From owner-svn-src-all@FreeBSD.ORG Sun Feb 24 02:04:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 90A77F8D; Sun, 24 Feb 2013 02:04:44 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-x233.google.com (mail-we0-x233.google.com [IPv6:2a00:1450:400c:c03::233]) by mx1.freebsd.org (Postfix) with ESMTP id 86B0DE64; Sun, 24 Feb 2013 02:04:43 +0000 (UTC) Received: by mail-we0-f179.google.com with SMTP id p43so1547446wea.24 for ; Sat, 23 Feb 2013 18:04:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=qcJIH6mBzvZPI07rc8M1/wwEmNi3L/E8HCxe0/pO3es=; b=ABqBr1awGL8YRzqvYczzyj9zMbKB/YreLHbu0+QCgSLOYc7Eo1UGg7tCrBLcsw4LJT K+2y/whS1oP+CL0M+DN+CgGfUXiA65rgsHbhK6TfZyXwthZSnOtfv+nEDEH/3IwEfmXD jn1e1eLggkJwU+IG9eZsiQdLK1VEnNUW92IonNyWIE/BBK7GY5PXsvIIVGuY3t48ATx/ vKK/8hAQOAXjUY3VFQTlefjIIcz4WBys7G/1nFBmLt/lHxo7DMp7ZIxgL4k8sFJqGdgl FNIZXlXR1OANwy9vjKDNjcKIU/MoC9kZL0IROFuuhbEoint3ryc7clD5AWzssbY8GiuP VlgQ== MIME-Version: 1.0 X-Received: by 10.194.90.168 with SMTP id bx8mr11224960wjb.59.1361671481927; Sat, 23 Feb 2013 18:04:41 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.74.194 with HTTP; Sat, 23 Feb 2013 18:04:41 -0800 (PST) In-Reply-To: <51294081.1060505@FreeBSD.org> References: <201302222240.r1MMeAsu042087@svn.freebsd.org> <20130222235332.GB2454@kib.kiev.ua> <5128AED6.2020906@FreeBSD.org> <20130223201857.GD2454@kib.kiev.ua> <51294081.1060505@FreeBSD.org> Date: Sat, 23 Feb 2013 18:04:41 -0800 X-Google-Sender-Auth: AysyGa2R7OPj6__8xDAFFHs5Sug Message-ID: Subject: Re: svn commit: r247166 - head/contrib/llvm/tools/clang/lib/Driver From: Adrian Chadd To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2013 02:04:44 -0000 Just curious about the OS detection - is the default platform detection based on the currently running OS, or the cross-built target OS? eg, if I were cross-compiling FreeBSD on (say) haiku, which has different CPU defaults, what would the default CPU output be? Adrian From owner-svn-src-all@FreeBSD.ORG Sun Feb 24 02:47:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1216B906; Sun, 24 Feb 2013 02:47:22 +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 E8285F5B; Sun, 24 Feb 2013 02:47:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1O2lLaj054558; Sun, 24 Feb 2013 02:47:21 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1O2lKun054548; Sun, 24 Feb 2013 02:47:20 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302240247.r1O2lKun054548@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 24 Feb 2013 02:47: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: r247209 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2013 02:47:22 -0000 Author: pfg Date: Sun Feb 24 02:47:19 2013 New Revision: 247209 URL: http://svnweb.freebsd.org/changeset/base/247209 Log: MFC r246563, r246564, r246634: ext2fs: Miscellaneous cleanups and fixes. make e2fs_maxcontig local and remove tautological check. Replace redundant EXT2_MIN_BLOCK with EXT2_MIN_BLOCK_SIZE. Use prototype declarations for function definitions Submitted by: Christoph Mallon 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_inode_cnv.c stable/9/sys/fs/ext2fs/ext2_lookup.c stable/9/sys/fs/ext2fs/ext2_subr.c stable/9/sys/fs/ext2fs/ext2_vfsops.c stable/9/sys/fs/ext2fs/ext2_vnops.c stable/9/sys/fs/ext2fs/ext2fs.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 Feb 23 23:22:48 2013 (r247208) +++ stable/9/sys/fs/ext2fs/ext2_alloc.c Sun Feb 24 02:47:19 2013 (r247209) @@ -80,12 +80,8 @@ static daddr_t ext2_mapsearch(struct m_ * available block is located. */ int -ext2_alloc(ip, lbn, bpref, size, cred, bnp) - struct inode *ip; - int32_t lbn, bpref; - int size; - struct ucred *cred; - int32_t *bnp; +ext2_alloc(struct inode *ip, int32_t lbn, int32_t bpref, int size, + struct ucred *cred, int32_t *bnp) { struct m_ext2fs *fs; struct ext2mount *ump; @@ -159,11 +155,7 @@ static int doreallocblks = 0; SYSCTL_INT(_vfs_ext2fs, OID_AUTO, doreallocblks, CTLFLAG_RW, &doreallocblks, 0, ""); int -ext2_reallocblks(ap) - struct vop_reallocblks_args /* { - struct vnode *a_vp; - struct cluster_save *a_buflist; - } */ *ap; +ext2_reallocblks(struct vop_reallocblks_args *ap) { struct m_ext2fs *fs; struct inode *ip; @@ -350,11 +342,7 @@ fail: * */ int -ext2_valloc(pvp, mode, cred, vpp) - struct vnode *pvp; - int mode; - struct ucred *cred; - struct vnode **vpp; +ext2_valloc(struct vnode *pvp, int mode, struct ucred *cred, struct vnode **vpp) { struct timespec ts; struct inode *pip; @@ -562,12 +550,8 @@ ext2_dirpref(struct inode *pip) * that will hold the pointer */ int32_t -ext2_blkpref(ip, lbn, indx, bap, blocknr) - struct inode *ip; - int32_t lbn; - int indx; - int32_t *bap; - int32_t blocknr; +ext2_blkpref(struct inode *ip, int32_t lbn, int indx, int32_t *bap, + int32_t blocknr) { int tmp; mtx_assert(EXT2_MTX(ip->i_ump), MA_OWNED); @@ -978,10 +962,7 @@ gotit: * */ void -ext2_blkfree(ip, bno, size) - struct inode *ip; - int32_t bno; - long size; +ext2_blkfree(struct inode *ip, int32_t bno, long size) { struct m_ext2fs *fs; struct buf *bp; @@ -1027,10 +1008,7 @@ ext2_blkfree(ip, bno, size) * */ int -ext2_vfree(pvp, ino, mode) - struct vnode *pvp; - ino_t ino; - int mode; +ext2_vfree(struct vnode *pvp, ino_t ino, int mode) { struct m_ext2fs *fs; struct inode *pip; @@ -1124,10 +1102,7 @@ ext2_mapsearch(struct m_ext2fs *fs, char * fs: error message */ static void -ext2_fserr(fs, uid, cp) - struct m_ext2fs *fs; - uid_t uid; - char *cp; +ext2_fserr(struct m_ext2fs *fs, uid_t uid, char *cp) { log(LOG_ERR, "uid %u on %s: %s\n", uid, fs->e2fs_fsmnt, cp); Modified: stable/9/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_balloc.c Sat Feb 23 23:22:48 2013 (r247208) +++ stable/9/sys/fs/ext2fs/ext2_balloc.c Sun Feb 24 02:47:19 2013 (r247209) @@ -55,13 +55,8 @@ * the inode and the logical block number in a file. */ int -ext2_balloc(ip, lbn, size, cred, bpp, flags) - struct inode *ip; - int32_t lbn; - int size; - struct ucred *cred; - struct buf **bpp; - int flags; +ext2_balloc(struct inode *ip, int32_t lbn, int size, struct ucred *cred, + struct buf **bpp, int flags) { struct m_ext2fs *fs; struct ext2mount *ump; Modified: stable/9/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_bmap.c Sat Feb 23 23:22:48 2013 (r247208) +++ stable/9/sys/fs/ext2fs/ext2_bmap.c Sun Feb 24 02:47:19 2013 (r247209) @@ -56,15 +56,7 @@ * number to index into the array of block pointers described by the dinode. */ int -ext2_bmap(ap) - struct vop_bmap_args /* { - struct vnode *a_vp; - daddr_t a_bn; - struct bufobj **a_bop; - daddr_t *a_bnp; - int *a_runp; - int *a_runb; - } */ *ap; +ext2_bmap(struct vop_bmap_args *ap) { int32_t blkno; int error; @@ -99,12 +91,7 @@ ext2_bmap(ap) */ int -ext2_bmaparray(vp, bn, bnp, runp, runb) - struct vnode *vp; - int32_t bn; - int32_t *bnp; - int *runp; - int *runb; +ext2_bmaparray(struct vnode *vp, int32_t bn, int32_t *bnp, int *runp, int *runb) { struct inode *ip; struct buf *bp; @@ -252,11 +239,7 @@ ext2_bmaparray(vp, bn, bnp, runp, runb) * once with the offset into the page itself. */ int -ext2_getlbns(vp, bn, ap, nump) - struct vnode *vp; - int32_t bn; - struct indir *ap; - int *nump; +ext2_getlbns(struct vnode *vp, int32_t bn, struct indir *ap, int *nump) { long blockcnt, metalbn, realbn; struct ext2mount *ump; Modified: stable/9/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_inode.c Sat Feb 23 23:22:48 2013 (r247208) +++ stable/9/sys/fs/ext2fs/ext2_inode.c Sun Feb 24 02:47:19 2013 (r247209) @@ -66,9 +66,7 @@ static int ext2_indirtrunc(struct inode * set, then wait for the write to complete. */ int -ext2_update(vp, waitfor) - struct vnode *vp; - int waitfor; +ext2_update(struct vnode *vp, int waitfor) { struct m_ext2fs *fs; struct buf *bp; @@ -108,12 +106,8 @@ ext2_update(vp, waitfor) * disk blocks. */ int -ext2_truncate(vp, length, flags, cred, td) - struct vnode *vp; - off_t length; - int flags; - struct ucred *cred; - struct thread *td; +ext2_truncate(struct vnode *vp, off_t length, int flags, struct ucred *cred, + struct thread *td) { struct vnode *ovp = vp; int32_t lastblock; @@ -361,12 +355,8 @@ done: */ static int -ext2_indirtrunc(ip, lbn, dbn, lastbn, level, countp) - struct inode *ip; - int32_t lbn, lastbn; - int32_t dbn; - int level; - long *countp; +ext2_indirtrunc(struct inode *ip, int32_t lbn, int32_t dbn, int32_t lastbn, + int level, long *countp) { struct buf *bp; struct m_ext2fs *fs = ip->i_e2fs; @@ -470,11 +460,7 @@ ext2_indirtrunc(ip, lbn, dbn, lastbn, le * discard preallocated blocks */ int -ext2_inactive(ap) - struct vop_inactive_args /* { - struct vnode *a_vp; - struct thread *a_td; - } */ *ap; +ext2_inactive(struct vop_inactive_args *ap) { struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); @@ -510,11 +496,7 @@ out: * Reclaim an inode so that it can be used for other purposes. */ int -ext2_reclaim(ap) - struct vop_reclaim_args /* { - struct vnode *a_vp; - struct thread *a_td; - } */ *ap; +ext2_reclaim(struct vop_reclaim_args *ap) { struct inode *ip; struct vnode *vp = ap->a_vp; Modified: stable/9/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_inode_cnv.c Sat Feb 23 23:22:48 2013 (r247208) +++ stable/9/sys/fs/ext2fs/ext2_inode_cnv.c Sun Feb 24 02:47:19 2013 (r247209) @@ -41,8 +41,7 @@ #define NSEC_TO_XTIME(t) (le32toh(t << 2) & EXT3_NSEC_MASK) void -ext2_print_inode( in ) - struct inode *in; +ext2_print_inode(struct inode *in) { int i; @@ -68,9 +67,7 @@ ext2_print_inode( in ) * raw ext2 inode to inode */ void -ext2_ei2i(ei, ip) - struct ext2fs_dinode *ei; - struct inode *ip; +ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) { int i; @@ -113,9 +110,7 @@ ext2_ei2i(ei, ip) * inode to raw ext2 inode */ void -ext2_i2ei(ip, ei) - struct inode *ip; - struct ext2fs_dinode *ei; +ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei) { int i; Modified: stable/9/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_lookup.c Sat Feb 23 23:22:48 2013 (r247208) +++ stable/9/sys/fs/ext2fs/ext2_lookup.c Sun Feb 24 02:47:19 2013 (r247209) @@ -129,12 +129,7 @@ static int ext2_lookup_ino(struct vnode * the whole buffer to uiomove */ int -ext2_readdir(ap) - struct vop_readdir_args /* { - struct vnode *a_vp; - struct uio *a_uio; - struct ucred *a_cred; - } */ *ap; +ext2_readdir(struct vop_readdir_args *ap) { struct uio *uio = ap->a_uio; int count, error; @@ -278,12 +273,7 @@ ext2_readdir(ap) * nor deleting, add name to cache */ int -ext2_lookup(ap) - struct vop_cachedlookup_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - } */ *ap; +ext2_lookup(struct vop_cachedlookup_args *ap) { return (ext2_lookup_ino(ap->a_dvp, ap->a_vpp, ap->a_cnp, NULL)); @@ -722,10 +712,7 @@ found: } void -ext2_dirbad(ip, offset, how) - struct inode *ip; - doff_t offset; - char *how; +ext2_dirbad(struct inode *ip, doff_t offset, char *how) { struct mount *mp; @@ -751,10 +738,8 @@ ext2_dirbad(ip, offset, how) * changed so that it confirms to ext2_check_dir_entry */ static int -ext2_dirbadentry(dp, de, entryoffsetinblock) - struct vnode *dp; - struct ext2fs_direct_2 *de; - int entryoffsetinblock; +ext2_dirbadentry(struct vnode *dp, struct ext2fs_direct_2 *de, + int entryoffsetinblock) { int DIRBLKSIZ = VTOI(dp)->i_e2fs->e2fs_bsize; @@ -791,10 +776,7 @@ ext2_dirbadentry(dp, de, entryoffsetinbl * entry is to be obtained. */ int -ext2_direnter(ip, dvp, cnp) - struct inode *ip; - struct vnode *dvp; - struct componentname *cnp; +ext2_direnter(struct inode *ip, struct vnode *dvp, struct componentname *cnp) { struct ext2fs_direct_2 *ep, *nep; struct inode *dp; @@ -944,9 +926,7 @@ ext2_direnter(ip, dvp, cnp) * to the size of the previous entry. */ int -ext2_dirremove(dvp, cnp) - struct vnode *dvp; - struct componentname *cnp; +ext2_dirremove(struct vnode *dvp, struct componentname *cnp) { struct inode *dp; struct ext2fs_direct_2 *ep, *rep; @@ -994,9 +974,7 @@ ext2_dirremove(dvp, cnp) * set up by a call to namei. */ int -ext2_dirrewrite(dp, ip, cnp) - struct inode *dp, *ip; - struct componentname *cnp; +ext2_dirrewrite(struct inode *dp, struct inode *ip, struct componentname *cnp) { struct buf *bp; struct ext2fs_direct_2 *ep; @@ -1027,10 +1005,7 @@ ext2_dirrewrite(dp, ip, cnp) * NB: does not handle corrupted directories. */ int -ext2_dirempty(ip, parentino, cred) - struct inode *ip; - ino_t parentino; - struct ucred *cred; +ext2_dirempty(struct inode *ip, ino_t parentino, struct ucred *cred) { off_t off; struct dirtemplate dbuf; @@ -1081,9 +1056,7 @@ ext2_dirempty(ip, parentino, cred) * The target is always vput before returning. */ int -ext2_checkpath(source, target, cred) - struct inode *source, *target; - struct ucred *cred; +ext2_checkpath(struct inode *source, struct inode *target, struct ucred *cred) { struct vnode *vp; int error, namlen; Modified: stable/9/sys/fs/ext2fs/ext2_subr.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_subr.c Sat Feb 23 23:22:48 2013 (r247208) +++ stable/9/sys/fs/ext2fs/ext2_subr.c Sun Feb 24 02:47:19 2013 (r247209) @@ -63,11 +63,7 @@ void ext2_checkoverlap(struct buf *, str * remaining space in the directory. */ int -ext2_blkatoff(vp, offset, res, bpp) - struct vnode *vp; - off_t offset; - char **res; - struct buf **bpp; +ext2_blkatoff(struct vnode *vp, off_t offset, char **res, struct buf **bpp) { struct inode *ip; struct m_ext2fs *fs; @@ -93,9 +89,7 @@ ext2_blkatoff(vp, offset, res, bpp) #ifdef KDB void -ext2_checkoverlap(bp, ip) - struct buf *bp; - struct inode *ip; +ext2_checkoverlap(struct buf *bp, struct inode *ip) { struct buf *ebp, *ep; int32_t start, last; Modified: stable/9/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_vfsops.c Sat Feb 23 23:22:48 2013 (r247208) +++ stable/9/sys/fs/ext2fs/ext2_vfsops.c Sun Feb 24 02:47:19 2013 (r247209) @@ -320,8 +320,8 @@ compute_sb_data(struct vnode *devvp, str struct buf *bp; uint32_t e2fs_descpb; - fs->e2fs_bsize = EXT2_MIN_BLOCK_SIZE << es->e2fs_log_bsize; fs->e2fs_bshift = EXT2_MIN_BLOCK_LOG_SIZE + es->e2fs_log_bsize; + fs->e2fs_bsize = 1U << fs->e2fs_bshift; fs->e2fs_fsbtodb = es->e2fs_log_bsize + 1; fs->e2fs_qbmask = fs->e2fs_bsize - 1; fs->e2fs_fsize = EXT2_MIN_FRAG_SIZE << es->e2fs_log_fsize; @@ -527,6 +527,7 @@ ext2_mountfs(struct vnode *devvp, struct int ronly; int i, size; int32_t *lp; + int32_t e2fs_maxcontig; ronly = vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0); /* XXX: use VOP_ACESS to check FS perms */ @@ -601,12 +602,8 @@ ext2_mountfs(struct vnode *devvp, struct * in ext2fs doesn't have these variables, so we can calculate * them here. */ - ump->um_e2fs->e2fs_maxcontig = MAX(1, MAXPHYS / ump->um_e2fs->e2fs_bsize); - if (ump->um_e2fs->e2fs_maxcontig > 0) - ump->um_e2fs->e2fs_contigsumsize = - MIN(ump->um_e2fs->e2fs_maxcontig, EXT2_MAXCONTIG); - else - ump->um_e2fs->e2fs_contigsumsize = 0; + e2fs_maxcontig = MAX(1, MAXPHYS / ump->um_e2fs->e2fs_bsize); + ump->um_e2fs->e2fs_contigsumsize = MIN(e2fs_maxcontig, EXT2_MAXCONTIG); if (ump->um_e2fs->e2fs_contigsumsize > 0) { size = ump->um_e2fs->e2fs_gcount * sizeof(int32_t); ump->um_e2fs->e2fs_maxcluster = malloc(size, M_EXT2MNT, M_WAITOK); Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_vnops.c Sat Feb 23 23:22:48 2013 (r247208) +++ stable/9/sys/fs/ext2fs/ext2_vnops.c Sun Feb 24 02:47:19 2013 (r247209) @@ -225,13 +225,7 @@ ext2_itimes(struct vnode *vp) * Create a regular file */ static int -ext2_create(ap) - struct vop_create_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; +ext2_create(struct vop_create_args *ap) { int error; @@ -244,13 +238,7 @@ ext2_create(ap) } static int -ext2_open(ap) - struct vop_open_args /* { - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +ext2_open(struct vop_open_args *ap) { if (ap->a_vp->v_type == VBLK || ap->a_vp->v_type == VCHR) @@ -274,13 +262,7 @@ ext2_open(ap) * Update the times on the inode. */ static int -ext2_close(ap) - struct vop_close_args /* { - struct vnode *a_vp; - int a_fflag; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +ext2_close(struct vop_close_args *ap) { struct vnode *vp = ap->a_vp; @@ -292,13 +274,7 @@ ext2_close(ap) } static int -ext2_access(ap) - struct vop_access_args /* { - struct vnode *a_vp; - accmode_t a_accmode; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +ext2_access(struct vop_access_args *ap) { struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); @@ -336,12 +312,7 @@ ext2_access(ap) } static int -ext2_getattr(ap) - struct vop_getattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - } */ *ap; +ext2_getattr(struct vop_getattr_args *ap) { struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); @@ -382,12 +353,7 @@ ext2_getattr(ap) * Set attribute vnode op. called from several syscalls */ static int -ext2_setattr(ap) - struct vop_setattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - } */ *ap; +ext2_setattr(struct vop_setattr_args *ap) { struct vattr *vap = ap->a_vap; struct vnode *vp = ap->a_vp; @@ -525,11 +491,7 @@ ext2_setattr(ap) * Inode must be locked before calling. */ static int -ext2_chmod(vp, mode, cred, td) - struct vnode *vp; - int mode; - struct ucred *cred; - struct thread *td; +ext2_chmod(struct vnode *vp, int mode, struct ucred *cred, struct thread *td) { struct inode *ip = VTOI(vp); int error; @@ -566,12 +528,8 @@ ext2_chmod(vp, mode, cred, td) * inode must be locked prior to call. */ static int -ext2_chown(vp, uid, gid, cred, td) - struct vnode *vp; - uid_t uid; - gid_t gid; - struct ucred *cred; - struct thread *td; +ext2_chown(struct vnode *vp, uid_t uid, gid_t gid, struct ucred *cred, + struct thread *td) { struct inode *ip = VTOI(vp); uid_t ouid; @@ -616,13 +574,7 @@ ext2_chown(vp, uid, gid, cred, td) */ /* ARGSUSED */ static int -ext2_fsync(ap) - struct vop_fsync_args /* { - struct vnode *a_vp; - struct ucred *a_cred; - int a_waitfor; - struct thread *a_td; - } */ *ap; +ext2_fsync(struct vop_fsync_args *ap) { /* * Flush all dirty buffers associated with a vnode. @@ -638,13 +590,7 @@ ext2_fsync(ap) */ /* ARGSUSED */ static int -ext2_mknod(ap) - struct vop_mknod_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; +ext2_mknod(struct vop_mknod_args *ap) { struct vattr *vap = ap->a_vap; struct vnode **vpp = ap->a_vpp; @@ -683,12 +629,7 @@ ext2_mknod(ap) } static int -ext2_remove(ap) - struct vop_remove_args /* { - struct vnode *a_dvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; +ext2_remove(struct vop_remove_args *ap) { struct inode *ip; struct vnode *vp = ap->a_vp; @@ -714,12 +655,7 @@ out: * link vnode call */ static int -ext2_link(ap) - struct vop_link_args /* { - struct vnode *a_tdvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; +ext2_link(struct vop_link_args *ap) { struct vnode *vp = ap->a_vp; struct vnode *tdvp = ap->a_tdvp; @@ -782,15 +718,7 @@ out: * directory. */ static int -ext2_rename(ap) - struct vop_rename_args /* { - struct vnode *a_fdvp; - struct vnode *a_fvp; - struct componentname *a_fcnp; - struct vnode *a_tdvp; - struct vnode *a_tvp; - struct componentname *a_tcnp; - } */ *ap; +ext2_rename(struct vop_rename_args *ap) { struct vnode *tvp = ap->a_tvp; struct vnode *tdvp = ap->a_tdvp; @@ -1145,13 +1073,7 @@ out: * Mkdir system call */ static int -ext2_mkdir(ap) - struct vop_mkdir_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; +ext2_mkdir(struct vop_mkdir_args *ap) { struct vnode *dvp = ap->a_dvp; struct vattr *vap = ap->a_vap; @@ -1282,12 +1204,7 @@ out: * Rmdir system call. */ static int -ext2_rmdir(ap) - struct vop_rmdir_args /* { - struct vnode *a_dvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; +ext2_rmdir(struct vop_rmdir_args *ap) { struct vnode *vp = ap->a_vp; struct vnode *dvp = ap->a_dvp; @@ -1355,14 +1272,7 @@ out: * symlink -- make a symbolic link */ static int -ext2_symlink(ap) - struct vop_symlink_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - char *a_target; - } */ *ap; +ext2_symlink(struct vop_symlink_args *ap) { struct vnode *vp, **vpp = ap->a_vpp; struct inode *ip; @@ -1392,12 +1302,7 @@ ext2_symlink(ap) * Return target name of a symbolic link */ static int -ext2_readlink(ap) - struct vop_readlink_args /* { - struct vnode *a_vp; - struct uio *a_uio; - struct ucred *a_cred; - } */ *ap; +ext2_readlink(struct vop_readlink_args *ap) { struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); @@ -1419,11 +1324,7 @@ ext2_readlink(ap) * deadlock on memory. See ext2_bmap() for details. */ static int -ext2_strategy(ap) - struct vop_strategy_args /* { - struct vnode *a_vp; - struct buf *a_bp; - } */ *ap; +ext2_strategy(struct vop_strategy_args *ap) { struct buf *bp = ap->a_bp; struct vnode *vp = ap->a_vp; @@ -1461,10 +1362,7 @@ ext2_strategy(ap) * Print out the contents of an inode. */ static int -ext2_print(ap) - struct vop_print_args /* { - struct vnode *a_vp; - } */ *ap; +ext2_print(struct vop_print_args *ap) { struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); @@ -1482,13 +1380,7 @@ ext2_print(ap) * Update the times on the inode then do device close. */ static int -ext2fifo_close(ap) - struct vop_close_args /* { - struct vnode *a_vp; - int a_fflag; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +ext2fifo_close(struct vop_close_args *ap) { struct vnode *vp = ap->a_vp; @@ -1505,8 +1397,7 @@ ext2fifo_close(ap) * Fall through to ext2 kqfilter routines if needed */ static int -ext2fifo_kqfilter(ap) - struct vop_kqfilter_args *ap; +ext2fifo_kqfilter(struct vop_kqfilter_args *ap) { int error; @@ -1520,12 +1411,7 @@ ext2fifo_kqfilter(ap) * Return POSIX pathconf information applicable to ext2 filesystems. */ static int -ext2_pathconf(ap) - struct vop_pathconf_args /* { - struct vnode *a_vp; - int a_name; - int *a_retval; - } */ *ap; +ext2_pathconf(struct vop_pathconf_args *ap) { switch (ap->a_name) { @@ -1558,11 +1444,7 @@ ext2_pathconf(ap) */ /* ARGSUSED */ static int -ext2_vptofh(ap) - struct vop_vptofh_args /* { - struct vnode *a_vp; - struct fid *a_fhp; - } */ *ap; +ext2_vptofh(struct vop_vptofh_args *ap) { struct inode *ip; struct ufid *ufhp; @@ -1580,10 +1462,7 @@ ext2_vptofh(ap) * vnodes. */ int -ext2_vinit(mntp, fifoops, vpp) - struct mount *mntp; - struct vop_vector *fifoops; - struct vnode **vpp; +ext2_vinit(struct mount *mntp, struct vop_vector *fifoops, struct vnode **vpp) { struct inode *ip; struct vnode *vp; @@ -1605,11 +1484,8 @@ ext2_vinit(mntp, fifoops, vpp) * Allocate a new inode. */ static int -ext2_makeinode(mode, dvp, vpp, cnp) - int mode; - struct vnode *dvp; - struct vnode **vpp; - struct componentname *cnp; +ext2_makeinode(int mode, struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp) { struct inode *ip, *pdir; struct vnode *tvp; @@ -1692,13 +1568,7 @@ bad: * Vnode op for reading. */ static int -ext2_read(ap) - struct vop_read_args /* { - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; - } */ *ap; +ext2_read(struct vop_read_args *ap) { struct vnode *vp; struct inode *ip; @@ -1841,13 +1711,7 @@ ext2_read(ap) * Vnode op for writing. */ static int -ext2_write(ap) - struct vop_write_args /* { - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; - } */ *ap; +ext2_write(struct vop_write_args *ap) { struct vnode *vp; struct uio *uio; Modified: stable/9/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2fs.h Sat Feb 23 23:22:48 2013 (r247208) +++ stable/9/sys/fs/ext2fs/ext2fs.h Sun Feb 24 02:47:19 2013 (r247209) @@ -170,7 +170,6 @@ struct m_ext2fs { char e2fs_wasvalid; /* valid at mount time */ off_t e2fs_maxfilesize; struct ext2_gd *e2fs_gd; /* Group Descriptors */ - int32_t e2fs_maxcontig; /* max number of contiguous blks */ int32_t e2fs_contigsumsize; /* size of cluster summary array */ int32_t *e2fs_maxcluster; /* max cluster in each cyl group */ struct csum *e2fs_clustersum; /* cluster summary in each cyl group */ @@ -304,7 +303,6 @@ struct csum { /* * Macro-instructions used to manage several block sizes */ -#define EXT2_MIN_BLOCK_SIZE 1024 #define EXT2_MAX_BLOCK_SIZE 4096 #define EXT2_MIN_BLOCK_LOG_SIZE 10 #define EXT2_BLOCK_SIZE(s) ((s)->e2fs_bsize) From owner-svn-src-all@FreeBSD.ORG Sun Feb 24 05:49:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5DA79FFC; Sun, 24 Feb 2013 05:49:00 +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 3827415FE; Sun, 24 Feb 2013 05:49:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1O5mxqt009553; Sun, 24 Feb 2013 05:48:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1O5mxGH009552; Sun, 24 Feb 2013 05:48:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302240548.r1O5mxGH009552@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 24 Feb 2013 05:48: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: r247211 - stable/9/sys/ufs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2013 05:49:00 -0000 Author: kib Date: Sun Feb 24 05:48:59 2013 New Revision: 247211 URL: http://svnweb.freebsd.org/changeset/base/247211 Log: MFC r246612: Fix several unsafe pointer dereferences in the buffered_write() function. Modified: stable/9/sys/ufs/ffs/ffs_alloc.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_alloc.c Sun Feb 24 03:15:43 2013 (r247210) +++ stable/9/sys/ufs/ffs/ffs_alloc.c Sun Feb 24 05:48:59 2013 (r247211) @@ -2853,10 +2853,11 @@ buffered_write(fp, uio, active_cred, fla int flags; struct thread *td; { - struct vnode *devvp; + struct vnode *devvp, *vp; struct inode *ip; struct buf *bp; struct fs *fs; + struct filedesc *fdp; int error, vfslocked; daddr_t lbn; @@ -2867,12 +2868,34 @@ buffered_write(fp, uio, active_cred, fla * within the filesystem being written. Yes, this is an ugly hack. */ devvp = fp->f_vnode; - ip = VTOI(td->td_proc->p_fd->fd_cdir); - if (ip->i_devvp != devvp) + if (!vn_isdisk(devvp, NULL)) return (EINVAL); + fdp = td->td_proc->p_fd; + FILEDESC_SLOCK(fdp); + vp = fdp->fd_cdir; + vref(vp); + FILEDESC_SUNLOCK(fdp); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vn_lock(vp, LK_SHARED | LK_RETRY); + /* + * Check that the current directory vnode indeed belongs to + * UFS before trying to dereference UFS-specific v_data fields. + */ + if (vp->v_op != &ffs_vnodeops1 && vp->v_op != &ffs_vnodeops2) { + vput(vp); + VFS_UNLOCK_GIANT(vfslocked); + return (EINVAL); + } + ip = VTOI(vp); + if (ip->i_devvp != devvp) { + vput(vp); + VFS_UNLOCK_GIANT(vfslocked); + return (EINVAL); + } fs = ip->i_fs; + vput(vp); + VFS_UNLOCK_GIANT(vfslocked); foffset_lock_uio(fp, uio, flags); - vfslocked = VFS_LOCK_GIANT(ip->i_vnode->v_mount); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); #ifdef DEBUG if (fsckcmds) { @@ -2900,7 +2923,6 @@ buffered_write(fp, uio, active_cred, fla error = bwrite(bp); out: VOP_UNLOCK(devvp, 0); - VFS_UNLOCK_GIANT(vfslocked); foffset_unlock_uio(fp, uio, flags | FOF_NEXTOFF); return (error); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 24 06:44:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ABB4A9C5; Sun, 24 Feb 2013 06:44:31 +0000 (UTC) (envelope-from mckusick@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 8608F170C; Sun, 24 Feb 2013 06:44:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1O6iV5f026862; Sun, 24 Feb 2013 06:44:31 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1O6iU12026849; Sun, 24 Feb 2013 06:44:30 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201302240644.r1O6iU12026849@svn.freebsd.org> From: Kirk McKusick Date: Sun, 24 Feb 2013 06:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247212 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2013 06:44:31 -0000 Author: mckusick Date: Sun Feb 24 06:44:29 2013 New Revision: 247212 URL: http://svnweb.freebsd.org/changeset/base/247212 Log: When running with the -d option, instrument fsck_ffs to track the number, data type, and running time of its I/O operations. No functional changes. Modified: head/sbin/fsck_ffs/dir.c head/sbin/fsck_ffs/ea.c head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/main.c head/sbin/fsck_ffs/setup.c Modified: head/sbin/fsck_ffs/dir.c ============================================================================== --- head/sbin/fsck_ffs/dir.c Sun Feb 24 05:48:59 2013 (r247211) +++ head/sbin/fsck_ffs/dir.c Sun Feb 24 06:44:29 2013 (r247212) @@ -708,6 +708,6 @@ getdirblk(ufs2_daddr_t blkno, long size) if (pdirbp != 0) pdirbp->b_flags &= ~B_INUSE; - pdirbp = getdatablk(blkno, size); + pdirbp = getdatablk(blkno, size, BT_DIRDATA); return (pdirbp); } Modified: head/sbin/fsck_ffs/ea.c ============================================================================== --- head/sbin/fsck_ffs/ea.c Sun Feb 24 05:48:59 2013 (r247211) +++ head/sbin/fsck_ffs/ea.c Sun Feb 24 06:44:29 2013 (r247212) @@ -73,7 +73,7 @@ eascan(struct inodesc *idesc, struct ufs else blksiz = sblock.fs_bsize; printf("blksiz = %ju\n", (intmax_t)blksiz); - bp = getdatablk(dp->di_extb[0], blksiz); + bp = getdatablk(dp->di_extb[0], blksiz, BT_EXTATTR); cp = (u_char *)bp->b_un.b_buf; for (n = 0; n < blksiz; n++) { printf("%02x", cp[n]); Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Sun Feb 24 05:48:59 2013 (r247211) +++ head/sbin/fsck_ffs/fsck.h Sun Feb 24 06:44:29 2013 (r247212) @@ -138,6 +138,7 @@ struct bufarea { int b_size; int b_errs; int b_flags; + int b_type; union { char *b_buf; /* buffer space */ ufs1_daddr_t *b_indir1; /* UFS1 indirect block */ @@ -165,6 +166,36 @@ struct bufarea { * Buffer flags */ #define B_INUSE 0x00000001 /* Buffer is in use */ +/* + * Type of data in buffer + */ +#define BT_UNKNOWN 0 /* Buffer holds a superblock */ +#define BT_SUPERBLK 1 /* Buffer holds a superblock */ +#define BT_CYLGRP 2 /* Buffer holds a cylinder group map */ +#define BT_LEVEL1 3 /* Buffer holds single level indirect */ +#define BT_LEVEL2 4 /* Buffer holds double level indirect */ +#define BT_LEVEL3 5 /* Buffer holds triple level indirect */ +#define BT_EXTATTR 6 /* Buffer holds external attribute data */ +#define BT_INODES 7 /* Buffer holds external attribute data */ +#define BT_DIRDATA 8 /* Buffer holds directory data */ +#define BT_DATA 9 /* Buffer holds user data */ +#define BT_NUMBUFTYPES 10 +#define BT_NAMES { \ + "unknown", \ + "Superblock", \ + "Cylinder Group", \ + "Single Level Indirect", \ + "Double Level Indirect", \ + "Triple Level Indirect", \ + "External Attribute", \ + "Inode Block", \ + "Directory Contents", \ + "User Data" } +long readcnt[BT_NUMBUFTYPES]; +long totalreadcnt[BT_NUMBUFTYPES]; +struct timespec readtime[BT_NUMBUFTYPES]; +struct timespec totalreadtime[BT_NUMBUFTYPES]; +struct timespec startprog; struct bufarea sblk; /* file system superblock */ struct bufarea cgblk; /* cylinder group blocks */ @@ -177,10 +208,11 @@ struct bufarea *pbp; /* current inode b else \ (bp)->b_dirty = 1; \ } while (0) -#define initbarea(bp) do { \ +#define initbarea(bp, type) do { \ (bp)->b_dirty = 0; \ (bp)->b_bno = (ufs2_daddr_t)-1; \ (bp)->b_flags = 0; \ + (bp)->b_type = type; \ } while (0) #define sbdirty() dirty(&sblk) @@ -357,6 +389,7 @@ int dirscan(struct inodesc *); int dofix(struct inodesc *, const char *msg); int eascan(struct inodesc *, struct ufs2_dinode *dp); void fileerror(ino_t cwd, ino_t ino, const char *errmesg); +void finalIOstats(void); int findino(struct inodesc *); int findname(struct inodesc *); void flush(int fd, struct bufarea *bp); @@ -365,7 +398,7 @@ void freeino(ino_t ino); void freeinodebuf(void); int ftypeok(union dinode *dp); void getblk(struct bufarea *bp, ufs2_daddr_t blk, long size); -struct bufarea *getdatablk(ufs2_daddr_t blkno, long size); +struct bufarea *getdatablk(ufs2_daddr_t blkno, long size, int type); struct inoinfo *getinoinfo(ino_t inumber); union dinode *getnextinode(ino_t inumber, int rebuildcg); void getpathname(char *namebuf, ino_t curdir, ino_t ino); @@ -375,6 +408,7 @@ void alarmhandler(int sig); void inocleanup(void); void inodirty(void); struct inostat *inoinfo(ino_t inum); +void IOstats(char *what); int linkup(ino_t orphan, ino_t parentdir, char *name); int makeentry(ino_t parent, ino_t ino, const char *name); void panic(const char *fmt, ...) __printflike(1, 2); Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Sun Feb 24 05:48:59 2013 (r247211) +++ head/sbin/fsck_ffs/fsutil.c Sun Feb 24 06:44:29 2013 (r247212) @@ -56,19 +56,23 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "fsck.h" static void slowio_start(void); static void slowio_end(void); +static void printIOstats(void); -long diskreads, totalreads; /* Disk cache statistics */ +static long diskreads, totaldiskreads, totalreads; /* Disk cache statistics */ +static struct timespec startpass, finishpass; struct timeval slowio_starttime; int slowio_delay_usec = 10000; /* Initial IO delay for background fsck */ int slowio_pollcnt; static TAILQ_HEAD(buflist, bufarea) bufhead; /* head of buffer cache list */ static int numbufs; /* size of buffer cache */ +static char *buftype[BT_NUMBUFTYPES] = BT_NAMES; int ftypeok(union dinode *dp) @@ -163,7 +167,7 @@ bufinit(void) if (bufp == 0) errx(EEXIT, "cannot allocate buffer pool"); cgblk.b_un.b_buf = bufp; - initbarea(&cgblk); + initbarea(&cgblk, BT_CYLGRP); TAILQ_INIT(&bufhead); bufcnt = MAXBUFS; if (bufcnt < MINBUFS) @@ -178,16 +182,21 @@ bufinit(void) } bp->b_un.b_buf = bufp; TAILQ_INSERT_HEAD(&bufhead, bp, b_list); - initbarea(bp); + initbarea(bp, BT_UNKNOWN); } numbufs = i; /* save number of buffers */ + for (i = 0; i < BT_NUMBUFTYPES; i++) { + readtime[i].tv_sec = totalreadtime[i].tv_sec = 0; + readtime[i].tv_nsec = totalreadtime[i].tv_nsec = 0; + readcnt[i] = totalreadcnt[i] = 0; + } } /* * Manage a cache of directory blocks. */ struct bufarea * -getdatablk(ufs2_daddr_t blkno, long size) +getdatablk(ufs2_daddr_t blkno, long size, int type) { struct bufarea *bp; @@ -199,26 +208,62 @@ getdatablk(ufs2_daddr_t blkno, long size break; if (bp == NULL) errx(EEXIT, "deadlocked buffer pool"); + bp->b_type = type; getblk(bp, blkno, size); /* fall through */ foundit: + if (debug && bp->b_type != type) + printf("Buffer type changed from %s to %s\n", + buftype[bp->b_type], buftype[type]); TAILQ_REMOVE(&bufhead, bp, b_list); TAILQ_INSERT_HEAD(&bufhead, bp, b_list); bp->b_flags |= B_INUSE; return (bp); } +/* + * Timespec operations (from ). + */ +#define timespecsub(vvp, uvp) \ + do { \ + (vvp)->tv_sec -= (uvp)->tv_sec; \ + (vvp)->tv_nsec -= (uvp)->tv_nsec; \ + if ((vvp)->tv_nsec < 0) { \ + (vvp)->tv_sec--; \ + (vvp)->tv_nsec += 1000000000; \ + } \ + } while (0) +#define timespecadd(vvp, uvp) \ + do { \ + (vvp)->tv_sec += (uvp)->tv_sec; \ + (vvp)->tv_nsec += (uvp)->tv_nsec; \ + if ((vvp)->tv_nsec >= 1000000000) { \ + (vvp)->tv_sec++; \ + (vvp)->tv_nsec -= 1000000000; \ + } \ + } while (0) + void getblk(struct bufarea *bp, ufs2_daddr_t blk, long size) { ufs2_daddr_t dblk; + struct timespec start, finish; - totalreads++; dblk = fsbtodb(&sblock, blk); - if (bp->b_bno != dblk) { + if (bp->b_bno == dblk) { + totalreads++; + } else { flush(fswritefd, bp); - diskreads++; + if (debug) { + readcnt[bp->b_type]++; + clock_gettime(CLOCK_REALTIME_PRECISE, &start); + } bp->b_errs = blread(fsreadfd, bp->b_un.b_buf, dblk, size); + if (debug) { + clock_gettime(CLOCK_REALTIME_PRECISE, &finish); + timespecsub(&finish, &start); + timespecadd(&readtime[bp->b_type], &finish); + } bp->b_bno = dblk; bp->b_size = size; } @@ -292,8 +337,8 @@ ckfini(int markclean) } if (debug && totalreads > 0) printf("cache with %d buffers missed %ld of %ld (%d%%)\n", - numbufs, diskreads, totalreads, - (int)(diskreads * 100 / totalreads)); + numbufs, totaldiskreads, totalreads, + (int)(totaldiskreads * 100 / totalreads)); if (fswritefd < 0) { (void)close(fsreadfd); return; @@ -347,6 +392,82 @@ ckfini(int markclean) (void)close(fswritefd); } +/* + * Print out I/O statistics. + */ +void +IOstats(char *what) +{ + int i; + + if (debug == 0) + return; + if (diskreads == 0) { + printf("%s: no I/O\n\n", what); + return; + } + if (startpass.tv_sec == 0) + startpass = startprog; + printf("%s: I/O statistics\n", what); + printIOstats(); + totaldiskreads += diskreads; + diskreads = 0; + for (i = 0; i < BT_NUMBUFTYPES; i++) { + timespecadd(&totalreadtime[i], &readtime[i]); + totalreadcnt[i] += readcnt[i]; + readtime[i].tv_sec = readtime[i].tv_nsec = 0; + readcnt[i] = 0; + } + clock_gettime(CLOCK_REALTIME_PRECISE, &startpass); +} + +void +finalIOstats(void) +{ + int i; + + if (debug == 0) + return; + printf("Final I/O statistics\n"); + totaldiskreads += diskreads; + diskreads = totaldiskreads; + startpass = startprog; + for (i = 0; i < BT_NUMBUFTYPES; i++) { + timespecadd(&totalreadtime[i], &readtime[i]); + totalreadcnt[i] += readcnt[i]; + readtime[i] = totalreadtime[i]; + readcnt[i] = totalreadcnt[i]; + } + printIOstats(); +} + +static void printIOstats(void) +{ + long long msec, totalmsec; + int i; + + clock_gettime(CLOCK_REALTIME_PRECISE, &finishpass); + timespecsub(&finishpass, &startpass); + printf("Running time: %ld msec\n", + finishpass.tv_sec * 1000 + finishpass.tv_nsec / 1000000); + printf("buffer reads by type:\n"); + for (totalmsec = 0, i = 0; i < BT_NUMBUFTYPES; i++) + totalmsec += readtime[i].tv_sec * 1000 + + readtime[i].tv_nsec / 1000000; + if (totalmsec == 0) + totalmsec = 1; + for (i = 0; i < BT_NUMBUFTYPES; i++) { + if (readcnt[i] == 0) + continue; + msec = readtime[i].tv_sec * 1000 + readtime[i].tv_nsec / 1000000; + printf("%21s:%8ld %2ld.%ld%% %8lld msec %2lld.%lld%%\n", + buftype[i], readcnt[i], readcnt[i] * 100 / diskreads, + (readcnt[i] * 1000 / diskreads) % 10, msec, + msec * 100 / totalmsec, (msec * 1000 / totalmsec) % 10); + } + printf("\n"); +} + int blread(int fd, char *buf, ufs2_daddr_t blk, long size) { @@ -358,6 +479,8 @@ blread(int fd, char *buf, ufs2_daddr_t b offset *= dev_bsize; if (bkgrdflag) slowio_start(); + totalreads++; + diskreads++; if (lseek(fd, offset, 0) < 0) rwerror("SEEK BLK", blk); else if (read(fd, buf, (int)size) == size) { Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Sun Feb 24 05:48:59 2013 (r247211) +++ head/sbin/fsck_ffs/inode.c Sun Feb 24 06:44:29 2013 (r247212) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); static ino_t startinum; -static int iblock(struct inodesc *, long ilevel, off_t isize); +static int iblock(struct inodesc *, long ilevel, off_t isize, int type); int ckinode(union dinode *dp, struct inodesc *idesc) @@ -121,7 +121,7 @@ ckinode(union dinode *dp, struct inodesc sizepb *= NINDIR(&sblock); if (DIP(&dino, di_ib[i])) { idesc->id_blkno = DIP(&dino, di_ib[i]); - ret = iblock(idesc, i + 1, remsize); + ret = iblock(idesc, i + 1, remsize, BT_LEVEL1 + i); if (ret & STOP) return (ret); } else { @@ -151,7 +151,7 @@ ckinode(union dinode *dp, struct inodesc } static int -iblock(struct inodesc *idesc, long ilevel, off_t isize) +iblock(struct inodesc *idesc, long ilevel, off_t isize, int type) { struct bufarea *bp; int i, n, (*func)(struct inodesc *), nif; @@ -168,7 +168,7 @@ iblock(struct inodesc *idesc, long ileve func = dirscan; if (chkrange(idesc->id_blkno, idesc->id_numfrags)) return (SKIP); - bp = getdatablk(idesc->id_blkno, sblock.fs_bsize); + bp = getdatablk(idesc->id_blkno, sblock.fs_bsize, type); ilevel--; for (sizepb = sblock.fs_bsize, i = 0; i < ilevel; i++) sizepb *= NINDIR(&sblock); @@ -199,7 +199,7 @@ iblock(struct inodesc *idesc, long ileve if (ilevel == 0) n = (*func)(idesc); else - n = iblock(idesc, ilevel, isize); + n = iblock(idesc, ilevel, isize, type); if (n & STOP) { bp->b_flags &= ~B_INUSE; return (n); @@ -292,7 +292,7 @@ ginode(ino_t inumber) iblk = ino_to_fsba(&sblock, inumber); if (pbp != 0) pbp->b_flags &= ~B_INUSE; - pbp = getdatablk(iblk, sblock.fs_bsize); + pbp = getdatablk(iblk, sblock.fs_bsize, BT_INODES); startinum = (inumber / INOPB(&sblock)) * INOPB(&sblock); } if (sblock.fs_magic == FS_UFS1_MAGIC) @@ -306,8 +306,8 @@ ginode(ino_t inumber) * over all the inodes in numerical order. */ static ino_t nextino, lastinum, lastvalidinum; -static long readcnt, readpercg, fullcnt, inobufsize, partialcnt, partialsize; -static caddr_t inodebuf; +static long readcount, readpercg, fullcnt, inobufsize, partialcnt, partialsize; +static struct bufarea inobuf; union dinode * getnextinode(ino_t inumber, int rebuildcg) @@ -315,7 +315,7 @@ getnextinode(ino_t inumber, int rebuildc int j; long size; mode_t mode; - ufs2_daddr_t ndb, dblk; + ufs2_daddr_t ndb, blk; union dinode *dp; static caddr_t nextinop; @@ -323,9 +323,9 @@ getnextinode(ino_t inumber, int rebuildc errx(EEXIT, "bad inode number %ju to nextinode", (uintmax_t)inumber); if (inumber >= lastinum) { - readcnt++; - dblk = fsbtodb(&sblock, ino_to_fsba(&sblock, lastinum)); - if (readcnt % readpercg == 0) { + readcount++; + blk = ino_to_fsba(&sblock, lastinum); + if (readcount % readpercg == 0) { size = partialsize; lastinum += partialcnt; } else { @@ -333,14 +333,14 @@ getnextinode(ino_t inumber, int rebuildc lastinum += fullcnt; } /* - * If blread returns an error, it will already have zeroed + * If getblk encounters an error, it will already have zeroed * out the buffer, so we do not need to do so here. */ - (void)blread(fsreadfd, inodebuf, dblk, size); - nextinop = inodebuf; + getblk(&inobuf, blk, size); + nextinop = inobuf.b_un.b_buf; } dp = (union dinode *)nextinop; - if (rebuildcg && nextinop == inodebuf) { + if (rebuildcg && nextinop == inobuf.b_un.b_buf) { /* * Try to determine if we have reached the end of the * allocated inodes. @@ -406,8 +406,8 @@ setinodebuf(ino_t inum) startinum = 0; nextino = inum; lastinum = inum; - readcnt = 0; - if (inodebuf != NULL) + readcount = 0; + if (inobuf.b_un.b_buf != NULL) return; inobufsize = blkroundup(&sblock, INOBUFSIZE); fullcnt = inobufsize / ((sblock.fs_magic == FS_UFS1_MAGIC) ? @@ -422,7 +422,8 @@ setinodebuf(ino_t inum) partialcnt = fullcnt; partialsize = inobufsize; } - if ((inodebuf = malloc((unsigned)inobufsize)) == NULL) + initbarea(&inobuf, BT_INODES); + if ((inobuf.b_un.b_buf = malloc((unsigned)inobufsize)) == NULL) errx(EEXIT, "cannot allocate space for inode buffer"); } @@ -430,9 +431,9 @@ void freeinodebuf(void) { - if (inodebuf != NULL) - free((char *)inodebuf); - inodebuf = NULL; + if (inobuf.b_un.b_buf != NULL) + free((char *)inobuf.b_un.b_buf); + inobuf.b_un.b_buf = NULL; } /* Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Sun Feb 24 05:48:59 2013 (r247211) +++ head/sbin/fsck_ffs/main.c Sun Feb 24 06:44:29 2013 (r247212) @@ -424,7 +424,9 @@ checkfilesys(char *filesys) printf("** Root file system\n"); printf("** Phase 1 - Check Blocks and Sizes\n"); } + clock_gettime(CLOCK_REALTIME_PRECISE, &startprog); pass1(); + IOstats("Pass1"); /* * 1b: locate first references to duplicates, if any @@ -437,6 +439,7 @@ checkfilesys(char *filesys) usedsoftdep ? "softupdates" : ""); printf("** Phase 1b - Rescan For More DUPS\n"); pass1b(); + IOstats("Pass1b"); } /* @@ -445,6 +448,7 @@ checkfilesys(char *filesys) if (preen == 0) printf("** Phase 2 - Check Pathnames\n"); pass2(); + IOstats("Pass2"); /* * 3: scan inodes looking for disconnected directories @@ -452,6 +456,7 @@ checkfilesys(char *filesys) if (preen == 0) printf("** Phase 3 - Check Connectivity\n"); pass3(); + IOstats("Pass3"); /* * 4: scan inodes looking for disconnected files; check reference counts @@ -459,6 +464,7 @@ checkfilesys(char *filesys) if (preen == 0) printf("** Phase 4 - Check Reference Counts\n"); pass4(); + IOstats("Pass4"); /* * 5: check and repair resource counts in cylinder groups @@ -466,6 +472,7 @@ checkfilesys(char *filesys) if (preen == 0) printf("** Phase 5 - Check Cyl groups\n"); pass5(); + IOstats("Pass5"); /* * print out summary statistics @@ -519,6 +526,7 @@ checkfilesys(char *filesys) } if (rerun) resolved = 0; + finalIOstats(); /* * Check to see if the file system is mounted read-write. Modified: head/sbin/fsck_ffs/setup.c ============================================================================== --- head/sbin/fsck_ffs/setup.c Sun Feb 24 05:48:59 2013 (r247211) +++ head/sbin/fsck_ffs/setup.c Sun Feb 24 06:44:29 2013 (r247212) @@ -249,6 +249,7 @@ setup(char *dev) for (i = 0, j = 0; i < sblock.fs_cssize; i += sblock.fs_bsize, j++) { size = sblock.fs_cssize - i < sblock.fs_bsize ? sblock.fs_cssize - i : sblock.fs_bsize; + readcnt[sblk.b_type]++; if (blread(fsreadfd, (char *)sblock.fs_csp + i, fsbtodb(&sblock, sblock.fs_csaddr + j * sblock.fs_frag), size) != 0 && !asked) { @@ -322,6 +323,7 @@ readsb(int listerr) if (bflag) { super = bflag; + readcnt[sblk.b_type]++; if ((blread(fsreadfd, (char *)&sblock, super, (long)SBLOCKSIZE))) return (0); if (sblock.fs_magic == FS_BAD_MAGIC) { @@ -337,6 +339,7 @@ readsb(int listerr) } else { for (i = 0; sblock_try[i] != -1; i++) { super = sblock_try[i] / dev_bsize; + readcnt[sblk.b_type]++; if ((blread(fsreadfd, (char *)&sblock, super, (long)SBLOCKSIZE))) return (0); @@ -439,8 +442,8 @@ sblock_init(void) fswritefd = -1; fsmodified = 0; lfdir = 0; - initbarea(&sblk); - initbarea(&asblk); + initbarea(&sblk, BT_SUPERBLK); + initbarea(&asblk, BT_SUPERBLK); sblk.b_un.b_buf = malloc(SBLOCKSIZE); asblk.b_un.b_buf = malloc(SBLOCKSIZE); if (sblk.b_un.b_buf == NULL || asblk.b_un.b_buf == NULL) From owner-svn-src-all@FreeBSD.ORG Sun Feb 24 15:15:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5EF4DC4E; Sun, 24 Feb 2013 15:15:51 +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 422DE689; Sun, 24 Feb 2013 15:15:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1OFFpPW079550; Sun, 24 Feb 2013 15:15:51 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1OFFpWh079548; Sun, 24 Feb 2013 15:15:51 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201302241515.r1OFFpWh079548@svn.freebsd.org> From: Mark Johnston Date: Sun, 24 Feb 2013 15:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247221 - head/lib/libelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2013 15:15:51 -0000 Author: markj Date: Sun Feb 24 15:15:50 2013 New Revision: 247221 URL: http://svnweb.freebsd.org/changeset/base/247221 Log: Merge part of r1712 from elftoolchain, making it possible to resize ELF sections and indirectly change the layout of an ELF file when ELF_F_LAYOUT is not set. PR: bin/167103 Approved by: rstone (co-mentor) Obtained from: elftoolchain MFC after: 2 weeks Modified: head/lib/libelf/elf_update.c Modified: head/lib/libelf/elf_update.c ============================================================================== --- head/lib/libelf/elf_update.c Sun Feb 24 11:32:45 2013 (r247220) +++ head/lib/libelf/elf_update.c Sun Feb 24 15:15:50 2013 (r247221) @@ -41,89 +41,79 @@ __FBSDID("$FreeBSD$"); #include "_libelf.h" /* - * Update the internal data structures associated with an ELF object. - * Returns the size in bytes the ELF object would occupy in its file - * representation. + * Layout strategy: * - * After a successful call to this function, the following structures - * are updated: + * - Case 1: ELF_F_LAYOUT is asserted + * In this case the application has full control over where the + * section header table, program header table, and section data + * will reside. The library only perform error checks. * - * - The ELF header is updated. - * - All sections are sorted in order of ascending addresses and their - * section header table entries updated. An error is signalled - * if an overlap was detected among sections. - * - All data descriptors associated with a section are sorted in order - * of ascending addresses. Overlaps, if detected, are signalled as - * errors. Other sanity checks for alignments, section types etc. are - * made. + * - Case 2: ELF_F_LAYOUT is not asserted * - * After a resync_elf() successfully returns, the ELF descriptor is - * ready for being handed over to _libelf_write_elf(). + * The library will do the object layout using the following + * ordering: + * - The executable header is placed first, are required by the + * ELF specification. + * - The program header table is placed immediately following the + * executable header. + * - Section data, if any, is placed after the program header + * table, aligned appropriately. + * - The section header table, if needed, is placed last. * - * File alignments: - * PHDR - Addr - * SHDR - Addr + * There are two sub-cases to be taken care of: * - * XXX: how do we handle 'flags'. + * - Case 2a: e->e_cmd == ELF_C_READ or ELF_C_RDWR + * + * In this sub-case, the underlying ELF object may already have + * content in it, which the application may have modified. The + * library will retrieve content from the existing object as + * needed. + * + * - Case 2b: e->e_cmd == ELF_C_WRITE + * + * The ELF object is being created afresh in this sub-case; + * there is no pre-existing content in the underlying ELF + * object. */ /* * Compute the extents of a section, by looking at the data - * descriptors associated with it. The function returns zero if an - * error was detected. `*rc' holds the maximum file extent seen so - * far. + * descriptors associated with it. The function returns 1 if + * successful, or zero if an error was detected. */ static int -_libelf_compute_section_extents(Elf *e, Elf_Scn *s, off_t *rc) +_libelf_compute_section_extents(Elf *e, Elf_Scn *s, off_t rc) { int ec; - Elf_Data *d, *td; + size_t fsz, msz; + Elf_Data *d; + Elf32_Shdr *shdr32; + Elf64_Shdr *shdr64; unsigned int elftype; uint32_t sh_type; uint64_t d_align; uint64_t sh_align, sh_entsize, sh_offset, sh_size; uint64_t scn_size, scn_alignment; - /* - * We need to recompute library private data structures if one - * or more of the following is true: - * - The underlying Shdr structure has been marked `dirty'. Significant - * fields include: `sh_offset', `sh_type', `sh_size', `sh_addralign'. - * - The Elf_Data structures part of this section have been marked - * `dirty'. Affected members include `d_align', `d_offset', `d_type', - * and `d_size'. - * - The section as a whole is `dirty', e.g., it has been allocated - * using elf_newscn(), or if a new Elf_Data structure was added using - * elf_newdata(). - * - * Each of these conditions would result in the ELF_F_DIRTY bit being - * set on the section descriptor's `s_flags' field. - */ - ec = e->e_class; + shdr32 = &s->s_shdr.s_shdr32; + shdr64 = &s->s_shdr.s_shdr64; if (ec == ELFCLASS32) { - sh_type = s->s_shdr.s_shdr32.sh_type; - sh_align = (uint64_t) s->s_shdr.s_shdr32.sh_addralign; - sh_entsize = (uint64_t) s->s_shdr.s_shdr32.sh_entsize; - sh_offset = (uint64_t) s->s_shdr.s_shdr32.sh_offset; - sh_size = (uint64_t) s->s_shdr.s_shdr32.sh_size; + sh_type = shdr32->sh_type; + sh_align = (uint64_t) shdr32->sh_addralign; + sh_entsize = (uint64_t) shdr32->sh_entsize; + sh_offset = (uint64_t) shdr32->sh_offset; + sh_size = (uint64_t) shdr32->sh_size; } else { - sh_type = s->s_shdr.s_shdr64.sh_type; - sh_align = s->s_shdr.s_shdr64.sh_addralign; - sh_entsize = s->s_shdr.s_shdr64.sh_entsize; - sh_offset = s->s_shdr.s_shdr64.sh_offset; - sh_size = s->s_shdr.s_shdr64.sh_size; + sh_type = shdr64->sh_type; + sh_align = shdr64->sh_addralign; + sh_entsize = shdr64->sh_entsize; + sh_offset = shdr64->sh_offset; + sh_size = shdr64->sh_size; } - if (sh_type == SHT_NULL || sh_type == SHT_NOBITS) - return (1); - - if ((s->s_flags & ELF_F_DIRTY) == 0) { - if ((size_t) *rc < sh_offset + sh_size) - *rc = sh_offset + sh_size; - return (1); - } + assert(sh_type != SHT_NULL && sh_type != SHT_NOBITS); elftype = _libelf_xlate_shtype(sh_type); if (elftype > ELF_T_LAST) { @@ -131,15 +121,52 @@ _libelf_compute_section_extents(Elf *e, return (0); } - /* - * Compute the extent of the data descriptors associated with - * this section. - */ - scn_alignment = 0; if (sh_align == 0) sh_align = _libelf_falign(elftype, ec); - /* Compute the section alignment. */ + /* + * Check the section's data buffers for sanity and compute the + * section's alignment. + * Compute the section's size and alignment using the data + * descriptors associated with the section. + */ + if (STAILQ_EMPTY(&s->s_data)) { + /* + * The section's content (if any) has not been read in + * yet. If section is not dirty marked dirty, we can + * reuse the values in the 'sh_size' and 'sh_offset' + * fields of the section header. + */ + if ((s->s_flags & ELF_F_DIRTY) == 0) { + /* + * If the library is doing the layout, then we + * compute the new start offset for the + * section based on the current offset and the + * section's alignment needs. + * + * If the application is doing the layout, we + * can use the value in the 'sh_offset' field + * in the section header directly. + */ + if (e->e_flags & ELF_F_LAYOUT) + goto updatedescriptor; + else + goto computeoffset; + } + + /* + * Otherwise, we need to bring in the section's data + * from the underlying ELF object. + */ + if (e->e_cmd != ELF_C_WRITE && elf_getdata(s, NULL) == NULL) + return (0); + } + + /* + * Loop through the section's data descriptors. + */ + scn_size = 0L; + scn_alignment = 0L; STAILQ_FOREACH(d, &s->s_data, d_next) { if (d->d_type > ELF_T_LAST) { LIBELF_SET_ERROR(DATA, 0); @@ -153,23 +180,40 @@ _libelf_compute_section_extents(Elf *e, LIBELF_SET_ERROR(DATA, 0); return (0); } - if (d_align > scn_alignment) - scn_alignment = d_align; - } - scn_size = 0L; + /* + * The buffer's size should be a multiple of the + * memory size of the underlying type. + */ + msz = _libelf_msize(d->d_type, ec, e->e_version); + if (d->d_size % msz) { + LIBELF_SET_ERROR(DATA, 0); + return (0); + } - STAILQ_FOREACH_SAFE(d, &s->s_data, d_next, td) { + /* + * Compute the section's size. + */ if (e->e_flags & ELF_F_LAYOUT) { if ((uint64_t) d->d_off + d->d_size > scn_size) scn_size = d->d_off + d->d_size; } else { scn_size = roundup2(scn_size, d->d_align); d->d_off = scn_size; - scn_size += d->d_size; + fsz = _libelf_fsize(d->d_type, ec, d->d_version, + d->d_size / msz); + scn_size += fsz; } + + /* + * The section's alignment is the maximum alignment + * needed for its data buffers. + */ + if (d_align > scn_alignment) + scn_alignment = d_align; } + /* * If the application is requesting full control over the layout * of the section, check its values for sanity. @@ -180,46 +224,60 @@ _libelf_compute_section_extents(Elf *e, LIBELF_SET_ERROR(LAYOUT, 0); return (0); } - } else { - /* - * Otherwise compute the values in the section header. - */ + goto updatedescriptor; + } - if (scn_alignment > sh_align) - sh_align = scn_alignment; + /* + * Otherwise compute the values in the section header. + * + * The section alignment is the maximum alignment for any of + * its contained data descriptors. + */ + if (scn_alignment > sh_align) + sh_align = scn_alignment; - /* - * If the section entry size is zero, try and fill in an - * appropriate entry size. Per the elf(5) manual page - * sections without fixed-size entries should have their - * 'sh_entsize' field set to zero. - */ - if (sh_entsize == 0 && - (sh_entsize = _libelf_fsize(elftype, ec, e->e_version, - (size_t) 1)) == 1) - sh_entsize = 0; + /* + * If the section entry size is zero, try and fill in an + * appropriate entry size. Per the elf(5) manual page + * sections without fixed-size entries should have their + * 'sh_entsize' field set to zero. + */ + if (sh_entsize == 0 && + (sh_entsize = _libelf_fsize(elftype, ec, e->e_version, + (size_t) 1)) == 1) + sh_entsize = 0; - sh_size = scn_size; - sh_offset = roundup(*rc, sh_align); + sh_size = scn_size; - if (ec == ELFCLASS32) { - s->s_shdr.s_shdr32.sh_addralign = (uint32_t) sh_align; - s->s_shdr.s_shdr32.sh_entsize = (uint32_t) sh_entsize; - s->s_shdr.s_shdr32.sh_offset = (uint32_t) sh_offset; - s->s_shdr.s_shdr32.sh_size = (uint32_t) sh_size; - } else { - s->s_shdr.s_shdr64.sh_addralign = sh_align; - s->s_shdr.s_shdr64.sh_entsize = sh_entsize; - s->s_shdr.s_shdr64.sh_offset = sh_offset; - s->s_shdr.s_shdr64.sh_size = sh_size; - } - } +computeoffset: + /* + * Compute the new offset for the section based on + * the section's alignment needs. + */ + sh_offset = roundup(rc, sh_align); - if ((size_t) *rc < sh_offset + sh_size) - *rc = sh_offset + sh_size; + /* + * Update the section header. + */ + if (ec == ELFCLASS32) { + shdr32->sh_addralign = (uint32_t) sh_align; + shdr32->sh_entsize = (uint32_t) sh_entsize; + shdr32->sh_offset = (uint32_t) sh_offset; + shdr32->sh_size = (uint32_t) sh_size; + } else { + shdr64->sh_addralign = sh_align; + shdr64->sh_entsize = sh_entsize; + shdr64->sh_offset = sh_offset; + shdr64->sh_size = sh_size; + } +updatedescriptor: + /* + * Update the section descriptor. + */ s->s_size = sh_size; s->s_offset = sh_offset; + return (1); } @@ -267,13 +325,16 @@ _libelf_insert_section(Elf *e, Elf_Scn * return (1); } +/* + * Recompute section layout. + */ + static off_t _libelf_resync_sections(Elf *e, off_t rc) { int ec; - off_t nrc; + Elf_Scn *s; size_t sh_type, shdr_start, shdr_end; - Elf_Scn *s, *ts; ec = e->e_class; @@ -281,13 +342,7 @@ _libelf_resync_sections(Elf *e, off_t rc * Make a pass through sections, computing the extent of each * section. Order in increasing order of addresses. */ - - nrc = rc; - STAILQ_FOREACH(s, &e->e_u.e_elf.e_scn, s_next) - if (_libelf_compute_section_extents(e, s, &nrc) == 0) - return ((off_t) -1); - - STAILQ_FOREACH_SAFE(s, &e->e_u.e_elf.e_scn, s_next, ts) { + STAILQ_FOREACH(s, &e->e_u.e_elf.e_scn, s_next) { if (ec == ELFCLASS32) sh_type = s->s_shdr.s_shdr32.sh_type; else @@ -296,21 +351,22 @@ _libelf_resync_sections(Elf *e, off_t rc if (sh_type == SHT_NOBITS || sh_type == SHT_NULL) continue; - if (s->s_offset < (uint64_t) rc) { - if (s->s_offset + s->s_size < (uint64_t) rc) { - /* - * Try insert this section in the - * correct place in the list, - * detecting overlaps if any. - */ - STAILQ_REMOVE(&e->e_u.e_elf.e_scn, s, _Elf_Scn, - s_next); - if (_libelf_insert_section(e, s) == 0) - return ((off_t) -1); - } else { - LIBELF_SET_ERROR(LAYOUT, 0); + if (_libelf_compute_section_extents(e, s, rc) == 0) + return ((off_t) -1); + + if (s->s_size == 0) + continue; + + if (s->s_offset + s->s_size < (size_t) rc) { + /* + * Try insert this section in the + * correct place in the list, + * detecting overlaps if any. + */ + STAILQ_REMOVE(&e->e_u.e_elf.e_scn, s, _Elf_Scn, + s_next); + if (_libelf_insert_section(e, s) == 0) return ((off_t) -1); - } } else rc = s->s_offset + s->s_size; } @@ -338,8 +394,6 @@ _libelf_resync_sections(Elf *e, off_t rc } } - assert(nrc == rc); - return (rc); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 24 18:11:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9465991E; Sun, 24 Feb 2013 18:11:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 4CC61CD5; Sun, 24 Feb 2013 18:11:36 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a] (spaceball.andric.com [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id AB7455C43; Sun, 24 Feb 2013 19:11:32 +0100 (CET) Message-ID: <512A57D1.6050006@FreeBSD.org> Date: Sun, 24 Feb 2013 19:11:29 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20130117 Thunderbird/19.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r247166 - head/contrib/llvm/tools/clang/lib/Driver References: <201302222240.r1MMeAsu042087@svn.freebsd.org> <20130222235332.GB2454@kib.kiev.ua> <5128AED6.2020906@FreeBSD.org> <20130223201857.GD2454@kib.kiev.ua> <51294081.1060505@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2013 18:11:36 -0000 On 2013-02-24 03:04, Adrian Chadd wrote: > Just curious about the OS detection - is the default platform > detection based on the currently running OS, or the cross-built target > OS? > > eg, if I were cross-compiling FreeBSD on (say) haiku, which has > different CPU defaults, what would the default CPU output be? When you are cross-compiling, you usually specify -target $target_triple, e.g.: clang -target amd64-unknown-freebsd10.0 -c foo.c or you make a link or symlink from clang to ${target_triple}-clang, like so: amd64-unknown-freebsd10.0-clang -c foo.c In either case, the default CPU is whatever the default CPU is for that target triple. So for the amd64-unknown-freebsd triple, it would be x86_64, for i386-unknown-freebsd it would be i486, etc. From owner-svn-src-all@FreeBSD.ORG Sun Feb 24 18:26:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D4483F57; Sun, 24 Feb 2013 18:26:18 +0000 (UTC) (envelope-from luigi@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 95A10D6A; Sun, 24 Feb 2013 18:26:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1OIQIxw038083; Sun, 24 Feb 2013 18:26:18 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1OIQIpT038081; Sun, 24 Feb 2013 18:26:18 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201302241826.r1OIQIpT038081@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 24 Feb 2013 18:26: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: r247230 - in stable/9/sys: dev/netmap net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2013 18:26:18 -0000 Author: luigi Date: Sun Feb 24 18:26:17 2013 New Revision: 247230 URL: http://svnweb.freebsd.org/changeset/base/247230 Log: MFC some flags and minor things related to "transparent mode" that i forgot in previous commits. Modified: stable/9/sys/dev/netmap/ixgbe_netmap.h stable/9/sys/net/netmap.h Modified: stable/9/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/ixgbe_netmap.h Sun Feb 24 18:13:57 2013 (r247229) +++ stable/9/sys/dev/netmap/ixgbe_netmap.h Sun Feb 24 18:26:17 2013 (r247230) @@ -63,9 +63,6 @@ * This is tricky, much better to use TDH for now. */ SYSCTL_DECL(_dev_netmap); -static int ix_write_len; -SYSCTL_INT(_dev_netmap, OID_AUTO, ix_write_len, - CTLFLAG_RW, &ix_write_len, 0, "write rx len"); static int ix_rx_miss, ix_rx_miss_bufs, ix_use_dd, ix_crcstrip; SYSCTL_INT(_dev_netmap, OID_AUTO, ix_crcstrip, CTLFLAG_RW, &ix_crcstrip, 0, "strip CRC on rx frames"); @@ -236,7 +233,7 @@ ixgbe_netmap_txsync(struct ifnet *ifp, u * seems very expensive, so we interrupt once every half ring, * or when requested with NS_REPORT */ - int report_frequency = kring->nkr_num_slots >> 1; + u_int report_frequency = kring->nkr_num_slots >> 1; if (k > lim) return netmap_ring_reinit(kring); @@ -485,12 +482,9 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u * rxr->next_to_check is set to 0 on a ring reinit */ if (netmap_no_pendintr || force_update) { - /* XXX apparently the length field in advanced descriptors - * does not include the CRC irrespective of the setting - * of CRCSTRIP. The data sheets say differently. - * Very strange. - */ int crclen = ix_crcstrip ? 0 : 4; + uint16_t slot_flags = kring->nkr_slot_flags; + l = rxr->next_to_check; j = netmap_idx_n2k(kring, l); @@ -501,8 +495,7 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u if ((staterr & IXGBE_RXD_STAT_DD) == 0) break; ring->slot[j].len = le16toh(curr->wb.upper.length) - crclen; - if (ix_write_len) - D("rx[%d] len %d", j, ring->slot[j].len); + ring->slot[j].flags = slot_flags; bus_dmamap_sync(rxr->ptag, rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); j = (j == lim) ? 0 : j + 1; Modified: stable/9/sys/net/netmap.h ============================================================================== --- stable/9/sys/net/netmap.h Sun Feb 24 18:13:57 2013 (r247229) +++ stable/9/sys/net/netmap.h Sun Feb 24 18:26:17 2013 (r247230) @@ -144,8 +144,11 @@ struct netmap_slot { * e.g. by generating an interrupt */ #define NS_FORWARD 0x0004 /* pass packet to the other endpoint - * (host stack or device + * (host stack or device) */ +#define NS_NO_LEARN 0x0008 +#define NS_PORT_SHIFT 8 +#define NS_PORT_MASK (0xff << NS_PORT_SHIFT) }; /* From owner-svn-src-all@FreeBSD.ORG Sun Feb 24 19:32:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E184D29B; Sun, 24 Feb 2013 19:32:43 +0000 (UTC) (envelope-from pluknet@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 D16BEFB9; Sun, 24 Feb 2013 19:32:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1OJWhen058660; Sun, 24 Feb 2013 19:32:43 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1OJWhdF058658; Sun, 24 Feb 2013 19:32:43 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302241932.r1OJWhdF058658@svn.freebsd.org> From: Sergey Kandaurov Date: Sun, 24 Feb 2013 19:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247234 - head/sbin/fsdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2013 19:32:44 -0000 Author: pluknet Date: Sun Feb 24 19:32:43 2013 New Revision: 247234 URL: http://svnweb.freebsd.org/changeset/base/247234 Log: Catch up with internal API changes for initbarea() and getdatablk() of fsck_ffs introduced with r247212. Submitted by: David Wolfskill Modified: head/sbin/fsdb/fsdbutil.c Modified: head/sbin/fsdb/fsdbutil.c ============================================================================== --- head/sbin/fsdb/fsdbutil.c Sun Feb 24 19:10:16 2013 (r247233) +++ head/sbin/fsdb/fsdbutil.c Sun Feb 24 19:32:43 2013 (r247234) @@ -239,11 +239,11 @@ printindir(ufs2_daddr_t blk, int level, /* for the final indirect level, don't use the cache */ bp = &buf; bp->b_un.b_buf = bufp; - initbarea(bp); + initbarea(bp, BT_UNKNOWN); getblk(bp, blk, sblock.fs_bsize); } else - bp = getdatablk(blk, sblock.fs_bsize); + bp = getdatablk(blk, sblock.fs_bsize, BT_UNKNOWN); cpl = charsperline(); for (i = charssofar = 0; i < NINDIR(&sblock); i++) { From owner-svn-src-all@FreeBSD.ORG Sun Feb 24 20:53:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8FC117EA; Sun, 24 Feb 2013 20:53:33 +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 775BC34F; Sun, 24 Feb 2013 20:53:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1OKrXZk082508; Sun, 24 Feb 2013 20:53:33 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1OKrX44082507; Sun, 24 Feb 2013 20:53:33 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201302242053.r1OKrX44082507@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Feb 2013 20:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247236 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2013 20:53:33 -0000 Author: jilles Date: Sun Feb 24 20:53:32 2013 New Revision: 247236 URL: http://svnweb.freebsd.org/changeset/base/247236 Log: libc/opendir: Improve behaviour of union uniquifier: * Reopen the directory using openat(fd, ".", ...) instead of opening the pathname again. This fixes a race condition where the meaning of the pathname changes and allows a reopen with fdopendir(). * Always reopen the directory for union stacks, not only when DTF_REWIND is passed. Applications should be able to fchdir(dirfd(dir)) and *at(dirfd(dir), ...). DTF_REWIND now does nothing. Modified: head/lib/libc/gen/opendir.c Modified: head/lib/libc/gen/opendir.c ============================================================================== --- head/lib/libc/gen/opendir.c Sun Feb 24 19:49:02 2013 (r247235) +++ head/lib/libc/gen/opendir.c Sun Feb 24 20:53:32 2013 (r247236) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include "gen-private.h" #include "telldir.h" -static DIR * __opendir_common(int, const char *, int); +static DIR * __opendir_common(int, int); /* * Open a directory. @@ -78,7 +78,7 @@ fdopendir(int fd) } if (_fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) return (NULL); - return (__opendir_common(fd, NULL, DTF_HIDEW|DTF_NODUP)); + return (__opendir_common(fd, DTF_HIDEW|DTF_NODUP)); } DIR * @@ -92,7 +92,7 @@ __opendir2(const char *name, int flags) O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC)) == -1) return (NULL); - dir = __opendir_common(fd, name, flags); + dir = __opendir_common(fd, flags); if (dir == NULL) { saved_errno = errno; _close(fd); @@ -113,7 +113,7 @@ opendir_compar(const void *p1, const voi * Common routine for opendir(3), __opendir2(3) and fdopendir(3). */ static DIR * -__opendir_common(int fd, const char *name, int flags) +__opendir_common(int fd, int flags) { DIR *dirp; int incr; @@ -121,6 +121,8 @@ __opendir_common(int fd, const char *nam int unionstack; int fd2; + fd2 = -1; + if ((dirp = malloc(sizeof(DIR) + sizeof(struct _telldir))) == NULL) return (NULL); @@ -165,7 +167,22 @@ __opendir_common(int fd, const char *nam * entries into a buffer, sort the buffer, and * remove duplicate entries by setting the inode * number to zero. + * + * We reopen the directory because _getdirentries() + * on a MNT_UNION mount modifies the open directory, + * making it refer to the lower directory after the + * upper directory's entries are exhausted. + * This would otherwise break software that uses + * the directory descriptor for fchdir or *at + * functions, such as fts.c. */ + if ((fd2 = _openat(fd, ".", O_RDONLY | O_CLOEXEC)) == -1) { + saved_errno = errno; + free(buf); + free(dirp); + errno = saved_errno; + return (NULL); + } do { /* @@ -181,7 +198,7 @@ __opendir_common(int fd, const char *nam ddptr = buf + (len - space); } - n = _getdirentries(fd, ddptr, space, &dirp->dd_seek); + n = _getdirentries(fd2, ddptr, space, &dirp->dd_seek); if (n > 0) { ddptr += n; space -= n; @@ -191,25 +208,8 @@ __opendir_common(int fd, const char *nam ddeptr = ddptr; flags |= __DTF_READALL; - /* - * Re-open the directory. - * This has the effect of rewinding back to the - * top of the union stack and is needed by - * programs which plan to fchdir to a descriptor - * which has also been read -- see fts.c. - */ - if (flags & DTF_REWIND) { - if ((fd2 = _open(name, O_RDONLY | O_DIRECTORY | - O_CLOEXEC)) == -1) { - saved_errno = errno; - free(buf); - free(dirp); - errno = saved_errno; - return (NULL); - } - (void)_dup2(fd2, fd); - _close(fd2); - } + _close(fd2); + fd2 = -1; /* * There is now a buffer full of (possibly) duplicate @@ -293,7 +293,6 @@ __opendir_common(int fd, const char *nam if (dirp->dd_buf == NULL) goto fail; dirp->dd_seek = 0; - flags &= ~DTF_REWIND; } dirp->dd_loc = 0; @@ -310,6 +309,8 @@ __opendir_common(int fd, const char *nam fail: saved_errno = errno; + if (fd2 != -1) + _close(fd2); free(dirp); errno = saved_errno; return (NULL); From owner-svn-src-all@FreeBSD.ORG Sun Feb 24 21:00:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CEF109D6; Sun, 24 Feb 2013 21:00:38 +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 B69D4383; Sun, 24 Feb 2013 21:00:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1OL0cje085177; Sun, 24 Feb 2013 21:00:38 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1OL0ck8085176; Sun, 24 Feb 2013 21:00:38 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201302242100.r1OL0ck8085176@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 24 Feb 2013 21:00:38 +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: r247237 - stable/9/lib/libc/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2013 21:00:38 -0000 Author: jilles Date: Sun Feb 24 21:00:37 2013 New Revision: 247237 URL: http://svnweb.freebsd.org/changeset/base/247237 Log: MFC r246617: sigqueue(2): Fix typo (EEPERM -> EPERM). Modified: stable/9/lib/libc/sys/sigqueue.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/sigqueue.2 ============================================================================== --- stable/9/lib/libc/sys/sigqueue.2 Sun Feb 24 20:53:32 2013 (r247236) +++ stable/9/lib/libc/sys/sigqueue.2 Sun Feb 24 21:00:37 2013 (r247237) @@ -117,7 +117,7 @@ or a system-wide resource limit has been The value of the .Fa signo argument is an invalid or unsupported signal number. -.It Bq Er EEPERM +.It Bq Er EPERM The process does not have the appropriate privilege to send the signal to the receiving process. .It Bq Er ESRCH From owner-svn-src-all@FreeBSD.ORG Sun Feb 24 21:36:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C14F7A04; Sun, 24 Feb 2013 21:36:54 +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 9B12E747; Sun, 24 Feb 2013 21:36:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1OLas1S095415; Sun, 24 Feb 2013 21:36:54 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1OLasok095414; Sun, 24 Feb 2013 21:36:54 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201302242136.r1OLasok095414@svn.freebsd.org> From: Devin Teske Date: Sun, 24 Feb 2013 21: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: r247241 - stable/9/usr.sbin/sysinstall/help X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2013 21:36:54 -0000 Author: dteske Date: Sun Feb 24 21:36:54 2013 New Revision: 247241 URL: http://svnweb.freebsd.org/changeset/base/247241 Log: Oops, r186202 (over 4 years ago) forgot to remove Tape from the F1 Help file. Direct commit to stable/9 (no sysinstall in head). Modified: stable/9/usr.sbin/sysinstall/help/options.hlp Modified: stable/9/usr.sbin/sysinstall/help/options.hlp ============================================================================== --- stable/9/usr.sbin/sysinstall/help/options.hlp Sun Feb 24 21:23:11 2013 (r247240) +++ stable/9/usr.sbin/sysinstall/help/options.hlp Sun Feb 24 21:36:54 2013 (r247241) @@ -88,14 +88,6 @@ Editor: Specify which screen editor to setting to `/usr/bin/vi'. -Tape Blocksize: Specify block size in 512 byte blocks of tape. - - This defaults to 20 blocks, which should work with most - tape drive + tar combinations. It may not allow your particular - drive to win any records for speed, however, and the more - adventurous among you might try experimenting with larger sizes. - - Extract Detail: How to show filenames on debug screen as they're extracted. While a distribution is being extracted, the default detail level From owner-svn-src-all@FreeBSD.ORG Sun Feb 24 21:42:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1FF5BBC7; Sun, 24 Feb 2013 21:42:40 +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 0D00F77D; Sun, 24 Feb 2013 21:42:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1OLgdIv097748; Sun, 24 Feb 2013 21:42:39 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1OLgdou097747; Sun, 24 Feb 2013 21:42:39 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201302242142.r1OLgdou097747@svn.freebsd.org> From: Devin Teske Date: Sun, 24 Feb 2013 21:42: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: r247242 - stable/9/usr.sbin/sysinstall/help X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Feb 2013 21:42:40 -0000 Author: dteske Date: Sun Feb 24 21:42:39 2013 New Revision: 247242 URL: http://svnweb.freebsd.org/changeset/base/247242 Log: Oops, r215291 (over 2 years ago) forgot to remove mention of "medium" from the F1 Help file. Direct commit to stable/9 (no sysinstall in head). Modified: stable/9/usr.sbin/sysinstall/help/options.hlp Modified: stable/9/usr.sbin/sysinstall/help/options.hlp ============================================================================== --- stable/9/usr.sbin/sysinstall/help/options.hlp Sun Feb 24 21:36:54 2013 (r247241) +++ stable/9/usr.sbin/sysinstall/help/options.hlp Sun Feb 24 21:42:39 2013 (r247242) @@ -92,9 +92,8 @@ Extract Detail: How to show filenames o While a distribution is being extracted, the default detail level of "high" will show the full file names as they're extracted. - If you would prefer a more terse form for this, namely dots, select - the "medium" detail level. If you want nothing to be printed - on the debugging screen during extraction, select "low". + If you want nothing to be printed on the debugging screen during + extraction, select "low". Release Name: Which release to attempt to load from installation media. From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 01:50:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C489631D; Mon, 25 Feb 2013 01:50:05 +0000 (UTC) (envelope-from kientzle@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 A8B4533F; Mon, 25 Feb 2013 01:50:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1P1o5TK070969; Mon, 25 Feb 2013 01:50:05 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1P1o4TR070963; Mon, 25 Feb 2013 01:50:04 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201302250150.r1P1o4TR070963@svn.freebsd.org> From: Tim Kientzle Date: Mon, 25 Feb 2013 01:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247250 - in head/sys/boot: common fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 01:50:05 -0000 Author: kientzle Date: Mon Feb 25 01:50:04 2013 New Revision: 247250 URL: http://svnweb.freebsd.org/changeset/base/247250 Log: Fix the bug I introduced in r247045. After digging through more carefully, it looks like there's no real need to have the DTB in the module directory. So we can simplify a lot: Just copy DTB into local heap for "fdt addr" and U-Boot integration, drop all the extra COPYIN() calls. I've left one final COPYIN() to update the in-kernel DTB for consistency with how this code used to work, but I'm no longer convinced it's appropriate here. I've also remove the mem_load_raw() utility that I added to boot/common/module.c with r247045 since it's no longer necessary. Modified: head/sys/boot/common/bootstrap.h head/sys/boot/common/module.c head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/common/bootstrap.h ============================================================================== --- head/sys/boot/common/bootstrap.h Mon Feb 25 00:08:28 2013 (r247249) +++ head/sys/boot/common/bootstrap.h Mon Feb 25 01:50:04 2013 (r247250) @@ -237,8 +237,6 @@ void file_discard(struct preloaded_file void file_addmetadata(struct preloaded_file *fp, int type, size_t size, void *p); int file_addmodule(struct preloaded_file *fp, char *modname, int version, struct kernel_module **newmp); -/* Load from a buffer in memory. */ -struct preloaded_file *mem_load_raw(char *type, char *name, const void *p, size_t len); /* MI module loaders */ #ifdef __elfN Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Mon Feb 25 00:08:28 2013 (r247249) +++ head/sys/boot/common/module.c Mon Feb 25 01:50:04 2013 (r247250) @@ -422,42 +422,6 @@ file_loadraw(char *type, char *name) } /* - * Load a chunk of data as if it had been read from a file. - */ -struct preloaded_file * -mem_load_raw(char *type, char *name, const void *p, size_t len) -{ - struct preloaded_file *fp; - - /* We can't load first */ - if ((file_findfile(NULL, NULL)) == NULL) { - command_errmsg = "can't load file before kernel"; - return(NULL); - } - - if (archsw.arch_loadaddr != NULL) - loadaddr = archsw.arch_loadaddr(LOAD_RAW, name, loadaddr); - archsw.arch_copyin(p, loadaddr, len); - - /* Looks OK so far; create & populate control structure */ - fp = file_alloc(); - fp->f_name = strdup(name); - fp->f_type = strdup(type); - fp->f_args = NULL; - fp->f_metadata = NULL; - fp->f_loader = -1; - fp->f_addr = loadaddr; - fp->f_size = len; - - /* recognise space consumption */ - loadaddr += len; - - /* Add to the list of loaded files */ - file_insert_tail(fp); - return fp; -} - -/* * Load the module (name), pass it (argc),(argv), add container file * to the list of loaded files. * If module is already loaded just assign new argc/argv. Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Mon Feb 25 00:08:28 2013 (r247249) +++ head/sys/boot/fdt/fdt_loader_cmd.c Mon Feb 25 01:50:04 2013 (r247250) @@ -63,12 +63,16 @@ __FBSDID("$FreeBSD$"); #define CMD_REQUIRES_BLOB 0x01 /* Location of FDT yet to be loaded. */ +/* This may be in read-only memory, so can't be manipulated directly. */ static struct fdt_header *fdt_to_load = NULL; -/* Local copy of FDT on heap. */ +/* Location of FDT on heap. */ +/* This is the copy we actually manipulate. */ static struct fdt_header *fdtp = NULL; /* Size of FDT blob */ static size_t fdtp_size = 0; -/* Location of FDT in kernel or module */ +/* Location of FDT in kernel or module. */ +/* This won't be set if FDT is loaded from disk or memory. */ +/* If it is set, we'll update it when fdt_copy() gets called. */ static vm_offset_t fdtp_va = 0; static int fdt_load_dtb(vm_offset_t va); @@ -191,7 +195,6 @@ fdt_find_static_dtb() fdt_start = (vm_offset_t)sym.st_value + offs; free(strp); } - printf("fdt_start: 0x%08jX\n", (intmax_t)fdt_start); return (fdt_start); } @@ -239,14 +242,19 @@ fdt_load_dtb(vm_offset_t va) static int fdt_load_dtb_addr(struct fdt_header *header) { - struct preloaded_file *bfp; - bfp = mem_load_raw("dtb", "memory.dtb", header, fdt_totalsize(header)); - if (bfp == NULL) { - command_errmsg = "unable to copy DTB into module directory"; + // TODO: Verify that there really is an FDT at + // the specified location. + fdtp_size = fdt_totalsize(header); + free(fdtp); + if ((fdtp = malloc(fdtp_size)) == NULL) { + command_errmsg = "can't allocate memory for device tree copy"; return (1); } - return fdt_load_dtb(bfp->f_addr); + + fdtp_va = 0; // Don't write this back into module or kernel. + bcopy(header, fdtp, fdtp_size); + return (0); } static int @@ -339,7 +347,7 @@ _fdt_strtovect(char *str, void *cellbuf, #define TMP_MAX_ETH 8 -void +static void fixup_ethernet(const char *env, char *ethstr, int *eth_no, int len) { char *end, *str; @@ -376,7 +384,7 @@ fixup_ethernet(const char *env, char *et *eth_no = n + 1; } -void +static void fixup_cpubusfreqs(unsigned long cpufreq, unsigned long busfreq) { int lo, o = 0, o2, maxo = 0, depth; @@ -424,7 +432,7 @@ fixup_cpubusfreqs(unsigned long cpufreq, } } -int +static int fdt_reg_valid(uint32_t *reg, int len, int addr_cells, int size_cells) { int cells_in_tuple, i, tuples, tuple_size; @@ -456,7 +464,7 @@ fdt_reg_valid(uint32_t *reg, int len, in return (0); } -void +static void fixup_memory(struct sys_info *si) { struct mem_region *curmr; @@ -611,7 +619,7 @@ fixup_memory(struct sys_info *si) free(sb); } -void +static void fixup_stdout(const char *env) { const char *str; @@ -664,7 +672,7 @@ fixup_stdout(const char *env) /* * Locate the blob, fix it up and return its location. */ -static vm_offset_t +static int fdt_fixup(void) { const char *env; @@ -692,7 +700,7 @@ fdt_fixup(void) /* Value assigned to fixup-applied does not matter. */ if (fdt_getprop(fdtp, chosen, "fixup-applied", NULL)) - goto success; + return (1); /* Acquire sys_info */ si = ub_get_sys_info(); @@ -735,15 +743,11 @@ fdt_fixup(void) fixup_memory(si); fdt_setprop(fdtp, chosen, "fixup-applied", NULL, 0); - -success: - /* Overwrite the FDT with the fixed version. */ - COPYIN(fdtp, fdtp_va, fdtp_size); - return (fdtp_va); + return (1); } /* - * Copy DTB blob to specified location and its return size + * Copy DTB blob to specified location and return size */ int fdt_copy(vm_offset_t va) @@ -761,6 +765,11 @@ fdt_copy(vm_offset_t va) if (fdt_fixup() == 0) return (0); + if (fdtp_va != 0) { + /* Overwrite the FDT with the fixed version. */ + /* XXX Is this really appropriate? */ + COPYIN(fdtp, fdtp_va, fdtp_size); + } COPYIN(fdtp, va, fdtp_size); return (fdtp_size); } @@ -1334,8 +1343,6 @@ fdt_modprop(int nodeoff, char *propname, else sprintf(command_errbuf, "Could not add/modify property!\n"); - } else { - COPYIN(fdtp, fdtp_va, fdtp_size); } return (rv); } @@ -1520,7 +1527,6 @@ fdt_cmd_mkprop(int argc, char *argv[]) if (fdt_modprop(o, propname, value, 1)) return (CMD_ERROR); - COPYIN(fdtp, fdtp_va, fdtp_size); return (CMD_OK); } @@ -1557,8 +1563,6 @@ fdt_cmd_rm(int argc, char *argv[]) if (rv) { sprintf(command_errbuf, "could not delete node"); return (CMD_ERROR); - } else { - COPYIN(fdtp, fdtp_va, fdtp_size); } return (CMD_OK); } @@ -1589,8 +1593,6 @@ fdt_cmd_mknode(int argc, char *argv[]) sprintf(command_errbuf, "Could not add node!\n"); return (CMD_ERROR); - } else { - COPYIN(fdtp, fdtp_va, fdtp_size); } return (CMD_OK); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 02:41:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D26C7BC8; Mon, 25 Feb 2013 02:41:39 +0000 (UTC) (envelope-from marcel@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 3B4C2705; Mon, 25 Feb 2013 02:41:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1P2fdsE088248; Mon, 25 Feb 2013 02:41:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1P2fc2h088244; Mon, 25 Feb 2013 02:41:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201302250241.r1P2fc2h088244@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 25 Feb 2013 02:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247251 - in head/sys/ia64: ia64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 02:41:39 -0000 Author: marcel Date: Mon Feb 25 02:41:38 2013 New Revision: 247251 URL: http://svnweb.freebsd.org/changeset/base/247251 Log: kernacc() expects all KVAs to be covered in the kernel map. With the introduction of the PBVM, this stopped being the case. Redefine the VM parameters so that the PBVM is included in the kernel map. In particular this introduces VM_INIT_KERNEL_ADDRESS to point to the base of region 5 now that VM_MIN_KERNEL_ADDRESS points to the base of region 4 to include the PBVM. While here define KERNBASE to the actual link address of the kernel as is intended. PR: 169926 Modified: head/sys/ia64/ia64/pmap.c head/sys/ia64/include/vmparam.h Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Mon Feb 25 01:50:04 2013 (r247250) +++ head/sys/ia64/ia64/pmap.c Mon Feb 25 02:41:38 2013 (r247251) @@ -387,7 +387,7 @@ pmap_bootstrap() */ ia64_kptdir = ia64_physmem_alloc(PAGE_SIZE, PAGE_SIZE); nkpt = 0; - kernel_vm_end = VM_MIN_KERNEL_ADDRESS; + kernel_vm_end = VM_INIT_KERNEL_ADDRESS; /* * Determine a valid (mappable) VHPT size. @@ -425,7 +425,7 @@ pmap_bootstrap() ia64_set_pta(base + (1 << 8) + (pmap_vhpt_log2size << 2) + 1); ia64_srlz_i(); - virtual_avail = VM_MIN_KERNEL_ADDRESS; + virtual_avail = VM_INIT_KERNEL_ADDRESS; virtual_end = VM_MAX_KERNEL_ADDRESS; /* @@ -1383,7 +1383,7 @@ pmap_kextract(vm_offset_t va) /* Region 5 is our KVA. Bail out if the VA is beyond our limits. */ if (va >= kernel_vm_end) goto err_out; - if (va >= VM_MIN_KERNEL_ADDRESS) { + if (va >= VM_INIT_KERNEL_ADDRESS) { pte = pmap_find_kpte(va); pa = pmap_present(pte) ? pmap_ppn(pte) | (va & PAGE_MASK) : 0; goto out; @@ -2746,7 +2746,7 @@ DB_COMMAND(kpte, db_kpte) db_printf("usage: kpte \n"); return; } - if (addr < VM_MIN_KERNEL_ADDRESS) { + if (addr < VM_INIT_KERNEL_ADDRESS) { db_printf("kpte: error: invalid \n"); return; } Modified: head/sys/ia64/include/vmparam.h ============================================================================== --- head/sys/ia64/include/vmparam.h Mon Feb 25 01:50:04 2013 (r247250) +++ head/sys/ia64/include/vmparam.h Mon Feb 25 02:41:38 2013 (r247251) @@ -181,12 +181,13 @@ /* user/kernel map constants */ #define VM_MIN_ADDRESS 0 #define VM_MAXUSER_ADDRESS IA64_RR_BASE(IA64_VM_MINKERN_REGION) -#define VM_MIN_KERNEL_ADDRESS IA64_RR_BASE(IA64_VM_MINKERN_REGION + 1) -#define VM_MAX_KERNEL_ADDRESS \ - (VM_MIN_KERNEL_ADDRESS + IA64_REGION_GAP_START - 1) +#define VM_MIN_KERNEL_ADDRESS VM_MAXUSER_ADDRESS +#define VM_INIT_KERNEL_ADDRESS IA64_RR_BASE(IA64_VM_MINKERN_REGION + 1) +#define VM_MAX_KERNEL_ADDRESS (IA64_RR_BASE(IA64_VM_MINKERN_REGION + 2) - 1) #define VM_MAX_ADDRESS ~0UL -#define KERNBASE VM_MAXUSER_ADDRESS +/* We link the kernel at IA64_PBVM_BASE. */ +#define KERNBASE IA64_PBVM_BASE /* * USRSTACK is the top (end) of the user stack. Immediately above the user From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 07:13:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BF626F9; Mon, 25 Feb 2013 07:13:38 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp4.clear.net.nz (smtp4.clear.net.nz [203.97.37.64]) by mx1.freebsd.org (Postfix) with ESMTP id 706B2164; Mon, 25 Feb 2013 07:13:38 +0000 (UTC) Received: from mxin3-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp4.clear.net.nz (CLEAR Net Mail) with ESMTP id <0MIR00HJSLA7LZ20@smtp4.clear.net.nz>; Mon, 25 Feb 2013 20:13:34 +1300 (NZDT) Received: from 202-0-48-19.paradise.net.nz (HELO bender) ([202.0.48.19]) by smtpin32.paradise.net.nz with ESMTP; Mon, 25 Feb 2013 20:13:32 +1300 Date: Mon, 25 Feb 2013 20:13:13 +1300 From: Andrew Turner Subject: Re: svn commit: r247116 - in head/sys: fs/nfs fs/nfsclient kern nfsclient sys tools In-reply-to: <201302211902.r1LJ2o5T033708@svn.freebsd.org> To: John Baldwin Message-id: <20130225201313.2050da18@bender> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit References: <201302211902.r1LJ2o5T033708@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 07:13:38 -0000 On Thu, 21 Feb 2013 19:02:50 +0000 (UTC) John Baldwin wrote: > Author: jhb > Date: Thu Feb 21 19:02:50 2013 > New Revision: 247116 > URL: http://svnweb.freebsd.org/changeset/base/247116 > > Log: > Further refine the handling of stop signals in the NFS client. The > changes in r246417 were incomplete as they did not add explicit > calls to sigdeferstop() around all the places that previously passed > SBDRY to _sleep(). In addition, nfs_getcacheblk() could trigger a > write RPC from getblk() resulting in sigdeferstop() recursing. > Rather than manually deferring stop signals in specific places, > change the VFS_*() and VOP_*() methods to defer stop signals for > filesystems which request this behavior via a new VFCF_SBDRY flag. > Note that this has to be a VFC flag rather than a MNTK flag so that > it works properly with VFS_MOUNT() when the mount is not yet fully > constructed. For now, only the NFS clients are set this new flag in > VFS_SET(). > A few other related changes: > - Add an assertion to ensure that TDF_SBDRY doesn't leak to > userland. > - When a lookup request uses VOP_READLINK() to follow a symlink, > mark the request as being on behalf of the thread performing the > lookup (cnp_thread) rather than using a NULL thread pointer. This > causes NFS to properly handle signals during this VOP on an > interruptible mount. > > PR: kern/176179 > Reported by: Russell Cattelan (sigdeferstop() recursion) > Reviewed by: kib > MFC after: 1 month This change is causing init to crash for me on armv6. I'm netbooting a PandaBoard and it appears init is receiving a SIGABRT before it gets into main(). Do you have any idea where I could look to track down why it is doing this? Andrew From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 08:04:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 82D91AE4; Mon, 25 Feb 2013 08:04:48 +0000 (UTC) (envelope-from gonzo@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 73B3A31B; Mon, 25 Feb 2013 08:04:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1P84miA085539; Mon, 25 Feb 2013 08:04:48 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1P84mLu085538; Mon, 25 Feb 2013 08:04:48 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201302250804.r1P84mLu085538@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 25 Feb 2013 08:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247252 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 08:04:48 -0000 Author: gonzo Date: Mon Feb 25 08:04:47 2013 New Revision: 247252 URL: http://svnweb.freebsd.org/changeset/base/247252 Log: - Fix off-by-one error when returning max pin number - Fix GPIOGET for output pins. Requesting state for output pin is valid operation, get the state from TI_GPIO_DATAOUTX register Modified: head/sys/arm/ti/ti_gpio.c Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Mon Feb 25 02:41:38 2013 (r247251) +++ head/sys/arm/ti/ti_gpio.c Mon Feb 25 08:04:47 2013 (r247252) @@ -281,7 +281,7 @@ ti_gpio_pin_max(device_t dev, int *maxpi banks++; } - *maxpin = (banks * PINS_PER_BANK); + *maxpin = (banks * PINS_PER_BANK) - 1; TI_GPIO_UNLOCK(sc); @@ -541,13 +541,11 @@ ti_gpio_pin_get(device_t dev, uint32_t p /* Sanity check the pin is not configured as an output */ val = ti_gpio_read_4(sc, bank, TI_GPIO_OE); - if ((val & mask) == mask) { - TI_GPIO_UNLOCK(sc); - return (EINVAL); - } - /* Read the value on the pin */ - *value = (ti_gpio_read_4(sc, bank, TI_GPIO_DATAIN) & mask) ? 1 : 0; + if (val & mask) + *value = (ti_gpio_read_4(sc, bank, TI_GPIO_DATAOUT) & mask) ? 1 : 0; + else + *value = (ti_gpio_read_4(sc, bank, TI_GPIO_DATAIN) & mask) ? 1 : 0; TI_GPIO_UNLOCK(sc); @@ -728,6 +726,7 @@ ti_gpio_attach(device_t dev) /* Finish of the probe call */ device_add_child(dev, "gpioc", device_get_unit(dev)); device_add_child(dev, "gpiobus", device_get_unit(dev)); + return (bus_generic_attach(dev)); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 08:14:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6A42BED9; Mon, 25 Feb 2013 08:14:08 +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 5B84B376; Mon, 25 Feb 2013 08:14:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1P8E8MK088802; Mon, 25 Feb 2013 08:14:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1P8E87j088801; Mon, 25 Feb 2013 08:14:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302250814.r1P8E87j088801@svn.freebsd.org> From: Xin LI Date: Mon, 25 Feb 2013 08: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: r247254 - in stable: 8/sbin/recoverdisk 9/sbin/recoverdisk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 08:14:08 -0000 Author: delphij Date: Mon Feb 25 08:14:07 2013 New Revision: 247254 URL: http://svnweb.freebsd.org/changeset/base/247254 Log: MFC r246329: Use stripesize as smallest block size if it's available. Modified: stable/9/sbin/recoverdisk/recoverdisk.c Directory Properties: stable/9/sbin/recoverdisk/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sbin/recoverdisk/recoverdisk.c Directory Properties: stable/8/sbin/recoverdisk/ (props changed) Modified: stable/9/sbin/recoverdisk/recoverdisk.c ============================================================================== --- stable/9/sbin/recoverdisk/recoverdisk.c Mon Feb 25 08:08:13 2013 (r247253) +++ stable/9/sbin/recoverdisk/recoverdisk.c Mon Feb 25 08:14:07 2013 (r247254) @@ -156,6 +156,7 @@ main(int argc, char * const argv[]) int error, state; u_char *buf; u_int sectorsize; + u_int stripesize; time_t t1, t2; struct stat sb; u_int n, snapshot = 60; @@ -201,6 +202,10 @@ main(int argc, char * const argv[]) if (error < 0) err(1, "DIOCGSECTORSIZE failed"); + error = ioctl(fdr, DIOCGSTRIPESIZE, &stripesize); + if (error == 0 && stripesize > sectorsize) + sectorsize = stripesize; + minsize = sectorsize; bigsize = (bigsize / sectorsize) * sectorsize; From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 08:14:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9F7BDEDA; Mon, 25 Feb 2013 08:14:08 +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 90B95377; Mon, 25 Feb 2013 08:14:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1P8E8jd088812; Mon, 25 Feb 2013 08:14:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1P8E8T1088811; Mon, 25 Feb 2013 08:14:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302250814.r1P8E8T1088811@svn.freebsd.org> From: Xin LI Date: Mon, 25 Feb 2013 08:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247254 - in stable: 8/sbin/recoverdisk 9/sbin/recoverdisk X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 08:14:08 -0000 Author: delphij Date: Mon Feb 25 08:14:07 2013 New Revision: 247254 URL: http://svnweb.freebsd.org/changeset/base/247254 Log: MFC r246329: Use stripesize as smallest block size if it's available. Modified: stable/8/sbin/recoverdisk/recoverdisk.c Directory Properties: stable/8/sbin/recoverdisk/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sbin/recoverdisk/recoverdisk.c Directory Properties: stable/9/sbin/recoverdisk/ (props changed) Modified: stable/8/sbin/recoverdisk/recoverdisk.c ============================================================================== --- stable/8/sbin/recoverdisk/recoverdisk.c Mon Feb 25 08:08:13 2013 (r247253) +++ stable/8/sbin/recoverdisk/recoverdisk.c Mon Feb 25 08:14:07 2013 (r247254) @@ -156,6 +156,7 @@ main(int argc, char * const argv[]) int error, flags, state; u_char *buf; u_int sectorsize; + u_int stripesize; time_t t1, t2; struct stat sb; u_int n, snapshot = 60; @@ -202,6 +203,10 @@ main(int argc, char * const argv[]) if (error < 0) err(1, "DIOCGSECTORSIZE failed"); + error = ioctl(fdr, DIOCGSTRIPESIZE, &stripesize); + if (error == 0 && stripesize > sectorsize) + sectorsize = stripesize; + minsize = sectorsize; bigsize = (bigsize / sectorsize) * sectorsize; From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 08:24:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 69229581; Mon, 25 Feb 2013 08:24:22 +0000 (UTC) (envelope-from hselasky@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 5B49362B; Mon, 25 Feb 2013 08:24:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1P8OMU4092087; Mon, 25 Feb 2013 08:24:22 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1P8OMG1092086; Mon, 25 Feb 2013 08:24:22 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302250824.r1P8OMG1092086@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 25 Feb 2013 08:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247255 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 08:24:22 -0000 Author: hselasky Date: Mon Feb 25 08:24:21 2013 New Revision: 247255 URL: http://svnweb.freebsd.org/changeset/base/247255 Log: Add new USB ID. Submitted by: Dmitry Luhtionov Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Feb 25 08:14:07 2013 (r247254) +++ head/sys/dev/usb/usbdevs Mon Feb 25 08:24:21 2013 (r247255) @@ -650,6 +650,7 @@ vendor OWEN 0x1555 Owen vendor OQO 0x1557 OQO vendor UMEDIA 0x157e U-MEDIA Communications vendor FIBERLINE 0x1582 Fiberline +vendor AFATECH 0x15a4 Afatech Technologies, Inc. vendor SPARKLAN 0x15a9 SparkLAN vendor OLIMEX 0x15ba Olimex vendor SOUNDGRAPH 0x15c2 Soundgraph, Inc. @@ -916,6 +917,9 @@ product ADS UBS10BTX 0x0009 UBS-10BT Et /* AEI products */ product AEI FASTETHERNET 0x1701 Fast Ethernet +/* Afatech Technologies, Inc. */ +product AFATECH AFATECH1336 0x1336 Flash Card Reader + /* Agate Technologies products */ product AGATE QDRIVE 0x0378 Q-Drive From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 08:50:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 35C16C7C; Mon, 25 Feb 2013 08:50:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 86831745; Mon, 25 Feb 2013 08:50:30 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r1P8oJB7025501; Mon, 25 Feb 2013 10:50:19 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r1P8oJB7025501 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r1P8oJAC025500; Mon, 25 Feb 2013 10:50:19 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 25 Feb 2013 10:50:19 +0200 From: Konstantin Belousov To: Andrew Turner Subject: Re: svn commit: r247116 - in head/sys: fs/nfs fs/nfsclient kern nfsclient sys tools Message-ID: <20130225085019.GU2454@kib.kiev.ua> References: <201302211902.r1LJ2o5T033708@svn.freebsd.org> <20130225201313.2050da18@bender> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eHrxbAcqt/LxKPZN" Content-Disposition: inline In-Reply-To: <20130225201313.2050da18@bender> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 08:50:31 -0000 --eHrxbAcqt/LxKPZN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 25, 2013 at 08:13:13PM +1300, Andrew Turner wrote: > On Thu, 21 Feb 2013 19:02:50 +0000 (UTC) > John Baldwin wrote: >=20 > > Author: jhb > > Date: Thu Feb 21 19:02:50 2013 > > New Revision: 247116 > > URL: http://svnweb.freebsd.org/changeset/base/247116 > >=20 > > Log: > > Further refine the handling of stop signals in the NFS client. The > > changes in r246417 were incomplete as they did not add explicit > > calls to sigdeferstop() around all the places that previously passed > > SBDRY to _sleep(). In addition, nfs_getcacheblk() could trigger a > > write RPC from getblk() resulting in sigdeferstop() recursing. > > Rather than manually deferring stop signals in specific places, > > change the VFS_*() and VOP_*() methods to defer stop signals for > > filesystems which request this behavior via a new VFCF_SBDRY flag. > > Note that this has to be a VFC flag rather than a MNTK flag so that > > it works properly with VFS_MOUNT() when the mount is not yet fully > > constructed. For now, only the NFS clients are set this new flag in > > VFS_SET().=20 > > A few other related changes: > > - Add an assertion to ensure that TDF_SBDRY doesn't leak to > > userland. > > - When a lookup request uses VOP_READLINK() to follow a symlink, > > mark the request as being on behalf of the thread performing the > > lookup (cnp_thread) rather than using a NULL thread pointer. This > > causes NFS to properly handle signals during this VOP on an > > interruptible mount. > > =20 > > PR: kern/176179 > > Reported by: Russell Cattelan (sigdeferstop() recursion) > > Reviewed by: kib > > MFC after: 1 month >=20 > This change is causing init to crash for me on armv6. I'm netbooting a > PandaBoard and it appears init is receiving a SIGABRT before it gets > into main(). >=20 > Do you have any idea where I could look to track down why it is doing > this? It is weird. SIGABRT sent by the kernel usually means that execve(2) already destroyed the previous address space of the process, but the new image cannot be activated, most likely due to image format error discovered too late, or resource shortage. Could it be that some NFS RPC fails after the patch, but I cannot imagine why. You would need to track this. Also, verify that the init binary is correct. I tried amd64 netboot, and it worked fine. --eHrxbAcqt/LxKPZN Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRKyXKAAoJEJDCuSvBvK1BrzUQAKJaikkGdd3UCBbUCrf02xkq Fk5bIQGS6EAVwS+2LHH+CAjN9cSZE8QFsTdcZrcpPT7hKpbkjyrSo8vDD3RviERT 11mBtepm7JA8UQOnprnIUMCJny+JOLj9CRiG1+oGPp6Acm1/248wJwShqFC28O4W ApzoxsTacOZ9RO1/jpeR2WGkeB8ypjIsGh+TuFStVfBdkGQihuFl2eaRJPanQn9O esQ1eNkaokWfJD4nXQ0vAtyi6c3HyP1UwLJ4EohcpltIvKUMBWaT6CMwrOYBmLOs Xf9iYpBEsgMqww0ECpIExDIeN326njO36v9AndMsBiYdCfGZ+3eEmcBoohSqQZ8y dJRVIW2YJLN0zWc1c1UC5JnagxdrYzrB6ms2ZCTWdhh59HiTXqQXm+/6vO49I0Gb gWnD6H13JEzfv0sfBe/ZaIb3VFstRmCqtdDAOC9PYyF6t7dc+mzZd+CfkC6ShJbp /2C9nT+E8FbWdwHZ2Y7VOTmm2IZYs3M2P0nOKOfkfQMkAZ1OBrWLwJtclslIA+2e cS1enDYZ6DTmGNDKMqv10qqyOqpFhEnneTvwvRldtpSw76A5SgHJjncfpAEc1i34 qEJXKkMfCMvMzZFEj1kGu7gFcXmWGrRk25jSpMWFraBQ2g1jqiOOdT5MHAZe5AKi pRYiLhYfc70IvI4b3+YX =k2Fp -----END PGP SIGNATURE----- --eHrxbAcqt/LxKPZN-- From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 09:33:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BDE28726; Mon, 25 Feb 2013 09:33:49 +0000 (UTC) (envelope-from gonzo@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 807CB890; Mon, 25 Feb 2013 09:33:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1P9XnOo013019; Mon, 25 Feb 2013 09:33:49 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1P9XnsE013018; Mon, 25 Feb 2013 09:33:49 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201302250933.r1P9XnsE013018@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 25 Feb 2013 09:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247259 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 09:33:49 -0000 Author: gonzo Date: Mon Feb 25 09:33:48 2013 New Revision: 247259 URL: http://svnweb.freebsd.org/changeset/base/247259 Log: Fix off-by-one error in sanity checks Modified: head/sys/arm/ti/ti_gpio.c Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Mon Feb 25 09:22:36 2013 (r247258) +++ head/sys/arm/ti/ti_gpio.c Mon Feb 25 09:33:48 2013 (r247259) @@ -315,7 +315,7 @@ ti_gpio_pin_getcaps(device_t dev, uint32 TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ - if ((bank > MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { + if ((bank >= MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { TI_GPIO_UNLOCK(sc); return (EINVAL); } @@ -353,7 +353,7 @@ ti_gpio_pin_getflags(device_t dev, uint3 TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ - if ((bank > MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { + if ((bank >= MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { TI_GPIO_UNLOCK(sc); return (EINVAL); } @@ -390,7 +390,7 @@ ti_gpio_pin_getname(device_t dev, uint32 TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ - if ((bank > MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { + if ((bank >= MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { TI_GPIO_UNLOCK(sc); return (EINVAL); } @@ -445,7 +445,7 @@ ti_gpio_pin_setflags(device_t dev, uint3 TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ - if ((bank > MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { + if ((bank >= MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { TI_GPIO_UNLOCK(sc); return (EINVAL); } @@ -494,7 +494,7 @@ ti_gpio_pin_set(device_t dev, uint32_t p TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ - if ((bank > MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { + if ((bank >= MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { TI_GPIO_UNLOCK(sc); return (EINVAL); } @@ -533,7 +533,7 @@ ti_gpio_pin_get(device_t dev, uint32_t p TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ - if ((bank > MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { + if ((bank >= MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { TI_GPIO_UNLOCK(sc); return (EINVAL); } @@ -575,7 +575,7 @@ ti_gpio_pin_toggle(device_t dev, uint32_ TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ - if ((bank > MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { + if ((bank >= MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { TI_GPIO_UNLOCK(sc); return (EINVAL); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 10:36:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A52CA6E1; Mon, 25 Feb 2013 10:36:31 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64]) by mx1.freebsd.org (Postfix) with ESMTP id 74667B7E; Mon, 25 Feb 2013 10:36:31 +0000 (UTC) Received: from mxin1-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp3.clear.net.nz (CLEAR Net Mail) with ESMTP id <0MIR0071RUSMEK00@smtp3.clear.net.nz>; Mon, 25 Feb 2013 23:36:23 +1300 (NZDT) Received: from 202-0-48-19.paradise.net.nz (HELO bender) ([202.0.48.19]) by smtpin1.paradise.net.nz with ESMTP; Mon, 25 Feb 2013 23:36:22 +1300 Date: Mon, 25 Feb 2013 23:36:03 +1300 From: Andrew Turner Subject: Re: svn commit: r247116 - in head/sys: fs/nfs fs/nfsclient kern nfsclient sys tools In-reply-to: <20130225085019.GU2454@kib.kiev.ua> To: Konstantin Belousov Message-id: <20130225233603.49a5d4a5@bender> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit References: <201302211902.r1LJ2o5T033708@svn.freebsd.org> <20130225201313.2050da18@bender> <20130225085019.GU2454@kib.kiev.ua> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 10:36:31 -0000 On Mon, 25 Feb 2013 10:50:19 +0200 Konstantin Belousov wrote: > On Mon, Feb 25, 2013 at 08:13:13PM +1300, Andrew Turner wrote: > > On Thu, 21 Feb 2013 19:02:50 +0000 (UTC) > > John Baldwin wrote: > > > > > Author: jhb > > > Date: Thu Feb 21 19:02:50 2013 > > > New Revision: 247116 > > > URL: http://svnweb.freebsd.org/changeset/base/247116 > > > > > > Log: > > > Further refine the handling of stop signals in the NFS client. > > > The changes in r246417 were incomplete as they did not add > > > explicit calls to sigdeferstop() around all the places that > > > previously passed SBDRY to _sleep(). In addition, > > > nfs_getcacheblk() could trigger a write RPC from getblk() > > > resulting in sigdeferstop() recursing. Rather than manually > > > deferring stop signals in specific places, change the VFS_*() and > > > VOP_*() methods to defer stop signals for filesystems which > > > request this behavior via a new VFCF_SBDRY flag. Note that this > > > has to be a VFC flag rather than a MNTK flag so that it works > > > properly with VFS_MOUNT() when the mount is not yet fully > > > constructed. For now, only the NFS clients are set this new flag > > > in VFS_SET(). A few other related changes: > > > - Add an assertion to ensure that TDF_SBDRY doesn't leak to > > > userland. > > > - When a lookup request uses VOP_READLINK() to follow a symlink, > > > mark the request as being on behalf of the thread performing the > > > lookup (cnp_thread) rather than using a NULL thread pointer. This > > > causes NFS to properly handle signals during this VOP on an > > > interruptible mount. > > > > > > PR: kern/176179 > > > Reported by: Russell Cattelan (sigdeferstop() recursion) > > > Reviewed by: kib > > > MFC after: 1 month > > > > This change is causing init to crash for me on armv6. I'm > > netbooting a PandaBoard and it appears init is receiving a SIGABRT > > before it gets into main(). > > > > Do you have any idea where I could look to track down why it is > > doing this? > > It is weird. SIGABRT sent by the kernel usually means that execve(2) > already destroyed the previous address space of the process, but the > new image cannot be activated, most likely due to image format error > discovered too late, or resource shortage. > > Could it be that some NFS RPC fails after the patch, but I cannot > imagine why. You would need to track this. Also, verify that the init > binary is correct. > > I tried amd64 netboot, and it worked fine. It looks like this change is not the issue, it just changed the symptom enough for me to not realise I was seeing an issue where it would crash the kernel before. I reinstated this change but only allowed the kernel to access half the memory and it booted correctly. The real issue appears to be related to something in the vm layer not working on ARM boards with too much memory (somewhere between 512MiB and 1GiB). Andrew From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 10:57:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 66361C4C; Mon, 25 Feb 2013 10:57:36 +0000 (UTC) (envelope-from hselasky@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 5A272D6F; Mon, 25 Feb 2013 10:57:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PAvaOp037642; Mon, 25 Feb 2013 10:57:36 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PAvadM037641; Mon, 25 Feb 2013 10:57:36 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302251057.r1PAvadM037641@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 25 Feb 2013 10:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247263 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 10:57:36 -0000 Author: hselasky Date: Mon Feb 25 10:57:35 2013 New Revision: 247263 URL: http://svnweb.freebsd.org/changeset/base/247263 Log: Fix init/uninit function type. Modified: head/sys/dev/usb/usb_pf.c Modified: head/sys/dev/usb/usb_pf.c ============================================================================== --- head/sys/dev/usb/usb_pf.c Mon Feb 25 10:52:01 2013 (r247262) +++ head/sys/dev/usb/usb_pf.c Mon Feb 25 10:57:35 2013 (r247263) @@ -63,8 +63,8 @@ #include #endif /* USB_GLOBAL_INCLUDE_FILE */ -static void usbpf_init(void); -static void usbpf_uninit(void); +static void usbpf_init(void *); +static void usbpf_uninit(void *); static int usbpf_ioctl(struct ifnet *, u_long, caddr_t); static int usbpf_clone_match(struct if_clone *, const char *); static int usbpf_clone_create(struct if_clone *, char *, size_t, caddr_t); @@ -82,7 +82,7 @@ SYSINIT(usbpf_init, SI_SUB_PSEUDO, SI_OR SYSUNINIT(usbpf_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_uninit, NULL); static void -usbpf_init(void) +usbpf_init(void *arg) { usbpf_cloner = if_clone_advanced(usbusname, 0, usbpf_clone_match, @@ -90,7 +90,7 @@ usbpf_init(void) } static void -usbpf_uninit(void) +usbpf_uninit(void *arg) { int devlcnt; device_t *devlp; From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 11:22:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 841CB154; Mon, 25 Feb 2013 11:22:55 +0000 (UTC) (envelope-from mjacob@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 788451AF; Mon, 25 Feb 2013 11:22:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PBMsmJ046418; Mon, 25 Feb 2013 11:22:54 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PBMsTR046416; Mon, 25 Feb 2013 11:22:54 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201302251122.r1PBMsTR046416@svn.freebsd.org> From: Matt Jacob Date: Mon, 25 Feb 2013 11:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247264 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 11:22:55 -0000 Author: mjacob Date: Mon Feb 25 11:22:54 2013 New Revision: 247264 URL: http://svnweb.freebsd.org/changeset/base/247264 Log: 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. Noticed by: Bugs in NetBSD. Only a NetBSD user might actually still use such old hardware. MFC after: 1 week Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Mon Feb 25 10:57:35 2013 (r247263) +++ head/sys/dev/isp/isp.c Mon Feb 25 11:22:54 2013 (r247264) @@ -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-all@FreeBSD.ORG Mon Feb 25 11:55:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3FB4C629; Mon, 25 Feb 2013 11:55:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8E98A341; Mon, 25 Feb 2013 11:55:06 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r1PBt1Il056992; Mon, 25 Feb 2013 13:55:01 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r1PBt1Il056992 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r1PBt01x056975; Mon, 25 Feb 2013 13:55:00 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 25 Feb 2013 13:55:00 +0200 From: Konstantin Belousov To: Andrew Turner Subject: Re: svn commit: r247116 - in head/sys: fs/nfs fs/nfsclient kern nfsclient sys tools Message-ID: <20130225115500.GW2454@kib.kiev.ua> References: <201302211902.r1LJ2o5T033708@svn.freebsd.org> <20130225201313.2050da18@bender> <20130225085019.GU2454@kib.kiev.ua> <20130225233603.49a5d4a5@bender> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GVLQrlG8+/jMfW4X" Content-Disposition: inline In-Reply-To: <20130225233603.49a5d4a5@bender> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 11:55:07 -0000 --GVLQrlG8+/jMfW4X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 25, 2013 at 11:36:03PM +1300, Andrew Turner wrote: > On Mon, 25 Feb 2013 10:50:19 +0200 > Konstantin Belousov wrote: >=20 > > On Mon, Feb 25, 2013 at 08:13:13PM +1300, Andrew Turner wrote: > > > On Thu, 21 Feb 2013 19:02:50 +0000 (UTC) > > > John Baldwin wrote: > > >=20 > > > > Author: jhb > > > > Date: Thu Feb 21 19:02:50 2013 > > > > New Revision: 247116 > > > > URL: http://svnweb.freebsd.org/changeset/base/247116 > > > >=20 > > > > Log: > > > > Further refine the handling of stop signals in the NFS client. > > > > The changes in r246417 were incomplete as they did not add > > > > explicit calls to sigdeferstop() around all the places that > > > > previously passed SBDRY to _sleep(). In addition, > > > > nfs_getcacheblk() could trigger a write RPC from getblk() > > > > resulting in sigdeferstop() recursing. Rather than manually > > > > deferring stop signals in specific places, change the VFS_*() and > > > > VOP_*() methods to defer stop signals for filesystems which > > > > request this behavior via a new VFCF_SBDRY flag. Note that this > > > > has to be a VFC flag rather than a MNTK flag so that it works > > > > properly with VFS_MOUNT() when the mount is not yet fully > > > > constructed. For now, only the NFS clients are set this new flag > > > > in VFS_SET(). A few other related changes: > > > > - Add an assertion to ensure that TDF_SBDRY doesn't leak to > > > > userland. > > > > - When a lookup request uses VOP_READLINK() to follow a symlink, > > > > mark the request as being on behalf of the thread performing the > > > > lookup (cnp_thread) rather than using a NULL thread pointer. This > > > > causes NFS to properly handle signals during this VOP on an > > > > interruptible mount. > > > > =20 > > > > PR: kern/176179 > > > > Reported by: Russell Cattelan (sigdeferstop() recursion) > > > > Reviewed by: kib > > > > MFC after: 1 month > > >=20 > > > This change is causing init to crash for me on armv6. I'm > > > netbooting a PandaBoard and it appears init is receiving a SIGABRT > > > before it gets into main(). > > >=20 > > > Do you have any idea where I could look to track down why it is > > > doing this? > >=20 > > It is weird. SIGABRT sent by the kernel usually means that execve(2) > > already destroyed the previous address space of the process, but the > > new image cannot be activated, most likely due to image format error > > discovered too late, or resource shortage. > >=20 > > Could it be that some NFS RPC fails after the patch, but I cannot > > imagine why. You would need to track this. Also, verify that the init > > binary is correct. > >=20 > > I tried amd64 netboot, and it worked fine. >=20 > It looks like this change is not the issue, it just changed the > symptom enough for me to not realise I was seeing an issue where > it would crash the kernel before. I reinstated this change but only > allowed the kernel to access half the memory and it booted correctly. >=20 > The real issue appears to be related to something in the vm layer not > working on ARM boards with too much memory (somewhere between 512MiB > and 1GiB). Hm, do you have r246926, r246929 and r247046 ? --GVLQrlG8+/jMfW4X Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRK1ETAAoJEJDCuSvBvK1Bu9EP/2ymcl0cpBUfw1VGwy3++vJM /A+0ON4aj/5mHCOyp526FUD5OMscS7wWMKWQuFdj4rueYFk7ctJjbmHM3xu4CJQZ xUxCAr13YJvuTwpkMQerM/YtFF9UzeKOkUKag4K4ozfmVeDjuoyLZu3rdSJPzsjl BPDww5dSr3UFUW2yQkMQMlrrhYIU0g79BUQsWgLJWH16dzRuGn4knMbor/l4bhyL 37Sb0huWawU1kaPzrJFahPyeov2AuQsDpGdv7eOdYCGLDtzYbMXAv4mo8b3Th7sX E0ZG1eU/+kObUnI67zpRUl2jl/c5VrVfY21NBePW1PMfzpbze7jFoJtqs45G1NXU fGfg1NLeX3H/8k/qj0BOE1gX+MI+FzRYgCW7M8YUIxQhGk3FyW06LqrGDLDUIaeW E03UAJxhmVw7femVLmvpH+ZCOaBDXximEhIfH4c0DTwH+kSbTR3U+31tCXMrC08r qXWbEAnOTDcWJvhIPmlrP2eI/z0MxYwFSBdClM2s/grPeQatFZbIvBzsdAxthw76 khK0GqmxGyrnYUi5wRrfBz5STpRqZxGiCe0tfOFvGmUj8Ba0xV8G0eDAdUbG9f1f OMDs9jHSZkilDnX3uOTBpohXUS7ioERGCvsrjdyX9Z5duTZC8A2I99ks1VwiuagA C747Nh4J7fKXXIVo0r8x =STI5 -----END PGP SIGNATURE----- --GVLQrlG8+/jMfW4X-- From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 12:33:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C48003E3; Mon, 25 Feb 2013 12:33:35 +0000 (UTC) (envelope-from mm@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 993377AE; Mon, 25 Feb 2013 12:33:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PCXZgP067420; Mon, 25 Feb 2013 12:33:35 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PCXWD0067392; Mon, 25 Feb 2013 12:33:32 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201302251233.r1PCXWD0067392@svn.freebsd.org> From: Martin Matuska Date: Mon, 25 Feb 2013 12:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247265 - in head: cddl/contrib/opensolaris/cmd/zinject cddl/contrib/opensolaris/lib/libzpool/common cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/compat/opensolaris/sys sys... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 12:33:35 -0000 Author: mm Date: Mon Feb 25 12:33:31 2013 New Revision: 247265 URL: http://svnweb.freebsd.org/changeset/base/247265 Log: MFV v242732: Merge the ZFS I/O deadman thread from vendor (illumos). This feature panics the system on hanging ZFS I/O, helps debugging and resumes failed service. The panic behavior can be controlled with the loader-only tunables: vfs.zfs.deadman_enabled (enable or disable panic on stalled ZFS I/O) vfs.zfs.deadman_synctime (expiration time for stalled ZFS I/O) By default, ZFS I/O deadman is enabled by default on amd64 and i386 excluding virtual guest machines. Illumos ZFS issues: 3246 ZFS I/O deadman thread References: https://www.illumos.org/issues/3246 MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zinject/translate.c head/cddl/contrib/opensolaris/cmd/zinject/zinject.c head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h head/sys/cddl/compat/opensolaris/sys/time.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_boot.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zinject/translate.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zinject/translate.c Mon Feb 25 11:22:54 2013 (r247264) +++ head/cddl/contrib/opensolaris/cmd/zinject/translate.c Mon Feb 25 12:33:31 2013 (r247265) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -455,6 +456,20 @@ translate_device(const char *pool, const &record->zi_guid) == 0); } + /* + * Device faults can take on three different forms: + * 1). delayed or hanging I/O + * 2). zfs label faults + * 3). generic disk faults + */ + if (record->zi_timer != 0) { + record->zi_cmd = ZINJECT_DELAY_IO; + } else if (label_type != TYPE_INVAL) { + record->zi_cmd = ZINJECT_LABEL_FAULT; + } else { + record->zi_cmd = ZINJECT_DEVICE_FAULT; + } + switch (label_type) { case TYPE_LABEL_UBERBLOCK: record->zi_start = offsetof(vdev_label_t, vl_uberblock[0]); Modified: head/cddl/contrib/opensolaris/cmd/zinject/zinject.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Feb 25 11:22:54 2013 (r247264) +++ head/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Feb 25 12:33:31 2013 (r247265) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* @@ -603,7 +604,7 @@ main(int argc, char **argv) } while ((c = getopt(argc, argv, - ":aA:b:d:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:")) != -1) { + ":aA:b:d:D:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:")) != -1) { switch (c) { case 'a': flags |= ZINJECT_FLUSH_ARC; @@ -629,6 +630,15 @@ main(int argc, char **argv) case 'd': device = optarg; break; + case 'D': + record.zi_timer = strtoull(optarg, &end, 10); + if (errno != 0 || *end != '\0') { + (void) fprintf(stderr, "invalid i/o delay " + "value: '%s'\n", optarg); + usage(); + return (1); + } + break; case 'e': if (strcasecmp(optarg, "io") == 0) { error = EIO; @@ -693,6 +703,7 @@ main(int argc, char **argv) case 'p': (void) strlcpy(record.zi_func, optarg, sizeof (record.zi_func)); + record.zi_cmd = ZINJECT_PANIC; break; case 'q': quiet = 1; @@ -766,13 +777,15 @@ main(int argc, char **argv) argc -= optind; argv += optind; + if (record.zi_duration != 0) + record.zi_cmd = ZINJECT_IGNORED_WRITES; + if (cancel != NULL) { /* * '-c' is invalid with any other options. */ if (raw != NULL || range != NULL || type != TYPE_INVAL || - level != 0 || record.zi_func[0] != '\0' || - record.zi_duration != 0) { + level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED) { (void) fprintf(stderr, "cancel (-c) incompatible with " "any other options\n"); usage(); @@ -804,8 +817,7 @@ main(int argc, char **argv) * for doing injection, so handle it separately here. */ if (raw != NULL || range != NULL || type != TYPE_INVAL || - level != 0 || record.zi_func[0] != '\0' || - record.zi_duration != 0) { + level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED) { (void) fprintf(stderr, "device (-d) incompatible with " "data error injection\n"); usage(); @@ -839,7 +851,7 @@ main(int argc, char **argv) } else if (raw != NULL) { if (range != NULL || type != TYPE_INVAL || level != 0 || - record.zi_func[0] != '\0' || record.zi_duration != 0) { + record.zi_cmd != ZINJECT_UNINITIALIZED) { (void) fprintf(stderr, "raw (-b) format with " "any other options\n"); usage(); @@ -862,13 +874,14 @@ main(int argc, char **argv) return (1); } + record.zi_cmd = ZINJECT_DATA_FAULT; if (translate_raw(raw, &record) != 0) return (1); if (!error) error = EIO; - } else if (record.zi_func[0] != '\0') { + } else if (record.zi_cmd == ZINJECT_PANIC) { if (raw != NULL || range != NULL || type != TYPE_INVAL || - level != 0 || device != NULL || record.zi_duration != 0) { + level != 0 || device != NULL) { (void) fprintf(stderr, "panic (-p) incompatible with " "other options\n"); usage(); @@ -886,7 +899,7 @@ main(int argc, char **argv) if (argv[1] != NULL) record.zi_type = atoi(argv[1]); dataset[0] = '\0'; - } else if (record.zi_duration != 0) { + } else if (record.zi_cmd == ZINJECT_IGNORED_WRITES) { if (nowrites == 0) { (void) fprintf(stderr, "-s or -g meaningless " "without -I (ignore writes)\n"); @@ -940,6 +953,7 @@ main(int argc, char **argv) return (1); } + record.zi_cmd = ZINJECT_DATA_FAULT; if (translate_record(type, argv[0], range, level, &record, pool, dataset) != 0) return (1); Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Mon Feb 25 11:22:54 2013 (r247264) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Mon Feb 25 12:33:31 2013 (r247265) @@ -45,6 +45,9 @@ int aok; uint64_t physmem; vnode_t *rootdir = (vnode_t *)0xabcd1234; char hw_serial[HW_HOSTID_LEN]; +#ifdef illumos +kmutex_t cpu_lock; +#endif struct utsname utsname = { "userland", "libzpool", "1", "1", "na" @@ -842,6 +845,28 @@ ddi_strtoull(const char *str, char **npt return (0); } +#ifdef illumos +/* ARGSUSED */ +cyclic_id_t +cyclic_add(cyc_handler_t *hdlr, cyc_time_t *when) +{ + return (1); +} + +/* ARGSUSED */ +void +cyclic_remove(cyclic_id_t id) +{ +} + +/* ARGSUSED */ +int +cyclic_reprogram(cyclic_id_t id, hrtime_t expiration) +{ + return (1); +} +#endif + /* * ========================================================================= * kernel emulation setup & teardown @@ -875,6 +900,10 @@ kernel_init(int mode) system_taskq_init(); +#ifdef illumos + mutex_init(&cpu_lock, NULL, MUTEX_DEFAULT, NULL); +#endif + spa_init(mode); } Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Mon Feb 25 11:22:54 2013 (r247264) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Mon Feb 25 12:33:31 2013 (r247265) @@ -457,6 +457,9 @@ extern vnode_t *rootdir; extern void delay(clock_t ticks); +#define SEC_TO_TICK(sec) ((sec) * hz) +#define NSEC_TO_TICK(usec) ((usec) / (NANOSEC / hz)) + #define gethrestime_sec() time(NULL) #define gethrestime(t) \ do {\ @@ -624,6 +627,36 @@ typedef uint32_t idmap_rid_t; #define ERESTART (-1) #endif +#ifdef illumos +/* + * Cyclic information + */ +extern kmutex_t cpu_lock; + +typedef uintptr_t cyclic_id_t; +typedef uint16_t cyc_level_t; +typedef void (*cyc_func_t)(void *); + +#define CY_LOW_LEVEL 0 +#define CY_INFINITY INT64_MAX +#define CYCLIC_NONE ((cyclic_id_t)0) + +typedef struct cyc_time { + hrtime_t cyt_when; + hrtime_t cyt_interval; +} cyc_time_t; + +typedef struct cyc_handler { + cyc_func_t cyh_func; + void *cyh_arg; + cyc_level_t cyh_level; +} cyc_handler_t; + +extern cyclic_id_t cyclic_add(cyc_handler_t *, cyc_time_t *); +extern void cyclic_remove(cyclic_id_t); +extern int cyclic_reprogram(cyclic_id_t, hrtime_t); +#endif /* illumos */ + #ifdef __cplusplus } #endif Modified: head/sys/cddl/compat/opensolaris/sys/time.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/time.h Mon Feb 25 11:22:54 2013 (r247264) +++ head/sys/cddl/compat/opensolaris/sys/time.h Mon Feb 25 12:33:31 2013 (r247265) @@ -46,6 +46,9 @@ typedef longlong_t hrtime_t; ((ts)->tv_sec < INT64_MIN || (ts)->tv_sec > INT64_MAX) #endif +#define SEC_TO_TICK(sec) ((sec) * hz) +#define NSEC_TO_TICK(usec) ((usec) / (NANOSEC / hz)) + #ifdef _KERNEL static __inline hrtime_t gethrtime(void) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 25 11:22:54 2013 (r247264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 25 12:33:31 2013 (r247265) @@ -22,6 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 Martin Matuska . All rights reserved. */ /* @@ -141,6 +142,10 @@ uint_t zio_taskq_basedc = 80; /* base boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */ extern int zfs_sync_pass_deferred_free; +#ifndef illumos +extern void spa_deadman(void *arg); +#endif + /* * This (illegal) pool name is used when temporarily importing a spa_t in order * to get the vdev stats associated with the imported devices. @@ -6258,6 +6263,17 @@ spa_sync(spa_t *spa, uint64_t txg) tx = dmu_tx_create_assigned(dp, txg); + spa->spa_sync_starttime = gethrtime(); +#ifdef illumos + VERIFY(cyclic_reprogram(spa->spa_deadman_cycid, + spa->spa_sync_starttime + spa->spa_deadman_synctime)); +#else /* FreeBSD */ +#ifdef _KERNEL + callout_reset(&spa->spa_deadman_cycid, + hz * spa->spa_deadman_synctime / NANOSEC, spa_deadman, spa); +#endif +#endif + /* * If we are upgrading to SPA_VERSION_RAIDZ_DEFLATE this txg, * set spa_deflate if we have no raid-z vdevs. @@ -6386,6 +6402,14 @@ spa_sync(spa_t *spa, uint64_t txg) } dmu_tx_commit(tx); +#ifdef illumos + VERIFY(cyclic_reprogram(spa->spa_deadman_cycid, CY_INFINITY)); +#else /* FreeBSD */ +#ifdef _KERNEL + callout_drain(&spa->spa_deadman_cycid); +#endif +#endif + /* * Clear the dirty config list. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Feb 25 11:22:54 2013 (r247264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Feb 25 12:33:31 2013 (r247265) @@ -22,10 +22,12 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2013 Martin Matuska . All rights reserved. */ #include #include +#include #include #include #include @@ -253,6 +255,52 @@ TUNABLE_INT("vfs.zfs.recover", &zfs_reco SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0, "Try to recover from otherwise-fatal errors."); +extern int zfs_txg_synctime_ms; + +/* + * Expiration time in units of zfs_txg_synctime_ms. This value has two + * meanings. First it is used to determine when the spa_deadman logic + * should fire. By default the spa_deadman will fire if spa_sync has + * not completed in 1000 * zfs_txg_synctime_ms (i.e. 1000 seconds). + * Secondly, the value determines if an I/O is considered "hung". + * Any I/O that has not completed in zfs_deadman_synctime is considered + * "hung" resulting in a system panic. + * 1000 zfs_txg_synctime_ms (i.e. 1000 seconds). + */ +uint64_t zfs_deadman_synctime = 1000ULL; +TUNABLE_QUAD("vfs.zfs.deadman_synctime", &zfs_deadman_synctime); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime, CTLFLAG_RDTUN, + &zfs_deadman_synctime, 0, + "Stalled ZFS I/O expiration time in units of vfs.zfs.txg_synctime_ms"); + +/* + * Default value of -1 for zfs_deadman_enabled is resolved in + * zfs_deadman_init() + */ +int zfs_deadman_enabled = -1; +TUNABLE_INT("vfs.zfs.deadman_enabled", &zfs_deadman_enabled); +SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RDTUN, + &zfs_deadman_enabled, 0, "Kernel panic on stalled ZFS I/O"); + +#ifndef illumos +#ifdef _KERNEL +static void +zfs_deadman_init() +{ + /* + * If we are not i386 or amd64 or in a virtual machine, + * disable ZFS deadman thread by default + */ + if (zfs_deadman_enabled == -1) { +#if defined(__amd64__) || defined(__i386__) + zfs_deadman_enabled = (vm_guest == VM_GUEST_NO) ? 1 : 0; +#else + zfs_deadman_enabled = 0; +#endif + } +} +#endif /* _KERNEL */ +#endif /* !illumos */ /* * ========================================================================== @@ -422,6 +470,23 @@ spa_lookup(const char *name) } /* + * Fires when spa_sync has not completed within zfs_deadman_synctime_ms. + * If the zfs_deadman_enabled flag is set then it inspects all vdev queues + * looking for potentially hung I/Os. + */ +void +spa_deadman(void *arg) +{ + spa_t *spa = arg; + + zfs_dbgmsg("slow spa_sync: started %llu seconds ago, calls %llu", + (gethrtime() - spa->spa_sync_starttime) / NANOSEC, + ++spa->spa_deadman_calls); + if (zfs_deadman_enabled) + vdev_deadman(spa->spa_root_vdev); +} + +/* * Create an uninitialized spa_t with the given name. Requires * spa_namespace_lock. The caller must ensure that the spa_t doesn't already * exist by calling spa_lookup() first. @@ -431,6 +496,10 @@ spa_add(const char *name, nvlist_t *conf { spa_t *spa; spa_config_dirent_t *dp; +#ifdef illumos + cyc_handler_t hdlr; + cyc_time_t when; +#endif ASSERT(MUTEX_HELD(&spa_namespace_lock)); @@ -462,6 +531,32 @@ spa_add(const char *name, nvlist_t *conf spa->spa_proc = &p0; spa->spa_proc_state = SPA_PROC_NONE; +#ifdef illumos + hdlr.cyh_func = spa_deadman; + hdlr.cyh_arg = spa; + hdlr.cyh_level = CY_LOW_LEVEL; +#endif + + spa->spa_deadman_synctime = zfs_deadman_synctime * + zfs_txg_synctime_ms * MICROSEC; + +#ifdef illumos + /* + * This determines how often we need to check for hung I/Os after + * the cyclic has already fired. Since checking for hung I/Os is + * an expensive operation we don't want to check too frequently. + * Instead wait for 5 synctimes before checking again. + */ + when.cyt_interval = 5ULL * zfs_txg_synctime_ms * MICROSEC; + when.cyt_when = CY_INFINITY; + mutex_enter(&cpu_lock); + spa->spa_deadman_cycid = cyclic_add(&hdlr, &when); + mutex_exit(&cpu_lock); +#else /* !illumos */ +#ifdef _KERNEL + callout_init(&spa->spa_deadman_cycid, CALLOUT_MPSAFE); +#endif +#endif refcount_create(&spa->spa_refcount); spa_config_lock_init(spa); @@ -544,6 +639,18 @@ spa_remove(spa_t *spa) nvlist_free(spa->spa_load_info); spa_config_set(spa, NULL); +#ifdef illumos + mutex_enter(&cpu_lock); + if (spa->spa_deadman_cycid != CYCLIC_NONE) + cyclic_remove(spa->spa_deadman_cycid); + mutex_exit(&cpu_lock); + spa->spa_deadman_cycid = CYCLIC_NONE; +#else /* !illumos */ +#ifdef _KERNEL + callout_drain(&spa->spa_deadman_cycid); +#endif +#endif + refcount_destroy(&spa->spa_refcount); spa_config_lock_destroy(spa); @@ -1511,6 +1618,12 @@ spa_prev_software_version(spa_t *spa) } uint64_t +spa_deadman_synctime(spa_t *spa) +{ + return (spa->spa_deadman_synctime); +} + +uint64_t dva_get_dsize_sync(spa_t *spa, const dva_t *dva) { uint64_t asize = DVA_GET_ASIZE(dva); @@ -1605,7 +1718,9 @@ spa_init(int mode) spa_mode_global = mode; #ifdef illumos -#ifndef _KERNEL +#ifdef _KERNEL + spa_arch_init(); +#else if (spa_mode_global != FREAD && dprintf_find_string("watch")) { arc_procfd = open("/proc/self/ctl", O_WRONLY); if (arc_procfd == -1) { @@ -1629,6 +1744,11 @@ spa_init(int mode) zpool_feature_init(); spa_config_load(); l2arc_start(); +#ifndef illumos +#ifdef _KERNEL + zfs_deadman_init(); +#endif +#endif /* !illumos */ } void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Feb 25 11:22:54 2013 (r247264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Feb 25 12:33:31 2013 (r247265) @@ -599,6 +599,7 @@ extern boolean_t spa_suspended(spa_t *sp extern uint64_t spa_bootfs(spa_t *spa); extern uint64_t spa_delegation(spa_t *spa); extern objset_t *spa_meta_objset(spa_t *spa); +extern uint64_t spa_deadman_synctime(spa_t *spa); /* Miscellaneous support routines */ extern void spa_activate_mos_feature(spa_t *spa, const char *feature); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_boot.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_boot.h Mon Feb 25 11:22:54 2013 (r247264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_boot.h Mon Feb 25 12:33:31 2013 (r247265) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _SYS_SPA_BOOT_H #define _SYS_SPA_BOOT_H @@ -35,6 +39,8 @@ extern "C" { extern char *spa_get_bootprop(char *prop); extern void spa_free_bootprop(char *prop); +extern void spa_arch_init(void); + #ifdef __cplusplus } #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Mon Feb 25 11:22:54 2013 (r247264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Mon Feb 25 12:33:31 2013 (r247265) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2013 Martin Matuska . All rights reserved. */ #ifndef _SYS_SPA_IMPL_H @@ -230,6 +231,16 @@ struct spa { uint64_t spa_feat_for_write_obj; /* required to write to pool */ uint64_t spa_feat_for_read_obj; /* required to read from pool */ uint64_t spa_feat_desc_obj; /* Feature descriptions */ +#ifdef illumos + cyclic_id_t spa_deadman_cycid; /* cyclic id */ +#else /* FreeBSD */ +#ifdef _KERNEL + struct callout spa_deadman_cycid; /* callout id */ +#endif +#endif /* illumos */ + uint64_t spa_deadman_calls; /* number of deadman calls */ + uint64_t spa_sync_starttime; /* starting time fo spa_sync */ + uint64_t spa_deadman_synctime; /* deadman expiration timer */ /* * spa_refcnt & spa_config_lock must be the last elements * because refcount_t changes size based on compilation options. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Mon Feb 25 11:22:54 2013 (r247264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Mon Feb 25 12:33:31 2013 (r247265) @@ -80,6 +80,7 @@ extern void vdev_metaslab_fini(vdev_t *v extern void vdev_metaslab_set_size(vdev_t *); extern void vdev_expand(vdev_t *vd, uint64_t txg); extern void vdev_split(vdev_t *vd); +extern void vdev_deadman(vdev_t *vd); extern void vdev_get_stats(vdev_t *vd, vdev_stat_t *vs); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 25 11:22:54 2013 (r247264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 25 12:33:31 2013 (r247265) @@ -104,6 +104,8 @@ struct vdev_queue { avl_tree_t vq_read_tree; avl_tree_t vq_write_tree; avl_tree_t vq_pending_tree; + uint64_t vq_io_complete_ts; + uint64_t vq_io_delta_ts; kmutex_t vq_lock; }; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Mon Feb 25 11:22:54 2013 (r247264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Mon Feb 25 12:33:31 2013 (r247265) @@ -22,6 +22,10 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #ifndef _SYS_ZFS_CONTEXT_H #define _SYS_ZFS_CONTEXT_H @@ -88,6 +92,11 @@ extern "C" { #include #include #include +#ifdef illumos +#include +#else /* FreeBSD */ +#include +#endif #include Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Mon Feb 25 11:22:54 2013 (r247264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Mon Feb 25 12:33:31 2013 (r247265) @@ -246,12 +246,24 @@ typedef struct zinject_record { uint32_t zi_iotype; int32_t zi_duration; uint64_t zi_timer; + uint32_t zi_cmd; + uint32_t zi_pad; } zinject_record_t; #define ZINJECT_NULL 0x1 #define ZINJECT_FLUSH_ARC 0x2 #define ZINJECT_UNLOAD_SPA 0x4 +typedef enum zinject_type { + ZINJECT_UNINITIALIZED, + ZINJECT_DATA_FAULT, + ZINJECT_DEVICE_FAULT, + ZINJECT_LABEL_FAULT, + ZINJECT_IGNORED_WRITES, + ZINJECT_PANIC, + ZINJECT_DELAY_IO, +} zinject_type_t; + typedef struct zfs_share { uint64_t z_exportdata; uint64_t z_sharedata; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Feb 25 11:22:54 2013 (r247264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Feb 25 12:33:31 2013 (r247265) @@ -443,6 +443,7 @@ struct zio { uint64_t io_offset; uint64_t io_deadline; + uint64_t io_timestamp; avl_node_t io_offset_node; avl_node_t io_deadline_node; avl_tree_t *io_vdev_tree; @@ -596,6 +597,7 @@ extern int zio_handle_fault_injection(zi extern int zio_handle_device_injection(vdev_t *vd, zio_t *zio, int error); extern int zio_handle_label_injection(zio_t *zio, int error); extern void zio_handle_ignored_writes(zio_t *zio); +extern uint64_t zio_handle_io_delay(zio_t *zio); /* * Checksum ereport functions Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 25 11:22:54 2013 (r247264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 25 12:33:31 2013 (r247265) @@ -3173,3 +3173,41 @@ vdev_split(vdev_t *vd) } vdev_propagate_state(cvd); } + +void +vdev_deadman(vdev_t *vd) +{ + for (int c = 0; c < vd->vdev_children; c++) { + vdev_t *cvd = vd->vdev_child[c]; + + vdev_deadman(cvd); + } + + if (vd->vdev_ops->vdev_op_leaf) { + vdev_queue_t *vq = &vd->vdev_queue; + + mutex_enter(&vq->vq_lock); + if (avl_numnodes(&vq->vq_pending_tree) > 0) { + spa_t *spa = vd->vdev_spa; + zio_t *fio; + uint64_t delta; + + /* + * Look at the head of all the pending queues, + * if any I/O has been outstanding for longer than + * the spa_deadman_synctime we panic the system. + */ + fio = avl_first(&vq->vq_pending_tree); + delta = ddi_get_lbolt64() - fio->io_timestamp; + if (delta > NSEC_TO_TICK(spa_deadman_synctime(spa))) { + zfs_dbgmsg("SLOW IO: zio timestamp %llu, " + "delta %llu, last io %llu", + fio->io_timestamp, delta, + vq->vq_io_complete_ts); + fm_panic("I/O to pool '%s' appears to be " + "hung.", spa_name(spa)); + } + } + mutex_exit(&vq->vq_lock); + } +} Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Mon Feb 25 11:22:54 2013 (r247264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Mon Feb 25 12:33:31 2013 (r247265) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #include #include #include @@ -315,6 +319,7 @@ again: zio_buf_alloc(size), size, fio->io_type, ZIO_PRIORITY_AGG, flags | ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE, vdev_queue_agg_io_done, NULL); + aio->io_timestamp = fio->io_timestamp; nio = fio; do { @@ -386,7 +391,8 @@ vdev_queue_io(zio_t *zio) mutex_enter(&vq->vq_lock); - zio->io_deadline = (ddi_get_lbolt64() >> zfs_vdev_time_shift) + + zio->io_timestamp = ddi_get_lbolt64(); + zio->io_deadline = (zio->io_timestamp >> zfs_vdev_time_shift) + zio->io_priority; vdev_queue_io_add(vq, zio); @@ -411,10 +417,16 @@ vdev_queue_io_done(zio_t *zio) { vdev_queue_t *vq = &zio->io_vd->vdev_queue; + if (zio_injection_enabled) + delay(SEC_TO_TICK(zio_handle_io_delay(zio))); + mutex_enter(&vq->vq_lock); avl_remove(&vq->vq_pending_tree, zio); + vq->vq_io_complete_ts = ddi_get_lbolt64(); + vq->vq_io_delta_ts = vq->vq_io_complete_ts - zio->io_timestamp; + for (int i = 0; i < zfs_vdev_ramp_rate; i++) { zio_t *nio = vdev_queue_io_to_issue(vq, zfs_vdev_max_pending); if (nio == NULL) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c Mon Feb 25 11:22:54 2013 (r247264) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c Mon Feb 25 12:33:31 2013 (r247265) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* @@ -147,14 +148,8 @@ zio_handle_fault_injection(zio_t *zio, i for (handler = list_head(&inject_handlers); handler != NULL; handler = list_next(&inject_handlers, handler)) { - /* Ignore errors not destined for this pool */ - if (zio->io_spa != handler->zi_spa) - continue; - - /* Ignore device errors and panic injection */ - if (handler->zi_record.zi_guid != 0 || - handler->zi_record.zi_func[0] != '\0' || - handler->zi_record.zi_duration != 0) + if (zio->io_spa != handler->zi_spa || + handler->zi_record.zi_cmd != ZINJECT_DATA_FAULT) continue; /* If this handler matches, return EIO */ @@ -197,10 +192,7 @@ zio_handle_label_injection(zio_t *zio, i uint64_t start = handler->zi_record.zi_start; uint64_t end = handler->zi_record.zi_end; - /* Ignore device only faults or panic injection */ - if (handler->zi_record.zi_start == 0 || - handler->zi_record.zi_func[0] != '\0' || - handler->zi_record.zi_duration != 0) + if (handler->zi_record.zi_cmd != ZINJECT_LABEL_FAULT) continue; /* @@ -246,13 +238,7 @@ zio_handle_device_injection(vdev_t *vd, for (handler = list_head(&inject_handlers); handler != NULL; handler = list_next(&inject_handlers, handler)) { - /* - * Ignore label specific faults, panic injection - * or fake writes - */ - if (handler->zi_record.zi_start != 0 || - handler->zi_record.zi_func[0] != '\0' || - handler->zi_record.zi_duration != 0) + if (handler->zi_record.zi_cmd != ZINJECT_DEVICE_FAULT) continue; if (vd->vdev_guid == handler->zi_record.zi_guid) { @@ -316,10 +302,8 @@ zio_handle_ignored_writes(zio_t *zio) handler = list_next(&inject_handlers, handler)) { /* Ignore errors not destined for this pool */ - if (zio->io_spa != handler->zi_spa) - continue; - - if (handler->zi_record.zi_duration == 0) + if (zio->io_spa != handler->zi_spa || + handler->zi_record.zi_cmd != ZINJECT_IGNORED_WRITES) continue; /* @@ -355,11 +339,8 @@ spa_handle_ignored_writes(spa_t *spa) for (handler = list_head(&inject_handlers); handler != NULL; handler = list_next(&inject_handlers, handler)) { - /* Ignore errors not destined for this pool */ - if (spa != handler->zi_spa) - continue; - - if (handler->zi_record.zi_duration == 0) + if (spa != handler->zi_spa || + handler->zi_record.zi_cmd != ZINJECT_IGNORED_WRITES) continue; if (handler->zi_record.zi_duration > 0) { @@ -379,6 +360,34 @@ spa_handle_ignored_writes(spa_t *spa) rw_exit(&inject_lock); } +uint64_t +zio_handle_io_delay(zio_t *zio) +{ + vdev_t *vd = zio->io_vd; + inject_handler_t *handler; + uint64_t seconds = 0; + + if (zio_injection_enabled == 0) + return (0); + + rw_enter(&inject_lock, RW_READER); + + for (handler = list_head(&inject_handlers); handler != NULL; + handler = list_next(&inject_handlers, handler)) { + + if (handler->zi_record.zi_cmd != ZINJECT_DELAY_IO) + continue; + + if (vd->vdev_guid == handler->zi_record.zi_guid) { + seconds = handler->zi_record.zi_timer; + break; + } + + } + rw_exit(&inject_lock); + return (seconds); +} + /* * Create a new handler for the given record. We add it to the list, adding * a reference to the spa_t in the process. We increment zio_injection_enabled, From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 14:06:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 74CFBB55; Mon, 25 Feb 2013 14:06:25 +0000 (UTC) (envelope-from mjacob@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 4E476E81; Mon, 25 Feb 2013 14:06:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PE6PMi094824; Mon, 25 Feb 2013 14:06:25 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PE6P2K094823; Mon, 25 Feb 2013 14:06:25 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201302251406.r1PE6P2K094823@svn.freebsd.org> From: Matt Jacob Date: Mon, 25 Feb 2013 14:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247266 - head/sys/dev/sym X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 14:06:25 -0000 Author: mjacob Date: Mon Feb 25 14:06:24 2013 New Revision: 247266 URL: http://svnweb.freebsd.org/changeset/base/247266 Log: Don't try and negotiate sync mode if either period or offset are zero. PR: kern/163064 Partially Submitted by: Peter MFC after: 1 month Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Mon Feb 25 12:33:31 2013 (r247265) +++ head/sys/dev/sym/sym_hipd.c Mon Feb 25 14:06:24 2013 (r247266) @@ -8211,8 +8211,13 @@ static void sym_update_trans(hcb_p np, t * Scale against driver configuration limits. */ if (tip->width > SYM_SETUP_MAX_WIDE) tip->width = SYM_SETUP_MAX_WIDE; - if (tip->offset > SYM_SETUP_MAX_OFFS) tip->offset = SYM_SETUP_MAX_OFFS; - if (tip->period < SYM_SETUP_MIN_SYNC) tip->period = SYM_SETUP_MIN_SYNC; + if (tip->period && tip->offset) { + if (tip->offset > SYM_SETUP_MAX_OFFS) tip->offset = SYM_SETUP_MAX_OFFS; + if (tip->period < SYM_SETUP_MIN_SYNC) tip->period = SYM_SETUP_MIN_SYNC; + } else { + tip->offset = 0; + tip->period = 0; + } /* * Scale against actual controller BUS width. @@ -8231,21 +8236,23 @@ static void sym_update_trans(hcb_p np, t /* * Scale period factor and offset against controller limits. */ - if (tip->options & PPR_OPT_DT) { - if (tip->period < np->minsync_dt) - tip->period = np->minsync_dt; - if (tip->period > np->maxsync_dt) - tip->period = np->maxsync_dt; - if (tip->offset > np->maxoffs_dt) - tip->offset = np->maxoffs_dt; - } - else { - if (tip->period < np->minsync) - tip->period = np->minsync; - if (tip->period > np->maxsync) - tip->period = np->maxsync; - if (tip->offset > np->maxoffs) - tip->offset = np->maxoffs; + if (tip->offset && tip->period) { + if (tip->options & PPR_OPT_DT) { + if (tip->period < np->minsync_dt) + tip->period = np->minsync_dt; + if (tip->period > np->maxsync_dt) + tip->period = np->maxsync_dt; + if (tip->offset > np->maxoffs_dt) + tip->offset = np->maxoffs_dt; + } + else { + if (tip->period < np->minsync) + tip->period = np->minsync; + if (tip->period > np->maxsync) + tip->period = np->maxsync; + if (tip->offset > np->maxoffs) + tip->offset = np->maxoffs; + } } } From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 16:13:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 81501E09; Mon, 25 Feb 2013 16:13:22 +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 70ABD732; Mon, 25 Feb 2013 16:13:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PGDMnG033522; Mon, 25 Feb 2013 16:13:22 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PGDM2q033521; Mon, 25 Feb 2013 16:13:22 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201302251613.r1PGDM2q033521@svn.freebsd.org> From: Devin Teske Date: Mon, 25 Feb 2013 16:13: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: r247267 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 16:13:22 -0000 Author: dteske Date: Mon Feb 25 16:13:21 2013 New Revision: 247267 URL: http://svnweb.freebsd.org/changeset/base/247267 Log: Oops, r55392 (over 13 years ago) forgot to classify the new HTTP Proxy for the options dialog (causing "" to be displayed for the HTTP media type). Direct commit to stable/9 (no sysinstall in head). Modified: stable/9/usr.sbin/sysinstall/options.c Modified: stable/9/usr.sbin/sysinstall/options.c ============================================================================== --- stable/9/usr.sbin/sysinstall/options.c Mon Feb 25 14:06:24 2013 (r247266) +++ stable/9/usr.sbin/sysinstall/options.c Mon Feb 25 16:13:21 2013 (r247267) @@ -75,6 +75,9 @@ mediaCheck(Option *opt) case DEVICE_TYPE_FTP: return "FTP"; + case DEVICE_TYPE_HTTP: + return "HTTP Proxy"; + case DEVICE_TYPE_CDROM: return "CDROM"; From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 16:22:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3D292198; Mon, 25 Feb 2013 16:22:41 +0000 (UTC) (envelope-from gallatin@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 1DF5A793; Mon, 25 Feb 2013 16:22:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PGMfTI036451; Mon, 25 Feb 2013 16:22:41 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PGMeSn036450; Mon, 25 Feb 2013 16:22:40 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201302251622.r1PGMeSn036450@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 25 Feb 2013 16:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247268 - head/sys/dev/mxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 16:22:41 -0000 Author: gallatin Date: Mon Feb 25 16:22:40 2013 New Revision: 247268 URL: http://svnweb.freebsd.org/changeset/base/247268 Log: Several cleanups and fixes to mxge: - Remove vestigial null pointer tests after malloc(..., M_WAITOK). - Remove vestigal qualhack union - Use strlcpy() instead of the error-prone strncpy() when parsing EEPROM and copying strings - Check the MAC address in the EEPROM strings more strictly. - Expand the macro MXGE_NEXT_STRING() at its only user. Due to a typo, the macro was very confusing. - Remove unnecessary buffer limit check. The buffer is double-NUL terminated per construction. PR: kern/176369 Submitted by: Christoph Mallon Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Mon Feb 25 16:13:21 2013 (r247267) +++ head/sys/dev/mxge/if_mxge.c Mon Feb 25 16:22:40 2013 (r247268) @@ -288,42 +288,43 @@ mxge_dma_free(mxge_dma_t *dma) static int mxge_parse_strings(mxge_softc_t *sc) { -#define MXGE_NEXT_STRING(p) while(ptr < limit && *ptr++) - - char *ptr, *limit; + char *ptr; int i, found_mac, found_sn2; + char *endptr; ptr = sc->eeprom_strings; - limit = sc->eeprom_strings + MXGE_EEPROM_STRINGS_SIZE; found_mac = 0; found_sn2 = 0; - while (ptr < limit && *ptr != '\0') { - if (memcmp(ptr, "MAC=", 4) == 0) { - ptr += 1; - sc->mac_addr_string = ptr; - for (i = 0; i < 6; i++) { - ptr += 3; - if ((ptr + 2) > limit) + while (*ptr != '\0') { + if (strncmp(ptr, "MAC=", 4) == 0) { + ptr += 4; + for (i = 0;;) { + sc->mac_addr[i] = strtoul(ptr, &endptr, 16); + if (endptr - ptr != 2) + goto abort; + ptr = endptr; + if (++i == 6) + break; + if (*ptr++ != ':') goto abort; - sc->mac_addr[i] = strtoul(ptr, NULL, 16); - found_mac = 1; } - } else if (memcmp(ptr, "PC=", 3) == 0) { + found_mac = 1; + } else if (strncmp(ptr, "PC=", 3) == 0) { ptr += 3; - strncpy(sc->product_code_string, ptr, - sizeof (sc->product_code_string) - 1); - } else if (!found_sn2 && (memcmp(ptr, "SN=", 3) == 0)) { + strlcpy(sc->product_code_string, ptr, + sizeof(sc->product_code_string)); + } else if (!found_sn2 && (strncmp(ptr, "SN=", 3) == 0)) { ptr += 3; - strncpy(sc->serial_number_string, ptr, - sizeof (sc->serial_number_string) - 1); - } else if (memcmp(ptr, "SN2=", 4) == 0) { + strlcpy(sc->serial_number_string, ptr, + sizeof(sc->serial_number_string)); + } else if (strncmp(ptr, "SN2=", 4) == 0) { /* SN2 takes precedence over SN */ ptr += 4; found_sn2 = 1; - strncpy(sc->serial_number_string, ptr, - sizeof (sc->serial_number_string) - 1); + strlcpy(sc->serial_number_string, ptr, + sizeof(sc->serial_number_string)); } - MXGE_NEXT_STRING(ptr); + while (*ptr++ != '\0') {} } if (found_mac) @@ -649,12 +650,6 @@ abort: return (mxge_load_firmware(sc, 0)); } -union qualhack -{ - const char *ro_char; - char *rw_char; -}; - static int mxge_validate_firmware(mxge_softc_t *sc, const mcp_gen_header_t *hdr) { @@ -667,7 +662,7 @@ mxge_validate_firmware(mxge_softc_t *sc, } /* save firmware version for sysctl */ - strncpy(sc->fw_version, hdr->version, sizeof (sc->fw_version)); + strlcpy(sc->fw_version, hdr->version, sizeof(sc->fw_version)); if (mxge_verbose) device_printf(sc->dev, "firmware id: %s\n", hdr->version); @@ -3325,8 +3320,6 @@ mxge_alloc_slice_rings(struct mxge_slice size_t bytes; int err, i; - err = ENOMEM; - /* allocate per-slice receive resources */ ss->rx_small.mask = ss->rx_big.mask = rx_ring_entries - 1; @@ -3335,24 +3328,16 @@ mxge_alloc_slice_rings(struct mxge_slice /* allocate the rx shadow rings */ bytes = rx_ring_entries * sizeof (*ss->rx_small.shadow); ss->rx_small.shadow = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->rx_small.shadow == NULL) - return err; bytes = rx_ring_entries * sizeof (*ss->rx_big.shadow); ss->rx_big.shadow = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->rx_big.shadow == NULL) - return err; /* allocate the rx host info rings */ bytes = rx_ring_entries * sizeof (*ss->rx_small.info); ss->rx_small.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->rx_small.info == NULL) - return err; bytes = rx_ring_entries * sizeof (*ss->rx_big.info); ss->rx_big.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->rx_big.info == NULL) - return err; /* allocate the rx busdma resources */ err = bus_dma_tag_create(sc->parent_dmat, /* parent */ @@ -3449,8 +3434,6 @@ mxge_alloc_slice_rings(struct mxge_slice bytes = 8 + sizeof (*ss->tx.req_list) * (ss->tx.max_desc + 4); ss->tx.req_bytes = malloc(bytes, M_DEVBUF, M_WAITOK); - if (ss->tx.req_bytes == NULL) - return err; /* ensure req_list entries are aligned to 8 bytes */ ss->tx.req_list = (mcp_kreq_ether_send_t *) ((unsigned long)(ss->tx.req_bytes + 7) & ~7UL); @@ -3459,14 +3442,10 @@ mxge_alloc_slice_rings(struct mxge_slice bytes = sizeof (*ss->tx.seg_list) * ss->tx.max_desc; ss->tx.seg_list = (bus_dma_segment_t *) malloc(bytes, M_DEVBUF, M_WAITOK); - if (ss->tx.seg_list == NULL) - return err; /* allocate the tx host info ring */ bytes = tx_ring_entries * sizeof (*ss->tx.info); ss->tx.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); - if (ss->tx.info == NULL) - return err; /* allocate the tx busdma resources */ err = bus_dma_tag_create(sc->parent_dmat, /* parent */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 16:25:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2C79550F; Mon, 25 Feb 2013 16:25:39 +0000 (UTC) (envelope-from kientzle@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 1E5CD7C5; Mon, 25 Feb 2013 16:25:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PGPd6S036890; Mon, 25 Feb 2013 16:25:39 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PGPcg4036889; Mon, 25 Feb 2013 16:25:38 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201302251625.r1PGPcg4036889@svn.freebsd.org> From: Tim Kientzle Date: Mon, 25 Feb 2013 16:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247269 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 16:25:39 -0000 Author: kientzle Date: Mon Feb 25 16:25:38 2013 New Revision: 247269 URL: http://svnweb.freebsd.org/changeset/base/247269 Log: Fix ARM build by assigning the computed time here to a variable of the right type for printf. Modified: head/sbin/fsck_ffs/fsutil.c Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Mon Feb 25 16:22:40 2013 (r247268) +++ head/sbin/fsck_ffs/fsutil.c Mon Feb 25 16:25:38 2013 (r247269) @@ -448,8 +448,8 @@ static void printIOstats(void) clock_gettime(CLOCK_REALTIME_PRECISE, &finishpass); timespecsub(&finishpass, &startpass); - printf("Running time: %ld msec\n", - finishpass.tv_sec * 1000 + finishpass.tv_nsec / 1000000); + msec = finishpass.tv_sec * 1000 + finishpass.tv_nsec / 1000000; + printf("Running time: %lld msec\n", msec); printf("buffer reads by type:\n"); for (totalmsec = 0, i = 0; i < BT_NUMBUFTYPES; i++) totalmsec += readtime[i].tv_sec * 1000 + From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 16:47:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D7A71C0E; Mon, 25 Feb 2013 16:47:10 +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 9957887B; Mon, 25 Feb 2013 16:47:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PGlAD4043244; Mon, 25 Feb 2013 16:47:10 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PGl9Mr043242; Mon, 25 Feb 2013 16:47:09 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302251647.r1PGl9Mr043242@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 25 Feb 2013 16:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247270 - head/usr.sbin/rtadvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 16:47:10 -0000 Author: des Date: Mon Feb 25 16:47:09 2013 New Revision: 247270 URL: http://svnweb.freebsd.org/changeset/base/247270 Log: - Implement and use usage(). - Document the -C option. - Allow rtadvd to be invoked without any interfaces on the command line, and document that possibility. MFC after: 1 week Modified: head/usr.sbin/rtadvd/rtadvd.8 head/usr.sbin/rtadvd/rtadvd.c Modified: head/usr.sbin/rtadvd/rtadvd.8 ============================================================================== --- head/usr.sbin/rtadvd/rtadvd.8 Mon Feb 25 16:25:38 2013 (r247269) +++ head/usr.sbin/rtadvd/rtadvd.8 Mon Feb 25 16:47:09 2013 (r247270) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2011 +.Dd February 25, 2013 .Dt RTADVD 8 .Os .Sh NAME @@ -39,13 +39,19 @@ .Nm .Op Fl dDfRs .Op Fl c Ar configfile +.Op Fl C Ar ctlsock .Op Fl M Ar ifname .Op Fl p Ar pidfile -.Ar interface ... +.Op Ar interface ... .Sh DESCRIPTION .Nm sends router advertisement packets to the specified .Ar interfaces . +If no interfaces are specified, +.Nm +will still run, but will not advertise any routes until interfaces are +added using +.Xr rtadvctl 8 . .Pp The program will daemonize itself on invocation. It will then send router advertisement packets periodically, as well @@ -121,6 +127,11 @@ for the configuration file. By default, .Pa /etc/rtadvd.conf is used. +.It Fl C +Specify an alternate location for the control socket used by +.Xr rtadvctl 8 . +The default is +.Pa /var/run/rtadvd.sock . .It Fl d Print debugging information. .It Fl D @@ -185,6 +196,7 @@ The default process ID file. .Ex -std .Sh SEE ALSO .Xr rtadvd.conf 5 , +.Xr rtadvctl 8 , .Xr rtsol 8 .Rs .%A Thomas Narten Modified: head/usr.sbin/rtadvd/rtadvd.c ============================================================================== --- head/usr.sbin/rtadvd/rtadvd.c Mon Feb 25 16:25:38 2013 (r247269) +++ head/usr.sbin/rtadvd/rtadvd.c Mon Feb 25 16:47:09 2013 (r247270) @@ -166,6 +166,15 @@ static void rtmsg_input(struct sockinfo static void set_short_delay(struct ifinfo *); static int check_accept_rtadv(int); +static void +usage(void) +{ + + fprintf(stderr, "usage: rtadvd [-dDfRs] " + "[-c configfile] [-C ctlsock] [-M ifname] [-p pidfile]\n"); + exit(1); +} + int main(int argc, char *argv[]) { @@ -177,7 +186,7 @@ main(int argc, char *argv[]) pid_t pid, otherpid; /* get command line options and arguments */ - while ((ch = getopt(argc, argv, "c:C:dDfM:p:Rs")) != -1) { + while ((ch = getopt(argc, argv, "c:C:dDfhM:p:Rs")) != -1) { switch (ch) { case 'c': conffile = optarg; @@ -209,17 +218,12 @@ main(int argc, char *argv[]) case 'p': pidfilename = optarg; break; + default: + usage(); } } argc -= optind; argv += optind; - if (argc == 0) { - fprintf(stderr, - "usage: rtadvd [-dDfRs] [-c conffile] " - "[-C ctrlsockname] [-M ifname] " - "[-p pidfile] interfaces...\n"); - exit(1); - } logopt = LOG_NDELAY | LOG_PID; if (fflag) From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 17:07:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C6A7A3B3; Mon, 25 Feb 2013 17:07:43 +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 99900989; Mon, 25 Feb 2013 17:07:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PH7hL8049242; Mon, 25 Feb 2013 17:07:43 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PH7heJ049241; Mon, 25 Feb 2013 17:07:43 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302251707.r1PH7heJ049241@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 25 Feb 2013 17:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247271 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 17:07:43 -0000 Author: des Date: Mon Feb 25 17:07:42 2013 New Revision: 247271 URL: http://svnweb.freebsd.org/changeset/base/247271 Log: If rtadvd_interfaces is set to "none", start rtadvd without listing any interfaces on the command line. MFC after: 1 week Modified: head/etc/rc.d/rtadvd Modified: head/etc/rc.d/rtadvd ============================================================================== --- head/etc/rc.d/rtadvd Mon Feb 25 16:47:09 2013 (r247270) +++ head/etc/rc.d/rtadvd Mon Feb 25 17:07:42 2013 (r247271) @@ -46,6 +46,8 @@ rtadvd_precmd() fi done ;; + [Nn][Oo][Nn][Ee]) + ;; *) command_args="${rtadvd_interfaces}" ;; From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 17:32:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 59D3C844; Mon, 25 Feb 2013 17:32:11 +0000 (UTC) (envelope-from joel@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 33D50A58; Mon, 25 Feb 2013 17:32:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PHWBAX057348; Mon, 25 Feb 2013 17:32:11 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PHWB4q057347; Mon, 25 Feb 2013 17:32:11 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201302251732.r1PHWB4q057347@svn.freebsd.org> From: Joel Dahl Date: Mon, 25 Feb 2013 17:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247272 - head/usr.bin/systat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 17:32:11 -0000 Author: joel (doc committer) Date: Mon Feb 25 17:32:10 2013 New Revision: 247272 URL: http://svnweb.freebsd.org/changeset/base/247272 Log: Remove EOL whitespace. Modified: head/usr.bin/systat/systat.1 Modified: head/usr.bin/systat/systat.1 ============================================================================== --- head/usr.bin/systat/systat.1 Mon Feb 25 17:07:42 2013 (r247271) +++ head/usr.bin/systat/systat.1 Mon Feb 25 17:32:10 2013 (r247272) @@ -513,12 +513,12 @@ The following units are recognised: kbit mbyte, gbit, gbyte and auto. .It Cm pps Show statistics in packets per second instead of bytes/bits per second. -A subsequent call of -.Ic pps +A subsequent call of +.Ic pps switches this mode off. .It Cm match Op Ar patterns -Display only interfaces that match pattern provided as an argument. -Patterns should be in shell syntax separated by whitespaces or commas. +Display only interfaces that match pattern provided as an argument. +Patterns should be in shell syntax separated by whitespaces or commas. If this command is called without arguments then all interfaces are displayed. For example: .Pp @@ -528,8 +528,8 @@ This will display em0 and bge1 interface .Pp .Dl match em*, bge*, lo0 .Pp -This will display all -.Ic em +This will display all +.Ic em interfaces, all .Ic bge interfaces and the loopback interface. From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 18:07:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1A15DF2B; Mon, 25 Feb 2013 18:07:21 +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 001F8C1B; Mon, 25 Feb 2013 18:07:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PI7KBg067060; Mon, 25 Feb 2013 18:07:20 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PI7K4W067058; Mon, 25 Feb 2013 18:07:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201302251807.r1PI7K4W067058@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 25 Feb 2013 18:07: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: r247273 - stable/9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 18:07:21 -0000 Author: jilles Date: Mon Feb 25 18:07:20 2013 New Revision: 247273 URL: http://svnweb.freebsd.org/changeset/base/247273 Log: MFC r241010: libc/fts: Use O_CLOEXEC for internal file descriptors. Because fts keeps internal file descriptors open across calls, making such descriptors close-on-exec helps not only multi-threaded applications but also single-threaded applications. In particular, this prevents passing a temporary file descriptor for saving the current directory to processes created via find -exec. Modified: stable/9/lib/libc/gen/fts-compat.c stable/9/lib/libc/gen/fts.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/fts-compat.c ============================================================================== --- stable/9/lib/libc/gen/fts-compat.c Mon Feb 25 17:32:10 2013 (r247272) +++ stable/9/lib/libc/gen/fts-compat.c Mon Feb 25 18:07:20 2013 (r247273) @@ -218,7 +218,8 @@ __fts_open_44bsd(argv, options, compar) * and ".." are all fairly nasty problems. Note, if we can't get the * descriptor we run anyway, just more slowly. */ - if (!ISSET(FTS_NOCHDIR) && (sp->fts_rfd = _open(".", O_RDONLY, 0)) < 0) + if (!ISSET(FTS_NOCHDIR) && + (sp->fts_rfd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) SET(FTS_NOCHDIR); return (sp); @@ -347,7 +348,8 @@ __fts_read_44bsd(sp) (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) { p->fts_info = fts_stat(sp, p, 1); if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { - if ((p->fts_symfd = _open(".", O_RDONLY, 0)) < 0) { + if ((p->fts_symfd = _open(".", O_RDONLY | O_CLOEXEC, + 0)) < 0) { p->fts_errno = errno; p->fts_info = FTS_ERR; } else @@ -438,7 +440,7 @@ next: tmp = p; p->fts_info = fts_stat(sp, p, 1); if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { if ((p->fts_symfd = - _open(".", O_RDONLY, 0)) < 0) { + _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) { p->fts_errno = errno; p->fts_info = FTS_ERR; } else @@ -579,7 +581,7 @@ __fts_children_44bsd(sp, instr) ISSET(FTS_NOCHDIR)) return (sp->fts_child = fts_build(sp, instr)); - if ((fd = _open(".", O_RDONLY, 0)) < 0) + if ((fd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) return (NULL); sp->fts_child = fts_build(sp, instr); if (fchdir(fd)) @@ -1178,7 +1180,7 @@ fts_safe_changedir(sp, p, fd, path) newfd = fd; if (ISSET(FTS_NOCHDIR)) return (0); - if (fd < 0 && (newfd = _open(path, O_RDONLY, 0)) < 0) + if (fd < 0 && (newfd = _open(path, O_RDONLY | O_CLOEXEC, 0)) < 0) return (-1); if (_fstat(newfd, &sb)) { ret = -1; Modified: stable/9/lib/libc/gen/fts.c ============================================================================== --- stable/9/lib/libc/gen/fts.c Mon Feb 25 17:32:10 2013 (r247272) +++ stable/9/lib/libc/gen/fts.c Mon Feb 25 18:07:20 2013 (r247273) @@ -213,7 +213,8 @@ fts_open(argv, options, compar) * and ".." are all fairly nasty problems. Note, if we can't get the * descriptor we run anyway, just more slowly. */ - if (!ISSET(FTS_NOCHDIR) && (sp->fts_rfd = _open(".", O_RDONLY, 0)) < 0) + if (!ISSET(FTS_NOCHDIR) && + (sp->fts_rfd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) SET(FTS_NOCHDIR); return (sp); @@ -342,7 +343,8 @@ fts_read(sp) (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) { p->fts_info = fts_stat(sp, p, 1); if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { - if ((p->fts_symfd = _open(".", O_RDONLY, 0)) < 0) { + if ((p->fts_symfd = _open(".", O_RDONLY | O_CLOEXEC, + 0)) < 0) { p->fts_errno = errno; p->fts_info = FTS_ERR; } else @@ -433,7 +435,7 @@ next: tmp = p; p->fts_info = fts_stat(sp, p, 1); if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { if ((p->fts_symfd = - _open(".", O_RDONLY, 0)) < 0) { + _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) { p->fts_errno = errno; p->fts_info = FTS_ERR; } else @@ -574,7 +576,7 @@ fts_children(sp, instr) ISSET(FTS_NOCHDIR)) return (sp->fts_child = fts_build(sp, instr)); - if ((fd = _open(".", O_RDONLY, 0)) < 0) + if ((fd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) return (NULL); sp->fts_child = fts_build(sp, instr); if (fchdir(fd)) { @@ -1145,7 +1147,7 @@ fts_safe_changedir(sp, p, fd, path) newfd = fd; if (ISSET(FTS_NOCHDIR)) return (0); - if (fd < 0 && (newfd = _open(path, O_RDONLY, 0)) < 0) + if (fd < 0 && (newfd = _open(path, O_RDONLY | O_CLOEXEC, 0)) < 0) return (-1); if (_fstat(newfd, &sb)) { ret = -1; From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 19:05:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F098B258; Mon, 25 Feb 2013 19:05:41 +0000 (UTC) (envelope-from peterj@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 DCF54F8D; Mon, 25 Feb 2013 19:05:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PJ5fTo085182; Mon, 25 Feb 2013 19:05:41 GMT (envelope-from peterj@svn.freebsd.org) Received: (from peterj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PJ5fKF085179; Mon, 25 Feb 2013 19:05:41 GMT (envelope-from peterj@svn.freebsd.org) Message-Id: <201302251905.r1PJ5fKF085179@svn.freebsd.org> From: Peter Jeremy Date: Mon, 25 Feb 2013 19:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247274 - in head: bin/test tools/regression/bin/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 19:05:42 -0000 Author: peterj Date: Mon Feb 25 19:05:40 2013 New Revision: 247274 URL: http://svnweb.freebsd.org/changeset/base/247274 Log: Enhance test(1) by adding provision to compare any combination of the access, birth, change and modify times of two files, instead of only being able to compare modify times. The builtin test in sh(1) will automagically acquire the same expansion. Approved by: grog MFC after: 2 weeks Modified: head/bin/test/test.1 head/bin/test/test.c head/tools/regression/bin/test/regress.sh Modified: head/bin/test/test.1 ============================================================================== --- head/bin/test/test.1 Mon Feb 25 18:07:20 2013 (r247273) +++ head/bin/test/test.1 Mon Feb 25 19:05:40 2013 (r247274) @@ -169,15 +169,65 @@ True if .Ar file exists and is a socket. .It Ar file1 Fl nt Ar file2 -True if +True if both +.Ar file1 +and +.Ar file2 +exist and +.Ar file1 +is newer than +.Ar file2 . +.It Ar file1 Fl nt Ns Ar X Ns Ar Y Ar file2 +True if both +.Ar file1 +and +.Ar file2 +exist and .Ar file1 -exists and is newer than +has a more recent last access time +.Pq Ar X Ns = Ns Cm a , +inode creation time +.Pq Ar X Ns = Ns Cm b , +change time +.Pq Ar X Ns = Ns Cm c , +or modification time +.Pq Ar X Ns = Ns Cm m +than the last access time +.Pq Ar Y Ns = Ns Cm a , +inode creation time +.Pq Ar Y Ns = Ns Cm b , +change time +.Pq Ar Y Ns = Ns Cm c , +or modification time +.Pq Ar Y Ns = Ns Cm m +of .Ar file2 . +Note that +.Ic -ntmm +is equivalent to +.Ic -nt . .It Ar file1 Fl ot Ar file2 -True if +True if both +.Ar file1 +and +.Ar file2 +exist and .Ar file1 -exists and is older than +is older than .Ar file2 . +Note that +.Ar file1 +.Ic -ot +.Ar file2 +is equivalent to +.Ar file2 +.Ic -nt +.Ar file1 +.It Ar file1 Fl ot Ns Ar X Ns Ar Y Ar file2 +Equivalent to +.Ar file2 +.Ic -nt Ns Ar Y Ns Ar X +.Ar file1 . .It Ar file1 Fl ef Ar file2 True if .Ar file1 Modified: head/bin/test/test.c ============================================================================== --- head/bin/test/test.c Mon Feb 25 18:07:20 2013 (r247273) +++ head/bin/test/test.c Mon Feb 25 19:05:40 2013 (r247274) @@ -63,7 +63,7 @@ error(const char *msg, ...) "-u"|"-g"|"-k"|"-s"|"-t"|"-z"|"-n"|"-o"|"-O"|"-G"|"-L"|"-S"; binary-operator ::= "="|"!="|"-eq"|"-ne"|"-ge"|"-gt"|"-le"|"-lt"| - "-nt"|"-ot"|"-ef"; + "-nt"|"-nt[abcm][abcm]"|"-ot"|"-ot[abcm][abcm])"|"-ef"; operand ::= */ @@ -85,8 +85,38 @@ enum token { FILSUID, FILSGID, FILSTCK, - FILNT, - FILOT, + FILNTAA, + FILNTAB, + FILNTAC, + FILNTAM, + FILNTBA, + FILNTBB, + FILNTBC, + FILNTBM, + FILNTCA, + FILNTCB, + FILNTCC, + FILNTCM, + FILNTMA, + FILNTMB, + FILNTMC, + FILNTMM, + FILOTAA, + FILOTAB, + FILOTAC, + FILOTAM, + FILOTBA, + FILOTBB, + FILOTBC, + FILOTBM, + FILOTCA, + FILOTCB, + FILOTCC, + FILOTCM, + FILOTMA, + FILOTMB, + FILOTMC, + FILOTMM, FILEQ, FILUID, FILGID, @@ -118,9 +148,16 @@ enum token_types { PAREN }; +enum time_types { + ATIME, + BTIME, + CTIME, + MTIME +}; + static struct t_op { - char op_text[4]; - short op_num, op_type; + char op_text[6]; + char op_num, op_type; } const ops [] = { {"-r", FILRD, UNOP}, {"-w", FILWR, UNOP}, @@ -154,8 +191,40 @@ static struct t_op { {"-gt", INTGT, BINOP}, {"-le", INTLE, BINOP}, {"-lt", INTLT, BINOP}, - {"-nt", FILNT, BINOP}, - {"-ot", FILOT, BINOP}, + {"-nt", FILNTMM, BINOP}, + {"-ntaa", FILNTAA, BINOP}, + {"-ntab", FILNTAB, BINOP}, + {"-ntac", FILNTAC, BINOP}, + {"-ntam", FILNTAM, BINOP}, + {"-ntba", FILNTBA, BINOP}, + {"-ntbb", FILNTBB, BINOP}, + {"-ntbc", FILNTBC, BINOP}, + {"-ntbm", FILNTBM, BINOP}, + {"-ntca", FILNTCA, BINOP}, + {"-ntcb", FILNTCB, BINOP}, + {"-ntcc", FILNTCC, BINOP}, + {"-ntcm", FILNTCM, BINOP}, + {"-ntma", FILNTMA, BINOP}, + {"-ntmb", FILNTMB, BINOP}, + {"-ntmc", FILNTMC, BINOP}, + {"-ntmm", FILNTMM, BINOP}, + {"-ot", FILOTMM, BINOP}, + {"-otaa", FILOTAA, BINOP}, + {"-otab", FILOTBB, BINOP}, + {"-otac", FILOTAC, BINOP}, + {"-otam", FILOTAM, BINOP}, + {"-otba", FILOTBA, BINOP}, + {"-otbb", FILOTBB, BINOP}, + {"-otbc", FILOTBC, BINOP}, + {"-otbm", FILOTBM, BINOP}, + {"-otca", FILOTCA, BINOP}, + {"-otcb", FILOTCB, BINOP}, + {"-otcc", FILOTCC, BINOP}, + {"-otcm", FILOTCM, BINOP}, + {"-otma", FILOTMA, BINOP}, + {"-otmb", FILOTMB, BINOP}, + {"-otmc", FILOTMC, BINOP}, + {"-otmm", FILOTMM, BINOP}, {"-ef", FILEQ, BINOP}, {"!", UNOT, BUNOP}, {"-a", BAND, BBINOP}, @@ -180,10 +249,10 @@ static int intcmp(const char *, const ch static int isunopoperand(void); static int islparenoperand(void); static int isrparenoperand(void); -static int newerf(const char *, const char *); +static int newerf(const char *, const char *, enum time_types, + enum time_types); static int nexpr(enum token); static int oexpr(enum token); -static int olderf(const char *, const char *); static int primary(enum token); static void syntax(const char *, const char *); static enum token t_lex(char *); @@ -353,10 +422,70 @@ binop(void) return intcmp(opnd1, opnd2) <= 0; case INTLT: return intcmp(opnd1, opnd2) < 0; - case FILNT: - return newerf (opnd1, opnd2); - case FILOT: - return olderf (opnd1, opnd2); + case FILNTAA: + return newerf(opnd1, opnd2, ATIME, ATIME); + case FILNTAB: + return newerf(opnd1, opnd2, ATIME, BTIME); + case FILNTAC: + return newerf(opnd1, opnd2, ATIME, CTIME); + case FILNTAM: + return newerf(opnd1, opnd2, ATIME, MTIME); + case FILNTBA: + return newerf(opnd1, opnd2, BTIME, ATIME); + case FILNTBB: + return newerf(opnd1, opnd2, BTIME, BTIME); + case FILNTBC: + return newerf(opnd1, opnd2, BTIME, CTIME); + case FILNTBM: + return newerf(opnd1, opnd2, BTIME, MTIME); + case FILNTCA: + return newerf(opnd1, opnd2, CTIME, ATIME); + case FILNTCB: + return newerf(opnd1, opnd2, CTIME, BTIME); + case FILNTCC: + return newerf(opnd1, opnd2, CTIME, CTIME); + case FILNTCM: + return newerf(opnd1, opnd2, CTIME, MTIME); + case FILNTMA: + return newerf(opnd1, opnd2, MTIME, ATIME); + case FILNTMB: + return newerf(opnd1, opnd2, MTIME, BTIME); + case FILNTMC: + return newerf(opnd1, opnd2, MTIME, CTIME); + case FILNTMM: + return newerf(opnd1, opnd2, MTIME, MTIME); + case FILOTAA: + return newerf(opnd2, opnd1, ATIME, ATIME); + case FILOTAB: + return newerf(opnd2, opnd1, BTIME, ATIME); + case FILOTAC: + return newerf(opnd2, opnd1, CTIME, ATIME); + case FILOTAM: + return newerf(opnd2, opnd1, MTIME, ATIME); + case FILOTBA: + return newerf(opnd2, opnd1, ATIME, BTIME); + case FILOTBB: + return newerf(opnd2, opnd1, BTIME, BTIME); + case FILOTBC: + return newerf(opnd2, opnd1, CTIME, BTIME); + case FILOTBM: + return newerf(opnd2, opnd1, MTIME, BTIME); + case FILOTCA: + return newerf(opnd2, opnd1, ATIME, CTIME); + case FILOTCB: + return newerf(opnd2, opnd1, BTIME, CTIME); + case FILOTCC: + return newerf(opnd2, opnd1, CTIME, CTIME); + case FILOTCM: + return newerf(opnd2, opnd1, MTIME, CTIME); + case FILOTMA: + return newerf(opnd2, opnd1, ATIME, MTIME); + case FILOTMB: + return newerf(opnd2, opnd1, BTIME, MTIME); + case FILOTMC: + return newerf(opnd2, opnd1, CTIME, MTIME); + case FILOTMM: + return newerf(opnd2, opnd1, MTIME, MTIME); case FILEQ: return equalf (opnd1, opnd2); default: @@ -570,25 +699,34 @@ intcmp (const char *s1, const char *s2) } static int -newerf (const char *f1, const char *f2) +newerf (const char *f1, const char *f2, enum time_types t1, enum time_types t2) { struct stat b1, b2; + struct timespec *ts1, *ts2; if (stat(f1, &b1) != 0 || stat(f2, &b2) != 0) return 0; - if (b1.st_mtim.tv_sec > b2.st_mtim.tv_sec) + switch (t1) { + case ATIME: ts1 = &b1.st_atim; break; + case BTIME: ts1 = &b1.st_birthtim; break; + case CTIME: ts1 = &b1.st_ctim; break; + default: ts1 = &b1.st_mtim; break; + } + + switch (t2) { + case ATIME: ts2 = &b2.st_atim; break; + case BTIME: ts2 = &b2.st_birthtim; break; + case CTIME: ts2 = &b2.st_ctim; break; + default: ts2 = &b2.st_mtim; break; + } + + if (ts1->tv_sec > ts2->tv_sec) return 1; - if (b1.st_mtim.tv_sec < b2.st_mtim.tv_sec) + if (ts1->tv_sec < ts2->tv_sec) return 0; - return (b1.st_mtim.tv_nsec > b2.st_mtim.tv_nsec); -} - -static int -olderf (const char *f1, const char *f2) -{ - return (newerf(f2, f1)); + return (ts1->tv_nsec > ts2->tv_nsec); } static int Modified: head/tools/regression/bin/test/regress.sh ============================================================================== --- head/tools/regression/bin/test/regress.sh Mon Feb 25 18:07:20 2013 (r247273) +++ head/tools/regression/bin/test/regress.sh Mon Feb 25 19:05:40 2013 (r247274) @@ -52,7 +52,7 @@ t () } count=0 -echo "1..130" +echo "1..266" t 0 'b = b' t 0 'b == b' @@ -194,3 +194,66 @@ t 1 '\( ! -a \)' t 0 '\( -n -o \)' t 1 '\( -z -o \)' t 1 '\( ! -o \)' + +# Test all file timestamp comparison operators +s() { + t ${1} "${35} -nt ${36}" + t ${2} "${35} -ntaa ${36}" + t ${3} "${35} -ntab ${36}" + t ${4} "${35} -ntac ${36}" + t ${5} "${35} -ntam ${36}" + t ${6} "${35} -ntba ${36}" + t ${7} "${35} -ntbb ${36}" + t ${8} "${35} -ntbc ${36}" + t ${9} "${35} -ntbm ${36}" + t ${10} "${35} -ntca ${36}" + t ${11} "${35} -ntcb ${36}" + t ${12} "${35} -ntcc ${36}" + t ${13} "${35} -ntcm ${36}" + t ${14} "${35} -ntma ${36}" + t ${15} "${35} -ntmb ${36}" + t ${16} "${35} -ntmc ${36}" + t ${17} "${35} -ntmm ${36}" + t ${18} "${35} -ot ${36}" + t ${19} "${35} -otaa ${36}" + t ${20} "${35} -otab ${36}" + t ${21} "${35} -otac ${36}" + t ${22} "${35} -otam ${36}" + t ${23} "${35} -otba ${36}" + t ${24} "${35} -otbb ${36}" + t ${25} "${35} -otbc ${36}" + t ${26} "${35} -otbm ${36}" + t ${27} "${35} -otca ${36}" + t ${28} "${35} -otcb ${36}" + t ${29} "${35} -otcc ${36}" + t ${30} "${35} -otcm ${36}" + t ${31} "${35} -otma ${36}" + t ${32} "${35} -otmb ${36}" + t ${33} "${35} -otmc ${36}" + t ${34} "${35} -otmm ${36}" +} + +a=/tmp/test$$.1 +b=/tmp/test$$.2 +trap "rm -f $a $b" EXIT + +# Tests 131-164 +s 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 $a $b + +touch $a +# Tests 165-198 +s 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 $a $b + +sleep 2 # Ensure $b is newer than $a +touch $b +# Tests 199-232 +s 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 $a $b + +sleep 2 +echo >$b # Updates mtime & ctime +sleep 2 +touch -A 01 -a $b + +# $b now has ctime > mtime > atime > btime +# Tests 233-266 +s 1 1 0 1 1 1 1 1 1 0 0 1 0 0 0 1 1 1 1 1 0 0 0 1 0 0 1 1 1 1 1 1 0 1 $b $b From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 19:06:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E7D2E3D1; Mon, 25 Feb 2013 19:06:04 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64]) by mx1.freebsd.org (Postfix) with ESMTP id B60D2F97; Mon, 25 Feb 2013 19:06:04 +0000 (UTC) Received: from mxin3-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp3.clear.net.nz (CLEAR Net Mail) with ESMTP id <0MIS002XYIE2BB30@smtp3.clear.net.nz>; Tue, 26 Feb 2013 08:06:03 +1300 (NZDT) Received: from 202-0-48-19.paradise.net.nz (HELO bender) ([202.0.48.19]) by smtpin32.paradise.net.nz with ESMTP; Tue, 26 Feb 2013 08:06:02 +1300 Date: Tue, 26 Feb 2013 08:05:42 +1300 From: Andrew Turner Subject: Re: svn commit: r247116 - in head/sys: fs/nfs fs/nfsclient kern nfsclient sys tools In-reply-to: <20130225115500.GW2454@kib.kiev.ua> To: Konstantin Belousov Message-id: <20130226080542.253c69ea@bender> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit References: <201302211902.r1LJ2o5T033708@svn.freebsd.org> <20130225201313.2050da18@bender> <20130225085019.GU2454@kib.kiev.ua> <20130225233603.49a5d4a5@bender> <20130225115500.GW2454@kib.kiev.ua> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 19:06:05 -0000 On Mon, 25 Feb 2013 13:55:00 +0200 Konstantin Belousov wrote: > On Mon, Feb 25, 2013 at 11:36:03PM +1300, Andrew Turner wrote: > > On Mon, 25 Feb 2013 10:50:19 +0200 > > Konstantin Belousov wrote: > > > > > On Mon, Feb 25, 2013 at 08:13:13PM +1300, Andrew Turner wrote: > > > > On Thu, 21 Feb 2013 19:02:50 +0000 (UTC) > > > > John Baldwin wrote: > > > > > > > > > Author: jhb > > > > > Date: Thu Feb 21 19:02:50 2013 > > > > > New Revision: 247116 > > > > > URL: http://svnweb.freebsd.org/changeset/base/247116 > > > > > > > > > > Log: > > > > > Further refine the handling of stop signals in the NFS > > > > > client. The changes in r246417 were incomplete as they did > > > > > not add explicit calls to sigdeferstop() around all the > > > > > places that previously passed SBDRY to _sleep(). In addition, > > > > > nfs_getcacheblk() could trigger a write RPC from getblk() > > > > > resulting in sigdeferstop() recursing. Rather than manually > > > > > deferring stop signals in specific places, change the VFS_*() > > > > > and VOP_*() methods to defer stop signals for filesystems > > > > > which request this behavior via a new VFCF_SBDRY flag. Note > > > > > that this has to be a VFC flag rather than a MNTK flag so > > > > > that it works properly with VFS_MOUNT() when the mount is not > > > > > yet fully constructed. For now, only the NFS clients are set > > > > > this new flag in VFS_SET(). A few other related changes: > > > > > - Add an assertion to ensure that TDF_SBDRY doesn't leak to > > > > > userland. > > > > > - When a lookup request uses VOP_READLINK() to follow a > > > > > symlink, mark the request as being on behalf of the thread > > > > > performing the lookup (cnp_thread) rather than using a NULL > > > > > thread pointer. This causes NFS to properly handle signals > > > > > during this VOP on an interruptible mount. > > > > > > > > > > PR: kern/176179 > > > > > Reported by: Russell Cattelan (sigdeferstop() > > > > > recursion) Reviewed by: kib > > > > > MFC after: 1 month > > > > > > > > This change is causing init to crash for me on armv6. I'm > > > > netbooting a PandaBoard and it appears init is receiving a > > > > SIGABRT before it gets into main(). > > > > > > > > Do you have any idea where I could look to track down why it is > > > > doing this? > > > > > > It is weird. SIGABRT sent by the kernel usually means that > > > execve(2) already destroyed the previous address space of the > > > process, but the new image cannot be activated, most likely due > > > to image format error discovered too late, or resource shortage. > > > > > > Could it be that some NFS RPC fails after the patch, but I cannot > > > imagine why. You would need to track this. Also, verify that the > > > init binary is correct. > > > > > > I tried amd64 netboot, and it worked fine. > > > > It looks like this change is not the issue, it just changed the > > symptom enough for me to not realise I was seeing an issue where > > it would crash the kernel before. I reinstated this change but only > > allowed the kernel to access half the memory and it booted > > correctly. > > > > The real issue appears to be related to something in the vm layer > > not working on ARM boards with too much memory (somewhere between > > 512MiB and 1GiB). > > Hm, do you have r246926, r246929 and r247046 ? Yes, I've updated the kernel to r247213. Andrew From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 19:08:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DC7DC57E; Mon, 25 Feb 2013 19:08:47 +0000 (UTC) (envelope-from keramida@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 B164DFBC; Mon, 25 Feb 2013 19:08:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PJ8lBJ085736; Mon, 25 Feb 2013 19:08:47 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PJ8lrG085735; Mon, 25 Feb 2013 19:08:47 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201302251908.r1PJ8lrG085735@svn.freebsd.org> From: Giorgos Keramidas Date: Mon, 25 Feb 2013 19:08:47 +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: r247275 - stable/9/lib/libc/stdlib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 19:08:47 -0000 Author: keramida (doc committer) Date: Mon Feb 25 19:08:46 2013 New Revision: 247275 URL: http://svnweb.freebsd.org/changeset/base/247275 Log: MFH r247014, r247050 and r247051. Add a sample program that shows how a custom comparison function and qsort(3) can work together to sort an array of integers. PR: docs/176197 Submitted by: Fernando, fapesteguia at opensistemas.com Christoph Mallon, christoph.mallon at gmx.de Approved by: gjb (mentor), remko (mentor) Modified: stable/9/lib/libc/stdlib/qsort.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdlib/qsort.3 ============================================================================== --- stable/9/lib/libc/stdlib/qsort.3 Mon Feb 25 19:05:40 2013 (r247274) +++ stable/9/lib/libc/stdlib/qsort.3 Mon Feb 25 19:08:46 2013 (r247275) @@ -32,7 +32,7 @@ .\" @(#)qsort.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 30, 2003 +.Dd February 20, 2013 .Dt QSORT 3 .Os .Sh NAME @@ -205,6 +205,46 @@ functions return no value. .Pp .Rv -std heapsort mergesort +.Sh EXAMPLES +A sample program that sorts an array of +.Vt int +values in place using +.Fn qsort , +and then prints the sorted array to standard output is: +.Bd -literal +#include +#include + +/* + * Custom comparison function that can compare 'int' values through pointers + * passed by qsort(3). + */ +static int +int_compare(const void *p1, const void *p2) +{ + int left = *(const int *)p1; + int right = *(const int *)p2; + + return ((left > right) - (left < right)); +} + +/* + * Sort an array of 'int' values and print it to standard output. + */ +int +main(void) +{ + int int_array[] = { 4, 5, 9, 3, 0, 1, 7, 2, 8, 6 }; + const size_t array_size = sizeof(int_array) / sizeof(int_array[0]); + size_t k; + + qsort(&int_array, array_size, sizeof(int_array[0]), int_compare); + for (k = 0; k < array_size; k++) + printf(" %d", int_array[k]); + puts(""); + return (EXIT_SUCCESS); +} +.Ed .Sh COMPATIBILITY Previous versions of .Fn qsort From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 19:09:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3455F6F5; Mon, 25 Feb 2013 19:09:14 +0000 (UTC) (envelope-from keramida@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 0B30BFC5; Mon, 25 Feb 2013 19:09:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PJ9DvI085855; Mon, 25 Feb 2013 19:09:13 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PJ9D27085854; Mon, 25 Feb 2013 19:09:13 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201302251909.r1PJ9D27085854@svn.freebsd.org> From: Giorgos Keramidas Date: Mon, 25 Feb 2013 19:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r247276 - stable/8/lib/libc/stdlib X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 19:09:14 -0000 Author: keramida (doc committer) Date: Mon Feb 25 19:09:13 2013 New Revision: 247276 URL: http://svnweb.freebsd.org/changeset/base/247276 Log: MFH r247014, r247050 and r247051. Add a sample program that shows how a custom comparison function and qsort(3) can work together to sort an array of integers. PR: docs/176197 Submitted by: Fernando, fapesteguia at opensistemas.com Christoph Mallon, christoph.mallon at gmx.de Approved by: gjb (mentor), remko (mentor) Modified: stable/8/lib/libc/stdlib/qsort.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/stdlib/qsort.3 ============================================================================== --- stable/8/lib/libc/stdlib/qsort.3 Mon Feb 25 19:08:46 2013 (r247275) +++ stable/8/lib/libc/stdlib/qsort.3 Mon Feb 25 19:09:13 2013 (r247276) @@ -32,7 +32,7 @@ .\" @(#)qsort.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 30, 2003 +.Dd February 20, 2013 .Dt QSORT 3 .Os .Sh NAME @@ -205,6 +205,46 @@ functions return no value. .Pp .Rv -std heapsort mergesort +.Sh EXAMPLES +A sample program that sorts an array of +.Vt int +values in place using +.Fn qsort , +and then prints the sorted array to standard output is: +.Bd -literal +#include +#include + +/* + * Custom comparison function that can compare 'int' values through pointers + * passed by qsort(3). + */ +static int +int_compare(const void *p1, const void *p2) +{ + int left = *(const int *)p1; + int right = *(const int *)p2; + + return ((left > right) - (left < right)); +} + +/* + * Sort an array of 'int' values and print it to standard output. + */ +int +main(void) +{ + int int_array[] = { 4, 5, 9, 3, 0, 1, 7, 2, 8, 6 }; + const size_t array_size = sizeof(int_array) / sizeof(int_array[0]); + size_t k; + + qsort(&int_array, array_size, sizeof(int_array[0]), int_compare); + for (k = 0; k < array_size; k++) + printf(" %d", int_array[k]); + puts(""); + return (EXIT_SUCCESS); +} +.Ed .Sh COMPATIBILITY Previous versions of .Fn qsort From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 19:09:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1B4DC861; Mon, 25 Feb 2013 19:09:42 +0000 (UTC) (envelope-from keramida@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 E90E1FCB; Mon, 25 Feb 2013 19:09:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PJ9fgQ085979; Mon, 25 Feb 2013 19:09:41 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PJ9fU7085978; Mon, 25 Feb 2013 19:09:41 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201302251909.r1PJ9fU7085978@svn.freebsd.org> From: Giorgos Keramidas Date: Mon, 25 Feb 2013 19:09:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r247277 - stable/7/lib/libc/stdlib X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 19:09:42 -0000 Author: keramida (doc committer) Date: Mon Feb 25 19:09:41 2013 New Revision: 247277 URL: http://svnweb.freebsd.org/changeset/base/247277 Log: MFH r247014, r247050 and r247051. Add a sample program that shows how a custom comparison function and qsort(3) can work together to sort an array of integers. PR: docs/176197 Submitted by: Fernando, fapesteguia at opensistemas.com Christoph Mallon, christoph.mallon at gmx.de Approved by: gjb (mentor), remko (mentor) Modified: stable/7/lib/libc/stdlib/qsort.3 Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/stdlib/qsort.3 ============================================================================== --- stable/7/lib/libc/stdlib/qsort.3 Mon Feb 25 19:09:13 2013 (r247276) +++ stable/7/lib/libc/stdlib/qsort.3 Mon Feb 25 19:09:41 2013 (r247277) @@ -32,7 +32,7 @@ .\" @(#)qsort.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 30, 2003 +.Dd February 20, 2013 .Dt QSORT 3 .Os .Sh NAME @@ -205,6 +205,46 @@ functions return no value. .Pp .Rv -std heapsort mergesort +.Sh EXAMPLES +A sample program that sorts an array of +.Vt int +values in place using +.Fn qsort , +and then prints the sorted array to standard output is: +.Bd -literal +#include +#include + +/* + * Custom comparison function that can compare 'int' values through pointers + * passed by qsort(3). + */ +static int +int_compare(const void *p1, const void *p2) +{ + int left = *(const int *)p1; + int right = *(const int *)p2; + + return ((left > right) - (left < right)); +} + +/* + * Sort an array of 'int' values and print it to standard output. + */ +int +main(void) +{ + int int_array[] = { 4, 5, 9, 3, 0, 1, 7, 2, 8, 6 }; + const size_t array_size = sizeof(int_array) / sizeof(int_array[0]); + size_t k; + + qsort(&int_array, array_size, sizeof(int_array[0]), int_compare); + for (k = 0; k < array_size; k++) + printf(" %d", int_array[k]); + puts(""); + return (EXIT_SUCCESS); +} +.Ed .Sh COMPATIBILITY Previous versions of .Fn qsort From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 19:14:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 52C3DA32; Mon, 25 Feb 2013 19:14:07 +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 2E63EFFE; Mon, 25 Feb 2013 19:14:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PJE746088370; Mon, 25 Feb 2013 19:14:07 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PJE7iR088369; Mon, 25 Feb 2013 19:14:07 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201302251914.r1PJE7iR088369@svn.freebsd.org> From: Devin Teske Date: Mon, 25 Feb 2013 19:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247278 - head/usr.sbin/bsdconfig/startup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 19:14:07 -0000 Author: dteske Date: Mon Feb 25 19:14:06 2013 New Revision: 247278 URL: http://svnweb.freebsd.org/changeset/base/247278 Log: Fix typo and update copyright. Modified: head/usr.sbin/bsdconfig/startup/rcvar Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Mon Feb 25 19:09:41 2013 (r247277) +++ head/usr.sbin/bsdconfig/startup/rcvar Mon Feb 25 19:14:06 2013 (r247278) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -75,7 +75,7 @@ dialog_menu_main() " # END-QUOTE if [ ! "$_RCVAR_MAP" ]; then - # Genreate RCVAR_MAP of `rcvar dflt script desc ...' per-line + # Generate RCVAR_MAP of `rcvar dflt script desc ...' per-line f_dialog_info "$msg_creating_rcvar_map" RCVAR_MAP=$( f_startup_rcvar_map ) export RCVAR_MAP From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 19:22:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 40BC9DE7; Mon, 25 Feb 2013 19:22:57 +0000 (UTC) (envelope-from sbruno@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 1ABCA105; Mon, 25 Feb 2013 19:22:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PJMun6091517; Mon, 25 Feb 2013 19:22:56 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PJMuDK091516; Mon, 25 Feb 2013 19:22:56 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201302251922.r1PJMuDK091516@svn.freebsd.org> From: Sean Bruno Date: Mon, 25 Feb 2013 19:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247279 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 19:22:57 -0000 Author: sbruno Date: Mon Feb 25 19:22:56 2013 New Revision: 247279 URL: http://svnweb.freebsd.org/changeset/base/247279 Log: The 5300 series ciss(4) board does not work in performant mode with our currnet initialization sequence. Set it to simple mode only so that systems can be updated from stable/7 to newer installations. At some point, we should figure out why we cannot initialize performant mode on this board. PR: kern/153361 Reviewed by: scottl Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Mon Feb 25 19:14:06 2013 (r247278) +++ head/sys/dev/ciss/ciss.c Mon Feb 25 19:22:56 2013 (r247279) @@ -282,6 +282,7 @@ TUNABLE_INT("hw.ciss.force_interrupt", & #define CISS_BOARD_SA5 1 #define CISS_BOARD_SA5B 2 #define CISS_BOARD_NOMSI (1<<4) +#define CISS_BOARD_SIMPLE (1<<5) static struct { @@ -290,7 +291,8 @@ static struct int flags; char *desc; } ciss_vendor_data[] = { - { 0x0e11, 0x4070, CISS_BOARD_SA5|CISS_BOARD_NOMSI, "Compaq Smart Array 5300" }, + { 0x0e11, 0x4070, CISS_BOARD_SA5|CISS_BOARD_NOMSI|CISS_BOARD_SIMPLE, + "Compaq Smart Array 5300" }, { 0x0e11, 0x4080, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "Compaq Smart Array 5i" }, { 0x0e11, 0x4082, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "Compaq Smart Array 532" }, { 0x0e11, 0x4083, CISS_BOARD_SA5B|CISS_BOARD_NOMSI, "HP Smart Array 5312" }, @@ -682,8 +684,15 @@ ciss_init_pci(struct ciss_softc *sc) supported_methods = CISS_TRANSPORT_METHOD_PERF; break; default: - supported_methods = sc->ciss_cfg->supported_methods; - break; + /* + * Override the capabilities of the BOARD and specify SIMPLE + * MODE + */ + if (ciss_vendor_data[i].flags & CISS_BOARD_SIMPLE) + supported_methods = CISS_TRANSPORT_METHOD_SIMPLE; + else + supported_methods = sc->ciss_cfg->supported_methods; + break; } setup: From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 19:26:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 72DC4FBA; Mon, 25 Feb 2013 19:26:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id DAF65140; Mon, 25 Feb 2013 19:26:45 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r1PJQgjT036548; Mon, 25 Feb 2013 21:26:42 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r1PJQgjT036548 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r1PJQg29036547; Mon, 25 Feb 2013 21:26:42 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 25 Feb 2013 21:26:42 +0200 From: Konstantin Belousov To: Andrew Turner Subject: Re: svn commit: r247116 - in head/sys: fs/nfs fs/nfsclient kern nfsclient sys tools Message-ID: <20130225192642.GB2454@kib.kiev.ua> References: <201302211902.r1LJ2o5T033708@svn.freebsd.org> <20130225201313.2050da18@bender> <20130225085019.GU2454@kib.kiev.ua> <20130225233603.49a5d4a5@bender> <20130225115500.GW2454@kib.kiev.ua> <20130226080542.253c69ea@bender> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rPF8rPXpDlNr1aSW" Content-Disposition: inline In-Reply-To: <20130226080542.253c69ea@bender> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 19:26:46 -0000 --rPF8rPXpDlNr1aSW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 26, 2013 at 08:05:42AM +1300, Andrew Turner wrote: > On Mon, 25 Feb 2013 13:55:00 +0200 > Konstantin Belousov wrote: >=20 > > On Mon, Feb 25, 2013 at 11:36:03PM +1300, Andrew Turner wrote: > > > The real issue appears to be related to something in the vm layer > > > not working on ARM boards with too much memory (somewhere between > > > 512MiB and 1GiB). > >=20 > > Hm, do you have r246926, r246929 and r247046 ? >=20 > Yes, I've updated the kernel to r247213. It was more the question if reverting all three of them restores the proper operation. --rPF8rPXpDlNr1aSW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRK7rxAAoJEJDCuSvBvK1BOvMQAKVQRUnbgCUEjMpb8U5AW8HR 02QqrIlFJwzVmxbayobCmFmPgDW4k6VinaHDoUWptUtxfUztmQT4Av/BEu/I0wKJ mXnbE+nvU1JxqS0GqITBO77Ark7CdGafgNOkHRJi4jnEIN7FEQJYX9ejsJTdJ7Ex iK6jRqk48M9aNiqfyHi4QZh7Z9Es1VcXWsKVSqbGoVhFdRw2dO6L3aD/BkVtoO1N lEVfRv6i/04XB7DvkJLE1bqkc7Sr6eAk3USQly/4niObvCQW/9QEgH2AsMOsDQbI UluLARo/54ZxAuh+8feECK7n75JXg0GhU0O7iDLRHv/OklUpDfC+H8WqKeD5KOF6 87pdahY2vvFCdC0ZPbfLchUtiBwFlOCDa7oaQVWvzOAE36F8RYROOS4k4gSWhTxq peQwQpAITSlaq/eYbpr3DA9tJ2f9YC3wEU8hSPJjJggyPypwEH/CbAe9R8byCxvK dTma5N+UwZBdVYkyRkMh0U81MClEnUDfYVEu/5KzHkWxSUrORvZ63pCOpEeOtVHs qMcIhr+9vYnzqg982tezCivYe5vpN56L5zKgTvbUVEAtvmO6mZdTf/cs24zI404D zBZwJ9bo4KxBS5VeN09YFQuFnRN6ECbm3hIh2VRv3XONkjoZRE+rYey5FgJHXPsA 248LGCeX3PVQs9RUJGSY =mhpW -----END PGP SIGNATURE----- --rPF8rPXpDlNr1aSW-- From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 19:55:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 03599622; Mon, 25 Feb 2013 19:55:35 +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 E80F224F; Mon, 25 Feb 2013 19:55:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PJtYL4000775; Mon, 25 Feb 2013 19:55:34 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PJtWIj000758; Mon, 25 Feb 2013 19:55:32 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201302251955.r1PJtWIj000758@svn.freebsd.org> From: Devin Teske Date: Mon, 25 Feb 2013 19:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247280 - in head/usr.sbin/bsdconfig: include networking networking/include networking/share share share/media X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 19:55:35 -0000 Author: dteske Date: Mon Feb 25 19:55:32 2013 New Revision: 247280 URL: http://svnweb.freebsd.org/changeset/base/247280 Log: Import media selection/preparation framework (sysinstall inspired). Makes accessing files from various types of media nice and abstracted away from the wet-work involved in preparing, validating, and initializing those types of media. This will be used for the package management system module and other modules that need access to files and want to allow the user to decide where those files come from (either in a scripted fashion, prompted fashion, or any combination thereof). Heavily inspired by sysinstall and even uses the same reserved words so that scripts are portable. Coded over months, tested continuously through- out, and reviewed several times. Some notes about the changes: - Move network-setting acquisition/validation routines to media/tcpip.subr - The options screen from sysinstall has been converted to a dialog menu - The "UFS" media choice is renamed to "Directory" to reflect how sysinstall treats the choice and a new [true] "UFS" media choice has been added that acts on real UFS partitions (such as external disks with disklabels). - Many more help files have been resurrected from sysinstall (I noticed that some of the content seems a bit dated; I gave them a once-over but they could really use an update). - A total of 10 media choices are presented (via mediaGetType) including: CD/DVD, FTP, FTP Passive, HTTP Proxy, Directory, NFS, DOS, UFS, Floppy, USB - Novel struct/device management layer for managing the issue of passing more information than can comfortably fit in an argument list. Added: head/usr.sbin/bsdconfig/include/media.hlp (contents, props changed) head/usr.sbin/bsdconfig/include/network_device.hlp (contents, props changed) head/usr.sbin/bsdconfig/include/options.hlp (contents, props changed) head/usr.sbin/bsdconfig/include/tcp.hlp - copied unchanged from r245694, head/usr.sbin/bsdconfig/networking/include/tcp.hlp head/usr.sbin/bsdconfig/share/device.subr (contents, props changed) head/usr.sbin/bsdconfig/share/media/ head/usr.sbin/bsdconfig/share/media/Makefile (contents, props changed) head/usr.sbin/bsdconfig/share/media/any.subr (contents, props changed) head/usr.sbin/bsdconfig/share/media/cdrom.subr (contents, props changed) head/usr.sbin/bsdconfig/share/media/common.subr (contents, props changed) head/usr.sbin/bsdconfig/share/media/directory.subr (contents, props changed) head/usr.sbin/bsdconfig/share/media/dos.subr (contents, props changed) head/usr.sbin/bsdconfig/share/media/floppy.subr (contents, props changed) head/usr.sbin/bsdconfig/share/media/ftp.subr (contents, props changed) head/usr.sbin/bsdconfig/share/media/httpproxy.subr (contents, props changed) head/usr.sbin/bsdconfig/share/media/network.subr (contents, props changed) head/usr.sbin/bsdconfig/share/media/nfs.subr (contents, props changed) head/usr.sbin/bsdconfig/share/media/options.subr (contents, props changed) head/usr.sbin/bsdconfig/share/media/tcpip.subr (contents, props changed) head/usr.sbin/bsdconfig/share/media/ufs.subr (contents, props changed) head/usr.sbin/bsdconfig/share/media/usb.subr (contents, props changed) head/usr.sbin/bsdconfig/share/struct.subr (contents, props changed) Deleted: head/usr.sbin/bsdconfig/networking/include/tcp.hlp Modified: head/usr.sbin/bsdconfig/include/Makefile head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/include/Makefile head/usr.sbin/bsdconfig/networking/share/common.subr head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/hostname.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr head/usr.sbin/bsdconfig/networking/share/netmask.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/networking/share/routing.subr head/usr.sbin/bsdconfig/share/Makefile head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/script.subr head/usr.sbin/bsdconfig/share/strings.subr head/usr.sbin/bsdconfig/share/variable.subr Modified: head/usr.sbin/bsdconfig/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/include/Makefile Mon Feb 25 19:22:56 2013 (r247279) +++ head/usr.sbin/bsdconfig/include/Makefile Mon Feb 25 19:55:32 2013 (r247280) @@ -3,7 +3,8 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/include -FILES= bsdconfig.hlp messages.subr usage.hlp +FILES= bsdconfig.hlp media.hlp messages.subr network_device.hlp \ + options.hlp tcp.hlp usage.hlp beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Added: head/usr.sbin/bsdconfig/include/media.hlp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/include/media.hlp Mon Feb 25 19:55:32 2013 (r247280) @@ -0,0 +1,48 @@ +You can install from the following types of media: + + CDROM requires one of the following supported CDROM drives: + ATAPI - Any standard ATAPI CDROM drive hooked to + a supported controller (see Hardware Guide). + SCSI - Any standard SCSI CDROM drive hooked to + a supported controller (see Hardware Guide). + + + DOS A DOS primary partition with the required FreeBSD + distribution files copied onto it (e.g. C:\FREEBSD\) + + + UFS Assuming a disk or partition with an existing + FreeBSD file system and distribution set on it, + get the distribution files from there. + + + Floppy Get distribution files from one or more DOS or UFS + formatted floppies. Such floppies are assumed to + contain the appropriate distribution pieces - see + ABOUT.TXT for more information about making floppy + distribution media. + + + FTP Get the distribution files from an anonymous ftp server + (you will be presented with a list). Please note that + you may invoke FTP in "Active" mode, "Passive" mode, or + via an HTTP proxy. + + Active mode is the standard way of fetching files and + Passive mode is for use when you're behind a firewall or + some other security mechanism that blocks active FTP + connections. Using an HTTP proxy is sometimes necessary + for firewalls which block all FTP connections. + + If you chose to enter your own URL in the FTP menu, please + note that all paths are *relative* to the home directory + of the user being logged in as. By default, this is the + user "ftp" (anonymous ftp) but you may change this in the + Options screen. + + + NFS Get the distribution files from an NFS server somewhere + (make sure that permissions on the server allow this!). + If this install method hangs on you or refuses to work + properly, you may need to set some special options for + your NFS server. See the Options screen for more details. Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Mon Feb 25 19:22:56 2013 (r247279) +++ head/usr.sbin/bsdconfig/include/messages.subr Mon Feb 25 19:55:32 2013 (r247280) @@ -1,5 +1,5 @@ # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,39 +27,251 @@ field_username="Username:" field_password="Password:" +hline_alnum_arrows_punc_tab_enter="Use alnum, arrows, punctuation, TAB or ENTER" hline_alnum_punc_tab_enter="Use alpha-numeric, punctuation, TAB or ENTER" hline_arrows_tab_enter="Press arrows, TAB or ENTER" +hline_choose_help_for_more_information_on_media_types="Choose Help for more information on the various media types" +msg_accept_continue="Accept/Continue" msg_always_try_sudo_when_run_as="Always try sudo(8) when run as %s" +msg_argentina="Argentina" +msg_assume_network_is_already_configured="Running multi-user, assume that the network is already configured?" +msg_attempt_automatic_dhcp_configuration="Attempt automatic DHCP configuration of interfaces" +msg_attempt_ipv6_configuration_of_interfaces="Attempt IPv6 configuration of interfaces" +msg_australia="Australia" +msg_austria="Austria" msg_becoming_root_via_sudo="Becoming root via sudo(8)..." +msg_brazil="Brazil" +msg_canada="Canada" msg_cancel="Cancel" msg_cancel_exit="Cancel/Exit" msg_cannot_create_permission_denied="%s: cannot create %s: Permission denied" +msg_cannot_resolve_hostname="Cannot resolve \`%s'! Are you sure that your\nname server, gateway and network interface are correctly configured?" +msg_cant_find_distribution="Warning: Can't find the \`%s' distribution on this\nFTP server. You may need to visit a different server for\nthe release you are trying to fetch or go to the Options\nmenu and set the release name to explicitly match what's\navailable on %s (or set to \"any\").\n\nWould you like to select another FTP server?" +msg_cant_seem_to_write_out_resolv_conf="Can't seem to write out %s. Net cannot be used." +msg_cd_dvd="CD/DVD" +msg_cdrom="CDROM" +msg_checking_access_to="Checking access to\n %s" +msg_china="China" +msg_choose_a_cd_dvd_type="Choose a CD/DVD type" +msg_choose_a_dos_partition="Choose a DOS partition" +msg_choose_a_floppy_drive="Choose a Floppy drive" +msg_choose_a_ufs_partition="Choose a UFS partition" +msg_choose_a_usb_partition="Choose a USB drive" +msg_choose_installation_media="Choose Installation Media" +msg_choose_installation_media_description="FreeBSD can be installed from a variety of different installation\nmedia, ranging from floppies to an Internet FTP server. If you're\ninstalling FreeBSD from a supported CD/DVD drive then this is generally\nthe best media to use if you have no overriding reason for using other\nmedia." +msg_client_error="Client error, you could try an other server" msg_command_failed_rest_of_script_aborted="Command \`%s' failed - rest of script aborted." +msg_configuration_for_interface="Configuration for Interface" +msg_could_not_unmount_the_cdrom_dvd="Could not unmount the CDROM/DVD from %s: %s" +msg_could_not_unmount_the_dos_partition="Could not unmount the DOS partition from %s: %s" +msg_could_not_unmount_the_nfs_partition="Could not unmount the NFS partition from %s: %s" +msg_could_not_unmount_the_ufs_partition="Could not unmount the UFS partition from %s: %s" +msg_couldnt_connect_to_proxy="Couldn't connect to proxy" +msg_couldnt_connect_to_ftp_server="Couldn't connect to FTP server" +msg_couldnt_open_ftp_connection="Couldn't open FTP connection to %s:\n %s." msg_created_path="Created %s" +msg_croatia="Croatia" +msg_czech_republic="Czech Republic" +msg_debugging="Debugging" +msg_denmark="Denmark" +msg_device_is_not_configured="The %s device is not configured. You will need to do so\nin the Networking configuration menu before proceeding." +msg_dhcp="DHCP" +msg_dialog_mixedform_navigation_help="Use / arrows to navigate between fields, TAB to focus buttons, and Enter for OK/Cancel." +msg_directory="Directory" msg_directory_not_found="%s: Directory not found." +msg_done="Done" +msg_dos="DOS" +msg_editor="Editor" +msg_emit_extra_debugging_output="Emit extra debugging output" +msg_enter_a_fully_qualified_pathname_for_the_directory="Enter a fully qualified pathname for the directory\ncontaining the FreeBSD distribution files:" +msg_enter_the_device_name_of_a_ufs_formatted_partition="Enter the device-name of a UFS formatted partition" +msg_error="Error" +msg_error_mounting_device="Error mounting %s on %s: %s" +msg_error_mounting_floppy_device="Error mounting floppy %s (%s) on %s: %s" +msg_error_mounting_usb_drive="Error mounting USB drive %s on %s: %s" +msg_error_when_requesting_url="Error when requesting %s, you could try an other server" +msg_estonia="Estonia" msg_exit="Exit" msg_exit_bsdconfig="Exit bsdconfig" +msg_extra_options_to_ifconfig="Extra options to ifconfig (usually empty):" +msg_failed_to_add_default_route="Failed to add a default route; please check your network configuration" +msg_file_system="File System" +msg_finland="Finland" +msg_floppy="Floppy" +msg_france="France" +msg_ftp="FTP" +msg_ftp_passive="FTP Passive" +msg_ftp_username="FTP username" +msg_germany="Germany" +msg_greece="Greece" +msg_help="Help" +msg_host_name_including_domain="Host name (including domain)" +msg_hostname_variable_not_set="WARNING: hostname variable not set and is a non-optional\nparameter. Please add this to your installation script\nor set the netInteractive variable (see bsdconfig man page)" +msg_http="HTTP" +msg_http_proxy="HTTP Proxy" +msg_hungary="Hungary" +msg_iceland="Iceland" +msg_install_from_a_dos_partition="Install from a DOS partition" +msg_install_from_a_floppy_disk_set="Install from a floppy disk set" +msg_install_from_a_freebsd_cd_dvd="Install from a FreeBSD CD/DVD" +msg_install_from_a_usb_drive="Install from a USB drive" +msg_install_from_a_ufs_partition="Install from a UFS partition" +msg_install_from_an_ftp_server="Install from an FTP server" +msg_install_from_an_ftp_server_thru_firewall="Install from an FTP server through a firewall" +msg_install_from_an_ftp_server_thru_proxy="Install from an FTP server through an HTTP proxy" +msg_install_from_the_existing_filesystem="Install from the existing filesystem" +msg_install_over_nfs="Install over NFS" +msg_invalid_gateway_ipv4_address_specified="Invalid gateway IPv4 address specified" +msg_invalid_hostname_value="Invalid hostname value" +msg_invalid_ipv4_address="Invalid IPv4 address" +msg_invalid_name_server_ip_address_specified="Invalid name server IP address specified" +msg_invalid_netmask_value="Invalid netmask value" +msg_invalid_nfs_path_specification="Invalid NFS path specification. Must be of the form:\nhost:/full/pathname/to/FreeBSD/distdir" +msg_ipv4_address="IPv4 Address" +msg_ipv4_gateway="IPv4 Gateway" +msg_ipv6="IPv6" +msg_ipv6_ready="IPv6 ready" +msg_ireland="Ireland" +msg_israel="Israel" +msg_italy="Italy" +msg_japan="Japan" +msg_korea="Korea" +msg_lithuania="Lithuania" +msg_length_of_specified_url_is_too_long="Length of specified URL is %u characters. Allowable maximum is %u." +msg_logging_in_to_user_at_host="Logging in to %s@%s.." +msg_looking_up_host="Looking up host %s" msg_main_menu="Main Menu" +msg_main_site="Main Site" +msg_media_timeout="Media Timeout" +msg_media_type="Media Type" msg_menu_text="If you've already installed FreeBSD, you may use\nthis menu to customize it somewhat to suit your\nparticular configuration. Most importantly, you\ncan use the Packages utility to load extra '3rd\nparty' software not provided in the base\ndistributions." +msg_missing_ftp_host_or_directory="Missing FTP host or directory specification. FTP media not initialized." msg_must_be_root_to_execute="%s: must be root to execute" +msg_must_specify_a_host_name_of_some_sort="Must specify a host name of some sort!" +msg_name_server="Name server" +msg_net_device_init_failed="Net device init failed." +msg_netmask="Netmask" +msg_netherlands="Netherlands" +msg_network_configuration="Network Configuration" +msg_network_interface_information_required="Network interface information required" msg_nfailed_attempts="%u incorrect password attempts" +msg_nfs="NFS" +msg_nfs_secure="NFS Secure" +msg_nfs_server_talks_only_on_a_secure_port="NFS server talks only on a secure port" +msg_nfs_slow="NFS Slow" +msg_nfs_tcp="NFS TCP" +msg_nfs_version_3="NFS version 3" msg_no="No" +msg_no_cd_dvd_devices_found="No CD/DVD devices found! Please check that your system's\nconfiguration is correct and that the CD/DVD drive is of a\nsupported type. For more information, consult the hardware\nguide in the Doc menu." +msg_no_dos_primary_partitions_found="No DOS primary partitions found! This installation method is unavailable" +msg_no_floppy_devices_found="No floppy devices found! Please check that your system's configuration\nis correct. For more information, consult the hardware guide in the Doc\nmenu." +msg_no_gateway_has_been_set="No gateway has been set. You will be unable to access hosts\nnot on your local network" +msg_no_network_devices="No network devices available!" msg_no_such_file_or_directory="%s: %s: No such file or directory" +msg_no_usb_devices_found="No USB devices found (try Options/Re-scan Devices)" msg_no_username="No username provided!" +msg_norway="Norway" +msg_not_a_directory="%s: %s: Not a directory" msg_not_found="not found" +msg_not_yet_set="not yet set" msg_ok="OK" +msg_options="Options" +msg_options_editor="Options Editor" +msg_other="other" msg_permission_denied="%s: %s: Permission denied" +msg_please_check_the_url_and_try_again="No such directory: %s\nplease check the URL and try again." msg_please_enter_password="Please enter your password for sudo(8):" msg_please_enter_username_password="Please enter a username and password for sudo(8):" +msg_please_enter_the_address_of_the_http_proxy="Please enter the address of the HTTP proxy in this format:\n hostname:port (the ':port' is optional, default is 3128)" +msg_please_enter_the_full_nfs_file_specification="Please enter the full NFS file specification for the remote\nhost and directory containing the FreeBSD distribution files.\nThis should be in the format: hostname:/some/freebsd/dir" +msg_please_enter_the_password_for_this_user="Please enter the password for this user:" +msg_please_enter_the_username_you_wish_to_login_as="Please enter the username you wish to login as:" +msg_please_insert_floppy_in_drive="Please insert floppy in %s" +msg_please_insert_floppy_containing="Please insert floppy containing %s in %s" +msg_please_select_a_cd_dvd_drive="FreeBSD can be installed directly from a CD/DVD containing a valid\nFreeBSD distribution. If you are seeing this menu it is because\nmore than one CD/DVD drive was found on your system. Please select\none of the following CD/DVD drives as your installation drive." +msg_please_select_a_floppy_drive="You have more than one floppy drive. Please choose which drive\nyou would like to use." +msg_please_select_a_freebsd_ftp_distribution_site="Please select a FreeBSD FTP distribution site" +msg_please_select_dos_partition="FreeBSD can be installed directly from a DOS partition assuming,\nof course, that you have copied the relevant distributions into\nyour DOS partition before starting this installation. If this is\nnot the case then you should reboot DOS at this time and copy the\ndistributions you wish to install into a \"FREEBSD\" subdirectory\non one of your DOS partitions. Otherwise, please select the DOS\npartition containing the FreeBSD distribution files." +msg_please_select_ufs_partition="FreeBSD can be installed directly from another FreeBSD partition\nthat is UFS formatted assuming, of course, that you have copied\nthe relevant distributions into said partition before starting\ninstallation." +msg_please_select_a_usb_drive="You have more than one USB drive. Please choose which drive\nyou would like to use." +msg_please_select_ethernet_device_to_configure="Please select the ethernet or PLIP device to configure." +msg_please_select_the_site_closest_to_you_or_other="Please select the site closest to you or \"other\" if you'd like to\nspecify a different choice. Also note that not every site listed here\ncarries more than the base distribution kits. Only Primary sites are\nguaranteed to carry the full range of possible distributions." +msg_please_specify_the_name_of_the_text_editor="Please specify the name of the text editor you wish to use:" +msg_please_specify_the_number_of_seconds_to_wait="Please specify the number of seconds to wait for slow media:" +msg_please_specify_the_release_you_wish_to_load="Please specify the release you wish to load or\n\"any\" for a generic release install:" +msg_please_specify_url_of_a_freebsd_distribution="Please specify the URL of a FreeBSD distribution on a\nremote ftp site. This site must accept either anonymous\nftp or you should have set an ftp username and password\nin the Options screen.\n\nA URL looks like this: ftp:///\nWhere is relative to the anonymous ftp directory or the\nhome directory of the user being logged in as." +msg_poland="Poland" +msg_portugal="Portugal" msg_previous_syntax_errors="%s: Not overwriting \`%s' due to previous syntax errors" +msg_primary="Primary" +msg_probing_devices_please_wait_this_can_take_a_while="Probing devices, please wait (this can take a while)..." msg_quick_start_how_to_use_this_menu_system="Quick start - How to use this menu system" +msg_release_name="Release Name" +msg_rerun_bsdconfig_initial_device_probe="Re-run bsdconfig initial device probe" +msg_rescan_devices="Re-scan Devices" +msg_reset="RESET!" +msg_reset_all_values_to_startup_defaults="Reset all values to startup defaults" +msg_reuse_old_ftp_site_selection_values="Re-use old FTP site selection values?" +msg_romania="Romania" +msg_russia="Russia" +msg_scanning_for_dhcp_servers="Scanning for DHCP servers..." +msg_scanning_for_ra_servers="Scanning for RA servers..." msg_secure_mode_requires_x11="Secure-mode requires X11 (use \`-X')!" msg_secure_mode_requires_root="Secure-mode requires root-access!" +msg_select_a_site_thats_close="Select a site that's close!" +msg_server_error_when_requesting_url="Server error when requesting %s, you could try an other server" +msg_singapore="Singapore" +msg_slovak_republic="Slovak Republic" +msg_slovenia="Slovenia" +msg_snapshots_server_japan="Snapshots Server Japan" +msg_snapshots_server_sweden="Snapshots Server Sweden" +msg_sorry_invalid_url="Sorry, %s is an invalid URL!" msg_sorry_try_again="Sorry, try again." +msg_south_africa="South Africa" +msg_spain="Spain" +msg_specify_some_other_ftp_site="Specify some other ftp site by URL" +msg_sweden="Sweden" +msg_switzerland="Switzerland" +msg_taiwan="Taiwan" +msg_the_current_installation_media_type="The current installation media type." +msg_timeout_value_in_seconds_for_slow_media="Timeout value in seconds for slow media." +msg_try_dhcp_configuration="Do you want to try DHCP configuration of the interface?" +msg_try_ipv6_configuration="Do you want to try IPv6 configuration of the interface?" msg_try_sudo_only_this_once="Try sudo(8) only this once" +msg_turkey="Turkey" +msg_ufs="UFS" +msg_uk="UK" +msg_ukraine="Ukraine" +msg_unable_to_configure_device="Unable to configure the %s interface!\nThis installation method cannot be used." +msg_unable_to_get_proper_ftp_path="Unable to get proper FTP path. FTP media not initialized." +msg_unable_to_make_directory_mountpoint="Unable to make %s directory mountpoint for %s!" msg_unable_to_open="Unable to open %s" +msg_unknown="unknown" msg_unknown_user="Unknown user: %s" +msg_url_was_not_found="%s was not found, maybe directory or release-version are wrong?" +msg_usa="USA" msg_usage="Usage" +msg_usb="USB" +msg_use_defaults="Use Defaults" +msg_use_nfs_version_3="Use NFS version 3" +msg_use_tcp_protocol_for_nfs="Use TCP protocol for NFS" msg_user_disallowed="User disallowed: %s" +msg_user_is_using_a_slow_pc_or_ethernet_card="User is using a slow PC or Ethernet card" +msg_username_and_password_to_use="Username and password to use instead of anonymous" +msg_using_interface="Using interface %s" +msg_using_usb_device="Using USB device: %s" +msg_view_set_various_media_options="View/Set various media options" +msg_which_release_to_attempt_to_load="Which release to attempt to load from installation media" +msg_which_text_editor_to_use="Which text editor to use during installation" +msg_would_you_like_to_bring_interface_up="Would you like to bring the %s interface up right now?" msg_yes="Yes" msg_you_are_not_root_but="You are not root but %s can use sudo(8).\nWhat would you like to do?" +msg_you_may_remove_the_floppy="You may remove the floppy from %s" +msg_youve_already_done_the_network_configuration="You've already done the network configuration once,\nwould you like to skip over it now?" +tcplayout_extras_help="Any interface-specific options to ifconfig you would like to add" +tcplayout_extras_help_for_plip="For PLIP configuration, you must enter the peer's IP address here." +tcplayout_gateway_help="IPv4 address of host forwarding packets to non-local destinations" +tcplayout_hostname_help="Your fully-qualified hostname, e.g. foo.example.com" +tcplayout_ipaddr_help="The IPv4 address to be used for this interface" +tcplayout_nameserver_help="IPv4 or IPv6 address of your local DNS server" +tcplayout_netmask_help="The netmask for this interface, e.g. 255.255.255.0 for a class C network" Added: head/usr.sbin/bsdconfig/include/network_device.hlp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/include/network_device.hlp Mon Feb 25 19:55:32 2013 (r247280) @@ -0,0 +1,58 @@ +You can do network installations over 3 types of communications links: + + Serial port: SLIP / PPP + Parallel port: PLIP (laplink cable) + Ethernet: A standard Ethernet controller (includes some + PCMCIA networking cards). + +SLIP support is rather primitive and limited primarily to directly +connected links, such as a serial cable running between a laptop +computer and another PC. The link must be hard-wired as the SLIP +installation doesn't currently offer a dialing capability (that +facility is offered by the PPP utility, which should be used in +preference to SLIP whenever possible). When you choose the SLIP +option, you'll be given the option of later editing the slattach +command before it's run on the serial line. It is expected that +you'll run slattach (or some equivalent command) on the other end of +the link at that time and bring up the line. FreeBSD will then +install itself at serial speeds of up to 115.2K/baud (the recommended +speed for a hardwired cable). + +If you're using a modem then PPP is almost certainly your only choice. +Make sure that you have your service provider's information handy as +you'll need to know it fairly early in the installation process. You +will need to know your service provider's IP address, the IP address +of your provider's DNS server, and possibly your own IP address unless +your ISP supports dynamic negotiation, most do. If you do not choose +a PAP or CHAP login you will also need to know how to use the various +"AT commands" to dial the ISP with your particular brand of modem as +the PPP dialer provides only a very simple terminal emulator and has no +"modem capabilities database". If you choose a PAP or CHAP login you +can simply enter `dial' (without the quotes) at the ppp prompt if your +modem uses the Hayes compatible AT command set. + +If a hard-wired connection to another FreeBSD (2.0R or later) machine +is available, you might also consider installing over a "laplink" +parallel port cable. The data rate over the parallel port is much +higher than what is typically possible over a serial line, and speeds +of over 50KB/sec are not uncommon. + +Finally, for the fastest possible network installation, an Ethernet +adaptor is always a good choice! FreeBSD supports most common PC +Ethernet cards, a table of which is provided in the FreeBSD Hardware +Guide (see the `Documentation' entry in the main menu). If you are +using one of the supported PCMCIA Ethernet cards, also be sure that +it's plugged in BEFORE the laptop is powered on! Sysinstall does not, +unfortunately, currently support "hot insertion" of PCMCIA cards. + +You will also need to know your IP address on the network, the +"netmask" value for your address class, and the name of your machine. +Your system administrator can tell you which values to use for your +particular network setup. If you will be referring to other hosts by +name rather than IP address, you'll also need a name server and +possibly the address of a gateway (if you're using PPP, it's your +provider's IP address) to use in talking to it. If you do not know +the answers to all or most of these questions then you should really +probably talk to your system administrator FIRST before trying this +type of installation! Choosing the wrong IP address on a busy network +will NOT make you popular with your systems administrator! :-) Added: head/usr.sbin/bsdconfig/include/options.hlp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/include/options.hlp Mon Feb 25 19:55:32 2013 (r247280) @@ -0,0 +1,98 @@ +The following options may be set from this screen. + +NFS Secure: NFS server talks only on a secure port + + This is most commonly used when talking to Sun workstations, which + will not talk NFS over "non privileged" ports. + + +NFS Slow: User is using a slow PC or Ethernet card + + Use this option if you have a slow PC (386) or an Ethernet card + with poor performance being "fed" by NFS on a higher-performance + workstation. This will throttle the workstation back to prevent + the PC from becoming swamped with data. + + +NFS TCP: Use TCP for the NFS mount + + This option can be used if your NFS server supports TCP + connections; not all do! This may be useful if your NFS server + is at a remote site in which case it may offer some additional + stability. + + +NFS version 3: Use NFS version 3 + + This option forces the use of NFS version 3 and is on by default. + If your NFS server only supports NFS version 2, disable this option. + + +Debugging: Turn on the extra debugging flag + + This turns on a lot of extra noise in between dialogs (unless + debugFile has been set, sending the data to a logfile instead). + Optionally, if debugFile begins with a plus sign (`+'), output will + occur both on standard output and to debugFile (minus leading plus). + If your installation should fail for any reason, PLEASE turn this + flag on when attempting to reproduce the problem. It will provide a + lot of extra debugging at the failure point and may be very helpful + to the developers in tracking such problems down! + + +DHCP: Enable DHCP configuration of interfaces + + This option specifies whether DHCP configuration of interfaces + may be attempted. The default setting is to interactively ask + the user. + + +IPv6: Enable IPv6 router solicitation configuration + + This option specifies whether automatic configuration of IPv6 + interfaces may be attempted. This uses the router solicitation + method of automatic configuration. The default setting is to + interactively ask the user. + + +FTP username: Specify username and password instead of anonymous. + + By default, the installation attempts to log in as the + anonymous user. If you wish to log in as someone else, + specify the username and password with this option. + + +Editor: Specify which screen editor to use. + + At various points during the installation it may be necessary + to customize some text file, at which point the user will be + thrown unceremoniously into a screen editor. A relatively + simplistic editor which shows its command set on-screen is + selected by default, but UNIX purists may wish to change this + setting to `/usr/bin/vi'. + + +Release Name: Which release to attempt to load from installation media. + + You should only change this option if you're really sure you know + what you are doing! This will change the release name used by + bsdconfig when fetching components of any distributions, and + is a useful way of using a more recent installation boot floppy + with an older release (say, on CDROM). + + +Media Type: Which media type is being used. + + This is mostly informational and indicates which media type (if any) + was last selected in the Media menu. It's also a convenient short-cut + to the media menu itself. + + +Re-scan Devices: + + Reprobe the system for devices. + + +Use Defaults: Use default values. + + Reset all options back to their default values. Copied: head/usr.sbin/bsdconfig/include/tcp.hlp (from r245694, head/usr.sbin/bsdconfig/networking/include/tcp.hlp) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/include/tcp.hlp Mon Feb 25 19:55:32 2013 (r247280, copy of r245694, head/usr.sbin/bsdconfig/networking/include/tcp.hlp) @@ -0,0 +1,33 @@ +This screen allows you to set up your general network parameters +(hostname, domain name, DNS server, etc) as well as the settings for a +given interface (which was selected from the menu before this screen). + +PLIP/SLIP users - please read through to the end of this doc! + +The "options" field is kind of special (read: a hack :-): + +Any valid options to ifconfig can be specified here, so if you need +to do something "special" to get your interface working, then here +is the place to do it. + +If you're running SLIP or PLIP, you also need to use it for specifying +the remote end of the link (simply type the foreign IP address in). +In the specific case where you're running PLIP with a Linux host peer +rather than a FreeBSD one, you also must add the "-link0" flag after the +foreign address. + +If you're dealing with an ethernet adaptor with multiple media +connectors (e.g. AUI, 10BT, 10B2, etc), you can use this field to +specify which one to use. Examples of valid strings include: + + "media 10base5/AUI" - Select the AUI port. + "media 10baseT/UTP" - Select the twisted pair port. + "media 10base2/BNC" - Select the BNC connector. + "media 100baseTX" - Select 100BaseT on a 100/10 dual adaptor. + +If you have a wireless interface and must specify arguments such as a +WEP key here, you may use something like: + + "wepmode on wepkey 0xFEEDFACE" + +When you're done with this form, select OK. Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Mon Feb 25 19:22:56 2013 (r247279) +++ head/usr.sbin/bsdconfig/networking/devices Mon Feb 25 19:55:32 2013 (r247280) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -34,6 +34,7 @@ f_dprintf "%s: loading includes..." "$0" f_include $BSDCFG_SHARE/dialog.subr f_include $BSDCFG_SHARE/mustberoot.subr f_include $BSDCFG_SHARE/sysrc.subr +f_include $BSDCFG_SHARE/media/tcpip.subr f_include $BSDCFG_SHARE/networking/device.subr f_include $BSDCFG_SHARE/networking/ipaddr.subr f_include $BSDCFG_SHARE/networking/media.subr Modified: head/usr.sbin/bsdconfig/networking/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/Makefile Mon Feb 25 19:22:56 2013 (r247279) +++ head/usr.sbin/bsdconfig/networking/include/Makefile Mon Feb 25 19:55:32 2013 (r247280) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/120.networking/include -FILES= messages.subr tcp.hlp +FILES= messages.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: head/usr.sbin/bsdconfig/networking/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/common.subr Mon Feb 25 19:22:56 2013 (r247279) +++ head/usr.sbin/bsdconfig/networking/share/common.subr Mon Feb 25 19:55:32 2013 (r247280) @@ -1,6 +1,6 @@ if [ ! "$_NETWORKING_COMMON_SUBR" ]; then _NETWORKING_COMMON_SUBR=1 # -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -33,17 +33,6 @@ BSDCFG_SHARE="/usr/share/bsdconfig" ############################################################ FUNCTIONS -# f_mounted $local_directory -# -# Return success if a filesystem is mounted on a particular directory. -# -f_mounted() -{ - local dir="$1" - [ -d "$dir" ] || return $FAILURE - mount | grep -Eq " on $dir \([^)]+\)$" -} - # f_jailed # # Returns true if the current process is jail(8)ed. Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Mon Feb 25 19:22:56 2013 (r247279) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Mon Feb 25 19:55:32 2013 (r247280) @@ -1,6 +1,6 @@ if [ ! "$_NETWORKING_DEVICE_SUBR" ]; then _NETWORKING_DEVICE_SUBR=1 # -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -31,8 +31,10 @@ if [ ! "$_NETWORKING_DEVICE_SUBR" ]; the BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." networking/device.subr +f_include $BSDCFG_SHARE/device.subr f_include $BSDCFG_SHARE/dialog.subr f_include $BSDCFG_SHARE/sysrc.subr +f_include $BSDCFG_SHARE/media/tcpip.subr f_include $BSDCFG_SHARE/networking/common.subr f_include $BSDCFG_SHARE/networking/ipaddr.subr f_include $BSDCFG_SHARE/networking/media.subr @@ -43,8 +45,6 @@ f_include $BSDCFG_SHARE/networking/routi BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -TCP_HELPFILE=$BSDCFG_LIBE/$APP_DIR/include/tcp.hlp - ############################################################ GLOBALS # @@ -55,133 +55,6 @@ TCP_HELPFILE=$BSDCFG_LIBE/$APP_DIR/inclu ############################################################ FUNCTIONS -# f_device_desc $device_name -# -# Print a description for a device name (eg., `fxp0'). -# -f_device_desc() -{ - local device="$1" d="[1234567890]" desc="" - - # Check variables - [ "$device" ] || return $SUCCESS - - # - # Return sysctl MIB dev.NAME.UNIT.%desc if it exists, - # otherwise fall through to below static list. - # - if f_have sysctl; then - local devname devunit - devname="${device%%$d*}" - devunit="${device#$devname}" - devunit="${devunit%%[a-zA-Z_]*}" - sysctl -n "dev.$devname.$devunit.%desc" 2> /dev/null && - return $SUCCESS - fi - - case "$device" in - # Network devices - ae$d) desc="Attansic/Atheros L2 Fast Ethernet";; - age$d) desc="Attansic/Atheros L1 Gigabit Ethernet";; - alc$d) desc="Atheros AR8131/AR8132 PCIe Ethernet";; - ale$d) desc="Atheros AR8121/AR8113/AR8114 PCIe Ethernet";; - an$d) desc="Aironet 4500/4800 802.11 wireless adapter";; - ath$d) desc="Atheros IEEE 802.11 wireless adapter";; - aue$d) desc="ADMtek USB Ethernet adapter";; - axe$d) desc="ASIX Electronics USB Ethernet adapter";; - bce$d) desc="Broadcom NetXtreme II Gigabit Ethernet card";; - bfe$d) desc="Broadcom BCM440x PCI Ethernet card";; - bge$d) desc="Broadcom BCM570x PCI Gigabit Ethernet card";; - bm$d) desc="Apple BMAC Built-in Ethernet";; - bwn$d) desc="Broadcom BCM43xx IEEE 802.11 wireless adapter";; - cas$d) desc="Sun Cassini/Cassini+ or NS DP83065 Saturn Ethernet";; - cc3i$d) desc="SDL HSSI sync serial PCI card";; - cue$d) desc="CATC USB Ethernet adapter";; - cxgb$d) desc="Chelsio T3 10Gb Ethernet card";; - dc$d) desc="DEC/Intel 21143 (and clones) PCI Fast Ethernet card";; - de$d) desc="DEC DE435 PCI NIC or other DC21040-AA based card";; - disc$d) desc="Software discard network interface";; - ed$d) desc="Novell NE1000/2000; 3C503; NE2000-compatible PCMCIA";; - el$d) desc="3Com 3C501 Ethernet card";; - em$d) desc="Intel(R) PRO/1000 Ethernet card";; - en$d) desc="Efficient Networks ATM PCI card";; - ep$d) desc="3Com 3C509 Ethernet card/3C589 PCMCIA";; - et$d) desc="Agere ET1310 based PCI Express Gigabit Ethernet card";; - ex$d) desc="Intel EtherExpress Pro/10 Ethernet card";; - fe$d) desc="Fujitsu MB86960A/MB86965A Ethernet card";; - fpa$d) desc="DEC DEFPA PCI FDDI card";; - fwe$d) desc="FireWire Ethernet emulation";; - fwip$d) desc="IP over FireWire";; - fxp$d) desc="Intel EtherExpress Pro/100B PCI Fast Ethernet card";; - gem$d) desc="Apple GMAC or Sun ERI/GEM Ethernet adapter";; - hme$d) desc="Sun HME (Happy Meal Ethernet) Ethernet adapter";; - ie$d) desc="AT&T StarLAN 10 and EN100; 3Com 3C507; NI5210";; - igb$d) desc="Intel(R) PRO/1000 PCI Express Gigabit Ethernet card";; - ipw$d) desc="Intel PRO/Wireless 2100 IEEE 802.11 adapter";; - iwi$d) desc="Intel PRO/Wireless 2200BG/2225BG/2915ABG adapter";; - iwn$d) desc="Intel Wireless WiFi Link 4965AGN IEEE 802.11n adapter";; - ix$d) desc="Intel Etherexpress Ethernet card";; - ixgb$d) desc="Intel(R) PRO/10Gb Ethernet card";; - ixgbe$d) desc="Intel(R) PRO/10Gb Ethernet card";; - jme$d) desc="JMicron JMC250 Gigabit/JMC260 Fast Ethernet";; - kue$d) desc="Kawasaki LSI USB Ethernet adapter";; - le$d) desc="AMD Am7900 LANCE or Am79C9xx PCnet Ethernet adapter";; - lge$d) desc="Level 1 LXT1001 Gigabit Ethernet card";; - lnc$d) desc="Lance/PCnet (Isolan/Novell NE2100/NE32-VL) Ethernet";; - lp$d) desc="Parallel Port IP (PLIP) peer connection";; - lo$d) desc="Loop-back (local) network interface";; - malo$d) desc="Marvell Libertas 88W8335 802.11 wireless adapter";; - msk$d) desc="Marvell/SysKonnect Yukon II Gigabit Ethernet";; - mxge$d) desc="Myricom Myri10GE 10Gb Ethernet card";; - nfe$d) desc="NVIDIA nForce MCP Ethernet";; - ng${d}_*|ng$d${d}_*|ng$d$d${d}_*|ng$d$d$d${d}_*|ng$d$d$d$d${d}_*) - desc="Vimage netgraph(4) bridged Ethernet device";; - nge$d) desc="NatSemi PCI Gigabit Ethernet card";; - nve$d) desc="NVIDIA nForce MCP Ethernet";; - nxge$d) desc="Neterion Xframe 10GbE Server/Storage adapter";; - pcn$d) desc="AMD Am79c79x PCI Ethernet card";; - plip$d) desc="Parallel Port IP (PLIP) peer connection";; - ral$d) desc="Ralink Technology IEEE 802.11 wireless adapter";; - ray$d) desc="Raytheon Raylink 802.11 wireless adapter";; - re$d) desc="RealTek 8139C+/8169/8169S/8110S PCI Ethernet adapter";; - rl$d) desc="RealTek 8129/8139 PCI Ethernet card";; - rue$d) desc="RealTek USB Ethernet card";; - rum$d) desc="Ralink Technology USB IEEE 802.11 wireless adapter";; - sf$d) desc="Adaptec AIC-6915 PCI Ethernet card";; - sge$d) desc="Silicon Integrated Systems SiS190/191 Ethernet";; - sis$d) desc="SiS 900/SiS 7016 PCI Ethernet card";; - sk$d) desc="SysKonnect PCI Gigabit Ethernet card";; - sn$d) desc="SMC/Megahertz Ethernet card";; - snc$d) desc="SONIC Ethernet card";; - sr$d) desc="SDL T1/E1 sync serial PCI card";; - ste$d) desc="Sundance ST201 PCI Ethernet card";; - stge$d) desc="Sundance/Tamarack TC9021 Gigabit Ethernet";; - ti$d) desc="Alteon Networks PCI Gigabit Ethernet card";; - tl$d) desc="Texas Instruments ThunderLAN PCI Ethernet card";; - tx$d) desc="SMC 9432TX Ethernet card";; - txp$d) desc="3Com 3cR990 Ethernet card";; - uath$d) desc="Atheros AR5005UG and AR5005UX USB wireless adapter";; - upgt$d) desc="Conexant/Intersil PrismGT USB wireless adapter";; - ural$d) desc="Ralink Technology RT2500USB 802.11 wireless adapter";; - urtw$d) desc="Realtek 8187L USB wireless adapter";; - vge$d) desc="VIA VT612x PCI Gigabit Ethernet card";; - vlan$d|vlan$d$d|vlan$d$d$d|vlan$d$d$d$d|vlan$d$d$d$d$d) - desc="IEEE 802.1Q VLAN network interface";; - vr$d) desc="VIA VT3043/VT86C100A Rhine PCI Ethernet card";; - vx$d) desc="3COM 3c590 / 3c595 Ethernet card";; - wb$d) desc="Winbond W89C840F PCI Ethernet card";; - wi$d) desc="Lucent WaveLAN/IEEE 802.11 wireless adapter";; - wpi$d) desc="Intel 3945ABG IEEE 802.11 wireless adapter";; - wx$d) desc="Intel Gigabit Ethernet (82452) card";; - xe$d) desc="Xircom/Intel EtherExpress Pro100/16 Ethernet card";; - xl$d) desc="3COM 3c90x / 3c90xB PCI Ethernet card";; - zyd$d) desc="ZyDAS ZD1211/ZD1211B USB 802.11 wireless adapter";; - # Unknown device - *) desc="";; - esac - printf "%s\n" "$desc" -} - # f_dialog_menu_netdev # # Display a list of network devices with descriptions. Modified: head/usr.sbin/bsdconfig/networking/share/hostname.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/hostname.subr Mon Feb 25 19:22:56 2013 (r247279) +++ head/usr.sbin/bsdconfig/networking/share/hostname.subr Mon Feb 25 19:55:32 2013 (r247280) @@ -1,6 +1,6 @@ if [ ! "$_NETWORKING_HOSTNAME_SUBR" ]; then _NETWORKING_HOSTNAME_SUBR=1 # -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -41,63 +41,6 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc ############################################################ FUNCTIONS -# f_validate_hostname $hostname -# -# Returns zero if the given argument (a fully-qualified hostname) is compliant -# with standards set-forth in RFC's 952 and 1123 of the Network Working Group: -# -# RFC 952 - DoD Internet host table specification -# http://tools.ietf.org/html/rfc952 -# -# RFC 1123 - Requirements for Internet Hosts - Application and Support -# http://tools.ietf.org/html/rfc1123 -# -# See http://en.wikipedia.org/wiki/Hostname for a brief overview. -# -# The return status for invalid hostnames is one of: -# 255 Entire hostname exceeds the maximum length of 255 characters. -# 63 One or more individual labels within the hostname (separated by -# dots) exceeds the maximum of 63 characters. -# 1 One or more individual labels within the hostname contains one -# or more invalid characters. -# 2 One or more individual labels within the hostname starts or -# ends with a hyphen (hyphens are allowed, but a label cannot -# begin or end with a hyphen). -# 3 One or more individual labels within the hostname are null. -# -# If the hostname is determined to be invalid, the appropriate error will be -# displayed using the f_show_msg function. -# -f_validate_hostname() -{ - local fqhn="$1" - - ( # Operate within a sub-shell to protect the parent environment - - # Return error if the hostname exceeds 255 characters - [ ${#fqhn} -gt 255 ] && exit 255 - - IFS="." # Split on `dot' - for label in $fqhn; do - - # Return error if the label exceeds 63 characters - [ ${#label} -gt 63 ] && exit 63 - - # Return error if the label is null - [ "$label" ] || exit 3 - - # Return error if label begins/ends with dash - case "$label" in - -*|*-) exit 2 - esac - - # Return error if the label contains any invalid chars - echo "$label" | grep -q '^[[:alnum:]-]*$' || exit 1 - - done - ) -} - # f_dialog_hnerror $error $hostname # # Display a msgbox with the appropriate error message for an error returned by Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Mon Feb 25 19:22:56 2013 (r247279) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Mon Feb 25 19:55:32 2013 (r247280) @@ -1,6 +1,6 @@ if [ ! "$_NETWORKING_IPADDR_SUBR" ]; then _NETWORKING_IPADDR_SUBR=1 # -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -40,75 +40,10 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc ############################################################ FUNCTIONS -# f_ifconfig_inet $interface -# -# Returns the IPv4 address associated with $interface. -# -f_ifconfig_inet() -{ - local interface="$1" - ifconfig "$interface" 2> /dev/null | awk \ - ' - BEGIN { found = 0 } - ( $1 == "inet" ) \ - { - print $2 - found = 1 - exit - } - END { exit ! found } - ' -} - -# f_validate_ipaddr $ipaddr -# -# Returns zero if the given argument (an IP address) is of the proper format. -# -# The return status for invalid IP address is one of: -# 1 One or more individual octets within the IP address (separated -# by dots) contains one or more invalid characters. -# 2 One or more individual octets within the IP address are null -# and/or missing. -# 3 One or more individual octets within the IP address exceeds the -# maximum of 255 (or 2^8, being an octet comprised of 8 bits). -# 4 The IP address has either too few or too many octets. -# -f_validate_ipaddr() -{ - local ip="$1" - - ( # Operate within a sub-shell to protect the parent environment - - # Track number of octets for error checking - noctets=0 - - IFS="." # Split on `dot' - for octet in $ip; do - - # Return error if the octet is null - [ "$octet" ] || exit 2 - - # Return error if not a whole integer - f_isinteger "$octet" || exit 1 - - # Return error if not a positive integer - [ $octet -ge 0 ] || exit 1 - - # Return error if the octet exceeds 255 - [ $octet -gt 255 ] && exit 3 - - noctets=$(( $noctets + 1 )) - - done - - [ $noctets -eq 4 ] || exit 4 - ) -} - # f_dialog_iperror $error $ipaddr # # Display a msgbox with the appropriate error message for an error returned by -# the f_validate_ipaddr function above. +# the f_validate_ipaddr function. # f_dialog_iperror() { @@ -144,141 +79,6 @@ f_dialog_validate_ipaddr() return $retval } -# f_validate_ipaddr6 $ipv6_addr -# -# Returns zero if the given argument (an IPv6 address) is of the proper format. -# -# The return status for invalid IP address is one of: -# 1 One or more individual segments within the IP address -# (separated by colons) contains one or more invalid characters. -# Segments must contain only combinations of the characters 0-9, -# A-F, or a-f. -# 2 Too many/incorrect null segments. A single null segment is -# allowed within the IP address (separated by colons) but not -# allowed at the beginning or end (unless a double-null segment; -# i.e., "::*" or "*::"). -# 3 One or more individual segments within the IP address -# (separated by colons) exceeds the length of 4 hex-digits. -# 4 The IP address entered has either too few (less than 3), too -# many (more than 8), or not enough segments, separated by -# colons. -# 5* The IPv4 address at the end of the IPv6 address is invalid. -# * When there is an error with the dotted-quad IPv4 address at the -# end of the IPv6 address, the return value of 5 is OR'd with a -# bit-shifted (<< 4) return of f_validate_ipaddr. -# -f_validate_ipaddr6() -{ - local ip="$1" - - ( # Operate within a sub-shell to protect the parent environment - - IFS=":" # Split on `colon' - set -- $ip: - - # Return error if too many or too few segments - # Using 9 as max in case of leading or trailing null spanner - [ $# -gt 9 -o $# -lt 3 ] && exit 4 - - h="[0-9A-Fa-f]" - nulls=0 - nsegments=$# - contains_ipv4_segment= - - while [ $# -gt 0 ]; do - - segment="${1%:}" - shift - - # - # Return error if this segment makes one null too-many. - # A single null segment is allowed anywhere in the - # middle as well as double null segments are allowed at - # the beginning or end (but not both). - # - if [ ! "$segment" ]; then - nulls=$(( $nulls + 1 )) - if [ $nulls -eq 3 ]; then - # Only valid syntax for 3 nulls is `::' - [ "$ip" = "::" ] || exit 2 - elif [ $nulls -eq 2 ]; then - # Only valid if begins/ends with `::' - case "$ip" in - ::*|*::) : fall thru ;; - *) exit 2 - esac - fi - continue - fi - - # - # Return error if not a valid hexadecimal short - # - case "$segment" in - $h|$h$h|$h$h$h|$h$h$h$h) - : valid segment of 1-4 hexadecimal digits - ;; - *[!0-9A-Fa-f]*) - # Segment contains at least one invalid char - - # Return error immediately if not last segment - [ $# -eq 0 ] || exit 1 - - # Otherwise, check for legacy IPv4 notation - case "$segment" in - *[!0-9.]*) - # Segment contains at least one invalid - # character even for an IPv4 address - exit 1 - esac - - # Return error if not enough segments - if [ $nulls -eq 0 ]; then - [ $nsegments -eq 7 ] || exit 4 - fi *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 20:09:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7FEE6959; Mon, 25 Feb 2013 20:09:09 +0000 (UTC) (envelope-from trociny@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 67A622F9; Mon, 25 Feb 2013 20:09:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PK98Cr004601; Mon, 25 Feb 2013 20:09:08 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PK98wF004594; Mon, 25 Feb 2013 20:09:08 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201302252009.r1PK98wF004594@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 25 Feb 2013 20:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247281 - in head/sbin: hastctl hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 20:09:09 -0000 Author: trociny Date: Mon Feb 25 20:09:07 2013 New Revision: 247281 URL: http://svnweb.freebsd.org/changeset/base/247281 Log: Add i/o error counters to hastd(8) and make hastctl(8) display them. This may be useful for detecting problems with HAST disks. Discussed with and reviewed by: pjd MFC after: 1 week Modified: head/sbin/hastctl/hastctl.c head/sbin/hastd/control.c head/sbin/hastd/hast.h head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastctl/hastctl.c ============================================================================== --- head/sbin/hastctl/hastctl.c Mon Feb 25 19:55:32 2013 (r247280) +++ head/sbin/hastctl/hastctl.c Mon Feb 25 20:09:07 2013 (r247281) @@ -351,6 +351,12 @@ control_status(struct nv *nv) (uint64_t)nv_get_uint64(nv, "stat_flush%u", ii)); printf(" activemap updates: %ju\n", (uint64_t)nv_get_uint64(nv, "stat_activemap_update%u", ii)); + printf(" local errors: " + "read: %ju, write: %ju, delete: %ju, flush: %ju\n", + (uintmax_t)nv_get_uint64(nv, "stat_read_error%u", ii), + (uintmax_t)nv_get_uint64(nv, "stat_write_error%u", ii), + (uintmax_t)nv_get_uint64(nv, "stat_delete_error%u", ii), + (uintmax_t)nv_get_uint64(nv, "stat_flush_error%u", ii)); } return (ret); } Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Mon Feb 25 19:55:32 2013 (r247280) +++ head/sbin/hastd/control.c Mon Feb 25 20:09:07 2013 (r247281) @@ -207,6 +207,14 @@ control_status_worker(struct hast_resour "stat_flush%u", no); nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_activemap_update"), "stat_activemap_update%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_read_error"), + "stat_read_error%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_write_error"), + "stat_write_error%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_delete_error"), + "stat_delete_error%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_flush_error"), + "stat_flush_error%u", no); end: if (cnvin != NULL) nv_free(cnvin); @@ -459,6 +467,16 @@ ctrl_thread(void *arg) nv_add_uint64(nvout, res->hr_stat_flush, "stat_flush"); nv_add_uint64(nvout, res->hr_stat_activemap_update, "stat_activemap_update"); + nv_add_uint64(nvout, res->hr_stat_read_error, + "stat_read_error"); + nv_add_uint64(nvout, res->hr_stat_write_error + + res->hr_stat_activemap_write_error, + "stat_write_error"); + nv_add_uint64(nvout, res->hr_stat_delete_error, + "stat_delete_error"); + nv_add_uint64(nvout, res->hr_stat_flush_error + + res->hr_stat_activemap_flush_error, + "stat_flush_error"); nv_add_int16(nvout, 0, "error"); break; case CONTROL_RELOAD: Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Mon Feb 25 19:55:32 2013 (r247280) +++ head/sbin/hastd/hast.h Mon Feb 25 20:09:07 2013 (r247281) @@ -239,6 +239,18 @@ struct hast_resource { uint64_t hr_stat_flush; /* Number of activemap updates. */ uint64_t hr_stat_activemap_update; + /* Number of local read errors. */ + uint64_t hr_stat_read_error; + /* Number of local write errors. */ + uint64_t hr_stat_write_error; + /* Number of local delete errors. */ + uint64_t hr_stat_delete_error; + /* Number of flush errors. */ + uint64_t hr_stat_flush_error; + /* Number of activemap write errors. */ + uint64_t hr_stat_activemap_write_error; + /* Number of activemap flush errors. */ + uint64_t hr_stat_activemap_flush_error; /* Next resource. */ TAILQ_ENTRY(hast_resource) hr_next; Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Mon Feb 25 19:55:32 2013 (r247280) +++ head/sbin/hastd/primary.c Mon Feb 25 20:09:07 2013 (r247281) @@ -303,6 +303,7 @@ hast_activemap_flush(struct hast_resourc if (pwrite(res->hr_localfd, buf, size, METADATA_SIZE) != (ssize_t)size) { pjdlog_errno(LOG_ERR, "Unable to flush activemap to disk"); + res->hr_stat_activemap_write_error++; return (-1); } if (res->hr_metaflush == 1 && g_flush(res->hr_localfd) == -1) { @@ -313,6 +314,7 @@ hast_activemap_flush(struct hast_resourc } else { pjdlog_errno(LOG_ERR, "Unable to flush disk cache on activemap update"); + res->hr_stat_activemap_flush_error++; return (-1); } } @@ -1936,6 +1938,22 @@ ggate_send_thread(void *arg) "G_GATE_CMD_DONE failed"); } } + if (hio->hio_errors[0]) { + switch (ggio->gctl_cmd) { + case BIO_READ: + res->hr_stat_read_error++; + break; + case BIO_WRITE: + res->hr_stat_write_error++; + break; + case BIO_DELETE: + res->hr_stat_delete_error++; + break; + case BIO_FLUSH: + res->hr_stat_flush_error++; + break; + } + } pjdlog_debug(2, "ggate_send: (%p) Moving request to the free queue.", hio); QUEUE_INSERT2(hio, free); Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Mon Feb 25 19:55:32 2013 (r247280) +++ head/sbin/hastd/secondary.c Mon Feb 25 20:09:07 2013 (r247281) @@ -765,6 +765,7 @@ disk_thread(void *arg) pjdlog_errno(LOG_WARNING, "Unable to store cleared activemap"); free(map); + res->hr_stat_activemap_write_error++; break; } free(map); @@ -883,8 +884,23 @@ send_thread(void *arg) PJDLOG_ABORT("Unexpected command (cmd=%hhu).", hio->hio_cmd); } - if (hio->hio_error != 0) + if (hio->hio_error != 0) { + switch (hio->hio_cmd) { + case HIO_READ: + res->hr_stat_read_error++; + break; + case HIO_WRITE: + res->hr_stat_write_error++; + break; + case HIO_DELETE: + res->hr_stat_delete_error++; + break; + case HIO_FLUSH: + res->hr_stat_flush_error++; + break; + } nv_add_int16(nvout, hio->hio_error, "error"); + } if (hast_proto_send(res, res->hr_remoteout, nvout, data, length) == -1) { secondary_exit(EX_TEMPFAIL, "Unable to send reply"); From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 20:31:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 59C21195; Mon, 25 Feb 2013 20:31:48 +0000 (UTC) (envelope-from neel@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 35C00662; Mon, 25 Feb 2013 20:31:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PKVmZP012700; Mon, 25 Feb 2013 20:31:48 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PKVmxK012699; Mon, 25 Feb 2013 20:31:48 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201302252031.r1PKVmxK012699@svn.freebsd.org> From: Neel Natu Date: Mon, 25 Feb 2013 20:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247282 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 20:31:48 -0000 Author: neel Date: Mon Feb 25 20:31:47 2013 New Revision: 247282 URL: http://svnweb.freebsd.org/changeset/base/247282 Log: Get rid of unused struct member. Pointed out by: Gopakumar T Obtained from: NetApp Modified: head/usr.sbin/bhyve/pci_emul.h Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Mon Feb 25 20:09:07 2013 (r247281) +++ head/usr.sbin/bhyve/pci_emul.h Mon Feb 25 20:31:47 2013 (r247282) @@ -105,7 +105,6 @@ struct pci_devinst { uint8_t pi_bus, pi_slot, pi_func; uint8_t pi_lintr_pin; char pi_name[PI_NAMESZ]; - uint16_t pi_iobase; int pi_bar_getsize; struct { From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 20:50:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D075B58D; Mon, 25 Feb 2013 20:50:08 +0000 (UTC) (envelope-from pjd@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 C3735730; Mon, 25 Feb 2013 20:50:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PKo8Zc016718; Mon, 25 Feb 2013 20:50:08 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PKo8BO016717; Mon, 25 Feb 2013 20:50:08 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302252050.r1PKo8BO016717@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 25 Feb 2013 20:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247283 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 20:50:08 -0000 Author: pjd Date: Mon Feb 25 20:50:08 2013 New Revision: 247283 URL: http://svnweb.freebsd.org/changeset/base/247283 Log: After r237012, the fdgrowtable() doesn't drop the filedesc lock anymore, so update a stale comment. Reviewed by: kib, keramida Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Feb 25 20:31:47 2013 (r247282) +++ head/sys/kern/kern_descrip.c Mon Feb 25 20:50:08 2013 (r247283) @@ -855,9 +855,7 @@ do_dup(struct thread *td, int flags, int /* * If the caller specified a file descriptor, make sure the file * table is large enough to hold it, and grab it. Otherwise, just - * allocate a new descriptor the usual way. Since the filedesc - * lock may be temporarily dropped in the process, we have to look - * out for a race. + * allocate a new descriptor the usual way. */ if (flags & DUP_FIXED) { if (new >= fdp->fd_nfiles) { From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 20:51:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0AA2C761; Mon, 25 Feb 2013 20:51:30 +0000 (UTC) (envelope-from pjd@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 E762774D; Mon, 25 Feb 2013 20:51:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PKpTKH018504; Mon, 25 Feb 2013 20:51:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PKpTe4018503; Mon, 25 Feb 2013 20:51:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201302252051.r1PKpTe4018503@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 25 Feb 2013 20:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247284 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 20:51:30 -0000 Author: pjd Date: Mon Feb 25 20:51:29 2013 New Revision: 247284 URL: http://svnweb.freebsd.org/changeset/base/247284 Log: Style. Suggested by: kib Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Feb 25 20:50:08 2013 (r247283) +++ head/sys/kern/kern_descrip.c Mon Feb 25 20:51:29 2013 (r247284) @@ -1425,8 +1425,7 @@ fdgrowtable(struct filedesc *fdp, int nf FILEDESC_XLOCK_ASSERT(fdp); - KASSERT(fdp->fd_nfiles > 0, - ("zero-length file table")); + KASSERT(fdp->fd_nfiles > 0, ("zero-length file table")); /* save old values */ onfiles = fdp->fd_nfiles; @@ -1447,13 +1446,11 @@ fdgrowtable(struct filedesc *fdp, int nf * it on the freelist. We place the struct freetable in the * middle so we don't have to worry about padding. */ - ntable = malloc(nnfiles * sizeof(*ntable) + - sizeof(struct freetable) + - nnfiles * sizeof(*nfileflags), - M_FILEDESC, M_ZERO | M_WAITOK); + ntable = malloc(nnfiles * sizeof(*ntable) + sizeof(struct freetable) + + nnfiles * sizeof(*nfileflags), M_FILEDESC, M_ZERO | M_WAITOK); nfileflags = (char *)&ntable[nnfiles] + sizeof(struct freetable); - nmap = malloc(NDSLOTS(nnfiles) * NDSLOTSIZE, - M_FILEDESC, M_ZERO | M_WAITOK); + nmap = malloc(NDSLOTS(nnfiles) * NDSLOTSIZE, M_FILEDESC, + M_ZERO | M_WAITOK); /* copy the old data over and point at the new tables */ memcpy(ntable, otable, onfiles * sizeof(*otable)); From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 21:00:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 92E75C88; Mon, 25 Feb 2013 21:00:17 +0000 (UTC) (envelope-from alc@rice.edu) Received: from proofpoint1.mail.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) by mx1.freebsd.org (Postfix) with ESMTP id 590887BE; Mon, 25 Feb 2013 21:00:16 +0000 (UTC) Received: from pps.filterd (proofpoint1 [127.0.0.1]) by proofpoint1.mail.rice.edu (8.14.5/8.14.5) with SMTP id r1PCuGgY022295; Mon, 25 Feb 2013 15:00:15 -0600 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by proofpoint1.mail.rice.edu with ESMTP id 1ant268ehq-1; Mon, 25 Feb 2013 15:00:15 -0600 Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 830E0460147; Mon, 25 Feb 2013 15:00:15 -0600 (CST) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 7FC0A4600F9; Mon, 25 Feb 2013 15:00:15 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id gvV7cGiGMJDj; Mon, 25 Feb 2013 15:00:15 -0600 (CST) Received: from staff-84-wless194-019.rice.edu (staff-84-wless194-019.rice.edu [10.84.194.19]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 2000A46015E; Mon, 25 Feb 2013 15:00:13 -0600 (CST) Subject: Re: svn commit: r247116 - in head/sys: fs/nfs fs/nfsclient kern nfsclient sys tools Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Alan Cox In-Reply-To: <20130225233603.49a5d4a5@bender> Date: Mon, 25 Feb 2013 15:00:41 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <8006325C-B281-4F4D-BE1A-C3B444FE979F@rice.edu> References: <201302211902.r1LJ2o5T033708@svn.freebsd.org> <20130225201313.2050da18@bender> <20130225085019.GU2454@kib.kiev.ua> <20130225233603.49a5d4a5@bender> To: Andrew Turner X-Mailer: Apple Mail (2.1085) Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 21:00:17 -0000 On Feb 25, 2013, at 4:36 AM, Andrew Turner wrote: > On Mon, 25 Feb 2013 10:50:19 +0200 > Konstantin Belousov wrote: >=20 >> On Mon, Feb 25, 2013 at 08:13:13PM +1300, Andrew Turner wrote: >>> On Thu, 21 Feb 2013 19:02:50 +0000 (UTC) >>> John Baldwin wrote: >>>=20 >>>> Author: jhb >>>> Date: Thu Feb 21 19:02:50 2013 >>>> New Revision: 247116 >>>> URL: http://svnweb.freebsd.org/changeset/base/247116 >>>>=20 >>>> Log: >>>> Further refine the handling of stop signals in the NFS client. >>>> The changes in r246417 were incomplete as they did not add >>>> explicit calls to sigdeferstop() around all the places that >>>> previously passed SBDRY to _sleep(). In addition, >>>> nfs_getcacheblk() could trigger a write RPC from getblk() >>>> resulting in sigdeferstop() recursing. Rather than manually >>>> deferring stop signals in specific places, change the VFS_*() and >>>> VOP_*() methods to defer stop signals for filesystems which >>>> request this behavior via a new VFCF_SBDRY flag. Note that this >>>> has to be a VFC flag rather than a MNTK flag so that it works >>>> properly with VFS_MOUNT() when the mount is not yet fully >>>> constructed. For now, only the NFS clients are set this new flag >>>> in VFS_SET(). A few other related changes: >>>> - Add an assertion to ensure that TDF_SBDRY doesn't leak to >>>> userland. >>>> - When a lookup request uses VOP_READLINK() to follow a symlink, >>>> mark the request as being on behalf of the thread performing the >>>> lookup (cnp_thread) rather than using a NULL thread pointer. This >>>> causes NFS to properly handle signals during this VOP on an >>>> interruptible mount. >>>>=20 >>>> PR: kern/176179 >>>> Reported by: Russell Cattelan (sigdeferstop() recursion) >>>> Reviewed by: kib >>>> MFC after: 1 month >>>=20 >>> This change is causing init to crash for me on armv6. I'm >>> netbooting a PandaBoard and it appears init is receiving a SIGABRT >>> before it gets into main(). >>>=20 >>> Do you have any idea where I could look to track down why it is >>> doing this? >>=20 >> It is weird. SIGABRT sent by the kernel usually means that execve(2) >> already destroyed the previous address space of the process, but the >> new image cannot be activated, most likely due to image format error >> discovered too late, or resource shortage. >>=20 >> Could it be that some NFS RPC fails after the patch, but I cannot >> imagine why. You would need to track this. Also, verify that the init >> binary is correct. >>=20 >> I tried amd64 netboot, and it worked fine. >=20 > It looks like this change is not the issue, it just changed the > symptom enough for me to not realise I was seeing an issue where > it would crash the kernel before. I reinstated this change but only > allowed the kernel to access half the memory and it booted correctly. >=20 > The real issue appears to be related to something in the vm layer not > working on ARM boards with too much memory (somewhere between 512MiB > and 1GiB). The recently introduced auto-sizing and cap may be too optimistic. In = fact, they are greater than what we allow on 32-bit x86 and 32-bit MIPS. Try the following. Index: arm/include/vmparam.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- arm/include/vmparam.h (revision 247249) +++ arm/include/vmparam.h (working copy) @@ -142,15 +142,15 @@ #define VM_KMEM_SIZE (12*1024*1024) #endif #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (2) +#define VM_KMEM_SIZE_SCALE (3) #endif =20 /* - * Ceiling on the size of the kmem submap: 60% of the kernel map. + * Ceiling on the size of the kmem submap: 40% of the kernel map. */ #ifndef VM_KMEM_SIZE_MAX #define VM_KMEM_SIZE_MAX ((vm_max_kernel_address - \ - VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) + VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) #endif =20 #define MAXTSIZ (16*1024*1024) From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 22:25:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 081102A8; Mon, 25 Feb 2013 22:25:57 +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 EF0C1B6F; Mon, 25 Feb 2013 22:25:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PMPuol046614; Mon, 25 Feb 2013 22:25:56 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PMPuYJ046613; Mon, 25 Feb 2013 22:25:56 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302252225.r1PMPuYJ046613@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 25 Feb 2013 22:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247285 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 22:25:57 -0000 Author: des Date: Mon Feb 25 22:25:56 2013 New Revision: 247285 URL: http://svnweb.freebsd.org/changeset/base/247285 Log: In all situations where we need to bootstrap yacc, we also need to bootstrap liby. This was not readily apparent, because a normal 'make buildworld' or 'make toolchain' builds liby before building anything that uses yacc. However, 'make kernel-toolchain' does not build headers or libraries, so it was not possible to build a kernel from head on, say, stable/9 without first building the complete toolchain. MFC after: 1 week Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Feb 25 20:51:29 2013 (r247284) +++ head/Makefile.inc1 Mon Feb 25 22:25:56 2013 (r247285) @@ -1132,7 +1132,8 @@ _lex= usr.bin/lex .endif .if ${BOOTSTRAPPING} < 1000013 -_yacc= usr.bin/yacc +_yacc= lib/liby \ + usr.bin/yacc .endif .if ${BOOTSTRAPPING} < 1000026 From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 22:42:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2A6EE77E; Mon, 25 Feb 2013 22:42:46 +0000 (UTC) (envelope-from adrian@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 863DED03; Mon, 25 Feb 2013 22:42:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PMgkbg051990; Mon, 25 Feb 2013 22:42:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PMghVO051966; Mon, 25 Feb 2013 22:42:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302252242.r1PMghVO051966@svn.freebsd.org> From: Adrian Chadd Date: Mon, 25 Feb 2013 22:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247286 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 22:42:47 -0000 Author: adrian Date: Mon Feb 25 22:42:43 2013 New Revision: 247286 URL: http://svnweb.freebsd.org/changeset/base/247286 Log: Begin adding support to explicitly set the current chainmask. Right now the only way to set the chainmask is to set the hardware configured chainmask through capabilities. This is fine for forcing the chainmask to be something other than what the hardware is capable of (eg to reduce TX/RX to one connected antenna) but it does change what the HAL hardware chainmask configuration is. For operational mode changes, it (may?) make sense to separately control the TX/RX chainmask. Right now it's done as part of ar5416_reset.c - ar5416UpdateChainMasks() calculates which TX/RX chainmasks to enable based on the operating mode. (1 for legacy and whatever is supported for 11n operation.) But doing this in the HAL is suboptimal - the driver needs to know the currently configured chainmask in order to correctly enable things for each TX descriptor. This is currently done by overriding the chainmask config in the ar5416 TX routines but this has to disappear - the AR9300 HAL support requires the driver to dynamically set the TX chainmask based on the TX power and TX rate in order to meet mini-PCIe slot power requirements. So: * Introduce a new HAL method to set the operational chainmask variables; * Introduce null methods for the previous generation chipsets; * Add new driver state to record the current chainmask separate from the hardware configured chainmask. Part #2 of this will involve disabling ar5416UpdateChainMasks() and moving it into the driver; as well as properly programming the TX chainmask based on the currently configured HAL chainmask. Tested: * AR5416, STA mode - both legacy (11a/11bg) and 11n rates - verified that AR_SELFGEN_MASK (the chainmask used for self-generated frames like ACKs and RTSes) is correct, as well as the TX descriptor contents is correct. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5210/ar5210.h head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c head/sys/dev/ath/ath_hal/ar5211/ar5211.h head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Feb 25 22:25:56 2013 (r247285) +++ head/sys/dev/ath/ath_hal/ah.h Mon Feb 25 22:42:43 2013 (r247286) @@ -1437,6 +1437,8 @@ struct ath_hal { HAL_STATUS __ahdecl(*ah_setQuiet)(struct ath_hal *ah, uint32_t period, uint32_t duration, uint32_t nextStart, HAL_QUIET_FLAG flag); + void __ahdecl(*ah_setChainMasks)(struct ath_hal *, + uint32_t, uint32_t); /* DFS functions */ void __ahdecl(*ah_enableDfs)(struct ath_hal *ah, Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210.h Mon Feb 25 22:25:56 2013 (r247285) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210.h Mon Feb 25 22:42:43 2013 (r247286) @@ -259,6 +259,7 @@ extern HAL_BOOL ar5210GetDiagState(struc extern uint32_t ar5210Get11nExtBusy(struct ath_hal *); extern HAL_BOOL ar5210GetMibCycleCounts(struct ath_hal *, HAL_SURVEY_SAMPLE *); +extern void ar5210SetChainMasks(struct ath_hal *, uint32_t, uint32_t); extern void ar5210EnableDfs(struct ath_hal *, HAL_PHYERR_PARAM *); extern void ar5210GetDfsThresh(struct ath_hal *, HAL_PHYERR_PARAM *); extern void ar5210UpdateDiagReg(struct ath_hal *ah, uint32_t val); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Mon Feb 25 22:25:56 2013 (r247285) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Mon Feb 25 22:42:43 2013 (r247286) @@ -137,6 +137,7 @@ static const struct ath_hal_private ar52 .ah_setCoverageClass = ar5210SetCoverageClass, .ah_get11nExtBusy = ar5210Get11nExtBusy, .ah_getMibCycleCounts = ar5210GetMibCycleCounts, + .ah_setChainMasks = ar5210SetChainMasks, .ah_enableDfs = ar5210EnableDfs, .ah_getDfsThresh = ar5210GetDfsThresh, /* XXX procRadarEvent */ Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c Mon Feb 25 22:25:56 2013 (r247285) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c Mon Feb 25 22:42:43 2013 (r247286) @@ -671,6 +671,12 @@ ar5210GetMibCycleCounts(struct ath_hal * } void +ar5210SetChainMasks(struct ath_hal *ah, uint32_t txchainmask, + uint32_t rxchainmask) +{ +} + +void ar5210EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) { } Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211.h Mon Feb 25 22:25:56 2013 (r247285) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211.h Mon Feb 25 22:42:43 2013 (r247286) @@ -286,6 +286,8 @@ extern HAL_BOOL ar5211GetDiagState(struc extern uint32_t ar5211Get11nExtBusy(struct ath_hal *); extern HAL_BOOL ar5211GetMibCycleCounts(struct ath_hal *, HAL_SURVEY_SAMPLE *); +extern void ar5211SetChainMasks(struct ath_hal *ah, uint32_t, uint32_t); + extern void ar5211EnableDfs(struct ath_hal *, HAL_PHYERR_PARAM *); extern void ar5211GetDfsThresh(struct ath_hal *, HAL_PHYERR_PARAM *); Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Mon Feb 25 22:25:56 2013 (r247285) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Mon Feb 25 22:42:43 2013 (r247286) @@ -137,6 +137,7 @@ static const struct ath_hal_private ar52 .ah_setCoverageClass = ar5211SetCoverageClass, .ah_get11nExtBusy = ar5211Get11nExtBusy, .ah_getMibCycleCounts = ar5211GetMibCycleCounts, + .ah_setChainMasks = ar5211SetChainMasks, .ah_enableDfs = ar5211EnableDfs, .ah_getDfsThresh = ar5211GetDfsThresh, /* XXX procRadarEvent */ Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c Mon Feb 25 22:25:56 2013 (r247285) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c Mon Feb 25 22:42:43 2013 (r247286) @@ -711,6 +711,12 @@ ar5211GetMibCycleCounts(struct ath_hal * } void +ar5211SetChainMasks(struct ath_hal *ah, uint32_t txchainmask, + uint32_t rxchainmask) +{ +} + +void ar5211EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) { } Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Feb 25 22:25:56 2013 (r247285) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Feb 25 22:42:43 2013 (r247286) @@ -513,6 +513,7 @@ extern HAL_STATUS ar5212SetQuiet(struct uint32_t duration, uint32_t nextStart, HAL_QUIET_FLAG flag); extern HAL_BOOL ar5212GetMibCycleCounts(struct ath_hal *, HAL_SURVEY_SAMPLE *); +extern void ar5212SetChainMasks(struct ath_hal *, uint32_t, uint32_t); extern HAL_BOOL ar5212SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Mon Feb 25 22:25:56 2013 (r247285) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Mon Feb 25 22:42:43 2013 (r247286) @@ -134,6 +134,7 @@ static const struct ath_hal_private ar52 .ah_setCoverageClass = ar5212SetCoverageClass, .ah_setQuiet = ar5212SetQuiet, .ah_getMibCycleCounts = ar5212GetMibCycleCounts, + .ah_setChainMasks = ar5212SetChainMasks, /* DFS Functions */ .ah_enableDfs = ar5212EnableDfs, Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Mon Feb 25 22:25:56 2013 (r247285) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Mon Feb 25 22:42:43 2013 (r247286) @@ -1413,3 +1413,9 @@ ar5212GetMibCycleCounts(struct ath_hal * return (AH_FALSE); } + +void +ar5212SetChainMasks(struct ath_hal *ah, uint32_t tx_chainmask, + uint32_t rx_chainmask) +{ +} Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Feb 25 22:25:56 2013 (r247285) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Feb 25 22:42:43 2013 (r247286) @@ -239,6 +239,7 @@ extern HAL_BOOL ar5416SetDecompMask(stru extern void ar5416SetCoverageClass(struct ath_hal *, uint8_t, int); extern HAL_BOOL ar5416GetMibCycleCounts(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hsample); +extern void ar5416SetChainMasks(struct ath_hal *ah, uint32_t, uint32_t); extern uint32_t ar5416Get11nExtBusy(struct ath_hal *ah); extern void ar5416Set11nMac2040(struct ath_hal *ah, HAL_HT_MACMODE mode); extern HAL_HT_RXCLEAR ar5416Get11nRxClear(struct ath_hal *ah); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Feb 25 22:25:56 2013 (r247285) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Feb 25 22:42:43 2013 (r247286) @@ -150,6 +150,7 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_setCoverageClass = ar5416SetCoverageClass; ah->ah_setQuiet = ar5416SetQuiet; ah->ah_getMibCycleCounts = ar5416GetMibCycleCounts; + ah->ah_setChainMasks = ar5416SetChainMasks; ah->ah_resetKeyCacheEntry = ar5416ResetKeyCacheEntry; ah->ah_setKeyCacheEntry = ar5416SetKeyCacheEntry; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Mon Feb 25 22:25:56 2013 (r247285) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Mon Feb 25 22:42:43 2013 (r247286) @@ -256,6 +256,20 @@ ar5416GetMibCycleCounts(struct ath_hal * } /* + * Setup the TX/RX chainmasks - this needs to be done before a call + * to the reset method as it doesn't update the hardware. + */ +void +ar5416SetChainMasks(struct ath_hal *ah, uint32_t tx_chainmask, + uint32_t rx_chainmask) +{ + HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps; + + AH5416(ah)->ah_tx_chainmask = tx_chainmask & pCap->halTxChainMask; + AH5416(ah)->ah_rx_chainmask = rx_chainmask & pCap->halRxChainMask; +} + +/* * Return approximation of extension channel busy over an time interval * 0% (clear) -> 100% (busy) * Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Feb 25 22:25:56 2013 (r247285) +++ head/sys/dev/ath/if_athvar.h Mon Feb 25 22:42:43 2013 (r247286) @@ -715,8 +715,10 @@ struct ath_softc { u_int32_t sc_avgtsfdeltap;/* TDMA slot adjust (+) */ u_int32_t sc_avgtsfdeltam;/* TDMA slot adjust (-) */ uint16_t *sc_eepromdata; /* Local eeprom data, if AR9100 */ - int sc_txchainmask; /* currently configured TX chainmask */ - int sc_rxchainmask; /* currently configured RX chainmask */ + int sc_txchainmask; /* hardware TX chainmask */ + int sc_rxchainmask; /* hardware RX chainmask */ + int sc_cur_txchainmask; /* currently configured TX chainmask */ + int sc_cur_rxchainmask; /* currently configured RX chainmask */ int sc_rts_aggr_limit; /* TX limit on RTS aggregates */ int sc_aggr_limit; /* TX limit on all aggregates */ int sc_delim_min_pad; /* Minimum delimiter count */ @@ -1334,6 +1336,8 @@ void ath_intr(void *); ((*(_ah)->ah_getMibCycleCounts)((_ah), (_sample))) #define ath_hal_get_chan_ext_busy(_ah) \ ((*(_ah)->ah_get11nExtBusy)((_ah))) +#define ath_hal_setchainmasks(_ah, _txchainmask, _rxchainmask) \ + ((*(_ah)->ah_setChainMasks)((_ah), (_txchainmask), (_rxchainmask))) #define ath_hal_spectral_supported(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_SPECTRAL_SCAN, 0, NULL) == HAL_OK) From owner-svn-src-all@FreeBSD.ORG Mon Feb 25 22:45:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4C9FA93C; Mon, 25 Feb 2013 22:45:04 +0000 (UTC) (envelope-from adrian@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 3035ED30; Mon, 25 Feb 2013 22:45:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1PMj4QR052388; Mon, 25 Feb 2013 22:45:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1PMj3Bn052384; Mon, 25 Feb 2013 22:45:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302252245.r1PMj3Bn052384@svn.freebsd.org> From: Adrian Chadd Date: Mon, 25 Feb 2013 22:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247287 - in head/sys/dev/ath: . ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 22:45:04 -0000 Author: adrian Date: Mon Feb 25 22:45:02 2013 New Revision: 247287 URL: http://svnweb.freebsd.org/changeset/base/247287 Log: Part #2 of the TX chainmask changes: * Remove ar5416UpdateChainmasks(); * Remove the TX chainmask override code from the ar5416 TX descriptor setup routines; * Write a driver method to calculate the current chainmask based on the operating mode and update the driver state; * Call the HAL chainmask method before calling ath_hal_reset(); * Use the currently configured chainmask in the TX descriptors rather than the hardware TX chainmasks. Tested: * AR5416, STA/AP mode - legacy and 11n modes Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Feb 25 22:42:43 2013 (r247286) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Feb 25 22:45:02 2013 (r247287) @@ -44,7 +44,6 @@ static void ar5416InitBB(struct ath_hal static void ar5416InitIMR(struct ath_hal *ah, HAL_OPMODE opmode); static void ar5416InitQoS(struct ath_hal *ah); static void ar5416InitUserSettings(struct ath_hal *ah); -static void ar5416UpdateChainMasks(struct ath_hal *ah, HAL_BOOL is_ht); static void ar5416OverrideIni(struct ath_hal *ah, const struct ieee80211_channel *); #if 0 @@ -210,11 +209,6 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO __func__, OS_REG_READ(ah,AR_PHY_ADC_CTL)); /* - * Setup ah_tx_chainmask / ah_rx_chainmask before we fiddle - * with enabling the TX/RX radio chains. - */ - ar5416UpdateChainMasks(ah, IEEE80211_IS_CHAN_HT(chan)); - /* * This routine swaps the analog chains - it should be done * before any radio register twiddling is done. */ @@ -1464,31 +1458,6 @@ ar5416RestoreChainMask(struct ath_hal *a } } -/* - * Update the chainmask based on the current channel configuration. - * - * XXX ath9k checks bluetooth co-existence here - * XXX ath9k checks whether the current state is "off-channel". - * XXX ath9k sticks the hardware into 1x1 mode for legacy; - * we're going to leave multi-RX on for multi-path cancellation. - */ -static void -ar5416UpdateChainMasks(struct ath_hal *ah, HAL_BOOL is_ht) -{ - struct ath_hal_private *ahpriv = AH_PRIVATE(ah); - HAL_CAPABILITIES *pCap = &ahpriv->ah_caps; - - if (is_ht) { - AH5416(ah)->ah_tx_chainmask = pCap->halTxChainMask; - } else { - AH5416(ah)->ah_tx_chainmask = 1; - } - AH5416(ah)->ah_rx_chainmask = pCap->halRxChainMask; - HALDEBUG(ah, HAL_DEBUG_RESET, "TX chainmask: 0x%x; RX chainmask: 0x%x\n", - AH5416(ah)->ah_tx_chainmask, - AH5416(ah)->ah_rx_chainmask); -} - void ar5416InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan) { Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Mon Feb 25 22:42:43 2013 (r247286) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Mon Feb 25 22:45:02 2013 (r247287) @@ -701,20 +701,6 @@ ar5416Set11nRateScenario(struct ath_hal (void)nseries; /* - * XXX since the upper layers doesn't know the current chainmask - * XXX setup, just override its decisions here. - * XXX The upper layers need to be taught this! - */ - if (series[0].Tries != 0) - series[0].ChSel = AH5416(ah)->ah_tx_chainmask; - if (series[1].Tries != 0) - series[1].ChSel = AH5416(ah)->ah_tx_chainmask; - if (series[2].Tries != 0) - series[2].ChSel = AH5416(ah)->ah_tx_chainmask; - if (series[3].Tries != 0) - series[3].ChSel = AH5416(ah)->ah_tx_chainmask; - - /* * Only one of RTS and CTS enable must be set. * If a frame has both set, just do RTS protection - * that's enough to satisfy legacy protection. Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Feb 25 22:42:43 2013 (r247286) +++ head/sys/dev/ath/if_ath.c Mon Feb 25 22:45:02 2013 (r247287) @@ -1476,6 +1476,26 @@ ath_reset_keycache(struct ath_softc *sc) ieee80211_crypto_reload_keys(ic); } +/* + * Fetch the current chainmask configuration based on the current + * operating channel and options. + */ +static void +ath_update_chainmasks(struct ath_softc *sc, struct ieee80211_channel *chan) +{ + + /* + * Set TX chainmask to the currently configured chainmask; + * the TX chainmask depends upon the current operating mode. + */ + sc->sc_cur_rxchainmask = sc->sc_rxchainmask; + if (IEEE80211_IS_CHAN_HT(chan)) { + sc->sc_cur_txchainmask = sc->sc_txchainmask; + } else { + sc->sc_cur_txchainmask = 1; + } +} + void ath_resume(struct ath_softc *sc) { @@ -1494,6 +1514,10 @@ ath_resume(struct ath_softc *sc) * Must reset the chip before we reload the * keycache as we were powered down on suspend. */ + ath_update_chainmasks(sc, + sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan); + ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask, + sc->sc_cur_rxchainmask); ath_hal_reset(ah, sc->sc_opmode, sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan, AH_FALSE, &status); @@ -1935,6 +1959,9 @@ ath_init(void *arg) * and then setup of the interrupt mask. */ ath_settkipmic(sc); + ath_update_chainmasks(sc, ic->ic_curchan); + ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask, + sc->sc_cur_rxchainmask); if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_FALSE, &status)) { if_printf(ifp, "unable to reset hardware; hal status %u\n", status); @@ -2250,6 +2277,9 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T ath_settkipmic(sc); /* configure TKIP MIC handling */ /* NB: indicate channel change so we do a full reset */ + ath_update_chainmasks(sc, ic->ic_curchan); + ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask, + sc->sc_cur_rxchainmask); if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_TRUE, &status)) if_printf(ifp, "%s: unable to reset hardware; hal status %u\n", __func__, status); @@ -4440,6 +4470,9 @@ ath_chan_set(struct ath_softc *sc, struc */ ath_draintxq(sc, ATH_RESET_FULL); /* clear pending tx frames */ + ath_update_chainmasks(sc, chan); + ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask, + sc->sc_cur_rxchainmask); if (!ath_hal_reset(ah, sc->sc_opmode, chan, AH_TRUE, &status)) { if_printf(ifp, "%s: unable to reset " "channel %u (%u MHz, flags 0x%x), hal status %u\n", Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Mon Feb 25 22:42:43 2013 (r247286) +++ head/sys/dev/ath/if_ath_tx_ht.c Mon Feb 25 22:45:02 2013 (r247287) @@ -499,20 +499,13 @@ ath_rateseries_setup(struct ath_softc *s series[i].Tries = rc[i].tries; /* - * XXX this isn't strictly correct - sc_txchainmask - * XXX isn't the currently active chainmask; - * XXX it's the interface chainmask at startup. - * XXX It's overridden in the HAL rate scenario function - * XXX for now. - */ - /* * XXX TODO: When the NIC is capable of three stream TX, * transmit 1/2 stream rates on two streams. * * This reduces the power consumption of the NIC and * keeps it within the PCIe slot power limits. */ - series[i].ChSel = sc->sc_txchainmask; + series[i].ChSel = sc->sc_cur_txchainmask; if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) series[i].RateFlags |= HAL_RATESERIES_RTS_CTS; @@ -542,6 +535,14 @@ ath_rateseries_setup(struct ath_softc *s ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) series[i].RateFlags |= HAL_RATESERIES_HALFGI; + /* + * XXX TODO: STBC if it's possible + */ + + /* + * XXX TODO: LDPC if it's possible + */ + series[i].Rate = rt->info[rc[i].rix].rateCode; series[i].RateIndex = rc[i].rix; series[i].tx_power_cap = 0x3f; /* XXX for now */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 26 00:02:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 18D315C3; Tue, 26 Feb 2013 00:02:31 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id D2CD3F8E; Tue, 26 Feb 2013 00:02:30 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 17F5D358C5D; Tue, 26 Feb 2013 01:02:28 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 02AD52848C; Tue, 26 Feb 2013 01:02:27 +0100 (CET) Date: Tue, 26 Feb 2013 01:02:27 +0100 From: Jilles Tjoelker To: Peter Jeremy Subject: Re: svn commit: r247274 - in head: bin/test tools/regression/bin/test Message-ID: <20130226000227.GA80718@stack.nl> References: <201302251905.r1PJ5fKF085179@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201302251905.r1PJ5fKF085179@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 00:02:31 -0000 On Mon, Feb 25, 2013 at 07:05:41PM +0000, Peter Jeremy wrote: > Author: peterj > Date: Mon Feb 25 19:05:40 2013 > New Revision: 247274 > URL: http://svnweb.freebsd.org/changeset/base/247274 > Log: > Enhance test(1) by adding provision to compare any combination of the > access, birth, change and modify times of two files, instead of only > being able to compare modify times. The builtin test in sh(1) will > automagically acquire the same expansion. > Approved by: grog > MFC after: 2 weeks What do you need this for? If it is not needed very often, this test can be done more portably (older FreeBSD and GNU) as [ -n "$(find -L FILE1 -prune -newerXY FILE2 2>/dev/null)" ] (If FILE1 is certainly not a directory, -prune can be omitted; if FILE1 is certainly not a symlink or should not be followed, -L can be omitted; the 2>/dev/null silences error messages about nonexistent files that test(1) does not generate.) I have generally been rather reluctant in adding things to sh(1) and even more so if they are completely new. Someone proposed something rather similar (except that it added a time string parser -- even more code) in PR bin/57054 and I rejected it in 2009. The -ef, -nt and -ot primaries are not in POSIX but they should remain anyway. They have existed for years and are (almost) compatible to features in most other shells. (Sadly, it was noticed rather late that pdksh's -nt and -ot give results not matching real ksh for nonexistent files.) > Modified: > head/bin/test/test.1 > head/bin/test/test.c > head/tools/regression/bin/test/regress.sh > [snip] > Modified: head/tools/regression/bin/test/regress.sh > ============================================================================== > --- head/tools/regression/bin/test/regress.sh Mon Feb 25 18:07:20 2013 (r247273) > +++ head/tools/regression/bin/test/regress.sh Mon Feb 25 19:05:40 2013 (r247274) > @@ -52,7 +52,7 @@ t () > [snip] > +a=/tmp/test$$.1 > +b=/tmp/test$$.2 Please use mktemp(1). Using $$ for temporary files is insecure on multiuser systems. > +trap "rm -f $a $b" EXIT > + > +# Tests 131-164 > +s 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 $a $b > + > +touch $a > +# Tests 165-198 > +s 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 $a $b > + > +sleep 2 # Ensure $b is newer than $a > +touch $b Please use touch -t instead of sleeping. I'm impatient while running tests :) > +# Tests 199-232 > +s 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 $a $b > + > +sleep 2 > +echo >$b # Updates mtime & ctime You can probably do this with touch -m -t. > +sleep 2 > +touch -A 01 -a $b > + > +# $b now has ctime > mtime > atime > btime > +# Tests 233-266 > +s 1 1 0 1 1 1 1 1 1 0 0 1 0 0 0 1 1 1 1 1 0 0 0 1 0 0 1 1 1 1 1 1 0 1 $b $b The ctime cannot be manipulated explicitly but the other times can be set in the future so both relations with the ctime can be tested. The touch -a is indeed required because file reads do not set the atime if the filesystem is mounted noatime. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Tue Feb 26 00:10:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 574718D0; Tue, 26 Feb 2013 00:10:29 +0000 (UTC) (envelope-from np@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 46CC1FF8; Tue, 26 Feb 2013 00:10:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q0ATxr077661; Tue, 26 Feb 2013 00:10:29 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q0AS1a077655; Tue, 26 Feb 2013 00:10:28 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201302260010.r1Q0AS1a077655@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 26 Feb 2013 00:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247289 - in head/sys: conf dev/cxgbe/common dev/cxgbe/firmware modules/cxgbe/firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 00:10:29 -0000 Author: np Date: Tue Feb 26 00:10:28 2013 New Revision: 247289 URL: http://svnweb.freebsd.org/changeset/base/247289 Log: cxgbe(4): Update firmware to 1.8.4.0. MFC after: 5 days Added: head/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu (contents, props changed) Deleted: head/sys/dev/cxgbe/firmware/t4fw-1.6.2.0.bin.uu Modified: head/sys/conf/files head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/modules/cxgbe/firmware/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 25 22:51:49 2013 (r247288) +++ head/sys/conf/files Tue Feb 26 00:10:28 2013 (r247289) @@ -1123,7 +1123,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.6.2.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Mon Feb 25 22:51:49 2013 (r247288) +++ head/sys/dev/cxgbe/common/common.h Tue Feb 26 00:10:28 2013 (r247289) @@ -64,8 +64,9 @@ enum { }; #define FW_VERSION_MAJOR 1 -#define FW_VERSION_MINOR 6 -#define FW_VERSION_MICRO 2 +#define FW_VERSION_MINOR 8 +#define FW_VERSION_MICRO 4 +#define FW_VERSION_BUILD 0 struct port_stats { u64 tx_octets; /* total # of octets in good frames */ @@ -546,7 +547,4 @@ int t4_sge_ctxt_rd_bd(struct adapter *ad int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox); int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl); int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, u32 addr, u32 val); -int t4_config_scheduler(struct adapter *adapter, int mode, int level, int pktsize, - int sched_class, int port, int rate, int unit, - int weight, int minrate, int maxrate); #endif /* __CHELSIO_COMMON_H */ Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Feb 25 22:51:49 2013 (r247288) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue Feb 26 00:10:28 2013 (r247289) @@ -3909,13 +3909,13 @@ int t4_i2c_rd(struct adapter *adap, unsi F_FW_CMD_READ | V_FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_FUNC_I2C)); c.cycles_to_len16 = htonl(FW_LEN16(c)); - c.u.i2c.pid_pkd = V_FW_LDST_CMD_PID(port_id); - c.u.i2c.base = dev_addr; - c.u.i2c.boffset = offset; + c.u.i2c_deprecated.pid_pkd = V_FW_LDST_CMD_PID(port_id); + c.u.i2c_deprecated.base = dev_addr; + c.u.i2c_deprecated.boffset = offset; ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); if (ret == 0) - *valp = c.u.i2c.data; + *valp = c.u.i2c_deprecated.data; return ret; } @@ -4593,7 +4593,7 @@ int t4_alloc_vi_func(struct adapter *ada } } if (rss_size) - *rss_size = G_FW_VI_CMD_RSSSIZE(ntohs(c.rsssize_pkd)); + *rss_size = G_FW_VI_CMD_RSSSIZE(ntohs(c.norss_rsssize)); return G_FW_VI_CMD_VIID(htons(c.type_to_viid)); } @@ -5304,43 +5304,3 @@ int __devinit t4_port_init(struct port_i return 0; } - -int t4_config_scheduler(struct adapter *adapter, int mode, int level, - int pktsize, int sched_class, int port, int unit, - int rate, int weight, int minrate, int maxrate) -{ - struct fw_sched_cmd cmd, rpl; - - if (rate < 0 || unit < 0) - return -EINVAL; - - memset(&cmd, 0, sizeof(cmd)); - cmd.op_to_write = cpu_to_be32(V_FW_CMD_OP(FW_SCHED_CMD) | - F_FW_CMD_REQUEST | F_FW_CMD_WRITE); - cmd.retval_len16 = cpu_to_be32(V_FW_CMD_LEN16(sizeof(cmd)/16)); - - cmd.u.params.sc = 1; - cmd.u.params.level = level; - cmd.u.params.mode = mode; - cmd.u.params.ch = port; - cmd.u.params.cl = sched_class; - cmd.u.params.rate = rate; - cmd.u.params.unit = unit; - - switch (level) { - case FW_SCHED_PARAMS_LEVEL_CH_WRR: - case FW_SCHED_PARAMS_LEVEL_CL_WRR: - cmd.u.params.weight = cpu_to_be16(weight); - break; - case FW_SCHED_PARAMS_LEVEL_CH_RL: - case FW_SCHED_PARAMS_LEVEL_CL_RL: - cmd.u.params.max = cpu_to_be32(maxrate); - cmd.u.params.min = cpu_to_be32(minrate); - cmd.u.params.pktsize = cpu_to_be16(pktsize); - break; - default: - return -EINVAL; - } - - return t4_wr_mbox_meat(adapter, adapter->mbox, &cmd, sizeof(cmd), &rpl, 1); -} Added: head/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu Tue Feb 26 00:10:28 2013 (r247289) @@ -0,0 +1,8237 @@ +/*- + * Copyright (c) 2013 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. + */ +begin-base64 644 t4fw +AAADkgEIBAAAAQkBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAA3cDhgONAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IFRodSBGZWIgIDcgMTU6 +Mzg6MjYgUFNUIDIwMTMgb24gY2xlb3BhdHJhLmFzaWNkZXNpZ25lcnMuY29tOi9ob21lL2Zpcm13 +YXJlL2N2cy9mdy1yZWxlYXNlKSwgVmVyc2lvbiBUNHh4IDAxLjA4LjA0LjAwAAAAAAAAAJ/jNKZg +AMQA4QAwuHj///8f/OFAgAAAAeEAe3AAABAAH//7gOEAYBDhAZRwIAAAAOEBnAThAHkAAAIAQOEA +eYAABgBAAAIACgAGAArhAHkEAAoAAIAAAQDhAHs84QB7ROEAe+TiAAAAAAEAAOEAe5AgAAAAAACA +AOEAewAAAEAB4QB7nAAAQABERERC4AAAAOMABHNERERA4wAIACAAAlwAAAAAH/+NIAAAAAAf/40k +AAAAAB//jSgAAAAAH/+NLB//wAAAAAAAAAAAAMAAEv/OE//OhCAEMwGTIBH/zRL/zZIQEf/NEv/N +khAR/80B9DER/8yQEBH/zCIK/5IQAOQxAAUxAQIAEv/JAucxAhYAEf/IgRABAV/AIQIRAckUEf/F +Ev/FkhAR/8US/8WSEGAAEgAAABH/vxL/w5IQEf+/Ev/CkhCBEBH/wcAgkhES/8CSEsAgkhMS/7+S +EIIQAvJQZS/3Ef+9xy+SEBH/vJIQEv+8E/+8kyDAMpMhE/+7kyKCIhL/uhP/upMgIyIhFP+5BDMB +yTgT/7iDMAODFAgzERT/tqQzkyET/6qTImAACMIwkyET/6eTIhL/sZAgkCGQIpAjkCSQJZAmkCeQ +KJApkCqQK5AskC2QLpAvICYQICYRgiIS/6TAMC03MC03NC03OC03PCM9AXIz7QACABL/oSMKAC83 +AC83EC83IC83MCM9AXIz7QACABL/lsAwKDcwKDc0KDc4KDc8Iz0BcjPtAwIAEv+UwDAnNwAnNxAn +NyAnNzAjPQFyM+0DAgAS/44V/48W/4/AMNcgBWYBYAAWAAAAAAQ2BQACANMP0w8FMwxuOxQHRxQH +BEN2MeYENgUFMwxvO+0AAgAS/4IV/4AjCgACJwIHBEMEPgUFMwwHRxRvO/ADAgAS/3zJLoMghCGF +IrwidDsOhlC0VZYwtDN0M/Rj/+YAZT/iZV/fEv9wwDIDLgUDAgAS/2fAMCg3QCg3RCg3SCg3TCM9 +AXIz7QMCAAACABL/ai0nAMARAUkxAEgxAQIAwAAU/2YE0jEV/2WUUBT/ZQTTMRX/ZZRQFP9kBNQx +Ff9klFAU/2QE1TEV/2OUUBD/YwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+GAOMACfgf/4YAH/+GAOMAD/gf +/4YAH/+GAOMAD/gf/4YAH/+HdOMAD/gf/4d0H/+NIOMAEWwf/40gH/+nhOMAFxgf/6eEH/+nhOMA +MXwf/8AAH//8ZeMAMXwgAAAAIAABauMAbeQgAAF4IAABfOMAb1AgAAF8IAABheMAb1QgAAGYIAAB +nOMAb2AgAAGcIAABpeMAb2QgAAG4IAABvOMAb3AgAAG8IAABxeMAb3QgAAHYIAAB2OMAb4AgAAHc +IAAB4uMAb4AgAAH4IAAB+OMAb4ggAAH8IAAB/OMAb4ggAAIYIAACGOMAb4ggAAIcIAACHOMAb4gg +AAI4IAACOOMAb4ggAAI8IAACPOMAb4ggAAJYIAACWOMAb4ggAAJcIAACYuMAb4ggAAJ4IAACeOMA +b5AgAAJ8IAACguMAb5AgAAKYIAGaouMAb5ggAoAAIAKTYOMCB6QgApNgIAKTYOMCGwQgApNgIAYP +KOMCGwQgBg8wIAYT8OMFltQgBoAAIAaNUOMFm5QgBo1QIAdgsuMFqOQgB2DAIAdhjOMGfFQgCMAA +IAjAAOMGfSAgCMAAIAjAAOMGfSAgCMAAIAkvL+MGfSAAAAAAAAAAAAAAAAAgAAYvIAAGICAACjkg +AAYgIAAJpSAABiAgAAbZIAAJPSAACMIgAAYgIAAIcSAACCQgAAe5IAAGDSAAB2QgAAYgIAAGICAA +BiAgAAb6AAAAAP///////w/8///w////APwgAItrIACMqyAAjNsgAIyhIACMYSAAjFcgAIwcIACM +EiAAjAggAIu4IACM2SAAi64gAIuUAAAAAAAAAAAAAAAAAAAACgAAAAoAAAAUAAAACgAAAAoAAAAK +AAAACgAAAAoAAAAKAAAAAAAAAAAAAAAAAAAIAAAAEAAAAEAAAAEAAAAACAAAABAAAABAAAABAAAA +BAAAABAAAABAAAABAAAAIAbKiyAGycIgBsshIAbLCCAGyu8gBsrWIAbKvSAGyqQgQIAAAAAAAP8Y +MGBgAAAA/wABAgIAAAAQIEAAAAAAAAQAAgABAACAAEAAIAAQAAggBwDOIAcAziAHAIEgBwBIIAb/ +nSAG/2ggBv9oIAcAziAHAM4gBv9oIAb/gyAG/4MgBwDOIAcAziAHAM4gBwDOIAcAziAHAM4gBwDO +IAcAziAHAM4gBwDOIAcAziAHAM4gBwDOIAcAziAHAM4gBwDOIAcAziAHAM4gBwDOIAcAISACiqgA +AAABIAKKrAAAAAIgAo3wAAAA/yACidwAAAD/IAKJ3AAAAAAgAo3wAAAAACACieAAAAABIAKJ6AAA +AAQgAonwAAAACCACifwAAAAQIAKKBAAAACAgAooMAAAAQCACihQAAACAIAKKKAAAAQAgAoo8AAAC +ACACilQAAAQAIAKKaAAACAAgAop4AAAQACACioQAACAAIAKKmAAAQAAgAonIAAAAECACidAAAAAR +IAKJSAAAAQAgAolUAAAAgCACiWQAAABAIAKJdAAAACAgAomEAAAAECACiZQAAAAIIAKJoAAAAAQg +AomsAAAAAiACibgAAAABAAAAAAAAAAAgAojoAAAAASACjfwAAAACIAKI8AAAAAQgAoj4AAAACCAC +iQAAAAAQIAKOBAAAACAgAokEAAAAQCACiRAAAACAIAKJHAAAAQAgAokoAAACAAAAAAEAAAABAAAA +AQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAH +AAAABwAAAAYAAAAGAAw1AAAQRqoAFFhVABhqAAAAK2gAACODAAAYagAADQYAAAsqAAAAAAAAAAAA +AAAAAABoKwAAaCsAAGyCAABvnAAASmgAAEpoAABNKQAASmgAAE7qAABMmAAAUj0AAE+4AAGGoAAB +hqAAAgjWAAII1gACCNUAAgjVAAKLCwACiwsAAgjVAAK2cgACtnIAAw1AAAQGBwAAAAAAAAAAAAAA +AAACAgUFCAgLCw4OEREUFBcXGhodHSAgIyMmJikpLCwvLzIyNTU4ODs7AAAAAAAAACAEkYAgAWn4 +IAA1yCABQhggAWWAIAFe0CABJAggA6KkH//rIB//5uAgAI1sH//azCAAXFQgAE7gAAAAAAAAAAAg +AUOQIAB7CAAAAAAAAAAAH//U4B//xggf/8PoH//BmCAASnAgAEKsIAA/4CAAg/gf/99YAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgARGgIAFRqCAAlcggAJT8H//w +KB//z/wf/8tAIAB4VCAE6eggAQXwIADkxCAAzJggAMb8IAC5QCAArCwgAJiAIASVLCADu5QgAPcw +IAPbiCABliwgAFwUAAAAACAAliQgBVKUIACK4CABScQgADI4AAAAAAAAAAAAAAAAH//zUCAAlegg +A75EAAAAAAAAAAAgAw1UIAAq2CAAMUQgACdoAAAAACAAIRggACPYIAAdjAAAAAAgAC+cIAD66AAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAALKwgBJEgAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAgAC6IIAMYMCAALWAAAAAAAAAAAAAAAAAf/8AAAAQAICAGE/AgBhiw +BEEACAQBAAgf/6SggQAAADAAAAAf/5iApQAAAMAAAADABAAAH/zeACAGFEAf/5iQA4AAAAD/+AAB +AAAAABAAAIEEAQCBBAAAAQQAAAEEAQCAAAAAAAX//x//hBAGAAAAKgAAAB//zyggA/V0AgAAAIAQ +AABBQAAAQUABAIMAAAH//7//gYAAAAQAAAgf/5cAIAjhcB//jXD//wAA//8A/yAI4aAgCOIAIAjh +4B//jhAAAA0gH/+XcB//lkAf/5scH/ziAB//mpAf/5sUH/zg4B//klAP////H/+S1B//l6gf/5a0 +H/+XIAAAC5AAAP+AIAkE8B//lxQAAAo44QAuAOEAXgDhAZIAH/+X5B//lqTgAACg4QAwuAAAgADh +AGAQAABAAOECEADhAjAA4QJQAOECcADhABAIH/zhQB//p0Qf/6c8H/zgCB//p0Af/6dcH/+nVB// +p1gf/6d0H/+nbB//p3Af/5iA//7//wAgAAAgBhPwH/zeAAQAAAgFAAAAg/8AAIEAAAAAEAAAIAYU +QCoAAAAgAAOAIAKJkB//gAAgCMRgAAA/KCAIw7AgCMRQIAjEgCACkLzP////EAAAACAIw9A///// +AgAAACACisQgAorIIAKQuCACisxAAAAAIAjEEB/84HQf/5sgH/ziDAAAgAAgABEoH/+NcAAADDz/ +/3//H/+VmCAIx7AgCQyQH/+XcCAIx+AgAoiQAAAIAB//keSCAAAAgYAAAAwAAAAABgAAAABAAB/8 +4gAf/5scAAALOCAIyGAgCMjQIAjJQCAIyXAEAQAI4AAAAB//ljggCMmgIAjJAFMAAABRAAAAIAjJ +4FIAAAAwAAAA//v//w/+//8AA///AAAn/yAJDNAgABfUH4AAPx//liwgCMowAAQAAAABAAAgCMrw +H/+UzAAA//8gCMtQIAjLsCAIy4AgBg8wIAjMMB//lkgNAAAAIAAv2CAIzLAIAAAAIAjNAPf///8f +/6SgAQAAAB//lSgf/5SAIAjfIBQAAACAAAAAgAAAAngAAACAAAAGgACwAAAACgAA4zCS///wAIAA +sQDhAZoAAAIAACAI3uAAAH5AH/+OIAYAAAAFgAAAH/+YkB//lFQrAAAAIABFsDUAAAADgAAAAwAA +AB//lFgH////AD///4BAAAAID///H////wD///8gAAAAH/+WHD0AAAAf/5KMBwAAAIEEAQCBBAAA +AAA6mMMAAAAYAAAAH/+OYAAAD/8AQwAAH/+V5AQAAAAf/4QQH/+muB//pMDhAHoAH/+STB//lQQf +/5aAH/+UnCAJEzAAAweAIAkToABAAAAAAAkAAAAwAv/8+H/AAAAAo/+7AKP/ugDgAwAAg/+2AA// +//8P//gA/wAAACAJE+AgCOEAIAjhMCAJFHAACgAAAA8AAP//AA8f/5UQA//AAIP/wAAgCRTwIAkV +YB//lpgf/6Uw/2DwAB//pRAf/40wBIAACB//gFAARAAAAMAAAP8f//8AAIEADwAAAP//AAAf/5Y8 +H/+bGB/84ggf/5yoIAjmkB//kogf/4BgIAYSAAAAMAAAACcQH//Z4B//lPjerb7vNAAAAD8AAAAA +AIkGAJkAAB//pHgQAAcC7gAAAAHAgAAf/6NImQAAAB//pTQAiAAIgoAAAR//pMgf/6PUAxUAAAMR +AAAADwP/IAjqYCAAwCQgCOqQIAjq0CAJHUAAAI4CIAkeECAI6vAgCR2AIAkdwCAI6yAgCOtgIAjr +kCkAAAAgAMicIAYYMCAGEkAgANs48PDw8P8A/wCqqqqqzMzMzAAPQkAgA+F4H/+WoAAJAAAAgAAA +IAjtACAA++wAAEgAIAD/cB//lhQACQAIH/+kPB//pIQf/5SYAAAIBgAAiMwAAIkUfwAAAPAAAAAg +CR9AIAkgQCAJIHAgCR6gIAkgECAJH6AABAP/CgAAAB//o2Qf/6QkH/+UcIP/twCD/7YgIAjx8DMA +AADhAAAAH/+kRB//lVQf/6SMA//gAAA/9pAAABkUA//wAAAQAAEAABkcH/+kiAAP//8AAN6tH/+k +QB//lhAf/5UsIAYPQB//lIwf/5aIIABgWB//lSAgADWIH/+UhB//lFAf/5n0IAkhsCACjSAgAGD4 +H/+TiACBAADgAQAAAOABAAAA4AEgCSKAIAj0sAAADEQgAIgkIACFuCAJIgAgCSJQH/+WNCAJApAg +CQLASAAAAB//jgTv////IAkDAH////+/////3////yABddgf/5XwIAF3yB//klAf/5Ws4QAuAB// +lbThAF4A4QIOAP//v/8f/48s4QAOAOEBjgDhAHIA//++/x//lrQAAAo4H/+X+B//l/QAAAxwAAD/ +gB//l+wf/5hYIAF9dCABhcwD/wAA/7///x//l1Q8AAAAAAX//4MAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACB +gAAAAAAAAB//+Wgf//loH//5LB//+Swf//ksH//5LB//9Ggf//b0H//1mB//9Zgf//WYIAXlwAAA +AAAAAAAAAAAAAAAAAAAgBelAIAXpQAAAAAAAAAAAAAAAAAAAAAAgAX9AIAXlwB//9/Qf//f0H//3 +9B//9/Qf//f0H//39AAAAAAf//RwAAAAAAAAAAAAAAAAAAAAAAIBAAAAAAAAAAAAAAAAAAAEAAAA +AAAAAIGAAAAAAAAQBQAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAgQAAAAAAABgFAAAAgAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAACgQAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAgCgAR8X8T8X/TDwPmMQECABbxfRfxfndrBpBgtGZ3Y/hUDoBVk5kPFABj +//kAAABsEAQY8Xsd8XYrIAcc8XYqIQj6AgAHcbsBAO7cOQ3cAoAAC6oCnDDj8XAZsASAAAiqAhzx +biMwgPpACBXgDQUAnWXsZgIhuN0AAPrAhhWkdx0A6Xz/Ld4CgADrewIMzwKAAOtmASTL4QAAmWMC +BImTZyhmBgYgixjxXyUhCfTBZhWkMx0A5WYKK5AEgADoAAUDKMEAAG05AgUCYdEPAAAAbBAEHPFP +JiAHG/FOH/FU/kEEFaDWEQANyzmbMIcg++KWBaAJJQD6YEYVoBgFAOg2Ayu+AoAA+OYADHFmAQD4 +YCYVoAwFAOUgVys0AoAA98YADrArBQD/pgAO8Ao1AOjxPhKCAYAAnDWcN5szGfE9CnUClTGZNiUh +CZ00LyAHnDmUO/imAAkx/wEA4jYKL/wCgAAP7gII7gLuNggtEASAANEPJyEIKiEJnDWUNwZ3Agiq +Apo2CHcC5zYELJAEgADRDwAAAAAAAABsEAgoIAUnIAcpMQX4IIYV4BlFAPkADMVhdwEAiiIW8R8Y +8R/xVQwN4A2VAAx7Eaa7LLKe/YAMQ+AKpQArsp3rFgUljDmAAIyI94AMcJIAnQAtYq5k0TgrYq3k +sTRmc/0AAO6GCCWJuYAAKCAUpIgICEcoJBT1AAu90A8FABnxCS4iFiwhKYgVGvEIrsyagOoiHi5n +woAA/QBmFaANJQD9AEYV4AtlAO3w9x1WAoAAC6oCixSagekAFQRAQQAAiRUIAIooPBD9IMYV4EwF +AP0g5hWgDEUA7Ls2BMiBAABtuQUIAIYJAmHu8OkVoIeAAIgV7gAFDc8CgACpiOiMICWkNQAAC8kM +bZkCCAJhKCEp6iEoJEAFAAAICE8oJSn5QAhEIgCdAP/hwgXgDBUA+iCoFeAe5QDqIh4sbUKAAPwg +JhXgCQUA+CAGFeANBQDpFgIl2YEAAFhx1Ax+EffAAEcwDZUA/dOmFefFAQD5gAYpUgCdAMAg0Q8A +6iQACdgEgADsRAAK6ASAAFhzsdKg0Q8AwLAKzzTvhggt9o4AANog/EBoHaAbxQBYdABj/8oAAADq +JAAK2ASAAFh1PtKg0Q8A//nsDaALBQAAACt8GOokAAlgBIAAWHP0Y/+cwKBZjncY8LCMiPmf80CQ +CqUAY/+sKiEJ/EKwFa/9BQANjQENjgwuJBTttAMuYQKAAO+0AC1WAoAA/UYADTAJFQAJqgKasfjV +phXv+WIALyUp//vUDaAIBQCKJ+tEAApoBIAA+0QAFaAMBQBYbjDSoNEPAAAAbBAGKCAFKyIQ5CAH +KlAEgAD4AwId4B7FAPveAAzwGUUA+QAMXWFEAQCMIh/wiOoWAC4LHgAADEkRD5kILZKeDwIA96AL +41IAnQAnkp0MBj5kcW6LKSoiCguqDPdACQuiAJ0AKiBOLCBMsa37gAskIAsVAC0kTiowASkiGPNA +C0aSAJ0AKyAHLCEk/GAkFeAIVQD5QAQEMKsRAOCIEQ1SgoAACogCGvBuCN0CKCEHKyEJCswC+6YA +DrqIAQDq8GocQwKAAAi7AighIp1wjSCbc5x0+wYADDAKZQDodgIu7gKAAArdAp1xLCIQnHUrIDgY +8F78ACId4EwVAPzhJhXguxkAC805HPBZnnj7DQAOcAgFAJh3DcwCnHbt8E4U2AUAACsmGBvwRJh7 +mXrtABUDyMEAAAkAiut2DiHIQQAA7nYPI/EBAAAJIIYOAmMJAIYOAmEMTBGvzOrGnSMAqYAAjikt +IDim7p4p86AFV5IAnQAFD0f54ARRUgCdAMAg0Q8A6iQAC1gEgABYTV/B7O/wLxV2kYAA6iQACdgE +gADsEgAq6ASAAFhzFtKg0Q8AAAAA6iQACtgEgABYdKrSoNEPAAAAK0wY6iQACWAEgABYc2Jj/8GI +IsCUCYgC+EBGFa/+3gAAAAAAAAD8Q6gVpIkBAACBBAC9Gg3MAvxDphWv+h4AiieNEMDA6qwgLtgE +gABYbarSoNEP2iBYcsBj/1EAAGwQDC0gBSYiEC8gByshNeUWAynABIAA+wCIFac1AQDyf8AV4AwV +AAPDOftBAA1wFYUA64ICLGAEgAD3XgAKsf8BAPcAMBWgFUUA9aAf1WO7AQCJIigWAPM9XA3gDoUA +mBDywB4HEgCdAJ8SnxqbFhbv75MV6hYEL68CgADmVQgCMA0AAOYWCSJwBQAAiBouFggrEgn1AAZi +EgCdACpSnvtACaviAJ0AL1KdZPO7GO/giIj3AAlYkgCdABnv3CmSrgwDPurv2hSJ+YAAKqKtFu/Y +6hYLJGv9AADrEgslCWmAAO1mCCWbmYAAiCmHKgh3DPLgCWPiAJ0AKRoA8yIyDeD69QArIBacEftg +Ca0iAJ0AGO/QhhSNwyogOP3g5hXgCQUA+eEmFeBHBQD34QYVoKoZAAp5ORfvxysiF5v6KyIbm/uN +xAp4OfzADxLiAJ0AmBeeHYYVnBGZHOcSDCsIHgAAYAF+GO+ziIhqgSaKGSlSnnqTQytSnZsbjRvp +760UM/0AAO/UAAaB2YAAlphl/xxgAtWeHfwgJhWgCgUAWY1rGO+kiIiMEe4SDSQPBwAA//9oDaAP +BQAAwJD4IWYV7/7uABvvm8CqCoo0+2EGFa/+/gAAAAAAAAD/+zgNoA8FAACeHZ8e/CAmFaAKBQBZ +jVcY75CMEYiIjx6OHfkf9diSAJ0AYAJRwJCZG4obHe+JwLoLizTr1ggtdo4AAGACOACeHZ8enBHq +JAAJ2ASAAFhMrowRjx7uEg0ldfmAAGAB7wCeHZ8e+kDwFaAMBQBYTaWMEY8e7hINLXXGAABgAsYA +iBGOF/YgyBWvjAUALCQ7jBQGdgIG7gKsuQzaDJqE6SYbLFgEgADtIhApUASAAFhz744djBH6s6YV +oQcFAHN7CCsgFigK/3i5XoopKSA4o6rqJgkk+aaAAC8iEC0hNfuAiBXgCBUA+CCmFaAGNQCWEw27 +NvoghhXgHYUA/34ADv/2tgCKJ58eixDqrCAqYASAAFhwkI8emhErIhv9QIgV7/2GAAAAAAAA6iAH +KeAEgABYTV+MEf4hqBWv/kIA2iBYcfeMEf4hqBWv/kIAAC0iEIoWKyA7Fu9ICpkCCYkC5pgCDYn2 +AAAa70X4RIQV42kBAIfA6yAHKzICgAAGmQImIQf64AQDsLsRAOrvNR3agoAAC3cCKyEiCncCKiEJ +l/CHIJ31+eDGFapmAQDp9gQrMwKAAAaqAhbvK+r2Ayu+AoAA5+cCB8jBAADn9gEmQIEAAOa7AgJT ++QAA6/YCIhQ1AABtqQUIAIYJAmEoIBSkiAgIRygkFPUABq3SAJ0Aihj6s6YVoQkFAPMh8g3g/PUA +KyAW/WAJFSIAnQAtIhex3e0mFyGAqYAAjykuIDij/58p88AHv5IAnQCGFWVg0sAg0Q8AAAAAKCBO +ZIw9DpsCmyLrEgApUASAAO0SAypgBIAAWHHn0qDRDwDrEgMpUASAAFhzfNKg0Q8A2iD8QGgdoBvF +AFhyNWP/xwCLEtog67wYKWAEgABYcjBj/7QAAAAAAOokAA5YBIAA/CCIFa+OBQDuJDsscASAAFhz +bPohBhWgDwUALyYb/kdmHe/8ggCLGyohCfxCsBWv/QUADY0BDY4MLiQU5MwQDVYCgAAMqgL9YGYd +4A4FAP9gBh2gBhUABqoCmrEZ7tL3NaYVr/vKAACKJ+tEAApoBIAA+0QAFaAMBQBYbGXSoNEPAADa +IFhxe2P/BAAAAAAA6iAHKeAEgABYTNtj/tOLEtog67wSKWAEgABYcgFj/vdsEAgoIAXt7rwZ0ASA +APPdcgXgHkUA/wAKdSAMpQArIE4p0gjTD+oWAyXb/QAAKyRO9yAIWJAHFQAvMq5k8igqMq3mpAAF +EVGAALCY6NYIJQhBgAApIBSzmQkJRykkFPUgEO3SAJ0AKSBzKyId+yAEAN//9QDgehoEwAUAAP9X +AA/0iAEAKCRz+0AEBXAIFQAKijkPuwHrJh0tBv4AAIoifKcEKyBOyrR9pwgtIEwsIE59wxnMbC4g +FO8iAi9YHAAAZPH0wCDRDwAAAAAAAIgnx5MJqQHpJgIkUMEAAFhkOOPukhUBEYAAKKAAA4gKiIzs +oActWASAAPpAaB2gDUUAC4AAZa/hiSdkn6iKmsqnKpIJZK+eKKAAA4gKiIzsoActWASAAPpAaB2g +DTUAC4AAZa/hY/99AAD//1gNoAoFAMCgWYw0He5sidgsCgr5P/dAkB5FACYKACkgFLOZ+EKGHe/8 +GgAAAADqJAAK2ASAAFhy5tKg0Q8AACogBSsgBw8CAP9ADxUhuwEABQVH+KAPKVIAnQCOE+7iBi94 +BIAAnhQLvgL1YApyEgCdAAy6EQOqCCiinvcADnzSAJ0AKqKd7hYBJQrxgAD6QAgV4AwVAFgf9hvu +Si8hCR7uQCghIi0gBxzuUikhJP8GAAww3REA7hIELuqCgAANmQIMmQKZoIwgKKYC/0BmFeANJQDu +pgUuZgKAAA3MAv1AJhWgCQUA6wAVBVBhAACxmeqDHgyP6AAAjxEM/xHz4ABH8A6lAC72nfS/8sES +AJ0AKiIH60QACmgEgAD7RAAVoAwFAFhrwGP+OgAAAAAA//dYDaAKBQAMmzTr1ggtbu4AAGP+2QAA +LyEJ+EKwFaALBQD6wAYd7/oFAAqaASpkA+qaDAxBAoAA6iQUL/4CgAAI/wIH/wKfYfZ1phXv9soA +iifAsPtEABWgDBUAWG47He4anaCMIBvuGeumAi5mAoAAB8wC/UAmFaAbxQDsJAAJUASAAFhxRMAg +0Q8AAInY9yAEqJIAnQAM6hGjqiiinvcABXzSAJ0AKqKdZKCmsJiY2O4WAS11VgAAiSLrFgAkhRmA +AJ8S+L/rYVIAnQCKJ8Cw+0QAFaAMFQBYby4e7fqeoI0gG+377BICLu4CgAAH3QKdoYzGnKP7QEYV +7/TqAOtUAAlQBIAAWHJmY/0njxOP8/4ghhXv+I4AAAAAAAAA//jQDaAKBQAAnxKbEfogBhXgCgUA +WYudHe3WixCJ2I8SjhH5P/qIkAylAP/9jA2gCgUAwKAMmDT5oQYVr/1aAAAAAIsQ7xYCKVAEgADr +vBgpYASAAFhxCP4gSBXv/SIAbBAEKCAU74seahgEgACKJ/pgaB3gDAUA6qwgKegEgABYa1XSoNEP +AIsic75+FO24iUhqkXob7bXTDyyyrmTAWCqyrWSgVLCd7UYIJQLhgAApIBTpJBQs2twAAC8hCfhC +sBWgDQUA/UAGHe/8BQAMnAEspAPsnAwMQQKAAOwkFC/+AoAA+eYAD7AOFQAO/wKfof91phWv/eYA +wKDA6g6eNO5GCC19ZgAAjyLJ9cAg0Q/AoFmLXolI+T/70JIAnQBj/+UA2iD8QGgdoBvFAFhw0sAg +0Q9sEAgpIg/vITQpsASAAPZg6BXnhQEA7iAHKlgEgAD7H8AVoAQVAPqNAA0wHUUA/uEAC/HuAQDp +fR8MFHQAACggT+8gTSRABQAACAhHKCRP+eATC6IAnQAvIAWbEZoQ/eARLWIAnQCJIsej+UAN0OIA +nQAsIhmLMv1gE00iAJ0AjTgY7W3vEgEmkaGAAAzkEahEGO1r6BYCJ/gNAAD1wA0CEgCdAClCnv8g +GYviAJ0AKUKd7ZQABJHBgACLKSoiCgwFPg8CAAuqDPVACeviAJ0ALBoA9YIyDeD49QArIBbTD/lg +GAUiAJ0AGu1mKSEkKyEHCpkCKiEJCwtKDLsQC6oCKyAHHO1SCytA6O1eHdqCgAAMuwIsISKb0Isg +mdSa0wjMApzS/WAAFbAMVQAMuwKb0RvtVSoiDyrWBSkgOPvapgWgDAUA/aDmFaBIJQD3oQYV4JkZ +APlNAA3wCiUACYo5KWIEKdYJKGIFKNYK/MDIFaAJBQDs1gsjh+GAAOntRRzCgoAACYgCmNyMaJff +nN6MEolpKdYQiGoo1hHsABUGySEAAAkAioxn/OAKq6IAnQAZ7S0KuAIJiAKY1sD1/pOmFeEOBQD1 +wfIN4Pr1ACsgFvtgEgUiAJ0ALiIZjCktIE8rIDjlzAgHcAUAAO4mGSbr/QAALSRPnCnzYA4HkgCd +AI0QZdG+wCDRD58TnhSeFZ0W6iQACtgEgABYSjaNFo4U7xIDJXVhgACOEGXv14on2zDsEgElUMEA +AFhuHMAg0Q8a7P+KqPdADsiSAJ0AK0Ke/2APs+IAnQApQp0d7PjkkeplY/0AAJzY7ZQADPJ2AABg +AHoAKCA58R/4DhIAnQD/++QNoAkVAMGjevkSKSA6/iCmFaAL9QD7IBAlYgCdAOokAArYBIAAWHFq +0qDRDwAAAAAAAPAAGA2gGtUAwKGMNyshCY04jjLrrxEN3QKAAA+7AuS7AglQBIAAWHFMwCDRDwAA +AP//WA2gGoUAAAAr7BjqJAAJYASAAFhwEmP/KAAACrkCmdbAhfiTphWhDAUAdcsNKyAWKgr/+2AN +PSIAnQCLEGSxNYtqjGeKaat7B8wMnGf3YNIN4A0FALGqjGWbaotmmmms2qt7d7sBsaqbZppliCkt +IDiliJgp86AJN5IAnQCJJ4qayqWLmcqxnxMZ7L8osACeFJ4VCYgKiIwssAf6QGgdoA01AAuAAI4U +jxOLIsej+1/zaOIAnQAoITSHZ/xB6BXgCRUAmRD44QALsBxFAPz+AA5/85YAANogWG9SY/47iifq +rDArWASAAFhcw9Kg0Q8AAAAAAAAA//NIDaAJBQCfE54UnhWdFvpA8BWgDAUAWEq+jRaOFO8SAy1n +TgAAK+wS6iQACWAEgABYb81j/hPqIAcq4ASAAFhKn2P9tZ8TnhT+IKYVoAoFAFmKShrsgoqojhSP +E/lf8HiSAJ0A//iIDaAJBQDAkBzsfMC6C6s0+4EGFe/4QgCfE4onnhTuFgUp2ASAAOwSASVQwQAA +WG2O7hIELTAEgAD+IGgV7/qWAJ8TnhTuFgUpUASAAFhvHY4U/iBoFe/7JgAAwVP6QGgdoAsFAPwA +Ah2gDTUAWGjGKyAFjhX1f91NYgCdAGP9Y58TnhSeFeogByrgBIAAWEpyjhT+IGgV7/kaAAAAAAAA +bBAMlRMmIAUvIAeHL+oyBCnABIAA/EaEFec1AQDyf8AV4A4VAAPjOf1BAA1wG0UA56sfDGAEgAD6 +wB6lYf8BAIkiKBYA8zr8DeAOhQAmgAEoFgDywBy3EgCdAJ8SnxoZ7D6TFxbsPOoWBiJYDQAA6xYJ +L68CgADmVQgCcAUAAIganhiNGfUABVoSAJ0AK1Ke/WAII+IAnQAvUp1k85KImPcAB+iSAJ0AFuwr +JmKuDAM+6uwoEwiJgAAqoq3qFgska/0AAOsSCyUIEYAA7ZYIJZqBgACHKYYqB2YM8sAH6+IAnQAo +GgDzAjIN4Pr1ACsgFpwR+2AILSIAnQAW7CsqIDj72FAF4A0FAJ3394CIFeCqGQAKazmGFsSACo05 +9sAPguIAnQCdFI0X6xYFLoduAABgAZCImGqBIY0ZK1KefbM+L1KdnxuGG7CK72QAAwHhgACamGX/ +RmAC1gCeHPwgJhWgCgUAWYnDGev8iJiMEe4SDCQPGwAA//9kDaAPBQAAwLD6IWYV7/8CAMDaDY00 +/SEGFe//BgAA//v8DaAPBQAAnhyfHfwgJhWgCgUAWYmxGevqjBGImI8djhz5H/dIkgCdAGACWcBg +lhuKG8C6C4s065YILXf+AABgAkOeHJ8dnBHqJAAJ2ASAAFhJCYwRjx3uEgwld3GAAGAB+54cnx36 +QPAVoAwFAFhKAIwRjx3uEgwtd0YAAGAC05wR/iGGFa+IBQDoJDsmOEEAAOcDHgewgQAABgJhhhaW ++I3Hh8SIxq1tBncMl8R22wouFgzsFgEkQAUAAIwWixGGFI4VmLadtwbuAu0iDylQBIAAWHBBGeu6 +jhyMEfqzphWhBwUAc3sIKyAWKAr/eLlciykqIDiju+smCSV5qoAAhi8vITT9gIgV4AoVAPog5hWg +CDUAmBMP3Tb8IMYV4B9FAPe+AA+/9v4AAJ4ciiefHYsQ6qwgKmAEgABYbOHvEg0tYASAAP4hiBWv +/NoA6iAHKeAEgABYSbGMEY4c+dcwBe/+QgAA2iBYbkiMEY4c+dcmBe/+NgAmIDsX65vtuwIHyIEA +APmCABWjqwEA57cCCwjGAACTH43AE+uUA90BIyAHAyNACjMQA90CE+uIJiEkA90CIyEH6yEJLVIC +gAD6xgALOjMBAOohIimbAoAAA7sCgy+d8I0glvSX9pP1m/ODH+vrfB7uAoAADe0CnfELqgLq9gIi +DD0AALBKbakFCACGCQJhKCAUpIgICEcoJBT1AAZd0gCdACoSCPqzphWhCQUA8yHyDeD89QArIBb9 +YAilIgCdAMg/jiktIDij7p4p86AHr5IAnQCPF2Xw0sAg0Q8AJiBOZGxnDpsCmyLrEgApUASAAO0S +AypgBIAAWG4/0qDRDwDqJAAK2ASAAFhv1NKg0Q8A2iD8QGgdoBvFAFhujWP/xwCLEtog67wYKWAE +gABYbohj/7TbwPwgyBWvjgUALiQ7CCCGCQJj7PYIKVAEgADtIg8r8ASAAFhvw/ohBhWgDwUA/kdm +He/8qgCLGyohCfxCsBWv/QUADY0BDY4MLiQU5MwQDVYCgAAMqgL9YGYd4A4FAP9gBh2gBhUABqoC +mrEZ6yn3NaYVr/vyAACKJ+tEAApoBIAA+0QAFaAMBQBYaLzSoNEP2iBYbdNj/wYAAAAA6iAHKeAE +gABYSTNj/uGLEtog67wSKWAEgABYbllj/vdsEAYoIAUlIAckCgP3AAVkUVUBACggImSAoQIqAlhm +5vlABMDQBhUAKSAh4+sKGAQKgADzIAQv0gCdAOxZEQKlaQAAo5kqkp5uo3Qrkp1ksGopICH6QAgV +oPzlAAyZAfcmAAywDQUA+EQmHeAIBQD4IAYVoA6VAPggJhWgDwUA+CBGFaAMBQBYa/YMXRGj3fWz +phWgAgUA0Q8X6u+KeGqhJgxZEaOZLpKebuMtK5Kd5LApZWP9AACceGW/lMAg0Q///igNoAsFAMCg +WYiqinhroc7//4wNoAsFAMCwwNoNrTT84QYV7/9SAAAAAGwQCiwgBfhA8BXgCxUA+GBoHaelAQDo +FgElU/kAAOq6OQoYBIAA6hYFLCAEgAD9gcAEUZkBAMGz+4AZhWIAnQCMIhvqybQ+5cKxbMcCgACr +iJ4U7RIEKAQKgAD1IAQCEgCdACyCnv2ABxPiAJ0AL4Kd7xYGJ5SJgAAlIRuKQocpmBAFpTb1TwAL +cQ8FAHbzAdWghioHZgz0wAXT4gCdACoaAPVCMg3g/PUAKyAWmBD9YAX1IgCdAI0ppd2dKYpC+qAK +cqIAnQCZGIwVG+q+h0OZGZgQ63cBBgfpgABgAK0a6qOKqOgWACUMn4AAjBQrgp58sz8vgp0e6p3k +8Dhla/0AAJ3o7xYGL/uOAABgAfaZGPghJhXgCgUAWYhbGuqUiqiIEOkSCCUPFwAA//9UDaAPBQAA +wPAc6o3AugurNPuBBhXv/woAAAAAAAAA//yEDaAPBQAAmRiZGeokAArYBIAAWEewiBDpEggleamA +AGABipkYmRn6QPAVoAwFAFhIqIgQ6RIILXmOAABgAmDudAAKWASAAOWsDAroBIAA7xIGKVAEgADs +RgIp4ASAAFhr5okZiRiIEPsTphWhDQUAddsIKyAWLgr/frkxwPH+IKYV7/oOAACKJ4sR6qwgKeAE +gABYa6PAsuukAi0gBIAA+0BIFa/+bgAAAAAAAADqIAcq4ASAAFhIcYgQ+CEIFe/+9gCJQIwVh0P4 +IAYVp9kBAO0WAi4HpgAAKiAH+uBoHeGqAQBYJ3mJFteg6jz/IkBBAADpnCAhjDUAAG2pBQgAhgkC +YcCgmhMvIQcW6lyIEvvUtAWq/wEA6eo6H/8CgADm/wIEaD0AAPYgyBWk3R0A7iEaJugFAAANPQyf +YOsiACvgBIAA7ak5AbgFAADpZgIkQEEAAOhmAy3+AoAAD38C72YBKugEgADvQgMjUEEAAFhrmZcX +6iQACdgEgABYYfaPQOMSByep7oAAhxDy86YV4QYFAPTB8g3g+PUAKyAW+WAE3SIAnQCIE9KA0Q8A +iRVkkJvAINEPACucGOokAAlgBIAAWG1YY//kiif4IAYVp7lBAA8CAOqsICgECoAA9WAEUdIAnQCM +FisKAezMICnoBIAAWGek+iBmFa/8OgAAAACLFuw9EQlQBIAA/WAARfAMFQBYZazyYGAV7/3CAGWs +0Pmf5mjSAJ0ALyAg8f/mF5IAnQBj/3sAAAAAAAAA6iAHKuAEgABYSA2IE9KA0Q+KJ9ww6xIBJVCB +AABYazHAsvtARh3gAgUA0Q8AANsw/GBoHeAMBQBYZ4PbQOw0AAroBIAA6hYDK/AEgADvEgYpUASA +AFhrWfdAaB3v+2YAAAArnBLqJAAJYASAAFhtHmP+/ABsEAQU6fMkQIAIRBH6gGgdoAsVAFmEixjp +32SgQvhGAAwwCSUAmaHopgAhAcmAAGghHG8kGe4iFmVIIQAAA0CICQiKAyCICQSKAwCICQCK2kD6 +AEId4AwVAFmJWMAg0Q/HJNEPD+gwn6IO7jCeow3AMJ2kDLEw/UCmFaALBQCbpvtA5hXv/y4AAAAA +AGwQFOIWGynwBIAA/iNGFaAMFQD6I2gVp2UBAOjiACNb+QAAC8s5KaAHiqf6IaYV54gBAPgihhWh +mQEA6RYKJVCBAADqFh4qGASAAPTAL2ESAJ0ALRIbjdJl1B8f6aGP+BLpn/fgL8iQDqUAJiKuZGYc +KSKtZJYYGumasPiYqOiUAASvwYAALxIeKRIa++BoFa/FBQAF/wEvFhzvrwgEyIEAAO/8QCyoBIAA +/yAvkuIAnQAmEhotEhQlFhX2wGgVr/wFAOYWESboPQAADNkBpZbmFhArKASAAP7ALmLiAJ0AmBeZ +FZMWJBIb7xIKItgRAACbG/4iZhXkrR0A6hYWIbBBAADmFhIi0CEAAJocFul1lhgqEhomEhzkQQcv +/wKAAKL/7xYYIzEBAACWGRbphftBhBWqRAEA6hYZKicCgAAGRAKUH/XTAgWgB6IAJyAA6v8MBMgF +AADqEh4nQAUAAP8AaB2gaAEA6BIdJJWJgAArEhwsMACKowXMC6ur67xALmgEgAD7gBUC4gCdAAkM +QPoAIh3gCgUADLo4DasL7aoKBeghAAD6ACId4AwFAAa8OBbpZwh3C6bGJmCQ58sLDUAEgADnzAoF +2GEAAORkCAZgQQAAioANAIkPqjaawAsAi4yA4zwBIRAFAAD/n/rz4gCdAIMUD8sMCsIMkoD/oAgV +4AcVAPOgKBWgBgUAC3Y4qWmiopLReisBsf+f0PKAGefSAJ0AHOlNLRIbIhIaFulJGulI7hIPJ0AF +AAAGNgHqOgEMzgKAAAlmAikSHQqIAiMSGZiUllCPJygSFyYSFgP/DP5A5hXhNB0Ao2MvEhQS6TOT +Hp6AjdAuEh7ihgIhmAUAAO+GAy7OAoAA+GYADPALBQD5ACYV4ApVAOYWASmgBIAA6BIVJBBBAADo +FgApeASAAFmGcy8SHioSFiYSHI/zKBIVKxIQ5v8ICUgEgADmEhEn+QEAAPvgFVviAJ0AbakFCACG +CQJhAzQCKBIa6IIHKw0eAABkgaj10igFoPL1ABzpFy4SGi8SGC0SGy7hDfPzphXgClUA/aAIFeAL +BQBZhlgmEhsmYBbywAoFIgCdAC0SGy4SGigSGf2gCBXgClUA/8DoFeALBQDoFgAqYASAAFmGSy4S +Gy7gFiIK/3LhCioSG4sdWCgsZKKMLxITJhIYJxIS9eAFwhIAnQAmYp4pEhj2wBNT4gCdACmSnekW +FySHeYAAKhIaLxIZiVCKpy4SF/gghhXgBCUA++EAD7eZQQDvFhkkkRmAACoSHhPo1CsSHIqjo5Mj +MAAX6NGrqwUzC+00AAXZAQAA+mAQUuDJAQD6ACId4AoFAAy6OA2rC+2qCgXoIQAAjBXYoOeTCAuQ +BIAA/4AARjAOBQDsFh0mWGEAAP2CgBWv9u4AjRz6IWgVr/YOAAAA+48ADr/1ggAf6KyP+PfgDpiS +AJ0AJhIYJxISJmKeKRIY9sAOy+IAnQApkp0b6KPkkc1n0/0AAJq46RYXLPmGAABgABMrEhoqEhsr +sQ1YJ9Jj/rTAINEPAIsaLBIb67wYLlAEgABYa9bAINEPLGEAscz8wAQdr/liACUSGiYSGSVRDAZV +DGVSACYSGyZgBPTAENkSAJ0AIhIa4xIXKbcCgACIIaYzIiIC5oI2adgEgADzABKgUAcFACkSG4oW +KJAUhB6qiPaAAEJ3iAEA6JQUIiAFAAD1ABIeUgCdABzoly4SGi8SGC0SGy7hDST2nf2gCBXgClUA +9c8AD3ALBQBZhdYvEhsv8BYmCv928Q4rEhorsQ0qEhsFuwxYJ58qEhuNFoqnwMDqrCAu2ASAAFhl +/NKg0Q8nEh2LGPaAAgPwDwUA6wAVA7hBAACx/+eDHg+P6AAA9IAgFa/ylgAAAC0SFdMP7foMCUAE +gAD4IsgV5OodAPHBIA3gDwUADQCG6AwAB/gFAAB++fEoEheNGQ6eDPlAAEQwDwUA5O0mZEBBAAAN +IIboLAAH+AUAAH758WP9EBfoTY0c+iFoFa/4WgAAAPpvAA6/99oA//ZkDaAJBQCLGiwSG+u8Ei5Q +BIAAWGt4wCDRD8CgWYX7H+gzj/j5//EYkgCdAP/4/A2gCQUAwJAY6C7Aagb2NPcBBhWv+LYAAAAA +2+DtjA8qYASAAPojyBWk3R0AWQWy+iNGFaAOFQD+IaYVr+feAMCgWYXmH+gej/j5/8/okA6lAP/o +IA2gCQUALBIb+4BoHaAbxQBYa1jAINEPAADAkBjoFA72NPcBBhWv55IAAAD7LwAKv+g6APrPAAq/ +6NIAACwSGi7AFS3AFCvAEezBCSlQBIAA7t0IC3AEgABZBYdj/dwAACoSG4sWWF/PLxIaj/Dx//Dy +kgCdACsSF+oSGynvAoAA/WAARfAMBQBYY6L0YGAVr/gCAAAAKhIb6zQACWAEgABb9pgoEhqIgQyr +Ees7CA04BIAA8R/toFIAnQDqEhspYASAAFv2Z/dAAEP/9oYAjBf2I2gV7/8FAA+PAQ+GDCZ0FC1x +Cf7isBWgCwUAK8QAL8QD5O4QDu4CgAD/pgAOsAkVAAndAp3BGufY+VWmFe/2BgAAbBAIiCIvIAeV +FPQgZhWg+/UA8RgsDeH/AQAoIBZ7gSwrEgTTD9MP/iDGFee7AQD7f8AV4AkVAOubOQlQBIAAWCcU +LxIG808QDeD79QAsMA8V57od58EW57/lUIAuC4YAAIcTsHclXDf+IKYV5FUdAOV1CA/PAoAA5pkI +AqgNAAD14AbiEAylACiSnvUAFQviAJ0AJZKd5FQAAooBgACK2PdACjiSAJ0ALmKuZOEBKWKt5JD9 +ZXv9AADv1ggkiAGAACggFtMPe4EOmRDrMQYpUASAAFgm2YkQKiAEixP1QAk5EgCdACogFKuqCgpH +KiQU9UAM5lIAnQAsMA+JFPGRnA3nmQEA+SAOKVIAnQDpVAABwEEAAG15BQgAhgkCYcCgmhIMdBGk +VCggBPUACjkSAJ0AiTHkFgEqWASAAOUyAiyNYgAA8yAOQFAEBQCkeYoV4hICLVcCgACmqimmndEP +AIrY90APUJIAnQCJFQyZEaaZLpKe9cAQA+IAnQAukp2eEIgQ5YQABA/ZgACwqfmhBhXv/BYAAAAA +7BIDKVAEgADtEgQp2ASAAFhqV9Kg0Q8AwJAMrjTu1ggs+EYAANog/EBoHaAbxQBYaqZj/8onMA72 +4ACD//pGAAAAK/wY6iQACWAEgABYap5j/6zAoFmFIR3nWorYKwr/+V/1YJAMpQBj/7kAAAAAAOsS +AylQBIAAWF8fY/7hAAAAACwhBx3nZvvO0gXqzAEA7jAOLmcCgAANzAIstiiKIBjnaf1AABUwDDUA +DKoCKrYp6AQFAfhBAAD5IAnBUgCdAG3pDgQCYw9AhgQCZQ8AhgQCYcDQ/CBGFe/62gCOMPPACuqS +AJ0AjxXiEgIv/wKAAKb/J/ad0Q8rIQn8QrAVr/0FAA2tAQ2vDP5Chh3gDgUA7ZQDLmECgADulAAt +3gKAAP1mAA2wCBUACLsCm5H41aYVr/i6AIon/KBoHaALFQDtEgMlUIEAAFhkt/ogRhWv+O4AANog +60QACuAEgABb9b6LEYkxDKwR7LsIDSAEgADxP/IAUgCdAOokAArgBIAAW/WNpKSkeYoV4hICLVcC +gACmqimmndEP//WIDaAFBQAAACv8EuokAAlgBIAAWGpGY/5MAAAAAAD+IMYV4AoFAFmExh3m/4rY +/iDIFeD79QD5X+/wkAylAP/0iA2gBQUAwOD+IAYVr/gOAAyoNPmhBhWv9DYAiieFq/tEABWvyQUA +CakBqVkpnEBt6RMEAmMPgIYEAmkPYIYEAmd5+xnTD40TDwIA+6BoHeAMBQBYZH76IEYVr/VuAPXv +AA///4oA2iD6gGgd4AwFAFhih7N7jBXiEgIuZwKAAKbMK8ad0Q9sEAQjIAAkCu10MQYiIQO8ItEP +hiCFI4Qh9nAABDs2IQD4YABBs2YBAKYzDjMR8q8ACX1EAQDjPBohE8kAAAQkLAQzKKMi0Q9sEAiK +IicgB4kwlRT4QtAVoXcBAPFbDA3omQEA+CAmFeD79QB7gSArEgQLC0f7f8AV4AkVAOubOQlQBIAA +WCYE80/gDeD79QAa5rSIqBbmsfcADGCSAJ0ALWKuZNGsJWKtZFGosIiYqOlUAAKMeYAAFeaiJVCA +JVw3+CAGFeRVHQDlRQgLzwKAAOaZCAKoDQAA9OAIWhIAnQAokp71ABMD4gCdACWSnWRRbyogFvtD +Jg3g7NUAKzAQ/WASZCIAnQArMQu8u9ogWCXMLCAE9YAK+RIAnQAoIBSkiAgIRygkFPUADIZSAJ0A +ihQe5qKNESghBxzmghnmoP+h4BXqiAEA/wAAFDT/HQDpiAIH+AUAAA9PDJhQiyAP7Dn8oGYV56oB +AOxWAi3eAoAA60sCAshBAADrVgEhwEEAAPlACAFSAJ0A6EENYlP9AABtqQUIAIYJAmHAgJgT6SAE +Ilv9AAAMuxGrW/UgB5kSAJ0AiDHlMgIl2EEAAOsWAiwJ8gAA8wAK8FADBQCjTIgTDH0Rpt3s1p0s +EASAANEPAAAAAAAAAPcADXiSAJ0ADHkRppkukp71wA3T4gCdACWSnWRRsbCMnKhlXuRgAFHqJAAJ +2ASAAO0SBCpgBIAAWGk70qDRDwDAoFmEFBrmTIio+R/zUJD79QD/+cgNoAUFAADaIPxAaB2gG8UA +WGmGY/+8wFDA2g2INPlBBhWv+UoAK3wY6iQACWAEgABYaX5j/5wAAAAAAOokAApYBIAAWF4FY/6p +iif9IGgdoAsVAOqsICpoBIAAWGPL+iBmFa/8AgCLMPNgCOKSAJ0A4hIDK+cCgACmzCTGndEPjxAu +IQn4QrAV7/oFAAqKAQqMDCwkFOSZEA92AoAACe4C++BmHaALBQD74AYd4A0VAA3uAp7x/NWmFe/4 +6gAAAAAAAADqJAAK4ASAAFv0u4sSKDIB6hYFLWcCgADsuwgNGASAAPEf9VBSAJ0A6iQACuAEgABb +9ImIE6Ojo0wMfRGm3ezWnSwQBIAA0Q//9owNoAUFAI40izeNNf5wAAe7ziEA/4AARnPuAQCuzA7M +Ef1vAA293QEA7MwaJdvJAAANvSwNzCj9YABFv/YiAAArfBLqJAAJYASAAFhpNGP+dMCgWYO3GuXw +iKj5H/I4kPv1AP/5ZA2gBQUAAMBQwPoPjzT/QQYV7/kmALBLDLsR61sICVAEgAD7YgAV4AwFAFhh +i7NM4hIDK+8CgACm3SzWndEPAABsEATaIFgluIQ3JTAW+cvmBaKmBQAGpigX5fioaAVVCghVC6dV +iFC4RPUEBg3gBxUAiDLqUgEpAQqAAAB5GgmIApSgmkGVQJRRmDLRD9ogWCWmG+XqHeXqK7Iy6tKB +LWAEgACsu+8wFi3eQoAAq6oe5eYZ5eTo5doeZwKAAK7MqWkrkn3u5cUfgQqAAO/CASvoCoAADbsC +LZJ/CP8BK5Z9D90CDe04DbsCm8Ipkn9kn39YAraIMupSASkBCoAAAHkaCYgClKCaQZVAlFGYMtEP +bBAI2iBYJYTUoBvlzvnLmAXipgUABkQoFeW96UkICVcCgACrqoqgKZJ/GOXEpUX7IAQEsGMFAPgg +BhXgBxUA4QAFATO5AAD4gABCMADiAAAAAAM8CvWAAgZ8OEUA6MgICVAEgADogn8qWASAAP50ABWu +LQUA7cwIC2gEgAALgAABAYcDN2DhAQcJ9yAAANEPbBAEKCAFJSAH+mCoFa/01QD6QEgV4AMlAP0B +IBHRVQEAwCDRDwCIKRnlpJor+wAHfCIAnQAJWQkpnQIqkQgpkQT7IARbogCdAMGv+0AECOIAnQDa +IFhhN4siA7oBZK/AiicEuwHrJgIlUMEAAFhbGuPldBUBEYAAKKAAA4gKiIzsoActWASAAPpAaB2g +DUUAC4AAZa/hiSdkn4WKmsqnKpIJZK97KKAAA4gKiIzsoActWASAAPpAaB2gDTUAC4AAZa/hY/9a +AAD//1gNoAoFANogWGEnKyAi6rsMCVAEgABYYnfaUPoAIh3gDAUAWGMmiyIDugHzf/smYgCdACwg +B+S9AQlQBIAA/EBGFeG8AQDrvB8pYASAAFhof8Ag0Q8A6yAiKVAEgABYYmUqIAXB436hDGioKYsi +82AEBX/8hgAvIDrAj3j56vpAaB2gCwUA/AACHaANJQBYYZFj/9cAAPpAaB2gCwUA/AACHaANJQBY +YQ9j/78AAGwQCogrHeVPLiAhizf8YMgVoP/lAA/uAS4kIQ3MAQy7DOuJCHjIBIAAwCDRDwMAhgkC +YZsVKCAFJSAH+CEGFe/01QD8QEgV4AMlAP0bQEHRVQEAiimbK/tAB+xiAJ0AG+U4C1sJK70CLLEI +K7EE/WAEs6IAnQDBz/2ABGDiAJ0AAioCWGDOiyIDugFkr5qKJwS7AesmAiVQwQAAWFqx26Dj5QoV +ASGAACiwANMPA4gKiIwssAf6QGgdoA1FAAuAAOukAA1/JgAAiScPAgBkn1iKmiuSCcqnZL9OKLAA +A4gKiIwssAf6QGgdoA01AAuAAOukAA1/NgAAY/8tAAAAAAD//0wNoAsFANogWGC7KyAi6rsMCVAE +gABYYgvaUPoAIh3gDAUAWGK6iyIDugHzf/rWYgCdACwgB+S9AQlQBIAA/EBGFeG8AQDrvB8pYASA +AFhoE8Ag0Q8A6yAiKVAEgABYYfkqIAXB436hDGioKYsi82AEBX/8XgAvIDrAj3j56vpAaB2gCwUA +/AACHaANJQBYYSVj/9cAAPpAaB2gCwUA/AACHaANJQBYYKNj/78AAGwQBCkwFglZFPUgBliSAJ0A +8S2wDe/65QDj5L8UpfkAAGiVBMAg0Q8AKyAGsLsLC0frJAYt/34AAI0ijCcK3QHtJgImUMEAAFha +WcmsKKAAA4gKiIzsoActWASAAPpAaB2gDUUAC4AAZa/hiSdkn7OKmmSgmoqZZK+pKKAAA4gKiIzs +oActWASAAPpAaB2gDTUAC4AAZa/hY/+IKSAGsJkJCUfpJAYs++4AAIwiiScKzAGcIouaZLBOi5ko +sAADiAqIjNog/WDwFaANNQALgADAINEPAAAAAOokAAnYBIAA7EQACugEgABYaX3AINEPAOokAAnY +BIAA7EQACugEgABb/1PAINEPAP/+vA2gCwUA//2MDaAKBQBsEATRDwAAAGwQCBXknRTkfBfknZIS ++CBIFaAKBQD6IGYVoAlFAJkUGuSXCIIJ4IEECReCgAD2QABD8AgVAOoiCAxACoAA+CAmFa/59QD5 +FwAMcAYFAPggBhWgAIoAmxOMFLFm4iwMI7gxAADlXAImY/0AAOwWBCYE8YAALVHC+sAEANALFQDg +uxoOo0wAAC5xfmTvygIqAlhiyY8R+sAEANAIFQDgiBoNGASAAOgWAyeAaYAAiaKKEAqZAZkyijcq +rDBYWfXJrCigAASICoiM7KAHLVgEgAD6YGgdoA1FAAuAAGWv4Yk3ZJ90iprLpyqSCWSvaiigAASI +CoiM7KAHLVgEgAD6YGgdoA01AAuAAGWv4WP/SYsT+iBIFaAJFQALmzlYY5vRD///GA2gCgUAbBAG +HeRWCysRrbMqMn8Z5FQV5D6IoPigAETwBAUA6bkIBAGRgAAsMngvMnv5gAWEYgCdAGXw7Cw2fCsy +eSs2e91ADeQWlKAN5BbAyfxABhQiAJ0ALzJ7wcDt5EIXg5mAACIyfCohBI4g8+H+Daa6AQAkNnz0 +b2YVoAAeAC42fO2vAQXD/QAACP8C7yUEJYxZAAAiMnywzO8yeyEA8YAAycZj/7/aIFhiNmWgnSoh +BP9BAAwWmgEAyJjRD9ogWGNh0Q8A2iBYY5TRDwAAAAAAAPpAaB2gCwUAWGNh0Q8AAADq0mAhY+EA +APuABADQCxUA/WABBd/89QAMuwMLqgEq1mBZhiEkNnwkNnv6b+gVr/zKAFl781hh6C1So2TfNVl7 +xGP/LxzkEf5viBWgClUA+G9IFaALRQDoFgAha+UAAFmBQPpv6BWv+9IAKTJ74jZ8LPtGAAAiNnvR +DwAAbBAEFOQDGeP/6OPpGV7CgACktCNCf6mI6LgIAYJBgACKMHipAipCexzj+CsxBCpGfwy6Aeo1 +BCnQBIAAWGH5zq4pMQT/IQAMFtkBAMjX0Q/aMFhjJdEP2jBYY1jRDwAAAAAAAPpAaB2gCwUAWGMl +0Q8jRn/RDwAAbBAE8GDwDe/59QCIIgk5AwmIASgmAoonDwIADwIAKqwwWFlc4+O2FQERgAAooAAD +iAqIjOygBy1YBIAA+kBoHaANRQALgABlr+GJJ8uUiprKqIqZyawooAADiAqIjOygBy1YBIAA+kBo +HaANNQALgABlr+HRDwAAAAAAAP//UA2gCgUA0Q8AAGwQBPJdABXgGMUA+EAHXCczAQAU44v0YAXS +EgCdAAw5EaSZKJKe0w/3AAcG0gCdACmSnWSQzxzjnhvjtgIqCQyqCquqWGH7+kAEANAJFQD9IAEE +3/v1AOKkAASAcYAAiqILmwMLqgGaIoonDwIAKqwwWFkm4+OAFQERgAAooAADiAqIjOygBy1YBIAA ++kBoHaANRQALgABlr+GJJ2SQZCqSCsqmKpIJyawooAADiAqIjOygBy1YBIAA+kBoHaANNQALgABl +r+HRDwAAAP//XA2gCgUAFeNcilhqoTcMORGkmSuSnm69PimSneSQOmVb/QAAm1hlnz5gAAvaMFl7 +amWvM9EP0Q/RDwAAAAD//IwNoAkFAMCgWYESilhrob3//0gNoAkFAMCQwMoMrDT8oQYVr/8OAAAA +AGwQBBjjQQIDRwwzEagzKzKEGeNKKLAAKrIBCYgKCiGMAgo+KIIMAwI+/EBoHaANJQALgAAiNoQM +AgDRD2wQBBTjMgIDRwwzEaQzJDKEikEmQAAoQAj6mGgdoKklAAIFPgMCPnmBJRjjNQhoCoiM6lQA +ClgEgAD8QGgdoA0lAAuAACI2hAwCANEPAAAA6yQAClAEgABYYbvzQGgdr/8uAAAAAAAAbBAEGuM0 +KqJGK3rQC6ooFONL/0AAFTALFQALqgL6luYVoAkFAAnkMRXjRhjjKyhWhCVShCNCt2YwDW0IBStC +t2awBGP/8wAAHOM/IsaKY//8AAAAbBAEWX/sEuMCE+MdKSKC0w8JGo4DqAqIgAuAAGP/7ABsEAQq +IgcqrBBYYpjRDwAAbBAEiCcijBDaIFhid2ihAdEP2iBYYnES4ysLqBHoIggFAdmAAAzqMCsihSuy +ACKs/+y7CAlQBIAAWYTvHOMjKsJ/+kAEANALFQAAuxoLqgIqxn9ZhR7RDwAAAAD6AOIdoAsVAFhi +Tywifywmg9EPAGwQBCYiBw8CAOZsECnQBIAAWGKy7DQACmgEgADuVAANWASAAO8iACtQBIAAWGH1 +0Q8AAAAS4woD6DAE7jAFsTCTIJQhlSIS4wYT4tSEIAQzApMgEuMEwDAoN0AoN0QoN0goN0wjPQFy +M+0DAgAS4v4T4t2TIMcvE+L9AyMDEuL8hCAENAGUIBLi+4QgBDQBlCAS4vmEIAQ0AZQgEuL4hCAE +NAGUIMcvwDEDIwMS4vWEIAQ0AZQgY//8AAAAEuLygyADExQPMxGTIFf/2hDi75EAkgGTApQDEeLt +ghAB6jCiEQHwMcBABOQWAAIAEeLpghAjGgADIgKSEBHi5sAhkhAE5DGEA4MCggGBAADSMAEjAAAA +ABDi4ZEAkgGTApQDEeLfghAB6jCiEQHxMcBABOQWAAIAEeLXghAjKgADIgKSEBHi18AhkhAE5DGE +A4MCggGBAADTMAEzAAAAABDi0pEAkgGTApQDEeLQghAB6jCiEQHyMcBABOQWAAIAEeLFghAjSgAD +IgKSEBHiyMAhkhAE5DGEA4MCggGBAADUMAFDAAAAAABclAFdlAJelANflABDAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXJABXZACXpADX5AAUwAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJyUAB2QAZ2UAp6U +A5+UBAiUBQmUBgqUBwuUAEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACckAGd +kAKekAcdkAOfkAR4kAV5kAZ6kAd7kABTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAA3JQAHZAB3ZQC3pQD35QEBJQFBZQGBpQHB5QICJQJCZQKCpQLC5QAQwAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAANyQAd2QAt6QCx2QA9+QBLSQBbWQBraQB7eQCLiQCbmQCrqQC7uQAFMAAAAf//uQ +ANIxEP/+CgAAAAAAH//72ADTMRD//goAAAAAAB///CAA1DEQ//4KAAAAAAAA9DAKAAAAAAD0MAoA +AAAAAPQwCgAAAABsEAQqIhAooAUpCpL5AATlYgCdACsiGPrgAAZwjbUA/YAETWIAnQDzYAQr0gCd +AP9uwAwfyQUAi62Ot4jqjOiN6y/sIOn/AQZQwQAA790IBEDBAADo5gom6QEAAOrTYH5IBIAAfaFp +muga4RwKAIcJAmEJAmEJAmHAgejGBSlQBIAA+YDmFaAOBQD/gIYVoA0lAP+AxhWv//UA78YDL2AE +gABYA3vAINEPWMcSwCDRDxnhDAm5AfhDBhXgAgUA0Q8M2gwK+gwqrHD7wQYVr/5yAC38QP3BBhXv +/kYAbBAEE+EBAyIC0Q8AbBAEFuD/JCAHiWDAc/EyQA3hRAEAKSIYCehR9QAJiJIAnQDzwfAF4anh +APVACYiSAJ0A9IAGchIAnQAMSRGjmSuSnvdgCsnSAJ0AKpKdZKEzG+Do6wAFDUgEgAAJAmEJAmEJ +AmEpIQcb4Oj/wdAF6pkBAOzg5xzPAoAAC5kCmaAZ4OX+QAgVoD0FAJ2n/UCmFaAbhQCbo5mi7+4C +D0YCgACepPcGAAxwDgUAnqaYoSgiGAiIQe6mCCxHAoAAmKnt4NYafwKAAKP/J/adLCIYnmAqIhAN +zALsJhgpWASAAFi35QUKR2iiGIon+gAiHeAMBQD7RAAVoA0VAFheCdKg0Q/AINEPHODFi8j3YATQ +kgCdAAxJEaOZLZKe96AFIdIAnQAqkp3koJtl6/0AAJ3IZa8eYABPjiKxn+9mACcBqYAABQhH9QAE +SRIAnQDAINEPKhoACpkC+EMGFe/7JgAAACsqAAubAvpDBhXv+yYAAAAAACtMGOokAAlgBIAAWGOQ +Y/+9AACMImXPtitMGOokAAlgBIAAWGOKY/+lAAAAAAD/+qgNoAoFAMCgWX4KHOCbi8j5f/rgkgCd +AP/9xA2gCgUAwKDA2g29NP2BBhXv/YoAjCePyorJ/4QAFa/IBQDo7gEH+EEAAO/GCiVTwQAA6sYJ +J3EBAAB+qymJyx3giaqamsmdoIwg+8EOBeANFQDrpgIuZgKAAA3MAv1AJhWgAgUA0Q8d4H+doIwg ++8D8BeANFQDrpgIuZgKAAA3MAv1AJhWgAgUA0Q9sEAjkIhAqYASAAOdCByvQBIAA6+BzGXAEgADy +gsgVoBg1AOdyDiL76QAAePspGOBtCPgKiICaFJwS7hYBLAAigAAAAACSECqykexUAAnYBIAAWXzN +ZKYv8oLGFaACBQDRDwAAAAAAK+IYC5tS7hYBJf85gAAa4FriFgAp2ASAAOqisyrgBIAAWXy/ZKRZ +IiqAonKSFSIg3hrgUtsw6qK1KuAEgABZfLj7QEEAEgCdABrgTNsw6qK3KuAEgABZfLL7QEFoEgCd +ABrgRtsw6qK5KuAEgABZfKxkppQa4EHbMOqiuyrgBIAAWXyn+0BC4BIAnQDBOPJAHrhiAJ0AaScj +ixUjtN2LEPqCxhXgAgUA0Q+SECqyiexUAAnYBIAAWXyaZKbbixD6gsYV4AIFANEPAACSECqyl+xU +AAnYBIAAWXySZa8S+iBoHaALtQBYtNT6ACId4AMFAOqzOAUBiYAA6hICK1gEgABZedLDsOzgHh0o +BIAA/KBoHeAKVQBZfSTIWRzgGo0RDFw2LNYXZTTgjRD8gsYV4AIFANEPLkByZO61khAqsq3sVAAJ +2ASAAFl8dmWuovogaB2gG2UAWLS4+gAiHeACBQDqsjgFAKmAAOoSAitYBIAAWXm2LH0DKsUoZSSM +jRD8gsYV4AIFANEPAJIQKrKf7FQACdgEgABZfGJkovsa3/fbMOqiiyrgBIAAWXxdZa5A+iBoHaAL +VQBYtKD6ACId4AIFAOqyOAUpmYAA6hICK1gEgABZeZ4sQHPxgCju0gCdAGSlFYoU+gCiHeAM1QBY +tHzSoNEPkhAqsqXsVAAJ2ASAAFl8R2WutPogaB2gGyUAWLSKZKPzK0By+2BEIBIAnQDqEgIrWASA +AFl5iCxCF4sQK0YWCsw2/ILmFaACBQDRDwCSECqyo+xUAAnYBIAAWXw0ZKJzGt/J2zDqop0q4ASA +AFl8L2WuVPogaB2gC+UAWLRyZKOT6hICK1gEgABZeXMrfQIqtRSLEPqCxhXgAgUA0Q+SECqylexU +AAnYBIAAWXwgZKJ6Gt+02zDqoqEq4ASAAFl8G2SjtxrfsNsw0w/qoo8q4ASAAFl8FmWt7vogaB2g +C3UAWLRYZKMtK0ByZLfyGt+lixLqotsrYASAAFl8DGWm5ytAc8DIDLsCK0RzixD6gsYV4AIFANEP +AACSECqyq+xUAAnYBIAAWXwBZKI/Gt+W2zDTD+qijSrgBIAAWXv8Za2G+iBoHaALZQBYtD5kosUr +QHJkt3ka34uLEuqi2ytgBIAAWXvyZKeIK0BzLAr9DLsBK0RzixD6gsYV4AIFANEPAJIQKrKT7FQA +CdgEgABZe+dkogca33zbMNMP6qKHKuAEgABZe+Jkowoa33bbMOqipyrgBIAAWXvdZKw/Gt9y2zDq +oq8q4ASAAFl72GWsLMCl/b7gBaA7BQBZfHYa32qLEuqiyStgBIAAWXvQZaQYixErshgLmVLImWiS +B/kgBPnSAJ0AjRGMECvWGPyCxhWgAgUA0Q+SECqyg+xUAAnYBIAAWXvCZKG7Gt9X2zDqooUq4ASA +AFl7vWWsjPogaB2gCyUAWLQAZKHLGt9OixLqotsrYASAAFl7tWWsa4oU+gBCHeAM1QBYs+HSoNEP +AAAAAAAAAOoSASpYBIAAWLP7zayCFSIg3mP8FwAAAOoSAitYBIAAWXjw9UAq8pIAnQDHL9EPAPog +aB2gC/UAWLPlZKFi6hICK1gEgABZeOfoEgAjyAsAACqVFfiCxhWgAgUA0Q8AAPogaB2gGxUAWLPZ +ZKEyKkByZKXUKUBz8T/ez5IAnQDxP96P0gCdAOoSAitYBIAAWXjVLUIYHN8j+6EADrA7BQD8gwYV +4ApVAFl8JYsQ+oLGFeACBQDRDwD6IGgdoAulAFizw2Sg2i5ActMPZOTl6hICK1gEgABZeMMvQTb7 +4A8CogCdAIoU+gFCHeAM1QBYs6LSoNEPAAAA+iBoHaAbVQBYs7NkoJrqEgEqWASAAOwSAitoBIAA +WLM6ixD6gsYV4AIFANEPAAAA+iBoHaALlQBYs6dkoGooQHJkhIga3vWLEuqi2ytgBIAAWXtbZaHN +K0BzjRD8gsYV4AwVAAy7AvqOZh3gAgUA0Q8AAAAAAAAA+iBoHaALFQBYs5XKohre5IsS6qLbK2AE +gABZe0tlqsOKFPoAIh3gDNUAWLN30qDRD8Cl/b3CBaA7BQBZe+XAINEPAAAAAAAA+iBoHaALhQBY +s4P6ACId4AIFAOqyOAUBSYAALEByDwIAZMP5Gt7U6xICK2AEgABZezRlof0tQHPA6A7dAi1Ec2Uv +pY8Q/oLGFeACBQDRDwD6IGgdoBsFAFizb2SviihActMPZIOE6hICK1gEgABZeG8pQhmLECtGFgqZ +NviDJhXgAgUA0Q8AAPogaB2gCzUAWLNhZK9SGt6wixLTD+qiwStgBIAAWXsW4960HQO2AACLESuy +GAvJUciZaJIH+T/tkdIAnQCOEYwQA70BLeYY/ILGFaACBQDRD2UvDI8Q/oLGFeACBQDRD4gVwJgJ +IgIihN74IEgVpyIBAPj6xhWv5VYAAAAAAAAA6hICK1gEgABZeEYqRTaKEPqCxhWgAgUA0Q8a3o2L +EuqiwytgBIAAWXr0Za09ixErshgLyVFokQpokgf5P+lh0gCdAB7ejAO9AQ7dAo4RjBAt5hj8gsYV +oAIFANEPihT6ASId4AzVAFizFNKg0Q8AAPogaB2gC0UAWLMlZK5ijRH9vPwFoApVAP2jCBXgOwUA +WXt7Gt5vixLqosErYASAAFl61ePedh0N1gAAixErshgL6VHImWiSB/k/5XnSAJ0AjhGMEAO9AS3m +GPyCxhWgAgUA0Q8a3l+LEuqiyytgBIAAWXrFZayDixErshgLmVJokQpokgf5P+OR0gCdABLeYPgg +KBWijgUArn4CsgIihhgt4N38IAgVoA8VAA/dAi3k3fyCxhWgAgUA0Q+KFPoBAh3gDNUAWLLg0qDR +D4gV+iBIFaAPJQAPLwLvhN4rWASAAFl39IgVIoDe+xuGHa/fDgCKEo0V+7yOBeAJRQAJKQL5u8Yd +4AwlAFl6n2ShqYoS+7yEBeAMJQBZeptkoZkb3j/6IEgVoAwlAFl6l2ShoIoS+7x2BeAMJQBZepNk +oZCCFfJb0BWv3g4AAADAsPggqBXgGAUA+EYADDNjRQDy4ABB8IwFAOiU3inQBIAAWXdt+HyCHaAL +BQD44ABDsIwFAOMWAyvQBIAAWXdmhRLacOVcAiMb+QAA7DQACtgEgABZd1Ub3hz6IEgVoAwlAFl6 +dmShNBveGfogSBWgDCUAWXpyZKEjG94W+iBIFaAMJQBZem5koSKKEvu8JAXgDCUAWXpqZKESghXy +W9AVr9wiAAAAGt37ixLqosMrYASAAFl6YmWq9osRK7IYC+lRaJEKaJIH+T/XKdIAnQAe3gKMEQO9 +AQ7dAv2DBhXgClUA/bv8BaA7BQBZevaLEPqCxhXgAgUA0Q+KFPoA4h3gDNUAWLJ+0qDRDy8qgK9/ +IvDewIEIIgL+IKYV5yIBAPP7xh2v2KoAAIoU+gICHeAMxQBYsnLSoNEPihT6AUId4AzFAFiybtKg +0Q+KFPoBIh3gDMUAWLJq0qDRD4oU+gECHeAMxQBYsmXSoNEPAIoS/N/AFaNrRQDrewgFUAkAAFi0 +E2P+TYoS/N/AFaNrRQDrewgFUAkAAFizU2P+VtpQ6xIDKeAEgABYtAlj/svaUOsSAyngBIAAWLNL +Y/7cihT6AkId4AzFAFiyTdKg0Q+KFPoCIh3gDMUAWLJJ0qDRDwCKFPoAwh3gDMUAWLJE0qDRD4oU ++gDiHeAMxQBYskDSoNEPihT6AMId4AzVAFiyPNKg0Q8AAGwQBCgiGPjgAAQwicUAeYEn9EIIFeeV +AQD1IAmpEAcFAIk3iprkkgklAKGAAItD7EIFJYRlAADJwcAg0Q+Nc9Rw7nIFJoQdAABl7+wmIAf6 +QGgdoWYBAPrAaB3gPAUAWDArZKHUi0MpQgUPAgD1YAd4EgCdAGSRX/tC5h3vjgUA/0AmHaj7HQD/ +QsYd6P8dAP9Cph3o/x0AL6QULSIW/UPmHejdHQD9Q8Yd6N0dAP1Dph3o3R0ALaQcHN2EDGoR/UAA +RTAJVQCZoCogFvpA8BXg+PUA+UbGDaAZ9QD5uvoFoqwFAAy8HajIKIJ/CpkM+QALemIAnQAf3Xf1 +QAAWsDgFAOjdAg33AoAAr+6d4Ik4jEfqMgkkgJGAAJc7maCLOJqxJzYIJzYJ7t1sFgBpgAAtIhgO +3QItJhiKN/oAYh3gDAUA+0QAFaANNQBYWovAINEPizhkvslj/94AAAAAAAD5P/ig0gCdACekAC1S +E7Hf/qJmFejtHQD9Q2Yd6M4dACykGf9DRh2ozB0ALKQYKVIQHd0wsZkNnQL4ogYV6IcdAPlAxh2o ++B0A/0CmHejvHQAupAQnpAf9QmYd6M0dAP1CRh2ozB0A/UImHajMHQD9QgYdr/qWAADE0C2kAIxG +/UDmHajMHQD9QMYdqMwdAP1Aph2ozB0ALKQEKVIT+UNmHeiZHQD5Q0Yd6JkdAPlDJh3omR0AKaQY +iET5QmYdqIgdAPlCRh2oiB0A+UImHaiIHQD5QgYdr/kKAI44Ze35iS4a3SbqNgsh+IEAAO+WASFA +4QAAmDmZOP5BxhXgAgUA0Q8f3R8KrQoe3R+vzw/dC67dK9F/K7zQB7s1+6/kHe/6PgAAbBAEJCIQ +ZEB1KDAYKTAZKyIW6jAaLEYCgAAJiALpMBssRgKAAAqIAgiIEQmIAuuJB3XIBQAAKSYWKSIY0w/q +3QkUwCiAAAqaASomGCswECwwEe0wEi3eAoAADLsC7DATLd4CgAANuwIIuxEMuwJosBIsQAUtCpX9 +gAhMYgCdAMAg0Q8ALjAULzAV6DAWL3YCgAAP7gLvMBcvdgKAAAjuAgjuEQ/uAv3Y4ABfyQUAi02N +t4jajtjs0gsm+IEAAAn/AersMC9IBIAA78wIBEDBAADo1gomYQEAAPuABYOiAJ0A/UAFzCIAnQCa +2Bzct/wACB2gCjUAbaoCCQJhKTAUKjAV7DAWLM4CgAAKmQLqMBcszgKAAAyZAgiZEQqZApnjKDAQ +KTAR6jASLEYCgAAJiALpMBMsRgKAAPsGAAwwDAUA7OYFLEYCgAAJiAKY5C8wBCgwBekwBi/+AoAA +CP8C6DAHL/4CgAAJ/wII/xH55gAPsA0lAO/mBilQBIAAW/7/Y/7tANpAWMJawCDRDw7KDAr6DCqs +cPuhBhWv/UYALPxA/aEGFa/9GgAAAABsEAgW3K7Apf25XAWgOwUA9NYoFaANBQBZeZkoYk75uP4F +4AUFAPEc4A3gBhUAmRUY3KWYFoxMLcEEjsD7v+AV7/U5AO/FBS3PAoAA6ekID78CgAAHlwwHAIf3 +gGQV5qUBAAqmYP1DQEdWdwEADPgRCJgMCCCHwKAKpmL1QAwPUgCdAH+5Cch2+uAMpCIAnQAY3I4X +3IrogigvzkKAAKmpJ3KrqYgJiBGod4l68yAJxSIAnQDy4AmEYgCdAJcU/bkGBaAKVQD84AgV4DsF +AP7gsBWgCQUA+CAGFeAPBQBZeWiNFPe47AXvmHUAKNQFitj29igV755lAP+gph2gDAUA7NYKJQC5 +gAD8IMgVoAolAPwgiBXgOwUAWXlZHdxojBQt0p4qwh6MwA3MDOwWByV8/IAAixQqshkrshj+7ggV +qAA9APtrAA0wDAUA++AABTANFQD7WgANMC8FAO6qCg+CCoAA+0AIFaC7nQBYWSGLFI23jNrkwAlm +0IEAAI7ZYAABwOCN4Q0NR/ugaB3gDAUAWFltjhWLFIoX7gAFBciBAAAJAmEJAmEJAmEJAmEJAmEJ +AmGIt/8EABXvyQUA+eAEB/AJBQDphgon+QEAAP8BBhXgDAUA/wEmFeANFQDqcgwtWASAAFhZAhrc +NSqiTrFV+r/yC6AGFQDRDwAAAAAAAO3BBCf4BQAADw9PL8UFffFcsNsMuRH5wABE//lOAAAACfsR ++0AARf/59QD/oAATNfsdAObuCA//goAA/88AD3AGFQD/34AVpLsBAOjiAC2BCoAA78EFK1gKgAAJ +uQMJiAEIuwKb4P+ACBWv/loAwPAvxQX//mgNoA8FAABsEAyIIs6PKSIYGtwSF9vk9iBmFeGZQQDn +2+Yc3oKAAOsWAizPgoAA+yAARLAb5QD4IIYV4ARaAMAg0Q8uUhsc3AaurnrrAbGILlYb+KNGFaAI +BQAd3AKKGA2qCgiNCejcABRIBQAALiEHCJkCGNvRDg5KDO4RCO4CnkAY2/qOIPiARhWgSAUAmEMY +2/cO3REt3G/5xgAMNN0dAOhGBC92AoAADt4CGNvxnkEqoqEuYiUpRhQZ2+8IqgH/zwAPcAgFAA6Y +OY4SCO4CDqoCDKoCmkeKFigiFYkpqojqmQgEQMEAAOgmFSTIwQAAmSmOFwzuEafuLead+ELQFa+a +hQAqNAUqIAf/t44F4Pn1APkFZg3irgUADq4dr+8v8n/BnwiZDPngIzJiAJ0AHdvSCI8Q778CDU8C +gACtmZ+TKWImKGIl+QAdtGAb5QAsIAcMDEEMyBGniCqCnpwYnBf7QCDD4gCdACSCnY0T+iCIFeAZ +5QDoRAACIBmAAA0Ah+uyqCJ5gQAAnxVtmgIIAmGINyoiF40pjoqGjokqJYIJ7GImJxqhgAAoYiUu +YiwNmQwMiAwO7gkF7gsKiDYoFgvouwgHccEAAOsWBiXYwQAA6xYALGAEgAD7IBRr4gCdACogFhnb +lf5A8BXg/fUAfaF5HduilR70IaYVoqUFAAX1HQqkCq1dqVUFRAsV252THKVE5dJ+JRhBAAD6YAQA +0AMVAAA5GglVASnSfwWZAinWfyVCfwChBOMSDCnQCoAA5BYBIqgFAAAlRn8t0oCEHYUe+6AX2KIA +nQAd24cM+RENmQgpkgAJqgFkov0qXDjqBgACSKEAAPiCaB3gD1UAL0QgLTIb/IZmHejdHQD8hkYd +6N0dAPyGJh3o3R0ALUQwKmIk+obmHaiqHQD6hsYdqKodAPqGph2oqh0AKkQ0KSIW+IfmHeiZHQD4 +h8Yd6JkdAPiHph3omR0AKUQ8LWIo/IjmHej9HQD+iMYd6P8dAP6Iph3o/x0A70REJugFAAAtZigq +YicpYib4hOYdoA8FAP6EJh3o2B0A/ITGHej9HQAvRCX5QABFeN8dAC1EJPqJZh2oqh0A+olGHaiq +HQD6iSYdqKodACpESC9iJQn/DO+JCnJJYQAALfqALUQhKlIZDwIADwIA8VIADeANBQAtZiAtZiwK +ijbqRhUi4aEAAAwgiAkEii9iJqr/L2YmKVIZCowMKFIaCpkM6VYZLOUmAADxl5AN4AgFAP7ECBXg +2AEADvoKjxWKoA/ZCgrKNpqQKWIgDpkL798LBMghAADpRgAH+CEAAA8IiiliIC9iJg6ZCqr/L2Ym +j5AK/wyfkC9iIA75ComQsYjqzAwEgSmAAA7+C4XjHNsWj+KlpZXjelsBsf+f4v7EyBXv8QIAAAAA +APHjcA3gCgUAKWIsLuwY6mYgJMgFAAD4xYYV4A8FAIkVKpwY/U0ADPDYAQDpFgUuew4AAP22BAWv +/vYAwPEvZiD//2gNoA8VAACeGYsQ6BYKKVAEgABYN6qIG4wajhnrEgAlavGAAGP7si9iIA76Coqg +7v8LAmlhAADkrwNn+CEAAAqKNipGFQ9giA0MiiliICxiJg6ZCqrMLGYmj5AK/wyfkC9iIA79Co3Q +6owMBoLRgAAO/guP4xza4Yjir696+wGxiJ/j+cBGFaAIBQD+xMgV7+2eAAAAAP/ysA2gBQUAiDhk +izaJOcAgkjuYkIo4maGSOPJhJhWgAgUA0Q8c2s//+8ANoAgFAMn5LWIs/8MAFaAPBQDvZiAm6AUA +APzFhhXv+X4AwIH4xAYVr/lWAACNES3dAirRAinRAS3RBQqZAf0/6BrgChUAixjaIOu8EilgBIAA +WF1+wCDRD4sY2iDrvBgpYASAAFhdecAg0Q8AGdqqCI8KqekJ/wsZ2qip/4kWLfF/Cd0M/boAFeAJ +BQAJ3TX97+Qd7+4mAABsEAaLJycgB4i68wlgDeF3AQAjsgkFCEdogggpIHQImRApNgD9tVIFoApV +AO2yAilwBIAA/kAIFeA7BQBZd4P9tUYFoApVAPoGAh3gDUUAWXd/Ftpp9OASmhIAnQAMeRGmmSqS +nvdAFppSAJ0AJJKdZEKh/bUuBaAKVQD8YBAV4DsFAFl3ciowAMO0DwIA+0ASVGIAnQAqPQYloAHD +sA8CAP21GAWmVQEA/KBoHeAKVQBZd2bp2k0Z0ASAAPSgESCSAJ0A9KANIRIAnQD0oAzikgCdAMDA +CQCH6RYAKlgEgAALAmELAmELAmELAmEjIQcoIAce2nr+QQQV6jMBAPgCAAWxiAEA6rsQDEQCgADo +/wIJnwKAAAszAhjabxvaOw7/AggzApNAjSD+gIYV4DgFAPiAZhWgAwUAk0WTR/qARhXgCUUA7kYG +IliBAAD9oAAWsA5FAP+mAA6wDiUA7UYBLm4CgAAKIIYLAmMKAIbrDAABUMEAAA7dAu1GCSJZAQAA +CoCGCwJpCmCGCwJnCkCGCwJlDH8Rpv8p9p30oAqqkgCdABTaT/hBCBWvmnUAKiQF8pEoFe+ZZQD4 +QKYd4AYFAOYmCiQAuYAA+gBCHaA7BQDs2i8ZaASAAFl3HCsiHihCdiQiAOhEDAgECoAA82AEH9IA +nQArIgcpsgrkkO1l0IEAACuyCS2yAfQgCBXn3QEA+6BoHeAMBQBYVz7lAAUBSIEAAAkCYQkCYQkC +YQkCYQkCYQkCYY8n/+QAFa/IBQAI7gHm9goncQEAAO72CSpYBIAA/+EGFaAMBQD6YYgVoA0VAFhW +1sAg0Q8AAPxGUBWv+ZoAKiIZKyIY/m4IFagAPQAKuhgKCk8Kqg//QAEFMAwFAPtACBWgDRUAWFbI +Y/9TAAAA//W0DaADBQAV2dmKWPdABHiSAJ0ADHkRppkrkp73YAT6UgCdACSSnWRAlrCr+qEGFe/2 +bgAAAAD6YIAlr/bmAPwQQh2v97oA//xYDaALBQD9s/gFoApVAPoGAh3gDQUAWXbR6iIKKVgEgABb +/S9j/o2JJ4yay8+DmY0iZNBR/GAIFeAKVQD9s94FoDsFAFl2xsAg0Q8AAAD/9MANoAQFAMCgWXcg +ilj5X/tQkgCdAP/0ZA2gBAUAAP/+9A2gAwUAwEDA6g6uNP6hBhWv9AYAANog79ndGWAEgADvNgAj +2GEAAFhci2P/lWwQBoknIyAHKJIKAwNB55IJJA7xgAAFCEfogg1p0ASAACkgdAiZECl2ABnZkAw7 +EfRgDiISAJ0Aqbsssp73gBI6UgCdACuyneS0AAWPoYAAFtmDmhAT2YnmAAUKWASAAAsCYQsCYQsC +YQsCYS0gByghBxvZtvlAAAQwzREA6swQDEcCgAAMiAILiAKYQI4gw1D0gGYV4A9FAONGAi9mAoAA +D8wCnEErIDP0Q8gV4AMFAPxgaB2giJUAC4w58qAM35APJQAY2aMuIQiTReNGBy4uAoAA/qYACvHd +AQDoRgYu7AKAAA3uAvnGAA8wC0UA7kYEImiBAAAHIIYNAmMHAIYNAmGVSRXZkwyuEanu+9OmFe+d +dQAtJAWOKPSxKBWvmGUAKCQF4yYKJwC5gAD6AEIdoDsFAOzZcxloBIAAWXZgKCIeKVJ2hSDpVQwE +fdKAAIkni5rksOBk0IEAACuSCS2yAQ0NR/ugaB3gDAUAWFaG5gAFAUiBAAAJAmEJAmEJAmEJAmEJ +AmEJAmGPJ//kABWvyAUACO4B4/YKJ3EBAADu9gkq2ASAAP/hBhWgDAUA+oGIFaANFQBYVh7AINEP +AAAqIhkrIhj+jggVqAA9AAq6GAoKTwqqD/9AAQUwDAUA+0AIFaANFQBYVhJj/2IAAAD/+IgNoAcF +ABTZI4xI4xYAKAQKgAD3gAQ4kgCdAAyrEam7LbKe96AEwlIAnQArsp1ksI+wzZ1I5LQADfEuAABg +AA0AAAAAAAD//IwNoAsFANog7tlIGWAEgADudgAh2GEAAFhb9cAg0Q8AAI0q/bKEBaA7BQD9oAgV +4ApVAFl2FBnY/4oQ/EDwFeAPJQD8EaIdr/kOAAAAAP/28A2gCwUAwKBZdmqMSIoQ6dj0GAQKgAD5 +n/tAkgCdAP/96A2gCwUAwLDA6g7ONP6BBhWv/a4AbBAIiCcjIAeJigMDQeeCCSSPOYAABQhHaIIH +KSB0CJkQmXAqIDMV2OHyIKYV4AwFAPNAPA3gCwUAnBL6IIYV4ARFAPRgDcoSAJ0ADDkRpZkukp71 +wBgLogCdACiSnegWAyxQBIAA5tjNFBARgAD2AAgdoAMFAG1JAggCYSsgM2WyDSwhBy0gBxjZAvhB +BBXqzAEA/CAABfDdEQDq3RAOZwKAAO3MAg3cAoAAC5kCHdj3CJkCG9jCDcwCnKCOIJimk6WTp/tA +RhXgPwUAn6P5QIYV4A9FAOkSBC92AoAAD+4C7qYBJWCBAAAHIIYMAmMHAIYMAmEX2Of9IAAUsAsl +AAuZApmpiBXtIggsRwKAAKWI9ROmFa+fdQAvJAX08SgVr55lAC4kBeMmCiaAuYAA+gBCHaA7BQDs +2MMZaASAAFl1sCoiHihydoUgDwIADwIA6FUMBX3SgACIJ4mK6IIJJFCBAABkkMgtggENDUf7oGgd +4AwFAFhV1OYABQFAgQAACAJhCAJhCAJhCAJhCAJhCAJhjyf/5AAVr8gFAAjuAeP2CidxAQAA7vYJ +KtgEgAD/4QYVoAwFAPqBiBWgDRUAWFVswCDRDwAAKiIZKyIY/o4IFagAPQAKuhgKCk8Kqg//QAEF +MAwFAPtACBWgDRUAWFVgY/9iAAAA//hkDaAHBQAW2HGKaPdACriSAJ0AiRUMmRGlmSuSnvVgCyui +AJ0AKJKdZIFcsKv6wQYV7/jOAAD//MwNoAgFACggNSkgNiQgN+iZEQxEAoAACYgC+IYACjCIlQDk +FgIiIZ0AAPgghhWkRB0A9ICAFa/3bgCIJ4qKZKEEh4naIOvYjRlgBIAA63YAIdhhAABYWzjAINEP +AAAa2EuIEhnYhi0hCI4nKyEHLCAHju7+IAYVqrsBAPwgAAcwzBEA7LsRDmKCgADsuwIPdAKAAA7d +AhzYcY4TCd0CDLsCm+CMIOPmBSR5IQAAn+Pq5gIkWZ0AAP3AhhXkux0A6xYBLmYCgAAMuwKb4QcE +iQ4gi/nAxhXgugUAmucvIAz5BgAVoDwFAOjmBy/8AoAA790CAVjBAADt5gQnUKEAAFlxbIoTixDs +EgIlUWEAAFlxaIsRihMMuxH7QABFf/TSAAAAAAAAAP/0CA2gCAUAwKBZdYaKaPlf9RCSAJ0A//Os +DaAIBQAA//vkDaAHBQDAgMDKDKw0/MEGFa/zTgAAbBAEGthIKSIYGNhHCpkBKSYYLjIJ/wAWIKIA +nQAuIhMtMQsqIhQb2EEO3QgK2gztJhMlYQMAAHyzBR/YPXr7EvpAaB2gCwUA/AACHaANJQBYAgcr +IhIkCgDTD/NvkA3gPhUALbAwDQ1FftEvL7BIKLBJLCIW6bBKL/4CgAAI/wLosEsv/gKAAAn/Agj/ +EQj/Auz5B3ZABQAAKCYWKQoh+aAP7GAqJQD7oBCsICxVAP2gC0wiAJ0AftEXKgoC/bA6BaA7BQBZ +dOr0QkYVoAIFANEPLbAxLrA0irrxoAmWEgCdAC+wNeiwNi92AoAADwIAD+4C77A3L3YCgAAI7gII +7hEP7gJl4QgssFwtsF3usF4uZgKAAA3MAu2wXy5mAoAADswCCMwRDcwCZMDjLaIQLdIZ/aAG06IA +nQD9YOgVr52VAC20BR3XsYzO/AAIHeCZBQAJyQgJAmEJAmEvsFwosF3psF4v/gKAAAj/AuiwXy/+ +AoAACf8CCP8RCP8CL8YlLrBYL7BZ6LBaL3YCgAAP7gLvsFsvdgKAAAjuAuiiDy92AoAAD+4CLsYn +LbBELrBFGdfi77BGLu4CgAAO3QIusEfkxigu7gKAAA/dAuTGJi7uAoAADt0CLcYk6bYLJfCBAADu +hgAleOEAAC+2CPlhJhWgDSUA/0HmFaAMBQBb+5v0QkYVoAIFANEPAAAAAAAA9EJGFaACBQDRDwAA +KLAxf4ftLLBML7BNKiIQ7rBOLmYCgAAPzALtsE8uZgKAAA7MAumiFC5mAoAADcwCLaIVfJECLKYU +LLBQLrBRDwIA77BSLmYCgAAOzALusFMuZgKAAA/MAgjMEQ7MAnzRAiymFftgaB2gDAUA/ABCHeAL +BQBb/cf0QkYVoAIFANEPAAAA+2BoHaAMBQD8AEId4AsFAFv+b/RCRhWgAgUA0Q8AAAD7YGgdoAwF +APwAQh3gCwUAW/zU9EJGFaACBQDRDy8iEY/3j/4s8BAp8BEd15To8BIuZgKAAAnMAu/wEy5mAoAA +CMwCCMwRD8wCfNATDHtY/XAAFbWsAQD7RgANcAAeAADGqh/XZR3Xhi/yKC3Shqr/Cf8Rr90t3f4s +0n7AogrMAizWfhzXgPxACBXgOwUAWXRIY/zIAAAAAOsxCylQBIAAWLg/9EJGFaACBQDRDwAAAGwQ +BC4gBSgKdP8ACtuiAJ0AKyIYHtdx82AMA1A09QCNLIk2KjAgH9dt/GFEFaCItQD9IAp9ZaoBAP9m +AA3/+cUA6yYYJmNtAAD5gAQGd/sBAPngBhwiAJ0ArNiYLPVAB74QKTUA+UAHfGArZQD7QAc8YCxF +AP1ABvwgPSUA/UAGvGIAnQD1QAZ8IgCdACswMCwwMR/XTu0wMi3eAoAADLsC7DAzLd4CgAANuwII +uxH9ZgANv+mlAPvioB3oq7kA/VAAFTWbAQD7JgAMsAAWAAAb1x4a1z8rsigqooapuQmZEampK5yA +6yYSJMrBAAAqPCAKQIYJAmUKIIYJAmMKAIYJAmEsIhgOzAL8QwYVoAIFANEPAAAAAAD+AGId44vh +APn/+a4iAJ0AKzAkLzAl6DAmLd4CgAAPuwLvMCct3gKAAAi7Agi7Ee+7AgZIEQAA+y0ADn/8GgAA +KSIRiZf5IcgV7/42AAAAAP2uPAWgClUA/EAIFeA7BQBZc+EqIAUrCnh7oRL6QigVoAsFAPwAAh2g +DSUAWLWhwCDRDykiEsmYiZf5IcgV4AtlACo8IG25BQpghgkCZ8Ag0Q8pIhGJlysxC4mev7sLS0vl +v91kyMEAAGP/wmwQBBvXAyoxDNMPK7J/HNcB+GIQFeAUZQD7Q/YN4AUFAHyhF+okAArYBIAA7DQA +CmgEgABYtcjAINEPAGiRQWiSIWiUCcBA//9kDaAFBQB8odF7q87aMFi19tWg//8QDaAEBQD9QOYN +oBRlAHujAmAAAcBA2jBYtgL//pwNoAUFANowWLYT5aQABQERgAD9rcQFoApVAPxgKBXgOwUAWXOj +//38DaAEBQAAAAD//dANoATFAGwQBCkwE/EmcA3g9YUAaJEDwCDRD4QnDwIAhE4c1tP8YjAV4ogF +AAhICC2E3/5iUBWgClUA/xwGHaA7BQBZc478YjAVpHpFAOpKCAHYYQAAWW/CpTv8YlAVpVpFAKpK +WW+/6iQAClgEgABYtlbAINEPhCcPAgAPAgAkQg4c1rwtMBEtRAL+YlAVoApVAP6AZh2gOwUAWXN4 +/GIwFaHKhQDqSggB2GEAAFlvrKU7/GJQFaKqhQCqSllvqcAg0Q8AAGwQBIg3FtaqiI70wBAV4okF +APkAAEHwB3UA9npGHeAENQD0emYdoAcFACc01PZ6ph3g8vUA4lEPcsgFAAAnNNYlNNcpZADRD/zA +MBWgCxUAKzTX/HrGHaAKJQDqZAAmYAUAACxkAdEPbBAEjzj9rSIFoApVAPxiEBXgOwUA/+BoHaH/ +8QBZc0wpMBD1IASokgCdAGiSA8Ag0Q8S1oeDNiIifwkzEaMiiiqLLYqoj7ctohj94QgVoI7FAA7d +Ai2mGIj6jvvz5AAV78kFAOkzAQZowQAA4+4IBEDBAADo9goncQEAAH3jeP+gBDQiAJ0AnfgY1hjo +AAUOSASAAAkCYQkCYQkCYfOABhWgCQUA+YJEHeANJQDpxREs4ASAAFi1scAg0Q/aMFi2v/9WkA3g +DXUAi6eLviyyjgyeVn7QGfwAYh3o7LkAftAO+2BAJeAMBQBYtonAINEPWLXqwCDRDwAM6AwIOAwo +jHD54QYVr/4SACk8QPnhBhXv/eYAbBAEiC4jLDhzgQOJIsiUwCDRDwAAiy6Is+xEAAroBIAA67zg +KVAEgAALgACMLnPB3Y0iZN/eY//VAAAAbBAEKiIUKSIT/avQBec1AQDqmQwBlB0AAGSQkCwgBwwM +QQzKEa2qK6Ke92AFEVIAnQAqop3rpAAFBQGAABXV1xTV7R/WMAUAhwoCYQoCYS4hBxjV1/UmAAo6 +7gEA6tXXH3cCgAAI7gKesP5ACBWgGAUAmLOaspS1/8YAD/AEJQDvtgQvdgKAAATuAp6x5QIVBdBh +AAAKAIoMyBGtiCSGnS8iFKn/7yYUIZR1AACKJ/oAIh3gDAUA+0QAFaANFQBYUwLSoNEPwCDRDwAA +AAAAAP/9hA2gCgUAAIsiyLVoMhTAINEPK8wY6iQACWAEgABYWJ5pMuqMJ47Kisn9hAAV788FAO/d +AQdwQQAA7sYKJVPBAADqxgkm6QEAAH2rKYjLqoqayRzVqZygiyD5q+4F4AwVAOmmAi3eAoAADLsC ++0AmFeACBQDRDxzVoJygiyD5q9wF4AwVAOmmAi3eAoAADLsC+0AmFeACBQDRD2wQBBzV5y0yBv5h +ZBWgClUA/mPwFeA7BQBZcp4sMQskIhGILBrV4IVHrIiYLIlMwLD0ocgV4A0FAOqeAgSQRoAAnkz8 +g2YV4AAqAAAAACtCG+taCAHYgQAAWW7HLkIbLTELrt0tRhsqUAQrUAXpUAYtVgKAAAuqAuhQBy0u +AoAACVUC7NXJGq4CgAAIVQL0oGAV7/jFAPigBAKwOwUA/qBoHaAKVQBZcnspIhMoMQsrQhupiOgm +EyL4wQAAf7EJwCDRDwAAAAAAABzVuIpMDKoB6kYMKVAEgABYtmr6QGgdoAsFAPwAAh2gDSUAW/9p +wCDRDwBsEAiIIicgBykiFJkT8RL8DeF3AQAa1alkkQEW1UwqoIAMeBHmiAgFUN0AAPkTyBXkqh0A +qkrr1UsVUAkAAPsgCfOgDKUAKIKd6BYEJAnZgACNuPegCjiSAJ0ALmKu8c9wDeAJBQAqYq3koO5m ++/0AAO+2CCUHiYAAKyAUpLsLC0crJBT1YAleUgCdAIs5iRT4YgAVp8UBAPmACpFWux0A/IHgANAF +BQCwSm2pBQgAhgkCYYkTGtWCiZDoEgQiY/0AAOqZAgzuAoAADc0C/QAmFeAKBQBtuQfphgYkQQEA +AIgU6zIBLk8CgACpiJgV6TICLYwyAACaEPNgDThSAJ0AixDrSwgL5wKAAObMCAXb/QAA68adKpAE +gADRDwAFDEdowhiKJ/qAaB3gDAUA6qwgKmgEgABYUkzSoNEPwCDRD+okAAnYBIAA7EQACugEgABY +V5fSoNEPAADAoAzeNO62CC14vgAAjyJl/9TaIPxAaB2gG8UAWFfkY//EAAAAAAD/+xQNoAgFAIgi +ZY+yK3wY6iQACWAEgABYV9tj/6HAoFlyXhvU8I24+b/1eJAMpQBj/7ItIQn+QrAVr/8FAA+/AQ+4 +DCgkFO+kAy9xAoAA6aQALu4CgAD/pgAOsAwVAAzdAp2h/NWmFa/6kgAAAI4nnhGF6fnBSBWvyQUA +7OILJ2iBAAAJ2QGZEunJCApXAoAA6ogMAqhBAACV6ejmCiTJAQAA+KAIYuIAnQBoq0GlrCzM8P0g +BNuiAJ0A7xIEIgyFAACwTm3pBQUAhg8CYYzRDwIADwIArKzo0gImY8EAAPmABuRiAJ0A7NYBLigE +gABljj9gAKAAAOsSBSzgBIAA7BYGKVAEgABb4wOJFogVizHqFgAtbwKAAK2I8X/zCFIAnQDaIOyU +AAxYBIAAW+LSjhDurggKkASAAO5OCAv/AoAA5v8IB3P9AAAu9p3RDwAAAAWZDPwgiBWk+R0AbfkF +BSCGDAJjjBIPRQyPFCzMQOn/CAKMPQAAsFhtiQUMQIYPAmWFEozSCagMqFUlXDDl1gEubQYAAIkS +wKDq1gIkyQEAAPmgJhXgBQUA+aAGFe/2EgCOEQxVDPXBJhXv+74AhRIlXED1oCYV7/yeAAAAAGwQ +BB3UpRrU2w8CAC3SHSyixyqhcKPd6joMDu5CgAD9gABGcAsFACvEBCvEBVjxPfpAaB2gCwUAW/Bq +0Q8AAABsEBYrIAcjFhrlFhcqSASAAPghJhXgChUAmh8V1McmEhr8IugV4bsBACsWFodl+MCIFaP+ +9QD6uAQVp90BAPbB5BWgd/kA+AoAAbDIWQD8I2YVrEgdAPqPAA0wtnkA+iJmFe+qAQDqFhQkVEqA +AAYLSfohxhXgACYAAAAAnh4uEhotFhUv4T0o4B0oFAAvFhIu4h8uFhD1oDshEgCdAIki+yBCYJIA +nQDw5WAN4AwFAOwWESOASYAA2kBY2sX0AAId4AYFAC4SG9pw/ABiHeAMJQDu3DkJ2ASAAFjas/dA +AEMwD/UAdvBV9CEGFaSGHQDjFgckQAUAAPgjBhWgAT4AAAApEhJkl3cqEhqKpX2mn/wiCBWgCxUA +6xYRKlAEgADrEhIo6ASAAFja2manqfwAYh2gBQUACsU6ZFeTw2CUGPIg5hXk1h0ALRYYLxIWHtQh +E9Qa6RIYL6AEgAD14AhyEA2lAAz2EaNmKGKe+QBDA+IAnQAmYp3bYOa0AAW+QYAAj+ibFffgPniS +AJ0AKDKu0w/qEgkkPJGAACsyreS3iWfL/QAA6eYIJbxhgAApIBTTDw8CAKqZCQlHKSQU9SA9ZlIA +nQArEhsuEhTxYMAN4A01AP+gQAiiAJ0AZFDFjxcPAgDI8WRQY+tkAAlQBIAA/ABiHaAdhQBY2tDu +Eg4teASAAOYSCCKvWYAAKBIT+6faBeAMBQCc8pzznPSc9etrAg9UAoAA6/YALECCgAAKiALs1EIa +zsKAAPkGAAxwClUA+eAmFaAbxQBZcPEtEhX5oDqpUgCdAMAg7hIYKn8CgACj/y72ndEPAAAAAAAA +j+j34DtgkgCdAOkSGCo3AoAAo2YoYp75ADu74gCdACtinea0AAW7oYAAsPiY6PrAaB3v+2YAKhIR +ZKB66xIFKVAEgAD8AGIdoB2FAFjaoCsQABbUHh/UH44YJmL6GdQe/8YAD3H7HQDmtgsP+wKAAOn/ +AgX8pIAALBIQ7RISI1v/AAAosj8rsX2eoJ+hnaKco5uk+UCmFaAAdgAAACwSEC0SEithBYhjnqCf +oZuimKOdpJylJqwYLRITjB4C3RDtFgouZAKAAOwWCyum/gAAGtOh+CEIFaAPBQD+IMYV4A8lAJ8d +CogCKBYM62QACVAEgAD8AGIdoB2FAFjadI0cLxIaiRYrEhqP9fE1YA3j/vUAHNPyi7T/QEYVoI+Z +AP1ABhXgb4kA/UAmFaDfoQDw0AATMM+RAO7T6h7pQoAA7qYDLEECgAD9BgAMebsBAOumBC5gwoAA +DGYCCGYClqWMHemcASUwYQAA6RYGJmP9AADsFg0ue7YAAOtkAAlQBIAA/ABiHaAdhQBY2lEW09WJ +Go8b+iGIFeANBQCdEZ0SnROdFJ2k/UCmFe/+9QCeop6jm6AuEhrp/wIKxsKAAOj/AgDgMQAA5v8C +ANghAADtHBAlMGEAAO+mASDQEQAAWNkqwMHqyjkNKASAANmg6hYeIqHZgAAkFh/+ACIdoA0FAAnt +OOUWICbrUYAAE9O3iBuMGhrTtisSG4QYFdOv8XgAFLAOFQDr6zkKJ4KAAPSGAAp2DwUAC685/SYA +DLANNQD5JgAMMAwlAAvcOSwWHQn5AikWGfnmAA+wBQUA/iOGFeADIgAPVlD+GAAF8M/JAPwhiBXg +j7EA/UAGFeDveQDs7hEMRAKAAOvMEA3agoAA7LsCCzPCgAD4xgALMM+BAP2IABYxj2kA7O4CDEUC +gAAI7gIc04mcoSgQAAbuAvvGAA9wb7kA9MgAEzu/AQD3xgAPMAYlAObuAg3dAoAA7qYELEICgAAL +iAKYpRvTgZuiGNOB+UBmFa/5pgAAAAAAAAAAmaGUoJ6inqOepJ6lnaadp52onakvEh3lXAElMKEA +AP6gEZxiAJ0A62QACVAEgAD8AIIdoC2FAFjZ5eRQUWrOwoAA9KAKYJIAnQArEhzH7/smAAzwDQUA +45kCC/0uAACNEywSGo4SjxGLzCzCEJmhm6n1QAYVoAgFAJiimKafo56knaecpYwU/UEGFa/+JgAt +EhssEhkb01gMmQLrmQIGhBmAAPDiQA3v/vUAmaGUoJ6inqOepP9AphWgDQUAnaadp52o/UEmFe/9 +NgAvEhoiFiEr8hYm8Tgi8Tos8hXo8TkrNAKAAAYiAibxOy3yG+7yGixEAoAACGYCKPIXL/IZn6Ke +o52knKabp5iolqWZoZSgkqnyJCgVr/v2AAAAAAAAAADw4kAN7/v1AJmhlKCbopujm6T7QKYV4AgF +AJimmKeYqPlBJhWv+zoALBIajRIvwTsmwTkowTguwTrrwhgrNAKAAOb/AgxEAoAACO4CJsIUiMws +whCbpJinlqiZoZ2ilKCco5+lnqmMFP1AxhWv+hoAKxIb7BIZJYNRgAAb0xbH7/0mAAywDQUA65kC +A4DxgACZoZSgnqKeo56knqWdpp2nnaj9QSYV7/kyAC4SGiIWIS3iEiziEyviGIjthu4v4hSC7y7i +EZ6inaOcpJulmKaWp5+pmaGUoJKo8iQoFa/4VgArEhzH3/smAAzwDAUA45kCA4DxgACZoZSgnaKd +o52knaWcppynnKj9QSYVr/eaAJmhlKCOE/4gKBXgCAUAmKKYo5ikmKaYp5ion6X/QSYVr/cKACoS +GhnS6IqlE9J8JRIg5BIfJUwwgADj0ngThVmAABzS4osYDLsC+z9GFe/nwgCFH8DS960ACv/oRgDA +pf2luAWgG8UA7k4RCmgEgABZb39j+IcAAPoiiBWgDgUAnhGeEp4TnhRY2C3IqfoiiBWgCwUAWNgi +wKBZRRskFh/lFiAlYaGAAB/SvC/wFCQWH+UWIC/hHgAA+6WMBaFLFQBZY48s6v8MrAH7pYQFoUsV +AFlmoyQWH/QkBhXv7/IALRIQZdiBY/gmH9KYjhgP7gL/P0YVr+UmAMCgWUUDyKkY0qbTDyiAFGSA +XCoSFFjYDOkSHi1dbgAA+iKIFaALFQBY1//4I8gV7+5qAAAAAAD/38QNoDYFAOsSEipQBIAA7BIQ +KOgEgABY2Mlj+D8AACsSGowZ7RIXKVAEgABYVMjSoNEPAAAAAPulNgWhSxUAWWNjLBoADKwC+6Us +BaFLFQBZZndj/4MAwLAN+DTo5ggtw+YAANog/EBoHaAbxQBYUM1j/6orEhbaIOu8GClgBIAAWFDI +Y/+XwKBZb4we0h2P6Pn/wTiQDaUAY//HjB8tIQn+QrAVr/8FAA+fAQ+YDOgkFC9xAoAA/2BmHeAI +BQDotAAu7gKAAA7dAgzdAp2x/HWmFa/ghgCKJ40ZwMDqrCAu2ASAAFhPSNKg6xIYKmcCgACjzCvG +ndEPAAAAAAAA/96MDaAGBQD/4AgNoAVFAMCgWW9qHtH7j+j5/8RQkA2lAP/imA2gBgUAAAAAAAAA +/+IwDaALBQAN+DT5wQYVr+I2AAAAAAAAbBAGKCAFLSAHwZQPAgD5AA61Yd0BACkiAmWRky4wARbR +4f/BQAbQDKUALyBOZfJX7tHjHsgEgAD1oAnSEgCdAAzaEaaqKKKenRD3ABGU0gCdACqineekAAUN +AYAAi+iZEfdgDTCSAJ0ALWKuZNFYKmKt5KFUZfv9AADv5gglCrmAACsgFKS7CwtHKyQU9WAMvdAN +BQAY0cUf0eSOIP3lxhXgC0UA6O4CD1YCgAALqgIb0iwu9jTq9i0r6ASAAOsPHg3QBIAADQJnC0CG +DQJlCyCGDQJjCwCG7QwAA9kBAAAK4IYd0iALAm8KwIYLAm0KoIYLAmsKgIYLAmkqIQkvIAcuMAEo +MQErIST+IAAHMP8RAOr/EA90AoAAD+4CDrsCH9ISLiEiDbsCK3YgD+4CjSAqdiP45IYVoJqFAKp6 +GNILLnYi/aAAFrAOJQAO3QItdiGLMyt2JQgAiQoAigyaEaaq/VOmFaeFAQD5AAeZUgCdAMAg0Q+L +6J0R92AI0JIAnQAMmhGmqi+invfgCYTSAJ0AKqKdZKEnsL+f6OekAA117gAA/CAGFeABRgAAAAAA +6iQACdgEgADsRAAK6ASAAFhUEdKg0Q8AwKAMuDTo5ggtdY4AANog/EBoHaAbxQBYVGBj/8oAAADq +JAAK2ASAAFhVntKg0Q8AAIsQ2iDrvBgpYASAAFhUVmP/pMCgWW7ZHtFri+iJEfl/8nCQDKUAY/+y +AAAAAAAA+EKwFa/+BQAOvgEOvwwvJBQvIQntpAAsQQKAAO6kAy/+AoAA+eYAD7AOFQAO/wKfof7V +phWv+OIAiifrRAAKaASAAPtEABWgDAUAWE6T0qDRDwAAAAAAAP/3RA2gCgUAwLgLmwL6QEYV7/x+ +AAAAAPwgBhXgCgUAWW60HtFGi+iNEIkR+X/2kJAMpQD/+5ANoAoFAAAAwKAMvzT/wQYV7/tWAABs +EAgpIAUmIAfnNAAJwASAAPoCgh2gAzUA+yAOvSFmAQAFCUfl0S0UlFEAAIwi5GQABgORgADAINEP +AAAtIh1l0cmJJwxNEZ0TiJr/IWgV784FAOuSCCTggQAADs4BnhKr2q7/rYjolgon+QEAAPvgDVOi +AJ0AyXLJQAu5Am1JBQcAhgkCYY0TisCtqv9AEeRiAJ0AmsD5YGgdr/5KAAAAAAAAAOxqEQMkoQAA +BaoILqKe98AKcdIAnQAqop3Prtog7CQAA1hhAABYU/LAINEPF9EIiXiYFPcgD/CSAJ0ADEoRpaor +op73YBA50gCdACqineSh/mTb/QAAm3hkr78Z0QuZoI4g/aLOBeAPFQDvpgIvdgKAAAPuAp6hjoMt +0n8b0PL9or4FqO4dAK7d7aYDJUhBAAD8AAoVoAgFALGI6YMeDA/oAACbpvmirgWgGQUAmaeYqI8g +CP8RA/8Cn6nv0OUadwKAAKXuI+adiyIsIAb4QOgV4A0VAA27AusmAiZgBQAA7CQGJMiBAACIkYyS +/aKOBe/LBQDrmwEEQ0EAAOiWASZgwQAA7JYCJdkBAAB7iyCMk6jImJGfgI4g7YYCL3YCgAAD7gL/ +ACYVoAIFANEPAAAf0MifgI4gHdE07YYCL3YCgAAD7gL/ACYVoAIFANEPAOokAArYBIAAWFTo0qDR +DwD/+tQNoAoFAPqwyBXgGpUA+iAmFaACBgDr+gwDgbmAAApOFO3sCCvABIAA7U02DcgEgADTD23Z +BQgAhgkCYYkSqnjuTwwEyQEAAG35BQgghgkCY44TjRIK7gyu3S3cQP2ABhXv+L4AAChShC+ACCmA +B/ggBhXgqiUAevEuGNC3iIDAoAuAAIoQiREKmQzpFgEk7WmAACtSgn+3CSxSgn/PxmP9mQBZaBxj +/+8vgQsv/PgPD0Pv/Pwk8/0AAA/pOPggBhXv/uYAAIgSKIxA+YAGFa/3BgDAoFlt84l4iBT5P+/I +kgCdAP/4OA2gCgUAwKDAugubNPrhBhXv9/4AAAAAbBAIiCeJIvxA8BWvxgUA6oILKl8CgADrOwgE +QIEAAAaIAflAAEQwDzUA6IxALegEgAD5YCCSocwBAC7QB+3QZR6oBIAADMsR6uwDJzv5AADtuwgE +gEGAAMAg0Q8osp6aEe7QYhdIGQAA+QAfG+IAnQApsp0sFgDmlAAEnvmAACniCPcgHzCSAJ0ALNKu +ZMOVKtKt5KORZMP9AADo5gglHLGAACwgFCtQB6y7CwtHKyQU9WAendAOFQAZ0H4e0LyLEIogiDTs +0Ecd3wKAAO27CA1WAoAA8QAE+l/NBQAtIAcjUQH/RgAMcN0RAO0hJC7SgoAACaoCmGGaYBrQMvzA +RhWgGIUA+MBmFaAIJQDqAAUDUEEAAG2KAgoCYSwhCfpA8BWgCAUA+MCmFaA/pQDjZgkuZQKAAP+G +AA5xqgEA7GYGLVQCgAAK2gIOqgKaZCghCfpAaB2gDAUA/qAkFaAJNQDptp0sXQKAAP9mAA3wDQUA +WFQ5wCDRD48nsX4OrgKJ++kWAif4gQAADf0BnRWtme1cICTJAQAAedMEiBII3QyJ0Pj4AATwiBUA +eJkanmHp0IATw/0AAPjABhXhiB0A+MBGFaAATgAAnmEZ0HqZYIjRCFgUmGIY0HiJNh3QePkQCBWi +mR0ADZkBjfGpiJhjiPPvEgUicAkAAAzuEa7dr4/oFgMn+QEAAH/TAgjdDKdIsogMiBHuiAwL9wKA +AO3pCAQCIYAAKGwQmBT54A8S4gCdAA3/DPkAaB3krx0AbakFDQCGCQJhiRUKfQym+OqMECTJAQAA +bdkFCSCGCgJjiiDTDwiqERjQUq5p/6CuBaAPFQD/IMYV4A1FAA2qApiUGNBOmpWKUyiCfhbQTf+g +iAXoqh0Aqojolgck6IEAAP4AChXgCgUAsartgx4ND+gAAP0hRhWgKgUAmpuPNIhTijUG/wH3oIAF +p4gBAO6qAQxCQoAACP8CBv8Cn5woUAktUAsvUAomUAju0Dke6QKAAOb/EAxDAoAA+wYADDCmMQDt +/wINUcKAAAr/Agj/Aoo2GNAwn53+YUgV5dYdAO6qAQ7oQoAADaoC+yHGFaRmAQDo/wELMgKAAAb/ +AohVmJ+GViaWEI5XLpYRL5YSjVQtlhMqUAH/n7AF4BiFAO5RASgECoAA8UAED9IAnQAqIAcKKkDt +ISQtUoKAAA+qAiqWFI8gKJYX/eAAF7AINQAI/wIYz40slhbvlhUk0YEAAPgACB2gDyUAbfoCCgJh +LyEJLCAH++AAF7AYpQAI/wIvlhr/n/YF4cwBAADMEQzcAg/MAv4gKBXgCgUAKpYZLpYd7JYYJ/gN +AACfEY4RLradLVAHiif1oABGsAwFAOvUAAVQgQAAWEy70qDRDwAAAAAAAADphAAD8omAANMPbXkF +DUCGCQJlY/43wKDAigiYNOjmCC1jlgAA2iD8QGgdoBvFAFhSVMAg0Q8AAPtvAA6/77oAwJD8IAYV +r/CGACvMGOokAAlgBIAAWFJKwCDRD8CgWWzNHs9eiegdz1f5P+BokA81AGP/sAAAAAD4QrAVr/kF +AAm5AQm8DCwkFCwhCQSIEPlAZh3gCQUA6aQALmYCgAAIzAIOzAKcof+1phWv7/oAAGwQBikgBSYg +B9gw9gBiHeAaRQD7IA4NIWYBAAUJR/0iwAFfxQUAiiITzzvkZAAFA4mAAMAg0Q8AiCeOio2L64II +JGCBAAAFyQHpFgEqfwKAAKv6qd2v7u6GCibpAQAAnRD7oA3bogCdAO0SACGA2YAA6bQAAgCZgABt +SQUDAIYJAmEqwgAPqgj9QA8MYgCdAJrA+WBoHa/+QgAAAAAAAADsahEDJKEAAAOqCC6invfACbHS +AJ0AKqKdz67aIOwkAANYYQAAWFICwCDRDxvPGIm4mBL3IAjIkgCdAAxKEaOqLKKe94AJKdIAnQAq +op3koRxk4/0AAJy4ZK+/Gc8bmaCPIP+e7gWgCxUA66YCL/4CgAAH/wKfoY+DLuJ/HM8C/Z7eBej/ +HQCv7u6mAyVIQQAA/AAKFeAIBQCxiOmDHgwP6AAAnKYYz2f5QQYVoBkFAJmnjyAI/xEH/wKfqQxO +EaPuJ+adjSIsIAaJJwvdAu0mAiZgBQAA7CQGJMiBAACIkY2SH87r5ZwBBENBAADolgEm6MEAAO2W +AiZhAQAAfIsajZOo2JiRn4COIMAg4oYCL3YCgAAH7gKegdEPH87dn4COIMAg4oYCL3YCgAAH7gKe +gdEPAAAAAADqJAAK2ASAAFhS/tKg0Q8A//s0DaAKBQDAoFlsPBvOzYm4iBL5P/bYkgCdAP/7wA2g +CgUAwKDAygycNP1hBhWv+4YAAAAAAADr2gwBgbmAAApOFO3sCCnABIAA7U02DcgEgADTD23ZBQgA +hgkCYYkRqjjuTQwEyQEAAG3ZBQgghgkCY40RCv4Mrt0t3ED9gAYV7/imAI8RL/xA/4AGFe/4cgAA +AGwQBBXOpxbOxfCIABOwCUUA5M8QGcYCgAAJiAIoZi0FNQLnZi4qGASAAOVmNCkwBIAAA2CGBgJn +A0CGBgJlAyCGBgJjAwCG5gwAARkBAAD1yGgdoIoFAKoiAwJvBMCGAwJtBKCGAwJrBICGAwJp0Q8A +AAAAbBAGIyAHFM6HAwNBDDkRpJkokp79CCBB0AU1ACuSncu2H88AGM8A+kAIFaAJBQD4IAYV4AwF +APggRhXgDVUA+CAmFaAe5QBYTyYMOhGkqvVTphXgAgUA0Q/aIOs8GClgBIAAWFFfxyTRDwAAbBAG +KCBwwGTlzmwUdbSAACQgBwQEQQxJEaWZKpKe4yIALSFsAAAqkp1koFDbMFjqVcDB/AACHeAOFQD5 +nR4FoAkFAPggJhXgDwUA6RYCLVgEgADoFgAp0ASAAFhPBgxMEaXMJsadKiBwKwr7C6oB+k4GHaAC +BQDRD8Ag0Q/aIOtMGClgBIAAWFE7xyTRDwAAbBAEJCAHE87JFc5HBARB4zJ/Kk8CgAAFmQgokp4P +AgDkMwgMETgAACqSnWSgQwM7AvwAAh2gDSUA/gBCHaAfBQBZbV/9nXYFoA4VAOymACnuAoAADt0C +naGLIJuiDEkR9SAARPAIJQD5M6YVoAIFANEP2iDrTBgpYASAAFhRGcck0Q8AbBAWLjAQ95xOBeAf +RQDzwfAN4AYFAPXAQPCSAJ0AaOIDwCDRDyogBwUJR9MP+COGFeGqAQDqFh4slGgAACsgBfdgWDxS +AJ0ALCBy84BX55IAnQDaIFhRMmWnxI0iZde/LhIeiDUqIhD4IUYVoBmFAO4WECR4XQAA+x4ADLT/ +HQDvFgsn+A0AAJ8dnxz1wFDiEgCdACwSEAzMEafMK8Ket039YFrb4gCdACvCnftgWKASAJ0AjCmN +KgwOPi4WGgzdDH7beSogIikgIwqZDPsgWoASAJ0AKCAHGs52/VgAFeGIAQANiAkojQIugQYJ7zYP +7gwuhQYtICKv3Q0NRy0kIvugWbgSAJ0AKKJ/7iILJsv9AAD7AAQA0AgVAOCZGgxACoAA6e4IBEP9 +AAAI7gKeKigSGgzpDPkgWFuiAJ0AiR0ezl0sIAcoIQcdzjP+QSQV4MwRAPWQABY6iAEA7cwCDEMC +gAAI/wItISScsIogiBoczdLu3QINVgKAAAqZApmxKiEinbSfswyqApqyHM5LKSIQmbUZzkr8RxAV +4A8lAJ+5lrf5YQYVoA4VAP9hRhWgCnUA/AMABvBOdQAN6jkNyTkKmQKKG+a2CyHAQQAA6bYGJcjB +AABtqQUIAIYJAmEezbWevI0w86BEQpIAnQAqEhDpEgwtVwKAAKeqKaadKCAULxIapIjoJBQngMGA +AC0SGowpKyA4rcycKfNgTq+SAJ0ALhIc+cBNeVIAnQDAINEPKyAHKCAFKjAR/EBIFaG7AQArFh75 +AC48UKo5APuARjiQHqUADLwRp8wtwp4rFhAqFhn/oEdLogCdACnCnSkWEekWHSgECoAA+yBG2BIA +nQD6QGgdoAtFAFlrCxvNjPtARsBSAJ0Ai7j3YEbwkgCdACxyrveARE1SAJ0AKnKtHs2D7wIABev9 +AAD7QEdYEgCdAO3mCCgECoAA+0BDaBIAnQAtMBQtJDgrMBUmJDsrJDmJO4s8iDqPOY42jDgsJQkv +JSMuJSIoJSQpJSUrJEyJPSkkTSgyES4yECYkTiYkTyYmGyYmHSYkcCYkcvZOJh2gDxUALyUpLyYX +LyYYLyYZLyRzLiUoKCYVLiEaLDARx7z7wAQF88wBAPxHRh2gCCUA+aAEBjAPRQDo0Bx127EAAP8A +AAQwCRUA+S0ADDmeHQCpiA6IEQi7DBjN0f+gBAbwDhUADOw5C4ksDe05C4guCOg5Hs2m6YgIC0gE +gAAN6TkdzVrfYAzfOQn/Ai0gFAi5HOklNCXz8QAACOgcKRIZpN3oJTUvdAKAAA7+Ai4mEO0kFC3E +AoAA+eYAD7AsBQDvJg8kr+GAABvNtxnNZi4gB4wpnCyIPvgiRhWg/hEA6BIRL/qCgAAJ/wIpIQj/ +AAYV4e4BAO8iAC90AoAADpkC+yYADPAONQDr+wIP/gKAAA7/Ap+B/5o+BaAvBQCfg+6GAiR4wQAA +LxYdjiuWhZ6JnIj7AMYV4A8VAPkAhhXgCwUA+iJmFeAZZQD4I2YV4BxFAOwWCS7yAoAAD+4Cnof2 +QoYdoCwFAC0gBw0NQevNjhboUQAA6hYILoEKgADtMg8vyAqAAAuZAhvNIC0WFCkWFSm2QCkSHRvN *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Feb 26 00:27:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 91BEEC90; Tue, 26 Feb 2013 00:27:28 +0000 (UTC) (envelope-from np@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 75238124; Tue, 26 Feb 2013 00:27:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q0RS0M083181; Tue, 26 Feb 2013 00:27:28 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q0RRjj083176; Tue, 26 Feb 2013 00:27:27 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201302260027.r1Q0RRjj083176@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 26 Feb 2013 00:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247291 - in head/sys/dev/cxgbe: . common firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 00:27:28 -0000 Author: np Date: Tue Feb 26 00:27:27 2013 New Revision: 247291 URL: http://svnweb.freebsd.org/changeset/base/247291 Log: cxgbe(4): Ask the card's firmware to pad up tiny CPLs by encapsulating them in a firmware message if it is able to do so. This works out better for one of the FIFOs in the chip. MFC after: 5 days Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/t4_msg.h head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Feb 26 00:18:50 2013 (r247290) +++ head/sys/dev/cxgbe/adapter.h Tue Feb 26 00:27:27 2013 (r247291) @@ -600,7 +600,7 @@ struct adapter { struct callout sfl_callout; an_handler_t an_handler __aligned(CACHE_LINE_SIZE); - fw_msg_handler_t fw_msg_handler[4]; /* NUM_FW6_TYPES */ + fw_msg_handler_t fw_msg_handler[5]; /* NUM_FW6_TYPES */ cpl_handler_t cpl_handler[0xef]; /* NUM_CPL_CMDS */ #ifdef INVARIANTS Modified: head/sys/dev/cxgbe/common/t4_msg.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_msg.h Tue Feb 26 00:18:50 2013 (r247290) +++ head/sys/dev/cxgbe/common/t4_msg.h Tue Feb 26 00:27:27 2013 (r247291) @@ -2224,6 +2224,15 @@ struct cpl_sge_egr_update { #define V_EGR_QID(x) ((x) << S_EGR_QID) #define G_EGR_QID(x) (((x) >> S_EGR_QID) & M_EGR_QID) +/* cpl_fw*.type values */ +enum { + FW_TYPE_CMD_RPL = 0, + FW_TYPE_WR_RPL = 1, + FW_TYPE_CQE = 2, + FW_TYPE_OFLD_CONNECTION_WR_RPL = 3, + FW_TYPE_RSSCPL = 4, +}; + struct cpl_fw2_pld { RSS_HDR u8 opcode; @@ -2292,10 +2301,11 @@ struct cpl_fw6_msg { /* cpl_fw6_msg.type values */ enum { - FW6_TYPE_CMD_RPL = 0, - FW6_TYPE_WR_RPL = 1, - FW6_TYPE_CQE = 2, - FW6_TYPE_OFLD_CONNECTION_WR_RPL = 3, + FW6_TYPE_CMD_RPL = FW_TYPE_CMD_RPL, + FW6_TYPE_WR_RPL = FW_TYPE_WR_RPL, + FW6_TYPE_CQE = FW_TYPE_CQE, + FW6_TYPE_OFLD_CONNECTION_WR_RPL = FW_TYPE_OFLD_CONNECTION_WR_RPL, + FW6_TYPE_RSSCPL = FW_TYPE_RSSCPL, NUM_FW6_TYPES }; Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_interface.h Tue Feb 26 00:18:50 2013 (r247290) +++ head/sys/dev/cxgbe/firmware/t4fw_interface.h Tue Feb 26 00:27:27 2013 (r247291) @@ -3534,7 +3534,7 @@ enum fw_params_param_pfvf { FW_PARAMS_PARAM_PFVF_ACTIVE_FILTER_END = 0x2E, FW_PARAMS_PARAM_PFVF_ETHOFLD_START = 0x2F, FW_PARAMS_PARAM_PFVF_ETHOFLD_END = 0x30, - FW_PARAMS_PARAM_PFVF_CPLFW4MSG_CPLSGEEGRUPDATE = 0x31 + FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP = 0x31 }; /* Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Feb 26 00:18:50 2013 (r247290) +++ head/sys/dev/cxgbe/t4_main.c Tue Feb 26 00:27:27 2013 (r247291) @@ -281,6 +281,7 @@ static int upload_config_file(struct ada static int partition_resources(struct adapter *, const struct firmware *); static int get_params__pre_init(struct adapter *); static int get_params__post_init(struct adapter *); +static int set_params__post_init(struct adapter *); static void t4_set_desc(struct adapter *); static void build_medialist(struct port_info *); static int update_mac_settings(struct port_info *, int); @@ -519,6 +520,10 @@ t4_attach(device_t dev) if (rc != 0) goto done; /* error message displayed already */ + rc = set_params__post_init(sc); + if (rc != 0) + goto done; /* error message displayed already */ + if (sc->flags & MASTER_PF) { uint16_t indsz = min(RX_COPY_THRESHOLD - 1, M_INDICATESIZE); @@ -1991,6 +1996,33 @@ get_params__post_init(struct adapter *sc return (rc); } +static int +set_params__post_init(struct adapter *sc) +{ + uint32_t param, val; + int rc; + + param = FW_PARAM_PFVF(CPLFW4MSG_ENCAP); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); + if (rc == 0) { + /* ask for encapsulated CPLs */ + param = FW_PARAM_PFVF(CPLFW4MSG_ENCAP); + val = 1; + rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); + if (rc != 0) { + device_printf(sc->dev, + "failed to set parameter (post_init): %d.\n", rc); + return (rc); + } + } else if (rc != FW_EINVAL) { + device_printf(sc->dev, + "failed to check for encapsulated CPLs: %d.\n", rc); + } else + rc = 0; /* the firmware doesn't support the param, no worries */ + + return (rc); +} + #undef FW_PARAM_PFVF #undef FW_PARAM_DEV @@ -3077,6 +3109,14 @@ t4_register_fw_msg_handler(struct adapte if (type >= nitems(sc->fw_msg_handler)) return (EINVAL); + /* + * These are dispatched by the handler for FW{4|6}_CPL_MSG using the CPL + * handler dispatch table. Reject any attempt to install a handler for + * this subtype. + */ + if (type == FW_TYPE_RSSCPL || type == FW6_TYPE_RSSCPL) + return (EINVAL); + new = h ? (uintptr_t)h : (uintptr_t)fw_msg_not_handled; loc = (uintptr_t *) &sc->fw_msg_handler[type]; atomic_store_rel_ptr(loc, new); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Feb 26 00:18:50 2013 (r247290) +++ head/sys/dev/cxgbe/t4_sge.c Tue Feb 26 00:27:27 2013 (r247291) @@ -3509,6 +3509,10 @@ handle_sge_egr_update(struct sge_iq *iq, return (0); } +/* handle_fw_msg works for both fw4_msg and fw6_msg because this is valid */ +CTASSERT(offsetof(struct cpl_fw4_msg, data) == \ + offsetof(struct cpl_fw6_msg, data)); + static int handle_fw_msg(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) { @@ -3518,6 +3522,13 @@ handle_fw_msg(struct sge_iq *iq, const s KASSERT(m == NULL, ("%s: payload with opcode %02x", __func__, rss->opcode)); + if (cpl->type == FW_TYPE_RSSCPL || cpl->type == FW6_TYPE_RSSCPL) { + const struct rss_header *rss2; + + rss2 = (const struct rss_header *)&cpl->data[0]; + return (sc->cpl_handler[rss2->opcode](iq, rss2, m)); + } + return (sc->fw_msg_handler[cpl->type](sc, &cpl->data[0])); } From owner-svn-src-all@FreeBSD.ORG Tue Feb 26 00:43:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 621D5CF; Tue, 26 Feb 2013 00:43: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 508EA198; Tue, 26 Feb 2013 00:43:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q0h4UQ088638; Tue, 26 Feb 2013 00:43:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q0h2GO088626; Tue, 26 Feb 2013 00:43:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302260043.r1Q0h2GO088626@svn.freebsd.org> From: Xin LI Date: Tue, 26 Feb 2013 00:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r247293 - in vendor/expat/dist: . doc examples lib tests tests/benchmark xmlwf X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 00:43:04 -0000 Author: delphij Date: Tue Feb 26 00:43:01 2013 New Revision: 247293 URL: http://svnweb.freebsd.org/changeset/base/247293 Log: Vendor import of expat 2.1.0 (trimmed). Added: vendor/expat/dist/FREEBSD-Xlist (contents, props changed) Deleted: vendor/expat/dist/FREEBSD-upgrade vendor/expat/dist/configure vendor/expat/dist/doc/valid-xhtml10.png vendor/expat/dist/lib/winconfig.h vendor/expat/dist/tests/benchmark/benchmark.dsp vendor/expat/dist/tests/benchmark/benchmark.dsw Modified: vendor/expat/dist/Changes (contents, props changed) vendor/expat/dist/MANIFEST (contents, props changed) vendor/expat/dist/Makefile.in (contents, props changed) vendor/expat/dist/README (contents, props changed) vendor/expat/dist/configure.in (contents, props changed) vendor/expat/dist/doc/reference.html (contents, props changed) vendor/expat/dist/doc/xmlwf.sgml (contents, props changed) vendor/expat/dist/expat_config.h.in (contents, props changed) vendor/expat/dist/lib/expat.h (contents, props changed) vendor/expat/dist/lib/xmlparse.c (contents, props changed) vendor/expat/dist/lib/xmlrole.c (contents, props changed) vendor/expat/dist/lib/xmltok.c (contents, props changed) vendor/expat/dist/lib/xmltok_impl.c (contents, props changed) vendor/expat/dist/tests/README.txt (contents, props changed) vendor/expat/dist/tests/minicheck.h vendor/expat/dist/tests/runtests.c (contents, props changed) vendor/expat/dist/tests/xmltest.sh (contents, props changed) vendor/expat/dist/xmlwf/readfilemap.c (contents, props changed) vendor/expat/dist/xmlwf/xmlwf.c (contents, props changed) Directory Properties: vendor/expat/dist/COPYING (props changed) vendor/expat/dist/doc/style.css (props changed) vendor/expat/dist/doc/xmlwf.1 (props changed) vendor/expat/dist/examples/elements.c (props changed) vendor/expat/dist/examples/outline.c (props changed) vendor/expat/dist/lib/ascii.h (props changed) vendor/expat/dist/lib/asciitab.h (props changed) vendor/expat/dist/lib/iasciitab.h (props changed) vendor/expat/dist/lib/internal.h (props changed) vendor/expat/dist/lib/latin1tab.h (props changed) vendor/expat/dist/lib/nametab.h (props changed) vendor/expat/dist/lib/utf8tab.h (props changed) vendor/expat/dist/lib/xmlrole.h (props changed) vendor/expat/dist/lib/xmltok.h (props changed) vendor/expat/dist/lib/xmltok_impl.h (props changed) vendor/expat/dist/lib/xmltok_ns.c (props changed) vendor/expat/dist/tests/chardata.c (props changed) vendor/expat/dist/tests/chardata.h (props changed) vendor/expat/dist/xmlwf/codepage.c (props changed) vendor/expat/dist/xmlwf/codepage.h (props changed) vendor/expat/dist/xmlwf/ct.c (props changed) vendor/expat/dist/xmlwf/filemap.h (props changed) vendor/expat/dist/xmlwf/unixfilemap.c (props changed) vendor/expat/dist/xmlwf/win32filemap.c (props changed) vendor/expat/dist/xmlwf/xmlfile.c (props changed) vendor/expat/dist/xmlwf/xmlfile.h (props changed) vendor/expat/dist/xmlwf/xmlmime.c (props changed) vendor/expat/dist/xmlwf/xmlmime.h (props changed) vendor/expat/dist/xmlwf/xmltchar.h (props changed) vendor/expat/dist/xmlwf/xmlurl.h (props changed) vendor/expat/dist/xmlwf/xmlwin32url.cxx (props changed) Modified: vendor/expat/dist/Changes ============================================================================== --- vendor/expat/dist/Changes Tue Feb 26 00:34:52 2013 (r247292) +++ vendor/expat/dist/Changes Tue Feb 26 00:43:01 2013 (r247293) @@ -1,5 +1,41 @@ +Release 2.1.0 Sat March 24 2012 + - Bug Fixes: + #1742315: Harmful XML_ParserCreateNS suggestion. + #2895533: CVE-2012-1147 - Resource leak in readfilemap.c. + #1785430: Expat build fails on linux-amd64 with gcc version>=4.1 -O3. + #1983953, 2517952, 2517962, 2649838: + Build modifications using autoreconf instead of buildconf.sh. + #2815947, #2884086: OBJEXT and EXEEXT support while building. + #1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences. + #2517938: xmlwf should return non-zero exit status if not well-formed. + #2517946: Wrong statement about XMLDecl in xmlwf.1 and xmlwf.sgml. + #2855609: Dangling positionPtr after error. + #2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8(). + #2958794: CVE-2012-1148 - Memory leak in poolGrow. + #2990652: CMake support. + #3010819: UNEXPECTED_STATE with a trailing "%" in entity value. + #3206497: Unitialized memory returned from XML_Parse. + #3287849: make check fails on mingw-w64. + #3496608: CVE-2012-0876 - Hash DOS attack. + - Patches: + #1749198: pkg-config support. + #3010222: Fix for bug #3010819. + #3312568: CMake support. + #3446384: Report byte offsets for attr names and values. + - New Features / API changes: + Added new API member XML_SetHashSalt() that allows setting an intial + value (salt) for hash calculations. This is part of the fix for + bug #3496608 to randomize hash parameters. + When compiled with XML_ATTR_INFO defined, adds new API member + XML_GetAttributeInfo() that allows retrieving the byte + offsets for attribute names and values (patch #3446384). + Added CMake build system. + See bug #2990652 and patch #3312568. + Added run-benchmark target to Makefile.in - relies on testdata module + present in the same relative location as in the repository. + Release 2.0.1 Tue June 5 2007 - - Fixed bugs #1515266, 1515600: The character data handler's calling + - Fixed bugs #1515266, #1515600: The character data handler's calling of XML_StopParser() was not handled properly; if the parser was stopped and the handler set to NULL, the parser would segfault. - Fixed bug #1690883: Expat failed on EBCDIC systems as it assumed @@ -8,7 +44,7 @@ Release 2.0.1 Tue June 5 2007 - Fixed xmlwf bug #1513566: "out of memory" error on file size zero. - Fixed outline.c bug #1543233: missing a final XML_ParserFree() call. - Fixes and improvements for Windows platform: - bugs #1409451, #1476160, 1548182, 1602769, 1717322. + bugs #1409451, #1476160, #1548182, #1602769, #1717322. - Build fixes for various platforms: HP-UX, Tru64, Solaris 9: patch #1437840, bug #1196180. All Unix: #1554618 (refreshed config.sub/config.guess). @@ -30,8 +66,8 @@ Release 2.0.0 Wed Jan 11 2006 byte indexes and line/column numbers. - Updated to use libtool 1.5.22 (the most recent). - Added support for AmigaOS. - - Some mostly minor bug fixes. SF issues include: 1006708, - 1021776, 1023646, 1114960, 1156398, 1221160, 1271642. + - Some mostly minor bug fixes. SF issues include: #1006708, + #1021776, #1023646, #1114960, #1156398, #1221160, #1271642. Release 1.95.8 Fri Jul 23 2004 - Major new feature: suspend/resume. Handlers can now request @@ -40,8 +76,8 @@ Release 1.95.8 Fri Jul 23 2004 documentation for more details. - Some mostly minor bug fixes, but compilation should no longer generate warnings on most platforms. SF issues - include: 827319, 840173, 846309, 888329, 896188, 923913, - 928113, 961698, 985192. + include: #827319, #840173, #846309, #888329, #896188, #923913, + #928113, #961698, #985192. Release 1.95.7 Mon Oct 20 2003 - Fixed enum XML_Status issue (reported on SourceForge many @@ -54,19 +90,19 @@ Release 1.95.7 Mon Oct 20 2003 - Improved ability to build without the configure-generated expat_config.h header. This is useful for applications which embed Expat rather than linking in the library. - - Fixed a variety of bugs: see SF issues 458907, 609603, - 676844, 679754, 692878, 692964, 695401, 699323, 699487, - 820946. + - Fixed a variety of bugs: see SF issues #458907, #609603, + #676844, #679754, #692878, #692964, #695401, #699323, #699487, + #820946. - Improved hash table lookups. - Added more regression tests and improved documentation. Release 1.95.6 Tue Jan 28 2003 - Added XML_FreeContentModel(). - Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree(). - - Fixed a variety of bugs: see SF issues 615606, 616863, - 618199, 653180, 673791. + - Fixed a variety of bugs: see SF issues #615606, #616863, + #618199, #653180, #673791. - Enhanced the regression test suite. - - Man page improvements: includes SF issue 632146. + - Man page improvements: includes SF issue #632146. Release 1.95.5 Fri Sep 6 2002 - Added XML_UseForeignDTD() for improved SAX2 support. @@ -84,9 +120,9 @@ Release 1.95.5 Fri Sep 6 2002 - Reduced line-length for all source code and headers to be no longer than 80 characters, to help with AS/400 support. - Reduced memory copying during parsing (SF patch #600964). - - Fixed a variety of bugs: see SF issues 580793, 434664, - 483514, 580503, 581069, 584041, 584183, 584832, 585537, - 596555, 596678, 598352, 598944, 599715, 600479, 600971. + - Fixed a variety of bugs: see SF issues #580793, #434664, + #483514, #580503, #581069, #584041, #584183, #584832, #585537, + #596555, #596678, #598352, #598944, #599715, #600479, #600971. Release 1.95.4 Fri Jul 12 2002 - Added support for VMS, contributed by Craig Berry. See @@ -95,14 +131,14 @@ Release 1.95.4 Fri Jul 12 2002 contributed by Thomas Wegner and Daryle Walker. - Added Borland C++ Builder 5 / BCC 5.5 support, contributed by Patrick McConnell (SF patch #538032). - - Fixed a variety of bugs: see SF issues 441449, 563184, - 564342, 566334, 566901, 569461, 570263, 575168, 579196. + - Fixed a variety of bugs: see SF issues #441449, #563184, + #564342, #566334, #566901, #569461, #570263, #575168, #579196. - Made skippedEntityHandler conform to SAX2 (see source comment) - Re-implemented WFC: Entity Declared from XML 1.0 spec and added a new error "entity declared in parameter entity": - see SF bug report 569461 and SF patch 578161 + see SF bug report #569461 and SF patch #578161 - Re-implemented section 5.1 from XML 1.0 spec: - see SF bug report 570263 and SF patch 578161 + see SF bug report #570263 and SF patch #578161 Release 1.95.3 Mon Jun 3 2002 - Added a project to the MSVC workspace to create a wchar_t @@ -114,9 +150,9 @@ Release 1.95.3 Mon Jun 3 2002 - Made the XML_UNICODE builds usable (thanks, Karl!). - Allow xmlwf to read from standard input. - Install a man page for xmlwf on Unix systems. - - Fixed many bugs; see SF bug reports 231864, 461380, 464837, - 466885, 469226, 477667, 484419, 487840, 494749, 496505, - 547350. Other bugs which we can't test as easily may also + - Fixed many bugs; see SF bug reports #231864, #461380, #464837, + #466885, #469226, #477667, #484419, #487840, #494749, #496505, + #547350. Other bugs which we can't test as easily may also have been fixed, especially in the area of build support. Release 1.95.2 Fri Jul 27 2001 Added: vendor/expat/dist/FREEBSD-Xlist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/dist/FREEBSD-Xlist Tue Feb 26 00:43:01 2013 (r247293) @@ -0,0 +1,19 @@ +# $FreeBSD$ +*.MPW +*.cmake +*.def +*.dsp +*.dsw +*.m4 +*.pc.in +*config.h +CMake* +Configure* +amiga +bcb5 +configure +conftools +doc/valid-xhtml10.png +m4 +vms +win32 Modified: vendor/expat/dist/MANIFEST ============================================================================== --- vendor/expat/dist/MANIFEST Tue Feb 26 00:34:52 2013 (r247292) +++ vendor/expat/dist/MANIFEST Tue Feb 26 00:43:01 2013 (r247293) @@ -1,5 +1,8 @@ -amiga/stdlib.c amiga/launch.c +amiga/expat_68k.c +amiga/expat_68k.h +amiga/expat_68k_handler_stubs.c +amiga/expat_base.h amiga/expat_vectors.c amiga/expat_lib.c amiga/expat.xml @@ -42,25 +45,35 @@ doc/style.css doc/valid-xhtml10.png doc/xmlwf.1 doc/xmlwf.sgml +CMakeLists.txt +CMake.README COPYING Changes +ConfigureChecks.cmake MANIFEST Makefile.in README configure configure.in expat_config.h.in +expat_config.h.cmake +expat.pc.in expat.dsw +aclocal.m4 conftools/PrintPath conftools/ac_c_bigendian_cross.m4 -conftools/config.guess -conftools/config.sub conftools/expat.m4 conftools/get-version.sh +conftools/mkinstalldirs +conftools/config.guess +conftools/config.sub conftools/install-sh -conftools/libtool.m4 conftools/ltmain.sh -conftools/mkinstalldirs +m4/libtool.m4 +m4/ltversion.m4 +m4/ltoptions.m4 +m4/ltsugar.m4 +m4/lt~obsolete.m4 examples/elements.c examples/elements.dsp examples/outline.c Modified: vendor/expat/dist/Makefile.in ============================================================================== --- vendor/expat/dist/Makefile.in Tue Feb 26 00:34:52 2013 (r247292) +++ vendor/expat/dist/Makefile.in Tue Feb 26 00:43:01 2013 (r247293) @@ -31,6 +31,7 @@ bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ man1dir = @mandir@/man1 +pkgconfigdir = $(libdir)/pkgconfig top_builddir = . @@ -46,18 +47,18 @@ LIBRARY = libexpat.la DESTDIR = $(INSTALL_ROOT) -default: buildlib xmlwf/xmlwf +default: buildlib xmlwf/xmlwf@EXEEXT@ -buildlib: $(LIBRARY) +buildlib: $(LIBRARY) expat.pc -all: $(LIBRARY) xmlwf/xmlwf examples/elements examples/outline +all: $(LIBRARY) expat.pc xmlwf/xmlwf@EXEEXT@ examples/elements examples/outline clean: - cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs - cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs - cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs - cd tests && rm -rf .libs runtests runtests.o runtestspp runtestspp.o - cd tests && rm -f chardata.o minicheck.o + cd lib && rm -f $(LIBRARY) *.@OBJEXT@ *.lo && rm -rf .libs _libs + cd xmlwf && rm -f xmlwf *.@OBJEXT@ *.lo && rm -rf .libs _libs + cd examples && rm -f elements outline *.@OBJEXT@ *.lo && rm -rf .libs _libs + cd tests && rm -rf .libs runtests runtests.@OBJEXT@ runtestspp runtestspp.@OBJEXT@ + cd tests && rm -f chardata.@OBJEXT@ minicheck.@OBJEXT@ rm -rf .libs libexpat.la rm -f examples/core tests/core xmlwf/core @@ -65,34 +66,37 @@ clobber: clean distclean: clean rm -f expat_config.h config.status config.log config.cache libtool - rm -f Makefile + rm -f Makefile expat.pc extraclean: distclean rm -f expat_config.h.in configure - rm -f conftools/ltconfig conftools/ltmain.sh conftools/libtool.m4 + rm -f aclocal.m4 m4/* + rm -f conftools/ltmain.sh conftools/install-sh conftools/config.guess conftools/config.sub check: tests/runtests tests/runtestspp tests/runtests tests/runtestspp -install: xmlwf/xmlwf installlib +install: xmlwf/xmlwf@EXEEXT@ installlib $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) - $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(DESTDIR)$(bindir)/xmlwf + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf@EXEEXT@ $(DESTDIR)$(bindir)/xmlwf $(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(man1dir) -installlib: $(LIBRARY) $(APIHEADER) - $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) +installlib: $(LIBRARY) $(APIHEADER) expat.pc + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) $(DESTDIR)$(pkgconfigdir) $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)/$(LIBRARY) for FN in $(APIHEADER) ; do $(INSTALL_DATA) $$FN $(DESTDIR)$(includedir) ; done + $(INSTALL_DATA) expat.pc $(DESTDIR)$(pkgconfigdir)/expat.pc uninstall: uninstalllib - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf@EXEEXT@ rm -f $(DESTDIR)$(man1dir)/xmlwf.1 uninstalllib: $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIBRARY) rm -f $(DESTDIR)$(includedir)/expat.h rm -f $(DESTDIR)$(includedir)/expat_external.h + rm -f $(DESTDIR)$(pkgconfigdir)/expat.pc # for VPATH builds (invoked by configure) mkdir-init: @@ -125,6 +129,9 @@ LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo $(LIBRARY): $(LIB_OBJS) $(LINK_LIB) $(LIB_OBJS) +expat.pc: $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ + lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \ $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h @@ -137,46 +144,53 @@ lib/xmltok.lo: lib/xmltok.c lib/xmltok_i $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h -XMLWF_OBJS = xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/@FILEMAP@.o -xmlwf/xmlwf.o: xmlwf/xmlwf.c -xmlwf/xmlfile.o: xmlwf/xmlfile.c -xmlwf/codepage.o: xmlwf/codepage.c -xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c -xmlwf/xmlwf: $(XMLWF_OBJS) $(LIBRARY) +XMLWF_OBJS = xmlwf/xmlwf.@OBJEXT@ xmlwf/xmlfile.@OBJEXT@ xmlwf/codepage.@OBJEXT@ xmlwf/@FILEMAP@.@OBJEXT@ +xmlwf/xmlwf.@OBJEXT@: xmlwf/xmlwf.c +xmlwf/xmlfile.@OBJEXT@: xmlwf/xmlfile.c +xmlwf/codepage.@OBJEXT@: xmlwf/codepage.c +xmlwf/@FILEMAP@.@OBJEXT@: xmlwf/@FILEMAP@.c +xmlwf/xmlwf@EXEEXT@: $(XMLWF_OBJS) $(LIBRARY) $(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY) -examples/elements.o: examples/elements.c -examples/elements: examples/elements.o $(LIBRARY) +examples/elements.@OBJEXT@: examples/elements.c +examples/elements: examples/elements.@OBJEXT@ $(LIBRARY) $(LINK_EXE) $< $(LIBRARY) -examples/outline.o: examples/outline.c -examples/outline: examples/outline.o $(LIBRARY) +examples/outline.@OBJEXT@: examples/outline.c +examples/outline: examples/outline.@OBJEXT@ $(LIBRARY) $(LINK_EXE) $< $(LIBRARY) -tests/chardata.o: tests/chardata.c tests/chardata.h -tests/minicheck.o: tests/minicheck.c tests/minicheck.h -tests/runtests.o: tests/runtests.c tests/chardata.h -tests/runtests: tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY) - $(LINK_EXE) tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY) -tests/runtestspp.o: tests/runtestspp.cpp tests/runtests.c tests/chardata.h -tests/runtestspp: tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY) - $(LINK_CXX_EXE) tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY) +tests/chardata.@OBJEXT@: tests/chardata.c tests/chardata.h +tests/minicheck.@OBJEXT@: tests/minicheck.c tests/minicheck.h +tests/runtests.@OBJEXT@: tests/runtests.c tests/chardata.h +tests/runtests: tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY) + $(LINK_EXE) tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY) +tests/runtestspp.@OBJEXT@: tests/runtestspp.cpp tests/runtests.c tests/chardata.h +tests/runtestspp: tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY) + $(LINK_CXX_EXE) tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY) + +tests/benchmark/benchmark.@OBJEXT@: tests/benchmark/benchmark.c +tests/benchmark/benchmark: tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY) + $(LINK_EXE) tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY) + +run-benchmark: tests/benchmark/benchmark + tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 tests/xmlts.zip: wget --output-document=tests/xmlts.zip \ - http://www.w3.org/XML/Test/xmlts20020606.zip + http://www.w3.org/XML/Test/xmlts20080827.zip tests/XML-Test-Suite: tests/xmlts.zip cd tests && unzip -q xmlts.zip -run-xmltest: xmlwf/xmlwf tests/XML-Test-Suite +run-xmltest: xmlwf/xmlwf@EXEEXT@ tests/XML-Test-Suite tests/xmltest.sh -.SUFFIXES: .c .cpp .lo .o +.SUFFIXES: .c .cpp .lo .@OBJEXT@ -.cpp.o: +.cpp.@OBJEXT@: $(CXXCOMPILE) -o $@ -c $< -.c.o: +.c.@OBJEXT@: $(COMPILE) -o $@ -c $< .c.lo: $(LTCOMPILE) -o $@ -c $< Modified: vendor/expat/dist/README ============================================================================== --- vendor/expat/dist/README Tue Feb 26 00:34:52 2013 (r247292) +++ vendor/expat/dist/README Tue Feb 26 00:43:01 2013 (r247293) @@ -1,5 +1,5 @@ - Expat, Release 2.0.1 + Expat, Release 2.1.0 This is Expat, a C library for parsing XML, written by James Clark. Expat is a stream-oriented XML parser. This means that you register @@ -25,8 +25,7 @@ intended to be production grade software If you are building Expat from a check-out from the CVS repository, you need to run a script that generates the configure script using the GNU autoconf and libtool tools. To do this, you need to have -autoconf 2.52 or newer and libtool 1.4 or newer (1.5 or newer preferred). -Run the script like this: +autoconf 2.58 or newer. Run the script like this: ./buildconf.sh @@ -65,8 +64,8 @@ location. Have a look at the "Makefile" the directories into which things will be installed. If you are interested in building Expat to provide document -information in UTF-16 rather than the default UTF-8, follow these -instructions (after having run "make distclean"): +information in UTF-16 encoding rather than the default UTF-8, follow +these instructions (after having run "make distclean"): 1. For UTF-16 output as unsigned short (and version/error strings as char), run: @@ -106,7 +105,10 @@ use DESTDIR=$(INSTALL_ROOT), even if DES environment, because variable-setting priority is 1) commandline 2) in-makefile -3) environment +3) environment + +Note: This only applies to the Expat library itself, building UTF-16 versions +of xmlwf and the tests is currently not supported. Note for Solaris users: The "ar" command is usually located in "/usr/ccs/bin", which is not in the default PATH. You will need to Modified: vendor/expat/dist/configure.in ============================================================================== --- vendor/expat/dist/configure.in Tue Feb 26 00:34:52 2013 (r247292) +++ vendor/expat/dist/configure.in Tue Feb 26 00:43:01 2013 (r247293) @@ -10,8 +10,8 @@ dnl under the terms of the License (ba dnl in the file COPYING that comes with this distribution. dnl -dnl Ensure that Expat is configured with autoconf 2.52 or newer -AC_PREREQ(2.52) +dnl Ensure that Expat is configured with autoconf 2.58 or newer +AC_PREREQ(2.58) dnl Get the version number of Expat, using m4's esyscmd() command to run dnl the command at m4-generation time. This allows us to create an m4 @@ -25,12 +25,13 @@ dnl test. I believe this test will work, dnl GNU M4 to test it right now. define([expat_version], ifdef([__gnu__], [esyscmd(conftools/get-version.sh lib/expat.h)], - [2.0.x])) + [2.1.x])) AC_INIT(expat, expat_version, expat-bugs@libexpat.org) undefine([expat_version]) AC_CONFIG_SRCDIR(Makefile.in) AC_CONFIG_AUX_DIR(conftools) +AC_CONFIG_MACRO_DIR([m4]) dnl @@ -44,13 +45,12 @@ dnl dnl If the API changes incompatibly set LIBAGE back to 0 dnl -LIBCURRENT=6 -LIBREVISION=2 -LIBAGE=5 +LIBCURRENT=7 +LIBREVISION=0 +LIBAGE=6 AC_CONFIG_HEADER(expat_config.h) -sinclude(conftools/libtool.m4) sinclude(conftools/ac_c_bigendian_cross.m4) AC_LIBTOOL_WIN32_DLL @@ -62,6 +62,7 @@ AC_SUBST(LIBAGE) dnl Checks for programs. AC_PROG_CC +AC_PROG_CXX AC_PROG_INSTALL if test "$GCC" = yes ; then @@ -144,7 +145,7 @@ AC_DEFINE([XML_DTD], 1, AC_DEFINE([XML_CONTEXT_BYTES], 1024, [Define to specify how much context to retain around the current parse point.]) -AC_CONFIG_FILES(Makefile) +AC_CONFIG_FILES([Makefile expat.pc]) AC_OUTPUT abs_srcdir="`cd $srcdir && pwd`" Modified: vendor/expat/dist/doc/reference.html ============================================================================== --- vendor/expat/dist/doc/reference.html Tue Feb 26 00:34:52 2013 (r247292) +++ vendor/expat/dist/doc/reference.html Tue Feb 26 00:43:01 2013 (r247293) @@ -129,8 +129,10 @@ interface.

  • XML_GetBase
  • XML_GetSpecifiedAttributeCount
  • XML_GetIdAttributeIndex
  • +
  • XML_GetAttributeInfo
  • XML_SetEncoding
  • XML_SetParamEntityParsing
  • +
  • XML_SetHashSalt
  • XML_UseForeignDTD
  • XML_SetReturnNSTriplet
  • XML_DefaultCurrent
  • @@ -369,6 +371,11 @@ footprint and can be faster. statically with the code that calls it; this is required to get all the right MSVC magic annotations correct. This is ignored on other platforms. + +
    XML_ATTR_INFO
    +
    If defined, makes the the additional function XML_GetAttributeInfo available +for reporting attribute byte offsets.

    @@ -917,12 +924,15 @@ XML_ParserCreateNS(const XML_Char *encod Constructs a new parser that has namespace processing in effect. Namespace expanded element names and attribute names are returned as a concatenation of the namespace URI, sep, and the local part of the name. This -means that you should pick a character for sep that can't be -part of a legal URI. There is a special case when sep is the null -character '\0': the namespace URI and the local part will be -concatenated without any separator - this is intended to support RDF processors. -It is a programming error to use the null separator with -namespace triplets. +means that you should pick a character for sep that can't be part +of an URI. Since Expat does not check namespace URIs for conformance, the +only safe choice for a namespace separator is a character that is illegal +in XML. For instance, '\xFF' is not legal in UTF-8, and +'\xFFFF' is not legal in UTF-16. There is a special case when +sep is the null character '\0': the namespace URI and +the local part will be concatenated without any separator - this is intended +to support RDF processors. It is a programming error to use the null separator +with namespace triplets.
     XML_Parser XMLCALL
    @@ -2074,6 +2084,27 @@ attribute. If called inside a start hand
     current call.
     
     
    +
    +const XML_AttrInfo * XMLCALL
    +XML_GetAttributeInfo(XML_Parser parser);
    +
    +
    +typedef struct {
    +  XML_Index  nameStart;  /* Offset to beginning of the attribute name. */
    +  XML_Index  nameEnd;    /* Offset after the attribute name's last byte. */
    +  XML_Index  valueStart; /* Offset to beginning of the attribute value. */
    +  XML_Index  valueEnd;   /* Offset after the attribute value's last byte. */
    +} XML_AttrInfo;
    +
    +
    +Returns an array of XML_AttrInfo structures for the +attribute/value pairs passed in the last call to the +XML_StartElementHandler that were specified +in the start-tag rather than defaulted. Each attribute/value pair counts +as 1; thus the number of entries in the array is +XML_GetSpecifiedAttributeCount(parser) / 2. +
    +
     enum XML_Status XMLCALL
     XML_SetEncoding(XML_Parser p,
    @@ -2104,6 +2135,24 @@ The choices for code are:
     
  • XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE
  • XML_PARAM_ENTITY_PARSING_ALWAYS
  • +Note: If XML_SetParamEntityParsing is called after +XML_Parse or XML_ParseBuffer, then it has +no effect and will always return 0. + + +
    +int XMLCALL
    +XML_SetHashSalt(XML_Parser p,
    +                unsigned long hash_salt);
    +
    +
    +Sets the hash salt to use for internal hash calculations. +Helps in preventing DoS attacks based on predicting hash +function behavior. In order to have an effect this must be called +before parsing has started. Returns 1 if successful, 0 when called +after XML_Parse or XML_ParseBuffer. +

    Note: This call is optional, as the parser will auto-generate a new +random salt value if no value has been set at the start of parsing.

    
    Modified: vendor/expat/dist/doc/xmlwf.sgml
    ==============================================================================
    --- vendor/expat/dist/doc/xmlwf.sgml	Tue Feb 26 00:34:52 2013	(r247292)
    +++ vendor/expat/dist/doc/xmlwf.sgml	Tue Feb 26 00:43:01 2013	(r247293)
    @@ -389,11 +389,6 @@ supports both.
       
         BUGS
     	
    -	According to the W3C standard, an XML file without a
    -	declaration at the beginning is not considered well-formed.
    -	However, &dhpackage; allows this to pass.
    -	
    -	
     	&dhpackage; returns a 0 - noerr result,
     	even if the file is not well-formed.  There is no good way for
     	a program to use &dhpackage; to quickly
    
    Modified: vendor/expat/dist/expat_config.h.in
    ==============================================================================
    --- vendor/expat/dist/expat_config.h.in	Tue Feb 26 00:34:52 2013	(r247292)
    +++ vendor/expat/dist/expat_config.h.in	Tue Feb 26 00:43:01 2013	(r247293)
    @@ -39,6 +39,9 @@
     /* Define to 1 if you have the  header file. */
     #undef HAVE_STRING_H
     
    +/* Define to 1 if you have the  header file. */
    +#undef HAVE_SYS_PARAM_H
    +
     /* Define to 1 if you have the  header file. */
     #undef HAVE_SYS_STAT_H
     
    @@ -48,6 +51,10 @@
     /* Define to 1 if you have the  header file. */
     #undef HAVE_UNISTD_H
     
    +/* Define to the sub-directory in which libtool stores uninstalled libraries.
    +   */
    +#undef LT_OBJDIR
    +
     /* Define to the address where bug reports for this package should be sent. */
     #undef PACKAGE_BUGREPORT
     
    @@ -60,6 +67,9 @@
     /* Define to the one symbol short name of this package. */
     #undef PACKAGE_TARNAME
     
    +/* Define to the home page for this package. */
    +#undef PACKAGE_URL
    +
     /* Define to the version of this package. */
     #undef PACKAGE_VERSION
     
    @@ -85,8 +95,8 @@
     /* Define to empty if `const' does not conform to ANSI C. */
     #undef const
     
    -/* Define to `long' if  does not define. */
    +/* Define to `long int' if  does not define. */
     #undef off_t
     
    -/* Define to `unsigned' if  does not define. */
    +/* Define to `unsigned int' if  does not define. */
     #undef size_t
    
    Modified: vendor/expat/dist/lib/expat.h
    ==============================================================================
    --- vendor/expat/dist/lib/expat.h	Tue Feb 26 00:34:52 2013	(r247292)
    +++ vendor/expat/dist/lib/expat.h	Tue Feb 26 00:43:01 2013	(r247293)
    @@ -742,6 +742,29 @@ XML_GetSpecifiedAttributeCount(XML_Parse
     XMLPARSEAPI(int)
     XML_GetIdAttributeIndex(XML_Parser parser);
     
    +#ifdef XML_ATTR_INFO
    +/* Source file byte offsets for the start and end of attribute names and values.
    +   The value indices are exclusive of surrounding quotes; thus in a UTF-8 source
    +   file an attribute value of "blah" will yield:
    +   info->valueEnd - info->valueStart = 4 bytes.
    +*/
    +typedef struct {
    +  XML_Index  nameStart;  /* Offset to beginning of the attribute name. */
    +  XML_Index  nameEnd;    /* Offset after the attribute name's last byte. */
    +  XML_Index  valueStart; /* Offset to beginning of the attribute value. */
    +  XML_Index  valueEnd;   /* Offset after the attribute value's last byte. */
    +} XML_AttrInfo;
    +
    +/* Returns an array of XML_AttrInfo structures for the attribute/value pairs
    +   passed in last call to the XML_StartElementHandler that were specified
    +   in the start-tag rather than defaulted. Each attribute/value pair counts
    +   as 1; thus the number of entries in the array is
    +   XML_GetSpecifiedAttributeCount(parser) / 2.
    +*/
    +XMLPARSEAPI(const XML_AttrInfo *)
    +XML_GetAttributeInfo(XML_Parser parser);
    +#endif
    +
     /* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
        detected.  The last call to XML_Parse must have isFinal true; len
        may be zero for this call (or any other).
    @@ -883,6 +906,15 @@ XMLPARSEAPI(int)
     XML_SetParamEntityParsing(XML_Parser parser,
                               enum XML_ParamEntityParsing parsing);
     
    +/* Sets the hash salt to use for internal hash calculations.
    +   Helps in preventing DoS attacks based on predicting hash
    +   function behavior. This must be called before parsing is started.
    +   Returns 1 if successful, 0 when called after parsing has started.
    +*/
    +XMLPARSEAPI(int)
    +XML_SetHashSalt(XML_Parser parser,
    +                unsigned long hash_salt);
    +
     /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
        XML_GetErrorCode returns information about the error.
     */
    @@ -984,7 +1016,8 @@ enum XML_FeatureEnum {
       XML_FEATURE_SIZEOF_XML_CHAR,
       XML_FEATURE_SIZEOF_XML_LCHAR,
       XML_FEATURE_NS,
    -  XML_FEATURE_LARGE_SIZE
    +  XML_FEATURE_LARGE_SIZE,
    +  XML_FEATURE_ATTR_INFO
       /* Additional features must be added to the end of this enum. */
     };
     
    @@ -1004,8 +1037,8 @@ XML_GetFeatureList(void);
        change to major or minor version.
     */
     #define XML_MAJOR_VERSION 2
    -#define XML_MINOR_VERSION 0
    -#define XML_MICRO_VERSION 1
    +#define XML_MINOR_VERSION 1
    +#define XML_MICRO_VERSION 0
     
     #ifdef __cplusplus
     }
    
    Modified: vendor/expat/dist/lib/xmlparse.c
    ==============================================================================
    --- vendor/expat/dist/lib/xmlparse.c	Tue Feb 26 00:34:52 2013	(r247292)
    +++ vendor/expat/dist/lib/xmlparse.c	Tue Feb 26 00:43:01 2013	(r247293)
    @@ -5,6 +5,8 @@
     #include 
     #include                      /* memset(), memcpy() */
     #include 
    +#include                      /* UINT_MAX */
    +#include                        /* time() */
     
     #define XML_BUILDING_EXPAT 1
     
    @@ -12,7 +14,7 @@
     #include "winconfig.h"
     #elif defined(MACOS_CLASSIC)
     #include "macconfig.h"
    -#elif defined(__amigaos4__)
    +#elif defined(__amigaos__)
     #include "amigaconfig.h"
     #elif defined(__WATCOMC__)
     #include "watcomconfig.h"
    @@ -327,15 +329,15 @@ processXmlDecl(XML_Parser parser, int is
     static enum XML_Error
     initializeEncoding(XML_Parser parser);
     static enum XML_Error
    -doProlog(XML_Parser parser, const ENCODING *enc, const char *s, 
    -         const char *end, int tok, const char *next, const char **nextPtr, 
    +doProlog(XML_Parser parser, const ENCODING *enc, const char *s,
    +         const char *end, int tok, const char *next, const char **nextPtr,
              XML_Bool haveMore);
     static enum XML_Error
    -processInternalEntity(XML_Parser parser, ENTITY *entity, 
    +processInternalEntity(XML_Parser parser, ENTITY *entity,
                           XML_Bool betweenDecl);
     static enum XML_Error
     doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
    -          const char *start, const char *end, const char **endPtr, 
    +          const char *start, const char *end, const char **endPtr,
               XML_Bool haveMore);
     static enum XML_Error
     doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr,
    @@ -353,7 +355,7 @@ static enum XML_Error
     addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
                const XML_Char *uri, BINDING **bindingsPtr);
     static int
    -defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata, 
    +defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata,
                     XML_Bool isId, const XML_Char *dfltValue, XML_Parser parser);
     static enum XML_Error
     storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata,
    @@ -391,12 +393,13 @@ static void dtdReset(DTD *p, const XML_M
     static void
     dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms);
     static int
    -dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
    +dtdCopy(XML_Parser oldParser,
    +        DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
     static int
    -copyEntityTable(HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
    -
    +copyEntityTable(XML_Parser oldParser,
    +                HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
     static NAMED *
    -lookup(HASH_TABLE *table, KEY name, size_t createSize);
    +lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize);
     static void FASTCALL
     hashTableInit(HASH_TABLE *, const XML_Memory_Handling_Suite *ms);
     static void FASTCALL hashTableClear(HASH_TABLE *);
    @@ -429,11 +432,15 @@ static ELEMENT_TYPE *
     getElementType(XML_Parser parser, const ENCODING *enc,
                    const char *ptr, const char *end);
     
    +static unsigned long generate_hash_secret_salt(void);
    +static XML_Bool startParsing(XML_Parser parser);
    +
     static XML_Parser
     parserCreate(const XML_Char *encodingName,
                  const XML_Memory_Handling_Suite *memsuite,
                  const XML_Char *nameSep,
                  DTD *dtd);
    +
     static void
     parserInit(XML_Parser parser, const XML_Char *encodingName);
     
    @@ -533,6 +540,9 @@ struct XML_ParserStruct {
       NS_ATT *m_nsAtts;
       unsigned long m_nsAttsVersion;
       unsigned char m_nsAttsPower;
    +#ifdef XML_ATTR_INFO
    +  XML_AttrInfo *m_attInfo;
    +#endif
       POSITION m_position;
       STRING_POOL m_tempPool;
       STRING_POOL m_temp2Pool;
    @@ -546,6 +556,7 @@ struct XML_ParserStruct {
       XML_Bool m_useForeignDTD;
       enum XML_ParamEntityParsing m_paramEntityParsing;
     #endif
    +  unsigned long m_hash_secret_salt;
     };
     
     #define MALLOC(s) (parser->m_mem.malloc_fcn((s)))
    @@ -640,6 +651,7 @@ struct XML_ParserStruct {
     #define nsAtts (parser->m_nsAtts)
     #define nsAttsVersion (parser->m_nsAttsVersion)
     #define nsAttsPower (parser->m_nsAttsPower)
    +#define attInfo (parser->m_attInfo)
     #define tempPool (parser->m_tempPool)
     #define temp2Pool (parser->m_temp2Pool)
     #define groupConnector (parser->m_groupConnector)
    @@ -653,6 +665,7 @@ struct XML_ParserStruct {
     #define useForeignDTD (parser->m_useForeignDTD)
     #define paramEntityParsing (parser->m_paramEntityParsing)
     #endif /* XML_DTD */
    +#define hash_secret_salt (parser->m_hash_secret_salt)
     
     XML_Parser XMLCALL
     XML_ParserCreate(const XML_Char *encodingName)
    @@ -670,29 +683,42 @@ XML_ParserCreateNS(const XML_Char *encod
     
     static const XML_Char implicitContext[] = {
       ASCII_x, ASCII_m, ASCII_l, ASCII_EQUALS, ASCII_h, ASCII_t, ASCII_t, ASCII_p,
    -  ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w, 
    +  ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w,
       ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD, ASCII_o, ASCII_r, ASCII_g,
       ASCII_SLASH, ASCII_X, ASCII_M, ASCII_L, ASCII_SLASH, ASCII_1, ASCII_9,
       ASCII_9, ASCII_8, ASCII_SLASH, ASCII_n, ASCII_a, ASCII_m, ASCII_e,
       ASCII_s, ASCII_p, ASCII_a, ASCII_c, ASCII_e, '\0'
     };
     
    +static unsigned long
    +generate_hash_secret_salt(void)
    +{
    +  unsigned int seed = time(NULL) % UINT_MAX;
    +  srand(seed);
    +  return rand();
    +}
    +
    +static XML_Bool  /* only valid for root parser */
    +startParsing(XML_Parser parser)
    +{
    +    /* hash functions must be initialized before setContext() is called */
    +    if (hash_secret_salt == 0)
    +      hash_secret_salt = generate_hash_secret_salt();
    +    if (ns) {
    +      /* implicit context only set for root parser, since child
    +         parsers (i.e. external entity parsers) will inherit it
    +      */
    +      return setContext(parser, implicitContext);
    +    }
    +    return XML_TRUE;
    +}
    +
     XML_Parser XMLCALL
     XML_ParserCreate_MM(const XML_Char *encodingName,
                         const XML_Memory_Handling_Suite *memsuite,
                         const XML_Char *nameSep)
     {
    -  XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL);
    -  if (parser != NULL && ns) {
    -    /* implicit context only set for root parser, since child
    -       parsers (i.e. external entity parsers) will inherit it
    -    */
    -    if (!setContext(parser, implicitContext)) {
    -      XML_ParserFree(parser);
    -      return NULL;
    -    }
    -  }
    -  return parser;
    +  return parserCreate(encodingName, memsuite, nameSep, NULL);
     }
     
     static XML_Parser
    @@ -737,9 +763,20 @@ parserCreate(const XML_Char *encodingNam
         FREE(parser);
         return NULL;
       }
    +#ifdef XML_ATTR_INFO
    +  attInfo = (XML_AttrInfo*)MALLOC(attsSize * sizeof(XML_AttrInfo));
    +  if (attInfo == NULL) {
    +    FREE(atts);
    +    FREE(parser);
    +    return NULL;
    +  }
    +#endif
       dataBuf = (XML_Char *)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));
       if (dataBuf == NULL) {
         FREE(atts);
    +#ifdef XML_ATTR_INFO
    +    FREE(attInfo);
    +#endif
         FREE(parser);
         return NULL;
       }
    @@ -752,6 +789,9 @@ parserCreate(const XML_Char *encodingNam
         if (_dtd == NULL) {
           FREE(dataBuf);
           FREE(atts);
    +#ifdef XML_ATTR_INFO
    +      FREE(attInfo);
    +#endif
           FREE(parser);
           return NULL;
         }
    @@ -866,6 +906,7 @@ parserInit(XML_Parser parser, const XML_
       useForeignDTD = XML_FALSE;
       paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
     #endif
    +  hash_secret_salt = 0;
     }
     
     /* moves list of bindings to freeBindingList */
    @@ -913,7 +954,7 @@ XML_ParserReset(XML_Parser parser, const
       poolClear(&temp2Pool);
       parserInit(parser, encodingName);
       dtdReset(_dtd, &parser->m_mem);
    -  return setContext(parser, implicitContext);
    +  return XML_TRUE;
     }
     
     enum XML_Status XMLCALL
    @@ -982,6 +1023,12 @@ XML_ExternalEntityParserCreate(XML_Parse
       int oldInEntityValue = prologState.inEntityValue;
     #endif
       XML_Bool oldns_triplets = ns_triplets;
    +  /* Note that the new parser shares the same hash secret as the old
    +     parser, so that dtdCopy and copyEntityTable can lookup values
    +     from hash tables associated with either parser without us having
    +     to worry which hash secrets each table has.
    +  */
    +  unsigned long oldhash_secret_salt = hash_secret_salt;
     
     #ifdef XML_DTD
       if (!context)
    @@ -1035,13 +1082,14 @@ XML_ExternalEntityParserCreate(XML_Parse
         externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg;
       defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
       ns_triplets = oldns_triplets;
    +  hash_secret_salt = oldhash_secret_salt;
       parentParser = oldParser;
     #ifdef XML_DTD
       paramEntityParsing = oldParamEntityParsing;
       prologState.inEntityValue = oldInEntityValue;
       if (context) {
     #endif /* XML_DTD */
    -    if (!dtdCopy(_dtd, oldDtd, &parser->m_mem)
    +    if (!dtdCopy(oldParser, _dtd, oldDtd, &parser->m_mem)
           || !setContext(parser, context)) {
           XML_ParserFree(parser);
           return NULL;
    @@ -1130,6 +1178,9 @@ XML_ParserFree(XML_Parser parser)
     #endif /* XML_DTD */
         dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem);
       FREE((void *)atts);
    +#ifdef XML_ATTR_INFO
    +  FREE((void *)attInfo);
    +#endif
       FREE(groupConnector);
       FREE(buffer);
       FREE(dataBuf);
    @@ -1210,6 +1261,14 @@ XML_GetIdAttributeIndex(XML_Parser parse
       return idAttIndex;
     }
     
    +#ifdef XML_ATTR_INFO
    +const XML_AttrInfo * XMLCALL
    +XML_GetAttributeInfo(XML_Parser parser)
    +{
    +  return attInfo;
    +}
    +#endif
    +
     void XMLCALL
     XML_SetElementHandler(XML_Parser parser,
                           XML_StartElementHandler start,
    @@ -1426,6 +1485,17 @@ XML_SetParamEntityParsing(XML_Parser par
     #endif
     }
     
    +int XMLCALL
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 00:44:55 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 2011E242;
     Tue, 26 Feb 2013 00:44:55 +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 073801A8;
     Tue, 26 Feb 2013 00:44:55 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q0isUD088973;
     Tue, 26 Feb 2013 00:44:54 GMT (envelope-from markj@svn.freebsd.org)
    Received: (from markj@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q0isnC088972;
     Tue, 26 Feb 2013 00:44:54 GMT (envelope-from markj@svn.freebsd.org)
    Message-Id: <201302260044.r1Q0isnC088972@svn.freebsd.org>
    From: Mark Johnston 
    Date: Tue, 26 Feb 2013 00:44: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: r247294 - stable/9/usr.bin/grep/regex
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 00:44:55 -0000
    
    Author: markj
    Date: Tue Feb 26 00:44:54 2013
    New Revision: 247294
    URL: http://svnweb.freebsd.org/changeset/base/247294
    
    Log:
      MFC r246917:
        Strengthen the check in IS_OUT_OF_BOUNDS to ensure that (j - 1) is a
        valid index into the input buffer.
      
      Approved by:	rstone (co-mentor)
    
    Modified:
      stable/9/usr.bin/grep/regex/tre-fastmatch.c
    Directory Properties:
      stable/9/usr.bin/grep/   (props changed)
    
    Modified: stable/9/usr.bin/grep/regex/tre-fastmatch.c
    ==============================================================================
    --- stable/9/usr.bin/grep/regex/tre-fastmatch.c	Tue Feb 26 00:43:01 2013	(r247293)
    +++ stable/9/usr.bin/grep/regex/tre-fastmatch.c	Tue Feb 26 00:44:54 2013	(r247294)
    @@ -103,7 +103,7 @@ static int	fastcmp(const fastmatch_t *fg
       ((!fg->reversed							\
         ? ((type == STR_WIDE) ? ((j + fg->wlen) > len)			\
     			  : ((j + fg->len) > len))			\
    -    : (j < 0)))
    +    : (j <= 0)))
     
     /*
      * Checks whether the new position after shifting in the input string
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 00:58:04 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 800C154B;
     Tue, 26 Feb 2013 00:58: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 43C6E221;
     Tue, 26 Feb 2013 00:58:04 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q0w4VW092340;
     Tue, 26 Feb 2013 00:58:04 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q0w4Eh092339;
     Tue, 26 Feb 2013 00:58:04 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201302260058.r1Q0w4Eh092339@svn.freebsd.org>
    From: Xin LI 
    Date: Tue, 26 Feb 2013 00:58:04 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-vendor@freebsd.org
    Subject: svn commit: r247295 - vendor/expat/2.1.0
    X-SVN-Group: vendor
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 00:58:04 -0000
    
    Author: delphij
    Date: Tue Feb 26 00:58:03 2013
    New Revision: 247295
    URL: http://svnweb.freebsd.org/changeset/base/247295
    
    Log:
      Tag expat 2.1.0.
    
    Added:
      vendor/expat/2.1.0/
         - copied from r247294, vendor/expat/dist/
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 00:58:47 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 839396AD;
     Tue, 26 Feb 2013 00:58:47 +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 65BDC227;
     Tue, 26 Feb 2013 00:58:47 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q0wkRj092462;
     Tue, 26 Feb 2013 00:58:47 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q0wiJX092450;
     Tue, 26 Feb 2013 00:58:44 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201302260058.r1Q0wiJX092450@svn.freebsd.org>
    From: Xin LI 
    Date: Tue, 26 Feb 2013 00:58:44 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247296 - in head: contrib/expat contrib/expat/doc
     contrib/expat/examples contrib/expat/lib contrib/expat/tests
     contrib/expat/tests/benchmark contrib/expat/xmlwf lib/libexpat
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 00:58:47 -0000
    
    Author: delphij
    Date: Tue Feb 26 00:58:44 2013
    New Revision: 247296
    URL: http://svnweb.freebsd.org/changeset/base/247296
    
    Log:
      Update base system libexpat to 2.1.0.
      
      MFC after:	3 days
    
    Added:
      head/contrib/expat/FREEBSD-Xlist
         - copied unchanged from r247293, vendor/expat/dist/FREEBSD-Xlist
    Deleted:
      head/contrib/expat/FREEBSD-upgrade
      head/contrib/expat/configure
      head/contrib/expat/doc/valid-xhtml10.png
      head/contrib/expat/lib/winconfig.h
      head/contrib/expat/tests/benchmark/benchmark.dsp
      head/contrib/expat/tests/benchmark/benchmark.dsw
    Modified:
      head/contrib/expat/Changes   (contents, props changed)
      head/contrib/expat/MANIFEST   (contents, props changed)
      head/contrib/expat/Makefile.in   (contents, props changed)
      head/contrib/expat/README   (contents, props changed)
      head/contrib/expat/configure.in   (contents, props changed)
      head/contrib/expat/doc/reference.html   (contents, props changed)
      head/contrib/expat/doc/xmlwf.sgml   (contents, props changed)
      head/contrib/expat/expat_config.h.in   (contents, props changed)
      head/contrib/expat/lib/expat.h   (contents, props changed)
      head/contrib/expat/lib/xmlparse.c   (contents, props changed)
      head/contrib/expat/lib/xmlrole.c   (contents, props changed)
      head/contrib/expat/lib/xmltok.c   (contents, props changed)
      head/contrib/expat/lib/xmltok_impl.c   (contents, props changed)
      head/contrib/expat/tests/README.txt   (contents, props changed)
      head/contrib/expat/tests/minicheck.h
      head/contrib/expat/tests/runtests.c   (contents, props changed)
      head/contrib/expat/tests/xmltest.sh   (contents, props changed)
      head/contrib/expat/xmlwf/readfilemap.c   (contents, props changed)
      head/contrib/expat/xmlwf/xmlwf.c   (contents, props changed)
      head/lib/libexpat/expat_config.h
      head/lib/libexpat/libbsdxml.3
    Directory Properties:
      head/contrib/expat/   (props changed)
      head/contrib/expat/COPYING   (props changed)
      head/contrib/expat/doc/style.css   (props changed)
      head/contrib/expat/doc/xmlwf.1   (props changed)
      head/contrib/expat/examples/elements.c   (props changed)
      head/contrib/expat/examples/outline.c   (props changed)
      head/contrib/expat/lib/ascii.h   (props changed)
      head/contrib/expat/lib/asciitab.h   (props changed)
      head/contrib/expat/lib/iasciitab.h   (props changed)
      head/contrib/expat/lib/internal.h   (props changed)
      head/contrib/expat/lib/latin1tab.h   (props changed)
      head/contrib/expat/lib/nametab.h   (props changed)
      head/contrib/expat/lib/utf8tab.h   (props changed)
      head/contrib/expat/lib/xmlrole.h   (props changed)
      head/contrib/expat/lib/xmltok.h   (props changed)
      head/contrib/expat/lib/xmltok_impl.h   (props changed)
      head/contrib/expat/lib/xmltok_ns.c   (props changed)
      head/contrib/expat/tests/chardata.c   (props changed)
      head/contrib/expat/tests/chardata.h   (props changed)
      head/contrib/expat/xmlwf/codepage.c   (props changed)
      head/contrib/expat/xmlwf/codepage.h   (props changed)
      head/contrib/expat/xmlwf/ct.c   (props changed)
      head/contrib/expat/xmlwf/filemap.h   (props changed)
      head/contrib/expat/xmlwf/unixfilemap.c   (props changed)
      head/contrib/expat/xmlwf/win32filemap.c   (props changed)
      head/contrib/expat/xmlwf/xmlfile.c   (props changed)
      head/contrib/expat/xmlwf/xmlfile.h   (props changed)
      head/contrib/expat/xmlwf/xmlmime.c   (props changed)
      head/contrib/expat/xmlwf/xmlmime.h   (props changed)
      head/contrib/expat/xmlwf/xmltchar.h   (props changed)
      head/contrib/expat/xmlwf/xmlurl.h   (props changed)
      head/contrib/expat/xmlwf/xmlwin32url.cxx   (props changed)
    
    Modified: head/contrib/expat/Changes
    ==============================================================================
    --- head/contrib/expat/Changes	Tue Feb 26 00:58:03 2013	(r247295)
    +++ head/contrib/expat/Changes	Tue Feb 26 00:58:44 2013	(r247296)
    @@ -1,5 +1,41 @@
    +Release 2.1.0 Sat March 24 2012
    +        - Bug Fixes:
    +          #1742315: Harmful XML_ParserCreateNS suggestion.
    +          #2895533: CVE-2012-1147 - Resource leak in readfilemap.c.
    +          #1785430: Expat build fails on linux-amd64 with gcc version>=4.1 -O3.
    +          #1983953, 2517952, 2517962, 2649838: 
    +                Build modifications using autoreconf instead of buildconf.sh.
    +          #2815947, #2884086: OBJEXT and EXEEXT support while building.
    +          #1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences.
    +          #2517938: xmlwf should return non-zero exit status if not well-formed.
    +          #2517946: Wrong statement about XMLDecl in xmlwf.1 and xmlwf.sgml.
    +          #2855609: Dangling positionPtr after error.
    +          #2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8().
    +          #2958794: CVE-2012-1148 - Memory leak in poolGrow.
    +          #2990652: CMake support.
    +          #3010819: UNEXPECTED_STATE with a trailing "%" in entity value.
    +          #3206497: Unitialized memory returned from XML_Parse.
    +          #3287849: make check fails on mingw-w64.
    +          #3496608: CVE-2012-0876 - Hash DOS attack.
    +        - Patches:
    +          #1749198: pkg-config support.
    +          #3010222: Fix for bug #3010819.
    +          #3312568: CMake support.
    +          #3446384: Report byte offsets for attr names and values.
    +        - New Features / API changes:
    +          Added new API member XML_SetHashSalt() that allows setting an intial
    +                value (salt) for hash calculations. This is part of the fix for
    +                bug #3496608 to randomize hash parameters.
    +          When compiled with XML_ATTR_INFO defined, adds new API member
    +                XML_GetAttributeInfo() that allows retrieving the byte
    +                offsets for attribute names and values (patch #3446384).
    +          Added CMake build system.
    +                See bug #2990652 and patch #3312568.
    +          Added run-benchmark target to Makefile.in - relies on testdata module
    +                present in the same relative location as in the repository.
    +          
     Release 2.0.1 Tue June 5 2007
    -        - Fixed bugs #1515266, 1515600: The character data handler's calling
    +        - Fixed bugs #1515266, #1515600: The character data handler's calling
               of XML_StopParser() was not handled properly; if the parser was
               stopped and the handler set to NULL, the parser would segfault.
             - Fixed bug #1690883: Expat failed on EBCDIC systems as it assumed
    @@ -8,7 +44,7 @@ Release 2.0.1 Tue June 5 2007
             - Fixed xmlwf bug #1513566: "out of memory" error on file size zero.
             - Fixed outline.c bug #1543233: missing a final XML_ParserFree() call.
             - Fixes and improvements for Windows platform:
    -          bugs #1409451, #1476160, 1548182, 1602769, 1717322.
    +          bugs #1409451, #1476160, #1548182, #1602769, #1717322.
             - Build fixes for various platforms:
               HP-UX, Tru64, Solaris 9: patch #1437840, bug #1196180.
               All Unix: #1554618 (refreshed config.sub/config.guess).
    @@ -30,8 +66,8 @@ Release 2.0.0 Wed Jan 11 2006
               byte indexes and line/column numbers.
             - Updated to use libtool 1.5.22 (the most recent).
             - Added support for AmigaOS.
    -        - Some mostly minor bug fixes. SF issues include: 1006708,
    -          1021776, 1023646, 1114960, 1156398, 1221160, 1271642.
    +        - Some mostly minor bug fixes. SF issues include: #1006708,
    +          #1021776, #1023646, #1114960, #1156398, #1221160, #1271642.
     
     Release 1.95.8 Fri Jul 23 2004
             - Major new feature: suspend/resume.  Handlers can now request
    @@ -40,8 +76,8 @@ Release 1.95.8 Fri Jul 23 2004
               documentation for more details.
             - Some mostly minor bug fixes, but compilation should no
               longer generate warnings on most platforms.  SF issues
    -          include: 827319, 840173, 846309, 888329, 896188, 923913,
    -          928113, 961698, 985192.
    +          include: #827319, #840173, #846309, #888329, #896188, #923913,
    +          #928113, #961698, #985192.
     
     Release 1.95.7 Mon Oct 20 2003
             - Fixed enum XML_Status issue (reported on SourceForge many
    @@ -54,19 +90,19 @@ Release 1.95.7 Mon Oct 20 2003
             - Improved ability to build without the configure-generated
               expat_config.h header.  This is useful for applications
               which embed Expat rather than linking in the library.
    -        - Fixed a variety of bugs: see SF issues 458907, 609603,
    -          676844, 679754, 692878, 692964, 695401, 699323, 699487,
    -          820946.
    +        - Fixed a variety of bugs: see SF issues #458907, #609603,
    +          #676844, #679754, #692878, #692964, #695401, #699323, #699487,
    +          #820946.
             - Improved hash table lookups.
             - Added more regression tests and improved documentation.
     
     Release 1.95.6 Tue Jan 28 2003
             - Added XML_FreeContentModel().
             - Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree().
    -        - Fixed a variety of bugs: see SF issues 615606, 616863,
    -          618199, 653180, 673791.
    +        - Fixed a variety of bugs: see SF issues #615606, #616863,
    +          #618199, #653180, #673791.
             - Enhanced the regression test suite.
    -        - Man page improvements: includes SF issue 632146.
    +        - Man page improvements: includes SF issue #632146.
     
     Release 1.95.5 Fri Sep 6 2002
             - Added XML_UseForeignDTD() for improved SAX2 support.
    @@ -84,9 +120,9 @@ Release 1.95.5 Fri Sep 6 2002
             - Reduced line-length for all source code and headers to be
               no longer than 80 characters, to help with AS/400 support.
             - Reduced memory copying during parsing (SF patch #600964).
    -        - Fixed a variety of bugs: see SF issues 580793, 434664,
    -          483514, 580503, 581069, 584041, 584183, 584832, 585537,
    -          596555, 596678, 598352, 598944, 599715, 600479, 600971.
    +        - Fixed a variety of bugs: see SF issues #580793, #434664,
    +          #483514, #580503, #581069, #584041, #584183, #584832, #585537,
    +          #596555, #596678, #598352, #598944, #599715, #600479, #600971.
     
     Release 1.95.4 Fri Jul 12 2002
             - Added support for VMS, contributed by Craig Berry.  See
    @@ -95,14 +131,14 @@ Release 1.95.4 Fri Jul 12 2002
               contributed by Thomas Wegner and Daryle Walker.
             - Added Borland C++ Builder 5 / BCC 5.5 support, contributed
               by Patrick McConnell (SF patch #538032).
    -        - Fixed a variety of bugs: see SF issues 441449, 563184,
    -          564342, 566334, 566901, 569461, 570263, 575168, 579196.
    +        - Fixed a variety of bugs: see SF issues #441449, #563184,
    +          #564342, #566334, #566901, #569461, #570263, #575168, #579196.
             - Made skippedEntityHandler conform to SAX2 (see source comment)
             - Re-implemented WFC: Entity Declared from XML 1.0 spec and
               added a new error "entity declared in parameter entity":
    -          see SF bug report 569461 and SF patch 578161
    +          see SF bug report #569461 and SF patch #578161
             - Re-implemented section 5.1 from XML 1.0 spec:
    -          see SF bug report 570263 and SF patch 578161
    +          see SF bug report #570263 and SF patch #578161
     
     Release 1.95.3 Mon Jun 3 2002
             - Added a project to the MSVC workspace to create a wchar_t
    @@ -114,9 +150,9 @@ Release 1.95.3 Mon Jun 3 2002
             - Made the XML_UNICODE builds usable (thanks, Karl!).
             - Allow xmlwf to read from standard input.
             - Install a man page for xmlwf on Unix systems.
    -        - Fixed many bugs; see SF bug reports 231864, 461380, 464837,
    -          466885, 469226, 477667, 484419, 487840, 494749, 496505,
    -          547350.  Other bugs which we can't test as easily may also
    +        - Fixed many bugs; see SF bug reports #231864, #461380, #464837,
    +          #466885, #469226, #477667, #484419, #487840, #494749, #496505,
    +          #547350.  Other bugs which we can't test as easily may also
               have been fixed, especially in the area of build support.
     
     Release 1.95.2 Fri Jul 27 2001
    
    Copied: head/contrib/expat/FREEBSD-Xlist (from r247293, vendor/expat/dist/FREEBSD-Xlist)
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/contrib/expat/FREEBSD-Xlist	Tue Feb 26 00:58:44 2013	(r247296, copy of r247293, vendor/expat/dist/FREEBSD-Xlist)
    @@ -0,0 +1,19 @@
    +# $FreeBSD$
    +*.MPW
    +*.cmake
    +*.def
    +*.dsp
    +*.dsw
    +*.m4
    +*.pc.in
    +*config.h
    +CMake*
    +Configure*
    +amiga
    +bcb5
    +configure
    +conftools
    +doc/valid-xhtml10.png
    +m4
    +vms
    +win32
    
    Modified: head/contrib/expat/MANIFEST
    ==============================================================================
    --- head/contrib/expat/MANIFEST	Tue Feb 26 00:58:03 2013	(r247295)
    +++ head/contrib/expat/MANIFEST	Tue Feb 26 00:58:44 2013	(r247296)
    @@ -1,5 +1,8 @@
    -amiga/stdlib.c
     amiga/launch.c
    +amiga/expat_68k.c
    +amiga/expat_68k.h
    +amiga/expat_68k_handler_stubs.c
    +amiga/expat_base.h
     amiga/expat_vectors.c
     amiga/expat_lib.c
     amiga/expat.xml
    @@ -42,25 +45,35 @@ doc/style.css
     doc/valid-xhtml10.png
     doc/xmlwf.1
     doc/xmlwf.sgml
    +CMakeLists.txt
    +CMake.README
     COPYING
     Changes
    +ConfigureChecks.cmake
     MANIFEST
     Makefile.in
     README
     configure
     configure.in
     expat_config.h.in
    +expat_config.h.cmake
    +expat.pc.in
     expat.dsw
    +aclocal.m4
     conftools/PrintPath
     conftools/ac_c_bigendian_cross.m4
    -conftools/config.guess
    -conftools/config.sub
     conftools/expat.m4
     conftools/get-version.sh
    +conftools/mkinstalldirs
    +conftools/config.guess
    +conftools/config.sub
     conftools/install-sh
    -conftools/libtool.m4
     conftools/ltmain.sh
    -conftools/mkinstalldirs
    +m4/libtool.m4
    +m4/ltversion.m4
    +m4/ltoptions.m4
    +m4/ltsugar.m4
    +m4/lt~obsolete.m4
     examples/elements.c
     examples/elements.dsp
     examples/outline.c
    
    Modified: head/contrib/expat/Makefile.in
    ==============================================================================
    --- head/contrib/expat/Makefile.in	Tue Feb 26 00:58:03 2013	(r247295)
    +++ head/contrib/expat/Makefile.in	Tue Feb 26 00:58:44 2013	(r247296)
    @@ -31,6 +31,7 @@ bindir = @bindir@
     libdir = @libdir@
     includedir = @includedir@
     man1dir = @mandir@/man1
    +pkgconfigdir = $(libdir)/pkgconfig
     
     top_builddir = .
     
    @@ -46,18 +47,18 @@ LIBRARY = libexpat.la
     
     DESTDIR = $(INSTALL_ROOT)
     
    -default:  buildlib xmlwf/xmlwf
    +default:  buildlib xmlwf/xmlwf@EXEEXT@
     
    -buildlib: $(LIBRARY)
    +buildlib: $(LIBRARY) expat.pc
     
    -all: $(LIBRARY) xmlwf/xmlwf examples/elements examples/outline
    +all: $(LIBRARY) expat.pc xmlwf/xmlwf@EXEEXT@ examples/elements examples/outline
     
     clean:
    -	cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs
    -	cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs
    -	cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs
    -	cd tests && rm -rf .libs runtests runtests.o runtestspp runtestspp.o
    -	cd tests && rm -f chardata.o minicheck.o
    +	cd lib && rm -f $(LIBRARY) *.@OBJEXT@ *.lo && rm -rf .libs _libs
    +	cd xmlwf && rm -f xmlwf *.@OBJEXT@ *.lo && rm -rf .libs _libs
    +	cd examples && rm -f elements outline *.@OBJEXT@ *.lo && rm -rf .libs _libs
    +	cd tests && rm -rf .libs runtests runtests.@OBJEXT@ runtestspp runtestspp.@OBJEXT@
    +	cd tests && rm -f chardata.@OBJEXT@ minicheck.@OBJEXT@
     	rm -rf .libs libexpat.la
     	rm -f examples/core tests/core xmlwf/core
     
    @@ -65,34 +66,37 @@ clobber: clean
     
     distclean: clean
     	rm -f expat_config.h config.status config.log config.cache libtool
    -	rm -f Makefile
    +	rm -f Makefile expat.pc
     
     extraclean: distclean
     	rm -f expat_config.h.in configure
    -	rm -f conftools/ltconfig conftools/ltmain.sh conftools/libtool.m4
    +	rm -f aclocal.m4 m4/*
    +	rm -f conftools/ltmain.sh conftools/install-sh conftools/config.guess conftools/config.sub
     
     check: tests/runtests tests/runtestspp
     	tests/runtests
     	tests/runtestspp
     
    -install: xmlwf/xmlwf installlib
    +install: xmlwf/xmlwf@EXEEXT@ installlib
     	$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
    -	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(DESTDIR)$(bindir)/xmlwf
    +	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf@EXEEXT@ $(DESTDIR)$(bindir)/xmlwf
     	$(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(man1dir)
     
    -installlib: $(LIBRARY) $(APIHEADER)
    -	$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
    +installlib: $(LIBRARY) $(APIHEADER) expat.pc
    +	$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) $(DESTDIR)$(pkgconfigdir)
     	$(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)/$(LIBRARY)
     	for FN in $(APIHEADER) ; do $(INSTALL_DATA) $$FN $(DESTDIR)$(includedir) ; done
    +	$(INSTALL_DATA) expat.pc $(DESTDIR)$(pkgconfigdir)/expat.pc
     
     uninstall: uninstalllib
    -	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf
    +	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf@EXEEXT@
     	rm -f $(DESTDIR)$(man1dir)/xmlwf.1
     
     uninstalllib:
     	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIBRARY)
     	rm -f $(DESTDIR)$(includedir)/expat.h
     	rm -f $(DESTDIR)$(includedir)/expat_external.h
    +	rm -f $(DESTDIR)$(pkgconfigdir)/expat.pc
     
     # for VPATH builds (invoked by configure)
     mkdir-init:
    @@ -125,6 +129,9 @@ LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo
     $(LIBRARY): $(LIB_OBJS)
     	$(LINK_LIB) $(LIB_OBJS)
     
    +expat.pc: $(top_builddir)/config.status
    +	cd $(top_builddir) && $(SHELL) ./config.status $@
    +
     lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \
     	$(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h
     
    @@ -137,46 +144,53 @@ lib/xmltok.lo: lib/xmltok.c lib/xmltok_i
     	$(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h
     
     
    -XMLWF_OBJS = xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/@FILEMAP@.o
    -xmlwf/xmlwf.o: xmlwf/xmlwf.c
    -xmlwf/xmlfile.o: xmlwf/xmlfile.c
    -xmlwf/codepage.o: xmlwf/codepage.c
    -xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c
    -xmlwf/xmlwf: $(XMLWF_OBJS) $(LIBRARY)
    +XMLWF_OBJS = xmlwf/xmlwf.@OBJEXT@ xmlwf/xmlfile.@OBJEXT@ xmlwf/codepage.@OBJEXT@ xmlwf/@FILEMAP@.@OBJEXT@
    +xmlwf/xmlwf.@OBJEXT@: xmlwf/xmlwf.c
    +xmlwf/xmlfile.@OBJEXT@: xmlwf/xmlfile.c
    +xmlwf/codepage.@OBJEXT@: xmlwf/codepage.c
    +xmlwf/@FILEMAP@.@OBJEXT@: xmlwf/@FILEMAP@.c
    +xmlwf/xmlwf@EXEEXT@: $(XMLWF_OBJS) $(LIBRARY)
     	$(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY)
     
    -examples/elements.o: examples/elements.c
    -examples/elements: examples/elements.o $(LIBRARY)
    +examples/elements.@OBJEXT@: examples/elements.c
    +examples/elements: examples/elements.@OBJEXT@ $(LIBRARY)
     	$(LINK_EXE) $< $(LIBRARY)
     
    -examples/outline.o: examples/outline.c
    -examples/outline: examples/outline.o $(LIBRARY)
    +examples/outline.@OBJEXT@: examples/outline.c
    +examples/outline: examples/outline.@OBJEXT@ $(LIBRARY)
     	$(LINK_EXE) $< $(LIBRARY)
     
    -tests/chardata.o: tests/chardata.c tests/chardata.h
    -tests/minicheck.o: tests/minicheck.c tests/minicheck.h
    -tests/runtests.o: tests/runtests.c tests/chardata.h
    -tests/runtests: tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY)
    -	$(LINK_EXE) tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY)
    -tests/runtestspp.o: tests/runtestspp.cpp tests/runtests.c tests/chardata.h
    -tests/runtestspp: tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY)
    -	$(LINK_CXX_EXE) tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY)
    +tests/chardata.@OBJEXT@: tests/chardata.c tests/chardata.h
    +tests/minicheck.@OBJEXT@: tests/minicheck.c tests/minicheck.h
    +tests/runtests.@OBJEXT@: tests/runtests.c tests/chardata.h
    +tests/runtests: tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
    +	$(LINK_EXE) tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
    +tests/runtestspp.@OBJEXT@: tests/runtestspp.cpp tests/runtests.c tests/chardata.h
    +tests/runtestspp: tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
    +	$(LINK_CXX_EXE) tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
    +
    +tests/benchmark/benchmark.@OBJEXT@: tests/benchmark/benchmark.c
    +tests/benchmark/benchmark: tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY)
    +	$(LINK_EXE) tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY)
    +
    +run-benchmark: tests/benchmark/benchmark
    +	tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
     
     tests/xmlts.zip:
     	wget --output-document=tests/xmlts.zip \
    -		http://www.w3.org/XML/Test/xmlts20020606.zip
    +		http://www.w3.org/XML/Test/xmlts20080827.zip
     
     tests/XML-Test-Suite: tests/xmlts.zip
     	cd tests && unzip -q xmlts.zip
     
    -run-xmltest: xmlwf/xmlwf tests/XML-Test-Suite
    +run-xmltest: xmlwf/xmlwf@EXEEXT@ tests/XML-Test-Suite
     	tests/xmltest.sh
     
    -.SUFFIXES: .c .cpp .lo .o
    +.SUFFIXES: .c .cpp .lo .@OBJEXT@
     
    -.cpp.o:
    +.cpp.@OBJEXT@:
     	$(CXXCOMPILE) -o $@ -c $<
    -.c.o:
    +.c.@OBJEXT@:
     	$(COMPILE) -o $@ -c $<
     .c.lo:
     	$(LTCOMPILE) -o $@ -c $<
    
    Modified: head/contrib/expat/README
    ==============================================================================
    --- head/contrib/expat/README	Tue Feb 26 00:58:03 2013	(r247295)
    +++ head/contrib/expat/README	Tue Feb 26 00:58:44 2013	(r247296)
    @@ -1,5 +1,5 @@
     
    -                        Expat, Release 2.0.1
    +                        Expat, Release 2.1.0
     
     This is Expat, a C library for parsing XML, written by James Clark.
     Expat is a stream-oriented XML parser.  This means that you register
    @@ -25,8 +25,7 @@ intended to be production grade software
     If you are building Expat from a check-out from the CVS repository,
     you need to run a script that generates the configure script using the
     GNU autoconf and libtool tools.  To do this, you need to have
    -autoconf 2.52 or newer and libtool 1.4 or newer (1.5 or newer preferred).
    -Run the script like this:
    +autoconf 2.58 or newer. Run the script like this:
     
             ./buildconf.sh
     
    @@ -65,8 +64,8 @@ location.  Have a look at the "Makefile"
     the directories into which things will be installed.
     
     If you are interested in building Expat to provide document
    -information in UTF-16 rather than the default UTF-8, follow these
    -instructions (after having run "make distclean"):
    +information in UTF-16 encoding rather than the default UTF-8, follow
    +these instructions (after having run "make distclean"):
     
             1. For UTF-16 output as unsigned short (and version/error
                strings as char), run:
    @@ -106,7 +105,10 @@ use DESTDIR=$(INSTALL_ROOT), even if DES
     environment, because variable-setting priority is
     1) commandline
     2) in-makefile
    -3) environment           
    +3) environment  
    +
    +Note: This only applies to the Expat library itself, building UTF-16 versions
    +of xmlwf and the tests is currently not supported.         
     
     Note for Solaris users:  The "ar" command is usually located in
     "/usr/ccs/bin", which is not in the default PATH.  You will need to
    
    Modified: head/contrib/expat/configure.in
    ==============================================================================
    --- head/contrib/expat/configure.in	Tue Feb 26 00:58:03 2013	(r247295)
    +++ head/contrib/expat/configure.in	Tue Feb 26 00:58:44 2013	(r247296)
    @@ -10,8 +10,8 @@ dnl   under the terms of the License (ba
     dnl   in the file COPYING that comes with this distribution.
     dnl
     
    -dnl Ensure that Expat is configured with autoconf 2.52 or newer
    -AC_PREREQ(2.52)
    +dnl Ensure that Expat is configured with autoconf 2.58 or newer
    +AC_PREREQ(2.58)
     
     dnl Get the version number of Expat, using m4's esyscmd() command to run
     dnl the command at m4-generation time. This allows us to create an m4
    @@ -25,12 +25,13 @@ dnl test. I believe this test will work,
     dnl GNU M4 to test it right now.
     define([expat_version], ifdef([__gnu__],
                                   [esyscmd(conftools/get-version.sh lib/expat.h)],
    -                              [2.0.x]))
    +                              [2.1.x]))
     AC_INIT(expat, expat_version, expat-bugs@libexpat.org)
     undefine([expat_version])
     
     AC_CONFIG_SRCDIR(Makefile.in)
     AC_CONFIG_AUX_DIR(conftools)
    +AC_CONFIG_MACRO_DIR([m4])
     
     
     dnl
    @@ -44,13 +45,12 @@ dnl 
     dnl If the API changes incompatibly set LIBAGE back to 0
     dnl
     
    -LIBCURRENT=6
    -LIBREVISION=2
    -LIBAGE=5
    +LIBCURRENT=7
    +LIBREVISION=0
    +LIBAGE=6
     
     AC_CONFIG_HEADER(expat_config.h)
     
    -sinclude(conftools/libtool.m4)
     sinclude(conftools/ac_c_bigendian_cross.m4)
     
     AC_LIBTOOL_WIN32_DLL
    @@ -62,6 +62,7 @@ AC_SUBST(LIBAGE)
     
     dnl Checks for programs.
     AC_PROG_CC
    +AC_PROG_CXX
     AC_PROG_INSTALL
     
     if test "$GCC" = yes ; then
    @@ -144,7 +145,7 @@ AC_DEFINE([XML_DTD], 1,
     AC_DEFINE([XML_CONTEXT_BYTES], 1024,
               [Define to specify how much context to retain around the current parse point.])
     
    -AC_CONFIG_FILES(Makefile)
    +AC_CONFIG_FILES([Makefile expat.pc])
     AC_OUTPUT
     
     abs_srcdir="`cd $srcdir && pwd`"
    
    Modified: head/contrib/expat/doc/reference.html
    ==============================================================================
    --- head/contrib/expat/doc/reference.html	Tue Feb 26 00:58:03 2013	(r247295)
    +++ head/contrib/expat/doc/reference.html	Tue Feb 26 00:58:44 2013	(r247296)
    @@ -129,8 +129,10 @@ interface.

  • XML_GetBase
  • XML_GetSpecifiedAttributeCount
  • XML_GetIdAttributeIndex
  • +
  • XML_GetAttributeInfo
  • XML_SetEncoding
  • XML_SetParamEntityParsing
  • +
  • XML_SetHashSalt
  • XML_UseForeignDTD
  • XML_SetReturnNSTriplet
  • XML_DefaultCurrent
  • @@ -369,6 +371,11 @@ footprint and can be faster. statically with the code that calls it; this is required to get all the right MSVC magic annotations correct. This is ignored on other platforms. + +
    XML_ATTR_INFO
    +
    If defined, makes the the additional function XML_GetAttributeInfo available +for reporting attribute byte offsets.

    @@ -917,12 +924,15 @@ XML_ParserCreateNS(const XML_Char *encod Constructs a new parser that has namespace processing in effect. Namespace expanded element names and attribute names are returned as a concatenation of the namespace URI, sep, and the local part of the name. This -means that you should pick a character for sep that can't be -part of a legal URI. There is a special case when sep is the null -character '\0': the namespace URI and the local part will be -concatenated without any separator - this is intended to support RDF processors. -It is a programming error to use the null separator with -namespace triplets. +means that you should pick a character for sep that can't be part +of an URI. Since Expat does not check namespace URIs for conformance, the +only safe choice for a namespace separator is a character that is illegal +in XML. For instance, '\xFF' is not legal in UTF-8, and +'\xFFFF' is not legal in UTF-16. There is a special case when +sep is the null character '\0': the namespace URI and +the local part will be concatenated without any separator - this is intended +to support RDF processors. It is a programming error to use the null separator +with namespace triplets.
     XML_Parser XMLCALL
    @@ -2074,6 +2084,27 @@ attribute. If called inside a start hand
     current call.
     
     
    +
    +const XML_AttrInfo * XMLCALL
    +XML_GetAttributeInfo(XML_Parser parser);
    +
    +
    +typedef struct {
    +  XML_Index  nameStart;  /* Offset to beginning of the attribute name. */
    +  XML_Index  nameEnd;    /* Offset after the attribute name's last byte. */
    +  XML_Index  valueStart; /* Offset to beginning of the attribute value. */
    +  XML_Index  valueEnd;   /* Offset after the attribute value's last byte. */
    +} XML_AttrInfo;
    +
    +
    +Returns an array of XML_AttrInfo structures for the +attribute/value pairs passed in the last call to the +XML_StartElementHandler that were specified +in the start-tag rather than defaulted. Each attribute/value pair counts +as 1; thus the number of entries in the array is +XML_GetSpecifiedAttributeCount(parser) / 2. +
    +
     enum XML_Status XMLCALL
     XML_SetEncoding(XML_Parser p,
    @@ -2104,6 +2135,24 @@ The choices for code are:
     
  • XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE
  • XML_PARAM_ENTITY_PARSING_ALWAYS
  • +Note: If XML_SetParamEntityParsing is called after +XML_Parse or XML_ParseBuffer, then it has +no effect and will always return 0. + + +
    +int XMLCALL
    +XML_SetHashSalt(XML_Parser p,
    +                unsigned long hash_salt);
    +
    +
    +Sets the hash salt to use for internal hash calculations. +Helps in preventing DoS attacks based on predicting hash +function behavior. In order to have an effect this must be called +before parsing has started. Returns 1 if successful, 0 when called +after XML_Parse or XML_ParseBuffer. +

    Note: This call is optional, as the parser will auto-generate a new +random salt value if no value has been set at the start of parsing.

    
    Modified: head/contrib/expat/doc/xmlwf.sgml
    ==============================================================================
    --- head/contrib/expat/doc/xmlwf.sgml	Tue Feb 26 00:58:03 2013	(r247295)
    +++ head/contrib/expat/doc/xmlwf.sgml	Tue Feb 26 00:58:44 2013	(r247296)
    @@ -389,11 +389,6 @@ supports both.
       
         BUGS
     	
    -	According to the W3C standard, an XML file without a
    -	declaration at the beginning is not considered well-formed.
    -	However, &dhpackage; allows this to pass.
    -	
    -	
     	&dhpackage; returns a 0 - noerr result,
     	even if the file is not well-formed.  There is no good way for
     	a program to use &dhpackage; to quickly
    
    Modified: head/contrib/expat/expat_config.h.in
    ==============================================================================
    --- head/contrib/expat/expat_config.h.in	Tue Feb 26 00:58:03 2013	(r247295)
    +++ head/contrib/expat/expat_config.h.in	Tue Feb 26 00:58:44 2013	(r247296)
    @@ -39,6 +39,9 @@
     /* Define to 1 if you have the  header file. */
     #undef HAVE_STRING_H
     
    +/* Define to 1 if you have the  header file. */
    +#undef HAVE_SYS_PARAM_H
    +
     /* Define to 1 if you have the  header file. */
     #undef HAVE_SYS_STAT_H
     
    @@ -48,6 +51,10 @@
     /* Define to 1 if you have the  header file. */
     #undef HAVE_UNISTD_H
     
    +/* Define to the sub-directory in which libtool stores uninstalled libraries.
    +   */
    +#undef LT_OBJDIR
    +
     /* Define to the address where bug reports for this package should be sent. */
     #undef PACKAGE_BUGREPORT
     
    @@ -60,6 +67,9 @@
     /* Define to the one symbol short name of this package. */
     #undef PACKAGE_TARNAME
     
    +/* Define to the home page for this package. */
    +#undef PACKAGE_URL
    +
     /* Define to the version of this package. */
     #undef PACKAGE_VERSION
     
    @@ -85,8 +95,8 @@
     /* Define to empty if `const' does not conform to ANSI C. */
     #undef const
     
    -/* Define to `long' if  does not define. */
    +/* Define to `long int' if  does not define. */
     #undef off_t
     
    -/* Define to `unsigned' if  does not define. */
    +/* Define to `unsigned int' if  does not define. */
     #undef size_t
    
    Modified: head/contrib/expat/lib/expat.h
    ==============================================================================
    --- head/contrib/expat/lib/expat.h	Tue Feb 26 00:58:03 2013	(r247295)
    +++ head/contrib/expat/lib/expat.h	Tue Feb 26 00:58:44 2013	(r247296)
    @@ -742,6 +742,29 @@ XML_GetSpecifiedAttributeCount(XML_Parse
     XMLPARSEAPI(int)
     XML_GetIdAttributeIndex(XML_Parser parser);
     
    +#ifdef XML_ATTR_INFO
    +/* Source file byte offsets for the start and end of attribute names and values.
    +   The value indices are exclusive of surrounding quotes; thus in a UTF-8 source
    +   file an attribute value of "blah" will yield:
    +   info->valueEnd - info->valueStart = 4 bytes.
    +*/
    +typedef struct {
    +  XML_Index  nameStart;  /* Offset to beginning of the attribute name. */
    +  XML_Index  nameEnd;    /* Offset after the attribute name's last byte. */
    +  XML_Index  valueStart; /* Offset to beginning of the attribute value. */
    +  XML_Index  valueEnd;   /* Offset after the attribute value's last byte. */
    +} XML_AttrInfo;
    +
    +/* Returns an array of XML_AttrInfo structures for the attribute/value pairs
    +   passed in last call to the XML_StartElementHandler that were specified
    +   in the start-tag rather than defaulted. Each attribute/value pair counts
    +   as 1; thus the number of entries in the array is
    +   XML_GetSpecifiedAttributeCount(parser) / 2.
    +*/
    +XMLPARSEAPI(const XML_AttrInfo *)
    +XML_GetAttributeInfo(XML_Parser parser);
    +#endif
    +
     /* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
        detected.  The last call to XML_Parse must have isFinal true; len
        may be zero for this call (or any other).
    @@ -883,6 +906,15 @@ XMLPARSEAPI(int)
     XML_SetParamEntityParsing(XML_Parser parser,
                               enum XML_ParamEntityParsing parsing);
     
    +/* Sets the hash salt to use for internal hash calculations.
    +   Helps in preventing DoS attacks based on predicting hash
    +   function behavior. This must be called before parsing is started.
    +   Returns 1 if successful, 0 when called after parsing has started.
    +*/
    +XMLPARSEAPI(int)
    +XML_SetHashSalt(XML_Parser parser,
    +                unsigned long hash_salt);
    +
     /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
        XML_GetErrorCode returns information about the error.
     */
    @@ -984,7 +1016,8 @@ enum XML_FeatureEnum {
       XML_FEATURE_SIZEOF_XML_CHAR,
       XML_FEATURE_SIZEOF_XML_LCHAR,
       XML_FEATURE_NS,
    -  XML_FEATURE_LARGE_SIZE
    +  XML_FEATURE_LARGE_SIZE,
    +  XML_FEATURE_ATTR_INFO
       /* Additional features must be added to the end of this enum. */
     };
     
    @@ -1004,8 +1037,8 @@ XML_GetFeatureList(void);
        change to major or minor version.
     */
     #define XML_MAJOR_VERSION 2
    -#define XML_MINOR_VERSION 0
    -#define XML_MICRO_VERSION 1
    +#define XML_MINOR_VERSION 1
    +#define XML_MICRO_VERSION 0
     
     #ifdef __cplusplus
     }
    
    Modified: head/contrib/expat/lib/xmlparse.c
    ==============================================================================
    --- head/contrib/expat/lib/xmlparse.c	Tue Feb 26 00:58:03 2013	(r247295)
    +++ head/contrib/expat/lib/xmlparse.c	Tue Feb 26 00:58:44 2013	(r247296)
    @@ -5,6 +5,8 @@
     #include 
     #include                      /* memset(), memcpy() */
     #include 
    +#include                      /* UINT_MAX */
    +#include                        /* time() */
     
     #define XML_BUILDING_EXPAT 1
     
    @@ -12,7 +14,7 @@
     #include "winconfig.h"
     #elif defined(MACOS_CLASSIC)
     #include "macconfig.h"
    -#elif defined(__amigaos4__)
    +#elif defined(__amigaos__)
     #include "amigaconfig.h"
     #elif defined(__WATCOMC__)
     #include "watcomconfig.h"
    @@ -327,15 +329,15 @@ processXmlDecl(XML_Parser parser, int is
     static enum XML_Error
     initializeEncoding(XML_Parser parser);
     static enum XML_Error
    -doProlog(XML_Parser parser, const ENCODING *enc, const char *s, 
    -         const char *end, int tok, const char *next, const char **nextPtr, 
    +doProlog(XML_Parser parser, const ENCODING *enc, const char *s,
    +         const char *end, int tok, const char *next, const char **nextPtr,
              XML_Bool haveMore);
     static enum XML_Error
    -processInternalEntity(XML_Parser parser, ENTITY *entity, 
    +processInternalEntity(XML_Parser parser, ENTITY *entity,
                           XML_Bool betweenDecl);
     static enum XML_Error
     doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
    -          const char *start, const char *end, const char **endPtr, 
    +          const char *start, const char *end, const char **endPtr,
               XML_Bool haveMore);
     static enum XML_Error
     doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr,
    @@ -353,7 +355,7 @@ static enum XML_Error
     addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
                const XML_Char *uri, BINDING **bindingsPtr);
     static int
    -defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata, 
    +defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata,
                     XML_Bool isId, const XML_Char *dfltValue, XML_Parser parser);
     static enum XML_Error
     storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata,
    @@ -391,12 +393,13 @@ static void dtdReset(DTD *p, const XML_M
     static void
     dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms);
     static int
    -dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
    +dtdCopy(XML_Parser oldParser,
    +        DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
     static int
    -copyEntityTable(HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
    -
    +copyEntityTable(XML_Parser oldParser,
    +                HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
     static NAMED *
    -lookup(HASH_TABLE *table, KEY name, size_t createSize);
    +lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize);
     static void FASTCALL
     hashTableInit(HASH_TABLE *, const XML_Memory_Handling_Suite *ms);
     static void FASTCALL hashTableClear(HASH_TABLE *);
    @@ -429,11 +432,15 @@ static ELEMENT_TYPE *
     getElementType(XML_Parser parser, const ENCODING *enc,
                    const char *ptr, const char *end);
     
    +static unsigned long generate_hash_secret_salt(void);
    +static XML_Bool startParsing(XML_Parser parser);
    +
     static XML_Parser
     parserCreate(const XML_Char *encodingName,
                  const XML_Memory_Handling_Suite *memsuite,
                  const XML_Char *nameSep,
                  DTD *dtd);
    +
     static void
     parserInit(XML_Parser parser, const XML_Char *encodingName);
     
    @@ -533,6 +540,9 @@ struct XML_ParserStruct {
       NS_ATT *m_nsAtts;
       unsigned long m_nsAttsVersion;
       unsigned char m_nsAttsPower;
    +#ifdef XML_ATTR_INFO
    +  XML_AttrInfo *m_attInfo;
    +#endif
       POSITION m_position;
       STRING_POOL m_tempPool;
       STRING_POOL m_temp2Pool;
    @@ -546,6 +556,7 @@ struct XML_ParserStruct {
       XML_Bool m_useForeignDTD;
       enum XML_ParamEntityParsing m_paramEntityParsing;
     #endif
    +  unsigned long m_hash_secret_salt;
     };
     
     #define MALLOC(s) (parser->m_mem.malloc_fcn((s)))
    @@ -640,6 +651,7 @@ struct XML_ParserStruct {
     #define nsAtts (parser->m_nsAtts)
     #define nsAttsVersion (parser->m_nsAttsVersion)
     #define nsAttsPower (parser->m_nsAttsPower)
    +#define attInfo (parser->m_attInfo)
     #define tempPool (parser->m_tempPool)
     #define temp2Pool (parser->m_temp2Pool)
     #define groupConnector (parser->m_groupConnector)
    @@ -653,6 +665,7 @@ struct XML_ParserStruct {
     #define useForeignDTD (parser->m_useForeignDTD)
     #define paramEntityParsing (parser->m_paramEntityParsing)
     #endif /* XML_DTD */
    +#define hash_secret_salt (parser->m_hash_secret_salt)
     
     XML_Parser XMLCALL
     XML_ParserCreate(const XML_Char *encodingName)
    @@ -670,29 +683,42 @@ XML_ParserCreateNS(const XML_Char *encod
     
     static const XML_Char implicitContext[] = {
       ASCII_x, ASCII_m, ASCII_l, ASCII_EQUALS, ASCII_h, ASCII_t, ASCII_t, ASCII_p,
    -  ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w, 
    +  ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w,
       ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD, ASCII_o, ASCII_r, ASCII_g,
       ASCII_SLASH, ASCII_X, ASCII_M, ASCII_L, ASCII_SLASH, ASCII_1, ASCII_9,
       ASCII_9, ASCII_8, ASCII_SLASH, ASCII_n, ASCII_a, ASCII_m, ASCII_e,
       ASCII_s, ASCII_p, ASCII_a, ASCII_c, ASCII_e, '\0'
     };
     
    +static unsigned long
    +generate_hash_secret_salt(void)
    +{
    +  unsigned int seed = time(NULL) % UINT_MAX;
    +  srand(seed);
    +  return rand();
    +}
    +
    +static XML_Bool  /* only valid for root parser */
    +startParsing(XML_Parser parser)
    +{
    +    /* hash functions must be initialized before setContext() is called */
    +    if (hash_secret_salt == 0)
    +      hash_secret_salt = generate_hash_secret_salt();
    +    if (ns) {
    +      /* implicit context only set for root parser, since child
    +         parsers (i.e. external entity parsers) will inherit it
    +      */
    +      return setContext(parser, implicitContext);
    +    }
    +    return XML_TRUE;
    +}
    +
     XML_Parser XMLCALL
     XML_ParserCreate_MM(const XML_Char *encodingName,
                         const XML_Memory_Handling_Suite *memsuite,
                         const XML_Char *nameSep)
     {
    -  XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL);
    -  if (parser != NULL && ns) {
    -    /* implicit context only set for root parser, since child
    -       parsers (i.e. external entity parsers) will inherit it
    -    */
    -    if (!setContext(parser, implicitContext)) {
    -      XML_ParserFree(parser);
    -      return NULL;
    -    }
    -  }
    -  return parser;
    +  return parserCreate(encodingName, memsuite, nameSep, NULL);
     }
     
     static XML_Parser
    @@ -737,9 +763,20 @@ parserCreate(const XML_Char *encodingNam
         FREE(parser);
         return NULL;
       }
    +#ifdef XML_ATTR_INFO
    +  attInfo = (XML_AttrInfo*)MALLOC(attsSize * sizeof(XML_AttrInfo));
    +  if (attInfo == NULL) {
    +    FREE(atts);
    +    FREE(parser);
    +    return NULL;
    +  }
    +#endif
       dataBuf = (XML_Char *)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));
       if (dataBuf == NULL) {
         FREE(atts);
    +#ifdef XML_ATTR_INFO
    +    FREE(attInfo);
    +#endif
         FREE(parser);
         return NULL;
       }
    @@ -752,6 +789,9 @@ parserCreate(const XML_Char *encodingNam
         if (_dtd == NULL) {
           FREE(dataBuf);
           FREE(atts);
    +#ifdef XML_ATTR_INFO
    +      FREE(attInfo);
    +#endif
           FREE(parser);
           return NULL;
         }
    @@ -866,6 +906,7 @@ parserInit(XML_Parser parser, const XML_
       useForeignDTD = XML_FALSE;
       paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
     #endif
    +  hash_secret_salt = 0;
     }
     
     /* moves list of bindings to freeBindingList */
    @@ -913,7 +954,7 @@ XML_ParserReset(XML_Parser parser, const
       poolClear(&temp2Pool);
       parserInit(parser, encodingName);
       dtdReset(_dtd, &parser->m_mem);
    -  return setContext(parser, implicitContext);
    +  return XML_TRUE;
     }
     
     enum XML_Status XMLCALL
    @@ -982,6 +1023,12 @@ XML_ExternalEntityParserCreate(XML_Parse
       int oldInEntityValue = prologState.inEntityValue;
     #endif
       XML_Bool oldns_triplets = ns_triplets;
    +  /* Note that the new parser shares the same hash secret as the old
    +     parser, so that dtdCopy and copyEntityTable can lookup values
    +     from hash tables associated with either parser without us having
    +     to worry which hash secrets each table has.
    +  */
    +  unsigned long oldhash_secret_salt = hash_secret_salt;
     
     #ifdef XML_DTD
       if (!context)
    @@ -1035,13 +1082,14 @@ XML_ExternalEntityParserCreate(XML_Parse
         externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg;
       defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
       ns_triplets = oldns_triplets;
    +  hash_secret_salt = oldhash_secret_salt;
       parentParser = oldParser;
     #ifdef XML_DTD
       paramEntityParsing = oldParamEntityParsing;
       prologState.inEntityValue = oldInEntityValue;
       if (context) {
     #endif /* XML_DTD */
    -    if (!dtdCopy(_dtd, oldDtd, &parser->m_mem)
    +    if (!dtdCopy(oldParser, _dtd, oldDtd, &parser->m_mem)
           || !setContext(parser, context)) {
           XML_ParserFree(parser);
           return NULL;
    @@ -1130,6 +1178,9 @@ XML_ParserFree(XML_Parser parser)
     #endif /* XML_DTD */
         dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem);
       FREE((void *)atts);
    +#ifdef XML_ATTR_INFO
    +  FREE((void *)attInfo);
    +#endif
       FREE(groupConnector);
       FREE(buffer);
       FREE(dataBuf);
    @@ -1210,6 +1261,14 @@ XML_GetIdAttributeIndex(XML_Parser parse
       return idAttIndex;
     }
     
    +#ifdef XML_ATTR_INFO
    +const XML_AttrInfo * XMLCALL
    +XML_GetAttributeInfo(XML_Parser parser)
    +{
    +  return attInfo;
    +}
    +#endif
    +
     void XMLCALL
     XML_SetElementHandler(XML_Parser parser,
                           XML_StartElementHandler start,
    @@ -1426,6 +1485,17 @@ XML_SetParamEntityParsing(XML_Parser par
     #endif
     }
     
    +int XMLCALL
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 01:00:16 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 2E39F839;
     Tue, 26 Feb 2013 01:00:16 +0000 (UTC)
     (envelope-from attilio@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 1BE1F23E;
     Tue, 26 Feb 2013 01:00:16 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q10GwV094184;
     Tue, 26 Feb 2013 01:00:16 GMT (envelope-from attilio@svn.freebsd.org)
    Received: (from attilio@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q10Cns093263;
     Tue, 26 Feb 2013 01:00:12 GMT (envelope-from attilio@svn.freebsd.org)
    Message-Id: <201302260100.r1Q10Cns093263@svn.freebsd.org>
    From: Attilio Rao 
    Date: Tue, 26 Feb 2013 01:00:12 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247297 - in head/sys: arm/at91 arm/sa11x0 fs/fuse kern
     mips/adm5120 mips/alchemy mips/beri mips/cavium mips/gxemul mips/idt
     mips/malta mips/rt305x mips/sentry5 mips/sibyte powerpc/aim ...
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 01:00:16 -0000
    
    Author: attilio
    Date: Tue Feb 26 01:00:11 2013
    New Revision: 247297
    URL: http://svnweb.freebsd.org/changeset/base/247297
    
    Log:
      Merge from vmobj-rwlock branch:
      Remove unused inclusion of vm/vm_pager.h and vm/vnode_pager.h.
      
      Sponsored by:	EMC / Isilon storage division
      Tested by:	pho
      Reviewed by:	alc
    
    Modified:
      head/sys/arm/at91/at91_machdep.c
      head/sys/arm/sa11x0/assabet_machdep.c
      head/sys/fs/fuse/fuse_io.c
      head/sys/kern/sys_process.c
      head/sys/mips/adm5120/adm5120_machdep.c
      head/sys/mips/alchemy/alchemy_machdep.c
      head/sys/mips/beri/beri_machdep.c
      head/sys/mips/cavium/octeon_machdep.c
      head/sys/mips/gxemul/gxemul_machdep.c
      head/sys/mips/idt/idt_machdep.c
      head/sys/mips/malta/malta_machdep.c
      head/sys/mips/rt305x/rt305x_machdep.c
      head/sys/mips/sentry5/s5_machdep.c
      head/sys/mips/sibyte/sb_machdep.c
      head/sys/powerpc/aim/mmu_oea.c
      head/sys/powerpc/aim/mmu_oea64.c
      head/sys/powerpc/aim/moea64_native.c
      head/sys/powerpc/ps3/mmu_ps3.c
      head/sys/sparc64/sparc64/tsb.c
    
    Modified: head/sys/arm/at91/at91_machdep.c
    ==============================================================================
    --- head/sys/arm/at91/at91_machdep.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/arm/at91/at91_machdep.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -76,7 +76,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/arm/sa11x0/assabet_machdep.c
    ==============================================================================
    --- head/sys/arm/sa11x0/assabet_machdep.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/arm/sa11x0/assabet_machdep.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -79,7 +79,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/fs/fuse/fuse_io.c
    ==============================================================================
    --- head/sys/fs/fuse/fuse_io.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/fs/fuse/fuse_io.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -87,8 +87,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
    -#include 
     #include 
     
     #include "fuse.h"
    
    Modified: head/sys/kern/sys_process.c
    ==============================================================================
    --- head/sys/kern/sys_process.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/kern/sys_process.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     
     #ifdef COMPAT_FREEBSD32
    
    Modified: head/sys/mips/adm5120/adm5120_machdep.c
    ==============================================================================
    --- head/sys/mips/adm5120/adm5120_machdep.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/mips/adm5120/adm5120_machdep.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     
     #include 
     #include 
    
    Modified: head/sys/mips/alchemy/alchemy_machdep.c
    ==============================================================================
    --- head/sys/mips/alchemy/alchemy_machdep.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/mips/alchemy/alchemy_machdep.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     
     #include 
     #include 
    
    Modified: head/sys/mips/beri/beri_machdep.c
    ==============================================================================
    --- head/sys/mips/beri/beri_machdep.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/mips/beri/beri_machdep.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     
     #include 
     #include 
    
    Modified: head/sys/mips/cavium/octeon_machdep.c
    ==============================================================================
    --- head/sys/mips/cavium/octeon_machdep.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/mips/cavium/octeon_machdep.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     
     #include 
     #include 
    
    Modified: head/sys/mips/gxemul/gxemul_machdep.c
    ==============================================================================
    --- head/sys/mips/gxemul/gxemul_machdep.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/mips/gxemul/gxemul_machdep.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     
     #include 
     #include 
    
    Modified: head/sys/mips/idt/idt_machdep.c
    ==============================================================================
    --- head/sys/mips/idt/idt_machdep.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/mips/idt/idt_machdep.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     
     #include 
     #include 
    
    Modified: head/sys/mips/malta/malta_machdep.c
    ==============================================================================
    --- head/sys/mips/malta/malta_machdep.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/mips/malta/malta_machdep.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     
     #include 
     #include 
    
    Modified: head/sys/mips/rt305x/rt305x_machdep.c
    ==============================================================================
    --- head/sys/mips/rt305x/rt305x_machdep.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/mips/rt305x/rt305x_machdep.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     
     #include 
     #include 
    
    Modified: head/sys/mips/sentry5/s5_machdep.c
    ==============================================================================
    --- head/sys/mips/sentry5/s5_machdep.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/mips/sentry5/s5_machdep.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     
     #include 
     #include 
    
    Modified: head/sys/mips/sibyte/sb_machdep.c
    ==============================================================================
    --- head/sys/mips/sibyte/sb_machdep.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/mips/sibyte/sb_machdep.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     
     #include 
     #include 
    
    Modified: head/sys/powerpc/aim/mmu_oea.c
    ==============================================================================
    --- head/sys/powerpc/aim/mmu_oea.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/powerpc/aim/mmu_oea.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -136,7 +136,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     
     #include 
    
    Modified: head/sys/powerpc/aim/mmu_oea64.c
    ==============================================================================
    --- head/sys/powerpc/aim/mmu_oea64.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/powerpc/aim/mmu_oea64.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -140,7 +140,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     
     #include 
    
    Modified: head/sys/powerpc/aim/moea64_native.c
    ==============================================================================
    --- head/sys/powerpc/aim/moea64_native.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/powerpc/aim/moea64_native.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -117,7 +117,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     
     #include 
     #include 
    
    Modified: head/sys/powerpc/ps3/mmu_ps3.c
    ==============================================================================
    --- head/sys/powerpc/ps3/mmu_ps3.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/powerpc/ps3/mmu_ps3.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     
     #include 
    
    Modified: head/sys/sparc64/sparc64/tsb.c
    ==============================================================================
    --- head/sys/sparc64/sparc64/tsb.c	Tue Feb 26 00:58:44 2013	(r247296)
    +++ head/sys/sparc64/sparc64/tsb.c	Tue Feb 26 01:00:11 2013	(r247297)
    @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     
     #include 
     #include 
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 02:13:03 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id CC9AC5A6;
     Tue, 26 Feb 2013 02:13:03 +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 AAE34726;
     Tue, 26 Feb 2013 02:13:03 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q2D3Ra016806;
     Tue, 26 Feb 2013 02:13:03 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q2D2N1016801;
     Tue, 26 Feb 2013 02:13:02 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201302260213.r1Q2D2N1016801@svn.freebsd.org>
    From: Xin LI 
    Date: Tue, 26 Feb 2013 02:13:02 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247300 - in head: sys/sys usr.bin/truss
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 02:13:03 -0000
    
    Author: delphij
    Date: Tue Feb 26 02:13:02 2013
    New Revision: 247300
    URL: http://svnweb.freebsd.org/changeset/base/247300
    
    Log:
      Expose timespec and timeval macros when __BSD_VISIBLE is defined.  This
      allows userland application to use the following macros:
      
      	timespecclear, timespecisset, timespeccmp, timespecadd,
      	timespecsub;
      
      	timevalclear, timevalisset, timevalcmp.
      
      MFC after:	1 month
    
    Modified:
      head/sys/sys/time.h
      head/usr.bin/truss/main.c
      head/usr.bin/truss/syscalls.c
      head/usr.bin/truss/truss.h
    
    Modified: head/sys/sys/time.h
    ==============================================================================
    --- head/sys/sys/time.h	Tue Feb 26 01:38:12 2013	(r247299)
    +++ head/sys/sys/time.h	Tue Feb 26 02:13:02 2013	(r247300)
    @@ -156,9 +156,6 @@ timeval2bintime(const struct timeval *tv
     	/* 18446744073709 = int(2^64 / 1000000) */
     	bt->frac = tv->tv_usec * (uint64_t)18446744073709LL;
     }
    -#endif /* __BSD_VISIBLE */
    -
    -#ifdef _KERNEL
     
     /* Operations on timespecs */
     #define	timespecclear(tvp)	((tvp)->tv_sec = (tvp)->tv_nsec = 0)
    @@ -197,7 +194,7 @@ timeval2bintime(const struct timeval *tv
     
     /* timevaladd and timevalsub are not inlined */
     
    -#endif /* _KERNEL */
    +#endif /* __BSD_VISIBLE */
     
     #ifndef _KERNEL			/* NetBSD/OpenBSD compatible interfaces */
     
    
    Modified: head/usr.bin/truss/main.c
    ==============================================================================
    --- head/usr.bin/truss/main.c	Tue Feb 26 01:38:12 2013	(r247299)
    +++ head/usr.bin/truss/main.c	Tue Feb 26 02:13:02 2013	(r247300)
    @@ -323,14 +323,14 @@ START_TRACE:
     				fprintf(trussinfo->outfile, "%5d: ",
     				    trussinfo->pid);
     			if (trussinfo->flags & ABSOLUTETIMESTAMPS) {
    -				timespecsubt(&trussinfo->curthread->after,
    +				timespecsubt_to(&trussinfo->curthread->after,
     				    &trussinfo->start_time, &timediff);
     				fprintf(trussinfo->outfile, "%ld.%09ld ",
     				    (long)timediff.tv_sec,
     				    timediff.tv_nsec);
     			}
     			if (trussinfo->flags & RELATIVETIMESTAMPS) {
    -				timespecsubt(&trussinfo->curthread->after,
    +				timespecsubt_to(&trussinfo->curthread->after,
     				    &trussinfo->curthread->before, &timediff);
     				fprintf(trussinfo->outfile, "%ld.%09ld ",
     				    (long)timediff.tv_sec,
    @@ -349,14 +349,14 @@ START_TRACE:
     				fprintf(trussinfo->outfile, "%5d: ",
     				    trussinfo->pid);
     			if (trussinfo->flags & ABSOLUTETIMESTAMPS) {
    -				timespecsubt(&trussinfo->curthread->after,
    +				timespecsubt_to(&trussinfo->curthread->after,
     				    &trussinfo->start_time, &timediff);
     				fprintf(trussinfo->outfile, "%ld.%09ld ",
     				    (long)timediff.tv_sec,
     				    timediff.tv_nsec);
     			}
     			if (trussinfo->flags & RELATIVETIMESTAMPS) {
    -				timespecsubt(&trussinfo->curthread->after,
    +				timespecsubt_to(&trussinfo->curthread->after,
     				    &trussinfo->curthread->before, &timediff);
     				fprintf(trussinfo->outfile, "%ld.%09ld ",
     				    (long)timediff.tv_sec, timediff.tv_nsec);
    
    Modified: head/usr.bin/truss/syscalls.c
    ==============================================================================
    --- head/usr.bin/truss/syscalls.c	Tue Feb 26 01:38:12 2013	(r247299)
    +++ head/usr.bin/truss/syscalls.c	Tue Feb 26 02:13:02 2013	(r247300)
    @@ -1126,14 +1126,14 @@ print_syscall(struct trussinfo *trussinf
     	}
     
     	if (trussinfo->flags & ABSOLUTETIMESTAMPS) {
    -		timespecsubt(&trussinfo->curthread->after,
    +		timespecsubt_to(&trussinfo->curthread->after,
     		    &trussinfo->start_time, &timediff);
     		len += fprintf(trussinfo->outfile, "%ld.%09ld ",
     		    (long)timediff.tv_sec, timediff.tv_nsec);
     	}
     
     	if (trussinfo->flags & RELATIVETIMESTAMPS) {
    -		timespecsubt(&trussinfo->curthread->after,
    +		timespecsubt_to(&trussinfo->curthread->after,
     		    &trussinfo->curthread->before, &timediff);
     		len += fprintf(trussinfo->outfile, "%ld.%09ld ",
     		    (long)timediff.tv_sec, timediff.tv_nsec);
    @@ -1165,9 +1165,9 @@ print_syscall_ret(struct trussinfo *trus
     		if (!sc)
     			return;
     		clock_gettime(CLOCK_REALTIME, &trussinfo->curthread->after);
    -		timespecsubt(&trussinfo->curthread->after,
    +		timespecsubt_to(&trussinfo->curthread->after,
     		    &trussinfo->curthread->before, &timediff);
    -		timespecadd(&sc->time, &timediff, &sc->time);
    +		timespecadd_to(&sc->time, &timediff, &sc->time);
     		sc->ncalls++;
     		if (errorp)
     			sc->nerror++;
    @@ -1205,7 +1205,7 @@ print_summary(struct trussinfo *trussinf
     			fprintf(trussinfo->outfile, "%-20s%5jd.%09ld%8d%8d\n",
     			    sc->name, (intmax_t)sc->time.tv_sec,
     			    sc->time.tv_nsec, sc->ncalls, sc->nerror);
    -			timespecadd(&total, &sc->time, &total);
    +			timespecadd_to(&total, &sc->time, &total);
     			ncall += sc->ncalls;
     			nerror += sc->nerror;
     		}
    
    Modified: head/usr.bin/truss/truss.h
    ==============================================================================
    --- head/usr.bin/truss/truss.h	Tue Feb 26 01:38:12 2013	(r247299)
    +++ head/usr.bin/truss/truss.h	Tue Feb 26 02:13:02 2013	(r247300)
    @@ -62,7 +62,7 @@ struct trussinfo
     	SLIST_HEAD(, threadinfo) threadlist;
     };
     
    -#define	timespecsubt(tvp, uvp, vvp)					\
    +#define	timespecsubt_to(tvp, uvp, vvp)					\
     	do {								\
     		(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec;		\
     		(vvp)->tv_nsec = (tvp)->tv_nsec - (uvp)->tv_nsec;	\
    @@ -72,7 +72,7 @@ struct trussinfo
     		}							\
     	} while (0)
     
    -#define	timespecadd(tvp, uvp, vvp)					\
    +#define	timespecadd_to(tvp, uvp, vvp)					\
     	do {								\
     		(vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec;		\
     		(vvp)->tv_nsec = (tvp)->tv_nsec + (uvp)->tv_nsec;	\
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 03:24:46 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 754B4709;
     Tue, 26 Feb 2013 03:24:46 +0000 (UTC) (envelope-from ian@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 507709B4;
     Tue, 26 Feb 2013 03:24:46 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q3Ojb0039627;
     Tue, 26 Feb 2013 03:24:45 GMT (envelope-from ian@svn.freebsd.org)
    Received: (from ian@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q3Oj56039626;
     Tue, 26 Feb 2013 03:24:45 GMT (envelope-from ian@svn.freebsd.org)
    Message-Id: <201302260324.r1Q3Oj56039626@svn.freebsd.org>
    From: Ian Lepore 
    Date: Tue, 26 Feb 2013 03:24:45 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247301 - head/sys/boot/common
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 03:24:46 -0000
    
    Author: ian
    Date: Tue Feb 26 03:24:45 2013
    New Revision: 247301
    URL: http://svnweb.freebsd.org/changeset/base/247301
    
    Log:
      Adjust the arm kernel entry point address properly regardless of whether the
      e_entry field holds a physical or a virtual address.  Add a comment block
      that explains the assumptions being made by the adjustment code.
    
    Modified:
      head/sys/boot/common/load_elf.c
    
    Modified: head/sys/boot/common/load_elf.c
    ==============================================================================
    --- head/sys/boot/common/load_elf.c	Tue Feb 26 02:13:02 2013	(r247300)
    +++ head/sys/boot/common/load_elf.c	Tue Feb 26 03:24:45 2013	(r247301)
    @@ -290,14 +290,25 @@ __elfN(loadimage)(struct preloaded_file 
     	} else
     	    off = 0;
     #elif defined(__arm__)
    -	if (off & 0xf0000000u) {
    -	    off = -(off & 0xf0000000u);
    -	    ehdr->e_entry += off;
    +	/*
    +	 * The elf headers in some kernels specify virtual addresses in all
    +	 * header fields.  More recently, the e_entry and p_paddr fields are the
    +	 * proper physical addresses.  Even when the p_paddr fields are correct,
    +	 * the MI code below uses the p_vaddr fields with an offset added for
    +	 * loading (doing so is arguably wrong).  To make loading work, we need
    +	 * an offset that represents the difference between physical and virtual
    +	 * addressing.  ARM kernels are always linked at 0xC0000000.  Depending
    +	 * on the headers, the offset value passed in may be physical or virtual
    +	 * (because it typically comes from e_entry), but we always replace
    +	 * whatever is passed in with the va<->pa offset.  On the other hand, we
    +	 * only adjust the entry point if it's a virtual address to begin with.
    +	 */
    +	off = -0xc0000000u;
    +	if ((ehdr->e_entry & 0xc0000000u) == 0xc000000u)
    +		ehdr->e_entry += off;
     #ifdef ELF_VERBOSE
    -	    printf("Converted entry 0x%08x\n", ehdr->e_entry);
    +	printf("ehdr->e_entry 0x%08x, va<->pa off %llx\n", ehdr->e_entry, off);
     #endif
    -	} else
    -	    off = 0;
     #else
     	off = 0;		/* other archs use direct mapped kernels */
     #endif
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 03:39:16 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 5DC51AD5;
     Tue, 26 Feb 2013 03:39:16 +0000 (UTC)
     (envelope-from marcel@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 386D0A25;
     Tue, 26 Feb 2013 03:39:16 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q3dGaE043255;
     Tue, 26 Feb 2013 03:39:16 GMT (envelope-from marcel@svn.freebsd.org)
    Received: (from marcel@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q3dG6c043254;
     Tue, 26 Feb 2013 03:39:16 GMT (envelope-from marcel@svn.freebsd.org)
    Message-Id: <201302260339.r1Q3dG6c043254@svn.freebsd.org>
    From: Marcel Moolenaar 
    Date: Tue, 26 Feb 2013 03:39: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: r247302 - stable/9/sys/ia64/ia64
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 03:39:16 -0000
    
    Author: marcel
    Date: Tue Feb 26 03:39:15 2013
    New Revision: 247302
    URL: http://svnweb.freebsd.org/changeset/base/247302
    
    Log:
      MFC r239379:
      Use pmap_kextract(x) rather than pmap_extract(kernel_pmap, x).
    
    Modified:
      stable/9/sys/ia64/ia64/mem.c
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/ia64/ia64/mem.c
    ==============================================================================
    --- stable/9/sys/ia64/ia64/mem.c	Tue Feb 26 03:24:45 2013	(r247301)
    +++ stable/9/sys/ia64/ia64/mem.c	Tue Feb 26 03:39:15 2013	(r247302)
    @@ -129,7 +129,7 @@ kmemphys:
     			addr = trunc_page(v);
     			eaddr = round_page(v + c);
     			for (; addr < eaddr; addr += PAGE_SIZE) {
    -				if (pmap_extract(kernel_pmap, addr) == 0)
    +				if (pmap_kextract(addr) == 0)
     					return (EFAULT);
     			}
     			if (!kernacc((caddr_t)v, c, (uio->uio_rw == UIO_READ)
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 03:46:35 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id EC1EAD52;
     Tue, 26 Feb 2013 03:46:35 +0000 (UTC)
     (envelope-from marcel@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 DD166A5A;
     Tue, 26 Feb 2013 03:46:35 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q3kZB5045970;
     Tue, 26 Feb 2013 03:46:35 GMT (envelope-from marcel@svn.freebsd.org)
    Received: (from marcel@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q3kZEl045969;
     Tue, 26 Feb 2013 03:46:35 GMT (envelope-from marcel@svn.freebsd.org)
    Message-Id: <201302260346.r1Q3kZEl045969@svn.freebsd.org>
    From: Marcel Moolenaar 
    Date: Tue, 26 Feb 2013 03:46: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: r247303 - stable/9/sys/ia64/ia64
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 03:46:36 -0000
    
    Author: marcel
    Date: Tue Feb 26 03:46:35 2013
    New Revision: 247303
    URL: http://svnweb.freebsd.org/changeset/base/247303
    
    Log:
      MFC r246882:
      Return EFAULT when the address is not a kernel virtual address.
    
    Modified:
      stable/9/sys/ia64/ia64/mem.c
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/ia64/ia64/mem.c
    ==============================================================================
    --- stable/9/sys/ia64/ia64/mem.c	Tue Feb 26 03:39:15 2013	(r247302)
    +++ stable/9/sys/ia64/ia64/mem.c	Tue Feb 26 03:46:35 2013	(r247303)
    @@ -128,6 +128,8 @@ kmemphys:
     			 */
     			addr = trunc_page(v);
     			eaddr = round_page(v + c);
    +			if (addr < VM_MAXUSER_ADDRESS)
    +				return (EFAULT);
     			for (; addr < eaddr; addr += PAGE_SIZE) {
     				if (pmap_kextract(addr) == 0)
     					return (EFAULT);
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 04:59:03 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 69AAB73E;
     Tue, 26 Feb 2013 04:59:03 +0000 (UTC)
     (envelope-from kientzle@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 44AEBCFC;
     Tue, 26 Feb 2013 04:59:03 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q4x3jC067202;
     Tue, 26 Feb 2013 04:59:03 GMT
     (envelope-from kientzle@svn.freebsd.org)
    Received: (from kientzle@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q4x39V067201;
     Tue, 26 Feb 2013 04:59:03 GMT
     (envelope-from kientzle@svn.freebsd.org)
    Message-Id: <201302260459.r1Q4x39V067201@svn.freebsd.org>
    From: Tim Kientzle 
    Date: Tue, 26 Feb 2013 04:59:03 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247304 - head/sys/arm/conf
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 04:59:03 -0000
    
    Author: kientzle
    Date: Tue Feb 26 04:59:02 2013
    New Revision: 247304
    URL: http://svnweb.freebsd.org/changeset/base/247304
    
    Log:
      RPi users might want to touch the boot partition, which is always FAT
      formatted on this board, so compile-in MSDOSFS.
      
      Comment out the compiled-in FDT and explain why.
    
    Modified:
      head/sys/arm/conf/RPI-B
    
    Modified: head/sys/arm/conf/RPI-B
    ==============================================================================
    --- head/sys/arm/conf/RPI-B	Tue Feb 26 03:46:35 2013	(r247303)
    +++ head/sys/arm/conf/RPI-B	Tue Feb 26 04:59:02 2013	(r247304)
    @@ -42,6 +42,7 @@ options 	FFS			#Berkeley Fast Filesystem
     options 	SOFTUPDATES		#Enable FFS soft updates support
     options 	UFS_ACL			#Support for access control lists
     options 	UFS_DIRHASH		#Improve performance on big directories
    +options 	MSDOSFS			#MSDOS Filesystem
     device		snp
     
     options 	NFSCL			#Network Filesystem Client
    @@ -113,5 +114,7 @@ device		smsc
     
     # Flattened Device Tree
     options         FDT
    -options         FDT_DTB_STATIC
    -makeoptions     FDT_DTS_FILE=bcm2835-rpi-b.dts
    +# Note:  DTB is normally loaded and modified by RPi boot loader, then
    +# handed to kernel via U-Boot and ubldr.
    +#options         FDT_DTB_STATIC
    +#makeoptions     FDT_DTS_FILE=bcm2835-rpi-b.dts
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 05:12:26 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 9D9609F9;
     Tue, 26 Feb 2013 05:12:26 +0000 (UTC)
     (envelope-from bryanv@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 77F77D75;
     Tue, 26 Feb 2013 05:12:26 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q5CQmQ072750;
     Tue, 26 Feb 2013 05:12:26 GMT (envelope-from bryanv@svn.freebsd.org)
    Received: (from bryanv@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q5CQ6e072749;
     Tue, 26 Feb 2013 05:12:26 GMT (envelope-from bryanv@svn.freebsd.org)
    Message-Id: <201302260512.r1Q5CQ6e072749@svn.freebsd.org>
    From: Bryan Venteicher 
    Date: Tue, 26 Feb 2013 05:12: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: r247305 - in stable/9/sys/modules/virtio: . scsi
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 05:12:26 -0000
    
    Author: bryanv
    Date: Tue Feb 26 05:12:25 2013
    New Revision: 247305
    URL: http://svnweb.freebsd.org/changeset/base/247305
    
    Log:
      MFC part of r241470 missed in r246582
      
      Add the VirtIO SCSI Makefile. I was in one directory too
      deep when I did the previous commit.
      
      Approved by:	grehan
    
    Added:
      stable/9/sys/modules/virtio/scsi/
         - copied from r241470, head/sys/modules/virtio/scsi/
    Modified:
      stable/9/sys/modules/virtio/Makefile
    
    Modified: stable/9/sys/modules/virtio/Makefile
    ==============================================================================
    --- stable/9/sys/modules/virtio/Makefile	Tue Feb 26 04:59:02 2013	(r247304)
    +++ stable/9/sys/modules/virtio/Makefile	Tue Feb 26 05:12:25 2013	(r247305)
    @@ -23,6 +23,6 @@
     # SUCH DAMAGE.
     #
     
    -SUBDIR=	virtio pci network block balloon
    +SUBDIR=	virtio pci network block balloon scsi
     
     .include 
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 05:27:03 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 13185BF3;
     Tue, 26 Feb 2013 05:27:03 +0000 (UTC)
     (envelope-from bryanv@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 DEA41DDA;
     Tue, 26 Feb 2013 05:27:02 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q5R2Jc076318;
     Tue, 26 Feb 2013 05:27:02 GMT (envelope-from bryanv@svn.freebsd.org)
    Received: (from bryanv@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q5R2AR076316;
     Tue, 26 Feb 2013 05:27:02 GMT (envelope-from bryanv@svn.freebsd.org)
    Message-Id: <201302260527.r1Q5R2AR076316@svn.freebsd.org>
    From: Bryan Venteicher 
    Date: Tue, 26 Feb 2013 05:27: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: r247306 - in stable/9/sys: amd64/conf i386/conf
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 05:27:03 -0000
    
    Author: bryanv
    Date: Tue Feb 26 05:27:02 2013
    New Revision: 247306
    URL: http://svnweb.freebsd.org/changeset/base/247306
    
    Log:
      Complete MFC of r245362
      
          Add VirtIO to i386 and amd64 GENERIC
      
      This completes the MFC of r245362 not was not done
      in r246885. 9-STABLE VirtIO should now match HEAD.
      
      Approved by:	grehan
    
    Modified:
      stable/9/sys/amd64/conf/GENERIC
      stable/9/sys/i386/conf/GENERIC
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
      stable/9/sys/modules/   (props changed)
    
    Modified: stable/9/sys/amd64/conf/GENERIC
    ==============================================================================
    --- stable/9/sys/amd64/conf/GENERIC	Tue Feb 26 05:12:25 2013	(r247305)
    +++ stable/9/sys/amd64/conf/GENERIC	Tue Feb 26 05:27:02 2013	(r247306)
    @@ -341,3 +341,11 @@ device		snd_hda		# Intel High Definition
     device		snd_ich		# Intel, NVidia and other ICH AC'97 Audio
     device		snd_uaudio	# USB Audio
     device		snd_via8233	# VIA VT8233x Audio
    +
    +# VirtIO support
    +device		virtio		# Generic VirtIO bus (required)
    +device		virtio_pci	# VirtIO PCI Interface
    +device		vtnet		# VirtIO Ethernet device
    +device		virtio_blk	# VirtIO Block device
    +device		virtio_scsi	# VirtIO SCSI device
    +device		virtio_balloon	# VirtIO Memory Balloon device
    
    Modified: stable/9/sys/i386/conf/GENERIC
    ==============================================================================
    --- stable/9/sys/i386/conf/GENERIC	Tue Feb 26 05:12:25 2013	(r247305)
    +++ stable/9/sys/i386/conf/GENERIC	Tue Feb 26 05:27:02 2013	(r247306)
    @@ -354,3 +354,11 @@ device		snd_hda		# Intel High Definition
     device		snd_ich		# Intel, NVidia and other ICH AC'97 Audio
     device		snd_uaudio	# USB Audio
     device		snd_via8233	# VIA VT8233x Audio
    +
    +# VirtIO support
    +device		virtio		# Generic VirtIO bus (required)
    +device		virtio_pci	# VirtIO PCI Interface
    +device		vtnet		# VirtIO Ethernet device
    +device		virtio_blk	# VirtIO Block device
    +device		virtio_scsi	# VirtIO SCSI device
    +device		virtio_balloon	# VirtIO Memory Balloon device
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 05:58:06 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 9002224A;
     Tue, 26 Feb 2013 05:58:06 +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 5FAE1E97;
     Tue, 26 Feb 2013 05:58:06 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q5w6Zu085288;
     Tue, 26 Feb 2013 05:58:06 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q5w5EH085282;
     Tue, 26 Feb 2013 05:58:05 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201302260558.r1Q5w5EH085282@svn.freebsd.org>
    From: Xin LI 
    Date: Tue, 26 Feb 2013 05:58: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: r247309 - in stable/9: cddl/contrib/opensolaris/cmd/zfs
     cddl/contrib/opensolaris/cmd/zpool sys/cddl/boot/zfs
     sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/common/zfs
     sys/...
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 05:58:06 -0000
    
    Author: delphij
    Date: Tue Feb 26 05:58:05 2013
    New Revision: 247309
    URL: http://svnweb.freebsd.org/changeset/base/247309
    
    Log:
      MFC r246586,246587,246619,246624,246768,246808:
      
      LZ4 compression support in ZFS.
      
      (Note: sys/conf/files change omitted from this changeset).
    
    Added:
      stable/9/sys/cddl/boot/zfs/lz4.c
         - copied unchanged from r246586, head/sys/cddl/boot/zfs/lz4.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4
         - copied unchanged from r246586, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4.descrip
         - copied unchanged from r246586, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4.descrip
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c
         - copied, changed from r246586, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c
    Modified:
      stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8
      stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
      stable/9/sys/cddl/boot/zfs/README
      stable/9/sys/cddl/boot/zfs/zfsimpl.h
      stable/9/sys/cddl/boot/zfs/zfssubr.c
      stable/9/sys/cddl/compat/opensolaris/sys/byteorder.h
      stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c
      stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h
      stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/Makefile.files
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c
    Directory Properties:
      stable/9/cddl/   (props changed)
      stable/9/cddl/contrib/opensolaris/   (props changed)
      stable/9/cddl/contrib/opensolaris/cmd/zfs/   (props changed)
      stable/9/sys/   (props changed)
      stable/9/sys/cddl/contrib/opensolaris/   (props changed)
    
    Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8
    ==============================================================================
    --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Tue Feb 26 05:44:48 2013	(r247308)
    +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Tue Feb 26 05:58:05 2013	(r247309)
    @@ -1,5 +1,5 @@
     '\" te
    -.\" Copyright (c) 2012, Martin Matuska .
    +.\" Copyright (c) 2013, Martin Matuska .
     .\" All Rights Reserved.
     .\"
     .\" The contents of this file are subject to the terms of the
    @@ -19,15 +19,16 @@
     .\"
     .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved.
     .\" Copyright (c) 2012 by Delphix. All rights reserved.
    -.\" Copyright (c) 2012 Nexenta Systems, Inc. All Rights Reserved.
     .\" Copyright (c) 2012, Joyent, Inc. All rights reserved.
     .\" Copyright (c) 2011, Pawel Jakub Dawidek 
     .\" Copyright (c) 2012, Bryan Drewery 
     .\" Copyright (c) 2012, Glen Barber 
    +.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
    +.\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved.
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd November 26, 2012
    +.Dd February 10, 2013
     .Dt ZFS 8
     .Os
     .Sh NAME
    @@ -39,14 +40,12 @@
     .Nm
     .Cm create
     .Op Fl p
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ... filesystem
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... Ar filesystem
     .Nm
     .Cm create
     .Op Fl ps
     .Op Fl b Ar blocksize
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ...
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
     .Fl V
     .Ar size volume
     .Nm
    @@ -59,13 +58,13 @@
     .Sm off
     .Ar snapshot
     .Op % Ns Ar snapname
    -.Op , Ns Ar ...
    +.Op , Ns ...
     .Sm on
     .Nm
     .Cm snapshot
     .Op Fl r
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ... filesystem@snapname Ns | Ns Ar volume@snapname
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
    +.Ar filesystem@snapname Ns | Ns Ar volume@snapname
     .Nm
     .Cm rollback
     .Op Fl rRf
    @@ -73,8 +72,8 @@
     .Nm
     .Cm clone
     .Op Fl p
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ... snapshot filesystem Ns | Ns Ar volume
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
    +.Ar snapshot filesystem Ns | Ns Ar volume
     .Nm
     .Cm promote
     .Ar clone-filesystem
    @@ -102,31 +101,29 @@
     .Cm list
     .Op Fl r Ns | Ns Fl d Ar depth
     .Op Fl H
    -.Op Fl o Ar property Ns Op , Ns Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    -.Op Fl s Ar property
    -.Ar ...
    -.Op Fl S Ar property
    -.Ar ...
    +.Op Fl o Ar property Ns Oo , Ns property Ns Oc Ns ...
    +.Op Fl t Ar type Ns Oo , Ns type Ns Oc Ns ...
    +.Oo Fl s Ar property Oc Ns ...
    +.Oo Fl S Ar property Oc Ns ...
     .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
     .Nm
     .Cm set
     .Ar property Ns = Ns Ar value
    -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
    +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
     .Nm
     .Cm get
     .Op Fl r Ns | Ns Fl d Ar depth
     .Op Fl Hp
    -.Op Fl o Ar all | field Ns Op , Ns Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    -.Op Fl s Ar source Ns Op , Ns Ar ...
    -.Ar all | property Ns Op , Ns Ar ...
    -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
    +.Op Fl o Ar all | field Ns Oo , Ns Ar field Oc Ns ...
    +.Op Fl t Ar type Ns Oo Ns , Ar type Oc Ns ...
    +.Op Fl s Ar source Ns Oo Ns , Ns Ar source Oc Ns ...
    +.Ar all | property Ns Oo Ns , Ns Ar property Oc Ns ...
    +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
     .Nm
     .Cm inherit
     .Op Fl rS
     .Ar property
    -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
    +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
     .Nm
     .Cm upgrade
     .Op Fl v
    @@ -138,29 +135,25 @@
     .Nm
     .Cm userspace
     .Op Fl Hinp
    -.Op Fl o Ar field Ns Op , Ns Ar ...
    -.Op Fl s Ar field
    -.Ar ...
    -.Op Fl S Ar field
    -.Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    +.Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
    +.Oo Fl s Ar field Oc Ns ...
    +.Oo Fl S Ar field Oc Ns ...
    +.Op Fl t Ar type Ns Oo Ns , Ns Ar type Oc Ns ...
     .Ar filesystem Ns | Ns Ar snapshot
     .Nm
     .Cm groupspace
     .Op Fl Hinp
    -.Op Fl o Ar field Ns Op , Ns Ar ...
    -.Op Fl s Ar field
    -.Ar ...
    -.Op Fl S Ar field
    -.Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    +.Op Fl o Ar field Ns Oo , Ns field Oc Ns ...
    +.Oo Fl s Ar field Oc Ns ...
    +.Oo Fl S Ar field Oc Ns ...
    +.Op Fl t Ar type Ns Oo Ns , Ns Ar type Oc Ns ...
     .Ar filesystem Ns | Ns Ar snapshot
     .Nm
     .Cm mount
     .Nm
     .Cm mount
     .Op Fl vO
    -.Op Fl o Ar property Ns Op , Ns Ar ...
    +.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
     .Fl a | Ar filesystem
     .Nm
     .Cm unmount
    @@ -192,63 +185,71 @@
     .Nm
     .Cm allow
     .Op Fl ldug
    -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ...
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar user Ns | Ns Ar group Ns Oo Ns , Ns Ar user Ns | Ns Ar group Oc Ns ...
    +.Ar perm Ns | Ns Ar @setname Ns
    +.Oo Ns , Ns Ar perm Ns | Ns Ar @setname Oc Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm allow
     .Op Fl ld
    -.Fl e
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Fl e Ns | Ns Cm everyone
    +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm allow
     .Fl c
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm allow
     .Fl s
     .Ar @setname
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm unallow
     .Op Fl rldug
    -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ...
    -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar user Ns | Ns Ar group Ns Oo Ns , Ns Ar user Ns | Ns Ar group Oc Ns ...
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm unallow
     .Op Fl rld
    -.Fl e
    -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Fl e Ns | Ns Cm everyone
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm unallow
     .Op Fl r
     .Fl c
    -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm unallow
     .Op Fl r
     .Fl s
     .Ar @setname
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm hold
     .Op Fl r
    -.Ar tag snapshot ...
    +.Ar tag snapshot Ns ...
     .Nm
     .Cm holds
     .Op Fl r
    -.Ar snapshot ...
    +.Ar snapshot Ns ...
     .Nm
     .Cm release
     .Op Fl r
    -.Ar tag snapshot ...
    +.Ar tag snapshot Ns ...
     .Nm
     .Cm diff
     .Op Fl FHt
    @@ -860,7 +861,7 @@ but this may change in future releases).
     disables integrity checking on user data. Disabling checksums is
     .Em NOT
     a recommended practice.
    -.It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | Cm zle
    +.It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | zle | Cm lz4
     Controls the compression algorithm used for this dataset. The
     .CM lzjb
     compression algorithm is optimized for performance while providing decent data
    @@ -888,6 +889,26 @@ The
     .Cm zle
     compression algorithm compresses runs of zeros.
     .Pp
    +The
    +.Sy lz4
    +compression algorithm is a high-performance replacement
    +for the
    +.Sy lzjb
    +algorithm. It features significantly faster
    +compression and decompression, as well as a moderately higher
    +compression ratio than
    +.Sy lzjb ,
    +but can only be used on pools with
    +the
    +.Sy lz4_compress
    +feature set to
    +.Sy enabled .
    +See
    +.Xr zpool-features 7
    +for details on ZFS feature flags and the
    +.Sy lz4_compress
    +feature.
    +.Pp
     This property can also be referred to by its shortened column name
     .Cm compress .
     Changing this property affects only newly-written data.
    @@ -1384,8 +1405,8 @@ Displays a help message.
     .Nm
     .Cm create
     .Op Fl p
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ... filesystem
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
    +.Ar filesystem
     .Xc
     .Pp
     Creates a new
    @@ -1420,8 +1441,7 @@ options.
     .Cm create
     .Op Fl ps
     .Op Fl b Ar blocksize
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ...
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
     .Fl V
     .Ar size volume
     .Xc
    @@ -1521,7 +1541,7 @@ behavior for mounted file systems in use
     .Sm off
     .Ar snapshot
     .Op % Ns Ar snapname
    -.Op , Ns Ar ...
    +.Op , Ns ...
     .Sm on
     .Xc
     .Pp
    @@ -1582,8 +1602,7 @@ behavior for mounted file systems in use
     .Nm
     .Cm snapshot
     .Op Fl r
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ...
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
     .Ar filesystem@snapname Ns | Ns volume@snapname
     .Xc
     .Pp
    @@ -1630,8 +1649,8 @@ option to force an unmount of any clone 
     .Nm
     .Cm clone
     .Op Fl p
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ... snapshot filesystem Ns | Ns Ar volume
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
    +.Ar snapshot filesystem Ns | Ns Ar volume
     .Xc
     .Pp
     Creates a clone of the given snapshot. See the
    @@ -1734,13 +1753,11 @@ only dataset that can be renamed recursi
     .Cm list
     .Op Fl r Ns | Ns Fl d Ar depth
     .Op Fl H
    -.Op Fl o Ar property Ns Op , Ns Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    -.Op Fl s Ar property
    -.Ar ...
    -.Op Fl S Ar property
    -.Ar ...
    -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
    +.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
    +.Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
    +.Oo Fl s Ar property Oc Ns ...
    +.Oo Fl S Ar property Oc Ns ...
    +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
     .Xc
     .Pp
     Lists the property information for the given datasets in tabular form. If
    @@ -1766,7 +1783,7 @@ will display only the dataset and its di
     .It Fl H
     Used for scripting mode. Do not print headers and separate fields by a single
     tab instead of arbitrary white space.
    -.It Fl o Ar property Ns Op , Ns Ar ...
    +.It Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
     A comma-separated list of properties to display. The property must be:
     .Bl -bullet -offset 2n
     .It
    @@ -1790,7 +1807,7 @@ shortcut for specifying
     .Sy filesystem,volume
     syntax.
     .El
    -.It Fl t Ar type Ns Op , Ns Ar ...
    +.It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
     A comma-separated list of types to display, where
     .Ar type
     is one of
    @@ -1853,11 +1870,11 @@ section.
     .Cm get
     .Op Fl r Ns | Ns Fl d Ar depth
     .Op Fl Hp
    -.Op Fl o Ar all | field Ns Op , Ns Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    -.Op Fl s Ar source Ns Op , Ns Ar ...
    -.Ar all | property Ns Op , Ns Ar ...
    -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
    +.Op Fl o Ar all | field Ns Oo , Ns Ar field Oc Ns ...
    +.Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
    +.Op Fl s Ar source Ns Oo , Ns Ar source Oc Ns ...
    +.Ar all | property Ns Oo , Ns Ar property Oc Ns ...
    +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
     .Xc
     .Pp
     Displays properties for the given datasets. If no datasets are specified, then
    @@ -1907,7 +1924,7 @@ omitted, and fields are explicitly separ
     arbitrary amount of space.
     .It Fl p
     Display numbers in parseable (exact) values.
    -.It Fl o Cm all | Ar field Ns Op , Ns Ar ...
    +.It Fl o Cm all | Ar field Ns Oo , Ns Ar field Oc Ns ...
     A comma-separated list of columns to display. Supported values are
     .Sy name,property,value,received,source .
     Default values are
    @@ -1915,7 +1932,7 @@ Default values are
     The keyword
     .Cm all
     specifies all columns.
    -.It Fl t Ar type Ns Op , Ns Ar ...
    +.It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
     A comma-separated list of types to display, where
     .Ar type
     is one of
    @@ -1923,7 +1940,7 @@ is one of
     For example, specifying
     .Fl t Cm snapshot
     displays only snapshots.
    -.It Fl s Ar source Ns Op , Ns Ar ...
    +.It Fl s Ar source Ns Oo , Ns Ar source Oc Ns ...
     A comma-separated list of sources to display. Those properties coming from a
     source other than those in this list are ignored. Each source must be one of
     the following:
    @@ -1935,7 +1952,7 @@ The default value is all sources.
     .Cm inherit
     .Op Fl rS
     .Ar property
    -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
    +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
     .Xc
     .Pp
     Clears the specified property, causing it to be inherited from an ancestor. If
    @@ -2010,12 +2027,10 @@ Upgrade the specified file system.
     .Nm
     .Cm userspace
     .Op Fl Hinp
    -.Op Fl o Ar field Ns Op , Ns Ar ...
    -.Op Fl s Ar field
    -.Ar ...
    -.Op Fl S Ar field
    -.Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    +.Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
    +.Oo Fl s Ar field Oc Ns ...
    +.Oo Fl S Ar field Oc Ns ...
    +.Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
     .Ar filesystem Ns | Ns Ar snapshot
     .Xc
     .Pp
    @@ -2032,7 +2047,7 @@ Print numeric ID instead of user/group n
     Do not print headers, use tab-delimited output.
     .It Fl p
     Use exact (parsable) numeric output.
    -.It Fl o Ar field Ns Op , Ns Ar ...
    +.It Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
     Display only the specified fields from the following set:
     .Sy type,name,used,quota .
     The default is to display all fields.
    @@ -2047,7 +2062,7 @@ another. The default is
     .It Fl S Ar field
     Sort by this field in reverse order. See
     .Fl s .
    -.It Fl t Ar type Ns Op , Ns Ar ...
    +.It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
     Print only the specified types from the following set:
     .Sy all,posixuser,smbuser,posixgroup,smbgroup .
     .Pp
    @@ -2063,12 +2078,10 @@ Translate SID to POSIX ID. This flag cur
     .Nm
     .Cm groupspace
     .Op Fl Hinp
    -.Op Fl o Ar field Ns Op , Ns Ar ...
    -.Op Fl s Ar field
    -.Ar ...
    -.Op Fl S Ar field
    -.Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    +.Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
    +.Oo Fl s Ar field Oc Ns ...
    +.Oo Fl S Ar field Oc Ns ...
    +.Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
     .Ar filesystem Ns | Ns Ar snapshot
     .Xc
     .Pp
    @@ -2092,7 +2105,7 @@ file systems currently mounted.
     .Nm
     .Cm mount
     .Op Fl vO
    -.Op Fl o Ar property Ns Op , Ns Ar ...
    +.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
     .Fl a | Ar filesystem
     .Xc
     .Pp
    @@ -2105,7 +2118,7 @@ Report mount progress.
     .It Fl O
     Perform an overlay mount. Overlay mounts are not supported on
     .Fx .
    -.It Fl o Ar property Ns Op , Ns Ar ...
    +.It Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
     An optional, comma-separated list of mount options to use temporarily for the
     duration of the mount. See the
     .Qq Sx Temporary Mount Point Properties
    @@ -2424,16 +2437,18 @@ for more information.
     .Nm
     .Cm allow
     .Op Fl ldug
    -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ...
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar user Ns | Ns Ar group Ns Oo Ns , Ns Ar user Ns | Ns Ar group Oc Ns ...
    +.Ar perm Ns | Ns Ar @setname Ns
    +.Oo Ns , Ns Ar perm Ns | Ns Ar @setname Oc Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .It Xo
     .Nm
     .Cm allow
     .Op Fl ld
    -.Fl e
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Fl e Ns | Ns Cm everyone
    +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .Pp
    @@ -2443,26 +2458,31 @@ administration permission for the file s
     .Bl -tag -width indent
     .It Xo
     .Op Fl ug
    -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ...
    +.Ar user Ns | Ns Ar group Ns Oo , Ar user Ns | Ns Ar group Oc Ns ...
     .Xc
     Specifies to whom the permissions are delegated. Multiple entities can be
     specified as a comma-separated list. If neither of the
     .Fl ug
     options are specified, then the argument is interpreted preferentially as the
    -keyword "everyone", then as a user name, and lastly as a group name. To specify
    -a user or group named "everyone", use the
    +keyword
    +.Cm everyone ,
    +then as a user name, and lastly as a group name. To specify
    +a user or group named
    +.Qq everyone ,
    +use the
     .Fl u
     or
     .Fl g
     options. To specify a group with the same name as a user, use the
     .Fl g
     option.
    +.It Op Fl e Ns | Ns Cm everyone
    +Specifies that the permissions be delegated to
    +.Qq everyone .
     .It Xo
    -.Op Fl e
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar perm Ns | Ns Ar @setname Ns Oo , Ns Ar perm Ns | Ns Ar @setname Oc Ns ...
     .Xc
    -Specifies that the permissions be delegated to "everyone".
    -Multiple permissions
    +The permissions to delegate. Multiple permissions
     may be specified as a comma-separated list. Permission names are the same as
     .Tn ZFS
     subcommand and property names. See the property list below. Property set names,
    @@ -2569,7 +2589,8 @@ protocol
     .Nm
     .Cm allow
     .Fl c
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .Pp
    @@ -2580,7 +2601,8 @@ creator of any newly-created descendent 
     .Cm allow
     .Fl s
     .Ar @setname
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .Pp
    @@ -2596,16 +2618,18 @@ and can be no more than 64 characters lo
     .Nm
     .Cm unallow
     .Op Fl rldug
    -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ...
    -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar user Ns | Ns Ar group Ns Oo Ns , Ns Ar user Ns | Ns Ar group Oc Ns ...
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .It Xo
     .Nm
     .Cm unallow
     .Op Fl rld
    -.Fl e
    -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Fl e Ns | Ns Cm everyone
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .It Xo
    @@ -2613,7 +2637,8 @@ and can be no more than 64 characters lo
     .Cm unallow
     .Op Fl r
     .Fl c
    -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .Pp
    @@ -2622,10 +2647,12 @@ Removes permissions that were granted wi
     command. No permissions are explicitly denied, so other permissions granted are
     still in effect. For example, if the permission is granted by an ancestor. If
     no permissions are specified, then all permissions for the specified
    -.Ar user , group , No or Ar everyone
    -are removed. Specifying "everyone" (or using the
    -.Fl e
    -option) only removes the permissions that were granted to "everyone",
    +.Ar user , group , No or everyone
    +are removed. Specifying
    +.Cm everyone
    +.Po or using the Fl e
    +option
    +.Pc only removes the permissions that were granted to everyone ,
     not all permissions for every user and group. See the
     .Qq Nm Cm allow
     command for a description of the
    @@ -2641,7 +2668,8 @@ Recursively remove the permissions from 
     .Op Fl r
     .Fl s
     .Ar @setname
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .Pp
    @@ -2651,7 +2679,7 @@ then all permissions are removed, thus r
     .Nm
     .Cm hold
     .Op Fl r
    -.Ar tag snapshot ...
    +.Ar tag snapshot Ns ...
     .Xc
     .Pp
     Adds a single reference, named with the
    @@ -2672,7 +2700,7 @@ snapshots of all descendent file systems
     .Nm
     .Cm holds
     .Op Fl r
    -.Ar snapshot ...
    +.Ar snapshot Ns ...
     .Xc
     .Pp
     Lists all existing user references for the given snapshot or snapshots.
    @@ -2685,7 +2713,7 @@ listing the holds on the named snapshot.
     .Nm
     .Cm release
     .Op Fl r
    -.Ar tag snapshot ...
    +.Ar tag snapshot Ns ...
     .Xc
     .Pp
     Removes a single reference, named with the
    
    Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
    ==============================================================================
    --- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7	Tue Feb 26 05:44:48 2013	(r247308)
    +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7	Tue Feb 26 05:58:05 2013	(r247309)
    @@ -18,10 +18,11 @@
     .\" information: Portions Copyright [yyyy] [name of copyright owner]
     .\"
     .\" Copyright (c) 2012 by Delphix. All rights reserved.
    +.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd Aug 28, 2012
    +.Dd February 8, 2013
     .Dt ZPOOL-FEATURES 7
     .Os
     .Sh NAME
    @@ -185,6 +186,49 @@ This feature is
     .Sy active
     while there are any filesystems, volumes, or snapshots which were created
     after enabling this feature.
    +.It Sy lz4_compress
    +.Bl -column "READ\-ONLY COMPATIBLE" "org.illumos:lz4_compress"
    +.It GUID Ta org.illumos:lz4_compress
    +.It READ\-ONLY COMPATIBLE Ta no
    +.It DEPENDENCIES Ta none
    +.El
    +.Pp
    +.Sy lz4
    +is a high-performance real-time compression algorithm that
    +features significantly faster compression and decompression as well as a
    +higher compression ratio than the older
    +.Sy lzjb
    +compression.
    +Typically,
    +.Sy lz4
    +compression is approximately 50% faster on
    +compressible data and 200% faster on incompressible data than
    +.Sy lzjb .
    +It is also approximately 80% faster on decompression, while
    +giving approximately 10% better compression ratio.
    +.Pp
    +When the
    +.Sy lz4_compress
    +feature is set to
    +.Sy enabled ,
    +the
    +administrator can turn on
    +.Sy lz4
    +compression on any dataset on the
    +pool using the
    +.Xr zfs 8
    +command. Please note that doing so will
    +immediately activate the
    +.Sy lz4_compress
    +feature on the underlying
    +pool (even before any data is written). Since this feature is not
    +read-only compatible, this operation will render the pool unimportable
    +on systems without support for the
    +.Sy lz4_compress
    +feature. At the
    +moment, this operation cannot be reversed. Booting off of
    +.Sy lz4
    +-compressed root pools is supported.
     .El
     .Sh SEE ALSO
     .Xr zpool 8
    
    Modified: stable/9/sys/cddl/boot/zfs/README
    ==============================================================================
    --- stable/9/sys/cddl/boot/zfs/README	Tue Feb 26 05:44:48 2013	(r247308)
    +++ stable/9/sys/cddl/boot/zfs/README	Tue Feb 26 05:58:05 2013	(r247309)
    @@ -5,6 +5,7 @@ are used by the ZFS bootstrap:
     
         fletcher.c			checksum support
         sha256.c			checksum support
    +    lz4.c			compression support
         lzjb.c			compression support
         zfssubr.c			checksum, compression and raidz support
         zfsimpl.h			mostly describing the physical layout
    
    Copied: stable/9/sys/cddl/boot/zfs/lz4.c (from r246586, head/sys/cddl/boot/zfs/lz4.c)
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ stable/9/sys/cddl/boot/zfs/lz4.c	Tue Feb 26 05:58:05 2013	(r247309, copy of r246586, head/sys/cddl/boot/zfs/lz4.c)
    @@ -0,0 +1,308 @@
    +/*
    + * LZ4 - Fast LZ compression algorithm
    + * Header File
    + * Copyright (C) 2011-2013, Yann Collet.
    + * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions are
    + * met:
    + *
    + *     * Redistributions of source code must retain the above copyright
    + * notice, this list of conditions and the following disclaimer.
    + *     * Redistributions in binary form must reproduce the above
    + * copyright notice, this list of conditions and the following disclaimer
    + * in the documentation and/or other materials provided with the
    + * distribution.
    + *
    + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    + * OWNER 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.
    + *
    + * You can contact the author at :
    + * - LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html
    + * - LZ4 source repository : http://code.google.com/p/lz4/
    + *
    + * $FreeBSD$
    + */
    +
    +static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest,
    +					    int isize, int maxOutputSize);
    +
    +/* ARGSUSED */
    +static int
    +lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int dummy __unused)
    +{
    +	const uint8_t *src = s_start;
    +	uint32_t bufsiz = htonl(*(uint32_t *)src);
    +
    +	/* invalid compressed buffer size encoded at start */
    +	if (bufsiz + 4 > s_len)
    +		return (1);
    +
    +	/*
    +	 * Returns 0 on success (decompression function returned non-negative)
    +	 * and non-zero on failure (decompression function returned negative).
    +	 */
    +	return (LZ4_uncompress_unknownOutputSize(s_start + 4, d_start, bufsiz,
    +	    d_len) < 0);
    +}
    +
    +/*
    + * CPU Feature Detection
    + */
    +
    +/* 32 or 64 bits ? */
    +#if (defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) || \
    +	defined(__amd64) || defined(__ppc64__) || defined(_WIN64) || \
    +	defined(__LP64__) || defined(_LP64))
    +#define	LZ4_ARCH64	1
    +#else
    +#define	LZ4_ARCH64	0
    +#endif
    +
    +/*
    + * Little Endian or Big Endian?
    + * Note: overwrite the below #define if you know your architecture endianess.
    + */
    +#if BYTE_ORDER == BIG_ENDIAN
    +#define	LZ4_BIG_ENDIAN	1
    +#else
    +	/*
    +	 * Little Endian assumed. PDP Endian and other very rare endian format
    +	 * are unsupported.
    +	 */
    +#endif
    +
    +/*
    + * Compiler Options
    + */
    +#if __STDC_VERSION__ >= 199901L	/* C99 */
    +/* "restrict" is a known keyword */
    +#else
    +/* Disable restrict */
    +#define	restrict
    +#endif
    +
    +#define	GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
    +
    +#define	lz4_bswap16(x) ((unsigned short int) ((((x) >> 8) & 0xffu) \
    +	| (((x) & 0xffu) << 8)))
    +
    +#if (GCC_VERSION >= 302) || (__INTEL_COMPILER >= 800) || defined(__clang__)
    +#define	expect(expr, value)    (__builtin_expect((expr), (value)))
    +#else
    +#define	expect(expr, value)    (expr)
    +#endif
    +
    +#define	likely(expr)	expect((expr) != 0, 1)
    +#define	unlikely(expr)	expect((expr) != 0, 0)
    +
    +/* Basic types */
    +#define	BYTE	uint8_t
    +#define	U16	uint16_t
    +#define	U32	uint32_t
    +#define	S32	int32_t
    +#define	U64	uint64_t
    +
    +typedef struct _U16_S {
    +	U16 v;
    +} U16_S;
    +typedef struct _U32_S {
    +	U32 v;
    +} U32_S;
    +typedef struct _U64_S {
    +	U64 v;
    +} U64_S;
    +
    +#define	A64(x)	(((U64_S *)(x))->v)
    +#define	A32(x)	(((U32_S *)(x))->v)
    +#define	A16(x)	(((U16_S *)(x))->v)
    +
    +/*
    + * Constants
    + */
    +#define	MINMATCH 4
    +
    +#define	COPYLENGTH 8
    +#define	LASTLITERALS 5
    +
    +#define	ML_BITS 4
    +#define	ML_MASK ((1U<> ML_BITS)) == RUN_MASK) {
    +			int s = 255;
    +			while ((ip < iend) && (s == 255)) {
    +				s = *ip++;
    +				length += s;
    +			}
    +		}
    +		/* copy literals */
    +		cpy = op + length;
    +		if ((cpy > oend - COPYLENGTH) ||
    +		    (ip + length > iend - COPYLENGTH)) {
    +			if (cpy > oend)
    +				/*
    +				 * Error: request to write beyond destination
    +				 * buffer.
    +				 */
    +				goto _output_error;
    +			if (ip + length > iend)
    +				/*
    +				 * Error : request to read beyond source
    +				 * buffer.
    +				 */
    +				goto _output_error;
    +			memcpy(op, ip, length);
    +			op += length;
    +			ip += length;
    +			if (ip < iend)
    +				/* Error : LZ4 format violation */
    +				goto _output_error;
    +			/* Necessarily EOF, due to parsing restrictions. */
    +			break;
    +		}
    +		LZ4_WILDCOPY(ip, op, cpy);
    +		ip -= (op - cpy);
    +		op = cpy;
    +
    +		/* get offset */
    +		LZ4_READ_LITTLEENDIAN_16(ref, cpy, ip);
    +		ip += 2;
    +		if (ref < (BYTE * const) dest)
    +			/*
    +			 * Error: offset creates reference outside of
    +			 * destination buffer.
    +			 */
    +			goto _output_error;
    +
    +		/* get matchlength */
    +		if ((length = (token & ML_MASK)) == ML_MASK) {
    +			while (ip < iend) {
    +				int s = *ip++;
    +				length += s;
    +				if (s == 255)
    +					continue;
    +				break;
    +			}
    +		}
    +		/* copy repeated sequence */
    +		if unlikely(op - ref < STEPSIZE) {
    +#if LZ4_ARCH64
    +			size_t dec2table[] = { 0, 0, 0, -1, 0, 1, 2, 3 };
    +			size_t dec2 = dec2table[op - ref];
    +#else
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 06:01:59 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id DC0634A0;
     Tue, 26 Feb 2013 06:01:59 +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 BB717EBB;
     Tue, 26 Feb 2013 06:01:59 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q61xsI087654;
     Tue, 26 Feb 2013 06:01:59 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q61xPP087646;
     Tue, 26 Feb 2013 06:01:59 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201302260601.r1Q61xPP087646@svn.freebsd.org>
    From: Xin LI 
    Date: Tue, 26 Feb 2013 06:01:59 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247310 - in stable/8: cddl/contrib/opensolaris/cmd/zfs
     cddl/contrib/opensolaris/cmd/zpool sys/cddl/boot/zfs
     sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/common/zfs
     sys/...
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 06:01:59 -0000
    
    Author: delphij
    Date: Tue Feb 26 06:01:58 2013
    New Revision: 247310
    URL: http://svnweb.freebsd.org/changeset/base/247310
    
    Log:
      MF9 r247309:
      
      MFC r246586,246587,246619,246624,246768,246808:
      
      LZ4 compression support in ZFS.
      
      (Note: sys/conf/files change omitted from this changeset).
    
    Added:
      stable/8/sys/cddl/boot/zfs/lz4.c
         - copied unchanged from r247309, stable/9/sys/cddl/boot/zfs/lz4.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4
         - copied unchanged from r247309, stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4.descrip
         - copied unchanged from r247309, stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4.descrip
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c
         - copied unchanged from r247309, stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c
    Modified:
      stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8
      stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
      stable/8/sys/cddl/boot/zfs/README
      stable/8/sys/cddl/boot/zfs/zfsimpl.h
      stable/8/sys/cddl/boot/zfs/zfssubr.c
      stable/8/sys/cddl/compat/opensolaris/sys/byteorder.h
      stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c
      stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h
      stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/Makefile.files
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c
    Directory Properties:
      stable/8/cddl/   (props changed)
      stable/8/cddl/contrib/opensolaris/   (props changed)
      stable/8/cddl/contrib/opensolaris/cmd/zfs/   (props changed)
      stable/8/sys/   (props changed)
      stable/8/sys/cddl/   (props changed)
      stable/8/sys/cddl/contrib/opensolaris/   (props changed)
    
    Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8
    ==============================================================================
    --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Tue Feb 26 05:58:05 2013	(r247309)
    +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Tue Feb 26 06:01:58 2013	(r247310)
    @@ -1,5 +1,5 @@
     '\" te
    -.\" Copyright (c) 2012, Martin Matuska .
    +.\" Copyright (c) 2013, Martin Matuska .
     .\" All Rights Reserved.
     .\"
     .\" The contents of this file are subject to the terms of the
    @@ -19,14 +19,15 @@
     .\"
     .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved.
     .\" Copyright (c) 2012 by Delphix. All rights reserved.
    -.\" Copyright (c) 2012 Nexenta Systems, Inc. All Rights Reserved.
     .\" Copyright (c) 2012, Joyent, Inc. All rights reserved.
     .\" Copyright (c) 2011, Pawel Jakub Dawidek 
     .\" Copyright (c) 2012, Glen Barber 
    +.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
    +.\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved.
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd November 26, 2012
    +.Dd February 10, 2013
     .Dt ZFS 8
     .Os
     .Sh NAME
    @@ -38,14 +39,12 @@
     .Nm
     .Cm create
     .Op Fl p
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ... filesystem
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... Ar filesystem
     .Nm
     .Cm create
     .Op Fl ps
     .Op Fl b Ar blocksize
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ...
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
     .Fl V
     .Ar size volume
     .Nm
    @@ -58,13 +57,13 @@
     .Sm off
     .Ar snapshot
     .Op % Ns Ar snapname
    -.Op , Ns Ar ...
    +.Op , Ns ...
     .Sm on
     .Nm
     .Cm snapshot
     .Op Fl r
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ... filesystem@snapname Ns | Ns Ar volume@snapname
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
    +.Ar filesystem@snapname Ns | Ns Ar volume@snapname
     .Nm
     .Cm rollback
     .Op Fl rRf
    @@ -72,8 +71,8 @@
     .Nm
     .Cm clone
     .Op Fl p
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ... snapshot filesystem Ns | Ns Ar volume
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
    +.Ar snapshot filesystem Ns | Ns Ar volume
     .Nm
     .Cm promote
     .Ar clone-filesystem
    @@ -101,31 +100,29 @@
     .Cm list
     .Op Fl r Ns | Ns Fl d Ar depth
     .Op Fl H
    -.Op Fl o Ar property Ns Op , Ns Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    -.Op Fl s Ar property
    -.Ar ...
    -.Op Fl S Ar property
    -.Ar ...
    +.Op Fl o Ar property Ns Oo , Ns property Ns Oc Ns ...
    +.Op Fl t Ar type Ns Oo , Ns type Ns Oc Ns ...
    +.Oo Fl s Ar property Oc Ns ...
    +.Oo Fl S Ar property Oc Ns ...
     .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
     .Nm
     .Cm set
     .Ar property Ns = Ns Ar value
    -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
    +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
     .Nm
     .Cm get
     .Op Fl r Ns | Ns Fl d Ar depth
     .Op Fl Hp
    -.Op Fl o Ar all | field Ns Op , Ns Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    -.Op Fl s Ar source Ns Op , Ns Ar ...
    -.Ar all | property Ns Op , Ns Ar ...
    -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
    +.Op Fl o Ar all | field Ns Oo , Ns Ar field Oc Ns ...
    +.Op Fl t Ar type Ns Oo Ns , Ar type Oc Ns ...
    +.Op Fl s Ar source Ns Oo Ns , Ns Ar source Oc Ns ...
    +.Ar all | property Ns Oo Ns , Ns Ar property Oc Ns ...
    +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
     .Nm
     .Cm inherit
     .Op Fl rS
     .Ar property
    -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
    +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
     .Nm
     .Cm upgrade
     .Op Fl v
    @@ -137,29 +134,25 @@
     .Nm
     .Cm userspace
     .Op Fl Hinp
    -.Op Fl o Ar field Ns Op , Ns Ar ...
    -.Op Fl s Ar field
    -.Ar ...
    -.Op Fl S Ar field
    -.Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    +.Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
    +.Oo Fl s Ar field Oc Ns ...
    +.Oo Fl S Ar field Oc Ns ...
    +.Op Fl t Ar type Ns Oo Ns , Ns Ar type Oc Ns ...
     .Ar filesystem Ns | Ns Ar snapshot
     .Nm
     .Cm groupspace
     .Op Fl Hinp
    -.Op Fl o Ar field Ns Op , Ns Ar ...
    -.Op Fl s Ar field
    -.Ar ...
    -.Op Fl S Ar field
    -.Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    +.Op Fl o Ar field Ns Oo , Ns field Oc Ns ...
    +.Oo Fl s Ar field Oc Ns ...
    +.Oo Fl S Ar field Oc Ns ...
    +.Op Fl t Ar type Ns Oo Ns , Ns Ar type Oc Ns ...
     .Ar filesystem Ns | Ns Ar snapshot
     .Nm
     .Cm mount
     .Nm
     .Cm mount
     .Op Fl vO
    -.Op Fl o Ar property Ns Op , Ns Ar ...
    +.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
     .Fl a | Ar filesystem
     .Nm
     .Cm unmount
    @@ -191,63 +184,71 @@
     .Nm
     .Cm allow
     .Op Fl ldug
    -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ...
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar user Ns | Ns Ar group Ns Oo Ns , Ns Ar user Ns | Ns Ar group Oc Ns ...
    +.Ar perm Ns | Ns Ar @setname Ns
    +.Oo Ns , Ns Ar perm Ns | Ns Ar @setname Oc Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm allow
     .Op Fl ld
    -.Fl e
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Fl e Ns | Ns Cm everyone
    +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm allow
     .Fl c
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm allow
     .Fl s
     .Ar @setname
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm unallow
     .Op Fl rldug
    -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ...
    -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar user Ns | Ns Ar group Ns Oo Ns , Ns Ar user Ns | Ns Ar group Oc Ns ...
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm unallow
     .Op Fl rld
    -.Fl e
    -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Fl e Ns | Ns Cm everyone
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm unallow
     .Op Fl r
     .Fl c
    -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm unallow
     .Op Fl r
     .Fl s
     .Ar @setname
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Nm
     .Cm hold
     .Op Fl r
    -.Ar tag snapshot ...
    +.Ar tag snapshot Ns ...
     .Nm
     .Cm holds
     .Op Fl r
    -.Ar snapshot ...
    +.Ar snapshot Ns ...
     .Nm
     .Cm release
     .Op Fl r
    -.Ar tag snapshot ...
    +.Ar tag snapshot Ns ...
     .Nm
     .Cm diff
     .Op Fl FHt
    @@ -859,7 +860,7 @@ but this may change in future releases).
     disables integrity checking on user data. Disabling checksums is
     .Em NOT
     a recommended practice.
    -.It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | Cm zle
    +.It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | zle | Cm lz4
     Controls the compression algorithm used for this dataset. The
     .CM lzjb
     compression algorithm is optimized for performance while providing decent data
    @@ -887,6 +888,26 @@ The
     .Cm zle
     compression algorithm compresses runs of zeros.
     .Pp
    +The
    +.Sy lz4
    +compression algorithm is a high-performance replacement
    +for the
    +.Sy lzjb
    +algorithm. It features significantly faster
    +compression and decompression, as well as a moderately higher
    +compression ratio than
    +.Sy lzjb ,
    +but can only be used on pools with
    +the
    +.Sy lz4_compress
    +feature set to
    +.Sy enabled .
    +See
    +.Xr zpool-features 7
    +for details on ZFS feature flags and the
    +.Sy lz4_compress
    +feature.
    +.Pp
     This property can also be referred to by its shortened column name
     .Cm compress .
     Changing this property affects only newly-written data.
    @@ -1383,8 +1404,8 @@ Displays a help message.
     .Nm
     .Cm create
     .Op Fl p
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ... filesystem
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
    +.Ar filesystem
     .Xc
     .Pp
     Creates a new
    @@ -1419,8 +1440,7 @@ options.
     .Cm create
     .Op Fl ps
     .Op Fl b Ar blocksize
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ...
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
     .Fl V
     .Ar size volume
     .Xc
    @@ -1520,7 +1540,7 @@ behavior for mounted file systems in use
     .Sm off
     .Ar snapshot
     .Op % Ns Ar snapname
    -.Op , Ns Ar ...
    +.Op , Ns ...
     .Sm on
     .Xc
     .Pp
    @@ -1581,8 +1601,7 @@ behavior for mounted file systems in use
     .Nm
     .Cm snapshot
     .Op Fl r
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ...
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
     .Ar filesystem@snapname Ns | Ns volume@snapname
     .Xc
     .Pp
    @@ -1629,8 +1648,8 @@ option to force an unmount of any clone 
     .Nm
     .Cm clone
     .Op Fl p
    -.Op Fl o Ar property Ns = Ns Ar value
    -.Ar ... snapshot filesystem Ns | Ns Ar volume
    +.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
    +.Ar snapshot filesystem Ns | Ns Ar volume
     .Xc
     .Pp
     Creates a clone of the given snapshot. See the
    @@ -1733,13 +1752,11 @@ only dataset that can be renamed recursi
     .Cm list
     .Op Fl r Ns | Ns Fl d Ar depth
     .Op Fl H
    -.Op Fl o Ar property Ns Op , Ns Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    -.Op Fl s Ar property
    -.Ar ...
    -.Op Fl S Ar property
    -.Ar ...
    -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
    +.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
    +.Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
    +.Oo Fl s Ar property Oc Ns ...
    +.Oo Fl S Ar property Oc Ns ...
    +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
     .Xc
     .Pp
     Lists the property information for the given datasets in tabular form. If
    @@ -1765,7 +1782,7 @@ will display only the dataset and its di
     .It Fl H
     Used for scripting mode. Do not print headers and separate fields by a single
     tab instead of arbitrary white space.
    -.It Fl o Ar property Ns Op , Ns Ar ...
    +.It Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
     A comma-separated list of properties to display. The property must be:
     .Bl -bullet -offset 2n
     .It
    @@ -1789,7 +1806,7 @@ shortcut for specifying
     .Sy filesystem,volume
     syntax.
     .El
    -.It Fl t Ar type Ns Op , Ns Ar ...
    +.It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
     A comma-separated list of types to display, where
     .Ar type
     is one of
    @@ -1852,11 +1869,11 @@ section.
     .Cm get
     .Op Fl r Ns | Ns Fl d Ar depth
     .Op Fl Hp
    -.Op Fl o Ar all | field Ns Op , Ns Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    -.Op Fl s Ar source Ns Op , Ns Ar ...
    -.Ar all | property Ns Op , Ns Ar ...
    -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
    +.Op Fl o Ar all | field Ns Oo , Ns Ar field Oc Ns ...
    +.Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
    +.Op Fl s Ar source Ns Oo , Ns Ar source Oc Ns ...
    +.Ar all | property Ns Oo , Ns Ar property Oc Ns ...
    +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
     .Xc
     .Pp
     Displays properties for the given datasets. If no datasets are specified, then
    @@ -1906,7 +1923,7 @@ omitted, and fields are explicitly separ
     arbitrary amount of space.
     .It Fl p
     Display numbers in parseable (exact) values.
    -.It Fl o Cm all | Ar field Ns Op , Ns Ar ...
    +.It Fl o Cm all | Ar field Ns Oo , Ns Ar field Oc Ns ...
     A comma-separated list of columns to display. Supported values are
     .Sy name,property,value,received,source .
     Default values are
    @@ -1914,7 +1931,7 @@ Default values are
     The keyword
     .Cm all
     specifies all columns.
    -.It Fl t Ar type Ns Op , Ns Ar ...
    +.It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
     A comma-separated list of types to display, where
     .Ar type
     is one of
    @@ -1922,7 +1939,7 @@ is one of
     For example, specifying
     .Fl t Cm snapshot
     displays only snapshots.
    -.It Fl s Ar source Ns Op , Ns Ar ...
    +.It Fl s Ar source Ns Oo , Ns Ar source Oc Ns ...
     A comma-separated list of sources to display. Those properties coming from a
     source other than those in this list are ignored. Each source must be one of
     the following:
    @@ -1934,7 +1951,7 @@ The default value is all sources.
     .Cm inherit
     .Op Fl rS
     .Ar property
    -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
    +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
     .Xc
     .Pp
     Clears the specified property, causing it to be inherited from an ancestor. If
    @@ -2009,12 +2026,10 @@ Upgrade the specified file system.
     .Nm
     .Cm userspace
     .Op Fl Hinp
    -.Op Fl o Ar field Ns Op , Ns Ar ...
    -.Op Fl s Ar field
    -.Ar ...
    -.Op Fl S Ar field
    -.Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    +.Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
    +.Oo Fl s Ar field Oc Ns ...
    +.Oo Fl S Ar field Oc Ns ...
    +.Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
     .Ar filesystem Ns | Ns Ar snapshot
     .Xc
     .Pp
    @@ -2031,7 +2046,7 @@ Print numeric ID instead of user/group n
     Do not print headers, use tab-delimited output.
     .It Fl p
     Use exact (parsable) numeric output.
    -.It Fl o Ar field Ns Op , Ns Ar ...
    +.It Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
     Display only the specified fields from the following set:
     .Sy type,name,used,quota .
     The default is to display all fields.
    @@ -2046,7 +2061,7 @@ another. The default is
     .It Fl S Ar field
     Sort by this field in reverse order. See
     .Fl s .
    -.It Fl t Ar type Ns Op , Ns Ar ...
    +.It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
     Print only the specified types from the following set:
     .Sy all,posixuser,smbuser,posixgroup,smbgroup .
     .Pp
    @@ -2062,12 +2077,10 @@ Translate SID to POSIX ID. This flag cur
     .Nm
     .Cm groupspace
     .Op Fl Hinp
    -.Op Fl o Ar field Ns Op , Ns Ar ...
    -.Op Fl s Ar field
    -.Ar ...
    -.Op Fl S Ar field
    -.Ar ...
    -.Op Fl t Ar type Ns Op , Ns Ar ...
    +.Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
    +.Oo Fl s Ar field Oc Ns ...
    +.Oo Fl S Ar field Oc Ns ...
    +.Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
     .Ar filesystem Ns | Ns Ar snapshot
     .Xc
     .Pp
    @@ -2091,7 +2104,7 @@ file systems currently mounted.
     .Nm
     .Cm mount
     .Op Fl vO
    -.Op Fl o Ar property Ns Op , Ns Ar ...
    +.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
     .Fl a | Ar filesystem
     .Xc
     .Pp
    @@ -2104,7 +2117,7 @@ Report mount progress.
     .It Fl O
     Perform an overlay mount. Overlay mounts are not supported on
     .Fx .
    -.It Fl o Ar property Ns Op , Ns Ar ...
    +.It Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
     An optional, comma-separated list of mount options to use temporarily for the
     duration of the mount. See the
     .Qq Sx Temporary Mount Point Properties
    @@ -2423,16 +2436,18 @@ for more information.
     .Nm
     .Cm allow
     .Op Fl ldug
    -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ...
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar user Ns | Ns Ar group Ns Oo Ns , Ns Ar user Ns | Ns Ar group Oc Ns ...
    +.Ar perm Ns | Ns Ar @setname Ns
    +.Oo Ns , Ns Ar perm Ns | Ns Ar @setname Oc Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .It Xo
     .Nm
     .Cm allow
     .Op Fl ld
    -.Fl e
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Fl e Ns | Ns Cm everyone
    +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .Pp
    @@ -2442,26 +2457,31 @@ administration permission for the file s
     .Bl -tag -width indent
     .It Xo
     .Op Fl ug
    -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ...
    +.Ar user Ns | Ns Ar group Ns Oo , Ar user Ns | Ns Ar group Oc Ns ...
     .Xc
     Specifies to whom the permissions are delegated. Multiple entities can be
     specified as a comma-separated list. If neither of the
     .Fl ug
     options are specified, then the argument is interpreted preferentially as the
    -keyword "everyone", then as a user name, and lastly as a group name. To specify
    -a user or group named "everyone", use the
    +keyword
    +.Cm everyone ,
    +then as a user name, and lastly as a group name. To specify
    +a user or group named
    +.Qq everyone ,
    +use the
     .Fl u
     or
     .Fl g
     options. To specify a group with the same name as a user, use the
     .Fl g
     option.
    +.It Op Fl e Ns | Ns Cm everyone
    +Specifies that the permissions be delegated to
    +.Qq everyone .
     .It Xo
    -.Op Fl e
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar perm Ns | Ns Ar @setname Ns Oo , Ns Ar perm Ns | Ns Ar @setname Oc Ns ...
     .Xc
    -Specifies that the permissions be delegated to "everyone".
    -Multiple permissions
    +The permissions to delegate. Multiple permissions
     may be specified as a comma-separated list. Permission names are the same as
     .Tn ZFS
     subcommand and property names. See the property list below. Property set names,
    @@ -2568,7 +2588,8 @@ protocol
     .Nm
     .Cm allow
     .Fl c
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .Pp
    @@ -2579,7 +2600,8 @@ creator of any newly-created descendent 
     .Cm allow
     .Fl s
     .Ar @setname
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ...
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .Pp
    @@ -2595,16 +2617,18 @@ and can be no more than 64 characters lo
     .Nm
     .Cm unallow
     .Op Fl rldug
    -.Cm everyone Ns | Ns Ar user Ns | Ns Ar group Ns Op , Ns Ar ...
    -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Ar user Ns | Ns Ar group Ns Oo Ns , Ns Ar user Ns | Ns Ar group Oc Ns ...
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .It Xo
     .Nm
     .Cm unallow
     .Op Fl rld
    -.Fl e
    -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Fl e Ns | Ns Cm everyone
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .It Xo
    @@ -2612,7 +2636,8 @@ and can be no more than 64 characters lo
     .Cm unallow
     .Op Fl r
     .Fl c
    -.Op Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .Pp
    @@ -2621,10 +2646,12 @@ Removes permissions that were granted wi
     command. No permissions are explicitly denied, so other permissions granted are
     still in effect. For example, if the permission is granted by an ancestor. If
     no permissions are specified, then all permissions for the specified
    -.Ar user , group , No or Ar everyone
    -are removed. Specifying "everyone" (or using the
    -.Fl e
    -option) only removes the permissions that were granted to "everyone",
    +.Ar user , group , No or everyone
    +are removed. Specifying
    +.Cm everyone
    +.Po or using the Fl e
    +option
    +.Pc only removes the permissions that were granted to everyone ,
     not all permissions for every user and group. See the
     .Qq Nm Cm allow
     command for a description of the
    @@ -2640,7 +2667,8 @@ Recursively remove the permissions from 
     .Op Fl r
     .Fl s
     .Ar @setname
    -.Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar ...
    +.Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
    +.Ns ... Oc
     .Ar filesystem Ns | Ns Ar volume
     .Xc
     .Pp
    @@ -2650,7 +2678,7 @@ then all permissions are removed, thus r
     .Nm
     .Cm hold
     .Op Fl r
    -.Ar tag snapshot ...
    +.Ar tag snapshot Ns ...
     .Xc
     .Pp
     Adds a single reference, named with the
    @@ -2671,7 +2699,7 @@ snapshots of all descendent file systems
     .Nm
     .Cm holds
     .Op Fl r
    -.Ar snapshot ...
    +.Ar snapshot Ns ...
     .Xc
     .Pp
     Lists all existing user references for the given snapshot or snapshots.
    @@ -2684,7 +2712,7 @@ listing the holds on the named snapshot.
     .Nm
     .Cm release
     .Op Fl r
    -.Ar tag snapshot ...
    +.Ar tag snapshot Ns ...
     .Xc
     .Pp
     Removes a single reference, named with the
    
    Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
    ==============================================================================
    --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7	Tue Feb 26 05:58:05 2013	(r247309)
    +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7	Tue Feb 26 06:01:58 2013	(r247310)
    @@ -18,10 +18,11 @@
     .\" information: Portions Copyright [yyyy] [name of copyright owner]
     .\"
     .\" Copyright (c) 2012 by Delphix. All rights reserved.
    +.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd Aug 28, 2012
    +.Dd February 8, 2013
     .Dt ZPOOL-FEATURES 7
     .Os
     .Sh NAME
    @@ -185,6 +186,49 @@ This feature is
     .Sy active
     while there are any filesystems, volumes, or snapshots which were created
     after enabling this feature.
    +.It Sy lz4_compress
    +.Bl -column "READ\-ONLY COMPATIBLE" "org.illumos:lz4_compress"
    +.It GUID Ta org.illumos:lz4_compress
    +.It READ\-ONLY COMPATIBLE Ta no
    +.It DEPENDENCIES Ta none
    +.El
    +.Pp
    +.Sy lz4
    +is a high-performance real-time compression algorithm that
    +features significantly faster compression and decompression as well as a
    +higher compression ratio than the older
    +.Sy lzjb
    +compression.
    +Typically,
    +.Sy lz4
    +compression is approximately 50% faster on
    +compressible data and 200% faster on incompressible data than
    +.Sy lzjb .
    +It is also approximately 80% faster on decompression, while
    +giving approximately 10% better compression ratio.
    +.Pp
    +When the
    +.Sy lz4_compress
    +feature is set to
    +.Sy enabled ,
    +the
    +administrator can turn on
    +.Sy lz4
    +compression on any dataset on the
    +pool using the
    +.Xr zfs 8
    +command. Please note that doing so will
    +immediately activate the
    +.Sy lz4_compress
    +feature on the underlying
    +pool (even before any data is written). Since this feature is not
    +read-only compatible, this operation will render the pool unimportable
    +on systems without support for the
    +.Sy lz4_compress
    +feature. At the
    +moment, this operation cannot be reversed. Booting off of
    +.Sy lz4
    +-compressed root pools is supported.
     .El
     .Sh SEE ALSO
     .Xr zpool 8
    
    Modified: stable/8/sys/cddl/boot/zfs/README
    ==============================================================================
    --- stable/8/sys/cddl/boot/zfs/README	Tue Feb 26 05:58:05 2013	(r247309)
    +++ stable/8/sys/cddl/boot/zfs/README	Tue Feb 26 06:01:58 2013	(r247310)
    @@ -5,6 +5,7 @@ are used by the ZFS bootstrap:
     
         fletcher.c			checksum support
         sha256.c			checksum support
    +    lz4.c			compression support
         lzjb.c			compression support
         zfssubr.c			checksum, compression and raidz support
         zfsimpl.h			mostly describing the physical layout
    
    Copied: stable/8/sys/cddl/boot/zfs/lz4.c (from r247309, stable/9/sys/cddl/boot/zfs/lz4.c)
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ stable/8/sys/cddl/boot/zfs/lz4.c	Tue Feb 26 06:01:58 2013	(r247310, copy of r247309, stable/9/sys/cddl/boot/zfs/lz4.c)
    @@ -0,0 +1,308 @@
    +/*
    + * LZ4 - Fast LZ compression algorithm
    + * Header File
    + * Copyright (C) 2011-2013, Yann Collet.
    + * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions are
    + * met:
    + *
    + *     * Redistributions of source code must retain the above copyright
    + * notice, this list of conditions and the following disclaimer.
    + *     * Redistributions in binary form must reproduce the above
    + * copyright notice, this list of conditions and the following disclaimer
    + * in the documentation and/or other materials provided with the
    + * distribution.
    + *
    + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    + * OWNER 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.
    + *
    + * You can contact the author at :
    + * - LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html
    + * - LZ4 source repository : http://code.google.com/p/lz4/
    + *
    + * $FreeBSD$
    + */
    +
    +static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest,
    +					    int isize, int maxOutputSize);
    +
    +/* ARGSUSED */
    +static int
    +lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int dummy __unused)
    +{
    +	const uint8_t *src = s_start;
    +	uint32_t bufsiz = htonl(*(uint32_t *)src);
    +
    +	/* invalid compressed buffer size encoded at start */
    +	if (bufsiz + 4 > s_len)
    +		return (1);
    +
    +	/*
    +	 * Returns 0 on success (decompression function returned non-negative)
    +	 * and non-zero on failure (decompression function returned negative).
    +	 */
    +	return (LZ4_uncompress_unknownOutputSize(s_start + 4, d_start, bufsiz,
    +	    d_len) < 0);
    +}
    +
    +/*
    + * CPU Feature Detection
    + */
    +
    +/* 32 or 64 bits ? */
    +#if (defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) || \
    +	defined(__amd64) || defined(__ppc64__) || defined(_WIN64) || \
    +	defined(__LP64__) || defined(_LP64))
    +#define	LZ4_ARCH64	1
    +#else
    +#define	LZ4_ARCH64	0
    +#endif
    +
    +/*
    + * Little Endian or Big Endian?
    + * Note: overwrite the below #define if you know your architecture endianess.
    + */
    +#if BYTE_ORDER == BIG_ENDIAN
    +#define	LZ4_BIG_ENDIAN	1
    +#else
    +	/*
    +	 * Little Endian assumed. PDP Endian and other very rare endian format
    +	 * are unsupported.
    +	 */
    +#endif
    +
    +/*
    + * Compiler Options
    + */
    +#if __STDC_VERSION__ >= 199901L	/* C99 */
    +/* "restrict" is a known keyword */
    +#else
    +/* Disable restrict */
    +#define	restrict
    +#endif
    +
    +#define	GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
    +
    +#define	lz4_bswap16(x) ((unsigned short int) ((((x) >> 8) & 0xffu) \
    +	| (((x) & 0xffu) << 8)))
    +
    +#if (GCC_VERSION >= 302) || (__INTEL_COMPILER >= 800) || defined(__clang__)
    +#define	expect(expr, value)    (__builtin_expect((expr), (value)))
    +#else
    +#define	expect(expr, value)    (expr)
    +#endif
    +
    +#define	likely(expr)	expect((expr) != 0, 1)
    +#define	unlikely(expr)	expect((expr) != 0, 0)
    +
    +/* Basic types */
    +#define	BYTE	uint8_t
    +#define	U16	uint16_t
    +#define	U32	uint32_t
    +#define	S32	int32_t
    +#define	U64	uint64_t
    +
    +typedef struct _U16_S {
    +	U16 v;
    +} U16_S;
    +typedef struct _U32_S {
    +	U32 v;
    +} U32_S;
    +typedef struct _U64_S {
    +	U64 v;
    +} U64_S;
    +
    +#define	A64(x)	(((U64_S *)(x))->v)
    +#define	A32(x)	(((U32_S *)(x))->v)
    +#define	A16(x)	(((U16_S *)(x))->v)
    +
    +/*
    + * Constants
    + */
    +#define	MINMATCH 4
    +
    +#define	COPYLENGTH 8
    +#define	LASTLITERALS 5
    +
    +#define	ML_BITS 4
    +#define	ML_MASK ((1U<> ML_BITS)) == RUN_MASK) {
    +			int s = 255;
    +			while ((ip < iend) && (s == 255)) {
    +				s = *ip++;
    +				length += s;
    +			}
    +		}
    +		/* copy literals */
    +		cpy = op + length;
    +		if ((cpy > oend - COPYLENGTH) ||
    +		    (ip + length > iend - COPYLENGTH)) {
    +			if (cpy > oend)
    +				/*
    +				 * Error: request to write beyond destination
    +				 * buffer.
    +				 */
    +				goto _output_error;
    +			if (ip + length > iend)
    +				/*
    +				 * Error : request to read beyond source
    +				 * buffer.
    +				 */
    +				goto _output_error;
    +			memcpy(op, ip, length);
    +			op += length;
    +			ip += length;
    +			if (ip < iend)
    +				/* Error : LZ4 format violation */
    +				goto _output_error;
    +			/* Necessarily EOF, due to parsing restrictions. */
    +			break;
    +		}
    +		LZ4_WILDCOPY(ip, op, cpy);
    +		ip -= (op - cpy);
    +		op = cpy;
    +
    +		/* get offset */
    +		LZ4_READ_LITTLEENDIAN_16(ref, cpy, ip);
    +		ip += 2;
    +		if (ref < (BYTE * const) dest)
    +			/*
    +			 * Error: offset creates reference outside of
    +			 * destination buffer.
    +			 */
    +			goto _output_error;
    +
    +		/* get matchlength */
    +		if ((length = (token & ML_MASK)) == ML_MASK) {
    +			while (ip < iend) {
    +				int s = *ip++;
    +				length += s;
    +				if (s == 255)
    +					continue;
    +				break;
    +			}
    +		}
    +		/* copy repeated sequence */
    +		if unlikely(op - ref < STEPSIZE) {
    +#if LZ4_ARCH64
    +			size_t dec2table[] = { 0, 0, 0, -1, 0, 1, 2, 3 };
    +			size_t dec2 = dec2table[op - ref];
    +#else
    +			const int dec2 = 0;
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 07:00:26 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 03AA0F04;
     Tue, 26 Feb 2013 07:00:26 +0000 (UTC) (envelope-from alc@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 D7C1812B;
     Tue, 26 Feb 2013 07:00:25 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q70PFm005556;
     Tue, 26 Feb 2013 07:00:25 GMT (envelope-from alc@svn.freebsd.org)
    Received: (from alc@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q70Pej005555;
     Tue, 26 Feb 2013 07:00:25 GMT (envelope-from alc@svn.freebsd.org)
    Message-Id: <201302260700.r1Q70Pej005555@svn.freebsd.org>
    From: Alan Cox 
    Date: Tue, 26 Feb 2013 07:00:25 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247312 - head/sys/fs/fuse
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 07:00:26 -0000
    
    Author: alc
    Date: Tue Feb 26 07:00:24 2013
    New Revision: 247312
    URL: http://svnweb.freebsd.org/changeset/base/247312
    
    Log:
      Eliminate a duplicate #include.
      
      Sponsored by:	EMC / Isilon Storage Division
    
    Modified:
      head/sys/fs/fuse/fuse_io.c
    
    Modified: head/sys/fs/fuse/fuse_io.c
    ==============================================================================
    --- head/sys/fs/fuse/fuse_io.c	Tue Feb 26 06:38:00 2013	(r247311)
    +++ head/sys/fs/fuse/fuse_io.c	Tue Feb 26 07:00:24 2013	(r247312)
    @@ -87,7 +87,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     
     #include "fuse.h"
     #include "fuse_file.h"
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 07:27:31 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 8DBB776B;
     Tue, 26 Feb 2013 07:27:31 +0000 (UTC)
     (envelope-from andrew@fubar.geek.nz)
    Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64])
     by mx1.freebsd.org (Postfix) with ESMTP id 595D320D;
     Tue, 26 Feb 2013 07:27:31 +0000 (UTC)
    Received: from mxin1-orange.clear.net.nz
     (lb2-srcnat.clear.net.nz [203.97.32.237])
     by smtp3.clear.net.nz (CLEAR Net Mail)
     with ESMTP id <0MIT0069RGPTX700@smtp3.clear.net.nz>; Tue,
     26 Feb 2013 20:27:30 +1300 (NZDT)
    Received: from 202-0-48-19.paradise.net.nz (HELO bender) ([202.0.48.19])
     by smtpin1.paradise.net.nz with ESMTP; Tue, 26 Feb 2013 20:27:30 +1300
    Date: Tue, 26 Feb 2013 20:27:07 +1300
    From: Andrew Turner 
    Subject: Re: svn commit: r247116 - in head/sys: fs/nfs fs/nfsclient kern
     nfsclient sys tools
    In-reply-to: <8006325C-B281-4F4D-BE1A-C3B444FE979F@rice.edu>
    To: Alan Cox 
    Message-id: <20130226202707.026ad226@bender>
    MIME-version: 1.0
    Content-type: text/plain; charset=US-ASCII
    Content-transfer-encoding: 7bit
    References: <201302211902.r1LJ2o5T033708@svn.freebsd.org>
     <20130225201313.2050da18@bender> <20130225085019.GU2454@kib.kiev.ua>
     <20130225233603.49a5d4a5@bender>
     <8006325C-B281-4F4D-BE1A-C3B444FE979F@rice.edu>
    Cc: Konstantin Belousov , svn-src-head@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org,
     John Baldwin 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 07:27:31 -0000
    
    On Mon, 25 Feb 2013 15:00:41 -0600
    Alan Cox  wrote:
    
    > 
    > On Feb 25, 2013, at 4:36 AM, Andrew Turner wrote:
    > 
    > > On Mon, 25 Feb 2013 10:50:19 +0200
    > > Konstantin Belousov  wrote:
    > > 
    > >> On Mon, Feb 25, 2013 at 08:13:13PM +1300, Andrew Turner wrote:
    > >>> On Thu, 21 Feb 2013 19:02:50 +0000 (UTC)
    > >>> John Baldwin  wrote:
    > >>> 
    > >>>> Author: jhb
    > >>>> Date: Thu Feb 21 19:02:50 2013
    > >>>> New Revision: 247116
    > >>>> URL: http://svnweb.freebsd.org/changeset/base/247116
    > >>>> 
    > >>>> Log:
    > >>>>  Further refine the handling of stop signals in the NFS client.
    > >>>> The changes in r246417 were incomplete as they did not add
    > >>>> explicit calls to sigdeferstop() around all the places that
    > >>>> previously passed SBDRY to _sleep().  In addition,
    > >>>> nfs_getcacheblk() could trigger a write RPC from getblk()
    > >>>> resulting in sigdeferstop() recursing. Rather than manually
    > >>>> deferring stop signals in specific places, change the VFS_*() and
    > >>>> VOP_*() methods to defer stop signals for filesystems which
    > >>>> request this behavior via a new VFCF_SBDRY flag. Note that this
    > >>>> has to be a VFC flag rather than a MNTK flag so that it works
    > >>>> properly with VFS_MOUNT() when the mount is not yet fully
    > >>>> constructed.  For now, only the NFS clients are set this new flag
    > >>>> in VFS_SET(). A few other related changes:
    > >>>>  - Add an assertion to ensure that TDF_SBDRY doesn't leak to
    > >>>> userland.
    > >>>>  - When a lookup request uses VOP_READLINK() to follow a symlink,
    > >>>> mark the request as being on behalf of the thread performing the
    > >>>> lookup (cnp_thread) rather than using a NULL thread pointer.
    > >>>> This causes NFS to properly handle signals during this VOP on an
    > >>>> interruptible mount.
    > >>>> 
    > >>>>  PR:		kern/176179
    > >>>>  Reported by:	Russell Cattelan (sigdeferstop() recursion)
    > >>>>  Reviewed by:	kib
    > >>>>  MFC after:	1 month
    > >>> 
    > >>> This change is causing init to crash for me on armv6. I'm
    > >>> netbooting a PandaBoard and it appears init is receiving a SIGABRT
    > >>> before it gets into main().
    > >>> 
    > >>> Do you have any idea where I could look to track down why it is
    > >>> doing this?
    > >> 
    > >> It is weird. SIGABRT sent by the kernel usually means that
    > >> execve(2) already destroyed the previous address space of the
    > >> process, but the new image cannot be activated, most likely due to
    > >> image format error discovered too late, or resource shortage.
    > >> 
    > >> Could it be that some NFS RPC fails after the patch, but I cannot
    > >> imagine why. You would need to track this. Also, verify that the
    > >> init binary is correct.
    > >> 
    > >> I tried amd64 netboot, and it worked fine.
    > > 
    > > It looks like this change is not the issue, it just changed the
    > > symptom enough for me to not realise I was seeing an issue where
    > > it would crash the kernel before. I reinstated this change but only
    > > allowed the kernel to access half the memory and it booted
    > > correctly.
    > > 
    > > The real issue appears to be related to something in the vm layer
    > > not working on ARM boards with too much memory (somewhere between
    > > 512MiB and 1GiB).
    > 
    > 
    > The recently introduced auto-sizing and cap may be too optimistic.
    > In fact, they are greater than what we allow on 32-bit x86 and 32-bit
    > MIPS.  Try the following.
    > 
    > Index: arm/include/vmparam.h
    > ===================================================================
    > --- arm/include/vmparam.h	(revision 247249)
    > +++ arm/include/vmparam.h	(working copy)
    > @@ -142,15 +142,15 @@
    >  #define VM_KMEM_SIZE		(12*1024*1024)
    >  #endif
    >  #ifndef VM_KMEM_SIZE_SCALE
    > -#define VM_KMEM_SIZE_SCALE	(2)
    > +#define VM_KMEM_SIZE_SCALE	(3)
    >  #endif
    >  
    >  /*
    > - * Ceiling on the size of the kmem submap: 60% of the kernel map.
    > + * Ceiling on the size of the kmem submap: 40% of the kernel map.
    >   */
    >  #ifndef VM_KMEM_SIZE_MAX
    >  #define	VM_KMEM_SIZE_MAX	((vm_max_kernel_address - \
    > -    VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5)
    > +    VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
    >  #endif
    >  
    >  #define MAXTSIZ 	(16*1024*1024)
    > 
    This patch fixes the boot for me. Is it likely we will see similar
    issues with boards with more memory with this? I know of ARM boards
    with 2GiB of ram, and I would expect to see some with more soon.
    
    Andrew
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 07:41:35 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 991C0A79;
     Tue, 26 Feb 2013 07:41:35 +0000 (UTC) (envelope-from alc@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 8B85C28D;
     Tue, 26 Feb 2013 07:41:35 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q7fZut018015;
     Tue, 26 Feb 2013 07:41:35 GMT (envelope-from alc@svn.freebsd.org)
    Received: (from alc@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q7fZSn018013;
     Tue, 26 Feb 2013 07:41:35 GMT (envelope-from alc@svn.freebsd.org)
    Message-Id: <201302260741.r1Q7fZSn018013@svn.freebsd.org>
    From: Alan Cox 
    Date: Tue, 26 Feb 2013 07:41:35 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247313 - in head/sys/arm: at91 sa11x0
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 07:41:35 -0000
    
    Author: alc
    Date: Tue Feb 26 07:41:34 2013
    New Revision: 247313
    URL: http://svnweb.freebsd.org/changeset/base/247313
    
    Log:
      Eliminate a redundant #include: machine/pmap.h is already included
      through vm/pmap.h.
    
    Modified:
      head/sys/arm/at91/at91_machdep.c
      head/sys/arm/sa11x0/assabet_machdep.c
    
    Modified: head/sys/arm/at91/at91_machdep.c
    ==============================================================================
    --- head/sys/arm/at91/at91_machdep.c	Tue Feb 26 07:00:24 2013	(r247312)
    +++ head/sys/arm/at91/at91_machdep.c	Tue Feb 26 07:41:34 2013	(r247313)
    @@ -77,7 +77,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/arm/sa11x0/assabet_machdep.c
    ==============================================================================
    --- head/sys/arm/sa11x0/assabet_machdep.c	Tue Feb 26 07:00:24 2013	(r247312)
    +++ head/sys/arm/sa11x0/assabet_machdep.c	Tue Feb 26 07:41:34 2013	(r247313)
    @@ -80,7 +80,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 07:49:46 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 5BB76C5F;
     Tue, 26 Feb 2013 07:49:46 +0000 (UTC) (envelope-from alc@rice.edu)
    Received: from proofpoint1.mail.rice.edu (proofpoint1.mail.rice.edu
     [128.42.201.100])
     by mx1.freebsd.org (Postfix) with ESMTP id EA18F2D3;
     Tue, 26 Feb 2013 07:49:45 +0000 (UTC)
    Received: from pps.filterd (proofpoint1 [127.0.0.1])
     by proofpoint1.mail.rice.edu (8.14.5/8.14.5) with SMTP id r1PMK2FK023466;
     Tue, 26 Feb 2013 01:49:44 -0600
    Received: from mh10.mail.rice.edu (mh10.mail.rice.edu [128.42.201.30])
     by proofpoint1.mail.rice.edu with ESMTP id 1ant268mk5-1;
     Tue, 26 Feb 2013 01:49:44 -0600
    Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1])
     by mh10.mail.rice.edu (Postfix) with ESMTP id 97CE9603DC;
     Tue, 26 Feb 2013 01:49:44 -0600 (CST)
    Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1])
     by mh10.mail.rice.edu (Postfix) with ESMTP id 95EBB603DB;
     Tue, 26 Feb 2013 01:49:44 -0600 (CST)
    X-Virus-Scanned: by amavis-2.7.0 at mh10.mail.rice.edu, auth channel
    Received: from mh10.mail.rice.edu ([127.0.0.1])
     by mh10.mail.rice.edu (mh10.mail.rice.edu [127.0.0.1]) (amavis, port 10026)
     with ESMTP id qI_DU-Ym-wcu; Tue, 26 Feb 2013 01:49:44 -0600 (CST)
    Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net
     (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18])
     (using TLSv1 with cipher RC4-MD5 (128/128 bits))
     (No client certificate requested) (Authenticated sender: alc)
     by mh10.mail.rice.edu (Postfix) with ESMTPSA id D3D36603DA;
     Tue, 26 Feb 2013 01:49:43 -0600 (CST)
    Message-ID: <512C6916.5010608@rice.edu>
    Date: Tue, 26 Feb 2013 01:49:42 -0600
    From: Alan Cox 
    User-Agent: Mozilla/5.0 (X11; FreeBSD i386;
     rv:17.0) Gecko/20130127 Thunderbird/17.0.2
    MIME-Version: 1.0
    To: Andrew Turner 
    Subject: Re: svn commit: r247116 - in head/sys: fs/nfs fs/nfsclient kern 
     nfsclient sys tools
    References: <201302211902.r1LJ2o5T033708@svn.freebsd.org>
     <20130225201313.2050da18@bender> <20130225085019.GU2454@kib.kiev.ua>
     <20130225233603.49a5d4a5@bender>
     <8006325C-B281-4F4D-BE1A-C3B444FE979F@rice.edu>
     <20130226202707.026ad226@bender>
    In-Reply-To: <20130226202707.026ad226@bender>
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: 7bit
    Cc: Konstantin Belousov , svn-src-head@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org,
     John Baldwin 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 07:49:46 -0000
    
    On 02/26/2013 01:27, Andrew Turner wrote:
    > On Mon, 25 Feb 2013 15:00:41 -0600
    > Alan Cox  wrote:
    >
    >> On Feb 25, 2013, at 4:36 AM, Andrew Turner wrote:
    >>
    >>> On Mon, 25 Feb 2013 10:50:19 +0200
    >>> Konstantin Belousov  wrote:
    >>>
    >>>> On Mon, Feb 25, 2013 at 08:13:13PM +1300, Andrew Turner wrote:
    >>>>> On Thu, 21 Feb 2013 19:02:50 +0000 (UTC)
    >>>>> John Baldwin  wrote:
    >>>>>
    >>>>>> Author: jhb
    >>>>>> Date: Thu Feb 21 19:02:50 2013
    >>>>>> New Revision: 247116
    >>>>>> URL: http://svnweb.freebsd.org/changeset/base/247116
    >>>>>>
    >>>>>> Log:
    >>>>>>  Further refine the handling of stop signals in the NFS client.
    >>>>>> The changes in r246417 were incomplete as they did not add
    >>>>>> explicit calls to sigdeferstop() around all the places that
    >>>>>> previously passed SBDRY to _sleep().  In addition,
    >>>>>> nfs_getcacheblk() could trigger a write RPC from getblk()
    >>>>>> resulting in sigdeferstop() recursing. Rather than manually
    >>>>>> deferring stop signals in specific places, change the VFS_*() and
    >>>>>> VOP_*() methods to defer stop signals for filesystems which
    >>>>>> request this behavior via a new VFCF_SBDRY flag. Note that this
    >>>>>> has to be a VFC flag rather than a MNTK flag so that it works
    >>>>>> properly with VFS_MOUNT() when the mount is not yet fully
    >>>>>> constructed.  For now, only the NFS clients are set this new flag
    >>>>>> in VFS_SET(). A few other related changes:
    >>>>>>  - Add an assertion to ensure that TDF_SBDRY doesn't leak to
    >>>>>> userland.
    >>>>>>  - When a lookup request uses VOP_READLINK() to follow a symlink,
    >>>>>> mark the request as being on behalf of the thread performing the
    >>>>>> lookup (cnp_thread) rather than using a NULL thread pointer.
    >>>>>> This causes NFS to properly handle signals during this VOP on an
    >>>>>> interruptible mount.
    >>>>>>
    >>>>>>  PR:		kern/176179
    >>>>>>  Reported by:	Russell Cattelan (sigdeferstop() recursion)
    >>>>>>  Reviewed by:	kib
    >>>>>>  MFC after:	1 month
    >>>>> This change is causing init to crash for me on armv6. I'm
    >>>>> netbooting a PandaBoard and it appears init is receiving a SIGABRT
    >>>>> before it gets into main().
    >>>>>
    >>>>> Do you have any idea where I could look to track down why it is
    >>>>> doing this?
    >>>> It is weird. SIGABRT sent by the kernel usually means that
    >>>> execve(2) already destroyed the previous address space of the
    >>>> process, but the new image cannot be activated, most likely due to
    >>>> image format error discovered too late, or resource shortage.
    >>>>
    >>>> Could it be that some NFS RPC fails after the patch, but I cannot
    >>>> imagine why. You would need to track this. Also, verify that the
    >>>> init binary is correct.
    >>>>
    >>>> I tried amd64 netboot, and it worked fine.
    >>> It looks like this change is not the issue, it just changed the
    >>> symptom enough for me to not realise I was seeing an issue where
    >>> it would crash the kernel before. I reinstated this change but only
    >>> allowed the kernel to access half the memory and it booted
    >>> correctly.
    >>>
    >>> The real issue appears to be related to something in the vm layer
    >>> not working on ARM boards with too much memory (somewhere between
    >>> 512MiB and 1GiB).
    >>
    >> The recently introduced auto-sizing and cap may be too optimistic.
    >> In fact, they are greater than what we allow on 32-bit x86 and 32-bit
    >> MIPS.  Try the following.
    >>
    >> Index: arm/include/vmparam.h
    >> ===================================================================
    >> --- arm/include/vmparam.h	(revision 247249)
    >> +++ arm/include/vmparam.h	(working copy)
    >> @@ -142,15 +142,15 @@
    >>  #define VM_KMEM_SIZE		(12*1024*1024)
    >>  #endif
    >>  #ifndef VM_KMEM_SIZE_SCALE
    >> -#define VM_KMEM_SIZE_SCALE	(2)
    >> +#define VM_KMEM_SIZE_SCALE	(3)
    >>  #endif
    >>  
    >>  /*
    >> - * Ceiling on the size of the kmem submap: 60% of the kernel map.
    >> + * Ceiling on the size of the kmem submap: 40% of the kernel map.
    >>   */
    >>  #ifndef VM_KMEM_SIZE_MAX
    >>  #define	VM_KMEM_SIZE_MAX	((vm_max_kernel_address - \
    >> -    VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5)
    >> +    VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
    >>  #endif
    >>  
    >>  #define MAXTSIZ 	(16*1024*1024)
    >>
    > This patch fixes the boot for me. Is it likely we will see similar
    > issues with boards with more memory with this? I know of ARM boards
    > with 2GiB of ram, and I would expect to see some with more soon.
    >
    
    The kmem submap should be fine, but other things might become a problem.
    
    What do "sysctl -x vm.min_kernel_address" and "sysctl -x
    vm.max_kernel_address" report on your machine?
    
    Alan
    
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 08:09:52 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 59359348;
     Tue, 26 Feb 2013 08:09:52 +0000 (UTC)
     (envelope-from andrew@fubar.geek.nz)
    Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64])
     by mx1.freebsd.org (Postfix) with ESMTP id 0293F373;
     Tue, 26 Feb 2013 08:09:51 +0000 (UTC)
    Received: from mxin2-orange.clear.net.nz
     (lb2-srcnat.clear.net.nz [203.97.32.237])
     by smtp3.clear.net.nz (CLEAR Net Mail)
     with ESMTP id <0MIT0061FIMVX610@smtp3.clear.net.nz>; Tue,
     26 Feb 2013 21:08:58 +1300 (NZDT)
    Received: from 202-0-48-19.paradise.net.nz (HELO bender) ([202.0.48.19])
     by smtpin2.paradise.net.nz with ESMTP; Tue, 26 Feb 2013 21:08:57 +1300
    Date: Tue, 26 Feb 2013 21:08:35 +1300
    From: Andrew Turner 
    Subject: Re: svn commit: r247116 - in head/sys: fs/nfs fs/nfsclient kern
     nfsclient sys tools
    In-reply-to: <512C6916.5010608@rice.edu>
    To: Alan Cox 
    Message-id: <20130226210835.749cd816@bender>
    MIME-version: 1.0
    Content-type: text/plain; charset=US-ASCII
    Content-transfer-encoding: 7bit
    References: <201302211902.r1LJ2o5T033708@svn.freebsd.org>
     <20130225201313.2050da18@bender> <20130225085019.GU2454@kib.kiev.ua>
     <20130225233603.49a5d4a5@bender>
     <8006325C-B281-4F4D-BE1A-C3B444FE979F@rice.edu>
     <20130226202707.026ad226@bender> <512C6916.5010608@rice.edu>
    Cc: Konstantin Belousov , svn-src-head@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org,
     John Baldwin 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 08:09:52 -0000
    
    On Tue, 26 Feb 2013 01:49:42 -0600
    Alan Cox  wrote:
    
    > On 02/26/2013 01:27, Andrew Turner wrote:
    > > On Mon, 25 Feb 2013 15:00:41 -0600
    > > Alan Cox  wrote:
    > >
    > >> On Feb 25, 2013, at 4:36 AM, Andrew Turner wrote:
    > >>
    > >>> On Mon, 25 Feb 2013 10:50:19 +0200
    > >>> Konstantin Belousov  wrote:
    > >>>
    > >>>> On Mon, Feb 25, 2013 at 08:13:13PM +1300, Andrew Turner wrote:
    > >>>>> On Thu, 21 Feb 2013 19:02:50 +0000 (UTC)
    > >>>>> John Baldwin  wrote:
    > >>>>>
    > >>>>>> Author: jhb
    > >>>>>> Date: Thu Feb 21 19:02:50 2013
    > >>>>>> New Revision: 247116
    > >>>>>> URL: http://svnweb.freebsd.org/changeset/base/247116
    > >>>>>>
    > >>>>>> Log:
    > >>>>>>  Further refine the handling of stop signals in the NFS client.
    > >>>>>> The changes in r246417 were incomplete as they did not add
    > >>>>>> explicit calls to sigdeferstop() around all the places that
    > >>>>>> previously passed SBDRY to _sleep().  In addition,
    > >>>>>> nfs_getcacheblk() could trigger a write RPC from getblk()
    > >>>>>> resulting in sigdeferstop() recursing. Rather than manually
    > >>>>>> deferring stop signals in specific places, change the VFS_*()
    > >>>>>> and VOP_*() methods to defer stop signals for filesystems which
    > >>>>>> request this behavior via a new VFCF_SBDRY flag. Note that this
    > >>>>>> has to be a VFC flag rather than a MNTK flag so that it works
    > >>>>>> properly with VFS_MOUNT() when the mount is not yet fully
    > >>>>>> constructed.  For now, only the NFS clients are set this new
    > >>>>>> flag in VFS_SET(). A few other related changes:
    > >>>>>>  - Add an assertion to ensure that TDF_SBDRY doesn't leak to
    > >>>>>> userland.
    > >>>>>>  - When a lookup request uses VOP_READLINK() to follow a
    > >>>>>> symlink, mark the request as being on behalf of the thread
    > >>>>>> performing the lookup (cnp_thread) rather than using a NULL
    > >>>>>> thread pointer. This causes NFS to properly handle signals
    > >>>>>> during this VOP on an interruptible mount.
    > >>>>>>
    > >>>>>>  PR:		kern/176179
    > >>>>>>  Reported by:	Russell Cattelan (sigdeferstop()
    > >>>>>> recursion) Reviewed by:	kib
    > >>>>>>  MFC after:	1 month
    > >>>>> This change is causing init to crash for me on armv6. I'm
    > >>>>> netbooting a PandaBoard and it appears init is receiving a
    > >>>>> SIGABRT before it gets into main().
    > >>>>>
    > >>>>> Do you have any idea where I could look to track down why it is
    > >>>>> doing this?
    > >>>> It is weird. SIGABRT sent by the kernel usually means that
    > >>>> execve(2) already destroyed the previous address space of the
    > >>>> process, but the new image cannot be activated, most likely due
    > >>>> to image format error discovered too late, or resource shortage.
    > >>>>
    > >>>> Could it be that some NFS RPC fails after the patch, but I cannot
    > >>>> imagine why. You would need to track this. Also, verify that the
    > >>>> init binary is correct.
    > >>>>
    > >>>> I tried amd64 netboot, and it worked fine.
    > >>> It looks like this change is not the issue, it just changed the
    > >>> symptom enough for me to not realise I was seeing an issue where
    > >>> it would crash the kernel before. I reinstated this change but
    > >>> only allowed the kernel to access half the memory and it booted
    > >>> correctly.
    > >>>
    > >>> The real issue appears to be related to something in the vm layer
    > >>> not working on ARM boards with too much memory (somewhere between
    > >>> 512MiB and 1GiB).
    > >>
    > >> The recently introduced auto-sizing and cap may be too optimistic.
    > >> In fact, they are greater than what we allow on 32-bit x86 and
    > >> 32-bit MIPS.  Try the following.
    > >>
    > >> Index: arm/include/vmparam.h
    > >> ===================================================================
    > >> --- arm/include/vmparam.h	(revision 247249)
    > >> +++ arm/include/vmparam.h	(working copy)
    > >> @@ -142,15 +142,15 @@
    > >>  #define VM_KMEM_SIZE		(12*1024*1024)
    > >>  #endif
    > >>  #ifndef VM_KMEM_SIZE_SCALE
    > >> -#define VM_KMEM_SIZE_SCALE	(2)
    > >> +#define VM_KMEM_SIZE_SCALE	(3)
    > >>  #endif
    > >>  
    > >>  /*
    > >> - * Ceiling on the size of the kmem submap: 60% of the kernel map.
    > >> + * Ceiling on the size of the kmem submap: 40% of the kernel map.
    > >>   */
    > >>  #ifndef VM_KMEM_SIZE_MAX
    > >>  #define	VM_KMEM_SIZE_MAX	((vm_max_kernel_address - \
    > >> -    VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5)
    > >> +    VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
    > >>  #endif
    > >>  
    > >>  #define MAXTSIZ 	(16*1024*1024)
    > >>
    > > This patch fixes the boot for me. Is it likely we will see similar
    > > issues with boards with more memory with this? I know of ARM boards
    > > with 2GiB of ram, and I would expect to see some with more soon.
    > >
    > 
    > The kmem submap should be fine, but other things might become a
    > problem.
    > 
    > What do "sysctl -x vm.min_kernel_address" and "sysctl -x
    > vm.max_kernel_address" report on your machine?
    
    I get the following.
    
    # sysctl -x vm.min_kernel_address
    vm.min_kernel_address: 0xc0000000
    # sysctl -x vm.max_kernel_address
    vm.max_kernel_address: 0xdf000000
    
    Andrew
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 08:17:34 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id D0C99518;
     Tue, 26 Feb 2013 08:17:34 +0000 (UTC) (envelope-from alc@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 B90AC3CE;
     Tue, 26 Feb 2013 08:17:34 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q8HYln028049;
     Tue, 26 Feb 2013 08:17:34 GMT (envelope-from alc@svn.freebsd.org)
    Received: (from alc@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q8HY19028048;
     Tue, 26 Feb 2013 08:17:34 GMT (envelope-from alc@svn.freebsd.org)
    Message-Id: <201302260817.r1Q8HY19028048@svn.freebsd.org>
    From: Alan Cox 
    Date: Tue, 26 Feb 2013 08:17:34 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247314 - head/sys/arm/include
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 08:17:34 -0000
    
    Author: alc
    Date: Tue Feb 26 08:17:34 2013
    New Revision: 247314
    URL: http://svnweb.freebsd.org/changeset/base/247314
    
    Log:
      Be more conservative in auto-sizing and capping the kmem submap.  In
      fact, use the same values here that we use on 32-bit x86 and MIPS.  Some
      machines were reported to have problems with the more aggressive values.
      
      Reported and tested by:	andrew
    
    Modified:
      head/sys/arm/include/vmparam.h
    
    Modified: head/sys/arm/include/vmparam.h
    ==============================================================================
    --- head/sys/arm/include/vmparam.h	Tue Feb 26 07:41:34 2013	(r247313)
    +++ head/sys/arm/include/vmparam.h	Tue Feb 26 08:17:34 2013	(r247314)
    @@ -142,15 +142,15 @@
     #define VM_KMEM_SIZE		(12*1024*1024)
     #endif
     #ifndef VM_KMEM_SIZE_SCALE
    -#define VM_KMEM_SIZE_SCALE	(2)
    +#define VM_KMEM_SIZE_SCALE	(3)
     #endif
     
     /*
    - * Ceiling on the size of the kmem submap: 60% of the kernel map.
    + * Ceiling on the size of the kmem submap: 40% of the kernel map.
      */
     #ifndef VM_KMEM_SIZE_MAX
     #define	VM_KMEM_SIZE_MAX	((vm_max_kernel_address - \
    -    VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5)
    +    VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
     #endif
     
     #define MAXTSIZ 	(16*1024*1024)
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 08:51:39 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id B599E991;
     Tue, 26 Feb 2013 08:51:39 +0000 (UTC) (envelope-from mm@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 A64D16F3;
     Tue, 26 Feb 2013 08:51:39 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q8pd5g038774;
     Tue, 26 Feb 2013 08:51:39 GMT (envelope-from mm@svn.freebsd.org)
    Received: (from mm@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q8pdZt038773;
     Tue, 26 Feb 2013 08:51:39 GMT (envelope-from mm@svn.freebsd.org)
    Message-Id: <201302260851.r1Q8pdZt038773@svn.freebsd.org>
    From: Martin Matuska 
    Date: Tue, 26 Feb 2013 08:51:39 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-vendor@freebsd.org
    Subject: svn commit: r247315 - vendor-sys/illumos/dist/uts/common/fs/zfs
    X-SVN-Group: vendor-sys
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 08:51:39 -0000
    
    Author: mm
    Date: Tue Feb 26 08:51:39 2013
    New Revision: 247315
    URL: http://svnweb.freebsd.org/changeset/base/247315
    
    Log:
      Update vendor-sys/illumos/dist to illumos-gate 13968:e4988c7d0403
      
      Illumos ZFS issues:
        3552 condensing one space map burns 3 seconds of CPU in spa_sync() thread
             (fix race condition)
    
    Modified:
      vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c	Tue Feb 26 08:17:34 2013	(r247314)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c	Tue Feb 26 08:51:39 2013	(r247315)
    @@ -1383,6 +1383,13 @@ metaslab_group_alloc(metaslab_group_t *m
     				mutex_exit(&mg->mg_lock);
     				return (-1ULL);
     			}
    +
    +			/*
    +			 * If the selected metaslab is condensing, skip it.
    +			 */
    +			if (msp->ms_map->sm_condensing)
    +				continue;
    +
     			was_active = msp->ms_weight & METASLAB_ACTIVE_MASK;
     			if (activation_weight == METASLAB_WEIGHT_PRIMARY)
     				break;
    @@ -1423,16 +1430,6 @@ metaslab_group_alloc(metaslab_group_t *m
     		mutex_enter(&msp->ms_lock);
     
     		/*
    -		 * If this metaslab is currently condensing then pick again as
    -		 * we can't manipulate this metaslab until it's committed
    -		 * to disk.
    -		 */
    -		if (msp->ms_map->sm_condensing) {
    -			mutex_exit(&msp->ms_lock);
    -			continue;
    -		}
    -
    -		/*
     		 * Ensure that the metaslab we have selected is still
     		 * capable of handling our request. It's possible that
     		 * another thread may have changed the weight while we
    @@ -1458,6 +1455,16 @@ metaslab_group_alloc(metaslab_group_t *m
     			continue;
     		}
     
    +		/*
    +		 * If this metaslab is currently condensing then pick again as
    +		 * we can't manipulate this metaslab until it's committed
    +		 * to disk.
    +		 */
    +		if (msp->ms_map->sm_condensing) {
    +			mutex_exit(&msp->ms_lock);
    +			continue;
    +		}
    +
     		if ((offset = space_map_alloc(msp->ms_map, asize)) != -1ULL)
     			break;
     
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 08:53:34 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id A52AEB14;
     Tue, 26 Feb 2013 08:53:34 +0000 (UTC) (envelope-from mm@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 7AB96707;
     Tue, 26 Feb 2013 08:53:34 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q8rYBE039071;
     Tue, 26 Feb 2013 08:53:34 GMT (envelope-from mm@svn.freebsd.org)
    Received: (from mm@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q8rX9x039066;
     Tue, 26 Feb 2013 08:53:33 GMT (envelope-from mm@svn.freebsd.org)
    Message-Id: <201302260853.r1Q8rX9x039066@svn.freebsd.org>
    From: Martin Matuska 
    Date: Tue, 26 Feb 2013 08:53:33 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-vendor@freebsd.org
    Subject: svn commit: r247316 - vendor-sys/illumos/dist/common/zfs
     vendor-sys/illumos/dist/uts/common/fs/zfs
     vendor-sys/illumos/dist/uts/common/sys/fs vendor/illumos/dist/man/man1m
    X-SVN-Group: vendor-sys
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 08:53:34 -0000
    
    Author: mm
    Date: Tue Feb 26 08:53:33 2013
    New Revision: 247316
    URL: http://svnweb.freebsd.org/changeset/base/247316
    
    Log:
      Update vendor/illumos/dist and vendor-sys/illumos/dist
      to illumos-gate 13969:b2c7608044b7
      
      Illumos ZFS issues:
        3588 provide zfs properties for logical (uncompressed) space used and
             referenced
    
    Modified:
      vendor-sys/illumos/dist/common/zfs/zfs_prop.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c
      vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h
    
    Changes in other areas also in this revision:
    Modified:
      vendor/illumos/dist/man/man1m/zfs.1m
    
    Modified: vendor-sys/illumos/dist/common/zfs/zfs_prop.c
    ==============================================================================
    --- vendor-sys/illumos/dist/common/zfs/zfs_prop.c	Tue Feb 26 08:51:39 2013	(r247315)
    +++ vendor-sys/illumos/dist/common/zfs/zfs_prop.c	Tue Feb 26 08:53:33 2013	(r247316)
    @@ -20,7 +20,7 @@
      */
     /*
      * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    - * Copyright (c) 2011 by Delphix. All rights reserved.
    + * Copyright (c) 2012 by Delphix. All rights reserved.
      * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
      */
     
    @@ -350,6 +350,10 @@ zfs_prop_init(void)
     	    ZFS_TYPE_SNAPSHOT, "", "USERREFS");
     	zprop_register_number(ZFS_PROP_WRITTEN, "written", 0, PROP_READONLY,
     	    ZFS_TYPE_DATASET, "", "WRITTEN");
    +	zprop_register_number(ZFS_PROP_LOGICALUSED, "logicalused", 0,
    +	    PROP_READONLY, ZFS_TYPE_DATASET, "", "LUSED");
    +	zprop_register_number(ZFS_PROP_LOGICALREFERENCED, "logicalreferenced",
    +	    0, PROP_READONLY, ZFS_TYPE_DATASET, "", "LREFER");
     
     	/* default number properties */
     	zprop_register_number(ZFS_PROP_QUOTA, "quota", 0, PROP_DEFAULT,
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c	Tue Feb 26 08:51:39 2013	(r247315)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c	Tue Feb 26 08:53:33 2013	(r247316)
    @@ -2247,6 +2247,8 @@ dsl_dataset_stats(dsl_dataset_t *ds, nvl
     	    ds->ds_phys->ds_compressed_bytes);
     
     	dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_REFRATIO, ratio);
    +	dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_LOGICALREFERENCED,
    +	    ds->ds_phys->ds_uncompressed_bytes);
     
     	if (dsl_dataset_is_snapshot(ds)) {
     		dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_COMPRESSRATIO, ratio);
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c	Tue Feb 26 08:51:39 2013	(r247315)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c	Tue Feb 26 08:53:33 2013	(r247316)
    @@ -530,6 +530,8 @@ dsl_dir_stats(dsl_dir_t *dd, nvlist_t *n
     	    dd->dd_phys->dd_compressed_bytes == 0 ? 100 :
     	    (dd->dd_phys->dd_uncompressed_bytes * 100 /
     	    dd->dd_phys->dd_compressed_bytes));
    +	dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_LOGICALUSED,
    +	    dd->dd_phys->dd_uncompressed_bytes);
     	if (dd->dd_phys->dd_flags & DD_FLAG_USED_BREAKDOWN) {
     		dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_USEDSNAP,
     		    dd->dd_phys->dd_used_breakdown[DD_USED_SNAP]);
    
    Modified: vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h	Tue Feb 26 08:51:39 2013	(r247315)
    +++ vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h	Tue Feb 26 08:53:33 2013	(r247316)
    @@ -138,6 +138,8 @@ typedef enum {
     	ZFS_PROP_REFRATIO,
     	ZFS_PROP_WRITTEN,
     	ZFS_PROP_CLONES,
    +	ZFS_PROP_LOGICALUSED,
    +	ZFS_PROP_LOGICALREFERENCED,
     	ZFS_NUM_PROPS
     } zfs_prop_t;
     
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 08:53:35 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 0EACAB15;
     Tue, 26 Feb 2013 08:53:35 +0000 (UTC) (envelope-from mm@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 CFFFF708;
     Tue, 26 Feb 2013 08:53:34 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1Q8rY1I039077;
     Tue, 26 Feb 2013 08:53:34 GMT (envelope-from mm@svn.freebsd.org)
    Received: (from mm@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1Q8rYvg039076;
     Tue, 26 Feb 2013 08:53:34 GMT (envelope-from mm@svn.freebsd.org)
    Message-Id: <201302260853.r1Q8rYvg039076@svn.freebsd.org>
    From: Martin Matuska 
    Date: Tue, 26 Feb 2013 08:53:34 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-vendor@freebsd.org
    Subject: svn commit: r247316 - vendor-sys/illumos/dist/common/zfs
     vendor-sys/illumos/dist/uts/common/fs/zfs
     vendor-sys/illumos/dist/uts/common/sys/fs vendor/illumos/dist/man/man1m
    X-SVN-Group: vendor
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 08:53:35 -0000
    
    Author: mm
    Date: Tue Feb 26 08:53:33 2013
    New Revision: 247316
    URL: http://svnweb.freebsd.org/changeset/base/247316
    
    Log:
      Update vendor/illumos/dist and vendor-sys/illumos/dist
      to illumos-gate 13969:b2c7608044b7
      
      Illumos ZFS issues:
        3588 provide zfs properties for logical (uncompressed) space used and
             referenced
    
    Modified:
      vendor/illumos/dist/man/man1m/zfs.1m
    
    Changes in other areas also in this revision:
    Modified:
      vendor-sys/illumos/dist/common/zfs/zfs_prop.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c
      vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h
    
    Modified: vendor/illumos/dist/man/man1m/zfs.1m
    ==============================================================================
    --- vendor/illumos/dist/man/man1m/zfs.1m	Tue Feb 26 08:51:39 2013	(r247315)
    +++ vendor/illumos/dist/man/man1m/zfs.1m	Tue Feb 26 08:53:33 2013	(r247316)
    @@ -535,6 +535,40 @@ by using the \fBzfs destroy\fR \fB-d\fR 
     .sp
     .ne 2
     .na
    +\fB\fBlogicalreferenced\fR\fR
    +.ad
    +.sp .6
    +.RS 4n
    +The amount of space that is "logically" accessible by this dataset.  See
    +the \fBreferenced\fR property.  The logical space ignores the effect of
    +the \fBcompression\fR and \fBcopies\fR properties, giving a quantity
    +closer to the amount of data that applications see.  However, it does
    +include space consumed by metadata.
    +.sp
    +This property can also be referred to by its shortened column name,
    +\fBlrefer\fR.
    +.RE
    +
    +.sp
    +.ne 2
    +.na
    +\fB\fBlogicalused\fR\fR
    +.ad
    +.sp .6
    +.RS 4n
    +The amount of space that is "logically" consumed by this dataset and all
    +its descendents.  See the \fBused\fR property.  The logical space
    +ignores the effect of the \fBcompression\fR and \fBcopies\fR properties,
    +giving a quantity closer to the amount of data that applications see.
    +However, it does include space consumed by metadata.
    +.sp
    +This property can also be referred to by its shortened column name,
    +\fBlused\fR.
    +.RE
    +
    +.sp
    +.ne 2
    +.na
     \fB\fBmounted\fR\fR
     .ad
     .sp .6
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 10:24:49 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id D14E4FC;
     Tue, 26 Feb 2013 10:24:49 +0000 (UTC)
     (envelope-from adrian@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 AAE50A36;
     Tue, 26 Feb 2013 10:24:49 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QAOncw067218;
     Tue, 26 Feb 2013 10:24:49 GMT (envelope-from adrian@svn.freebsd.org)
    Received: (from adrian@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QAOnUO067217;
     Tue, 26 Feb 2013 10:24:49 GMT (envelope-from adrian@svn.freebsd.org)
    Message-Id: <201302261024.r1QAOnUO067217@svn.freebsd.org>
    From: Adrian Chadd 
    Date: Tue, 26 Feb 2013 10:24:49 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247317 - head/sys/dev/ath/ath_rate/sample
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 10:24:49 -0000
    
    Author: adrian
    Date: Tue Feb 26 10:24:49 2013
    New Revision: 247317
    URL: http://svnweb.freebsd.org/changeset/base/247317
    
    Log:
      Update the EWMA statistics for each intermediary rate as well as the final
      rate.
      
      This fixes two things:
      
      * The intermediary rates now also have their EWMA values changed;
      * The existing code was using the wrong value for longtries - so the
        EWMA stats were only adjusted for the first rate and not subsequent
        rates in a MRR setup.
      
      TODO:
      
      * Merge the EWMA updates into update_stats() now..
    
    Modified:
      head/sys/dev/ath/ath_rate/sample/sample.c
    
    Modified: head/sys/dev/ath/ath_rate/sample/sample.c
    ==============================================================================
    --- head/sys/dev/ath/ath_rate/sample/sample.c	Tue Feb 26 08:53:33 2013	(r247316)
    +++ head/sys/dev/ath/ath_rate/sample/sample.c	Tue Feb 26 10:24:49 2013	(r247317)
    @@ -1008,6 +1008,15 @@ ath_rate_tx_complete(struct ath_softc *s
     				     short_tries, long_tries,
     				     long_tries > rc[0].tries,
     				     nframes, nbad);
    +			update_ewma_stats(sc, an, frame_size,
    +				     rc[0].rix, rc[0].tries,
    +				     rc[1].rix, rc[1].tries,
    +				     rc[2].rix, rc[2].tries,
    +				     rc[3].rix, rc[3].tries,
    +				     short_tries, long_tries,
    +				     long_tries > rc[0].tries,
    +				     nframes, nbad);
    +
     			long_tries -= rc[0].tries;
     		}
     		
    @@ -1020,6 +1029,14 @@ ath_rate_tx_complete(struct ath_softc *s
     				     short_tries, long_tries,
     				     status,
     				     nframes, nbad);
    +			update_ewma_stats(sc, an, frame_size,
    +				     rc[1].rix, rc[1].tries,
    +				     rc[2].rix, rc[2].tries,
    +				     rc[3].rix, rc[3].tries,
    +				     0, 0,
    +				     short_tries, long_tries,
    +				     status,
    +				     nframes, nbad);
     			long_tries -= rc[1].tries;
     		}
     
    @@ -1032,6 +1049,14 @@ ath_rate_tx_complete(struct ath_softc *s
     				     short_tries, long_tries,
     				     status,
     				     nframes, nbad);
    +			update_ewma_stats(sc, an, frame_size,
    +				     rc[2].rix, rc[2].tries,
    +				     rc[3].rix, rc[3].tries,
    +				     0, 0,
    +				     0, 0,
    +				     short_tries, long_tries,
    +				     status,
    +				     nframes, nbad);
     			long_tries -= rc[2].tries;
     		}
     
    @@ -1044,17 +1069,15 @@ ath_rate_tx_complete(struct ath_softc *s
     				     short_tries, long_tries,
     				     status,
     				     nframes, nbad);
    +			update_ewma_stats(sc, an, frame_size,
    +				     rc[3].rix, rc[3].tries,
    +				     0, 0,
    +				     0, 0,
    +				     0, 0,
    +				     short_tries, long_tries,
    +				     status,
    +				     nframes, nbad);
     		}
    -
    -		update_ewma_stats(sc, an, frame_size,
    -			     rc[0].rix, rc[0].tries,
    -			     rc[1].rix, rc[1].tries,
    -			     rc[2].rix, rc[2].tries,
    -			     rc[3].rix, rc[3].tries,
    -			     short_tries, long_tries,
    -			     long_tries > rc[0].tries,
    -			     nframes, nbad);
    -
     	}
     }
     
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 13:59:40 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 56EC9FC8;
     Tue, 26 Feb 2013 13:59:40 +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 4991A666;
     Tue, 26 Feb 2013 13:59:40 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QDxeX0031012;
     Tue, 26 Feb 2013 13:59:40 GMT (envelope-from mav@svn.freebsd.org)
    Received: (from mav@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QDxe64031009;
     Tue, 26 Feb 2013 13:59:40 GMT (envelope-from mav@svn.freebsd.org)
    Message-Id: <201302261359.r1QDxe64031009@svn.freebsd.org>
    From: Alexander Motin 
    Date: Tue, 26 Feb 2013 13:59:40 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247318 - head/sys/dev/hwpmc
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 13:59:40 -0000
    
    Author: mav
    Date: Tue Feb 26 13:59:39 2013
    New Revision: 247318
    URL: http://svnweb.freebsd.org/changeset/base/247318
    
    Log:
      Change the way how software PMC updates counters.
      This at least fixes -n option of pmcstat.
      
      Reviewed by:	fabient
    
    Modified:
      head/sys/dev/hwpmc/hwpmc_soft.c
    
    Modified: head/sys/dev/hwpmc/hwpmc_soft.c
    ==============================================================================
    --- head/sys/dev/hwpmc/hwpmc_soft.c	Tue Feb 26 10:24:49 2013	(r247317)
    +++ head/sys/dev/hwpmc/hwpmc_soft.c	Tue Feb 26 13:59:39 2013	(r247318)
    @@ -408,8 +408,11 @@ pmc_soft_intr(struct pmckern_soft *ks)
     		}
     
     		processed = 1;
    -		pc->soft_values[ri]++;
     		if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) {
    +			if ((pc->soft_values[ri]--) <= 0)
    +				pc->soft_values[ri] += pm->pm_sc.pm_reloadcount;
    +			else
    +				continue;
     			user_mode = TRAPF_USERMODE(ks->pm_tf);
     			error = pmc_process_interrupt(ks->pm_cpu, PMC_SR, pm,
     			    ks->pm_tf, user_mode);
    @@ -424,7 +427,8 @@ pmc_soft_intr(struct pmckern_soft *ks)
     				 */
     				curthread->td_flags |= TDF_ASTPENDING;
     			}
    -		}
    +		} else
    +			pc->soft_values[ri]++;
     	}
     
     	atomic_add_int(processed ? &pmc_stats.pm_intr_processed :
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 15:51:47 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id EE10413A;
     Tue, 26 Feb 2013 15:51:47 +0000 (UTC)
     (envelope-from gallatin@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 D1A4BB68;
     Tue, 26 Feb 2013 15:51:47 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QFplT6066402;
     Tue, 26 Feb 2013 15:51:47 GMT
     (envelope-from gallatin@svn.freebsd.org)
    Received: (from gallatin@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QFplDV066399;
     Tue, 26 Feb 2013 15:51:47 GMT
     (envelope-from gallatin@svn.freebsd.org)
    Message-Id: <201302261551.r1QFplDV066399@svn.freebsd.org>
    From: Andrew Gallatin 
    Date: Tue, 26 Feb 2013 15:51:47 +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: r247320 - in stable/9/sys: dev/mxge modules/mxge/mxge
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 15:51:48 -0000
    
    Author: gallatin
    Date: Tue Feb 26 15:51:46 2013
    New Revision: 247320
    URL: http://svnweb.freebsd.org/changeset/base/247320
    
    Log:
      MFC r247011:
      
      Add support to mxge for IPv6 TX csum offload & IPv6 TSO.
      
      Sponsored by: Myricom, Inc.
    
    Modified:
      stable/9/sys/dev/mxge/if_mxge.c
      stable/9/sys/dev/mxge/if_mxge_var.h
      stable/9/sys/modules/mxge/mxge/Makefile
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
      stable/9/sys/modules/   (props changed)
    
    Modified: stable/9/sys/dev/mxge/if_mxge.c
    ==============================================================================
    --- stable/9/sys/dev/mxge/if_mxge.c	Tue Feb 26 15:25:43 2013	(r247319)
    +++ stable/9/sys/dev/mxge/if_mxge.c	Tue Feb 26 15:51:46 2013	(r247320)
    @@ -62,7 +62,9 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    +#include 
     #include 
    +#include 
     
     #include 
     #include 
    @@ -91,6 +93,7 @@ __FBSDID("$FreeBSD$");
     #endif
     
     #include "opt_inet.h"
    +#include "opt_inet6.h"
     
     /* tunable params */
     static int mxge_nvidia_ecrc_enable = 1;
    @@ -1809,21 +1812,99 @@ mxge_submit_req(mxge_tx_ring_t *tx, mcp_
             wmb();
     }
     
    +static int
    +mxge_parse_tx(struct mxge_slice_state *ss, struct mbuf *m,
    +    struct mxge_pkt_info *pi)
    +{
    +	struct ether_vlan_header *eh;
    +	uint16_t etype;
    +	int tso = m->m_pkthdr.csum_flags & (CSUM_TSO);
    +#if IFCAP_TSO6 && defined(INET6)
    +	int nxt;
    +#endif
    +
    +	eh = mtod(m, struct ether_vlan_header *);
    +	if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) {
    +		etype = ntohs(eh->evl_proto);
    +		pi->ip_off = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN;
    +	} else {
    +		etype = ntohs(eh->evl_encap_proto);
    +		pi->ip_off = ETHER_HDR_LEN;
    +	}
    +
    +	switch (etype) {
    +	case ETHERTYPE_IP:
    +		/*
    +		 * ensure ip header is in first mbuf, copy it to a
    +		 * scratch buffer if not
    +		 */
    +		pi->ip = (struct ip *)(m->m_data + pi->ip_off);
    +		pi->ip6 = NULL;
    +		if (__predict_false(m->m_len < pi->ip_off + sizeof(*pi->ip))) {
    +			m_copydata(m, 0, pi->ip_off + sizeof(*pi->ip),
    +			    ss->scratch);
    +			pi->ip = (struct ip *)(ss->scratch + pi->ip_off);
    +		}
    +		pi->ip_hlen = pi->ip->ip_hl << 2;
    +		if (!tso)
    +			return 0;
    +
    +		if (__predict_false(m->m_len < pi->ip_off + pi->ip_hlen +
    +		    sizeof(struct tcphdr))) {
    +			m_copydata(m, 0, pi->ip_off + pi->ip_hlen +
    +			    sizeof(struct tcphdr), ss->scratch);
    +			pi->ip = (struct ip *)(ss->scratch + pi->ip_off);
    +		}
    +		pi->tcp = (struct tcphdr *)((char *)pi->ip + pi->ip_hlen);
    +		break;
    +#if IFCAP_TSO6 && defined(INET6)
    +	case ETHERTYPE_IPV6:
    +		pi->ip6 = (struct ip6_hdr *)(m->m_data + pi->ip_off);
    +		if (__predict_false(m->m_len < pi->ip_off + sizeof(*pi->ip6))) {
    +			m_copydata(m, 0, pi->ip_off + sizeof(*pi->ip6),
    +			    ss->scratch);
    +			pi->ip6 = (struct ip6_hdr *)(ss->scratch + pi->ip_off);
    +		}
    +		nxt = 0;
    +		pi->ip_hlen = ip6_lasthdr(m, pi->ip_off, IPPROTO_IPV6, &nxt);
    +		pi->ip_hlen -= pi->ip_off;
    +		if (nxt != IPPROTO_TCP && nxt != IPPROTO_UDP)
    +			return EINVAL;
    +
    +		if (!tso)
    +			return 0;
    +
    +		if (pi->ip_off + pi->ip_hlen > ss->sc->max_tso6_hlen)
    +			return EINVAL;
    +
    +		if (__predict_false(m->m_len < pi->ip_off + pi->ip_hlen +
    +		    sizeof(struct tcphdr))) {
    +			m_copydata(m, 0, pi->ip_off + pi->ip_hlen +
    +			    sizeof(struct tcphdr), ss->scratch);
    +			pi->ip6 = (struct ip6_hdr *)(ss->scratch + pi->ip_off);
    +		}
    +		pi->tcp = (struct tcphdr *)((char *)pi->ip6 + pi->ip_hlen);
    +		break;
    +#endif
    +	default:
    +		return EINVAL;
    +	}
    +	return 0;
    +}
    +
     #if IFCAP_TSO4
     
     static void
     mxge_encap_tso(struct mxge_slice_state *ss, struct mbuf *m,
    -	       int busdma_seg_cnt, int ip_off)
    +	       int busdma_seg_cnt, struct mxge_pkt_info *pi)
     {
     	mxge_tx_ring_t *tx;
     	mcp_kreq_ether_send_t *req;
     	bus_dma_segment_t *seg;
    -	struct ip *ip;
    -	struct tcphdr *tcp;
     	uint32_t low, high_swapped;
     	int len, seglen, cum_len, cum_len_next;
     	int next_is_first, chop, cnt, rdma_count, small;
    -	uint16_t pseudo_hdr_offset, cksum_offset, mss;
    +	uint16_t pseudo_hdr_offset, cksum_offset, mss, sum;
     	uint8_t flags, flags_next;
     	static int once;
     
    @@ -1834,38 +1915,33 @@ mxge_encap_tso(struct mxge_slice_state *
     	 * header portion of the TSO packet.
     	 */
     
    -	/* ensure we have the ethernet, IP and TCP
    -	   header together in the first mbuf, copy
    -	   it to a scratch buffer if not */
    -	if (__predict_false(m->m_len < ip_off + sizeof (*ip))) {
    -		m_copydata(m, 0, ip_off + sizeof (*ip),
    -			   ss->scratch);
    -		ip = (struct ip *)(ss->scratch + ip_off);
    -	} else {
    -		ip = (struct ip *)(mtod(m, char *) + ip_off);
    -	}
    -	if (__predict_false(m->m_len < ip_off + (ip->ip_hl << 2)
    -			    + sizeof (*tcp))) {
    -		m_copydata(m, 0, ip_off + (ip->ip_hl << 2)
    -			   + sizeof (*tcp),  ss->scratch);
    -		ip = (struct ip *)(mtod(m, char *) + ip_off);
    -	} 
    -
    -	tcp = (struct tcphdr *)((char *)ip + (ip->ip_hl << 2));
    -	cum_len = -(ip_off + ((ip->ip_hl + tcp->th_off) << 2));
    -	cksum_offset = ip_off + (ip->ip_hl << 2);
    +	cksum_offset = pi->ip_off + pi->ip_hlen;
    +	cum_len = -(cksum_offset + (pi->tcp->th_off << 2));
     
     	/* TSO implies checksum offload on this hardware */
    -	if (__predict_false((m->m_pkthdr.csum_flags & (CSUM_TCP)) == 0)) {
    +	if (__predict_false((m->m_pkthdr.csum_flags & (CSUM_TCP|CSUM_TCP_IPV6)) == 0)) {
     		/*
     		 * If packet has full TCP csum, replace it with pseudo hdr
     		 * sum that the NIC expects, otherwise the NIC will emit
     		 * packets with bad TCP checksums.
     		 */
    -		m->m_pkthdr.csum_flags = CSUM_TCP;
     		m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum);
    -		tcp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr,
    -			htons(IPPROTO_TCP + (m->m_pkthdr.len - cksum_offset)));		
    +		if (pi->ip6) {
    +#if (CSUM_TCP_IPV6 != 0) && defined(INET6)
    +			m->m_pkthdr.csum_flags |= CSUM_TCP_IPV6;
    +			sum = in6_cksum_pseudo(pi->ip6,
    +			    m->m_pkthdr.len - cksum_offset,
    +			    IPPROTO_TCP, 0);
    +#endif
    +		} else {
    +			m->m_pkthdr.csum_flags |= CSUM_TCP;
    +			sum = in_pseudo(pi->ip->ip_src.s_addr,
    +			    pi->ip->ip_dst.s_addr,
    +			    htons(IPPROTO_TCP + (m->m_pkthdr.len -
    +				    cksum_offset)));
    +		}
    +		m_copyback(m, offsetof(struct tcphdr, th_sum) +
    +		    cksum_offset, sizeof(sum), (caddr_t)&sum);
     	}
     	flags = MXGEFW_FLAGS_TSO_HDR | MXGEFW_FLAGS_FIRST;
     
    @@ -1875,6 +1951,14 @@ mxge_encap_tso(struct mxge_slice_state *
     	 * the checksum by parsing the header. */
     	pseudo_hdr_offset = htobe16(mss);
     
    +	if (pi->ip6) {
    +		/*
    +		 * for IPv6 TSO, the "checksum offset" is re-purposed
    +		 * to store the TCP header len
    +		 */
    +		cksum_offset = (pi->tcp->th_off << 2);
    +	}
    +
     	tx = &ss->tx;
     	req = tx->req_list;
     	seg = tx->seg_list;
    @@ -1946,10 +2030,12 @@ mxge_encap_tso(struct mxge_slice_state *
     			req++;
     			cnt++;
     			rdma_count++;
    -			if (__predict_false(cksum_offset > seglen))
    -				cksum_offset -= seglen;
    -			else
    -				cksum_offset = 0;
    +			if (cksum_offset != 0 && !pi->ip6) {
    +				if (__predict_false(cksum_offset > seglen))
    +					cksum_offset -= seglen;
    +				else
    +					cksum_offset = 0;
    +			}
     			if (__predict_false(cnt > tx->max_desc))
     				goto drop;
     		}
    @@ -2029,14 +2115,14 @@ mxge_vlan_tag_insert(struct mbuf *m)
     static void
     mxge_encap(struct mxge_slice_state *ss, struct mbuf *m)
     {
    +	struct mxge_pkt_info pi = {0,0,0,0};
     	mxge_softc_t *sc;
     	mcp_kreq_ether_send_t *req;
     	bus_dma_segment_t *seg;
     	struct mbuf *m_tmp;
     	struct ifnet *ifp;
     	mxge_tx_ring_t *tx;
    -	struct ip *ip;
    -	int cnt, cum_len, err, i, idx, odd_flag, ip_off;
    +	int cnt, cum_len, err, i, idx, odd_flag;
     	uint16_t pseudo_hdr_offset;
             uint8_t flags, cksum_offset;
     
    @@ -2045,15 +2131,19 @@ mxge_encap(struct mxge_slice_state *ss, 
     	ifp = sc->ifp;
     	tx = &ss->tx;
     
    -	ip_off = sizeof (struct ether_header);
     #ifdef MXGE_NEW_VLAN_API
     	if (m->m_flags & M_VLANTAG) {
     		m = mxge_vlan_tag_insert(m);
     		if (__predict_false(m == NULL))
    -			goto drop;
    -		ip_off += ETHER_VLAN_ENCAP_LEN;
    +			goto drop_without_m;
     	}
     #endif
    +	if (m->m_pkthdr.csum_flags &
    +	    (CSUM_TSO | CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6)) {
    +		if (mxge_parse_tx(ss, m, &pi))
    +			goto drop;
    +	}
    +
     	/* (try to) map the frame for DMA */
     	idx = tx->req & tx->mask;
     	err = bus_dmamap_load_mbuf_sg(tx->dmat, tx->info[idx].map,
    @@ -2085,7 +2175,7 @@ mxge_encap(struct mxge_slice_state *ss, 
     #if IFCAP_TSO4
     	/* TSO is different enough, we handle it in another routine */
     	if (m->m_pkthdr.csum_flags & (CSUM_TSO)) {
    -		mxge_encap_tso(ss, m, cnt, ip_off);
    +		mxge_encap_tso(ss, m, cnt, &pi);
     		return;
     	}
     #endif
    @@ -2096,17 +2186,11 @@ mxge_encap(struct mxge_slice_state *ss, 
     	flags = MXGEFW_FLAGS_NO_TSO;
     
     	/* checksum offloading? */
    -	if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA)) {
    +	if (m->m_pkthdr.csum_flags &
    +	    (CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6)) {
     		/* ensure ip header is in first mbuf, copy
     		   it to a scratch buffer if not */
    -		if (__predict_false(m->m_len < ip_off + sizeof (*ip))) {
    -			m_copydata(m, 0, ip_off + sizeof (*ip),
    -				   ss->scratch);
    -			ip = (struct ip *)(ss->scratch + ip_off);
    -		} else {
    -			ip = (struct ip *)(mtod(m, char *) + ip_off);
    -		}
    -		cksum_offset = ip_off + (ip->ip_hl << 2);
    +		cksum_offset = pi.ip_off + pi.ip_hlen;
     		pseudo_hdr_offset = cksum_offset +  m->m_pkthdr.csum_data;
     		pseudo_hdr_offset = htobe16(pseudo_hdr_offset);
     		req->cksum_offset = cksum_offset;
    @@ -2189,6 +2273,7 @@ mxge_encap(struct mxge_slice_state *ss, 
     
     drop:
     	m_freem(m);
    +drop_without_m:
     	ss->oerrors++;
     	return;
     }
    @@ -4125,8 +4210,7 @@ mxge_ioctl(struct ifnet *ifp, u_long com
     		if (mask & IFCAP_TXCSUM) {
     			if (IFCAP_TXCSUM & ifp->if_capenable) {
     				ifp->if_capenable &= ~(IFCAP_TXCSUM|IFCAP_TSO4);
    -				ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP
    -						      | CSUM_TSO);
    +				ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP);
     			} else {
     				ifp->if_capenable |= IFCAP_TXCSUM;
     				ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP);
    @@ -4143,7 +4227,6 @@ mxge_ioctl(struct ifnet *ifp, u_long com
     		if (mask & IFCAP_TSO4) {
     			if (IFCAP_TSO4 & ifp->if_capenable) {
     				ifp->if_capenable &= ~IFCAP_TSO4;
    -				ifp->if_hwassist &= ~CSUM_TSO;
     			} else if (IFCAP_TXCSUM & ifp->if_capenable) {
     				ifp->if_capenable |= IFCAP_TSO4;
     				ifp->if_hwassist |= CSUM_TSO;
    @@ -4153,6 +4236,43 @@ mxge_ioctl(struct ifnet *ifp, u_long com
     				err = EINVAL;
     			}
     		}
    +#if IFCAP_TSO6
    +		if (mask & IFCAP_TXCSUM_IPV6) {
    +			if (IFCAP_TXCSUM_IPV6 & ifp->if_capenable) {
    +				ifp->if_capenable &= ~(IFCAP_TXCSUM_IPV6
    +						       | IFCAP_TSO6);
    +				ifp->if_hwassist &= ~(CSUM_TCP_IPV6
    +						      | CSUM_UDP);
    +			} else {
    +				ifp->if_capenable |= IFCAP_TXCSUM_IPV6;
    +				ifp->if_hwassist |= (CSUM_TCP_IPV6
    +						     | CSUM_UDP_IPV6);
    +			}
    +#ifdef NOTYET
    +		} else if (mask & IFCAP_RXCSUM6) {
    +			if (IFCAP_RXCSUM6 & ifp->if_capenable) {
    +				ifp->if_capenable &= ~IFCAP_RXCSUM6;
    +				sc->csum_flag = 0;
    +			} else {
    +				ifp->if_capenable |= IFCAP_RXCSUM6;
    +				sc->csum_flag = 1;
    +			}
    +#endif
    +		}
    +		if (mask & IFCAP_TSO6) {
    +			if (IFCAP_TSO6 & ifp->if_capenable) {
    +				ifp->if_capenable &= ~IFCAP_TSO6;
    +			} else if (IFCAP_TXCSUM_IPV6 & ifp->if_capenable) {
    +				ifp->if_capenable |= IFCAP_TSO6;
    +				ifp->if_hwassist |= CSUM_TSO;
    +			} else {
    +				printf("mxge requires tx checksum offload"
    +				       " be enabled to use TSO\n");
    +				err = EINVAL;
    +			}
    +		}
    +#endif /*IFCAP_TSO6 */
    +
     		if (mask & IFCAP_LRO) {
     			if (IFCAP_LRO & ifp->if_capenable) 
     				err = mxge_change_lro_locked(sc, 0);
    @@ -4645,6 +4765,7 @@ mxge_add_irq(mxge_softc_t *sc)
     static int 
     mxge_attach(device_t dev)
     {
    +	mxge_cmd_t cmd;
     	mxge_softc_t *sc = device_get_softc(dev);
     	struct ifnet *ifp;
     	int err, rid;
    @@ -4775,7 +4896,7 @@ mxge_attach(device_t dev)
     
     	ifp->if_baudrate = IF_Gbps(10UL);
     	ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO4 |
    -		IFCAP_VLAN_MTU | IFCAP_LINKSTATE;
    +		IFCAP_VLAN_MTU | IFCAP_LINKSTATE | IFCAP_TXCSUM_IPV6;
     #ifdef INET
     	ifp->if_capabilities |= IFCAP_LRO;
     #endif
    @@ -4788,7 +4909,6 @@ mxge_attach(device_t dev)
     	    sc->fw_ver_tiny >= 32)
     		ifp->if_capabilities |= IFCAP_VLAN_HWTSO;
     #endif
    -
     	sc->max_mtu = mxge_max_mtu(sc);
     	if (sc->max_mtu >= 9000)
     		ifp->if_capabilities |= IFCAP_JUMBO_MTU;
    @@ -4797,6 +4917,14 @@ mxge_attach(device_t dev)
     			      "latest firmware for 9000 byte jumbo support\n",
     			      sc->max_mtu - ETHER_HDR_LEN);
     	ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO;
    +	ifp->if_hwassist |= CSUM_TCP_IPV6 | CSUM_UDP_IPV6;
    +	/* check to see if f/w supports TSO for IPv6 */
    +	if (!mxge_send_cmd(sc, MXGEFW_CMD_GET_MAX_TSO6_HDR_SIZE, &cmd)) {
    +		if (CSUM_TCP_IPV6)
    +			ifp->if_capabilities |= IFCAP_TSO6;
    +		sc->max_tso6_hlen = min(cmd.data0,
    +					sizeof (sc->ss[0].scratch));
    +	}
     	ifp->if_capenable = ifp->if_capabilities;
     	if (sc->lro_cnt == 0)
     		ifp->if_capenable &= ~IFCAP_LRO;
    
    Modified: stable/9/sys/dev/mxge/if_mxge_var.h
    ==============================================================================
    --- stable/9/sys/dev/mxge/if_mxge_var.h	Tue Feb 26 15:25:43 2013	(r247319)
    +++ stable/9/sys/dev/mxge/if_mxge_var.h	Tue Feb 26 15:51:46 2013	(r247320)
    @@ -50,6 +50,19 @@ $FreeBSD$
     #define IFNET_BUF_RING 1
     #endif
     
    +#if (__FreeBSD_version < 1000020)
    +#undef IF_Kbps
    +#undef IF_Mbps
    +#undef IF_Gbps
    +#define	IF_Kbps(x)	((uintmax_t)(x) * 1000)	/* kilobits/sec. */
    +#define	IF_Mbps(x)	(IF_Kbps((x) * 1000))	/* megabits/sec. */
    +#define	IF_Gbps(x)	(IF_Mbps((x) * 1000))	/* gigabits/sec. */
    +static __inline void
    +if_initbaudrate(struct ifnet *ifp, uintmax_t baud)
    +{
    +	ifp->if_baudrate = baud;
    +}
    +#endif
     #ifndef VLAN_CAPABILITIES
     #define VLAN_CAPABILITIES(ifp)
     #define mxge_vlans_active(sc) (sc)->ifp->if_nvlans
    @@ -73,10 +86,33 @@ $FreeBSD$
     #define IFCAP_TSO4 0
     #endif
     
    +#ifndef IFCAP_TSO6
    +#define IFCAP_TSO6 0
    +#endif
    +
    +#ifndef IFCAP_TXCSUM_IPV6
    +#define IFCAP_TXCSUM_IPV6 0
    +#endif
    +
    +#ifndef IFCAP_RXCSUM_IPV6
    +#define IFCAP_RXCSUM_IPV6 0
    +#endif
    +
     #ifndef CSUM_TSO
     #define CSUM_TSO 0
     #endif
     
    +#ifndef CSUM_TCP_IPV6
    +#define CSUM_TCP_IPV6 0
    +#endif
    +
    +#ifndef CSUM_UDP_IPV6
    +#define CSUM_UDP_IPV6 0
    +#endif
    +
    +#ifndef CSUM_DELAY_DATA_IPV6
    +#define CSUM_DELAY_DATA_IPV6 0
    +#endif
     
     typedef struct {
     	void *addr;
    @@ -270,6 +306,7 @@ struct mxge_softc {
     	int dying;
     	int connector;
     	int current_media;
    +	int max_tso6_hlen;
     	mxge_dma_t dmabench_dma;
     	struct callout co_hdl;
     	struct taskqueue *tq;
    @@ -312,6 +349,15 @@ struct mxge_media_type
     	char *name;
     };
     
    +struct mxge_pkt_info {
    +	int ip_off;
    +	int ip_hlen;
    +	struct ip *ip;
    +	struct ip6_hdr *ip6;
    +	struct tcphdr *tcp;
    +};
    +
    +
     /* implement our own memory barriers, since bus_space_barrier
        cannot handle write-combining regions */
     
    
    Modified: stable/9/sys/modules/mxge/mxge/Makefile
    ==============================================================================
    --- stable/9/sys/modules/mxge/mxge/Makefile	Tue Feb 26 15:25:43 2013	(r247319)
    +++ stable/9/sys/modules/mxge/mxge/Makefile	Tue Feb 26 15:51:46 2013	(r247320)
    @@ -3,6 +3,6 @@
     .PATH: ${.CURDIR}/../../../dev/mxge
     
     KMOD=	if_mxge
    -SRCS=	if_mxge.c mxge_lro.c device_if.h bus_if.h pci_if.h opt_inet.h
    +SRCS=	if_mxge.c mxge_lro.c device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h
     
     .include 
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 16:49:08 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 9AD74869;
     Tue, 26 Feb 2013 16:49:08 +0000 (UTC) (envelope-from jhb@freebsd.org)
    Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net
     [IPv6:2001:470:1f10:75::2])
     by mx1.freebsd.org (Postfix) with ESMTP id 5F199F3C;
     Tue, 26 Feb 2013 16:49:08 +0000 (UTC)
    Received: from jhbbsd.localnet (unknown [209.249.190.124])
     by bigwig.baldwin.cx (Postfix) with ESMTPSA id 44851B97D;
     Tue, 26 Feb 2013 11:49:07 -0500 (EST)
    From: John Baldwin 
    To: Xin LI 
    Subject: Re: svn commit: r247300 - in head: sys/sys usr.bin/truss
    Date: Tue, 26 Feb 2013 09:41:52 -0500
    User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; )
    References: <201302260213.r1Q2D2N1016801@svn.freebsd.org>
    In-Reply-To: <201302260213.r1Q2D2N1016801@svn.freebsd.org>
    MIME-Version: 1.0
    Content-Type: Text/Plain;
      charset="utf-8"
    Content-Transfer-Encoding: 7bit
    Message-Id: <201302260941.52534.jhb@freebsd.org>
    X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
     (bigwig.baldwin.cx); Tue, 26 Feb 2013 11:49:07 -0500 (EST)
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 16:49:08 -0000
    
    On Monday, February 25, 2013 9:13:02 pm Xin LI wrote:
    > Author: delphij
    > Date: Tue Feb 26 02:13:02 2013
    > New Revision: 247300
    > URL: http://svnweb.freebsd.org/changeset/base/247300
    > 
    > Log:
    >   Expose timespec and timeval macros when __BSD_VISIBLE is defined.  This
    >   allows userland application to use the following macros:
    >   
    >   	timespecclear, timespecisset, timespeccmp, timespecadd,
    >   	timespecsub;
    >   
    >   	timevalclear, timevalisset, timevalcmp.
    
    Why not fix truss to use the stock functions instead of keeping private 
    "unusual" versions?
    
    -- 
    John Baldwin
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 16:55:45 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 841D9BB7;
     Tue, 26 Feb 2013 16:55: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 75EA3FA7;
     Tue, 26 Feb 2013 16:55:45 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QGtjMN085987;
     Tue, 26 Feb 2013 16:55:45 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QGtjc5085985;
     Tue, 26 Feb 2013 16:55:45 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302261655.r1QGtjc5085985@svn.freebsd.org>
    From: John Baldwin 
    Date: Tue, 26 Feb 2013 16:55: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: r247321 - in stable/9: etc/rc.d sys/kern
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 16:55:45 -0000
    
    Author: jhb
    Date: Tue Feb 26 16:55:44 2013
    New Revision: 247321
    URL: http://svnweb.freebsd.org/changeset/base/247321
    
    Log:
      MFC 234927:
      - Don't log messages saying that accounting is being disabled and enabled
        if the accounting log file is atomically replaced with a new file
        (such as during log rotation).
      - Simplify accounting log rotation a bit.  There is no need to re-run
        accton(8) after renaming the new log file to it's real name.
      
      PR:		kern/167321
    
    Modified:
      stable/9/etc/rc.d/accounting
      stable/9/sys/kern/kern_acct.c
    Directory Properties:
      stable/9/etc/   (props changed)
      stable/9/sys/   (props changed)
    
    Modified: stable/9/etc/rc.d/accounting
    ==============================================================================
    --- stable/9/etc/rc.d/accounting	Tue Feb 26 15:51:46 2013	(r247320)
    +++ stable/9/etc/rc.d/accounting	Tue Feb 26 16:55:44 2013	(r247321)
    @@ -65,9 +65,7 @@ accounting_rotate_log()
     	mv ${accounting_file} ${accounting_file}.0
     
     	if checkyesno accounting_enable; then
    -		ln $_file ${accounting_file##*/}
    -		${accounting_command} ${accounting_file}
    -		unlink $_file
    +		mv $_file ${accounting_file}
     	fi
     }
     
    
    Modified: stable/9/sys/kern/kern_acct.c
    ==============================================================================
    --- stable/9/sys/kern/kern_acct.c	Tue Feb 26 15:51:46 2013	(r247320)
    +++ stable/9/sys/kern/kern_acct.c	Tue Feb 26 16:55:44 2013	(r247321)
    @@ -122,7 +122,7 @@ static uint32_t	encode_timeval(struct ti
     static uint32_t	encode_long(long);
     static void	acctwatch(void);
     static void	acct_thread(void *);
    -static int	acct_disable(struct thread *);
    +static int	acct_disable(struct thread *, int);
     
     /*
      * Accounting vnode pointer, saved vnode pointer, and flags for each.
    @@ -196,7 +196,7 @@ int
     sys_acct(struct thread *td, struct acct_args *uap)
     {
     	struct nameidata nd;
    -	int error, flags, vfslocked;
    +	int error, flags, vfslocked, replacing;
     
     	error = priv_check(td, PRIV_ACCT);
     	if (error)
    @@ -246,6 +246,13 @@ sys_acct(struct thread *td, struct acct_
     	sx_xlock(&acct_sx);
     
     	/*
    +	 * Don't log spurious disable/enable messages if we are
    +	 * switching from one accounting file to another due to log
    +	 * rotation.
    +	 */
    +	replacing = (acct_vp != NULL && uap->path != NULL);
    +
    +	/*
     	 * If accounting was previously enabled, kill the old space-watcher,
     	 * close the file, and (if no new file was specified, leave).  Reset
     	 * the suspended state regardless of whether accounting remains
    @@ -254,7 +261,7 @@ sys_acct(struct thread *td, struct acct_
     	acct_suspended = 0;
     	if (acct_vp != NULL) {
     		vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount);
    -		error = acct_disable(td);
    +		error = acct_disable(td, !replacing);
     		VFS_UNLOCK_GIANT(vfslocked);
     	}
     	if (uap->path == NULL) {
    @@ -299,7 +306,8 @@ sys_acct(struct thread *td, struct acct_
     	}
     	acct_configured = 1;
     	sx_xunlock(&acct_sx);
    -	log(LOG_NOTICE, "Accounting enabled\n");
    +	if (!replacing)
    +		log(LOG_NOTICE, "Accounting enabled\n");
     	return (error);
     }
     
    @@ -308,7 +316,7 @@ sys_acct(struct thread *td, struct acct_
      * our reference to the credential, and clearing the vnode's flags.
      */
     static int
    -acct_disable(struct thread *td)
    +acct_disable(struct thread *td, int logging)
     {
     	int error;
     
    @@ -319,7 +327,8 @@ acct_disable(struct thread *td)
     	acct_vp = NULL;
     	acct_cred = NULL;
     	acct_flags = 0;
    -	log(LOG_NOTICE, "Accounting disabled\n");
    +	if (logging)
    +		log(LOG_NOTICE, "Accounting disabled\n");
     	return (error);
     }
     
    @@ -574,7 +583,7 @@ acctwatch(void)
     	 */
     	vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount);
     	if (acct_vp->v_type == VBAD) {
    -		(void) acct_disable(NULL);
    +		(void) acct_disable(NULL, 1);
     		VFS_UNLOCK_GIANT(vfslocked);
     		acct_state |= ACCT_EXITREQ;
     		return;
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 16:56:00 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 5A0D8CD9;
     Tue, 26 Feb 2013 16:56:00 +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 4C17EFAA;
     Tue, 26 Feb 2013 16:56:00 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QGu0n3086068;
     Tue, 26 Feb 2013 16:56:00 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QGtxdv086058;
     Tue, 26 Feb 2013 16:55:59 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302261655.r1QGtxdv086058@svn.freebsd.org>
    From: John Baldwin 
    Date: Tue, 26 Feb 2013 16:55:59 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247322 - in stable/8: etc/rc.d sys/kern
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 16:56:00 -0000
    
    Author: jhb
    Date: Tue Feb 26 16:55:59 2013
    New Revision: 247322
    URL: http://svnweb.freebsd.org/changeset/base/247322
    
    Log:
      MFC 234927:
      - Don't log messages saying that accounting is being disabled and enabled
        if the accounting log file is atomically replaced with a new file
        (such as during log rotation).
      - Simplify accounting log rotation a bit.  There is no need to re-run
        accton(8) after renaming the new log file to it's real name.
      
      PR:		kern/167321
    
    Modified:
      stable/8/etc/rc.d/accounting
      stable/8/sys/kern/kern_acct.c
    Directory Properties:
      stable/8/etc/   (props changed)
      stable/8/sys/   (props changed)
      stable/8/sys/kern/   (props changed)
    
    Modified: stable/8/etc/rc.d/accounting
    ==============================================================================
    --- stable/8/etc/rc.d/accounting	Tue Feb 26 16:55:44 2013	(r247321)
    +++ stable/8/etc/rc.d/accounting	Tue Feb 26 16:55:59 2013	(r247322)
    @@ -65,9 +65,7 @@ accounting_rotate_log()
     	mv ${accounting_file} ${accounting_file}.0
     
     	if checkyesno accounting_enable; then
    -		ln $_file ${accounting_file##*/}
    -		${accounting_command} ${accounting_file}
    -		unlink $_file
    +		mv $_file ${accounting_file}
     	fi
     }
     
    
    Modified: stable/8/sys/kern/kern_acct.c
    ==============================================================================
    --- stable/8/sys/kern/kern_acct.c	Tue Feb 26 16:55:44 2013	(r247321)
    +++ stable/8/sys/kern/kern_acct.c	Tue Feb 26 16:55:59 2013	(r247322)
    @@ -122,7 +122,7 @@ static uint32_t	encode_timeval(struct ti
     static uint32_t	encode_long(long);
     static void	acctwatch(void);
     static void	acct_thread(void *);
    -static int	acct_disable(struct thread *);
    +static int	acct_disable(struct thread *, int);
     
     /*
      * Accounting vnode pointer, saved vnode pointer, and flags for each.
    @@ -196,7 +196,7 @@ int
     acct(struct thread *td, struct acct_args *uap)
     {
     	struct nameidata nd;
    -	int error, flags, vfslocked;
    +	int error, flags, vfslocked, replacing;
     
     	error = priv_check(td, PRIV_ACCT);
     	if (error)
    @@ -246,6 +246,13 @@ acct(struct thread *td, struct acct_args
     	sx_xlock(&acct_sx);
     
     	/*
    +	 * Don't log spurious disable/enable messages if we are
    +	 * switching from one accounting file to another due to log
    +	 * rotation.
    +	 */
    +	replacing = (acct_vp != NULL && uap->path != NULL);
    +
    +	/*
     	 * If accounting was previously enabled, kill the old space-watcher,
     	 * close the file, and (if no new file was specified, leave).  Reset
     	 * the suspended state regardless of whether accounting remains
    @@ -254,7 +261,7 @@ acct(struct thread *td, struct acct_args
     	acct_suspended = 0;
     	if (acct_vp != NULL) {
     		vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount);
    -		error = acct_disable(td);
    +		error = acct_disable(td, !replacing);
     		VFS_UNLOCK_GIANT(vfslocked);
     	}
     	if (uap->path == NULL) {
    @@ -299,7 +306,8 @@ acct(struct thread *td, struct acct_args
     	}
     	acct_configured = 1;
     	sx_xunlock(&acct_sx);
    -	log(LOG_NOTICE, "Accounting enabled\n");
    +	if (!replacing)
    +		log(LOG_NOTICE, "Accounting enabled\n");
     	return (error);
     }
     
    @@ -308,7 +316,7 @@ acct(struct thread *td, struct acct_args
      * our reference to the credential, and clearing the vnode's flags.
      */
     static int
    -acct_disable(struct thread *td)
    +acct_disable(struct thread *td, int logging)
     {
     	int error;
     
    @@ -319,7 +327,8 @@ acct_disable(struct thread *td)
     	acct_vp = NULL;
     	acct_cred = NULL;
     	acct_flags = 0;
    -	log(LOG_NOTICE, "Accounting disabled\n");
    +	if (logging)
    +		log(LOG_NOTICE, "Accounting disabled\n");
     	return (error);
     }
     
    @@ -574,7 +583,7 @@ acctwatch(void)
     	 */
     	vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount);
     	if (acct_vp->v_type == VBAD) {
    -		(void) acct_disable(NULL);
    +		(void) acct_disable(NULL, 1);
     		VFS_UNLOCK_GIANT(vfslocked);
     		acct_state |= ACCT_EXITREQ;
     		return;
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 17:09:49 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id A25A6211;
     Tue, 26 Feb 2013 17:09:49 +0000 (UTC)
     (envelope-from davide.italiano@gmail.com)
    Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com
     [209.85.212.171])
     by mx1.freebsd.org (Postfix) with ESMTP id 9E4D810BA;
     Tue, 26 Feb 2013 17:09:48 +0000 (UTC)
    Received: by mail-wi0-f171.google.com with SMTP id hn17so5177420wib.4
     for ; Tue, 26 Feb 2013 09:09:42 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
     h=mime-version:x-received:sender:in-reply-to:references:date
     :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
     bh=htnbC5Zcd07c4KcFbdcuhqwEtYPdst+KV+L2JNUjJyo=;
     b=BfLhdW45GYNBXLCVla1BX8b93ewTrlI9iwPR88zODvKT3jd56e224Pm9F8e4T5chUl
     nzaOs90sDQJoCqqBQe3JhLLRfGqUQE3E/9fnEKFXdLl8ZZ8DLrihC9vxut6MAGYbjToU
     aiBlDTGuC22zU2FtTjwBGrox7Bmfu9rZkk59bHSU33MeKRbp7PBO6b0PmKKAtsNjMbVl
     FWoZ5TmC83N3HgvOGrjGARdKnK7iiq3x9q8YZCGg7CVmBKoFQvL0XJuEGNW0KUaa/DmB
     LRcka3Mu+bm6RGAmO8MNePXAExoVrx4z7i918jkVvpji9PjpD6B1rOKkbd6C+0C5f//T
     yXhA==
    MIME-Version: 1.0
    X-Received: by 10.194.119.68 with SMTP id ks4mr28071775wjb.3.1361898582471;
     Tue, 26 Feb 2013 09:09:42 -0800 (PST)
    Sender: davide.italiano@gmail.com
    Received: by 10.180.105.197 with HTTP; Tue, 26 Feb 2013 09:09:42 -0800 (PST)
    In-Reply-To: <201302260941.52534.jhb@freebsd.org>
    References: <201302260213.r1Q2D2N1016801@svn.freebsd.org>
     <201302260941.52534.jhb@freebsd.org>
    Date: Tue, 26 Feb 2013 18:09:42 +0100
    X-Google-Sender-Auth: yDYu8RCWnvKCQR6QaVDWn7wRIvU
    Message-ID: 
    Subject: Re: svn commit: r247300 - in head: sys/sys usr.bin/truss
    From: Davide Italiano 
    To: John Baldwin 
    Content-Type: text/plain; charset=ISO-8859-1
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org, Xin LI 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 17:09:49 -0000
    
    On Tue, Feb 26, 2013 at 3:41 PM, John Baldwin  wrote:
    > On Monday, February 25, 2013 9:13:02 pm Xin LI wrote:
    >> Author: delphij
    >> Date: Tue Feb 26 02:13:02 2013
    >> New Revision: 247300
    >> URL: http://svnweb.freebsd.org/changeset/base/247300
    >>
    >> Log:
    >>   Expose timespec and timeval macros when __BSD_VISIBLE is defined.  This
    >>   allows userland application to use the following macros:
    >>
    >>       timespecclear, timespecisset, timespeccmp, timespecadd,
    >>       timespecsub;
    >>
    >>       timevalclear, timevalisset, timevalcmp.
    >
    > Why not fix truss to use the stock functions instead of keeping private
    > "unusual" versions?
    >
    > --
    > John Baldwin
    
    time.h is already a mess in terms of namespace pollution, and this
    exposure might not help thing.
    Other details here:
    http://permalink.gmane.org/gmane.os.freebsd.architechture/15518
    
    -- 
    Davide
    
    "There are no solved problems; there are only problems that are more
    or less solved" -- Henri Poincare
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 17:22:10 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 1F18E761;
     Tue, 26 Feb 2013 17:22:10 +0000 (UTC)
     (envelope-from attilio@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 02C511144;
     Tue, 26 Feb 2013 17:22:10 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QHM9vI095027;
     Tue, 26 Feb 2013 17:22:09 GMT (envelope-from attilio@svn.freebsd.org)
    Received: (from attilio@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QHM9Sn095015;
     Tue, 26 Feb 2013 17:22:09 GMT (envelope-from attilio@svn.freebsd.org)
    Message-Id: <201302261722.r1QHM9Sn095015@svn.freebsd.org>
    From: Attilio Rao 
    Date: Tue, 26 Feb 2013 17:22:09 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247323 - head/sys/vm
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 17:22:10 -0000
    
    Author: attilio
    Date: Tue Feb 26 17:22:08 2013
    New Revision: 247323
    URL: http://svnweb.freebsd.org/changeset/base/247323
    
    Log:
      Wrap the sleeps synchronized by the vm_object lock into the specific
      macro VM_OBJECT_SLEEP().
      This hides some implementation details like the usage of the msleep()
      primitive and the necessity to access to the lock address directly.
      For this reason VM_OBJECT_MTX() macro is now retired.
      
      Sponsored by:	EMC / Isilon storage division
      Reviewed by:	alc
      Tested by:	pho
    
    Modified:
      head/sys/vm/swap_pager.c
      head/sys/vm/vm_object.c
      head/sys/vm/vm_object.h
      head/sys/vm/vm_page.c
      head/sys/vm/vnode_pager.c
    
    Modified: head/sys/vm/swap_pager.c
    ==============================================================================
    --- head/sys/vm/swap_pager.c	Tue Feb 26 16:55:59 2013	(r247322)
    +++ head/sys/vm/swap_pager.c	Tue Feb 26 17:22:08 2013	(r247323)
    @@ -1213,7 +1213,7 @@ swap_pager_getpages(vm_object_t object, 
     	while ((mreq->oflags & VPO_SWAPINPROG) != 0) {
     		mreq->oflags |= VPO_WANTED;
     		PCPU_INC(cnt.v_intrans);
    -		if (msleep(mreq, VM_OBJECT_MTX(object), PSWP, "swread", hz*20)) {
    +		if (VM_OBJECT_SLEEP(object, mreq, PSWP, "swread", hz * 20)) {
     			printf(
     "swap_pager: indefinite wait buffer: bufobj: %p, blkno: %jd, size: %ld\n",
     			    bp->b_bufobj, (intmax_t)bp->b_blkno, bp->b_bcount);
    
    Modified: head/sys/vm/vm_object.c
    ==============================================================================
    --- head/sys/vm/vm_object.c	Tue Feb 26 16:55:59 2013	(r247322)
    +++ head/sys/vm/vm_object.c	Tue Feb 26 17:22:08 2013	(r247323)
    @@ -387,7 +387,7 @@ vm_object_pip_wait(vm_object_t object, c
     	VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
     	while (object->paging_in_progress) {
     		object->flags |= OBJ_PIPWNT;
    -		msleep(object, VM_OBJECT_MTX(object), PVM, waitid, 0);
    +		VM_OBJECT_SLEEP(object, object, PVM, waitid, 0);
     	}
     }
     
    @@ -579,8 +579,7 @@ retry:
     					} else if (object->paging_in_progress) {
     						VM_OBJECT_UNLOCK(robject);
     						object->flags |= OBJ_PIPWNT;
    -						msleep(object,
    -						    VM_OBJECT_MTX(object),
    +						VM_OBJECT_SLEEP(object, object,
     						    PDROP | PVM, "objde2", 0);
     						VM_OBJECT_LOCK(robject);
     						temp = robject->backing_object;
    @@ -1139,8 +1138,7 @@ shadowlookup:
     			if (object != tobject)
     				VM_OBJECT_UNLOCK(object);
     			m->oflags |= VPO_WANTED;
    -			msleep(m, VM_OBJECT_MTX(tobject), PDROP | PVM, "madvpo",
    -			    0);
    +			VM_OBJECT_SLEEP(tobject, m, PDROP | PVM, "madvpo" , 0);
     			VM_OBJECT_LOCK(object);
       			goto relookup;
     		}
    @@ -1338,7 +1336,7 @@ retry:
     		if ((m->oflags & VPO_BUSY) || m->busy) {
     			VM_OBJECT_UNLOCK(new_object);
     			m->oflags |= VPO_WANTED;
    -			msleep(m, VM_OBJECT_MTX(orig_object), PVM, "spltwt", 0);
    +			VM_OBJECT_SLEEP(orig_object, m, PVM, "spltwt" , 0);
     			VM_OBJECT_LOCK(new_object);
     			goto retry;
     		}
    @@ -1496,7 +1494,7 @@ vm_object_backing_scan(vm_object_t objec
     				if ((p->oflags & VPO_BUSY) || p->busy) {
     					VM_OBJECT_UNLOCK(object);
     					p->oflags |= VPO_WANTED;
    -					msleep(p, VM_OBJECT_MTX(backing_object),
    +					VM_OBJECT_SLEEP(backing_object, p,
     					    PDROP | PVM, "vmocol", 0);
     					VM_OBJECT_LOCK(object);
     					VM_OBJECT_LOCK(backing_object);
    
    Modified: head/sys/vm/vm_object.h
    ==============================================================================
    --- head/sys/vm/vm_object.h	Tue Feb 26 16:55:59 2013	(r247322)
    +++ head/sys/vm/vm_object.h	Tue Feb 26 17:22:08 2013	(r247323)
    @@ -210,7 +210,9 @@ extern struct vm_object kmem_object_stor
     					mtx_init(&(object)->mtx, "vm object", \
     					    (type), MTX_DEF | MTX_DUPOK)
     #define	VM_OBJECT_LOCKED(object)	mtx_owned(&(object)->mtx)
    -#define	VM_OBJECT_MTX(object)		(&(object)->mtx)
    +#define	VM_OBJECT_SLEEP(object, wchan, pri, wmesg, timo) \
    +					msleep((wchan), &(object)->mtx, (pri), \
    +					    (wmesg), (timo))
     #define	VM_OBJECT_TRYLOCK(object)	mtx_trylock(&(object)->mtx)
     #define	VM_OBJECT_UNLOCK(object)	mtx_unlock(&(object)->mtx)
     
    
    Modified: head/sys/vm/vm_page.c
    ==============================================================================
    --- head/sys/vm/vm_page.c	Tue Feb 26 16:55:59 2013	(r247322)
    +++ head/sys/vm/vm_page.c	Tue Feb 26 17:22:08 2013	(r247323)
    @@ -763,7 +763,7 @@ vm_page_sleep(vm_page_t m, const char *m
     	 * it.
     	 */
     	m->oflags |= VPO_WANTED;
    -	msleep(m, VM_OBJECT_MTX(m->object), PVM, msg, 0);
    +	VM_OBJECT_SLEEP(m->object, m, PVM, msg, 0);
     }
     
     /*
    
    Modified: head/sys/vm/vnode_pager.c
    ==============================================================================
    --- head/sys/vm/vnode_pager.c	Tue Feb 26 16:55:59 2013	(r247322)
    +++ head/sys/vm/vnode_pager.c	Tue Feb 26 17:22:08 2013	(r247323)
    @@ -116,7 +116,7 @@ vnode_create_vobject(struct vnode *vp, o
     		}
     		VOP_UNLOCK(vp, 0);
     		vm_object_set_flag(object, OBJ_DISCONNECTWNT);
    -		msleep(object, VM_OBJECT_MTX(object), PDROP | PVM, "vodead", 0);
    +		VM_OBJECT_SLEEP(object, object, PDROP | PVM, "vodead" , 0);
     		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
     	}
     
    @@ -210,7 +210,7 @@ retry:
     		if ((object->flags & OBJ_DEAD) == 0)
     			break;
     		vm_object_set_flag(object, OBJ_DISCONNECTWNT);
    -		msleep(object, VM_OBJECT_MTX(object), PDROP | PVM, "vadead", 0);
    +		VM_OBJECT_SLEEP(object, object, PDROP | PVM, "vadead" , 0);
     	}
     
     	if (vp->v_usecount == 0)
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 18:13:43 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id CB507ED5;
     Tue, 26 Feb 2013 18:13: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 BAD6B158A;
     Tue, 26 Feb 2013 18:13:43 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QIDh9V010788;
     Tue, 26 Feb 2013 18:13:43 GMT (envelope-from mav@svn.freebsd.org)
    Received: (from mav@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QIDhNU010783;
     Tue, 26 Feb 2013 18:13:43 GMT (envelope-from mav@svn.freebsd.org)
    Message-Id: <201302261813.r1QIDhNU010783@svn.freebsd.org>
    From: Alexander Motin 
    Date: Tue, 26 Feb 2013 18:13:43 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247329 - in head: lib/libpmc sys/dev/hwpmc sys/kern
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 18:13:43 -0000
    
    Author: mav
    Date: Tue Feb 26 18:13:42 2013
    New Revision: 247329
    URL: http://svnweb.freebsd.org/changeset/base/247329
    
    Log:
      Add support for good old 8192Hz profiling clock to software PMC.
      
      Reviewed by:	fabient
    
    Modified:
      head/lib/libpmc/pmc.soft.3
      head/sys/dev/hwpmc/hwpmc_soft.c
      head/sys/kern/kern_clock.c
      head/sys/kern/kern_clocksource.c
    
    Modified: head/lib/libpmc/pmc.soft.3
    ==============================================================================
    --- head/lib/libpmc/pmc.soft.3	Tue Feb 26 18:11:43 2013	(r247328)
    +++ head/lib/libpmc/pmc.soft.3	Tue Feb 26 18:13:42 2013	(r247329)
    @@ -23,7 +23,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd March 28, 2012
    +.Dd February 26, 2013
     .Dt PMC.SOFT 3
     .Os
     .Sh NAME
    @@ -61,6 +61,8 @@ The event specifiers supported by softwa
     Hard clock ticks.
     .It Li CLOCK.STAT
     Stat clock ticks.
    +.It Li CLOCK.PROF
    +Profiling clock ticks.
     .It Li LOCK.FAILED
     Lock acquisition failed.
     .It Li PAGE_FAULT.ALL
    
    Modified: head/sys/dev/hwpmc/hwpmc_soft.c
    ==============================================================================
    --- head/sys/dev/hwpmc/hwpmc_soft.c	Tue Feb 26 18:11:43 2013	(r247328)
    +++ head/sys/dev/hwpmc/hwpmc_soft.c	Tue Feb 26 18:13:42 2013	(r247329)
    @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$");
     #define	SOFT_CAPS (PMC_CAP_READ | PMC_CAP_WRITE | PMC_CAP_INTERRUPT | \
         PMC_CAP_USER | PMC_CAP_SYSTEM)
     
    +PMC_SOFT_DECLARE( , , clock, prof);
    +
     struct soft_descr {
     	struct pmc_descr pm_descr;  /* "base class" */
     };
    @@ -125,6 +127,8 @@ soft_allocate_pmc(int cpu, int ri, struc
     		return (EINVAL);
     	pmc_soft_ev_release(ps);
     
    +	if (ev == pmc___clock_prof.ps_ev.pm_ev_code)
    +		cpu_startprofclock();
     	return (0);
     }
     
    @@ -324,9 +328,8 @@ soft_release_pmc(int cpu, int ri, struct
     	KASSERT(phw->phw_pmc == NULL,
     	    ("[soft,%d] PHW pmc %p non-NULL", __LINE__, phw->phw_pmc));
     
    -	/*
    -	 * Nothing to do.
    -	 */
    +	if (pmc->pm_event == pmc___clock_prof.ps_ev.pm_ev_code)
    +		cpu_stopprofclock();
     	return (0);
     }
     
    
    Modified: head/sys/kern/kern_clock.c
    ==============================================================================
    --- head/sys/kern/kern_clock.c	Tue Feb 26 18:11:43 2013	(r247328)
    +++ head/sys/kern/kern_clock.c	Tue Feb 26 18:13:42 2013	(r247329)
    @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$");
     #include 
     PMC_SOFT_DEFINE( , , clock, hard);
     PMC_SOFT_DEFINE( , , clock, stat);
    +PMC_SOFT_DEFINE( , , clock, prof);
     #endif
     
     #ifdef DEVICE_POLLING
    @@ -817,6 +818,10 @@ profclock_cnt(int cnt, int usermode, uin
     		}
     	}
     #endif
    +#ifdef HWPMC_HOOKS
    +	if (td->td_intr_frame != NULL)
    +		PMC_SOFT_CALL_TF( , , clock, prof, td->td_intr_frame);
    +#endif
     }
     
     /*
    
    Modified: head/sys/kern/kern_clocksource.c
    ==============================================================================
    --- head/sys/kern/kern_clocksource.c	Tue Feb 26 18:11:43 2013	(r247328)
    +++ head/sys/kern/kern_clocksource.c	Tue Feb 26 18:13:42 2013	(r247329)
    @@ -732,12 +732,15 @@ cpu_startprofclock(void)
     {
     
     	ET_LOCK();
    -	if (periodic) {
    -		configtimer(0);
    -		profiling = 1;
    -		configtimer(1);
    +	if (profiling == 0) {
    +		if (periodic) {
    +			configtimer(0);
    +			profiling = 1;
    +			configtimer(1);
    +		} else
    +			profiling = 1;
     	} else
    -		profiling = 1;
    +		profiling++;
     	ET_UNLOCK();
     }
     
    @@ -749,12 +752,15 @@ cpu_stopprofclock(void)
     {
     
     	ET_LOCK();
    -	if (periodic) {
    -		configtimer(0);
    +	if (profiling == 1) {
    +		if (periodic) {
    +			configtimer(0);
    +			profiling = 0;
    +			configtimer(1);
    +		} else
     		profiling = 0;
    -		configtimer(1);
     	} else
    -		profiling = 0;
    +		profiling--;
     	ET_UNLOCK();
     }
     
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 18:19:52 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id CAB222B9;
     Tue, 26 Feb 2013 18:19:52 +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 AD7E515D3;
     Tue, 26 Feb 2013 18:19:52 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QIJqto011738;
     Tue, 26 Feb 2013 18:19:52 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QIJq1W011734;
     Tue, 26 Feb 2013 18:19:52 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302261819.r1QIJq1W011734@svn.freebsd.org>
    From: John Baldwin 
    Date: Tue, 26 Feb 2013 18:19:52 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
    Subject: svn commit: r247331 - stable/9/sys/dev/twe
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 18:19:52 -0000
    
    Author: jhb
    Date: Tue Feb 26 18:19:51 2013
    New Revision: 247331
    URL: http://svnweb.freebsd.org/changeset/base/247331
    
    Log:
      MFC 239244,240137,240209:
      Add locking to the twe(4) driver and make it MPSAFE.
    
    Modified:
      stable/9/sys/dev/twe/twe.c
      stable/9/sys/dev/twe/twe_compat.h
      stable/9/sys/dev/twe/twe_freebsd.c
      stable/9/sys/dev/twe/twevar.h
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
    
    Modified: stable/9/sys/dev/twe/twe.c
    ==============================================================================
    --- stable/9/sys/dev/twe/twe.c	Tue Feb 26 18:18:39 2013	(r247330)
    +++ stable/9/sys/dev/twe/twe.c	Tue Feb 26 18:19:51 2013	(r247331)
    @@ -68,7 +68,7 @@ static int	twe_del_unit(struct twe_softc
     /*
      * Command I/O to controller.
      */
    -static void	twe_done(struct twe_softc *sc);
    +static void	twe_done(struct twe_softc *sc, int startio);
     static void	twe_complete(struct twe_softc *sc);
     static int	twe_wait_status(struct twe_softc *sc, u_int32_t status, int timeout);
     static int	twe_drain_response_queue(struct twe_softc *sc);
    @@ -151,8 +151,11 @@ twe_setup(struct twe_softc *sc)
     	/*
     	 * Put command onto the freelist.
     	 */
    +	TWE_IO_LOCK(sc);
     	twe_release_request(tr);
    +	TWE_IO_UNLOCK(sc);
         }
    +    TWE_IO_LOCK(sc);
     
         /*
          * Check status register for errors, clear them.
    @@ -164,6 +167,7 @@ twe_setup(struct twe_softc *sc)
          * Wait for the controller to come ready.
          */
         if (twe_wait_status(sc, TWE_STATUS_MICROCONTROLLER_READY, 60)) {
    +	TWE_IO_UNLOCK(sc);
     	twe_printf(sc, "microcontroller not ready\n");
     	return(ENXIO);
         }
    @@ -185,6 +189,7 @@ twe_setup(struct twe_softc *sc)
     	if (!twe_soft_reset(sc))
     	    break;			/* reset process complete */
         }
    +    TWE_IO_UNLOCK(sc);
         /* did we give up? */
         if (i >= TWE_MAX_RESET_TRIES) {
     	twe_printf(sc, "can't initialise controller, giving up\n");
    @@ -203,14 +208,17 @@ twe_add_unit(struct twe_softc *sc, int u
         TWE_Param			*drives = NULL, *param = NULL;
         TWE_Array_Descriptor	*ud;
     
    +    TWE_CONFIG_ASSERT_LOCKED(sc);
         if (unit < 0 || unit > TWE_MAX_UNITS)
     	return (EINVAL);
     
         /*
          * The controller is in a safe state, so try to find drives attached to it.
          */
    +    TWE_IO_LOCK(sc);
         if ((drives = twe_get_param(sc, TWE_PARAM_UNITSUMMARY, TWE_PARAM_UNITSUMMARY_Status,
     				TWE_MAX_UNITS, NULL)) == NULL) {
    +	TWE_IO_UNLOCK(sc);
     	twe_printf(sc, "can't detect attached units\n");
     	return (EIO);
         }
    @@ -218,6 +226,7 @@ twe_add_unit(struct twe_softc *sc, int u
         dr = &sc->twe_drive[unit];
         /* check that the drive is online */
         if (!(drives->data[unit] & TWE_PARAM_UNITSTATUS_Online)) {
    +	TWE_IO_UNLOCK(sc);
     	error = ENXIO;
     	goto out;
         }
    @@ -225,21 +234,25 @@ twe_add_unit(struct twe_softc *sc, int u
         table = TWE_PARAM_UNITINFO + unit;
     
         if (twe_get_param_4(sc, table, TWE_PARAM_UNITINFO_Capacity, &dr->td_size)) {
    +	TWE_IO_UNLOCK(sc);
     	twe_printf(sc, "error fetching capacity for unit %d\n", unit);
     	error = EIO;
     	goto out;
         }
         if (twe_get_param_1(sc, table, TWE_PARAM_UNITINFO_Status, &dr->td_state)) {
    +	TWE_IO_UNLOCK(sc);
     	twe_printf(sc, "error fetching state for unit %d\n", unit);
     	error = EIO;
     	goto out;
         }
         if (twe_get_param_2(sc, table, TWE_PARAM_UNITINFO_DescriptorSize, &dsize)) {
    +	TWE_IO_UNLOCK(sc);
     	twe_printf(sc, "error fetching descriptor size for unit %d\n", unit);
     	error = EIO;
     	goto out;
         }
         if ((param = twe_get_param(sc, table, TWE_PARAM_UNITINFO_Descriptor, dsize - 3, NULL)) == NULL) {
    +	TWE_IO_UNLOCK(sc);
     	twe_printf(sc, "error fetching descriptor for unit %d\n", unit);
     	error = EIO;
     	goto out;
    @@ -258,6 +271,7 @@ twe_add_unit(struct twe_softc *sc, int u
         }
         dr->td_cylinders = dr->td_size / (dr->td_heads * dr->td_sectors);
         dr->td_twe_unit = unit;
    +    TWE_IO_UNLOCK(sc);
     
         error = twe_attach_drive(sc, dr);
     
    @@ -274,6 +288,7 @@ twe_del_unit(struct twe_softc *sc, int u
     {
         int error;
     
    +    TWE_CONFIG_ASSERT_LOCKED(sc);
         if (unit < 0 || unit >= TWE_MAX_UNITS)
     	return (ENXIO);
     
    @@ -295,12 +310,15 @@ twe_init(struct twe_softc *sc)
         /*
          * Scan for drives
          */
    +    TWE_CONFIG_LOCK(sc);
         for (i = 0; i < TWE_MAX_UNITS; i++)
     	twe_add_unit(sc, i);
    +    TWE_CONFIG_UNLOCK(sc);
     
         /*
          * Initialise connection with controller.
          */
    +    TWE_IO_LOCK(sc);
         twe_init_connection(sc, TWE_INIT_MESSAGE_CREDITS);
     
     #ifdef TWE_SHUTDOWN_NOTIFICATION
    @@ -319,6 +337,7 @@ twe_init(struct twe_softc *sc)
          * Finally enable interrupts.
          */
         twe_enable_interrupts(sc);
    +    TWE_IO_UNLOCK(sc);
     }
     
     /********************************************************************************
    @@ -330,6 +349,7 @@ twe_deinit(struct twe_softc *sc)
         /*
          * Mark the controller as shutting down, and disable any further interrupts.
          */
    +    TWE_IO_ASSERT_LOCKED(sc);
         sc->twe_state |= TWE_STATE_SHUTDOWN;
         twe_disable_interrupts(sc);
     
    @@ -368,7 +388,7 @@ twe_intr(struct twe_softc *sc)
         if (status_reg & TWE_STATUS_COMMAND_INTERRUPT)
     	twe_command_intr(sc);
         if (status_reg & TWE_STATUS_RESPONSE_INTERRUPT)
    -	twe_done(sc);
    +	twe_done(sc, 1);
     };
     
     /********************************************************************************
    @@ -380,11 +400,12 @@ twe_startio(struct twe_softc *sc)
     {
         struct twe_request	*tr;
         TWE_Command		*cmd;
    -    twe_bio		*bp;
    +    struct bio		*bp;
         int			error;
     
         debug_called(4);
     
    +    TWE_IO_ASSERT_LOCKED(sc);
         if (sc->twe_state & (TWE_STATE_CTLR_BUSY | TWE_STATE_FRZN))
     	return;
     
    @@ -410,10 +431,10 @@ twe_startio(struct twe_softc *sc)
     	    /* connect the bio to the command */
     	    tr->tr_complete = twe_completeio;
     	    tr->tr_private = bp;
    -	    tr->tr_data = TWE_BIO_DATA(bp);
    -	    tr->tr_length = TWE_BIO_LENGTH(bp);
    +	    tr->tr_data = bp->bio_data;
    +	    tr->tr_length = bp->bio_bcount;
     	    cmd = TWE_FIND_COMMAND(tr);
    -	    if (TWE_BIO_IS_READ(bp)) {
    +	    if (bp->bio_cmd == BIO_READ) {
     		tr->tr_flags |= TWE_CMD_DATAIN;
     		cmd->io.opcode = TWE_OP_READ;
     	    } else {
    @@ -423,9 +444,9 @@ twe_startio(struct twe_softc *sc)
     	
     	    /* build a suitable I/O command (assumes 512-byte rounded transfers) */
     	    cmd->io.size = 3;
    -	    cmd->io.unit = TWE_BIO_UNIT(bp);
    +	    cmd->io.unit = *(int *)(bp->bio_driver1);
     	    cmd->io.block_count = (tr->tr_length + TWE_BLOCK_SIZE - 1) / TWE_BLOCK_SIZE;
    -	    cmd->io.lba = TWE_BIO_LBA(bp);
    +	    cmd->io.lba = bp->bio_pblkno;
     	}
     	
     	/* did we find something to do? */
    @@ -440,8 +461,9 @@ twe_startio(struct twe_softc *sc)
     		break;
     	    tr->tr_status = TWE_CMD_ERROR;
     	    if (tr->tr_private != NULL) {
    -		bp = (twe_bio *)(tr->tr_private);
    -		TWE_BIO_SET_ERROR(bp, error);
    +		bp = (struct bio *)(tr->tr_private);
    +		bp->bio_error = error;
    +		bp->bio_flags |= BIO_ERROR;
     		tr->tr_private = NULL;
     		twed_intr(bp);
     	        twe_release_request(tr);
    @@ -500,15 +522,32 @@ twe_ioctl(struct twe_softc *sc, u_long i
         u_int16_t			*aen_code = (u_int16_t *)addr;
         struct twe_request		*tr;
         u_int8_t			srid;
    -    int				s, error;
    +    int				error;
    +    size_t			tr_length;
     
         error = 0;
         switch(ioctlcmd) {
     	/* handle a command from userspace */
         case TWEIO_COMMAND:
    +	/*
    +	 * if there's a data buffer, allocate and copy it in.
    +	 * Must be in multipled of 512 bytes.
    +	 */
    +	tr_length = roundup2(tu->tu_size, 512);
    +	if (tr_length > 0) {
    +	    data = malloc(tr_length, M_DEVBUF, M_WAITOK);
    +	    error = copyin(tu->tu_data, data, tu->tu_size);
    +	    if (error) {
    +		free(data, M_DEVBUF);
    +		break;
    +	    }
    +	} else
    +	    data = NULL;
    +
     	/* get a request */
    +	TWE_IO_LOCK(sc);
     	while (twe_get_request(sc, &tr))
    -	    tsleep(sc, PPAUSE, "twioctl", hz);
    +	    mtx_sleep(sc, &sc->twe_io_lock, PPAUSE, "twioctl", hz);
     
     	/*
     	 * Save the command's request ID, copy the user-supplied command in,
    @@ -519,23 +558,15 @@ twe_ioctl(struct twe_softc *sc, u_long i
     	bcopy(&tu->tu_command, cmd, sizeof(TWE_Command));
     	cmd->generic.request_id = srid;
     
    -	/*
    -	 * if there's a data buffer, allocate and copy it in.
    -	 * Must be in multipled of 512 bytes.
    -	 */
    -	tr->tr_length = (tu->tu_size + 511) & ~511;
    +	tr->tr_length = tr_length;
    +	tr->tr_data = data;
     	if (tr->tr_length > 0) {
    -	    if ((tr->tr_data = malloc(tr->tr_length, M_DEVBUF, M_WAITOK)) == NULL) {
    -		error = ENOMEM;
    -		goto cmd_done;
    -	    }
    -	    if ((error = copyin(tu->tu_data, tr->tr_data, tu->tu_size)) != 0)
    -		goto cmd_done;
     	    tr->tr_flags |= TWE_CMD_DATAIN | TWE_CMD_DATAOUT;
     	}
     
     	/* run the command */
     	error = twe_wait_request(tr);
    +	TWE_IO_UNLOCK(sc);
     	if (error)
     	    goto cmd_done;
     
    @@ -550,8 +581,9 @@ twe_ioctl(struct twe_softc *sc, u_long i
     	/* free resources */
     	if (tr->tr_data != NULL)
     	    free(tr->tr_data, M_DEVBUF);
    -	if (tr != NULL)
    -	    twe_release_request(tr);
    +	TWE_IO_LOCK(sc);
    +	twe_release_request(tr);
    +	TWE_IO_UNLOCK(sc);
     
     	break;
     
    @@ -564,7 +596,9 @@ twe_ioctl(struct twe_softc *sc, u_long i
     	case TWEQ_READY:
     	case TWEQ_BUSY:
     	case TWEQ_COMPLETE:
    +	    TWE_IO_LOCK(sc);
     	    bcopy(&sc->twe_qstat[ts->ts_item], &ts->ts_qstat, sizeof(struct twe_qstat));
    +	    TWE_IO_UNLOCK(sc);
     	    break;
     #endif
     	default:
    @@ -575,22 +609,28 @@ twe_ioctl(struct twe_softc *sc, u_long i
     
     	/* poll for an AEN */
         case TWEIO_AEN_POLL:
    +	TWE_IO_LOCK(sc);
     	*aen_code = twe_dequeue_aen(sc);
    +	TWE_IO_UNLOCK(sc);
     	break;
     
     	/* wait for another AEN to show up */
         case TWEIO_AEN_WAIT:
    -	s = splbio();
    +	TWE_IO_LOCK(sc);
     	while ((*aen_code = twe_dequeue_aen(sc)) == TWE_AEN_QUEUE_EMPTY) {
    -	    error = tsleep(&sc->twe_aen_queue, PRIBIO | PCATCH, "tweaen", 0);
    +	    error = mtx_sleep(&sc->twe_aen_queue, &sc->twe_io_lock, PRIBIO | PCATCH,
    +		"tweaen", 0);
     	    if (error == EINTR)
     		break;
     	}
    -	splx(s);
    +	TWE_IO_UNLOCK(sc);
     	break;
     
         case TWEIO_GET_PARAM:
    -	if ((param = twe_get_param(sc, tp->tp_table_id, tp->tp_param_id, tp->tp_size, NULL)) == NULL) {
    +	TWE_IO_LOCK(sc);
    +	param = twe_get_param(sc, tp->tp_table_id, tp->tp_param_id, tp->tp_size, NULL);
    +	TWE_IO_UNLOCK(sc);
    +	if (param == NULL) {
     	    twe_printf(sc, "TWEIO_GET_PARAM failed for 0x%x/0x%x/%d\n", 
     		       tp->tp_table_id, tp->tp_param_id, tp->tp_size);
     	    error = EINVAL;
    @@ -607,26 +647,32 @@ twe_ioctl(struct twe_softc *sc, u_long i
     	break;
     
         case TWEIO_SET_PARAM:
    -	if ((data = malloc(tp->tp_size, M_DEVBUF, M_WAITOK)) == NULL) {
    -	    error = ENOMEM;
    -	} else {
    -	    error = copyin(tp->tp_data, data, tp->tp_size);
    -	    if (error == 0)
    -		error = twe_set_param(sc, tp->tp_table_id, tp->tp_param_id, tp->tp_size, data);
    -	    free(data, M_DEVBUF);
    +	data = malloc(tp->tp_size, M_DEVBUF, M_WAITOK);
    +	error = copyin(tp->tp_data, data, tp->tp_size);
    +	if (error == 0) {
    +	    TWE_IO_LOCK(sc);
    +	    error = twe_set_param(sc, tp->tp_table_id, tp->tp_param_id, tp->tp_size, data);
    +	    TWE_IO_UNLOCK(sc);
     	}
    +	free(data, M_DEVBUF);
     	break;
     
         case TWEIO_RESET:
    +	TWE_IO_LOCK(sc);
     	twe_reset(sc);
    +	TWE_IO_UNLOCK(sc);
     	break;
     
         case TWEIO_ADD_UNIT:
    +	TWE_CONFIG_LOCK(sc);
     	error = twe_add_unit(sc, td->td_unit);
    +	TWE_CONFIG_UNLOCK(sc);
     	break;
     
         case TWEIO_DEL_UNIT:
    +	TWE_CONFIG_LOCK(sc);
     	error = twe_del_unit(sc, td->td_unit);
    +	TWE_CONFIG_UNLOCK(sc);
     	break;
     
     	/* XXX implement ATA PASSTHROUGH */
    @@ -724,6 +770,7 @@ twe_get_param(struct twe_softc *sc, int 
     
         debug_called(4);
     
    +    TWE_IO_ASSERT_LOCKED(sc);
         tr = NULL;
         param = NULL;
     
    @@ -817,6 +864,7 @@ twe_set_param(struct twe_softc *sc, int 
     
         debug_called(4);
     
    +    TWE_IO_ASSERT_LOCKED(sc);
         tr = NULL;
         param = NULL;
         error = ENOMEM;
    @@ -874,6 +922,8 @@ twe_init_connection(struct twe_softc *sc
         
         debug_called(4);
     
    +    TWE_IO_ASSERT_LOCKED(sc);
    +
         /* get a command */
         if (twe_get_request(sc, &tr))
     	return(0);
    @@ -903,18 +953,16 @@ twe_init_connection(struct twe_softc *sc
     static int
     twe_wait_request(struct twe_request *tr)
     {
    -    int		s;
     
         debug_called(4);
     
    +    TWE_IO_ASSERT_LOCKED(tr->tr_sc);
         tr->tr_flags |= TWE_CMD_SLEEPER;
         tr->tr_status = TWE_CMD_BUSY;
         twe_enqueue_ready(tr);
         twe_startio(tr->tr_sc);
    -    s = splbio();
         while (tr->tr_status == TWE_CMD_BUSY)
    -	tsleep(tr, PRIBIO, "twewait", 0);
    -    splx(s);
    +	mtx_sleep(tr, &tr->tr_sc->twe_io_lock, PRIBIO, "twewait", 0);
         
         return(tr->tr_status != TWE_CMD_COMPLETE);
     }
    @@ -949,7 +997,7 @@ twe_immediate_request(struct twe_request
         /* Wait up to 5 seconds for the command to complete */
         while ((count++ < 5000) && (tr->tr_status == TWE_CMD_BUSY)){
     	DELAY(1000);
    -	twe_done(sc);
    +	twe_done(sc, 1);
         }
         if (usetmp && (tr->tr_data != NULL))
     	bcopy(sc->twe_immediate, tr->tr_data, tr->tr_length);
    @@ -965,15 +1013,17 @@ twe_completeio(struct twe_request *tr)
     {
         TWE_Command		*cmd = TWE_FIND_COMMAND(tr);
         struct twe_softc	*sc = tr->tr_sc;
    -    twe_bio		*bp = (twe_bio *)tr->tr_private;
    +    struct bio		*bp = tr->tr_private;
     
         debug_called(4);
     
         if (tr->tr_status == TWE_CMD_COMPLETE) {
     
     	if (cmd->generic.status)
    -	    if (twe_report_request(tr))
    -		TWE_BIO_SET_ERROR(bp, EIO);
    +	    if (twe_report_request(tr)) {
    +		bp->bio_error = EIO;
    +		bp->bio_flags |= BIO_ERROR;
    +	    }
     
         } else {
     	twe_panic(sc, "twe_completeio on incomplete command");
    @@ -991,12 +1041,12 @@ static void
     twe_reset(struct twe_softc *sc)
     {
         struct twe_request	*tr;
    -    int			i, s;
    +    int			i;
     
         /*
          * Sleep for a short period to allow AENs to be signalled.
          */
    -    tsleep(sc, PRIBIO, "twereset", hz);
    +    mtx_sleep(sc, &sc->twe_io_lock, PRIBIO, "twereset", hz);
     
         /*
          * Disable interrupts from the controller, and mask any accidental entry
    @@ -1004,7 +1054,6 @@ twe_reset(struct twe_softc *sc)
          */
         twe_printf(sc, "controller reset in progress...\n");
         twe_disable_interrupts(sc);
    -    s = splbio();
     
         /*
          * Try to soft-reset the controller.
    @@ -1036,11 +1085,9 @@ twe_reset(struct twe_softc *sc)
          * Kick the controller to start things going again, then re-enable interrupts.
          */
         twe_startio(sc);
    -    twe_enable_interrupts(sc);
         twe_printf(sc, "controller reset done, %d commands restarted\n", i);
     
     out:
    -    splx(s);
         twe_enable_interrupts(sc);
     }
     
    @@ -1060,11 +1107,14 @@ twe_start(struct twe_request *tr)
     {
         struct twe_softc	*sc = tr->tr_sc;
         TWE_Command		*cmd;
    -    int			i, s, done;
    +    int			i;
         u_int32_t		status_reg;
     
         debug_called(4);
     
    +    if (!dumping)
    +	TWE_IO_ASSERT_LOCKED(sc);
    +
         /* mark the command as currently being processed */
         tr->tr_status = TWE_CMD_BUSY;
         cmd = TWE_FIND_COMMAND(tr);
    @@ -1075,8 +1125,7 @@ twe_start(struct twe_request *tr)
          * XXX it might be more efficient to return EBUSY immediately
          *     and let the command be rescheduled.
          */
    -    for (i = 100000, done = 0; (i > 0) && !done; i--) {
    -	s = splbio();
    +    for (i = 100000; (i > 0); i--) {
     	
     	/* check to see if we can post a command */
     	status_reg = TWE_STATUS(sc);
    @@ -1086,7 +1135,7 @@ twe_start(struct twe_request *tr)
     	    twe_enqueue_busy(tr);
     
     	    TWE_COMMAND_QUEUE(sc, TWE_FIND_COMMANDPHYS(tr));
    -	    done = 1;
    +
     	    /* move command to work queue */
     #ifdef TWE_DEBUG
     	    if (tr->tr_complete != NULL) {
    @@ -1097,14 +1146,11 @@ twe_start(struct twe_request *tr)
     		debug(3, "queued request %d for polling caller", cmd->generic.request_id);
     	    }
     #endif
    -	}
    -	splx(s);	/* drop spl to allow completion interrupts */
    +	    return(0);
    +	} else if (!(status_reg & TWE_STATUS_RESPONSE_QUEUE_EMPTY) && i > 1)
    +	    twe_done(sc, 0);
         }
     
    -    /* command is enqueued */
    -    if (done)
    -	return(0);
    -
         /* 
          * We couldn't get the controller to take the command; try submitting it again later.
          * This should only happen if something is wrong with the controller, or if we have
    @@ -1120,19 +1166,18 @@ twe_start(struct twe_request *tr)
      * Can be called at any interrupt level, with or without interrupts enabled.
      */
     static void
    -twe_done(struct twe_softc *sc)
    +twe_done(struct twe_softc *sc, int startio)
     {
         TWE_Response_Queue	rq;
         TWE_Command		*cmd;
         struct twe_request	*tr;
    -    int			s, found;
    +    int			found;
         u_int32_t		status_reg;
         
         debug_called(5);
     
         /* loop collecting completed commands */
         found = 0;
    -    s = splbio();
         for (;;) {
     	status_reg = TWE_STATUS(sc);
     	twe_check_bits(sc, status_reg);		/* XXX should this fail? */
    @@ -1155,10 +1200,9 @@ twe_done(struct twe_softc *sc)
     	    break;					/* no response ready */
     	}
         }
    -    splx(s);
     
         /* if we've completed any commands, try posting some more */
    -    if (found)
    +    if (found && startio)
     	twe_startio(sc);
     
         /* handle completion and timeouts */
    @@ -1259,6 +1303,7 @@ twe_soft_reset(struct twe_softc *sc)
     
         debug_called(2);
     
    +    TWE_IO_ASSERT_LOCKED(sc);
         TWE_SOFT_RESET(sc);
     
         if (twe_wait_status(sc, TWE_STATUS_ATTENTION_INTERRUPT, 30)) {
    @@ -1396,6 +1441,7 @@ twe_drain_aen_queue(struct twe_softc *sc
     {
         u_int16_t	aen;
     
    +    TWE_IO_ASSERT_LOCKED(sc);
         for (;;) {
     	if (twe_get_param_2(sc, TWE_PARAM_AEN, TWE_PARAM_AEN_UnitCode, &aen))
     	    return(1);
    @@ -1417,14 +1463,14 @@ static void
     twe_enqueue_aen(struct twe_softc *sc, u_int16_t aen)
     {
         char	*msg;
    -    int		s, next, nextnext;
    +    int		next, nextnext;
     
         debug_called(4);
     
    +    TWE_IO_ASSERT_LOCKED(sc);
         if ((msg = twe_format_aen(sc, aen)) != NULL)
     	twe_printf(sc, "AEN: <%s>\n", msg);
     
    -    s = splbio();
         /* enqueue the AEN */
         next = ((sc->twe_aen_head + 1) % TWE_Q_LENGTH);
         nextnext = ((sc->twe_aen_head + 2) % TWE_Q_LENGTH);
    @@ -1447,7 +1493,6 @@ twe_enqueue_aen(struct twe_softc *sc, u_
     	sc->twe_wait_aen = -1;
     	wakeup(&sc->twe_wait_aen);
         }
    -    splx(s);
     }
     
     /********************************************************************************
    @@ -1462,6 +1507,7 @@ twe_dequeue_aen(struct twe_softc *sc)
         
         debug_called(4);
     
    +    TWE_IO_ASSERT_LOCKED(sc);
         if (sc->twe_aen_tail == sc->twe_aen_head) {
     	result = TWE_AEN_QUEUE_EMPTY;
         } else {
    @@ -1479,15 +1525,13 @@ twe_dequeue_aen(struct twe_softc *sc)
     static int
     twe_find_aen(struct twe_softc *sc, u_int16_t aen)
     {
    -    int		i, s, missing;
    +    int		i, missing;
     
         missing = 1;
    -    s = splbio();
         for (i = sc->twe_aen_tail; (i != sc->twe_aen_head) && missing; i = (i + 1) % TWE_Q_LENGTH) {
     	if (sc->twe_aen_queue[i] == aen)
     	    missing = 0;
         }
    -    splx(s);
         return(missing);
     }
     
    @@ -1504,22 +1548,20 @@ static int
     twe_wait_aen(struct twe_softc *sc, int aen, int timeout)
     {
         time_t	expiry;
    -    int		found, s;
    +    int		found;
     
         debug_called(4);
     
         expiry = time_second + timeout;
         found = 0;
     
    -    s = splbio();
         sc->twe_wait_aen = aen;
         do {
     	twe_fetch_aen(sc);
    -	tsleep(&sc->twe_wait_aen, PZERO, "twewaen", hz);
    +	mtx_sleep(&sc->twe_wait_aen, &sc->twe_io_lock, PZERO, "twewaen", hz);
     	if (sc->twe_wait_aen == -1)
     	    found = 1;
         } while ((time_second <= expiry) && !found);
    -    splx(s);
         return(!found);
     }
     #endif
    @@ -1541,6 +1583,9 @@ twe_get_request(struct twe_softc *sc, st
         TWE_Command		*cmd;
         debug_called(4);
     
    +    if (!dumping)
    +	TWE_IO_ASSERT_LOCKED(sc);
    +
         /* try to reuse an old buffer */
         *tr = twe_dequeue_free(sc);
     
    @@ -1567,6 +1612,8 @@ twe_release_request(struct twe_request *
     {
         debug_called(4);
     
    +    if (!dumping)
    +	TWE_IO_ASSERT_LOCKED(tr->tr_sc);
         if (tr->tr_private != NULL)
     	twe_panic(tr->tr_sc, "tr_private != NULL");
         twe_enqueue_free(tr);
    @@ -1591,6 +1638,8 @@ twe_describe_controller(struct twe_softc
     
         debug_called(2);
     
    +    TWE_IO_LOCK(sc);
    +
         /* get the port count */
         twe_get_param_1(sc, TWE_PARAM_CONTROLLER, TWE_PARAM_CONTROLLER_PortCount, &ports);
     
    @@ -1641,6 +1690,7 @@ twe_describe_controller(struct twe_softc
     	if (p[0])
     	    free(p[0], M_DEVBUF);
         }
    +    TWE_IO_UNLOCK(sc);
     }
     
     /********************************************************************************
    @@ -1722,7 +1772,6 @@ twe_check_bits(struct twe_softc *sc, u_i
     static char *
     twe_format_aen(struct twe_softc *sc, u_int16_t aen)
     {
    -    static char	buf[80];
         device_t	child;
         char	*code, *msg;
     
    @@ -1739,25 +1788,28 @@ twe_format_aen(struct twe_softc *sc, u_i
     
         case 'c':
     	if ((child = sc->twe_drive[TWE_AEN_UNIT(aen)].td_disk) != NULL) {
    -	    sprintf(buf, "twed%d: %s", device_get_unit(child), msg);
    +	    snprintf(sc->twe_aen_buf, sizeof(sc->twe_aen_buf), "twed%d: %s",
    +		device_get_unit(child), msg);
     	} else {
    -	    sprintf(buf, "twe%d: %s for unknown unit %d", device_get_unit(sc->twe_dev),
    -		    msg, TWE_AEN_UNIT(aen));
    +	    snprintf(sc->twe_aen_buf, sizeof(sc->twe_aen_buf),
    +		"twe%d: %s for unknown unit %d", device_get_unit(sc->twe_dev),
    +		msg, TWE_AEN_UNIT(aen));
     	}
    -	return(buf);
    +	return(sc->twe_aen_buf);
     
         case 'p':
    -	sprintf(buf, "twe%d: port %d: %s", device_get_unit(sc->twe_dev), TWE_AEN_UNIT(aen),
    -		msg);
    -	return(buf);
    +	snprintf(sc->twe_aen_buf, sizeof(sc->twe_aen_buf),
    +	    "twe%d: port %d: %s", device_get_unit(sc->twe_dev),
    +	    TWE_AEN_UNIT(aen), msg);
    +	return(sc->twe_aen_buf);
     
     	
         case 'x':
         default:
     	break;
         }
    -    sprintf(buf, "unknown AEN 0x%x", aen);
    -    return(buf);
    +    snprintf(sc->twe_aen_buf, sizeof(sc->twe_aen_buf), "unknown AEN 0x%x", aen);
    +    return(sc->twe_aen_buf);
     }
     
     /********************************************************************************
    
    Modified: stable/9/sys/dev/twe/twe_compat.h
    ==============================================================================
    --- stable/9/sys/dev/twe/twe_compat.h	Tue Feb 26 18:18:39 2013	(r247330)
    +++ stable/9/sys/dev/twe/twe_compat.h	Tue Feb 26 18:19:51 2013	(r247331)
    @@ -43,9 +43,13 @@
     #include 
     #include 
     #include 
    +#include 
     #include 
    +#include 
     #include 
    +#include 
     
    +#include 
     #include 
     #include 
     #include 
    @@ -58,6 +62,8 @@
     #include 
     #include 
     
    +#include 
    +
     #define TWE_DRIVER_NAME		twe
     #define TWED_DRIVER_NAME	twed
     #define TWE_MALLOC_CLASS	M_TWE
    @@ -65,10 +71,10 @@
     /* 
      * Wrappers for bus-space actions
      */
    -#define TWE_CONTROL(sc, val)		bus_space_write_4((sc)->twe_btag, (sc)->twe_bhandle, 0x0, (u_int32_t)val)
    -#define TWE_STATUS(sc)			(u_int32_t)bus_space_read_4((sc)->twe_btag, (sc)->twe_bhandle, 0x4)
    -#define TWE_COMMAND_QUEUE(sc, val)	bus_space_write_4((sc)->twe_btag, (sc)->twe_bhandle, 0x8, (u_int32_t)val)
    -#define TWE_RESPONSE_QUEUE(sc)		(TWE_Response_Queue)bus_space_read_4((sc)->twe_btag, (sc)->twe_bhandle, 0xc)
    +#define TWE_CONTROL(sc, val)		bus_write_4((sc)->twe_io, 0x0, (u_int32_t)val)
    +#define TWE_STATUS(sc)			(u_int32_t)bus_read_4((sc)->twe_io, 0x4)
    +#define TWE_COMMAND_QUEUE(sc, val)	bus_write_4((sc)->twe_io, 0x8, (u_int32_t)val)
    +#define TWE_RESPONSE_QUEUE(sc)		(TWE_Response_Queue)bus_read_4((sc)->twe_io, 0xc)
     
     /*
      * FreeBSD-specific softc elements
    @@ -79,8 +85,6 @@
         device_t			twe_dev;		/* bus device */		\
         struct cdev *twe_dev_t;		/* control device */		\
         struct resource		*twe_io;		/* register interface window */	\
    -    bus_space_handle_t		twe_bhandle;		/* bus space handle */		\
    -    bus_space_tag_t		twe_btag;		/* bus space tag */		\
         bus_dma_tag_t		twe_parent_dmat;	/* parent DMA tag */		\
         bus_dma_tag_t		twe_buffer_dmat;	/* data buffer DMA tag */	\
         bus_dma_tag_t		twe_cmd_dmat;		/* command buffer DMA tag */	\
    @@ -91,8 +95,8 @@
         void			*twe_cmd;		/* command structures */	\
         void			*twe_immediate;		/* immediate commands */	\
         bus_dmamap_t		twe_immediate_map;					\
    -    struct sysctl_ctx_list	sysctl_ctx;						\
    -    struct sysctl_oid		*sysctl_tree;
    +    struct mtx			twe_io_lock;						\
    +    struct sx			twe_config_lock;
     
     /*
      * FreeBSD-specific request elements
    @@ -107,52 +111,12 @@
     #define twe_printf(sc, fmt, args...)	device_printf(sc->twe_dev, fmt , ##args)
     #define twed_printf(twed, fmt, args...)	device_printf(twed->twed_dev, fmt , ##args)
     
    -#if __FreeBSD_version < 500003
    -# include 
    -# define INTR_ENTROPY			0
    -# define FREEBSD_4
    -
    -# include 			/* old buf style */
    -typedef struct buf			twe_bio;
    -typedef struct buf_queue_head		twe_bioq;
    -# define TWE_BIO_QINIT(bq)		bufq_init(&bq);
    -# define TWE_BIO_QINSERT(bq, bp)	bufq_insert_tail(&bq, bp)
    -# define TWE_BIO_QFIRST(bq)		bufq_first(&bq)
    -# define TWE_BIO_QREMOVE(bq, bp)	bufq_remove(&bq, bp)
    -# define TWE_BIO_IS_READ(bp)		((bp)->b_flags & B_READ)
    -# define TWE_BIO_DATA(bp)		(bp)->b_data
    -# define TWE_BIO_LENGTH(bp)		(bp)->b_bcount
    -# define TWE_BIO_LBA(bp)		(bp)->b_pblkno
    -# define TWE_BIO_SOFTC(bp)		(bp)->b_dev->si_drv1
    -# define TWE_BIO_UNIT(bp)		*(int *)((bp)->b_dev->si_drv2)
    -# define TWE_BIO_SET_ERROR(bp, err)	do { (bp)->b_error = err; (bp)->b_flags |= B_ERROR;} while(0)
    -# define TWE_BIO_HAS_ERROR(bp)		((bp)->b_flags & B_ERROR)
    -# define TWE_BIO_RESID(bp)		(bp)->b_resid
    -# define TWE_BIO_DONE(bp)		biodone(bp)
    -# define TWE_BIO_STATS_START(bp)	devstat_start_transaction(&((struct twed_softc *)TWE_BIO_SOFTC(bp))->twed_stats)
    -# define TWE_BIO_STATS_END(bp)		devstat_end_transaction_buf(&((struct twed_softc *)TWE_BIO_SOFTC(bp))->twed_stats, bp)
    -#else
    -# include 
    -# include 
    -typedef struct bio			twe_bio;
    -typedef struct bio_queue_head		twe_bioq;
    -# define TWE_BIO_QINIT(bq)		bioq_init(&bq);
    -# define TWE_BIO_QINSERT(bq, bp)	bioq_insert_tail(&bq, bp)
    -# define TWE_BIO_QFIRST(bq)		bioq_first(&bq)
    -# define TWE_BIO_QREMOVE(bq, bp)	bioq_remove(&bq, bp)
    -# define TWE_BIO_IS_READ(bp)		((bp)->bio_cmd == BIO_READ)
    -# define TWE_BIO_DATA(bp)		(bp)->bio_data
    -# define TWE_BIO_LENGTH(bp)		(bp)->bio_bcount
    -# define TWE_BIO_LBA(bp)		(bp)->bio_pblkno
    -# define TWE_BIO_SOFTC(bp)		(bp)->bio_disk->d_drv1
    -# define TWE_BIO_UNIT(bp)		*(int *)(bp->bio_driver1)
    -# define TWE_BIO_SET_ERROR(bp, err)	do { (bp)->bio_error = err; (bp)->bio_flags |= BIO_ERROR;} while(0)
    -# define TWE_BIO_HAS_ERROR(bp)		((bp)->bio_flags & BIO_ERROR)
    -# define TWE_BIO_RESID(bp)		(bp)->bio_resid
    -# define TWE_BIO_DONE(bp)		biodone(bp)
    -# define TWE_BIO_STATS_START(bp)
    -# define TWE_BIO_STATS_END(bp)
    -#endif
    +#define	TWE_IO_LOCK(sc)			mtx_lock(&(sc)->twe_io_lock)
    +#define	TWE_IO_UNLOCK(sc)		mtx_unlock(&(sc)->twe_io_lock)
    +#define	TWE_IO_ASSERT_LOCKED(sc)	mtx_assert(&(sc)->twe_io_lock, MA_OWNED)
    +#define	TWE_CONFIG_LOCK(sc)		sx_xlock(&(sc)->twe_config_lock)
    +#define	TWE_CONFIG_UNLOCK(sc)		sx_xunlock(&(sc)->twe_config_lock)
    +#define	TWE_CONFIG_ASSERT_LOCKED(sc)	sx_assert(&(sc)->twe_config_lock, SA_XLOCKED)
     
     #endif /* FreeBSD */
     
    
    Modified: stable/9/sys/dev/twe/twe_freebsd.c
    ==============================================================================
    --- stable/9/sys/dev/twe/twe_freebsd.c	Tue Feb 26 18:18:39 2013	(r247330)
    +++ stable/9/sys/dev/twe/twe_freebsd.c	Tue Feb 26 18:19:51 2013	(r247331)
    @@ -69,7 +69,6 @@ static	d_ioctl_t		twe_ioctl_wrapper;
     
     static struct cdevsw twe_cdevsw = {
     	.d_version =	D_VERSION,
    -	.d_flags =	D_NEEDGIANT,
     	.d_open =	twe_open,
     	.d_close =	twe_close,
     	.d_ioctl =	twe_ioctl_wrapper,
    @@ -84,7 +83,13 @@ twe_open(struct cdev *dev, int flags, in
     {
         struct twe_softc		*sc = (struct twe_softc *)dev->si_drv1;
     
    +    TWE_IO_LOCK(sc);
    +    if (sc->twe_state & TWE_STATE_DETACHING) {
    +	TWE_IO_UNLOCK(sc);
    +	return (ENXIO);
    +    }
         sc->twe_state |= TWE_STATE_OPEN;
    +    TWE_IO_UNLOCK(sc);
         return(0);
     }
     
    @@ -96,7 +101,9 @@ twe_close(struct cdev *dev, int flags, i
     {
         struct twe_softc		*sc = (struct twe_softc *)dev->si_drv1;
     
    +    TWE_IO_LOCK(sc);
         sc->twe_state &= ~TWE_STATE_OPEN;
    +    TWE_IO_UNLOCK(sc);
         return (0);
     }
     
    @@ -172,8 +179,8 @@ static int
     twe_attach(device_t dev)
     {
         struct twe_softc	*sc;
    +    struct sysctl_oid	*sysctl_tree;
         int			rid, error;
    -    u_int32_t		command;
     
         debug_called(4);
     
    @@ -182,32 +189,30 @@ twe_attach(device_t dev)
          */
         sc = device_get_softc(dev);
         sc->twe_dev = dev;
    +    mtx_init(&sc->twe_io_lock, "twe I/O", NULL, MTX_DEF);
    +    sx_init(&sc->twe_config_lock, "twe config");
     
    -    sysctl_ctx_init(&sc->sysctl_ctx);
    -    sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx,
    +    /*
    +     * XXX: This sysctl tree must stay at hw.tweX rather than using
    +     * the device_get_sysctl_tree() created by new-bus because
    +     * existing 3rd party binary tools such as tw_cli and 3dm2 use the
    +     * existence of this sysctl node to discover controllers.
    +     */
    +    sysctl_tree = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev),
     	SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO,
     	device_get_nameunit(dev), CTLFLAG_RD, 0, "");
    -    if (sc->sysctl_tree == NULL) {
    +    if (sysctl_tree == NULL) {
     	twe_printf(sc, "cannot add sysctl tree node\n");
     	return (ENXIO);
         }
    -    SYSCTL_ADD_STRING(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree),
    +    SYSCTL_ADD_STRING(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(sysctl_tree),
     	OID_AUTO, "driver_version", CTLFLAG_RD, TWE_DRIVER_VERSION_STRING, 0,
     	"TWE driver version");
     
         /*
    -     * Make sure we are going to be able to talk to this board.
    -     */
    -    command = pci_read_config(dev, PCIR_COMMAND, 2);
    -    if ((command & PCIM_CMD_PORTEN) == 0) {
    -	twe_printf(sc, "register window not available\n");
    -	return(ENXIO);
    -    }
    -    /*
          * Force the busmaster enable bit on, in case the BIOS forgot.
          */
    -    command |= PCIM_CMD_BUSMASTEREN;
    -    pci_write_config(dev, PCIR_COMMAND, command, 2);
    +    pci_enable_busmaster(dev);
     
         /*
          * Allocate the PCI register window.
    @@ -219,8 +224,6 @@ twe_attach(device_t dev)
     	twe_free(sc);
     	return(ENXIO);
         }
    -    sc->twe_btag = rman_get_bustag(sc->twe_io);
    -    sc->twe_bhandle = rman_get_bushandle(sc->twe_io);
     
         /*
          * Allocate the parent bus DMA tag appropriate for PCI.
    @@ -251,7 +254,7 @@ twe_attach(device_t dev)
     	twe_free(sc);
     	return(ENXIO);
         }
    -    if (bus_setup_intr(sc->twe_dev, sc->twe_irq, INTR_TYPE_BIO | INTR_ENTROPY,  
    +    if (bus_setup_intr(sc->twe_dev, sc->twe_irq, INTR_TYPE_BIO | INTR_ENTROPY | INTR_MPSAFE,  
     		       NULL, twe_pci_intr, sc, &sc->twe_intr)) {
     	twe_printf(sc, "can't set up interrupt\n");
     	twe_free(sc);
    @@ -302,7 +305,7 @@ twe_attach(device_t dev)
     			   BUS_SPACE_MAXSIZE_32BIT,	/* maxsegsize */
     			   BUS_DMA_ALLOCNOW,		/* flags */
     			   busdma_lock_mutex,		/* lockfunc */
    -			   &Giant,			/* lockarg */
    +			   &sc->twe_io_lock,		/* lockarg */
     			   &sc->twe_buffer_dmat)) {
     	twe_printf(sc, "can't allocate data buffer DMA tag\n");
     	twe_free(sc);
    @@ -424,7 +427,8 @@ twe_free(struct twe_softc *sc)
         if (sc->twe_dev_t != (struct cdev *)NULL)
     	destroy_dev(sc->twe_dev_t);
     
    -    sysctl_ctx_free(&sc->sysctl_ctx);
    +    sx_destroy(&sc->twe_config_lock);
    +    mtx_destroy(&sc->twe_io_lock);
     }
     
     /********************************************************************************
    @@ -434,27 +438,30 @@ static int
     twe_detach(device_t dev)
     {
         struct twe_softc	*sc = device_get_softc(dev);
    -    int			s, error;
     
         debug_called(4);
     
    -    error = EBUSY;
    -    s = splbio();
    -    if (sc->twe_state & TWE_STATE_OPEN)
    -	goto out;
    +    TWE_IO_LOCK(sc);
    +    if (sc->twe_state & TWE_STATE_OPEN) {
    +	TWE_IO_UNLOCK(sc);
    +	return (EBUSY);
    +    }
    +    sc->twe_state |= TWE_STATE_DETACHING;
    +    TWE_IO_UNLOCK(sc);
     
         /*	
          * Shut the controller down.
          */
    -    if (twe_shutdown(dev))
    -	goto out;
    +    if (twe_shutdown(dev)) {
    +	TWE_IO_LOCK(sc);
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 18:30:48 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 84CE4661;
     Tue, 26 Feb 2013 18:30:48 +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 5F2E0166B;
     Tue, 26 Feb 2013 18:30:48 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QIUlHV014978;
     Tue, 26 Feb 2013 18:30:47 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QIUlnS014977;
     Tue, 26 Feb 2013 18:30:47 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302261830.r1QIUlnS014977@svn.freebsd.org>
    From: John Baldwin 
    Date: Tue, 26 Feb 2013 18:30:47 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247332 - head/sys/dev/cpufreq
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 18:30:48 -0000
    
    Author: jhb
    Date: Tue Feb 26 18:30:47 2013
    New Revision: 247332
    URL: http://svnweb.freebsd.org/changeset/base/247332
    
    Log:
      Add a quirk to disable this driver for certain older laptops with an ICH2
      southbridge and an Intel 82815_MC host bridge where the host bridge's
      revision is less than 5.
      
      Tested by:	mi
      MFC after:	1 week
    
    Modified:
      head/sys/dev/cpufreq/ichss.c
    
    Modified: head/sys/dev/cpufreq/ichss.c
    ==============================================================================
    --- head/sys/dev/cpufreq/ichss.c	Tue Feb 26 18:19:51 2013	(r247331)
    +++ head/sys/dev/cpufreq/ichss.c	Tue Feb 26 18:30:47 2013	(r247332)
    @@ -67,7 +67,7 @@ struct ichss_softc {
     #define PCI_DEV_82801BA		0x244c /* ICH2M */
     #define PCI_DEV_82801CA		0x248c /* ICH3M */
     #define PCI_DEV_82801DB		0x24cc /* ICH4M */
    -#define PCI_DEV_82815BA		0x1130 /* Unsupported/buggy part */
    +#define PCI_DEV_82815_MC	0x1130 /* Unsupported/buggy part */
     
     /* PCI config registers for finding PMBASE and enabling SpeedStep. */
     #define ICHSS_PMBASE_OFFSET	0x40
    @@ -155,9 +155,6 @@ ichss_identify(driver_t *driver, device_
     	 * E.g. see Section 6.1 "PCI Devices and Functions" and table 6.1 of
     	 * Intel(r) 82801BA I/O Controller Hub 2 (ICH2) and Intel(r) 82801BAM
     	 * I/O Controller Hub 2 Mobile (ICH2-M).
    -	 *
    -	 * TODO: add a quirk to disable if we see the 82815_MC along
    -	 * with the 82801BA and revision < 5.
     	 */
     	ich_device = pci_find_bsf(0, 0x1f, 0);
     	if (ich_device == NULL ||
    @@ -167,6 +164,22 @@ ichss_identify(driver_t *driver, device_
     	    pci_get_device(ich_device) != PCI_DEV_82801DB))
     		return;
     
    +	/*
    +	 * Certain systems with ICH2 and an Intel 82815_MC host bridge
    +	 * where the host bridge's revision is < 5 lockup if SpeedStep
    +	 * is used.
    +	 */
    +	if (pci_get_device(ich_device) == PCI_DEV_82801BA) {
    +		device_t hostb;
    +
    +		hostb = pci_find_bsf(0, 0, 0);
    +		if (hostb != NULL &&
    +		    pci_get_vendor(hostb) == PCI_VENDOR_INTEL &&
    +		    pci_get_device(hostb) == PCI_DEV_82815_MC &&
    +		    pci_get_revid(hostb) < 5)
    +			return;
    +	}
    +
     	/* Find the PMBASE register from our PCI config header. */
     	pmbase = pci_read_config(ich_device, ICHSS_PMBASE_OFFSET,
     	    sizeof(pmbase));
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 18:31:05 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id B00247D7;
     Tue, 26 Feb 2013 18:31:05 +0000 (UTC) (envelope-from dim@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 515DB1674;
     Tue, 26 Feb 2013 18:31:05 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QIV4Zh016503;
     Tue, 26 Feb 2013 18:31:05 GMT (envelope-from dim@svn.freebsd.org)
    Received: (from dim@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QIV3J2016496;
     Tue, 26 Feb 2013 18:31:03 GMT (envelope-from dim@svn.freebsd.org)
    Message-Id: <201302261831.r1QIV3J2016496@svn.freebsd.org>
    From: Dimitry Andric 
    Date: Tue, 26 Feb 2013 18:31: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: r247333 - in stable/9: lib/libsm libexec/mail.local
     libexec/smrsh share/mk usr.bin/vacation usr.sbin/sendmail
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 18:31:05 -0000
    
    Author: dim
    Date: Tue Feb 26 18:31:03 2013
    New Revision: 247333
    URL: http://svnweb.freebsd.org/changeset/base/247333
    
    Log:
      MFC r246880:
      
      Since clang 3.2 now has an option to suppress warnings about implicitly
      promoted K&R parameters, remove the workarounds added for sendmail
      components in r228558.
    
    Modified:
      stable/9/lib/libsm/Makefile
      stable/9/libexec/mail.local/Makefile
      stable/9/libexec/smrsh/Makefile
      stable/9/share/mk/bsd.sys.mk   (contents, props changed)
      stable/9/usr.bin/vacation/Makefile
      stable/9/usr.sbin/sendmail/Makefile
    Directory Properties:
      stable/9/lib/libsm/   (props changed)
      stable/9/libexec/mail.local/   (props changed)
      stable/9/libexec/smrsh/   (props changed)
      stable/9/share/mk/   (props changed)
      stable/9/usr.bin/vacation/   (props changed)
      stable/9/usr.sbin/sendmail/   (props changed)
    
    Modified: stable/9/lib/libsm/Makefile
    ==============================================================================
    --- stable/9/lib/libsm/Makefile	Tue Feb 26 18:30:47 2013	(r247332)
    +++ stable/9/lib/libsm/Makefile	Tue Feb 26 18:31:03 2013	(r247333)
    @@ -18,11 +18,6 @@ CFLAGS+=${SENDMAIL_CFLAGS}
     
     WARNS?=	2
     
    -# Unfortunately, clang gives warnings about sendmail code that cannot
    -# be turned off yet.  Since this is contrib code, and we don't really
    -# care about the warnings, just make them non-fatal for now.
    -NO_WERROR.clang=
    -
     LIB=	sm
     
     SRCS+=	sm_os.h
    
    Modified: stable/9/libexec/mail.local/Makefile
    ==============================================================================
    --- stable/9/libexec/mail.local/Makefile	Tue Feb 26 18:30:47 2013	(r247332)
    +++ stable/9/libexec/mail.local/Makefile	Tue Feb 26 18:31:03 2013	(r247333)
    @@ -12,11 +12,6 @@ CFLAGS+=-I${SENDMAIL_DIR}/include -I.
     WARNS?=	2
     WFORMAT=0
     
    -# Unfortunately, clang gives warnings about sendmail code that cannot
    -# be turned off yet.  Since this is contrib code, and we don't really
    -# care about the warnings, just make them non-fatal for now.
    -NO_WERROR.clang=
    -
     LIBSMDIR=	${.OBJDIR}/../../lib/libsm
     LIBSM=		${LIBSMDIR}/libsm.a
     
    
    Modified: stable/9/libexec/smrsh/Makefile
    ==============================================================================
    --- stable/9/libexec/smrsh/Makefile	Tue Feb 26 18:30:47 2013	(r247332)
    +++ stable/9/libexec/smrsh/Makefile	Tue Feb 26 18:31:03 2013	(r247333)
    @@ -17,11 +17,6 @@ LDADD=	${LIBSM}
     
     WARNS?=	2
     
    -# Unfortunately, clang gives warnings about sendmail code that cannot
    -# be turned off yet.  Since this is contrib code, and we don't really
    -# care about the warnings, just make them non-fatal for now.
    -NO_WERROR.clang=
    -
     SRCS+=	sm_os.h
     CLEANFILES+=sm_os.h
     
    
    Modified: stable/9/share/mk/bsd.sys.mk
    ==============================================================================
    --- stable/9/share/mk/bsd.sys.mk	Tue Feb 26 18:30:47 2013	(r247332)
    +++ stable/9/share/mk/bsd.sys.mk	Tue Feb 26 18:31:03 2013	(r247333)
    @@ -72,7 +72,7 @@ CWARNFLAGS+=	-Wno-tautological-compare -
     		-Wno-parentheses-equality -Wno-unused-function -Wno-conversion
     .endif # WARNS <= 3
     .if ${WARNS} <= 2
    -CWARNFLAGS+=	-Wno-switch -Wno-switch-enum
    +CWARNFLAGS+=	-Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter
     .endif # WARNS <= 2
     .if ${WARNS} <= 1
     CWARNFLAGS+=	-Wno-parentheses
    
    Modified: stable/9/usr.bin/vacation/Makefile
    ==============================================================================
    --- stable/9/usr.bin/vacation/Makefile	Tue Feb 26 18:30:47 2013	(r247332)
    +++ stable/9/usr.bin/vacation/Makefile	Tue Feb 26 18:31:03 2013	(r247333)
    @@ -11,11 +11,6 @@ CFLAGS+=-D_FFR_LISTDB -D_FFR_DEBUG
     
     WARNS?=	2
     
    -# Unfortunately, clang gives warnings about sendmail code that cannot
    -# be turned off yet.  Since this is contrib code, and we don't really
    -# care about the warnings, just make them non-fatal for now.
    -NO_WERROR.clang=
    -
     LIBSMDIR=	${.OBJDIR}/../../lib/libsm
     LIBSM=		${LIBSMDIR}/libsm.a
     
    
    Modified: stable/9/usr.sbin/sendmail/Makefile
    ==============================================================================
    --- stable/9/usr.sbin/sendmail/Makefile	Tue Feb 26 18:30:47 2013	(r247332)
    +++ stable/9/usr.sbin/sendmail/Makefile	Tue Feb 26 18:31:03 2013	(r247333)
    @@ -45,11 +45,6 @@ CFLAGS+= -DNETINET6
     
     WARNS?=	1
     
    -# Unfortunately, clang gives warnings about sendmail code that cannot
    -# be turned off yet.  Since this is contrib code, and we don't really
    -# care about the warnings, just make them non-fatal for now.
    -NO_WERROR.clang=
    -
     DPADD=	${LIBUTIL} ${LIBWRAP}
     LDADD=	-lutil -lwrap
     
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 18:33:24 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 46859B64;
     Tue, 26 Feb 2013 18:33:24 +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 3939816D9;
     Tue, 26 Feb 2013 18:33:24 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QIXNQ7016869;
     Tue, 26 Feb 2013 18:33:24 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QIXNeJ016867;
     Tue, 26 Feb 2013 18:33:23 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201302261833.r1QIXNeJ016867@svn.freebsd.org>
    From: Xin LI 
    Date: Tue, 26 Feb 2013 18:33:23 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247334 - head/sys/dev/random
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 18:33:24 -0000
    
    Author: delphij
    Date: Tue Feb 26 18:33:23 2013
    New Revision: 247334
    URL: http://svnweb.freebsd.org/changeset/base/247334
    
    Log:
      Correct a typo introduced in r153575, which gives inverted logic when
      handling blocking semantics when seeding.
      
      PR:		kern/143298
      Submitted by:	James Juran 
      Reviewed by:	markm
      MFC after:	3 days
    
    Modified:
      head/sys/dev/random/randomdev_soft.c
    
    Modified: head/sys/dev/random/randomdev_soft.c
    ==============================================================================
    --- head/sys/dev/random/randomdev_soft.c	Tue Feb 26 18:31:03 2013	(r247333)
    +++ head/sys/dev/random/randomdev_soft.c	Tue Feb 26 18:33:23 2013	(r247334)
    @@ -391,7 +391,7 @@ random_yarrow_block(int flag)
     	mtx_lock(&random_reseed_mtx);
     
     	/* Blocking logic */
    -	while (random_systat.seeded && !error) {
    +	while (!random_systat.seeded && !error) {
     		if (flag & O_NONBLOCK)
     			error = EWOULDBLOCK;
     		else {
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 18:35:56 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 79243EC0;
     Tue, 26 Feb 2013 18:35:56 +0000 (UTC) (envelope-from jhb@freebsd.org)
    Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net
     [IPv6:2001:470:1f10:75::2])
     by mx1.freebsd.org (Postfix) with ESMTP id 55FFC1716;
     Tue, 26 Feb 2013 18:35:56 +0000 (UTC)
    Received: from jhbbsd.localnet (unknown [209.249.190.124])
     by bigwig.baldwin.cx (Postfix) with ESMTPSA id 84E42B958;
     Tue, 26 Feb 2013 13:35:55 -0500 (EST)
    From: John Baldwin 
    To: Davide Italiano 
    Subject: Re: svn commit: r247300 - in head: sys/sys usr.bin/truss
    Date: Tue, 26 Feb 2013 13:35:30 -0500
    User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; )
    References: <201302260213.r1Q2D2N1016801@svn.freebsd.org>
     <201302260941.52534.jhb@freebsd.org>
     
    In-Reply-To: 
    MIME-Version: 1.0
    Content-Type: Text/Plain;
      charset="iso-8859-1"
    Content-Transfer-Encoding: 7bit
    Message-Id: <201302261335.38001.jhb@freebsd.org>
    X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
     (bigwig.baldwin.cx); Tue, 26 Feb 2013 13:35:55 -0500 (EST)
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org, Xin LI 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 18:35:56 -0000
    
    On Tuesday, February 26, 2013 12:09:42 pm Davide Italiano wrote:
    > On Tue, Feb 26, 2013 at 3:41 PM, John Baldwin  wrote:
    > > On Monday, February 25, 2013 9:13:02 pm Xin LI wrote:
    > >> Author: delphij
    > >> Date: Tue Feb 26 02:13:02 2013
    > >> New Revision: 247300
    > >> URL: http://svnweb.freebsd.org/changeset/base/247300
    > >>
    > >> Log:
    > >>   Expose timespec and timeval macros when __BSD_VISIBLE is defined.  This
    > >>   allows userland application to use the following macros:
    > >>
    > >>       timespecclear, timespecisset, timespeccmp, timespecadd,
    > >>       timespecsub;
    > >>
    > >>       timevalclear, timevalisset, timevalcmp.
    > >
    > > Why not fix truss to use the stock functions instead of keeping private
    > > "unusual" versions?
    > >
    > > --
    > > John Baldwin
    > 
    > time.h is already a mess in terms of namespace pollution, and this
    > exposure might not help thing.
    > Other details here:
    > http://permalink.gmane.org/gmane.os.freebsd.architechture/15518
    
    I think that is orthogonal.  Even if this is reverted I think truss should
    be changed to use the "normal" timespecsubt() macro rather than using a custom
    one with a different argument order.
    
    -- 
    John Baldwin
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 18:51:14 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id E475B79E;
     Tue, 26 Feb 2013 18:51:14 +0000 (UTC)
     (envelope-from davide.italiano@gmail.com)
    Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com
     [209.85.212.179])
     by mx1.freebsd.org (Postfix) with ESMTP id E50F718C0;
     Tue, 26 Feb 2013 18:51:13 +0000 (UTC)
    Received: by mail-wi0-f179.google.com with SMTP id ez12so5079285wid.6
     for ; Tue, 26 Feb 2013 10:51:11 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
     h=mime-version:x-received:sender:in-reply-to:references:date
     :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
     bh=o0Dgv56Bs0MTBBC97rngr6PBxxuvxwY2J792oBLqUZQ=;
     b=JwJJgeV3b+RPznHMTKPf7Nk3hsiOnej75lB0lYHY3plvdBfaPJ99AeNkfgDJ026Uos
     U26P2aGrnId5git9pgwsSw4Bkh8jCyOC4wj1HVqCfflTDv9TmgUX71uaM6waZZz5JpJv
     6e5pGxkhF3ZD1VBfxrL8X+fhFfvCDkK4yXZw/+FrJkMXyWOMG4OSzXOAH7d2eKFHJ5c1
     aqmrQPmzUQGub3WkEnbNiWcvWufkyz/0GlaBTwHNcIX+DZAvDNvIvP3Br3VeOovKYaj6
     3knFWPhLMSHmBJXH7fGWshLeCLxKD5jPkkq8aCrFlbeokMOa76HfiVVkXFMER6zF36qq
     y2pA==
    MIME-Version: 1.0
    X-Received: by 10.194.62.170 with SMTP id z10mr28564266wjr.34.1361904671500;
     Tue, 26 Feb 2013 10:51:11 -0800 (PST)
    Sender: davide.italiano@gmail.com
    Received: by 10.180.105.197 with HTTP; Tue, 26 Feb 2013 10:51:11 -0800 (PST)
    In-Reply-To: <201302261335.38001.jhb@freebsd.org>
    References: <201302260213.r1Q2D2N1016801@svn.freebsd.org>
     <201302260941.52534.jhb@freebsd.org>
     
     <201302261335.38001.jhb@freebsd.org>
    Date: Tue, 26 Feb 2013 19:51:11 +0100
    X-Google-Sender-Auth: ozRWSi6Josxuw9Na7wrIZN2XLPg
    Message-ID: 
    Subject: Re: svn commit: r247300 - in head: sys/sys usr.bin/truss
    From: Davide Italiano 
    To: John Baldwin 
    Content-Type: text/plain; charset=ISO-8859-1
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org, Xin LI 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 18:51:15 -0000
    
    On Tue, Feb 26, 2013 at 7:35 PM, John Baldwin  wrote:
    > On Tuesday, February 26, 2013 12:09:42 pm Davide Italiano wrote:
    >> On Tue, Feb 26, 2013 at 3:41 PM, John Baldwin  wrote:
    >> > On Monday, February 25, 2013 9:13:02 pm Xin LI wrote:
    >> >> Author: delphij
    >> >> Date: Tue Feb 26 02:13:02 2013
    >> >> New Revision: 247300
    >> >> URL: http://svnweb.freebsd.org/changeset/base/247300
    >> >>
    >> >> Log:
    >> >>   Expose timespec and timeval macros when __BSD_VISIBLE is defined.  This
    >> >>   allows userland application to use the following macros:
    >> >>
    >> >>       timespecclear, timespecisset, timespeccmp, timespecadd,
    >> >>       timespecsub;
    >> >>
    >> >>       timevalclear, timevalisset, timevalcmp.
    >> >
    >> > Why not fix truss to use the stock functions instead of keeping private
    >> > "unusual" versions?
    >> >
    >> > --
    >> > John Baldwin
    >>
    >> time.h is already a mess in terms of namespace pollution, and this
    >> exposure might not help thing.
    >> Other details here:
    >> http://permalink.gmane.org/gmane.os.freebsd.architechture/15518
    >
    > I think that is orthogonal.  Even if this is reverted I think truss should
    > be changed to use the "normal" timespecsubt() macro rather than using a custom
    > one with a different argument order.
    >
    > --
    > John Baldwin
    
    When I talked about "exposure" I referred about timeval/timespec
    macros(). I wasn't arguing about your proposed change.
    Sorry if it wasn't clear.
    
    -- 
    Davide
    
    "There are no solved problems; there are only problems that are more
    or less solved" -- Henri Poincare
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 19:04:00 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 628EEBD2;
     Tue, 26 Feb 2013 19:04:00 +0000 (UTC)
     (envelope-from delphij@delphij.net)
    Received: from anubis.delphij.net (anubis.delphij.net
     [IPv6:2001:470:1:117::25])
     by mx1.freebsd.org (Postfix) with ESMTP id 314B91968;
     Tue, 26 Feb 2013 19:04:00 +0000 (UTC)
    Received: from epsilon.delphij.net (drawbridge.ixsystems.com [206.40.55.65])
     (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
     (No client certificate requested)
     by anubis.delphij.net (Postfix) with ESMTPSA id DF46C24B56;
     Tue, 26 Feb 2013 11:03:58 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis;
     t=1361905439; bh=kY3OIAUOgUHZOQlhwBzzUzVNEbR6mdU9q33ZdFzlrQE=;
     h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To;
     b=BaGr7LYSWfXz4IX8Yd2sSFzTrp8J+ohKBURJvziLSEdvCgYSPnZiN1/j+n7yH2xI7
     70UOzp0NOKsjlmpj03+LUK2J8uMMm2yjg/FZ10kbr5imbLiUJVJxZDUOiIV2dHQGOL
     RsYL8r7tNFW2q3pp1YUU1TNhKsdKv0NkEU5bWjHM=
    Message-ID: <512D071E.8090306@delphij.net>
    Date: Tue, 26 Feb 2013 11:03:58 -0800
    From: Xin Li 
    Organization: The FreeBSD Project
    MIME-Version: 1.0
    To: Davide Italiano 
    Subject: Re: svn commit: r247300 - in head: sys/sys usr.bin/truss
    References: <201302260213.r1Q2D2N1016801@svn.freebsd.org>
     <201302260941.52534.jhb@freebsd.org>
     
    In-Reply-To: 
    X-Enigmail-Version: 1.5.1
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: 7bit
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org, Xin LI ,
     John Baldwin 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    Reply-To: d@delphij.net
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 19:04:00 -0000
    
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    On 02/26/13 09:09, Davide Italiano wrote:
    > On Tue, Feb 26, 2013 at 3:41 PM, John Baldwin 
    > wrote:
    >> On Monday, February 25, 2013 9:13:02 pm Xin LI wrote:
    >>> Author: delphij Date: Tue Feb 26 02:13:02 2013 New Revision:
    >>> 247300 URL: http://svnweb.freebsd.org/changeset/base/247300
    >>> 
    >>> Log: Expose timespec and timeval macros when __BSD_VISIBLE is
    >>> defined.  This allows userland application to use the following
    >>> macros:
    >>> 
    >>> timespecclear, timespecisset, timespeccmp, timespecadd, 
    >>> timespecsub;
    >>> 
    >>> timevalclear, timevalisset, timevalcmp.
    >> 
    >> Why not fix truss to use the stock functions instead of keeping
    >> private "unusual" versions?
    >> 
    >> -- John Baldwin
    > 
    > time.h is already a mess in terms of namespace pollution, and this 
    > exposure might not help thing. Other details here: 
    > http://permalink.gmane.org/gmane.os.freebsd.architechture/15518
    
    What would be the preferred way of doing these operations on a
    timespec structure then?  Should the caller duplicate these macros?
    
    Cheers,
    - -- 
    Xin LI     https://www.delphij.net/
    FreeBSD - The Power to Serve!           Live free or die
    -----BEGIN PGP SIGNATURE-----
    
    iQEcBAEBCgAGBQJRLQceAAoJEG80Jeu8UPuzYQIIAIf9vJ6TS2Lmk+vkC0O9oXFi
    1W+msaOn/Onhi9TSbpdPlhfQI2VB8bkdDCA63ll3LC64jjDaRObobSYxYn7mKhz9
    +o0sdRXl8AvDkHNofSmrtO0h3JormzJjGIxNLi0DsTgrUDuOiVT34WtzTY6uvvnG
    Y4zpxoY/KI9ftaAabxhfTG8RcMkWbAHrQXmah/UujuMID57665I0NwxBap5lyyng
    lMygEBfAZ8bZqbh2IcUZi9qKBsIkFJugxYZc95WkU73A4rCGBJSJXpYWAghJxthy
    nDHNA6I5DxoeXpf3hEscG4WjHgLubZen8HwEs/3uA4mRkmAkI7pwT56wo7kVnwU=
    =JZjk
    -----END PGP SIGNATURE-----
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 19:04:55 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id C51E8D4A;
     Tue, 26 Feb 2013 19:04:55 +0000 (UTC)
     (envelope-from delphij@delphij.net)
    Received: from anubis.delphij.net (anubis.delphij.net
     [IPv6:2001:470:1:117::25])
     by mx1.freebsd.org (Postfix) with ESMTP id 8ADBE1971;
     Tue, 26 Feb 2013 19:04:55 +0000 (UTC)
    Received: from epsilon.delphij.net (drawbridge.ixsystems.com [206.40.55.65])
     (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
     (No client certificate requested)
     by anubis.delphij.net (Postfix) with ESMTPSA id 30ABA24B71;
     Tue, 26 Feb 2013 11:04:55 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis;
     t=1361905495; bh=Yc28KuYhkm0Yqc5QGF0PcqvRGjuwkqFdj6trrVQpRV8=;
     h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To;
     b=RohULJJfMIksDuYSDcq01w3KJu1aj3qmJUmz/tC3vq5W0Il7LoXA8hlrWYJURIzu+
     qu5X5xExFDRdSadBEBxCA/WcG33jvu24nB9Wr5PIcPjV0JrB0diFvvdzg21bpsSegR
     geSJS9a1rBOR/nbW1Jk9k2yD8NOy/VbR0RRBNR6c=
    Message-ID: <512D0756.80804@delphij.net>
    Date: Tue, 26 Feb 2013 11:04:54 -0800
    From: Xin Li 
    Organization: The FreeBSD Project
    MIME-Version: 1.0
    To: John Baldwin 
    Subject: Re: svn commit: r247300 - in head: sys/sys usr.bin/truss
    References: <201302260213.r1Q2D2N1016801@svn.freebsd.org>
     <201302260941.52534.jhb@freebsd.org>
     
     <201302261335.38001.jhb@freebsd.org>
    In-Reply-To: <201302261335.38001.jhb@freebsd.org>
    X-Enigmail-Version: 1.5.1
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: 7bit
    Cc: Davide Italiano , svn-src-head@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org,
     Xin LI 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    Reply-To: d@delphij.net
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 19:04:55 -0000
    
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    On 02/26/13 10:35, John Baldwin wrote:
    > On Tuesday, February 26, 2013 12:09:42 pm Davide Italiano wrote:
    >> On Tue, Feb 26, 2013 at 3:41 PM, John Baldwin 
    >> wrote:
    >>> On Monday, February 25, 2013 9:13:02 pm Xin LI wrote:
    >>>> Author: delphij Date: Tue Feb 26 02:13:02 2013 New Revision:
    >>>> 247300 URL: http://svnweb.freebsd.org/changeset/base/247300
    >>>> 
    >>>> Log: Expose timespec and timeval macros when __BSD_VISIBLE is
    >>>> defined.  This allows userland application to use the
    >>>> following macros:
    >>>> 
    >>>> timespecclear, timespecisset, timespeccmp, timespecadd, 
    >>>> timespecsub;
    >>>> 
    >>>> timevalclear, timevalisset, timevalcmp.
    >>> 
    >>> Why not fix truss to use the stock functions instead of keeping
    >>> private "unusual" versions?
    >>> 
    >>> -- John Baldwin
    >> 
    >> time.h is already a mess in terms of namespace pollution, and
    >> this exposure might not help thing. Other details here: 
    >> http://permalink.gmane.org/gmane.os.freebsd.architechture/15518
    > 
    > I think that is orthogonal.  Even if this is reverted I think truss
    > should be changed to use the "normal" timespecsubt() macro rather
    > than using a custom one with a different argument order.
    
    I'll find a way to solve this and post a patch for review, thanks for
    your comments.
    
    Cheers,
    - -- 
    Xin LI     https://www.delphij.net/
    FreeBSD - The Power to Serve!           Live free or die
    -----BEGIN PGP SIGNATURE-----
    
    iQEcBAEBCgAGBQJRLQdWAAoJEG80Jeu8UPuzpQ0H/1wxy58rK+p/jx2sZtFIhxCA
    j6H/xQ0nNqthVBW2rw0gwiaUgU1AfcAtdfz7/lFopsvbGFoxzQFYUyC4U67JhSk6
    IOgElmtjfFMfvj0ksQnEtIGPMYFbc5G4AHfmmwu4f9cjEPBQz3rPssybGqFvJjO+
    tUs7I6tYsq5Lnu9ltjDXgBcNHblgjFqz0jMZ/Rysdu4+51Mga5akyV2D6OFbcbNG
    oYzC5OOJFvnw6lV+bCVh/ZQNjvEE/Z+YUhfT66MlmU9CBDM9TlYCl7F+5/snZiZ4
    0xVFDUIglQqHXkaA1DtP7+HGfVtYhDvO3BgOUe+fHieFxkQFsiEATO4YUImZTKE=
    =KUVT
    -----END PGP SIGNATURE-----
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 19:14:06 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id C107A121;
     Tue, 26 Feb 2013 19:14:06 +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 909E719EC;
     Tue, 26 Feb 2013 19:14:06 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QJE6LD029161;
     Tue, 26 Feb 2013 19:14:06 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QJE6qP029159;
     Tue, 26 Feb 2013 19:14:06 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302261914.r1QJE6qP029159@svn.freebsd.org>
    From: John Baldwin 
    Date: Tue, 26 Feb 2013 19: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: r247335 - stable/9/sbin/dhclient
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 19:14:06 -0000
    
    Author: jhb
    Date: Tue Feb 26 19:14:05 2013
    New Revision: 247335
    URL: http://svnweb.freebsd.org/changeset/base/247335
    
    Log:
      MFC 239356,239564:
      Teach dhclient to track changes in link state and to enter the reboot
      state when the link on an interface goes up causing dhclient to attempt
      to renew its existing lease.
      
      PR:		bin/166656
    
    Modified:
      stable/9/sbin/dhclient/dhclient.c
      stable/9/sbin/dhclient/dhcpd.h
    Directory Properties:
      stable/9/sbin/dhclient/   (props changed)
    
    Modified: stable/9/sbin/dhclient/dhclient.c
    ==============================================================================
    --- stable/9/sbin/dhclient/dhclient.c	Tue Feb 26 18:33:23 2013	(r247334)
    +++ stable/9/sbin/dhclient/dhclient.c	Tue Feb 26 19:14:05 2013	(r247335)
    @@ -218,6 +218,7 @@ routehandler(struct protocol *p)
     	struct sockaddr *sa;
     	struct iaddr a;
     	ssize_t n;
    +	int linkstat;
     
     	n = read(routefd, &msg, sizeof(msg));
     	rtm = (struct rt_msghdr *)msg;
    @@ -278,6 +279,15 @@ routehandler(struct protocol *p)
     			    ifi->name);
     			goto die;
     		}
    +		linkstat = interface_link_status(ifi->name);
    +		if (linkstat != ifi->linkstat) {
    +			debug("%s link state %s -> %s", ifi->name,
    +			    ifi->linkstat ? "up" : "down",
    +			    linkstat ? "up" : "down");
    +			ifi->linkstat = linkstat;
    +			if (linkstat)
    +				state_reboot(ifi);
    +		}
     		break;
     	case RTM_IFANNOUNCE:
     		ifan = (struct if_announcemsghdr *)rtm;
    @@ -430,6 +440,7 @@ main(int argc, char *argv[])
     		}
     		fprintf(stderr, " got link\n");
     	}
    +	ifi->linkstat = 1;
     
     	if ((nullfd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1)
     		error("cannot open %s: %m", _PATH_DEVNULL);
    
    Modified: stable/9/sbin/dhclient/dhcpd.h
    ==============================================================================
    --- stable/9/sbin/dhclient/dhcpd.h	Tue Feb 26 18:33:23 2013	(r247334)
    +++ stable/9/sbin/dhclient/dhcpd.h	Tue Feb 26 19:14:05 2013	(r247335)
    @@ -208,6 +208,7 @@ struct interface_info {
     	int			 errors;
     	int			 dead;
     	u_int16_t		 index;
    +	int			 linkstat;
     };
     
     struct timeout {
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 19:14:30 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id E21BC28B;
     Tue, 26 Feb 2013 19:14:30 +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 BC42119F0;
     Tue, 26 Feb 2013 19:14:30 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QJEUNI029260;
     Tue, 26 Feb 2013 19:14:30 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QJEUmp029257;
     Tue, 26 Feb 2013 19:14:30 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302261914.r1QJEUmp029257@svn.freebsd.org>
    From: John Baldwin 
    Date: Tue, 26 Feb 2013 19:14:30 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247336 - stable/8/sbin/dhclient
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 19:14:31 -0000
    
    Author: jhb
    Date: Tue Feb 26 19:14:29 2013
    New Revision: 247336
    URL: http://svnweb.freebsd.org/changeset/base/247336
    
    Log:
      MFC 239356,239564:
      Teach dhclient to track changes in link state and to enter the reboot
      state when the link on an interface goes up causing dhclient to attempt
      to renew its existing lease.
      
      PR:		bin/166656
    
    Modified:
      stable/8/sbin/dhclient/dhclient.c
      stable/8/sbin/dhclient/dhcpd.h
    Directory Properties:
      stable/8/sbin/dhclient/   (props changed)
    
    Modified: stable/8/sbin/dhclient/dhclient.c
    ==============================================================================
    --- stable/8/sbin/dhclient/dhclient.c	Tue Feb 26 19:14:05 2013	(r247335)
    +++ stable/8/sbin/dhclient/dhclient.c	Tue Feb 26 19:14:29 2013	(r247336)
    @@ -218,6 +218,7 @@ routehandler(struct protocol *p)
     	struct sockaddr *sa;
     	struct iaddr a;
     	ssize_t n;
    +	int linkstat;
     
     	n = read(routefd, &msg, sizeof(msg));
     	rtm = (struct rt_msghdr *)msg;
    @@ -278,6 +279,15 @@ routehandler(struct protocol *p)
     			    ifi->name);
     			goto die;
     		}
    +		linkstat = interface_link_status(ifi->name);
    +		if (linkstat != ifi->linkstat) {
    +			debug("%s link state %s -> %s", ifi->name,
    +			    ifi->linkstat ? "up" : "down",
    +			    linkstat ? "up" : "down");
    +			ifi->linkstat = linkstat;
    +			if (linkstat)
    +				state_reboot(ifi);
    +		}
     		break;
     	case RTM_IFANNOUNCE:
     		ifan = (struct if_announcemsghdr *)rtm;
    @@ -430,6 +440,7 @@ main(int argc, char *argv[])
     		}
     		fprintf(stderr, " got link\n");
     	}
    +	ifi->linkstat = 1;
     
     	if ((nullfd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1)
     		error("cannot open %s: %m", _PATH_DEVNULL);
    
    Modified: stable/8/sbin/dhclient/dhcpd.h
    ==============================================================================
    --- stable/8/sbin/dhclient/dhcpd.h	Tue Feb 26 19:14:05 2013	(r247335)
    +++ stable/8/sbin/dhclient/dhcpd.h	Tue Feb 26 19:14:29 2013	(r247336)
    @@ -208,6 +208,7 @@ struct interface_info {
     	int			 errors;
     	int			 dead;
     	u_int16_t		 index;
    +	int			 linkstat;
     };
     
     struct timeout {
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 19:46:03 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id B556AA4F;
     Tue, 26 Feb 2013 19:46:03 +0000 (UTC) (envelope-from jmg@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 8FFBE1B84;
     Tue, 26 Feb 2013 19:46:03 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QJk340038119;
     Tue, 26 Feb 2013 19:46:03 GMT (envelope-from jmg@svn.freebsd.org)
    Received: (from jmg@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QJk3DW038118;
     Tue, 26 Feb 2013 19:46:03 GMT (envelope-from jmg@svn.freebsd.org)
    Message-Id: <201302261946.r1QJk3DW038118@svn.freebsd.org>
    From: John-Mark Gurney 
    Date: Tue, 26 Feb 2013 19:46:03 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247337 - head/lib/libkiconv
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 19:46:03 -0000
    
    Author: jmg
    Date: Tue Feb 26 19:46:02 2013
    New Revision: 247337
    URL: http://svnweb.freebsd.org/changeset/base/247337
    
    Log:
      no one bothered to write the iconv.9 man page...  If it appears we
      can readd the xref...
      
      MFC:	1 week
    
    Modified:
      head/lib/libkiconv/kiconv.3
    
    Modified: head/lib/libkiconv/kiconv.3
    ==============================================================================
    --- head/lib/libkiconv/kiconv.3	Tue Feb 26 19:14:29 2013	(r247336)
    +++ head/lib/libkiconv/kiconv.3	Tue Feb 26 19:46:02 2013	(r247337)
    @@ -126,5 +126,4 @@ not using
     .Sh SEE ALSO
     .Xr iconv 3 ,
     .Xr tolower 3 ,
    -.Xr toupper 3 ,
    -.Xr iconv 9
    +.Xr toupper 3
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 19:47:00 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 7DCACBDF;
     Tue, 26 Feb 2013 19:47:00 +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 5810E1BA1;
     Tue, 26 Feb 2013 19:47:00 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QJl0MZ038287;
     Tue, 26 Feb 2013 19:47:00 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QJkxcK038276;
     Tue, 26 Feb 2013 19:46:59 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201302261946.r1QJkxcK038276@svn.freebsd.org>
    From: Xin LI 
    Date: Tue, 26 Feb 2013 19:46:59 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247338 - in head: sys/sys usr.bin/truss
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 19:47:00 -0000
    
    Author: delphij
    Date: Tue Feb 26 19:46:59 2013
    New Revision: 247338
    URL: http://svnweb.freebsd.org/changeset/base/247338
    
    Log:
      Revert r247300 for now.  I'll post a new changeset for review.
    
    Modified:
      head/sys/sys/time.h
      head/usr.bin/truss/main.c
      head/usr.bin/truss/syscalls.c
      head/usr.bin/truss/truss.h
    
    Modified: head/sys/sys/time.h
    ==============================================================================
    --- head/sys/sys/time.h	Tue Feb 26 19:46:02 2013	(r247337)
    +++ head/sys/sys/time.h	Tue Feb 26 19:46:59 2013	(r247338)
    @@ -156,6 +156,9 @@ timeval2bintime(const struct timeval *tv
     	/* 18446744073709 = int(2^64 / 1000000) */
     	bt->frac = tv->tv_usec * (uint64_t)18446744073709LL;
     }
    +#endif /* __BSD_VISIBLE */
    +
    +#ifdef _KERNEL
     
     /* Operations on timespecs */
     #define	timespecclear(tvp)	((tvp)->tv_sec = (tvp)->tv_nsec = 0)
    @@ -194,7 +197,7 @@ timeval2bintime(const struct timeval *tv
     
     /* timevaladd and timevalsub are not inlined */
     
    -#endif /* __BSD_VISIBLE */
    +#endif /* _KERNEL */
     
     #ifndef _KERNEL			/* NetBSD/OpenBSD compatible interfaces */
     
    
    Modified: head/usr.bin/truss/main.c
    ==============================================================================
    --- head/usr.bin/truss/main.c	Tue Feb 26 19:46:02 2013	(r247337)
    +++ head/usr.bin/truss/main.c	Tue Feb 26 19:46:59 2013	(r247338)
    @@ -323,14 +323,14 @@ START_TRACE:
     				fprintf(trussinfo->outfile, "%5d: ",
     				    trussinfo->pid);
     			if (trussinfo->flags & ABSOLUTETIMESTAMPS) {
    -				timespecsubt_to(&trussinfo->curthread->after,
    +				timespecsubt(&trussinfo->curthread->after,
     				    &trussinfo->start_time, &timediff);
     				fprintf(trussinfo->outfile, "%ld.%09ld ",
     				    (long)timediff.tv_sec,
     				    timediff.tv_nsec);
     			}
     			if (trussinfo->flags & RELATIVETIMESTAMPS) {
    -				timespecsubt_to(&trussinfo->curthread->after,
    +				timespecsubt(&trussinfo->curthread->after,
     				    &trussinfo->curthread->before, &timediff);
     				fprintf(trussinfo->outfile, "%ld.%09ld ",
     				    (long)timediff.tv_sec,
    @@ -349,14 +349,14 @@ START_TRACE:
     				fprintf(trussinfo->outfile, "%5d: ",
     				    trussinfo->pid);
     			if (trussinfo->flags & ABSOLUTETIMESTAMPS) {
    -				timespecsubt_to(&trussinfo->curthread->after,
    +				timespecsubt(&trussinfo->curthread->after,
     				    &trussinfo->start_time, &timediff);
     				fprintf(trussinfo->outfile, "%ld.%09ld ",
     				    (long)timediff.tv_sec,
     				    timediff.tv_nsec);
     			}
     			if (trussinfo->flags & RELATIVETIMESTAMPS) {
    -				timespecsubt_to(&trussinfo->curthread->after,
    +				timespecsubt(&trussinfo->curthread->after,
     				    &trussinfo->curthread->before, &timediff);
     				fprintf(trussinfo->outfile, "%ld.%09ld ",
     				    (long)timediff.tv_sec, timediff.tv_nsec);
    
    Modified: head/usr.bin/truss/syscalls.c
    ==============================================================================
    --- head/usr.bin/truss/syscalls.c	Tue Feb 26 19:46:02 2013	(r247337)
    +++ head/usr.bin/truss/syscalls.c	Tue Feb 26 19:46:59 2013	(r247338)
    @@ -1126,14 +1126,14 @@ print_syscall(struct trussinfo *trussinf
     	}
     
     	if (trussinfo->flags & ABSOLUTETIMESTAMPS) {
    -		timespecsubt_to(&trussinfo->curthread->after,
    +		timespecsubt(&trussinfo->curthread->after,
     		    &trussinfo->start_time, &timediff);
     		len += fprintf(trussinfo->outfile, "%ld.%09ld ",
     		    (long)timediff.tv_sec, timediff.tv_nsec);
     	}
     
     	if (trussinfo->flags & RELATIVETIMESTAMPS) {
    -		timespecsubt_to(&trussinfo->curthread->after,
    +		timespecsubt(&trussinfo->curthread->after,
     		    &trussinfo->curthread->before, &timediff);
     		len += fprintf(trussinfo->outfile, "%ld.%09ld ",
     		    (long)timediff.tv_sec, timediff.tv_nsec);
    @@ -1165,9 +1165,9 @@ print_syscall_ret(struct trussinfo *trus
     		if (!sc)
     			return;
     		clock_gettime(CLOCK_REALTIME, &trussinfo->curthread->after);
    -		timespecsubt_to(&trussinfo->curthread->after,
    +		timespecsubt(&trussinfo->curthread->after,
     		    &trussinfo->curthread->before, &timediff);
    -		timespecadd_to(&sc->time, &timediff, &sc->time);
    +		timespecadd(&sc->time, &timediff, &sc->time);
     		sc->ncalls++;
     		if (errorp)
     			sc->nerror++;
    @@ -1205,7 +1205,7 @@ print_summary(struct trussinfo *trussinf
     			fprintf(trussinfo->outfile, "%-20s%5jd.%09ld%8d%8d\n",
     			    sc->name, (intmax_t)sc->time.tv_sec,
     			    sc->time.tv_nsec, sc->ncalls, sc->nerror);
    -			timespecadd_to(&total, &sc->time, &total);
    +			timespecadd(&total, &sc->time, &total);
     			ncall += sc->ncalls;
     			nerror += sc->nerror;
     		}
    
    Modified: head/usr.bin/truss/truss.h
    ==============================================================================
    --- head/usr.bin/truss/truss.h	Tue Feb 26 19:46:02 2013	(r247337)
    +++ head/usr.bin/truss/truss.h	Tue Feb 26 19:46:59 2013	(r247338)
    @@ -62,7 +62,7 @@ struct trussinfo
     	SLIST_HEAD(, threadinfo) threadlist;
     };
     
    -#define	timespecsubt_to(tvp, uvp, vvp)					\
    +#define	timespecsubt(tvp, uvp, vvp)					\
     	do {								\
     		(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec;		\
     		(vvp)->tv_nsec = (tvp)->tv_nsec - (uvp)->tv_nsec;	\
    @@ -72,7 +72,7 @@ struct trussinfo
     		}							\
     	} while (0)
     
    -#define	timespecadd_to(tvp, uvp, vvp)					\
    +#define	timespecadd(tvp, uvp, vvp)					\
     	do {								\
     		(vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec;		\
     		(vvp)->tv_nsec = (tvp)->tv_nsec + (uvp)->tv_nsec;	\
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 19:58:49 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id B8F6DE3A;
     Tue, 26 Feb 2013 19:58:49 +0000 (UTC)
     (envelope-from cognet@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 95F421C15;
     Tue, 26 Feb 2013 19:58:49 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QJwnNE041413;
     Tue, 26 Feb 2013 19:58:49 GMT (envelope-from cognet@svn.freebsd.org)
    Received: (from cognet@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QJwn0x041412;
     Tue, 26 Feb 2013 19:58:49 GMT (envelope-from cognet@svn.freebsd.org)
    Message-Id: <201302261958.r1QJwn0x041412@svn.freebsd.org>
    From: Olivier Houchard 
    Date: Tue, 26 Feb 2013 19:58:49 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247339 - head/sys/arm/arm
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 19:58:49 -0000
    
    Author: cognet
    Date: Tue Feb 26 19:58:49 2013
    New Revision: 247339
    URL: http://svnweb.freebsd.org/changeset/base/247339
    
    Log:
      Don't forget to init the VFP stuff for all cores.
    
    Modified:
      head/sys/arm/arm/mp_machdep.c
    
    Modified: head/sys/arm/arm/mp_machdep.c
    ==============================================================================
    --- head/sys/arm/arm/mp_machdep.c	Tue Feb 26 19:46:59 2013	(r247338)
    +++ head/sys/arm/arm/mp_machdep.c	Tue Feb 26 19:58:49 2013	(r247339)
    @@ -49,6 +49,9 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    +#ifdef ARM_VFP_SUPPORT
    +#include 
    +#endif
     
     #include "opt_smp.h"
     
    @@ -181,6 +184,11 @@ init_secondary(int cpu)
     	KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread"));
     	pc->pc_curthread = pc->pc_idlethread;
     	pc->pc_curpcb = pc->pc_idlethread->td_pcb;
    +#ifdef ARM_VFP_SUPPORT
    +	pc->pc_cpu = cpu;
    +
    +	vfp_init();
    +#endif
     
     	mtx_lock_spin(&ap_boot_mtx);
     
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 19:59:53 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 24AA6FC4;
     Tue, 26 Feb 2013 19:59:53 +0000 (UTC)
     (envelope-from cognet@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 0D2F61C26;
     Tue, 26 Feb 2013 19:59:53 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QJxqkg041600;
     Tue, 26 Feb 2013 19:59:52 GMT (envelope-from cognet@svn.freebsd.org)
    Received: (from cognet@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QJxq1c041599;
     Tue, 26 Feb 2013 19:59:52 GMT (envelope-from cognet@svn.freebsd.org)
    Message-Id: <201302261959.r1QJxq1c041599@svn.freebsd.org>
    From: Olivier Houchard 
    Date: Tue, 26 Feb 2013 19:59:52 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247340 - head/sys/arm/arm
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 19:59:53 -0000
    
    Author: cognet
    Date: Tue Feb 26 19:59:52 2013
    New Revision: 247340
    URL: http://svnweb.freebsd.org/changeset/base/247340
    
    Log:
      Fix SMP build.
    
    Modified:
      head/sys/arm/arm/vfp.c
    
    Modified: head/sys/arm/arm/vfp.c
    ==============================================================================
    --- head/sys/arm/arm/vfp.c	Tue Feb 26 19:58:49 2013	(r247339)
    +++ head/sys/arm/arm/vfp.c	Tue Feb 26 19:59:52 2013	(r247340)
    @@ -43,7 +43,6 @@ unsigned int get_coprocessorACR(void);
     int	vfp_bounce(u_int, u_int, struct trapframe *, int);
     void	vfp_discard(void);
     void	vfp_enable(void);
    -void	vfp_init(void);
     void	vfp_restore(struct vfp_state *);
     void	vfp_store(struct vfp_state *);
     void	set_coprocessorACR(u_int);
    @@ -74,8 +73,8 @@ void
     set_coprocessorACR(u_int val)
     {
     	__asm __volatile("mcr p15, 0, %0, c1, c0, 2\n\t"
    -			 "isb\n\t"
     	 : : "r" (val) : "cc");
    +	isb();
     }
     
     
    @@ -140,7 +139,7 @@ vfp_bounce(u_int addr, u_int insn, struc
     #ifdef SMP
     		/* don't save if newer registers are on another processor */
     		if (vfptd /* && (vfptd == curthread) */ &&
    -		   (vfptd->td_pcb->pcb_vfpcpu == PCPU_GET(vfpcpu))
    +		   (vfptd->td_pcb->pcb_vfpcpu == PCPU_GET(cpu)))
     #else
     		/* someone did not save their registers, */
     		if (vfptd /* && (vfptd == curthread) */)
    @@ -168,7 +167,7 @@ vfp_bounce(u_int addr, u_int insn, struc
     	 */
     	vfp_restore(&curpcb->pcb_vfpstate);
     #ifdef SMP
    -	curpcb->pcb_cpu = PCPU_GET(cpu);
    +	curpcb->pcb_vfpcpu = PCPU_GET(cpu);
     #endif
     	PCPU_SET(vfpcthread, PCPU_GET(curthread));
     	return 0;
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 20:01:05 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id E76711DC;
     Tue, 26 Feb 2013 20:01:05 +0000 (UTC)
     (envelope-from cognet@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 BB5931C3A;
     Tue, 26 Feb 2013 20:01:05 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QK15x6043547;
     Tue, 26 Feb 2013 20:01:05 GMT (envelope-from cognet@svn.freebsd.org)
    Received: (from cognet@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QK15p0043546;
     Tue, 26 Feb 2013 20:01:05 GMT (envelope-from cognet@svn.freebsd.org)
    Message-Id: <201302262001.r1QK15p0043546@svn.freebsd.org>
    From: Olivier Houchard 
    Date: Tue, 26 Feb 2013 20:01:05 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247341 - head/sys/arm/include
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 20:01:06 -0000
    
    Author: cognet
    Date: Tue Feb 26 20:01:05 2013
    New Revision: 247341
    URL: http://svnweb.freebsd.org/changeset/base/247341
    
    Log:
      Export vfp_init() prototype, for use in the MP code.
    
    Modified:
      head/sys/arm/include/vfp.h
    
    Modified: head/sys/arm/include/vfp.h
    ==============================================================================
    --- head/sys/arm/include/vfp.h	Tue Feb 26 19:59:52 2013	(r247340)
    +++ head/sys/arm/include/vfp.h	Tue Feb 26 20:01:05 2013	(r247341)
    @@ -124,5 +124,6 @@
     #define COPROC10		(0x3 << 20)
     #define COPROC11		(0x3 << 22)
     
    +void    vfp_init(void);
     
     #endif
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 20:02:17 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id BDC2D36E;
     Tue, 26 Feb 2013 20:02:17 +0000 (UTC)
     (envelope-from neel@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 B08B41C53;
     Tue, 26 Feb 2013 20:02:17 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QK2H29043798;
     Tue, 26 Feb 2013 20:02:17 GMT (envelope-from neel@svn.freebsd.org)
    Received: (from neel@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QK2HhZ043797;
     Tue, 26 Feb 2013 20:02:17 GMT (envelope-from neel@svn.freebsd.org)
    Message-Id: <201302262002.r1QK2HhZ043797@svn.freebsd.org>
    From: Neel Natu 
    Date: Tue, 26 Feb 2013 20:02:17 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247342 - head/usr.sbin/bhyve
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 20:02:17 -0000
    
    Author: neel
    Date: Tue Feb 26 20:02:17 2013
    New Revision: 247342
    URL: http://svnweb.freebsd.org/changeset/base/247342
    
    Log:
      Ignore the BARRIER flag in the virtio block header.
      
      This capability is not advertised by the host so ignore it even if the guest
      insists on setting the flag.
      
      Reviewed by:	grehan
      Obtained from:	NetApp
    
    Modified:
      head/usr.sbin/bhyve/pci_virtio_block.c
    
    Modified: head/usr.sbin/bhyve/pci_virtio_block.c
    ==============================================================================
    --- head/usr.sbin/bhyve/pci_virtio_block.c	Tue Feb 26 20:01:05 2013	(r247341)
    +++ head/usr.sbin/bhyve/pci_virtio_block.c	Tue Feb 26 20:02:17 2013	(r247342)
    @@ -110,8 +110,9 @@ CTASSERT(sizeof(struct vtblk_config) == 
      * Fixed-size block header
      */
     struct virtio_blk_hdr {
    -#define VBH_OP_READ	0
    -#define VBH_OP_WRITE	1
    +#define	VBH_OP_READ		0
    +#define	VBH_OP_WRITE		1
    +#define	VBH_FLAG_BARRIER	0x80000000	/* OR'ed into vbh_type */
     	uint32_t       	vbh_type;
     	uint32_t	vbh_ioprio;
     	uint64_t	vbh_sector;
    @@ -198,7 +199,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *s
     	int iolen;
     	int nsegs;
     	int uidx, aidx, didx;
    -	int writeop;
    +	int writeop, type;
     	off_t offset;
     
     	uidx = *hq->hq_used_idx;
    @@ -232,7 +233,13 @@ pci_vtblk_proc(struct pci_vtblk_softc *s
     	assert(vid[0].vd_flags & VRING_DESC_F_NEXT);
     	assert((vid[0].vd_flags & VRING_DESC_F_WRITE) == 0);
     
    -	writeop = (vbh->vbh_type == VBH_OP_WRITE);
    +	/*
    +	 * XXX
    +	 * The guest should not be setting the BARRIER flag because
    +	 * we don't advertise the capability.
    +	 */
    +	type = vbh->vbh_type & ~VBH_FLAG_BARRIER;
    +	writeop = (type == VBH_OP_WRITE);
     
     	offset = vbh->vbh_sector * DEV_BSIZE;
     
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 20:13:11 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id A6E178D9;
     Tue, 26 Feb 2013 20:13:11 +0000 (UTC)
     (envelope-from davide.italiano@gmail.com)
    Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com
     [209.85.212.173])
     by mx1.freebsd.org (Postfix) with ESMTP id AA8F01CD3;
     Tue, 26 Feb 2013 20:13:10 +0000 (UTC)
    Received: by mail-wi0-f173.google.com with SMTP id hq4so5379436wib.6
     for ; Tue, 26 Feb 2013 12:13:04 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
     h=mime-version:x-received:sender:in-reply-to:references:date
     :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
     bh=5XixmqRwAL3QcXC0xiGkwjLvpKPuO07FZ9n5CxfiBN4=;
     b=VKr1H0YW3/6IBwdQe/YIN+xrsn/lXwiWHH+GQ5VpUyBacnN8/3NqXgspGUs0bTiQGK
     /RdZyZVUHdKXRUikSEKs2QIeqLiSO09S5O7gWO/CTXI1Z6sM2v5CjDkA/KQ5pIi9hnOk
     kAM6jSBUOGABdyHT8np9ZEZ3KqxKogVRiTftKh0bNGXoIEYJ9J5dkpRjroxoo1e91YiD
     czPh/iXAOehRzY8uhsFIdxz3RIgfaCRAJu/mxJDWD67kF9wDPB6E7S0Xd/YjfPRnsd14
     RyZM98BqtDu3R3oWLlGGVUKtvN7s2QJ3IfgJmnvzfFVN74eM2wbrswdx4OfG6kWOqhPx
     cJ/Q==
    MIME-Version: 1.0
    X-Received: by 10.194.62.170 with SMTP id z10mr28981326wjr.34.1361909584067;
     Tue, 26 Feb 2013 12:13:04 -0800 (PST)
    Sender: davide.italiano@gmail.com
    Received: by 10.180.105.197 with HTTP; Tue, 26 Feb 2013 12:13:03 -0800 (PST)
    In-Reply-To: <512D071E.8090306@delphij.net>
    References: <201302260213.r1Q2D2N1016801@svn.freebsd.org>
     <201302260941.52534.jhb@freebsd.org>
     
     <512D071E.8090306@delphij.net>
    Date: Tue, 26 Feb 2013 21:13:03 +0100
    X-Google-Sender-Auth: DjA3xebRUg0WkjqKp_mLoq8YsOw
    Message-ID: 
    Subject: Re: svn commit: r247300 - in head: sys/sys usr.bin/truss
    From: Davide Italiano 
    To: d@delphij.net
    Content-Type: text/plain; charset=ISO-8859-1
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org, Xin LI ,
     John Baldwin 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 20:13:11 -0000
    
    On Tue, Feb 26, 2013 at 8:03 PM, Xin Li  wrote:
    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA512
    >
    > On 02/26/13 09:09, Davide Italiano wrote:
    >> On Tue, Feb 26, 2013 at 3:41 PM, John Baldwin 
    >> wrote:
    >>> On Monday, February 25, 2013 9:13:02 pm Xin LI wrote:
    >>>> Author: delphij Date: Tue Feb 26 02:13:02 2013 New Revision:
    >>>> 247300 URL: http://svnweb.freebsd.org/changeset/base/247300
    >>>>
    >>>> Log: Expose timespec and timeval macros when __BSD_VISIBLE is
    >>>> defined.  This allows userland application to use the following
    >>>> macros:
    >>>>
    >>>> timespecclear, timespecisset, timespeccmp, timespecadd,
    >>>> timespecsub;
    >>>>
    >>>> timevalclear, timevalisset, timevalcmp.
    >>>
    >>> Why not fix truss to use the stock functions instead of keeping
    >>> private "unusual" versions?
    >>>
    >>> -- John Baldwin
    >>
    >> time.h is already a mess in terms of namespace pollution, and this
    >> exposure might not help thing. Other details here:
    >> http://permalink.gmane.org/gmane.os.freebsd.architechture/15518
    >
    > What would be the preferred way of doing these operations on a
    > timespec structure then?  Should the caller duplicate these macros?
    >
    > Cheers,
    > - --
    > Xin LI     https://www.delphij.net/
    > FreeBSD - The Power to Serve!           Live free or die
    > -----BEGIN PGP SIGNATURE-----
    >
    > iQEcBAEBCgAGBQJRLQceAAoJEG80Jeu8UPuzYQIIAIf9vJ6TS2Lmk+vkC0O9oXFi
    > 1W+msaOn/Onhi9TSbpdPlhfQI2VB8bkdDCA63ll3LC64jjDaRObobSYxYn7mKhz9
    > +o0sdRXl8AvDkHNofSmrtO0h3JormzJjGIxNLi0DsTgrUDuOiVT34WtzTY6uvvnG
    > Y4zpxoY/KI9ftaAabxhfTG8RcMkWbAHrQXmah/UujuMID57665I0NwxBap5lyyng
    > lMygEBfAZ8bZqbh2IcUZi9qKBsIkFJugxYZc95WkU73A4rCGBJSJXpYWAghJxthy
    > nDHNA6I5DxoeXpf3hEscG4WjHgLubZen8HwEs/3uA4mRkmAkI7pwT56wo7kVnwU=
    > =JZjk
    > -----END PGP SIGNATURE-----
    
    Well, it may be. And maybe this might be a topic for a larger discussion.
    What's your use-case?
    
    -- 
    Davide
    
    "There are no solved problems; there are only problems that are more
    or less solved" -- Henri Poincare
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 20:19:21 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 2D5F6BF5;
     Tue, 26 Feb 2013 20:19:21 +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 115411D0A;
     Tue, 26 Feb 2013 20:19:21 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QKJKsR048273;
     Tue, 26 Feb 2013 20:19:20 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QKJKJ3048263;
     Tue, 26 Feb 2013 20:19:20 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302262019.r1QKJKJ3048263@svn.freebsd.org>
    From: John Baldwin 
    Date: Tue, 26 Feb 2013 20:19: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: r247344 - in stable/9: share/man/man9 sys/kern
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 20:19:21 -0000
    
    Author: jhb
    Date: Tue Feb 26 20:19:19 2013
    New Revision: 247344
    URL: http://svnweb.freebsd.org/changeset/base/247344
    
    Log:
      MFC 239512:
      Add a BUS_CHILD_DELETED() method that a bus can hook to allow it to cleanup
      any bus-specific state (such as ivars) when a child device is deleted.
    
    Added:
      stable/9/share/man/man9/BUS_CHILD_DELETED.9
         - copied unchanged from r239512, head/share/man/man9/BUS_CHILD_DELETED.9
    Modified:
      stable/9/share/man/man9/Makefile
      stable/9/sys/kern/bus_if.m
      stable/9/sys/kern/subr_bus.c
    Directory Properties:
      stable/9/share/man/man9/   (props changed)
      stable/9/sys/   (props changed)
    
    Copied: stable/9/share/man/man9/BUS_CHILD_DELETED.9 (from r239512, head/share/man/man9/BUS_CHILD_DELETED.9)
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ stable/9/share/man/man9/BUS_CHILD_DELETED.9	Tue Feb 26 20:19:19 2013	(r247344, copy of r239512, head/share/man/man9/BUS_CHILD_DELETED.9)
    @@ -0,0 +1,55 @@
    +.\" -*- nroff -*-
    +.\"
    +.\" Copyright (c) 2012 Advanced Computing Technologies LLC
    +.\" Written by: John H. Baldwin 
    +.\" All rights reserved.
    +.\"
    +.\" Redistribution and use in source and binary forms, with or without
    +.\" modification, are permitted provided that the following conditions
    +.\" are met:
    +.\" 1. Redistributions of source code must retain the above copyright
    +.\"    notice, this list of conditions and the following disclaimer.
    +.\" 2. Redistributions in binary form must reproduce the above copyright
    +.\"    notice, this list of conditions and the following disclaimer in the
    +.\"    documentation and/or other materials provided with the distribution.
    +.\"
    +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
    +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    +.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
    +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    +.\" SUCH DAMAGE.
    +.\"
    +.\" $FreeBSD$
    +.\"
    +.Dd August 21, 2012
    +.Dt BUS_CHILD_DELETED 9
    +.Os
    +.Sh NAME
    +.Nm BUS_CHILD_DELETED
    +.Nd "notify a bus device that a child is being deleted"
    +.Sh SYNOPSIS
    +.In sys/param.h
    +.In sys/bus.h
    +.Ft void
    +.Fn BUS_CHILD_DELETED "device_t dev" "device_t child"
    +.Sh DESCRIPTION
    +The
    +.Fn BUS_CHILD_DELETED
    +method is invoked by the new-bus framework when a device is deleted.
    +A bus driver can provide an implementation of this method to
    +release bus-specific resources associated with a device such as
    +instance variables.
    +.Sh SEE ALSO
    +.Xr BUS_ADD_CHILD 9 ,
    +.Xr device 9
    +.Sh HISTORY
    +The
    +.Fn BUS_CHILD_DELETED
    +method first appeared in
    +.Fx 10.0 .
    
    Modified: stable/9/share/man/man9/Makefile
    ==============================================================================
    --- stable/9/share/man/man9/Makefile	Tue Feb 26 20:18:25 2013	(r247343)
    +++ stable/9/share/man/man9/Makefile	Tue Feb 26 20:19:19 2013	(r247344)
    @@ -26,6 +26,7 @@ MAN=	accept_filter.9 \
     	bus_alloc_resource.9 \
     	BUS_BIND_INTR.9 \
     	bus_child_present.9 \
    +	BUS_CHILD_DELETED.9 \
     	BUS_CONFIG_INTR.9 \
     	BUS_DESCRIBE_INTR.9 \
     	bus_dma.9 \
    
    Modified: stable/9/sys/kern/bus_if.m
    ==============================================================================
    --- stable/9/sys/kern/bus_if.m	Tue Feb 26 20:18:25 2013	(r247343)
    +++ stable/9/sys/kern/bus_if.m	Tue Feb 26 20:19:19 2013	(r247344)
    @@ -160,6 +160,20 @@ METHOD int write_ivar {
     };
     
     /**
    + * @brief Notify a bus that a child was deleted
    + *
    + * Called at the beginning of device_delete_child() to allow the parent
    + * to teardown any bus-specific state for the child.
    + * 
    + * @param _dev		the device whose child is being deleted
    + * @param _child	the child device which is being deleted
    + */
    +METHOD void child_deleted {
    +	device_t _dev;
    +	device_t _child;
    +};
    +
    +/**
      * @brief Notify a bus that a child was detached
      *
      * Called after the child's DEVICE_DETACH() method to allow the parent
    
    Modified: stable/9/sys/kern/subr_bus.c
    ==============================================================================
    --- stable/9/sys/kern/subr_bus.c	Tue Feb 26 20:18:25 2013	(r247343)
    +++ stable/9/sys/kern/subr_bus.c	Tue Feb 26 20:19:19 2013	(r247344)
    @@ -1871,6 +1871,8 @@ device_delete_child(device_t dev, device
     		return (error);
     	if (child->devclass)
     		devclass_delete_device(child->devclass, child);
    +	if (child->parent)
    +		BUS_CHILD_DELETED(dev, child);
     	TAILQ_REMOVE(&dev->children, child, link);
     	TAILQ_REMOVE(&bus_data_devices, child, devlink);
     	kobj_delete((kobj_t) child, M_BUS);
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 20:19:46 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 21639D61;
     Tue, 26 Feb 2013 20:19:46 +0000 (UTC)
     (envelope-from trociny@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 131A01D12;
     Tue, 26 Feb 2013 20:19:46 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QKJjP5048359;
     Tue, 26 Feb 2013 20:19:45 GMT (envelope-from trociny@svn.freebsd.org)
    Received: (from trociny@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QKJjVW048358;
     Tue, 26 Feb 2013 20:19:45 GMT (envelope-from trociny@svn.freebsd.org)
    Message-Id: <201302262019.r1QKJjVW048358@svn.freebsd.org>
    From: Mikolaj Golub 
    Date: Tue, 26 Feb 2013 20:19:45 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247345 - head/sbin/hastctl
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 20:19:46 -0000
    
    Author: trociny
    Date: Tue Feb 26 20:19:45 2013
    New Revision: 247345
    URL: http://svnweb.freebsd.org/changeset/base/247345
    
    Log:
      Fix casting.
      
      MFC after:	3 days
    
    Modified:
      head/sbin/hastctl/hastctl.c
    
    Modified: head/sbin/hastctl/hastctl.c
    ==============================================================================
    --- head/sbin/hastctl/hastctl.c	Tue Feb 26 20:19:19 2013	(r247344)
    +++ head/sbin/hastctl/hastctl.c	Tue Feb 26 20:19:45 2013	(r247345)
    @@ -342,15 +342,15 @@ control_status(struct nv *nv)
     		    (intmax_t)nv_get_uint64(nv, "dirty%u", ii));
     		printf("  statistics:\n");
     		printf("    reads: %ju\n",
    -		    (uint64_t)nv_get_uint64(nv, "stat_read%u", ii));
    +		    (uintmax_t)nv_get_uint64(nv, "stat_read%u", ii));
     		printf("    writes: %ju\n",
    -		    (uint64_t)nv_get_uint64(nv, "stat_write%u", ii));
    +		    (uintmax_t)nv_get_uint64(nv, "stat_write%u", ii));
     		printf("    deletes: %ju\n",
    -		    (uint64_t)nv_get_uint64(nv, "stat_delete%u", ii));
    +		    (uintmax_t)nv_get_uint64(nv, "stat_delete%u", ii));
     		printf("    flushes: %ju\n",
    -		    (uint64_t)nv_get_uint64(nv, "stat_flush%u", ii));
    +		    (uintmax_t)nv_get_uint64(nv, "stat_flush%u", ii));
     		printf("    activemap updates: %ju\n",
    -		    (uint64_t)nv_get_uint64(nv, "stat_activemap_update%u", ii));
    +		    (uintmax_t)nv_get_uint64(nv, "stat_activemap_update%u", ii));
     		printf("    local errors: "
     		    "read: %ju, write: %ju, delete: %ju, flush: %ju\n",
     		    (uintmax_t)nv_get_uint64(nv, "stat_read_error%u", ii),
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 20:35:40 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id E1021F8;
     Tue, 26 Feb 2013 20:35:40 +0000 (UTC)
     (envelope-from attilio@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 C97CA1DBD;
     Tue, 26 Feb 2013 20:35:40 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QKZeU6053687;
     Tue, 26 Feb 2013 20:35:40 GMT (envelope-from attilio@svn.freebsd.org)
    Received: (from attilio@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QKZeSI053685;
     Tue, 26 Feb 2013 20:35:40 GMT (envelope-from attilio@svn.freebsd.org)
    Message-Id: <201302262035.r1QKZeSI053685@svn.freebsd.org>
    From: Attilio Rao 
    Date: Tue, 26 Feb 2013 20:35:40 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247346 - head/sys/vm
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 20:35:41 -0000
    
    Author: attilio
    Date: Tue Feb 26 20:35:40 2013
    New Revision: 247346
    URL: http://svnweb.freebsd.org/changeset/base/247346
    
    Log:
      Remove white spaces.
      
      Sponsored by:	EMC / Isilon storage division
    
    Modified:
      head/sys/vm/vm_object.c
      head/sys/vm/vnode_pager.c
    
    Modified: head/sys/vm/vm_object.c
    ==============================================================================
    --- head/sys/vm/vm_object.c	Tue Feb 26 20:19:45 2013	(r247345)
    +++ head/sys/vm/vm_object.c	Tue Feb 26 20:35:40 2013	(r247346)
    @@ -1138,7 +1138,7 @@ shadowlookup:
     			if (object != tobject)
     				VM_OBJECT_UNLOCK(object);
     			m->oflags |= VPO_WANTED;
    -			VM_OBJECT_SLEEP(tobject, m, PDROP | PVM, "madvpo" , 0);
    +			VM_OBJECT_SLEEP(tobject, m, PDROP | PVM, "madvpo", 0);
     			VM_OBJECT_LOCK(object);
       			goto relookup;
     		}
    @@ -1336,7 +1336,7 @@ retry:
     		if ((m->oflags & VPO_BUSY) || m->busy) {
     			VM_OBJECT_UNLOCK(new_object);
     			m->oflags |= VPO_WANTED;
    -			VM_OBJECT_SLEEP(orig_object, m, PVM, "spltwt" , 0);
    +			VM_OBJECT_SLEEP(orig_object, m, PVM, "spltwt", 0);
     			VM_OBJECT_LOCK(new_object);
     			goto retry;
     		}
    
    Modified: head/sys/vm/vnode_pager.c
    ==============================================================================
    --- head/sys/vm/vnode_pager.c	Tue Feb 26 20:19:45 2013	(r247345)
    +++ head/sys/vm/vnode_pager.c	Tue Feb 26 20:35:40 2013	(r247346)
    @@ -116,7 +116,7 @@ vnode_create_vobject(struct vnode *vp, o
     		}
     		VOP_UNLOCK(vp, 0);
     		vm_object_set_flag(object, OBJ_DISCONNECTWNT);
    -		VM_OBJECT_SLEEP(object, object, PDROP | PVM, "vodead" , 0);
    +		VM_OBJECT_SLEEP(object, object, PDROP | PVM, "vodead", 0);
     		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
     	}
     
    @@ -210,7 +210,7 @@ retry:
     		if ((object->flags & OBJ_DEAD) == 0)
     			break;
     		vm_object_set_flag(object, OBJ_DISCONNECTWNT);
    -		VM_OBJECT_SLEEP(object, object, PDROP | PVM, "vadead" , 0);
    +		VM_OBJECT_SLEEP(object, object, PDROP | PVM, "vadead", 0);
     	}
     
     	if (vp->v_usecount == 0)
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 20:35:55 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 25C92268;
     Tue, 26 Feb 2013 20:35:55 +0000 (UTC) (envelope-from np@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 17E9C1DC1;
     Tue, 26 Feb 2013 20:35:55 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QKZsGo053762;
     Tue, 26 Feb 2013 20:35:54 GMT (envelope-from np@svn.freebsd.org)
    Received: (from np@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QKZsAQ053757;
     Tue, 26 Feb 2013 20:35:54 GMT (envelope-from np@svn.freebsd.org)
    Message-Id: <201302262035.r1QKZsAQ053757@svn.freebsd.org>
    From: Navdeep Parhar 
    Date: Tue, 26 Feb 2013 20:35:54 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247347 - in head: share/man/man4 sys/dev/cxgbe
     sys/dev/cxgbe/common
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 20:35:55 -0000
    
    Author: np
    Date: Tue Feb 26 20:35:54 2013
    New Revision: 247347
    URL: http://svnweb.freebsd.org/changeset/base/247347
    
    Log:
      cxgbe(4): Consider all the API versions of the interfaces exported by
      the firmware (instead of just the main firmware version) when evaluating
      firmware compatibility.  Document the new "hw.cxgbe.fw_install" knob
      being introduced here.
      
      This should fix kern/173584 too.  Setting hw.cxgbe.fw_install=2 will
      mostly do what was requested in the PR but it's a bit more intelligent
      in that it won't reinstall the same firmware repeatedly if the knob is
      left set.
      
      PR:		kern/173584
      MFC after:	5 days
    
    Modified:
      head/share/man/man4/cxgbe.4
      head/sys/dev/cxgbe/common/common.h
      head/sys/dev/cxgbe/t4_main.c
    
    Modified: head/share/man/man4/cxgbe.4
    ==============================================================================
    --- head/share/man/man4/cxgbe.4	Tue Feb 26 20:35:40 2013	(r247346)
    +++ head/share/man/man4/cxgbe.4	Tue Feb 26 20:35:54 2013	(r247347)
    @@ -178,6 +178,15 @@ Bit 0 represents INTx (line interrupts),
     The default is 7 (all allowed).
     The driver will select the best possible type out of the allowed types by
     itself.
    +.It Va hw.cxgbe.fw_install
    +0 prohibits the driver from installing a firmware on the card.
    +1 allows the driver to install a new firmware if internal driver
    +heuristics indicate that the new firmware is preferable to the one
    +already on the card.
    +2 instructs the driver to always install the new firmware on the card as
    +long as it is compatible with the driver and is a different version than
    +the one already on the card.
    +The default is 1.
     .It Va hw.cxgbe.config_file
     Select a pre-packaged device configuration file.
     A configuration file contains a recipe for partitioning and configuring the
    
    Modified: head/sys/dev/cxgbe/common/common.h
    ==============================================================================
    --- head/sys/dev/cxgbe/common/common.h	Tue Feb 26 20:35:40 2013	(r247346)
    +++ head/sys/dev/cxgbe/common/common.h	Tue Feb 26 20:35:54 2013	(r247347)
    @@ -68,6 +68,11 @@ enum {
     #define FW_VERSION_MICRO 4
     #define FW_VERSION_BUILD 0
     
    +#define FW_VERSION (V_FW_HDR_FW_VER_MAJOR(FW_VERSION_MAJOR) | \
    +    V_FW_HDR_FW_VER_MINOR(FW_VERSION_MINOR) | \
    +    V_FW_HDR_FW_VER_MICRO(FW_VERSION_MICRO) | \
    +    V_FW_HDR_FW_VER_BUILD(FW_VERSION_BUILD))
    +
     struct port_stats {
     	u64 tx_octets;            /* total # of octets in good frames */
     	u64 tx_frames;            /* all good frames */
    
    Modified: head/sys/dev/cxgbe/t4_main.c
    ==============================================================================
    --- head/sys/dev/cxgbe/t4_main.c	Tue Feb 26 20:35:40 2013	(r247346)
    +++ head/sys/dev/cxgbe/t4_main.c	Tue Feb 26 20:35:54 2013	(r247347)
    @@ -213,6 +213,13 @@ static char t4_cfg_file[32] = "default";
     TUNABLE_STR("hw.cxgbe.config_file", t4_cfg_file, sizeof(t4_cfg_file));
     
     /*
    + * Firmware auto-install by driver during attach (0, 1, 2 = prohibited, allowed,
    + * encouraged respectively).
    + */
    +static unsigned int t4_fw_install = 1;
    +TUNABLE_INT("hw.cxgbe.fw_install", &t4_fw_install);
    +
    +/*
      * ASIC features that will be used.  Disable the ones you don't want so that the
      * chip resources aren't wasted on features that will not be used.
      */
    @@ -1503,6 +1510,33 @@ allocate:
     }
     
     /*
    + * Is the given firmware compatible with the one the driver was compiled with?
    + */
    +static int
    +fw_compatible(const struct fw_hdr *hdr)
    +{
    +
    +	if (hdr->fw_ver == htonl(FW_VERSION))
    +		return (1);
    +
    +	/*
    +	 * XXX: Is this too conservative?  Perhaps I should limit this to the
    +	 * features that are supported in the driver.
    +	 */
    +	if (hdr->intfver_nic == FW_HDR_INTFVER_NIC &&
    +	    hdr->intfver_vnic == FW_HDR_INTFVER_VNIC &&
    +	    hdr->intfver_ofld == FW_HDR_INTFVER_OFLD &&
    +	    hdr->intfver_ri == FW_HDR_INTFVER_RI &&
    +	    hdr->intfver_iscsipdu == FW_HDR_INTFVER_ISCSIPDU &&
    +	    hdr->intfver_iscsi == FW_HDR_INTFVER_ISCSI &&
    +	    hdr->intfver_fcoepdu == FW_HDR_INTFVER_FCOEPDU &&
    +	    hdr->intfver_fcoe == FW_HDR_INTFVER_FCOEPDU)
    +		return (1);
    +
    +	return (0);
    +}
    +
    +/*
      * Install a compatible firmware (if required), establish contact with it (by
      * saying hello), and reset the device.  If we end up as the master driver,
      * partition adapter resources by providing a configuration file to the
    @@ -1512,84 +1546,99 @@ static int
     prep_firmware(struct adapter *sc)
     {
     	const struct firmware *fw = NULL, *cfg = NULL, *default_cfg;
    -	int rc;
    +	int rc, card_fw_usable, kld_fw_usable;
     	enum dev_state state;
    +	struct fw_hdr *card_fw;
    +	const struct fw_hdr *kld_fw;
     
     	default_cfg = firmware_get(T4_CFGNAME);
     
    -	/* Check firmware version and install a different one if necessary */
    -	rc = t4_check_fw_version(sc);
    -	snprintf(sc->fw_version, sizeof(sc->fw_version), "%u.%u.%u.%u",
    -	    G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers),
    -	    G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers),
    -	    G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers),
    -	    G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers));
    -	if (rc != 0) {
    -		uint32_t v = 0;
    -
    -		fw = firmware_get(T4_FWNAME);
    -		if (fw != NULL) {
    -			const struct fw_hdr *hdr = (const void *)fw->data;
    +	/* Read the header of the firmware on the card */
    +	card_fw = malloc(sizeof(*card_fw), M_CXGBE, M_ZERO | M_WAITOK);
    +	rc = -t4_read_flash(sc, FLASH_FW_START,
    +	    sizeof (*card_fw) / sizeof (uint32_t), (uint32_t *)card_fw, 1);
    +	if (rc == 0)
    +		card_fw_usable = fw_compatible((const void*)card_fw);
    +	else {
    +		device_printf(sc->dev,
    +		    "Unable to read card's firmware header: %d\n", rc);
    +		card_fw_usable = 0;
    +	}
     
    -			v = ntohl(hdr->fw_ver);
    +	/* This is the firmware in the KLD */
    +	fw = firmware_get(T4_FWNAME);
    +	if (fw != NULL) {
    +		kld_fw = (const void *)fw->data;
    +		kld_fw_usable = fw_compatible(kld_fw);
    +	} else {
    +		kld_fw = NULL;
    +		kld_fw_usable = 0;
    +	}
     
    -			/*
    -			 * The firmware module will not be used if it isn't the
    -			 * same major version as what the driver was compiled
    -			 * with.
    -			 */
    -			if (G_FW_HDR_FW_VER_MAJOR(v) != FW_VERSION_MAJOR) {
    -				device_printf(sc->dev,
    -				    "Found firmware image but version %d "
    -				    "can not be used with this driver (%d)\n",
    -				    G_FW_HDR_FW_VER_MAJOR(v), FW_VERSION_MAJOR);
    +	/*
    +	 * Short circuit for the common case: the firmware on the card is an
    +	 * exact match and the KLD is an exact match too, or it's
    +	 * absent/incompatible, or we're prohibited from using it.  Note that
    +	 * t4_fw_install = 2 is ignored here -- use cxgbetool loadfw if you want
    +	 * to reinstall the same firmware as the one on the card.
    +	 */
    +	if (card_fw_usable && card_fw->fw_ver == htonl(FW_VERSION) &&
    +	    (!kld_fw_usable || kld_fw->fw_ver == htonl(FW_VERSION) ||
    +	    t4_fw_install == 0))
    +		goto hello;
    +
    +	if (kld_fw_usable && (!card_fw_usable ||
    +	    ntohl(kld_fw->fw_ver) > ntohl(card_fw->fw_ver) ||
    +	    (t4_fw_install == 2 && kld_fw->fw_ver != card_fw->fw_ver))) {
    +		uint32_t v = ntohl(kld_fw->fw_ver);
     
    -				firmware_put(fw, FIRMWARE_UNLOAD);
    -				fw = NULL;
    -			}
    -		}
    +		device_printf(sc->dev,
    +		    "installing firmware %d.%d.%d.%d on card.\n",
    +		    G_FW_HDR_FW_VER_MAJOR(v), G_FW_HDR_FW_VER_MINOR(v),
    +		    G_FW_HDR_FW_VER_MICRO(v), G_FW_HDR_FW_VER_BUILD(v));
     
    -		if (fw == NULL && rc < 0) {
    -			device_printf(sc->dev, "No usable firmware. "
    -			    "card has %d.%d.%d, driver compiled with %d.%d.%d",
    -			    G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers),
    -			    G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers),
    -			    G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers),
    -			    FW_VERSION_MAJOR, FW_VERSION_MINOR,
    -			    FW_VERSION_MICRO);
    -			rc = EAGAIN;
    +		rc = -t4_load_fw(sc, fw->data, fw->datasize);
    +		if (rc != 0) {
    +			device_printf(sc->dev,
    +			    "failed to install firmware: %d\n", rc);
     			goto done;
     		}
     
    -		/*
    -		 * Always upgrade, even for minor/micro/build mismatches.
    -		 * Downgrade only for a major version mismatch or if
    -		 * force_firmware_install was specified.
    -		 */
    -		if (fw != NULL && (rc < 0 || v > sc->params.fw_vers)) {
    -			device_printf(sc->dev,
    -			    "installing firmware %d.%d.%d.%d on card.\n",
    -			    G_FW_HDR_FW_VER_MAJOR(v), G_FW_HDR_FW_VER_MINOR(v),
    -			    G_FW_HDR_FW_VER_MICRO(v), G_FW_HDR_FW_VER_BUILD(v));
    -
    -			rc = -t4_load_fw(sc, fw->data, fw->datasize);
    -			if (rc != 0) {
    -				device_printf(sc->dev,
    -				    "failed to install firmware: %d\n", rc);
    -				goto done;
    -			} else {
    -				/* refresh */
    -				(void) t4_check_fw_version(sc);
    -				snprintf(sc->fw_version,
    -				    sizeof(sc->fw_version), "%u.%u.%u.%u",
    -				    G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers),
    -				    G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers),
    -				    G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers),
    -				    G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers));
    -			}
    -		}
    +		/* Installed successfully, update the cached header too. */
    +		memcpy(card_fw, kld_fw, sizeof(*card_fw));
    +		card_fw_usable = 1;
    +	}
    +
    +	if (!card_fw_usable) {
    +		uint32_t c, k;
    +
    +		c = ntohl(card_fw->fw_ver);
    +		k = kld_fw ? ntohl(kld_fw->fw_ver) : 0;
    +
    +		device_printf(sc->dev, "Cannot find a usable firmware: "
    +		    "fw_install %d, driver compiled with %d.%d.%d.%d, "
    +		    "card has %d.%d.%d.%d, KLD has %d.%d.%d.%d\n",
    +		    t4_fw_install,
    +		    G_FW_HDR_FW_VER_MAJOR(FW_VERSION),
    +		    G_FW_HDR_FW_VER_MINOR(FW_VERSION),
    +		    G_FW_HDR_FW_VER_MICRO(FW_VERSION),
    +		    G_FW_HDR_FW_VER_BUILD(FW_VERSION),
    +		    G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c),
    +		    G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c),
    +		    G_FW_HDR_FW_VER_MAJOR(k), G_FW_HDR_FW_VER_MINOR(k),
    +		    G_FW_HDR_FW_VER_MICRO(k), G_FW_HDR_FW_VER_BUILD(k));
    +		goto done;
     	}
     
    +hello:
    +	/* We're using whatever's on the card and it's known to be good. */
    +	sc->params.fw_vers = ntohl(card_fw->fw_ver);
    +	snprintf(sc->fw_version, sizeof(sc->fw_version), "%u.%u.%u.%u",
    +	    G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers),
    +	    G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers),
    +	    G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers),
    +	    G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers));
    +
     	/* Contact firmware.  */
     	rc = t4_fw_hello(sc, sc->mbox, sc->mbox, MASTER_MAY, &state);
     	if (rc < 0) {
    @@ -1639,6 +1688,7 @@ prep_firmware(struct adapter *sc)
     	sc->flags |= FW_OK;
     
     done:
    +	free(card_fw, M_CXGBE);
     	if (fw != NULL)
     		firmware_put(fw, FIRMWARE_UNLOAD);
     	if (cfg != NULL)
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 20:41:27 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id AD249626;
     Tue, 26 Feb 2013 20:41:27 +0000 (UTC) (envelope-from mm@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 942301E19;
     Tue, 26 Feb 2013 20:41:27 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QKfRfG056178;
     Tue, 26 Feb 2013 20:41:27 GMT (envelope-from mm@svn.freebsd.org)
    Received: (from mm@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QKfR1d056177;
     Tue, 26 Feb 2013 20:41:27 GMT (envelope-from mm@svn.freebsd.org)
    Message-Id: <201302262041.r1QKfR1d056177@svn.freebsd.org>
    From: Martin Matuska 
    Date: Tue, 26 Feb 2013 20:41:27 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247348 -
     head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 20:41:27 -0000
    
    Author: mm
    Date: Tue Feb 26 20:41:27 2013
    New Revision: 247348
    URL: http://svnweb.freebsd.org/changeset/base/247348
    
    Log:
      Be more verbose on ZFS deadman I/O panic
      Patch suggested upstream.
      
      Suggested by:	Olivier Cinquin
      MFC after:	12 days
    
    Modified:
      head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
    
    Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
    ==============================================================================
    --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Tue Feb 26 20:35:54 2013	(r247347)
    +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Tue Feb 26 20:41:27 2013	(r247348)
    @@ -23,6 +23,7 @@
      * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
      * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
      * Copyright (c) 2012 by Delphix. All rights reserved.
    + * Copyright 2013 Martin Matuska . All rights reserved.
      */
     
     #include 
    @@ -3205,7 +3206,10 @@ vdev_deadman(vdev_t *vd)
     				    fio->io_timestamp, delta,
     				    vq->vq_io_complete_ts);
     				fm_panic("I/O to pool '%s' appears to be "
    -				    "hung.", spa_name(spa));
    +				    "hung on vdev guid %llu at '%s'.",
    +				    spa_name(spa),
    +				    (long long unsigned int) vd->vdev_guid,
    +				    vd->vdev_path);
     			}
     		}
     		mutex_exit(&vq->vq_lock);
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 21:04:59 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 037561C8;
     Tue, 26 Feb 2013 21:04:59 +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 D1EBFC;
     Tue, 26 Feb 2013 21:04:58 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QL4wHw062769;
     Tue, 26 Feb 2013 21:04:58 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QL4wFr062766;
     Tue, 26 Feb 2013 21:04:58 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302262104.r1QL4wFr062766@svn.freebsd.org>
    From: John Baldwin 
    Date: Tue, 26 Feb 2013 21:04: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: r247349 - stable/9/sys/kern
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 21:04:59 -0000
    
    Author: jhb
    Date: Tue Feb 26 21:04:58 2013
    New Revision: 247349
    URL: http://svnweb.freebsd.org/changeset/base/247349
    
    Log:
      MFC 240467:
      Ignore stop and continue signals sent to an exiting process.  Stop signals
      set p_xstat to the signal that triggered the stop, but p_xstat is also
      used to hold the exit status of an exiting process.  Without this change,
      a stop signal that arrived after a process was marked P_WEXIT but before
      it was marked a zombie would overwrite the exit status with the stop signal
      number.
    
    Modified:
      stable/9/sys/kern/kern_exit.c
      stable/9/sys/kern/kern_sig.c
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/kern/kern_exit.c
    ==============================================================================
    --- stable/9/sys/kern/kern_exit.c	Tue Feb 26 20:41:27 2013	(r247348)
    +++ stable/9/sys/kern/kern_exit.c	Tue Feb 26 21:04:58 2013	(r247349)
    @@ -200,6 +200,14 @@ exit1(struct thread *td, int rv)
     	_STOPEVENT(p, S_EXIT, rv);
     
     	/*
    +	 * Ignore any pending request to stop due to a stop signal.
    +	 * Once P_WEXIT is set, future requests will be ignored as
    +	 * well.
    +	 */
    +	p->p_flag &= ~P_STOPPED_SIG;
    +	KASSERT(!P_SHOULDSTOP(p), ("exiting process is stopped"));
    +
    +	/*
     	 * Note that we are exiting and do another wakeup of anyone in
     	 * PIOCWAIT in case they aren't listening for S_EXIT stops or
     	 * decided to wait again after we told them we are exiting.
    
    Modified: stable/9/sys/kern/kern_sig.c
    ==============================================================================
    --- stable/9/sys/kern/kern_sig.c	Tue Feb 26 20:41:27 2013	(r247348)
    +++ stable/9/sys/kern/kern_sig.c	Tue Feb 26 21:04:58 2013	(r247349)
    @@ -2142,6 +2142,8 @@ tdsendsignal(struct proc *p, struct thre
     	 * We try do the per-process part here.
     	 */
     	if (P_SHOULDSTOP(p)) {
    +		KASSERT(!(p->p_flag & P_WEXIT),
    +		    ("signal to stopped but exiting process"));
     		if (sig == SIGKILL) {
     			/*
     			 * If traced process is already stopped,
    @@ -2256,7 +2258,7 @@ tdsendsignal(struct proc *p, struct thre
     		MPASS(action == SIG_DFL);
     
     		if (prop & SA_STOP) {
    -			if (p->p_flag & P_PPWAIT)
    +			if (p->p_flag & (P_PPWAIT|P_WEXIT))
     				goto out;
     			p->p_flag |= P_STOPPED_SIG;
     			p->p_xstat = sig;
    @@ -2418,6 +2420,7 @@ ptracestop(struct thread *td, int sig)
     	struct proc *p = td->td_proc;
     
     	PROC_LOCK_ASSERT(p, MA_OWNED);
    +	KASSERT(!(p->p_flag & P_WEXIT), ("Stopping exiting process"));
     	WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK,
     	    &p->p_mtx.lock_object, "Stopping for traced signal");
     
    @@ -2655,7 +2658,7 @@ issignal(struct thread *td, int stop_all
     			 * process group, ignore tty stop signals.
     			 */
     			if (prop & SA_STOP) {
    -				if (p->p_flag & P_TRACED ||
    +				if (p->p_flag & (P_TRACED|P_WEXIT) ||
     		    		    (p->p_pgrp->pg_jobc == 0 &&
     				     prop & SA_TTYSTOP))
     					break;	/* == ignore */
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 21:05:07 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id DD24A2DE;
     Tue, 26 Feb 2013 21:05:07 +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 B718567;
     Tue, 26 Feb 2013 21:05:07 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QL57vI062863;
     Tue, 26 Feb 2013 21:05:07 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QL57aS062861;
     Tue, 26 Feb 2013 21:05:07 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302262105.r1QL57aS062861@svn.freebsd.org>
    From: John Baldwin 
    Date: Tue, 26 Feb 2013 21:05:07 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247350 - stable/8/sys/kern
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 21:05:07 -0000
    
    Author: jhb
    Date: Tue Feb 26 21:05:06 2013
    New Revision: 247350
    URL: http://svnweb.freebsd.org/changeset/base/247350
    
    Log:
      MFC 240467:
      Ignore stop and continue signals sent to an exiting process.  Stop signals
      set p_xstat to the signal that triggered the stop, but p_xstat is also
      used to hold the exit status of an exiting process.  Without this change,
      a stop signal that arrived after a process was marked P_WEXIT but before
      it was marked a zombie would overwrite the exit status with the stop signal
      number.
    
    Modified:
      stable/8/sys/kern/kern_exit.c
      stable/8/sys/kern/kern_sig.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/kern/   (props changed)
    
    Modified: stable/8/sys/kern/kern_exit.c
    ==============================================================================
    --- stable/8/sys/kern/kern_exit.c	Tue Feb 26 21:04:58 2013	(r247349)
    +++ stable/8/sys/kern/kern_exit.c	Tue Feb 26 21:05:06 2013	(r247350)
    @@ -183,6 +183,14 @@ exit1(struct thread *td, int rv)
     	_STOPEVENT(p, S_EXIT, rv);
     
     	/*
    +	 * Ignore any pending request to stop due to a stop signal.
    +	 * Once P_WEXIT is set, future requests will be ignored as
    +	 * well.
    +	 */
    +	p->p_flag &= ~P_STOPPED_SIG;
    +	KASSERT(!P_SHOULDSTOP(p), ("exiting process is stopped"));
    +
    +	/*
     	 * Note that we are exiting and do another wakeup of anyone in
     	 * PIOCWAIT in case they aren't listening for S_EXIT stops or
     	 * decided to wait again after we told them we are exiting.
    
    Modified: stable/8/sys/kern/kern_sig.c
    ==============================================================================
    --- stable/8/sys/kern/kern_sig.c	Tue Feb 26 21:04:58 2013	(r247349)
    +++ stable/8/sys/kern/kern_sig.c	Tue Feb 26 21:05:06 2013	(r247350)
    @@ -2142,6 +2142,8 @@ tdsignal(struct proc *p, struct thread *
     	 * We try do the per-process part here.
     	 */
     	if (P_SHOULDSTOP(p)) {
    +		KASSERT(!(p->p_flag & P_WEXIT),
    +		    ("signal to stopped but exiting process"));
     		if (sig == SIGKILL) {
     			/*
     			 * If traced process is already stopped,
    @@ -2256,7 +2258,7 @@ tdsignal(struct proc *p, struct thread *
     		MPASS(action == SIG_DFL);
     
     		if (prop & SA_STOP) {
    -			if (p->p_flag & P_PPWAIT)
    +			if (p->p_flag & (P_PPWAIT|P_WEXIT))
     				goto out;
     			p->p_flag |= P_STOPPED_SIG;
     			p->p_xstat = sig;
    @@ -2418,6 +2420,7 @@ ptracestop(struct thread *td, int sig)
     	struct proc *p = td->td_proc;
     
     	PROC_LOCK_ASSERT(p, MA_OWNED);
    +	KASSERT(!(p->p_flag & P_WEXIT), ("Stopping exiting process"));
     	WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK,
     	    &p->p_mtx.lock_object, "Stopping for traced signal");
     
    @@ -2658,7 +2661,7 @@ issignal(struct thread *td, int stop_all
     			 * process group, ignore tty stop signals.
     			 */
     			if (prop & SA_STOP) {
    -				if (p->p_flag & P_TRACED ||
    +				if (p->p_flag & (P_TRACED|P_WEXIT) ||
     		    		    (p->p_pgrp->pg_jobc == 0 &&
     				     prop & SA_TTYSTOP))
     					break;	/* == ignore */
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 21:25:18 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 34FB5D6A;
     Tue, 26 Feb 2013 21:25:18 +0000 (UTC) (envelope-from np@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 1929016F;
     Tue, 26 Feb 2013 21:25:18 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QLPHSA069380;
     Tue, 26 Feb 2013 21:25:17 GMT (envelope-from np@svn.freebsd.org)
    Received: (from np@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QLPHua069379;
     Tue, 26 Feb 2013 21:25:17 GMT (envelope-from np@svn.freebsd.org)
    Message-Id: <201302262125.r1QLPHua069379@svn.freebsd.org>
    From: Navdeep Parhar 
    Date: Tue, 26 Feb 2013 21:25:17 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247355 - head/sys/dev/cxgbe/common
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 21:25:18 -0000
    
    Author: np
    Date: Tue Feb 26 21:25:17 2013
    New Revision: 247355
    URL: http://svnweb.freebsd.org/changeset/base/247355
    
    Log:
      cxgbe(4): Report unusual out of band errors from the firmware.
      
      Obtained from:	Chelsio
      MFC after:	5 days
    
    Modified:
      head/sys/dev/cxgbe/common/t4_hw.c
    
    Modified: head/sys/dev/cxgbe/common/t4_hw.c
    ==============================================================================
    --- head/sys/dev/cxgbe/common/t4_hw.c	Tue Feb 26 21:17:38 2013	(r247354)
    +++ head/sys/dev/cxgbe/common/t4_hw.c	Tue Feb 26 21:25:17 2013	(r247355)
    @@ -154,6 +154,36 @@ u32 t4_hw_pci_read_cfg4(adapter_t *adap,
     }
     
     /*
    + *	t4_report_fw_error - report firmware error
    + *	@adap: the adapter
    + *
    + *	The adapter firmware can indicate error conditions to the host.
    + *	This routine prints out the reason for the firmware error (as
    + *	reported by the firmware).
    + */
    +static void t4_report_fw_error(struct adapter *adap)
    +{
    +	static const char *reason[] = {
    +		"Crash",			/* PCIE_FW_EVAL_CRASH */
    +		"During Device Preparation",	/* PCIE_FW_EVAL_PREP */
    +		"During Device Configuration",	/* PCIE_FW_EVAL_CONF */
    +		"During Device Initialization",	/* PCIE_FW_EVAL_INIT */
    +		"Unexpected Event",		/* PCIE_FW_EVAL_UNEXPECTEDEVENT */
    +		"Insufficient Airflow",		/* PCIE_FW_EVAL_OVERHEAT */
    +		"Device Shutdown",		/* PCIE_FW_EVAL_DEVICESHUTDOWN */
    +		"Reserved",			/* reserved */
    +	};
    +	u32 pcie_fw;
    +
    +	pcie_fw = t4_read_reg(adap, A_PCIE_FW);
    +	if (!(pcie_fw & F_PCIE_FW_ERR))
    +		CH_ERR(adap, "Firmware error report called with no error\n");
    +	else
    +		CH_ERR(adap, "Firmware reports adapter error: %s\n",
    +		       reason[G_PCIE_FW_EVAL(pcie_fw)]);
    +}
    +
    +/*
      * Get the reply to a mailbox command and store it in @rpl in big-endian order.
      */
     static void get_mbox_rpl(struct adapter *adap, __be64 *rpl, int nflit,
    @@ -267,8 +297,15 @@ int t4_wr_mbox_meat(struct adapter *adap
     		}
     	}
     
    +	/*
    +	 * We timed out waiting for a reply to our mailbox command.  Report
    +	 * the error and also check to see if the firmware reported any
    +	 * errors ...
    +	 */
     	CH_ERR(adap, "command %#x in mailbox %d timed out\n",
     	       *(const u8 *)cmd, mbox);
    +	if (t4_read_reg(adap, A_PCIE_FW) & F_PCIE_FW_ERR)
    +		t4_report_fw_error(adap);
     	return -ETIMEDOUT;
     }
     
    @@ -2033,9 +2070,11 @@ static void cim_intr_handler(struct adap
     		{ F_TIMEOUTMAINT , "CIM PIF MA timeout", -1, 1 },
     		{ 0 }
     	};
    -
     	int fat;
     
    +	if (t4_read_reg(adapter, A_PCIE_FW) & F_PCIE_FW_ERR)
    +		t4_report_fw_error(adapter);
    +
     	fat = t4_handle_intr_status(adapter, A_CIM_HOST_INT_CAUSE,
     				    cim_intr_info) +
     	      t4_handle_intr_status(adapter, A_CIM_HOST_UPACC_INT_CAUSE,
    @@ -4103,12 +4142,16 @@ retry:
     	/*
     	 * Issue the HELLO command to the firmware.  If it's not successful
     	 * but indicates that we got a "busy" or "timeout" condition, retry
    -	 * the HELLO until we exhaust our retry limit.
    +	 * the HELLO until we exhaust our retry limit.  If we do exceed our
    +	 * retry limit, check to see if the firmware left us any error
    +	 * information and report that if so ...
     	 */
     	ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
     	if (ret != FW_SUCCESS) {
     		if ((ret == -EBUSY || ret == -ETIMEDOUT) && retries-- > 0)
     			goto retry;
    +		if (t4_read_reg(adap, A_PCIE_FW) & F_PCIE_FW_ERR)
    +			t4_report_fw_error(adap);
     		return ret;
     	}
     
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 21:37:13 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 2F9793D7;
     Tue, 26 Feb 2013 21:37:13 +0000 (UTC)
     (envelope-from mjacob@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 176EB206;
     Tue, 26 Feb 2013 21:37:13 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QLbC9q072766;
     Tue, 26 Feb 2013 21:37:12 GMT (envelope-from mjacob@svn.freebsd.org)
    Received: (from mjacob@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QLbCw2072765;
     Tue, 26 Feb 2013 21:37:12 GMT (envelope-from mjacob@svn.freebsd.org)
    Message-Id: <201302262137.r1QLbCw2072765@svn.freebsd.org>
    From: Matt Jacob 
    Date: Tue, 26 Feb 2013 21:37:12 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247356 - head/sys/dev/isp
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 21:37:13 -0000
    
    Author: mjacob
    Date: Tue Feb 26 21:37:12 2013
    New Revision: 247356
    URL: http://svnweb.freebsd.org/changeset/base/247356
    
    Log:
      Remove redundant xpt_alloc_ccb in isp_target_thread that was causing leakage.
      
      Pointed out by:	Sascha Wildner of DragonFly BSD
      MFC after:	1 week
    
    Modified:
      head/sys/dev/isp/isp_freebsd.c
    
    Modified: head/sys/dev/isp/isp_freebsd.c
    ==============================================================================
    --- head/sys/dev/isp/isp_freebsd.c	Tue Feb 26 21:25:17 2013	(r247355)
    +++ head/sys/dev/isp/isp_freebsd.c	Tue Feb 26 21:37:12 2013	(r247356)
    @@ -4140,8 +4140,6 @@ isp_target_thread(ispsoftc_t *isp, int c
     		return;
     	}
     
    -	ccb = xpt_alloc_ccb();
    -
     	ISP_LOCK(isp);
     	status = cam_periph_alloc(isptargctor, NULL, isptargdtor, isptargstart, "isptarg", CAM_PERIPH_BIO, wpath, NULL, 0, softc);
     	if (status != CAM_REQ_CMP) {
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 22:08:00 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 673B1CD5;
     Tue, 26 Feb 2013 22:08:00 +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 4200932F;
     Tue, 26 Feb 2013 22:08:00 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QM80Zx082100;
     Tue, 26 Feb 2013 22:08:00 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QM80Eb082098;
     Tue, 26 Feb 2013 22:08:00 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302262208.r1QM80Eb082098@svn.freebsd.org>
    From: John Baldwin 
    Date: Tue, 26 Feb 2013 22:08: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: r247357 - stable/9/sys/dev/pci
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 22:08:00 -0000
    
    Author: jhb
    Date: Tue Feb 26 22:07:59 2013
    New Revision: 247357
    URL: http://svnweb.freebsd.org/changeset/base/247357
    
    Log:
      MFC 240473:
      Add some registers defined in PCI 3.0 including new AER bits.
    
    Modified:
      stable/9/sys/dev/pci/pcireg.h
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/dev/pci/pcireg.h
    ==============================================================================
    --- stable/9/sys/dev/pci/pcireg.h	Tue Feb 26 21:37:12 2013	(r247356)
    +++ stable/9/sys/dev/pci/pcireg.h	Tue Feb 26 22:07:59 2013	(r247357)
    @@ -64,6 +64,7 @@
     #define	PCIM_CMD_BACKTOBACK	0x0200
     #define	PCIM_CMD_INTxDIS	0x0400
     #define	PCIR_STATUS	0x06
    +#define	PCIM_STATUS_INTxSTATE	0x0008
     #define	PCIM_STATUS_CAPPRESENT	0x0010
     #define	PCIM_STATUS_66CAPABLE	0x0020
     #define	PCIM_STATUS_BACKTOBACK	0x0080
    @@ -134,11 +135,22 @@
     #define	PCIZ_VC		0x0002	/* Virtual Channel */
     #define	PCIZ_SERNUM	0x0003	/* Device Serial Number */
     #define	PCIZ_PWRBDGT	0x0004	/* Power Budgeting */
    +#define	PCIZ_RCLINK_DCL	0x0005	/* Root Complex Link Declaration */
    +#define	PCIZ_RCLINK_CTL	0x0006	/* Root Complex Internal Link Control */
    +#define	PCIZ_RCEC_ASSOC	0x0007	/* Root Complex Event Collector Association */
    +#define	PCIZ_MFVC	0x0008	/* Multi-Function Virtual Channel */
    +#define	PCIZ_RCRB	0x000a	/* RCRB Header */
     #define	PCIZ_VENDOR	0x000b	/* Vendor Unique */
     #define	PCIZ_ACS	0x000d	/* Access Control Services */
     #define	PCIZ_ARI	0x000e	/* Alternative Routing-ID Interpretation */
     #define	PCIZ_ATS	0x000f	/* Address Translation Services */
     #define	PCIZ_SRIOV	0x0010	/* Single Root IO Virtualization */
    +#define	PCIZ_MULTICAST	0x0012	/* Multicast */
    +#define	PCIZ_RESIZE_BAR	0x0015	/* Resizable BAR */
    +#define	PCIZ_DPA	0x0016	/* Dynamic Power Allocation */
    +#define	PCIZ_TPH_REQ	0x0017	/* TPH Requester */
    +#define	PCIZ_LTR	0x0018	/* Latency Tolerance Reporting */
    +#define	PCIZ_SEC_PCIE	0x0019	/* Secondary PCI Express */
     
     /* config registers for header type 0 devices */
     
    @@ -913,6 +925,10 @@
     #define	PCIM_AER_UC_ECRC_ERROR		0x00080000
     #define	PCIM_AER_UC_UNSUPPORTED_REQUEST	0x00100000
     #define	PCIM_AER_UC_ACS_VIOLATION	0x00200000
    +#define	PCIM_AER_UC_INTERNAL_ERROR	0x00400000
    +#define	PCIM_AER_UC_MC_BLOCKED_TLP	0x00800000
    +#define	PCIM_AER_UC_ATOMIC_EGRESS_BLK	0x01000000
    +#define	PCIM_AER_UC_TLP_PREFIX_BLOCKED	0x02000000
     #define	PCIR_AER_UC_MASK	0x08	/* Shares bits with UC_STATUS */
     #define	PCIR_AER_UC_SEVERITY	0x0c	/* Shares bits with UC_STATUS */
     #define	PCIR_AER_COR_STATUS	0x10
    @@ -922,6 +938,8 @@
     #define	PCIM_AER_COR_REPLAY_ROLLOVER	0x00000100
     #define	PCIM_AER_COR_REPLAY_TIMEOUT	0x00001000
     #define	PCIM_AER_COR_ADVISORY_NF_ERROR	0x00002000
    +#define	PCIM_AER_COR_INTERNAL_ERROR	0x00004000
    +#define	PCIM_AER_COR_HEADER_LOG_OVFLOW	0x00008000
     #define	PCIR_AER_COR_MASK	0x14	/* Shares bits with COR_STATUS */
     #define	PCIR_AER_CAP_CONTROL	0x18
     #define	PCIM_AER_FIRST_ERROR_PTR	0x0000001f
    @@ -929,6 +947,9 @@
     #define	PCIM_AER_ECRC_GEN_ENABLE	0x00000040
     #define	PCIM_AER_ECRC_CHECK_CAPABLE	0x00000080
     #define	PCIM_AER_ECRC_CHECK_ENABLE	0x00000100
    +#define	PCIM_AER_MULT_HDR_CAPABLE	0x00000200
    +#define	PCIM_AER_MULT_HDR_ENABLE	0x00000400
    +#define	PCIM_AER_TLP_PREFIX_LOG_PRESENT	0x00000800
     #define	PCIR_AER_HEADER_LOG	0x1c
     #define	PCIR_AER_ROOTERR_CMD	0x2c	/* Only for root complex ports */
     #define	PCIM_AER_ROOTERR_COR_ENABLE	0x00000001
    @@ -945,6 +966,7 @@
     #define	PCIM_AER_ROOTERR_INT_MESSAGE	0xf8000000
     #define	PCIR_AER_COR_SOURCE_ID	0x34	/* Only for root complex ports */
     #define	PCIR_AER_ERR_SOURCE_ID	0x36	/* Only for root complex ports */
    +#define	PCIR_AER_TLP_PREFIX_LOG	0x38	/* Only for TLP prefix functions */
     
     /* Virtual Channel definitions */
     #define	PCIR_VC_CAP1		0x04
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 22:08:11 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 5ED38E26;
     Tue, 26 Feb 2013 22:08:11 +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 5207D331;
     Tue, 26 Feb 2013 22:08:11 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QM8BRZ082180;
     Tue, 26 Feb 2013 22:08:11 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QM8BDi082179;
     Tue, 26 Feb 2013 22:08:11 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302262208.r1QM8BDi082179@svn.freebsd.org>
    From: John Baldwin 
    Date: Tue, 26 Feb 2013 22:08:11 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247358 - stable/8/sys/dev/pci
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 22:08:11 -0000
    
    Author: jhb
    Date: Tue Feb 26 22:08:10 2013
    New Revision: 247358
    URL: http://svnweb.freebsd.org/changeset/base/247358
    
    Log:
      MFC 240473:
      Add some registers defined in PCI 3.0 including new AER bits.
    
    Modified:
      stable/8/sys/dev/pci/pcireg.h
    Directory Properties:
      stable/8/sys/   (props changed)
    
    Modified: stable/8/sys/dev/pci/pcireg.h
    ==============================================================================
    --- stable/8/sys/dev/pci/pcireg.h	Tue Feb 26 22:07:59 2013	(r247357)
    +++ stable/8/sys/dev/pci/pcireg.h	Tue Feb 26 22:08:10 2013	(r247358)
    @@ -64,6 +64,7 @@
     #define	PCIM_CMD_BACKTOBACK	0x0200
     #define	PCIM_CMD_INTxDIS	0x0400
     #define	PCIR_STATUS	0x06
    +#define	PCIM_STATUS_INTxSTATE	0x0008
     #define	PCIM_STATUS_CAPPRESENT	0x0010
     #define	PCIM_STATUS_66CAPABLE	0x0020
     #define	PCIM_STATUS_BACKTOBACK	0x0080
    @@ -135,11 +136,22 @@
     #define	PCIZ_VC		0x0002	/* Virtual Channel */
     #define	PCIZ_SERNUM	0x0003	/* Device Serial Number */
     #define	PCIZ_PWRBDGT	0x0004	/* Power Budgeting */
    +#define	PCIZ_RCLINK_DCL	0x0005	/* Root Complex Link Declaration */
    +#define	PCIZ_RCLINK_CTL	0x0006	/* Root Complex Internal Link Control */
    +#define	PCIZ_RCEC_ASSOC	0x0007	/* Root Complex Event Collector Association */
    +#define	PCIZ_MFVC	0x0008	/* Multi-Function Virtual Channel */
    +#define	PCIZ_RCRB	0x000a	/* RCRB Header */
     #define	PCIZ_VENDOR	0x000b	/* Vendor Unique */
     #define	PCIZ_ACS	0x000d	/* Access Control Services */
     #define	PCIZ_ARI	0x000e	/* Alternative Routing-ID Interpretation */
     #define	PCIZ_ATS	0x000f	/* Address Translation Services */
     #define	PCIZ_SRIOV	0x0010	/* Single Root IO Virtualization */
    +#define	PCIZ_MULTICAST	0x0012	/* Multicast */
    +#define	PCIZ_RESIZE_BAR	0x0015	/* Resizable BAR */
    +#define	PCIZ_DPA	0x0016	/* Dynamic Power Allocation */
    +#define	PCIZ_TPH_REQ	0x0017	/* TPH Requester */
    +#define	PCIZ_LTR	0x0018	/* Latency Tolerance Reporting */
    +#define	PCIZ_SEC_PCIE	0x0019	/* Secondary PCI Express */
     
     /* config registers for header type 0 devices */
     
    @@ -910,6 +922,10 @@
     #define	PCIM_AER_UC_ECRC_ERROR		0x00080000
     #define	PCIM_AER_UC_UNSUPPORTED_REQUEST	0x00100000
     #define	PCIM_AER_UC_ACS_VIOLATION	0x00200000
    +#define	PCIM_AER_UC_INTERNAL_ERROR	0x00400000
    +#define	PCIM_AER_UC_MC_BLOCKED_TLP	0x00800000
    +#define	PCIM_AER_UC_ATOMIC_EGRESS_BLK	0x01000000
    +#define	PCIM_AER_UC_TLP_PREFIX_BLOCKED	0x02000000
     #define	PCIR_AER_UC_MASK	0x08	/* Shares bits with UC_STATUS */
     #define	PCIR_AER_UC_SEVERITY	0x0c	/* Shares bits with UC_STATUS */
     #define	PCIR_AER_COR_STATUS	0x10
    @@ -919,6 +935,8 @@
     #define	PCIM_AER_COR_REPLAY_ROLLOVER	0x00000100
     #define	PCIM_AER_COR_REPLAY_TIMEOUT	0x00001000
     #define	PCIM_AER_COR_ADVISORY_NF_ERROR	0x00002000
    +#define	PCIM_AER_COR_INTERNAL_ERROR	0x00004000
    +#define	PCIM_AER_COR_HEADER_LOG_OVFLOW	0x00008000
     #define	PCIR_AER_COR_MASK	0x14	/* Shares bits with COR_STATUS */
     #define	PCIR_AER_CAP_CONTROL	0x18
     #define	PCIM_AER_FIRST_ERROR_PTR	0x0000001f
    @@ -926,6 +944,9 @@
     #define	PCIM_AER_ECRC_GEN_ENABLE	0x00000040
     #define	PCIM_AER_ECRC_CHECK_CAPABLE	0x00000080
     #define	PCIM_AER_ECRC_CHECK_ENABLE	0x00000100
    +#define	PCIM_AER_MULT_HDR_CAPABLE	0x00000200
    +#define	PCIM_AER_MULT_HDR_ENABLE	0x00000400
    +#define	PCIM_AER_TLP_PREFIX_LOG_PRESENT	0x00000800
     #define	PCIR_AER_HEADER_LOG	0x1c
     #define	PCIR_AER_ROOTERR_CMD	0x2c	/* Only for root complex ports */
     #define	PCIM_AER_ROOTERR_COR_ENABLE	0x00000001
    @@ -942,6 +963,7 @@
     #define	PCIM_AER_ROOTERR_INT_MESSAGE	0xf8000000
     #define	PCIR_AER_COR_SOURCE_ID	0x34	/* Only for root complex ports */
     #define	PCIR_AER_ERR_SOURCE_ID	0x36	/* Only for root complex ports */
    +#define	PCIR_AER_TLP_PREFIX_LOG	0x38	/* Only for TLP prefix functions */
     
     /* Virtual Channel definitions */
     #define	PCIR_VC_CAP1		0x04
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 23:18:36 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 9713F386;
     Tue, 26 Feb 2013 23:18:36 +0000 (UTC)
     (envelope-from n_hibma@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 89A7B8AF;
     Tue, 26 Feb 2013 23:18:36 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QNIaUt003864;
     Tue, 26 Feb 2013 23:18:36 GMT (envelope-from n_hibma@svn.freebsd.org)
    Received: (from n_hibma@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QNIauL003863;
     Tue, 26 Feb 2013 23:18:36 GMT (envelope-from n_hibma@svn.freebsd.org)
    Message-Id: <201302262318.r1QNIauL003863@svn.freebsd.org>
    From: Nick Hibma 
    Date: Tue, 26 Feb 2013 23:18:36 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247359 - head/sbin/reboot
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 23:18:36 -0000
    
    Author: n_hibma
    Date: Tue Feb 26 23:18:35 2013
    New Revision: 247359
    URL: http://svnweb.freebsd.org/changeset/base/247359
    
    Log:
      Clarify that overriding the -h/-D flags through flags in device.hints
      only works for sio(4) but not for uart(4) which no longer has this flag.
    
    Modified:
      head/sbin/reboot/boot_i386.8
    
    Modified: head/sbin/reboot/boot_i386.8
    ==============================================================================
    --- head/sbin/reboot/boot_i386.8	Tue Feb 26 22:08:10 2013	(r247358)
    +++ head/sbin/reboot/boot_i386.8	Tue Feb 26 23:18:35 2013	(r247359)
    @@ -220,15 +220,14 @@ you can use the
     option to force the kernel to use the serial port as its
     console device.
     The serial port driver
    -.Xr uart 4
    +.Xr sio 4
    +(but not
    +.Xr uart 4 )
     has a flag (0x20) to override this option.
     If that flag is set, the serial port will always be used as the console,
     regardless of the
     .Fl h
     option described here.
    -See the man page for
    -.Xr uart 4
    -for more details.
     .It Fl m
     mute the console to suppress all console input and output during the
     boot.
    
    From owner-svn-src-all@FreeBSD.ORG  Tue Feb 26 23:35:29 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id A5343942;
     Tue, 26 Feb 2013 23:35:29 +0000 (UTC)
     (envelope-from attilio@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 881A8941;
     Tue, 26 Feb 2013 23:35:29 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1QNZT8O009329;
     Tue, 26 Feb 2013 23:35:29 GMT (envelope-from attilio@svn.freebsd.org)
    Received: (from attilio@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1QNZR4x009316;
     Tue, 26 Feb 2013 23:35:27 GMT (envelope-from attilio@svn.freebsd.org)
    Message-Id: <201302262335.r1QNZR4x009316@svn.freebsd.org>
    From: Attilio Rao 
    Date: Tue, 26 Feb 2013 23:35:27 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247360 - in head/sys: arm/arm powerpc/booke vm
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Tue, 26 Feb 2013 23:35:29 -0000
    
    Author: attilio
    Date: Tue Feb 26 23:35:27 2013
    New Revision: 247360
    URL: http://svnweb.freebsd.org/changeset/base/247360
    
    Log:
      Merge from vmc-playground branch:
      Replace the sub-optimal uma_zone_set_obj() primitive with more modern
      uma_zone_reserve_kva().  The new primitive reserves before hand
      the necessary KVA space to cater the zone allocations and allocates pages
      with ALLOC_NOOBJ.  More specifically:
      - uma_zone_reserve_kva() does not need an object to cater the backend
        allocator.
      - uma_zone_reserve_kva() can cater M_WAITOK requests, in order to
        serve zones which need to do uma_prealloc() too.
      - When possible, uma_zone_reserve_kva() uses directly the direct-mapping
        by uma_small_alloc() rather than relying on the KVA / offset
        combination.
      
      The removal of the object attribute allows 2 further changes:
      1) _vm_object_allocate() becomes static within vm_object.c
      2) VM_OBJECT_LOCK_INIT() is removed.  This function is replaced by
         direct calls to mtx_init() as there is no need to export it anymore
         and the calls aren't either homogeneous anymore: there are now small
         differences between arguments passed to mtx_init().
      
      Sponsored by:	EMC / Isilon storage division
      Reviewed by:	alc (which also offered almost all the comments)
      Tested by:	pho, jhb, davide
    
    Modified:
      head/sys/arm/arm/pmap-v6.c
      head/sys/arm/arm/pmap.c
      head/sys/powerpc/booke/pmap.c
      head/sys/vm/swap_pager.c
      head/sys/vm/uma.h
      head/sys/vm/uma_core.c
      head/sys/vm/uma_int.h
      head/sys/vm/vm_map.c
      head/sys/vm/vm_object.c
      head/sys/vm/vm_object.h
    
    Modified: head/sys/arm/arm/pmap-v6.c
    ==============================================================================
    --- head/sys/arm/arm/pmap-v6.c	Tue Feb 26 23:18:35 2013	(r247359)
    +++ head/sys/arm/arm/pmap-v6.c	Tue Feb 26 23:35:27 2013	(r247360)
    @@ -392,7 +392,6 @@ static uma_zone_t l2table_zone;
     static vm_offset_t pmap_kernel_l2dtable_kva;
     static vm_offset_t pmap_kernel_l2ptp_kva;
     static vm_paddr_t pmap_kernel_l2ptp_phys;
    -static struct vm_object pvzone_obj;
     static int pv_entry_count=0, pv_entry_max=0, pv_entry_high_water=0;
     static struct rwlock pvh_global_lock;
     
    @@ -1164,7 +1163,7 @@ pmap_init(void)
     	    NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
     	TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
     	pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
    -	uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max);
    +	uma_zone_reserve_kva(pvzone, pv_entry_max);
     	pv_entry_high_water = 9 * (pv_entry_max / 10);
     
     	/*
    
    Modified: head/sys/arm/arm/pmap.c
    ==============================================================================
    --- head/sys/arm/arm/pmap.c	Tue Feb 26 23:18:35 2013	(r247359)
    +++ head/sys/arm/arm/pmap.c	Tue Feb 26 23:35:27 2013	(r247360)
    @@ -397,7 +397,6 @@ static uma_zone_t l2table_zone;
     static vm_offset_t pmap_kernel_l2dtable_kva;
     static vm_offset_t pmap_kernel_l2ptp_kva;
     static vm_paddr_t pmap_kernel_l2ptp_phys;
    -static struct vm_object pvzone_obj;
     static int pv_entry_count=0, pv_entry_max=0, pv_entry_high_water=0;
     static struct rwlock pvh_global_lock;
     
    @@ -1828,7 +1827,7 @@ pmap_init(void)
     	    NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
     	TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
     	pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
    -	uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max);
    +	uma_zone_reserve_kva(pvzone, pv_entry_max);
     	pv_entry_high_water = 9 * (pv_entry_max / 10);
     
     	/*
    
    Modified: head/sys/powerpc/booke/pmap.c
    ==============================================================================
    --- head/sys/powerpc/booke/pmap.c	Tue Feb 26 23:18:35 2013	(r247359)
    +++ head/sys/powerpc/booke/pmap.c	Tue Feb 26 23:35:27 2013	(r247360)
    @@ -217,7 +217,6 @@ static struct rwlock_padalign pvh_global
     
     /* Data for the pv entry allocation mechanism */
     static uma_zone_t pvzone;
    -static struct vm_object pvzone_obj;
     static int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0;
     
     #define PV_ENTRY_ZONE_MIN	2048	/* min pv entries in uma zone */
    @@ -1343,7 +1342,7 @@ mmu_booke_init(mmu_t mmu)
     	TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max);
     	pv_entry_high_water = 9 * (pv_entry_max / 10);
     
    -	uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max);
    +	uma_zone_reserve_kva(pvzone, pv_entry_max);
     
     	/* Pre-fill pvzone with initial number of pv entries. */
     	uma_prealloc(pvzone, PV_ENTRY_ZONE_MIN);
    
    Modified: head/sys/vm/swap_pager.c
    ==============================================================================
    --- head/sys/vm/swap_pager.c	Tue Feb 26 23:18:35 2013	(r247359)
    +++ head/sys/vm/swap_pager.c	Tue Feb 26 23:35:27 2013	(r247360)
    @@ -343,7 +343,6 @@ SYSCTL_INT(_vm, OID_AUTO, swap_async_max
     static struct mtx sw_alloc_mtx;	/* protect list manipulation */
     static struct pagerlst	swap_pager_object_list[NOBJLISTS];
     static uma_zone_t	swap_zone;
    -static struct vm_object	swap_zone_obj;
     
     /*
      * pagerops for OBJT_SWAP - "swap pager".  Some ops are also global procedure
    @@ -554,7 +553,7 @@ swap_pager_swap_init(void)
     	if (swap_zone == NULL)
     		panic("failed to create swap_zone.");
     	do {
    -		if (uma_zone_set_obj(swap_zone, &swap_zone_obj, n))
    +		if (uma_zone_reserve_kva(swap_zone, n))
     			break;
     		/*
     		 * if the allocation failed, try a zone two thirds the
    
    Modified: head/sys/vm/uma.h
    ==============================================================================
    --- head/sys/vm/uma.h	Tue Feb 26 23:18:35 2013	(r247359)
    +++ head/sys/vm/uma.h	Tue Feb 26 23:35:27 2013	(r247360)
    @@ -432,24 +432,23 @@ void uma_reclaim(void);
     void uma_set_align(int align);
     
     /*
    - * Switches the backing object of a zone
    + * Reserves the maximum KVA space required by the zone and configures the zone
    + * to use a VM_ALLOC_NOOBJ-based backend allocator.
      *
      * Arguments:
      *	zone  The zone to update.
    - *	obj   The VM object to use for future allocations.
    - *	size  The size of the object to allocate.
    + *	nitems  The upper limit on the number of items that can be allocated.
      *
      * Returns:
    - *	0  if kva space can not be allocated
    + *	0  if KVA space can not be allocated
      *	1  if successful
      *
      * Discussion:
    - *	A NULL object can be used and uma will allocate one for you.  Setting
    - *	the size will limit the amount of memory allocated to this zone.
    - *
    + *	When the machine supports a direct map and the zone's items are smaller
    + *	than a page, the zone will use the direct map instead of allocating KVA
    + *	space.
      */
    -struct vm_object;
    -int uma_zone_set_obj(uma_zone_t zone, struct vm_object *obj, int size);
    +int uma_zone_reserve_kva(uma_zone_t zone, int nitems);
     
     /*
      * Sets a high limit on the number of items allowed in a zone
    @@ -521,7 +520,7 @@ void uma_zone_set_zinit(uma_zone_t zone,
     void uma_zone_set_zfini(uma_zone_t zone, uma_fini zfini);
     
     /*
    - * Replaces the standard page_alloc or obj_alloc functions for this zone
    + * Replaces the standard backend allocator for this zone.
      *
      * Arguments:
      *	zone   The zone whose backend allocator is being changed.
    
    Modified: head/sys/vm/uma_core.c
    ==============================================================================
    --- head/sys/vm/uma_core.c	Tue Feb 26 23:18:35 2013	(r247359)
    +++ head/sys/vm/uma_core.c	Tue Feb 26 23:35:27 2013	(r247360)
    @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    +#include 
     #include 
     #include 
     #include 
    @@ -213,7 +214,7 @@ enum zfreeskip { SKIP_NONE, SKIP_DTOR, S
     
     /* Prototypes.. */
     
    -static void *obj_alloc(uma_zone_t, int, u_int8_t *, int);
    +static void *noobj_alloc(uma_zone_t, int, u_int8_t *, int);
     static void *page_alloc(uma_zone_t, int, u_int8_t *, int);
     static void *startup_alloc(uma_zone_t, int, u_int8_t *, int);
     static void page_free(void *, int, u_int8_t);
    @@ -1030,50 +1031,53 @@ page_alloc(uma_zone_t zone, int bytes, u
      *	NULL if M_NOWAIT is set.
      */
     static void *
    -obj_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait)
    +noobj_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait)
     {
    -	vm_object_t object;
    +	TAILQ_HEAD(, vm_page) alloctail;
    +	u_long npages;
     	vm_offset_t retkva, zkva;
    -	vm_page_t p;
    -	int pages, startpages;
    +	vm_page_t p, p_next;
     	uma_keg_t keg;
     
    +	TAILQ_INIT(&alloctail);
     	keg = zone_first_keg(zone);
    -	object = keg->uk_obj;
    -	retkva = 0;
     
    -	/*
    -	 * This looks a little weird since we're getting one page at a time.
    -	 */
    -	VM_OBJECT_LOCK(object);
    -	p = TAILQ_LAST(&object->memq, pglist);
    -	pages = p != NULL ? p->pindex + 1 : 0;
    -	startpages = pages;
    -	zkva = keg->uk_kva + pages * PAGE_SIZE;
    -	for (; bytes > 0; bytes -= PAGE_SIZE) {
    -		p = vm_page_alloc(object, pages,
    -		    VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED);
    -		if (p == NULL) {
    -			if (pages != startpages)
    -				pmap_qremove(retkva, pages - startpages);
    -			while (pages != startpages) {
    -				pages--;
    -				p = TAILQ_LAST(&object->memq, pglist);
    -				vm_page_unwire(p, 0);
    -				vm_page_free(p);
    -			}
    -			retkva = 0;
    -			goto done;
    +	npages = howmany(bytes, PAGE_SIZE);
    +	while (npages > 0) {
    +		p = vm_page_alloc(NULL, 0, VM_ALLOC_INTERRUPT |
    +		    VM_ALLOC_WIRED | VM_ALLOC_NOOBJ);
    +		if (p != NULL) {
    +			/*
    +			 * Since the page does not belong to an object, its
    +			 * listq is unused.
    +			 */
    +			TAILQ_INSERT_TAIL(&alloctail, p, listq);
    +			npages--;
    +			continue;
    +		}
    +		if (wait & M_WAITOK) {
    +			VM_WAIT;
    +			continue;
     		}
    +
    +		/*
    +		 * Page allocation failed, free intermediate pages and
    +		 * exit.
    +		 */
    +		TAILQ_FOREACH_SAFE(p, &alloctail, listq, p_next) {
    +			vm_page_unwire(p, 0);
    +			vm_page_free(p); 
    +		}
    +		return (NULL);
    +	}
    +	*flags = UMA_SLAB_PRIV;
    +	zkva = keg->uk_kva +
    +	    atomic_fetchadd_long(&keg->uk_offset, round_page(bytes));
    +	retkva = zkva;
    +	TAILQ_FOREACH(p, &alloctail, listq) {
     		pmap_qenter(zkva, &p, 1);
    -		if (retkva == 0)
    -			retkva = zkva;
     		zkva += PAGE_SIZE;
    -		pages += 1;
     	}
    -done:
    -	VM_OBJECT_UNLOCK(object);
    -	*flags = UMA_SLAB_PRIV;
     
     	return ((void *)retkva);
     }
    @@ -3012,7 +3016,7 @@ uma_zone_set_allocf(uma_zone_t zone, uma
     
     /* See uma.h */
     int
    -uma_zone_set_obj(uma_zone_t zone, struct vm_object *obj, int count)
    +uma_zone_reserve_kva(uma_zone_t zone, int count)
     {
     	uma_keg_t keg;
     	vm_offset_t kva;
    @@ -3024,21 +3028,25 @@ uma_zone_set_obj(uma_zone_t zone, struct
     	if (pages * keg->uk_ipers < count)
     		pages++;
     
    -	kva = kmem_alloc_nofault(kernel_map, pages * UMA_SLAB_SIZE);
    -
    -	if (kva == 0)
    -		return (0);
    -	if (obj == NULL)
    -		obj = vm_object_allocate(OBJT_PHYS, pages);
    -	else {
    -		VM_OBJECT_LOCK_INIT(obj, "uma object");
    -		_vm_object_allocate(OBJT_PHYS, pages, obj);
    -	}
    +#ifdef UMA_MD_SMALL_ALLOC
    +	if (keg->uk_ppera > 1) {
    +#else
    +	if (1) {
    +#endif
    +		kva = kmem_alloc_nofault(kernel_map, pages * UMA_SLAB_SIZE);
    +		if (kva == 0)
    +			return (0);
    +	} else
    +		kva = 0;
     	ZONE_LOCK(zone);
     	keg->uk_kva = kva;
    -	keg->uk_obj = obj;
    +	keg->uk_offset = 0;
     	keg->uk_maxpages = pages;
    -	keg->uk_allocf = obj_alloc;
    +#ifdef UMA_MD_SMALL_ALLOC
    +	keg->uk_allocf = (keg->uk_ppera > 1) ? noobj_alloc : uma_small_alloc;
    +#else
    +	keg->uk_allocf = noobj_alloc;
    +#endif
     	keg->uk_flags |= UMA_ZONE_NOFREE | UMA_ZFLAG_PRIVALLOC;
     	ZONE_UNLOCK(zone);
     	return (1);
    
    Modified: head/sys/vm/uma_int.h
    ==============================================================================
    --- head/sys/vm/uma_int.h	Tue Feb 26 23:18:35 2013	(r247359)
    +++ head/sys/vm/uma_int.h	Tue Feb 26 23:35:27 2013	(r247360)
    @@ -221,8 +221,8 @@ struct uma_keg {
     	uma_alloc	uk_allocf;	/* Allocation function */
     	uma_free	uk_freef;	/* Free routine */
     
    -	struct vm_object	*uk_obj;	/* Zone specific object */
    -	vm_offset_t	uk_kva;		/* Base kva for zones with objs */
    +	u_long		uk_offset;	/* Next free offset from base KVA */
    +	vm_offset_t	uk_kva;		/* Zone base KVA */
     	uma_zone_t	uk_slabzone;	/* Slab zone backing us, if OFFPAGE */
     
     	u_int16_t	uk_pgoff;	/* Offset to uma_slab struct */
    
    Modified: head/sys/vm/vm_map.c
    ==============================================================================
    --- head/sys/vm/vm_map.c	Tue Feb 26 23:18:35 2013	(r247359)
    +++ head/sys/vm/vm_map.c	Tue Feb 26 23:35:27 2013	(r247360)
    @@ -125,7 +125,6 @@ static uma_zone_t mapentzone;
     static uma_zone_t kmapentzone;
     static uma_zone_t mapzone;
     static uma_zone_t vmspace_zone;
    -static struct vm_object kmapentobj;
     static int vmspace_zinit(void *mem, int size, int flags);
     static void vmspace_zfini(void *mem, int size);
     static int vm_map_zinit(void *mem, int ize, int flags);
    @@ -303,7 +302,7 @@ vmspace_alloc(min, max)
     void
     vm_init2(void)
     {
    -	uma_zone_set_obj(kmapentzone, &kmapentobj, lmin(cnt.v_page_count,
    +	uma_zone_reserve_kva(kmapentzone, lmin(cnt.v_page_count,
     	    (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE) / 8 +
     	     maxproc * 2 + maxfiles);
     	vmspace_zone = uma_zcreate("VMSPACE", sizeof(struct vmspace), NULL,
    
    Modified: head/sys/vm/vm_object.c
    ==============================================================================
    --- head/sys/vm/vm_object.c	Tue Feb 26 23:18:35 2013	(r247359)
    +++ head/sys/vm/vm_object.c	Tue Feb 26 23:35:27 2013	(r247360)
    @@ -194,7 +194,7 @@ vm_object_zinit(void *mem, int size, int
     
     	object = (vm_object_t)mem;
     	bzero(&object->mtx, sizeof(object->mtx));
    -	VM_OBJECT_LOCK_INIT(object, "standard object");
    +	mtx_init(&object->mtx, "vm object", NULL, MTX_DEF | MTX_DUPOK);
     
     	/* These are true for any object that has been freed */
     	object->paging_in_progress = 0;
    @@ -203,7 +203,7 @@ vm_object_zinit(void *mem, int size, int
     	return (0);
     }
     
    -void
    +static void
     _vm_object_allocate(objtype_t type, vm_pindex_t size, vm_object_t object)
     {
     
    @@ -266,7 +266,7 @@ vm_object_init(void)
     	TAILQ_INIT(&vm_object_list);
     	mtx_init(&vm_object_list_mtx, "vm object_list", NULL, MTX_DEF);
     	
    -	VM_OBJECT_LOCK_INIT(kernel_object, "kernel object");
    +	mtx_init(&kernel_object->mtx, "vm object", "kernel object", MTX_DEF);
     	_vm_object_allocate(OBJT_PHYS, OFF_TO_IDX(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS),
     	    kernel_object);
     #if VM_NRESERVLEVEL > 0
    @@ -274,7 +274,7 @@ vm_object_init(void)
     	kernel_object->pg_color = (u_short)atop(VM_MIN_KERNEL_ADDRESS);
     #endif
     
    -	VM_OBJECT_LOCK_INIT(kmem_object, "kmem object");
    +	mtx_init(&kmem_object->mtx, "vm object", "kmem object", MTX_DEF);
     	_vm_object_allocate(OBJT_PHYS, OFF_TO_IDX(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS),
     	    kmem_object);
     #if VM_NRESERVLEVEL > 0
    
    Modified: head/sys/vm/vm_object.h
    ==============================================================================
    --- head/sys/vm/vm_object.h	Tue Feb 26 23:18:35 2013	(r247359)
    +++ head/sys/vm/vm_object.h	Tue Feb 26 23:35:27 2013	(r247360)
    @@ -206,9 +206,6 @@ extern struct vm_object kmem_object_stor
     #define	VM_OBJECT_LOCK(object)		mtx_lock(&(object)->mtx)
     #define	VM_OBJECT_LOCK_ASSERT(object, type) \
     					mtx_assert(&(object)->mtx, (type))
    -#define	VM_OBJECT_LOCK_INIT(object, type) \
    -					mtx_init(&(object)->mtx, "vm object", \
    -					    (type), MTX_DEF | MTX_DUPOK)
     #define	VM_OBJECT_LOCKED(object)	mtx_owned(&(object)->mtx)
     #define	VM_OBJECT_SLEEP(object, wchan, pri, wmesg, timo) \
     					msleep((wchan), &(object)->mtx, (pri), \
    @@ -234,7 +231,6 @@ void vm_object_pip_wakeupn(vm_object_t o
     void vm_object_pip_wait(vm_object_t object, char *waitid);
     
     vm_object_t vm_object_allocate (objtype_t, vm_pindex_t);
    -void _vm_object_allocate (objtype_t, vm_pindex_t, vm_object_t);
     boolean_t vm_object_coalesce(vm_object_t, vm_ooffset_t, vm_size_t, vm_size_t,
        boolean_t);
     void vm_object_collapse (vm_object_t);
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 00:01:28 2013
    Return-Path: 
    Delivered-To: svn-src-all@FreeBSD.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id BA6F952A;
     Wed, 27 Feb 2013 00:01:28 +0000 (UTC) (envelope-from grog@lemis.com)
    Received: from w3.lemis.com (w3.lemis.com [208.86.224.149])
     by mx1.freebsd.org (Postfix) with ESMTP id 75B6AA4F;
     Wed, 27 Feb 2013 00:01:28 +0000 (UTC)
    Received: from eureka.lemis.com (1032.x.rootbsd.net [208.86.224.149])
     by w3.lemis.com (Postfix) with ESMTP id BB0833B736;
     Wed, 27 Feb 2013 00:01:26 +0000 (UTC)
    Received: by eureka.lemis.com (Postfix, from userid 1004)
     id 7D460F74FA; Wed, 27 Feb 2013 11:01:25 +1100 (EST)
    Date: Wed, 27 Feb 2013 11:01:25 +1100
    From: Greg 'groggy' Lehey 
    To: Jilles Tjoelker 
    Subject: Re: svn commit: r247274 - in head: bin/test tools/regression/bin/test
    Message-ID: <20130227000125.GA7223@eureka.lemis.com>
    References: <201302251905.r1PJ5fKF085179@svn.freebsd.org>
     <20130226000227.GA80718@stack.nl>
    Mime-Version: 1.0
    Content-Type: multipart/signed; micalg=pgp-sha1;
     protocol="application/pgp-signature"; boundary="RnlQjJ0d97Da+TV1"
    Content-Disposition: inline
    In-Reply-To: <20130226000227.GA80718@stack.nl>
    User-Agent: Mutt/1.4.2.3i
    Organization: The FreeBSD Project
    Phone: +61-3-5346-1370
    Mobile: +61-418-838-708
    WWW-Home-Page: http://www.FreeBSD.org/
    X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F  09AC 22E6 F290 507A 4223
    Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
     Peter Jeremy , src-committers@FreeBSD.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 00:01:28 -0000
    
    
    --RnlQjJ0d97Da+TV1
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    
    On Tuesday, 26 February 2013 at  1:02:27 +0100, Jilles Tjoelker wrote:
    > On Mon, Feb 25, 2013 at 07:05:41PM +0000, Peter Jeremy wrote:
    >> Author: peterj
    >> Date: Mon Feb 25 19:05:40 2013
    >> New Revision: 247274
    >> URL: http://svnweb.freebsd.org/changeset/base/247274
    >
    >> Log:
    >>   Enhance test(1) by adding provision to compare any combination of the
    >>   access, birth, change and modify times of two files, instead of only
    >>   being able to compare modify times.  The builtin test in sh(1) will
    >>   automagically acquire the same expansion.
    >
    >>   Approved by:	grog
    >>   MFC after:	2 weeks
    >
    > What do you need this for?
    
    Lots of things.  For example, I need it to compare photos I have
    created and then set the timestamp to the time of exposure.  The only
    way I can establish that the image is newer is via the creation
    timestamp.  In the past I've wished I had the functionality for other
    reasons I now forget.  Peter has other reasons again.  I expect other
    users to also find this useful.
    
    Arguably comparing different kinds of timestamps is not very useful,
    but then, that's "arguably".  Others might find a use for it.
    
    > If it is not needed very often, this test can
    > be done more portably (older FreeBSD and GNU) as
    >   [ -n "$(find -L FILE1 -prune -newerXY FILE2 2>/dev/null)" ]
    
    That's really ugly.  It's also difficult for the casual reader to
    understand.
    
    > I have generally been rather reluctant in adding things to sh(1) and
    > even more so if they are completely new. Someone proposed something
    > rather similar (except that it added a time string parser -- even more
    > code) in PR bin/57054 and I rejected it in 2009.
    
    That was a much larger chunk of code.  And times change.  In December
    1998 I added an -S option to ls(1), and jkh (my mentor) refused it on
    the basis of bloat.  In June 2005, keramida submitted similar
    functionality, and it was committed as revision 146924.  It's also
    functionality that I use frequently.
    
    Re bloat.  Here's before and after:
    
       text    data     bss     dec     hex filename
      25645    1152    4720   31517    7b1d /bin/ls
      26718    1168    4840   32726    7fd6 /bin/ls
    
    A little over a kilobyte.  Peter even went to the trouble of keeping
    the size of the operator table entries the same.  I think the
    additional size is justifiable.
    
    Greg
    --
    Sent from my desktop computer.
    Finger grog@FreeBSD.org for PGP public key.
    See complete headers for address and phone numbers.
    This message is digitally signed.  If your Microsoft MUA reports
    problems, please read http://tinyurl.com/broken-mua
    
    --RnlQjJ0d97Da+TV1
    Content-Type: application/pgp-signature
    Content-Disposition: inline
    
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.19 (FreeBSD)
    
    iEYEARECAAYFAlEtTNQACgkQIubykFB6QiO7sQCfc/WV5Xbi4kxv+tn+1EMR6LCO
    DroAn3dbK/kQpgRG2xuJflfqmK389BN6
    =NPID
    -----END PGP SIGNATURE-----
    
    --RnlQjJ0d97Da+TV1--
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 00:14:13 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 3A798BB7;
     Wed, 27 Feb 2013 00:14:13 +0000 (UTC)
     (envelope-from gallatin@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 2AF90B17;
     Wed, 27 Feb 2013 00:14:13 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R0ECNS021674;
     Wed, 27 Feb 2013 00:14:12 GMT
     (envelope-from gallatin@svn.freebsd.org)
    Received: (from gallatin@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R0EC9M021673;
     Wed, 27 Feb 2013 00:14:12 GMT
     (envelope-from gallatin@svn.freebsd.org)
    Message-Id: <201302270014.r1R0EC9M021673@svn.freebsd.org>
    From: Andrew Gallatin 
    Date: Wed, 27 Feb 2013 00:14:12 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
    Subject: svn commit: r247365 - stable/9/sys/dev/mxge
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 00:14:13 -0000
    
    Author: gallatin
    Date: Wed Feb 27 00:14:12 2013
    New Revision: 247365
    URL: http://svnweb.freebsd.org/changeset/base/247365
    
    Log:
      Fix the build.
      
      Back out mis-guided compat shim that should not have been MFC'ed
    
    Modified:
      stable/9/sys/dev/mxge/if_mxge_var.h
    
    Modified: stable/9/sys/dev/mxge/if_mxge_var.h
    ==============================================================================
    --- stable/9/sys/dev/mxge/if_mxge_var.h	Tue Feb 26 23:54:17 2013	(r247364)
    +++ stable/9/sys/dev/mxge/if_mxge_var.h	Wed Feb 27 00:14:12 2013	(r247365)
    @@ -50,19 +50,6 @@ $FreeBSD$
     #define IFNET_BUF_RING 1
     #endif
     
    -#if (__FreeBSD_version < 1000020)
    -#undef IF_Kbps
    -#undef IF_Mbps
    -#undef IF_Gbps
    -#define	IF_Kbps(x)	((uintmax_t)(x) * 1000)	/* kilobits/sec. */
    -#define	IF_Mbps(x)	(IF_Kbps((x) * 1000))	/* megabits/sec. */
    -#define	IF_Gbps(x)	(IF_Mbps((x) * 1000))	/* gigabits/sec. */
    -static __inline void
    -if_initbaudrate(struct ifnet *ifp, uintmax_t baud)
    -{
    -	ifp->if_baudrate = baud;
    -}
    -#endif
     #ifndef VLAN_CAPABILITIES
     #define VLAN_CAPABILITIES(ifp)
     #define mxge_vlans_active(sc) (sc)->ifp->if_nvlans
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 00:25:45 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 6881B6C3;
     Wed, 27 Feb 2013 00:25:45 +0000 (UTC)
     (envelope-from adrian@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 4FF13CC9;
     Wed, 27 Feb 2013 00:25:45 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R0Pj7h024942;
     Wed, 27 Feb 2013 00:25:45 GMT (envelope-from adrian@svn.freebsd.org)
    Received: (from adrian@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R0Pi0E024938;
     Wed, 27 Feb 2013 00:25:44 GMT (envelope-from adrian@svn.freebsd.org)
    Message-Id: <201302270025.r1R0Pi0E024938@svn.freebsd.org>
    From: Adrian Chadd 
    Date: Wed, 27 Feb 2013 00:25:44 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247366 - in head/sys/dev/ath: . ath_hal
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 00:25:45 -0000
    
    Author: adrian
    Date: Wed Feb 27 00:25:44 2013
    New Revision: 247366
    URL: http://svnweb.freebsd.org/changeset/base/247366
    
    Log:
      Add in the STBC TX/RX capability support into the HAL and driver.
      
      The HAL already included the STBC fields; it just needed to be exposed
      to the driver and net80211 stack.
      
      This should allow single-stream STBC TX and RX to be negotiated; however
      the driver and rate control code currently don't do anything with it.
    
    Modified:
      head/sys/dev/ath/ath_hal/ah.c
      head/sys/dev/ath/ath_hal/ah.h
      head/sys/dev/ath/if_ath.c
      head/sys/dev/ath/if_athvar.h
    
    Modified: head/sys/dev/ath/ath_hal/ah.c
    ==============================================================================
    --- head/sys/dev/ath/ath_hal/ah.c	Wed Feb 27 00:14:12 2013	(r247365)
    +++ head/sys/dev/ath/ath_hal/ah.c	Wed Feb 27 00:25:44 2013	(r247366)
    @@ -692,6 +692,10 @@ ath_hal_getcapability(struct ath_hal *ah
     		return pCap->hal4AddrAggrSupport ? HAL_OK : HAL_ENOTSUPP;
     	case HAL_CAP_EXT_CHAN_DFS:
     		return pCap->halExtChanDfsSupport ? HAL_OK : HAL_ENOTSUPP;
    +	case HAL_CAP_RX_STBC:
    +		return pCap->halRxStbcSupport ? HAL_OK : HAL_ENOTSUPP;
    +	case HAL_CAP_TX_STBC:
    +		return pCap->halTxStbcSupport ? HAL_OK : HAL_ENOTSUPP;
     	case HAL_CAP_COMBINED_RADAR_RSSI:
     		return pCap->halUseCombinedRadarRssi ? HAL_OK : HAL_ENOTSUPP;
     	case HAL_CAP_AUTO_SLEEP:
    
    Modified: head/sys/dev/ath/ath_hal/ah.h
    ==============================================================================
    --- head/sys/dev/ath/ath_hal/ah.h	Wed Feb 27 00:14:12 2013	(r247365)
    +++ head/sys/dev/ath/ath_hal/ah.h	Wed Feb 27 00:25:44 2013	(r247366)
    @@ -137,6 +137,9 @@ typedef enum {
     	HAL_CAP_RIFS_RX_ENABLED	= 53,
     	HAL_CAP_BB_DFS_HANG	= 54,
     
    +	HAL_CAP_RX_STBC		= 58,
    +	HAL_CAP_TX_STBC		= 59,
    +
     	HAL_CAP_BT_COEX		= 60,	/* hardware is capable of bluetooth coexistence */
     	HAL_CAP_DYNAMIC_SMPS	= 61,	/* Dynamic MIMO Power Save hardware support */
     
    
    Modified: head/sys/dev/ath/if_ath.c
    ==============================================================================
    --- head/sys/dev/ath/if_ath.c	Wed Feb 27 00:14:12 2013	(r247365)
    +++ head/sys/dev/ath/if_ath.c	Wed Feb 27 00:25:44 2013	(r247366)
    @@ -781,6 +781,28 @@ ath_attach(u_int16_t devid, struct ath_s
     		ic->ic_txstream = txs;
     		ic->ic_rxstream = rxs;
     
    +		/*
    +		 * Setup TX and RX STBC based on what the HAL allows and
    +		 * the currently configured chainmask set.
    +		 * Ie - don't enable STBC TX if only one chain is enabled.
    +		 * STBC RX is fine on a single RX chain; it just won't
    +		 * provide any real benefit.
    +		 */
    +		if (ath_hal_getcapability(ah, HAL_CAP_RX_STBC, 0,
    +		    NULL) == HAL_OK) {
    +			sc->sc_rx_stbc = 1;
    +			device_printf(sc->sc_dev,
    +			    "[HT] 1 stream STBC receive enabled\n");
    +			ic->ic_htcaps |= IEEE80211_HTCAP_RXSTBC_1STREAM;
    +		}
    +		if (txs > 1 && ath_hal_getcapability(ah, HAL_CAP_TX_STBC, 0,
    +		    NULL) == HAL_OK) {
    +			sc->sc_tx_stbc = 1;
    +			device_printf(sc->sc_dev,
    +			    "[HT] 1 stream STBC transmit enabled\n");
    +			ic->ic_htcaps |= IEEE80211_HTCAP_TXSTBC;
    +		}
    +
     		(void) ath_hal_getcapability(ah, HAL_CAP_RTS_AGGR_LIMIT, 1,
     		    &sc->sc_rts_aggr_limit);
     		if (sc->sc_rts_aggr_limit != (64 * 1024))
    
    Modified: head/sys/dev/ath/if_athvar.h
    ==============================================================================
    --- head/sys/dev/ath/if_athvar.h	Wed Feb 27 00:14:12 2013	(r247365)
    +++ head/sys/dev/ath/if_athvar.h	Wed Feb 27 00:25:44 2013	(r247366)
    @@ -567,7 +567,9 @@ struct ath_softc {
     	/*
     	 * Second set of flags.
     	 */
    -	u_int32_t		sc_use_ent  : 1;
    +	u_int32_t		sc_use_ent  : 1,
    +				sc_rx_stbc  : 1,
    +				sc_tx_stbc  : 1;
     
     	/*
     	 * Enterprise mode configuration for AR9380 and later chipsets.
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 00:35:41 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id C71A1DE6;
     Wed, 27 Feb 2013 00:35:41 +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 B866ED53;
     Wed, 27 Feb 2013 00:35:41 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R0ZfNS028014;
     Wed, 27 Feb 2013 00:35:41 GMT (envelope-from smh@svn.freebsd.org)
    Received: (from smh@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R0Zft7028012;
     Wed, 27 Feb 2013 00:35:41 GMT (envelope-from smh@svn.freebsd.org)
    Message-Id: <201302270035.r1R0Zft7028012@svn.freebsd.org>
    From: Steven Hartland 
    Date: Wed, 27 Feb 2013 00:35:41 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247367 - head/sys/dev/mfi
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 00:35:41 -0000
    
    Author: smh
    Date: Wed Feb 27 00:35:40 2013
    New Revision: 247367
    URL: http://svnweb.freebsd.org/changeset/base/247367
    
    Log:
      Fixes mfi panic on recused on non-recusive mutex MFI I/O lock
      
      Removes a mtx_unlock call for mfi_io_lock which is never aquired
      
      While I'm here fix a braceing style issue.
      
      Reviewed by:	Doug Ambrisko
      Approved by:	pjd (mentor)
      MFC after:	1 month
    
    Modified:
      head/sys/dev/mfi/mfi.c
      head/sys/dev/mfi/mfi_tbolt.c
    
    Modified: head/sys/dev/mfi/mfi.c
    ==============================================================================
    --- head/sys/dev/mfi/mfi.c	Wed Feb 27 00:25:44 2013	(r247366)
    +++ head/sys/dev/mfi/mfi.c	Wed Feb 27 00:35:40 2013	(r247367)
    @@ -723,10 +723,8 @@ mfi_attach(struct mfi_softc *sc)
     		    "hook\n");
     		return (EINVAL);
     	}
    -	if ((error = mfi_aen_setup(sc, 0), 0) != 0) {
    -		mtx_unlock(&sc->mfi_io_lock);
    +	if ((error = mfi_aen_setup(sc, 0), 0) != 0)
     		return (error);
    -	}
     
     	/*
     	 * Register a shutdown handler.
    
    Modified: head/sys/dev/mfi/mfi_tbolt.c
    ==============================================================================
    --- head/sys/dev/mfi/mfi_tbolt.c	Wed Feb 27 00:25:44 2013	(r247366)
    +++ head/sys/dev/mfi/mfi_tbolt.c	Wed Feb 27 00:35:40 2013	(r247367)
    @@ -1194,6 +1194,7 @@ mfi_process_fw_state_chg_isr(void *arg)
     			sc->hw_crit_error= 1;
     			return ;
     		}
    +		mtx_unlock(&sc->mfi_io_lock);
     		if ((error = mfi_tbolt_init_MFI_queue(sc)) != 0)
     				return;
     
    @@ -1225,7 +1226,9 @@ mfi_process_fw_state_chg_isr(void *arg)
     			/*
     			 * Initiate AEN (Asynchronous Event Notification)
     			 */
    +			mtx_unlock(&sc->mfi_io_lock);
     			mfi_aen_setup(sc, sc->last_seq_num);
    +			mtx_lock(&sc->mfi_io_lock);
     			sc->issuepend_done = 1;
     			device_printf(sc->mfi_dev, "second stage of reset "
     			    "complete, FW is ready now.\n");
    @@ -1237,7 +1240,6 @@ mfi_process_fw_state_chg_isr(void *arg)
     		device_printf(sc->mfi_dev, "mfi_process_fw_state_chg_isr "
     		    "called with unhandled value:%d\n", sc->adpreset);
     	}
    -	mtx_unlock(&sc->mfi_io_lock);
     }
     
     /*
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 00:49:33 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 11AD12C8;
     Wed, 27 Feb 2013 00:49:33 +0000 (UTC)
     (envelope-from adrian@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 035F4E01;
     Wed, 27 Feb 2013 00:49:33 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R0nWn5031492;
     Wed, 27 Feb 2013 00:49:32 GMT (envelope-from adrian@svn.freebsd.org)
    Received: (from adrian@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R0nWjC031491;
     Wed, 27 Feb 2013 00:49:32 GMT (envelope-from adrian@svn.freebsd.org)
    Message-Id: <201302270049.r1R0nWjC031491@svn.freebsd.org>
    From: Adrian Chadd 
    Date: Wed, 27 Feb 2013 00:49:32 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247368 - head/sys/dev/ath
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 00:49:33 -0000
    
    Author: adrian
    Date: Wed Feb 27 00:49:32 2013
    New Revision: 247368
    URL: http://svnweb.freebsd.org/changeset/base/247368
    
    Log:
      Enable STBC for the given rate series if it's negotiated:
      
      * If both ends have negotiated (at least) one stream;
      * Only if it's a single stream rate (MCS0-7);
      * Only if there's more than one TX chain enabled.
      
      Tested:
      
      * AR9280 STA mode -> Atheros AP; tested both MCS2 (STBC) and MCS12 (no STBC.)
        Verified using athalq to inspect the TX descriptors.
      
      TODO:
      
      * Test AR5416 - no STBC should be enabled;
      * Test AR9280 with one TX chain enabled - no STBC should be enabled.
    
    Modified:
      head/sys/dev/ath/if_ath_tx_ht.c
    
    Modified: head/sys/dev/ath/if_ath_tx_ht.c
    ==============================================================================
    --- head/sys/dev/ath/if_ath_tx_ht.c	Wed Feb 27 00:35:40 2013	(r247367)
    +++ head/sys/dev/ath/if_ath_tx_ht.c	Wed Feb 27 00:49:32 2013	(r247368)
    @@ -536,17 +536,30 @@ ath_rateseries_setup(struct ath_softc *s
     			series[i].RateFlags |= HAL_RATESERIES_HALFGI;
     
     		/*
    -		 * XXX TODO: STBC if it's possible
    +		 * Setup rate and TX power cap for this series.
     		 */
    +		series[i].Rate = rt->info[rc[i].rix].rateCode;
    +		series[i].RateIndex = rc[i].rix;
    +		series[i].tx_power_cap = 0x3f;	/* XXX for now */
    +
    +
    +		/*
    +		 * If we have STBC TX enabled and the receiver
    +		 * can receive (at least) 1 stream STBC, AND it's
    +		 * MCS 0-7, AND we have at least two chains enabled,
    +		 * enable STBC.
    +		 */
    +		if (ic->ic_htcaps & IEEE80211_HTCAP_TXSTBC &&
    +		    ni->ni_htcap & IEEE80211_HTCAP_RXSTBC_1STREAM &&
    +		    (sc->sc_cur_txchainmask > 1) &&
    +		    HT_RC_2_STREAMS(series[i].Rate) == 1) {
    +			series[i].RateFlags |= HAL_RATESERIES_STBC;
    +		}
     
     		/*
     		 * XXX TODO: LDPC if it's possible
     		 */
     
    -		series[i].Rate = rt->info[rc[i].rix].rateCode;
    -		series[i].RateIndex = rc[i].rix;
    -		series[i].tx_power_cap = 0x3f;	/* XXX for now */
    -
     		/*
     		 * PktDuration doesn't include slot, ACK, RTS, etc timing -
     		 * it's just the packet duration
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 02:21:11 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 85BB8F10;
     Wed, 27 Feb 2013 02:21:11 +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 5E18C219;
     Wed, 27 Feb 2013 02:21:11 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R2LBD6061416;
     Wed, 27 Feb 2013 02:21:11 GMT (envelope-from smh@svn.freebsd.org)
    Received: (from smh@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R2LA8q061406;
     Wed, 27 Feb 2013 02:21:10 GMT (envelope-from smh@svn.freebsd.org)
    Message-Id: <201302270221.r1R2LA8q061406@svn.freebsd.org>
    From: Steven Hartland 
    Date: Wed, 27 Feb 2013 02:21:10 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247369 - head/sys/dev/mfi
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 02:21:11 -0000
    
    Author: smh
    Date: Wed Feb 27 02:21:10 2013
    New Revision: 247369
    URL: http://svnweb.freebsd.org/changeset/base/247369
    
    Log:
      Fixes queuing issues where mfi_release_command blindly sets the cm_flags = 0
      without first removing the command from the relavent queue.
      
      This was causing panics in the queue functions which check to ensure a command
      is not on another queue.
      
      Fixed some cases where the error from mfi_mapcmd was lost and where the command
      was never released / dequeued in error cases.
      
      Ensure that all failures to mfi_mapcmd are logged.
      
      Fixed possible null pointer exception in mfi_aen_setup if mfi_get_log_state
      failed.
      
      Fixed mfi_parse_entries & mfi_aen_setup not returning possible errors.
      
      Corrected MFI_DUMP_CMDS calls with invalid vars SC vs sc.
      
      Commands which have timed out now set cm_error to ETIMEDOUT and call
      mfi_complete which prevents them getting stuck in the busy queue forever.
      
      Fixed possible use of NULL pointer in mfi_tbolt_get_cmd.
      
      Changed output formats to be more easily recognisable when debugging.
      
      Optimised mfi_cmd_pool_tbolt cleanup.
      
      Made information about driver limiting commands always display as for modern
      cards this can be severe.
      
      Fixed mfi_tbolt_alloc_cmd out of memory case which previously didnt return an
      error.
      
      Added malloc checks for request_desc_pool including free when subsiquent errors
      are detected.
      
      Fixed overflow error in SIMD reply descriptor check.
      
      Fixed tbolt_cmd leak in mfi_build_and_issue_cmd if there's an error during IO
      build.
      
      Elimintated double checks on sc->mfi_aen_cm & sc->mfi_map_sync_cm in
      mfi_shutdown.
      
      Move local hdr calculation after error check in mfi_aen_complete.
      
      Fixed wakeup on NULL in mfi_aen_complete.
      
      Fixed mfi_aen_cm cleanup in mfi_process_fw_state_chg_isr not checking if it was
      NULL.
      
      Changed mfi_alloc_commands to error if bus_dmamap_create fails. Previously we
      would try to continue with the number of allocated commands but lots of places
      in the driver assume sc->mfi_max_fw_cmds is whats available so its unsafe to do
      this without lots of changes.
      
      Removed mfi_total_cmds as its no longer used due the above change.
      
      Corrected mfi_tbolt_alloc_cmd to return ENOMEM where appropriate.
      
      Fixed timeouts actually firing at double what they should.
      
      Setting hw.mfi.max_cmds=-1 now configures to use the controller max.
      
      A few style (9) fixes e.g. braced single line conditions and double blank lines
      
      Cleaned up queuing macros
      
      Removed invalid queuing tests for multiple queues
      
      Trap and deal with errors when doing sends in mfi_data_cb
      
      Refactored frame sending into one method with error checking of the return
      code so we can ensure commands aren't left on the queue after error. This
      ensures that mfi_mapcmd & mfi_data_cb leave the queue in a valid state.
      
      Refactored how commands are cleaned up, mfi_release_command now ensures
      that all queues and command state is maintained in a consistent state.
      
      Prevent NULL pointer use in mfi_tbolt_complete_cmd
      
      Fixed use of NULL sc->mfi_map_sync_cm in wakeup
      
      Added defines to help with output of mfi_cmd and header flags.
      
      Fixed mfi_tbolt_init_MFI_queue invalidating cm_index of the acquired mfi_cmd.
      
      Reset now reinitialises sync map as well as AEN.
      
      Fixed possible use of NULL pointer in mfi_build_and_issue_cmd
      
      Fixed mfi_tbolt_init_MFI_queue call to mfi_process_fw_state_chg_isr causing
      panic on failure.
      
      Ensure that tbolt cards always initialise next_host_reply_index and
      free_host_reply_index (based off mfi_max_fw_cmds) on both startup and
      reset as per the linux driver.
      
      Fixed mfi_tbolt_complete_cmd not acknowledging unknown commands so
      it didn't clear the controller.
      
      Prevent locks from being dropped and re-acquired in the following functions
      which was allowing multiple threads to enter critical methods such as
      mfi_tbolt_complete_cmd & mfi_process_fw_state_chg_isr:-
      * mfi_tbolt_init_MFI_queue
      * mfi_aen_complete / mfi_aen_register
      * mfi_tbolt_sync_map_info
      * mfi_get_log_state
      * mfi_parse_entries
      
      The locking for these functions was promoting to higher level methods. This
      also fixed MFI_LINUX_SET_AEN_2 which was already acquiring the lock, so would
      have paniced for recursive lock.
      
      This also required changing malloc of ld_sync in mfi_tbolt_sync_map_info to
      M_NOWAIT which can hence now fail but this was already expected as its return
      was being tested.
      
      Removed the assignment of cm_index in mfi_tbolt_init_MFI_queue which breaks
      the world if the cmd returned by mfi_dequeue_free isn't the first cmd.
      
      Fixed locking in mfi_data_cb, this is an async callback from bus_dmamap_load
      which could hence be called after the caller has dropped the lock. If we
      don't have the lock we aquire it and ensure we unlock before returning.
      
      Fixed locking mfi_comms_init when mfi_dequeue_free fails.
      
      Fixed mfi_build_and_issue_cmd not returning tbolt cmds aquired to the pool
      on error.
      
      Fixed mfi_abort not dropping the io lock when mfi_dequeue_free fails.
      
      Added hw.mfi.polled_cmd_timeout sysctl that enables tuning of polled
      timeouts. This shouldn't be reduced below 50 seconds as its used for
      firmware patching which can take quite some time.
      
      Added hw.mfi.fw_reset_test sysctl which is avaliable when compiled with
      MFI_DEBUG and allows the testing of controller reset that was provoking a
      large number of the issues encountered here.
      
      Reviewed by:	Doug Ambrisko
      Approved by:	pjd (mentor)
      MFC after:	1 month
    
    Modified:
      head/sys/dev/mfi/mfi.c
      head/sys/dev/mfi/mfi_cam.c
      head/sys/dev/mfi/mfi_debug.c
      head/sys/dev/mfi/mfi_tbolt.c
      head/sys/dev/mfi/mfireg.h
      head/sys/dev/mfi/mfivar.h
    
    Modified: head/sys/dev/mfi/mfi.c
    ==============================================================================
    --- head/sys/dev/mfi/mfi.c	Wed Feb 27 00:49:32 2013	(r247368)
    +++ head/sys/dev/mfi/mfi.c	Wed Feb 27 02:21:10 2013	(r247369)
    @@ -108,6 +108,7 @@ static void	mfi_bio_complete(struct mfi_
     static struct mfi_command *mfi_build_ldio(struct mfi_softc *,struct bio*);
     static struct mfi_command *mfi_build_syspdio(struct mfi_softc *,struct bio*);
     static int	mfi_send_frame(struct mfi_softc *, struct mfi_command *);
    +static int	mfi_std_send_frame(struct mfi_softc *, struct mfi_command *);
     static int	mfi_abort(struct mfi_softc *, struct mfi_command **);
     static int	mfi_linux_ioctl_int(struct cdev *, u_long, caddr_t, int, struct thread *);
     static void	mfi_timeout(void *);
    @@ -132,24 +133,30 @@ static int mfi_check_for_sscd(struct mfi
     SYSCTL_NODE(_hw, OID_AUTO, mfi, CTLFLAG_RD, 0, "MFI driver parameters");
     static int	mfi_event_locale = MFI_EVT_LOCALE_ALL;
     TUNABLE_INT("hw.mfi.event_locale", &mfi_event_locale);
    -SYSCTL_INT(_hw_mfi, OID_AUTO, event_locale, CTLFLAG_RW, &mfi_event_locale,
    -            0, "event message locale");
    +SYSCTL_INT(_hw_mfi, OID_AUTO, event_locale, CTLFLAG_RWTUN, &mfi_event_locale,
    +           0, "event message locale");
     
     static int	mfi_event_class = MFI_EVT_CLASS_INFO;
     TUNABLE_INT("hw.mfi.event_class", &mfi_event_class);
    -SYSCTL_INT(_hw_mfi, OID_AUTO, event_class, CTLFLAG_RW, &mfi_event_class,
    -          0, "event message class");
    +SYSCTL_INT(_hw_mfi, OID_AUTO, event_class, CTLFLAG_RWTUN, &mfi_event_class,
    +           0, "event message class");
     
     static int	mfi_max_cmds = 128;
     TUNABLE_INT("hw.mfi.max_cmds", &mfi_max_cmds);
    -SYSCTL_INT(_hw_mfi, OID_AUTO, max_cmds, CTLFLAG_RD, &mfi_max_cmds,
    -	   0, "Max commands");
    +SYSCTL_INT(_hw_mfi, OID_AUTO, max_cmds, CTLFLAG_RDTUN, &mfi_max_cmds,
    +	   0, "Max commands limit (-1 = controller limit)");
     
     static int	mfi_detect_jbod_change = 1;
     TUNABLE_INT("hw.mfi.detect_jbod_change", &mfi_detect_jbod_change);
    -SYSCTL_INT(_hw_mfi, OID_AUTO, detect_jbod_change, CTLFLAG_RW,
    +SYSCTL_INT(_hw_mfi, OID_AUTO, detect_jbod_change, CTLFLAG_RWTUN,
     	   &mfi_detect_jbod_change, 0, "Detect a change to a JBOD");
     
    +int		mfi_polled_cmd_timeout = MFI_POLL_TIMEOUT_SECS;
    +TUNABLE_INT("hw.mfi.polled_cmd_timeout", &mfi_polled_cmd_timeout);
    +SYSCTL_INT(_hw_mfi, OID_AUTO, polled_cmd_timeout, CTLFLAG_RWTUN,
    +	   &mfi_polled_cmd_timeout, 0,
    +	   "Polled command timeout - used for firmware flash etc (in seconds)");
    +
     /* Management interface */
     static d_open_t		mfi_open;
     static d_close_t	mfi_close;
    @@ -361,7 +368,7 @@ mfi_attach(struct mfi_softc *sc)
     {
     	uint32_t status;
     	int error, commsz, framessz, sensesz;
    -	int frames, unit, max_fw_sge;
    +	int frames, unit, max_fw_sge, max_fw_cmds;
     	uint32_t tb_mem_size = 0;
     
     	if (sc == NULL)
    @@ -456,7 +463,14 @@ mfi_attach(struct mfi_softc *sc)
     	 * instead of compile time.
     	 */
     	status = sc->mfi_read_fw_status(sc);
    -	sc->mfi_max_fw_cmds = status & MFI_FWSTATE_MAXCMD_MASK;
    +	max_fw_cmds = status & MFI_FWSTATE_MAXCMD_MASK;
    +	if (mfi_max_cmds > 0 && mfi_max_cmds < max_fw_cmds) {
    +		device_printf(sc->mfi_dev, "FW MaxCmds = %d, limiting to %d\n",
    +		    max_fw_cmds, mfi_max_cmds);
    +		sc->mfi_max_fw_cmds = mfi_max_cmds;
    +	} else {
    +		sc->mfi_max_fw_cmds = max_fw_cmds;
    +	}
     	max_fw_sge = (status & MFI_FWSTATE_MAXSGL_MASK) >> 16;
     	sc->mfi_max_sge = min(max_fw_sge, ((MFI_MAXPHYS / PAGE_SIZE) + 1));
     
    @@ -464,7 +478,8 @@ mfi_attach(struct mfi_softc *sc)
     
     	if (sc->mfi_flags & MFI_FLAGS_TBOLT) {
     		mfi_tbolt_init_globals(sc);
    -		device_printf(sc->mfi_dev, "MaxCmd = %x MaxSgl = %x state = %x \n",
    +		device_printf(sc->mfi_dev, "MaxCmd = %d, Drv MaxCmd = %d, "
    +		    "MaxSgl = %d, state = %#x\n", max_fw_cmds,
     		    sc->mfi_max_fw_cmds, sc->mfi_max_sge, status);
     		tb_mem_size = mfi_tbolt_get_memory_requirement(sc);
     
    @@ -503,8 +518,8 @@ mfi_attach(struct mfi_softc *sc)
     				0,			/* flags */
     				NULL, NULL,		/* lockfunc, lockarg */
     				&sc->mfi_tb_init_dmat)) {
    -		device_printf(sc->mfi_dev, "Cannot allocate init DMA tag\n");
    -		return (ENOMEM);
    +			device_printf(sc->mfi_dev, "Cannot allocate init DMA tag\n");
    +			return (ENOMEM);
     		}
     		if (bus_dmamem_alloc(sc->mfi_tb_init_dmat, (void **)&sc->mfi_tb_init,
     		    BUS_DMA_NOWAIT, &sc->mfi_tb_init_dmamap)) {
    @@ -683,11 +698,14 @@ mfi_attach(struct mfi_softc *sc)
     	/* ThunderBolt MFI_IOC2 INIT */
     	if (sc->mfi_flags & MFI_FLAGS_TBOLT) {
     		sc->mfi_disable_intr(sc);
    +		mtx_lock(&sc->mfi_io_lock);
     		if ((error = mfi_tbolt_init_MFI_queue(sc)) != 0) {
     			device_printf(sc->mfi_dev,
     			    "TB Init has failed with error %d\n",error);
    +			mtx_unlock(&sc->mfi_io_lock);
     			return error;
     		}
    +		mtx_unlock(&sc->mfi_io_lock);
     
     		if ((error = mfi_tbolt_alloc_cmd(sc)) != 0)
     			return error;
    @@ -723,8 +741,12 @@ mfi_attach(struct mfi_softc *sc)
     		    "hook\n");
     		return (EINVAL);
     	}
    -	if ((error = mfi_aen_setup(sc, 0), 0) != 0)
    +	mtx_lock(&sc->mfi_io_lock);
    +	if ((error = mfi_aen_setup(sc, 0), 0) != 0) {
    +		mtx_unlock(&sc->mfi_io_lock);
     		return (error);
    +	}
    +	mtx_unlock(&sc->mfi_io_lock);
     
     	/*
     	 * Register a shutdown handler.
    @@ -764,7 +786,9 @@ mfi_attach(struct mfi_softc *sc)
     	    mfi_timeout, sc);
     
     	if (sc->mfi_flags & MFI_FLAGS_TBOLT) {
    +		mtx_lock(&sc->mfi_io_lock);
     		mfi_tbolt_sync_map_info(sc);
    +		mtx_unlock(&sc->mfi_io_lock);
     	}
     
     	return (0);
    @@ -774,21 +798,16 @@ static int
     mfi_alloc_commands(struct mfi_softc *sc)
     {
     	struct mfi_command *cm;
    -	int i, ncmds;
    +	int i, j;
     
     	/*
     	 * XXX Should we allocate all the commands up front, or allocate on
     	 * demand later like 'aac' does?
     	 */
    -	ncmds = MIN(mfi_max_cmds, sc->mfi_max_fw_cmds);
    -	if (bootverbose)
    -		device_printf(sc->mfi_dev, "Max fw cmds= %d, sizing driver "
    -		   "pool to %d\n", sc->mfi_max_fw_cmds, ncmds);
    -
    -	sc->mfi_commands = malloc(sizeof(struct mfi_command) * ncmds, M_MFIBUF,
    -	    M_WAITOK | M_ZERO);
    +	sc->mfi_commands = malloc(sizeof(sc->mfi_commands[0]) *
    +	    sc->mfi_max_fw_cmds, M_MFIBUF, M_WAITOK | M_ZERO);
     
    -	for (i = 0; i < ncmds; i++) {
    +	for (i = 0; i < sc->mfi_max_fw_cmds; i++) {
     		cm = &sc->mfi_commands[i];
     		cm->cm_frame = (union mfi_frame *)((uintptr_t)sc->mfi_frames +
     		    sc->mfi_cmd_size * i);
    @@ -804,10 +823,20 @@ mfi_alloc_commands(struct mfi_softc *sc)
     			mtx_lock(&sc->mfi_io_lock);
     			mfi_release_command(cm);
     			mtx_unlock(&sc->mfi_io_lock);
    +		} else {
    +			device_printf(sc->mfi_dev, "Failed to allocate %d "
    +			   "command blocks, only allocated %d\n",
    +			    sc->mfi_max_fw_cmds, i - 1);
    +			for (j = 0; j < i; j++) {
    +				cm = &sc->mfi_commands[i];
    +				bus_dmamap_destroy(sc->mfi_buffer_dmat,
    +				    cm->cm_dmamap);
    +			}
    +			free(sc->mfi_commands, M_MFIBUF);
    +			sc->mfi_commands = NULL;
    +
    +			return (ENOMEM);
     		}
    -		else
    -			break;
    -		sc->mfi_total_cmds++;
     	}
     
     	return (0);
    @@ -832,6 +861,29 @@ mfi_release_command(struct mfi_command *
     		cm->cm_sg->sg32[0].addr = 0;
     	}
     
    +	/*
    +	 * Command may be on other queues e.g. busy queue depending on the
    +	 * flow of a previous call to mfi_mapcmd, so ensure its dequeued
    +	 * properly
    +	 */
    +	if ((cm->cm_flags & MFI_ON_MFIQ_BUSY) != 0)
    +		mfi_remove_busy(cm);
    +	if ((cm->cm_flags & MFI_ON_MFIQ_READY) != 0)
    +		mfi_remove_ready(cm);
    +
    +	/* We're not expecting it to be on any other queue but check */
    +	if ((cm->cm_flags & MFI_ON_MFIQ_MASK) != 0) {
    +		panic("Command %p is still on another queue, flags = %#x",
    +		    cm, cm->cm_flags);
    +	}
    +
    +	/* tbolt cleanup */
    +	if ((cm->cm_flags & MFI_CMD_TBOLT) != 0) {
    +		mfi_tbolt_return_cmd(cm->cm_sc,
    +		    cm->cm_sc->mfi_cmd_pool_tbolt[cm->cm_extra_frames - 1],
    +		    cm);
    +	}
    +
     	hdr_data = (uint32_t *)cm->cm_frame;
     	hdr_data[0] = 0;	/* cmd, sense_len, cmd_status, scsi_status */
     	hdr_data[1] = 0;	/* target_id, lun_id, cdb_len, sg_count */
    @@ -914,8 +966,10 @@ mfi_comms_init(struct mfi_softc *sc)
     	uint32_t context = 0;
     
     	mtx_lock(&sc->mfi_io_lock);
    -	if ((cm = mfi_dequeue_free(sc)) == NULL)
    +	if ((cm = mfi_dequeue_free(sc)) == NULL) {
    +		mtx_unlock(&sc->mfi_io_lock);
     		return (EBUSY);
    +	}
     
     	/* Zero out the MFI frame */
     	context = cm->cm_frame->header.context;
    @@ -944,15 +998,12 @@ mfi_comms_init(struct mfi_softc *sc)
     	cm->cm_data = NULL;
     	cm->cm_flags = MFI_CMD_POLLED;
     
    -	if ((error = mfi_mapcmd(sc, cm)) != 0) {
    +	if ((error = mfi_mapcmd(sc, cm)) != 0)
     		device_printf(sc->mfi_dev, "failed to send init command\n");
    -		mtx_unlock(&sc->mfi_io_lock);
    -		return (error);
    -	}
     	mfi_release_command(cm);
     	mtx_unlock(&sc->mfi_io_lock);
     
    -	return (0);
    +	return (error);
     }
     
     static int
    @@ -1003,7 +1054,7 @@ mfi_get_log_state(struct mfi_softc *sc, 
     	struct mfi_command *cm = NULL;
     	int error;
     
    -	mtx_lock(&sc->mfi_io_lock);
    +	mtx_assert(&sc->mfi_io_lock, MA_OWNED);
     	error = mfi_dcmd_command(sc, &cm, MFI_DCMD_CTRL_EVENT_GETINFO,
     	    (void **)log_state, sizeof(**log_state));
     	if (error)
    @@ -1022,7 +1073,6 @@ mfi_get_log_state(struct mfi_softc *sc, 
     out:
     	if (cm)
     		mfi_release_command(cm);
    -	mtx_unlock(&sc->mfi_io_lock);
     
     	return (error);
     }
    @@ -1035,32 +1085,32 @@ mfi_aen_setup(struct mfi_softc *sc, uint
     	int error = 0;
     	uint32_t seq;
     
    +	mtx_assert(&sc->mfi_io_lock, MA_OWNED);
    +
     	class_locale.members.reserved = 0;
     	class_locale.members.locale = mfi_event_locale;
     	class_locale.members.evt_class  = mfi_event_class;
     
     	if (seq_start == 0) {
    -		error = mfi_get_log_state(sc, &log_state);
    +		if ((error = mfi_get_log_state(sc, &log_state)) != 0)
    +			goto out;
     		sc->mfi_boot_seq_num = log_state->boot_seq_num;
    -		if (error) {
    -			if (log_state)
    -				free(log_state, M_MFIBUF);
    -			return (error);
    -		}
     
     		/*
     		 * Walk through any events that fired since the last
     		 * shutdown.
     		 */
    -		mfi_parse_entries(sc, log_state->shutdown_seq_num,
    -		    log_state->newest_seq_num);
    +		if ((error = mfi_parse_entries(sc, log_state->shutdown_seq_num,
    +		    log_state->newest_seq_num)) != 0)
    +			goto out;
     		seq = log_state->newest_seq_num;
     	} else
     		seq = seq_start;
    -	mfi_aen_register(sc, seq, class_locale.word);
    +	error = mfi_aen_register(sc, seq, class_locale.word);
    +out:
     	free(log_state, M_MFIBUF);
     
    -	return 0;
    +	return (error);
     }
     
     int
    @@ -1070,7 +1120,6 @@ mfi_wait_command(struct mfi_softc *sc, s
     	mtx_assert(&sc->mfi_io_lock, MA_OWNED);
     	cm->cm_complete = NULL;
     
    -
     	/*
     	 * MegaCli can issue a DCMD of 0.  In this case do nothing
     	 * and return 0 to it as status
    @@ -1098,12 +1147,13 @@ mfi_free(struct mfi_softc *sc)
     	if (sc->mfi_cdev != NULL)
     		destroy_dev(sc->mfi_cdev);
     
    -	if (sc->mfi_total_cmds != 0) {
    -		for (i = 0; i < sc->mfi_total_cmds; i++) {
    +	if (sc->mfi_commands != NULL) {
    +		for (i = 0; i < sc->mfi_max_fw_cmds; i++) {
     			cm = &sc->mfi_commands[i];
     			bus_dmamap_destroy(sc->mfi_buffer_dmat, cm->cm_dmamap);
     		}
     		free(sc->mfi_commands, M_MFIBUF);
    +		sc->mfi_commands = NULL;
     	}
     
     	if (sc->mfi_intr)
    @@ -1159,7 +1209,8 @@ mfi_free(struct mfi_softc *sc)
     		/* End LSIP200113393 */
     		/* ThunderBolt INIT packet memory Free */
     		if (sc->mfi_tb_init_busaddr != 0)
    -			bus_dmamap_unload(sc->mfi_tb_init_dmat, sc->mfi_tb_init_dmamap);
    +			bus_dmamap_unload(sc->mfi_tb_init_dmat,
    +			    sc->mfi_tb_init_dmamap);
     		if (sc->mfi_tb_init != NULL)
     			bus_dmamem_free(sc->mfi_tb_init_dmat, sc->mfi_tb_init,
     			    sc->mfi_tb_init_dmamap);
    @@ -1176,16 +1227,14 @@ mfi_free(struct mfi_softc *sc)
     			    sc->mfi_tb_ioc_init_dmamap);
     		if (sc->mfi_tb_ioc_init_dmat != NULL)
     			bus_dma_tag_destroy(sc->mfi_tb_ioc_init_dmat);
    -		for (int i = 0; i < sc->mfi_max_fw_cmds; i++) {
    -			if (sc->mfi_cmd_pool_tbolt != NULL) {
    +		if (sc->mfi_cmd_pool_tbolt != NULL) {
    +			for (int i = 0; i < sc->mfi_max_fw_cmds; i++) {
     				if (sc->mfi_cmd_pool_tbolt[i] != NULL) {
     					free(sc->mfi_cmd_pool_tbolt[i],
     					    M_MFIBUF);
     					sc->mfi_cmd_pool_tbolt[i] = NULL;
     				}
     			}
    -		}
    -		if (sc->mfi_cmd_pool_tbolt != NULL) {
     			free(sc->mfi_cmd_pool_tbolt, M_MFIBUF);
     			sc->mfi_cmd_pool_tbolt = NULL;
     		}
    @@ -1250,16 +1299,14 @@ restart:
     			cm->cm_error = 0;
     			mfi_complete(sc, cm);
     		}
    -		if (++ci == (sc->mfi_max_fw_cmds + 1)) {
    +		if (++ci == (sc->mfi_max_fw_cmds + 1))
     			ci = 0;
    -		}
     	}
     
     	sc->mfi_comms->hw_ci = ci;
     
     	/* Give defered I/O a chance to run */
    -	if (sc->mfi_flags & MFI_FLAGS_QFRZN)
    -		sc->mfi_flags &= ~MFI_FLAGS_QFRZN;
    +	sc->mfi_flags &= ~MFI_FLAGS_QFRZN;
     	mfi_startio(sc);
     	mtx_unlock(&sc->mfi_io_lock);
     
    @@ -1282,15 +1329,15 @@ mfi_shutdown(struct mfi_softc *sc)
     	int error;
     
     
    -	if (sc->mfi_aen_cm)
    +	if (sc->mfi_aen_cm != NULL) {
     		sc->cm_aen_abort = 1;
    -	if (sc->mfi_aen_cm != NULL)
     		mfi_abort(sc, &sc->mfi_aen_cm);
    +	}
     
    -	if (sc->mfi_map_sync_cm)
    +	if (sc->mfi_map_sync_cm != NULL) {
     		sc->cm_map_abort = 1;
    -	if (sc->mfi_map_sync_cm != NULL)
     		mfi_abort(sc, &sc->mfi_map_sync_cm);
    +	}
     
     	mtx_lock(&sc->mfi_io_lock);
     	error = mfi_dcmd_command(sc, &cm, MFI_DCMD_CTRL_SHUTDOWN, NULL, 0);
    @@ -1304,9 +1351,8 @@ mfi_shutdown(struct mfi_softc *sc)
     	cm->cm_flags = MFI_CMD_POLLED;
     	cm->cm_data = NULL;
     
    -	if ((error = mfi_mapcmd(sc, cm)) != 0) {
    +	if ((error = mfi_mapcmd(sc, cm)) != 0)
     		device_printf(sc->mfi_dev, "Failed to shutdown controller\n");
    -	}
     
     	mfi_release_command(cm);
     	mtx_unlock(&sc->mfi_io_lock);
    @@ -1372,8 +1418,10 @@ mfi_syspdprobe(struct mfi_softc *sc)
     	TAILQ_FOREACH_SAFE(syspd, &sc->mfi_syspd_tqh, pd_link, tmp) {
     		found = 0;
     		for (i = 0; i < pdlist->count; i++) {
    -			if (syspd->pd_id == pdlist->addr[i].device_id)
    +			if (syspd->pd_id == pdlist->addr[i].device_id) {
     				found = 1;
    +				break;
    +			}
     		}
     		if (found == 0) {
     			printf("DELETE\n");
    @@ -1626,6 +1674,8 @@ mfi_aen_register(struct mfi_softc *sc, i
     	struct mfi_evt_detail *ed = NULL;
     	int error = 0;
     
    +	mtx_assert(&sc->mfi_io_lock, MA_OWNED);
    +
     	current_aen.word = locale;
     	if (sc->mfi_aen_cm != NULL) {
     		prior_aen.word =
    @@ -1644,13 +1694,10 @@ mfi_aen_register(struct mfi_softc *sc, i
     		}
     	}
     
    -	mtx_lock(&sc->mfi_io_lock);
     	error = mfi_dcmd_command(sc, &cm, MFI_DCMD_CTRL_EVENT_WAIT,
     	    (void **)&ed, sizeof(*ed));
    -	mtx_unlock(&sc->mfi_io_lock);
    -	if (error) {
    +	if (error)
     		goto out;
    -	}
     
     	dcmd = &cm->cm_frame->dcmd;
     	((uint32_t *)&dcmd->mbox)[0] = seq;
    @@ -1661,10 +1708,8 @@ mfi_aen_register(struct mfi_softc *sc, i
     	sc->last_seq_num = seq;
     	sc->mfi_aen_cm = cm;
     
    -	mtx_lock(&sc->mfi_io_lock);
     	mfi_enqueue_ready(cm);
     	mfi_startio(sc);
    -	mtx_unlock(&sc->mfi_io_lock);
     
     out:
     	return (error);
    @@ -1682,11 +1727,11 @@ mfi_aen_complete(struct mfi_command *cm)
     	sc = cm->cm_sc;
     	mtx_assert(&sc->mfi_io_lock, MA_OWNED);
     
    -	hdr = &cm->cm_frame->header;
    -
     	if (sc->mfi_aen_cm == NULL)
     		return;
     
    +	hdr = &cm->cm_frame->header;
    +
     	if (sc->cm_aen_abort ||
     	    hdr->cmd_status == MFI_STAT_INVALID_STATUS) {
     		sc->cm_aen_abort = 0;
    @@ -1712,16 +1757,13 @@ mfi_aen_complete(struct mfi_command *cm)
     	}
     
     	free(cm->cm_data, M_MFIBUF);
    -	sc->mfi_aen_cm = NULL;
     	wakeup(&sc->mfi_aen_cm);
    +	sc->mfi_aen_cm = NULL;
     	mfi_release_command(cm);
     
     	/* set it up again so the driver can catch more events */
    -	if (!aborted) {
    -		mtx_unlock(&sc->mfi_io_lock);
    +	if (!aborted)
     		mfi_aen_setup(sc, seq);
    -		mtx_lock(&sc->mfi_io_lock);
    -	}
     }
     
     #define MAX_EVENTS 15
    @@ -1735,6 +1777,8 @@ mfi_parse_entries(struct mfi_softc *sc, 
     	union mfi_evt class_locale;
     	int error, i, seq, size;
     
    +	mtx_assert(&sc->mfi_io_lock, MA_OWNED);
    +
     	class_locale.members.reserved = 0;
     	class_locale.members.locale = mfi_event_locale;
     	class_locale.members.evt_class  = mfi_event_class;
    @@ -1746,13 +1790,10 @@ mfi_parse_entries(struct mfi_softc *sc, 
     		return (ENOMEM);
     
     	for (seq = start_seq;;) {
    -		mtx_lock(&sc->mfi_io_lock);
     		if ((cm = mfi_dequeue_free(sc)) == NULL) {
     			free(el, M_MFIBUF);
    -			mtx_unlock(&sc->mfi_io_lock);
     			return (EBUSY);
     		}
    -		mtx_unlock(&sc->mfi_io_lock);
     
     		dcmd = &cm->cm_frame->dcmd;
     		bzero(dcmd->mbox, MFI_MBOX_SIZE);
    @@ -1768,38 +1809,30 @@ mfi_parse_entries(struct mfi_softc *sc, 
     		cm->cm_data = el;
     		cm->cm_len = size;
     
    -		mtx_lock(&sc->mfi_io_lock);
     		if ((error = mfi_mapcmd(sc, cm)) != 0) {
     			device_printf(sc->mfi_dev,
     			    "Failed to get controller entries\n");
     			mfi_release_command(cm);
    -			mtx_unlock(&sc->mfi_io_lock);
     			break;
     		}
     
    -		mtx_unlock(&sc->mfi_io_lock);
     		bus_dmamap_sync(sc->mfi_buffer_dmat, cm->cm_dmamap,
     		    BUS_DMASYNC_POSTREAD);
     		bus_dmamap_unload(sc->mfi_buffer_dmat, cm->cm_dmamap);
     
     		if (dcmd->header.cmd_status == MFI_STAT_NOT_FOUND) {
    -			mtx_lock(&sc->mfi_io_lock);
     			mfi_release_command(cm);
    -			mtx_unlock(&sc->mfi_io_lock);
     			break;
     		}
     		if (dcmd->header.cmd_status != MFI_STAT_OK) {
     			device_printf(sc->mfi_dev,
     			    "Error %d fetching controller entries\n",
     			    dcmd->header.cmd_status);
    -			mtx_lock(&sc->mfi_io_lock);
     			mfi_release_command(cm);
    -			mtx_unlock(&sc->mfi_io_lock);
    +			error = EIO;
     			break;
     		}
    -		mtx_lock(&sc->mfi_io_lock);
     		mfi_release_command(cm);
    -		mtx_unlock(&sc->mfi_io_lock);
     
     		for (i = 0; i < el->count; i++) {
     			/*
    @@ -1815,15 +1848,13 @@ mfi_parse_entries(struct mfi_softc *sc, 
     				else if (el->event[i].seq < start_seq)
     					break;
     			}
    -			mtx_lock(&sc->mfi_io_lock);
     			mfi_queue_evt(sc, &el->event[i]);
    -			mtx_unlock(&sc->mfi_io_lock);
     		}
     		seq = el->event[el->count - 1].seq + 1;
     	}
     
     	free(el, M_MFIBUF);
    -	return (0);
    +	return (error);
     }
     
     static int
    @@ -1940,11 +1971,12 @@ static int mfi_add_sys_pd(struct mfi_sof
     	dcmd->mbox[0]=id;
     	dcmd->header.scsi_status = 0;
     	dcmd->header.pad0 = 0;
    -	if (mfi_mapcmd(sc, cm) != 0) {
    +	if ((error = mfi_mapcmd(sc, cm)) != 0) {
     		device_printf(sc->mfi_dev,
     		    "Failed to get physical drive info %d\n", id);
     		free(pd_info, M_MFIBUF);
    -		return (0);
    +		mfi_release_command(cm);
    +		return (error);
     	}
     	bus_dmamap_sync(sc->mfi_buffer_dmat, cm->cm_dmamap,
     	    BUS_DMASYNC_POSTREAD);
    @@ -2094,6 +2126,8 @@ mfi_build_syspdio(struct mfi_softc *sc, 
     	int flags = 0, blkcount = 0, readop;
     	uint8_t cdb_len;
     
    +	mtx_assert(&sc->mfi_io_lock, MA_OWNED);
    +
     	if ((cm = mfi_dequeue_free(sc)) == NULL)
     	    return (NULL);
     
    @@ -2140,6 +2174,7 @@ mfi_build_syspdio(struct mfi_softc *sc, 
     	cm->cm_sg = &pass->sgl;
     	cm->cm_total_frame_size = MFI_PASS_FRAME_SIZE;
     	cm->cm_flags = flags;
    +
     	return (cm);
     }
     
    @@ -2152,6 +2187,8 @@ mfi_build_ldio(struct mfi_softc *sc, str
     	uint32_t blkcount;
     	uint32_t context = 0;
     
    +	mtx_assert(&sc->mfi_io_lock, MA_OWNED);
    +
     	if ((cm = mfi_dequeue_free(sc)) == NULL)
     	    return (NULL);
     
    @@ -2193,6 +2230,7 @@ mfi_build_ldio(struct mfi_softc *sc, str
     	cm->cm_sg = &io->sgl;
     	cm->cm_total_frame_size = MFI_IO_FRAME_SIZE;
     	cm->cm_flags = flags;
    +
     	return (cm);
     }
     
    @@ -2210,11 +2248,14 @@ mfi_bio_complete(struct mfi_command *cm)
     	if ((hdr->cmd_status != MFI_STAT_OK) || (hdr->scsi_status != 0)) {
     		bio->bio_flags |= BIO_ERROR;
     		bio->bio_error = EIO;
    -		device_printf(sc->mfi_dev, "I/O error, status= %d "
    -		    "scsi_status= %d\n", hdr->cmd_status, hdr->scsi_status);
    +		device_printf(sc->mfi_dev, "I/O error, cmd=%p, status=%#x, "
    +		    "scsi_status=%#x\n", cm, hdr->cmd_status, hdr->scsi_status);
     		mfi_print_sense(cm->cm_sc, cm->cm_sense);
     	} else if (cm->cm_error != 0) {
     		bio->bio_flags |= BIO_ERROR;
    +		bio->bio_error = cm->cm_error;
    +		device_printf(sc->mfi_dev, "I/O error, cmd=%p, error=%#x\n",
    +		    cm, cm->cm_error);
     	}
     
     	mfi_release_command(cm);
    @@ -2250,6 +2291,7 @@ mfi_startio(struct mfi_softc *sc)
     
     		/* Send the command to the controller */
     		if (mfi_mapcmd(sc, cm) != 0) {
    +			device_printf(sc->mfi_dev, "Failed to startio\n");
     			mfi_requeue_ready(cm);
     			break;
     		}
    @@ -2278,10 +2320,7 @@ mfi_mapcmd(struct mfi_softc *sc, struct 
     			return (0);
     		}
     	} else {
    -		if (sc->MFA_enabled)
    -			error = mfi_tbolt_send_frame(sc, cm);
    -		else
    -			error = mfi_send_frame(sc, cm);
    +		error = mfi_send_frame(sc, cm);
     	}
     
     	return (error);
    @@ -2295,18 +2334,28 @@ mfi_data_cb(void *arg, bus_dma_segment_t
     	union mfi_sgl *sgl;
     	struct mfi_softc *sc;
     	int i, j, first, dir;
    -	int sge_size;
    +	int sge_size, locked;
     
     	cm = (struct mfi_command *)arg;
     	sc = cm->cm_sc;
     	hdr = &cm->cm_frame->header;
     	sgl = cm->cm_sg;
     
    +	/*
    +	 * We need to check if we have the lock as this is async
    +	 * callback so even though our caller mfi_mapcmd asserts
    +	 * it has the lock, there is no garantee that hasn't been
    +	 * dropped if bus_dmamap_load returned prior to our
    +	 * completion.
    +	 */
    +	if ((locked = mtx_owned(&sc->mfi_io_lock)) == 0)
    +		mtx_lock(&sc->mfi_io_lock);
    +
     	if (error) {
     		printf("error %d in callback\n", error);
     		cm->cm_error = error;
     		mfi_complete(sc, cm);
    -		return;
    +		goto out;
     	}
     	/* Use IEEE sgl only for IO's on a SKINNY controller
     	 * For other commands on a SKINNY controller use either
    @@ -2378,10 +2427,17 @@ mfi_data_cb(void *arg, bus_dma_segment_t
     	cm->cm_total_frame_size += (sc->mfi_sge_size * nsegs);
     	cm->cm_extra_frames = (cm->cm_total_frame_size - 1) / MFI_FRAME_SIZE;
     
    -	if (sc->MFA_enabled)
    -			mfi_tbolt_send_frame(sc, cm);
    -	else
    -		mfi_send_frame(sc, cm);
    +	if ((error = mfi_send_frame(sc, cm)) != 0) {
    +		printf("error %d in callback from mfi_send_frame\n", error);
    +		cm->cm_error = error;
    +		mfi_complete(sc, cm);
    +		goto out;
    +	}
    +
    +out:
    +	/* leave the lock in the state we found it */
    +	if (locked == 0)
    +		mtx_unlock(&sc->mfi_io_lock);
     
     	return;
     }
    @@ -2389,8 +2445,26 @@ mfi_data_cb(void *arg, bus_dma_segment_t
     static int
     mfi_send_frame(struct mfi_softc *sc, struct mfi_command *cm)
     {
    +	int error;
    +
    +	mtx_assert(&sc->mfi_io_lock, MA_OWNED);
    +
    +	if (sc->MFA_enabled)
    +		error = mfi_tbolt_send_frame(sc, cm);
    +	else
    +		error = mfi_std_send_frame(sc, cm);
    +
    +	if (error != 0 && (cm->cm_flags & MFI_ON_MFIQ_BUSY) != 0)
    +		mfi_remove_busy(cm);
    +
    +	return (error);
    +}
    +
    +static int
    +mfi_std_send_frame(struct mfi_softc *sc, struct mfi_command *cm)
    +{
     	struct mfi_frame_header *hdr;
    -	int tm = MFI_POLL_TIMEOUT_SECS * 1000;
    +	int tm = mfi_polled_cmd_timeout * 1000;
     
     	hdr = &cm->cm_frame->header;
     
    @@ -2444,6 +2518,7 @@ void
     mfi_complete(struct mfi_softc *sc, struct mfi_command *cm)
     {
     	int dir;
    +	mtx_assert(&sc->mfi_io_lock, MA_OWNED);
     
     	if ((cm->cm_flags & MFI_CMD_MAPPED) != 0) {
     		dir = 0;
    @@ -2471,11 +2546,12 @@ mfi_abort(struct mfi_softc *sc, struct m
     {
     	struct mfi_command *cm;
     	struct mfi_abort_frame *abort;
    -	int i = 0;
    +	int i = 0, error;
     	uint32_t context = 0;
     
     	mtx_lock(&sc->mfi_io_lock);
     	if ((cm = mfi_dequeue_free(sc)) == NULL) {
    +		mtx_unlock(&sc->mfi_io_lock);
     		return (EBUSY);
     	}
     
    @@ -2495,7 +2571,8 @@ mfi_abort(struct mfi_softc *sc, struct m
     	cm->cm_data = NULL;
     	cm->cm_flags = MFI_CMD_POLLED;
     
    -	mfi_mapcmd(sc, cm);
    +	if ((error = mfi_mapcmd(sc, cm)) != 0)
    +		device_printf(sc->mfi_dev, "failed to abort command\n");
     	mfi_release_command(cm);
     
     	mtx_unlock(&sc->mfi_io_lock);
    @@ -2511,7 +2588,7 @@ mfi_abort(struct mfi_softc *sc, struct m
     		mtx_unlock(&sc->mfi_io_lock);
     	}
     
    -	return (0);
    +	return (error);
     }
     
     int
    @@ -2549,7 +2626,8 @@ mfi_dump_blocks(struct mfi_softc *sc, in
     	cm->cm_total_frame_size = MFI_IO_FRAME_SIZE;
     	cm->cm_flags = MFI_CMD_POLLED | MFI_CMD_DATAOUT;
     
    -	error = mfi_mapcmd(sc, cm);
    +	if ((error = mfi_mapcmd(sc, cm)) != 0)
    +		device_printf(sc->mfi_dev, "failed dump blocks\n");
     	bus_dmamap_sync(sc->mfi_buffer_dmat, cm->cm_dmamap,
     	    BUS_DMASYNC_POSTWRITE);
     	bus_dmamap_unload(sc->mfi_buffer_dmat, cm->cm_dmamap);
    @@ -2592,7 +2670,8 @@ mfi_dump_syspd_blocks(struct mfi_softc *
     	cm->cm_total_frame_size = MFI_PASS_FRAME_SIZE;
     	cm->cm_flags = MFI_CMD_POLLED | MFI_CMD_DATAOUT | MFI_CMD_SCSI;
     
    -	error = mfi_mapcmd(sc, cm);
    +	if ((error = mfi_mapcmd(sc, cm)) != 0)
    +		device_printf(sc->mfi_dev, "failed dump blocks\n");
     	bus_dmamap_sync(sc->mfi_buffer_dmat, cm->cm_dmamap,
     	    BUS_DMASYNC_POSTWRITE);
     	bus_dmamap_unload(sc->mfi_buffer_dmat, cm->cm_dmamap);
    @@ -3306,8 +3385,10 @@ out:
     		}
     	case MFI_SET_AEN:
     		aen = (struct mfi_ioc_aen *)arg;
    +		mtx_lock(&sc->mfi_io_lock);
     		error = mfi_aen_register(sc, aen->aen_seq_num,
     		    aen->aen_class_locale);
    +		mtx_unlock(&sc->mfi_io_lock);
     
     		break;
     	case MFI_LINUX_CMD_2: /* Firmware Linux ioctl shim */
    @@ -3636,7 +3717,7 @@ mfi_dump_all(void)
     		deadline = time_uptime - MFI_CMD_TIMEOUT;
     		mtx_lock(&sc->mfi_io_lock);
     		TAILQ_FOREACH(cm, &sc->mfi_busy, cm_link) {
    -			if (cm->cm_timestamp < deadline) {
    +			if (cm->cm_timestamp <= deadline) {
     				device_printf(sc->mfi_dev,
     				    "COMMAND %p TIMEOUT AFTER %d SECONDS\n",
     				    cm, (int)(time_uptime - cm->cm_timestamp));
    @@ -3647,7 +3728,7 @@ mfi_dump_all(void)
     
     #if 0
     		if (timedout)
    -			MFI_DUMP_CMDS(SC);
    +			MFI_DUMP_CMDS(sc);
     #endif
     
     		mtx_unlock(&sc->mfi_io_lock);
    @@ -3660,7 +3741,7 @@ static void
     mfi_timeout(void *data)
     {
     	struct mfi_softc *sc = (struct mfi_softc *)data;
    -	struct mfi_command *cm;
    +	struct mfi_command *cm, *tmp;
     	time_t deadline;
     	int timedout = 0;
     
    @@ -3672,10 +3753,10 @@ mfi_timeout(void *data)
     		}
     	}
     	mtx_lock(&sc->mfi_io_lock);
    -	TAILQ_FOREACH(cm, &sc->mfi_busy, cm_link) {
    +	TAILQ_FOREACH_SAFE(cm, &sc->mfi_busy, cm_link, tmp) {
     		if (sc->mfi_aen_cm == cm || sc->mfi_map_sync_cm == cm)
     			continue;
    -		if (cm->cm_timestamp < deadline) {
    +		if (cm->cm_timestamp <= deadline) {
     			if (sc->adpreset != 0 && sc->issuepend_done == 0) {
     				cm->cm_timestamp = time_uptime;
     			} else {
    @@ -3685,6 +3766,13 @@ mfi_timeout(void *data)
     				     );
     				MFI_PRINT_CMD(cm);
     				MFI_VALIDATE_CMD(sc, cm);
    +				/*
    +				 * Fail the command instead of leaving it on
    +				 * the queue where it could remain stuck forever
    +				 */
    +				mfi_remove_busy(cm);
    +				cm->cm_error = ETIMEDOUT;
    +				mfi_complete(sc, cm);
     				timedout++;
     			}
     		}
    @@ -3692,7 +3780,7 @@ mfi_timeout(void *data)
     
     #if 0
     	if (timedout)
    -		MFI_DUMP_CMDS(SC);
    +		MFI_DUMP_CMDS(sc);
     #endif
     
     	mtx_unlock(&sc->mfi_io_lock);
    
    Modified: head/sys/dev/mfi/mfi_cam.c
    ==============================================================================
    --- head/sys/dev/mfi/mfi_cam.c	Wed Feb 27 00:49:32 2013	(r247368)
    +++ head/sys/dev/mfi/mfi_cam.c	Wed Feb 27 02:21:10 2013	(r247369)
    @@ -145,6 +145,7 @@ mfip_attach(device_t dev)
     				MFI_SCSI_MAX_CMDS, sc->devq);
     	if (sc->sim == NULL) {
     		cam_simq_free(sc->devq);
    +		sc->devq = NULL;
     		device_printf(dev, "CAM SIM attach failed\n");
     		return (EINVAL);
     	}
    @@ -155,7 +156,9 @@ mfip_attach(device_t dev)
     	if (xpt_bus_register(sc->sim, dev, 0) != 0) {
     		device_printf(dev, "XPT bus registration failed\n");
     		cam_sim_free(sc->sim, FALSE);
    +		sc->sim = NULL;
     		cam_simq_free(sc->devq);
    +		sc->devq = NULL;
     		mtx_unlock(&mfisc->mfi_io_lock);
     		return (EINVAL);
     	}
    @@ -187,11 +190,14 @@ mfip_detach(device_t dev)
     		mtx_lock(&sc->mfi_sc->mfi_io_lock);
     		xpt_bus_deregister(cam_sim_path(sc->sim));
     		cam_sim_free(sc->sim, FALSE);
    +		sc->sim = NULL;
     		mtx_unlock(&sc->mfi_sc->mfi_io_lock);
     	}
     
    -	if (sc->devq != NULL)
    +	if (sc->devq != NULL) {
     		cam_simq_free(sc->devq);
    +		sc->devq = NULL;
    +	}
     
     	return (0);
     }
    
    Modified: head/sys/dev/mfi/mfi_debug.c
    ==============================================================================
    --- head/sys/dev/mfi/mfi_debug.c	Wed Feb 27 00:49:32 2013	(r247368)
    +++ head/sys/dev/mfi/mfi_debug.c	Wed Feb 27 02:21:10 2013	(r247369)
    @@ -57,14 +57,7 @@ __FBSDID("$FreeBSD$");
     static void
     mfi_print_frame_flags(device_t dev, uint32_t flags)
     {
    -	device_printf(dev, "flags=%b\n", flags,
    -	    "\20"
    -	    "\1NOPOST"
    -	    "\2SGL64"
    -	    "\3SENSE64"
    -	    "\4WRITE"
    -	    "\5READ"
    -	    "\6IEEESGL");
    +	device_printf(dev, "flags=%b\n", flags, MFI_FRAME_FMT);
     }
     
     static void
    @@ -205,16 +198,7 @@ mfi_print_cmd(struct mfi_command *cm)
     	device_printf(dev, "cm=%p index=%d total_frame_size=%d "
     	    "extra_frames=%d\n", cm, cm->cm_index, cm->cm_total_frame_size,
     	    cm->cm_extra_frames);
    -	device_printf(dev, "flags=%b\n", cm->cm_flags,
    -	    "\20"
    -	    "\1MAPPED"
    -	    "\2DATAIN"
    -	    "\3DATAOUT"
    -	    "\4COMPLETED"
    -	    "\5POLLED"
    -	    "\6Q_FREE"
    -	    "\7Q_READY"
    -	    "\10Q_BUSY");
    +	device_printf(dev, "flags=%b\n", cm->cm_flags, MFI_CMD_FLAGS_FMT);
     
     	switch (cm->cm_frame->header.cmd) {
     	case MFI_CMD_DCMD:
    @@ -237,7 +221,7 @@ mfi_dump_cmds(struct mfi_softc *sc)
     {
     	int i;
     
    -	for (i = 0; i < sc->mfi_total_cmds; i++)
    +	for (i = 0; i < sc->mfi_max_fw_cmds; i++)
     		mfi_print_generic_frame(sc, &sc->mfi_commands[i]);
     }
     
    
    Modified: head/sys/dev/mfi/mfi_tbolt.c
    ==============================================================================
    --- head/sys/dev/mfi/mfi_tbolt.c	Wed Feb 27 00:49:32 2013	(r247368)
    +++ head/sys/dev/mfi/mfi_tbolt.c	Wed Feb 27 02:21:10 2013	(r247369)
    @@ -55,14 +55,12 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     
    -struct mfi_cmd_tbolt *mfi_tbolt_get_cmd(struct mfi_softc *sc);
    +struct mfi_cmd_tbolt *mfi_tbolt_get_cmd(struct mfi_softc *sc, struct mfi_command *);
     union mfi_mpi2_request_descriptor *
     mfi_tbolt_get_request_descriptor(struct mfi_softc *sc, uint16_t index);
     void mfi_tbolt_complete_cmd(struct mfi_softc *sc);
     int mfi_tbolt_build_io(struct mfi_softc *sc, struct mfi_command *mfi_cmd,
         struct mfi_cmd_tbolt *cmd);
    -static inline void mfi_tbolt_return_cmd(struct mfi_softc *sc,
    -    struct mfi_cmd_tbolt *cmd);
     union mfi_mpi2_request_descriptor *mfi_tbolt_build_mpt_cmd(struct mfi_softc
         *sc, struct mfi_command *cmd);
     uint8_t
    @@ -84,6 +82,15 @@ static void mfi_queue_map_sync(struct mf
     
     #define MFI_FUSION_ENABLE_INTERRUPT_MASK	(0x00000008)
     
    +
    +extern int	mfi_polled_cmd_timeout;
    +static int	mfi_fw_reset_test = 0;
    +#ifdef MFI_DEBUG
    +TUNABLE_INT("hw.mfi.fw_reset_test", &mfi_fw_reset_test);
    +SYSCTL_INT(_hw_mfi, OID_AUTO, fw_reset_test, CTLFLAG_RWTUN, &mfi_fw_reset_test,
    +           0, "Force a firmware reset condition");
    +#endif
    +
     void
     mfi_tbolt_enable_intr_ppc(struct mfi_softc *sc)
     {
    @@ -162,14 +169,14 @@ mfi_tbolt_adp_reset(struct mfi_softc *sc
     	while (!( HostDiag & DIAG_WRITE_ENABLE)) {
     		for (i = 0; i < 1000; i++);
     		HostDiag = (uint32_t)MFI_READ4(sc, MFI_HDR);
    -		device_printf(sc->mfi_dev, "ADP_RESET_TBOLT: retry time=%x, "
    -		    "hostdiag=%x\n", retry, HostDiag);
    +		device_printf(sc->mfi_dev, "ADP_RESET_TBOLT: retry time=%d, "
    +		    "hostdiag=%#x\n", retry, HostDiag);
     
     		if (retry++ >= 100)
     			return 1;
     	}
     
    -	device_printf(sc->mfi_dev, "ADP_RESET_TBOLT: HostDiag=%x\n", HostDiag);
    +	device_printf(sc->mfi_dev, "ADP_RESET_TBOLT: HostDiag=%#x\n", HostDiag);
     
     	MFI_WRITE4(sc, MFI_HDR, (HostDiag | DIAG_RESET_ADAPTER));
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 03:43:17 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 7D397D95;
     Wed, 27 Feb 2013 03:43:17 +0000 (UTC)
     (envelope-from benno@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 6E71073B;
     Wed, 27 Feb 2013 03:43:17 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R3hHnS087120;
     Wed, 27 Feb 2013 03:43:17 GMT (envelope-from benno@svn.freebsd.org)
    Received: (from benno@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R3hHVB087119;
     Wed, 27 Feb 2013 03:43:17 GMT (envelope-from benno@svn.freebsd.org)
    Message-Id: <201302270343.r1R3hHVB087119@svn.freebsd.org>
    From: Benno Rice 
    Date: Wed, 27 Feb 2013 03:43:17 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247370 - head/sbin/geom/class/part
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 03:43:17 -0000
    
    Author: benno
    Date: Wed Feb 27 03:43:16 2013
    New Revision: 247370
    URL: http://svnweb.freebsd.org/changeset/base/247370
    
    Log:
      Fix typo in EFI GPT GUID.
    
    Modified:
      head/sbin/geom/class/part/gpart.8
    
    Modified: head/sbin/geom/class/part/gpart.8
    ==============================================================================
    --- head/sbin/geom/class/part/gpart.8	Wed Feb 27 02:21:10 2013	(r247369)
    +++ head/sbin/geom/class/part/gpart.8	Wed Feb 27 03:43:16 2013	(r247370)
    @@ -583,7 +583,7 @@ The system partition for computers that 
     Interface (EFI).
     In such cases, the GPT partitioning scheme is used and the
     actual partition type for the system partition can also be specified as
    -.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab" .
    +.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b" .
     .It Cm freebsd
     A
     .Fx
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 04:33:07 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 6154D874;
     Wed, 27 Feb 2013 04:33:07 +0000 (UTC)
     (envelope-from adrian@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 522B88AB;
     Wed, 27 Feb 2013 04:33:07 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R4X7br002654;
     Wed, 27 Feb 2013 04:33:07 GMT (envelope-from adrian@svn.freebsd.org)
    Received: (from adrian@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R4X7iB002652;
     Wed, 27 Feb 2013 04:33:07 GMT (envelope-from adrian@svn.freebsd.org)
    Message-Id: <201302270433.r1R4X7iB002652@svn.freebsd.org>
    From: Adrian Chadd 
    Date: Wed, 27 Feb 2013 04:33:07 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247372 - head/sys/dev/ath/ath_rate/sample
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 04:33:07 -0000
    
    Author: adrian
    Date: Wed Feb 27 04:33:06 2013
    New Revision: 247372
    URL: http://svnweb.freebsd.org/changeset/base/247372
    
    Log:
      I give up - just throw the EWMA update into the normal update_stats()
      routine.
      
      There were still corner cases where the EWMA update stats are being
      called on a rix which didn't have an intermediary stats update; thus
      no packets were counted against it.  Sigh.
      
      This should fix the crashes I've been seeing on recent -HEAD.
    
    Modified:
      head/sys/dev/ath/ath_rate/sample/sample.c
    
    Modified: head/sys/dev/ath/ath_rate/sample/sample.c
    ==============================================================================
    --- head/sys/dev/ath/ath_rate/sample/sample.c	Wed Feb 27 04:19:12 2013	(r247371)
    +++ head/sys/dev/ath/ath_rate/sample/sample.c	Wed Feb 27 04:33:06 2013	(r247372)
    @@ -708,71 +708,6 @@ ath_rate_setupxtxdesc(struct ath_softc *
     	    s3code, sched->t3);		/* series 3 */
     }
     
    -/*
    - * Update the EWMA percentage.
    - *
    - * This is a simple hack to track an EWMA based on the current
    - * rate scenario. For the rate codes which failed, this will
    - * record a 0% against it. For the rate code which succeeded,
    - * EWMA will record the nbad*100/nframes percentage against it.
    - */
    -static void
    -update_ewma_stats(struct ath_softc *sc, struct ath_node *an,
    -    int frame_size,
    -    int rix0, int tries0,
    -    int rix1, int tries1,
    -    int rix2, int tries2,
    -    int rix3, int tries3,
    -    int short_tries, int tries, int status,
    -    int nframes, int nbad)
    -{
    -	struct sample_node *sn = ATH_NODE_SAMPLE(an);
    -	struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc);
    -	const int size_bin = size_to_bin(frame_size);
    -	int tries_so_far;
    -	int pct;
    -	int rix = rix0;
    -
    -	/* Calculate percentage based on current rate */
    -	if (nframes == 0)
    -		nframes = nbad = 1;
    -	pct = ((nframes - nbad) * 1000) / nframes;
    -
    -	/* Figure out which rate index succeeded */
    -	tries_so_far = tries0;
    -
    -	if (tries1 && tries_so_far < tries) {
    -		tries_so_far += tries1;
    -		rix = rix1;
    -		/* XXX bump ewma pct */
    -	}
    -
    -	if (tries2 && tries_so_far < tries) {
    -		tries_so_far += tries2;
    -		rix = rix2;
    -		/* XXX bump ewma pct */
    -	}
    -
    -	if (tries3 && tries_so_far < tries) {
    -		rix = rix3;
    -		/* XXX bump ewma pct */
    -	}
    -
    -	/* rix is the successful rate, update EWMA for final rix */
    -	if (sn->stats[size_bin][rix].total_packets <
    -	    ssc->smoothing_minpackets) {
    -		/* just average the first few packets */
    -		int a_pct = (sn->stats[size_bin][rix].packets_acked * 1000) /
    -		    (sn->stats[size_bin][rix].total_packets);
    -		sn->stats[size_bin][rix].ewma_pct = a_pct;
    -	} else {
    -		/* use a ewma */
    -		sn->stats[size_bin][rix].ewma_pct =
    -			((sn->stats[size_bin][rix].ewma_pct * ssc->smoothing_rate) +
    -			 (pct * (100 - ssc->smoothing_rate))) / 100;
    -	}
    -}
    -
     static void
     update_stats(struct ath_softc *sc, struct ath_node *an, 
     		  int frame_size,
    @@ -792,6 +727,7 @@ update_stats(struct ath_softc *sc, struc
     	const int size = bin_to_size(size_bin);
     	int tt, tries_so_far;
     	int is_ht40 = (an->an_node.ni_chw == 40);
    +	int pct;
     
     	if (!IS_RATE_DEFINED(sn, rix0))
     		return;
    @@ -865,6 +801,27 @@ update_stats(struct ath_softc *sc, struc
     	sn->stats[size_bin][rix0].last_tx = ticks;
     	sn->stats[size_bin][rix0].total_packets += nframes;
     
    +	/* update EWMA for this rix */
    +
    +	/* Calculate percentage based on current rate */
    +	if (nframes == 0)
    +		nframes = nbad = 1;
    +	pct = ((nframes - nbad) * 1000) / nframes;
    +
    +	if (sn->stats[size_bin][rix0].total_packets <
    +	    ssc->smoothing_minpackets) {
    +		/* just average the first few packets */
    +		int a_pct = (sn->stats[size_bin][rix0].packets_acked * 1000) /
    +		    (sn->stats[size_bin][rix0].total_packets);
    +		sn->stats[size_bin][rix0].ewma_pct = a_pct;
    +	} else {
    +		/* use a ewma */
    +		sn->stats[size_bin][rix0].ewma_pct =
    +			((sn->stats[size_bin][rix0].ewma_pct * ssc->smoothing_rate) +
    +			 (pct * (100 - ssc->smoothing_rate))) / 100;
    +	}
    +
    +
     	if (rix0 == sn->current_sample_rix[size_bin]) {
     		IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL,
     		   &an->an_node,
    @@ -907,6 +864,11 @@ ath_rate_tx_complete(struct ath_softc *s
     	short_tries = ts->ts_shortretry;
     	long_tries = ts->ts_longretry + 1;
     
    +	if (nframes == 0) {
    +		device_printf(sc->sc_dev, "%s: nframes=0?\n", __func__);
    +		return;
    +	}
    +
     	if (frame_size == 0)		    /* NB: should not happen */
     		frame_size = 1500;
     
    @@ -950,13 +912,6 @@ ath_rate_tx_complete(struct ath_softc *s
     			     0, 0,
     			     short_tries, long_tries, status,
     			     nframes, nbad);
    -		update_ewma_stats(sc, an, frame_size, 
    -			     final_rix, long_tries,
    -			     0, 0,
    -			     0, 0,
    -			     0, 0,
    -			     short_tries, long_tries, status,
    -			     nframes, nbad);
     
     	} else {
     		int finalTSIdx = ts->ts_finaltsi;
    @@ -1008,15 +963,6 @@ ath_rate_tx_complete(struct ath_softc *s
     				     short_tries, long_tries,
     				     long_tries > rc[0].tries,
     				     nframes, nbad);
    -			update_ewma_stats(sc, an, frame_size,
    -				     rc[0].rix, rc[0].tries,
    -				     rc[1].rix, rc[1].tries,
    -				     rc[2].rix, rc[2].tries,
    -				     rc[3].rix, rc[3].tries,
    -				     short_tries, long_tries,
    -				     long_tries > rc[0].tries,
    -				     nframes, nbad);
    -
     			long_tries -= rc[0].tries;
     		}
     		
    @@ -1029,14 +975,6 @@ ath_rate_tx_complete(struct ath_softc *s
     				     short_tries, long_tries,
     				     status,
     				     nframes, nbad);
    -			update_ewma_stats(sc, an, frame_size,
    -				     rc[1].rix, rc[1].tries,
    -				     rc[2].rix, rc[2].tries,
    -				     rc[3].rix, rc[3].tries,
    -				     0, 0,
    -				     short_tries, long_tries,
    -				     status,
    -				     nframes, nbad);
     			long_tries -= rc[1].tries;
     		}
     
    @@ -1049,14 +987,6 @@ ath_rate_tx_complete(struct ath_softc *s
     				     short_tries, long_tries,
     				     status,
     				     nframes, nbad);
    -			update_ewma_stats(sc, an, frame_size,
    -				     rc[2].rix, rc[2].tries,
    -				     rc[3].rix, rc[3].tries,
    -				     0, 0,
    -				     0, 0,
    -				     short_tries, long_tries,
    -				     status,
    -				     nframes, nbad);
     			long_tries -= rc[2].tries;
     		}
     
    @@ -1069,14 +999,6 @@ ath_rate_tx_complete(struct ath_softc *s
     				     short_tries, long_tries,
     				     status,
     				     nframes, nbad);
    -			update_ewma_stats(sc, an, frame_size,
    -				     rc[3].rix, rc[3].tries,
    -				     0, 0,
    -				     0, 0,
    -				     0, 0,
    -				     short_tries, long_tries,
    -				     status,
    -				     nframes, nbad);
     		}
     	}
     }
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 04:46:09 2013
    Return-Path: 
    Delivered-To: svn-src-all@FreeBSD.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 6669995;
     Wed, 27 Feb 2013 04:46:09 +0000 (UTC)
     (envelope-from brde@optusnet.com.au)
    Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au
     [211.29.132.184])
     by mx1.freebsd.org (Postfix) with ESMTP id E282D912;
     Wed, 27 Feb 2013 04:46:08 +0000 (UTC)
    Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au
     (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106])
     by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r1R4jv4Y018237
     (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
     Wed, 27 Feb 2013 15:45:59 +1100
    Date: Wed, 27 Feb 2013 15:45:57 +1100 (EST)
    From: Bruce Evans 
    X-X-Sender: bde@besplex.bde.org
    To: Davide Italiano 
    Subject: Re: svn commit: r247300 - in head: sys/sys usr.bin/truss
    In-Reply-To: 
    Message-ID: <20130227144854.F1004@besplex.bde.org>
    References: <201302260213.r1Q2D2N1016801@svn.freebsd.org>
     <201302260941.52534.jhb@freebsd.org>
     
     <201302261335.38001.jhb@freebsd.org>
     
    MIME-Version: 1.0
    Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
    X-Optus-CM-Score: 0
    X-Optus-CM-Analysis: v=2.0 cv=D4sfsYtj c=1 sm=1 a=BX3CFZHxMzQA:10
     a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Zxvf0eAqCQgA:10
     a=6I5d2MoRAAAA:8 a=TSbVqHtbAAAA:8 a=0f5610cAo4tEP4S7ggQA:9
     a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117
    Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
     src-committers@FreeBSD.org, Xin LI ,
     John Baldwin 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 04:46:09 -0000
    
    On Tue, 26 Feb 2013, Davide Italiano wrote:
    
    > On Tue, Feb 26, 2013 at 7:35 PM, John Baldwin  wrote:
    >> On Tuesday, February 26, 2013 12:09:42 pm Davide Italiano wrote:
    >>> On Tue, Feb 26, 2013 at 3:41 PM, John Baldwin  wrote:
    >>>> On Monday, February 25, 2013 9:13:02 pm Xin LI wrote:
    >>>>> Author: delphij
    >>>>> Date: Tue Feb 26 02:13:02 2013
    >>>>> New Revision: 247300
    >>>>> URL: http://svnweb.freebsd.org/changeset/base/247300
    >>>>>
    >>>>> Log:
    >>>>>   Expose timespec and timeval macros when __BSD_VISIBLE is defined.  This
    >>>>>   allows userland application to use the following macros:
    >>>>>
    >>>>>       timespecclear, timespecisset, timespeccmp, timespecadd,
    >>>>>       timespecsub;
    >>>>>
    >>>>>       timevalclear, timevalisset, timevalcmp.
    
    These were intentionally left out.  Unfortunately the API/namespace police
    were not vigilant when the even worse APIs timerclear(), etc., were imported
    from NetBSD/OpenBSD.
    
    Apart from namespace pollution, bugs in these APIs start with them being
    unsafe macros spelled as safe ones.  This bug is unimportant for
    relatively limited use in the kernel, but is unsuitable for a public
    API.
    
    Not leaving the above out gives a reasonable but nonstandard set of APIs
    for timespecs (the 5 listed above), but a weird sesqui-duplicated set for
    timevals (the 3 listed above, plus the 5 misnamed timer*() from NetBSD/
    OpenBSD).  Not leaving out the 3 duplicates the 3 least useful ones.
    
    >>>> Why not fix truss to use the stock functions instead of keeping private
    >>>> "unusual" versions?
    
    They are 3-operand variants of the 2-operand kernel ones that escaped.
    3 operands would be better (more general, and at no cost except in
    calling complexity if the target operand is one of the source operands),
    but the order of the 3 operands is as badly designed as possible:
    
         kernel API: operands (v, u); result v op= u;
         truss API:  operands (t, u, v); result should be t = u op v
                                         result is        v = t op u
             			    (just reversed; t is not the target...)
    
    The timeval APIs are not actually sesqui-duplicated like I said above.
    The NetBSD/OpenBSD ones follow the truss order, with t not being the
    target (it just means generic timespec/timeval, while u and v mean
    the second and third ones, and now it is the kernel API that is
    confusing since there is no t and the order of the others is reversed
    in the operands), while the 3 recently exposed kernel ones aren't of
    the form target = source1 op source2.
    
    truss's timespecadd() also has or had an off by 1 error in its tv_nsec
    wrap check.
    
    >>> time.h is already a mess in terms of namespace pollution, and this
    >>> exposure might not help thing.
    >>> Other details here:
    >>> http://permalink.gmane.org/gmane.os.freebsd.architechture/15518
    
    The bintime macros add further designed and implementation errors.  And
    now there are sbintimes...
    
    >> I think that is orthogonal.  Even if this is reverted I think truss should
    >> be changed to use the "normal" timespecsubt() macro rather than using a custom
    >> one with a different argument order.
    >
    > When I talked about "exposure" I referred about timeval/timespec
    > macros(). I wasn't arguing about your proposed change.
    > Sorry if it wasn't clear.
    
    In fact, conversion would further unimprove truss, since it wants a
    different target in all cases, so the 3-operand variants are ideal for
    it.  Converting to the 2-operand variants would require a temporary
    variable in all callers or in the macros.  The macros could be based
    on the standard ones, but would hardly be improved by that since the
    operations are so simple that no one would get them wrong with off by
    1 errors etc.
    
    Bruce
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 05:03:35 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id B64E1751;
     Wed, 27 Feb 2013 05:03:35 +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 934FC980;
     Wed, 27 Feb 2013 05:03:35 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R53ZsA012020;
     Wed, 27 Feb 2013 05:03:35 GMT (envelope-from yongari@svn.freebsd.org)
    Received: (from yongari@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R53ZYB012019;
     Wed, 27 Feb 2013 05:03:35 GMT (envelope-from yongari@svn.freebsd.org)
    Message-Id: <201302270503.r1R53ZYB012019@svn.freebsd.org>
    From: Pyun YongHyeon 
    Date: Wed, 27 Feb 2013 05:03:35 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247382 - head/sys/dev/msk
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 05:03:35 -0000
    
    Author: yongari
    Date: Wed Feb 27 05:03:35 2013
    New Revision: 247382
    URL: http://svnweb.freebsd.org/changeset/base/247382
    
    Log:
      RX checksum offloading on old Yukon controllers seem to cause more
      problems.  Disable RX checksum offloading on controllers that don't
      use new descriptor format but give chance to enable it with
      ifconfig(8).
    
    Modified:
      head/sys/dev/msk/if_msk.c
    
    Modified: head/sys/dev/msk/if_msk.c
    ==============================================================================
    --- head/sys/dev/msk/if_msk.c	Wed Feb 27 05:02:40 2013	(r247381)
    +++ head/sys/dev/msk/if_msk.c	Wed Feb 27 05:03:35 2013	(r247382)
    @@ -1695,6 +1695,12 @@ msk_attach(device_t dev)
     			ifp->if_capabilities |= IFCAP_VLAN_HWCSUM;
     	}
     	ifp->if_capenable = ifp->if_capabilities;
    +	/*
    +	 * Disable RX checksum offloading on controllers that don't use
    +	 * new descriptor format but give chance to enable it.
    +	 */
    +	if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0)
    +		ifp->if_capenable &= ~IFCAP_RXCSUM;
     
     	/*
     	 * Tell the upper layer(s) we support long frames.
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 06:53:16 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id E11189F0;
     Wed, 27 Feb 2013 06:53:16 +0000 (UTC)
     (envelope-from andrew@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 D2D98D61;
     Wed, 27 Feb 2013 06:53:16 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R6rGl7044767;
     Wed, 27 Feb 2013 06:53:16 GMT (envelope-from andrew@svn.freebsd.org)
    Received: (from andrew@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R6rGZW044766;
     Wed, 27 Feb 2013 06:53:16 GMT (envelope-from andrew@svn.freebsd.org)
    Message-Id: <201302270653.r1R6rGZW044766@svn.freebsd.org>
    From: Andrew Turner 
    Date: Wed, 27 Feb 2013 06:53:16 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247386 - head/contrib/binutils/gas/config
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 06:53:17 -0000
    
    Author: andrew
    Date: Wed Feb 27 06:53:15 2013
    New Revision: 247386
    URL: http://svnweb.freebsd.org/changeset/base/247386
    
    Log:
      Clear the memory allocated to build the unwind tables. This fixes C++
      exceptions on ARM EABI with static binaries.
    
    Modified:
      head/contrib/binutils/gas/config/tc-arm.c
    
    Modified: head/contrib/binutils/gas/config/tc-arm.c
    ==============================================================================
    --- head/contrib/binutils/gas/config/tc-arm.c	Wed Feb 27 06:12:50 2013	(r247385)
    +++ head/contrib/binutils/gas/config/tc-arm.c	Wed Feb 27 06:53:15 2013	(r247386)
    @@ -3079,6 +3079,7 @@ s_arm_unwind_fnend (int ignored ATTRIBUT
       record_alignment (now_seg, 2);
     
       ptr = frag_more (8);
    +  memset(ptr, 0, 8);
       where = frag_now_fix () - 8;
     
       /* Self relative offset of the function start.  */
    @@ -17350,6 +17351,7 @@ create_unwind_entry (int have_data)
     
       /* Allocate the table entry.	*/
       ptr = frag_more ((size << 2) + 4);
    +  memset(ptr, 0, (size << 2) + 4);
       where = frag_now_fix () - ((size << 2) + 4);
     
       switch (unwind.personality_index)
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 07:31:24 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 921DF170;
     Wed, 27 Feb 2013 07:31:24 +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 7635DE62;
     Wed, 27 Feb 2013 07:31:24 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R7VOtw056843;
     Wed, 27 Feb 2013 07:31:24 GMT (envelope-from kib@svn.freebsd.org)
    Received: (from kib@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R7VOrT056842;
     Wed, 27 Feb 2013 07:31:24 GMT (envelope-from kib@svn.freebsd.org)
    Message-Id: <201302270731.r1R7VOrT056842@svn.freebsd.org>
    From: Konstantin Belousov 
    Date: Wed, 27 Feb 2013 07:31:24 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247387 - head/sys/ufs/ffs
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 07:31:24 -0000
    
    Author: kib
    Date: Wed Feb 27 07:31:23 2013
    New Revision: 247387
    URL: http://svnweb.freebsd.org/changeset/base/247387
    
    Log:
      An inode block must not be blockingly read while cg block is owned.
      The order is inode buffer lock -> snaplk -> cg buffer lock, reversing
      the order causes deadlocks.
      
      Inode block must not be written while cg block buffer is owned. The
      FFS copy on write needs to allocate a block to copy the content of the
      inode block, and the cylinder group selected for the allocation might
      be the same as the owned cg block.  The reserved block detection code
      in the ffs_copyonwrite() and ffs_bp_snapblk() is unable to detect the
      situation, because the locked cg buffer is not exposed to it.
      
      In order to maintain the dependency between initialized inode block
      and the cg_initediblk pointer, look up the inode buffer in
      non-blocking mode. If succeeded, brelse cg block, initialize the inode
      block and write it.  After the write is finished, reread cg block and
      update the cg_initediblk.
      
      If inode block is already locked by another thread, let the another
      thread initialize it.  If another thread raced with us after we
      started writing inode block, the situation is detected by an update of
      cg_initediblk.  Note that double-initialization of the inode block is
      harmless, the block cannot be used until cg_initediblk is incremented.
      
      Sponsored by:	The FreeBSD Foundation
      In collaboration with:	pho
      Reviewed by:	mckusick
      MFC after:	1 month
      X-MFC-note:	after r246877
    
    Modified:
      head/sys/ufs/ffs/ffs_alloc.c
    
    Modified: head/sys/ufs/ffs/ffs_alloc.c
    ==============================================================================
    --- head/sys/ufs/ffs/ffs_alloc.c	Wed Feb 27 06:53:15 2013	(r247386)
    +++ head/sys/ufs/ffs/ffs_alloc.c	Wed Feb 27 07:31:23 2013	(r247387)
    @@ -1790,6 +1790,17 @@ fail:
     	return (0);
     }
     
    +static inline struct buf *
    +getinobuf(struct inode *ip, u_int cg, u_int32_t cginoblk, int gbflags)
    +{
    +	struct fs *fs;
    +
    +	fs = ip->i_fs;
    +	return (getblk(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs,
    +	    cg * fs->fs_ipg + cginoblk)), (int)fs->fs_bsize, 0, 0,
    +	    gbflags));
    +}
    +
     /*
      * Determine whether an inode can be allocated.
      *
    @@ -1814,9 +1825,11 @@ ffs_nodealloccg(ip, cg, ipref, mode, unu
     	u_int8_t *inosused, *loc;
     	struct ufs2_dinode *dp2;
     	int error, start, len, i;
    +	u_int32_t old_initediblk;
     
     	fs = ip->i_fs;
     	ump = ip->i_ump;
    +check_nifree:
     	if (fs->fs_cs(fs, cg).cs_nifree == 0)
     		return (0);
     	UFS_UNLOCK(ump);
    @@ -1828,13 +1841,13 @@ ffs_nodealloccg(ip, cg, ipref, mode, unu
     		return (0);
     	}
     	cgp = (struct cg *)bp->b_data;
    +restart:
     	if (!cg_chkmagic(cgp) || cgp->cg_cs.cs_nifree == 0) {
     		brelse(bp);
     		UFS_LOCK(ump);
     		return (0);
     	}
     	bp->b_xflags |= BX_BKGRDWRITE;
    -	cgp->cg_old_time = cgp->cg_time = time_second;
     	inosused = cg_inosused(cgp);
     	if (ipref) {
     		ipref %= fs->fs_ipg;
    @@ -1856,7 +1869,6 @@ ffs_nodealloccg(ip, cg, ipref, mode, unu
     		}
     	}
     	ipref = (loc - inosused) * NBBY + ffs(~*loc) - 1;
    -	cgp->cg_irotor = ipref;
     gotit:
     	/*
     	 * Check to see if we need to initialize more inodes.
    @@ -1864,9 +1876,37 @@ gotit:
     	if (fs->fs_magic == FS_UFS2_MAGIC &&
     	    ipref + INOPB(fs) > cgp->cg_initediblk &&
     	    cgp->cg_initediblk < cgp->cg_niblk) {
    -		ibp = getblk(ip->i_devvp, fsbtodb(fs,
    -		    ino_to_fsba(fs, cg * fs->fs_ipg + cgp->cg_initediblk)),
    -		    (int)fs->fs_bsize, 0, 0, 0);
    +		old_initediblk = cgp->cg_initediblk;
    +
    +		/*
    +		 * Free the cylinder group lock before writing the
    +		 * initialized inode block.  Entering the
    +		 * babarrierwrite() with the cylinder group lock
    +		 * causes lock order violation between the lock and
    +		 * snaplk.
    +		 *
    +		 * Another thread can decide to initialize the same
    +		 * inode block, but whichever thread first gets the
    +		 * cylinder group lock after writing the newly
    +		 * allocated inode block will update it and the other
    +		 * will realize that it has lost and leave the
    +		 * cylinder group unchanged.
    +		 */
    +		ibp = getinobuf(ip, cg, old_initediblk, GB_LOCK_NOWAIT);
    +		brelse(bp);
    +		if (ibp == NULL) {
    +			/*
    +			 * The inode block buffer is already owned by
    +			 * another thread, which must initialize it.
    +			 * Wait on the buffer to allow another thread
    +			 * to finish the updates, with dropped cg
    +			 * buffer lock, then retry.
    +			 */
    +			ibp = getinobuf(ip, cg, old_initediblk, 0);
    +			brelse(ibp);
    +			UFS_LOCK(ump);
    +			goto check_nifree;
    +		}
     		bzero(ibp->b_data, (int)fs->fs_bsize);
     		dp2 = (struct ufs2_dinode *)(ibp->b_data);
     		for (i = 0; i < INOPB(fs); i++) {
    @@ -1883,8 +1923,29 @@ gotit:
     		 * loading of newly created filesystems.
     		 */
     		babarrierwrite(ibp);
    -		cgp->cg_initediblk += INOPB(fs);
    +
    +		/*
    +		 * After the inode block is written, try to update the
    +		 * cg initediblk pointer.  If another thread beat us
    +		 * to it, then leave it unchanged as the other thread
    +		 * has already set it correctly.
    +		 */
    +		error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)),
    +		    (int)fs->fs_cgsize, NOCRED, &bp);
    +		UFS_LOCK(ump);
    +		ACTIVECLEAR(fs, cg);
    +		UFS_UNLOCK(ump);
    +		if (error != 0) {
    +			brelse(bp);
    +			return (error);
    +		}
    +		cgp = (struct cg *)bp->b_data;
    +		if (cgp->cg_initediblk == old_initediblk)
    +			cgp->cg_initediblk += INOPB(fs);
    +		goto restart;
     	}
    +	cgp->cg_old_time = cgp->cg_time = time_second;
    +	cgp->cg_irotor = ipref;
     	UFS_LOCK(ump);
     	ACTIVECLEAR(fs, cg);
     	setbit(inosused, ipref);
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 07:32:40 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 9C2F92E8;
     Wed, 27 Feb 2013 07:32:40 +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 75F91E6E;
     Wed, 27 Feb 2013 07:32:40 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R7We4P057054;
     Wed, 27 Feb 2013 07:32:40 GMT (envelope-from kib@svn.freebsd.org)
    Received: (from kib@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R7Wd3k057047;
     Wed, 27 Feb 2013 07:32:39 GMT (envelope-from kib@svn.freebsd.org)
    Message-Id: <201302270732.r1R7Wd3k057047@svn.freebsd.org>
    From: Konstantin Belousov 
    Date: Wed, 27 Feb 2013 07:32:39 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247388 - in head/sys: sys ufs/ffs ufs/ufs
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 07:32:40 -0000
    
    Author: kib
    Date: Wed Feb 27 07:32:39 2013
    New Revision: 247388
    URL: http://svnweb.freebsd.org/changeset/base/247388
    
    Log:
      The softdep freeblks workitem might hold a reference on the dquot.
      Current dqflush() panics when a dquot with with non-zero refcount is
      encountered.  The situation is possible, because quotas are turned off
      before softdep workitem queue if flushed, due to the quota file writes
      might create softdep workitems.
      
      Make the encountering an active dquot in dqflush() not fatal, return
      the error from quotaoff() instead.  Ignore the quotaoff() failures
      when ffs_flushfiles() is called in the course of softdep_flushfiles()
      loop, until the last iteration.  At the last loop, the quotas must be
      closed, and because SU workitems should be already flushed, the
      references to dquot are gone.
      
      Sponsored by:	The FreeBSD Foundation
      Reported and tested by:	pho
      Reviewed by:	mckusick
      MFC after:	2 weeks
    
    Modified:
      head/sys/sys/vnode.h
      head/sys/ufs/ffs/ffs_softdep.c
      head/sys/ufs/ffs/ffs_vfsops.c
      head/sys/ufs/ufs/ufs_quota.c
    
    Modified: head/sys/sys/vnode.h
    ==============================================================================
    --- head/sys/sys/vnode.h	Wed Feb 27 07:31:23 2013	(r247387)
    +++ head/sys/sys/vnode.h	Wed Feb 27 07:32:39 2013	(r247388)
    @@ -385,6 +385,7 @@ extern int		vttoif_tab[];
     #define	SKIPSYSTEM	0x0001	/* vflush: skip vnodes marked VSYSTEM */
     #define	FORCECLOSE	0x0002	/* vflush: force file closure */
     #define	WRITECLOSE	0x0004	/* vflush: only close writable files */
    +#define	EARLYFLUSH	0x0008	/* vflush: early call for ffs_flushfiles */
     #define	V_SAVE		0x0001	/* vinvalbuf: sync file first */
     #define	V_ALT		0x0002	/* vinvalbuf: invalidate only alternate bufs */
     #define	V_NORMAL	0x0004	/* vinvalbuf: invalidate only regular bufs */
    
    Modified: head/sys/ufs/ffs/ffs_softdep.c
    ==============================================================================
    --- head/sys/ufs/ffs/ffs_softdep.c	Wed Feb 27 07:31:23 2013	(r247387)
    +++ head/sys/ufs/ffs/ffs_softdep.c	Wed Feb 27 07:32:39 2013	(r247388)
    @@ -1908,7 +1908,12 @@ softdep_flushfiles(oldmnt, flags, td)
     	int flags;
     	struct thread *td;
     {
    -	int error, depcount, loopcnt, retry_flush_count, retry;
    +#ifdef QUOTA
    +	struct ufsmount *ump;
    +	int i;
    +#endif
    +	int error, early, depcount, loopcnt, retry_flush_count, retry;
    +	int morework;
     
     	loopcnt = 10;
     	retry_flush_count = 3;
    @@ -1926,7 +1931,9 @@ retry_flush:
     		 * Do another flush in case any vnodes were brought in
     		 * as part of the cleanup operations.
     		 */
    -		if ((error = ffs_flushfiles(oldmnt, flags, td)) != 0)
    +		early = retry_flush_count == 1 || (oldmnt->mnt_kern_flag &
    +		    MNTK_UNMOUNT) == 0 ? 0 : EARLYFLUSH;
    +		if ((error = ffs_flushfiles(oldmnt, flags | early, td)) != 0)
     			break;
     		if ((error = softdep_flushworklist(oldmnt, &depcount, td)) != 0 ||
     		    depcount == 0)
    @@ -1950,7 +1957,17 @@ retry_flush:
     			MNT_ILOCK(oldmnt);
     			KASSERT((oldmnt->mnt_kern_flag & MNTK_NOINSMNTQ) != 0,
     			    ("softdep_flushfiles: !MNTK_NOINSMNTQ"));
    -			if (oldmnt->mnt_nvnodelistsize > 0) {
    +			morework = oldmnt->mnt_nvnodelistsize > 0;
    +#ifdef QUOTA
    +			ump = VFSTOUFS(oldmnt);
    +			UFS_LOCK(ump);
    +			for (i = 0; i < MAXQUOTAS; i++) {
    +				if (ump->um_quotas[i] != NULLVP)
    +					morework = 1;
    +			}
    +			UFS_UNLOCK(ump);
    +#endif
    +			if (morework) {
     				if (--retry_flush_count > 0) {
     					retry = 1;
     					loopcnt = 3;
    
    Modified: head/sys/ufs/ffs/ffs_vfsops.c
    ==============================================================================
    --- head/sys/ufs/ffs/ffs_vfsops.c	Wed Feb 27 07:31:23 2013	(r247387)
    +++ head/sys/ufs/ffs/ffs_vfsops.c	Wed Feb 27 07:32:39 2013	(r247388)
    @@ -1351,9 +1351,10 @@ ffs_flushfiles(mp, flags, td)
     	struct thread *td;
     {
     	struct ufsmount *ump;
    -	int error;
    +	int qerror, error;
     
     	ump = VFSTOUFS(mp);
    +	qerror = 0;
     #ifdef QUOTA
     	if (mp->mnt_flag & MNT_QUOTA) {
     		int i;
    @@ -1361,11 +1362,19 @@ ffs_flushfiles(mp, flags, td)
     		if (error)
     			return (error);
     		for (i = 0; i < MAXQUOTAS; i++) {
    -			quotaoff(td, mp, i);
    +			error = quotaoff(td, mp, i);
    +			if (error != 0) {
    +				if ((flags & EARLYFLUSH) == 0)
    +					return (error);
    +				else
    +					qerror = error;
    +			}
     		}
    +
     		/*
    -		 * Here we fall through to vflush again to ensure
    -		 * that we have gotten rid of all the system vnodes.
    +		 * Here we fall through to vflush again to ensure that
    +		 * we have gotten rid of all the system vnodes, unless
    +		 * quotas must not be closed.
     		 */
     	}
     #endif
    @@ -1380,11 +1389,21 @@ ffs_flushfiles(mp, flags, td)
     		 * that we have gotten rid of all the system vnodes.
     		 */
     	}
    -        /*
    -	 * Flush all the files.
    +
    +	/*
    +	 * Do not close system files if quotas were not closed, to be
    +	 * able to sync the remaining dquots.  The freeblks softupdate
    +	 * workitems might hold a reference on a dquot, preventing
    +	 * quotaoff() from completing.  Next round of
    +	 * softdep_flushworklist() iteration should process the
    +	 * blockers, allowing the next run of quotaoff() to finally
    +	 * flush held dquots.
    +	 *
    +	 * Otherwise, flush all the files.
     	 */
    -	if ((error = vflush(mp, 0, flags, td)) != 0)
    +	if (qerror == 0 && (error = vflush(mp, 0, flags, td)) != 0)
     		return (error);
    +
     	/*
     	 * Flush filesystem metadata.
     	 */
    
    Modified: head/sys/ufs/ufs/ufs_quota.c
    ==============================================================================
    --- head/sys/ufs/ufs/ufs_quota.c	Wed Feb 27 07:31:23 2013	(r247387)
    +++ head/sys/ufs/ufs/ufs_quota.c	Wed Feb 27 07:32:39 2013	(r247388)
    @@ -80,7 +80,7 @@ static int dqopen(struct vnode *, struct
     static int dqget(struct vnode *,
     	u_long, struct ufsmount *, int, struct dquot **);
     static int dqsync(struct vnode *, struct dquot *);
    -static void dqflush(struct vnode *);
    +static int dqflush(struct vnode *);
     static int quotaoff1(struct thread *td, struct mount *mp, int type);
     static int quotaoff_inchange(struct thread *td, struct mount *mp, int type);
     
    @@ -674,8 +674,12 @@ again:
     		vrele(vp);
     	}
     
    -	dqflush(qvp);
    -	/* Clear um_quotas before closing the quota vnode to prevent
    +	error = dqflush(qvp);
    +	if (error != 0)
    +		return (error);
    +
    +	/*
    +	 * Clear um_quotas before closing the quota vnode to prevent
     	 * access to the closed vnode from dqget/dqsync
     	 */
     	UFS_LOCK(ump);
    @@ -1594,17 +1598,19 @@ out:
     /*
      * Flush all entries from the cache for a particular vnode.
      */
    -static void
    +static int
     dqflush(struct vnode *vp)
     {
     	struct dquot *dq, *nextdq;
     	struct dqhash *dqh;
    +	int error;
     
     	/*
     	 * Move all dquot's that used to refer to this quota
     	 * file off their hash chains (they will eventually
     	 * fall off the head of the free list and be re-used).
     	 */
    +	error = 0;
     	DQH_LOCK();
     	for (dqh = &dqhashtbl[dqhash]; dqh >= dqhashtbl; dqh--) {
     		for (dq = LIST_FIRST(dqh); dq; dq = nextdq) {
    @@ -1612,12 +1618,15 @@ dqflush(struct vnode *vp)
     			if (dq->dq_ump->um_quotas[dq->dq_type] != vp)
     				continue;
     			if (dq->dq_cnt)
    -				panic("dqflush: stray dquot");
    -			LIST_REMOVE(dq, dq_hash);
    -			dq->dq_ump = (struct ufsmount *)0;
    +				error = EBUSY;
    +			else {
    +				LIST_REMOVE(dq, dq_hash);
    +				dq->dq_ump = NULL;
    +			}
     		}
     	}
     	DQH_UNLOCK();
    +	return (error);
     }
     
     /*
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 07:34:09 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id C72F1476;
     Wed, 27 Feb 2013 07:34:09 +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 A3AB3E81;
     Wed, 27 Feb 2013 07:34:09 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R7Y9Fo057324;
     Wed, 27 Feb 2013 07:34:09 GMT (envelope-from kib@svn.freebsd.org)
    Received: (from kib@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R7Y9Tu057323;
     Wed, 27 Feb 2013 07:34:09 GMT (envelope-from kib@svn.freebsd.org)
    Message-Id: <201302270734.r1R7Y9Tu057323@svn.freebsd.org>
    From: Konstantin Belousov 
    Date: Wed, 27 Feb 2013 07:34:09 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247389 - head/sys/kern
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 07:34:09 -0000
    
    Author: kib
    Date: Wed Feb 27 07:34:09 2013
    New Revision: 247389
    URL: http://svnweb.freebsd.org/changeset/base/247389
    
    Log:
      Make recursive getblk() slightly more useful.  Keep the buffer state
      intact if getblk() is done on the already owned buffer.  Exit from
      brelse() early when the lock recursion is detected, otherwise brelse()
      might prematurely destroy the buffer under some circumstances.
      
      Sponsored by:	The FreeBSD Foundation
      Noted by:	mckusick
      Tested by:	pho
      MFC after:	2 weeks
    
    Modified:
      head/sys/kern/vfs_bio.c
    
    Modified: head/sys/kern/vfs_bio.c
    ==============================================================================
    --- head/sys/kern/vfs_bio.c	Wed Feb 27 07:32:39 2013	(r247388)
    +++ head/sys/kern/vfs_bio.c	Wed Feb 27 07:34:09 2013	(r247389)
    @@ -1268,6 +1268,15 @@ brelse(struct buf *bp)
     	KASSERT(!(bp->b_flags & (B_CLUSTER|B_PAGING)),
     	    ("brelse: inappropriate B_PAGING or B_CLUSTER bp %p", bp));
     
    +	if (BUF_LOCKRECURSED(bp)) {
    +		/*
    +		 * Do not process, in particular, do not handle the
    +		 * B_INVAL/B_RELBUF and do not release to free list.
    +		 */
    +		BUF_UNLOCK(bp);
    +		return;
    +	}
    +
     	if (bp->b_flags & B_MANAGED) {
     		bqrelse(bp);
     		return;
    @@ -1444,12 +1453,6 @@ brelse(struct buf *bp)
     			brelvp(bp);
     	}
     			
    -	if (BUF_LOCKRECURSED(bp)) {
    -		/* do not release to free list */
    -		BUF_UNLOCK(bp);
    -		return;
    -	}
    -
     	/* enqueue */
     	mtx_lock(&bqlock);
     	/* Handle delayed bremfree() processing. */
    @@ -2681,6 +2684,9 @@ loop:
     		/* We timed out or were interrupted. */
     		else if (error)
     			return (NULL);
    +		/* If recursed, assume caller knows the rules. */
    +		else if (BUF_LOCKRECURSED(bp))
    +			goto end;
     
     		/*
     		 * The buffer is locked.  B_CACHE is cleared if the buffer is 
    @@ -2864,6 +2870,7 @@ loop:
     	}
     	CTR4(KTR_BUF, "getblk(%p, %ld, %d) = %p", vp, (long)blkno, size, bp);
     	BUF_ASSERT_HELD(bp);
    +end:
     	KASSERT(bp->b_bufobj == bo,
     	    ("bp %p wrong b_bufobj %p should be %p", bp, bp->b_bufobj, bo));
     	return (bp);
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 08:25:59 2013
    Return-Path: 
    Delivered-To: svn-src-all@FreeBSD.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id C66F4EF7;
     Wed, 27 Feb 2013 08:25:59 +0000 (UTC)
     (envelope-from peter@rulingia.com)
    Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au
     [122.100.2.194]) by mx1.freebsd.org (Postfix) with ESMTP id 71CB9D3;
     Wed, 27 Feb 2013 08:25:58 +0000 (UTC)
    Received: from server.rulingia.com
     (c220-239-237-213.belrs5.nsw.optusnet.com.au [220.239.237.213])
     by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id r1R8Ptnk098994
     (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
     Wed, 27 Feb 2013 19:25:56 +1100 (EST)
     (envelope-from peter@rulingia.com)
    X-Bogosity: Ham, spamicity=0.000000
    Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1])
     by server.rulingia.com (8.14.5/8.14.5) with ESMTP id r1R8Pn0I091366
     (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
     Wed, 27 Feb 2013 19:25:49 +1100 (EST)
     (envelope-from peter@server.rulingia.com)
    Received: (from peter@localhost)
     by server.rulingia.com (8.14.5/8.14.5/Submit) id r1R8Pm8T091365;
     Wed, 27 Feb 2013 19:25:48 +1100 (EST) (envelope-from peter)
    Date: Wed, 27 Feb 2013 19:25:48 +1100
    From: Peter Jeremy 
    To: Jilles Tjoelker 
    Subject: Re: svn commit: r247274 - in head: bin/test tools/regression/bin/test
    Message-ID: <20130227082548.GF99210@server.rulingia.com>
    References: <201302251905.r1PJ5fKF085179@svn.freebsd.org>
     <20130226000227.GA80718@stack.nl>
    MIME-Version: 1.0
    Content-Type: multipart/signed; micalg=pgp-sha1;
     protocol="application/pgp-signature"; boundary="EP0wieDxd4TSJjHq"
    Content-Disposition: inline
    In-Reply-To: <20130226000227.GA80718@stack.nl>
    X-PGP-Key: http://www.rulingia.com/keys/peter.pgp
    User-Agent: Mutt/1.5.21 (2010-09-15)
    Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
     src-committers@FreeBSD.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 08:25:59 -0000
    
    
    --EP0wieDxd4TSJjHq
    Content-Type: text/plain; charset=iso-8859-1
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable
    
    On 2013-Feb-26 01:02:27 +0100, Jilles Tjoelker  wrote:
    >>   Enhance test(1) by adding provision to compare any combination of the
    >>   access, birth, change and modify times of two files, instead of only
    >>   being able to compare modify times.  The builtin test in sh(1) will
    >>   automagically acquire the same expansion.
    >
    >What do you need this for? If it is not needed very often, this test can
    >be done more portably (older FreeBSD and GNU) as
    >  [ -n "$(find -L FILE1 -prune -newerXY FILE2 2>/dev/null)" ]
    
    In my case I needed to compare the ctime on one set of files with the
    mtime in another set.  I had a think about using find(1) and gave it
    away as too ugly.  That expression needs serious thought to understand
    and about =BD the tokens in the find(1) are to handle special cases -
    which is a further indication that it isn't ideal.
    
    >I have generally been rather reluctant in adding things to sh(1) and
    >even more so if they are completely new. Someone proposed something
    >rather similar (except that it added a time string parser -- even more
    >code) in PR bin/57054 and I rejected it in 2009.
    
    Time parsing is a large can of worms - getting it right is messy (that
    patch includes 1KLOC of new code and still isn't locale aware).  And
    the work-around of touching a dummy file to the wanted age isn't too
    horrrible.  This is a much smaller patch and there's no equally clean
    work-around.
    
    >> +a=3D/tmp/test$$.1
    >> +b=3D/tmp/test$$.2
    >
    >Please use mktemp(1). Using $$ for temporary files is insecure on
    >multiuser systems.
    
    In this case, I want filenames that don't exist.  I will look at using
    mktemp(1) to create a temporary directory.
    
    >> +sleep 2    # Ensure $b is newer than $a
    >> +touch $b
    >
    >Please use touch -t instead of sleeping. I'm impatient while running
    >tests :)
    
    In this case, I want all the timestamps on $b to be later than $a.  I
    initially tried without the sleep but that failed with the builtin
    test(1) because the FS timestamps weren't sufficiently granular to
    report the difference.  I could create one of the files much earlier
    during the test and then use a conditional test to only sleep if the
    timestamps were indistinguishable (this probably needs to use the
    above find(1) horror to avoid using test(1) to test itself).
    
    I agree the other sleep(1)s should be able to be replaced with
    touch(1) but I ran into problems with my initial efforts to do
    everything using touch(1).  I will revisit it.
    
    --=20
    Peter Jeremy
    
    --EP0wieDxd4TSJjHq
    Content-Type: application/pgp-signature
    
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.19 (FreeBSD)
    
    iEYEARECAAYFAlEtwwwACgkQ/opHv/APuIeFvACeOgfECr+1cchOoV4s8MgvPapO
    HyYAoJz+idnfLYUcklexj343j62LFYI7
    =qmM8
    -----END PGP SIGNATURE-----
    
    --EP0wieDxd4TSJjHq--
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 08:32:35 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 69C312F3;
     Wed, 27 Feb 2013 08:32:35 +0000 (UTC)
     (envelope-from gonzo@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 44633117;
     Wed, 27 Feb 2013 08:32:35 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R8WZoX074996;
     Wed, 27 Feb 2013 08:32:35 GMT (envelope-from gonzo@svn.freebsd.org)
    Received: (from gonzo@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R8WZmP074995;
     Wed, 27 Feb 2013 08:32:35 GMT (envelope-from gonzo@svn.freebsd.org)
    Message-Id: <201302270832.r1R8WZmP074995@svn.freebsd.org>
    From: Oleksandr Tymoshenko 
    Date: Wed, 27 Feb 2013 08:32:35 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247390 - head/sys/arm/ti
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 08:32:35 -0000
    
    Author: gonzo
    Date: Wed Feb 27 08:32:34 2013
    New Revision: 247390
    URL: http://svnweb.freebsd.org/changeset/base/247390
    
    Log:
      - Initialize GPIO_OE register based on pinmux configuration
      
      Although AM335x TRM states that GPIO_OE register is not used and just
      reflects pads configuration in practice it does control pin behavior
      and shoiuld be set in addition to pinmux setup
    
    Modified:
      head/sys/arm/ti/ti_gpio.c
    
    Modified: head/sys/arm/ti/ti_gpio.c
    ==============================================================================
    --- head/sys/arm/ti/ti_gpio.c	Wed Feb 27 07:34:09 2013	(r247389)
    +++ head/sys/arm/ti/ti_gpio.c	Wed Feb 27 08:32:34 2013	(r247390)
    @@ -653,6 +653,9 @@ ti_gpio_attach(device_t dev)
     	struct ti_gpio_softc *sc = device_get_softc(dev);
     	unsigned int i;
     	int err = 0;
    +	int pin;
    +	uint32_t flags;
    +	uint32_t reg_oe;
     
     	sc->sc_dev = dev;
     
    @@ -720,6 +723,17 @@ ti_gpio_attach(device_t dev)
     			/* Disable interrupts for all pins */
     			ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE1, 0xffffffff);
     			ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE2, 0xffffffff);
    +
    +			/* Init OE registger based on pads configuration */
    +			reg_oe = 0xffffffff;
    +			for (pin = 0; pin < 32; pin++) {
    +				ti_scm_padconf_get_gpioflags(
    +				    PINS_PER_BANK*i + pin, &flags);
    +				if (flags & GPIO_PIN_OUTPUT)
    +					reg_oe &= ~(1U << pin);
    +			}
    +
    +			ti_gpio_write_4(sc, i, TI_GPIO_OE, reg_oe);
     		}
     	}
     
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 08:34:32 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id B34D5476;
     Wed, 27 Feb 2013 08:34:32 +0000 (UTC)
     (envelope-from gonzo@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 A606E129;
     Wed, 27 Feb 2013 08:34:32 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R8YW2X075331;
     Wed, 27 Feb 2013 08:34:32 GMT (envelope-from gonzo@svn.freebsd.org)
    Received: (from gonzo@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R8YWpp075330;
     Wed, 27 Feb 2013 08:34:32 GMT (envelope-from gonzo@svn.freebsd.org)
    Message-Id: <201302270834.r1R8YWpp075330@svn.freebsd.org>
    From: Oleksandr Tymoshenko 
    Date: Wed, 27 Feb 2013 08:34:32 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247391 - head/sys/arm/ti
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 08:34:32 -0000
    
    Author: gonzo
    Date: Wed Feb 27 08:34:32 2013
    New Revision: 247391
    URL: http://svnweb.freebsd.org/changeset/base/247391
    
    Log:
      Fix typo
    
    Modified:
      head/sys/arm/ti/ti_gpio.c
    
    Modified: head/sys/arm/ti/ti_gpio.c
    ==============================================================================
    --- head/sys/arm/ti/ti_gpio.c	Wed Feb 27 08:32:34 2013	(r247390)
    +++ head/sys/arm/ti/ti_gpio.c	Wed Feb 27 08:34:32 2013	(r247391)
    @@ -724,7 +724,7 @@ ti_gpio_attach(device_t dev)
     			ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE1, 0xffffffff);
     			ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE2, 0xffffffff);
     
    -			/* Init OE registger based on pads configuration */
    +			/* Init OE register based on pads configuration */
     			reg_oe = 0xffffffff;
     			for (pin = 0; pin < 32; pin++) {
     				ti_scm_padconf_get_gpioflags(
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 08:55:27 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 01F0AB1A;
     Wed, 27 Feb 2013 08:55:27 +0000 (UTC)
     (envelope-from pluknet@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 E7CC31E6;
     Wed, 27 Feb 2013 08:55:26 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R8tQ3M081522;
     Wed, 27 Feb 2013 08:55:26 GMT (envelope-from pluknet@svn.freebsd.org)
    Received: (from pluknet@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R8tQVw081521;
     Wed, 27 Feb 2013 08:55:26 GMT (envelope-from pluknet@svn.freebsd.org)
    Message-Id: <201302270855.r1R8tQVw081521@svn.freebsd.org>
    From: Sergey Kandaurov 
    Date: Wed, 27 Feb 2013 08:55: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: r247394 - stable/9/usr.sbin/mountd
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 08:55:27 -0000
    
    Author: pluknet
    Date: Wed Feb 27 08:55:26 2013
    New Revision: 247394
    URL: http://svnweb.freebsd.org/changeset/base/247394
    
    Log:
      MFC r247034:
        Check if the -sec option is given without an argument.
      
      PR:		bin/170413
      Submitted by:	Andrey Simonenko 
    
    Modified:
      stable/9/usr.sbin/mountd/mountd.c
    Directory Properties:
      stable/9/usr.sbin/mountd/   (props changed)
    
    Modified: stable/9/usr.sbin/mountd/mountd.c
    ==============================================================================
    --- stable/9/usr.sbin/mountd/mountd.c	Wed Feb 27 08:44:03 2013	(r247393)
    +++ stable/9/usr.sbin/mountd/mountd.c	Wed Feb 27 08:55:26 2013	(r247394)
    @@ -2238,7 +2238,7 @@ do_opt(char **cpp, char **endcpp, struct
     			ep->ex_indexfile = strdup(cpoptarg);
     		} else if (!strcmp(cpopt, "quiet")) {
     			opt_flags |= OP_QUIET;
    -		} else if (!strcmp(cpopt, "sec")) {
    +		} else if (cpoptarg && !strcmp(cpopt, "sec")) {
     			if (parsesec(cpoptarg, ep))
     				return (1);
     			opt_flags |= OP_SEC;
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 08:56:57 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id E01EDDA6;
     Wed, 27 Feb 2013 08:56:57 +0000 (UTC)
     (envelope-from pluknet@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 CD6311FD;
     Wed, 27 Feb 2013 08:56:57 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R8uvJW081756;
     Wed, 27 Feb 2013 08:56:57 GMT (envelope-from pluknet@svn.freebsd.org)
    Received: (from pluknet@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R8uvrQ081755;
     Wed, 27 Feb 2013 08:56:57 GMT (envelope-from pluknet@svn.freebsd.org)
    Message-Id: <201302270856.r1R8uvrQ081755@svn.freebsd.org>
    From: Sergey Kandaurov 
    Date: Wed, 27 Feb 2013 08:56:57 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247395 - stable/8/usr.sbin/mountd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 08:56:58 -0000
    
    Author: pluknet
    Date: Wed Feb 27 08:56:57 2013
    New Revision: 247395
    URL: http://svnweb.freebsd.org/changeset/base/247395
    
    Log:
      MFC r247034:
        Check if the -sec option is given without an argument.
      
      PR:		bin/170413
      Submitted by:	Andrey Simonenko 
    
    Modified:
      stable/8/usr.sbin/mountd/mountd.c
    Directory Properties:
      stable/8/usr.sbin/mountd/   (props changed)
    
    Modified: stable/8/usr.sbin/mountd/mountd.c
    ==============================================================================
    --- stable/8/usr.sbin/mountd/mountd.c	Wed Feb 27 08:55:26 2013	(r247394)
    +++ stable/8/usr.sbin/mountd/mountd.c	Wed Feb 27 08:56:57 2013	(r247395)
    @@ -2229,7 +2229,7 @@ do_opt(char **cpp, char **endcpp, struct
     			ep->ex_indexfile = strdup(cpoptarg);
     		} else if (!strcmp(cpopt, "quiet")) {
     			opt_flags |= OP_QUIET;
    -		} else if (!strcmp(cpopt, "sec")) {
    +		} else if (cpoptarg && !strcmp(cpopt, "sec")) {
     			if (parsesec(cpoptarg, ep))
     				return (1);
     			opt_flags |= OP_SEC;
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 09:34:10 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 21FF8463;
     Wed, 27 Feb 2013 09:34:10 +0000 (UTC)
     (envelope-from tijl@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 135D0339;
     Wed, 27 Feb 2013 09:34:10 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R9Y9cC093716;
     Wed, 27 Feb 2013 09:34:09 GMT (envelope-from tijl@svn.freebsd.org)
    Received: (from tijl@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R9Y9j9093715;
     Wed, 27 Feb 2013 09:34:09 GMT (envelope-from tijl@svn.freebsd.org)
    Message-Id: <201302270934.r1R9Y9j9093715@svn.freebsd.org>
    From: Tijl Coosemans 
    Date: Wed, 27 Feb 2013 09:34:09 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247396 - head/libexec/rtld-elf
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 09:34:10 -0000
    
    Author: tijl
    Date: Wed Feb 27 09:34:09 2013
    New Revision: 247396
    URL: http://svnweb.freebsd.org/changeset/base/247396
    
    Log:
      Map libraries linked with -Ttext-segment=base_addr at base_addr.
      Normal libraries have base address 0 and are unaffected by this change.
      
      PR:		176216
      Submitted by:	Damjan Jovanovic 
      Reviewed by:	kib
      MFC after:	1 week
    
    Modified:
      head/libexec/rtld-elf/map_object.c
    
    Modified: head/libexec/rtld-elf/map_object.c
    ==============================================================================
    --- head/libexec/rtld-elf/map_object.c	Wed Feb 27 08:56:57 2013	(r247395)
    +++ head/libexec/rtld-elf/map_object.c	Wed Feb 27 09:34:09 2013	(r247396)
    @@ -175,7 +175,7 @@ map_object(int fd, const char *path, con
         base_vaddr = trunc_page(segs[0]->p_vaddr);
         base_vlimit = round_page(segs[nsegs]->p_vaddr + segs[nsegs]->p_memsz);
         mapsize = base_vlimit - base_vaddr;
    -    base_addr = hdr->e_type == ET_EXEC ? (caddr_t) base_vaddr : NULL;
    +    base_addr = (caddr_t) base_vaddr;
     
         mapbase = mmap(base_addr, mapsize, PROT_NONE, MAP_ANON | MAP_PRIVATE |
           MAP_NOCORE, -1, 0);
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 14:45:25 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 2E2B5A15;
     Wed, 27 Feb 2013 14:45:25 +0000 (UTC) (envelope-from mm@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 1EC4C72E;
     Wed, 27 Feb 2013 14:45:25 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1REjPvO087790;
     Wed, 27 Feb 2013 14:45:25 GMT (envelope-from mm@svn.freebsd.org)
    Received: (from mm@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1REjOEE087781;
     Wed, 27 Feb 2013 14:45:24 GMT (envelope-from mm@svn.freebsd.org)
    Message-Id: <201302271445.r1REjOEE087781@svn.freebsd.org>
    From: Martin Matuska 
    Date: Wed, 27 Feb 2013 14:45:24 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247398 - in head: cddl/contrib/opensolaris/cmd/zdb
     sys/cddl/contrib/opensolaris/uts/common/fs/zfs
     sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 14:45:25 -0000
    
    Author: mm
    Date: Wed Feb 27 14:45:23 2013
    New Revision: 247398
    URL: http://svnweb.freebsd.org/changeset/base/247398
    
    Log:
      MFV 247176, 247178, 247315:
      Import metaslab_sync() speedup from vendor (illumos).
      
      Illumos ZFS issues:
        3552 condensing one space map burns 3 seconds of CPU in spa_sync() thread
        3564 spa_sync() spends 5-10% of its time in metaslab_sync() (when not
             condensing)
        3578 transferring the freed map to the defer map should be constant time
        3579 ztest trips assertion in metaslab_weight()
      
      References:
        https://www.illumos.org/issues/3552
        https://www.illumos.org/issues/3564
        https://www.illumos.org/issues/3578
        https://www.illumos.org/issues/3579
      
      MFC after:	2 weeks
    
    Modified:
      head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
      head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
      head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c
      head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h
      head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h
      head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
    Directory Properties:
      head/cddl/contrib/opensolaris/   (props changed)
      head/sys/cddl/contrib/opensolaris/   (props changed)
    
    Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
    ==============================================================================
    --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Wed Feb 27 11:42:28 2013	(r247397)
    +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Wed Feb 27 14:45:23 2013	(r247398)
    @@ -545,7 +545,7 @@ static void
     dump_metaslab_stats(metaslab_t *msp)
     {
     	char maxbuf[32];
    -	space_map_t *sm = &msp->ms_map;
    +	space_map_t *sm = msp->ms_map;
     	avl_tree_t *t = sm->sm_pp_root;
     	int free_pct = sm->sm_space * 100 / sm->sm_size;
     
    @@ -561,7 +561,7 @@ dump_metaslab(metaslab_t *msp)
     {
     	vdev_t *vd = msp->ms_group->mg_vd;
     	spa_t *spa = vd->vdev_spa;
    -	space_map_t *sm = &msp->ms_map;
    +	space_map_t *sm = msp->ms_map;
     	space_map_obj_t *smo = &msp->ms_smo;
     	char freebuf[32];
     
    @@ -2160,11 +2160,11 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb)
     			for (int m = 0; m < vd->vdev_ms_count; m++) {
     				metaslab_t *msp = vd->vdev_ms[m];
     				mutex_enter(&msp->ms_lock);
    -				space_map_unload(&msp->ms_map);
    -				VERIFY(space_map_load(&msp->ms_map,
    +				space_map_unload(msp->ms_map);
    +				VERIFY(space_map_load(msp->ms_map,
     				    &zdb_space_map_ops, SM_ALLOC, &msp->ms_smo,
     				    spa->spa_meta_objset) == 0);
    -				msp->ms_map.sm_ppd = vd;
    +				msp->ms_map->sm_ppd = vd;
     				mutex_exit(&msp->ms_lock);
     			}
     		}
    @@ -2187,7 +2187,7 @@ zdb_leak_fini(spa_t *spa)
     			for (int m = 0; m < vd->vdev_ms_count; m++) {
     				metaslab_t *msp = vd->vdev_ms[m];
     				mutex_enter(&msp->ms_lock);
    -				space_map_unload(&msp->ms_map);
    +				space_map_unload(msp->ms_map);
     				mutex_exit(&msp->ms_lock);
     			}
     		}
    
    Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
    ==============================================================================
    --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Wed Feb 27 11:42:28 2013	(r247397)
    +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Wed Feb 27 14:45:23 2013	(r247398)
    @@ -48,6 +48,14 @@ uint64_t metaslab_aliquot = 512ULL << 10
     uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1;	/* force gang blocks */
     
     /*
    + * The in-core space map representation is more compact than its on-disk form.
    + * The zfs_condense_pct determines how much more compact the in-core
    + * space_map representation must be before we compact it on-disk.
    + * Values should be greater than or equal to 100.
    + */
    +int zfs_condense_pct = 200;
    +
    +/*
      * This value defines the number of allowed allocation failures per vdev.
      * If a device reaches this threshold in a given txg then we consider skipping
      * allocations on that device.
    @@ -215,9 +223,9 @@ metaslab_compare(const void *x1, const v
     	/*
     	 * If the weights are identical, use the offset to force uniqueness.
     	 */
    -	if (m1->ms_map.sm_start < m2->ms_map.sm_start)
    +	if (m1->ms_map->sm_start < m2->ms_map->sm_start)
     		return (-1);
    -	if (m1->ms_map.sm_start > m2->ms_map.sm_start)
    +	if (m1->ms_map->sm_start > m2->ms_map->sm_start)
     		return (1);
     
     	ASSERT3P(m1, ==, m2);
    @@ -732,14 +740,15 @@ metaslab_init(metaslab_group_t *mg, spac
     	 * addition of new space; and for debugging, it ensures that we'd
     	 * data fault on any attempt to use this metaslab before it's ready.
     	 */
    -	space_map_create(&msp->ms_map, start, size,
    +	msp->ms_map = kmem_zalloc(sizeof (space_map_t), KM_SLEEP);
    +	space_map_create(msp->ms_map, start, size,
     	    vd->vdev_ashift, &msp->ms_lock);
     
     	metaslab_group_add(mg, msp);
     
     	if (metaslab_debug && smo->smo_object != 0) {
     		mutex_enter(&msp->ms_lock);
    -		VERIFY(space_map_load(&msp->ms_map, mg->mg_class->mc_ops,
    +		VERIFY(space_map_load(msp->ms_map, mg->mg_class->mc_ops,
     		    SM_FREE, smo, spa_meta_objset(vd->vdev_spa)) == 0);
     		mutex_exit(&msp->ms_lock);
     	}
    @@ -767,22 +776,27 @@ metaslab_fini(metaslab_t *msp)
     	metaslab_group_t *mg = msp->ms_group;
     
     	vdev_space_update(mg->mg_vd,
    -	    -msp->ms_smo.smo_alloc, 0, -msp->ms_map.sm_size);
    +	    -msp->ms_smo.smo_alloc, 0, -msp->ms_map->sm_size);
     
     	metaslab_group_remove(mg, msp);
     
     	mutex_enter(&msp->ms_lock);
     
    -	space_map_unload(&msp->ms_map);
    -	space_map_destroy(&msp->ms_map);
    +	space_map_unload(msp->ms_map);
    +	space_map_destroy(msp->ms_map);
    +	kmem_free(msp->ms_map, sizeof (*msp->ms_map));
     
     	for (int t = 0; t < TXG_SIZE; t++) {
    -		space_map_destroy(&msp->ms_allocmap[t]);
    -		space_map_destroy(&msp->ms_freemap[t]);
    +		space_map_destroy(msp->ms_allocmap[t]);
    +		space_map_destroy(msp->ms_freemap[t]);
    +		kmem_free(msp->ms_allocmap[t], sizeof (*msp->ms_allocmap[t]));
    +		kmem_free(msp->ms_freemap[t], sizeof (*msp->ms_freemap[t]));
     	}
     
    -	for (int t = 0; t < TXG_DEFER_SIZE; t++)
    -		space_map_destroy(&msp->ms_defermap[t]);
    +	for (int t = 0; t < TXG_DEFER_SIZE; t++) {
    +		space_map_destroy(msp->ms_defermap[t]);
    +		kmem_free(msp->ms_defermap[t], sizeof (*msp->ms_defermap[t]));
    +	}
     
     	ASSERT0(msp->ms_deferspace);
     
    @@ -801,7 +815,7 @@ static uint64_t
     metaslab_weight(metaslab_t *msp)
     {
     	metaslab_group_t *mg = msp->ms_group;
    -	space_map_t *sm = &msp->ms_map;
    +	space_map_t *sm = msp->ms_map;
     	space_map_obj_t *smo = &msp->ms_smo;
     	vdev_t *vd = mg->mg_vd;
     	uint64_t weight, space;
    @@ -809,6 +823,16 @@ metaslab_weight(metaslab_t *msp)
     	ASSERT(MUTEX_HELD(&msp->ms_lock));
     
     	/*
    +	 * This vdev is in the process of being removed so there is nothing
    +	 * for us to do here.
    +	 */
    +	if (vd->vdev_removing) {
    +		ASSERT0(smo->smo_alloc);
    +		ASSERT0(vd->vdev_ms_shift);
    +		return (0);
    +	}
    +
    +	/*
     	 * The baseline weight is the metaslab's free space.
     	 */
     	space = sm->sm_size - smo->smo_alloc;
    @@ -861,7 +885,7 @@ metaslab_prefetch(metaslab_group_t *mg)
     	 * Prefetch the next potential metaslabs
     	 */
     	for (msp = avl_first(t), m = 0; msp; msp = AVL_NEXT(t, msp), m++) {
    -		space_map_t *sm = &msp->ms_map;
    +		space_map_t *sm = msp->ms_map;
     		space_map_obj_t *smo = &msp->ms_smo;
     
     		/* If we have reached our prefetch limit then we're done */
    @@ -882,7 +906,7 @@ static int
     metaslab_activate(metaslab_t *msp, uint64_t activation_weight)
     {
     	metaslab_group_t *mg = msp->ms_group;
    -	space_map_t *sm = &msp->ms_map;
    +	space_map_t *sm = msp->ms_map;
     	space_map_ops_t *sm_ops = msp->ms_group->mg_class->mc_ops;
     
     	ASSERT(MUTEX_HELD(&msp->ms_lock));
    @@ -899,7 +923,7 @@ metaslab_activate(metaslab_t *msp, uint6
     				return (error);
     			}
     			for (int t = 0; t < TXG_DEFER_SIZE; t++)
    -				space_map_walk(&msp->ms_defermap[t],
    +				space_map_walk(msp->ms_defermap[t],
     				    space_map_claim, sm);
     
     		}
    @@ -930,12 +954,158 @@ metaslab_passivate(metaslab_t *msp, uint
     	 * this metaslab again.  In that case, it had better be empty,
     	 * or we would be leaving space on the table.
     	 */
    -	ASSERT(size >= SPA_MINBLOCKSIZE || msp->ms_map.sm_space == 0);
    +	ASSERT(size >= SPA_MINBLOCKSIZE || msp->ms_map->sm_space == 0);
     	metaslab_group_sort(msp->ms_group, msp, MIN(msp->ms_weight, size));
     	ASSERT((msp->ms_weight & METASLAB_ACTIVE_MASK) == 0);
     }
     
     /*
    + * Determine if the in-core space map representation can be condensed on-disk.
    + * We would like to use the following criteria to make our decision:
    + *
    + * 1. The size of the space map object should not dramatically increase as a
    + * result of writing out our in-core free map.
    + *
    + * 2. The minimal on-disk space map representation is zfs_condense_pct/100
    + * times the size than the in-core representation (i.e. zfs_condense_pct = 110
    + * and in-core = 1MB, minimal = 1.1.MB).
    + *
    + * Checking the first condition is tricky since we don't want to walk
    + * the entire AVL tree calculating the estimated on-disk size. Instead we
    + * use the size-ordered AVL tree in the space map and calculate the
    + * size required for the largest segment in our in-core free map. If the
    + * size required to represent that segment on disk is larger than the space
    + * map object then we avoid condensing this map.
    + *
    + * To determine the second criterion we use a best-case estimate and assume
    + * each segment can be represented on-disk as a single 64-bit entry. We refer
    + * to this best-case estimate as the space map's minimal form.
    + */
    +static boolean_t
    +metaslab_should_condense(metaslab_t *msp)
    +{
    +	space_map_t *sm = msp->ms_map;
    +	space_map_obj_t *smo = &msp->ms_smo_syncing;
    +	space_seg_t *ss;
    +	uint64_t size, entries, segsz;
    +
    +	ASSERT(MUTEX_HELD(&msp->ms_lock));
    +	ASSERT(sm->sm_loaded);
    +
    +	/*
    +	 * Use the sm_pp_root AVL tree, which is ordered by size, to obtain
    +	 * the largest segment in the in-core free map. If the tree is
    +	 * empty then we should condense the map.
    +	 */
    +	ss = avl_last(sm->sm_pp_root);
    +	if (ss == NULL)
    +		return (B_TRUE);
    +
    +	/*
    +	 * Calculate the number of 64-bit entries this segment would
    +	 * require when written to disk. If this single segment would be
    +	 * larger on-disk than the entire current on-disk structure, then
    +	 * clearly condensing will increase the on-disk structure size.
    +	 */
    +	size = (ss->ss_end - ss->ss_start) >> sm->sm_shift;
    +	entries = size / (MIN(size, SM_RUN_MAX));
    +	segsz = entries * sizeof (uint64_t);
    +
    +	return (segsz <= smo->smo_objsize &&
    +	    smo->smo_objsize >= (zfs_condense_pct *
    +	    sizeof (uint64_t) * avl_numnodes(&sm->sm_root)) / 100);
    +}
    +
    +/*
    + * Condense the on-disk space map representation to its minimized form.
    + * The minimized form consists of a small number of allocations followed by
    + * the in-core free map.
    + */
    +static void
    +metaslab_condense(metaslab_t *msp, uint64_t txg, dmu_tx_t *tx)
    +{
    +	spa_t *spa = msp->ms_group->mg_vd->vdev_spa;
    +	space_map_t *freemap = msp->ms_freemap[txg & TXG_MASK];
    +	space_map_t condense_map;
    +	space_map_t *sm = msp->ms_map;
    +	objset_t *mos = spa_meta_objset(spa);
    +	space_map_obj_t *smo = &msp->ms_smo_syncing;
    +
    +	ASSERT(MUTEX_HELD(&msp->ms_lock));
    +	ASSERT3U(spa_sync_pass(spa), ==, 1);
    +	ASSERT(sm->sm_loaded);
    +
    +	spa_dbgmsg(spa, "condensing: txg %llu, msp[%llu] %p, "
    +	    "smo size %llu, segments %lu", txg,
    +	    (msp->ms_map->sm_start / msp->ms_map->sm_size), msp,
    +	    smo->smo_objsize, avl_numnodes(&sm->sm_root));
    +
    +	/*
    +	 * Create an map that is a 100% allocated map. We remove segments
    +	 * that have been freed in this txg, any deferred frees that exist,
    +	 * and any allocation in the future. Removing segments should be
    +	 * a relatively inexpensive operation since we expect these maps to
    +	 * a small number of nodes.
    +	 */
    +	space_map_create(&condense_map, sm->sm_start, sm->sm_size,
    +	    sm->sm_shift, sm->sm_lock);
    +	space_map_add(&condense_map, condense_map.sm_start,
    +	    condense_map.sm_size);
    +
    +	/*
    +	 * Remove what's been freed in this txg from the condense_map.
    +	 * Since we're in sync_pass 1, we know that all the frees from
    +	 * this txg are in the freemap.
    +	 */
    +	space_map_walk(freemap, space_map_remove, &condense_map);
    +
    +	for (int t = 0; t < TXG_DEFER_SIZE; t++)
    +		space_map_walk(msp->ms_defermap[t],
    +		    space_map_remove, &condense_map);
    +
    +	for (int t = 1; t < TXG_CONCURRENT_STATES; t++)
    +		space_map_walk(msp->ms_allocmap[(txg + t) & TXG_MASK],
    +		    space_map_remove, &condense_map);
    +
    +	/*
    +	 * We're about to drop the metaslab's lock thus allowing
    +	 * other consumers to change it's content. Set the
    +	 * space_map's sm_condensing flag to ensure that
    +	 * allocations on this metaslab do not occur while we're
    +	 * in the middle of committing it to disk. This is only critical
    +	 * for the ms_map as all other space_maps use per txg
    +	 * views of their content.
    +	 */
    +	sm->sm_condensing = B_TRUE;
    +
    +	mutex_exit(&msp->ms_lock);
    +	space_map_truncate(smo, mos, tx);
    +	mutex_enter(&msp->ms_lock);
    +
    +	/*
    +	 * While we would ideally like to create a space_map representation
    +	 * that consists only of allocation records, doing so can be
    +	 * prohibitively expensive because the in-core free map can be
    +	 * large, and therefore computationally expensive to subtract
    +	 * from the condense_map. Instead we sync out two maps, a cheap
    +	 * allocation only map followed by the in-core free map. While not
    +	 * optimal, this is typically close to optimal, and much cheaper to
    +	 * compute.
    +	 */
    +	space_map_sync(&condense_map, SM_ALLOC, smo, mos, tx);
    +	space_map_vacate(&condense_map, NULL, NULL);
    +	space_map_destroy(&condense_map);
    +
    +	space_map_sync(sm, SM_FREE, smo, mos, tx);
    +	sm->sm_condensing = B_FALSE;
    +
    +	spa_dbgmsg(spa, "condensed: txg %llu, msp[%llu] %p, "
    +	    "smo size %llu", txg,
    +	    (msp->ms_map->sm_start / msp->ms_map->sm_size), msp,
    +	    smo->smo_objsize);
    +}
    +
    +/*
      * Write a metaslab to disk in the context of the specified transaction group.
      */
     void
    @@ -944,17 +1114,29 @@ metaslab_sync(metaslab_t *msp, uint64_t 
     	vdev_t *vd = msp->ms_group->mg_vd;
     	spa_t *spa = vd->vdev_spa;
     	objset_t *mos = spa_meta_objset(spa);
    -	space_map_t *allocmap = &msp->ms_allocmap[txg & TXG_MASK];
    -	space_map_t *freemap = &msp->ms_freemap[txg & TXG_MASK];
    -	space_map_t *freed_map = &msp->ms_freemap[TXG_CLEAN(txg) & TXG_MASK];
    -	space_map_t *sm = &msp->ms_map;
    +	space_map_t *allocmap = msp->ms_allocmap[txg & TXG_MASK];
    +	space_map_t **freemap = &msp->ms_freemap[txg & TXG_MASK];
    +	space_map_t **freed_map = &msp->ms_freemap[TXG_CLEAN(txg) & TXG_MASK];
    +	space_map_t *sm = msp->ms_map;
     	space_map_obj_t *smo = &msp->ms_smo_syncing;
     	dmu_buf_t *db;
     	dmu_tx_t *tx;
     
     	ASSERT(!vd->vdev_ishole);
     
    -	if (allocmap->sm_space == 0 && freemap->sm_space == 0)
    +	/*
    +	 * This metaslab has just been added so there's no work to do now.
    +	 */
    +	if (*freemap == NULL) {
    +		ASSERT3P(allocmap, ==, NULL);
    +		return;
    +	}
    +
    +	ASSERT3P(allocmap, !=, NULL);
    +	ASSERT3P(*freemap, !=, NULL);
    +	ASSERT3P(*freed_map, !=, NULL);
    +
    +	if (allocmap->sm_space == 0 && (*freemap)->sm_space == 0)
     		return;
     
     	/*
    @@ -982,49 +1164,36 @@ metaslab_sync(metaslab_t *msp, uint64_t 
     
     	mutex_enter(&msp->ms_lock);
     
    -	space_map_walk(freemap, space_map_add, freed_map);
    -
    -	if (sm->sm_loaded && spa_sync_pass(spa) == 1 && smo->smo_objsize >=
    -	    2 * sizeof (uint64_t) * avl_numnodes(&sm->sm_root)) {
    -		/*
    -		 * The in-core space map representation is twice as compact
    -		 * as the on-disk one, so it's time to condense the latter
    -		 * by generating a pure allocmap from first principles.
    -		 *
    -		 * This metaslab is 100% allocated,
    -		 * minus the content of the in-core map (sm),
    -		 * minus what's been freed this txg (freed_map),
    -		 * minus deferred frees (ms_defermap[]),
    -		 * minus allocations from txgs in the future
    -		 * (because they haven't been committed yet).
    -		 */
    -		space_map_vacate(allocmap, NULL, NULL);
    -		space_map_vacate(freemap, NULL, NULL);
    -
    -		space_map_add(allocmap, allocmap->sm_start, allocmap->sm_size);
    -
    -		space_map_walk(sm, space_map_remove, allocmap);
    -		space_map_walk(freed_map, space_map_remove, allocmap);
    -
    -		for (int t = 0; t < TXG_DEFER_SIZE; t++)
    -			space_map_walk(&msp->ms_defermap[t],
    -			    space_map_remove, allocmap);
    +	if (sm->sm_loaded && spa_sync_pass(spa) == 1 &&
    +	    metaslab_should_condense(msp)) {
    +		metaslab_condense(msp, txg, tx);
    +	} else {
    +		space_map_sync(allocmap, SM_ALLOC, smo, mos, tx);
    +		space_map_sync(*freemap, SM_FREE, smo, mos, tx);
    +	}
     
    -		for (int t = 1; t < TXG_CONCURRENT_STATES; t++)
    -			space_map_walk(&msp->ms_allocmap[(txg + t) & TXG_MASK],
    -			    space_map_remove, allocmap);
    +	space_map_vacate(allocmap, NULL, NULL);
     
    -		mutex_exit(&msp->ms_lock);
    -		space_map_truncate(smo, mos, tx);
    -		mutex_enter(&msp->ms_lock);
    +	/*
    +	 * For sync pass 1, we avoid walking the entire space map and
    +	 * instead will just swap the pointers for freemap and
    +	 * freed_map. We can safely do this since the freed_map is
    +	 * guaranteed to be empty on the initial pass.
    +	 */
    +	if (spa_sync_pass(spa) == 1) {
    +		ASSERT0((*freed_map)->sm_space);
    +		ASSERT0(avl_numnodes(&(*freed_map)->sm_root));
    +		space_map_swap(freemap, freed_map);
    +	} else {
    +		space_map_vacate(*freemap, space_map_add, *freed_map);
     	}
     
    -	space_map_sync(allocmap, SM_ALLOC, smo, mos, tx);
    -	space_map_sync(freemap, SM_FREE, smo, mos, tx);
    +	ASSERT0(msp->ms_allocmap[txg & TXG_MASK]->sm_space);
    +	ASSERT0(msp->ms_freemap[txg & TXG_MASK]->sm_space);
     
     	mutex_exit(&msp->ms_lock);
     
    -	VERIFY(0 == dmu_bonus_hold(mos, smo->smo_object, FTAG, &db));
    +	VERIFY0(dmu_bonus_hold(mos, smo->smo_object, FTAG, &db));
     	dmu_buf_will_dirty(db, tx);
     	ASSERT3U(db->db_size, >=, sizeof (*smo));
     	bcopy(smo, db->db_data, sizeof (*smo));
    @@ -1042,9 +1211,9 @@ metaslab_sync_done(metaslab_t *msp, uint
     {
     	space_map_obj_t *smo = &msp->ms_smo;
     	space_map_obj_t *smosync = &msp->ms_smo_syncing;
    -	space_map_t *sm = &msp->ms_map;
    -	space_map_t *freed_map = &msp->ms_freemap[TXG_CLEAN(txg) & TXG_MASK];
    -	space_map_t *defer_map = &msp->ms_defermap[txg % TXG_DEFER_SIZE];
    +	space_map_t *sm = msp->ms_map;
    +	space_map_t **freed_map = &msp->ms_freemap[TXG_CLEAN(txg) & TXG_MASK];
    +	space_map_t **defer_map = &msp->ms_defermap[txg % TXG_DEFER_SIZE];
     	metaslab_group_t *mg = msp->ms_group;
     	vdev_t *vd = mg->mg_vd;
     	int64_t alloc_delta, defer_delta;
    @@ -1055,40 +1224,57 @@ metaslab_sync_done(metaslab_t *msp, uint
     
     	/*
     	 * If this metaslab is just becoming available, initialize its
    -	 * allocmaps and freemaps and add its capacity to the vdev.
    +	 * allocmaps, freemaps, and defermap and add its capacity to the vdev.
     	 */
    -	if (freed_map->sm_size == 0) {
    +	if (*freed_map == NULL) {
    +		ASSERT(*defer_map == NULL);
     		for (int t = 0; t < TXG_SIZE; t++) {
    -			space_map_create(&msp->ms_allocmap[t], sm->sm_start,
    +			msp->ms_allocmap[t] = kmem_zalloc(sizeof (space_map_t),
    +			    KM_SLEEP);
    +			space_map_create(msp->ms_allocmap[t], sm->sm_start,
     			    sm->sm_size, sm->sm_shift, sm->sm_lock);
    -			space_map_create(&msp->ms_freemap[t], sm->sm_start,
    +			msp->ms_freemap[t] = kmem_zalloc(sizeof (space_map_t),
    +			    KM_SLEEP);
    +			space_map_create(msp->ms_freemap[t], sm->sm_start,
     			    sm->sm_size, sm->sm_shift, sm->sm_lock);
     		}
     
    -		for (int t = 0; t < TXG_DEFER_SIZE; t++)
    -			space_map_create(&msp->ms_defermap[t], sm->sm_start,
    +		for (int t = 0; t < TXG_DEFER_SIZE; t++) {
    +			msp->ms_defermap[t] = kmem_zalloc(sizeof (space_map_t),
    +			    KM_SLEEP);
    +			space_map_create(msp->ms_defermap[t], sm->sm_start,
     			    sm->sm_size, sm->sm_shift, sm->sm_lock);
    +		}
    +
    +		freed_map = &msp->ms_freemap[TXG_CLEAN(txg) & TXG_MASK];
    +		defer_map = &msp->ms_defermap[txg % TXG_DEFER_SIZE];
     
     		vdev_space_update(vd, 0, 0, sm->sm_size);
     	}
     
     	alloc_delta = smosync->smo_alloc - smo->smo_alloc;
    -	defer_delta = freed_map->sm_space - defer_map->sm_space;
    +	defer_delta = (*freed_map)->sm_space - (*defer_map)->sm_space;
     
     	vdev_space_update(vd, alloc_delta + defer_delta, defer_delta, 0);
     
    -	ASSERT(msp->ms_allocmap[txg & TXG_MASK].sm_space == 0);
    -	ASSERT(msp->ms_freemap[txg & TXG_MASK].sm_space == 0);
    +	ASSERT(msp->ms_allocmap[txg & TXG_MASK]->sm_space == 0);
    +	ASSERT(msp->ms_freemap[txg & TXG_MASK]->sm_space == 0);
     
     	/*
     	 * If there's a space_map_load() in progress, wait for it to complete
     	 * so that we have a consistent view of the in-core space map.
    -	 * Then, add defer_map (oldest deferred frees) to this map and
    -	 * transfer freed_map (this txg's frees) to defer_map.
     	 */
     	space_map_load_wait(sm);
    -	space_map_vacate(defer_map, sm->sm_loaded ? space_map_free : NULL, sm);
    -	space_map_vacate(freed_map, space_map_add, defer_map);
    +
    +	/*
    +	 * Move the frees from the defer_map to this map (if it's loaded).
    +	 * Swap the freed_map and the defer_map -- this is safe to do
    +	 * because we've just emptied out the defer_map.
    +	 */
    +	space_map_vacate(*defer_map, sm->sm_loaded ? space_map_free : NULL, sm);
    +	ASSERT0((*defer_map)->sm_space);
    +	ASSERT0(avl_numnodes(&(*defer_map)->sm_root));
    +	space_map_swap(freed_map, defer_map);
     
     	*smo = *smosync;
     
    @@ -1112,7 +1298,7 @@ metaslab_sync_done(metaslab_t *msp, uint
     		int evictable = 1;
     
     		for (int t = 1; t < TXG_CONCURRENT_STATES; t++)
    -			if (msp->ms_allocmap[(txg + t) & TXG_MASK].sm_space)
    +			if (msp->ms_allocmap[(txg + t) & TXG_MASK]->sm_space)
     				evictable = 0;
     
     		if (evictable && !metaslab_debug)
    @@ -1137,7 +1323,7 @@ metaslab_sync_reassess(metaslab_group_t 
     	for (int m = 0; m < vd->vdev_ms_count; m++) {
     		metaslab_t *msp = vd->vdev_ms[m];
     
    -		if (msp->ms_map.sm_start > mg->mg_bonus_area)
    +		if (msp->ms_map->sm_start > mg->mg_bonus_area)
     			break;
     
     		mutex_enter(&msp->ms_lock);
    @@ -1158,7 +1344,7 @@ metaslab_distance(metaslab_t *msp, dva_t
     {
     	uint64_t ms_shift = msp->ms_group->mg_vd->vdev_ms_shift;
     	uint64_t offset = DVA_GET_OFFSET(dva) >> ms_shift;
    -	uint64_t start = msp->ms_map.sm_start >> ms_shift;
    +	uint64_t start = msp->ms_map->sm_start >> ms_shift;
     
     	if (msp->ms_group->mg_vd->vdev_id != DVA_GET_VDEV(dva))
     		return (1ULL << 63);
    @@ -1206,6 +1392,13 @@ metaslab_group_alloc(metaslab_group_t *m
     				mutex_exit(&mg->mg_lock);
     				return (-1ULL);
     			}
    +
    +			/*
    +			 * If the selected metaslab is condensing, skip it.
    +			 */
    +			if (msp->ms_map->sm_condensing)
    +				continue;
    +
     			was_active = msp->ms_weight & METASLAB_ACTIVE_MASK;
     			if (activation_weight == METASLAB_WEIGHT_PRIMARY)
     				break;
    @@ -1271,20 +1464,30 @@ metaslab_group_alloc(metaslab_group_t *m
     			continue;
     		}
     
    -		if ((offset = space_map_alloc(&msp->ms_map, asize)) != -1ULL)
    +		/*
    +		 * If this metaslab is currently condensing then pick again as
    +		 * we can't manipulate this metaslab until it's committed
    +		 * to disk.
    +		 */
    +		if (msp->ms_map->sm_condensing) {
    +			mutex_exit(&msp->ms_lock);
    +			continue;
    +		}
    +
    +		if ((offset = space_map_alloc(msp->ms_map, asize)) != -1ULL)
     			break;
     
     		atomic_inc_64(&mg->mg_alloc_failures);
     
    -		metaslab_passivate(msp, space_map_maxsize(&msp->ms_map));
    +		metaslab_passivate(msp, space_map_maxsize(msp->ms_map));
     
     		mutex_exit(&msp->ms_lock);
     	}
     
    -	if (msp->ms_allocmap[txg & TXG_MASK].sm_space == 0)
    +	if (msp->ms_allocmap[txg & TXG_MASK]->sm_space == 0)
     		vdev_dirty(mg->mg_vd, VDD_METASLAB, msp, txg);
     
    -	space_map_add(&msp->ms_allocmap[txg & TXG_MASK], offset, asize);
    +	space_map_add(msp->ms_allocmap[txg & TXG_MASK], offset, asize);
     
     	mutex_exit(&msp->ms_lock);
     
    @@ -1516,13 +1719,13 @@ metaslab_free_dva(spa_t *spa, const dva_
     	mutex_enter(&msp->ms_lock);
     
     	if (now) {
    -		space_map_remove(&msp->ms_allocmap[txg & TXG_MASK],
    +		space_map_remove(msp->ms_allocmap[txg & TXG_MASK],
     		    offset, size);
    -		space_map_free(&msp->ms_map, offset, size);
    +		space_map_free(msp->ms_map, offset, size);
     	} else {
    -		if (msp->ms_freemap[txg & TXG_MASK].sm_space == 0)
    +		if (msp->ms_freemap[txg & TXG_MASK]->sm_space == 0)
     			vdev_dirty(vd, VDD_METASLAB, msp, txg);
    -		space_map_add(&msp->ms_freemap[txg & TXG_MASK], offset, size);
    +		space_map_add(msp->ms_freemap[txg & TXG_MASK], offset, size);
     	}
     
     	mutex_exit(&msp->ms_lock);
    @@ -1557,10 +1760,10 @@ metaslab_claim_dva(spa_t *spa, const dva
     
     	mutex_enter(&msp->ms_lock);
     
    -	if ((txg != 0 && spa_writeable(spa)) || !msp->ms_map.sm_loaded)
    +	if ((txg != 0 && spa_writeable(spa)) || !msp->ms_map->sm_loaded)
     		error = metaslab_activate(msp, METASLAB_WEIGHT_SECONDARY);
     
    -	if (error == 0 && !space_map_contains(&msp->ms_map, offset, size))
    +	if (error == 0 && !space_map_contains(msp->ms_map, offset, size))
     		error = ENOENT;
     
     	if (error || txg == 0) {	/* txg == 0 indicates dry run */
    @@ -1568,12 +1771,12 @@ metaslab_claim_dva(spa_t *spa, const dva
     		return (error);
     	}
     
    -	space_map_claim(&msp->ms_map, offset, size);
    +	space_map_claim(msp->ms_map, offset, size);
     
     	if (spa_writeable(spa)) {	/* don't dirty if we're zdb(1M) */
    -		if (msp->ms_allocmap[txg & TXG_MASK].sm_space == 0)
    +		if (msp->ms_allocmap[txg & TXG_MASK]->sm_space == 0)
     			vdev_dirty(vd, VDD_METASLAB, msp, txg);
    -		space_map_add(&msp->ms_allocmap[txg & TXG_MASK], offset, size);
    +		space_map_add(msp->ms_allocmap[txg & TXG_MASK], offset, size);
     	}
     
     	mutex_exit(&msp->ms_lock);
    
    Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c
    ==============================================================================
    --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c	Wed Feb 27 11:42:28 2013	(r247397)
    +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c	Wed Feb 27 14:45:23 2013	(r247398)
    @@ -114,6 +114,7 @@ space_map_add(space_map_t *sm, uint64_t 
     	int merge_before, merge_after;
     
     	ASSERT(MUTEX_HELD(sm->sm_lock));
    +	VERIFY(!sm->sm_condensing);
     	VERIFY(size != 0);
     	VERIFY3U(start, >=, sm->sm_start);
     	VERIFY3U(end, <=, sm->sm_start + sm->sm_size);
    @@ -198,6 +199,7 @@ space_map_remove(space_map_t *sm, uint64
     	int left_over, right_over;
     
     	ASSERT(MUTEX_HELD(sm->sm_lock));
    +	VERIFY(!sm->sm_condensing);
     	VERIFY(size != 0);
     	VERIFY(P2PHASE(start, 1ULL << sm->sm_shift) == 0);
     	VERIFY(P2PHASE(size, 1ULL << sm->sm_shift) == 0);
    @@ -267,6 +269,20 @@ space_map_contains(space_map_t *sm, uint
     }
     
     void
    +space_map_swap(space_map_t **msrc, space_map_t **mdst)
    +{
    +	space_map_t *sm;
    +
    +	ASSERT(MUTEX_HELD((*msrc)->sm_lock));
    +	ASSERT0((*mdst)->sm_space);
    +	ASSERT0(avl_numnodes(&(*mdst)->sm_root));
    +
    +	sm = *msrc;
    +	*msrc = *mdst;
    +	*mdst = sm;
    +}
    +
    +void
     space_map_vacate(space_map_t *sm, space_map_func_t *func, space_map_t *mdest)
     {
     	space_seg_t *ss;
    @@ -447,9 +463,9 @@ space_map_sync(space_map_t *sm, uint8_t 
     	space_map_obj_t *smo, objset_t *os, dmu_tx_t *tx)
     {
     	spa_t *spa = dmu_objset_spa(os);
    -	void *cookie = NULL;
    +	avl_tree_t *t = &sm->sm_root;
     	space_seg_t *ss;
    -	uint64_t bufsize, start, size, run_len, delta, sm_space;
    +	uint64_t bufsize, start, size, run_len, total, sm_space, nodes;
     	uint64_t *entry, *entry_map, *entry_map_end;
     
     	ASSERT(MUTEX_HELD(sm->sm_lock));
    @@ -478,13 +494,14 @@ space_map_sync(space_map_t *sm, uint8_t 
     	    SM_DEBUG_SYNCPASS_ENCODE(spa_sync_pass(spa)) |
     	    SM_DEBUG_TXG_ENCODE(dmu_tx_get_txg(tx));
     
    -	delta = 0;
    +	total = 0;
    +	nodes = avl_numnodes(&sm->sm_root);
     	sm_space = sm->sm_space;
    -	while ((ss = avl_destroy_nodes(&sm->sm_root, &cookie)) != NULL) {
    +	for (ss = avl_first(t); ss != NULL; ss = AVL_NEXT(t, ss)) {
     		size = ss->ss_end - ss->ss_start;
     		start = (ss->ss_start - sm->sm_start) >> sm->sm_shift;
     
    -		delta += size;
    +		total += size;
     		size >>= sm->sm_shift;
     
     		while (size) {
    @@ -506,7 +523,6 @@ space_map_sync(space_map_t *sm, uint8_t 
     			start += run_len;
     			size -= run_len;
     		}
    -		kmem_cache_free(space_seg_cache, ss);
     	}
     
     	if (entry != entry_map) {
    @@ -522,12 +538,11 @@ space_map_sync(space_map_t *sm, uint8_t 
     	 * Ensure that the space_map's accounting wasn't changed
     	 * while we were in the middle of writing it out.
     	 */
    +	VERIFY3U(nodes, ==, avl_numnodes(&sm->sm_root));
     	VERIFY3U(sm->sm_space, ==, sm_space);
    +	VERIFY3U(sm->sm_space, ==, total);
     
     	zio_buf_free(entry_map, bufsize);
    -
    -	sm->sm_space -= delta;
    -	VERIFY0(sm->sm_space);
     }
     
     void
    
    Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h
    ==============================================================================
    --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h	Wed Feb 27 11:42:28 2013	(r247397)
    +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h	Wed Feb 27 14:45:23 2013	(r247398)
    @@ -66,20 +66,38 @@ struct metaslab_group {
     };
     
     /*
    - * Each metaslab's free space is tracked in space map object in the MOS,
    - * which is only updated in syncing context.  Each time we sync a txg,
    + * Each metaslab maintains an in-core free map (ms_map) that contains the
    + * current list of free segments. As blocks are allocated, the allocated
    + * segment is removed from the ms_map and added to a per txg allocation map.
    + * As blocks are freed, they are added to the per txg free map. These per
    + * txg maps allow us to process all allocations and frees in syncing context
    + * where it is safe to update the on-disk space maps.
    + *
    + * Each metaslab's free space is tracked in a space map object in the MOS,
    + * which is only updated in syncing context. Each time we sync a txg,
      * we append the allocs and frees from that txg to the space map object.
      * When the txg is done syncing, metaslab_sync_done() updates ms_smo
    - * to ms_smo_syncing.  Everything in ms_smo is always safe to allocate.
    + * to ms_smo_syncing. Everything in ms_smo is always safe to allocate.
    + *
    + * To load the in-core free map we read the space map object from disk.
    + * This object contains a series of alloc and free records that are
    + * combined to make up the list of all free segments in this metaslab. These
    + * segments are represented in-core by the ms_map and are stored in an
    + * AVL tree.
    + *
    + * As the space map objects grows (as a result of the appends) it will
    + * eventually become space-inefficient. When the space map object is
    + * zfs_condense_pct/100 times the size of the minimal on-disk representation,
    + * we rewrite it in its minimized form.
      */
     struct metaslab {
     	kmutex_t	ms_lock;	/* metaslab lock		*/
     	space_map_obj_t	ms_smo;		/* synced space map object	*/
     	space_map_obj_t	ms_smo_syncing;	/* syncing space map object	*/
    -	space_map_t	ms_allocmap[TXG_SIZE];  /* allocated this txg	*/
    -	space_map_t	ms_freemap[TXG_SIZE];	/* freed this txg	*/
    -	space_map_t	ms_defermap[TXG_DEFER_SIZE]; /* deferred frees	*/
    -	space_map_t	ms_map;		/* in-core free space map	*/
    +	space_map_t	*ms_allocmap[TXG_SIZE];	/* allocated this txg	*/
    +	space_map_t	*ms_freemap[TXG_SIZE];	/* freed this txg	*/
    +	space_map_t	*ms_defermap[TXG_DEFER_SIZE];	/* deferred frees */
    +	space_map_t	*ms_map;	/* in-core free space map	*/
     	int64_t		ms_deferspace;	/* sum of ms_defermap[] space	*/
     	uint64_t	ms_weight;	/* weight vs. others in group	*/
     	metaslab_group_t *ms_group;	/* metaslab group		*/
    
    Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h
    ==============================================================================
    --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h	Wed Feb 27 11:42:28 2013	(r247397)
    +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h	Wed Feb 27 14:45:23 2013	(r247398)
    @@ -40,17 +40,17 @@ extern "C" {
     typedef struct space_map_ops space_map_ops_t;
     
     typedef struct space_map {
    -	avl_tree_t	sm_root;	/* AVL tree of map segments */
    +	avl_tree_t	sm_root;	/* offset-ordered segment AVL tree */
     	uint64_t	sm_space;	/* sum of all segments in the map */
     	uint64_t	sm_start;	/* start of map */
     	uint64_t	sm_size;	/* size of map */
     	uint8_t		sm_shift;	/* unit shift */
    -	uint8_t		sm_pad[3];	/* unused */
     	uint8_t		sm_loaded;	/* map loaded? */
     	uint8_t		sm_loading;	/* map loading? */
    +	uint8_t		sm_condensing;	/* map condensing? */
     	kcondvar_t	sm_load_cv;	/* map load completion */
     	space_map_ops_t	*sm_ops;	/* space map block picker ops vector */
    -	avl_tree_t	*sm_pp_root;	/* picker-private AVL tree */
    +	avl_tree_t	*sm_pp_root;	/* size-ordered, picker-private tree */
     	void		*sm_ppd;	/* picker-private data */
     	kmutex_t	*sm_lock;	/* pointer to lock that protects map */
     } space_map_t;
    @@ -149,6 +149,7 @@ extern void space_map_add(space_map_t *s
     extern void space_map_remove(space_map_t *sm, uint64_t start, uint64_t size);
     extern boolean_t space_map_contains(space_map_t *sm,
         uint64_t start, uint64_t size);
    +extern void space_map_swap(space_map_t **msrc, space_map_t **mdest);
     extern void space_map_vacate(space_map_t *sm,
         space_map_func_t *func, space_map_t *mdest);
     extern void space_map_walk(space_map_t *sm,
    
    Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
    ==============================================================================
    --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Wed Feb 27 11:42:28 2013	(r247397)
    +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Wed Feb 27 14:45:23 2013	(r247398)
    @@ -1847,6 +1847,7 @@ vdev_dtl_sync(vdev_t *vd, uint64_t txg)
     
     	space_map_truncate(smo, mos, tx);
     	space_map_sync(&smsync, SM_ALLOC, smo, mos, tx);
    +	space_map_vacate(&smsync, NULL, NULL);
     
     	space_map_destroy(&smsync);
     
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 17:12:46 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id C12B39AF;
     Wed, 27 Feb 2013 17:12:46 +0000 (UTC) (envelope-from jhb@freebsd.org)
    Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net
     [IPv6:2001:470:1f10:75::2])
     by mx1.freebsd.org (Postfix) with ESMTP id 9DD12F75;
     Wed, 27 Feb 2013 17:12:46 +0000 (UTC)
    Received: from jhbbsd.localnet (unknown [209.249.190.124])
     by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1E7F8B91E;
     Wed, 27 Feb 2013 12:12:46 -0500 (EST)
    From: John Baldwin 
    To: Nick Hibma 
    Subject: Re: svn commit: r247359 - head/sbin/reboot
    Date: Wed, 27 Feb 2013 11:38:24 -0500
    User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; )
    References: <201302262318.r1QNIauL003863@svn.freebsd.org>
    In-Reply-To: <201302262318.r1QNIauL003863@svn.freebsd.org>
    MIME-Version: 1.0
    Content-Type: Text/Plain;
      charset="utf-8"
    Content-Transfer-Encoding: 7bit
    Message-Id: <201302271138.24452.jhb@freebsd.org>
    X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
     (bigwig.baldwin.cx); Wed, 27 Feb 2013 12:12:46 -0500 (EST)
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 17:12:46 -0000
    
    On Tuesday, February 26, 2013 6:18:36 pm Nick Hibma wrote:
    > Author: n_hibma
    > Date: Tue Feb 26 23:18:35 2013
    > New Revision: 247359
    > URL: http://svnweb.freebsd.org/changeset/base/247359
    > 
    > Log:
    >   Clarify that overriding the -h/-D flags through flags in device.hints
    >   only works for sio(4) but not for uart(4) which no longer has this flag.
    
    You should probably just remove the flag entirely.  sio(4) doesn't build on 
    8.x and later.
    
    -- 
    John Baldwin
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 18:12:05 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 86A1CCB3;
     Wed, 27 Feb 2013 18:12:05 +0000 (UTC) (envelope-from pho@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 75365351;
     Wed, 27 Feb 2013 18:12:05 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RIC46Q051130;
     Wed, 27 Feb 2013 18:12:04 GMT (envelope-from pho@svn.freebsd.org)
    Received: (from pho@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RIC4HZ051129;
     Wed, 27 Feb 2013 18:12:04 GMT (envelope-from pho@svn.freebsd.org)
    Message-Id: <201302271812.r1RIC4HZ051129@svn.freebsd.org>
    From: Peter Holm 
    Date: Wed, 27 Feb 2013 18:12:04 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247399 - head/sbin/tunefs
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 18:12:05 -0000
    
    Author: pho
    Date: Wed Feb 27 18:12:04 2013
    New Revision: 247399
    URL: http://svnweb.freebsd.org/changeset/base/247399
    
    Log:
      The .journal file needs to reside on the ROOTINO which must not extend
      beyond direct blocks. A typo caused this check to fail.
    
    Modified:
      head/sbin/tunefs/tunefs.c
    
    Modified: head/sbin/tunefs/tunefs.c
    ==============================================================================
    --- head/sbin/tunefs/tunefs.c	Wed Feb 27 14:45:23 2013	(r247398)
    +++ head/sbin/tunefs/tunefs.c	Wed Feb 27 18:12:04 2013	(r247399)
    @@ -671,7 +671,7 @@ journal_findfile(void)
     				return (ino);
     		}
     	} else {
    -		if ((off_t)dp1->di_size >= lblktosize(&sblock, NDADDR)) {
    +		if ((off_t)dp2->di_size >= lblktosize(&sblock, NDADDR)) {
     			warnx("ROOTINO extends beyond direct blocks.");
     			return (-1);
     		}
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 18:12:15 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 4960BDFC;
     Wed, 27 Feb 2013 18:12:15 +0000 (UTC)
     (envelope-from attilio@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 3B5A3353;
     Wed, 27 Feb 2013 18:12:15 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RICF1j051199;
     Wed, 27 Feb 2013 18:12:15 GMT (envelope-from attilio@svn.freebsd.org)
    Received: (from attilio@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RICD1s051187;
     Wed, 27 Feb 2013 18:12:13 GMT (envelope-from attilio@svn.freebsd.org)
    Message-Id: <201302271812.r1RICD1s051187@svn.freebsd.org>
    From: Attilio Rao 
    Date: Wed, 27 Feb 2013 18:12:13 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247400 - in head/sys: amd64/amd64 i386/i386 i386/xen
     powerpc/aim powerpc/booke sparc64/sparc64 vm
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 18:12:15 -0000
    
    Author: attilio
    Date: Wed Feb 27 18:12:13 2013
    New Revision: 247400
    URL: http://svnweb.freebsd.org/changeset/base/247400
    
    Log:
      Merge from vmobj-rwlock:
      VM_OBJECT_LOCKED() macro is only used to implement a custom version
      of lock assertions right now (which likely spread out thanks to
      copy and paste).
      Remove it and implement actual assertions.
      
      Sponsored by:	EMC / Isilon storage division
      Reviewed by:	alc
      Tested by:	pho
    
    Modified:
      head/sys/amd64/amd64/pmap.c
      head/sys/i386/i386/pmap.c
      head/sys/i386/xen/pmap.c
      head/sys/powerpc/aim/mmu_oea.c
      head/sys/powerpc/aim/mmu_oea64.c
      head/sys/powerpc/booke/pmap.c
      head/sys/sparc64/sparc64/pmap.c
      head/sys/vm/vm_object.h
    
    Modified: head/sys/amd64/amd64/pmap.c
    ==============================================================================
    --- head/sys/amd64/amd64/pmap.c	Wed Feb 27 18:12:04 2013	(r247399)
    +++ head/sys/amd64/amd64/pmap.c	Wed Feb 27 18:12:13 2013	(r247400)
    @@ -3492,9 +3492,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, 
     	KASSERT((m->oflags & VPO_UNMANAGED) != 0 || va < kmi.clean_sva ||
     	    va >= kmi.clean_eva,
     	    ("pmap_enter: managed mapping within the clean submap"));
    -	KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
    -	    VM_OBJECT_LOCKED(m->object),
    -	    ("pmap_enter: page %p is not busy", m));
    +	if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0)
    +		VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
     	pa = VM_PAGE_TO_PHYS(m);
     	newpte = (pt_entry_t)(pa | PG_A | PG_V);
     	if ((access & VM_PROT_WRITE) != 0)
    
    Modified: head/sys/i386/i386/pmap.c
    ==============================================================================
    --- head/sys/i386/i386/pmap.c	Wed Feb 27 18:12:04 2013	(r247399)
    +++ head/sys/i386/i386/pmap.c	Wed Feb 27 18:12:13 2013	(r247400)
    @@ -3456,9 +3456,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, 
     	KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS,
     	    ("pmap_enter: invalid to pmap_enter page table pages (va: 0x%x)",
     	    va));
    -	KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
    -	    VM_OBJECT_LOCKED(m->object),
    -	    ("pmap_enter: page %p is not busy", m));
    +	if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0)
    +		VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
     
     	mpte = NULL;
     
    
    Modified: head/sys/i386/xen/pmap.c
    ==============================================================================
    --- head/sys/i386/xen/pmap.c	Wed Feb 27 18:12:04 2013	(r247399)
    +++ head/sys/i386/xen/pmap.c	Wed Feb 27 18:12:13 2013	(r247400)
    @@ -2666,9 +2666,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, 
     	KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS,
     	    ("pmap_enter: invalid to pmap_enter page table pages (va: 0x%x)",
     	    va));
    -	KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
    -	    VM_OBJECT_LOCKED(m->object),
    -	    ("pmap_enter: page %p is not busy", m));
    +	if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0)
    +		VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
     
     	mpte = NULL;
     
    
    Modified: head/sys/powerpc/aim/mmu_oea.c
    ==============================================================================
    --- head/sys/powerpc/aim/mmu_oea.c	Wed Feb 27 18:12:04 2013	(r247399)
    +++ head/sys/powerpc/aim/mmu_oea.c	Wed Feb 27 18:12:13 2013	(r247400)
    @@ -1121,9 +1121,8 @@ moea_enter_locked(pmap_t pmap, vm_offset
     	if (pmap_bootstrapped)
     		rw_assert(&pvh_global_lock, RA_WLOCKED);
     	PMAP_LOCK_ASSERT(pmap, MA_OWNED);
    -	KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
    -	    VM_OBJECT_LOCKED(m->object),
    -	    ("moea_enter_locked: page %p is not busy", m));
    +	if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0)
    +		VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
     
     	/* XXX change the pvo head for fake pages */
     	if ((m->oflags & VPO_UNMANAGED) != 0) {
    
    Modified: head/sys/powerpc/aim/mmu_oea64.c
    ==============================================================================
    --- head/sys/powerpc/aim/mmu_oea64.c	Wed Feb 27 18:12:04 2013	(r247399)
    +++ head/sys/powerpc/aim/mmu_oea64.c	Wed Feb 27 18:12:13 2013	(r247400)
    @@ -1183,9 +1183,8 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_
     		pvo_flags = PVO_MANAGED;
     	}
     
    -	KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
    -	    VM_OBJECT_LOCKED(m->object),
    -	    ("moea64_enter: page %p is not busy", m));
    +	if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0)
    +		VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
     
     	/* XXX change the pvo head for fake pages */
     	if ((m->oflags & VPO_UNMANAGED) != 0) {
    
    Modified: head/sys/powerpc/booke/pmap.c
    ==============================================================================
    --- head/sys/powerpc/booke/pmap.c	Wed Feb 27 18:12:04 2013	(r247399)
    +++ head/sys/powerpc/booke/pmap.c	Wed Feb 27 18:12:13 2013	(r247400)
    @@ -1560,9 +1560,8 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t
     		KASSERT((va <= VM_MAXUSER_ADDRESS),
     		    ("mmu_booke_enter_locked: user pmap, non user va"));
     	}
    -	KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
    -	    VM_OBJECT_LOCKED(m->object),
    -	    ("mmu_booke_enter_locked: page %p is not busy", m));
    +	if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0)
    +		VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
     
     	PMAP_LOCK_ASSERT(pmap, MA_OWNED);
     
    
    Modified: head/sys/sparc64/sparc64/pmap.c
    ==============================================================================
    --- head/sys/sparc64/sparc64/pmap.c	Wed Feb 27 18:12:04 2013	(r247399)
    +++ head/sys/sparc64/sparc64/pmap.c	Wed Feb 27 18:12:13 2013	(r247400)
    @@ -1494,9 +1494,8 @@ pmap_enter_locked(pmap_t pm, vm_offset_t
     
     	rw_assert(&tte_list_global_lock, RA_WLOCKED);
     	PMAP_LOCK_ASSERT(pm, MA_OWNED);
    -	KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
    -	    VM_OBJECT_LOCKED(m->object),
    -	    ("pmap_enter_locked: page %p is not busy", m));
    +	if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0)
    +		VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
     	PMAP_STATS_INC(pmap_nenter);
     	pa = VM_PAGE_TO_PHYS(m);
     
    
    Modified: head/sys/vm/vm_object.h
    ==============================================================================
    --- head/sys/vm/vm_object.h	Wed Feb 27 18:12:04 2013	(r247399)
    +++ head/sys/vm/vm_object.h	Wed Feb 27 18:12:13 2013	(r247400)
    @@ -206,7 +206,6 @@ extern struct vm_object kmem_object_stor
     #define	VM_OBJECT_LOCK(object)		mtx_lock(&(object)->mtx)
     #define	VM_OBJECT_LOCK_ASSERT(object, type) \
     					mtx_assert(&(object)->mtx, (type))
    -#define	VM_OBJECT_LOCKED(object)	mtx_owned(&(object)->mtx)
     #define	VM_OBJECT_SLEEP(object, wchan, pri, wmesg, timo) \
     					msleep((wchan), &(object)->mtx, (pri), \
     					    (wmesg), (timo))
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 19:03:33 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 2A23F4C9;
     Wed, 27 Feb 2013 19:03:33 +0000 (UTC)
     (envelope-from alfred@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 0CF3B84B;
     Wed, 27 Feb 2013 19:03:33 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RJ3XxL066654;
     Wed, 27 Feb 2013 19:03:33 GMT (envelope-from alfred@svn.freebsd.org)
    Received: (from alfred@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RJ3WDR066647;
     Wed, 27 Feb 2013 19:03:32 GMT (envelope-from alfred@svn.freebsd.org)
    Message-Id: <201302271903.r1RJ3WDR066647@svn.freebsd.org>
    From: Alfred Perlstein 
    Date: Wed, 27 Feb 2013 19:03:32 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247405 - in head: sys/dev/watchdog sys/sys
     usr.sbin/watchdogd
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 19:03:33 -0000
    
    Author: alfred
    Date: Wed Feb 27 19:03:31 2013
    New Revision: 247405
    URL: http://svnweb.freebsd.org/changeset/base/247405
    
    Log:
      watchdogd(8) and watchdog(4) enhancements.
      
      The following support was added to watchdog(4):
      - Support to query the outstanding timeout.
      - Support to set a software pre-timeout function watchdog with an 'action'
      - Support to set a software only watchdog with a configurable 'action'
      
      'action' can be a mask specifying a single operation or a combination of:
       log(9), printf(9), panic(9) and/or kdb_enter(9).
      
      Support the following in watchdogged:
      - Support to utilize the new additions to watchdog(4).
      - Support to warn if a watchdog script runs for too long.
      - Support for "dry run" where we do not actually arm the watchdog,
        but only report on our timing.
      
      Sponsored by:   iXsystems, Inc.
      MFC after:      1 month
    
    Modified:
      head/sys/dev/watchdog/watchdog.c
      head/sys/sys/watchdog.h
      head/usr.sbin/watchdogd/watchdogd.8
      head/usr.sbin/watchdogd/watchdogd.c
    
    Modified: head/sys/dev/watchdog/watchdog.c
    ==============================================================================
    --- head/sys/dev/watchdog/watchdog.c	Wed Feb 27 18:47:01 2013	(r247404)
    +++ head/sys/dev/watchdog/watchdog.c	Wed Feb 27 19:03:31 2013	(r247405)
    @@ -1,5 +1,8 @@
     /*-
      * Copyright (c) 2004 Poul-Henning Kamp
    + * Copyright (c) 2013 iXsystems.com,
    + *               author: Alfred Perlstein 
    + *
      * All rights reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    @@ -29,21 +32,40 @@
     __FBSDID("$FreeBSD$");
     
     #include 
    +#include 
     #include 
     #include 
     #include 
     #include 
     #include 
     #include 
    +#include 
     #include 
     #include 
     #include 
     
    +#include  /* kern_clock_gettime() */
    +
    +static int wd_set_pretimeout(int newtimeout, int disableiftoolong);
    +static void wd_timeout_cb(void *arg);
    +
    +static struct callout wd_pretimeo_handle;
    +static int wd_pretimeout;
    +static int wd_pretimeout_act = WD_SOFT_LOG;
    +
    +static struct callout wd_softtimeo_handle;
    +static int wd_softtimer;	/* true = use softtimer instead of hardware
    +				   watchdog */
    +static int wd_softtimeout_act = WD_SOFT_LOG;	/* action for the software timeout */
    +
     static struct cdev *wd_dev;
    -static volatile u_int wd_last_u;
    +static volatile u_int wd_last_u;    /* last timeout value set by kern_do_pat */
     
    -static int
    -kern_do_pat(u_int utim)
    +static int wd_lastpat_valid = 0;
    +static time_t wd_lastpat = 0;	/* when the watchdog was last patted */
    +
    +int
    +wdog_kern_pat(u_int utim)
     {
     	int error;
     
    @@ -51,11 +73,20 @@ kern_do_pat(u_int utim)
     		return (EINVAL);
     
     	if ((utim & WD_LASTVAL) != 0) {
    +		/*
    +		 * if WD_LASTVAL is set, fill in the bits for timeout
    +		 * from the saved value in wd_last_u.
    +		 */
     		MPASS((wd_last_u & ~WD_INTERVAL) == 0);
     		utim &= ~WD_LASTVAL;
     		utim |= wd_last_u;
    -	} else
    +	} else {
    +		/*
    +		 * Otherwise save the new interval.
    +		 * This can be zero (to disable the watchdog)
    +		 */
     		wd_last_u = (utim & WD_INTERVAL);
    +	}
     	if ((utim & WD_INTERVAL) == WD_TO_NEVER) {
     		utim = 0;
     
    @@ -65,18 +96,49 @@ kern_do_pat(u_int utim)
     		/* Assume no watchdog available; watchdog flags success */
     		error = EOPNOTSUPP;
     	}
    -	EVENTHANDLER_INVOKE(watchdog_list, utim, &error);
    +	if (wd_softtimer) {
    +		if (utim == 0) {
    +			callout_stop(&wd_softtimeo_handle);
    +		} else {
    +			(void) callout_reset(&wd_softtimeo_handle,
    +			    hz*utim, wd_timeout_cb, "soft");
    +		}
    +		error = 0;
    +	} else {
    +		EVENTHANDLER_INVOKE(watchdog_list, utim, &error);
    +	}
    +	wd_set_pretimeout(wd_pretimeout, true);
    +	/*
    +	 * If we were able to arm/strobe the watchdog, then
    +	 * update the last time it was strobed for WDIOC_GETTIMELEFT
    +	 */
    +	if (!error) {
    +		struct timespec ts;
    +
    +		error = kern_clock_gettime(curthread /* XXX */,
    +		    CLOCK_MONOTONIC_FAST, &ts);
    +		if (!error) {
    +			wd_lastpat = ts.tv_sec;
    +			wd_lastpat_valid = 1;
    +		}
    +	}
     	return (error);
     }
     
     static int
    -wd_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data,
    -    int flags __unused, struct thread *td)
    +wd_valid_act(int act)
    +{
    +
    +	if ((act & ~(WD_SOFT_MASK)) != 0)
    +		return false;
    +	return true;
    +}
    +
    +static int
    +wd_ioctl_patpat(caddr_t data)
     {
     	u_int u;
     
    -	if (cmd != WDIOCPATPAT)
    -		return (ENOIOCTL);
     	u = *(u_int *)data;
     	if (u & ~(WD_ACTIVE | WD_PASSIVE | WD_LASTVAL | WD_INTERVAL))
     		return (EINVAL);
    @@ -89,24 +151,162 @@ wd_ioctl(struct cdev *dev __unused, u_lo
     		return (ENOSYS);	/* XXX Not implemented yet */
     	u &= ~(WD_ACTIVE | WD_PASSIVE);
     
    -	return (kern_do_pat(u));
    +	return (wdog_kern_pat(u));
     }
     
    -u_int
    -wdog_kern_last_timeout(void)
    +static int
    +wd_get_time_left(struct thread *td, time_t *remainp)
     {
    +	struct timespec ts;
    +	int error;
     
    -	return (wd_last_u);
    +	error = kern_clock_gettime(td, CLOCK_MONOTONIC_FAST, &ts);
    +	if (error)
    +		return (error);
    +	if (!wd_lastpat_valid)
    +		return (ENOENT);
    +	*remainp = ts.tv_sec - wd_lastpat;
    +	return (0);
     }
     
    -int
    -wdog_kern_pat(u_int utim)
    +static void
    +wd_timeout_cb(void *arg)
     {
    +	const char *type = arg;
     
    -	if (utim & ~(WD_LASTVAL | WD_INTERVAL))
    -		return (EINVAL);
    +#ifdef DDB
    +	if ((wd_pretimeout_act & WD_SOFT_DDB)) {
    +		char kdb_why[80];
    +		snprintf(kdb_why, sizeof(buf), "watchdog %s timeout", type);
    +		kdb_backtrace();
    +		kdb_enter(KDB_WHY_WATCHDOG, kdb_why);
    +	}
    +#endif
    +	if ((wd_pretimeout_act & WD_SOFT_LOG))
    +		log(LOG_EMERG, "watchdog %s-timeout, WD_SOFT_LOG", type);
    +	if ((wd_pretimeout_act & WD_SOFT_PRINTF))
    +		printf("watchdog %s-timeout, WD_SOFT_PRINTF\n", type);
    +	if ((wd_pretimeout_act & WD_SOFT_PANIC))
    +		panic("watchdog %s-timeout, WD_SOFT_PANIC set", type);
    +}
     
    -	return (kern_do_pat(utim));
    +/*
    + * Called to manage timeouts.
    + * newtimeout needs to be in the range of 0 to actual watchdog timeout.
    + * if 0, we disable the pre-timeout.
    + * otherwise we set the pre-timeout provided it's not greater than the
    + * current actual watchdog timeout.
    + */
    +static int
    +wd_set_pretimeout(int newtimeout, int disableiftoolong)
    +{
    +	u_int utime;
    +
    +	utime = wdog_kern_last_timeout();
    +	/* do not permit a pre-timeout >= than the timeout. */
    +	if (newtimeout >= utime) {
    +		/*
    +		 * If 'disableiftoolong' then just fall through
    +		 * so as to disable the pre-watchdog
    +		 */
    +		if (disableiftoolong)
    +			newtimeout = 0;
    +		else
    +			return EINVAL;
    +	}
    +
    +	/* disable the pre-timeout */
    +	if (newtimeout == 0) {
    +		wd_pretimeout = 0;
    +		callout_stop(&wd_pretimeo_handle);
    +		return 0;
    +	}
    +
    +	/* We determined the value is sane, so reset the callout */
    +	(void) callout_reset(&wd_pretimeo_handle, hz*(utime - newtimeout),
    +	    wd_timeout_cb, "pre-timeout");
    +	wd_pretimeout = newtimeout;
    +	return 0;
    +}
    +
    +static int
    +wd_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data,
    +    int flags __unused, struct thread *td)
    +{
    +	u_int u;
    +	time_t timeleft;
    +	int error;
    +
    +	error = 0;
    +
    +	switch (cmd) {
    +	case WDIOC_SETSOFT:
    +		u = *(int *)data;
    +		/* do nothing? */
    +		if (u == wd_softtimer)
    +			break;
    +		/* If there is a pending timeout disallow this ioctl */
    +		if (wd_last_u != 0) {
    +			error = EINVAL;
    +			break;
    +		}
    +		wd_softtimer = u;
    +		break;
    +	case WDIOC_SETSOFTTIMEOUTACT:
    +		u = *(int *)data;
    +		if (wd_valid_act(u)) {
    +			wd_softtimeout_act = u;
    +		} else {
    +			error = EINVAL;
    +		}
    +		break;
    +	case WDIOC_SETPRETIMEOUTACT:
    +		u = *(int *)data;
    +		if (wd_valid_act(u)) {
    +			wd_pretimeout_act = u;
    +		} else {
    +			error = EINVAL;
    +		}
    +		break;
    +	case WDIOC_GETPRETIMEOUT:
    +		*(int *)data = (int)wd_pretimeout;
    +		break;
    +	case WDIOC_SETPRETIMEOUT:
    +		error = wd_set_pretimeout(*(int *)data, false);
    +		break;
    +	case WDIOC_GETTIMELEFT:
    +		error = wd_get_time_left(td, &timeleft);
    +		if (error)
    +			break;
    +		*(int *)data = (int)timeleft;
    +		break;
    +	case WDIOC_SETTIMEOUT:
    +		u = *(u_int *)data;
    +		error = wdog_kern_pat(u);
    +		break;
    +	case WDIOC_GETTIMEOUT:
    +		u = wdog_kern_last_timeout();
    +		*(u_int *)data = u;
    +		break;
    +	case WDIOCPATPAT:
    +		error = wd_ioctl_patpat(data);
    +		break;
    +	default:
    +		error = ENOIOCTL;
    +		break;
    +	}
    +	return (error);
    +}
    +
    +/*
    + * Return the last timeout set, this is NOT the seconds from NOW until timeout,
    + * rather it is the amount of seconds passed to WDIOCPATPAT/WDIOC_SETTIMEOUT.
    + */
    +u_int
    +wdog_kern_last_timeout(void)
    +{
    +
    +	return (wd_last_u);
     }
     
     static struct cdevsw wd_cdevsw = {
    @@ -120,10 +320,16 @@ watchdog_modevent(module_t mod __unused,
     {
     	switch(type) {
     	case MOD_LOAD:
    +		callout_init(&wd_pretimeo_handle, true);
    +		callout_init(&wd_softtimeo_handle, true);
     		wd_dev = make_dev(&wd_cdevsw, 0,
     		    UID_ROOT, GID_WHEEL, 0600, _PATH_WATCHDOG);
     		return 0;
     	case MOD_UNLOAD:
    +		callout_stop(&wd_pretimeo_handle);
    +		callout_stop(&wd_softtimeo_handle);
    +		callout_drain(&wd_pretimeo_handle);
    +		callout_drain(&wd_softtimeo_handle);
     		destroy_dev(wd_dev);
     		return 0;
     	case MOD_SHUTDOWN:
    
    Modified: head/sys/sys/watchdog.h
    ==============================================================================
    --- head/sys/sys/watchdog.h	Wed Feb 27 18:47:01 2013	(r247404)
    +++ head/sys/sys/watchdog.h	Wed Feb 27 19:03:31 2013	(r247405)
    @@ -1,5 +1,8 @@
     /*-
      * Copyright (c) 2003 Poul-Henning Kamp
    + * Copyright (c) 2013 iXsystems.com,
    + *                    author: Alfred Perlstein 
    + *
      * All rights reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    @@ -32,7 +35,18 @@
     
     #define	_PATH_WATCHDOG	"fido"
     
    -#define WDIOCPATPAT	_IOW('W', 42, u_int)
    +#define WDIOCPATPAT	_IOW('W', 42, u_int)	/* pat the watchdog */
    +#define WDIOC_SETTIMEOUT    _IOW('W', 43, int)	/* set/reset the timer */
    +#define WDIOC_GETTIMEOUT    _IOR('W', 44, int)	/* get total timeout */
    +#define WDIOC_GETTIMELEFT   _IOR('W', 45, int)	/* get time left */
    +#define WDIOC_GETPRETIMEOUT _IOR('W', 46, int)	/* get the pre-timeout */
    +#define WDIOC_SETPRETIMEOUT _IOW('W', 47, int)	/* set the pre-timeout */
    +/* set the action when a pre-timeout occurs see: WD_SOFT_* */
    +#define WDIOC_SETPRETIMEOUTACT _IOW('W', 48, int)
    +
    +/* use software watchdog instead of hardware */
    +#define WDIOC_SETSOFT	_IOW('W', 49, int)
    +#define WDIOC_SETSOFTTIMEOUTACT	_IOW('W', 50, int)
     
     #define WD_ACTIVE	0x8000000
     	/* 
    @@ -76,6 +90,15 @@
     #define WD_TO_8SEC	33
     #define WD_TO_16SEC	34
     #define WD_TO_32SEC	35
    +#define WD_TO_64SEC	36
    +#define WD_TO_128SEC	37
    +
    +/* action on pre-timeout trigger */
    +#define	WD_SOFT_PANIC	0x01	/* panic */
    +#define	WD_SOFT_DDB	0x02	/* enter debugger */
    +#define	WD_SOFT_LOG	0x04	/* log(9) */
    +#define	WD_SOFT_PRINTF	0x08	/* printf(9) */
    +#define WD_SOFT_MASK	0x0f	/* all of the above */
     
     #ifdef _KERNEL
     
    
    Modified: head/usr.sbin/watchdogd/watchdogd.8
    ==============================================================================
    --- head/usr.sbin/watchdogd/watchdogd.8	Wed Feb 27 18:47:01 2013	(r247404)
    +++ head/usr.sbin/watchdogd/watchdogd.8	Wed Feb 27 19:03:31 2013	(r247405)
    @@ -1,3 +1,5 @@
    +.\" Copyright (c) 2013  iXsystems.com,
    +.\"                     author: Alfred Perlstein 
     .\" Copyright (c) 2004  Poul-Henning Kamp 
     .\" Copyright (c) 2003  Sean M. Kelly 
     .\" All rights reserved.
    @@ -25,7 +27,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd September 2, 2006
    +.Dd September 2, 2013
     .Dt WATCHDOGD 8
     .Os
     .Sh NAME
    @@ -33,11 +35,17 @@
     .Nd watchdog daemon
     .Sh SYNOPSIS
     .Nm
    -.Op Fl d
    +.Op Fl dnw
    +.Op Fl -debug
    +.Op Fl -softtimeout
    +.Op Fl -softtimeout-action Ar action
    +.Op Fl -pretimeout Ar timeout
    +.Op Fl -pretimeout-action Ar action
     .Op Fl e Ar cmd
     .Op Fl I Ar file
     .Op Fl s Ar sleep
     .Op Fl t Ar timeout
    +.Op Fl T Ar script_timeout
     .Sh DESCRIPTION
     The
     .Nm
    @@ -62,6 +70,13 @@ is not specified, the daemon will perfor
     check instead.
     .Pp
     The
    +.Fl n
    +argument 'dry-run' will cause watchdog not to arm the system watchdog and
    +instead only run the watchdog function and report on failures.
    +This is useful for developing new watchdogd scripts as the system will not
    +reboot if there are problems with the script.
    +.Pp
    +The
     .Fl s Ar sleep
     argument can be used to control the sleep period between each execution
     of the check and defaults to one second.
    @@ -78,6 +93,16 @@ If this occurs,
     will no longer execute and thus the kernel's watchdog routines will take
     action after a configurable timeout.
     .Pp
    +The
    +.Fl T Ar script_timeout
    +specifies the threshold (in seconds) at which the watchdogd will complain
    +that its script has run for too long.
    +If unset
    +.Ar script_timeout
    +defaults to the value specified by the
    +.Fl s Ar sleep 
    +option.
    +.Pp
     Upon receiving the
     .Dv SIGTERM
     or
    @@ -90,17 +115,85 @@ will terminate.
     The
     .Nm
     utility recognizes the following runtime options:
    -.Bl -tag -width ".Fl I Ar file"
    +.Bl -tag -width ".Fl -softtimeout-action Ar action  "
     .It Fl I Ar file
     Write the process ID of the
     .Nm
     utility in the specified file.
    -.It Fl d
    +.It Fl d Fl -debug
     Do not fork.
     When this option is specified,
     .Nm
     will not fork into the background at startup.
    +.Pp
    +.It Fl w
    +Complain when the watchdog script takes too long.
    +This flag will cause watchdogd to complain when the amount of time to
    +execute the watchdog script exceeds the threshold of 'sleep' option.
    +.Pp
    +.It Fl -pretimeout Ar timeout
    +Set a "pretimeout" watchdog.  At "timeout" seconds before the watchdog
    +will fire attempt an action.  The action is set by the --pretimeout-action
    +flag.  The default is just to log a message (WD_SOFT_LOG) via
    +.Xr log 9 .
    +.Pp
    +.It Fl -pretimeout-action Ar action
    +Set the timeout action for the pretimeout.  See the section 
    +.Sx Timeout Actions .
    +.Pp
    +.It Fl -softtimeout
    +Instead of arming the various hardware watchdogs, only use a basic software
    +watchdog.  The default action is just to
    +.Xr log 9
    +a message (WD_SOFT_LOG).
    +.Pp
    +.It Fl -softtimeout-action Ar action
    +Set the timeout action for the softtimeout.  See the section 
    +.Sx Timeout Actions .
    +.Pp
     .El
    +.Sh Timeout Actions
    +The following timeout actions are available via the
    +.Fl -pretimeout-action
    +and
    +.Fl -softtimeout-action
    +flags:
    +.Bl -tag -width ".Ar printf  "
    +.It Ar panic
    +Call
    +.Xr panic 9
    +when the timeout is reached.
    +.Pp
    +.It Ar ddb
    +Enter the kernel debugger via
    +.Xr kdb_enter 9
    +when the timeout is reached.
    +.Pp
    +.It Ar log
    +Log a message using
    +.Xr log 9
    +when the timeout is reached.
    +.Pp
    +.It Ar printf
    +call the kernel 
    +.Xr printf 9
    +to display a message to the console and
    +.Xr dmesg 8
    +buffer.
    +.Pp
    +.El
    +Actions can be combined in a comma separated list as so:
    +.Ar log,printf
    +which would both
    +.Xr printf 9
    +and
    +.Xr log 9
    +which will send messages both to
    +.Xr dmesg 8
    +and the kernel
    +.Xr log 4
    +device for
    +.Xr syslog 8 .
     .Sh FILES
     .Bl -tag -width ".Pa /var/run/watchdogd.pid" -compact
     .It Pa /var/run/watchdogd.pid
    @@ -125,3 +218,6 @@ and
     .Pp
     Some contributions made by
     .An Jeff Roberson Aq jeff@FreeBSD.org .
    +.Pp
    +The pretimeout and softtimeout action system was added by
    +.An Alfred Perlstein Aq alfred@freebsd.org .
    
    Modified: head/usr.sbin/watchdogd/watchdogd.c
    ==============================================================================
    --- head/usr.sbin/watchdogd/watchdogd.c	Wed Feb 27 18:47:01 2013	(r247404)
    +++ head/usr.sbin/watchdogd/watchdogd.c	Wed Feb 27 19:03:31 2013	(r247405)
    @@ -1,5 +1,8 @@
     /*-
      * Copyright (c) 2003-2004  Sean M. Kelly 
    + * Copyright (c) 2013 iXsystems.com,
    + *                    author: Alfred Perlstein 
    + *
      * All rights reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    @@ -50,8 +53,11 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    +#include 
     #include 
     
    +#include 
    +
     static void	parseargs(int, char *[]);
     static void	sighandler(int);
     static void	watchdog_loop(void);
    @@ -63,13 +69,39 @@ static void	usage(void);
     static int debugging = 0;
     static int end_program = 0;
     static const char *pidfile = _PATH_VARRUN "watchdogd.pid";
    -static u_int timeout = WD_TO_16SEC;
    +static u_int timeout = WD_TO_128SEC;
    +static u_int pretimeout = 0;
     static u_int passive = 0;
     static int is_daemon = 0;
    +static int is_dry_run = 0;  /* do not arm the watchdog, only
    +			       report on timing of the watch
    +			       program */
    +static int do_timedog = 0;
    +static int do_syslog = 0;
     static int fd = -1;
     static int nap = 1;
    +static int carp_thresh_seconds = -1;
     static char *test_cmd = NULL;
     
    +static const char *getopt_shortopts;
    +
    +static int pretimeout_set;
    +static int pretimeout_act;
    +static int pretimeout_act_set;
    +
    +static int softtimeout_set;
    +static int softtimeout_act;
    +static int softtimeout_act_set;
    +
    +static struct option longopts[] = {
    +	{ "debug", no_argument, &debugging, 1 },
    +	{ "pretimeout", required_argument, &pretimeout_set, 1 },
    +	{ "pretimeout-action", required_argument, &pretimeout_act_set, 1 },
    +	{ "softtimeout", no_argument, &softtimeout_set, 1 },
    +	{ "softtimeout-action", required_argument, &softtimeout_act_set, 1 },
    +	{ NULL, 0, NULL, 0}
    +};
    +
     /*
      * Ask malloc() to map minimum-sized chunks of virtual address space at a time,
      * so that mlockall() won't needlessly wire megabytes of unused memory into the
    @@ -93,12 +125,18 @@ main(int argc, char *argv[])
     		
     	parseargs(argc, argv);
     
    +	if (do_syslog) {
    +		openlog("watchdogd", LOG_CONS|LOG_NDELAY|LOG_PERROR,
    +		    LOG_DAEMON);
    +
    +	}
    +
     	rtp.type = RTP_PRIO_REALTIME;
     	rtp.prio = 0;
     	if (rtprio(RTP_SET, 0, &rtp) == -1)
     		err(EX_OSERR, "rtprio");
     
    -	if (watchdog_init() == -1)
    +	if (!is_dry_run && watchdog_init() == -1)
     		errx(EX_SOFTWARE, "unable to initialize watchdog");
     
     	if (is_daemon) {
    @@ -108,6 +146,7 @@ main(int argc, char *argv[])
     		pfh = pidfile_open(pidfile, 0600, &otherpid);
     		if (pfh == NULL) {
     			if (errno == EEXIST) {
    +				watchdog_onoff(0);
     				errx(EX_SOFTWARE, "%s already running, pid: %d",
     				    getprogname(), otherpid);
     			}
    @@ -164,6 +203,9 @@ static int
     watchdog_init(void)
     {
     
    +	if (is_dry_run)
    +		return 0;
    +
     	fd = open("/dev/" _PATH_WATCHDOG, O_RDWR);
     	if (fd >= 0)
     		return (0);
    @@ -172,26 +214,98 @@ watchdog_init(void)
     }
     
     /*
    + * If we are doing timing, then get the time.
    + */
    +static int
    +watchdog_getuptime(struct timespec *tp)
    +{
    +	int error;
    +
    +	if (!do_timedog)
    +		return 0;
    +
    +	error = clock_gettime(CLOCK_UPTIME_FAST, tp);
    +	if (error)
    +		warn("clock_gettime");
    +	return (error);
    +}
    +
    +static long
    +watchdog_check_dogfunction_time(struct timespec *tp_start,
    +    struct timespec *tp_end)
    +{
    +	struct timeval tv_start, tv_end, tv;
    +	const char *cmd_prefix, *cmd;
    +	int sec;
    +
    +	if (!do_timedog)
    +		return (0);
    +
    +	TIMESPEC_TO_TIMEVAL(&tv_start, tp_start);
    +	TIMESPEC_TO_TIMEVAL(&tv_end, tp_end);
    +	timersub(&tv_end, &tv_start, &tv);
    +	sec = tv.tv_sec;
    +	if (sec < carp_thresh_seconds)
    +		return (sec);
    +
    +	if (test_cmd) {
    +		cmd_prefix = "Watchdog program";
    +		cmd = test_cmd;
    +	} else {
    +		cmd_prefix = "Watchdog operation";
    +		cmd = "stat(\"/etc\", &sb)";
    +	}
    +	if (do_syslog)
    +		syslog(LOG_CRIT, "%s: '%s' took too long: "
    +		    "%d.%06ld seconds >= %d seconds threshhold",
    +		    cmd_prefix, cmd, sec, (long)tv.tv_usec,
    +		    carp_thresh_seconds);
    +	warnx("%s: '%s' took too long: "
    +	    "%d.%06ld seconds >= %d seconds threshhold",
    +	    cmd_prefix, cmd, sec, (long)tv.tv_usec, carp_thresh_seconds);
    +	return (sec);
    +}
    +
    +
    +/*
      * Main program loop which is iterated every second.
      */
     static void
     watchdog_loop(void)
     {
    +	struct timespec ts_start, ts_end;
     	struct stat sb;
    -	int failed;
    +	long waited;
    +	int error, failed;
     
     	while (end_program != 2) {
     		failed = 0;
     
    +		error = watchdog_getuptime(&ts_start);
    +		if (error) {
    +			end_program = 1;
    +			goto try_end;
    +		}
    +
     		if (test_cmd != NULL)
     			failed = system(test_cmd);
     		else
     			failed = stat("/etc", &sb);
     
    +		error = watchdog_getuptime(&ts_end);
    +		if (error) {
    +			end_program = 1;
    +			goto try_end;
    +		}
    +
    +		waited = watchdog_check_dogfunction_time(&ts_start, &ts_end);
    +
     		if (failed == 0)
     			watchdog_patpat(timeout|WD_ACTIVE);
    -		sleep(nap);
    +		if (nap - waited > 0)
    +			sleep(nap - waited);
     
    +try_end:
     		if (end_program != 0) {
     			if (watchdog_onoff(0) == 0) {
     				end_program = 2;
    @@ -211,6 +325,9 @@ static int
     watchdog_patpat(u_int t)
     {
     
    +	if (is_dry_run)
    +		return 0;
    +
     	return ioctl(fd, WDIOCPATPAT, &t);
     }
     
    @@ -221,11 +338,62 @@ watchdog_patpat(u_int t)
     static int
     watchdog_onoff(int onoff)
     {
    +	int error;
     
    -	if (onoff)
    +	/* fake successful watchdog op if a dry run */
    +	if (is_dry_run)
    +		return 0;
    +
    +	if (onoff) {
    +		/*
    +		 * Call the WDIOC_SETSOFT regardless of softtimeout_set
    +		 * because we'll need to turn it off if someone had turned
    +		 * it on.
    +		 */
    +		error = ioctl(fd, WDIOC_SETSOFT, &softtimeout_set);
    +		if (error) {
    +			warn("setting WDIOC_SETSOFT %d", softtimeout_set);
    +			return (error);
    +		}
    +		error = watchdog_patpat((timeout|WD_ACTIVE));
    +		if (error) {
    +			warn("watchdog_patpat failed");
    +			goto failsafe;
    +		}
    +		if (softtimeout_act_set) {
    +			error = ioctl(fd, WDIOC_SETSOFTTIMEOUTACT,
    +			    &softtimeout_act);
    +			if (error) {
    +				warn("setting WDIOC_SETSOFTTIMEOUTACT %d",
    +				    softtimeout_act);
    +				goto failsafe;
    +			}
    +		}
    +		if (pretimeout_set) {
    +			error = ioctl(fd, WDIOC_SETPRETIMEOUT, &pretimeout);
    +			if (error) {
    +				warn("setting WDIOC_SETPRETIMEOUT %d",
    +				    pretimeout);
    +				goto failsafe;
    +			}
    +		}
    +		if (pretimeout_act_set) {
    +			error = ioctl(fd, WDIOC_SETPRETIMEOUTACT,
    +			    &pretimeout_act);
    +			if (error) {
    +				warn("setting WDIOC_SETPRETIMEOUTACT %d",
    +				    pretimeout_act);
    +				goto failsafe;
    +			}
    +		}
    +		/* pat one more time for good measure */
     		return watchdog_patpat((timeout|WD_ACTIVE));
    -	else
    +	 } else {
     		return watchdog_patpat(0);
    +	 }
    +failsafe:
    +	watchdog_patpat(0);
    +	return (error);
     }
     
     /*
    @@ -235,27 +403,132 @@ static void
     usage(void)
     {
     	if (is_daemon)
    -		fprintf(stderr, "usage: watchdogd [-d] [-e cmd] [-I file] [-s sleep] [-t timeout]\n");
    +		fprintf(stderr, "usage:\n"
    +"  watchdogd [-dnw] [-e cmd] [-I file] [-s sleep] [-t timeout]\n"
    +"            [-T script_timeout]\n"
    +"            [--debug]\n"
    +"            [--pretimeout seconds] [-pretimeout-action action]\n"
    +"            [--softtimeout] [-softtimeout-action action]\n"
    +);
     	else
     		fprintf(stderr, "usage: watchdog [-d] [-t timeout]\n");
     	exit(EX_USAGE);
     }
     
    +static long
    +fetchtimeout(int opt, const char *longopt, const char *myoptarg)
    +{
    +	const char *errstr;
    +	char *p;
    +	long rv;
    +
    +	errstr = NULL;
    +	p = NULL;
    +	errno = 0;
    +	rv = strtol(myoptarg, &p, 0);
    +	if ((p != NULL && *p != '\0') || errno != 0)
    +		errstr = "is not a number";
    +	if (rv <= 0)
    +		errstr = "must be greater than zero";
    +	if (errstr) {
    +		if (longopt) 
    +			errx(EX_USAGE, "--%s argument %s", longopt, errstr);
    +		else 
    +			errx(EX_USAGE, "-%c argument %s", opt, errstr);
    +	}
    +	return (rv);
    +}
    +
    +struct act_tbl {
    +	const char *at_act;
    +	int at_value;
    +};
    +
    +struct act_tbl act_tbl[] = {
    +	{ "panic", WD_SOFT_PANIC },
    +	{ "ddb", WD_SOFT_DDB },
    +	{ "log", WD_SOFT_LOG },
    +	{ "printf", WD_SOFT_PRINTF },
    +	{ NULL, 0 }
    +};
    +
    +static void
    +timeout_act_error(const char *lopt, const char *badact)
    +{
    +	char *opts, *oldopts;
    +	int i;
    +
    +	opts = NULL;
    +	for (i = 0; act_tbl[i].at_act != NULL; i++) {
    +		oldopts = opts;
    +		if (asprintf(&opts, "%s%s%s",
    +		    oldopts == NULL ? "" : oldopts,
    +		    oldopts == NULL ? "" : ", ",
    +		    act_tbl[i].at_act) == -1)
    +			err(EX_OSERR, "malloc");
    +		free(oldopts);
    +	}
    +	warnx("bad --%s argument '%s' must be one of (%s).",
    +	    lopt, badact, opts);
    +	usage();
    +}
    +
    +/*
    + * Take a comma separated list of actions and or the flags
    + * together for the ioctl.
    + */
    +static int
    +timeout_act_str2int(const char *lopt, const char *acts)
    +{
    +	int i;
    +	char *dupacts, *tofree;
    +	char *o;
    +	int rv = 0;
    +
    +	tofree = dupacts = strdup(acts);
    +	if (!tofree)
    +		err(EX_OSERR, "malloc");
    +	while ((o = strsep(&dupacts, ",")) != NULL) {
    +		for (i = 0; act_tbl[i].at_act != NULL; i++) {
    +			if (!strcmp(o, act_tbl[i].at_act)) {
    +				rv |= act_tbl[i].at_value;
    +				break;
    +			}
    +		}
    +		if (act_tbl[i].at_act == NULL)
    +			timeout_act_error(lopt, o);
    +	}
    +	free(tofree);
    +	return rv;
    +}
    +
     /*
      * Handle the few command line arguments supported.
      */
     static void
     parseargs(int argc, char *argv[])
     {
    +	int longindex;
     	int c;
     	char *p;
    +	const char *lopt;
     	double a;
     
    +	/*
    +	 * if we end with a 'd' aka 'watchdogd' then we are the daemon program,
    +	 * otherwise run as a command line utility.
    +	 */
     	c = strlen(argv[0]);
     	if (argv[0][c - 1] == 'd')
     		is_daemon = 1;
    -	while ((c = getopt(argc, argv,
    -	    is_daemon ? "I:de:s:t:?" : "dt:?")) != -1) {
    +
    +	if (is_daemon)
    +		getopt_shortopts = "I:de:ns:t:ST:w?";
    +	else
    +		getopt_shortopts = "dt:?";
    +
    +	while ((c = getopt_long(argc, argv, getopt_shortopts, longopts,
    +		    &longindex)) != -1) {
     		switch (c) {
     		case 'I':
     			pidfile = optarg;
    @@ -266,17 +539,19 @@ parseargs(int argc, char *argv[])
     		case 'e':
     			test_cmd = strdup(optarg);
     			break;
    +		case 'n':
    +			is_dry_run = 1;
    +			break;
     #ifdef notyet
     		case 'p':
     			passive = 1;
     			break;
     #endif
     		case 's':
    -			p = NULL;
    -			errno = 0;
    -			nap = strtol(optarg, &p, 0);
    -			if ((p != NULL && *p != '\0') || errno != 0)
    -				errx(EX_USAGE, "-s argument is not a number");
    +			nap = fetchtimeout(c, NULL, optarg);
    +			break;
    +		case 'S':
    +			do_syslog = 1;
     			break;
     		case 't':
     			p = NULL;
    @@ -286,6 +561,7 @@ parseargs(int argc, char *argv[])
     				errx(EX_USAGE, "-t argument is not a number");
     			if (a < 0)
     				errx(EX_USAGE, "-t argument must be positive");
    +
     			if (a == 0)
     				timeout = WD_TO_NEVER;
     			else
    @@ -294,12 +570,39 @@ parseargs(int argc, char *argv[])
     				printf("Timeout is 2^%d nanoseconds\n",
     				    timeout);
     			break;
    +		case 'T':
    +			carp_thresh_seconds = fetchtimeout(c, "NULL", optarg);
    +			break;
    +		case 'w':
    +			do_timedog = 1;
    +			break;
    +		case 0:
    +			lopt = longopts[longindex].name;
    +			if (!strcmp(lopt, "pretimeout")) {
    +				pretimeout = fetchtimeout(0, lopt, optarg);
    +			} else if (!strcmp(lopt, "pretimeout-action")) {
    +				pretimeout_act = timeout_act_str2int(lopt,
    +				    optarg);
    +			} else if (!strcmp(lopt, "softtimeout-action")) {
    +				softtimeout_act = timeout_act_str2int(lopt,
    +				    optarg);
    +			} else {
    +		/*		warnx("bad option at index %d: %s", optind,
    +				    argv[optind]);
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 19:20:56 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id F233D9D4;
     Wed, 27 Feb 2013 19:20:55 +0000 (UTC) (envelope-from mm@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 E0FD092D;
     Wed, 27 Feb 2013 19:20:55 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RJKtfm071324;
     Wed, 27 Feb 2013 19:20:55 GMT (envelope-from mm@svn.freebsd.org)
    Received: (from mm@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RJKpuD071292;
     Wed, 27 Feb 2013 19:20:51 GMT (envelope-from mm@svn.freebsd.org)
    Message-Id: <201302271920.r1RJKpuD071292@svn.freebsd.org>
    From: Martin Matuska 
    Date: Wed, 27 Feb 2013 19:20:51 +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: r247406 - in stable/9: cddl/contrib/opensolaris/cmd/zdb
     cddl/contrib/opensolaris/lib/libzfs/common
     sys/cddl/contrib/opensolaris/uts/common/fs/zfs
     sys/cddl/contrib/opensolaris/uts/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-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 19:20:56 -0000
    
    Author: mm
    Date: Wed Feb 27 19:20:50 2013
    New Revision: 247406
    URL: http://svnweb.freebsd.org/changeset/base/247406
    
    Log:
      MFC r246631,246651,246666,246675,246678,246688:
      Merge various ZFS bugfixes
      
      MFC r246631:
      Import vendor bugfixes
      
      Illumos ZFS issues:
        3422 zpool create/syseventd race yield non-importable pool
        3425 first write to a new zvol can fail with EFBIG
      
      MFC r246651:
      Import minor type change in refcount.h header from vendor (illumos).
      
      MFC r246666:
      Import vendor ZFS bugfix fixing a problem in arc_read().
      
      Illumos ZFS issues:
        3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
      
      MFC r246675:
      Add tunable to allow block allocation on degraded vdevs.
      
      Illumos ZFS issues:
        3507 Tunable to allow block allocation even on degraded vdevs
      
      MFC r246678:
      Import vendor bugfixes regarding SA rounding, header size and layout.
      This was already partially fixed by avg.
      
      Illumos ZFS issues:
        3512 rounding discrepancy in sa_find_sizes()
        3513 mismatch between SA header size and layout
      
      MFC r246688 [1]:
      Merge zfs_ioctl.c code that should have been merged together with ZFS v28.
      Fixes several problems if working with read-only pools.
      
      Changed code originaly introduced in onnv-gate 13061:bda0decf867b
      Contains changes up to illumos-gate 13700:4bc0783f6064
      
      PR:		kern/175897 [1]
      Suggested by:	avg [1]
    
    Modified:
      stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c
      stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
      stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
    Directory Properties:
      stable/9/cddl/contrib/opensolaris/   (props changed)
      stable/9/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
      stable/9/sys/   (props changed)
      stable/9/sys/cddl/contrib/opensolaris/   (props changed)
    
    Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c
    ==============================================================================
    --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -983,7 +983,7 @@ visit_indirect(spa_t *spa, const dnode_p
     		arc_buf_t *buf;
     		uint64_t fill = 0;
     
    -		err = arc_read_nolock(NULL, spa, bp, arc_getbuf_func, &buf,
    +		err = arc_read(NULL, spa, bp, arc_getbuf_func, &buf,
     		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
     		if (err)
     			return (err);
    @@ -2001,9 +2001,8 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *
     	    bp, NULL, NULL, ZIO_FLAG_CANFAIL)), ==, 0);
     }
     
    -/* ARGSUSED */
     static int
    -zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
    +zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
         const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	zdb_cb_t *zcb = arg;
    @@ -2410,7 +2409,7 @@ typedef struct zdb_ddt_entry {
     /* ARGSUSED */
     static int
     zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
    -    arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
    +    const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	avl_tree_t *t = arg;
     	avl_index_t where;
    
    Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
    ==============================================================================
    --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -526,13 +526,12 @@ get_configs(libzfs_handle_t *hdl, pool_l
     				 *	version
     				 *	pool guid
     				 *	name
    -				 *	pool txg (if available)
     				 *	comment (if available)
     				 *	pool state
     				 *	hostid (if available)
     				 *	hostname (if available)
     				 */
    -				uint64_t state, version, pool_txg;
    +				uint64_t state, version;
     				char *comment = NULL;
     
     				version = fnvlist_lookup_uint64(tmp,
    @@ -548,11 +547,6 @@ get_configs(libzfs_handle_t *hdl, pool_l
     				fnvlist_add_string(config,
     				    ZPOOL_CONFIG_POOL_NAME, name);
     
    -				if (nvlist_lookup_uint64(tmp,
    -				    ZPOOL_CONFIG_POOL_TXG, &pool_txg) == 0)
    -					fnvlist_add_uint64(config,
    -					    ZPOOL_CONFIG_POOL_TXG, pool_txg);
    -
     				if (nvlist_lookup_string(tmp,
     				    ZPOOL_CONFIG_COMMENT, &comment) == 0)
     					fnvlist_add_string(config,
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -940,7 +940,6 @@ buf_cons(void *vbuf, void *unused, int k
     
     	bzero(buf, sizeof (arc_buf_t));
     	mutex_init(&buf->b_evict_lock, NULL, MUTEX_DEFAULT, NULL);
    -	rw_init(&buf->b_data_lock, NULL, RW_DEFAULT, NULL);
     	arc_space_consume(sizeof (arc_buf_t), ARC_SPACE_HDRS);
     
     	return (0);
    @@ -970,7 +969,6 @@ buf_dest(void *vbuf, void *unused)
     	arc_buf_t *buf = vbuf;
     
     	mutex_destroy(&buf->b_evict_lock);
    -	rw_destroy(&buf->b_data_lock);
     	arc_space_return(sizeof (arc_buf_t), ARC_SPACE_HDRS);
     }
     
    @@ -2968,42 +2966,11 @@ arc_read_done(zio_t *zio)
      *
      * arc_read_done() will invoke all the requested "done" functions
      * for readers of this block.
    - *
    - * Normal callers should use arc_read and pass the arc buffer and offset
    - * for the bp.  But if you know you don't need locking, you can use
    - * arc_read_nolock.
      */
     int
    -arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_buf_t *pbuf,
    -    arc_done_func_t *done, void *private, int priority, int zio_flags,
    -    uint32_t *arc_flags, const zbookmark_t *zb)
    -{
    -	int err;
    -
    -	if (pbuf == NULL) {
    -		/*
    -		 * XXX This happens from traverse callback funcs, for
    -		 * the objset_phys_t block.
    -		 */
    -		return (arc_read_nolock(pio, spa, bp, done, private, priority,
    -		    zio_flags, arc_flags, zb));
    -	}
    -
    -	ASSERT(!refcount_is_zero(&pbuf->b_hdr->b_refcnt));
    -	ASSERT3U((char *)bp - (char *)pbuf->b_data, <, pbuf->b_hdr->b_size);
    -	rw_enter(&pbuf->b_data_lock, RW_READER);
    -
    -	err = arc_read_nolock(pio, spa, bp, done, private, priority,
    -	    zio_flags, arc_flags, zb);
    -	rw_exit(&pbuf->b_data_lock);
    -
    -	return (err);
    -}
    -
    -int
    -arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp,
    -    arc_done_func_t *done, void *private, int priority, int zio_flags,
    -    uint32_t *arc_flags, const zbookmark_t *zb)
    +arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done,
    +    void *private, int priority, int zio_flags, uint32_t *arc_flags,
    +    const zbookmark_t *zb)
     {
     	arc_buf_hdr_t *hdr;
     	arc_buf_t *buf;
    @@ -3482,19 +3449,6 @@ arc_release(arc_buf_t *buf, void *tag)
     	}
     }
     
    -/*
    - * Release this buffer.  If it does not match the provided BP, fill it
    - * with that block's contents.
    - */
    -/* ARGSUSED */
    -int
    -arc_release_bp(arc_buf_t *buf, void *tag, blkptr_t *bp, spa_t *spa,
    -    zbookmark_t *zb)
    -{
    -	arc_release(buf, tag);
    -	return (0);
    -}
    -
     int
     arc_released(arc_buf_t *buf)
     {
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -135,7 +135,7 @@ bptree_add(objset_t *os, uint64_t obj, b
     
     /* ARGSUSED */
     static int
    -bptree_visit_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
    +bptree_visit_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
         const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	int err;
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -513,7 +513,6 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t
     	spa_t *spa;
     	zbookmark_t zb;
     	uint32_t aflags = ARC_NOWAIT;
    -	arc_buf_t *pbuf;
     
     	DB_DNODE_ENTER(db);
     	dn = DB_DNODE(db);
    @@ -575,14 +574,8 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t
     	    db->db.db_object, db->db_level, db->db_blkid);
     
     	dbuf_add_ref(db, NULL);
    -	/* ZIO_FLAG_CANFAIL callers have to check the parent zio's error */
     
    -	if (db->db_parent)
    -		pbuf = db->db_parent->db_buf;
    -	else
    -		pbuf = db->db_objset->os_phys_buf;
    -
    -	(void) dsl_read(zio, spa, db->db_blkptr, pbuf,
    +	(void) arc_read(zio, spa, db->db_blkptr,
     	    dbuf_read_done, db, ZIO_PRIORITY_SYNC_READ,
     	    (*flags & DB_RF_CANFAIL) ? ZIO_FLAG_CANFAIL : ZIO_FLAG_MUSTSUCCEED,
     	    &aflags, &zb);
    @@ -982,7 +975,6 @@ void
     dbuf_release_bp(dmu_buf_impl_t *db)
     {
     	objset_t *os;
    -	zbookmark_t zb;
     
     	DB_GET_OBJSET(&os, db);
     	ASSERT(dsl_pool_sync_context(dmu_objset_pool(os)));
    @@ -990,13 +982,7 @@ dbuf_release_bp(dmu_buf_impl_t *db)
     	    list_link_active(&os->os_dsl_dataset->ds_synced_link));
     	ASSERT(db->db_parent == NULL || arc_released(db->db_parent->db_buf));
     
    -	zb.zb_objset = os->os_dsl_dataset ?
    -	    os->os_dsl_dataset->ds_object : 0;
    -	zb.zb_object = db->db.db_object;
    -	zb.zb_level = db->db_level;
    -	zb.zb_blkid = db->db_blkid;
    -	(void) arc_release_bp(db->db_buf, db,
    -	    db->db_blkptr, os->os_spa, &zb);
    +	(void) arc_release(db->db_buf, db);
     }
     
     dbuf_dirty_record_t *
    @@ -1831,7 +1817,6 @@ dbuf_prefetch(dnode_t *dn, uint64_t blki
     		if (bp && !BP_IS_HOLE(bp)) {
     			int priority = dn->dn_type == DMU_OT_DDT_ZAP ?
     			    ZIO_PRIORITY_DDT_PREFETCH : ZIO_PRIORITY_ASYNC_READ;
    -			arc_buf_t *pbuf;
     			dsl_dataset_t *ds = dn->dn_objset->os_dsl_dataset;
     			uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH;
     			zbookmark_t zb;
    @@ -1839,13 +1824,8 @@ dbuf_prefetch(dnode_t *dn, uint64_t blki
     			SET_BOOKMARK(&zb, ds ? ds->ds_object : DMU_META_OBJSET,
     			    dn->dn_object, 0, blkid);
     
    -			if (db)
    -				pbuf = db->db_buf;
    -			else
    -				pbuf = dn->dn_objset->os_phys_buf;
    -
    -			(void) dsl_read(NULL, dn->dn_objset->os_spa,
    -			    bp, pbuf, NULL, NULL, priority,
    +			(void) arc_read(NULL, dn->dn_objset->os_spa,
    +			    bp, NULL, NULL, priority,
     			    ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE,
     			    &aflags, &zb);
     		}
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -128,7 +128,7 @@ report_dnode(struct diffarg *da, uint64_
     
     /* ARGSUSED */
     static int
    -diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
    +diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
         const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	struct diffarg *da = arg;
    @@ -155,9 +155,9 @@ diff_cb(spa_t *spa, zilog_t *zilog, cons
     		int blksz = BP_GET_LSIZE(bp);
     		int i;
     
    -		if (dsl_read(NULL, spa, bp, pbuf,
    -		    arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ,
    -		    ZIO_FLAG_CANFAIL, &aflags, zb) != 0)
    +		if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
    +		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
    +		    &aflags, zb) != 0)
     			return (EIO);
     
     		blk = abuf->b_data;
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -276,12 +276,7 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat
     			aflags |= ARC_L2CACHE;
     
     		dprintf_bp(os->os_rootbp, "reading %s", "");
    -		/*
    -		 * XXX when bprewrite scrub can change the bp,
    -		 * and this is called from dmu_objset_open_ds_os, the bp
    -		 * could change, and we'll need a lock.
    -		 */
    -		err = dsl_read_nolock(NULL, spa, os->os_rootbp,
    +		err = arc_read(NULL, spa, os->os_rootbp,
     		    arc_getbuf_func, &os->os_phys_buf,
     		    ZIO_PRIORITY_SYNC_READ, ZIO_FLAG_CANFAIL, &aflags, &zb);
     		if (err) {
    @@ -1124,8 +1119,7 @@ dmu_objset_sync(objset_t *os, zio_t *pio
     	SET_BOOKMARK(&zb, os->os_dsl_dataset ?
     	    os->os_dsl_dataset->ds_object : DMU_META_OBJSET,
     	    ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
    -	VERIFY3U(0, ==, arc_release_bp(os->os_phys_buf, &os->os_phys_buf,
    -	    os->os_rootbp, os->os_spa, &zb));
    +	arc_release(os->os_phys_buf, &os->os_phys_buf);
     
     	dmu_write_policy(os, NULL, 0, 0, &zp);
     
    @@ -1764,7 +1758,7 @@ dmu_objset_prefetch(const char *name, vo
     			SET_BOOKMARK(&zb, ds->ds_object, ZB_ROOT_OBJECT,
     			    ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
     
    -			(void) dsl_read_nolock(NULL, dsl_dataset_get_spa(ds),
    +			(void) arc_read(NULL, dsl_dataset_get_spa(ds),
     			    &ds->ds_phys->ds_bp, NULL, NULL,
     			    ZIO_PRIORITY_ASYNC_READ,
     			    ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE,
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -317,7 +317,7 @@ dump_dnode(dmu_sendarg_t *dsp, uint64_t 
     
     /* ARGSUSED */
     static int
    -backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
    +backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
         const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	dmu_sendarg_t *dsp = arg;
    @@ -346,9 +346,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, co
     		uint32_t aflags = ARC_WAIT;
     		arc_buf_t *abuf;
     
    -		if (dsl_read(NULL, spa, bp, pbuf,
    -		    arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ,
    -		    ZIO_FLAG_CANFAIL, &aflags, zb) != 0)
    +		if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
    +		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
    +		    &aflags, zb) != 0)
     			return (EIO);
     
     		blk = abuf->b_data;
    @@ -365,9 +365,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, co
     		arc_buf_t *abuf;
     		int blksz = BP_GET_LSIZE(bp);
     
    -		if (arc_read_nolock(NULL, spa, bp,
    -		    arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ,
    -		    ZIO_FLAG_CANFAIL, &aflags, zb) != 0)
    +		if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
    +		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
    +		    &aflags, zb) != 0)
     			return (EIO);
     
     		err = dump_spill(dsp, zb->zb_object, blksz, abuf->b_data);
    @@ -377,9 +377,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, co
     		arc_buf_t *abuf;
     		int blksz = BP_GET_LSIZE(bp);
     
    -		if (dsl_read(NULL, spa, bp, pbuf,
    -		    arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ,
    -		    ZIO_FLAG_CANFAIL, &aflags, zb) != 0) {
    +		if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
    +		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
    +		    &aflags, zb) != 0) {
     			if (zfs_send_corrupt_data) {
     				/* Send a block filled with 0x"zfs badd bloc" */
     				abuf = arc_buf_alloc(spa, blksz, &abuf,
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -62,9 +62,9 @@ typedef struct traverse_data {
     } traverse_data_t;
     
     static int traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp,
    -    arc_buf_t *buf, uint64_t objset, uint64_t object);
    +    uint64_t objset, uint64_t object);
     static void prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *,
    -    arc_buf_t *buf, uint64_t objset, uint64_t object);
    +    uint64_t objset, uint64_t object);
     
     static int
     traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg)
    @@ -81,7 +81,7 @@ traverse_zil_block(zilog_t *zilog, blkpt
     	SET_BOOKMARK(&zb, td->td_objset, ZB_ZIL_OBJECT, ZB_ZIL_LEVEL,
     	    bp->blk_cksum.zc_word[ZIL_ZC_SEQ]);
     
    -	(void) td->td_func(td->td_spa, zilog, bp, NULL, &zb, NULL, td->td_arg);
    +	(void) td->td_func(td->td_spa, zilog, bp, &zb, NULL, td->td_arg);
     
     	return (0);
     }
    @@ -105,7 +105,7 @@ traverse_zil_record(zilog_t *zilog, lr_t
     		SET_BOOKMARK(&zb, td->td_objset, lr->lr_foid,
     		    ZB_ZIL_LEVEL, lr->lr_offset / BP_GET_LSIZE(bp));
     
    -		(void) td->td_func(td->td_spa, zilog, bp, NULL, &zb, NULL,
    +		(void) td->td_func(td->td_spa, zilog, bp, &zb, NULL,
     		    td->td_arg);
     	}
     	return (0);
    @@ -182,7 +182,7 @@ traverse_pause(traverse_data_t *td, cons
     
     static void
     traverse_prefetch_metadata(traverse_data_t *td,
    -    arc_buf_t *pbuf, const blkptr_t *bp, const zbookmark_t *zb)
    +    const blkptr_t *bp, const zbookmark_t *zb)
     {
     	uint32_t flags = ARC_NOWAIT | ARC_PREFETCH;
     
    @@ -200,14 +200,13 @@ traverse_prefetch_metadata(traverse_data
     	if (BP_GET_LEVEL(bp) == 0 && BP_GET_TYPE(bp) != DMU_OT_DNODE)
     		return;
     
    -	(void) arc_read(NULL, td->td_spa, bp,
    -	    pbuf, NULL, NULL, ZIO_PRIORITY_ASYNC_READ,
    -	    ZIO_FLAG_CANFAIL, &flags, zb);
    +	(void) arc_read(NULL, td->td_spa, bp, NULL, NULL,
    +	    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
     }
     
     static int
     traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
    -    arc_buf_t *pbuf, const blkptr_t *bp, const zbookmark_t *zb)
    +    const blkptr_t *bp, const zbookmark_t *zb)
     {
     	zbookmark_t czb;
     	int err = 0, lasterr = 0;
    @@ -228,8 +227,7 @@ traverse_visitbp(traverse_data_t *td, co
     	}
     
     	if (BP_IS_HOLE(bp)) {
    -		err = td->td_func(td->td_spa, NULL, NULL, pbuf, zb, dnp,
    -		    td->td_arg);
    +		err = td->td_func(td->td_spa, NULL, NULL, zb, dnp, td->td_arg);
     		return (err);
     	}
     
    @@ -249,7 +247,7 @@ traverse_visitbp(traverse_data_t *td, co
     	}
     
     	if (td->td_flags & TRAVERSE_PRE) {
    -		err = td->td_func(td->td_spa, NULL, bp, pbuf, zb, dnp,
    +		err = td->td_func(td->td_spa, NULL, bp, zb, dnp,
     		    td->td_arg);
     		if (err == TRAVERSE_VISIT_NO_CHILDREN)
     			return (0);
    @@ -265,8 +263,7 @@ traverse_visitbp(traverse_data_t *td, co
     		blkptr_t *cbp;
     		int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT;
     
    -		err = dsl_read(NULL, td->td_spa, bp, pbuf,
    -		    arc_getbuf_func, &buf,
    +		err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf,
     		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
     		if (err)
     			return (err);
    @@ -276,7 +273,7 @@ traverse_visitbp(traverse_data_t *td, co
     			SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object,
     			    zb->zb_level - 1,
     			    zb->zb_blkid * epb + i);
    -			traverse_prefetch_metadata(td, buf, &cbp[i], &czb);
    +			traverse_prefetch_metadata(td, &cbp[i], &czb);
     		}
     
     		/* recursively visitbp() blocks below this */
    @@ -284,7 +281,7 @@ traverse_visitbp(traverse_data_t *td, co
     			SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object,
     			    zb->zb_level - 1,
     			    zb->zb_blkid * epb + i);
    -			err = traverse_visitbp(td, dnp, buf, &cbp[i], &czb);
    +			err = traverse_visitbp(td, dnp, &cbp[i], &czb);
     			if (err) {
     				if (!hard)
     					break;
    @@ -296,21 +293,20 @@ traverse_visitbp(traverse_data_t *td, co
     		int i;
     		int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT;
     
    -		err = dsl_read(NULL, td->td_spa, bp, pbuf,
    -		    arc_getbuf_func, &buf,
    +		err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf,
     		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
     		if (err)
     			return (err);
     		dnp = buf->b_data;
     
     		for (i = 0; i < epb; i++) {
    -			prefetch_dnode_metadata(td, &dnp[i], buf, zb->zb_objset,
    +			prefetch_dnode_metadata(td, &dnp[i], zb->zb_objset,
     			    zb->zb_blkid * epb + i);
     		}
     
     		/* recursively visitbp() blocks below this */
     		for (i = 0; i < epb; i++) {
    -			err = traverse_dnode(td, &dnp[i], buf, zb->zb_objset,
    +			err = traverse_dnode(td, &dnp[i], zb->zb_objset,
     			    zb->zb_blkid * epb + i);
     			if (err) {
     				if (!hard)
    @@ -323,24 +319,23 @@ traverse_visitbp(traverse_data_t *td, co
     		objset_phys_t *osp;
     		dnode_phys_t *dnp;
     
    -		err = dsl_read_nolock(NULL, td->td_spa, bp,
    -		    arc_getbuf_func, &buf,
    +		err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf,
     		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
     		if (err)
     			return (err);
     
     		osp = buf->b_data;
     		dnp = &osp->os_meta_dnode;
    -		prefetch_dnode_metadata(td, dnp, buf, zb->zb_objset,
    +		prefetch_dnode_metadata(td, dnp, zb->zb_objset,
     		    DMU_META_DNODE_OBJECT);
     		if (arc_buf_size(buf) >= sizeof (objset_phys_t)) {
     			prefetch_dnode_metadata(td, &osp->os_userused_dnode,
    -			    buf, zb->zb_objset, DMU_USERUSED_OBJECT);
    +			    zb->zb_objset, DMU_USERUSED_OBJECT);
     			prefetch_dnode_metadata(td, &osp->os_groupused_dnode,
    -			    buf, zb->zb_objset, DMU_USERUSED_OBJECT);
    +			    zb->zb_objset, DMU_USERUSED_OBJECT);
     		}
     
    -		err = traverse_dnode(td, dnp, buf, zb->zb_objset,
    +		err = traverse_dnode(td, dnp, zb->zb_objset,
     		    DMU_META_DNODE_OBJECT);
     		if (err && hard) {
     			lasterr = err;
    @@ -348,7 +343,7 @@ traverse_visitbp(traverse_data_t *td, co
     		}
     		if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) {
     			dnp = &osp->os_userused_dnode;
    -			err = traverse_dnode(td, dnp, buf, zb->zb_objset,
    +			err = traverse_dnode(td, dnp, zb->zb_objset,
     			    DMU_USERUSED_OBJECT);
     		}
     		if (err && hard) {
    @@ -357,7 +352,7 @@ traverse_visitbp(traverse_data_t *td, co
     		}
     		if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) {
     			dnp = &osp->os_groupused_dnode;
    -			err = traverse_dnode(td, dnp, buf, zb->zb_objset,
    +			err = traverse_dnode(td, dnp, zb->zb_objset,
     			    DMU_GROUPUSED_OBJECT);
     		}
     	}
    @@ -367,8 +362,7 @@ traverse_visitbp(traverse_data_t *td, co
     
     post:
     	if (err == 0 && lasterr == 0 && (td->td_flags & TRAVERSE_POST)) {
    -		err = td->td_func(td->td_spa, NULL, bp, pbuf, zb, dnp,
    -		    td->td_arg);
    +		err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg);
     		if (err == ERESTART)
     			pause = B_TRUE;
     	}
    @@ -384,25 +378,25 @@ post:
     
     static void
     prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *dnp,
    -    arc_buf_t *buf, uint64_t objset, uint64_t object)
    +    uint64_t objset, uint64_t object)
     {
     	int j;
     	zbookmark_t czb;
     
     	for (j = 0; j < dnp->dn_nblkptr; j++) {
     		SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j);
    -		traverse_prefetch_metadata(td, buf, &dnp->dn_blkptr[j], &czb);
    +		traverse_prefetch_metadata(td, &dnp->dn_blkptr[j], &czb);
     	}
     
     	if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) {
     		SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID);
    -		traverse_prefetch_metadata(td, buf, &dnp->dn_spill, &czb);
    +		traverse_prefetch_metadata(td, &dnp->dn_spill, &czb);
     	}
     }
     
     static int
     traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp,
    -    arc_buf_t *buf, uint64_t objset, uint64_t object)
    +    uint64_t objset, uint64_t object)
     {
     	int j, err = 0, lasterr = 0;
     	zbookmark_t czb;
    @@ -410,7 +404,7 @@ traverse_dnode(traverse_data_t *td, cons
     
     	for (j = 0; j < dnp->dn_nblkptr; j++) {
     		SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j);
    -		err = traverse_visitbp(td, dnp, buf, &dnp->dn_blkptr[j], &czb);
    +		err = traverse_visitbp(td, dnp, &dnp->dn_blkptr[j], &czb);
     		if (err) {
     			if (!hard)
     				break;
    @@ -420,7 +414,7 @@ traverse_dnode(traverse_data_t *td, cons
     
     	if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) {
     		SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID);
    -		err = traverse_visitbp(td, dnp, buf, &dnp->dn_spill, &czb);
    +		err = traverse_visitbp(td, dnp, &dnp->dn_spill, &czb);
     		if (err) {
     			if (!hard)
     				return (err);
    @@ -433,8 +427,7 @@ traverse_dnode(traverse_data_t *td, cons
     /* ARGSUSED */
     static int
     traverse_prefetcher(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
    -    arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp,
    -    void *arg)
    +    const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	prefetch_data_t *pfd = arg;
     	uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH;
    @@ -455,10 +448,8 @@ traverse_prefetcher(spa_t *spa, zilog_t 
     	cv_broadcast(&pfd->pd_cv);
     	mutex_exit(&pfd->pd_mtx);
     
    -	(void) dsl_read(NULL, spa, bp, pbuf, NULL, NULL,
    -	    ZIO_PRIORITY_ASYNC_READ,
    -	    ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE,
    -	    &aflags, zb);
    +	(void) arc_read(NULL, spa, bp, NULL, NULL, ZIO_PRIORITY_ASYNC_READ,
    +	    ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE, &aflags, zb);
     
     	return (0);
     }
    @@ -476,7 +467,7 @@ traverse_prefetch_thread(void *arg)
     
     	SET_BOOKMARK(&czb, td.td_objset,
     	    ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
    -	(void) traverse_visitbp(&td, NULL, NULL, td.td_rootbp, &czb);
    +	(void) traverse_visitbp(&td, NULL, td.td_rootbp, &czb);
     
     	mutex_enter(&td_main->td_pfd->pd_mtx);
     	td_main->td_pfd->pd_exited = B_TRUE;
    @@ -540,7 +531,7 @@ traverse_impl(spa_t *spa, dsl_dataset_t 
     
     	SET_BOOKMARK(&czb, td.td_objset,
     	    ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
    -	err = traverse_visitbp(&td, NULL, NULL, rootbp, &czb);
    +	err = traverse_visitbp(&td, NULL, rootbp, &czb);
     
     	mutex_enter(&pd.pd_mtx);
     	pd.pd_cancel = B_TRUE;
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -21,7 +21,7 @@
     /*
      * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
      * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
    - * Copyright (c) 2012 by Delphix. All rights reserved.
    + * Copyright (c) 2013 by Delphix. All rights reserved.
      */
     
     #include 
    @@ -284,6 +284,7 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u
     			delta = P2NPHASE(off, dn->dn_datablksz);
     		}
     
    +		min_ibs = max_ibs = dn->dn_indblkshift;
     		if (dn->dn_maxblkid > 0) {
     			/*
     			 * The blocksize can't change,
    @@ -291,13 +292,6 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u
     			 */
     			ASSERT(dn->dn_datablkshift != 0);
     			min_bs = max_bs = dn->dn_datablkshift;
    -			min_ibs = max_ibs = dn->dn_indblkshift;
    -		} else if (dn->dn_indblkshift > max_ibs) {
    -			/*
    -			 * This ensures that if we reduce DN_MAX_INDBLKSHIFT,
    -			 * the code will still work correctly on older pools.
    -			 */
    -			min_ibs = max_ibs = dn->dn_indblkshift;
     		}
     
     		/*
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -1308,7 +1308,7 @@ struct killarg {
     
     /* ARGSUSED */
     static int
    -kill_blkptr(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
    +kill_blkptr(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
         const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	struct killarg *ka = arg;
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -396,24 +396,6 @@ dsl_free_sync(zio_t *pio, dsl_pool_t *dp
     	zio_nowait(zio_free_sync(pio, dp->dp_spa, txg, bpp, pio->io_flags));
     }
     
    -int
    -dsl_read(zio_t *pio, spa_t *spa, const blkptr_t *bpp, arc_buf_t *pbuf,
    -    arc_done_func_t *done, void *private, int priority, int zio_flags,
    -    uint32_t *arc_flags, const zbookmark_t *zb)
    -{
    -	return (arc_read(pio, spa, bpp, pbuf, done, private,
    -	    priority, zio_flags, arc_flags, zb));
    -}
    -
    -int
    -dsl_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bpp,
    -    arc_done_func_t *done, void *private, int priority, int zio_flags,
    -    uint32_t *arc_flags, const zbookmark_t *zb)
    -{
    -	return (arc_read_nolock(pio, spa, bpp, done, private,
    -	    priority, zio_flags, arc_flags, zb));
    -}
    -
     static uint64_t
     dsl_scan_ds_maxtxg(dsl_dataset_t *ds)
     {
    @@ -584,12 +566,8 @@ dsl_scan_prefetch(dsl_scan_t *scn, arc_b
     
     	SET_BOOKMARK(&czb, objset, object, BP_GET_LEVEL(bp), blkid);
     
    -	/*
    -	 * XXX need to make sure all of these arc_read() prefetches are
    -	 * done before setting xlateall (similar to dsl_read())
    -	 */
     	(void) arc_read(scn->scn_zio_root, scn->scn_dp->dp_spa, bp,
    -	    buf, NULL, NULL, ZIO_PRIORITY_ASYNC_READ,
    +	    NULL, NULL, ZIO_PRIORITY_ASYNC_READ,
     	    ZIO_FLAG_CANFAIL | ZIO_FLAG_SCAN_THREAD, &flags, &czb);
     }
     
    @@ -647,8 +625,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da
     		blkptr_t *cbp;
     		int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT;
     
    -		err = arc_read_nolock(NULL, dp->dp_spa, bp,
    -		    arc_getbuf_func, bufp,
    +		err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp,
     		    ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
     		if (err) {
     			scn->scn_phys.scn_errors++;
    @@ -670,8 +647,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da
     	} else if (BP_GET_TYPE(bp) == DMU_OT_USERGROUP_USED) {
     		uint32_t flags = ARC_WAIT;
     
    -		err = arc_read_nolock(NULL, dp->dp_spa, bp,
    -		    arc_getbuf_func, bufp,
    +		err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp,
     		    ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
     		if (err) {
     			scn->scn_phys.scn_errors++;
    @@ -683,8 +659,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da
     		int i, j;
     		int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT;
     
    -		err = arc_read_nolock(NULL, dp->dp_spa, bp,
    -		    arc_getbuf_func, bufp,
    +		err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp,
     		    ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
     		if (err) {
     			scn->scn_phys.scn_errors++;
    @@ -706,8 +681,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da
     		uint32_t flags = ARC_WAIT;
     		objset_phys_t *osp;
     
    -		err = arc_read_nolock(NULL, dp->dp_spa, bp,
    -		    arc_getbuf_func, bufp,
    +		err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp,
     		    ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
     		if (err) {
     			scn->scn_phys.scn_errors++;
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -21,6 +21,7 @@
     /*
      * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
      * Copyright (c) 2012 by Delphix. All rights reserved.
    + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
      */
     
     #include 
    @@ -97,6 +98,15 @@ int metaslab_prefetch_limit = SPA_DVAS_P
     int metaslab_smo_bonus_pct = 150;
     
     /*
    + * Should we be willing to write data to degraded vdevs?
    + */
    +boolean_t zfs_write_to_degraded = B_FALSE;
    +SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RW,
    +    &zfs_write_to_degraded, 0,
    +    "Allow writing data to degraded vdevs");
    +TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded);
    +
    +/*
      * ==========================================================================
      * Metaslab classes
      * ==========================================================================
    @@ -1383,10 +1393,13 @@ top:
     
     		/*
     		 * Avoid writing single-copy data to a failing vdev
    +		 * unless the user instructs us that it is okay.
     		 */
     		if ((vd->vdev_stat.vs_write_errors > 0 ||
     		    vd->vdev_state < VDEV_STATE_HEALTHY) &&
    -		    d == 0 && dshift == 3) {
    +		    d == 0 && dshift == 3 &&
    +		    !(zfs_write_to_degraded && vd->vdev_state ==
    +		    VDEV_STATE_DEGRADED)) {
     			all_zero = B_FALSE;
     			goto next;
     		}
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -553,6 +553,7 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_
     {
     	int var_size = 0;
     	int i;
    +	int j = -1;
     	int full_space;
     	int hdrsize;
     	boolean_t done = B_FALSE;
    @@ -574,11 +575,13 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_
     	    sizeof (sa_hdr_phys_t);
     
     	full_space = (buftype == SA_BONUS) ? DN_MAX_BONUSLEN : db->db_size;
    +	ASSERT(IS_P2ALIGNED(full_space, 8));
     
     	for (i = 0; i != attr_count; i++) {
     		boolean_t is_var_sz;
     
    -		*total += P2ROUNDUP(attr_desc[i].sa_length, 8);
    +		*total = P2ROUNDUP(*total, 8);
    +		*total += attr_desc[i].sa_length;
     		if (done)
     			goto next;
     
    @@ -590,7 +593,14 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_
     		if (is_var_sz && var_size > 1) {
     			if (P2ROUNDUP(hdrsize + sizeof (uint16_t), 8) +
     			    *total < full_space) {
    +				/*
    +				 * Account for header space used by array of
    +				 * optional sizes of variable-length attributes.
    +				 * Record the index in case this increase needs
    +				 * to be reversed due to spill-over.
    +				 */
     				hdrsize += sizeof (uint16_t);
    +				j = i;
     			} else {
     				done = B_TRUE;
     				*index = i;
    @@ -619,6 +629,14 @@ next:
     			*will_spill = B_TRUE;
     	}
     
    +	/*
    +	 * j holds the index of the last variable-sized attribute for
    +	 * which hdrsize was increased.  Reverse the increase if that
    +	 * attribute will be relocated to the spill block.
    +	 */
    +	if (*will_spill && j == *index)
    +		hdrsize -= sizeof (uint16_t);
    +
     	hdrsize = P2ROUNDUP(hdrsize, 8);
     	return (hdrsize);
     }
    @@ -709,6 +727,8 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu
     	for (i = 0, len_idx = 0, hash = -1ULL; i != attr_count; i++) {
     		uint16_t length;
     
    +		ASSERT(IS_P2ALIGNED(data_start, 8));
    +		ASSERT(IS_P2ALIGNED(buf_space, 8));
     		attrs[i] = attr_desc[i].sa_attr;
     		length = SA_REGISTERED_LEN(sa, attrs[i]);
     		if (length == 0)
    @@ -717,6 +737,7 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu
     			VERIFY(length == attr_desc[i].sa_length);
     
     		if (buf_space < length) {  /* switch to spill buffer */
    +			VERIFY(spilling);
     			VERIFY(bonustype == DMU_OT_SA);
     			if (buftype == SA_BONUS && !sa->sa_force_spill) {
     				sa_find_layout(hdl->sa_os, hash, attrs_start,
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -1764,7 +1764,7 @@ spa_load_verify_done(zio_t *zio)
     /*ARGSUSED*/
     static int
     spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
    -    arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
    +    const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	if (bp != NULL) {
     		zio_t *rio = arg;
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -49,7 +49,6 @@ struct arc_buf {
     	arc_buf_hdr_t		*b_hdr;
     	arc_buf_t		*b_next;
     	kmutex_t		b_evict_lock;
    -	krwlock_t		b_data_lock;
     	void			*b_data;
     	arc_evict_func_t	*b_efunc;
     	void			*b_private;
    @@ -93,8 +92,6 @@ void arc_buf_add_ref(arc_buf_t *buf, voi
     int arc_buf_remove_ref(arc_buf_t *buf, void *tag);
     int arc_buf_size(arc_buf_t *buf);
     void arc_release(arc_buf_t *buf, void *tag);
    -int arc_release_bp(arc_buf_t *buf, void *tag, blkptr_t *bp, spa_t *spa,
    -    zbookmark_t *zb);
     int arc_released(arc_buf_t *buf);
     int arc_has_callback(arc_buf_t *buf);
     void arc_buf_freeze(arc_buf_t *buf);
    @@ -103,10 +100,7 @@ void arc_buf_thaw(arc_buf_t *buf);
     int arc_referenced(arc_buf_t *buf);
     #endif
     
    -int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_buf_t *pbuf,
    -    arc_done_func_t *done, void *priv, int priority, int zio_flags,
    -    uint32_t *arc_flags, const zbookmark_t *zb);
    -int arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp,
    +int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp,
         arc_done_func_t *done, void *priv, int priority, int flags,
         uint32_t *arc_flags, const zbookmark_t *zb);
     zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg,
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -40,8 +40,7 @@ struct zilog;
     struct arc_buf;
     
     typedef int (blkptr_cb_t)(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
    -    struct arc_buf *pbuf, const zbookmark_t *zb, const struct dnode_phys *dnp,
    -    void *arg);
    +    const zbookmark_t *zb, const struct dnode_phys *dnp, void *arg);
     
     #define	TRAVERSE_PRE			(1<<0)
     #define	TRAVERSE_POST			(1<<1)
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -134,12 +134,6 @@ void dsl_pool_willuse_space(dsl_pool_t *
     void dsl_free(dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp);
     void dsl_free_sync(zio_t *pio, dsl_pool_t *dp, uint64_t txg,
         const blkptr_t *bpp);
    -int dsl_read(zio_t *pio, spa_t *spa, const blkptr_t *bpp, arc_buf_t *pbuf,
    -    arc_done_func_t *done, void *priv, int priority, int zio_flags,
    -    uint32_t *arc_flags, const zbookmark_t *zb);
    -int dsl_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bpp,
    -    arc_done_func_t *done, void *priv, int priority, int zio_flags,
    -    uint32_t *arc_flags, const zbookmark_t *zb);
     void dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx);
     void dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx);
     void dsl_pool_upgrade_dir_clones(dsl_pool_t *dp, dmu_tx_t *tx);
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -20,6 +20,7 @@
      */
     /*
      * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2012 by Delphix. All rights reserved.
      */
     
     #ifndef	_SYS_REFCOUNT_H
    @@ -54,8 +55,8 @@ typedef struct refcount {
     	kmutex_t rc_mtx;
     	list_t rc_list;
     	list_t rc_removed;
    -	int64_t rc_count;
    -	int64_t rc_removed_count;
    +	uint64_t rc_count;
    +	uint64_t rc_removed_count;
     } refcount_t;
     
     /* Note: refcount_t must be initialized with refcount_create() */
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -1328,7 +1328,8 @@ vdev_validate(vdev_t *vd, boolean_t stri
     	if (vd->vdev_ops->vdev_op_leaf && vdev_readable(vd)) {
     		uint64_t aux_guid = 0;
     		nvlist_t *nvl;
    -		uint64_t txg = strict ? spa->spa_config_txg : -1ULL;
    +		uint64_t txg = spa_last_synced_txg(spa) != 0 ?
    +		    spa_last_synced_txg(spa) : -1ULL;
     
     		if ((label = vdev_label_read_config(vd, txg)) == NULL) {
     			vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN,
    @@ -1512,7 +1513,7 @@ vdev_reopen(vdev_t *vd)
     		    !l2arc_vdev_present(vd))
     			l2arc_add_vdev(spa, vd);
     	} else {
    -		(void) vdev_validate(vd, spa_last_synced_txg(spa));
    +		(void) vdev_validate(vd, B_TRUE);
     	}
     
     	/*
    
    Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
    ==============================================================================
    --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Wed Feb 27 19:03:31 2013	(r247405)
    +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Wed Feb 27 19:20:50 2013	(r247406)
    @@ -106,12 +106,18 @@ typedef enum {
     	DATASET_NAME
     } zfs_ioc_namecheck_t;
     
    +typedef enum {
    +	POOL_CHECK_NONE		= 1 << 0,
    +	POOL_CHECK_SUSPENDED	= 1 << 1,
    +	POOL_CHECK_READONLY	= 1 << 2
    +} zfs_ioc_poolcheck_t;
    +
     typedef struct zfs_ioc_vec {
     	zfs_ioc_func_t		*zvec_func;
     	zfs_secpolicy_func_t	*zvec_secpolicy;
     	zfs_ioc_namecheck_t	zvec_namecheck;
     	boolean_t		zvec_his_log;
    -	boolean_t		zvec_pool_check;
    +	zfs_ioc_poolcheck_t	zvec_pool_check;
     } zfs_ioc_vec_t;
     
     /* This array is indexed by zfs_userquota_prop_t */
    @@ -5033,138 +5039,155 @@ zfs_ioc_unjail(zfs_cmd_t *zc)
     
     static zfs_ioc_vec_t zfs_ioc_vec[] = {
     	{ zfs_ioc_pool_create, zfs_secpolicy_config, POOL_NAME, B_FALSE,
    -	    B_FALSE },
    +	    POOL_CHECK_NONE },
     	{ zfs_ioc_pool_destroy,	zfs_secpolicy_config, POOL_NAME, B_FALSE,
    -	    B_FALSE },
    +	    POOL_CHECK_NONE },
     	{ zfs_ioc_pool_import, zfs_secpolicy_config, POOL_NAME, B_TRUE,
    -	    B_FALSE },
    +	    POOL_CHECK_NONE },
     	{ zfs_ioc_pool_export, zfs_secpolicy_config, POOL_NAME, B_FALSE,
    -	    B_FALSE },
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 19:22:31 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id EACE0B4F;
     Wed, 27 Feb 2013 19:22:31 +0000 (UTC) (envelope-from mm@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 C283B93D;
     Wed, 27 Feb 2013 19:22:31 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RJMVTc073041;
     Wed, 27 Feb 2013 19:22:31 GMT (envelope-from mm@svn.freebsd.org)
    Received: (from mm@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RJMRap073016;
     Wed, 27 Feb 2013 19:22:27 GMT (envelope-from mm@svn.freebsd.org)
    Message-Id: <201302271922.r1RJMRap073016@svn.freebsd.org>
    From: Martin Matuska 
    Date: Wed, 27 Feb 2013 19:22:27 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247407 - in stable/8: cddl/contrib/opensolaris/cmd/zdb
     cddl/contrib/opensolaris/lib/libzfs/common
     sys/cddl/contrib/opensolaris/uts/common/fs/zfs
     sys/cddl/contrib/opensolaris/uts/common...
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 19:22:32 -0000
    
    Author: mm
    Date: Wed Feb 27 19:22:27 2013
    New Revision: 247407
    URL: http://svnweb.freebsd.org/changeset/base/247407
    
    Log:
      MFC r246631,246651,246666,246675,246678,246688:
      Merge various ZFS bugfixes
      
      MFC r246631:
      Import vendor bugfixes
      
      Illumos ZFS issues:
        3422 zpool create/syseventd race yield non-importable pool
        3425 first write to a new zvol can fail with EFBIG
      
      MFC r246651:
      Import minor type change in refcount.h header from vendor (illumos).
      
      MFC r246666:
      Import vendor ZFS bugfix fixing a problem in arc_read().
      
      Illumos ZFS issues:
        3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
      
      MFC r246675:
      Add tunable to allow block allocation on degraded vdevs.
      
      Illumos ZFS issues:
        3507 Tunable to allow block allocation even on degraded vdevs
      
      MFC r246678:
      Import vendor bugfixes regarding SA rounding, header size and layout.
      This was already partially fixed by avg.
      
      Illumos ZFS issues:
        3512 rounding discrepancy in sa_find_sizes()
        3513 mismatch between SA header size and layout
      
      MFC r246688 [1]:
      Merge zfs_ioctl.c code that should have been merged together with ZFS v28.
      Fixes several problems if working with read-only pools.
      
      Changed code originaly introduced in onnv-gate 13061:bda0decf867b
      Contains changes up to illumos-gate 13700:4bc0783f6064
      
      PR:		kern/175897 [1]
      Suggested by:	avg [1]
    
    Modified:
      stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c
      stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
      stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
    Directory Properties:
      stable/8/cddl/contrib/opensolaris/   (props changed)
      stable/8/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
      stable/8/sys/   (props changed)
      stable/8/sys/cddl/   (props changed)
      stable/8/sys/cddl/contrib/opensolaris/   (props changed)
    
    Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c
    ==============================================================================
    --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -983,7 +983,7 @@ visit_indirect(spa_t *spa, const dnode_p
     		arc_buf_t *buf;
     		uint64_t fill = 0;
     
    -		err = arc_read_nolock(NULL, spa, bp, arc_getbuf_func, &buf,
    +		err = arc_read(NULL, spa, bp, arc_getbuf_func, &buf,
     		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
     		if (err)
     			return (err);
    @@ -2001,9 +2001,8 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *
     	    bp, NULL, NULL, ZIO_FLAG_CANFAIL)), ==, 0);
     }
     
    -/* ARGSUSED */
     static int
    -zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
    +zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
         const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	zdb_cb_t *zcb = arg;
    @@ -2410,7 +2409,7 @@ typedef struct zdb_ddt_entry {
     /* ARGSUSED */
     static int
     zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
    -    arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
    +    const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	avl_tree_t *t = arg;
     	avl_index_t where;
    
    Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
    ==============================================================================
    --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -526,13 +526,12 @@ get_configs(libzfs_handle_t *hdl, pool_l
     				 *	version
     				 *	pool guid
     				 *	name
    -				 *	pool txg (if available)
     				 *	comment (if available)
     				 *	pool state
     				 *	hostid (if available)
     				 *	hostname (if available)
     				 */
    -				uint64_t state, version, pool_txg;
    +				uint64_t state, version;
     				char *comment = NULL;
     
     				version = fnvlist_lookup_uint64(tmp,
    @@ -548,11 +547,6 @@ get_configs(libzfs_handle_t *hdl, pool_l
     				fnvlist_add_string(config,
     				    ZPOOL_CONFIG_POOL_NAME, name);
     
    -				if (nvlist_lookup_uint64(tmp,
    -				    ZPOOL_CONFIG_POOL_TXG, &pool_txg) == 0)
    -					fnvlist_add_uint64(config,
    -					    ZPOOL_CONFIG_POOL_TXG, pool_txg);
    -
     				if (nvlist_lookup_string(tmp,
     				    ZPOOL_CONFIG_COMMENT, &comment) == 0)
     					fnvlist_add_string(config,
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -940,7 +940,6 @@ buf_cons(void *vbuf, void *unused, int k
     
     	bzero(buf, sizeof (arc_buf_t));
     	mutex_init(&buf->b_evict_lock, NULL, MUTEX_DEFAULT, NULL);
    -	rw_init(&buf->b_data_lock, NULL, RW_DEFAULT, NULL);
     	arc_space_consume(sizeof (arc_buf_t), ARC_SPACE_HDRS);
     
     	return (0);
    @@ -970,7 +969,6 @@ buf_dest(void *vbuf, void *unused)
     	arc_buf_t *buf = vbuf;
     
     	mutex_destroy(&buf->b_evict_lock);
    -	rw_destroy(&buf->b_data_lock);
     	arc_space_return(sizeof (arc_buf_t), ARC_SPACE_HDRS);
     }
     
    @@ -2968,42 +2966,11 @@ arc_read_done(zio_t *zio)
      *
      * arc_read_done() will invoke all the requested "done" functions
      * for readers of this block.
    - *
    - * Normal callers should use arc_read and pass the arc buffer and offset
    - * for the bp.  But if you know you don't need locking, you can use
    - * arc_read_nolock.
      */
     int
    -arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_buf_t *pbuf,
    -    arc_done_func_t *done, void *private, int priority, int zio_flags,
    -    uint32_t *arc_flags, const zbookmark_t *zb)
    -{
    -	int err;
    -
    -	if (pbuf == NULL) {
    -		/*
    -		 * XXX This happens from traverse callback funcs, for
    -		 * the objset_phys_t block.
    -		 */
    -		return (arc_read_nolock(pio, spa, bp, done, private, priority,
    -		    zio_flags, arc_flags, zb));
    -	}
    -
    -	ASSERT(!refcount_is_zero(&pbuf->b_hdr->b_refcnt));
    -	ASSERT3U((char *)bp - (char *)pbuf->b_data, <, pbuf->b_hdr->b_size);
    -	rw_enter(&pbuf->b_data_lock, RW_READER);
    -
    -	err = arc_read_nolock(pio, spa, bp, done, private, priority,
    -	    zio_flags, arc_flags, zb);
    -	rw_exit(&pbuf->b_data_lock);
    -
    -	return (err);
    -}
    -
    -int
    -arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp,
    -    arc_done_func_t *done, void *private, int priority, int zio_flags,
    -    uint32_t *arc_flags, const zbookmark_t *zb)
    +arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done,
    +    void *private, int priority, int zio_flags, uint32_t *arc_flags,
    +    const zbookmark_t *zb)
     {
     	arc_buf_hdr_t *hdr;
     	arc_buf_t *buf;
    @@ -3482,19 +3449,6 @@ arc_release(arc_buf_t *buf, void *tag)
     	}
     }
     
    -/*
    - * Release this buffer.  If it does not match the provided BP, fill it
    - * with that block's contents.
    - */
    -/* ARGSUSED */
    -int
    -arc_release_bp(arc_buf_t *buf, void *tag, blkptr_t *bp, spa_t *spa,
    -    zbookmark_t *zb)
    -{
    -	arc_release(buf, tag);
    -	return (0);
    -}
    -
     int
     arc_released(arc_buf_t *buf)
     {
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -135,7 +135,7 @@ bptree_add(objset_t *os, uint64_t obj, b
     
     /* ARGSUSED */
     static int
    -bptree_visit_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
    +bptree_visit_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
         const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	int err;
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -513,7 +513,6 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t
     	spa_t *spa;
     	zbookmark_t zb;
     	uint32_t aflags = ARC_NOWAIT;
    -	arc_buf_t *pbuf;
     
     	DB_DNODE_ENTER(db);
     	dn = DB_DNODE(db);
    @@ -575,14 +574,8 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t
     	    db->db.db_object, db->db_level, db->db_blkid);
     
     	dbuf_add_ref(db, NULL);
    -	/* ZIO_FLAG_CANFAIL callers have to check the parent zio's error */
     
    -	if (db->db_parent)
    -		pbuf = db->db_parent->db_buf;
    -	else
    -		pbuf = db->db_objset->os_phys_buf;
    -
    -	(void) dsl_read(zio, spa, db->db_blkptr, pbuf,
    +	(void) arc_read(zio, spa, db->db_blkptr,
     	    dbuf_read_done, db, ZIO_PRIORITY_SYNC_READ,
     	    (*flags & DB_RF_CANFAIL) ? ZIO_FLAG_CANFAIL : ZIO_FLAG_MUSTSUCCEED,
     	    &aflags, &zb);
    @@ -982,7 +975,6 @@ void
     dbuf_release_bp(dmu_buf_impl_t *db)
     {
     	objset_t *os;
    -	zbookmark_t zb;
     
     	DB_GET_OBJSET(&os, db);
     	ASSERT(dsl_pool_sync_context(dmu_objset_pool(os)));
    @@ -990,13 +982,7 @@ dbuf_release_bp(dmu_buf_impl_t *db)
     	    list_link_active(&os->os_dsl_dataset->ds_synced_link));
     	ASSERT(db->db_parent == NULL || arc_released(db->db_parent->db_buf));
     
    -	zb.zb_objset = os->os_dsl_dataset ?
    -	    os->os_dsl_dataset->ds_object : 0;
    -	zb.zb_object = db->db.db_object;
    -	zb.zb_level = db->db_level;
    -	zb.zb_blkid = db->db_blkid;
    -	(void) arc_release_bp(db->db_buf, db,
    -	    db->db_blkptr, os->os_spa, &zb);
    +	(void) arc_release(db->db_buf, db);
     }
     
     dbuf_dirty_record_t *
    @@ -1831,7 +1817,6 @@ dbuf_prefetch(dnode_t *dn, uint64_t blki
     		if (bp && !BP_IS_HOLE(bp)) {
     			int priority = dn->dn_type == DMU_OT_DDT_ZAP ?
     			    ZIO_PRIORITY_DDT_PREFETCH : ZIO_PRIORITY_ASYNC_READ;
    -			arc_buf_t *pbuf;
     			dsl_dataset_t *ds = dn->dn_objset->os_dsl_dataset;
     			uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH;
     			zbookmark_t zb;
    @@ -1839,13 +1824,8 @@ dbuf_prefetch(dnode_t *dn, uint64_t blki
     			SET_BOOKMARK(&zb, ds ? ds->ds_object : DMU_META_OBJSET,
     			    dn->dn_object, 0, blkid);
     
    -			if (db)
    -				pbuf = db->db_buf;
    -			else
    -				pbuf = dn->dn_objset->os_phys_buf;
    -
    -			(void) dsl_read(NULL, dn->dn_objset->os_spa,
    -			    bp, pbuf, NULL, NULL, priority,
    +			(void) arc_read(NULL, dn->dn_objset->os_spa,
    +			    bp, NULL, NULL, priority,
     			    ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE,
     			    &aflags, &zb);
     		}
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -128,7 +128,7 @@ report_dnode(struct diffarg *da, uint64_
     
     /* ARGSUSED */
     static int
    -diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
    +diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
         const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	struct diffarg *da = arg;
    @@ -155,9 +155,9 @@ diff_cb(spa_t *spa, zilog_t *zilog, cons
     		int blksz = BP_GET_LSIZE(bp);
     		int i;
     
    -		if (dsl_read(NULL, spa, bp, pbuf,
    -		    arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ,
    -		    ZIO_FLAG_CANFAIL, &aflags, zb) != 0)
    +		if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
    +		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
    +		    &aflags, zb) != 0)
     			return (EIO);
     
     		blk = abuf->b_data;
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -276,12 +276,7 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat
     			aflags |= ARC_L2CACHE;
     
     		dprintf_bp(os->os_rootbp, "reading %s", "");
    -		/*
    -		 * XXX when bprewrite scrub can change the bp,
    -		 * and this is called from dmu_objset_open_ds_os, the bp
    -		 * could change, and we'll need a lock.
    -		 */
    -		err = dsl_read_nolock(NULL, spa, os->os_rootbp,
    +		err = arc_read(NULL, spa, os->os_rootbp,
     		    arc_getbuf_func, &os->os_phys_buf,
     		    ZIO_PRIORITY_SYNC_READ, ZIO_FLAG_CANFAIL, &aflags, &zb);
     		if (err) {
    @@ -1124,8 +1119,7 @@ dmu_objset_sync(objset_t *os, zio_t *pio
     	SET_BOOKMARK(&zb, os->os_dsl_dataset ?
     	    os->os_dsl_dataset->ds_object : DMU_META_OBJSET,
     	    ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
    -	VERIFY3U(0, ==, arc_release_bp(os->os_phys_buf, &os->os_phys_buf,
    -	    os->os_rootbp, os->os_spa, &zb));
    +	arc_release(os->os_phys_buf, &os->os_phys_buf);
     
     	dmu_write_policy(os, NULL, 0, 0, &zp);
     
    @@ -1764,7 +1758,7 @@ dmu_objset_prefetch(const char *name, vo
     			SET_BOOKMARK(&zb, ds->ds_object, ZB_ROOT_OBJECT,
     			    ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
     
    -			(void) dsl_read_nolock(NULL, dsl_dataset_get_spa(ds),
    +			(void) arc_read(NULL, dsl_dataset_get_spa(ds),
     			    &ds->ds_phys->ds_bp, NULL, NULL,
     			    ZIO_PRIORITY_ASYNC_READ,
     			    ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE,
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -317,7 +317,7 @@ dump_dnode(dmu_sendarg_t *dsp, uint64_t 
     
     /* ARGSUSED */
     static int
    -backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
    +backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
         const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	dmu_sendarg_t *dsp = arg;
    @@ -346,9 +346,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, co
     		uint32_t aflags = ARC_WAIT;
     		arc_buf_t *abuf;
     
    -		if (dsl_read(NULL, spa, bp, pbuf,
    -		    arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ,
    -		    ZIO_FLAG_CANFAIL, &aflags, zb) != 0)
    +		if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
    +		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
    +		    &aflags, zb) != 0)
     			return (EIO);
     
     		blk = abuf->b_data;
    @@ -365,9 +365,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, co
     		arc_buf_t *abuf;
     		int blksz = BP_GET_LSIZE(bp);
     
    -		if (arc_read_nolock(NULL, spa, bp,
    -		    arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ,
    -		    ZIO_FLAG_CANFAIL, &aflags, zb) != 0)
    +		if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
    +		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
    +		    &aflags, zb) != 0)
     			return (EIO);
     
     		err = dump_spill(dsp, zb->zb_object, blksz, abuf->b_data);
    @@ -377,9 +377,9 @@ backup_cb(spa_t *spa, zilog_t *zilog, co
     		arc_buf_t *abuf;
     		int blksz = BP_GET_LSIZE(bp);
     
    -		if (dsl_read(NULL, spa, bp, pbuf,
    -		    arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ,
    -		    ZIO_FLAG_CANFAIL, &aflags, zb) != 0) {
    +		if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
    +		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
    +		    &aflags, zb) != 0) {
     			if (zfs_send_corrupt_data) {
     				/* Send a block filled with 0x"zfs badd bloc" */
     				abuf = arc_buf_alloc(spa, blksz, &abuf,
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -62,9 +62,9 @@ typedef struct traverse_data {
     } traverse_data_t;
     
     static int traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp,
    -    arc_buf_t *buf, uint64_t objset, uint64_t object);
    +    uint64_t objset, uint64_t object);
     static void prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *,
    -    arc_buf_t *buf, uint64_t objset, uint64_t object);
    +    uint64_t objset, uint64_t object);
     
     static int
     traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg)
    @@ -81,7 +81,7 @@ traverse_zil_block(zilog_t *zilog, blkpt
     	SET_BOOKMARK(&zb, td->td_objset, ZB_ZIL_OBJECT, ZB_ZIL_LEVEL,
     	    bp->blk_cksum.zc_word[ZIL_ZC_SEQ]);
     
    -	(void) td->td_func(td->td_spa, zilog, bp, NULL, &zb, NULL, td->td_arg);
    +	(void) td->td_func(td->td_spa, zilog, bp, &zb, NULL, td->td_arg);
     
     	return (0);
     }
    @@ -105,7 +105,7 @@ traverse_zil_record(zilog_t *zilog, lr_t
     		SET_BOOKMARK(&zb, td->td_objset, lr->lr_foid,
     		    ZB_ZIL_LEVEL, lr->lr_offset / BP_GET_LSIZE(bp));
     
    -		(void) td->td_func(td->td_spa, zilog, bp, NULL, &zb, NULL,
    +		(void) td->td_func(td->td_spa, zilog, bp, &zb, NULL,
     		    td->td_arg);
     	}
     	return (0);
    @@ -182,7 +182,7 @@ traverse_pause(traverse_data_t *td, cons
     
     static void
     traverse_prefetch_metadata(traverse_data_t *td,
    -    arc_buf_t *pbuf, const blkptr_t *bp, const zbookmark_t *zb)
    +    const blkptr_t *bp, const zbookmark_t *zb)
     {
     	uint32_t flags = ARC_NOWAIT | ARC_PREFETCH;
     
    @@ -200,14 +200,13 @@ traverse_prefetch_metadata(traverse_data
     	if (BP_GET_LEVEL(bp) == 0 && BP_GET_TYPE(bp) != DMU_OT_DNODE)
     		return;
     
    -	(void) arc_read(NULL, td->td_spa, bp,
    -	    pbuf, NULL, NULL, ZIO_PRIORITY_ASYNC_READ,
    -	    ZIO_FLAG_CANFAIL, &flags, zb);
    +	(void) arc_read(NULL, td->td_spa, bp, NULL, NULL,
    +	    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
     }
     
     static int
     traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
    -    arc_buf_t *pbuf, const blkptr_t *bp, const zbookmark_t *zb)
    +    const blkptr_t *bp, const zbookmark_t *zb)
     {
     	zbookmark_t czb;
     	int err = 0, lasterr = 0;
    @@ -228,8 +227,7 @@ traverse_visitbp(traverse_data_t *td, co
     	}
     
     	if (BP_IS_HOLE(bp)) {
    -		err = td->td_func(td->td_spa, NULL, NULL, pbuf, zb, dnp,
    -		    td->td_arg);
    +		err = td->td_func(td->td_spa, NULL, NULL, zb, dnp, td->td_arg);
     		return (err);
     	}
     
    @@ -249,7 +247,7 @@ traverse_visitbp(traverse_data_t *td, co
     	}
     
     	if (td->td_flags & TRAVERSE_PRE) {
    -		err = td->td_func(td->td_spa, NULL, bp, pbuf, zb, dnp,
    +		err = td->td_func(td->td_spa, NULL, bp, zb, dnp,
     		    td->td_arg);
     		if (err == TRAVERSE_VISIT_NO_CHILDREN)
     			return (0);
    @@ -265,8 +263,7 @@ traverse_visitbp(traverse_data_t *td, co
     		blkptr_t *cbp;
     		int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT;
     
    -		err = dsl_read(NULL, td->td_spa, bp, pbuf,
    -		    arc_getbuf_func, &buf,
    +		err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf,
     		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
     		if (err)
     			return (err);
    @@ -276,7 +273,7 @@ traverse_visitbp(traverse_data_t *td, co
     			SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object,
     			    zb->zb_level - 1,
     			    zb->zb_blkid * epb + i);
    -			traverse_prefetch_metadata(td, buf, &cbp[i], &czb);
    +			traverse_prefetch_metadata(td, &cbp[i], &czb);
     		}
     
     		/* recursively visitbp() blocks below this */
    @@ -284,7 +281,7 @@ traverse_visitbp(traverse_data_t *td, co
     			SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object,
     			    zb->zb_level - 1,
     			    zb->zb_blkid * epb + i);
    -			err = traverse_visitbp(td, dnp, buf, &cbp[i], &czb);
    +			err = traverse_visitbp(td, dnp, &cbp[i], &czb);
     			if (err) {
     				if (!hard)
     					break;
    @@ -296,21 +293,20 @@ traverse_visitbp(traverse_data_t *td, co
     		int i;
     		int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT;
     
    -		err = dsl_read(NULL, td->td_spa, bp, pbuf,
    -		    arc_getbuf_func, &buf,
    +		err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf,
     		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
     		if (err)
     			return (err);
     		dnp = buf->b_data;
     
     		for (i = 0; i < epb; i++) {
    -			prefetch_dnode_metadata(td, &dnp[i], buf, zb->zb_objset,
    +			prefetch_dnode_metadata(td, &dnp[i], zb->zb_objset,
     			    zb->zb_blkid * epb + i);
     		}
     
     		/* recursively visitbp() blocks below this */
     		for (i = 0; i < epb; i++) {
    -			err = traverse_dnode(td, &dnp[i], buf, zb->zb_objset,
    +			err = traverse_dnode(td, &dnp[i], zb->zb_objset,
     			    zb->zb_blkid * epb + i);
     			if (err) {
     				if (!hard)
    @@ -323,24 +319,23 @@ traverse_visitbp(traverse_data_t *td, co
     		objset_phys_t *osp;
     		dnode_phys_t *dnp;
     
    -		err = dsl_read_nolock(NULL, td->td_spa, bp,
    -		    arc_getbuf_func, &buf,
    +		err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf,
     		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
     		if (err)
     			return (err);
     
     		osp = buf->b_data;
     		dnp = &osp->os_meta_dnode;
    -		prefetch_dnode_metadata(td, dnp, buf, zb->zb_objset,
    +		prefetch_dnode_metadata(td, dnp, zb->zb_objset,
     		    DMU_META_DNODE_OBJECT);
     		if (arc_buf_size(buf) >= sizeof (objset_phys_t)) {
     			prefetch_dnode_metadata(td, &osp->os_userused_dnode,
    -			    buf, zb->zb_objset, DMU_USERUSED_OBJECT);
    +			    zb->zb_objset, DMU_USERUSED_OBJECT);
     			prefetch_dnode_metadata(td, &osp->os_groupused_dnode,
    -			    buf, zb->zb_objset, DMU_USERUSED_OBJECT);
    +			    zb->zb_objset, DMU_USERUSED_OBJECT);
     		}
     
    -		err = traverse_dnode(td, dnp, buf, zb->zb_objset,
    +		err = traverse_dnode(td, dnp, zb->zb_objset,
     		    DMU_META_DNODE_OBJECT);
     		if (err && hard) {
     			lasterr = err;
    @@ -348,7 +343,7 @@ traverse_visitbp(traverse_data_t *td, co
     		}
     		if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) {
     			dnp = &osp->os_userused_dnode;
    -			err = traverse_dnode(td, dnp, buf, zb->zb_objset,
    +			err = traverse_dnode(td, dnp, zb->zb_objset,
     			    DMU_USERUSED_OBJECT);
     		}
     		if (err && hard) {
    @@ -357,7 +352,7 @@ traverse_visitbp(traverse_data_t *td, co
     		}
     		if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) {
     			dnp = &osp->os_groupused_dnode;
    -			err = traverse_dnode(td, dnp, buf, zb->zb_objset,
    +			err = traverse_dnode(td, dnp, zb->zb_objset,
     			    DMU_GROUPUSED_OBJECT);
     		}
     	}
    @@ -367,8 +362,7 @@ traverse_visitbp(traverse_data_t *td, co
     
     post:
     	if (err == 0 && lasterr == 0 && (td->td_flags & TRAVERSE_POST)) {
    -		err = td->td_func(td->td_spa, NULL, bp, pbuf, zb, dnp,
    -		    td->td_arg);
    +		err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg);
     		if (err == ERESTART)
     			pause = B_TRUE;
     	}
    @@ -384,25 +378,25 @@ post:
     
     static void
     prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *dnp,
    -    arc_buf_t *buf, uint64_t objset, uint64_t object)
    +    uint64_t objset, uint64_t object)
     {
     	int j;
     	zbookmark_t czb;
     
     	for (j = 0; j < dnp->dn_nblkptr; j++) {
     		SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j);
    -		traverse_prefetch_metadata(td, buf, &dnp->dn_blkptr[j], &czb);
    +		traverse_prefetch_metadata(td, &dnp->dn_blkptr[j], &czb);
     	}
     
     	if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) {
     		SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID);
    -		traverse_prefetch_metadata(td, buf, &dnp->dn_spill, &czb);
    +		traverse_prefetch_metadata(td, &dnp->dn_spill, &czb);
     	}
     }
     
     static int
     traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp,
    -    arc_buf_t *buf, uint64_t objset, uint64_t object)
    +    uint64_t objset, uint64_t object)
     {
     	int j, err = 0, lasterr = 0;
     	zbookmark_t czb;
    @@ -410,7 +404,7 @@ traverse_dnode(traverse_data_t *td, cons
     
     	for (j = 0; j < dnp->dn_nblkptr; j++) {
     		SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j);
    -		err = traverse_visitbp(td, dnp, buf, &dnp->dn_blkptr[j], &czb);
    +		err = traverse_visitbp(td, dnp, &dnp->dn_blkptr[j], &czb);
     		if (err) {
     			if (!hard)
     				break;
    @@ -420,7 +414,7 @@ traverse_dnode(traverse_data_t *td, cons
     
     	if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) {
     		SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID);
    -		err = traverse_visitbp(td, dnp, buf, &dnp->dn_spill, &czb);
    +		err = traverse_visitbp(td, dnp, &dnp->dn_spill, &czb);
     		if (err) {
     			if (!hard)
     				return (err);
    @@ -433,8 +427,7 @@ traverse_dnode(traverse_data_t *td, cons
     /* ARGSUSED */
     static int
     traverse_prefetcher(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
    -    arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp,
    -    void *arg)
    +    const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	prefetch_data_t *pfd = arg;
     	uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH;
    @@ -455,10 +448,8 @@ traverse_prefetcher(spa_t *spa, zilog_t 
     	cv_broadcast(&pfd->pd_cv);
     	mutex_exit(&pfd->pd_mtx);
     
    -	(void) dsl_read(NULL, spa, bp, pbuf, NULL, NULL,
    -	    ZIO_PRIORITY_ASYNC_READ,
    -	    ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE,
    -	    &aflags, zb);
    +	(void) arc_read(NULL, spa, bp, NULL, NULL, ZIO_PRIORITY_ASYNC_READ,
    +	    ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE, &aflags, zb);
     
     	return (0);
     }
    @@ -476,7 +467,7 @@ traverse_prefetch_thread(void *arg)
     
     	SET_BOOKMARK(&czb, td.td_objset,
     	    ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
    -	(void) traverse_visitbp(&td, NULL, NULL, td.td_rootbp, &czb);
    +	(void) traverse_visitbp(&td, NULL, td.td_rootbp, &czb);
     
     	mutex_enter(&td_main->td_pfd->pd_mtx);
     	td_main->td_pfd->pd_exited = B_TRUE;
    @@ -540,7 +531,7 @@ traverse_impl(spa_t *spa, dsl_dataset_t 
     
     	SET_BOOKMARK(&czb, td.td_objset,
     	    ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
    -	err = traverse_visitbp(&td, NULL, NULL, rootbp, &czb);
    +	err = traverse_visitbp(&td, NULL, rootbp, &czb);
     
     	mutex_enter(&pd.pd_mtx);
     	pd.pd_cancel = B_TRUE;
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -21,7 +21,7 @@
     /*
      * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
      * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
    - * Copyright (c) 2012 by Delphix. All rights reserved.
    + * Copyright (c) 2013 by Delphix. All rights reserved.
      */
     
     #include 
    @@ -284,6 +284,7 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u
     			delta = P2NPHASE(off, dn->dn_datablksz);
     		}
     
    +		min_ibs = max_ibs = dn->dn_indblkshift;
     		if (dn->dn_maxblkid > 0) {
     			/*
     			 * The blocksize can't change,
    @@ -291,13 +292,6 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u
     			 */
     			ASSERT(dn->dn_datablkshift != 0);
     			min_bs = max_bs = dn->dn_datablkshift;
    -			min_ibs = max_ibs = dn->dn_indblkshift;
    -		} else if (dn->dn_indblkshift > max_ibs) {
    -			/*
    -			 * This ensures that if we reduce DN_MAX_INDBLKSHIFT,
    -			 * the code will still work correctly on older pools.
    -			 */
    -			min_ibs = max_ibs = dn->dn_indblkshift;
     		}
     
     		/*
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -1308,7 +1308,7 @@ struct killarg {
     
     /* ARGSUSED */
     static int
    -kill_blkptr(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
    +kill_blkptr(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
         const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	struct killarg *ka = arg;
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -396,24 +396,6 @@ dsl_free_sync(zio_t *pio, dsl_pool_t *dp
     	zio_nowait(zio_free_sync(pio, dp->dp_spa, txg, bpp, pio->io_flags));
     }
     
    -int
    -dsl_read(zio_t *pio, spa_t *spa, const blkptr_t *bpp, arc_buf_t *pbuf,
    -    arc_done_func_t *done, void *private, int priority, int zio_flags,
    -    uint32_t *arc_flags, const zbookmark_t *zb)
    -{
    -	return (arc_read(pio, spa, bpp, pbuf, done, private,
    -	    priority, zio_flags, arc_flags, zb));
    -}
    -
    -int
    -dsl_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bpp,
    -    arc_done_func_t *done, void *private, int priority, int zio_flags,
    -    uint32_t *arc_flags, const zbookmark_t *zb)
    -{
    -	return (arc_read_nolock(pio, spa, bpp, done, private,
    -	    priority, zio_flags, arc_flags, zb));
    -}
    -
     static uint64_t
     dsl_scan_ds_maxtxg(dsl_dataset_t *ds)
     {
    @@ -584,12 +566,8 @@ dsl_scan_prefetch(dsl_scan_t *scn, arc_b
     
     	SET_BOOKMARK(&czb, objset, object, BP_GET_LEVEL(bp), blkid);
     
    -	/*
    -	 * XXX need to make sure all of these arc_read() prefetches are
    -	 * done before setting xlateall (similar to dsl_read())
    -	 */
     	(void) arc_read(scn->scn_zio_root, scn->scn_dp->dp_spa, bp,
    -	    buf, NULL, NULL, ZIO_PRIORITY_ASYNC_READ,
    +	    NULL, NULL, ZIO_PRIORITY_ASYNC_READ,
     	    ZIO_FLAG_CANFAIL | ZIO_FLAG_SCAN_THREAD, &flags, &czb);
     }
     
    @@ -647,8 +625,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da
     		blkptr_t *cbp;
     		int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT;
     
    -		err = arc_read_nolock(NULL, dp->dp_spa, bp,
    -		    arc_getbuf_func, bufp,
    +		err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp,
     		    ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
     		if (err) {
     			scn->scn_phys.scn_errors++;
    @@ -670,8 +647,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da
     	} else if (BP_GET_TYPE(bp) == DMU_OT_USERGROUP_USED) {
     		uint32_t flags = ARC_WAIT;
     
    -		err = arc_read_nolock(NULL, dp->dp_spa, bp,
    -		    arc_getbuf_func, bufp,
    +		err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp,
     		    ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
     		if (err) {
     			scn->scn_phys.scn_errors++;
    @@ -683,8 +659,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da
     		int i, j;
     		int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT;
     
    -		err = arc_read_nolock(NULL, dp->dp_spa, bp,
    -		    arc_getbuf_func, bufp,
    +		err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp,
     		    ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
     		if (err) {
     			scn->scn_phys.scn_errors++;
    @@ -706,8 +681,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da
     		uint32_t flags = ARC_WAIT;
     		objset_phys_t *osp;
     
    -		err = arc_read_nolock(NULL, dp->dp_spa, bp,
    -		    arc_getbuf_func, bufp,
    +		err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp,
     		    ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb);
     		if (err) {
     			scn->scn_phys.scn_errors++;
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -21,6 +21,7 @@
     /*
      * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
      * Copyright (c) 2012 by Delphix. All rights reserved.
    + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
      */
     
     #include 
    @@ -97,6 +98,15 @@ int metaslab_prefetch_limit = SPA_DVAS_P
     int metaslab_smo_bonus_pct = 150;
     
     /*
    + * Should we be willing to write data to degraded vdevs?
    + */
    +boolean_t zfs_write_to_degraded = B_FALSE;
    +SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RW,
    +    &zfs_write_to_degraded, 0,
    +    "Allow writing data to degraded vdevs");
    +TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded);
    +
    +/*
      * ==========================================================================
      * Metaslab classes
      * ==========================================================================
    @@ -1383,10 +1393,13 @@ top:
     
     		/*
     		 * Avoid writing single-copy data to a failing vdev
    +		 * unless the user instructs us that it is okay.
     		 */
     		if ((vd->vdev_stat.vs_write_errors > 0 ||
     		    vd->vdev_state < VDEV_STATE_HEALTHY) &&
    -		    d == 0 && dshift == 3) {
    +		    d == 0 && dshift == 3 &&
    +		    !(zfs_write_to_degraded && vd->vdev_state ==
    +		    VDEV_STATE_DEGRADED)) {
     			all_zero = B_FALSE;
     			goto next;
     		}
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -553,6 +553,7 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_
     {
     	int var_size = 0;
     	int i;
    +	int j = -1;
     	int full_space;
     	int hdrsize;
     	boolean_t done = B_FALSE;
    @@ -574,11 +575,13 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_
     	    sizeof (sa_hdr_phys_t);
     
     	full_space = (buftype == SA_BONUS) ? DN_MAX_BONUSLEN : db->db_size;
    +	ASSERT(IS_P2ALIGNED(full_space, 8));
     
     	for (i = 0; i != attr_count; i++) {
     		boolean_t is_var_sz;
     
    -		*total += P2ROUNDUP(attr_desc[i].sa_length, 8);
    +		*total = P2ROUNDUP(*total, 8);
    +		*total += attr_desc[i].sa_length;
     		if (done)
     			goto next;
     
    @@ -590,7 +593,14 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_
     		if (is_var_sz && var_size > 1) {
     			if (P2ROUNDUP(hdrsize + sizeof (uint16_t), 8) +
     			    *total < full_space) {
    +				/*
    +				 * Account for header space used by array of
    +				 * optional sizes of variable-length attributes.
    +				 * Record the index in case this increase needs
    +				 * to be reversed due to spill-over.
    +				 */
     				hdrsize += sizeof (uint16_t);
    +				j = i;
     			} else {
     				done = B_TRUE;
     				*index = i;
    @@ -619,6 +629,14 @@ next:
     			*will_spill = B_TRUE;
     	}
     
    +	/*
    +	 * j holds the index of the last variable-sized attribute for
    +	 * which hdrsize was increased.  Reverse the increase if that
    +	 * attribute will be relocated to the spill block.
    +	 */
    +	if (*will_spill && j == *index)
    +		hdrsize -= sizeof (uint16_t);
    +
     	hdrsize = P2ROUNDUP(hdrsize, 8);
     	return (hdrsize);
     }
    @@ -709,6 +727,8 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu
     	for (i = 0, len_idx = 0, hash = -1ULL; i != attr_count; i++) {
     		uint16_t length;
     
    +		ASSERT(IS_P2ALIGNED(data_start, 8));
    +		ASSERT(IS_P2ALIGNED(buf_space, 8));
     		attrs[i] = attr_desc[i].sa_attr;
     		length = SA_REGISTERED_LEN(sa, attrs[i]);
     		if (length == 0)
    @@ -717,6 +737,7 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu
     			VERIFY(length == attr_desc[i].sa_length);
     
     		if (buf_space < length) {  /* switch to spill buffer */
    +			VERIFY(spilling);
     			VERIFY(bonustype == DMU_OT_SA);
     			if (buftype == SA_BONUS && !sa->sa_force_spill) {
     				sa_find_layout(hdl->sa_os, hash, attrs_start,
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -1764,7 +1764,7 @@ spa_load_verify_done(zio_t *zio)
     /*ARGSUSED*/
     static int
     spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
    -    arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
    +    const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
     {
     	if (bp != NULL) {
     		zio_t *rio = arg;
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -49,7 +49,6 @@ struct arc_buf {
     	arc_buf_hdr_t		*b_hdr;
     	arc_buf_t		*b_next;
     	kmutex_t		b_evict_lock;
    -	krwlock_t		b_data_lock;
     	void			*b_data;
     	arc_evict_func_t	*b_efunc;
     	void			*b_private;
    @@ -93,8 +92,6 @@ void arc_buf_add_ref(arc_buf_t *buf, voi
     int arc_buf_remove_ref(arc_buf_t *buf, void *tag);
     int arc_buf_size(arc_buf_t *buf);
     void arc_release(arc_buf_t *buf, void *tag);
    -int arc_release_bp(arc_buf_t *buf, void *tag, blkptr_t *bp, spa_t *spa,
    -    zbookmark_t *zb);
     int arc_released(arc_buf_t *buf);
     int arc_has_callback(arc_buf_t *buf);
     void arc_buf_freeze(arc_buf_t *buf);
    @@ -103,10 +100,7 @@ void arc_buf_thaw(arc_buf_t *buf);
     int arc_referenced(arc_buf_t *buf);
     #endif
     
    -int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_buf_t *pbuf,
    -    arc_done_func_t *done, void *priv, int priority, int zio_flags,
    -    uint32_t *arc_flags, const zbookmark_t *zb);
    -int arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp,
    +int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp,
         arc_done_func_t *done, void *priv, int priority, int flags,
         uint32_t *arc_flags, const zbookmark_t *zb);
     zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg,
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -40,8 +40,7 @@ struct zilog;
     struct arc_buf;
     
     typedef int (blkptr_cb_t)(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
    -    struct arc_buf *pbuf, const zbookmark_t *zb, const struct dnode_phys *dnp,
    -    void *arg);
    +    const zbookmark_t *zb, const struct dnode_phys *dnp, void *arg);
     
     #define	TRAVERSE_PRE			(1<<0)
     #define	TRAVERSE_POST			(1<<1)
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -134,12 +134,6 @@ void dsl_pool_willuse_space(dsl_pool_t *
     void dsl_free(dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp);
     void dsl_free_sync(zio_t *pio, dsl_pool_t *dp, uint64_t txg,
         const blkptr_t *bpp);
    -int dsl_read(zio_t *pio, spa_t *spa, const blkptr_t *bpp, arc_buf_t *pbuf,
    -    arc_done_func_t *done, void *priv, int priority, int zio_flags,
    -    uint32_t *arc_flags, const zbookmark_t *zb);
    -int dsl_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bpp,
    -    arc_done_func_t *done, void *priv, int priority, int zio_flags,
    -    uint32_t *arc_flags, const zbookmark_t *zb);
     void dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx);
     void dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx);
     void dsl_pool_upgrade_dir_clones(dsl_pool_t *dp, dmu_tx_t *tx);
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -20,6 +20,7 @@
      */
     /*
      * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2012 by Delphix. All rights reserved.
      */
     
     #ifndef	_SYS_REFCOUNT_H
    @@ -54,8 +55,8 @@ typedef struct refcount {
     	kmutex_t rc_mtx;
     	list_t rc_list;
     	list_t rc_removed;
    -	int64_t rc_count;
    -	int64_t rc_removed_count;
    +	uint64_t rc_count;
    +	uint64_t rc_removed_count;
     } refcount_t;
     
     /* Note: refcount_t must be initialized with refcount_create() */
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -1328,7 +1328,8 @@ vdev_validate(vdev_t *vd, boolean_t stri
     	if (vd->vdev_ops->vdev_op_leaf && vdev_readable(vd)) {
     		uint64_t aux_guid = 0;
     		nvlist_t *nvl;
    -		uint64_t txg = strict ? spa->spa_config_txg : -1ULL;
    +		uint64_t txg = spa_last_synced_txg(spa) != 0 ?
    +		    spa_last_synced_txg(spa) : -1ULL;
     
     		if ((label = vdev_label_read_config(vd, txg)) == NULL) {
     			vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN,
    @@ -1512,7 +1513,7 @@ vdev_reopen(vdev_t *vd)
     		    !l2arc_vdev_present(vd))
     			l2arc_add_vdev(spa, vd);
     	} else {
    -		(void) vdev_validate(vd, spa_last_synced_txg(spa));
    +		(void) vdev_validate(vd, B_TRUE);
     	}
     
     	/*
    
    Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
    ==============================================================================
    --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Wed Feb 27 19:20:50 2013	(r247406)
    +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Wed Feb 27 19:22:27 2013	(r247407)
    @@ -106,12 +106,18 @@ typedef enum {
     	DATASET_NAME
     } zfs_ioc_namecheck_t;
     
    +typedef enum {
    +	POOL_CHECK_NONE		= 1 << 0,
    +	POOL_CHECK_SUSPENDED	= 1 << 1,
    +	POOL_CHECK_READONLY	= 1 << 2
    +} zfs_ioc_poolcheck_t;
    +
     typedef struct zfs_ioc_vec {
     	zfs_ioc_func_t		*zvec_func;
     	zfs_secpolicy_func_t	*zvec_secpolicy;
     	zfs_ioc_namecheck_t	zvec_namecheck;
     	boolean_t		zvec_his_log;
    -	boolean_t		zvec_pool_check;
    +	zfs_ioc_poolcheck_t	zvec_pool_check;
     } zfs_ioc_vec_t;
     
     /* This array is indexed by zfs_userquota_prop_t */
    @@ -5033,138 +5039,155 @@ zfs_ioc_unjail(zfs_cmd_t *zc)
     
     static zfs_ioc_vec_t zfs_ioc_vec[] = {
     	{ zfs_ioc_pool_create, zfs_secpolicy_config, POOL_NAME, B_FALSE,
    -	    B_FALSE },
    +	    POOL_CHECK_NONE },
     	{ zfs_ioc_pool_destroy,	zfs_secpolicy_config, POOL_NAME, B_FALSE,
    -	    B_FALSE },
    +	    POOL_CHECK_NONE },
     	{ zfs_ioc_pool_import, zfs_secpolicy_config, POOL_NAME, B_TRUE,
    -	    B_FALSE },
    +	    POOL_CHECK_NONE },
     	{ zfs_ioc_pool_export, zfs_secpolicy_config, POOL_NAME, B_FALSE,
    -	    B_FALSE },
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 19:38:26 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 37B05140;
     Wed, 27 Feb 2013 19:38:26 +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 19E489FA;
     Wed, 27 Feb 2013 19:38:26 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RJcPtG076767;
     Wed, 27 Feb 2013 19:38:25 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RJcPCh076765;
     Wed, 27 Feb 2013 19:38:25 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302271938.r1RJcPCh076765@svn.freebsd.org>
    From: John Baldwin 
    Date: Wed, 27 Feb 2013 19:38: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: r247408 - stable/9/usr.sbin/pciconf
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 19:38:26 -0000
    
    Author: jhb
    Date: Wed Feb 27 19:38:25 2013
    New Revision: 247408
    URL: http://svnweb.freebsd.org/changeset/base/247408
    
    Log:
      MFC 240474:
      - Denote PCI-e endpoints that support FLR.
      - Make parsing of PCI-e extended capabilities assume that future version
        numbers are backwards compatible.
      - Add new AER error descriptions.
      - Add descriptions for more PCI-e extended capabilities.
    
    Modified:
      stable/9/usr.sbin/pciconf/cap.c
      stable/9/usr.sbin/pciconf/err.c
    Directory Properties:
      stable/9/usr.sbin/pciconf/   (props changed)
    
    Modified: stable/9/usr.sbin/pciconf/cap.c
    ==============================================================================
    --- stable/9/usr.sbin/pciconf/cap.c	Wed Feb 27 19:22:27 2013	(r247407)
    +++ stable/9/usr.sbin/pciconf/cap.c	Wed Feb 27 19:38:25 2013	(r247408)
    @@ -428,6 +428,8 @@ cap_express(int fd, struct pci_conf *p, 
     	printf(" max data %d(%d)",
     	    MAX_PAYLOAD((flags & PCIEM_CTL_MAX_PAYLOAD) >> 5),
     	    MAX_PAYLOAD(val & PCIEM_CAP_MAX_PAYLOAD));
    +	if (val & PCIEM_CAP_FLR)
    +		printf(" FLR");
     	val = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4);
     	flags = read_config(fd, &p->pc_sel, ptr+ PCIER_LINK_STA, 2);
     	printf(" link x%d(x%d)", (flags & PCIEM_LINK_STA_WIDTH) >> 4,
    @@ -587,7 +589,7 @@ ecap_aer(int fd, struct pci_conf *p, uin
     	uint32_t sta, mask;
     
     	printf("AER %d", ver);
    -	if (ver != 1)
    +	if (ver < 1)
     		return;
     	sta = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_STATUS, 4);
     	mask = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_SEVERITY, 4);
    @@ -603,7 +605,7 @@ ecap_vc(int fd, struct pci_conf *p, uint
     	uint32_t cap1;
     
     	printf("VC %d", ver);
    -	if (ver != 1)
    +	if (ver < 1)
     		return;
     	cap1 = read_config(fd, &p->pc_sel, ptr + PCIR_VC_CAP1, 4);
     	printf(" max VC%d", cap1 & PCIM_VC_CAP1_EXT_COUNT);
    @@ -618,7 +620,7 @@ ecap_sernum(int fd, struct pci_conf *p, 
     	uint32_t high, low;
     
     	printf("Serial %d", ver);
    -	if (ver != 1)
    +	if (ver < 1)
     		return;
     	low = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_LOW, 4);
     	high = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_HIGH, 4);
    @@ -626,10 +628,58 @@ ecap_sernum(int fd, struct pci_conf *p, 
     }
     
     static void
    +ecap_vendor(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
    +{
    +	uint32_t val;
    +
    +	printf("Vendor %d", ver);
    +	if (ver < 1)
    +		return;
    +	val = read_config(fd, &p->pc_sel, ptr + 4, 4);
    +	printf(" ID %d", val & 0xffff);
    +}
    +
    +static void
    +ecap_sec_pcie(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
    +{
    +	uint32_t val;
    +
    +	printf("PCIe Sec %d", ver);
    +	if (ver < 1)
    +		return;
    +	val = read_config(fd, &p->pc_sel, ptr + 8, 4);
    +	printf(" lane errors %#x", val);
    +}
    +
    +struct {
    +	uint16_t id;
    +	const char *name;
    +} ecap_names[] = {
    +	{ PCIZ_PWRBDGT, "Power Budgeting" },
    +	{ PCIZ_RCLINK_DCL, "Root Complex Link Declaration" },
    +	{ PCIZ_RCLINK_CTL, "Root Complex Internal Link Control" },
    +	{ PCIZ_RCEC_ASSOC, "Root Complex Event Collector ASsociation" },
    +	{ PCIZ_MFVC, "MFVC" },
    +	{ PCIZ_RCRB, "RCRB" },
    +	{ PCIZ_ACS, "ACS" },
    +	{ PCIZ_ARI, "ARI" },
    +	{ PCIZ_ATS, "ATS" },
    +	{ PCIZ_SRIOV, "SRIOV" },
    +	{ PCIZ_MULTICAST, "Multicast" },
    +	{ PCIZ_RESIZE_BAR, "Resizable BAR" },
    +	{ PCIZ_DPA, "DPA" },
    +	{ PCIZ_TPH_REQ, "TPH Requester" },
    +	{ PCIZ_LTR, "LTR" },
    +	{ 0, NULL }
    +};
    +
    +static void
     list_ecaps(int fd, struct pci_conf *p)
     {
    +	const char *name;
     	uint32_t ecap;
     	uint16_t ptr;
    +	int i;
     
     	ptr = PCIR_EXTCAP;
     	ecap = read_config(fd, &p->pc_sel, ptr, 4);
    @@ -647,8 +697,20 @@ list_ecaps(int fd, struct pci_conf *p)
     		case PCIZ_SERNUM:
     			ecap_sernum(fd, p, ptr, PCI_EXTCAP_VER(ecap));
     			break;
    +		case PCIZ_VENDOR:
    +			ecap_vendor(fd, p, ptr, PCI_EXTCAP_VER(ecap));
    +			break;
    +		case PCIZ_SEC_PCIE:
    +			ecap_sec_pcie(fd, p, ptr, PCI_EXTCAP_VER(ecap));
    +			break;
     		default:
    -			printf("unknown %d", PCI_EXTCAP_VER(ecap));
    +			name = "unknown";
    +			for (i = 0; ecap_names[i].name != NULL; i++)
    +				if (ecap_names[i].id == PCI_EXTCAP_ID(ecap)) {
    +					name = ecap_names[i].name;
    +					break;
    +				}
    +			printf("%s %d", name, PCI_EXTCAP_VER(ecap));
     			break;
     		}
     		printf("\n");
    
    Modified: stable/9/usr.sbin/pciconf/err.c
    ==============================================================================
    --- stable/9/usr.sbin/pciconf/err.c	Wed Feb 27 19:22:27 2013	(r247407)
    +++ stable/9/usr.sbin/pciconf/err.c	Wed Feb 27 19:38:25 2013	(r247408)
    @@ -91,6 +91,10 @@ static struct bit_table aer_uc[] = {
     	{ PCIM_AER_UC_ECRC_ERROR, "ECRC Error" },
     	{ PCIM_AER_UC_UNSUPPORTED_REQUEST, "Unsupported Request" },
     	{ PCIM_AER_UC_ACS_VIOLATION, "ACS Violation" },
    +	{ PCIM_AER_UC_INTERNAL_ERROR, "Uncorrectable Internal Error" },
    +	{ PCIM_AER_UC_MC_BLOCKED_TLP, "MC Blocked TLP" },
    +	{ PCIM_AER_UC_ATOMIC_EGRESS_BLK, "AtomicOp Egress Blocked" },
    +	{ PCIM_AER_UC_TLP_PREFIX_BLOCKED, "TLP Prefix Blocked Error" },
     	{ 0, NULL },
     };
     
    @@ -102,6 +106,8 @@ static struct bit_table aer_cor[] = {
     	{ PCIM_AER_COR_REPLAY_ROLLOVER, "REPLAY_NUM Rollover" },
     	{ PCIM_AER_COR_REPLAY_TIMEOUT, "Replay Timer Timeout" },
     	{ PCIM_AER_COR_ADVISORY_NF_ERROR, "Advisory Non-Fatal Error" },
    +	{ PCIM_AER_COR_INTERNAL_ERROR, "Corrected Internal Error" },
    +	{ PCIM_AER_COR_HEADER_LOG_OVFLOW, "Header Log Overflow" },
     	{ 0, NULL },
     };
     
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 19:38:34 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 8A308293;
     Wed, 27 Feb 2013 19:38:34 +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 6D1449FC;
     Wed, 27 Feb 2013 19:38:34 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RJcYS0076823;
     Wed, 27 Feb 2013 19:38:34 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RJcYCC076821;
     Wed, 27 Feb 2013 19:38:34 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302271938.r1RJcYCC076821@svn.freebsd.org>
    From: John Baldwin 
    Date: Wed, 27 Feb 2013 19:38:34 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247409 - stable/8/usr.sbin/pciconf
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 19:38:34 -0000
    
    Author: jhb
    Date: Wed Feb 27 19:38:33 2013
    New Revision: 247409
    URL: http://svnweb.freebsd.org/changeset/base/247409
    
    Log:
      MFC 240474:
      - Denote PCI-e endpoints that support FLR.
      - Make parsing of PCI-e extended capabilities assume that future version
        numbers are backwards compatible.
      - Add new AER error descriptions.
      - Add descriptions for more PCI-e extended capabilities.
    
    Modified:
      stable/8/usr.sbin/pciconf/cap.c
      stable/8/usr.sbin/pciconf/err.c
    Directory Properties:
      stable/8/usr.sbin/pciconf/   (props changed)
    
    Modified: stable/8/usr.sbin/pciconf/cap.c
    ==============================================================================
    --- stable/8/usr.sbin/pciconf/cap.c	Wed Feb 27 19:38:25 2013	(r247408)
    +++ stable/8/usr.sbin/pciconf/cap.c	Wed Feb 27 19:38:33 2013	(r247409)
    @@ -428,6 +428,8 @@ cap_express(int fd, struct pci_conf *p, 
     	printf(" max data %d(%d)",
     	    MAX_PAYLOAD((flags & PCIEM_CTL_MAX_PAYLOAD) >> 5),
     	    MAX_PAYLOAD(val & PCIEM_CAP_MAX_PAYLOAD));
    +	if (val & PCIEM_CAP_FLR)
    +		printf(" FLR");
     	val = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4);
     	flags = read_config(fd, &p->pc_sel, ptr+ PCIER_LINK_STA, 2);
     	printf(" link x%d(x%d)", (flags & PCIEM_LINK_STA_WIDTH) >> 4,
    @@ -587,7 +589,7 @@ ecap_aer(int fd, struct pci_conf *p, uin
     	uint32_t sta, mask;
     
     	printf("AER %d", ver);
    -	if (ver != 1)
    +	if (ver < 1)
     		return;
     	sta = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_STATUS, 4);
     	mask = read_config(fd, &p->pc_sel, ptr + PCIR_AER_UC_SEVERITY, 4);
    @@ -603,7 +605,7 @@ ecap_vc(int fd, struct pci_conf *p, uint
     	uint32_t cap1;
     
     	printf("VC %d", ver);
    -	if (ver != 1)
    +	if (ver < 1)
     		return;
     	cap1 = read_config(fd, &p->pc_sel, ptr + PCIR_VC_CAP1, 4);
     	printf(" max VC%d", cap1 & PCIM_VC_CAP1_EXT_COUNT);
    @@ -618,7 +620,7 @@ ecap_sernum(int fd, struct pci_conf *p, 
     	uint32_t high, low;
     
     	printf("Serial %d", ver);
    -	if (ver != 1)
    +	if (ver < 1)
     		return;
     	low = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_LOW, 4);
     	high = read_config(fd, &p->pc_sel, ptr + PCIR_SERIAL_HIGH, 4);
    @@ -626,10 +628,58 @@ ecap_sernum(int fd, struct pci_conf *p, 
     }
     
     static void
    +ecap_vendor(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
    +{
    +	uint32_t val;
    +
    +	printf("Vendor %d", ver);
    +	if (ver < 1)
    +		return;
    +	val = read_config(fd, &p->pc_sel, ptr + 4, 4);
    +	printf(" ID %d", val & 0xffff);
    +}
    +
    +static void
    +ecap_sec_pcie(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
    +{
    +	uint32_t val;
    +
    +	printf("PCIe Sec %d", ver);
    +	if (ver < 1)
    +		return;
    +	val = read_config(fd, &p->pc_sel, ptr + 8, 4);
    +	printf(" lane errors %#x", val);
    +}
    +
    +struct {
    +	uint16_t id;
    +	const char *name;
    +} ecap_names[] = {
    +	{ PCIZ_PWRBDGT, "Power Budgeting" },
    +	{ PCIZ_RCLINK_DCL, "Root Complex Link Declaration" },
    +	{ PCIZ_RCLINK_CTL, "Root Complex Internal Link Control" },
    +	{ PCIZ_RCEC_ASSOC, "Root Complex Event Collector ASsociation" },
    +	{ PCIZ_MFVC, "MFVC" },
    +	{ PCIZ_RCRB, "RCRB" },
    +	{ PCIZ_ACS, "ACS" },
    +	{ PCIZ_ARI, "ARI" },
    +	{ PCIZ_ATS, "ATS" },
    +	{ PCIZ_SRIOV, "SRIOV" },
    +	{ PCIZ_MULTICAST, "Multicast" },
    +	{ PCIZ_RESIZE_BAR, "Resizable BAR" },
    +	{ PCIZ_DPA, "DPA" },
    +	{ PCIZ_TPH_REQ, "TPH Requester" },
    +	{ PCIZ_LTR, "LTR" },
    +	{ 0, NULL }
    +};
    +
    +static void
     list_ecaps(int fd, struct pci_conf *p)
     {
    +	const char *name;
     	uint32_t ecap;
     	uint16_t ptr;
    +	int i;
     
     	ptr = PCIR_EXTCAP;
     	ecap = read_config(fd, &p->pc_sel, ptr, 4);
    @@ -647,8 +697,20 @@ list_ecaps(int fd, struct pci_conf *p)
     		case PCIZ_SERNUM:
     			ecap_sernum(fd, p, ptr, PCI_EXTCAP_VER(ecap));
     			break;
    +		case PCIZ_VENDOR:
    +			ecap_vendor(fd, p, ptr, PCI_EXTCAP_VER(ecap));
    +			break;
    +		case PCIZ_SEC_PCIE:
    +			ecap_sec_pcie(fd, p, ptr, PCI_EXTCAP_VER(ecap));
    +			break;
     		default:
    -			printf("unknown %d", PCI_EXTCAP_VER(ecap));
    +			name = "unknown";
    +			for (i = 0; ecap_names[i].name != NULL; i++)
    +				if (ecap_names[i].id == PCI_EXTCAP_ID(ecap)) {
    +					name = ecap_names[i].name;
    +					break;
    +				}
    +			printf("%s %d", name, PCI_EXTCAP_VER(ecap));
     			break;
     		}
     		printf("\n");
    
    Modified: stable/8/usr.sbin/pciconf/err.c
    ==============================================================================
    --- stable/8/usr.sbin/pciconf/err.c	Wed Feb 27 19:38:25 2013	(r247408)
    +++ stable/8/usr.sbin/pciconf/err.c	Wed Feb 27 19:38:33 2013	(r247409)
    @@ -91,6 +91,10 @@ static struct bit_table aer_uc[] = {
     	{ PCIM_AER_UC_ECRC_ERROR, "ECRC Error" },
     	{ PCIM_AER_UC_UNSUPPORTED_REQUEST, "Unsupported Request" },
     	{ PCIM_AER_UC_ACS_VIOLATION, "ACS Violation" },
    +	{ PCIM_AER_UC_INTERNAL_ERROR, "Uncorrectable Internal Error" },
    +	{ PCIM_AER_UC_MC_BLOCKED_TLP, "MC Blocked TLP" },
    +	{ PCIM_AER_UC_ATOMIC_EGRESS_BLK, "AtomicOp Egress Blocked" },
    +	{ PCIM_AER_UC_TLP_PREFIX_BLOCKED, "TLP Prefix Blocked Error" },
     	{ 0, NULL },
     };
     
    @@ -102,6 +106,8 @@ static struct bit_table aer_cor[] = {
     	{ PCIM_AER_COR_REPLAY_ROLLOVER, "REPLAY_NUM Rollover" },
     	{ PCIM_AER_COR_REPLAY_TIMEOUT, "Replay Timer Timeout" },
     	{ PCIM_AER_COR_ADVISORY_NF_ERROR, "Advisory Non-Fatal Error" },
    +	{ PCIM_AER_COR_INTERNAL_ERROR, "Corrected Internal Error" },
    +	{ PCIM_AER_COR_HEADER_LOG_OVFLOW, "Header Log Overflow" },
     	{ 0, NULL },
     };
     
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 19:50:49 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 1F5BA5E7;
     Wed, 27 Feb 2013 19:50:49 +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 020D1A73;
     Wed, 27 Feb 2013 19:50:49 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RJomFg081640;
     Wed, 27 Feb 2013 19:50:48 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RJokPe081626;
     Wed, 27 Feb 2013 19:50:46 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302271950.r1RJokPe081626@svn.freebsd.org>
    From: John Baldwin 
    Date: Wed, 27 Feb 2013 19:50:46 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247411 - in head: include lib/libc/stdio
     tools/regression/lib/libc/stdio
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 19:50:49 -0000
    
    Author: jhb
    Date: Wed Feb 27 19:50:46 2013
    New Revision: 247411
    URL: http://svnweb.freebsd.org/changeset/base/247411
    
    Log:
      Add an implementation of open_memstream() and open_wmemstream().  These
      routines provide write-only stdio FILE objects that store their data in a
      dynamically allocated buffer.  They are a string builder interface somewhat
      akin to a completely dynamic sbuf.
      
      Reviewed by:	bde, jilles (earlier versions)
      MFC after:	1 month
    
    Added:
      head/lib/libc/stdio/open_memstream.3   (contents, props changed)
      head/lib/libc/stdio/open_memstream.c   (contents, props changed)
      head/lib/libc/stdio/open_wmemstream.c   (contents, props changed)
      head/tools/regression/lib/libc/stdio/test-open_memstream.c   (contents, props changed)
      head/tools/regression/lib/libc/stdio/test-open_memstream.t   (contents, props changed)
      head/tools/regression/lib/libc/stdio/test-open_wmemstream.c   (contents, props changed)
      head/tools/regression/lib/libc/stdio/test-open_wmemstream.t   (contents, props changed)
    Modified:
      head/include/stdio.h
      head/include/wchar.h
      head/lib/libc/stdio/Makefile.inc
      head/lib/libc/stdio/Symbol.map
      head/tools/regression/lib/libc/stdio/Makefile
    
    Modified: head/include/stdio.h
    ==============================================================================
    --- head/include/stdio.h	Wed Feb 27 19:49:14 2013	(r247410)
    +++ head/include/stdio.h	Wed Feb 27 19:50:46 2013	(r247411)
    @@ -346,6 +346,7 @@ char	*tempnam(const char *, const char *
     FILE	*fmemopen(void * __restrict, size_t, const char * __restrict);
     ssize_t	 getdelim(char ** __restrict, size_t * __restrict, int,
     	    FILE * __restrict);
    +FILE	*open_memstream(char **, size_t *);
     int	 renameat(int, const char *, int, const char *);
     int	 vdprintf(int, const char * __restrict, __va_list);
     
    
    Modified: head/include/wchar.h
    ==============================================================================
    --- head/include/wchar.h	Wed Feb 27 19:49:14 2013	(r247410)
    +++ head/include/wchar.h	Wed Feb 27 19:50:46 2013	(r247411)
    @@ -207,6 +207,7 @@ int	wcwidth(wchar_t);
     #if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
     size_t	mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
     	    size_t, mbstate_t * __restrict);
    +FILE	*open_wmemstream(wchar_t **, size_t *);
     wchar_t	*wcpcpy(wchar_t * __restrict, const wchar_t * __restrict);
     wchar_t	*wcpncpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
     wchar_t	*wcsdup(const wchar_t *) __malloc_like;
    
    Modified: head/lib/libc/stdio/Makefile.inc
    ==============================================================================
    --- head/lib/libc/stdio/Makefile.inc	Wed Feb 27 19:49:14 2013	(r247410)
    +++ head/lib/libc/stdio/Makefile.inc	Wed Feb 27 19:50:46 2013	(r247411)
    @@ -14,6 +14,7 @@ SRCS+=	_flock_stub.c asprintf.c clrerr.c
     	ftell.c funopen.c fvwrite.c fwalk.c fwide.c fwprintf.c fwscanf.c \
     	fwrite.c getc.c getchar.c getdelim.c getline.c \
     	gets.c getw.c getwc.c getwchar.c makebuf.c mktemp.c \
    +	open_memstream.c open_wmemstream.c \
     	perror.c printf.c printf-pos.c putc.c putchar.c \
     	puts.c putw.c putwc.c putwchar.c \
     	refill.c remove.c rewind.c rget.c scanf.c setbuf.c setbuffer.c \
    @@ -36,7 +37,7 @@ MAN+=	fclose.3 ferror.3 fflush.3 fgetln.
     	flockfile.3 \
     	fopen.3 fputs.3 \
     	fputws.3 fread.3 fseek.3 funopen.3 fwide.3 getc.3 \
    -	getline.3 getwc.3 mktemp.3 \
    +	getline.3 getwc.3 mktemp.3 open_memstream.3 \
     	printf.3 printf_l.3 putc.3 putwc.3 remove.3 scanf.3 scanf_l.3 setbuf.3 \
     	stdio.3 tmpnam.3 \
     	ungetc.3 ungetwc.3 wprintf.3 wscanf.3
    @@ -60,6 +61,7 @@ MLINKS+=getc.3 fgetc.3 getc.3 getc_unloc
     MLINKS+=getline.3 getdelim.3
     MLINKS+=getwc.3 fgetwc.3 getwc.3 getwchar.3
     MLINKS+=mktemp.3 mkdtemp.3 mktemp.3 mkstemp.3 mktemp.3 mkstemps.3
    +MLINKS+=open_memstream.3 open_wmemstream.3
     MLINKS+=printf.3 asprintf.3 printf.3 dprintf.3 printf.3 fprintf.3 \
     	printf.3 snprintf.3 printf.3 sprintf.3 \
     	printf.3 vasprintf.3 printf.3 vdprintf.3 \
    
    Modified: head/lib/libc/stdio/Symbol.map
    ==============================================================================
    --- head/lib/libc/stdio/Symbol.map	Wed Feb 27 19:49:14 2013	(r247410)
    +++ head/lib/libc/stdio/Symbol.map	Wed Feb 27 19:50:46 2013	(r247411)
    @@ -156,6 +156,8 @@ FBSD_1.3 {
     	putwc_l;
     	putwchar_l;
     	fmemopen;
    +	open_memstream;
    +	open_wmemstream;
     };
     
     FBSDprivate_1.0 {
    
    Added: head/lib/libc/stdio/open_memstream.3
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/lib/libc/stdio/open_memstream.3	Wed Feb 27 19:50:46 2013	(r247411)
    @@ -0,0 +1,154 @@
    +.\" Copyright (c) 2013 Advanced Computing Technologies LLC
    +.\" Written by: John H. Baldwin 
    +.\" All rights reserved.
    +.\"
    +.\" Redistribution and use in source and binary forms, with or without
    +.\" modification, are permitted provided that the following conditions
    +.\" are met:
    +.\" 1. Redistributions of source code must retain the above copyright
    +.\"    notice, this list of conditions and the following disclaimer.
    +.\" 2. Redistributions in binary form must reproduce the above copyright
    +.\"    notice, this list of conditions and the following disclaimer in the
    +.\"    documentation and/or other materials provided with the distribution.
    +.\"
    +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
    +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    +.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
    +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    +.\" SUCH DAMAGE.
    +.\"
    +.\" $FreeBSD$
    +.\"
    +.Dd February 27, 2013
    +.Dt OPEN_MEMSTREAM 3
    +.Os
    +.Sh NAME
    +.Nm open_memstream ,
    +.Nm open_wmemstream
    +.Nd dynamic memory buffer stream open functions
    +.Sh LIBRARY
    +.Lb libc
    +.Sh SYNOPSIS
    +.In stdio.h
    +.Ft FILE *
    +.Fn open_memstream "char **bufp" "size_t **sizep"
    +.In wchar.h
    +.Ft FILE *
    +.Fn open_wmemstream "wchar_t **bufp" "size_t **sizep"
    +.Sh DESCRIPTION
    +The
    +.Fn open_memstream
    +and
    +.Fn open_wmemstream
    +functions create a write-only, seekable stream backed by a dynamically
    +allocated memory buffer.
    +The
    +.Fn open_memstream
    +function creates a byte-oriented stream,
    +while the
    +.Fn open_wmemstream
    +function creates a wide-oriented stream.
    +.Pp
    +Each stream maintains a current position and size.
    +Initially,
    +the position and size are set to zero.
    +Each write begins at the current position and advances it the number of
    +successfully written bytes for
    +.Fn open_memstream
    +or wide characters for
    +.Fn open_wmemstream .
    +If a write moves the current position beyond the length of the buffer,
    +the length of the buffer is extended and a null character is appended to the
    +buffer.
    +.Pp
    +A stream's buffer always contains a null character at the end of the buffer
    +that is not included in the current length.
    +.Pp
    +If a stream's current position is moved beyond the current length via a
    +seek operation and a write is performed,
    +the characters between the current length and the current position are filled
    +with null characters before the write is performed.
    +.Pp
    +After a successful call to
    +.Xr fclose 3
    +or
    +.Xr fflush 3 ,
    +the pointer referenced by
    +.Fa bufp
    +will contain the start of the memory buffer and the variable referenced by
    +.Fa sizep
    +will contain the smaller of the current position and the current buffer length.
    +.Pp
    +After a successful call to
    +.Xr fflush 3,
    +the pointer referenced by
    +.Fa bufp
    +and the variable referenced by
    +.Fa sizep
    +are only valid until the next write operation or a call to
    +.Xr fclose 3.
    +.Pp
    +Once a stream is closed,
    +the allocated buffer referenced by
    +.Fa bufp
    +should be released via a call to
    +.Xr free 3
    +when it is no longer needed.
    +.Sh IMPLEMENTATION NOTES
    +Internally all I/O streams are effectively byte-oriented,
    +so using wide-oriented operations to write to a stream opened via
    +.Fn open_wmemstream
    +results in wide characters being expanded to a stream of multibyte characters
    +in stdio's internal buffers.
    +These multibyte characters are then converted back to wide characters when
    +written into the stream.
    +As a result,
    +the wide-oriented streams maintain an internal multibyte character conversion
    +state that is cleared on any seek opertion that changes the current position.
    +This should have no effect as long as wide-oriented output operations are used
    +on a wide-oriented stream.
    +.Sh RETURN VALUES
    +Upon successful completion,
    +.Fn open_memstream
    +and
    +.Fn open_wmemstream
    +return a
    +.Tn FILE
    +pointer.
    +Otherwise,
    +.Dv NULL
    +is returned and the global variable
    +.Va errno
    +is set to indicate the error.
    +.Sh ERRORS
    +.Bl -tag -width Er
    +.It Bq Er EINVAL
    +The
    +.Fa bufp
    +or
    +.Fa sizep
    +argument was
    +.Dv NULL .
    +.It Bq Er ENOMEM
    +Memory for the stream or buffer could not be allocated.
    +.Sh SEE ALSO
    +.Xr fclose 3 ,
    +.Xr fflush 3 ,
    +.Xr fopen 3 ,
    +.Xr free 3 ,
    +.Xr fseek 3 ,
    +.Xr sbuf 3 ,
    +.Xr stdio 3
    +.Sh STANDARDS
    +The
    +.Fn open_memstream
    +and
    +.Fn open_wmemstream
    +functions conform to
    +.St -p1003.1-2008 .
    
    Added: head/lib/libc/stdio/open_memstream.c
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/lib/libc/stdio/open_memstream.c	Wed Feb 27 19:50:46 2013	(r247411)
    @@ -0,0 +1,209 @@
    +/*-
    + * Copyright (c) 2013 Advanced Computing Technologies LLC
    + * Written by: John H. Baldwin 
    + * 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 "namespace.h"
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include "un-namespace.h"
    +
    +/* XXX: There is no FPOS_MAX.  This assumes fpos_t is an off_t. */
    +#define	FPOS_MAX	OFF_MAX
    +
    +struct memstream {
    +	char **bufp;
    +	size_t *sizep;
    +	ssize_t len;
    +	fpos_t offset;
    +};
    +
    +static int
    +memstream_grow(struct memstream *ms, fpos_t newoff)
    +{
    +	char *buf;
    +	ssize_t newsize;
    +
    +	if (newoff < 0 || newoff >= SSIZE_MAX)
    +		newsize = SSIZE_MAX - 1;
    +	else
    +		newsize = newoff;
    +	if (newsize > ms->len) {
    +		buf = realloc(*ms->bufp, newsize + 1);
    +		if (buf != NULL) {
    +#ifdef DEBUG
    +			fprintf(stderr, "MS: %p growing from %zd to %zd\n",
    +			    ms, ms->len, newsize);
    +#endif
    +			memset(buf + ms->len + 1, 0, newsize - ms->len);
    +			*ms->bufp = buf;
    +			ms->len = newsize;
    +			return (1);
    +		}
    +		return (0);
    +	}
    +	return (1);
    +}
    +
    +static void
    +memstream_update(struct memstream *ms)
    +{
    +
    +	assert(ms->len >= 0 && ms->offset >= 0);
    +	*ms->sizep = ms->len < ms->offset ? ms->len : ms->offset;
    +}
    +
    +static int
    +memstream_write(void *cookie, const char *buf, int len)
    +{
    +	struct memstream *ms;
    +	ssize_t tocopy;
    +
    +	ms = cookie;
    +	if (!memstream_grow(ms, ms->offset + len))
    +		return (-1);
    +	tocopy = ms->len - ms->offset;
    +	if (len < tocopy)
    +		tocopy = len;
    +	memcpy(*ms->bufp + ms->offset, buf, tocopy);
    +	ms->offset += tocopy;
    +	memstream_update(ms);
    +#ifdef DEBUG
    +	fprintf(stderr, "MS: write(%p, %d) = %zd\n", ms, len, tocopy);
    +#endif
    +	return (tocopy);
    +}
    +
    +static fpos_t
    +memstream_seek(void *cookie, fpos_t pos, int whence)
    +{
    +	struct memstream *ms;
    +#ifdef DEBUG
    +	fpos_t old;
    +#endif
    +
    +	ms = cookie;
    +#ifdef DEBUG
    +	old = ms->offset;
    +#endif
    +	switch (whence) {
    +	case SEEK_SET:
    +		/* _fseeko() checks for negative offsets. */
    +		assert(pos >= 0);
    +		ms->offset = pos;
    +		break;
    +	case SEEK_CUR:
    +		/* This is only called by _ftello(). */
    +		assert(pos == 0);
    +		break;
    +	case SEEK_END:
    +		if (pos < 0) {
    +			if (pos + ms->len < 0) {
    +#ifdef DEBUG
    +				fprintf(stderr,
    +				    "MS: bad SEEK_END: pos %jd, len %zd\n",
    +				    (intmax_t)pos, ms->len);
    +#endif
    +				errno = EINVAL;
    +				return (-1);
    +			}
    +		} else {
    +			if (FPOS_MAX - ms->len < pos) {
    +#ifdef DEBUG
    +				fprintf(stderr,
    +				    "MS: bad SEEK_END: pos %jd, len %zd\n",
    +				    (intmax_t)pos, ms->len);
    +#endif
    +				errno = EOVERFLOW;
    +				return (-1);
    +			}
    +		}
    +		ms->offset = ms->len + pos;
    +		break;
    +	}
    +	memstream_update(ms);
    +#ifdef DEBUG
    +	fprintf(stderr, "MS: seek(%p, %jd, %d) %jd -> %jd\n", ms, (intmax_t)pos,
    +	    whence, (intmax_t)old, (intmax_t)ms->offset);
    +#endif
    +	return (ms->offset);
    +}
    +
    +static int
    +memstream_close(void *cookie)
    +{
    +
    +	free(cookie);
    +	return (0);
    +}
    +
    +FILE *
    +open_memstream(char **bufp, size_t *sizep)
    +{
    +	struct memstream *ms;
    +	int save_errno;
    +	FILE *fp;
    +
    +	if (bufp == NULL || sizep == NULL) {
    +		errno = EINVAL;
    +		return (NULL);
    +	}
    +	*bufp = calloc(1, 1);
    +	if (*bufp == NULL)
    +		return (NULL);
    +	ms = malloc(sizeof(*ms));
    +	if (ms == NULL) {
    +		save_errno = errno;
    +		free(*bufp);
    +		*bufp = NULL;
    +		errno = save_errno;
    +		return (NULL);
    +	}
    +	ms->bufp = bufp;
    +	ms->sizep = sizep;
    +	ms->len = 0;
    +	ms->offset = 0;
    +	memstream_update(ms);
    +	fp = funopen(ms, NULL, memstream_write, memstream_seek,
    +	    memstream_close);
    +	if (fp == NULL) {
    +		save_errno = errno;
    +		free(ms);
    +		free(*bufp);
    +		*bufp = NULL;
    +		errno = save_errno;
    +		return (NULL);
    +	}
    +	fwide(fp, -1);
    +	return (fp);
    +}
    
    Added: head/lib/libc/stdio/open_wmemstream.c
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/lib/libc/stdio/open_wmemstream.c	Wed Feb 27 19:50:46 2013	(r247411)
    @@ -0,0 +1,271 @@
    +/*-
    + * Copyright (c) 2013 Advanced Computing Technologies LLC
    + * Written by: John H. Baldwin 
    + * 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 "namespace.h"
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include "un-namespace.h"
    +
    +/* XXX: There is no FPOS_MAX.  This assumes fpos_t is an off_t. */
    +#define	FPOS_MAX	OFF_MAX
    +
    +struct wmemstream {
    +	wchar_t **bufp;
    +	size_t *sizep;
    +	ssize_t len;
    +	fpos_t offset;
    +	mbstate_t mbstate;
    +};
    +
    +static int
    +wmemstream_grow(struct wmemstream *ms, fpos_t newoff)
    +{
    +	wchar_t *buf;
    +	ssize_t newsize;
    +
    +	if (newoff < 0 || newoff >= SSIZE_MAX / sizeof(wchar_t))
    +		newsize = SSIZE_MAX / sizeof(wchar_t) - 1;
    +	else
    +		newsize = newoff;
    +	if (newsize > ms->len) {
    +		buf = realloc(*ms->bufp, (newsize + 1) * sizeof(wchar_t));
    +		if (buf != NULL) {
    +#ifdef DEBUG
    +			fprintf(stderr, "WMS: %p growing from %zd to %zd\n",
    +			    ms, ms->len, newsize);
    +#endif
    +			wmemset(buf + ms->len + 1, 0, newsize - ms->len);
    +			*ms->bufp = buf;
    +			ms->len = newsize;
    +			return (1);
    +		}
    +		return (0);
    +	}
    +	return (1);
    +}
    +
    +static void
    +wmemstream_update(struct wmemstream *ms)
    +{
    +
    +	assert(ms->len >= 0 && ms->offset >= 0);
    +	*ms->sizep = ms->len < ms->offset ? ms->len : ms->offset;
    +}
    +
    +/*
    + * Based on a starting multibyte state and an input buffer, determine
    + * how many wchar_t's would be output.  This doesn't use mbsnrtowcs()
    + * so that it can handle embedded null characters.
    + */
    +static size_t
    +wbuflen(const mbstate_t *state, const char *buf, int len)
    +{
    +	mbstate_t lenstate;
    +	size_t charlen, count;
    +
    +	count = 0;
    +	lenstate = *state;
    +	while (len > 0) {
    +		charlen = mbrlen(buf, len, &lenstate);
    +		if (charlen == (size_t)-1)
    +			return (-1);
    +		if (charlen == (size_t)-2)
    +			break;
    +		if (charlen == 0)
    +			/* XXX: Not sure how else to handle this. */
    +			charlen = 1;
    +		len -= charlen;
    +		buf += charlen;
    +		count++;
    +	}
    +	return (count);
    +}
    +
    +static int
    +wmemstream_write(void *cookie, const char *buf, int len)
    +{
    +	struct wmemstream *ms;
    +	ssize_t consumed, wlen;
    +	size_t charlen;
    +
    +	ms = cookie;
    +	wlen = wbuflen(&ms->mbstate, buf, len);
    +	if (wlen < 0) {
    +		errno = EILSEQ;
    +		return (-1);
    +	}
    +	if (!wmemstream_grow(ms, ms->offset + wlen))
    +		return (-1);
    +
    +	/*
    +	 * This copies characters one at a time rather than using
    +	 * mbsnrtowcs() so it can properly handle embedded null
    +	 * characters.
    +	 */
    +	consumed = 0;
    +	while (len > 0 && ms->offset < ms->len) {
    +		charlen = mbrtowc(*ms->bufp + ms->offset, buf, len,
    +		    &ms->mbstate);
    +		if (charlen == (size_t)-1) {
    +			if (consumed == 0) {
    +				errno = EILSEQ;
    +				return (-1);
    +			}
    +			/* Treat it as a successful short write. */
    +			break;
    +		}
    +		if (charlen == 0)
    +			/* XXX: Not sure how else to handle this. */
    +			charlen = 1;
    +		if (charlen == (size_t)-2) {
    +			consumed += len;
    +			len = 0;
    +		} else {
    +			consumed += charlen;
    +			buf += charlen;
    +			len -= charlen;
    +			ms->offset++;
    +		}
    +	}
    +	wmemstream_update(ms);
    +#ifdef DEBUG
    +	fprintf(stderr, "WMS: write(%p, %d) = %zd\n", ms, len, consumed);
    +#endif
    +	return (consumed);
    +}
    +
    +static fpos_t
    +wmemstream_seek(void *cookie, fpos_t pos, int whence)
    +{
    +	struct wmemstream *ms;
    +	fpos_t old;
    +
    +	ms = cookie;
    +	old = ms->offset;
    +	switch (whence) {
    +	case SEEK_SET:
    +		/* _fseeko() checks for negative offsets. */
    +		assert(pos >= 0);
    +		ms->offset = pos;
    +		break;
    +	case SEEK_CUR:
    +		/* This is only called by _ftello(). */
    +		assert(pos == 0);
    +		break;
    +	case SEEK_END:
    +		if (pos < 0) {
    +			if (pos + ms->len < 0) {
    +#ifdef DEBUG
    +				fprintf(stderr,
    +				    "WMS: bad SEEK_END: pos %jd, len %zd\n",
    +				    (intmax_t)pos, ms->len);
    +#endif
    +				errno = EINVAL;
    +				return (-1);
    +			}
    +		} else {
    +			if (FPOS_MAX - ms->len < pos) {
    +#ifdef DEBUG
    +				fprintf(stderr,
    +				    "WMS: bad SEEK_END: pos %jd, len %zd\n",
    +				    (intmax_t)pos, ms->len);
    +#endif
    +				errno = EOVERFLOW;
    +				return (-1);
    +			}
    +		}
    +		ms->offset = ms->len + pos;
    +		break;
    +	}
    +	/* Reset the multibyte state if a seek changes the position. */
    +	if (ms->offset != old)
    +		memset(&ms->mbstate, 0, sizeof(ms->mbstate));
    +	wmemstream_update(ms);
    +#ifdef DEBUG
    +	fprintf(stderr, "WMS: seek(%p, %jd, %d) %jd -> %jd\n", ms,
    +	    (intmax_t)pos, whence, (intmax_t)old, (intmax_t)ms->offset);
    +#endif
    +	return (ms->offset);
    +}
    +
    +static int
    +wmemstream_close(void *cookie)
    +{
    +
    +	free(cookie);
    +	return (0);
    +}
    +
    +FILE *
    +open_wmemstream(wchar_t **bufp, size_t *sizep)
    +{
    +	struct wmemstream *ms;
    +	int save_errno;
    +	FILE *fp;
    +
    +	if (bufp == NULL || sizep == NULL) {
    +		errno = EINVAL;
    +		return (NULL);
    +	}
    +	*bufp = calloc(1, sizeof(wchar_t));
    +	if (*bufp == NULL)
    +		return (NULL);
    +	ms = malloc(sizeof(*ms));
    +	if (ms == NULL) {
    +		save_errno = errno;
    +		free(*bufp);
    +		*bufp = NULL;
    +		errno = save_errno;
    +		return (NULL);
    +	}
    +	ms->bufp = bufp;
    +	ms->sizep = sizep;
    +	ms->len = 0;
    +	ms->offset = 0;
    +	memset(&ms->mbstate, 0, sizeof(mbstate_t));
    +	wmemstream_update(ms);
    +	fp = funopen(ms, NULL, wmemstream_write, wmemstream_seek,
    +	    wmemstream_close);
    +	if (fp == NULL) {
    +		save_errno = errno;
    +		free(ms);
    +		free(*bufp);
    +		*bufp = NULL;
    +		errno = save_errno;
    +		return (NULL);
    +	}
    +	fwide(fp, 1);
    +	return (fp);
    +}
    
    Modified: head/tools/regression/lib/libc/stdio/Makefile
    ==============================================================================
    --- head/tools/regression/lib/libc/stdio/Makefile	Wed Feb 27 19:49:14 2013	(r247410)
    +++ head/tools/regression/lib/libc/stdio/Makefile	Wed Feb 27 19:50:46 2013	(r247411)
    @@ -1,6 +1,8 @@
     # $FreeBSD$
     
    -TESTS=	test-getdelim test-perror test-print-positional test-printbasic test-printfloat test-scanfloat
    +TESTS=	test-fmemopen test-getdelim test-open_memstream test-open_wmemstream \
    +	test-perror test-print-positional test-printbasic test-printfloat \
    +	test-scanfloat 
     CFLAGS+= -lm
     
     .PHONY: tests
    
    Added: head/tools/regression/lib/libc/stdio/test-open_memstream.c
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/tools/regression/lib/libc/stdio/test-open_memstream.c	Wed Feb 27 19:50:46 2013	(r247411)
    @@ -0,0 +1,203 @@
    +/*-
    + * Copyright (c) 2013 Advanced Computing Technologies LLC
    + * Written by: John H. Baldwin 
    + * 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 
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +static char *buf;
    +static size_t len;
    +
    +static void
    +assert_stream(const char *contents)
    +{
    +	if (strlen(contents) != len)
    +		printf("bad length %zd for \"%s\"\n", len, contents);
    +	else if (strncmp(buf, contents, strlen(contents)) != 0)
    +		printf("bad buffer \"%s\" for \"%s\"\n", buf, contents);
    +}
    +
    +static void
    +open_group_test(void)
    +{
    +	FILE *fp;
    +	off_t eob;
    +
    +	fp = open_memstream(&buf, &len);
    +	if (fp == NULL)
    +		err(1, "failed to open stream");
    +
    +	fprintf(fp, "hello my world");
    +	fflush(fp);
    +	assert_stream("hello my world");
    +	eob = ftello(fp);
    +	rewind(fp);
    +	fprintf(fp, "good-bye");
    +	fseeko(fp, eob, SEEK_SET);
    +	fclose(fp);
    +	assert_stream("good-bye world");
    +	free(buf);
    +}
    +
    +static void
    +simple_tests(void)
    +{
    +	static const char zerobuf[] =
    +	    { 'f', 'o', 'o', 0, 0, 0, 0, 'b', 'a', 'r', 0 };
    +	char c;
    +	FILE *fp;
    +
    +	fp = open_memstream(&buf, NULL);
    +	if (fp != NULL)
    +		errx(1, "did not fail to open stream");
    +	else if (errno != EINVAL)
    +		err(1, "incorrect error for bad length pointer");
    +	fp = open_memstream(NULL, &len);
    +	if (fp != NULL)
    +		errx(1, "did not fail to open stream");
    +	else if (errno != EINVAL)
    +		err(1, "incorrect error for bad buffer pointer");
    +	fp = open_memstream(&buf, &len);
    +	if (fp == NULL)
    +		err(1, "failed to open stream");
    +	fflush(fp);
    +	assert_stream("");
    +	if (fwide(fp, 0) >= 0)
    +		printf("stream is not byte-oriented\n");
    +
    +	fprintf(fp, "fo");
    +	fflush(fp);
    +	assert_stream("fo");
    +	fputc('o', fp);
    +	fflush(fp);
    +	assert_stream("foo");
    +	rewind(fp);
    +	fflush(fp);
    +	assert_stream("");
    +	fseek(fp, 0, SEEK_END);
    +	fflush(fp);
    +	assert_stream("foo");
    +
    +	/*
    +	 * Test seeking out past the current end.  Should zero-fill the
    +	 * intermediate area.
    +	 */
    +	fseek(fp, 4, SEEK_END);
    +	fprintf(fp, "bar");
    +	fflush(fp);
    +
    +	/*
    +	 * Can't use assert_stream() here since this should contain
    +	 * embedded null characters.
    +	 */
    +	if (len != 10)
    +		printf("bad length %zd for zero-fill test\n", len);
    +	else if (memcmp(buf, zerobuf, sizeof(zerobuf)) != 0)
    +		printf("bad buffer for zero-fill test\n");
    +
    +	fseek(fp, 3, SEEK_SET);
    +	fprintf(fp, " in ");
    +	fflush(fp);
    +	assert_stream("foo in ");
    +	fseek(fp, 0, SEEK_END);
    +	fflush(fp);
    +	assert_stream("foo in bar");
    +
    +	rewind(fp);
    +	if (fread(&c, sizeof(c), 1, fp) != 0)
    +		printf("fread did not fail\n");
    +	else if (!ferror(fp))
    +		printf("error indicator not set after fread\n");
    +	else
    +		clearerr(fp);
    +
    +	fseek(fp, 4, SEEK_SET);
    +	fprintf(fp, "bar baz");
    +	fclose(fp);
    +	assert_stream("foo bar baz");
    +	free(buf);
    +}
    +
    +static void
    +seek_tests(void)
    +{
    +	FILE *fp;
    +
    +	fp = open_memstream(&buf, &len);
    +	if (fp == NULL)
    +		err(1, "failed to open stream");
    +#define SEEK_FAIL(offset, whence, error) do {				\
    +	errno = 0;							\
    +	if (fseeko(fp, (offset), (whence)) == 0)			\
    +		printf("fseeko(%s, %s) did not fail, set pos to %jd\n",	\
    +		    __STRING(offset), __STRING(whence),			\
    +		    (intmax_t)ftello(fp));				\
    +	else if (errno != (error))					\
    +		printf("fseeko(%s, %s) failed with %d rather than %s\n",\
    +		    __STRING(offset), __STRING(whence),	errno,		\
    +		    __STRING(error));					\
    +} while (0)
    +
    +#define SEEK_OK(offset, whence, result) do {				\
    +	if (fseeko(fp, (offset), (whence)) != 0)			\
    +		printf("fseeko(%s, %s) failed: %s\n",			\
    +		    __STRING(offset), __STRING(whence),	strerror(errno)); \
    +	else if (ftello(fp) != (result))				\
    +		printf("fseeko(%s, %s) seeked to %jd rather than %s\n",	\
    +		    __STRING(offset), __STRING(whence),			\
    +		    (intmax_t)ftello(fp), __STRING(result));		\
    +} while (0)
    +
    +	SEEK_FAIL(-1, SEEK_SET, EINVAL);
    +	SEEK_FAIL(-1, SEEK_CUR, EINVAL);
    +	SEEK_FAIL(-1, SEEK_END, EINVAL);
    +	fprintf(fp, "foo");
    +	SEEK_OK(-1, SEEK_CUR, 2);
    +	SEEK_OK(0, SEEK_SET, 0);
    +	SEEK_OK(-1, SEEK_END, 2);
    +	SEEK_OK(OFF_MAX - 1, SEEK_SET, OFF_MAX - 1);
    +	SEEK_FAIL(2, SEEK_CUR, EOVERFLOW);
    +	fclose(fp);
    +}
    +
    +int
    +main(int ac, char **av)
    +{
    +
    +	open_group_test();
    +	simple_tests();
    +	seek_tests();
    +	return (0);
    +}
    
    Added: head/tools/regression/lib/libc/stdio/test-open_memstream.t
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/tools/regression/lib/libc/stdio/test-open_memstream.t	Wed Feb 27 19:50:46 2013	(r247411)
    @@ -0,0 +1,10 @@
    +#!/bin/sh
    +# $FreeBSD$
    +
    +cd `dirname $0`
    +
    +executable=`basename $0 .t`
    +
    +make $executable 2>&1 > /dev/null
    +
    +exec ./$executable
    
    Added: head/tools/regression/lib/libc/stdio/test-open_wmemstream.c
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/tools/regression/lib/libc/stdio/test-open_wmemstream.c	Wed Feb 27 19:50:46 2013	(r247411)
    @@ -0,0 +1,203 @@
    +/*-
    + * Copyright (c) 2013 Advanced Computing Technologies LLC
    + * Written by: John H. Baldwin 
    + * 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 
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +static wchar_t *buf;
    +static size_t len;
    +
    +static void
    +assert_stream(const wchar_t *contents)
    +{
    +	if (wcslen(contents) != len)
    +		printf("bad length %zd for \"%ls\"\n", len, contents);
    +	else if (wcsncmp(buf, contents, wcslen(contents)) != 0)
    +		printf("bad buffer \"%ls\" for \"%ls\"\n", buf, contents);
    +}
    +
    +static void
    +open_group_test(void)
    +{
    +	FILE *fp;
    +	off_t eob;
    +
    +	fp = open_wmemstream(&buf, &len);
    +	if (fp == NULL)
    +		err(1, "failed to open stream");
    +
    +	fwprintf(fp, L"hello my world");
    +	fflush(fp);
    +	assert_stream(L"hello my world");
    +	eob = ftello(fp);
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 19:51:47 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id CA7ED7AE;
     Wed, 27 Feb 2013 19:51:47 +0000 (UTC)
     (envelope-from tuexen@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 BBC9FA87;
     Wed, 27 Feb 2013 19:51:47 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RJpl0N081830;
     Wed, 27 Feb 2013 19:51:47 GMT (envelope-from tuexen@svn.freebsd.org)
    Received: (from tuexen@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RJplnB081829;
     Wed, 27 Feb 2013 19:51:47 GMT (envelope-from tuexen@svn.freebsd.org)
    Message-Id: <201302271951.r1RJplnB081829@svn.freebsd.org>
    From: Michael Tuexen 
    Date: Wed, 27 Feb 2013 19:51:47 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247412 - head/sys/netinet
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 19:51:47 -0000
    
    Author: tuexen
    Date: Wed Feb 27 19:51:47 2013
    New Revision: 247412
    URL: http://svnweb.freebsd.org/changeset/base/247412
    
    Log:
      Fix a potential race in returning setting errno when an
      association goes down.
      Reported by Mozilla in
      https://bugzilla.mozilla.org/show_bug.cgi?id=845513
      
      MFC after: 3 days
    
    Modified:
      head/sys/netinet/sctputil.c
    
    Modified: head/sys/netinet/sctputil.c
    ==============================================================================
    --- head/sys/netinet/sctputil.c	Wed Feb 27 19:50:46 2013	(r247411)
    +++ head/sys/netinet/sctputil.c	Wed Feb 27 19:51:47 2013	(r247412)
    @@ -2678,6 +2678,7 @@ set_error:
     	if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
     	    (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) &&
     	    ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) {
    +		SOCK_LOCK(stcb->sctp_socket);
     		if (from_peer) {
     			if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) {
     				SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNREFUSED);
    @@ -2709,7 +2710,7 @@ set_error:
     	if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
     	    (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) &&
     	    ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) {
    -		socantrcvmore(stcb->sctp_socket);
    +		socantrcvmore_locked(stcb->sctp_socket);
     	}
     	sorwakeup(stcb->sctp_socket);
     	sowwakeup(stcb->sctp_socket);
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 19:59:42 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 2F0C3ADE;
     Wed, 27 Feb 2013 19:59:42 +0000 (UTC) (envelope-from ian@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 21143AF4;
     Wed, 27 Feb 2013 19:59:42 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RJxgdS082986;
     Wed, 27 Feb 2013 19:59:42 GMT (envelope-from ian@svn.freebsd.org)
    Received: (from ian@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RJxg7i082985;
     Wed, 27 Feb 2013 19:59:42 GMT (envelope-from ian@svn.freebsd.org)
    Message-Id: <201302271959.r1RJxg7i082985@svn.freebsd.org>
    From: Ian Lepore 
    Date: Wed, 27 Feb 2013 19:59:41 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247413 - head/sys/boot/common
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 19:59:42 -0000
    
    Author: ian
    Date: Wed Feb 27 19:59:41 2013
    New Revision: 247413
    URL: http://svnweb.freebsd.org/changeset/base/247413
    
    Log:
      Fix a typo that prevented booting a kernel that had virtual addresses in
      the elf headers.
    
    Modified:
      head/sys/boot/common/load_elf.c
    
    Modified: head/sys/boot/common/load_elf.c
    ==============================================================================
    --- head/sys/boot/common/load_elf.c	Wed Feb 27 19:51:47 2013	(r247412)
    +++ head/sys/boot/common/load_elf.c	Wed Feb 27 19:59:41 2013	(r247413)
    @@ -304,7 +304,7 @@ __elfN(loadimage)(struct preloaded_file 
     	 * only adjust the entry point if it's a virtual address to begin with.
     	 */
     	off = -0xc0000000u;
    -	if ((ehdr->e_entry & 0xc0000000u) == 0xc000000u)
    +	if ((ehdr->e_entry & 0xc0000000u) == 0xc0000000u)
     		ehdr->e_entry += off;
     #ifdef ELF_VERBOSE
     	printf("ehdr->e_entry 0x%08x, va<->pa off %llx\n", ehdr->e_entry, off);
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 19:59:59 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 373D3C54;
     Wed, 27 Feb 2013 19:59:59 +0000 (UTC) (envelope-from jmg@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 2919FAFD;
     Wed, 27 Feb 2013 19:59:59 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RJxx7q083068;
     Wed, 27 Feb 2013 19:59:59 GMT (envelope-from jmg@svn.freebsd.org)
    Received: (from jmg@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RJxxJ5083067;
     Wed, 27 Feb 2013 19:59:59 GMT (envelope-from jmg@svn.freebsd.org)
    Message-Id: <201302271959.r1RJxxJ5083067@svn.freebsd.org>
    From: John-Mark Gurney 
    Date: Wed, 27 Feb 2013 19:59:59 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247414 - head/tools/test/iconv/tablegen
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 19:59:59 -0000
    
    Author: jmg
    Date: Wed Feb 27 19:59:58 2013
    New Revision: 247414
    URL: http://svnweb.freebsd.org/changeset/base/247414
    
    Log:
      fix this script so we don't expand the second $FreeBSD since svn thinks
      the $ in $1 ends the keyword, and expands it...
    
    Modified:
      head/tools/test/iconv/tablegen/cmp.sh
    
    Modified: head/tools/test/iconv/tablegen/cmp.sh
    ==============================================================================
    --- head/tools/test/iconv/tablegen/cmp.sh	Wed Feb 27 19:59:41 2013	(r247413)
    +++ head/tools/test/iconv/tablegen/cmp.sh	Wed Feb 27 19:59:58 2013	(r247414)
    @@ -1,4 +1,4 @@
     #!/bin/sh
     # $FreeBSD$
     
    -diff -I\$FreeBSD$1 $2 | grep '^-' >/dev/null && printf "\tDIFFER: $1 $2\n" && exit 0 || exit 0
    +diff -I\$\FreeBSD $1 $2 | grep '^-' >/dev/null && printf "\tDIFFER: $1 $2\n" && exit 0 || exit 0
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 20:09:25 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id BF764295;
     Wed, 27 Feb 2013 20:09:25 +0000 (UTC)
     (envelope-from joel@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 B150BC1C;
     Wed, 27 Feb 2013 20:09:25 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RK9Pfu086460;
     Wed, 27 Feb 2013 20:09:25 GMT (envelope-from joel@svn.freebsd.org)
    Received: (from joel@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RK9PVV086458;
     Wed, 27 Feb 2013 20:09:25 GMT (envelope-from joel@svn.freebsd.org)
    Message-Id: <201302272009.r1RK9PVV086458@svn.freebsd.org>
    From: Joel Dahl 
    Date: Wed, 27 Feb 2013 20:09:25 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247415 - head/lib/libc/stdio
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 20:09:25 -0000
    
    Author: joel (doc committer)
    Date: Wed Feb 27 20:09:25 2013
    New Revision: 247415
    URL: http://svnweb.freebsd.org/changeset/base/247415
    
    Log:
      mdoc: add missing El.
    
    Modified:
      head/lib/libc/stdio/open_memstream.3
    
    Modified: head/lib/libc/stdio/open_memstream.3
    ==============================================================================
    --- head/lib/libc/stdio/open_memstream.3	Wed Feb 27 19:59:58 2013	(r247414)
    +++ head/lib/libc/stdio/open_memstream.3	Wed Feb 27 20:09:25 2013	(r247415)
    @@ -137,6 +137,7 @@ argument was
     .Dv NULL .
     .It Bq Er ENOMEM
     Memory for the stream or buffer could not be allocated.
    +.El
     .Sh SEE ALSO
     .Xr fclose 3 ,
     .Xr fflush 3 ,
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 20:15:07 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 346FC598;
     Wed, 27 Feb 2013 20:15:07 +0000 (UTC)
     (envelope-from joel@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 26185CDB;
     Wed, 27 Feb 2013 20:15:07 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RKF7Qp089073;
     Wed, 27 Feb 2013 20:15:07 GMT (envelope-from joel@svn.freebsd.org)
    Received: (from joel@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RKF7ac089072;
     Wed, 27 Feb 2013 20:15:07 GMT (envelope-from joel@svn.freebsd.org)
    Message-Id: <201302272015.r1RKF7ac089072@svn.freebsd.org>
    From: Joel Dahl 
    Date: Wed, 27 Feb 2013 20:15:06 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247416 - head/usr.sbin/watchdogd
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 20:15:07 -0000
    
    Author: joel (doc committer)
    Date: Wed Feb 27 20:15:06 2013
    New Revision: 247416
    URL: http://svnweb.freebsd.org/changeset/base/247416
    
    Log:
      mdoc: begin sentence on new line.
    
    Modified:
      head/usr.sbin/watchdogd/watchdogd.8
    
    Modified: head/usr.sbin/watchdogd/watchdogd.8
    ==============================================================================
    --- head/usr.sbin/watchdogd/watchdogd.8	Wed Feb 27 20:09:25 2013	(r247415)
    +++ head/usr.sbin/watchdogd/watchdogd.8	Wed Feb 27 20:15:06 2013	(r247416)
    @@ -132,23 +132,27 @@ This flag will cause watchdogd to compla
     execute the watchdog script exceeds the threshold of 'sleep' option.
     .Pp
     .It Fl -pretimeout Ar timeout
    -Set a "pretimeout" watchdog.  At "timeout" seconds before the watchdog
    -will fire attempt an action.  The action is set by the --pretimeout-action
    -flag.  The default is just to log a message (WD_SOFT_LOG) via
    +Set a "pretimeout" watchdog.
    +At "timeout" seconds before the watchdog will fire attempt an action.
    +The action is set by the --pretimeout-action flag.
    +The default is just to log a message (WD_SOFT_LOG) via
     .Xr log 9 .
     .Pp
     .It Fl -pretimeout-action Ar action
    -Set the timeout action for the pretimeout.  See the section 
    +Set the timeout action for the pretimeout.
    +See the section 
     .Sx Timeout Actions .
     .Pp
     .It Fl -softtimeout
     Instead of arming the various hardware watchdogs, only use a basic software
    -watchdog.  The default action is just to
    +watchdog.
    +The default action is just to
     .Xr log 9
     a message (WD_SOFT_LOG).
     .Pp
     .It Fl -softtimeout-action Ar action
    -Set the timeout action for the softtimeout.  See the section 
    +Set the timeout action for the softtimeout.
    +See the section 
     .Sx Timeout Actions .
     .Pp
     .El
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 20:16:31 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 4A3ED723;
     Wed, 27 Feb 2013 20:16:31 +0000 (UTC)
     (envelope-from joel@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 32284CEE;
     Wed, 27 Feb 2013 20:16:31 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RKGV4R089290;
     Wed, 27 Feb 2013 20:16:31 GMT (envelope-from joel@svn.freebsd.org)
    Received: (from joel@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RKGV48089289;
     Wed, 27 Feb 2013 20:16:31 GMT (envelope-from joel@svn.freebsd.org)
    Message-Id: <201302272016.r1RKGV48089289@svn.freebsd.org>
    From: Joel Dahl 
    Date: Wed, 27 Feb 2013 20:16:31 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247417 - head/usr.sbin/watchdogd
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 20:16:31 -0000
    
    Author: joel (doc committer)
    Date: Wed Feb 27 20:16:30 2013
    New Revision: 247417
    URL: http://svnweb.freebsd.org/changeset/base/247417
    
    Log:
      Remove EOL whitespace.
    
    Modified:
      head/usr.sbin/watchdogd/watchdogd.8
    
    Modified: head/usr.sbin/watchdogd/watchdogd.8
    ==============================================================================
    --- head/usr.sbin/watchdogd/watchdogd.8	Wed Feb 27 20:15:06 2013	(r247416)
    +++ head/usr.sbin/watchdogd/watchdogd.8	Wed Feb 27 20:16:30 2013	(r247417)
    @@ -100,7 +100,7 @@ that its script has run for too long.
     If unset
     .Ar script_timeout
     defaults to the value specified by the
    -.Fl s Ar sleep 
    +.Fl s Ar sleep
     option.
     .Pp
     Upon receiving the
    @@ -140,7 +140,7 @@ The default is just to log a message (WD
     .Pp
     .It Fl -pretimeout-action Ar action
     Set the timeout action for the pretimeout.
    -See the section 
    +See the section
     .Sx Timeout Actions .
     .Pp
     .It Fl -softtimeout
    @@ -152,7 +152,7 @@ a message (WD_SOFT_LOG).
     .Pp
     .It Fl -softtimeout-action Ar action
     Set the timeout action for the softtimeout.
    -See the section 
    +See the section
     .Sx Timeout Actions .
     .Pp
     .El
    @@ -179,7 +179,7 @@ Log a message using
     when the timeout is reached.
     .Pp
     .It Ar printf
    -call the kernel 
    +call the kernel
     .Xr printf 9
     to display a message to the console and
     .Xr dmesg 8
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 21:03:10 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id A5025469;
     Wed, 27 Feb 2013 21:03:10 +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 7DE92F2A;
     Wed, 27 Feb 2013 21:03:10 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RL3AY2003814;
     Wed, 27 Feb 2013 21:03:10 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RL3Atr003813;
     Wed, 27 Feb 2013 21:03:10 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302272103.r1RL3Atr003813@svn.freebsd.org>
    From: John Baldwin 
    Date: Wed, 27 Feb 2013 21:03: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: r247420 - stable/9/sys/dev/amr
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 21:03:10 -0000
    
    Author: jhb
    Date: Wed Feb 27 21:03:09 2013
    New Revision: 247420
    URL: http://svnweb.freebsd.org/changeset/base/247420
    
    Log:
      MFC 240692,241228:
      Adjust the ioctl workaround from r234501:
      - Ensure the native ioctl path always allocates a 4kb buffer if a request
        uses a buffer size of 0.
      - Rounding all small requests up to 32k swamped the controller causing
        firmware hangs.  Instead, round requests smaller than 64k up to the next
        power of 2 as a general rule.  To handle the one known special case of a
        command that accepts a 12k buffer returning a 24k-ish reply, round
        requests between 8k and 16k up to 32k rather than 16k.  The result is
        that commands less than 8k should now be rounded up to a smaller size
        (either 4k or 8k) rather than 32k.
    
    Modified:
      stable/9/sys/dev/amr/amr.c
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
    
    Modified: stable/9/sys/dev/amr/amr.c
    ==============================================================================
    --- stable/9/sys/dev/amr/amr.c	Wed Feb 27 20:54:45 2013	(r247419)
    +++ stable/9/sys/dev/amr/amr.c	Wed Feb 27 21:03:09 2013	(r247420)
    @@ -546,13 +546,19 @@ shutdown_out:
      * The amr(4) firmware relies on this feature.  In fact, it assumes
      * the buffer is always a power of 2 up to a max of 64k.  There is
      * also at least one case where it assumes a buffer less than 16k is
    - * greater than 16k.  Force a minimum buffer size of 32k and round
    - * sizes between 32k and 64k up to 64k as a workaround.
    + * greater than 16k.  However, forcing all buffers to a size of 32k
    + * causes stalls in the firmware.  Force each command smaller than
    + * 64k up to the next power of two except that commands between 8k
    + * and 16k are rounded up to 32k instead of 16k.
      */
     static unsigned long
     amr_ioctl_buffer_length(unsigned long len)
     {
     
    +    if (len <= 4 * 1024)
    +	return (4 * 1024);
    +    if (len <= 8 * 1024)
    +	return (8 * 1024);
         if (len <= 32 * 1024)
     	return (32 * 1024);
         if (len <= 64 * 1024)
    @@ -859,11 +865,8 @@ amr_ioctl(struct cdev *dev, u_long cmd, 
     
         /* handle inbound data buffer */
         real_length = amr_ioctl_buffer_length(au_length);
    +    dp = malloc(real_length, M_AMR, M_WAITOK|M_ZERO);
         if (au_length != 0 && au_cmd[0] != 0x06) {
    -	if ((dp = malloc(real_length, M_AMR, M_WAITOK|M_ZERO)) == NULL) {
    -	    error = ENOMEM;
    -	    goto out;
    -	}
     	if ((error = copyin(au_buffer, dp, au_length)) != 0) {
     	    free(dp, M_AMR);
     	    return (error);
    @@ -933,8 +936,7 @@ amr_ioctl(struct cdev *dev, u_long cmd, 
     	error = copyout(dp, au_buffer, au_length);
         }
         debug(2, "copyout %ld bytes from %p -> %p", au_length, dp, au_buffer);
    -    if (dp != NULL)
    -	debug(2, "%p status 0x%x", dp, ac->ac_status);
    +    debug(2, "%p status 0x%x", dp, ac->ac_status);
         *au_statusp = ac->ac_status;
     
     out:
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 21:03:19 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id E95DD57A;
     Wed, 27 Feb 2013 21:03:19 +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 C25DEF2C;
     Wed, 27 Feb 2013 21:03:19 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RL3JoU003879;
     Wed, 27 Feb 2013 21:03:19 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RL3JwK003878;
     Wed, 27 Feb 2013 21:03:19 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302272103.r1RL3JwK003878@svn.freebsd.org>
    From: John Baldwin 
    Date: Wed, 27 Feb 2013 21:03:19 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247421 - stable/8/sys/dev/amr
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 21:03:20 -0000
    
    Author: jhb
    Date: Wed Feb 27 21:03:19 2013
    New Revision: 247421
    URL: http://svnweb.freebsd.org/changeset/base/247421
    
    Log:
      MFC 240692,241228:
      Adjust the ioctl workaround from r234501:
      - Ensure the native ioctl path always allocates a 4kb buffer if a request
        uses a buffer size of 0.
      - Rounding all small requests up to 32k swamped the controller causing
        firmware hangs.  Instead, round requests smaller than 64k up to the next
        power of 2 as a general rule.  To handle the one known special case of a
        command that accepts a 12k buffer returning a 24k-ish reply, round
        requests between 8k and 16k up to 32k rather than 16k.  The result is
        that commands less than 8k should now be rounded up to a smaller size
        (either 4k or 8k) rather than 32k.
    
    Modified:
      stable/8/sys/dev/amr/amr.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/amr/   (props changed)
    
    Modified: stable/8/sys/dev/amr/amr.c
    ==============================================================================
    --- stable/8/sys/dev/amr/amr.c	Wed Feb 27 21:03:09 2013	(r247420)
    +++ stable/8/sys/dev/amr/amr.c	Wed Feb 27 21:03:19 2013	(r247421)
    @@ -546,13 +546,19 @@ shutdown_out:
      * The amr(4) firmware relies on this feature.  In fact, it assumes
      * the buffer is always a power of 2 up to a max of 64k.  There is
      * also at least one case where it assumes a buffer less than 16k is
    - * greater than 16k.  Force a minimum buffer size of 32k and round
    - * sizes between 32k and 64k up to 64k as a workaround.
    + * greater than 16k.  However, forcing all buffers to a size of 32k
    + * causes stalls in the firmware.  Force each command smaller than
    + * 64k up to the next power of two except that commands between 8k
    + * and 16k are rounded up to 32k instead of 16k.
      */
     static unsigned long
     amr_ioctl_buffer_length(unsigned long len)
     {
     
    +    if (len <= 4 * 1024)
    +	return (4 * 1024);
    +    if (len <= 8 * 1024)
    +	return (8 * 1024);
         if (len <= 32 * 1024)
     	return (32 * 1024);
         if (len <= 64 * 1024)
    @@ -859,11 +865,8 @@ amr_ioctl(struct cdev *dev, u_long cmd, 
     
         /* handle inbound data buffer */
         real_length = amr_ioctl_buffer_length(au_length);
    +    dp = malloc(real_length, M_AMR, M_WAITOK|M_ZERO);
         if (au_length != 0 && au_cmd[0] != 0x06) {
    -	if ((dp = malloc(real_length, M_AMR, M_WAITOK|M_ZERO)) == NULL) {
    -	    error = ENOMEM;
    -	    goto out;
    -	}
     	if ((error = copyin(au_buffer, dp, au_length)) != 0) {
     	    free(dp, M_AMR);
     	    return (error);
    @@ -933,8 +936,7 @@ amr_ioctl(struct cdev *dev, u_long cmd, 
     	error = copyout(dp, au_buffer, au_length);
         }
         debug(2, "copyout %ld bytes from %p -> %p", au_length, dp, au_buffer);
    -    if (dp != NULL)
    -	debug(2, "%p status 0x%x", dp, ac->ac_status);
    +    debug(2, "%p status 0x%x", dp, ac->ac_status);
         *au_statusp = ac->ac_status;
     
     out:
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 21:58:07 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 1B625725;
     Wed, 27 Feb 2013 21:58:07 +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 0C50A2FC;
     Wed, 27 Feb 2013 21:58:07 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RLw6sY019515;
     Wed, 27 Feb 2013 21:58:06 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RLw6Jp019514;
     Wed, 27 Feb 2013 21:58:06 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201302272158.r1RLw6Jp019514@svn.freebsd.org>
    From: Xin LI 
    Date: Wed, 27 Feb 2013 21:58:06 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247422 - head
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 21:58:07 -0000
    
    Author: delphij
    Date: Wed Feb 27 21:58:06 2013
    New Revision: 247422
    URL: http://svnweb.freebsd.org/changeset/base/247422
    
    Log:
      Add a reminder that the user should update boot block if they are upgrading
      their existing system and use LZ4 compression for ZFS.
      
      Suggested by:	mm
      MFC after:	3 days
    
    Modified:
      head/UPDATING
    
    Modified: head/UPDATING
    ==============================================================================
    --- head/UPDATING	Wed Feb 27 21:03:19 2013	(r247421)
    +++ head/UPDATING	Wed Feb 27 21:58:06 2013	(r247422)
    @@ -26,6 +26,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
     	disable the most expensive debugging functionality run
     	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
     
    +20130208:
    +	A new compression method (lz4) has been merged to -HEAD.  Please
    +	refer to zpool-features(7) for more information.
    +
    +	Please refer to the "ZFS notes" section of this file for information
    +	on upgrading boot ZFS pools.
    +
     20130129:
     	A BSD-licensed patch(1) variant has been added and is installed
     	as bsdpatch, being the GNU version the default patch.
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 22:02:41 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 9386395C;
     Wed, 27 Feb 2013 22:02:41 +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 6D5DB35C;
     Wed, 27 Feb 2013 22:02:41 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RM2fAg021969;
     Wed, 27 Feb 2013 22:02:41 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RM2f6P021968;
     Wed, 27 Feb 2013 22:02:41 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302272202.r1RM2f6P021968@svn.freebsd.org>
    From: John Baldwin 
    Date: Wed, 27 Feb 2013 22:02:41 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
    Subject: svn commit: r247423 - stable/9/sys/kern
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 22:02:41 -0000
    
    Author: jhb
    Date: Wed Feb 27 22:02:40 2013
    New Revision: 247423
    URL: http://svnweb.freebsd.org/changeset/base/247423
    
    Log:
      MFC 240921:
      Add optional entropy harvesting for software interrupts in swi_sched()
      as controlled by kern.random.sys.harvest.swi.  SWI harvesting feeds into
      the interrupt FIFO and each event is estimated as providing a single bit of
      entropy.
    
    Modified:
      stable/9/sys/kern/kern_intr.c
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/kern/kern_intr.c
    ==============================================================================
    --- stable/9/sys/kern/kern_intr.c	Wed Feb 27 21:58:06 2013	(r247422)
    +++ stable/9/sys/kern/kern_intr.c	Wed Feb 27 22:02:40 2013	(r247423)
    @@ -1144,11 +1144,21 @@ swi_sched(void *cookie, int flags)
     {
     	struct intr_handler *ih = (struct intr_handler *)cookie;
     	struct intr_event *ie = ih->ih_event;
    +	struct intr_entropy entropy;
     	int error;
     
     	CTR3(KTR_INTR, "swi_sched: %s %s need=%d", ie->ie_name, ih->ih_name,
     	    ih->ih_need);
     
    +	if (harvest.swi) {
    +		CTR2(KTR_INTR, "swi_sched: pid %d (%s) gathering entropy",
    +		    curproc->p_pid, curthread->td_name);
    +		entropy.event = (uintptr_t)ih;
    +		entropy.td = curthread;
    +		random_harvest(&entropy, sizeof(entropy), 1, 0,
    +		    RANDOM_INTERRUPT);
    +	}
    +
     	/*
     	 * Set ih_need for this handler so that if the ithread is already
     	 * running it will execute this handler on the next pass.  Otherwise,
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 22:08:18 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id A23B9C00;
     Wed, 27 Feb 2013 22:08:18 +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 9444B3A7;
     Wed, 27 Feb 2013 22:08:18 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RM8I3o023023;
     Wed, 27 Feb 2013 22:08:18 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RM8I1M023022;
     Wed, 27 Feb 2013 22:08:18 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302272208.r1RM8I1M023022@svn.freebsd.org>
    From: John Baldwin 
    Date: Wed, 27 Feb 2013 22:08: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: r247424 - stable/9/sys/net
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 22:08:18 -0000
    
    Author: jhb
    Date: Wed Feb 27 22:08:18 2013
    New Revision: 247424
    URL: http://svnweb.freebsd.org/changeset/base/247424
    
    Log:
      MFC 241130:
      Rename the module for 'device enc' to "if_enc" to avoid conflicting with
      the CAM "enc" peripheral (part of ses(4)).  Previously the two modules
      used the same name, so only one was included in a linked kernel causing
      enc0 to not be created if you added IPSEC to GENERIC.  The new module
      name follows the pattern of other network interfaces (e.g. "if_loop").
    
    Modified:
      stable/9/sys/net/if_enc.c
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/net/if_enc.c
    ==============================================================================
    --- stable/9/sys/net/if_enc.c	Wed Feb 27 22:02:40 2013	(r247423)
    +++ stable/9/sys/net/if_enc.c	Wed Feb 27 22:08:18 2013	(r247424)
    @@ -179,12 +179,12 @@ enc_modevent(module_t mod, int type, voi
     }
     
     static moduledata_t enc_mod = {
    -	"enc",
    +	"if_enc",
     	enc_modevent,
     	0
     };
     
    -DECLARE_MODULE(enc, enc_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY);
    +DECLARE_MODULE(if_enc, enc_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY);
     
     static int
     enc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 23:17:46 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 6D5E45B1;
     Wed, 27 Feb 2013 23:17:46 +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 3DD869AE;
     Wed, 27 Feb 2013 23:17:46 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RNHkgx044103;
     Wed, 27 Feb 2013 23:17:46 GMT (envelope-from smh@svn.freebsd.org)
    Received: (from smh@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RNHk1m044102;
     Wed, 27 Feb 2013 23:17:46 GMT (envelope-from smh@svn.freebsd.org)
    Message-Id: <201302272317.r1RNHk1m044102@svn.freebsd.org>
    From: Steven Hartland 
    Date: Wed, 27 Feb 2013 23:17:46 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247426 - head/sys/dev/mfi
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 23:17:46 -0000
    
    Author: smh
    Date: Wed Feb 27 23:17:45 2013
    New Revision: 247426
    URL: http://svnweb.freebsd.org/changeset/base/247426
    
    Log:
      Adds hw.mfi.cmd_timeout loader / sysctl tuneable which controls the default
      timeout used in the mfi driver. This is useful for long running commands
      such as secure erase.
      
      Reviewed by:	John Baldwin
      Approved by:	pjd (mentor)
    
    Modified:
      head/sys/dev/mfi/mfi.c
    
    Modified: head/sys/dev/mfi/mfi.c
    ==============================================================================
    --- head/sys/dev/mfi/mfi.c	Wed Feb 27 23:02:47 2013	(r247425)
    +++ head/sys/dev/mfi/mfi.c	Wed Feb 27 23:17:45 2013	(r247426)
    @@ -157,6 +157,11 @@ SYSCTL_INT(_hw_mfi, OID_AUTO, polled_cmd
     	   &mfi_polled_cmd_timeout, 0,
     	   "Polled command timeout - used for firmware flash etc (in seconds)");
     
    +static int	mfi_cmd_timeout = MFI_CMD_TIMEOUT;
    +TUNABLE_INT("hw.mfi.cmd_timeout", &mfi_cmd_timeout);
    +SYSCTL_INT(_hw_mfi, OID_AUTO, cmd_timeout, CTLFLAG_RWTUN, &mfi_cmd_timeout,
    +	   0, "Command timeout (in seconds)");
    +
     /* Management interface */
     static d_open_t		mfi_open;
     static d_close_t	mfi_close;
    @@ -782,7 +787,7 @@ mfi_attach(struct mfi_softc *sc)
     
     	/* Start the timeout watchdog */
     	callout_init(&sc->mfi_watchdog_callout, CALLOUT_MPSAFE);
    -	callout_reset(&sc->mfi_watchdog_callout, MFI_CMD_TIMEOUT * hz,
    +	callout_reset(&sc->mfi_watchdog_callout, mfi_cmd_timeout * hz,
     	    mfi_timeout, sc);
     
     	if (sc->mfi_flags & MFI_FLAGS_TBOLT) {
    @@ -3714,7 +3719,7 @@ mfi_dump_all(void)
     			break;
     		device_printf(sc->mfi_dev, "Dumping\n\n");
     		timedout = 0;
    -		deadline = time_uptime - MFI_CMD_TIMEOUT;
    +		deadline = time_uptime - mfi_cmd_timeout;
     		mtx_lock(&sc->mfi_io_lock);
     		TAILQ_FOREACH(cm, &sc->mfi_busy, cm_link) {
     			if (cm->cm_timestamp <= deadline) {
    @@ -3745,10 +3750,11 @@ mfi_timeout(void *data)
     	time_t deadline;
     	int timedout = 0;
     
    -	deadline = time_uptime - MFI_CMD_TIMEOUT;
    +	deadline = time_uptime - mfi_cmd_timeout;
     	if (sc->adpreset == 0) {
     		if (!mfi_tbolt_reset(sc)) {
    -			callout_reset(&sc->mfi_watchdog_callout, MFI_CMD_TIMEOUT * hz, mfi_timeout, sc);
    +			callout_reset(&sc->mfi_watchdog_callout,
    +			    mfi_cmd_timeout * hz, mfi_timeout, sc);
     			return;
     		}
     	}
    @@ -3785,7 +3791,7 @@ mfi_timeout(void *data)
     
     	mtx_unlock(&sc->mfi_io_lock);
     
    -	callout_reset(&sc->mfi_watchdog_callout, MFI_CMD_TIMEOUT * hz,
    +	callout_reset(&sc->mfi_watchdog_callout, mfi_cmd_timeout * hz,
     	    mfi_timeout, sc);
     
     	if (0)
    
    From owner-svn-src-all@FreeBSD.ORG  Wed Feb 27 23:23:27 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 02760875;
     Wed, 27 Feb 2013 23:23:27 +0000 (UTC)
     (envelope-from doconnor@gsoft.com.au)
    Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10])
     by mx1.freebsd.org (Postfix) with ESMTP id 7B59B9FA;
     Wed, 27 Feb 2013 23:23:26 +0000 (UTC)
    Received: from ur.gsoft.com.au (Ur.gsoft.com.au [203.31.81.55])
     (authenticated bits=0)
     by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id r1RNN2p0084711
     (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO);
     Thu, 28 Feb 2013 09:53:07 +1030 (CST)
     (envelope-from doconnor@gsoft.com.au)
    Subject: Re: svn commit: r247359 - head/sbin/reboot
    Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
    Content-Type: text/plain; charset=us-ascii
    From: "Daniel O'Connor" 
    In-Reply-To: <201302271138.24452.jhb@freebsd.org>
    Date: Thu, 28 Feb 2013 09:53:02 +1030
    Content-Transfer-Encoding: quoted-printable
    Message-Id: <4602D40D-C4B2-4FB5-8E3B-8D74E19118FD@gsoft.com.au>
    References: <201302262318.r1QNIauL003863@svn.freebsd.org>
     <201302271138.24452.jhb@freebsd.org>
    To: John Baldwin 
    X-Mailer: Apple Mail (2.1499)
    X-Spam-Score: -3.051 () ALL_TRUSTED,BAYES_00,RP_MATCHES_RCVD
    X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org, Nick Hibma 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Wed, 27 Feb 2013 23:23:27 -0000
    
    
    On 28/02/2013, at 3:08, John Baldwin  wrote:
    >> URL: http://svnweb.freebsd.org/changeset/base/247359
    >>=20
    >> Log:
    >>  Clarify that overriding the -h/-D flags through flags in =
    device.hints
    >>  only works for sio(4) but not for uart(4) which no longer has this =
    flag.
    >=20
    > You should probably just remove the flag entirely.  sio(4) doesn't =
    build on=20
    > 8.x and later.
    
    
    The handbook will need fixing too since it mentions sio(4) and -D/-h.
    
    --
    Daniel O'Connor software and network engineer
    for Genesis Software - http://www.gsoft.com.au
    "The nice thing about standards is that there
    are so many of them to choose from."
      -- Andrew Tanenbaum
    GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
    
    
    
    
    
    
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 00:18:58 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 5453E3D0;
     Thu, 28 Feb 2013 00:18:58 +0000 (UTC)
     (envelope-from attilio@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 3AAABBF6;
     Thu, 28 Feb 2013 00:18:58 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S0Iwhq062425;
     Thu, 28 Feb 2013 00:18:58 GMT (envelope-from attilio@svn.freebsd.org)
    Received: (from attilio@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S0IuL0062417;
     Thu, 28 Feb 2013 00:18:56 GMT (envelope-from attilio@svn.freebsd.org)
    Message-Id: <201302280018.r1S0IuL0062417@svn.freebsd.org>
    From: Attilio Rao 
    Date: Thu, 28 Feb 2013 00:18:56 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247429 - in head/sys/arm: econa s3c2xx0 xscale/i80321
     xscale/i8134x xscale/ixp425 xscale/pxa
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 00:18:58 -0000
    
    Author: attilio
    Date: Thu Feb 28 00:18:56 2013
    New Revision: 247429
    URL: http://svnweb.freebsd.org/changeset/base/247429
    
    Log:
      Complete r247297:
      Remove unused inclusions of vm/vm_pager.h and vm/vnode_pager.h.
      
      Sponsored by:	EMC / Isilon storage division
    
    Modified:
      head/sys/arm/econa/econa_machdep.c
      head/sys/arm/s3c2xx0/s3c24x0_machdep.c
      head/sys/arm/xscale/i80321/ep80219_machdep.c
      head/sys/arm/xscale/i80321/iq31244_machdep.c
      head/sys/arm/xscale/i8134x/crb_machdep.c
      head/sys/arm/xscale/ixp425/avila_machdep.c
      head/sys/arm/xscale/pxa/pxa_machdep.c
    
    Modified: head/sys/arm/econa/econa_machdep.c
    ==============================================================================
    --- head/sys/arm/econa/econa_machdep.c	Thu Feb 28 00:14:59 2013	(r247428)
    +++ head/sys/arm/econa/econa_machdep.c	Thu Feb 28 00:18:56 2013	(r247429)
    @@ -67,9 +67,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c
    ==============================================================================
    --- head/sys/arm/s3c2xx0/s3c24x0_machdep.c	Thu Feb 28 00:14:59 2013	(r247428)
    +++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c	Thu Feb 28 00:18:56 2013	(r247429)
    @@ -77,9 +77,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c
    ==============================================================================
    --- head/sys/arm/xscale/i80321/ep80219_machdep.c	Thu Feb 28 00:14:59 2013	(r247428)
    +++ head/sys/arm/xscale/i80321/ep80219_machdep.c	Thu Feb 28 00:18:56 2013	(r247429)
    @@ -77,9 +77,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c
    ==============================================================================
    --- head/sys/arm/xscale/i80321/iq31244_machdep.c	Thu Feb 28 00:14:59 2013	(r247428)
    +++ head/sys/arm/xscale/i80321/iq31244_machdep.c	Thu Feb 28 00:18:56 2013	(r247429)
    @@ -77,9 +77,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/arm/xscale/i8134x/crb_machdep.c
    ==============================================================================
    --- head/sys/arm/xscale/i8134x/crb_machdep.c	Thu Feb 28 00:14:59 2013	(r247428)
    +++ head/sys/arm/xscale/i8134x/crb_machdep.c	Thu Feb 28 00:18:56 2013	(r247429)
    @@ -77,9 +77,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/arm/xscale/ixp425/avila_machdep.c
    ==============================================================================
    --- head/sys/arm/xscale/ixp425/avila_machdep.c	Thu Feb 28 00:14:59 2013	(r247428)
    +++ head/sys/arm/xscale/ixp425/avila_machdep.c	Thu Feb 28 00:18:56 2013	(r247429)
    @@ -77,9 +77,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/arm/xscale/pxa/pxa_machdep.c
    ==============================================================================
    --- head/sys/arm/xscale/pxa/pxa_machdep.c	Thu Feb 28 00:14:59 2013	(r247428)
    +++ head/sys/arm/xscale/pxa/pxa_machdep.c	Thu Feb 28 00:18:56 2013	(r247429)
    @@ -79,9 +79,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 00:22:05 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 9AE9E7EC;
     Thu, 28 Feb 2013 00:22:05 +0000 (UTC) (envelope-from jfv@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 8C770CB8;
     Thu, 28 Feb 2013 00:22:05 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S0M56C064519;
     Thu, 28 Feb 2013 00:22:05 GMT (envelope-from jfv@svn.freebsd.org)
    Received: (from jfv@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S0M4vm064514;
     Thu, 28 Feb 2013 00:22:04 GMT (envelope-from jfv@svn.freebsd.org)
    Message-Id: <201302280022.r1S0M4vm064514@svn.freebsd.org>
    From: Jack F Vogel 
    Date: Thu, 28 Feb 2013 00:22:04 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247430 - in stable/8/sys: conf dev/e1000 modules/em
     modules/igb
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 00:22:05 -0000
    
    Author: jfv
    Date: Thu Feb 28 00:22:04 2013
    New Revision: 247430
    URL: http://svnweb.freebsd.org/changeset/base/247430
    
    Log:
      MFC of the E1000 drivers to STABLE/8, this includes the follow revisions
      plus a few tweaks:
       196969,196970,211516,214646,215781,215789,215808,215910,223350,
       223482,223831,228281,228393,229939,231796,232238,234665,235256,
       236406,238148,238151,238214,238765,238770,238953,238981,239105,
       239109,239304,240518,240693,240968,241037,241856,241885,243570,
       243857,245334,246128,246482,247064
    
    Added:
      stable/8/sys/dev/e1000/e1000_i210.c
         - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c
      stable/8/sys/dev/e1000/e1000_i210.h
         - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h
    Modified:
      stable/8/sys/conf/files
      stable/8/sys/dev/e1000/e1000_82541.c
      stable/8/sys/dev/e1000/e1000_82543.c
      stable/8/sys/dev/e1000/e1000_82571.c
      stable/8/sys/dev/e1000/e1000_82575.c
      stable/8/sys/dev/e1000/e1000_82575.h
      stable/8/sys/dev/e1000/e1000_api.c
      stable/8/sys/dev/e1000/e1000_api.h
      stable/8/sys/dev/e1000/e1000_defines.h
      stable/8/sys/dev/e1000/e1000_hw.h
      stable/8/sys/dev/e1000/e1000_ich8lan.c
      stable/8/sys/dev/e1000/e1000_ich8lan.h
      stable/8/sys/dev/e1000/e1000_mac.c
      stable/8/sys/dev/e1000/e1000_mac.h
      stable/8/sys/dev/e1000/e1000_manage.c
      stable/8/sys/dev/e1000/e1000_manage.h
      stable/8/sys/dev/e1000/e1000_nvm.c
      stable/8/sys/dev/e1000/e1000_nvm.h
      stable/8/sys/dev/e1000/e1000_osdep.h
      stable/8/sys/dev/e1000/e1000_phy.c
      stable/8/sys/dev/e1000/e1000_phy.h
      stable/8/sys/dev/e1000/e1000_regs.h
      stable/8/sys/dev/e1000/if_em.c   (contents, props changed)
      stable/8/sys/dev/e1000/if_igb.c   (contents, props changed)
      stable/8/sys/dev/e1000/if_igb.h
      stable/8/sys/dev/e1000/if_lem.c
      stable/8/sys/modules/em/Makefile
      stable/8/sys/modules/igb/Makefile
    Directory Properties:
      stable/8/sys/dev/e1000/   (props changed)
    
    Modified: stable/8/sys/conf/files
    ==============================================================================
    --- stable/8/sys/conf/files	Thu Feb 28 00:18:56 2013	(r247429)
    +++ stable/8/sys/conf/files	Thu Feb 28 00:22:04 2013	(r247430)
    @@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c		optional em | i
     	compile-with "${NORMAL_C} -I$S/dev/e1000"
     dev/e1000/e1000_ich8lan.c	optional em | igb \
     	compile-with "${NORMAL_C} -I$S/dev/e1000"
    +dev/e1000/e1000_i210.c		optional em | igb \
    +	compile-with "${NORMAL_C} -I$S/dev/e1000"
     dev/e1000/e1000_api.c		optional em | igb \
     	compile-with "${NORMAL_C} -I$S/dev/e1000"
     dev/e1000/e1000_mac.c		optional em | igb \
    
    Modified: stable/8/sys/dev/e1000/e1000_82541.c
    ==============================================================================
    --- stable/8/sys/dev/e1000/e1000_82541.c	Thu Feb 28 00:18:56 2013	(r247429)
    +++ stable/8/sys/dev/e1000/e1000_82541.c	Thu Feb 28 00:22:04 2013	(r247430)
    @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st
     	 * of MAC speed/duplex configuration.  So we only need to
     	 * configure Collision Distance in the MAC.
     	 */
    -	e1000_config_collision_dist_generic(hw);
    +	mac->ops.config_collision_dist(hw);
     
     	/*
     	 * Configure Flow Control now that Auto-Neg has completed.
    
    Modified: stable/8/sys/dev/e1000/e1000_82543.c
    ==============================================================================
    --- stable/8/sys/dev/e1000/e1000_82543.c	Thu Feb 28 00:18:56 2013	(r247429)
    +++ stable/8/sys/dev/e1000/e1000_82543.c	Thu Feb 28 00:22:04 2013	(r247430)
    @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543
     		DEBUGOUT("Valid link established!!!\n");
     		/* Config the MAC and PHY after link is up */
     		if (hw->mac.type == e1000_82544) {
    -			e1000_config_collision_dist_generic(hw);
    +			hw->mac.ops.config_collision_dist(hw);
     		} else {
     			ret_val = e1000_config_mac_to_phy_82543(hw);
     			if (ret_val)
    @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543(
     	/* Take the link out of reset */
     	ctrl &= ~E1000_CTRL_LRST;
     
    -	e1000_config_collision_dist_generic(hw);
    +	hw->mac.ops.config_collision_dist(hw);
     
     	ret_val = e1000_commit_fc_settings_generic(hw);
     	if (ret_val)
    @@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8
     	 * settings.
     	 */
     	if (mac->type == e1000_82544)
    -		e1000_config_collision_dist_generic(hw);
    +		hw->mac.ops.config_collision_dist(hw);
     	else {
     		ret_val = e1000_config_mac_to_phy_82543(hw);
     		if (ret_val) {
    @@ -1433,7 +1433,7 @@ static s32 e1000_config_mac_to_phy_82543
     	if (phy_data & M88E1000_PSSR_DPLX)
     		ctrl |= E1000_CTRL_FD;
     
    -	e1000_config_collision_dist_generic(hw);
    +	hw->mac.ops.config_collision_dist(hw);
     
     	/*
     	 * Set up speed in the Device Control register depending on
    
    Modified: stable/8/sys/dev/e1000/e1000_82571.c
    ==============================================================================
    --- stable/8/sys/dev/e1000/e1000_82571.c	Thu Feb 28 00:18:56 2013	(r247429)
    +++ stable/8/sys/dev/e1000/e1000_82571.c	Thu Feb 28 00:22:04 2013	(r247430)
    @@ -1,6 +1,6 @@
     /******************************************************************************
     
    -  Copyright (c) 2001-2011, Intel Corporation 
    +  Copyright (c) 2001-2013, Intel Corporation 
       All rights reserved.
       
       Redistribution and use in source and binary forms, with or without 
    @@ -32,8 +32,7 @@
     ******************************************************************************/
     /*$FreeBSD$*/
     
    -/*
    - * 82571EB Gigabit Ethernet Controller
    +/* 82571EB Gigabit Ethernet Controller
      * 82571EB Gigabit Ethernet Controller (Copper)
      * 82571EB Gigabit Ethernet Controller (Fiber)
      * 82571EB Dual Port Gigabit Mezzanine Adapter
    @@ -51,9 +50,6 @@
     
     #include "e1000_api.h"
     
    -static s32  e1000_init_phy_params_82571(struct e1000_hw *hw);
    -static s32  e1000_init_nvm_params_82571(struct e1000_hw *hw);
    -static s32  e1000_init_mac_params_82571(struct e1000_hw *hw);
     static s32  e1000_acquire_nvm_82571(struct e1000_hw *hw);
     static void e1000_release_nvm_82571(struct e1000_hw *hw);
     static s32  e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset,
    @@ -78,7 +74,6 @@ static s32  e1000_get_hw_semaphore_82571
     static s32  e1000_fix_nvm_checksum_82571(struct e1000_hw *hw);
     static s32  e1000_get_phy_id_82571(struct e1000_hw *hw);
     static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw);
    -static s32  e1000_get_hw_semaphore_82573(struct e1000_hw *hw);
     static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw);
     static s32  e1000_get_hw_semaphore_82574(struct e1000_hw *hw);
     static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw);
    @@ -99,13 +94,13 @@ static void e1000_power_down_phy_copper_
     static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
     {
     	struct e1000_phy_info *phy = &hw->phy;
    -	s32 ret_val = E1000_SUCCESS;
    +	s32 ret_val;
     
     	DEBUGFUNC("e1000_init_phy_params_82571");
     
     	if (hw->phy.media_type != e1000_media_type_copper) {
     		phy->type = e1000_phy_none;
    -		goto out;
    +		return E1000_SUCCESS;
     	}
     
     	phy->addr			= 1;
    @@ -165,8 +160,7 @@ static s32 e1000_init_phy_params_82571(s
     		phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82574;
     		break;
     	default:
    -		ret_val = -E1000_ERR_PHY;
    -		goto out;
    +		return -E1000_ERR_PHY;
     		break;
     	}
     
    @@ -174,7 +168,7 @@ static s32 e1000_init_phy_params_82571(s
     	ret_val = e1000_get_phy_id_82571(hw);
     	if (ret_val) {
     		DEBUGOUT("Error getting PHY ID\n");
    -		goto out;
    +		return ret_val;
     	}
     
     	/* Verify phy id */
    @@ -201,7 +195,6 @@ static s32 e1000_init_phy_params_82571(s
     	if (ret_val)
     		DEBUGOUT1("PHY ID unknown: type = 0x%08x\n", phy->id);
     
    -out:
     	return ret_val;
     }
     
    @@ -241,8 +234,7 @@ static s32 e1000_init_nvm_params_82571(s
     		if (((eecd >> 15) & 0x3) == 0x3) {
     			nvm->type = e1000_nvm_flash_hw;
     			nvm->word_size = 2048;
    -			/*
    -			 * Autonomous Flash update bit must be cleared due
    +			/* Autonomous Flash update bit must be cleared due
     			 * to Flash update issue.
     			 */
     			eecd &= ~E1000_EECD_AUPDEN;
    @@ -254,8 +246,7 @@ static s32 e1000_init_nvm_params_82571(s
     		nvm->type = e1000_nvm_eeprom_spi;
     		size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
     			     E1000_EECD_SIZE_EX_SHIFT);
    -		/*
    -		 * Added to a constant, "size" becomes the left-shift value
    +		/* Added to a constant, "size" becomes the left-shift value
     		 * for setting word_size.
     		 */
     		size += NVM_WORD_SIZE_BASE_SHIFT;
    @@ -382,12 +373,11 @@ static s32 e1000_init_mac_params_82571(s
     
     		/* FWSM register */
     		mac->has_fwsm = TRUE;
    -		/*
    -		 * ARC supported; valid only if manageability features are
    +		/* ARC supported; valid only if manageability features are
     		 * enabled.
     		 */
    -		mac->arc_subsystem_valid = (E1000_READ_REG(hw, E1000_FWSM) &
    -					   E1000_FWSM_MODE_MASK) ? TRUE : FALSE;
    +		mac->arc_subsystem_valid = !!(E1000_READ_REG(hw, E1000_FWSM) &
    +					      E1000_FWSM_MODE_MASK);
     		break;
     	case e1000_82574:
     	case e1000_82583:
    @@ -405,8 +395,7 @@ static s32 e1000_init_mac_params_82571(s
     		break;
     	}
     
    -	/*
    -	 * Ensure that the inter-port SWSM.SMBI lock bit is clear before
    +	/* Ensure that the inter-port SWSM.SMBI lock bit is clear before
     	 * first NVM or PHY acess. This should be done for single-port
     	 * devices, and for one port only on dual-port devices so that
     	 * for those devices we can still use the SMBI lock to synchronize
    @@ -422,8 +411,9 @@ static s32 e1000_init_mac_params_82571(s
     			E1000_WRITE_REG(hw, E1000_SWSM2, swsm2 |
     					E1000_SWSM2_LOCK);
     			force_clear_smbi = TRUE;
    -		} else
    +		} else {
     			force_clear_smbi = FALSE;
    +		}
     		break;
     	default:
     		force_clear_smbi = TRUE;
    @@ -443,10 +433,7 @@ static s32 e1000_init_mac_params_82571(s
     		E1000_WRITE_REG(hw, E1000_SWSM, swsm & ~E1000_SWSM_SMBI);
     	}
     
    -	/*
    -	 * Initialze device specific counter of SMBI acquisition
    -	 * timeouts.
    -	 */
    +	/* Initialze device specific counter of SMBI acquisition timeouts. */
     	 hw->dev_spec._82571.smb_counter = 0;
     
     	return E1000_SUCCESS;
    @@ -477,7 +464,7 @@ void e1000_init_function_pointers_82571(
     static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
     {
     	struct e1000_phy_info *phy = &hw->phy;
    -	s32 ret_val = E1000_SUCCESS;
    +	s32 ret_val;
     	u16 phy_id = 0;
     
     	DEBUGFUNC("e1000_get_phy_id_82571");
    @@ -485,8 +472,7 @@ static s32 e1000_get_phy_id_82571(struct
     	switch (hw->mac.type) {
     	case e1000_82571:
     	case e1000_82572:
    -		/*
    -		 * The 82571 firmware may still be configuring the PHY.
    +		/* The 82571 firmware may still be configuring the PHY.
     		 * In this case, we cannot access the PHY until the
     		 * configuration is done.  So we explicitly set the
     		 * PHY ID.
    @@ -494,29 +480,29 @@ static s32 e1000_get_phy_id_82571(struct
     		phy->id = IGP01E1000_I_PHY_ID;
     		break;
     	case e1000_82573:
    -		ret_val = e1000_get_phy_id(hw);
    +		return e1000_get_phy_id(hw);
     		break;
     	case e1000_82574:
     	case e1000_82583:
     		ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id);
     		if (ret_val)
    -			goto out;
    +			return ret_val;
     
     		phy->id = (u32)(phy_id << 16);
     		usec_delay(20);
     		ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id);
     		if (ret_val)
    -			goto out;
    +			return ret_val;
     
     		phy->id |= (u32)(phy_id);
     		phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
     		break;
     	default:
    -		ret_val = -E1000_ERR_PHY;
    +		return -E1000_ERR_PHY;
     		break;
     	}
    -out:
    -	return ret_val;
    +
    +	return E1000_SUCCESS;
     }
     
     /**
    @@ -528,15 +514,13 @@ out:
     static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
     {
     	u32 swsm;
    -	s32 ret_val = E1000_SUCCESS;
     	s32 sw_timeout = hw->nvm.word_size + 1;
     	s32 fw_timeout = hw->nvm.word_size + 1;
     	s32 i = 0;
     
     	DEBUGFUNC("e1000_get_hw_semaphore_82571");
     
    -	/*
    -	 * If we have timedout 3 times on trying to acquire
    +	/* If we have timedout 3 times on trying to acquire
     	 * the inter-port SMBI semaphore, there is old code
     	 * operating on the other port, and it is not
     	 * releasing SMBI. Modify the number of times that
    @@ -576,12 +560,10 @@ static s32 e1000_get_hw_semaphore_82571(
     		/* Release semaphores */
     		e1000_put_hw_semaphore_82571(hw);
     		DEBUGOUT("Driver can't access the NVM\n");
    -		ret_val = -E1000_ERR_NVM;
    -		goto out;
    +		return -E1000_ERR_NVM;
     	}
     
    -out:
    -	return ret_val;
    +	return E1000_SUCCESS;
     }
     
     /**
    @@ -613,22 +595,19 @@ static void e1000_put_hw_semaphore_82571
     static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw)
     {
     	u32 extcnf_ctrl;
    -	s32 ret_val = E1000_SUCCESS;
     	s32 i = 0;
     
     	DEBUGFUNC("e1000_get_hw_semaphore_82573");
     
     	extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL);
    -	extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
     	do {
    +		extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
     		E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl);
     		extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL);
     
     		if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP)
     			break;
     
    -		extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
    -
     		msec_delay(2);
     		i++;
     	} while (i < MDIO_OWNERSHIP_TIMEOUT);
    @@ -637,12 +616,10 @@ static s32 e1000_get_hw_semaphore_82573(
     		/* Release semaphores */
     		e1000_put_hw_semaphore_82573(hw);
     		DEBUGOUT("Driver can't access the PHY\n");
    -		ret_val = -E1000_ERR_PHY;
    -		goto out;
    +		return -E1000_ERR_PHY;
     	}
     
    -out:
    -	return ret_val;
    +	return E1000_SUCCESS;
     }
     
     /**
    @@ -712,7 +689,7 @@ static void e1000_put_hw_semaphore_82574
      **/
     static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active)
     {
    -	u16 data = E1000_READ_REG(hw, E1000_POEMB);
    +	u32 data = E1000_READ_REG(hw, E1000_POEMB);
     
     	DEBUGFUNC("e1000_set_d0_lplu_state_82574");
     
    @@ -738,7 +715,7 @@ static s32 e1000_set_d0_lplu_state_82574
      **/
     static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active)
     {
    -	u16 data = E1000_READ_REG(hw, E1000_POEMB);
    +	u32 data = E1000_READ_REG(hw, E1000_POEMB);
     
     	DEBUGFUNC("e1000_set_d3_lplu_state_82574");
     
    @@ -771,7 +748,7 @@ static s32 e1000_acquire_nvm_82571(struc
     
     	ret_val = e1000_get_hw_semaphore_82571(hw);
     	if (ret_val)
    -		goto out;
    +		return ret_val;
     
     	switch (hw->mac.type) {
     	case e1000_82573:
    @@ -784,7 +761,6 @@ static s32 e1000_acquire_nvm_82571(struc
     	if (ret_val)
     		e1000_put_hw_semaphore_82571(hw);
     
    -out:
     	return ret_val;
     }
     
    @@ -817,7 +793,7 @@ static void e1000_release_nvm_82571(stru
     static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words,
     				 u16 *data)
     {
    -	s32 ret_val = E1000_SUCCESS;
    +	s32 ret_val;
     
     	DEBUGFUNC("e1000_write_nvm_82571");
     
    @@ -857,31 +833,27 @@ static s32 e1000_update_nvm_checksum_825
     
     	ret_val = e1000_update_nvm_checksum_generic(hw);
     	if (ret_val)
    -		goto out;
    +		return ret_val;
     
    -	/*
    -	 * If our nvm is an EEPROM, then we're done
    +	/* If our nvm is an EEPROM, then we're done
     	 * otherwise, commit the checksum to the flash NVM.
     	 */
     	if (hw->nvm.type != e1000_nvm_flash_hw)
    -		goto out;
    +		return E1000_SUCCESS;
     
     	/* Check for pending operations. */
     	for (i = 0; i < E1000_FLASH_UPDATES; i++) {
     		msec_delay(1);
    -		if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) == 0)
    +		if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD))
     			break;
     	}
     
    -	if (i == E1000_FLASH_UPDATES) {
    -		ret_val = -E1000_ERR_NVM;
    -		goto out;
    -	}
    +	if (i == E1000_FLASH_UPDATES)
    +		return -E1000_ERR_NVM;
     
     	/* Reset the firmware if using STM opcode. */
     	if ((E1000_READ_REG(hw, E1000_FLOP) & 0xFF00) == E1000_STM_OPCODE) {
    -		/*
    -		 * The enabling of and the actual reset must be done
    +		/* The enabling of and the actual reset must be done
     		 * in two write cycles.
     		 */
     		E1000_WRITE_REG(hw, E1000_HICR, E1000_HICR_FW_RESET_ENABLE);
    @@ -895,17 +867,14 @@ static s32 e1000_update_nvm_checksum_825
     
     	for (i = 0; i < E1000_FLASH_UPDATES; i++) {
     		msec_delay(1);
    -		if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) == 0)
    +		if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD))
     			break;
     	}
     
    -	if (i == E1000_FLASH_UPDATES) {
    -		ret_val = -E1000_ERR_NVM;
    -		goto out;
    -	}
    +	if (i == E1000_FLASH_UPDATES)
    +		return -E1000_ERR_NVM;
     
    -out:
    -	return ret_val;
    +	return E1000_SUCCESS;
     }
     
     /**
    @@ -944,19 +913,17 @@ static s32 e1000_write_nvm_eewr_82571(st
     {
     	struct e1000_nvm_info *nvm = &hw->nvm;
     	u32 i, eewr = 0;
    -	s32 ret_val = 0;
    +	s32 ret_val = E1000_SUCCESS;
     
     	DEBUGFUNC("e1000_write_nvm_eewr_82571");
     
    -	/*
    -	 * A check for invalid values:  offset too large, too many words,
    +	/* A check for invalid values:  offset too large, too many words,
     	 * and not enough words.
     	 */
     	if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
     	    (words == 0)) {
     		DEBUGOUT("nvm parameter(s) out of bounds\n");
    -		ret_val = -E1000_ERR_NVM;
    -		goto out;
    +		return -E1000_ERR_NVM;
     	}
     
     	for (i = 0; i < words; i++) {
    @@ -975,7 +942,6 @@ static s32 e1000_write_nvm_eewr_82571(st
     			break;
     	}
     
    -out:
     	return ret_val;
     }
     
    @@ -988,7 +954,6 @@ out:
     static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)
     {
     	s32 timeout = PHY_CFG_TIMEOUT;
    -	s32 ret_val = E1000_SUCCESS;
     
     	DEBUGFUNC("e1000_get_cfg_done_82571");
     
    @@ -1001,12 +966,10 @@ static s32 e1000_get_cfg_done_82571(stru
     	}
     	if (!timeout) {
     		DEBUGOUT("MNG configuration cycle has not completed.\n");
    -		ret_val = -E1000_ERR_RESET;
    -		goto out;
    +		return -E1000_ERR_RESET;
     	}
     
    -out:
    -	return ret_val;
    +	return E1000_SUCCESS;
     }
     
     /**
    @@ -1023,39 +986,40 @@ out:
     static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
     {
     	struct e1000_phy_info *phy = &hw->phy;
    -	s32 ret_val = E1000_SUCCESS;
    +	s32 ret_val;
     	u16 data;
     
     	DEBUGFUNC("e1000_set_d0_lplu_state_82571");
     
     	if (!(phy->ops.read_reg))
    -		goto out;
    +		return E1000_SUCCESS;
     
     	ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data);
     	if (ret_val)
    -		goto out;
    +		return ret_val;
     
     	if (active) {
     		data |= IGP02E1000_PM_D0_LPLU;
     		ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
     					     data);
     		if (ret_val)
    -			goto out;
    +			return ret_val;
     
     		/* When LPLU is enabled, we should disable SmartSpeed */
     		ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
     					    &data);
    +		if (ret_val)
    +			return ret_val;
     		data &= ~IGP01E1000_PSCFR_SMART_SPEED;
     		ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
     					     data);
     		if (ret_val)
    -			goto out;
    +			return ret_val;
     	} else {
     		data &= ~IGP02E1000_PM_D0_LPLU;
     		ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
     					     data);
    -		/*
    -		 * LPLU and SmartSpeed are mutually exclusive.  LPLU is used
    +		/* LPLU and SmartSpeed are mutually exclusive.  LPLU is used
     		 * during Dx states where the power conservation is most
     		 * important.  During driver activity we should enable
     		 * SmartSpeed, so performance is maintained.
    @@ -1065,32 +1029,31 @@ static s32 e1000_set_d0_lplu_state_82571
     						    IGP01E1000_PHY_PORT_CONFIG,
     						    &data);
     			if (ret_val)
    -				goto out;
    +				return ret_val;
     
     			data |= IGP01E1000_PSCFR_SMART_SPEED;
     			ret_val = phy->ops.write_reg(hw,
     						     IGP01E1000_PHY_PORT_CONFIG,
     						     data);
     			if (ret_val)
    -				goto out;
    +				return ret_val;
     		} else if (phy->smart_speed == e1000_smart_speed_off) {
     			ret_val = phy->ops.read_reg(hw,
     						    IGP01E1000_PHY_PORT_CONFIG,
     						    &data);
     			if (ret_val)
    -				goto out;
    +				return ret_val;
     
     			data &= ~IGP01E1000_PSCFR_SMART_SPEED;
     			ret_val = phy->ops.write_reg(hw,
     						     IGP01E1000_PHY_PORT_CONFIG,
     						     data);
     			if (ret_val)
    -				goto out;
    +				return ret_val;
     		}
     	}
     
    -out:
    -	return ret_val;
    +	return E1000_SUCCESS;
     }
     
     /**
    @@ -1101,13 +1064,12 @@ out:
      **/
     static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
     {
    -	u32 ctrl, ctrl_ext;
    +	u32 ctrl, ctrl_ext, eecd, tctl;
     	s32 ret_val;
     
     	DEBUGFUNC("e1000_reset_hw_82571");
     
    -	/*
    -	 * Prevent the PCI-E bus from sticking if there is no TLP connection
    +	/* Prevent the PCI-E bus from sticking if there is no TLP connection
     	 * on the last TLP read/write transaction when MAC is reset.
     	 */
     	ret_val = e1000_disable_pcie_master_generic(hw);
    @@ -1118,13 +1080,14 @@ static s32 e1000_reset_hw_82571(struct e
     	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
     
     	E1000_WRITE_REG(hw, E1000_RCTL, 0);
    -	E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP);
    +	tctl = E1000_READ_REG(hw, E1000_TCTL);
    +	tctl &= ~E1000_TCTL_EN;
    +	E1000_WRITE_REG(hw, E1000_TCTL, tctl);
     	E1000_WRITE_FLUSH(hw);
     
     	msec_delay(10);
     
    -	/*
    -	 * Must acquire the MDIO ownership before MAC reset.
    +	/* Must acquire the MDIO ownership before MAC reset.
     	 * Ownership defaults to firmware after a reset.
     	 */
     	switch (hw->mac.type) {
    @@ -1167,15 +1130,23 @@ static s32 e1000_reset_hw_82571(struct e
     	ret_val = e1000_get_auto_rd_done_generic(hw);
     	if (ret_val)
     		/* We don't want to continue accessing MAC registers. */
    -		goto out;
    +		return ret_val;
     
    -	/*
    -	 * Phy configuration from NVM just starts after EECD_AUTO_RD is set.
    +	/* Phy configuration from NVM just starts after EECD_AUTO_RD is set.
     	 * Need to wait for Phy configuration completion before accessing
     	 * NVM and Phy.
     	 */
     
     	switch (hw->mac.type) {
    +	case e1000_82571:
    +	case e1000_82572:
    +		/* REQ and GNT bits need to be cleared when using AUTO_RD
    +		 * to access the EEPROM.
    +		 */
    +		eecd = E1000_READ_REG(hw, E1000_EECD);
    +		eecd &= ~(E1000_EECD_REQ | E1000_EECD_GNT);
    +		E1000_WRITE_REG(hw, E1000_EECD, eecd);
    +		break;
     	case e1000_82573:
     	case e1000_82574:
     	case e1000_82583:
    @@ -1193,7 +1164,7 @@ static s32 e1000_reset_hw_82571(struct e
     		/* Install any alternate MAC address into RAR0 */
     		ret_val = e1000_check_alt_mac_addr_generic(hw);
     		if (ret_val)
    -			goto out;
    +			return ret_val;
     
     		e1000_set_laa_state_82571(hw, TRUE);
     	}
    @@ -1202,8 +1173,7 @@ static s32 e1000_reset_hw_82571(struct e
     	if (hw->phy.media_type == e1000_media_type_internal_serdes)
     		hw->mac.serdes_link_state = e1000_serdes_link_down;
     
    -out:
    -	return ret_val;
    +	return E1000_SUCCESS;
     }
     
     /**
    @@ -1225,16 +1195,15 @@ static s32 e1000_init_hw_82571(struct e1
     
     	/* Initialize identification LED */
     	ret_val = mac->ops.id_led_init(hw);
    +	/* An error is not fatal and we should not stop init due to this */
     	if (ret_val)
     		DEBUGOUT("Error initializing identification LED\n");
    -		/* This is not fatal and we should not stop init due to this */
     
     	/* Disabling VLAN filtering */
     	DEBUGOUT("Initializing the IEEE VLAN\n");
     	mac->ops.clear_vfta(hw);
     
    -	/* Setup the receive address. */
    -	/*
    +	/* Setup the receive address.
     	 * If, however, a locally administered address was assigned to the
     	 * 82571, we must reserve a RAR for it to work around an issue where
     	 * resetting one port will reload the MAC on the other port.
    @@ -1277,8 +1246,7 @@ static s32 e1000_init_hw_82571(struct e1
     		break;
     	}
     
    -	/*
    -	 * Clear all of the statistics registers (clear on read).  It is
    +	/* Clear all of the statistics registers (clear on read).  It is
     	 * important that we do this after we have tried to establish link
     	 * because the symbol error count will increment wildly if there
     	 * is no link.
    @@ -1377,8 +1345,7 @@ static void e1000_initialize_hw_bits_825
     		E1000_WRITE_REG(hw, E1000_PBA_ECC, reg);
     	}
     
    -	/*
    -	 * Workaround for hardware errata.
    +	/* Workaround for hardware errata.
     	 * Ensure that DMA Dynamic Clock gating is disabled on 82571 and 82572
     	 */
     	if ((hw->mac.type == e1000_82571) ||
    @@ -1388,6 +1355,15 @@ static void e1000_initialize_hw_bits_825
     		E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg);
     	}
     
    +	/* Disable IPv6 extension header parsing because some malformed
    +	 * IPv6 headers can hang the Rx.
    +	 */
    +	if (hw->mac.type <= e1000_82573) {
    +		reg = E1000_READ_REG(hw, E1000_RFCTL);
    +		reg |= (E1000_RFCTL_IPV6_EX_DIS | E1000_RFCTL_NEW_IPV6_EXT_DIS);
    +		E1000_WRITE_REG(hw, E1000_RFCTL, reg);
    +	}
    +
     	/* PCI-Ex Control Registers */
     	switch (hw->mac.type) {
     	case e1000_82574:
    @@ -1396,8 +1372,7 @@ static void e1000_initialize_hw_bits_825
     		reg |= (1 << 22);
     		E1000_WRITE_REG(hw, E1000_GCR, reg);
     
    -		/*
    -		 * Workaround for hardware errata.
    +		/* Workaround for hardware errata.
     		 * apply workaround for hardware errata documented in errata
     		 * docs Fixes issue where some error prone or unreliable PCIe
     		 * completions are occurring, particularly with ASPM enabled.
    @@ -1435,25 +1410,25 @@ static void e1000_clear_vfta_82571(struc
     	case e1000_82574:
     	case e1000_82583:
     		if (hw->mng_cookie.vlan_id != 0) {
    -			/*
    -			 * The VFTA is a 4096b bit-field, each identifying
    +			/* The VFTA is a 4096b bit-field, each identifying
     			 * a single VLAN ID.  The following operations
     			 * determine which 32b entry (i.e. offset) into the
     			 * array we want to set the VLAN ID (i.e. bit) of
     			 * the manageability unit.
     			 */
     			vfta_offset = (hw->mng_cookie.vlan_id >>
    -				E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_MASK;
    -			vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id &
    -				E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
    +				       E1000_VFTA_ENTRY_SHIFT) &
    +			    E1000_VFTA_ENTRY_MASK;
    +			vfta_bit_in_reg =
    +			    1 << (hw->mng_cookie.vlan_id &
    +				  E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
     		}
     		break;
     	default:
     		break;
     	}
     	for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) {
    -		/*
    -		 * If the offset we want to clear is the same offset of the
    +		/* If the offset we want to clear is the same offset of the
     		 * manageability VLAN ID, then clear all bits except that of
     		 * the manageability unit.
     		 */
    @@ -1495,8 +1470,7 @@ static s32 e1000_led_on_82574(struct e10
     
     	ctrl = hw->mac.ledctl_mode2;
     	if (!(E1000_STATUS_LU & E1000_READ_REG(hw, E1000_STATUS))) {
    -		/*
    -		 * If no link, then turn LED on by setting the invert bit
    +		/* If no link, then turn LED on by setting the invert bit
     		 * for each LED that's "on" (0x0E) in ledctl_mode2.
     		 */
     		for (i = 0; i < 4; i++)
    @@ -1519,30 +1493,28 @@ bool e1000_check_phy_82574(struct e1000_
     {
     	u16 status_1kbt = 0;
     	u16 receive_errors = 0;
    -	bool phy_hung = FALSE;
    -	s32 ret_val = E1000_SUCCESS;
    +	s32 ret_val;
     
     	DEBUGFUNC("e1000_check_phy_82574");
     
    -	/*
    -	 * Read PHY Receive Error counter first, if its is max - all F's then
    +	/* Read PHY Receive Error counter first, if its is max - all F's then
     	 * read the Base1000T status register If both are max then PHY is hung.
     	 */
     	ret_val = hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER,
     				       &receive_errors);
     	if (ret_val)
    -		goto out;
    +		return FALSE;
     	if (receive_errors == E1000_RECEIVE_ERROR_MAX) {
     		ret_val = hw->phy.ops.read_reg(hw, E1000_BASE1000T_STATUS,
     					       &status_1kbt);
     		if (ret_val)
    -			goto out;
    +			return FALSE;
     		if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) ==
     		    E1000_IDLE_ERROR_COUNT_MASK)
    -			phy_hung = TRUE;
    +			return TRUE;
     	}
    -out:
    -	return phy_hung;
    +
    +	return FALSE;
     }
     
     
    @@ -1560,8 +1532,7 @@ static s32 e1000_setup_link_82571(struct
     {
     	DEBUGFUNC("e1000_setup_link_82571");
     
    -	/*
    -	 * 82573 does not have a word in the NVM to determine
    +	/* 82573 does not have a word in the NVM to determine
     	 * the default flow control setting, so we explicitly
     	 * set it to full.
     	 */
    @@ -1608,17 +1579,14 @@ static s32 e1000_setup_copper_link_82571
     		ret_val = e1000_copper_link_setup_igp(hw);
     		break;
     	default:
    -		ret_val = -E1000_ERR_PHY;
    +		return -E1000_ERR_PHY;
     		break;
     	}
     
     	if (ret_val)
    -		goto out;
    -
    -	ret_val = e1000_setup_copper_link_generic(hw);
    +		return ret_val;
     
    -out:
    -	return ret_val;
    +	return e1000_setup_copper_link_generic(hw);
     }
     
     /**
    @@ -1635,8 +1603,7 @@ static s32 e1000_setup_fiber_serdes_link
     	switch (hw->mac.type) {
     	case e1000_82571:
     	case e1000_82572:
    -		/*
    -		 * If SerDes loopback mode is entered, there is no form
    +		/* If SerDes loopback mode is entered, there is no form
     		 * of reset to take the adapter out of that mode.  So we
     		 * have to explicitly take the adapter out of loopback
     		 * mode.  This prevents drivers from twiddling their thumbs
    @@ -1685,16 +1652,17 @@ static s32 e1000_check_for_serdes_link_8
     
     	ctrl = E1000_READ_REG(hw, E1000_CTRL);
     	status = E1000_READ_REG(hw, E1000_STATUS);
    +	E1000_READ_REG(hw, E1000_RXCW);
    +	/* SYNCH bit and IV bit are sticky */
    +	usec_delay(10);
     	rxcw = E1000_READ_REG(hw, E1000_RXCW);
     
     	if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) {
    -
     		/* Receiver is synchronized with no invalid bits.  */
     		switch (mac->serdes_link_state) {
     		case e1000_serdes_link_autoneg_complete:
     			if (!(status & E1000_STATUS_LU)) {
    -				/*
    -				 * We have lost link, retry autoneg before
    +				/* We have lost link, retry autoneg before
     				 * reporting link failure
     				 */
     				mac->serdes_link_state =
    @@ -1707,15 +1675,12 @@ static s32 e1000_check_for_serdes_link_8
     			break;
     
     		case e1000_serdes_link_forced_up:
    -			/*
    -			 * If we are receiving /C/ ordered sets, re-enable
    +			/* If we are receiving /C/ ordered sets, re-enable
     			 * auto-negotiation in the TXCW register and disable
     			 * forced link in the Device Control register in an
     			 * attempt to auto-negotiate with our link partner.
    -			 * If the partner code word is null, stop forcing
    -			 * and restart auto negotiation.
     			 */
    -			if ((rxcw & E1000_RXCW_C) || !(rxcw & E1000_RXCW_CW))  {
    +			if (rxcw & E1000_RXCW_C) {
     				/* Enable autoneg, and unforce link up */
     				E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw);
     				E1000_WRITE_REG(hw, E1000_CTRL,
    @@ -1731,8 +1696,7 @@ static s32 e1000_check_for_serdes_link_8
     
     		case e1000_serdes_link_autoneg_progress:
     			if (rxcw & E1000_RXCW_C) {
    -				/*
    -				 * We received /C/ ordered sets, meaning the
    +				/* We received /C/ ordered sets, meaning the
     				 * link partner has autonegotiated, and we can
     				 * trust the Link Up (LU) status bit.
     				 */
    @@ -1748,8 +1712,7 @@ static s32 e1000_check_for_serdes_link_8
     					DEBUGOUT("AN_PROG   -> DOWN\n");
     				}
     			} else {
    -				/*
    -				 * The link partner did not autoneg.
    +				/* The link partner did not autoneg.
     				 * Force link up and full duplex, and change
     				 * state to forced.
     				 */
    @@ -1774,8 +1737,7 @@ static s32 e1000_check_for_serdes_link_8
     
     		case e1000_serdes_link_down:
     		default:
    -			/*
    -			 * The link was down but the receiver has now gained
    +			/* The link was down but the receiver has now gained
     			 * valid sync, so lets see if we can bring the link
     			 * up.
     			 */
    @@ -1794,17 +1756,18 @@ static s32 e1000_check_for_serdes_link_8
     			mac->serdes_link_state = e1000_serdes_link_down;
     			DEBUGOUT("ANYSTATE  -> DOWN\n");
     		} else {
    -			/*
    -			 * Check several times, if Sync and Config
    -			 * both are consistently 1 then simply ignore
    -			 * the Invalid bit and restart Autoneg
    +			/* Check several times, if SYNCH bit and CONFIG
    +			 * bit both are consistently 1 then simply ignore
    +			 * the IV bit and restart Autoneg
     			 */
     			for (i = 0; i < AN_RETRY_COUNT; i++) {
     				usec_delay(10);
     				rxcw = E1000_READ_REG(hw, E1000_RXCW);
    -				if ((rxcw & E1000_RXCW_IV) &&
    -				    !((rxcw & E1000_RXCW_SYNCH) &&
    -				      (rxcw & E1000_RXCW_C))) {
    +				if ((rxcw & E1000_RXCW_SYNCH) &&
    +				    (rxcw & E1000_RXCW_C))
    +					continue;
    +
    +				if (rxcw & E1000_RXCW_IV) {
     					mac->serdes_has_link = FALSE;
     					mac->serdes_link_state =
     							e1000_serdes_link_down;
    @@ -1845,7 +1808,7 @@ static s32 e1000_valid_led_default_82571
     	ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data);
     	if (ret_val) {
     		DEBUGOUT("NVM Read Error\n");
    -		goto out;
    +		return ret_val;
     	}
     
     	switch (hw->mac.type) {
    @@ -1862,8 +1825,7 @@ static s32 e1000_valid_led_default_82571
     		break;
     	}
     
    -out:
    -	return ret_val;
    +	return E1000_SUCCESS;
     }
     
     /**
    @@ -1900,15 +1862,14 @@ void e1000_set_laa_state_82571(struct e1
     
     	/* If workaround is activated... */
     	if (state)
    -		/*
    -		 * Hold a copy of the LAA in RAR[14] This is done so that
    +		/* Hold a copy of the LAA in RAR[14] This is done so that
     		 * between the time RAR[0] gets clobbered and the time it
     		 * gets fixed, the actual LAA is in one of the RARs and no
     		 * incoming packets directed to this port are dropped.
     		 * Eventually the LAA will be in RAR[0] and RAR[14].
     		 */
    -		e1000_rar_set_generic(hw, hw->mac.addr,
    -				      hw->mac.rar_entry_count - 1);
    +		hw->mac.ops.rar_set(hw, hw->mac.addr,
    +				    hw->mac.rar_entry_count - 1);
     	return;
     }
     
    @@ -1925,25 +1886,23 @@ void e1000_set_laa_state_82571(struct e1
     static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
     {
     	struct e1000_nvm_info *nvm = &hw->nvm;
    -	s32 ret_val = E1000_SUCCESS;
    +	s32 ret_val;
     	u16 data;
     
     	DEBUGFUNC("e1000_fix_nvm_checksum_82571");
     
     	if (nvm->type != e1000_nvm_flash_hw)
    -		goto out;
    +		return E1000_SUCCESS;
     
    -	/*
    -	 * Check bit 4 of word 10h.  If it is 0, firmware is done updating
    +	/* Check bit 4 of word 10h.  If it is 0, firmware is done updating
     	 * 10h-12h.  Checksum may need to be fixed.
     	 */
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 00:44:56 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 7CC9F2A1;
     Thu, 28 Feb 2013 00:44:56 +0000 (UTC) (envelope-from np@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 6B9E0DBC;
     Thu, 28 Feb 2013 00:44:56 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S0iuQZ071137;
     Thu, 28 Feb 2013 00:44:56 GMT (envelope-from np@svn.freebsd.org)
    Received: (from np@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S0isq2071124;
     Thu, 28 Feb 2013 00:44:54 GMT (envelope-from np@svn.freebsd.org)
    Message-Id: <201302280044.r1S0isq2071124@svn.freebsd.org>
    From: Navdeep Parhar 
    Date: Thu, 28 Feb 2013 00:44: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: r247434 - in stable/9: share/man/man4 sys/conf
     sys/dev/cxgb/ulp/tom sys/dev/cxgbe sys/dev/cxgbe/common
     sys/dev/cxgbe/firmware sys/dev/cxgbe/tom sys/modules/cxgbe/firmware
     sys/modules/cx...
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 00:44:56 -0000
    
    Author: np
    Date: Thu Feb 28 00:44:54 2013
    New Revision: 247434
    URL: http://svnweb.freebsd.org/changeset/base/247434
    
    Log:
      MFC r245243, r245274, r245276, r245434, r245441, r245448, r245467,
      r245468, r245517, r245518, r245520, r245567, r245933, r245935, r245936,
      r245937, r246093, r246385, r246575, r247062, r247122, r247289, r247291,
      r247347, r247355, and r241733.
      
      Note that TCP_OFFLOAD is not enabled in 9 yet and so some of these MFCs
      don't really affect functionality.  But they do help future MFCs
      (related to TCP_OFFLOAD or not) by minimizing diffs with the driver in
      head.
      
      r245243:
      cxgbe(4): updates to the configuration file that controls how hardware
      resources are partitioned.
      
      - Reduce the number of virtual interfaces reserved for PF4.  This leaves
        spare room in the source MAC table and allows the driver to setup
        filters that rewrite the source MAC address.
      
      - Reduce the number of filters and use the freed up space for the CLIP
        (Compressed Local IPv6 addresses) table.  This is a prerequisite for
        IPv6 TOE support which will follow separately in a series of commits.
      
      r245274:
      cxgbe(4): Add functions to help synchronize "slow" operations (those not
      on the fast data path) and use them instead of frobbing the adapter lock
      and busy flag directly.
      
      Other changes made while reworking all slow operations:
      - Wait for the reply to a filter request (add/delete).  This guarantees
        that the operation is complete by the time the ioctl returns.
      - Tidy up the tid_info structure.
      - Do not allow the tx queue size to be set to something that's not a
        power of 2.
      
      r245276:
      Overhaul the stid allocator so that it can be used for IPv6 servers
      too.  The entry for an IPv6 server in the TCAM takes up the equivalent
      of two ordinary stids and must be properly aligned too.
      
      r245434:
      cxgbe(4): Updates to the hardware L2 table management code.
      
      - Add full support for IPv6 addresses.
      
      - Read the size of the L2 table during attach.  Do not assume that PCIe
        physical function 4 of the card has all of the table to itself.
      
      - Use FNV instead of Jenkins to hash L3 addresses and drop the private
        copy of jhash.h from the driver.
      
      r245441:
      cxgbe/tom: Miscellaneous updates for TOE+IPv6 support (more to follow).
      
      - Teach find_best_mtu_idx() to deal with IPv6 endpoints.
      
      - Install correct protosw in offloaded TCP/IPv6 sockets when DDP is
        enabled.
      
      - Move set_tcp_ddp_ulp_mode to t4_tom.c so that t4_tom.h can be included
        without having to drag in t4_msg.h too.  This was bothering the iWARP
        driver for some reason.
      
      r245448:
      cxgbe/tom: Basic CLIP table management.
      
      This is the Compressed Local IPv6 table on the chip.  To save space, the
      chip uses an index into this table instead of a full IPv6 address in
      some of its hardware data structures.
      
      For now the driver fills this table with all the local IPv6 addresses
      that it sees at the time the table is initialized.  I'll improve this
      later so that the table is updated whenever new IPv6 addresses are
      configured or existing ones deleted.
      
      r245467:
      cxgbe/tom: Add support for fully offloaded TCP/IPv6 connections (active open).
      
      r245468:
      cxgbe/tom: Add support for fully offloaded TCP/IPv6 connections (passive open).
      
      r245517:
      cxgbe: Fix the for_each_foo macros -- the last argument should not share
      its name with any member of struct sge.
      
      r245518:
      cxgbe:  Do a more thorough job in the CLEAR_STATS ioctl.
      
      r245520:
      Allow "ivlan" (inner VLAN) to be used as an alias for "vlan" when
      specifying match criteria.  "vlan" continues to be valid here, and it
      continues to be valid when deleting, rewriting, inserting, or stacking
      an 802.1q tag to a matching packet.
      
      r245567:
      cxgbe: Make the for_each macros safer to use by turning them
      into a single statement each.
      
      r245933:
      cxgbe/tom: List IFCAP_TOE6 as supported now that all the required pieces
      are in place.  You still have to enable it explicitly, after loading the
      t4_tom KLD.
      
      r245935:
      Add a couple of missing error codes.  Treat CPL_ERR_KEEPALV_NEG_ADVICE as
      negative advice and not a fatal error.
      
      r245936:
      Force the 404-BT card (4 x 1G) to use the "uwire" configuration file.
      
      r245937:
      Install an extra hold on the newly allocated synq entry so that it
      cannot be freed while do_pass_accept_req is running.  This closes a race
      where do_pass_establish on another CPU (the driver chose a different
      queue for the new tid) expands the synq entry into a full PCB and then
      releases the only hold on it, all while do_pass_accept_req is still
      running.
      
      r246093:
      Provide a statistic to track the number of drops in each of the port's
      txq's buf_ring.  The aggregate for all the queues of a port is already
      provided in ifnet->if_snd.ifq_drops.
      
      r246385:
      Busy-wait when cold.
      
      r246575:
      Do not hold locks around hardware context reads.
      
      r247062:
      cxgbe(4): Assume that CSUM_TSO in the transmit path implies CSUM_IP and
      CSUM_TCP too.  They are all set explicitly by the kernel usually.
      
      r247122:
      cxgbe(4): Add sysctls to extract debug information from the chip:
      
      dev.t4nex.X.misc.cim_la         logic analyzer dump
      dev.t4nex.X.misc.cim_qcfg       queue configuration
      dev.t4nex.X.misc.cim_ibq_xxx    inbound queues
      dev.t4nex.X.misc.cim_obq_xxx    outbound queues
      
      r247289:
      cxgbe(4): Update firmware to 1.8.4.0.
      
      r247291:
      cxgbe(4): Ask the card's firmware to pad up tiny CPLs by encapsulating
      them in a firmware message if it is able to do so.  This works out
      better for one of the FIFOs in the chip.
      
      r247347:
      cxgbe(4): Consider all the API versions of the interfaces exported by
      the firmware (instead of just the main firmware version) when evaluating
      firmware compatibility.  Document the new "hw.cxgbe.fw_install" knob
      being introduced here.
      
      This should fix kern/173584 too.  Setting hw.cxgbe.fw_install=2 will
      mostly do what was requested in the PR but it's a bit more intelligent
      in that it won't reinstall the same firmware repeatedly if the knob is
      left set.
      
      r247355:
      cxgbe(4): Report unusual out of band errors from the firmware.
      
      r241733 (by ed@):
      Prefer __containerof() over __member2struct().
      
      The former works better with qualifiers, but also properly type checks
      the input pointer.
    
    Added:
      stable/9/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu
         - copied unchanged from r247289, head/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu
    Deleted:
      stable/9/sys/dev/cxgbe/common/jhash.h
      stable/9/sys/dev/cxgbe/firmware/t4fw-1.6.2.0.bin.uu
    Modified:
      stable/9/share/man/man4/cxgbe.4
      stable/9/sys/conf/files
      stable/9/sys/dev/cxgb/ulp/tom/cxgb_tom.h
      stable/9/sys/dev/cxgbe/adapter.h
      stable/9/sys/dev/cxgbe/common/common.h
      stable/9/sys/dev/cxgbe/common/t4_hw.c
      stable/9/sys/dev/cxgbe/common/t4_hw.h
      stable/9/sys/dev/cxgbe/common/t4_msg.h
      stable/9/sys/dev/cxgbe/firmware/t4fw_cfg.txt
      stable/9/sys/dev/cxgbe/firmware/t4fw_interface.h
      stable/9/sys/dev/cxgbe/offload.h
      stable/9/sys/dev/cxgbe/t4_l2t.c
      stable/9/sys/dev/cxgbe/t4_l2t.h
      stable/9/sys/dev/cxgbe/t4_main.c
      stable/9/sys/dev/cxgbe/t4_sge.c
      stable/9/sys/dev/cxgbe/tom/t4_connect.c
      stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c
      stable/9/sys/dev/cxgbe/tom/t4_listen.c
      stable/9/sys/dev/cxgbe/tom/t4_tom.c
      stable/9/sys/dev/cxgbe/tom/t4_tom.h
      stable/9/sys/dev/cxgbe/tom/t4_tom_l2t.c
      stable/9/sys/modules/cxgbe/firmware/Makefile
      stable/9/sys/modules/cxgbe/tom/Makefile
      stable/9/tools/tools/cxgbetool/cxgbetool.c
    Directory Properties:
      stable/9/share/man/man4/   (props changed)
      stable/9/sys/   (props changed)
      stable/9/sys/conf/   (props changed)
      stable/9/sys/dev/   (props changed)
      stable/9/sys/modules/   (props changed)
      stable/9/tools/tools/cxgbetool/   (props changed)
    
    Modified: stable/9/share/man/man4/cxgbe.4
    ==============================================================================
    --- stable/9/share/man/man4/cxgbe.4	Thu Feb 28 00:30:35 2013	(r247433)
    +++ stable/9/share/man/man4/cxgbe.4	Thu Feb 28 00:44:54 2013	(r247434)
    @@ -178,6 +178,15 @@ Bit 0 represents INTx (line interrupts),
     The default is 7 (all allowed).
     The driver will select the best possible type out of the allowed types by
     itself.
    +.It Va hw.cxgbe.fw_install
    +0 prohibits the driver from installing a firmware on the card.
    +1 allows the driver to install a new firmware if internal driver
    +heuristics indicate that the new firmware is preferable to the one
    +already on the card.
    +2 instructs the driver to always install the new firmware on the card as
    +long as it is compatible with the driver and is a different version than
    +the one already on the card.
    +The default is 1.
     .It Va hw.cxgbe.config_file
     Select a pre-packaged device configuration file.
     A configuration file contains a recipe for partitioning and configuring the
    
    Modified: stable/9/sys/conf/files
    ==============================================================================
    --- stable/9/sys/conf/files	Thu Feb 28 00:30:35 2013	(r247433)
    +++ stable/9/sys/conf/files	Thu Feb 28 00:44:54 2013	(r247434)
    @@ -959,7 +959,7 @@ t4fw.fwo		optional cxgbe					\
     	no-implicit-rule						\
     	clean		"t4fw.fwo"
     t4fw.fw			optional cxgbe					\
    -	dependency	"$S/dev/cxgbe/firmware/t4fw-1.6.2.0.bin.uu"	\
    +	dependency	"$S/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu"	\
     	compile-with	"${NORMAL_FW}"					\
     	no-obj no-implicit-rule						\
     	clean		"t4fw.fw"
    
    Modified: stable/9/sys/dev/cxgb/ulp/tom/cxgb_tom.h
    ==============================================================================
    --- stable/9/sys/dev/cxgb/ulp/tom/cxgb_tom.h	Thu Feb 28 00:30:35 2013	(r247433)
    +++ stable/9/sys/dev/cxgb/ulp/tom/cxgb_tom.h	Thu Feb 28 00:44:54 2013	(r247434)
    @@ -142,7 +142,8 @@ void t3_process_tid_release_list(void *d
     static inline struct tom_data *
     t3_tomdata(struct toedev *tod)
     {
    -	return (member2struct(tom_data, tod, tod));
    +
    +	return (__containerof(tod, struct tom_data, tod));
     }
     
     union listen_entry {
    
    Modified: stable/9/sys/dev/cxgbe/adapter.h
    ==============================================================================
    --- stable/9/sys/dev/cxgbe/adapter.h	Thu Feb 28 00:30:35 2013	(r247433)
    +++ stable/9/sys/dev/cxgbe/adapter.h	Thu Feb 28 00:44:54 2013	(r247434)
    @@ -158,6 +158,16 @@ enum {
     };
     
     enum {
    +	/* flags understood by begin_synchronized_op */
    +	HOLD_LOCK	= (1 << 0),
    +	SLEEP_OK	= (1 << 1),
    +	INTR_OK		= (1 << 2),
    +
    +	/* flags understood by end_synchronized_op */
    +	LOCK_HELD	= HOLD_LOCK,
    +};
    +
    +enum {
     	/* adapter flags */
     	FULL_INIT_DONE	= (1 << 0),
     	FW_OK		= (1 << 1),
    @@ -174,11 +184,11 @@ enum {
     	PORT_SYSCTL_CTX	= (1 << 2),
     };
     
    -#define IS_DOOMED(pi)	(pi->flags & DOOMED)
    -#define SET_DOOMED(pi)	do {pi->flags |= DOOMED;} while (0)
    -#define IS_BUSY(sc)	(sc->flags & CXGBE_BUSY)
    -#define SET_BUSY(sc)	do {sc->flags |= CXGBE_BUSY;} while (0)
    -#define CLR_BUSY(sc)	do {sc->flags &= ~CXGBE_BUSY;} while (0)
    +#define IS_DOOMED(pi)	((pi)->flags & DOOMED)
    +#define SET_DOOMED(pi)	do {(pi)->flags |= DOOMED;} while (0)
    +#define IS_BUSY(sc)	((sc)->flags & CXGBE_BUSY)
    +#define SET_BUSY(sc)	do {(sc)->flags |= CXGBE_BUSY;} while (0)
    +#define CLR_BUSY(sc)	do {(sc)->flags &= ~CXGBE_BUSY;} while (0)
     
     struct port_info {
     	device_t dev;
    @@ -435,7 +445,7 @@ static inline struct sge_rxq *
     iq_to_rxq(struct sge_iq *iq)
     {
     
    -	return (member2struct(sge_rxq, iq, iq));
    +	return (__containerof(iq, struct sge_rxq, iq));
     }
     
     
    @@ -450,7 +460,7 @@ static inline struct sge_ofld_rxq *
     iq_to_ofld_rxq(struct sge_iq *iq)
     {
     
    -	return (member2struct(sge_ofld_rxq, iq, iq));
    +	return (__containerof(iq, struct sge_ofld_rxq, iq));
     }
     #endif
     
    @@ -567,7 +577,8 @@ struct adapter {
     	int flags;
     
     	char fw_version[32];
    -	unsigned int cfcsum;
    +	char cfg_file[32];
    +	u_int cfcsum;
     	struct adapter_params params;
     	struct t4_virt_res vres;
     
    @@ -589,8 +600,13 @@ struct adapter {
     	struct callout sfl_callout;
     
     	an_handler_t an_handler __aligned(CACHE_LINE_SIZE);
    -	fw_msg_handler_t fw_msg_handler[4];	/* NUM_FW6_TYPES */
    +	fw_msg_handler_t fw_msg_handler[5];	/* NUM_FW6_TYPES */
     	cpl_handler_t cpl_handler[0xef];	/* NUM_CPL_CMDS */
    +
    +#ifdef INVARIANTS
    +	const char *last_op;
    +	const void *last_op_thr;
    +#endif
     };
     
     #define ADAPTER_LOCK(sc)		mtx_lock(&(sc)->sc_lock)
    @@ -598,6 +614,12 @@ struct adapter {
     #define ADAPTER_LOCK_ASSERT_OWNED(sc)	mtx_assert(&(sc)->sc_lock, MA_OWNED)
     #define ADAPTER_LOCK_ASSERT_NOTOWNED(sc) mtx_assert(&(sc)->sc_lock, MA_NOTOWNED)
     
    +/* XXX: not bulletproof, but much better than nothing */
    +#define ASSERT_SYNCHRONIZED_OP(sc)	\
    +    KASSERT(IS_BUSY(sc) && \
    +	(mtx_owned(&(sc)->sc_lock) || sc->last_op_thr == curthread), \
    +	("%s: operation not synchronized.", __func__))
    +
     #define PORT_LOCK(pi)			mtx_lock(&(pi)->pi_lock)
     #define PORT_UNLOCK(pi)			mtx_unlock(&(pi)->pi_lock)
     #define PORT_LOCK_ASSERT_OWNED(pi)	mtx_assert(&(pi)->pi_lock, MA_OWNED)
    @@ -626,18 +648,18 @@ struct adapter {
     #define TXQ_LOCK_ASSERT_OWNED(txq)	EQ_LOCK_ASSERT_OWNED(&(txq)->eq)
     #define TXQ_LOCK_ASSERT_NOTOWNED(txq)	EQ_LOCK_ASSERT_NOTOWNED(&(txq)->eq)
     
    -#define for_each_txq(pi, iter, txq) \
    -	txq = &pi->adapter->sge.txq[pi->first_txq]; \
    -	for (iter = 0; iter < pi->ntxq; ++iter, ++txq)
    -#define for_each_rxq(pi, iter, rxq) \
    -	rxq = &pi->adapter->sge.rxq[pi->first_rxq]; \
    -	for (iter = 0; iter < pi->nrxq; ++iter, ++rxq)
    -#define for_each_ofld_txq(pi, iter, ofld_txq) \
    -	ofld_txq = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq]; \
    -	for (iter = 0; iter < pi->nofldtxq; ++iter, ++ofld_txq)
    -#define for_each_ofld_rxq(pi, iter, ofld_rxq) \
    -	ofld_rxq = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq]; \
    -	for (iter = 0; iter < pi->nofldrxq; ++iter, ++ofld_rxq)
    +#define for_each_txq(pi, iter, q) \
    +	for (q = &pi->adapter->sge.txq[pi->first_txq], iter = 0; \
    +	    iter < pi->ntxq; ++iter, ++q)
    +#define for_each_rxq(pi, iter, q) \
    +	for (q = &pi->adapter->sge.rxq[pi->first_rxq], iter = 0; \
    +	    iter < pi->nrxq; ++iter, ++q)
    +#define for_each_ofld_txq(pi, iter, q) \
    +	for (q = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq], iter = 0; \
    +	    iter < pi->nofldtxq; ++iter, ++q)
    +#define for_each_ofld_rxq(pi, iter, q) \
    +	for (q = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq], iter = 0; \
    +	    iter < pi->nofldrxq; ++iter, ++q)
     
     /* One for errors, one for firmware events */
     #define T4_EXTRA_INTR 2
    @@ -751,6 +773,8 @@ int t4_register_cpl_handler(struct adapt
     int t4_register_an_handler(struct adapter *, an_handler_t);
     int t4_register_fw_msg_handler(struct adapter *, int, fw_msg_handler_t);
     int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *);
    +int begin_synchronized_op(struct adapter *, struct port_info *, int, char *);
    +void end_synchronized_op(struct adapter *, int);
     
     /* t4_sge.c */
     void t4_sge_modload(void);
    
    Modified: stable/9/sys/dev/cxgbe/common/common.h
    ==============================================================================
    --- stable/9/sys/dev/cxgbe/common/common.h	Thu Feb 28 00:30:35 2013	(r247433)
    +++ stable/9/sys/dev/cxgbe/common/common.h	Thu Feb 28 00:44:54 2013	(r247434)
    @@ -64,8 +64,14 @@ enum {
     };
     
     #define FW_VERSION_MAJOR 1
    -#define FW_VERSION_MINOR 6
    -#define FW_VERSION_MICRO 2
    +#define FW_VERSION_MINOR 8
    +#define FW_VERSION_MICRO 4
    +#define FW_VERSION_BUILD 0
    +
    +#define FW_VERSION (V_FW_HDR_FW_VER_MAJOR(FW_VERSION_MAJOR) | \
    +    V_FW_HDR_FW_VER_MINOR(FW_VERSION_MINOR) | \
    +    V_FW_HDR_FW_VER_MICRO(FW_VERSION_MICRO) | \
    +    V_FW_HDR_FW_VER_BUILD(FW_VERSION_BUILD))
     
     struct port_stats {
     	u64 tx_octets;            /* total # of octets in good frames */
    @@ -546,7 +552,4 @@ int t4_sge_ctxt_rd_bd(struct adapter *ad
     int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox);
     int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl);
     int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, u32 addr, u32 val);
    -int t4_config_scheduler(struct adapter *adapter, int mode, int level, int pktsize,
    -                        int sched_class, int port, int rate, int unit,
    -			int weight, int minrate, int maxrate);
     #endif /* __CHELSIO_COMMON_H */
    
    Modified: stable/9/sys/dev/cxgbe/common/t4_hw.c
    ==============================================================================
    --- stable/9/sys/dev/cxgbe/common/t4_hw.c	Thu Feb 28 00:30:35 2013	(r247433)
    +++ stable/9/sys/dev/cxgbe/common/t4_hw.c	Thu Feb 28 00:44:54 2013	(r247434)
    @@ -35,7 +35,12 @@ __FBSDID("$FreeBSD$");
     #include "firmware/t4fw_interface.h"
     
     #undef msleep
    -#define msleep(x) pause("t4hw", (x) * hz / 1000)
    +#define msleep(x) do { \
    +	if (cold) \
    +		DELAY((x) * 1000); \
    +	else \
    +		pause("t4hw", (x) * hz / 1000); \
    +} while (0)
     
     /**
      *	t4_wait_op_done_val - wait until an operation is completed
    @@ -149,6 +154,36 @@ u32 t4_hw_pci_read_cfg4(adapter_t *adap,
     }
     
     /*
    + *	t4_report_fw_error - report firmware error
    + *	@adap: the adapter
    + *
    + *	The adapter firmware can indicate error conditions to the host.
    + *	This routine prints out the reason for the firmware error (as
    + *	reported by the firmware).
    + */
    +static void t4_report_fw_error(struct adapter *adap)
    +{
    +	static const char *reason[] = {
    +		"Crash",			/* PCIE_FW_EVAL_CRASH */
    +		"During Device Preparation",	/* PCIE_FW_EVAL_PREP */
    +		"During Device Configuration",	/* PCIE_FW_EVAL_CONF */
    +		"During Device Initialization",	/* PCIE_FW_EVAL_INIT */
    +		"Unexpected Event",		/* PCIE_FW_EVAL_UNEXPECTEDEVENT */
    +		"Insufficient Airflow",		/* PCIE_FW_EVAL_OVERHEAT */
    +		"Device Shutdown",		/* PCIE_FW_EVAL_DEVICESHUTDOWN */
    +		"Reserved",			/* reserved */
    +	};
    +	u32 pcie_fw;
    +
    +	pcie_fw = t4_read_reg(adap, A_PCIE_FW);
    +	if (!(pcie_fw & F_PCIE_FW_ERR))
    +		CH_ERR(adap, "Firmware error report called with no error\n");
    +	else
    +		CH_ERR(adap, "Firmware reports adapter error: %s\n",
    +		       reason[G_PCIE_FW_EVAL(pcie_fw)]);
    +}
    +
    +/*
      * Get the reply to a mailbox command and store it in @rpl in big-endian order.
      */
     static void get_mbox_rpl(struct adapter *adap, __be64 *rpl, int nflit,
    @@ -262,8 +297,15 @@ int t4_wr_mbox_meat(struct adapter *adap
     		}
     	}
     
    +	/*
    +	 * We timed out waiting for a reply to our mailbox command.  Report
    +	 * the error and also check to see if the firmware reported any
    +	 * errors ...
    +	 */
     	CH_ERR(adap, "command %#x in mailbox %d timed out\n",
     	       *(const u8 *)cmd, mbox);
    +	if (t4_read_reg(adap, A_PCIE_FW) & F_PCIE_FW_ERR)
    +		t4_report_fw_error(adap);
     	return -ETIMEDOUT;
     }
     
    @@ -2028,9 +2070,11 @@ static void cim_intr_handler(struct adap
     		{ F_TIMEOUTMAINT , "CIM PIF MA timeout", -1, 1 },
     		{ 0 }
     	};
    -
     	int fat;
     
    +	if (t4_read_reg(adapter, A_PCIE_FW) & F_PCIE_FW_ERR)
    +		t4_report_fw_error(adapter);
    +
     	fat = t4_handle_intr_status(adapter, A_CIM_HOST_INT_CAUSE,
     				    cim_intr_info) +
     	      t4_handle_intr_status(adapter, A_CIM_HOST_UPACC_INT_CAUSE,
    @@ -3904,13 +3948,13 @@ int t4_i2c_rd(struct adapter *adap, unsi
     		F_FW_CMD_READ |
     		V_FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_FUNC_I2C));
     	c.cycles_to_len16 = htonl(FW_LEN16(c));
    -	c.u.i2c.pid_pkd = V_FW_LDST_CMD_PID(port_id);
    -	c.u.i2c.base = dev_addr;
    -	c.u.i2c.boffset = offset;
    +	c.u.i2c_deprecated.pid_pkd = V_FW_LDST_CMD_PID(port_id);
    +	c.u.i2c_deprecated.base = dev_addr;
    +	c.u.i2c_deprecated.boffset = offset;
     
     	ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
     	if (ret == 0)
    -		*valp = c.u.i2c.data;
    +		*valp = c.u.i2c_deprecated.data;
     	return ret;
     }
     
    @@ -4098,12 +4142,16 @@ retry:
     	/*
     	 * Issue the HELLO command to the firmware.  If it's not successful
     	 * but indicates that we got a "busy" or "timeout" condition, retry
    -	 * the HELLO until we exhaust our retry limit.
    +	 * the HELLO until we exhaust our retry limit.  If we do exceed our
    +	 * retry limit, check to see if the firmware left us any error
    +	 * information and report that if so ...
     	 */
     	ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
     	if (ret != FW_SUCCESS) {
     		if ((ret == -EBUSY || ret == -ETIMEDOUT) && retries-- > 0)
     			goto retry;
    +		if (t4_read_reg(adap, A_PCIE_FW) & F_PCIE_FW_ERR)
    +			t4_report_fw_error(adap);
     		return ret;
     	}
     
    @@ -4588,7 +4636,7 @@ int t4_alloc_vi_func(struct adapter *ada
     		}
     	}
     	if (rss_size)
    -		*rss_size = G_FW_VI_CMD_RSSSIZE(ntohs(c.rsssize_pkd));
    +		*rss_size = G_FW_VI_CMD_RSSSIZE(ntohs(c.norss_rsssize));
     	return G_FW_VI_CMD_VIID(htons(c.type_to_viid));
     }
     
    @@ -5299,43 +5347,3 @@ int __devinit t4_port_init(struct port_i
     
     	return 0;
     }
    -
    -int t4_config_scheduler(struct adapter *adapter, int mode, int level,
    -			int pktsize, int sched_class, int port, int unit,
    -			int rate, int weight, int minrate, int maxrate)
    -{
    -	struct fw_sched_cmd cmd, rpl;
    -
    -	if (rate < 0 || unit < 0)
    -		return -EINVAL;
    -
    -	memset(&cmd, 0, sizeof(cmd));
    -	cmd.op_to_write = cpu_to_be32(V_FW_CMD_OP(FW_SCHED_CMD) |
    -	    F_FW_CMD_REQUEST | F_FW_CMD_WRITE);
    -	cmd.retval_len16 = cpu_to_be32(V_FW_CMD_LEN16(sizeof(cmd)/16));
    -
    -	cmd.u.params.sc = 1;
    -	cmd.u.params.level = level;
    -	cmd.u.params.mode = mode;
    -	cmd.u.params.ch = port;
    -	cmd.u.params.cl = sched_class;
    -	cmd.u.params.rate = rate;
    -	cmd.u.params.unit = unit;
    -
    - 	switch (level) {
    -		case FW_SCHED_PARAMS_LEVEL_CH_WRR:
    -		case FW_SCHED_PARAMS_LEVEL_CL_WRR:
    -			cmd.u.params.weight = cpu_to_be16(weight);
    -			break;
    -		case FW_SCHED_PARAMS_LEVEL_CH_RL:
    -		case FW_SCHED_PARAMS_LEVEL_CL_RL:
    -			cmd.u.params.max = cpu_to_be32(maxrate);
    -			cmd.u.params.min = cpu_to_be32(minrate);
    -			cmd.u.params.pktsize = cpu_to_be16(pktsize);
    -			break;
    -		default:
    -			return -EINVAL;
    -	}
    -
    -	return t4_wr_mbox_meat(adapter, adapter->mbox, &cmd, sizeof(cmd), &rpl, 1);
    -}
    
    Modified: stable/9/sys/dev/cxgbe/common/t4_hw.h
    ==============================================================================
    --- stable/9/sys/dev/cxgbe/common/t4_hw.h	Thu Feb 28 00:30:35 2013	(r247433)
    +++ stable/9/sys/dev/cxgbe/common/t4_hw.h	Thu Feb 28 00:44:54 2013	(r247434)
    @@ -58,6 +58,7 @@ enum {
     	CIM_PIFLA_SIZE = 64,    /* # of 192-bit words in CIM PIF LA */
     	CIM_MALA_SIZE  = 64,    /* # of 160-bit words in CIM MA LA */
     	CIM_IBQ_SIZE   = 128,   /* # of 128-bit words in a CIM IBQ */
    +	CIM_OBQ_SIZE   = 128,   /* # of 128-bit words in a CIM OBQ */
     	TPLA_SIZE      = 128,   /* # of 64-bit words in TP LA */
     	ULPRX_LA_SIZE  = 512,   /* # of 256-bit words in ULP_RX LA */
     };
    
    Modified: stable/9/sys/dev/cxgbe/common/t4_msg.h
    ==============================================================================
    --- stable/9/sys/dev/cxgbe/common/t4_msg.h	Thu Feb 28 00:30:35 2013	(r247433)
    +++ stable/9/sys/dev/cxgbe/common/t4_msg.h	Thu Feb 28 00:44:54 2013	(r247434)
    @@ -159,6 +159,8 @@ enum CPL_error {
     	CPL_ERR_KEEPALIVE_TIMEDOUT = 34,
     	CPL_ERR_RTX_NEG_ADVICE     = 35,
     	CPL_ERR_PERSIST_NEG_ADVICE = 36,
    +	CPL_ERR_KEEPALV_NEG_ADVICE = 37,
    +	CPL_ERR_WAIT_ARP_RPL       = 41,
     	CPL_ERR_ABORT_FAILED       = 42,
     	CPL_ERR_IWARP_FLM          = 50,
     };
    @@ -2222,6 +2224,15 @@ struct cpl_sge_egr_update {
     #define V_EGR_QID(x) ((x) << S_EGR_QID)
     #define G_EGR_QID(x) (((x) >> S_EGR_QID) & M_EGR_QID)
     
    +/* cpl_fw*.type values */
    +enum {
    +	FW_TYPE_CMD_RPL = 0,
    +	FW_TYPE_WR_RPL = 1,
    +	FW_TYPE_CQE = 2,
    +	FW_TYPE_OFLD_CONNECTION_WR_RPL = 3,
    +	FW_TYPE_RSSCPL = 4,
    +};
    +
     struct cpl_fw2_pld {
     	RSS_HDR
     	u8 opcode;
    @@ -2290,10 +2301,11 @@ struct cpl_fw6_msg {
     
     /* cpl_fw6_msg.type values */
     enum {
    -	FW6_TYPE_CMD_RPL = 0,
    -	FW6_TYPE_WR_RPL = 1,
    -	FW6_TYPE_CQE = 2,
    -	FW6_TYPE_OFLD_CONNECTION_WR_RPL = 3,
    +	FW6_TYPE_CMD_RPL	= FW_TYPE_CMD_RPL,
    +	FW6_TYPE_WR_RPL		= FW_TYPE_WR_RPL,
    +	FW6_TYPE_CQE		= FW_TYPE_CQE,
    +	FW6_TYPE_OFLD_CONNECTION_WR_RPL = FW_TYPE_OFLD_CONNECTION_WR_RPL,
    +	FW6_TYPE_RSSCPL		= FW_TYPE_RSSCPL,
     
     	NUM_FW6_TYPES
     };
    
    Copied: stable/9/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu (from r247289, head/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu)
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ stable/9/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu	Thu Feb 28 00:44:54 2013	(r247434, copy of r247289, head/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu)
    @@ -0,0 +1,8237 @@
    +/*-
    + * Copyright (c) 2013 Chelsio Communications, Inc.
    + * All rights reserved.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in the
    + *    documentation and/or other materials provided with the distribution.
    + *
    + * THIS SOFTWARE IS PROVIDED BY THE 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.
    + */
    +begin-base64 644 t4fw
    +AAADkgEIBAAAAQkBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAA3cDhgONAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IFRodSBGZWIgIDcgMTU6
    +Mzg6MjYgUFNUIDIwMTMgb24gY2xlb3BhdHJhLmFzaWNkZXNpZ25lcnMuY29tOi9ob21lL2Zpcm13
    +YXJlL2N2cy9mdy1yZWxlYXNlKSwgVmVyc2lvbiBUNHh4IDAxLjA4LjA0LjAwAAAAAAAAAJ/jNKZg
    +AMQA4QAwuHj///8f/OFAgAAAAeEAe3AAABAAH//7gOEAYBDhAZRwIAAAAOEBnAThAHkAAAIAQOEA
    +eYAABgBAAAIACgAGAArhAHkEAAoAAIAAAQDhAHs84QB7ROEAe+TiAAAAAAEAAOEAe5AgAAAAAACA
    +AOEAewAAAEAB4QB7nAAAQABERERC4AAAAOMABHNERERA4wAIACAAAlwAAAAAH/+NIAAAAAAf/40k
    +AAAAAB//jSgAAAAAH/+NLB//wAAAAAAAAAAAAMAAEv/OE//OhCAEMwGTIBH/zRL/zZIQEf/NEv/N
    +khAR/80B9DER/8yQEBH/zCIK/5IQAOQxAAUxAQIAEv/JAucxAhYAEf/IgRABAV/AIQIRAckUEf/F
    +Ev/FkhAR/8US/8WSEGAAEgAAABH/vxL/w5IQEf+/Ev/CkhCBEBH/wcAgkhES/8CSEsAgkhMS/7+S
    +EIIQAvJQZS/3Ef+9xy+SEBH/vJIQEv+8E/+8kyDAMpMhE/+7kyKCIhL/uhP/upMgIyIhFP+5BDMB
    +yTgT/7iDMAODFAgzERT/tqQzkyET/6qTImAACMIwkyET/6eTIhL/sZAgkCGQIpAjkCSQJZAmkCeQ
    +KJApkCqQK5AskC2QLpAvICYQICYRgiIS/6TAMC03MC03NC03OC03PCM9AXIz7QACABL/oSMKAC83
    +AC83EC83IC83MCM9AXIz7QACABL/lsAwKDcwKDc0KDc4KDc8Iz0BcjPtAwIAEv+UwDAnNwAnNxAn
    +NyAnNzAjPQFyM+0DAgAS/44V/48W/4/AMNcgBWYBYAAWAAAAAAQ2BQACANMP0w8FMwxuOxQHRxQH
    +BEN2MeYENgUFMwxvO+0AAgAS/4IV/4AjCgACJwIHBEMEPgUFMwwHRxRvO/ADAgAS/3zJLoMghCGF
    +IrwidDsOhlC0VZYwtDN0M/Rj/+YAZT/iZV/fEv9wwDIDLgUDAgAS/2fAMCg3QCg3RCg3SCg3TCM9
    +AXIz7QMCAAACABL/ai0nAMARAUkxAEgxAQIAwAAU/2YE0jEV/2WUUBT/ZQTTMRX/ZZRQFP9kBNQx
    +Ff9klFAU/2QE1TEV/2OUUBD/YwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA
    +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+GAOMACfgf/4YAH/+GAOMAD/gf
    +/4YAH/+GAOMAD/gf/4YAH/+HdOMAD/gf/4d0H/+NIOMAEWwf/40gH/+nhOMAFxgf/6eEH/+nhOMA
    +MXwf/8AAH//8ZeMAMXwgAAAAIAABauMAbeQgAAF4IAABfOMAb1AgAAF8IAABheMAb1QgAAGYIAAB
    +nOMAb2AgAAGcIAABpeMAb2QgAAG4IAABvOMAb3AgAAG8IAABxeMAb3QgAAHYIAAB2OMAb4AgAAHc
    +IAAB4uMAb4AgAAH4IAAB+OMAb4ggAAH8IAAB/OMAb4ggAAIYIAACGOMAb4ggAAIcIAACHOMAb4gg
    +AAI4IAACOOMAb4ggAAI8IAACPOMAb4ggAAJYIAACWOMAb4ggAAJcIAACYuMAb4ggAAJ4IAACeOMA
    +b5AgAAJ8IAACguMAb5AgAAKYIAGaouMAb5ggAoAAIAKTYOMCB6QgApNgIAKTYOMCGwQgApNgIAYP
    +KOMCGwQgBg8wIAYT8OMFltQgBoAAIAaNUOMFm5QgBo1QIAdgsuMFqOQgB2DAIAdhjOMGfFQgCMAA
    +IAjAAOMGfSAgCMAAIAjAAOMGfSAgCMAAIAkvL+MGfSAAAAAAAAAAAAAAAAAgAAYvIAAGICAACjkg
    +AAYgIAAJpSAABiAgAAbZIAAJPSAACMIgAAYgIAAIcSAACCQgAAe5IAAGDSAAB2QgAAYgIAAGICAA
    +BiAgAAb6AAAAAP///////w/8///w////APwgAItrIACMqyAAjNsgAIyhIACMYSAAjFcgAIwcIACM
    +EiAAjAggAIu4IACM2SAAi64gAIuUAAAAAAAAAAAAAAAAAAAACgAAAAoAAAAUAAAACgAAAAoAAAAK
    +AAAACgAAAAoAAAAKAAAAAAAAAAAAAAAAAAAIAAAAEAAAAEAAAAEAAAAACAAAABAAAABAAAABAAAA
    +BAAAABAAAABAAAABAAAAIAbKiyAGycIgBsshIAbLCCAGyu8gBsrWIAbKvSAGyqQgQIAAAAAAAP8Y
    +MGBgAAAA/wABAgIAAAAQIEAAAAAAAAQAAgABAACAAEAAIAAQAAggBwDOIAcAziAHAIEgBwBIIAb/
    +nSAG/2ggBv9oIAcAziAHAM4gBv9oIAb/gyAG/4MgBwDOIAcAziAHAM4gBwDOIAcAziAHAM4gBwDO
    +IAcAziAHAM4gBwDOIAcAziAHAM4gBwDOIAcAziAHAM4gBwDOIAcAziAHAM4gBwDOIAcAISACiqgA
    +AAABIAKKrAAAAAIgAo3wAAAA/yACidwAAAD/IAKJ3AAAAAAgAo3wAAAAACACieAAAAABIAKJ6AAA
    +AAQgAonwAAAACCACifwAAAAQIAKKBAAAACAgAooMAAAAQCACihQAAACAIAKKKAAAAQAgAoo8AAAC
    +ACACilQAAAQAIAKKaAAACAAgAop4AAAQACACioQAACAAIAKKmAAAQAAgAonIAAAAECACidAAAAAR
    +IAKJSAAAAQAgAolUAAAAgCACiWQAAABAIAKJdAAAACAgAomEAAAAECACiZQAAAAIIAKJoAAAAAQg
    +AomsAAAAAiACibgAAAABAAAAAAAAAAAgAojoAAAAASACjfwAAAACIAKI8AAAAAQgAoj4AAAACCAC
    +iQAAAAAQIAKOBAAAACAgAokEAAAAQCACiRAAAACAIAKJHAAAAQAgAokoAAACAAAAAAEAAAABAAAA
    +AQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAH
    +AAAABwAAAAYAAAAGAAw1AAAQRqoAFFhVABhqAAAAK2gAACODAAAYagAADQYAAAsqAAAAAAAAAAAA
    +AAAAAABoKwAAaCsAAGyCAABvnAAASmgAAEpoAABNKQAASmgAAE7qAABMmAAAUj0AAE+4AAGGoAAB
    +hqAAAgjWAAII1gACCNUAAgjVAAKLCwACiwsAAgjVAAK2cgACtnIAAw1AAAQGBwAAAAAAAAAAAAAA
    +AAACAgUFCAgLCw4OEREUFBcXGhodHSAgIyMmJikpLCwvLzIyNTU4ODs7AAAAAAAAACAEkYAgAWn4
    +IAA1yCABQhggAWWAIAFe0CABJAggA6KkH//rIB//5uAgAI1sH//azCAAXFQgAE7gAAAAAAAAAAAg
    +AUOQIAB7CAAAAAAAAAAAH//U4B//xggf/8PoH//BmCAASnAgAEKsIAA/4CAAg/gf/99YAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgARGgIAFRqCAAlcggAJT8H//w
    +KB//z/wf/8tAIAB4VCAE6eggAQXwIADkxCAAzJggAMb8IAC5QCAArCwgAJiAIASVLCADu5QgAPcw
    +IAPbiCABliwgAFwUAAAAACAAliQgBVKUIACK4CABScQgADI4AAAAAAAAAAAAAAAAH//zUCAAlegg
    +A75EAAAAAAAAAAAgAw1UIAAq2CAAMUQgACdoAAAAACAAIRggACPYIAAdjAAAAAAgAC+cIAD66AAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAALKwgBJEgAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAgAC6IIAMYMCAALWAAAAAAAAAAAAAAAAAf/8AAAAQAICAGE/AgBhiw
    +BEEACAQBAAgf/6SggQAAADAAAAAf/5iApQAAAMAAAADABAAAH/zeACAGFEAf/5iQA4AAAAD/+AAB
    +AAAAABAAAIEEAQCBBAAAAQQAAAEEAQCAAAAAAAX//x//hBAGAAAAKgAAAB//zyggA/V0AgAAAIAQ
    +AABBQAAAQUABAIMAAAH//7//gYAAAAQAAAgf/5cAIAjhcB//jXD//wAA//8A/yAI4aAgCOIAIAjh
    +4B//jhAAAA0gH/+XcB//lkAf/5scH/ziAB//mpAf/5sUH/zg4B//klAP////H/+S1B//l6gf/5a0
    +H/+XIAAAC5AAAP+AIAkE8B//lxQAAAo44QAuAOEAXgDhAZIAH/+X5B//lqTgAACg4QAwuAAAgADh
    +AGAQAABAAOECEADhAjAA4QJQAOECcADhABAIH/zhQB//p0Qf/6c8H/zgCB//p0Af/6dcH/+nVB//
    +p1gf/6d0H/+nbB//p3Af/5iA//7//wAgAAAgBhPwH/zeAAQAAAgFAAAAg/8AAIEAAAAAEAAAIAYU
    +QCoAAAAgAAOAIAKJkB//gAAgCMRgAAA/KCAIw7AgCMRQIAjEgCACkLzP////EAAAACAIw9A/////
    +AgAAACACisQgAorIIAKQuCACisxAAAAAIAjEEB/84HQf/5sgH/ziDAAAgAAgABEoH/+NcAAADDz/
    +/3//H/+VmCAIx7AgCQyQH/+XcCAIx+AgAoiQAAAIAB//keSCAAAAgYAAAAwAAAAABgAAAABAAB/8
    +4gAf/5scAAALOCAIyGAgCMjQIAjJQCAIyXAEAQAI4AAAAB//ljggCMmgIAjJAFMAAABRAAAAIAjJ
    +4FIAAAAwAAAA//v//w/+//8AA///AAAn/yAJDNAgABfUH4AAPx//liwgCMowAAQAAAABAAAgCMrw
    +H/+UzAAA//8gCMtQIAjLsCAIy4AgBg8wIAjMMB//lkgNAAAAIAAv2CAIzLAIAAAAIAjNAPf///8f
    +/6SgAQAAAB//lSgf/5SAIAjfIBQAAACAAAAAgAAAAngAAACAAAAGgACwAAAACgAA4zCS///wAIAA
    +sQDhAZoAAAIAACAI3uAAAH5AH/+OIAYAAAAFgAAAH/+YkB//lFQrAAAAIABFsDUAAAADgAAAAwAA
    +AB//lFgH////AD///4BAAAAID///H////wD///8gAAAAH/+WHD0AAAAf/5KMBwAAAIEEAQCBBAAA
    +AAA6mMMAAAAYAAAAH/+OYAAAD/8AQwAAH/+V5AQAAAAf/4QQH/+muB//pMDhAHoAH/+STB//lQQf
    +/5aAH/+UnCAJEzAAAweAIAkToABAAAAAAAkAAAAwAv/8+H/AAAAAo/+7AKP/ugDgAwAAg/+2AA//
    +//8P//gA/wAAACAJE+AgCOEAIAjhMCAJFHAACgAAAA8AAP//AA8f/5UQA//AAIP/wAAgCRTwIAkV
    +YB//lpgf/6Uw/2DwAB//pRAf/40wBIAACB//gFAARAAAAMAAAP8f//8AAIEADwAAAP//AAAf/5Y8
    +H/+bGB/84ggf/5yoIAjmkB//kogf/4BgIAYSAAAAMAAAACcQH//Z4B//lPjerb7vNAAAAD8AAAAA
    +AIkGAJkAAB//pHgQAAcC7gAAAAHAgAAf/6NImQAAAB//pTQAiAAIgoAAAR//pMgf/6PUAxUAAAMR
    +AAAADwP/IAjqYCAAwCQgCOqQIAjq0CAJHUAAAI4CIAkeECAI6vAgCR2AIAkdwCAI6yAgCOtgIAjr
    +kCkAAAAgAMicIAYYMCAGEkAgANs48PDw8P8A/wCqqqqqzMzMzAAPQkAgA+F4H/+WoAAJAAAAgAAA
    +IAjtACAA++wAAEgAIAD/cB//lhQACQAIH/+kPB//pIQf/5SYAAAIBgAAiMwAAIkUfwAAAPAAAAAg
    +CR9AIAkgQCAJIHAgCR6gIAkgECAJH6AABAP/CgAAAB//o2Qf/6QkH/+UcIP/twCD/7YgIAjx8DMA
    +AADhAAAAH/+kRB//lVQf/6SMA//gAAA/9pAAABkUA//wAAAQAAEAABkcH/+kiAAP//8AAN6tH/+k
    +QB//lhAf/5UsIAYPQB//lIwf/5aIIABgWB//lSAgADWIH/+UhB//lFAf/5n0IAkhsCACjSAgAGD4
    +H/+TiACBAADgAQAAAOABAAAA4AEgCSKAIAj0sAAADEQgAIgkIACFuCAJIgAgCSJQH/+WNCAJApAg
    +CQLASAAAAB//jgTv////IAkDAH////+/////3////yABddgf/5XwIAF3yB//klAf/5Ws4QAuAB//
    +lbThAF4A4QIOAP//v/8f/48s4QAOAOEBjgDhAHIA//++/x//lrQAAAo4H/+X+B//l/QAAAxwAAD/
    +gB//l+wf/5hYIAF9dCABhcwD/wAA/7///x//l1Q8AAAAAAX//4MAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACB
    +gAAAAAAAAB//+Wgf//loH//5LB//+Swf//ksH//5LB//9Ggf//b0H//1mB//9Zgf//WYIAXlwAAA
    +AAAAAAAAAAAAAAAAAAAgBelAIAXpQAAAAAAAAAAAAAAAAAAAAAAgAX9AIAXlwB//9/Qf//f0H//3
    +9B//9/Qf//f0H//39AAAAAAf//RwAAAAAAAAAAAAAAAAAAAAAAIBAAAAAAAAAAAAAAAAAAAEAAAA
    +AAAAAIGAAAAAAAAQBQAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAgQAAAAAAABgFAAAAgAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAACgQAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAgCgAR8X8T8X/TDwPmMQECABbxfRfxfndrBpBgtGZ3Y/hUDoBVk5kPFABj
    +//kAAABsEAQY8Xsd8XYrIAcc8XYqIQj6AgAHcbsBAO7cOQ3cAoAAC6oCnDDj8XAZsASAAAiqAhzx
    +biMwgPpACBXgDQUAnWXsZgIhuN0AAPrAhhWkdx0A6Xz/Ld4CgADrewIMzwKAAOtmASTL4QAAmWMC
    +BImTZyhmBgYgixjxXyUhCfTBZhWkMx0A5WYKK5AEgADoAAUDKMEAAG05AgUCYdEPAAAAbBAEHPFP
    +JiAHG/FOH/FU/kEEFaDWEQANyzmbMIcg++KWBaAJJQD6YEYVoBgFAOg2Ayu+AoAA+OYADHFmAQD4
    +YCYVoAwFAOUgVys0AoAA98YADrArBQD/pgAO8Ao1AOjxPhKCAYAAnDWcN5szGfE9CnUClTGZNiUh
    +CZ00LyAHnDmUO/imAAkx/wEA4jYKL/wCgAAP7gII7gLuNggtEASAANEPJyEIKiEJnDWUNwZ3Agiq
    +Apo2CHcC5zYELJAEgADRDwAAAAAAAABsEAgoIAUnIAcpMQX4IIYV4BlFAPkADMVhdwEAiiIW8R8Y
    +8R/xVQwN4A2VAAx7Eaa7LLKe/YAMQ+AKpQArsp3rFgUljDmAAIyI94AMcJIAnQAtYq5k0TgrYq3k
    +sTRmc/0AAO6GCCWJuYAAKCAUpIgICEcoJBT1AAu90A8FABnxCS4iFiwhKYgVGvEIrsyagOoiHi5n
    +woAA/QBmFaANJQD9AEYV4AtlAO3w9x1WAoAAC6oCixSagekAFQRAQQAAiRUIAIooPBD9IMYV4EwF
    +AP0g5hWgDEUA7Ls2BMiBAABtuQUIAIYJAmHu8OkVoIeAAIgV7gAFDc8CgACpiOiMICWkNQAAC8kM
    +bZkCCAJhKCEp6iEoJEAFAAAICE8oJSn5QAhEIgCdAP/hwgXgDBUA+iCoFeAe5QDqIh4sbUKAAPwg
    +JhXgCQUA+CAGFeANBQDpFgIl2YEAAFhx1Ax+EffAAEcwDZUA/dOmFefFAQD5gAYpUgCdAMAg0Q8A
    +6iQACdgEgADsRAAK6ASAAFhzsdKg0Q8AwLAKzzTvhggt9o4AANog/EBoHaAbxQBYdABj/8oAAADq
    +JAAK2ASAAFh1PtKg0Q8A//nsDaALBQAAACt8GOokAAlgBIAAWHP0Y/+cwKBZjncY8LCMiPmf80CQ
    +CqUAY/+sKiEJ/EKwFa/9BQANjQENjgwuJBTttAMuYQKAAO+0AC1WAoAA/UYADTAJFQAJqgKasfjV
    +phXv+WIALyUp//vUDaAIBQCKJ+tEAApoBIAA+0QAFaAMBQBYbjDSoNEPAAAAbBAGKCAFKyIQ5CAH
    +KlAEgAD4AwId4B7FAPveAAzwGUUA+QAMXWFEAQCMIh/wiOoWAC4LHgAADEkRD5kILZKeDwIA96AL
    +41IAnQAnkp0MBj5kcW6LKSoiCguqDPdACQuiAJ0AKiBOLCBMsa37gAskIAsVAC0kTiowASkiGPNA
    +C0aSAJ0AKyAHLCEk/GAkFeAIVQD5QAQEMKsRAOCIEQ1SgoAACogCGvBuCN0CKCEHKyEJCswC+6YA
    +DrqIAQDq8GocQwKAAAi7AighIp1wjSCbc5x0+wYADDAKZQDodgIu7gKAAArdAp1xLCIQnHUrIDgY
    +8F78ACId4EwVAPzhJhXguxkAC805HPBZnnj7DQAOcAgFAJh3DcwCnHbt8E4U2AUAACsmGBvwRJh7
    +mXrtABUDyMEAAAkAiut2DiHIQQAA7nYPI/EBAAAJIIYOAmMJAIYOAmEMTBGvzOrGnSMAqYAAjikt
    +IDim7p4p86AFV5IAnQAFD0f54ARRUgCdAMAg0Q8A6iQAC1gEgABYTV/B7O/wLxV2kYAA6iQACdgE
    +gADsEgAq6ASAAFhzFtKg0Q8AAAAA6iQACtgEgABYdKrSoNEPAAAAK0wY6iQACWAEgABYc2Jj/8GI
    +IsCUCYgC+EBGFa/+3gAAAAAAAAD8Q6gVpIkBAACBBAC9Gg3MAvxDphWv+h4AiieNEMDA6qwgLtgE
    +gABYbarSoNEP2iBYcsBj/1EAAGwQDC0gBSYiEC8gByshNeUWAynABIAA+wCIFac1AQDyf8AV4AwV
    +AAPDOftBAA1wFYUA64ICLGAEgAD3XgAKsf8BAPcAMBWgFUUA9aAf1WO7AQCJIigWAPM9XA3gDoUA
    +mBDywB4HEgCdAJ8SnxqbFhbv75MV6hYEL68CgADmVQgCMA0AAOYWCSJwBQAAiBouFggrEgn1AAZi
    +EgCdACpSnvtACaviAJ0AL1KdZPO7GO/giIj3AAlYkgCdABnv3CmSrgwDPurv2hSJ+YAAKqKtFu/Y
    +6hYLJGv9AADrEgslCWmAAO1mCCWbmYAAiCmHKgh3DPLgCWPiAJ0AKRoA8yIyDeD69QArIBacEftg
    +Ca0iAJ0AGO/QhhSNwyogOP3g5hXgCQUA+eEmFeBHBQD34QYVoKoZAAp5ORfvxysiF5v6KyIbm/uN
    +xAp4OfzADxLiAJ0AmBeeHYYVnBGZHOcSDCsIHgAAYAF+GO+ziIhqgSaKGSlSnnqTQytSnZsbjRvp
    +760UM/0AAO/UAAaB2YAAlphl/xxgAtWeHfwgJhWgCgUAWY1rGO+kiIiMEe4SDSQPBwAA//9oDaAP
    +BQAAwJD4IWYV7/7uABvvm8CqCoo0+2EGFa/+/gAAAAAAAAD/+zgNoA8FAACeHZ8e/CAmFaAKBQBZ
    +jVcY75CMEYiIjx6OHfkf9diSAJ0AYAJRwJCZG4obHe+JwLoLizTr1ggtdo4AAGACOACeHZ8enBHq
    +JAAJ2ASAAFhMrowRjx7uEg0ldfmAAGAB7wCeHZ8e+kDwFaAMBQBYTaWMEY8e7hINLXXGAABgAsYA
    +iBGOF/YgyBWvjAUALCQ7jBQGdgIG7gKsuQzaDJqE6SYbLFgEgADtIhApUASAAFhz744djBH6s6YV
    +oQcFAHN7CCsgFigK/3i5XoopKSA4o6rqJgkk+aaAAC8iEC0hNfuAiBXgCBUA+CCmFaAGNQCWEw27
    +NvoghhXgHYUA/34ADv/2tgCKJ58eixDqrCAqYASAAFhwkI8emhErIhv9QIgV7/2GAAAAAAAA6iAH
    +KeAEgABYTV+MEf4hqBWv/kIA2iBYcfeMEf4hqBWv/kIAAC0iEIoWKyA7Fu9ICpkCCYkC5pgCDYn2
    +AAAa70X4RIQV42kBAIfA6yAHKzICgAAGmQImIQf64AQDsLsRAOrvNR3agoAAC3cCKyEiCncCKiEJ
    +l/CHIJ31+eDGFapmAQDp9gQrMwKAAAaqAhbvK+r2Ayu+AoAA5+cCB8jBAADn9gEmQIEAAOa7AgJT
    ++QAA6/YCIhQ1AABtqQUIAIYJAmEoIBSkiAgIRygkFPUABq3SAJ0Aihj6s6YVoQkFAPMh8g3g/PUA
    +KyAW/WAJFSIAnQAtIhex3e0mFyGAqYAAjykuIDij/58p88AHv5IAnQCGFWVg0sAg0Q8AAAAAKCBO
    +ZIw9DpsCmyLrEgApUASAAO0SAypgBIAAWHHn0qDRDwDrEgMpUASAAFhzfNKg0Q8A2iD8QGgdoBvF
    +AFhyNWP/xwCLEtog67wYKWAEgABYcjBj/7QAAAAAAOokAA5YBIAA/CCIFa+OBQDuJDsscASAAFhz
    +bPohBhWgDwUALyYb/kdmHe/8ggCLGyohCfxCsBWv/QUADY0BDY4MLiQU5MwQDVYCgAAMqgL9YGYd
    +4A4FAP9gBh2gBhUABqoCmrEZ7tL3NaYVr/vKAACKJ+tEAApoBIAA+0QAFaAMBQBYbGXSoNEPAADa
    +IFhxe2P/BAAAAAAA6iAHKeAEgABYTNtj/tOLEtog67wSKWAEgABYcgFj/vdsEAgoIAXt7rwZ0ASA
    +APPdcgXgHkUA/wAKdSAMpQArIE4p0gjTD+oWAyXb/QAAKyRO9yAIWJAHFQAvMq5k8igqMq3mpAAF
    +EVGAALCY6NYIJQhBgAApIBSzmQkJRykkFPUgEO3SAJ0AKSBzKyId+yAEAN//9QDgehoEwAUAAP9X
    +AA/0iAEAKCRz+0AEBXAIFQAKijkPuwHrJh0tBv4AAIoifKcEKyBOyrR9pwgtIEwsIE59wxnMbC4g
    +FO8iAi9YHAAAZPH0wCDRDwAAAAAAAIgnx5MJqQHpJgIkUMEAAFhkOOPukhUBEYAAKKAAA4gKiIzs
    +oActWASAAPpAaB2gDUUAC4AAZa/hiSdkn6iKmsqnKpIJZK+eKKAAA4gKiIzsoActWASAAPpAaB2g
    +DTUAC4AAZa/hY/99AAD//1gNoAoFAMCgWYw0He5sidgsCgr5P/dAkB5FACYKACkgFLOZ+EKGHe/8
    +GgAAAADqJAAK2ASAAFhy5tKg0Q8AACogBSsgBw8CAP9ADxUhuwEABQVH+KAPKVIAnQCOE+7iBi94
    +BIAAnhQLvgL1YApyEgCdAAy6EQOqCCiinvcADnzSAJ0AKqKd7hYBJQrxgAD6QAgV4AwVAFgf9hvu
    +Si8hCR7uQCghIi0gBxzuUikhJP8GAAww3REA7hIELuqCgAANmQIMmQKZoIwgKKYC/0BmFeANJQDu
    +pgUuZgKAAA3MAv1AJhWgCQUA6wAVBVBhAACxmeqDHgyP6AAAjxEM/xHz4ABH8A6lAC72nfS/8sES
    +AJ0AKiIH60QACmgEgAD7RAAVoAwFAFhrwGP+OgAAAAAA//dYDaAKBQAMmzTr1ggtbu4AAGP+2QAA
    +LyEJ+EKwFaALBQD6wAYd7/oFAAqaASpkA+qaDAxBAoAA6iQUL/4CgAAI/wIH/wKfYfZ1phXv9soA
    +iifAsPtEABWgDBUAWG47He4anaCMIBvuGeumAi5mAoAAB8wC/UAmFaAbxQDsJAAJUASAAFhxRMAg
    +0Q8AAInY9yAEqJIAnQAM6hGjqiiinvcABXzSAJ0AKqKdZKCmsJiY2O4WAS11VgAAiSLrFgAkhRmA
    +AJ8S+L/rYVIAnQCKJ8Cw+0QAFaAMFQBYby4e7fqeoI0gG+377BICLu4CgAAH3QKdoYzGnKP7QEYV
    +7/TqAOtUAAlQBIAAWHJmY/0njxOP8/4ghhXv+I4AAAAAAAAA//jQDaAKBQAAnxKbEfogBhXgCgUA
    +WYudHe3WixCJ2I8SjhH5P/qIkAylAP/9jA2gCgUAwKAMmDT5oQYVr/1aAAAAAIsQ7xYCKVAEgADr
    +vBgpYASAAFhxCP4gSBXv/SIAbBAEKCAU74seahgEgACKJ/pgaB3gDAUA6qwgKegEgABYa1XSoNEP
    +AIsic75+FO24iUhqkXob7bXTDyyyrmTAWCqyrWSgVLCd7UYIJQLhgAApIBTpJBQs2twAAC8hCfhC
    +sBWgDQUA/UAGHe/8BQAMnAEspAPsnAwMQQKAAOwkFC/+AoAA+eYAD7AOFQAO/wKfof91phWv/eYA
    +wKDA6g6eNO5GCC19ZgAAjyLJ9cAg0Q/AoFmLXolI+T/70JIAnQBj/+UA2iD8QGgdoBvFAFhw0sAg
    +0Q9sEAgpIg/vITQpsASAAPZg6BXnhQEA7iAHKlgEgAD7H8AVoAQVAPqNAA0wHUUA/uEAC/HuAQDp
    +fR8MFHQAACggT+8gTSRABQAACAhHKCRP+eATC6IAnQAvIAWbEZoQ/eARLWIAnQCJIsej+UAN0OIA
    +nQAsIhmLMv1gE00iAJ0AjTgY7W3vEgEmkaGAAAzkEahEGO1r6BYCJ/gNAAD1wA0CEgCdAClCnv8g
    +GYviAJ0AKUKd7ZQABJHBgACLKSoiCgwFPg8CAAuqDPVACeviAJ0ALBoA9YIyDeD49QArIBbTD/lg
    +GAUiAJ0AGu1mKSEkKyEHCpkCKiEJCwtKDLsQC6oCKyAHHO1SCytA6O1eHdqCgAAMuwIsISKb0Isg
    +mdSa0wjMApzS/WAAFbAMVQAMuwKb0RvtVSoiDyrWBSkgOPvapgWgDAUA/aDmFaBIJQD3oQYV4JkZ
    +APlNAA3wCiUACYo5KWIEKdYJKGIFKNYK/MDIFaAJBQDs1gsjh+GAAOntRRzCgoAACYgCmNyMaJff
    +nN6MEolpKdYQiGoo1hHsABUGySEAAAkAioxn/OAKq6IAnQAZ7S0KuAIJiAKY1sD1/pOmFeEOBQD1
    +wfIN4Pr1ACsgFvtgEgUiAJ0ALiIZjCktIE8rIDjlzAgHcAUAAO4mGSbr/QAALSRPnCnzYA4HkgCd
    +AI0QZdG+wCDRD58TnhSeFZ0W6iQACtgEgABYSjaNFo4U7xIDJXVhgACOEGXv14on2zDsEgElUMEA
    +AFhuHMAg0Q8a7P+KqPdADsiSAJ0AK0Ke/2APs+IAnQApQp0d7PjkkeplY/0AAJzY7ZQADPJ2AABg
    +AHoAKCA58R/4DhIAnQD/++QNoAkVAMGjevkSKSA6/iCmFaAL9QD7IBAlYgCdAOokAArYBIAAWHFq
    +0qDRDwAAAAAAAPAAGA2gGtUAwKGMNyshCY04jjLrrxEN3QKAAA+7AuS7AglQBIAAWHFMwCDRDwAA
    +AP//WA2gGoUAAAAr7BjqJAAJYASAAFhwEmP/KAAACrkCmdbAhfiTphWhDAUAdcsNKyAWKgr/+2AN
    +PSIAnQCLEGSxNYtqjGeKaat7B8wMnGf3YNIN4A0FALGqjGWbaotmmmms2qt7d7sBsaqbZppliCkt
    +IDiliJgp86AJN5IAnQCJJ4qayqWLmcqxnxMZ7L8osACeFJ4VCYgKiIwssAf6QGgdoA01AAuAAI4U
    +jxOLIsej+1/zaOIAnQAoITSHZ/xB6BXgCRUAmRD44QALsBxFAPz+AA5/85YAANogWG9SY/47iifq
    +rDArWASAAFhcw9Kg0Q8AAAAAAAAA//NIDaAJBQCfE54UnhWdFvpA8BWgDAUAWEq+jRaOFO8SAy1n
    +TgAAK+wS6iQACWAEgABYb81j/hPqIAcq4ASAAFhKn2P9tZ8TnhT+IKYVoAoFAFmKShrsgoqojhSP
    +E/lf8HiSAJ0A//iIDaAJBQDAkBzsfMC6C6s0+4EGFe/4QgCfE4onnhTuFgUp2ASAAOwSASVQwQAA
    +WG2O7hIELTAEgAD+IGgV7/qWAJ8TnhTuFgUpUASAAFhvHY4U/iBoFe/7JgAAwVP6QGgdoAsFAPwA
    +Ah2gDTUAWGjGKyAFjhX1f91NYgCdAGP9Y58TnhSeFeogByrgBIAAWEpyjhT+IGgV7/kaAAAAAAAA
    +bBAMlRMmIAUvIAeHL+oyBCnABIAA/EaEFec1AQDyf8AV4A4VAAPjOf1BAA1wG0UA56sfDGAEgAD6
    +wB6lYf8BAIkiKBYA8zr8DeAOhQAmgAEoFgDywBy3EgCdAJ8SnxoZ7D6TFxbsPOoWBiJYDQAA6xYJ
    +L68CgADmVQgCcAUAAIganhiNGfUABVoSAJ0AK1Ke/WAII+IAnQAvUp1k85KImPcAB+iSAJ0AFuwr
    +JmKuDAM+6uwoEwiJgAAqoq3qFgska/0AAOsSCyUIEYAA7ZYIJZqBgACHKYYqB2YM8sAH6+IAnQAo
    +GgDzAjIN4Pr1ACsgFpwR+2AILSIAnQAW7CsqIDj72FAF4A0FAJ3394CIFeCqGQAKazmGFsSACo05
    +9sAPguIAnQCdFI0X6xYFLoduAABgAZCImGqBIY0ZK1KefbM+L1KdnxuGG7CK72QAAwHhgACamGX/
    +RmAC1gCeHPwgJhWgCgUAWYnDGev8iJiMEe4SDCQPGwAA//9kDaAPBQAAwLD6IWYV7/8CAMDaDY00
    +/SEGFe//BgAA//v8DaAPBQAAnhyfHfwgJhWgCgUAWYmxGevqjBGImI8djhz5H/dIkgCdAGACWcBg
    +lhuKG8C6C4s065YILXf+AABgAkOeHJ8dnBHqJAAJ2ASAAFhJCYwRjx3uEgwld3GAAGAB+54cnx36
    +QPAVoAwFAFhKAIwRjx3uEgwtd0YAAGAC05wR/iGGFa+IBQDoJDsmOEEAAOcDHgewgQAABgJhhhaW
    ++I3Hh8SIxq1tBncMl8R22wouFgzsFgEkQAUAAIwWixGGFI4VmLadtwbuAu0iDylQBIAAWHBBGeu6
    +jhyMEfqzphWhBwUAc3sIKyAWKAr/eLlciykqIDiju+smCSV5qoAAhi8vITT9gIgV4AoVAPog5hWg
    +CDUAmBMP3Tb8IMYV4B9FAPe+AA+/9v4AAJ4ciiefHYsQ6qwgKmAEgABYbOHvEg0tYASAAP4hiBWv
    +/NoA6iAHKeAEgABYSbGMEY4c+dcwBe/+QgAA2iBYbkiMEY4c+dcmBe/+NgAmIDsX65vtuwIHyIEA
    +APmCABWjqwEA57cCCwjGAACTH43AE+uUA90BIyAHAyNACjMQA90CE+uIJiEkA90CIyEH6yEJLVIC
    +gAD6xgALOjMBAOohIimbAoAAA7sCgy+d8I0glvSX9pP1m/ODH+vrfB7uAoAADe0CnfELqgLq9gIi
    +DD0AALBKbakFCACGCQJhKCAUpIgICEcoJBT1AAZd0gCdACoSCPqzphWhCQUA8yHyDeD89QArIBb9
    +YAilIgCdAMg/jiktIDij7p4p86AHr5IAnQCPF2Xw0sAg0Q8AJiBOZGxnDpsCmyLrEgApUASAAO0S
    +AypgBIAAWG4/0qDRDwDqJAAK2ASAAFhv1NKg0Q8A2iD8QGgdoBvFAFhujWP/xwCLEtog67wYKWAE
    +gABYbohj/7TbwPwgyBWvjgUALiQ7CCCGCQJj7PYIKVAEgADtIg8r8ASAAFhvw/ohBhWgDwUA/kdm
    +He/8qgCLGyohCfxCsBWv/QUADY0BDY4MLiQU5MwQDVYCgAAMqgL9YGYd4A4FAP9gBh2gBhUABqoC
    +mrEZ6yn3NaYVr/vyAACKJ+tEAApoBIAA+0QAFaAMBQBYaLzSoNEP2iBYbdNj/wYAAAAA6iAHKeAE
    +gABYSTNj/uGLEtog67wSKWAEgABYbllj/vdsEAYoIAUlIAckCgP3AAVkUVUBACggImSAoQIqAlhm
    +5vlABMDQBhUAKSAh4+sKGAQKgADzIAQv0gCdAOxZEQKlaQAAo5kqkp5uo3Qrkp1ksGopICH6QAgV
    +oPzlAAyZAfcmAAywDQUA+EQmHeAIBQD4IAYVoA6VAPggJhWgDwUA+CBGFaAMBQBYa/YMXRGj3fWz
    +phWgAgUA0Q8X6u+KeGqhJgxZEaOZLpKebuMtK5Kd5LApZWP9AACceGW/lMAg0Q///igNoAsFAMCg
    +WYiqinhroc7//4wNoAsFAMCwwNoNrTT84QYV7/9SAAAAAGwQCiwgBfhA8BXgCxUA+GBoHaelAQDo
    +FgElU/kAAOq6OQoYBIAA6hYFLCAEgAD9gcAEUZkBAMGz+4AZhWIAnQCMIhvqybQ+5cKxbMcCgACr
    +iJ4U7RIEKAQKgAD1IAQCEgCdACyCnv2ABxPiAJ0AL4Kd7xYGJ5SJgAAlIRuKQocpmBAFpTb1TwAL
    +cQ8FAHbzAdWghioHZgz0wAXT4gCdACoaAPVCMg3g/PUAKyAWmBD9YAX1IgCdAI0ppd2dKYpC+qAK
    +cqIAnQCZGIwVG+q+h0OZGZgQ63cBBgfpgABgAK0a6qOKqOgWACUMn4AAjBQrgp58sz8vgp0e6p3k
    +8Dhla/0AAJ3o7xYGL/uOAABgAfaZGPghJhXgCgUAWYhbGuqUiqiIEOkSCCUPFwAA//9UDaAPBQAA
    +wPAc6o3AugurNPuBBhXv/woAAAAAAAAA//yEDaAPBQAAmRiZGeokAArYBIAAWEewiBDpEggleamA
    +AGABipkYmRn6QPAVoAwFAFhIqIgQ6RIILXmOAABgAmDudAAKWASAAOWsDAroBIAA7xIGKVAEgADs
    +RgIp4ASAAFhr5okZiRiIEPsTphWhDQUAddsIKyAWLgr/frkxwPH+IKYV7/oOAACKJ4sR6qwgKeAE
    +gABYa6PAsuukAi0gBIAA+0BIFa/+bgAAAAAAAADqIAcq4ASAAFhIcYgQ+CEIFe/+9gCJQIwVh0P4
    +IAYVp9kBAO0WAi4HpgAAKiAH+uBoHeGqAQBYJ3mJFteg6jz/IkBBAADpnCAhjDUAAG2pBQgAhgkC
    +YcCgmhMvIQcW6lyIEvvUtAWq/wEA6eo6H/8CgADm/wIEaD0AAPYgyBWk3R0A7iEaJugFAAANPQyf
    +YOsiACvgBIAA7ak5AbgFAADpZgIkQEEAAOhmAy3+AoAAD38C72YBKugEgADvQgMjUEEAAFhrmZcX
    +6iQACdgEgABYYfaPQOMSByep7oAAhxDy86YV4QYFAPTB8g3g+PUAKyAW+WAE3SIAnQCIE9KA0Q8A
    +iRVkkJvAINEPACucGOokAAlgBIAAWG1YY//kiif4IAYVp7lBAA8CAOqsICgECoAA9WAEUdIAnQCM
    +FisKAezMICnoBIAAWGek+iBmFa/8OgAAAACLFuw9EQlQBIAA/WAARfAMFQBYZazyYGAV7/3CAGWs
    +0Pmf5mjSAJ0ALyAg8f/mF5IAnQBj/3sAAAAAAAAA6iAHKuAEgABYSA2IE9KA0Q+KJ9ww6xIBJVCB
    +AABYazHAsvtARh3gAgUA0Q8AANsw/GBoHeAMBQBYZ4PbQOw0AAroBIAA6hYDK/AEgADvEgYpUASA
    +AFhrWfdAaB3v+2YAAAArnBLqJAAJYASAAFhtHmP+/ABsEAQU6fMkQIAIRBH6gGgdoAsVAFmEixjp
    +32SgQvhGAAwwCSUAmaHopgAhAcmAAGghHG8kGe4iFmVIIQAAA0CICQiKAyCICQSKAwCICQCK2kD6
    +AEId4AwVAFmJWMAg0Q/HJNEPD+gwn6IO7jCeow3AMJ2kDLEw/UCmFaALBQCbpvtA5hXv/y4AAAAA
    +AGwQFOIWGynwBIAA/iNGFaAMFQD6I2gVp2UBAOjiACNb+QAAC8s5KaAHiqf6IaYV54gBAPgihhWh
    +mQEA6RYKJVCBAADqFh4qGASAAPTAL2ESAJ0ALRIbjdJl1B8f6aGP+BLpn/fgL8iQDqUAJiKuZGYc
    +KSKtZJYYGumasPiYqOiUAASvwYAALxIeKRIa++BoFa/FBQAF/wEvFhzvrwgEyIEAAO/8QCyoBIAA
    +/yAvkuIAnQAmEhotEhQlFhX2wGgVr/wFAOYWESboPQAADNkBpZbmFhArKASAAP7ALmLiAJ0AmBeZ
    +FZMWJBIb7xIKItgRAACbG/4iZhXkrR0A6hYWIbBBAADmFhIi0CEAAJocFul1lhgqEhomEhzkQQcv
    +/wKAAKL/7xYYIzEBAACWGRbphftBhBWqRAEA6hYZKicCgAAGRAKUH/XTAgWgB6IAJyAA6v8MBMgF
    +AADqEh4nQAUAAP8AaB2gaAEA6BIdJJWJgAArEhwsMACKowXMC6ur67xALmgEgAD7gBUC4gCdAAkM
    +QPoAIh3gCgUADLo4DasL7aoKBeghAAD6ACId4AwFAAa8OBbpZwh3C6bGJmCQ58sLDUAEgADnzAoF
    +2GEAAORkCAZgQQAAioANAIkPqjaawAsAi4yA4zwBIRAFAAD/n/rz4gCdAIMUD8sMCsIMkoD/oAgV
    +4AcVAPOgKBWgBgUAC3Y4qWmiopLReisBsf+f0PKAGefSAJ0AHOlNLRIbIhIaFulJGulI7hIPJ0AF
    +AAAGNgHqOgEMzgKAAAlmAikSHQqIAiMSGZiUllCPJygSFyYSFgP/DP5A5hXhNB0Ao2MvEhQS6TOT
    +Hp6AjdAuEh7ihgIhmAUAAO+GAy7OAoAA+GYADPALBQD5ACYV4ApVAOYWASmgBIAA6BIVJBBBAADo
    +FgApeASAAFmGcy8SHioSFiYSHI/zKBIVKxIQ5v8ICUgEgADmEhEn+QEAAPvgFVviAJ0AbakFCACG
    +CQJhAzQCKBIa6IIHKw0eAABkgaj10igFoPL1ABzpFy4SGi8SGC0SGy7hDfPzphXgClUA/aAIFeAL
    +BQBZhlgmEhsmYBbywAoFIgCdAC0SGy4SGigSGf2gCBXgClUA/8DoFeALBQDoFgAqYASAAFmGSy4S
    +Gy7gFiIK/3LhCioSG4sdWCgsZKKMLxITJhIYJxIS9eAFwhIAnQAmYp4pEhj2wBNT4gCdACmSnekW
    +FySHeYAAKhIaLxIZiVCKpy4SF/gghhXgBCUA++EAD7eZQQDvFhkkkRmAACoSHhPo1CsSHIqjo5Mj
    +MAAX6NGrqwUzC+00AAXZAQAA+mAQUuDJAQD6ACId4AoFAAy6OA2rC+2qCgXoIQAAjBXYoOeTCAuQ
    +BIAA/4AARjAOBQDsFh0mWGEAAP2CgBWv9u4AjRz6IWgVr/YOAAAA+48ADr/1ggAf6KyP+PfgDpiS
    +AJ0AJhIYJxISJmKeKRIY9sAOy+IAnQApkp0b6KPkkc1n0/0AAJq46RYXLPmGAABgABMrEhoqEhsr
    +sQ1YJ9Jj/rTAINEPAIsaLBIb67wYLlAEgABYa9bAINEPLGEAscz8wAQdr/liACUSGiYSGSVRDAZV
    +DGVSACYSGyZgBPTAENkSAJ0AIhIa4xIXKbcCgACIIaYzIiIC5oI2adgEgADzABKgUAcFACkSG4oW
    +KJAUhB6qiPaAAEJ3iAEA6JQUIiAFAAD1ABIeUgCdABzoly4SGi8SGC0SGy7hDST2nf2gCBXgClUA
    +9c8AD3ALBQBZhdYvEhsv8BYmCv928Q4rEhorsQ0qEhsFuwxYJ58qEhuNFoqnwMDqrCAu2ASAAFhl
    +/NKg0Q8nEh2LGPaAAgPwDwUA6wAVA7hBAACx/+eDHg+P6AAA9IAgFa/ylgAAAC0SFdMP7foMCUAE
    +gAD4IsgV5OodAPHBIA3gDwUADQCG6AwAB/gFAAB++fEoEheNGQ6eDPlAAEQwDwUA5O0mZEBBAAAN
    +IIboLAAH+AUAAH758WP9EBfoTY0c+iFoFa/4WgAAAPpvAA6/99oA//ZkDaAJBQCLGiwSG+u8Ei5Q
    +BIAAWGt4wCDRD8CgWYX7H+gzj/j5//EYkgCdAP/4/A2gCQUAwJAY6C7Aagb2NPcBBhWv+LYAAAAA
    +2+DtjA8qYASAAPojyBWk3R0AWQWy+iNGFaAOFQD+IaYVr+feAMCgWYXmH+gej/j5/8/okA6lAP/o
    +IA2gCQUALBIb+4BoHaAbxQBYa1jAINEPAADAkBjoFA72NPcBBhWv55IAAAD7LwAKv+g6APrPAAq/
    +6NIAACwSGi7AFS3AFCvAEezBCSlQBIAA7t0IC3AEgABZBYdj/dwAACoSG4sWWF/PLxIaj/Dx//Dy
    +kgCdACsSF+oSGynvAoAA/WAARfAMBQBYY6L0YGAVr/gCAAAAKhIb6zQACWAEgABb9pgoEhqIgQyr
    +Ees7CA04BIAA8R/toFIAnQDqEhspYASAAFv2Z/dAAEP/9oYAjBf2I2gV7/8FAA+PAQ+GDCZ0FC1x
    +Cf7isBWgCwUAK8QAL8QD5O4QDu4CgAD/pgAOsAkVAAndAp3BGufY+VWmFe/2BgAAbBAIiCIvIAeV
    +FPQgZhWg+/UA8RgsDeH/AQAoIBZ7gSwrEgTTD9MP/iDGFee7AQD7f8AV4AkVAOubOQlQBIAAWCcU
    +LxIG808QDeD79QAsMA8V57od58EW57/lUIAuC4YAAIcTsHclXDf+IKYV5FUdAOV1CA/PAoAA5pkI
    +AqgNAAD14AbiEAylACiSnvUAFQviAJ0AJZKd5FQAAooBgACK2PdACjiSAJ0ALmKuZOEBKWKt5JD9
    +ZXv9AADv1ggkiAGAACggFtMPe4EOmRDrMQYpUASAAFgm2YkQKiAEixP1QAk5EgCdACogFKuqCgpH
    +KiQU9UAM5lIAnQAsMA+JFPGRnA3nmQEA+SAOKVIAnQDpVAABwEEAAG15BQgAhgkCYcCgmhIMdBGk
    +VCggBPUACjkSAJ0AiTHkFgEqWASAAOUyAiyNYgAA8yAOQFAEBQCkeYoV4hICLVcCgACmqimmndEP
    +AIrY90APUJIAnQCJFQyZEaaZLpKe9cAQA+IAnQAukp2eEIgQ5YQABA/ZgACwqfmhBhXv/BYAAAAA
    +7BIDKVAEgADtEgQp2ASAAFhqV9Kg0Q8AwJAMrjTu1ggs+EYAANog/EBoHaAbxQBYaqZj/8onMA72
    +4ACD//pGAAAAK/wY6iQACWAEgABYap5j/6zAoFmFIR3nWorYKwr/+V/1YJAMpQBj/7kAAAAAAOsS
    +AylQBIAAWF8fY/7hAAAAACwhBx3nZvvO0gXqzAEA7jAOLmcCgAANzAIstiiKIBjnaf1AABUwDDUA
    +DKoCKrYp6AQFAfhBAAD5IAnBUgCdAG3pDgQCYw9AhgQCZQ8AhgQCYcDQ/CBGFe/62gCOMPPACuqS
    +AJ0AjxXiEgIv/wKAAKb/J/ad0Q8rIQn8QrAVr/0FAA2tAQ2vDP5Chh3gDgUA7ZQDLmECgADulAAt
    +3gKAAP1mAA2wCBUACLsCm5H41aYVr/i6AIon/KBoHaALFQDtEgMlUIEAAFhkt/ogRhWv+O4AANog
    +60QACuAEgABb9b6LEYkxDKwR7LsIDSAEgADxP/IAUgCdAOokAArgBIAAW/WNpKSkeYoV4hICLVcC
    +gACmqimmndEP//WIDaAFBQAAACv8EuokAAlgBIAAWGpGY/5MAAAAAAD+IMYV4AoFAFmExh3m/4rY
    +/iDIFeD79QD5X+/wkAylAP/0iA2gBQUAwOD+IAYVr/gOAAyoNPmhBhWv9DYAiieFq/tEABWvyQUA
    +CakBqVkpnEBt6RMEAmMPgIYEAmkPYIYEAmd5+xnTD40TDwIA+6BoHeAMBQBYZH76IEYVr/VuAPXv
    +AA///4oA2iD6gGgd4AwFAFhih7N7jBXiEgIuZwKAAKbMK8ad0Q9sEAQjIAAkCu10MQYiIQO8ItEP
    +hiCFI4Qh9nAABDs2IQD4YABBs2YBAKYzDjMR8q8ACX1EAQDjPBohE8kAAAQkLAQzKKMi0Q9sEAiK
    +IicgB4kwlRT4QtAVoXcBAPFbDA3omQEA+CAmFeD79QB7gSArEgQLC0f7f8AV4AkVAOubOQlQBIAA
    +WCYE80/gDeD79QAa5rSIqBbmsfcADGCSAJ0ALWKuZNGsJWKtZFGosIiYqOlUAAKMeYAAFeaiJVCA
    +JVw3+CAGFeRVHQDlRQgLzwKAAOaZCAKoDQAA9OAIWhIAnQAokp71ABMD4gCdACWSnWRRbyogFvtD
    +Jg3g7NUAKzAQ/WASZCIAnQArMQu8u9ogWCXMLCAE9YAK+RIAnQAoIBSkiAgIRygkFPUADIZSAJ0A
    +ihQe5qKNESghBxzmghnmoP+h4BXqiAEA/wAAFDT/HQDpiAIH+AUAAA9PDJhQiyAP7Dn8oGYV56oB
    +AOxWAi3eAoAA60sCAshBAADrVgEhwEEAAPlACAFSAJ0A6EENYlP9AABtqQUIAIYJAmHAgJgT6SAE
    +Ilv9AAAMuxGrW/UgB5kSAJ0AiDHlMgIl2EEAAOsWAiwJ8gAA8wAK8FADBQCjTIgTDH0Rpt3s1p0s
    +EASAANEPAAAAAAAAAPcADXiSAJ0ADHkRppkukp71wA3T4gCdACWSnWRRsbCMnKhlXuRgAFHqJAAJ
    +2ASAAO0SBCpgBIAAWGk70qDRDwDAoFmEFBrmTIio+R/zUJD79QD/+cgNoAUFAADaIPxAaB2gG8UA
    +WGmGY/+8wFDA2g2INPlBBhWv+UoAK3wY6iQACWAEgABYaX5j/5wAAAAAAOokAApYBIAAWF4FY/6p
    +iif9IGgdoAsVAOqsICpoBIAAWGPL+iBmFa/8AgCLMPNgCOKSAJ0A4hIDK+cCgACmzCTGndEPjxAu
    +IQn4QrAV7/oFAAqKAQqMDCwkFOSZEA92AoAACe4C++BmHaALBQD74AYd4A0VAA3uAp7x/NWmFe/4
    +6gAAAAAAAADqJAAK4ASAAFv0u4sSKDIB6hYFLWcCgADsuwgNGASAAPEf9VBSAJ0A6iQACuAEgABb
    +9ImIE6Ojo0wMfRGm3ezWnSwQBIAA0Q//9owNoAUFAI40izeNNf5wAAe7ziEA/4AARnPuAQCuzA7M
    +Ef1vAA293QEA7MwaJdvJAAANvSwNzCj9YABFv/YiAAArfBLqJAAJYASAAFhpNGP+dMCgWYO3GuXw
    +iKj5H/I4kPv1AP/5ZA2gBQUAAMBQwPoPjzT/QQYV7/kmALBLDLsR61sICVAEgAD7YgAV4AwFAFhh
    +i7NM4hIDK+8CgACm3SzWndEPAABsEATaIFgluIQ3JTAW+cvmBaKmBQAGpigX5fioaAVVCghVC6dV
    +iFC4RPUEBg3gBxUAiDLqUgEpAQqAAAB5GgmIApSgmkGVQJRRmDLRD9ogWCWmG+XqHeXqK7Iy6tKB
    +LWAEgACsu+8wFi3eQoAAq6oe5eYZ5eTo5doeZwKAAK7MqWkrkn3u5cUfgQqAAO/CASvoCoAADbsC
    +LZJ/CP8BK5Z9D90CDe04DbsCm8Ipkn9kn39YAraIMupSASkBCoAAAHkaCYgClKCaQZVAlFGYMtEP
    +bBAI2iBYJYTUoBvlzvnLmAXipgUABkQoFeW96UkICVcCgACrqoqgKZJ/GOXEpUX7IAQEsGMFAPgg
    +BhXgBxUA4QAFATO5AAD4gABCMADiAAAAAAM8CvWAAgZ8OEUA6MgICVAEgADogn8qWASAAP50ABWu
    +LQUA7cwIC2gEgAALgAABAYcDN2DhAQcJ9yAAANEPbBAEKCAFJSAH+mCoFa/01QD6QEgV4AMlAP0B
    +IBHRVQEAwCDRDwCIKRnlpJor+wAHfCIAnQAJWQkpnQIqkQgpkQT7IARbogCdAMGv+0AECOIAnQDa
    +IFhhN4siA7oBZK/AiicEuwHrJgIlUMEAAFhbGuPldBUBEYAAKKAAA4gKiIzsoActWASAAPpAaB2g
    +DUUAC4AAZa/hiSdkn4WKmsqnKpIJZK97KKAAA4gKiIzsoActWASAAPpAaB2gDTUAC4AAZa/hY/9a
    +AAD//1gNoAoFANogWGEnKyAi6rsMCVAEgABYYnfaUPoAIh3gDAUAWGMmiyIDugHzf/smYgCdACwg
    +B+S9AQlQBIAA/EBGFeG8AQDrvB8pYASAAFhof8Ag0Q8A6yAiKVAEgABYYmUqIAXB436hDGioKYsi
    +82AEBX/8hgAvIDrAj3j56vpAaB2gCwUA/AACHaANJQBYYZFj/9cAAPpAaB2gCwUA/AACHaANJQBY
    +YQ9j/78AAGwQCogrHeVPLiAhizf8YMgVoP/lAA/uAS4kIQ3MAQy7DOuJCHjIBIAAwCDRDwMAhgkC
    +YZsVKCAFJSAH+CEGFe/01QD8QEgV4AMlAP0bQEHRVQEAiimbK/tAB+xiAJ0AG+U4C1sJK70CLLEI
    +K7EE/WAEs6IAnQDBz/2ABGDiAJ0AAioCWGDOiyIDugFkr5qKJwS7AesmAiVQwQAAWFqx26Dj5QoV
    +ASGAACiwANMPA4gKiIwssAf6QGgdoA1FAAuAAOukAA1/JgAAiScPAgBkn1iKmiuSCcqnZL9OKLAA
    +A4gKiIwssAf6QGgdoA01AAuAAOukAA1/NgAAY/8tAAAAAAD//0wNoAsFANogWGC7KyAi6rsMCVAE
    +gABYYgvaUPoAIh3gDAUAWGK6iyIDugHzf/rWYgCdACwgB+S9AQlQBIAA/EBGFeG8AQDrvB8pYASA
    +AFhoE8Ag0Q8A6yAiKVAEgABYYfkqIAXB436hDGioKYsi82AEBX/8XgAvIDrAj3j56vpAaB2gCwUA
    +/AACHaANJQBYYSVj/9cAAPpAaB2gCwUA/AACHaANJQBYYKNj/78AAGwQBCkwFglZFPUgBliSAJ0A
    +8S2wDe/65QDj5L8UpfkAAGiVBMAg0Q8AKyAGsLsLC0frJAYt/34AAI0ijCcK3QHtJgImUMEAAFha
    +WcmsKKAAA4gKiIzsoActWASAAPpAaB2gDUUAC4AAZa/hiSdkn7OKmmSgmoqZZK+pKKAAA4gKiIzs
    +oActWASAAPpAaB2gDTUAC4AAZa/hY/+IKSAGsJkJCUfpJAYs++4AAIwiiScKzAGcIouaZLBOi5ko
    +sAADiAqIjNog/WDwFaANNQALgADAINEPAAAAAOokAAnYBIAA7EQACugEgABYaX3AINEPAOokAAnY
    +BIAA7EQACugEgABb/1PAINEPAP/+vA2gCwUA//2MDaAKBQBsEATRDwAAAGwQCBXknRTkfBfknZIS
    ++CBIFaAKBQD6IGYVoAlFAJkUGuSXCIIJ4IEECReCgAD2QABD8AgVAOoiCAxACoAA+CAmFa/59QD5
    +FwAMcAYFAPggBhWgAIoAmxOMFLFm4iwMI7gxAADlXAImY/0AAOwWBCYE8YAALVHC+sAEANALFQDg
    +uxoOo0wAAC5xfmTvygIqAlhiyY8R+sAEANAIFQDgiBoNGASAAOgWAyeAaYAAiaKKEAqZAZkyijcq
    +rDBYWfXJrCigAASICoiM7KAHLVgEgAD6YGgdoA1FAAuAAGWv4Yk3ZJ90iprLpyqSCWSvaiigAASI
    +CoiM7KAHLVgEgAD6YGgdoA01AAuAAGWv4WP/SYsT+iBIFaAJFQALmzlYY5vRD///GA2gCgUAbBAG
    +HeRWCysRrbMqMn8Z5FQV5D6IoPigAETwBAUA6bkIBAGRgAAsMngvMnv5gAWEYgCdAGXw7Cw2fCsy
    +eSs2e91ADeQWlKAN5BbAyfxABhQiAJ0ALzJ7wcDt5EIXg5mAACIyfCohBI4g8+H+Daa6AQAkNnz0
    +b2YVoAAeAC42fO2vAQXD/QAACP8C7yUEJYxZAAAiMnywzO8yeyEA8YAAycZj/7/aIFhiNmWgnSoh
    +BP9BAAwWmgEAyJjRD9ogWGNh0Q8A2iBYY5TRDwAAAAAAAPpAaB2gCwUAWGNh0Q8AAADq0mAhY+EA
    +APuABADQCxUA/WABBd/89QAMuwMLqgEq1mBZhiEkNnwkNnv6b+gVr/zKAFl781hh6C1So2TfNVl7
    +xGP/LxzkEf5viBWgClUA+G9IFaALRQDoFgAha+UAAFmBQPpv6BWv+9IAKTJ74jZ8LPtGAAAiNnvR
    +DwAAbBAEFOQDGeP/6OPpGV7CgACktCNCf6mI6LgIAYJBgACKMHipAipCexzj+CsxBCpGfwy6Aeo1
    +BCnQBIAAWGH5zq4pMQT/IQAMFtkBAMjX0Q/aMFhjJdEP2jBYY1jRDwAAAAAAAPpAaB2gCwUAWGMl
    +0Q8jRn/RDwAAbBAE8GDwDe/59QCIIgk5AwmIASgmAoonDwIADwIAKqwwWFlc4+O2FQERgAAooAAD
    +iAqIjOygBy1YBIAA+kBoHaANRQALgABlr+GJJ8uUiprKqIqZyawooAADiAqIjOygBy1YBIAA+kBo
    +HaANNQALgABlr+HRDwAAAAAAAP//UA2gCgUA0Q8AAGwQBPJdABXgGMUA+EAHXCczAQAU44v0YAXS
    +EgCdAAw5EaSZKJKe0w/3AAcG0gCdACmSnWSQzxzjnhvjtgIqCQyqCquqWGH7+kAEANAJFQD9IAEE
    +3/v1AOKkAASAcYAAiqILmwMLqgGaIoonDwIAKqwwWFkm4+OAFQERgAAooAADiAqIjOygBy1YBIAA
    ++kBoHaANRQALgABlr+GJJ2SQZCqSCsqmKpIJyawooAADiAqIjOygBy1YBIAA+kBoHaANNQALgABl
    +r+HRDwAAAP//XA2gCgUAFeNcilhqoTcMORGkmSuSnm69PimSneSQOmVb/QAAm1hlnz5gAAvaMFl7
    +amWvM9EP0Q/RDwAAAAD//IwNoAkFAMCgWYESilhrob3//0gNoAkFAMCQwMoMrDT8oQYVr/8OAAAA
    +AGwQBBjjQQIDRwwzEagzKzKEGeNKKLAAKrIBCYgKCiGMAgo+KIIMAwI+/EBoHaANJQALgAAiNoQM
    +AgDRD2wQBBTjMgIDRwwzEaQzJDKEikEmQAAoQAj6mGgdoKklAAIFPgMCPnmBJRjjNQhoCoiM6lQA
    +ClgEgAD8QGgdoA0lAAuAACI2hAwCANEPAAAA6yQAClAEgABYYbvzQGgdr/8uAAAAAAAAbBAEGuM0
    +KqJGK3rQC6ooFONL/0AAFTALFQALqgL6luYVoAkFAAnkMRXjRhjjKyhWhCVShCNCt2YwDW0IBStC
    +t2awBGP/8wAAHOM/IsaKY//8AAAAbBAEWX/sEuMCE+MdKSKC0w8JGo4DqAqIgAuAAGP/7ABsEAQq
    +IgcqrBBYYpjRDwAAbBAEiCcijBDaIFhid2ihAdEP2iBYYnES4ysLqBHoIggFAdmAAAzqMCsihSuy
    +ACKs/+y7CAlQBIAAWYTvHOMjKsJ/+kAEANALFQAAuxoLqgIqxn9ZhR7RDwAAAAD6AOIdoAsVAFhi
    +Tywifywmg9EPAGwQBCYiBw8CAOZsECnQBIAAWGKy7DQACmgEgADuVAANWASAAO8iACtQBIAAWGH1
    +0Q8AAAAS4woD6DAE7jAFsTCTIJQhlSIS4wYT4tSEIAQzApMgEuMEwDAoN0AoN0QoN0goN0wjPQFy
    +M+0DAgAS4v4T4t2TIMcvE+L9AyMDEuL8hCAENAGUIBLi+4QgBDQBlCAS4vmEIAQ0AZQgEuL4hCAE
    +NAGUIMcvwDEDIwMS4vWEIAQ0AZQgY//8AAAAEuLygyADExQPMxGTIFf/2hDi75EAkgGTApQDEeLt
    +ghAB6jCiEQHwMcBABOQWAAIAEeLpghAjGgADIgKSEBHi5sAhkhAE5DGEA4MCggGBAADSMAEjAAAA
    +ABDi4ZEAkgGTApQDEeLfghAB6jCiEQHxMcBABOQWAAIAEeLXghAjKgADIgKSEBHi18AhkhAE5DGE
    +A4MCggGBAADTMAEzAAAAABDi0pEAkgGTApQDEeLQghAB6jCiEQHyMcBABOQWAAIAEeLFghAjSgAD
    +IgKSEBHiyMAhkhAE5DGEA4MCggGBAADUMAFDAAAAAABclAFdlAJelANflABDAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXJABXZACXpADX5AAUwAAAAAA
    +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJyUAB2QAZ2UAp6U
    +A5+UBAiUBQmUBgqUBwuUAEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACckAGd
    +kAKekAcdkAOfkAR4kAV5kAZ6kAd7kABTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    +AAAA3JQAHZAB3ZQC3pQD35QEBJQFBZQGBpQHB5QICJQJCZQKCpQLC5QAQwAAAAAAAAAAAAAAAAAA
    +AAAAAAAAAAAAANyQAd2QAt6QCx2QA9+QBLSQBbWQBraQB7eQCLiQCbmQCrqQC7uQAFMAAAAf//uQ
    +ANIxEP/+CgAAAAAAH//72ADTMRD//goAAAAAAB///CAA1DEQ//4KAAAAAAAA9DAKAAAAAAD0MAoA
    +AAAAAPQwCgAAAABsEAQqIhAooAUpCpL5AATlYgCdACsiGPrgAAZwjbUA/YAETWIAnQDzYAQr0gCd
    +AP9uwAwfyQUAi62Ot4jqjOiN6y/sIOn/AQZQwQAA790IBEDBAADo5gom6QEAAOrTYH5IBIAAfaFp
    +muga4RwKAIcJAmEJAmEJAmHAgejGBSlQBIAA+YDmFaAOBQD/gIYVoA0lAP+AxhWv//UA78YDL2AE
    +gABYA3vAINEPWMcSwCDRDxnhDAm5AfhDBhXgAgUA0Q8M2gwK+gwqrHD7wQYVr/5yAC38QP3BBhXv
    +/kYAbBAEE+EBAyIC0Q8AbBAEFuD/JCAHiWDAc/EyQA3hRAEAKSIYCehR9QAJiJIAnQDzwfAF4anh
    +APVACYiSAJ0A9IAGchIAnQAMSRGjmSuSnvdgCsnSAJ0AKpKdZKEzG+Do6wAFDUgEgAAJAmEJAmEJ
    +AmEpIQcb4Oj/wdAF6pkBAOzg5xzPAoAAC5kCmaAZ4OX+QAgVoD0FAJ2n/UCmFaAbhQCbo5mi7+4C
    +D0YCgACepPcGAAxwDgUAnqaYoSgiGAiIQe6mCCxHAoAAmKnt4NYafwKAAKP/J/adLCIYnmAqIhAN
    +zALsJhgpWASAAFi35QUKR2iiGIon+gAiHeAMBQD7RAAVoA0VAFheCdKg0Q/AINEPHODFi8j3YATQ
    +kgCdAAxJEaOZLZKe96AFIdIAnQAqkp3koJtl6/0AAJ3IZa8eYABPjiKxn+9mACcBqYAABQhH9QAE
    +SRIAnQDAINEPKhoACpkC+EMGFe/7JgAAACsqAAubAvpDBhXv+yYAAAAAACtMGOokAAlgBIAAWGOQ
    +Y/+9AACMImXPtitMGOokAAlgBIAAWGOKY/+lAAAAAAD/+qgNoAoFAMCgWX4KHOCbi8j5f/rgkgCd
    +AP/9xA2gCgUAwKDA2g29NP2BBhXv/YoAjCePyorJ/4QAFa/IBQDo7gEH+EEAAO/GCiVTwQAA6sYJ
    +J3EBAAB+qymJyx3giaqamsmdoIwg+8EOBeANFQDrpgIuZgKAAA3MAv1AJhWgAgUA0Q8d4H+doIwg
    ++8D8BeANFQDrpgIuZgKAAA3MAv1AJhWgAgUA0Q9sEAjkIhAqYASAAOdCByvQBIAA6+BzGXAEgADy
    +gsgVoBg1AOdyDiL76QAAePspGOBtCPgKiICaFJwS7hYBLAAigAAAAACSECqykexUAAnYBIAAWXzN
    +ZKYv8oLGFaACBQDRDwAAAAAAK+IYC5tS7hYBJf85gAAa4FriFgAp2ASAAOqisyrgBIAAWXy/ZKRZ
    +IiqAonKSFSIg3hrgUtsw6qK1KuAEgABZfLj7QEEAEgCdABrgTNsw6qK3KuAEgABZfLL7QEFoEgCd
    +ABrgRtsw6qK5KuAEgABZfKxkppQa4EHbMOqiuyrgBIAAWXyn+0BC4BIAnQDBOPJAHrhiAJ0AaScj
    +ixUjtN2LEPqCxhXgAgUA0Q+SECqyiexUAAnYBIAAWXyaZKbbixD6gsYV4AIFANEPAACSECqyl+xU
    +AAnYBIAAWXySZa8S+iBoHaALtQBYtNT6ACId4AMFAOqzOAUBiYAA6hICK1gEgABZedLDsOzgHh0o
    +BIAA/KBoHeAKVQBZfSTIWRzgGo0RDFw2LNYXZTTgjRD8gsYV4AIFANEPLkByZO61khAqsq3sVAAJ
    +2ASAAFl8dmWuovogaB2gG2UAWLS4+gAiHeACBQDqsjgFAKmAAOoSAitYBIAAWXm2LH0DKsUoZSSM
    +jRD8gsYV4AIFANEPAJIQKrKf7FQACdgEgABZfGJkovsa3/fbMOqiiyrgBIAAWXxdZa5A+iBoHaAL
    +VQBYtKD6ACId4AIFAOqyOAUpmYAA6hICK1gEgABZeZ4sQHPxgCju0gCdAGSlFYoU+gCiHeAM1QBY
    +tHzSoNEPkhAqsqXsVAAJ2ASAAFl8R2WutPogaB2gGyUAWLSKZKPzK0By+2BEIBIAnQDqEgIrWASA
    +AFl5iCxCF4sQK0YWCsw2/ILmFaACBQDRDwCSECqyo+xUAAnYBIAAWXw0ZKJzGt/J2zDqop0q4ASA
    +AFl8L2WuVPogaB2gC+UAWLRyZKOT6hICK1gEgABZeXMrfQIqtRSLEPqCxhXgAgUA0Q+SECqylexU
    +AAnYBIAAWXwgZKJ6Gt+02zDqoqEq4ASAAFl8G2SjtxrfsNsw0w/qoo8q4ASAAFl8FmWt7vogaB2g
    +C3UAWLRYZKMtK0ByZLfyGt+lixLqotsrYASAAFl8DGWm5ytAc8DIDLsCK0RzixD6gsYV4AIFANEP
    +AACSECqyq+xUAAnYBIAAWXwBZKI/Gt+W2zDTD+qijSrgBIAAWXv8Za2G+iBoHaALZQBYtD5kosUr
    +QHJkt3ka34uLEuqi2ytgBIAAWXvyZKeIK0BzLAr9DLsBK0RzixD6gsYV4AIFANEPAJIQKrKT7FQA
    +CdgEgABZe+dkogca33zbMNMP6qKHKuAEgABZe+Jkowoa33bbMOqipyrgBIAAWXvdZKw/Gt9y2zDq
    +oq8q4ASAAFl72GWsLMCl/b7gBaA7BQBZfHYa32qLEuqiyStgBIAAWXvQZaQYixErshgLmVLImWiS
    +B/kgBPnSAJ0AjRGMECvWGPyCxhWgAgUA0Q+SECqyg+xUAAnYBIAAWXvCZKG7Gt9X2zDqooUq4ASA
    +AFl7vWWsjPogaB2gCyUAWLQAZKHLGt9OixLqotsrYASAAFl7tWWsa4oU+gBCHeAM1QBYs+HSoNEP
    +AAAAAAAAAOoSASpYBIAAWLP7zayCFSIg3mP8FwAAAOoSAitYBIAAWXjw9UAq8pIAnQDHL9EPAPog
    +aB2gC/UAWLPlZKFi6hICK1gEgABZeOfoEgAjyAsAACqVFfiCxhWgAgUA0Q8AAPogaB2gGxUAWLPZ
    +ZKEyKkByZKXUKUBz8T/ez5IAnQDxP96P0gCdAOoSAitYBIAAWXjVLUIYHN8j+6EADrA7BQD8gwYV
    +4ApVAFl8JYsQ+oLGFeACBQDRDwD6IGgdoAulAFizw2Sg2i5ActMPZOTl6hICK1gEgABZeMMvQTb7
    +4A8CogCdAIoU+gFCHeAM1QBYs6LSoNEPAAAA+iBoHaAbVQBYs7NkoJrqEgEqWASAAOwSAitoBIAA
    +WLM6ixD6gsYV4AIFANEPAAAA+iBoHaALlQBYs6dkoGooQHJkhIga3vWLEuqi2ytgBIAAWXtbZaHN
    +K0BzjRD8gsYV4AwVAAy7AvqOZh3gAgUA0Q8AAAAAAAAA+iBoHaALFQBYs5XKohre5IsS6qLbK2AE
    +gABZe0tlqsOKFPoAIh3gDNUAWLN30qDRD8Cl/b3CBaA7BQBZe+XAINEPAAAAAAAA+iBoHaALhQBY
    +s4P6ACId4AIFAOqyOAUBSYAALEByDwIAZMP5Gt7U6xICK2AEgABZezRlof0tQHPA6A7dAi1Ec2Uv
    +pY8Q/oLGFeACBQDRDwD6IGgdoBsFAFizb2SviihActMPZIOE6hICK1gEgABZeG8pQhmLECtGFgqZ
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 01:00:33 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 6FF5CA3D;
     Thu, 28 Feb 2013 01:00:33 +0000 (UTC)
     (envelope-from neel@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 6256EE75;
     Thu, 28 Feb 2013 01:00:33 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S10XmG075163;
     Thu, 28 Feb 2013 01:00:33 GMT (envelope-from neel@svn.freebsd.org)
    Received: (from neel@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S10X23075162;
     Thu, 28 Feb 2013 01:00:33 GMT (envelope-from neel@svn.freebsd.org)
    Message-Id: <201302280100.r1S10X23075162@svn.freebsd.org>
    From: Neel Natu 
    Date: Thu, 28 Feb 2013 01:00:33 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247438 - head/sys/dev/pci
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 01:00:33 -0000
    
    Author: neel
    Date: Thu Feb 28 01:00:32 2013
    New Revision: 247438
    URL: http://svnweb.freebsd.org/changeset/base/247438
    
    Log:
      Remove the quirk to allow use of MSI when the guest is running inside bhyve.
      
      This became redundant after the hostbridge presented to the guest started
      advertising the PCI-E capability (r246846).
      
      Obtained from:	NetApp
    
    Modified:
      head/sys/dev/pci/pci.c
    
    Modified: head/sys/dev/pci/pci.c
    ==============================================================================
    --- head/sys/dev/pci/pci.c	Thu Feb 28 00:52:44 2013	(r247437)
    +++ head/sys/dev/pci/pci.c	Thu Feb 28 01:00:32 2013	(r247438)
    @@ -244,7 +244,6 @@ static const struct pci_quirk pci_quirks
     	 * but support MSI just fine.  QEMU uses the Intel 82440.
     	 */
     	{ 0x12378086, PCI_QUIRK_ENABLE_MSI_VM,	0,	0 },
    -	{ 0x12751275, PCI_QUIRK_ENABLE_MSI_VM,	0, 	0 },	/* bhyve */
     
     	/*
     	 * HPET MMIO base address may appear in Bar1 for AMD SB600 SMBus
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 01:22:15 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id B9363476;
     Thu, 28 Feb 2013 01:22:15 +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 AC364F57;
     Thu, 28 Feb 2013 01:22:15 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S1MFJ0083623;
     Thu, 28 Feb 2013 01:22:15 GMT (envelope-from gjb@svn.freebsd.org)
    Received: (from gjb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S1MFUB083622;
     Thu, 28 Feb 2013 01:22:15 GMT (envelope-from gjb@svn.freebsd.org)
    Message-Id: <201302280122.r1S1MFUB083622@svn.freebsd.org>
    From: Glen Barber 
    Date: Thu, 28 Feb 2013 01:22:15 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247441 - head/usr.bin/dc
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 01:22:15 -0000
    
    Author: gjb (doc,ports committer)
    Date: Thu Feb 28 01:22:14 2013
    New Revision: 247441
    URL: http://svnweb.freebsd.org/changeset/base/247441
    
    Log:
      Properly handle '-h' argument.
      
      PR:		176332
      Reviewed by:	scottl
      MFC after:	3 days
    
    Modified:
      head/usr.bin/dc/dc.c
    
    Modified: head/usr.bin/dc/dc.c
    ==============================================================================
    --- head/usr.bin/dc/dc.c	Thu Feb 28 01:05:48 2013	(r247440)
    +++ head/usr.bin/dc/dc.c	Thu Feb 28 01:22:14 2013	(r247441)
    @@ -84,7 +84,7 @@ main(int argc, char *argv[])
     	bool extended_regs = false, preproc_done = false;
     
     	/* accept and ignore a single dash to be 4.4BSD dc(1) compatible */
    -	while ((ch = getopt_long(argc, argv, "e:f:Vx", long_options, NULL)) != -1) {
    +	while ((ch = getopt_long(argc, argv, "e:f:hVx", long_options, NULL)) != -1) {
     		switch (ch) {
     		case 'e':
     			if (!preproc_done)
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 01:24:25 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 3A408612;
     Thu, 28 Feb 2013 01:24:25 +0000 (UTC) (envelope-from pjd@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 2CA03F72;
     Thu, 28 Feb 2013 01:24:25 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S1OPGN083937;
     Thu, 28 Feb 2013 01:24:25 GMT (envelope-from pjd@svn.freebsd.org)
    Received: (from pjd@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S1OPmv083936;
     Thu, 28 Feb 2013 01:24:25 GMT (envelope-from pjd@svn.freebsd.org)
    Message-Id: <201302280124.r1S1OPmv083936@svn.freebsd.org>
    From: Pawel Jakub Dawidek 
    Date: Thu, 28 Feb 2013 01:24:25 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247442 - head/contrib/openbsm/bin/auditdistd
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 01:24:25 -0000
    
    Author: pjd
    Date: Thu Feb 28 01:24:24 2013
    New Revision: 247442
    URL: http://svnweb.freebsd.org/changeset/base/247442
    
    Log:
      When we are waiting for new trail files we may have been disconnected and
      reconnected in the meantime. Check if reset is set before opening next trail
      file, as not doing so will result in sending OPEN message with the same
      file name twice and this is illegal - the second OPEN is send without first
      closing previous trail file.
    
    Modified:
      head/contrib/openbsm/bin/auditdistd/sender.c
    
    Modified: head/contrib/openbsm/bin/auditdistd/sender.c
    ==============================================================================
    --- head/contrib/openbsm/bin/auditdistd/sender.c	Thu Feb 28 01:22:14 2013	(r247441)
    +++ head/contrib/openbsm/bin/auditdistd/sender.c	Thu Feb 28 01:24:24 2013	(r247442)
    @@ -394,6 +394,7 @@ read_thread_wait(void)
     
     	mtx_lock(&adist_remote_mtx);
     	if (adhost->adh_reset) {
    +reset:
     		adhost->adh_reset = false;
     		if (trail_filefd(adist_trail) != -1)
     			trail_close(adist_trail);
    @@ -408,6 +409,14 @@ read_thread_wait(void)
     	while (trail_filefd(adist_trail) == -1) {
     		newfile = true;
     		wait_for_dir();
    +		/*
    +		 * We may have been disconnected and reconnected in the
    +		 * meantime, check if reset is set.
    +		 */
    +		mtx_lock(&adist_remote_mtx);
    +		if (adhost->adh_reset)
    +			goto reset;
    +		mtx_unlock(&adist_remote_mtx);
     		if (trail_filefd(adist_trail) == -1)
     			trail_next(adist_trail);
     	}
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 02:23:45 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id EBD267EB;
     Thu, 28 Feb 2013 02:23:44 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
    Received: from onyx.glenbarber.us (onyx.glenbarber.us
     [IPv6:2607:fc50:1000:c200::face])
     by mx1.freebsd.org (Postfix) with ESMTP id 7F81D245;
     Thu, 28 Feb 2013 02:23:44 +0000 (UTC)
    Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174])
     (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
     (No client certificate requested) (Authenticated sender: gjb)
     by onyx.glenbarber.us (Postfix) with ESMTPSA id 1117B23F645;
     Wed, 27 Feb 2013 21:23:35 -0500 (EST)
    DKIM-Filter: OpenDKIM Filter v2.8.0 onyx.glenbarber.us 1117B23F645
    Authentication-Results: onyx.glenbarber.us; dkim=none
     reason="no signature"; dkim-adsp=none
    Date: Wed, 27 Feb 2013 21:23:33 -0500
    From: Glen Barber 
    To: Jack F Vogel 
    Subject: Re: svn commit: r247430 - in stable/8/sys: conf dev/e1000 modules/em
     modules/igb
    Message-ID: <20130228022333.GC70215@glenbarber.us>
    References: <201302280022.r1S0M4vm064514@svn.freebsd.org>
    MIME-Version: 1.0
    Content-Type: multipart/signed; micalg=pgp-sha256;
     protocol="application/pgp-signature"; boundary="f0KYrhQ4vYSV2aJu"
    Content-Disposition: inline
    In-Reply-To: <201302280022.r1S0M4vm064514@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-8@freebsd.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 02:23:45 -0000
    
    
    --f0KYrhQ4vYSV2aJu
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable
    
    Jack,
    
    This commit seems to break the build for at least powerpc and sparc64.
    
    Glen
    
    On Thu, Feb 28, 2013 at 12:22:04AM +0000, Jack F Vogel wrote:
    > Author: jfv
    > Date: Thu Feb 28 00:22:04 2013
    > New Revision: 247430
    > URL: http://svnweb.freebsd.org/changeset/base/247430
    >=20
    > Log:
    >   MFC of the E1000 drivers to STABLE/8, this includes the follow revisions
    >   plus a few tweaks:
    >    196969,196970,211516,214646,215781,215789,215808,215910,223350,
    >    223482,223831,228281,228393,229939,231796,232238,234665,235256,
    >    236406,238148,238151,238214,238765,238770,238953,238981,239105,
    >    239109,239304,240518,240693,240968,241037,241856,241885,243570,
    >    243857,245334,246128,246482,247064
    >=20
    > Added:
    >   stable/8/sys/dev/e1000/e1000_i210.c
    >      - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c
    >   stable/8/sys/dev/e1000/e1000_i210.h
    >      - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h
    > Modified:
    >   stable/8/sys/conf/files
    >   stable/8/sys/dev/e1000/e1000_82541.c
    >   stable/8/sys/dev/e1000/e1000_82543.c
    >   stable/8/sys/dev/e1000/e1000_82571.c
    >   stable/8/sys/dev/e1000/e1000_82575.c
    >   stable/8/sys/dev/e1000/e1000_82575.h
    >   stable/8/sys/dev/e1000/e1000_api.c
    >   stable/8/sys/dev/e1000/e1000_api.h
    >   stable/8/sys/dev/e1000/e1000_defines.h
    >   stable/8/sys/dev/e1000/e1000_hw.h
    >   stable/8/sys/dev/e1000/e1000_ich8lan.c
    >   stable/8/sys/dev/e1000/e1000_ich8lan.h
    >   stable/8/sys/dev/e1000/e1000_mac.c
    >   stable/8/sys/dev/e1000/e1000_mac.h
    >   stable/8/sys/dev/e1000/e1000_manage.c
    >   stable/8/sys/dev/e1000/e1000_manage.h
    >   stable/8/sys/dev/e1000/e1000_nvm.c
    >   stable/8/sys/dev/e1000/e1000_nvm.h
    >   stable/8/sys/dev/e1000/e1000_osdep.h
    >   stable/8/sys/dev/e1000/e1000_phy.c
    >   stable/8/sys/dev/e1000/e1000_phy.h
    >   stable/8/sys/dev/e1000/e1000_regs.h
    >   stable/8/sys/dev/e1000/if_em.c   (contents, props changed)
    >   stable/8/sys/dev/e1000/if_igb.c   (contents, props changed)
    >   stable/8/sys/dev/e1000/if_igb.h
    >   stable/8/sys/dev/e1000/if_lem.c
    >   stable/8/sys/modules/em/Makefile
    >   stable/8/sys/modules/igb/Makefile
    > Directory Properties:
    >   stable/8/sys/dev/e1000/   (props changed)
    >=20
    > Modified: stable/8/sys/conf/files
    > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D=3D
    > --- stable/8/sys/conf/files	Thu Feb 28 00:18:56 2013	(r247429)
    > +++ stable/8/sys/conf/files	Thu Feb 28 00:22:04 2013	(r247430)
    > @@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c		optional em | i
    >  	compile-with "${NORMAL_C} -I$S/dev/e1000"
    >  dev/e1000/e1000_ich8lan.c	optional em | igb \
    >  	compile-with "${NORMAL_C} -I$S/dev/e1000"
    > +dev/e1000/e1000_i210.c		optional em | igb \
    > +	compile-with "${NORMAL_C} -I$S/dev/e1000"
    >  dev/e1000/e1000_api.c		optional em | igb \
    >  	compile-with "${NORMAL_C} -I$S/dev/e1000"
    >  dev/e1000/e1000_mac.c		optional em | igb \
    >=20
    > Modified: stable/8/sys/dev/e1000/e1000_82541.c
    > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D=3D
    > --- stable/8/sys/dev/e1000/e1000_82541.c	Thu Feb 28 00:18:56 2013	(r24742=
    9)
    > +++ stable/8/sys/dev/e1000/e1000_82541.c	Thu Feb 28 00:22:04 2013	(r24743=
    0)
    > @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st
    >  	 * of MAC speed/duplex configuration.  So we only need to
    >  	 * configure Collision Distance in the MAC.
    >  	 */
    > -	e1000_config_collision_dist_generic(hw);
    > +	mac->ops.config_collision_dist(hw);
    > =20
    >  	/*
    >  	 * Configure Flow Control now that Auto-Neg has completed.
    >=20
    > Modified: stable/8/sys/dev/e1000/e1000_82543.c
    > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D=3D
    > --- stable/8/sys/dev/e1000/e1000_82543.c	Thu Feb 28 00:18:56 2013	(r24742=
    9)
    > +++ stable/8/sys/dev/e1000/e1000_82543.c	Thu Feb 28 00:22:04 2013	(r24743=
    0)
    > @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543
    >  		DEBUGOUT("Valid link established!!!\n");
    >  		/* Config the MAC and PHY after link is up */
    >  		if (hw->mac.type =3D=3D e1000_82544) {
    > -			e1000_config_collision_dist_generic(hw);
    > +			hw->mac.ops.config_collision_dist(hw);
    >  		} else {
    >  			ret_val =3D e1000_config_mac_to_phy_82543(hw);
    >  			if (ret_val)
    > @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543(
    >  	/* Take the link out of reset */
    >  	ctrl &=3D ~E1000_CTRL_LRST;
    > =20
    > -	e1000_config_collision_dist_generic(hw);
    > +	hw->mac.ops.config_collision_dist(hw);
    > =20
    >  	ret_val =3D e1000_commit_fc_settings_generic(hw);
    >  	if (ret_val)
    > @@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8
    >  	 * settings.
    >  	 */
    >  	if (mac->type =3D=3D e1000_82544)
    > -		e1000_config_collision_dist_generic(hw);
    > +		hw->mac.ops.config_collision_dist(hw);
    >  	else {
    >  		ret_val =3D e1000_config_mac_to_phy_82543(hw);
    >  		if (ret_val) {
    > @@ -1433,7 +1433,7 @@ static s32 e1000_config_mac_to_phy_82543
    >  	if (phy_data & M88E1000_PSSR_DPLX)
    >  		ctrl |=3D E1000_CTRL_FD;
    > =20
    > -	e1000_config_collision_dist_generic(hw);
    > +	hw->mac.ops.config_collision_dist(hw);
    > =20
    >  	/*
    >  	 * Set up speed in the Device Control register depending on
    >=20
    > Modified: stable/8/sys/dev/e1000/e1000_82571.c
    > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D=3D
    > --- stable/8/sys/dev/e1000/e1000_82571.c	Thu Feb 28 00:18:56 2013	(r24742=
    9)
    > +++ stable/8/sys/dev/e1000/e1000_82571.c	Thu Feb 28 00:22:04 2013	(r24743=
    0)
    > @@ -1,6 +1,6 @@
    >  /***********************************************************************=
    *******
    > =20
    > -  Copyright (c) 2001-2011, Intel Corporation=20
    > +  Copyright (c) 2001-2013, Intel Corporation=20
    >    All rights reserved.
    >   =20
    >    Redistribution and use in source and binary forms, with or without=20
    > @@ -32,8 +32,7 @@
    >  ************************************************************************=
    ******/
    >  /*$FreeBSD$*/
    > =20
    > -/*
    > - * 82571EB Gigabit Ethernet Controller
    > +/* 82571EB Gigabit Ethernet Controller
    >   * 82571EB Gigabit Ethernet Controller (Copper)
    >   * 82571EB Gigabit Ethernet Controller (Fiber)
    >   * 82571EB Dual Port Gigabit Mezzanine Adapter
    > @@ -51,9 +50,6 @@
    > =20
    >  #include "e1000_api.h"
    > =20
    > -static s32  e1000_init_phy_params_82571(struct e1000_hw *hw);
    > -static s32  e1000_init_nvm_params_82571(struct e1000_hw *hw);
    > -static s32  e1000_init_mac_params_82571(struct e1000_hw *hw);
    >  static s32  e1000_acquire_nvm_82571(struct e1000_hw *hw);
    >  static void e1000_release_nvm_82571(struct e1000_hw *hw);
    >  static s32  e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset,
    > @@ -78,7 +74,6 @@ static s32  e1000_get_hw_semaphore_82571
    >  static s32  e1000_fix_nvm_checksum_82571(struct e1000_hw *hw);
    >  static s32  e1000_get_phy_id_82571(struct e1000_hw *hw);
    >  static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw);
    > -static s32  e1000_get_hw_semaphore_82573(struct e1000_hw *hw);
    >  static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw);
    >  static s32  e1000_get_hw_semaphore_82574(struct e1000_hw *hw);
    >  static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw);
    > @@ -99,13 +94,13 @@ static void e1000_power_down_phy_copper_
    >  static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
    >  {
    >  	struct e1000_phy_info *phy =3D &hw->phy;
    > -	s32 ret_val =3D E1000_SUCCESS;
    > +	s32 ret_val;
    > =20
    >  	DEBUGFUNC("e1000_init_phy_params_82571");
    > =20
    >  	if (hw->phy.media_type !=3D e1000_media_type_copper) {
    >  		phy->type =3D e1000_phy_none;
    > -		goto out;
    > +		return E1000_SUCCESS;
    >  	}
    > =20
    >  	phy->addr			=3D 1;
    > @@ -165,8 +160,7 @@ static s32 e1000_init_phy_params_82571(s
    >  		phy->ops.set_d3_lplu_state =3D e1000_set_d3_lplu_state_82574;
    >  		break;
    >  	default:
    > -		ret_val =3D -E1000_ERR_PHY;
    > -		goto out;
    > +		return -E1000_ERR_PHY;
    >  		break;
    >  	}
    > =20
    > @@ -174,7 +168,7 @@ static s32 e1000_init_phy_params_82571(s
    >  	ret_val =3D e1000_get_phy_id_82571(hw);
    >  	if (ret_val) {
    >  		DEBUGOUT("Error getting PHY ID\n");
    > -		goto out;
    > +		return ret_val;
    >  	}
    > =20
    >  	/* Verify phy id */
    > @@ -201,7 +195,6 @@ static s32 e1000_init_phy_params_82571(s
    >  	if (ret_val)
    >  		DEBUGOUT1("PHY ID unknown: type =3D 0x%08x\n", phy->id);
    > =20
    > -out:
    >  	return ret_val;
    >  }
    > =20
    > @@ -241,8 +234,7 @@ static s32 e1000_init_nvm_params_82571(s
    >  		if (((eecd >> 15) & 0x3) =3D=3D 0x3) {
    >  			nvm->type =3D e1000_nvm_flash_hw;
    >  			nvm->word_size =3D 2048;
    > -			/*
    > -			 * Autonomous Flash update bit must be cleared due
    > +			/* Autonomous Flash update bit must be cleared due
    >  			 * to Flash update issue.
    >  			 */
    >  			eecd &=3D ~E1000_EECD_AUPDEN;
    > @@ -254,8 +246,7 @@ static s32 e1000_init_nvm_params_82571(s
    >  		nvm->type =3D e1000_nvm_eeprom_spi;
    >  		size =3D (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
    >  			     E1000_EECD_SIZE_EX_SHIFT);
    > -		/*
    > -		 * Added to a constant, "size" becomes the left-shift value
    > +		/* Added to a constant, "size" becomes the left-shift value
    >  		 * for setting word_size.
    >  		 */
    >  		size +=3D NVM_WORD_SIZE_BASE_SHIFT;
    > @@ -382,12 +373,11 @@ static s32 e1000_init_mac_params_82571(s
    > =20
    >  		/* FWSM register */
    >  		mac->has_fwsm =3D TRUE;
    > -		/*
    > -		 * ARC supported; valid only if manageability features are
    > +		/* ARC supported; valid only if manageability features are
    >  		 * enabled.
    >  		 */
    > -		mac->arc_subsystem_valid =3D (E1000_READ_REG(hw, E1000_FWSM) &
    > -					   E1000_FWSM_MODE_MASK) ? TRUE : FALSE;
    > +		mac->arc_subsystem_valid =3D !!(E1000_READ_REG(hw, E1000_FWSM) &
    > +					      E1000_FWSM_MODE_MASK);
    >  		break;
    >  	case e1000_82574:
    >  	case e1000_82583:
    > @@ -405,8 +395,7 @@ static s32 e1000_init_mac_params_82571(s
    >  		break;
    >  	}
    > =20
    > -	/*
    > -	 * Ensure that the inter-port SWSM.SMBI lock bit is clear before
    > +	/* Ensure that the inter-port SWSM.SMBI lock bit is clear before
    >  	 * first NVM or PHY acess. This should be done for single-port
    >  	 * devices, and for one port only on dual-port devices so that
    >  	 * for those devices we can still use the SMBI lock to synchronize
    > @@ -422,8 +411,9 @@ static s32 e1000_init_mac_params_82571(s
    >  			E1000_WRITE_REG(hw, E1000_SWSM2, swsm2 |
    >  					E1000_SWSM2_LOCK);
    >  			force_clear_smbi =3D TRUE;
    > -		} else
    > +		} else {
    >  			force_clear_smbi =3D FALSE;
    > +		}
    >  		break;
    >  	default:
    >  		force_clear_smbi =3D TRUE;
    > @@ -443,10 +433,7 @@ static s32 e1000_init_mac_params_82571(s
    >  		E1000_WRITE_REG(hw, E1000_SWSM, swsm & ~E1000_SWSM_SMBI);
    >  	}
    > =20
    > -	/*
    > -	 * Initialze device specific counter of SMBI acquisition
    > -	 * timeouts.
    > -	 */
    > +	/* Initialze device specific counter of SMBI acquisition timeouts. */
    >  	 hw->dev_spec._82571.smb_counter =3D 0;
    > =20
    >  	return E1000_SUCCESS;
    > @@ -477,7 +464,7 @@ void e1000_init_function_pointers_82571(
    >  static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
    >  {
    >  	struct e1000_phy_info *phy =3D &hw->phy;
    > -	s32 ret_val =3D E1000_SUCCESS;
    > +	s32 ret_val;
    >  	u16 phy_id =3D 0;
    > =20
    >  	DEBUGFUNC("e1000_get_phy_id_82571");
    > @@ -485,8 +472,7 @@ static s32 e1000_get_phy_id_82571(struct
    >  	switch (hw->mac.type) {
    >  	case e1000_82571:
    >  	case e1000_82572:
    > -		/*
    > -		 * The 82571 firmware may still be configuring the PHY.
    > +		/* The 82571 firmware may still be configuring the PHY.
    >  		 * In this case, we cannot access the PHY until the
    >  		 * configuration is done.  So we explicitly set the
    >  		 * PHY ID.
    > @@ -494,29 +480,29 @@ static s32 e1000_get_phy_id_82571(struct
    >  		phy->id =3D IGP01E1000_I_PHY_ID;
    >  		break;
    >  	case e1000_82573:
    > -		ret_val =3D e1000_get_phy_id(hw);
    > +		return e1000_get_phy_id(hw);
    >  		break;
    >  	case e1000_82574:
    >  	case e1000_82583:
    >  		ret_val =3D phy->ops.read_reg(hw, PHY_ID1, &phy_id);
    >  		if (ret_val)
    > -			goto out;
    > +			return ret_val;
    > =20
    >  		phy->id =3D (u32)(phy_id << 16);
    >  		usec_delay(20);
    >  		ret_val =3D phy->ops.read_reg(hw, PHY_ID2, &phy_id);
    >  		if (ret_val)
    > -			goto out;
    > +			return ret_val;
    > =20
    >  		phy->id |=3D (u32)(phy_id);
    >  		phy->revision =3D (u32)(phy_id & ~PHY_REVISION_MASK);
    >  		break;
    >  	default:
    > -		ret_val =3D -E1000_ERR_PHY;
    > +		return -E1000_ERR_PHY;
    >  		break;
    >  	}
    > -out:
    > -	return ret_val;
    > +
    > +	return E1000_SUCCESS;
    >  }
    > =20
    >  /**
    > @@ -528,15 +514,13 @@ out:
    >  static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
    >  {
    >  	u32 swsm;
    > -	s32 ret_val =3D E1000_SUCCESS;
    >  	s32 sw_timeout =3D hw->nvm.word_size + 1;
    >  	s32 fw_timeout =3D hw->nvm.word_size + 1;
    >  	s32 i =3D 0;
    > =20
    >  	DEBUGFUNC("e1000_get_hw_semaphore_82571");
    > =20
    > -	/*
    > -	 * If we have timedout 3 times on trying to acquire
    > +	/* If we have timedout 3 times on trying to acquire
    >  	 * the inter-port SMBI semaphore, there is old code
    >  	 * operating on the other port, and it is not
    >  	 * releasing SMBI. Modify the number of times that
    > @@ -576,12 +560,10 @@ static s32 e1000_get_hw_semaphore_82571(
    >  		/* Release semaphores */
    >  		e1000_put_hw_semaphore_82571(hw);
    >  		DEBUGOUT("Driver can't access the NVM\n");
    > -		ret_val =3D -E1000_ERR_NVM;
    > -		goto out;
    > +		return -E1000_ERR_NVM;
    >  	}
    > =20
    > -out:
    > -	return ret_val;
    > +	return E1000_SUCCESS;
    >  }
    > =20
    >  /**
    > @@ -613,22 +595,19 @@ static void e1000_put_hw_semaphore_82571
    >  static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw)
    >  {
    >  	u32 extcnf_ctrl;
    > -	s32 ret_val =3D E1000_SUCCESS;
    >  	s32 i =3D 0;
    > =20
    >  	DEBUGFUNC("e1000_get_hw_semaphore_82573");
    > =20
    >  	extcnf_ctrl =3D E1000_READ_REG(hw, E1000_EXTCNF_CTRL);
    > -	extcnf_ctrl |=3D E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
    >  	do {
    > +		extcnf_ctrl |=3D E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
    >  		E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl);
    >  		extcnf_ctrl =3D E1000_READ_REG(hw, E1000_EXTCNF_CTRL);
    > =20
    >  		if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP)
    >  			break;
    > =20
    > -		extcnf_ctrl |=3D E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
    > -
    >  		msec_delay(2);
    >  		i++;
    >  	} while (i < MDIO_OWNERSHIP_TIMEOUT);
    > @@ -637,12 +616,10 @@ static s32 e1000_get_hw_semaphore_82573(
    >  		/* Release semaphores */
    >  		e1000_put_hw_semaphore_82573(hw);
    >  		DEBUGOUT("Driver can't access the PHY\n");
    > -		ret_val =3D -E1000_ERR_PHY;
    > -		goto out;
    > +		return -E1000_ERR_PHY;
    >  	}
    > =20
    > -out:
    > -	return ret_val;
    > +	return E1000_SUCCESS;
    >  }
    > =20
    >  /**
    > @@ -712,7 +689,7 @@ static void e1000_put_hw_semaphore_82574
    >   **/
    >  static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool activ=
    e)
    >  {
    > -	u16 data =3D E1000_READ_REG(hw, E1000_POEMB);
    > +	u32 data =3D E1000_READ_REG(hw, E1000_POEMB);
    > =20
    >  	DEBUGFUNC("e1000_set_d0_lplu_state_82574");
    > =20
    > @@ -738,7 +715,7 @@ static s32 e1000_set_d0_lplu_state_82574
    >   **/
    >  static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool activ=
    e)
    >  {
    > -	u16 data =3D E1000_READ_REG(hw, E1000_POEMB);
    > +	u32 data =3D E1000_READ_REG(hw, E1000_POEMB);
    > =20
    >  	DEBUGFUNC("e1000_set_d3_lplu_state_82574");
    > =20
    > @@ -771,7 +748,7 @@ static s32 e1000_acquire_nvm_82571(struc
    > =20
    >  	ret_val =3D e1000_get_hw_semaphore_82571(hw);
    >  	if (ret_val)
    > -		goto out;
    > +		return ret_val;
    > =20
    >  	switch (hw->mac.type) {
    >  	case e1000_82573:
    > @@ -784,7 +761,6 @@ static s32 e1000_acquire_nvm_82571(struc
    >  	if (ret_val)
    >  		e1000_put_hw_semaphore_82571(hw);
    > =20
    > -out:
    >  	return ret_val;
    >  }
    > =20
    > @@ -817,7 +793,7 @@ static void e1000_release_nvm_82571(stru
    >  static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 wo=
    rds,
    >  				 u16 *data)
    >  {
    > -	s32 ret_val =3D E1000_SUCCESS;
    > +	s32 ret_val;
    > =20
    >  	DEBUGFUNC("e1000_write_nvm_82571");
    > =20
    > @@ -857,31 +833,27 @@ static s32 e1000_update_nvm_checksum_825
    > =20
    >  	ret_val =3D e1000_update_nvm_checksum_generic(hw);
    >  	if (ret_val)
    > -		goto out;
    > +		return ret_val;
    > =20
    > -	/*
    > -	 * If our nvm is an EEPROM, then we're done
    > +	/* If our nvm is an EEPROM, then we're done
    >  	 * otherwise, commit the checksum to the flash NVM.
    >  	 */
    >  	if (hw->nvm.type !=3D e1000_nvm_flash_hw)
    > -		goto out;
    > +		return E1000_SUCCESS;
    > =20
    >  	/* Check for pending operations. */
    >  	for (i =3D 0; i < E1000_FLASH_UPDATES; i++) {
    >  		msec_delay(1);
    > -		if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) =3D=3D 0)
    > +		if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD))
    >  			break;
    >  	}
    > =20
    > -	if (i =3D=3D E1000_FLASH_UPDATES) {
    > -		ret_val =3D -E1000_ERR_NVM;
    > -		goto out;
    > -	}
    > +	if (i =3D=3D E1000_FLASH_UPDATES)
    > +		return -E1000_ERR_NVM;
    > =20
    >  	/* Reset the firmware if using STM opcode. */
    >  	if ((E1000_READ_REG(hw, E1000_FLOP) & 0xFF00) =3D=3D E1000_STM_OPCODE) {
    > -		/*
    > -		 * The enabling of and the actual reset must be done
    > +		/* The enabling of and the actual reset must be done
    >  		 * in two write cycles.
    >  		 */
    >  		E1000_WRITE_REG(hw, E1000_HICR, E1000_HICR_FW_RESET_ENABLE);
    > @@ -895,17 +867,14 @@ static s32 e1000_update_nvm_checksum_825
    > =20
    >  	for (i =3D 0; i < E1000_FLASH_UPDATES; i++) {
    >  		msec_delay(1);
    > -		if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) =3D=3D 0)
    > +		if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD))
    >  			break;
    >  	}
    > =20
    > -	if (i =3D=3D E1000_FLASH_UPDATES) {
    > -		ret_val =3D -E1000_ERR_NVM;
    > -		goto out;
    > -	}
    > +	if (i =3D=3D E1000_FLASH_UPDATES)
    > +		return -E1000_ERR_NVM;
    > =20
    > -out:
    > -	return ret_val;
    > +	return E1000_SUCCESS;
    >  }
    > =20
    >  /**
    > @@ -944,19 +913,17 @@ static s32 e1000_write_nvm_eewr_82571(st
    >  {
    >  	struct e1000_nvm_info *nvm =3D &hw->nvm;
    >  	u32 i, eewr =3D 0;
    > -	s32 ret_val =3D 0;
    > +	s32 ret_val =3D E1000_SUCCESS;
    > =20
    >  	DEBUGFUNC("e1000_write_nvm_eewr_82571");
    > =20
    > -	/*
    > -	 * A check for invalid values:  offset too large, too many words,
    > +	/* A check for invalid values:  offset too large, too many words,
    >  	 * and not enough words.
    >  	 */
    >  	if ((offset >=3D nvm->word_size) || (words > (nvm->word_size - offset))=
     ||
    >  	    (words =3D=3D 0)) {
    >  		DEBUGOUT("nvm parameter(s) out of bounds\n");
    > -		ret_val =3D -E1000_ERR_NVM;
    > -		goto out;
    > +		return -E1000_ERR_NVM;
    >  	}
    > =20
    >  	for (i =3D 0; i < words; i++) {
    > @@ -975,7 +942,6 @@ static s32 e1000_write_nvm_eewr_82571(st
    >  			break;
    >  	}
    > =20
    > -out:
    >  	return ret_val;
    >  }
    > =20
    > @@ -988,7 +954,6 @@ out:
    >  static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)
    >  {
    >  	s32 timeout =3D PHY_CFG_TIMEOUT;
    > -	s32 ret_val =3D E1000_SUCCESS;
    > =20
    >  	DEBUGFUNC("e1000_get_cfg_done_82571");
    > =20
    > @@ -1001,12 +966,10 @@ static s32 e1000_get_cfg_done_82571(stru
    >  	}
    >  	if (!timeout) {
    >  		DEBUGOUT("MNG configuration cycle has not completed.\n");
    > -		ret_val =3D -E1000_ERR_RESET;
    > -		goto out;
    > +		return -E1000_ERR_RESET;
    >  	}
    > =20
    > -out:
    > -	return ret_val;
    > +	return E1000_SUCCESS;
    >  }
    > =20
    >  /**
    > @@ -1023,39 +986,40 @@ out:
    >  static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool activ=
    e)
    >  {
    >  	struct e1000_phy_info *phy =3D &hw->phy;
    > -	s32 ret_val =3D E1000_SUCCESS;
    > +	s32 ret_val;
    >  	u16 data;
    > =20
    >  	DEBUGFUNC("e1000_set_d0_lplu_state_82571");
    > =20
    >  	if (!(phy->ops.read_reg))
    > -		goto out;
    > +		return E1000_SUCCESS;
    > =20
    >  	ret_val =3D phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data);
    >  	if (ret_val)
    > -		goto out;
    > +		return ret_val;
    > =20
    >  	if (active) {
    >  		data |=3D IGP02E1000_PM_D0_LPLU;
    >  		ret_val =3D phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
    >  					     data);
    >  		if (ret_val)
    > -			goto out;
    > +			return ret_val;
    > =20
    >  		/* When LPLU is enabled, we should disable SmartSpeed */
    >  		ret_val =3D phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
    >  					    &data);
    > +		if (ret_val)
    > +			return ret_val;
    >  		data &=3D ~IGP01E1000_PSCFR_SMART_SPEED;
    >  		ret_val =3D phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
    >  					     data);
    >  		if (ret_val)
    > -			goto out;
    > +			return ret_val;
    >  	} else {
    >  		data &=3D ~IGP02E1000_PM_D0_LPLU;
    >  		ret_val =3D phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
    >  					     data);
    > -		/*
    > -		 * LPLU and SmartSpeed are mutually exclusive.  LPLU is used
    > +		/* LPLU and SmartSpeed are mutually exclusive.  LPLU is used
    >  		 * during Dx states where the power conservation is most
    >  		 * important.  During driver activity we should enable
    >  		 * SmartSpeed, so performance is maintained.
    > @@ -1065,32 +1029,31 @@ static s32 e1000_set_d0_lplu_state_82571
    >  						    IGP01E1000_PHY_PORT_CONFIG,
    >  						    &data);
    >  			if (ret_val)
    > -				goto out;
    > +				return ret_val;
    > =20
    >  			data |=3D IGP01E1000_PSCFR_SMART_SPEED;
    >  			ret_val =3D phy->ops.write_reg(hw,
    >  						     IGP01E1000_PHY_PORT_CONFIG,
    >  						     data);
    >  			if (ret_val)
    > -				goto out;
    > +				return ret_val;
    >  		} else if (phy->smart_speed =3D=3D e1000_smart_speed_off) {
    >  			ret_val =3D phy->ops.read_reg(hw,
    >  						    IGP01E1000_PHY_PORT_CONFIG,
    >  						    &data);
    >  			if (ret_val)
    > -				goto out;
    > +				return ret_val;
    > =20
    >  			data &=3D ~IGP01E1000_PSCFR_SMART_SPEED;
    >  			ret_val =3D phy->ops.write_reg(hw,
    >  						     IGP01E1000_PHY_PORT_CONFIG,
    >  						     data);
    >  			if (ret_val)
    > -				goto out;
    > +				return ret_val;
    >  		}
    >  	}
    > =20
    > -out:
    > -	return ret_val;
    > +	return E1000_SUCCESS;
    >  }
    > =20
    >  /**
    > @@ -1101,13 +1064,12 @@ out:
    >   **/
    >  static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
    >  {
    > -	u32 ctrl, ctrl_ext;
    > +	u32 ctrl, ctrl_ext, eecd, tctl;
    >  	s32 ret_val;
    > =20
    >  	DEBUGFUNC("e1000_reset_hw_82571");
    > =20
    > -	/*
    > -	 * Prevent the PCI-E bus from sticking if there is no TLP connection
    > +	/* Prevent the PCI-E bus from sticking if there is no TLP connection
    >  	 * on the last TLP read/write transaction when MAC is reset.
    >  	 */
    >  	ret_val =3D e1000_disable_pcie_master_generic(hw);
    > @@ -1118,13 +1080,14 @@ static s32 e1000_reset_hw_82571(struct e
    >  	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
    > =20
    >  	E1000_WRITE_REG(hw, E1000_RCTL, 0);
    > -	E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP);
    > +	tctl =3D E1000_READ_REG(hw, E1000_TCTL);
    > +	tctl &=3D ~E1000_TCTL_EN;
    > +	E1000_WRITE_REG(hw, E1000_TCTL, tctl);
    >  	E1000_WRITE_FLUSH(hw);
    > =20
    >  	msec_delay(10);
    > =20
    > -	/*
    > -	 * Must acquire the MDIO ownership before MAC reset.
    > +	/* Must acquire the MDIO ownership before MAC reset.
    >  	 * Ownership defaults to firmware after a reset.
    >  	 */
    >  	switch (hw->mac.type) {
    > @@ -1167,15 +1130,23 @@ static s32 e1000_reset_hw_82571(struct e
    >  	ret_val =3D e1000_get_auto_rd_done_generic(hw);
    >  	if (ret_val)
    >  		/* We don't want to continue accessing MAC registers. */
    > -		goto out;
    > +		return ret_val;
    > =20
    > -	/*
    > -	 * Phy configuration from NVM just starts after EECD_AUTO_RD is set.
    > +	/* Phy configuration from NVM just starts after EECD_AUTO_RD is set.
    >  	 * Need to wait for Phy configuration completion before accessing
    >  	 * NVM and Phy.
    >  	 */
    > =20
    >  	switch (hw->mac.type) {
    > +	case e1000_82571:
    > +	case e1000_82572:
    > +		/* REQ and GNT bits need to be cleared when using AUTO_RD
    > +		 * to access the EEPROM.
    > +		 */
    > +		eecd =3D E1000_READ_REG(hw, E1000_EECD);
    > +		eecd &=3D ~(E1000_EECD_REQ | E1000_EECD_GNT);
    > +		E1000_WRITE_REG(hw, E1000_EECD, eecd);
    > +		break;
    >  	case e1000_82573:
    >  	case e1000_82574:
    >  	case e1000_82583:
    > @@ -1193,7 +1164,7 @@ static s32 e1000_reset_hw_82571(struct e
    >  		/* Install any alternate MAC address into RAR0 */
    >  		ret_val =3D e1000_check_alt_mac_addr_generic(hw);
    >  		if (ret_val)
    > -			goto out;
    > +			return ret_val;
    > =20
    >  		e1000_set_laa_state_82571(hw, TRUE);
    >  	}
    > @@ -1202,8 +1173,7 @@ static s32 e1000_reset_hw_82571(struct e
    >  	if (hw->phy.media_type =3D=3D e1000_media_type_internal_serdes)
    >  		hw->mac.serdes_link_state =3D e1000_serdes_link_down;
    > =20
    > -out:
    > -	return ret_val;
    > +	return E1000_SUCCESS;
    >  }
    > =20
    >  /**
    > @@ -1225,16 +1195,15 @@ static s32 e1000_init_hw_82571(struct e1
    > =20
    >  	/* Initialize identification LED */
    >  	ret_val =3D mac->ops.id_led_init(hw);
    > +	/* An error is not fatal and we should not stop init due to this */
    >  	if (ret_val)
    >  		DEBUGOUT("Error initializing identification LED\n");
    > -		/* This is not fatal and we should not stop init due to this */
    > =20
    >  	/* Disabling VLAN filtering */
    >  	DEBUGOUT("Initializing the IEEE VLAN\n");
    >  	mac->ops.clear_vfta(hw);
    > =20
    > -	/* Setup the receive address. */
    > -	/*
    > +	/* Setup the receive address.
    >  	 * If, however, a locally administered address was assigned to the
    >  	 * 82571, we must reserve a RAR for it to work around an issue where
    >  	 * resetting one port will reload the MAC on the other port.
    > @@ -1277,8 +1246,7 @@ static s32 e1000_init_hw_82571(struct e1
    >  		break;
    >  	}
    > =20
    > -	/*
    > -	 * Clear all of the statistics registers (clear on read).  It is
    > +	/* Clear all of the statistics registers (clear on read).  It is
    >  	 * important that we do this after we have tried to establish link
    >  	 * because the symbol error count will increment wildly if there
    >  	 * is no link.
    > @@ -1377,8 +1345,7 @@ static void e1000_initialize_hw_bits_825
    >  		E1000_WRITE_REG(hw, E1000_PBA_ECC, reg);
    >  	}
    > =20
    > -	/*
    > -	 * Workaround for hardware errata.
    > +	/* Workaround for hardware errata.
    >  	 * Ensure that DMA Dynamic Clock gating is disabled on 82571 and 82572
    >  	 */
    >  	if ((hw->mac.type =3D=3D e1000_82571) ||
    > @@ -1388,6 +1355,15 @@ static void e1000_initialize_hw_bits_825
    >  		E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg);
    >  	}
    > =20
    > +	/* Disable IPv6 extension header parsing because some malformed
    > +	 * IPv6 headers can hang the Rx.
    > +	 */
    > +	if (hw->mac.type <=3D e1000_82573) {
    > +		reg =3D E1000_READ_REG(hw, E1000_RFCTL);
    > +		reg |=3D (E1000_RFCTL_IPV6_EX_DIS | E1000_RFCTL_NEW_IPV6_EXT_DIS);
    > +		E1000_WRITE_REG(hw, E1000_RFCTL, reg);
    > +	}
    > +
    >  	/* PCI-Ex Control Registers */
    >  	switch (hw->mac.type) {
    >  	case e1000_82574:
    > @@ -1396,8 +1372,7 @@ static void e1000_initialize_hw_bits_825
    >  		reg |=3D (1 << 22);
    >  		E1000_WRITE_REG(hw, E1000_GCR, reg);
    > =20
    > -		/*
    > -		 * Workaround for hardware errata.
    > +		/* Workaround for hardware errata.
    >  		 * apply workaround for hardware errata documented in errata
    >  		 * docs Fixes issue where some error prone or unreliable PCIe
    >  		 * completions are occurring, particularly with ASPM enabled.
    > @@ -1435,25 +1410,25 @@ static void e1000_clear_vfta_82571(struc
    >  	case e1000_82574:
    >  	case e1000_82583:
    >  		if (hw->mng_cookie.vlan_id !=3D 0) {
    > -			/*
    > -			 * The VFTA is a 4096b bit-field, each identifying
    > +			/* The VFTA is a 4096b bit-field, each identifying
    >  			 * a single VLAN ID.  The following operations
    >  			 * determine which 32b entry (i.e. offset) into the
    >  			 * array we want to set the VLAN ID (i.e. bit) of
    >  			 * the manageability unit.
    >  			 */
    >  			vfta_offset =3D (hw->mng_cookie.vlan_id >>
    > -				E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_MASK;
    > -			vfta_bit_in_reg =3D 1 << (hw->mng_cookie.vlan_id &
    > -				E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
    > +				       E1000_VFTA_ENTRY_SHIFT) &
    > +			    E1000_VFTA_ENTRY_MASK;
    > +			vfta_bit_in_reg =3D
    > +			    1 << (hw->mng_cookie.vlan_id &
    > +				  E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
    >  		}
    >  		break;
    >  	default:
    >  		break;
    >  	}
    >  	for (offset =3D 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) {
    > -		/*
    > -		 * If the offset we want to clear is the same offset of the
    > +		/* If the offset we want to clear is the same offset of the
    >  		 * manageability VLAN ID, then clear all bits except that of
    >  		 * the manageability unit.
    >  		 */
    > @@ -1495,8 +1470,7 @@ static s32 e1000_led_on_82574(struct e10
    > =20
    >  	ctrl =3D hw->mac.ledctl_mode2;
    >  	if (!(E1000_STATUS_LU & E1000_READ_REG(hw, E1000_STATUS))) {
    > -		/*
    > -		 * If no link, then turn LED on by setting the invert bit
    > +		/* If no link, then turn LED on by setting the invert bit
    >  		 * for each LED that's "on" (0x0E) in ledctl_mode2.
    >  		 */
    >  		for (i =3D 0; i < 4; i++)
    > @@ -1519,30 +1493,28 @@ bool e1000_check_phy_82574(struct e1000_
    >  {
    >  	u16 status_1kbt =3D 0;
    >  	u16 receive_errors =3D 0;
    > -	bool phy_hung =3D FALSE;
    > -	s32 ret_val =3D E1000_SUCCESS;
    > +	s32 ret_val;
    > =20
    >  	DEBUGFUNC("e1000_check_phy_82574");
    > =20
    > -	/*
    > -	 * Read PHY Receive Error counter first, if its is max - all F's then
    > +	/* Read PHY Receive Error counter first, if its is max - all F's then
    >  	 * read the Base1000T status register If both are max then PHY is hung.
    >  	 */
    >  	ret_val =3D hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER,
    >  				       &receive_errors);
    >  	if (ret_val)
    > -		goto out;
    > +		return FALSE;
    >  	if (receive_errors =3D=3D E1000_RECEIVE_ERROR_MAX) {
    >  		ret_val =3D hw->phy.ops.read_reg(hw, E1000_BASE1000T_STATUS,
    >  					       &status_1kbt);
    >  		if (ret_val)
    > -			goto out;
    > +			return FALSE;
    >  		if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) =3D=3D
    >  		    E1000_IDLE_ERROR_COUNT_MASK)
    > -			phy_hung =3D TRUE;
    > +			return TRUE;
    >  	}
    > -out:
    > -	return phy_hung;
    > +
    > +	return FALSE;
    >  }
    > =20
    > =20
    > @@ -1560,8 +1532,7 @@ static s32 e1000_setup_link_82571(struct
    >  {
    >  	DEBUGFUNC("e1000_setup_link_82571");
    > =20
    > -	/*
    > -	 * 82573 does not have a word in the NVM to determine
    > +	/* 82573 does not have a word in the NVM to determine
    >  	 * the default flow control setting, so we explicitly
    >  	 * set it to full.
    >  	 */
    > @@ -1608,17 +1579,14 @@ static s32 e1000_setup_copper_link_82571
    >  		ret_val =3D e1000_copper_link_setup_igp(hw);
    >  		break;
    >  	default:
    > -		ret_val =3D -E1000_ERR_PHY;
    > +		return -E1000_ERR_PHY;
    >  		break;
    >  	}
    > =20
    >  	if (ret_val)
    > -		goto out;
    > -
    > -	ret_val =3D e1000_setup_copper_link_generic(hw);
    > +		return ret_val;
    > =20
    > -out:
    > -	return ret_val;
    > +	return e1000_setup_copper_link_generic(hw);
    >  }
    > =20
    >  /**
    > @@ -1635,8 +1603,7 @@ static s32 e1000_setup_fiber_serdes_link
    >  	switch (hw->mac.type) {
    >  	case e1000_82571:
    >  	case e1000_82572:
    > -		/*
    > -		 * If SerDes loopback mode is entered, there is no form
    > +		/* If SerDes loopback mode is entered, there is no form
    >  		 * of reset to take the adapter out of that mode.  So we
    >  		 * have to explicitly take the adapter out of loopback
    >  		 * mode.  This prevents drivers from twiddling their thumbs
    > @@ -1685,16 +1652,17 @@ static s32 e1000_check_for_serdes_link_8
    > =20
    >  	ctrl =3D E1000_READ_REG(hw, E1000_CTRL);
    >  	status =3D E1000_READ_REG(hw, E1000_STATUS);
    > +	E1000_READ_REG(hw, E1000_RXCW);
    > +	/* SYNCH bit and IV bit are sticky */
    > +	usec_delay(10);
    >  	rxcw =3D E1000_READ_REG(hw, E1000_RXCW);
    > =20
    >  	if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) {
    > -
    >  		/* Receiver is synchronized with no invalid bits.  */
    >  		switch (mac->serdes_link_state) {
    >  		case e1000_serdes_link_autoneg_complete:
    >  			if (!(status & E1000_STATUS_LU)) {
    > -				/*
    > -				 * We have lost link, retry autoneg before
    > +				/* We have lost link, retry autoneg before
    >  				 * reporting link failure
    >  				 */
    >  				mac->serdes_link_state =3D
    > @@ -1707,15 +1675,12 @@ static s32 e1000_check_for_serdes_link_8
    >  			break;
    > =20
    >  		case e1000_serdes_link_forced_up:
    > -			/*
    > -			 * If we are receiving /C/ ordered sets, re-enable
    > +			/* If we are receiving /C/ ordered sets, re-enable
    >  			 * auto-negotiation in the TXCW register and disable
    >  			 * forced link in the Device Control register in an
    >  			 * attempt to auto-negotiate with our link partner.
    > -			 * If the partner code word is null, stop forcing
    > -			 * and restart auto negotiation.
    >  			 */
    > -			if ((rxcw & E1000_RXCW_C) || !(rxcw & E1000_RXCW_CW))  {
    > +			if (rxcw & E1000_RXCW_C) {
    >  				/* Enable autoneg, and unforce link up */
    >  				E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw);
    >  				E1000_WRITE_REG(hw, E1000_CTRL,
    > @@ -1731,8 +1696,7 @@ static s32 e1000_check_for_serdes_link_8
    > =20
    >  		case e1000_serdes_link_autoneg_progress:
    >  			if (rxcw & E1000_RXCW_C) {
    > -				/*
    > -				 * We received /C/ ordered sets, meaning the
    > +				/* We received /C/ ordered sets, meaning the
    >  				 * link partner has autonegotiated, and we can
    >  				 * trust the Link Up (LU) status bit.
    >  				 */
    > @@ -1748,8 +1712,7 @@ static s32 e1000_check_for_serdes_link_8
    >  					DEBUGOUT("AN_PROG   -> DOWN\n");
    >  				}
    >  			} else {
    > -				/*
    > -				 * The link partner did not autoneg.
    > +				/* The link partner did not autoneg.
    >  				 * Force link up and full duplex, and change
    >  				 * state to forced.
    >  				 */
    > @@ -1774,8 +1737,7 @@ static s32 e1000_check_for_serdes_link_8
    > =20
    >  		case e1000_serdes_link_down:
    >  		default:
    > -			/*
    > -			 * The link was down but the receiver has now gained
    > +			/* The link was down but the receiver has now gained
    >  			 * valid sync, so lets see if we can bring the link
    >  			 * up.
    >  			 */
    > @@ -1794,17 +1756,18 @@ static s32 e1000_check_for_serdes_link_8
    >  			mac->serdes_link_state =3D e1000_serdes_link_down;
    >  			DEBUGOUT("ANYSTATE  -> DOWN\n");
    >  		} else {
    > -			/*
    > -			 * Check several times, if Sync and Config
    > -			 * both are consistently 1 then simply ignore
    > -			 * the Invalid bit and restart Autoneg
    > +			/* Check several times, if SYNCH bit and CONFIG
    > +			 * bit both are consistently 1 then simply ignore
    > +			 * the IV bit and restart Autoneg
    >  			 */
    >  			for (i =3D 0; i < AN_RETRY_COUNT; i++) {
    >  				usec_delay(10);
    >  				rxcw =3D E1000_READ_REG(hw, E1000_RXCW);
    > -				if ((rxcw & E1000_RXCW_IV) &&
    > -				    !((rxcw & E1000_RXCW_SYNCH) &&
    > -				      (rxcw & E1000_RXCW_C))) {
    > +				if ((rxcw & E1000_RXCW_SYNCH) &&
    > +				    (rxcw & E1000_RXCW_C))
    > +					continue;
    > +
    > +				if (rxcw & E1000_RXCW_IV) {
    >  					mac->serdes_has_link =3D FALSE;
    >  					mac->serdes_link_state =3D
    >  							e1000_serdes_link_down;
    > @@ -1845,7 +1808,7 @@ static s32 e1000_valid_led_default_82571
    >  	ret_val =3D hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data);
    >  	if (ret_val) {
    >  		DEBUGOUT("NVM Read Error\n");
    > -		goto out;
    > +		return ret_val;
    >  	}
    > =20
    >  	switch (hw->mac.type) {
    > @@ -1862,8 +1825,7 @@ static s32 e1000_valid_led_default_82571
    >  		break;
    >  	}
    > =20
    > -out:
    > -	return ret_val;
    > +	return E1000_SUCCESS;
    >  }
    > =20
    >  /**
    > @@ -1900,15 +1862,14 @@ void e1000_set_laa_state_82571(struct e1
    > =20
    >  	/* If workaround is activated... */
    >  	if (state)
    > -		/*
    > -		 * Hold a copy of the LAA in RAR[14] This is done so that
    > +		/* Hold a copy of the LAA in RAR[14] This is done so that
    >  		 * between the time RAR[0] gets clobbered and the time it
    >  		 * gets fixed, the actual LAA is in one of the RARs and no
    >  		 * incoming packets directed to this port are dropped.
    >  		 * Eventually the LAA will be in RAR[0] and RAR[14].
    >  		 */
    > -		e1000_rar_set_generic(hw, hw->mac.addr,
    > -				      hw->mac.rar_entry_count - 1);
    > +		hw->mac.ops.rar_set(hw, hw->mac.addr,
    > +				    hw->mac.rar_entry_count - 1);
    >  	return;
    >  }
    > =20
    > @@ -1925,25 +1886,23 @@ void e1000_set_laa_state_82571(struct e1
    >  static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
    >  {
    >  	struct e1000_nvm_info *nvm =3D &hw->nvm;
    > -	s32 ret_val =3D E1000_SUCCESS;
    > +	s32 ret_val;
    >  	u16 data;
    > =20
    >  	DEBUGFUNC("e1000_fix_nvm_checksum_82571");
    > =20
    >  	if (nvm->type !=3D e1000_nvm_flash_hw)
    > -		goto out;
    > +		return E1000_SUCCESS;
    > =20
    > -	/*
    > -	 * Check bit 4 of word 10h.  If it is 0, firmware is done updating
    > +	/* Check bit 4 of word 10h.  If it is 0, firmware is done updating
    >  	 * 10h-12h.  Checksum may need to be fixed.
    >  	 */
    >=20
    > *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    > _______________________________________________
    > svn-src-stable-8@freebsd.org mailing list
    > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8
    > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.or=
    g"
    
    --f0KYrhQ4vYSV2aJu
    Content-Type: application/pgp-signature
    
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.19 (FreeBSD)
    
    iQEcBAEBCAAGBQJRLr+lAAoJEFJPDDeguUaj+8MH/1NbMjgLJcaSRJqnlVrqbtlC
    uRAtZB12ImzxshbSxaj3ZuWsAQ/5Sg+J6nJwB5iKyFO7jkoCuDVGi5XJraGHdXWM
    RSNsJPrt5w9Hk0JDHMZkbvJaMrvOYUGT9Iz1aID399Zn5GdoWsrGeDPSXwunBobz
    mRR4RuBBZLawDnMSxp7LwkUp2zlVIY578hfw9GskTAWDU4ADrbzr7eHgmbBZ48fJ
    Jd+QNrwfRKPhLiFjrcSaa5YbVXCp5kDumL5Y34FF99H4Rq91yS+UkPu4Ait6Nooq
    xA0X24FFfi8+tnpbK04MNdWfH+SxznQV79eCJ9JDZcMl1kV0EcT/uCtCg7bMGD8=
    =oUZH
    -----END PGP SIGNATURE-----
    
    --f0KYrhQ4vYSV2aJu--
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 04:16:49 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 52C9594;
     Thu, 28 Feb 2013 04:16: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 453DE8BE;
     Thu, 28 Feb 2013 04:16:49 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S4GmXs037519;
     Thu, 28 Feb 2013 04:16:48 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S4Gm42037515;
     Thu, 28 Feb 2013 04:16:48 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201302280416.r1S4Gm42037515@svn.freebsd.org>
    From: Xin LI 
    Date: Thu, 28 Feb 2013 04:16:48 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247443 - in head: share/man/man4 sys/dev/arcmsr
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 04:16:49 -0000
    
    Author: delphij
    Date: Thu Feb 28 04:16:47 2013
    New Revision: 247443
    URL: http://svnweb.freebsd.org/changeset/base/247443
    
    Log:
      Refresh vendor driver version which adds ARC-1224 support.
      
      Many thanks to Areca for continuing to support FreeBSD.
      
      Submitted by:	黃清隆 
      MFC after:	3 days
    
    Modified:
      head/share/man/man4/arcmsr.4
      head/sys/dev/arcmsr/arcmsr.c
      head/sys/dev/arcmsr/arcmsr.h
    
    Modified: head/share/man/man4/arcmsr.4
    ==============================================================================
    --- head/share/man/man4/arcmsr.4	Thu Feb 28 01:24:24 2013	(r247442)
    +++ head/share/man/man4/arcmsr.4	Thu Feb 28 04:16:47 2013	(r247443)
    @@ -24,7 +24,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd December 18, 2012
    +.Dd February 27, 2013
     .Dt ARCMSR 4
     .Os
     .Sh NAME
    @@ -108,6 +108,8 @@ ARC-1222
     .It
     ARC-1223
     .It
    +ARC-1224
    +.It
     ARC-1230
     .It
     ARC-1231
    
    Modified: head/sys/dev/arcmsr/arcmsr.c
    ==============================================================================
    --- head/sys/dev/arcmsr/arcmsr.c	Thu Feb 28 01:24:24 2013	(r247442)
    +++ head/sys/dev/arcmsr/arcmsr.c	Thu Feb 28 04:16:47 2013	(r247443)
    @@ -1,16 +1,15 @@
     /*
    -*****************************************************************************************
    -**        O.S   : FreeBSD
    +********************************************************************************
    +**        OS    : FreeBSD
     **   FILE NAME  : arcmsr.c
     **        BY    : Erich Chen, Ching Huang
     **   Description: SCSI RAID Device Driver for 
    -**                ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x) SATA/SAS RAID HOST Adapter
    -**                ARCMSR RAID Host adapter
    -**                [RAID controller:INTEL 331(PCI-X) 341(PCI-EXPRESS) chip set]
    -******************************************************************************************
    -************************************************************************
    +**                ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x)
    +**                SATA/SAS RAID HOST Adapter
    +********************************************************************************
    +********************************************************************************
     **
    -** Copyright (C) 2002 - 2010, Areca Technology Corporation All rights reserved.
    +** Copyright (C) 2002 - 2012, Areca Technology Corporation All rights reserved.
     **
     ** Redistribution and use in source and binary forms, with or without
     ** modification, are permitted provided that the following conditions
    @@ -33,7 +32,7 @@
     ** 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.
    -**************************************************************************
    +********************************************************************************
     ** History
     **
     **        REV#         DATE             NAME             DESCRIPTION
    @@ -73,7 +72,7 @@
     **     1.20.00.23   01/30/2012      Ching Huang          Fixed Request requeued and Retrying command
     **     1.20.00.24   06/11/2012      Ching Huang          Fixed return sense data condition
     **     1.20.00.25   08/17/2012      Ching Huang          Fixed hotplug device no function on type A adapter
    -**     1.20.00.26   12/14/2012      Ching Huang          Added support ARC1214
    +**     1.20.00.26   12/14/2012      Ching Huang          Added support ARC1214,1224
     ******************************************************************************************
     */
     
    @@ -145,7 +144,7 @@ __FBSDID("$FreeBSD$");
     #define arcmsr_callout_init(a)	callout_init(a);
     #endif
     
    -#define ARCMSR_DRIVER_VERSION	"Driver Version 1.20.00.26 2012-12-14"
    +#define ARCMSR_DRIVER_VERSION	"Driver Version 1.20.00.26 2013-01-08"
     #include 
     /*
     **************************************************************************
    @@ -168,7 +167,7 @@ static void arcmsr_stop_adapter_bgrb(str
     static void arcmsr_start_adapter_bgrb(struct AdapterControlBlock *acb);
     static void arcmsr_iop_init(struct AdapterControlBlock *acb);
     static void arcmsr_flush_adapter_cache(struct AdapterControlBlock *acb);
    -static void	arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, struct QBUFFER *prbuffer);
    +static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, struct QBUFFER *prbuffer);
     static void arcmsr_Write_data_2iop_wqbuffer(struct AdapterControlBlock *acb);
     static void arcmsr_abort_allcmd(struct AdapterControlBlock *acb);
     static void arcmsr_srb_complete(struct CommandControlBlock *srb, int stand_flag);
    @@ -212,7 +211,11 @@ static device_method_t arcmsr_methods[]=
     	DEVMETHOD(device_suspend,	arcmsr_suspend),
     	DEVMETHOD(device_resume,	arcmsr_resume),
     
    +#if __FreeBSD_version >= 803000
     	DEVMETHOD_END
    +#else
    +	{ 0, 0 }
    +#endif
     };
     	
     static driver_t arcmsr_driver={
    @@ -1381,13 +1384,61 @@ static void arcmsr_poll(struct cam_sim *
     **************************************************************************
     **************************************************************************
     */
    -static void	arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb,
    +static u_int32_t arcmsr_Read_iop_rqbuffer_data_D(struct AdapterControlBlock *acb,
    +    struct QBUFFER *prbuffer) {
    +
    +	u_int8_t *pQbuffer;
    +	u_int8_t *buf1 = 0;
    +	u_int32_t *iop_data, *buf2 = 0;
    +	u_int32_t iop_len, data_len;
    +
    +	iop_data = (u_int32_t *)prbuffer->data;
    +	iop_len = (u_int32_t)prbuffer->data_len;
    +	if ( iop_len > 0 )
    +	{
    +		buf1 = malloc(128, M_DEVBUF, M_NOWAIT | M_ZERO);
    +		buf2 = (u_int32_t *)buf1;
    +		if( buf1 == NULL)
    +			return (0);
    +		data_len = iop_len;
    +		while(data_len >= 4)
    +		{
    +			*buf2++ = *iop_data++;
    +			data_len -= 4;
    +		}
    +		if(data_len)
    +			*buf2 = *iop_data;
    +		buf2 = (u_int32_t *)buf1;
    +	}
    +	while (iop_len > 0) {
    +		pQbuffer = &acb->rqbuffer[acb->rqbuf_lastindex];
    +		*pQbuffer = *buf1;
    +		acb->rqbuf_lastindex++;
    +		/* if last, index number set it to 0 */
    +		acb->rqbuf_lastindex %= ARCMSR_MAX_QBUFFER;
    +		buf1++;
    +		iop_len--;
    +	}
    +	if(buf2)
    +		free( (u_int8_t *)buf2, M_DEVBUF);
    +	/* let IOP know data has been read */
    +	arcmsr_iop_message_read(acb);
    +	return (1);
    +}
    +/*
    +**************************************************************************
    +**************************************************************************
    +*/
    +static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb,
         struct QBUFFER *prbuffer) {
     
     	u_int8_t *pQbuffer;
     	u_int8_t *iop_data;
     	u_int32_t iop_len;
     
    +	if(acb->adapter_type == ACB_ADAPTER_TYPE_D) {
    +		return(arcmsr_Read_iop_rqbuffer_data_D(acb, prbuffer));
    +	}
     	iop_data = (u_int8_t *)prbuffer->data;
     	iop_len = (u_int32_t)prbuffer->data_len;
     	while (iop_len > 0) {
    @@ -1401,6 +1452,7 @@ static void	arcmsr_Read_iop_rqbuffer_dat
     	}
     	/* let IOP know data has been read */
     	arcmsr_iop_message_read(acb);
    +	return (1);
     }
     /*
     **************************************************************************
    @@ -1417,7 +1469,8 @@ static void arcmsr_iop2drv_data_wrote_ha
     	my_empty_len = (acb->rqbuf_lastindex - acb->rqbuf_firstindex - 1) &
     	    (ARCMSR_MAX_QBUFFER-1);
     	if(my_empty_len >= prbuffer->data_len) {
    -		arcmsr_Read_iop_rqbuffer_data(acb, prbuffer);
    +		if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0)
    +			acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW;
     	} else {
     		acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW;
     	}
    @@ -1427,6 +1480,50 @@ static void arcmsr_iop2drv_data_wrote_ha
     **********************************************************************
     **********************************************************************
     */
    +static void arcmsr_Write_data_2iop_wqbuffer_D(struct AdapterControlBlock *acb)
    +{
    +	u_int8_t *pQbuffer;
    +	struct QBUFFER *pwbuffer;
    +	u_int8_t *buf1 = 0;
    +	u_int32_t *iop_data, *buf2 = 0;
    +	u_int32_t allxfer_len = 0, data_len;
    +	
    +	if(acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READ) {
    +		buf1 = malloc(128, M_DEVBUF, M_NOWAIT | M_ZERO);
    +		buf2 = (u_int32_t *)buf1;
    +		if( buf1 == NULL)
    +			return;
    +
    +		acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READ);
    +		pwbuffer = arcmsr_get_iop_wqbuffer(acb);
    +		iop_data = (u_int32_t *)pwbuffer->data;
    +		while((acb->wqbuf_firstindex != acb->wqbuf_lastindex) 
    +			&& (allxfer_len < 124)) {
    +			pQbuffer = &acb->wqbuffer[acb->wqbuf_firstindex];
    +			*buf1 = *pQbuffer;
    +			acb->wqbuf_firstindex++;
    +			acb->wqbuf_firstindex %= ARCMSR_MAX_QBUFFER;
    +			buf1++;
    +			allxfer_len++;
    +		}
    +		pwbuffer->data_len = allxfer_len;
    +		data_len = allxfer_len;
    +		buf1 = (u_int8_t *)buf2;
    +		while(data_len >= 4)
    +		{
    +			*iop_data++ = *buf2++;
    +			data_len -= 4;
    +		}
    +		if(data_len)
    +			*iop_data = *buf2;
    +		free( buf1, M_DEVBUF);
    +		arcmsr_iop_message_wrote(acb);
    +	}
    +}
    +/*
    +**********************************************************************
    +**********************************************************************
    +*/
     static void arcmsr_Write_data_2iop_wqbuffer(struct AdapterControlBlock *acb)
     {
     	u_int8_t *pQbuffer;
    @@ -1434,6 +1531,10 @@ static void arcmsr_Write_data_2iop_wqbuf
     	u_int8_t *iop_data;
     	int32_t allxfer_len=0;
     	
    +	if(acb->adapter_type == ACB_ADAPTER_TYPE_D) {
    +		arcmsr_Write_data_2iop_wqbuffer_D(acb);
    +		return;
    +	}
     	if(acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READ) {
     		acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READ);
     		pwbuffer = arcmsr_get_iop_wqbuffer(acb);
    @@ -2153,7 +2254,8 @@ u_int32_t arcmsr_iop_ioctlcmd(struct Ada
     	
     				acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
     				prbuffer = arcmsr_get_iop_rqbuffer(acb);
    -				arcmsr_Read_iop_rqbuffer_data(acb, prbuffer);
    +				if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0)
    +					acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW;
     			}
     			pcmdmessagefld->cmdmessage.Length = allxfer_len;
     			pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK;
    @@ -2374,7 +2476,8 @@ static int arcmsr_iop_message_xfer(struc
     	
     				acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
     				prbuffer = arcmsr_get_iop_rqbuffer(acb);
    -				arcmsr_Read_iop_rqbuffer_data(acb, prbuffer);
    +				if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0)
    +					acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW;
     			}
     			pcmdmessagefld->cmdmessage.Length = allxfer_len;
     			pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK;
    
    Modified: head/sys/dev/arcmsr/arcmsr.h
    ==============================================================================
    --- head/sys/dev/arcmsr/arcmsr.h	Thu Feb 28 01:24:24 2013	(r247442)
    +++ head/sys/dev/arcmsr/arcmsr.h	Thu Feb 28 04:16:47 2013	(r247443)
    @@ -1,17 +1,14 @@
     /*
    -***********************************************************************************************
    -**        O.S   : FreeBSD
    +********************************************************************************
    +**        OS    : FreeBSD
     **   FILE NAME  : arcmsr.h
     **        BY    : Erich Chen, Ching Huang
     **   Description: SCSI RAID Device Driver for 
    -**                ARECA SATA/SAS RAID HOST Adapter
    -**                [RAID controller:INTEL 331(PCI-X) 341(PCI-EXPRESS) chip set]
    -***********************************************************************************************
    -************************************************************************
    -** Copyright (C) 2002 - 2010, Areca Technology Corporation All rights reserved.
    -**
    -**     Web site: www.areca.com.tw
    -**       E-mail: erich@areca.com.tw; ching2048@areca.com.tw
    +**                ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x)
    +**                SATA/SAS RAID HOST Adapter
    +********************************************************************************
    +********************************************************************************
    +** Copyright (C) 2002 - 2012, Areca Technology Corporation All rights reserved.
     **
     ** Redistribution and use in source and binary forms,with or without
     ** modification,are permitted provided that the following conditions
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 05:40:07 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id AAAB4B23;
     Thu, 28 Feb 2013 05:40:07 +0000 (UTC)
     (envelope-from jfvogel@gmail.com)
    Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com
     [209.85.128.181])
     by mx1.freebsd.org (Postfix) with ESMTP id E27CEC03;
     Thu, 28 Feb 2013 05:40:06 +0000 (UTC)
    Received: by mail-ve0-f181.google.com with SMTP id d10so1414816vea.12
     for ; Wed, 27 Feb 2013 21:39:59 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
     h=mime-version:x-received:in-reply-to:references:date:message-id
     :subject:from:to:cc:content-type;
     bh=XHBXTGjg8jNk5KQeC1TWNWYLVGpEVGO1iWaH3cA2Hok=;
     b=wpSTZ4Vyq/a4bsIS0KGU4z91uxJFbXEQWzdK9tw7hMpdaD54kmmkBEx+jSNx/5slbJ
     Eu64a6lo5Mrh0nzJlHs+ctoDv+oXgA1+sEO25is9sNq0wzJuToq4SMASalnjBk0cdgEV
     E23ByO1hGoh20kOSkAec/WupSbQEEB+NlZUgjZrqQRYLHF8w5JbX9puK32RCFF2ET9qW
     edHsOArHrRXQjlY2svz2+25OPh9EpzzEPJJKZpHcb/aD0jtLAIXLSut4GuTwM57rW1VK
     7QcPAAoe8vjoSmKb5LYmcI8r58czEvJKPQmRar7+iwJNTe/sbnQ9b6DFHgR18Qjjdm76
     PuOg==
    MIME-Version: 1.0
    X-Received: by 10.221.2.71 with SMTP id nt7mr1951324vcb.71.1362029999756; Wed,
     27 Feb 2013 21:39:59 -0800 (PST)
    Received: by 10.220.191.132 with HTTP; Wed, 27 Feb 2013 21:39:59 -0800 (PST)
    In-Reply-To: <20130228022333.GC70215@glenbarber.us>
    References: <201302280022.r1S0M4vm064514@svn.freebsd.org>
     <20130228022333.GC70215@glenbarber.us>
    Date: Wed, 27 Feb 2013 21:39:59 -0800
    Message-ID: 
    Subject: Re: svn commit: r247430 - in stable/8/sys: conf dev/e1000 modules/em
     modules/igb
    From: Jack Vogel 
    To: Glen Barber 
    Content-Type: text/plain; charset=ISO-8859-1
    X-Content-Filtered-By: Mailman/MimeDel 2.1.14
    Cc: Jack F Vogel , svn-src-stable@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org,
     svn-src-stable-8@freebsd.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 05:40:07 -0000
    
    Oh, that's odd, then HEAD should be broken too, do you have more detail?
    
    Jack
    
    
    On Wed, Feb 27, 2013 at 6:23 PM, Glen Barber  wrote:
    
    > Jack,
    >
    > This commit seems to break the build for at least powerpc and sparc64.
    >
    > Glen
    >
    > On Thu, Feb 28, 2013 at 12:22:04AM +0000, Jack F Vogel wrote:
    > > Author: jfv
    > > Date: Thu Feb 28 00:22:04 2013
    > > New Revision: 247430
    > > URL: http://svnweb.freebsd.org/changeset/base/247430
    > >
    > > Log:
    > >   MFC of the E1000 drivers to STABLE/8, this includes the follow
    > revisions
    > >   plus a few tweaks:
    > >    196969,196970,211516,214646,215781,215789,215808,215910,223350,
    > >    223482,223831,228281,228393,229939,231796,232238,234665,235256,
    > >    236406,238148,238151,238214,238765,238770,238953,238981,239105,
    > >    239109,239304,240518,240693,240968,241037,241856,241885,243570,
    > >    243857,245334,246128,246482,247064
    > >
    > > Added:
    > >   stable/8/sys/dev/e1000/e1000_i210.c
    > >      - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c
    > >   stable/8/sys/dev/e1000/e1000_i210.h
    > >      - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h
    > > Modified:
    > >   stable/8/sys/conf/files
    > >   stable/8/sys/dev/e1000/e1000_82541.c
    > >   stable/8/sys/dev/e1000/e1000_82543.c
    > >   stable/8/sys/dev/e1000/e1000_82571.c
    > >   stable/8/sys/dev/e1000/e1000_82575.c
    > >   stable/8/sys/dev/e1000/e1000_82575.h
    > >   stable/8/sys/dev/e1000/e1000_api.c
    > >   stable/8/sys/dev/e1000/e1000_api.h
    > >   stable/8/sys/dev/e1000/e1000_defines.h
    > >   stable/8/sys/dev/e1000/e1000_hw.h
    > >   stable/8/sys/dev/e1000/e1000_ich8lan.c
    > >   stable/8/sys/dev/e1000/e1000_ich8lan.h
    > >   stable/8/sys/dev/e1000/e1000_mac.c
    > >   stable/8/sys/dev/e1000/e1000_mac.h
    > >   stable/8/sys/dev/e1000/e1000_manage.c
    > >   stable/8/sys/dev/e1000/e1000_manage.h
    > >   stable/8/sys/dev/e1000/e1000_nvm.c
    > >   stable/8/sys/dev/e1000/e1000_nvm.h
    > >   stable/8/sys/dev/e1000/e1000_osdep.h
    > >   stable/8/sys/dev/e1000/e1000_phy.c
    > >   stable/8/sys/dev/e1000/e1000_phy.h
    > >   stable/8/sys/dev/e1000/e1000_regs.h
    > >   stable/8/sys/dev/e1000/if_em.c   (contents, props changed)
    > >   stable/8/sys/dev/e1000/if_igb.c   (contents, props changed)
    > >   stable/8/sys/dev/e1000/if_igb.h
    > >   stable/8/sys/dev/e1000/if_lem.c
    > >   stable/8/sys/modules/em/Makefile
    > >   stable/8/sys/modules/igb/Makefile
    > > Directory Properties:
    > >   stable/8/sys/dev/e1000/   (props changed)
    > >
    > > Modified: stable/8/sys/conf/files
    > >
    > ==============================================================================
    > > --- stable/8/sys/conf/files   Thu Feb 28 00:18:56 2013        (r247429)
    > > +++ stable/8/sys/conf/files   Thu Feb 28 00:22:04 2013        (r247430)
    > > @@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c           optional em | i
    > >       compile-with "${NORMAL_C} -I$S/dev/e1000"
    > >  dev/e1000/e1000_ich8lan.c    optional em | igb \
    > >       compile-with "${NORMAL_C} -I$S/dev/e1000"
    > > +dev/e1000/e1000_i210.c               optional em | igb \
    > > +     compile-with "${NORMAL_C} -I$S/dev/e1000"
    > >  dev/e1000/e1000_api.c                optional em | igb \
    > >       compile-with "${NORMAL_C} -I$S/dev/e1000"
    > >  dev/e1000/e1000_mac.c                optional em | igb \
    > >
    > > Modified: stable/8/sys/dev/e1000/e1000_82541.c
    > >
    > ==============================================================================
    > > --- stable/8/sys/dev/e1000/e1000_82541.c      Thu Feb 28 00:18:56 2013
    >      (r247429)
    > > +++ stable/8/sys/dev/e1000/e1000_82541.c      Thu Feb 28 00:22:04 2013
    >      (r247430)
    > > @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st
    > >        * of MAC speed/duplex configuration.  So we only need to
    > >        * configure Collision Distance in the MAC.
    > >        */
    > > -     e1000_config_collision_dist_generic(hw);
    > > +     mac->ops.config_collision_dist(hw);
    > >
    > >       /*
    > >        * Configure Flow Control now that Auto-Neg has completed.
    > >
    > > Modified: stable/8/sys/dev/e1000/e1000_82543.c
    > >
    > ==============================================================================
    > > --- stable/8/sys/dev/e1000/e1000_82543.c      Thu Feb 28 00:18:56 2013
    >      (r247429)
    > > +++ stable/8/sys/dev/e1000/e1000_82543.c      Thu Feb 28 00:22:04 2013
    >      (r247430)
    > > @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543
    > >               DEBUGOUT("Valid link established!!!\n");
    > >               /* Config the MAC and PHY after link is up */
    > >               if (hw->mac.type == e1000_82544) {
    > > -                     e1000_config_collision_dist_generic(hw);
    > > +                     hw->mac.ops.config_collision_dist(hw);
    > >               } else {
    > >                       ret_val = e1000_config_mac_to_phy_82543(hw);
    > >                       if (ret_val)
    > > @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543(
    > >       /* Take the link out of reset */
    > >       ctrl &= ~E1000_CTRL_LRST;
    > >
    > > -     e1000_config_collision_dist_generic(hw);
    > > +     hw->mac.ops.config_collision_dist(hw);
    > >
    > >       ret_val = e1000_commit_fc_settings_generic(hw);
    > >       if (ret_val)
    > > @@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8
    > >        * settings.
    > >        */
    > >       if (mac->type == e1000_82544)
    > > -             e1000_config_collision_dist_generic(hw);
    > > +             hw->mac.ops.config_collision_dist(hw);
    > >       else {
    > >               ret_val = e1000_config_mac_to_phy_82543(hw);
    > >               if (ret_val) {
    > > @@ -1433,7 +1433,7 @@ static s32 e1000_config_mac_to_phy_82543
    > >       if (phy_data & M88E1000_PSSR_DPLX)
    > >               ctrl |= E1000_CTRL_FD;
    > >
    > > -     e1000_config_collision_dist_generic(hw);
    > > +     hw->mac.ops.config_collision_dist(hw);
    > >
    > >       /*
    > >        * Set up speed in the Device Control register depending on
    > >
    > > Modified: stable/8/sys/dev/e1000/e1000_82571.c
    > >
    > ==============================================================================
    > > --- stable/8/sys/dev/e1000/e1000_82571.c      Thu Feb 28 00:18:56 2013
    >      (r247429)
    > > +++ stable/8/sys/dev/e1000/e1000_82571.c      Thu Feb 28 00:22:04 2013
    >      (r247430)
    > > @@ -1,6 +1,6 @@
    > >
    >  /******************************************************************************
    > >
    > > -  Copyright (c) 2001-2011, Intel Corporation
    > > +  Copyright (c) 2001-2013, Intel Corporation
    > >    All rights reserved.
    > >
    > >    Redistribution and use in source and binary forms, with or without
    > > @@ -32,8 +32,7 @@
    > >
    >  ******************************************************************************/
    > >  /*$FreeBSD$*/
    > >
    > > -/*
    > > - * 82571EB Gigabit Ethernet Controller
    > > +/* 82571EB Gigabit Ethernet Controller
    > >   * 82571EB Gigabit Ethernet Controller (Copper)
    > >   * 82571EB Gigabit Ethernet Controller (Fiber)
    > >   * 82571EB Dual Port Gigabit Mezzanine Adapter
    > > @@ -51,9 +50,6 @@
    > >
    > >  #include "e1000_api.h"
    > >
    > > -static s32  e1000_init_phy_params_82571(struct e1000_hw *hw);
    > > -static s32  e1000_init_nvm_params_82571(struct e1000_hw *hw);
    > > -static s32  e1000_init_mac_params_82571(struct e1000_hw *hw);
    > >  static s32  e1000_acquire_nvm_82571(struct e1000_hw *hw);
    > >  static void e1000_release_nvm_82571(struct e1000_hw *hw);
    > >  static s32  e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset,
    > > @@ -78,7 +74,6 @@ static s32  e1000_get_hw_semaphore_82571
    > >  static s32  e1000_fix_nvm_checksum_82571(struct e1000_hw *hw);
    > >  static s32  e1000_get_phy_id_82571(struct e1000_hw *hw);
    > >  static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw);
    > > -static s32  e1000_get_hw_semaphore_82573(struct e1000_hw *hw);
    > >  static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw);
    > >  static s32  e1000_get_hw_semaphore_82574(struct e1000_hw *hw);
    > >  static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw);
    > > @@ -99,13 +94,13 @@ static void e1000_power_down_phy_copper_
    > >  static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
    > >  {
    > >       struct e1000_phy_info *phy = &hw->phy;
    > > -     s32 ret_val = E1000_SUCCESS;
    > > +     s32 ret_val;
    > >
    > >       DEBUGFUNC("e1000_init_phy_params_82571");
    > >
    > >       if (hw->phy.media_type != e1000_media_type_copper) {
    > >               phy->type = e1000_phy_none;
    > > -             goto out;
    > > +             return E1000_SUCCESS;
    > >       }
    > >
    > >       phy->addr                       = 1;
    > > @@ -165,8 +160,7 @@ static s32 e1000_init_phy_params_82571(s
    > >               phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82574;
    > >               break;
    > >       default:
    > > -             ret_val = -E1000_ERR_PHY;
    > > -             goto out;
    > > +             return -E1000_ERR_PHY;
    > >               break;
    > >       }
    > >
    > > @@ -174,7 +168,7 @@ static s32 e1000_init_phy_params_82571(s
    > >       ret_val = e1000_get_phy_id_82571(hw);
    > >       if (ret_val) {
    > >               DEBUGOUT("Error getting PHY ID\n");
    > > -             goto out;
    > > +             return ret_val;
    > >       }
    > >
    > >       /* Verify phy id */
    > > @@ -201,7 +195,6 @@ static s32 e1000_init_phy_params_82571(s
    > >       if (ret_val)
    > >               DEBUGOUT1("PHY ID unknown: type = 0x%08x\n", phy->id);
    > >
    > > -out:
    > >       return ret_val;
    > >  }
    > >
    > > @@ -241,8 +234,7 @@ static s32 e1000_init_nvm_params_82571(s
    > >               if (((eecd >> 15) & 0x3) == 0x3) {
    > >                       nvm->type = e1000_nvm_flash_hw;
    > >                       nvm->word_size = 2048;
    > > -                     /*
    > > -                      * Autonomous Flash update bit must be cleared due
    > > +                     /* Autonomous Flash update bit must be cleared due
    > >                        * to Flash update issue.
    > >                        */
    > >                       eecd &= ~E1000_EECD_AUPDEN;
    > > @@ -254,8 +246,7 @@ static s32 e1000_init_nvm_params_82571(s
    > >               nvm->type = e1000_nvm_eeprom_spi;
    > >               size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
    > >                            E1000_EECD_SIZE_EX_SHIFT);
    > > -             /*
    > > -              * Added to a constant, "size" becomes the left-shift value
    > > +             /* Added to a constant, "size" becomes the left-shift value
    > >                * for setting word_size.
    > >                */
    > >               size += NVM_WORD_SIZE_BASE_SHIFT;
    > > @@ -382,12 +373,11 @@ static s32 e1000_init_mac_params_82571(s
    > >
    > >               /* FWSM register */
    > >               mac->has_fwsm = TRUE;
    > > -             /*
    > > -              * ARC supported; valid only if manageability features are
    > > +             /* ARC supported; valid only if manageability features are
    > >                * enabled.
    > >                */
    > > -             mac->arc_subsystem_valid = (E1000_READ_REG(hw, E1000_FWSM)
    > &
    > > -                                        E1000_FWSM_MODE_MASK) ? TRUE :
    > FALSE;
    > > +             mac->arc_subsystem_valid = !!(E1000_READ_REG(hw,
    > E1000_FWSM) &
    > > +                                           E1000_FWSM_MODE_MASK);
    > >               break;
    > >       case e1000_82574:
    > >       case e1000_82583:
    > > @@ -405,8 +395,7 @@ static s32 e1000_init_mac_params_82571(s
    > >               break;
    > >       }
    > >
    > > -     /*
    > > -      * Ensure that the inter-port SWSM.SMBI lock bit is clear before
    > > +     /* Ensure that the inter-port SWSM.SMBI lock bit is clear before
    > >        * first NVM or PHY acess. This should be done for single-port
    > >        * devices, and for one port only on dual-port devices so that
    > >        * for those devices we can still use the SMBI lock to synchronize
    > > @@ -422,8 +411,9 @@ static s32 e1000_init_mac_params_82571(s
    > >                       E1000_WRITE_REG(hw, E1000_SWSM2, swsm2 |
    > >                                       E1000_SWSM2_LOCK);
    > >                       force_clear_smbi = TRUE;
    > > -             } else
    > > +             } else {
    > >                       force_clear_smbi = FALSE;
    > > +             }
    > >               break;
    > >       default:
    > >               force_clear_smbi = TRUE;
    > > @@ -443,10 +433,7 @@ static s32 e1000_init_mac_params_82571(s
    > >               E1000_WRITE_REG(hw, E1000_SWSM, swsm & ~E1000_SWSM_SMBI);
    > >       }
    > >
    > > -     /*
    > > -      * Initialze device specific counter of SMBI acquisition
    > > -      * timeouts.
    > > -      */
    > > +     /* Initialze device specific counter of SMBI acquisition timeouts.
    > */
    > >        hw->dev_spec._82571.smb_counter = 0;
    > >
    > >       return E1000_SUCCESS;
    > > @@ -477,7 +464,7 @@ void e1000_init_function_pointers_82571(
    > >  static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
    > >  {
    > >       struct e1000_phy_info *phy = &hw->phy;
    > > -     s32 ret_val = E1000_SUCCESS;
    > > +     s32 ret_val;
    > >       u16 phy_id = 0;
    > >
    > >       DEBUGFUNC("e1000_get_phy_id_82571");
    > > @@ -485,8 +472,7 @@ static s32 e1000_get_phy_id_82571(struct
    > >       switch (hw->mac.type) {
    > >       case e1000_82571:
    > >       case e1000_82572:
    > > -             /*
    > > -              * The 82571 firmware may still be configuring the PHY.
    > > +             /* The 82571 firmware may still be configuring the PHY.
    > >                * In this case, we cannot access the PHY until the
    > >                * configuration is done.  So we explicitly set the
    > >                * PHY ID.
    > > @@ -494,29 +480,29 @@ static s32 e1000_get_phy_id_82571(struct
    > >               phy->id = IGP01E1000_I_PHY_ID;
    > >               break;
    > >       case e1000_82573:
    > > -             ret_val = e1000_get_phy_id(hw);
    > > +             return e1000_get_phy_id(hw);
    > >               break;
    > >       case e1000_82574:
    > >       case e1000_82583:
    > >               ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id);
    > >               if (ret_val)
    > > -                     goto out;
    > > +                     return ret_val;
    > >
    > >               phy->id = (u32)(phy_id << 16);
    > >               usec_delay(20);
    > >               ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id);
    > >               if (ret_val)
    > > -                     goto out;
    > > +                     return ret_val;
    > >
    > >               phy->id |= (u32)(phy_id);
    > >               phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
    > >               break;
    > >       default:
    > > -             ret_val = -E1000_ERR_PHY;
    > > +             return -E1000_ERR_PHY;
    > >               break;
    > >       }
    > > -out:
    > > -     return ret_val;
    > > +
    > > +     return E1000_SUCCESS;
    > >  }
    > >
    > >  /**
    > > @@ -528,15 +514,13 @@ out:
    > >  static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
    > >  {
    > >       u32 swsm;
    > > -     s32 ret_val = E1000_SUCCESS;
    > >       s32 sw_timeout = hw->nvm.word_size + 1;
    > >       s32 fw_timeout = hw->nvm.word_size + 1;
    > >       s32 i = 0;
    > >
    > >       DEBUGFUNC("e1000_get_hw_semaphore_82571");
    > >
    > > -     /*
    > > -      * If we have timedout 3 times on trying to acquire
    > > +     /* If we have timedout 3 times on trying to acquire
    > >        * the inter-port SMBI semaphore, there is old code
    > >        * operating on the other port, and it is not
    > >        * releasing SMBI. Modify the number of times that
    > > @@ -576,12 +560,10 @@ static s32 e1000_get_hw_semaphore_82571(
    > >               /* Release semaphores */
    > >               e1000_put_hw_semaphore_82571(hw);
    > >               DEBUGOUT("Driver can't access the NVM\n");
    > > -             ret_val = -E1000_ERR_NVM;
    > > -             goto out;
    > > +             return -E1000_ERR_NVM;
    > >       }
    > >
    > > -out:
    > > -     return ret_val;
    > > +     return E1000_SUCCESS;
    > >  }
    > >
    > >  /**
    > > @@ -613,22 +595,19 @@ static void e1000_put_hw_semaphore_82571
    > >  static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw)
    > >  {
    > >       u32 extcnf_ctrl;
    > > -     s32 ret_val = E1000_SUCCESS;
    > >       s32 i = 0;
    > >
    > >       DEBUGFUNC("e1000_get_hw_semaphore_82573");
    > >
    > >       extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL);
    > > -     extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
    > >       do {
    > > +             extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
    > >               E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl);
    > >               extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL);
    > >
    > >               if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP)
    > >                       break;
    > >
    > > -             extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
    > > -
    > >               msec_delay(2);
    > >               i++;
    > >       } while (i < MDIO_OWNERSHIP_TIMEOUT);
    > > @@ -637,12 +616,10 @@ static s32 e1000_get_hw_semaphore_82573(
    > >               /* Release semaphores */
    > >               e1000_put_hw_semaphore_82573(hw);
    > >               DEBUGOUT("Driver can't access the PHY\n");
    > > -             ret_val = -E1000_ERR_PHY;
    > > -             goto out;
    > > +             return -E1000_ERR_PHY;
    > >       }
    > >
    > > -out:
    > > -     return ret_val;
    > > +     return E1000_SUCCESS;
    > >  }
    > >
    > >  /**
    > > @@ -712,7 +689,7 @@ static void e1000_put_hw_semaphore_82574
    > >   **/
    > >  static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool
    > active)
    > >  {
    > > -     u16 data = E1000_READ_REG(hw, E1000_POEMB);
    > > +     u32 data = E1000_READ_REG(hw, E1000_POEMB);
    > >
    > >       DEBUGFUNC("e1000_set_d0_lplu_state_82574");
    > >
    > > @@ -738,7 +715,7 @@ static s32 e1000_set_d0_lplu_state_82574
    > >   **/
    > >  static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool
    > active)
    > >  {
    > > -     u16 data = E1000_READ_REG(hw, E1000_POEMB);
    > > +     u32 data = E1000_READ_REG(hw, E1000_POEMB);
    > >
    > >       DEBUGFUNC("e1000_set_d3_lplu_state_82574");
    > >
    > > @@ -771,7 +748,7 @@ static s32 e1000_acquire_nvm_82571(struc
    > >
    > >       ret_val = e1000_get_hw_semaphore_82571(hw);
    > >       if (ret_val)
    > > -             goto out;
    > > +             return ret_val;
    > >
    > >       switch (hw->mac.type) {
    > >       case e1000_82573:
    > > @@ -784,7 +761,6 @@ static s32 e1000_acquire_nvm_82571(struc
    > >       if (ret_val)
    > >               e1000_put_hw_semaphore_82571(hw);
    > >
    > > -out:
    > >       return ret_val;
    > >  }
    > >
    > > @@ -817,7 +793,7 @@ static void e1000_release_nvm_82571(stru
    > >  static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16
    > words,
    > >                                u16 *data)
    > >  {
    > > -     s32 ret_val = E1000_SUCCESS;
    > > +     s32 ret_val;
    > >
    > >       DEBUGFUNC("e1000_write_nvm_82571");
    > >
    > > @@ -857,31 +833,27 @@ static s32 e1000_update_nvm_checksum_825
    > >
    > >       ret_val = e1000_update_nvm_checksum_generic(hw);
    > >       if (ret_val)
    > > -             goto out;
    > > +             return ret_val;
    > >
    > > -     /*
    > > -      * If our nvm is an EEPROM, then we're done
    > > +     /* If our nvm is an EEPROM, then we're done
    > >        * otherwise, commit the checksum to the flash NVM.
    > >        */
    > >       if (hw->nvm.type != e1000_nvm_flash_hw)
    > > -             goto out;
    > > +             return E1000_SUCCESS;
    > >
    > >       /* Check for pending operations. */
    > >       for (i = 0; i < E1000_FLASH_UPDATES; i++) {
    > >               msec_delay(1);
    > > -             if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) ==
    > 0)
    > > +             if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD))
    > >                       break;
    > >       }
    > >
    > > -     if (i == E1000_FLASH_UPDATES) {
    > > -             ret_val = -E1000_ERR_NVM;
    > > -             goto out;
    > > -     }
    > > +     if (i == E1000_FLASH_UPDATES)
    > > +             return -E1000_ERR_NVM;
    > >
    > >       /* Reset the firmware if using STM opcode. */
    > >       if ((E1000_READ_REG(hw, E1000_FLOP) & 0xFF00) == E1000_STM_OPCODE)
    > {
    > > -             /*
    > > -              * The enabling of and the actual reset must be done
    > > +             /* The enabling of and the actual reset must be done
    > >                * in two write cycles.
    > >                */
    > >               E1000_WRITE_REG(hw, E1000_HICR,
    > E1000_HICR_FW_RESET_ENABLE);
    > > @@ -895,17 +867,14 @@ static s32 e1000_update_nvm_checksum_825
    > >
    > >       for (i = 0; i < E1000_FLASH_UPDATES; i++) {
    > >               msec_delay(1);
    > > -             if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD) ==
    > 0)
    > > +             if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD))
    > >                       break;
    > >       }
    > >
    > > -     if (i == E1000_FLASH_UPDATES) {
    > > -             ret_val = -E1000_ERR_NVM;
    > > -             goto out;
    > > -     }
    > > +     if (i == E1000_FLASH_UPDATES)
    > > +             return -E1000_ERR_NVM;
    > >
    > > -out:
    > > -     return ret_val;
    > > +     return E1000_SUCCESS;
    > >  }
    > >
    > >  /**
    > > @@ -944,19 +913,17 @@ static s32 e1000_write_nvm_eewr_82571(st
    > >  {
    > >       struct e1000_nvm_info *nvm = &hw->nvm;
    > >       u32 i, eewr = 0;
    > > -     s32 ret_val = 0;
    > > +     s32 ret_val = E1000_SUCCESS;
    > >
    > >       DEBUGFUNC("e1000_write_nvm_eewr_82571");
    > >
    > > -     /*
    > > -      * A check for invalid values:  offset too large, too many words,
    > > +     /* A check for invalid values:  offset too large, too many words,
    > >        * and not enough words.
    > >        */
    > >       if ((offset >= nvm->word_size) || (words > (nvm->word_size -
    > offset)) ||
    > >           (words == 0)) {
    > >               DEBUGOUT("nvm parameter(s) out of bounds\n");
    > > -             ret_val = -E1000_ERR_NVM;
    > > -             goto out;
    > > +             return -E1000_ERR_NVM;
    > >       }
    > >
    > >       for (i = 0; i < words; i++) {
    > > @@ -975,7 +942,6 @@ static s32 e1000_write_nvm_eewr_82571(st
    > >                       break;
    > >       }
    > >
    > > -out:
    > >       return ret_val;
    > >  }
    > >
    > > @@ -988,7 +954,6 @@ out:
    > >  static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)
    > >  {
    > >       s32 timeout = PHY_CFG_TIMEOUT;
    > > -     s32 ret_val = E1000_SUCCESS;
    > >
    > >       DEBUGFUNC("e1000_get_cfg_done_82571");
    > >
    > > @@ -1001,12 +966,10 @@ static s32 e1000_get_cfg_done_82571(stru
    > >       }
    > >       if (!timeout) {
    > >               DEBUGOUT("MNG configuration cycle has not completed.\n");
    > > -             ret_val = -E1000_ERR_RESET;
    > > -             goto out;
    > > +             return -E1000_ERR_RESET;
    > >       }
    > >
    > > -out:
    > > -     return ret_val;
    > > +     return E1000_SUCCESS;
    > >  }
    > >
    > >  /**
    > > @@ -1023,39 +986,40 @@ out:
    > >  static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool
    > active)
    > >  {
    > >       struct e1000_phy_info *phy = &hw->phy;
    > > -     s32 ret_val = E1000_SUCCESS;
    > > +     s32 ret_val;
    > >       u16 data;
    > >
    > >       DEBUGFUNC("e1000_set_d0_lplu_state_82571");
    > >
    > >       if (!(phy->ops.read_reg))
    > > -             goto out;
    > > +             return E1000_SUCCESS;
    > >
    > >       ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data);
    > >       if (ret_val)
    > > -             goto out;
    > > +             return ret_val;
    > >
    > >       if (active) {
    > >               data |= IGP02E1000_PM_D0_LPLU;
    > >               ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
    > >                                            data);
    > >               if (ret_val)
    > > -                     goto out;
    > > +                     return ret_val;
    > >
    > >               /* When LPLU is enabled, we should disable SmartSpeed */
    > >               ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
    > >                                           &data);
    > > +             if (ret_val)
    > > +                     return ret_val;
    > >               data &= ~IGP01E1000_PSCFR_SMART_SPEED;
    > >               ret_val = phy->ops.write_reg(hw,
    > IGP01E1000_PHY_PORT_CONFIG,
    > >                                            data);
    > >               if (ret_val)
    > > -                     goto out;
    > > +                     return ret_val;
    > >       } else {
    > >               data &= ~IGP02E1000_PM_D0_LPLU;
    > >               ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
    > >                                            data);
    > > -             /*
    > > -              * LPLU and SmartSpeed are mutually exclusive.  LPLU is
    > used
    > > +             /* LPLU and SmartSpeed are mutually exclusive.  LPLU is
    > used
    > >                * during Dx states where the power conservation is most
    > >                * important.  During driver activity we should enable
    > >                * SmartSpeed, so performance is maintained.
    > > @@ -1065,32 +1029,31 @@ static s32 e1000_set_d0_lplu_state_82571
    > >
    > IGP01E1000_PHY_PORT_CONFIG,
    > >                                                   &data);
    > >                       if (ret_val)
    > > -                             goto out;
    > > +                             return ret_val;
    > >
    > >                       data |= IGP01E1000_PSCFR_SMART_SPEED;
    > >                       ret_val = phy->ops.write_reg(hw,
    > >
    >  IGP01E1000_PHY_PORT_CONFIG,
    > >                                                    data);
    > >                       if (ret_val)
    > > -                             goto out;
    > > +                             return ret_val;
    > >               } else if (phy->smart_speed == e1000_smart_speed_off) {
    > >                       ret_val = phy->ops.read_reg(hw,
    > >
    > IGP01E1000_PHY_PORT_CONFIG,
    > >                                                   &data);
    > >                       if (ret_val)
    > > -                             goto out;
    > > +                             return ret_val;
    > >
    > >                       data &= ~IGP01E1000_PSCFR_SMART_SPEED;
    > >                       ret_val = phy->ops.write_reg(hw,
    > >
    >  IGP01E1000_PHY_PORT_CONFIG,
    > >                                                    data);
    > >                       if (ret_val)
    > > -                             goto out;
    > > +                             return ret_val;
    > >               }
    > >       }
    > >
    > > -out:
    > > -     return ret_val;
    > > +     return E1000_SUCCESS;
    > >  }
    > >
    > >  /**
    > > @@ -1101,13 +1064,12 @@ out:
    > >   **/
    > >  static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
    > >  {
    > > -     u32 ctrl, ctrl_ext;
    > > +     u32 ctrl, ctrl_ext, eecd, tctl;
    > >       s32 ret_val;
    > >
    > >       DEBUGFUNC("e1000_reset_hw_82571");
    > >
    > > -     /*
    > > -      * Prevent the PCI-E bus from sticking if there is no TLP
    > connection
    > > +     /* Prevent the PCI-E bus from sticking if there is no TLP
    > connection
    > >        * on the last TLP read/write transaction when MAC is reset.
    > >        */
    > >       ret_val = e1000_disable_pcie_master_generic(hw);
    > > @@ -1118,13 +1080,14 @@ static s32 e1000_reset_hw_82571(struct e
    > >       E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
    > >
    > >       E1000_WRITE_REG(hw, E1000_RCTL, 0);
    > > -     E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP);
    > > +     tctl = E1000_READ_REG(hw, E1000_TCTL);
    > > +     tctl &= ~E1000_TCTL_EN;
    > > +     E1000_WRITE_REG(hw, E1000_TCTL, tctl);
    > >       E1000_WRITE_FLUSH(hw);
    > >
    > >       msec_delay(10);
    > >
    > > -     /*
    > > -      * Must acquire the MDIO ownership before MAC reset.
    > > +     /* Must acquire the MDIO ownership before MAC reset.
    > >        * Ownership defaults to firmware after a reset.
    > >        */
    > >       switch (hw->mac.type) {
    > > @@ -1167,15 +1130,23 @@ static s32 e1000_reset_hw_82571(struct e
    > >       ret_val = e1000_get_auto_rd_done_generic(hw);
    > >       if (ret_val)
    > >               /* We don't want to continue accessing MAC registers. */
    > > -             goto out;
    > > +             return ret_val;
    > >
    > > -     /*
    > > -      * Phy configuration from NVM just starts after EECD_AUTO_RD is
    > set.
    > > +     /* Phy configuration from NVM just starts after EECD_AUTO_RD is
    > set.
    > >        * Need to wait for Phy configuration completion before accessing
    > >        * NVM and Phy.
    > >        */
    > >
    > >       switch (hw->mac.type) {
    > > +     case e1000_82571:
    > > +     case e1000_82572:
    > > +             /* REQ and GNT bits need to be cleared when using AUTO_RD
    > > +              * to access the EEPROM.
    > > +              */
    > > +             eecd = E1000_READ_REG(hw, E1000_EECD);
    > > +             eecd &= ~(E1000_EECD_REQ | E1000_EECD_GNT);
    > > +             E1000_WRITE_REG(hw, E1000_EECD, eecd);
    > > +             break;
    > >       case e1000_82573:
    > >       case e1000_82574:
    > >       case e1000_82583:
    > > @@ -1193,7 +1164,7 @@ static s32 e1000_reset_hw_82571(struct e
    > >               /* Install any alternate MAC address into RAR0 */
    > >               ret_val = e1000_check_alt_mac_addr_generic(hw);
    > >               if (ret_val)
    > > -                     goto out;
    > > +                     return ret_val;
    > >
    > >               e1000_set_laa_state_82571(hw, TRUE);
    > >       }
    > > @@ -1202,8 +1173,7 @@ static s32 e1000_reset_hw_82571(struct e
    > >       if (hw->phy.media_type == e1000_media_type_internal_serdes)
    > >               hw->mac.serdes_link_state = e1000_serdes_link_down;
    > >
    > > -out:
    > > -     return ret_val;
    > > +     return E1000_SUCCESS;
    > >  }
    > >
    > >  /**
    > > @@ -1225,16 +1195,15 @@ static s32 e1000_init_hw_82571(struct e1
    > >
    > >       /* Initialize identification LED */
    > >       ret_val = mac->ops.id_led_init(hw);
    > > +     /* An error is not fatal and we should not stop init due to this */
    > >       if (ret_val)
    > >               DEBUGOUT("Error initializing identification LED\n");
    > > -             /* This is not fatal and we should not stop init due to
    > this */
    > >
    > >       /* Disabling VLAN filtering */
    > >       DEBUGOUT("Initializing the IEEE VLAN\n");
    > >       mac->ops.clear_vfta(hw);
    > >
    > > -     /* Setup the receive address. */
    > > -     /*
    > > +     /* Setup the receive address.
    > >        * If, however, a locally administered address was assigned to the
    > >        * 82571, we must reserve a RAR for it to work around an issue
    > where
    > >        * resetting one port will reload the MAC on the other port.
    > > @@ -1277,8 +1246,7 @@ static s32 e1000_init_hw_82571(struct e1
    > >               break;
    > >       }
    > >
    > > -     /*
    > > -      * Clear all of the statistics registers (clear on read).  It is
    > > +     /* Clear all of the statistics registers (clear on read).  It is
    > >        * important that we do this after we have tried to establish link
    > >        * because the symbol error count will increment wildly if there
    > >        * is no link.
    > > @@ -1377,8 +1345,7 @@ static void e1000_initialize_hw_bits_825
    > >               E1000_WRITE_REG(hw, E1000_PBA_ECC, reg);
    > >       }
    > >
    > > -     /*
    > > -      * Workaround for hardware errata.
    > > +     /* Workaround for hardware errata.
    > >        * Ensure that DMA Dynamic Clock gating is disabled on 82571 and
    > 82572
    > >        */
    > >       if ((hw->mac.type == e1000_82571) ||
    > > @@ -1388,6 +1355,15 @@ static void e1000_initialize_hw_bits_825
    > >               E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg);
    > >       }
    > >
    > > +     /* Disable IPv6 extension header parsing because some malformed
    > > +      * IPv6 headers can hang the Rx.
    > > +      */
    > > +     if (hw->mac.type <= e1000_82573) {
    > > +             reg = E1000_READ_REG(hw, E1000_RFCTL);
    > > +             reg |= (E1000_RFCTL_IPV6_EX_DIS |
    > E1000_RFCTL_NEW_IPV6_EXT_DIS);
    > > +             E1000_WRITE_REG(hw, E1000_RFCTL, reg);
    > > +     }
    > > +
    > >       /* PCI-Ex Control Registers */
    > >       switch (hw->mac.type) {
    > >       case e1000_82574:
    > > @@ -1396,8 +1372,7 @@ static void e1000_initialize_hw_bits_825
    > >               reg |= (1 << 22);
    > >               E1000_WRITE_REG(hw, E1000_GCR, reg);
    > >
    > > -             /*
    > > -              * Workaround for hardware errata.
    > > +             /* Workaround for hardware errata.
    > >                * apply workaround for hardware errata documented in
    > errata
    > >                * docs Fixes issue where some error prone or unreliable
    > PCIe
    > >                * completions are occurring, particularly with ASPM
    > enabled.
    > > @@ -1435,25 +1410,25 @@ static void e1000_clear_vfta_82571(struc
    > >       case e1000_82574:
    > >       case e1000_82583:
    > >               if (hw->mng_cookie.vlan_id != 0) {
    > > -                     /*
    > > -                      * The VFTA is a 4096b bit-field, each identifying
    > > +                     /* The VFTA is a 4096b bit-field, each identifying
    > >                        * a single VLAN ID.  The following operations
    > >                        * determine which 32b entry (i.e. offset) into the
    > >                        * array we want to set the VLAN ID (i.e. bit) of
    > >                        * the manageability unit.
    > >                        */
    > >                       vfta_offset = (hw->mng_cookie.vlan_id >>
    > > -                             E1000_VFTA_ENTRY_SHIFT) &
    > E1000_VFTA_ENTRY_MASK;
    > > -                     vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id &
    > > -                             E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
    > > +                                    E1000_VFTA_ENTRY_SHIFT) &
    > > +                         E1000_VFTA_ENTRY_MASK;
    > > +                     vfta_bit_in_reg =
    > > +                         1 << (hw->mng_cookie.vlan_id &
    > > +                               E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
    > >               }
    > >               break;
    > >       default:
    > >               break;
    > >       }
    > >       for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) {
    > > -             /*
    > > -              * If the offset we want to clear is the same offset of the
    > > +             /* If the offset we want to clear is the same offset of the
    > >                * manageability VLAN ID, then clear all bits except that
    > of
    > >                * the manageability unit.
    > >                */
    > > @@ -1495,8 +1470,7 @@ static s32 e1000_led_on_82574(struct e10
    > >
    > >       ctrl = hw->mac.ledctl_mode2;
    > >       if (!(E1000_STATUS_LU & E1000_READ_REG(hw, E1000_STATUS))) {
    > > -             /*
    > > -              * If no link, then turn LED on by setting the invert bit
    > > +             /* If no link, then turn LED on by setting the invert bit
    > >                * for each LED that's "on" (0x0E) in ledctl_mode2.
    > >                */
    > >               for (i = 0; i < 4; i++)
    > > @@ -1519,30 +1493,28 @@ bool e1000_check_phy_82574(struct e1000_
    > >  {
    > >       u16 status_1kbt = 0;
    > >       u16 receive_errors = 0;
    > > -     bool phy_hung = FALSE;
    > > -     s32 ret_val = E1000_SUCCESS;
    > > +     s32 ret_val;
    > >
    > >       DEBUGFUNC("e1000_check_phy_82574");
    > >
    > > -     /*
    > > -      * Read PHY Receive Error counter first, if its is max - all F's
    > then
    > > +     /* Read PHY Receive Error counter first, if its is max - all F's
    > then
    > >        * read the Base1000T status register If both are max then PHY is
    > hung.
    > >        */
    > >       ret_val = hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER,
    > >                                      &receive_errors);
    > >       if (ret_val)
    > > -             goto out;
    > > +             return FALSE;
    > >       if (receive_errors == E1000_RECEIVE_ERROR_MAX) {
    > >               ret_val = hw->phy.ops.read_reg(hw, E1000_BASE1000T_STATUS,
    > >                                              &status_1kbt);
    > >               if (ret_val)
    > > -                     goto out;
    > > +                     return FALSE;
    > >               if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) ==
    > >                   E1000_IDLE_ERROR_COUNT_MASK)
    > > -                     phy_hung = TRUE;
    > > +                     return TRUE;
    > >       }
    > > -out:
    > > -     return phy_hung;
    > > +
    > > +     return FALSE;
    > >  }
    > >
    > >
    > > @@ -1560,8 +1532,7 @@ static s32 e1000_setup_link_82571(struct
    > >  {
    > >       DEBUGFUNC("e1000_setup_link_82571");
    > >
    > > -     /*
    > > -      * 82573 does not have a word in the NVM to determine
    > > +     /* 82573 does not have a word in the NVM to determine
    > >        * the default flow control setting, so we explicitly
    > >        * set it to full.
    > >        */
    > > @@ -1608,17 +1579,14 @@ static s32 e1000_setup_copper_link_82571
    > >               ret_val = e1000_copper_link_setup_igp(hw);
    > >               break;
    > >       default:
    > > -             ret_val = -E1000_ERR_PHY;
    > > +             return -E1000_ERR_PHY;
    > >               break;
    > >       }
    > >
    > >       if (ret_val)
    > > -             goto out;
    > > -
    > > -     ret_val = e1000_setup_copper_link_generic(hw);
    > > +             return ret_val;
    > >
    > > -out:
    > > -     return ret_val;
    > > +     return e1000_setup_copper_link_generic(hw);
    > >  }
    > >
    > >  /**
    > > @@ -1635,8 +1603,7 @@ static s32 e1000_setup_fiber_serdes_link
    > >       switch (hw->mac.type) {
    > >       case e1000_82571:
    > >       case e1000_82572:
    > > -             /*
    > > -              * If SerDes loopback mode is entered, there is no form
    > > +             /* If SerDes loopback mode is entered, there is no form
    > >                * of reset to take the adapter out of that mode.  So we
    > >                * have to explicitly take the adapter out of loopback
    > >                * mode.  This prevents drivers from twiddling their thumbs
    > > @@ -1685,16 +1652,17 @@ static s32 e1000_check_for_serdes_link_8
    > >
    > >       ctrl = E1000_READ_REG(hw, E1000_CTRL);
    > >       status = E1000_READ_REG(hw, E1000_STATUS);
    > > +     E1000_READ_REG(hw, E1000_RXCW);
    > > +     /* SYNCH bit and IV bit are sticky */
    > > +     usec_delay(10);
    > >       rxcw = E1000_READ_REG(hw, E1000_RXCW);
    > >
    > >       if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) {
    > > -
    > >               /* Receiver is synchronized with no invalid bits.  */
    > >               switch (mac->serdes_link_state) {
    > >               case e1000_serdes_link_autoneg_complete:
    > >                       if (!(status & E1000_STATUS_LU)) {
    > > -                             /*
    > > -                              * We have lost link, retry autoneg before
    > > +                             /* We have lost link, retry autoneg before
    > >                                * reporting link failure
    > >                                */
    > >                               mac->serdes_link_state =
    > > @@ -1707,15 +1675,12 @@ static s32 e1000_check_for_serdes_link_8
    > >                       break;
    > >
    > >               case e1000_serdes_link_forced_up:
    > > -                     /*
    > > -                      * If we are receiving /C/ ordered sets, re-enable
    > > +                     /* If we are receiving /C/ ordered sets, re-enable
    > >                        * auto-negotiation in the TXCW register and
    > disable
    > >                        * forced link in the Device Control register in an
    > >                        * attempt to auto-negotiate with our link partner.
    > > -                      * If the partner code word is null, stop forcing
    > > -                      * and restart auto negotiation.
    > >                        */
    > > -                     if ((rxcw & E1000_RXCW_C) || !(rxcw &
    > E1000_RXCW_CW))  {
    > > +                     if (rxcw & E1000_RXCW_C) {
    > >                               /* Enable autoneg, and unforce link up */
    > >                               E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw);
    > >                               E1000_WRITE_REG(hw, E1000_CTRL,
    > > @@ -1731,8 +1696,7 @@ static s32 e1000_check_for_serdes_link_8
    > >
    > >               case e1000_serdes_link_autoneg_progress:
    > >                       if (rxcw & E1000_RXCW_C) {
    > > -                             /*
    > > -                              * We received /C/ ordered sets, meaning
    > the
    > > +                             /* We received /C/ ordered sets, meaning
    > the
    > >                                * link partner has autonegotiated, and we
    > can
    > >                                * trust the Link Up (LU) status bit.
    > >                                */
    > > @@ -1748,8 +1712,7 @@ static s32 e1000_check_for_serdes_link_8
    > >                                       DEBUGOUT("AN_PROG   -> DOWN\n");
    > >                               }
    > >                       } else {
    > > -                             /*
    > > -                              * The link partner did not autoneg.
    > > +                             /* The link partner did not autoneg.
    > >                                * Force link up and full duplex, and
    > change
    > >                                * state to forced.
    > >                                */
    > > @@ -1774,8 +1737,7 @@ static s32 e1000_check_for_serdes_link_8
    > >
    > >               case e1000_serdes_link_down:
    > >               default:
    > > -                     /*
    > > -                      * The link was down but the receiver has now
    > gained
    > > +                     /* The link was down but the receiver has now
    > gained
    > >                        * valid sync, so lets see if we can bring the link
    > >                        * up.
    > >                        */
    > > @@ -1794,17 +1756,18 @@ static s32 e1000_check_for_serdes_link_8
    > >                       mac->serdes_link_state = e1000_serdes_link_down;
    > >                       DEBUGOUT("ANYSTATE  -> DOWN\n");
    > >               } else {
    > > -                     /*
    > > -                      * Check several times, if Sync and Config
    > > -                      * both are consistently 1 then simply ignore
    > > -                      * the Invalid bit and restart Autoneg
    > > +                     /* Check several times, if SYNCH bit and CONFIG
    > > +                      * bit both are consistently 1 then simply ignore
    > > +                      * the IV bit and restart Autoneg
    > >                        */
    > >                       for (i = 0; i < AN_RETRY_COUNT; i++) {
    > >                               usec_delay(10);
    > >                               rxcw = E1000_READ_REG(hw, E1000_RXCW);
    > > -                             if ((rxcw & E1000_RXCW_IV) &&
    > > -                                 !((rxcw & E1000_RXCW_SYNCH) &&
    > > -                                   (rxcw & E1000_RXCW_C))) {
    > > +                             if ((rxcw & E1000_RXCW_SYNCH) &&
    > > +                                 (rxcw & E1000_RXCW_C))
    > > +                                     continue;
    > > +
    > > +                             if (rxcw & E1000_RXCW_IV) {
    > >                                       mac->serdes_has_link = FALSE;
    > >                                       mac->serdes_link_state =
    > >
    > e1000_serdes_link_down;
    > > @@ -1845,7 +1808,7 @@ static s32 e1000_valid_led_default_82571
    > >       ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data);
    > >       if (ret_val) {
    > >               DEBUGOUT("NVM Read Error\n");
    > > -             goto out;
    > > +             return ret_val;
    > >       }
    > >
    > >       switch (hw->mac.type) {
    > > @@ -1862,8 +1825,7 @@ static s32 e1000_valid_led_default_82571
    > >               break;
    > >       }
    > >
    > > -out:
    > > -     return ret_val;
    > > +     return E1000_SUCCESS;
    > >  }
    > >
    > >  /**
    > > @@ -1900,15 +1862,14 @@ void e1000_set_laa_state_82571(struct e1
    > >
    > >       /* If workaround is activated... */
    > >       if (state)
    > > -             /*
    > > -              * Hold a copy of the LAA in RAR[14] This is done so that
    > > +             /* Hold a copy of the LAA in RAR[14] This is done so that
    > >                * between the time RAR[0] gets clobbered and the time it
    > >                * gets fixed, the actual LAA is in one of the RARs and no
    > >                * incoming packets directed to this port are dropped.
    > >                * Eventually the LAA will be in RAR[0] and RAR[14].
    > >                */
    > > -             e1000_rar_set_generic(hw, hw->mac.addr,
    > > -                                   hw->mac.rar_entry_count - 1);
    > > +             hw->mac.ops.rar_set(hw, hw->mac.addr,
    > > +                                 hw->mac.rar_entry_count - 1);
    > >       return;
    > >  }
    > >
    > > @@ -1925,25 +1886,23 @@ void e1000_set_laa_state_82571(struct e1
    > >  static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
    > >  {
    > >       struct e1000_nvm_info *nvm = &hw->nvm;
    > > -     s32 ret_val = E1000_SUCCESS;
    > > +     s32 ret_val;
    > >       u16 data;
    > >
    > >       DEBUGFUNC("e1000_fix_nvm_checksum_82571");
    > >
    > >       if (nvm->type != e1000_nvm_flash_hw)
    > > -             goto out;
    > > +             return E1000_SUCCESS;
    > >
    > > -     /*
    > > -      * Check bit 4 of word 10h.  If it is 0, firmware is done updating
    > > +     /* Check bit 4 of word 10h.  If it is 0, firmware is done updating
    > >        * 10h-12h.  Checksum may need to be fixed.
    > >        */
    > >
    > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    > > _______________________________________________
    > > svn-src-stable-8@freebsd.org mailing list
    > > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8
    > > To unsubscribe, send any mail to "
    > svn-src-stable-8-unsubscribe@freebsd.org"
    >
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 05:41:14 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 88BE0C94;
     Thu, 28 Feb 2013 05:41:14 +0000 (UTC)
     (envelope-from jfvogel@gmail.com)
    Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com
     [209.85.220.179])
     by mx1.freebsd.org (Postfix) with ESMTP id AC645C12;
     Thu, 28 Feb 2013 05:41:13 +0000 (UTC)
    Received: by mail-vc0-f179.google.com with SMTP id k1so932094vck.38
     for ; Wed, 27 Feb 2013 21:41:07 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
     h=mime-version:x-received:in-reply-to:references:date:message-id
     :subject:from:to:cc:content-type;
     bh=6MvJGkOilA1JGT1vPQkdYeWy6wImDTQV0mxEdEjmLbQ=;
     b=c9lZ7DRRo6tVjveS8JWQW2GwYQqyynQ1nPzX7VjWY0ygTDHw+jLiUGgeL7SLS9oN6t
     /tUpGvWW9T3F2r3PUhB6AweErMXiO10bSkdFnehL3Vub0BzBYtyk8rWnpQ/4mirCBrHH
     Qm9mCEmDIWkKOUm9dncdoOW27jEMIDubfzR9rL265YvpYk4kHtf1iGrevKG2NvuEvjae
     Mrs4KBMAJKTiGwPHfv/M/WDbG3O0ith4nsXwpTyH54yDZuR5Xc/4qHiEUmUavRg2uavX
     HUmrtUobbNsEe1y8t3wlt4x1KXitoTQYzCsdYidKNkWisdfa/XLPUuJXftOlB/oYMwbu
     tKPQ==
    MIME-Version: 1.0
    X-Received: by 10.52.30.48 with SMTP id p16mr1779773vdh.118.1362030066832;
     Wed, 27 Feb 2013 21:41:06 -0800 (PST)
    Received: by 10.220.191.132 with HTTP; Wed, 27 Feb 2013 21:41:06 -0800 (PST)
    In-Reply-To: 
    References: <201302280022.r1S0M4vm064514@svn.freebsd.org>
     <20130228022333.GC70215@glenbarber.us>
     
    Date: Wed, 27 Feb 2013 21:41:06 -0800
    Message-ID: 
    Subject: Re: svn commit: r247430 - in stable/8/sys: conf dev/e1000 modules/em
     modules/igb
    From: Jack Vogel 
    To: Glen Barber 
    Content-Type: text/plain; charset=ISO-8859-1
    X-Content-Filtered-By: Mailman/MimeDel 2.1.14
    Cc: Jack F Vogel , svn-src-stable@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org,
     svn-src-stable-8@freebsd.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 05:41:14 -0000
    
    LOL, I would see the messages just as I sent this, never mind.
    
    Jack
    
    
    On Wed, Feb 27, 2013 at 9:39 PM, Jack Vogel  wrote:
    
    > Oh, that's odd, then HEAD should be broken too, do you have more detail?
    >
    > Jack
    >
    >
    > On Wed, Feb 27, 2013 at 6:23 PM, Glen Barber  wrote:
    >
    >> Jack,
    >>
    >> This commit seems to break the build for at least powerpc and sparc64.
    >>
    >> Glen
    >>
    >> On Thu, Feb 28, 2013 at 12:22:04AM +0000, Jack F Vogel wrote:
    >> > Author: jfv
    >> > Date: Thu Feb 28 00:22:04 2013
    >> > New Revision: 247430
    >> > URL: http://svnweb.freebsd.org/changeset/base/247430
    >> >
    >> > Log:
    >> >   MFC of the E1000 drivers to STABLE/8, this includes the follow
    >> revisions
    >> >   plus a few tweaks:
    >> >    196969,196970,211516,214646,215781,215789,215808,215910,223350,
    >> >    223482,223831,228281,228393,229939,231796,232238,234665,235256,
    >> >    236406,238148,238151,238214,238765,238770,238953,238981,239105,
    >> >    239109,239304,240518,240693,240968,241037,241856,241885,243570,
    >> >    243857,245334,246128,246482,247064
    >> >
    >> > Added:
    >> >   stable/8/sys/dev/e1000/e1000_i210.c
    >> >      - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c
    >> >   stable/8/sys/dev/e1000/e1000_i210.h
    >> >      - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h
    >> > Modified:
    >> >   stable/8/sys/conf/files
    >> >   stable/8/sys/dev/e1000/e1000_82541.c
    >> >   stable/8/sys/dev/e1000/e1000_82543.c
    >> >   stable/8/sys/dev/e1000/e1000_82571.c
    >> >   stable/8/sys/dev/e1000/e1000_82575.c
    >> >   stable/8/sys/dev/e1000/e1000_82575.h
    >> >   stable/8/sys/dev/e1000/e1000_api.c
    >> >   stable/8/sys/dev/e1000/e1000_api.h
    >> >   stable/8/sys/dev/e1000/e1000_defines.h
    >> >   stable/8/sys/dev/e1000/e1000_hw.h
    >> >   stable/8/sys/dev/e1000/e1000_ich8lan.c
    >> >   stable/8/sys/dev/e1000/e1000_ich8lan.h
    >> >   stable/8/sys/dev/e1000/e1000_mac.c
    >> >   stable/8/sys/dev/e1000/e1000_mac.h
    >> >   stable/8/sys/dev/e1000/e1000_manage.c
    >> >   stable/8/sys/dev/e1000/e1000_manage.h
    >> >   stable/8/sys/dev/e1000/e1000_nvm.c
    >> >   stable/8/sys/dev/e1000/e1000_nvm.h
    >> >   stable/8/sys/dev/e1000/e1000_osdep.h
    >> >   stable/8/sys/dev/e1000/e1000_phy.c
    >> >   stable/8/sys/dev/e1000/e1000_phy.h
    >> >   stable/8/sys/dev/e1000/e1000_regs.h
    >> >   stable/8/sys/dev/e1000/if_em.c   (contents, props changed)
    >> >   stable/8/sys/dev/e1000/if_igb.c   (contents, props changed)
    >> >   stable/8/sys/dev/e1000/if_igb.h
    >> >   stable/8/sys/dev/e1000/if_lem.c
    >> >   stable/8/sys/modules/em/Makefile
    >> >   stable/8/sys/modules/igb/Makefile
    >> > Directory Properties:
    >> >   stable/8/sys/dev/e1000/   (props changed)
    >> >
    >> > Modified: stable/8/sys/conf/files
    >> >
    >> ==============================================================================
    >> > --- stable/8/sys/conf/files   Thu Feb 28 00:18:56 2013        (r247429)
    >> > +++ stable/8/sys/conf/files   Thu Feb 28 00:22:04 2013        (r247430)
    >> > @@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c           optional em | i
    >> >       compile-with "${NORMAL_C} -I$S/dev/e1000"
    >> >  dev/e1000/e1000_ich8lan.c    optional em | igb \
    >> >       compile-with "${NORMAL_C} -I$S/dev/e1000"
    >> > +dev/e1000/e1000_i210.c               optional em | igb \
    >> > +     compile-with "${NORMAL_C} -I$S/dev/e1000"
    >> >  dev/e1000/e1000_api.c                optional em | igb \
    >> >       compile-with "${NORMAL_C} -I$S/dev/e1000"
    >> >  dev/e1000/e1000_mac.c                optional em | igb \
    >> >
    >> > Modified: stable/8/sys/dev/e1000/e1000_82541.c
    >> >
    >> ==============================================================================
    >> > --- stable/8/sys/dev/e1000/e1000_82541.c      Thu Feb 28 00:18:56 2013
    >>        (r247429)
    >> > +++ stable/8/sys/dev/e1000/e1000_82541.c      Thu Feb 28 00:22:04 2013
    >>        (r247430)
    >> > @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st
    >> >        * of MAC speed/duplex configuration.  So we only need to
    >> >        * configure Collision Distance in the MAC.
    >> >        */
    >> > -     e1000_config_collision_dist_generic(hw);
    >> > +     mac->ops.config_collision_dist(hw);
    >> >
    >> >       /*
    >> >        * Configure Flow Control now that Auto-Neg has completed.
    >> >
    >> > Modified: stable/8/sys/dev/e1000/e1000_82543.c
    >> >
    >> ==============================================================================
    >> > --- stable/8/sys/dev/e1000/e1000_82543.c      Thu Feb 28 00:18:56 2013
    >>        (r247429)
    >> > +++ stable/8/sys/dev/e1000/e1000_82543.c      Thu Feb 28 00:22:04 2013
    >>        (r247430)
    >> > @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543
    >> >               DEBUGOUT("Valid link established!!!\n");
    >> >               /* Config the MAC and PHY after link is up */
    >> >               if (hw->mac.type == e1000_82544) {
    >> > -                     e1000_config_collision_dist_generic(hw);
    >> > +                     hw->mac.ops.config_collision_dist(hw);
    >> >               } else {
    >> >                       ret_val = e1000_config_mac_to_phy_82543(hw);
    >> >                       if (ret_val)
    >> > @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543(
    >> >       /* Take the link out of reset */
    >> >       ctrl &= ~E1000_CTRL_LRST;
    >> >
    >> > -     e1000_config_collision_dist_generic(hw);
    >> > +     hw->mac.ops.config_collision_dist(hw);
    >> >
    >> >       ret_val = e1000_commit_fc_settings_generic(hw);
    >> >       if (ret_val)
    >> > @@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8
    >> >        * settings.
    >> >        */
    >> >       if (mac->type == e1000_82544)
    >> > -             e1000_config_collision_dist_generic(hw);
    >> > +             hw->mac.ops.config_collision_dist(hw);
    >> >       else {
    >> >               ret_val = e1000_config_mac_to_phy_82543(hw);
    >> >               if (ret_val) {
    >> > @@ -1433,7 +1433,7 @@ static s32 e1000_config_mac_to_phy_82543
    >> >       if (phy_data & M88E1000_PSSR_DPLX)
    >> >               ctrl |= E1000_CTRL_FD;
    >> >
    >> > -     e1000_config_collision_dist_generic(hw);
    >> > +     hw->mac.ops.config_collision_dist(hw);
    >> >
    >> >       /*
    >> >        * Set up speed in the Device Control register depending on
    >> >
    >> > Modified: stable/8/sys/dev/e1000/e1000_82571.c
    >> >
    >> ==============================================================================
    >> > --- stable/8/sys/dev/e1000/e1000_82571.c      Thu Feb 28 00:18:56 2013
    >>        (r247429)
    >> > +++ stable/8/sys/dev/e1000/e1000_82571.c      Thu Feb 28 00:22:04 2013
    >>        (r247430)
    >> > @@ -1,6 +1,6 @@
    >> >
    >>  /******************************************************************************
    >> >
    >> > -  Copyright (c) 2001-2011, Intel Corporation
    >> > +  Copyright (c) 2001-2013, Intel Corporation
    >> >    All rights reserved.
    >> >
    >> >    Redistribution and use in source and binary forms, with or without
    >> > @@ -32,8 +32,7 @@
    >> >
    >>  ******************************************************************************/
    >> >  /*$FreeBSD$*/
    >> >
    >> > -/*
    >> > - * 82571EB Gigabit Ethernet Controller
    >> > +/* 82571EB Gigabit Ethernet Controller
    >> >   * 82571EB Gigabit Ethernet Controller (Copper)
    >> >   * 82571EB Gigabit Ethernet Controller (Fiber)
    >> >   * 82571EB Dual Port Gigabit Mezzanine Adapter
    >> > @@ -51,9 +50,6 @@
    >> >
    >> >  #include "e1000_api.h"
    >> >
    >> > -static s32  e1000_init_phy_params_82571(struct e1000_hw *hw);
    >> > -static s32  e1000_init_nvm_params_82571(struct e1000_hw *hw);
    >> > -static s32  e1000_init_mac_params_82571(struct e1000_hw *hw);
    >> >  static s32  e1000_acquire_nvm_82571(struct e1000_hw *hw);
    >> >  static void e1000_release_nvm_82571(struct e1000_hw *hw);
    >> >  static s32  e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset,
    >> > @@ -78,7 +74,6 @@ static s32  e1000_get_hw_semaphore_82571
    >> >  static s32  e1000_fix_nvm_checksum_82571(struct e1000_hw *hw);
    >> >  static s32  e1000_get_phy_id_82571(struct e1000_hw *hw);
    >> >  static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw);
    >> > -static s32  e1000_get_hw_semaphore_82573(struct e1000_hw *hw);
    >> >  static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw);
    >> >  static s32  e1000_get_hw_semaphore_82574(struct e1000_hw *hw);
    >> >  static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw);
    >> > @@ -99,13 +94,13 @@ static void e1000_power_down_phy_copper_
    >> >  static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
    >> >  {
    >> >       struct e1000_phy_info *phy = &hw->phy;
    >> > -     s32 ret_val = E1000_SUCCESS;
    >> > +     s32 ret_val;
    >> >
    >> >       DEBUGFUNC("e1000_init_phy_params_82571");
    >> >
    >> >       if (hw->phy.media_type != e1000_media_type_copper) {
    >> >               phy->type = e1000_phy_none;
    >> > -             goto out;
    >> > +             return E1000_SUCCESS;
    >> >       }
    >> >
    >> >       phy->addr                       = 1;
    >> > @@ -165,8 +160,7 @@ static s32 e1000_init_phy_params_82571(s
    >> >               phy->ops.set_d3_lplu_state =
    >> e1000_set_d3_lplu_state_82574;
    >> >               break;
    >> >       default:
    >> > -             ret_val = -E1000_ERR_PHY;
    >> > -             goto out;
    >> > +             return -E1000_ERR_PHY;
    >> >               break;
    >> >       }
    >> >
    >> > @@ -174,7 +168,7 @@ static s32 e1000_init_phy_params_82571(s
    >> >       ret_val = e1000_get_phy_id_82571(hw);
    >> >       if (ret_val) {
    >> >               DEBUGOUT("Error getting PHY ID\n");
    >> > -             goto out;
    >> > +             return ret_val;
    >> >       }
    >> >
    >> >       /* Verify phy id */
    >> > @@ -201,7 +195,6 @@ static s32 e1000_init_phy_params_82571(s
    >> >       if (ret_val)
    >> >               DEBUGOUT1("PHY ID unknown: type = 0x%08x\n", phy->id);
    >> >
    >> > -out:
    >> >       return ret_val;
    >> >  }
    >> >
    >> > @@ -241,8 +234,7 @@ static s32 e1000_init_nvm_params_82571(s
    >> >               if (((eecd >> 15) & 0x3) == 0x3) {
    >> >                       nvm->type = e1000_nvm_flash_hw;
    >> >                       nvm->word_size = 2048;
    >> > -                     /*
    >> > -                      * Autonomous Flash update bit must be cleared due
    >> > +                     /* Autonomous Flash update bit must be cleared due
    >> >                        * to Flash update issue.
    >> >                        */
    >> >                       eecd &= ~E1000_EECD_AUPDEN;
    >> > @@ -254,8 +246,7 @@ static s32 e1000_init_nvm_params_82571(s
    >> >               nvm->type = e1000_nvm_eeprom_spi;
    >> >               size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
    >> >                            E1000_EECD_SIZE_EX_SHIFT);
    >> > -             /*
    >> > -              * Added to a constant, "size" becomes the left-shift
    >> value
    >> > +             /* Added to a constant, "size" becomes the left-shift
    >> value
    >> >                * for setting word_size.
    >> >                */
    >> >               size += NVM_WORD_SIZE_BASE_SHIFT;
    >> > @@ -382,12 +373,11 @@ static s32 e1000_init_mac_params_82571(s
    >> >
    >> >               /* FWSM register */
    >> >               mac->has_fwsm = TRUE;
    >> > -             /*
    >> > -              * ARC supported; valid only if manageability features are
    >> > +             /* ARC supported; valid only if manageability features are
    >> >                * enabled.
    >> >                */
    >> > -             mac->arc_subsystem_valid = (E1000_READ_REG(hw,
    >> E1000_FWSM) &
    >> > -                                        E1000_FWSM_MODE_MASK) ? TRUE :
    >> FALSE;
    >> > +             mac->arc_subsystem_valid = !!(E1000_READ_REG(hw,
    >> E1000_FWSM) &
    >> > +                                           E1000_FWSM_MODE_MASK);
    >> >               break;
    >> >       case e1000_82574:
    >> >       case e1000_82583:
    >> > @@ -405,8 +395,7 @@ static s32 e1000_init_mac_params_82571(s
    >> >               break;
    >> >       }
    >> >
    >> > -     /*
    >> > -      * Ensure that the inter-port SWSM.SMBI lock bit is clear before
    >> > +     /* Ensure that the inter-port SWSM.SMBI lock bit is clear before
    >> >        * first NVM or PHY acess. This should be done for single-port
    >> >        * devices, and for one port only on dual-port devices so that
    >> >        * for those devices we can still use the SMBI lock to synchronize
    >> > @@ -422,8 +411,9 @@ static s32 e1000_init_mac_params_82571(s
    >> >                       E1000_WRITE_REG(hw, E1000_SWSM2, swsm2 |
    >> >                                       E1000_SWSM2_LOCK);
    >> >                       force_clear_smbi = TRUE;
    >> > -             } else
    >> > +             } else {
    >> >                       force_clear_smbi = FALSE;
    >> > +             }
    >> >               break;
    >> >       default:
    >> >               force_clear_smbi = TRUE;
    >> > @@ -443,10 +433,7 @@ static s32 e1000_init_mac_params_82571(s
    >> >               E1000_WRITE_REG(hw, E1000_SWSM, swsm & ~E1000_SWSM_SMBI);
    >> >       }
    >> >
    >> > -     /*
    >> > -      * Initialze device specific counter of SMBI acquisition
    >> > -      * timeouts.
    >> > -      */
    >> > +     /* Initialze device specific counter of SMBI acquisition
    >> timeouts. */
    >> >        hw->dev_spec._82571.smb_counter = 0;
    >> >
    >> >       return E1000_SUCCESS;
    >> > @@ -477,7 +464,7 @@ void e1000_init_function_pointers_82571(
    >> >  static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
    >> >  {
    >> >       struct e1000_phy_info *phy = &hw->phy;
    >> > -     s32 ret_val = E1000_SUCCESS;
    >> > +     s32 ret_val;
    >> >       u16 phy_id = 0;
    >> >
    >> >       DEBUGFUNC("e1000_get_phy_id_82571");
    >> > @@ -485,8 +472,7 @@ static s32 e1000_get_phy_id_82571(struct
    >> >       switch (hw->mac.type) {
    >> >       case e1000_82571:
    >> >       case e1000_82572:
    >> > -             /*
    >> > -              * The 82571 firmware may still be configuring the PHY.
    >> > +             /* The 82571 firmware may still be configuring the PHY.
    >> >                * In this case, we cannot access the PHY until the
    >> >                * configuration is done.  So we explicitly set the
    >> >                * PHY ID.
    >> > @@ -494,29 +480,29 @@ static s32 e1000_get_phy_id_82571(struct
    >> >               phy->id = IGP01E1000_I_PHY_ID;
    >> >               break;
    >> >       case e1000_82573:
    >> > -             ret_val = e1000_get_phy_id(hw);
    >> > +             return e1000_get_phy_id(hw);
    >> >               break;
    >> >       case e1000_82574:
    >> >       case e1000_82583:
    >> >               ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id);
    >> >               if (ret_val)
    >> > -                     goto out;
    >> > +                     return ret_val;
    >> >
    >> >               phy->id = (u32)(phy_id << 16);
    >> >               usec_delay(20);
    >> >               ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id);
    >> >               if (ret_val)
    >> > -                     goto out;
    >> > +                     return ret_val;
    >> >
    >> >               phy->id |= (u32)(phy_id);
    >> >               phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
    >> >               break;
    >> >       default:
    >> > -             ret_val = -E1000_ERR_PHY;
    >> > +             return -E1000_ERR_PHY;
    >> >               break;
    >> >       }
    >> > -out:
    >> > -     return ret_val;
    >> > +
    >> > +     return E1000_SUCCESS;
    >> >  }
    >> >
    >> >  /**
    >> > @@ -528,15 +514,13 @@ out:
    >> >  static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
    >> >  {
    >> >       u32 swsm;
    >> > -     s32 ret_val = E1000_SUCCESS;
    >> >       s32 sw_timeout = hw->nvm.word_size + 1;
    >> >       s32 fw_timeout = hw->nvm.word_size + 1;
    >> >       s32 i = 0;
    >> >
    >> >       DEBUGFUNC("e1000_get_hw_semaphore_82571");
    >> >
    >> > -     /*
    >> > -      * If we have timedout 3 times on trying to acquire
    >> > +     /* If we have timedout 3 times on trying to acquire
    >> >        * the inter-port SMBI semaphore, there is old code
    >> >        * operating on the other port, and it is not
    >> >        * releasing SMBI. Modify the number of times that
    >> > @@ -576,12 +560,10 @@ static s32 e1000_get_hw_semaphore_82571(
    >> >               /* Release semaphores */
    >> >               e1000_put_hw_semaphore_82571(hw);
    >> >               DEBUGOUT("Driver can't access the NVM\n");
    >> > -             ret_val = -E1000_ERR_NVM;
    >> > -             goto out;
    >> > +             return -E1000_ERR_NVM;
    >> >       }
    >> >
    >> > -out:
    >> > -     return ret_val;
    >> > +     return E1000_SUCCESS;
    >> >  }
    >> >
    >> >  /**
    >> > @@ -613,22 +595,19 @@ static void e1000_put_hw_semaphore_82571
    >> >  static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw)
    >> >  {
    >> >       u32 extcnf_ctrl;
    >> > -     s32 ret_val = E1000_SUCCESS;
    >> >       s32 i = 0;
    >> >
    >> >       DEBUGFUNC("e1000_get_hw_semaphore_82573");
    >> >
    >> >       extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL);
    >> > -     extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
    >> >       do {
    >> > +             extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
    >> >               E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl);
    >> >               extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL);
    >> >
    >> >               if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP)
    >> >                       break;
    >> >
    >> > -             extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
    >> > -
    >> >               msec_delay(2);
    >> >               i++;
    >> >       } while (i < MDIO_OWNERSHIP_TIMEOUT);
    >> > @@ -637,12 +616,10 @@ static s32 e1000_get_hw_semaphore_82573(
    >> >               /* Release semaphores */
    >> >               e1000_put_hw_semaphore_82573(hw);
    >> >               DEBUGOUT("Driver can't access the PHY\n");
    >> > -             ret_val = -E1000_ERR_PHY;
    >> > -             goto out;
    >> > +             return -E1000_ERR_PHY;
    >> >       }
    >> >
    >> > -out:
    >> > -     return ret_val;
    >> > +     return E1000_SUCCESS;
    >> >  }
    >> >
    >> >  /**
    >> > @@ -712,7 +689,7 @@ static void e1000_put_hw_semaphore_82574
    >> >   **/
    >> >  static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool
    >> active)
    >> >  {
    >> > -     u16 data = E1000_READ_REG(hw, E1000_POEMB);
    >> > +     u32 data = E1000_READ_REG(hw, E1000_POEMB);
    >> >
    >> >       DEBUGFUNC("e1000_set_d0_lplu_state_82574");
    >> >
    >> > @@ -738,7 +715,7 @@ static s32 e1000_set_d0_lplu_state_82574
    >> >   **/
    >> >  static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool
    >> active)
    >> >  {
    >> > -     u16 data = E1000_READ_REG(hw, E1000_POEMB);
    >> > +     u32 data = E1000_READ_REG(hw, E1000_POEMB);
    >> >
    >> >       DEBUGFUNC("e1000_set_d3_lplu_state_82574");
    >> >
    >> > @@ -771,7 +748,7 @@ static s32 e1000_acquire_nvm_82571(struc
    >> >
    >> >       ret_val = e1000_get_hw_semaphore_82571(hw);
    >> >       if (ret_val)
    >> > -             goto out;
    >> > +             return ret_val;
    >> >
    >> >       switch (hw->mac.type) {
    >> >       case e1000_82573:
    >> > @@ -784,7 +761,6 @@ static s32 e1000_acquire_nvm_82571(struc
    >> >       if (ret_val)
    >> >               e1000_put_hw_semaphore_82571(hw);
    >> >
    >> > -out:
    >> >       return ret_val;
    >> >  }
    >> >
    >> > @@ -817,7 +793,7 @@ static void e1000_release_nvm_82571(stru
    >> >  static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16
    >> words,
    >> >                                u16 *data)
    >> >  {
    >> > -     s32 ret_val = E1000_SUCCESS;
    >> > +     s32 ret_val;
    >> >
    >> >       DEBUGFUNC("e1000_write_nvm_82571");
    >> >
    >> > @@ -857,31 +833,27 @@ static s32 e1000_update_nvm_checksum_825
    >> >
    >> >       ret_val = e1000_update_nvm_checksum_generic(hw);
    >> >       if (ret_val)
    >> > -             goto out;
    >> > +             return ret_val;
    >> >
    >> > -     /*
    >> > -      * If our nvm is an EEPROM, then we're done
    >> > +     /* If our nvm is an EEPROM, then we're done
    >> >        * otherwise, commit the checksum to the flash NVM.
    >> >        */
    >> >       if (hw->nvm.type != e1000_nvm_flash_hw)
    >> > -             goto out;
    >> > +             return E1000_SUCCESS;
    >> >
    >> >       /* Check for pending operations. */
    >> >       for (i = 0; i < E1000_FLASH_UPDATES; i++) {
    >> >               msec_delay(1);
    >> > -             if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)
    >> == 0)
    >> > +             if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD))
    >> >                       break;
    >> >       }
    >> >
    >> > -     if (i == E1000_FLASH_UPDATES) {
    >> > -             ret_val = -E1000_ERR_NVM;
    >> > -             goto out;
    >> > -     }
    >> > +     if (i == E1000_FLASH_UPDATES)
    >> > +             return -E1000_ERR_NVM;
    >> >
    >> >       /* Reset the firmware if using STM opcode. */
    >> >       if ((E1000_READ_REG(hw, E1000_FLOP) & 0xFF00) ==
    >> E1000_STM_OPCODE) {
    >> > -             /*
    >> > -              * The enabling of and the actual reset must be done
    >> > +             /* The enabling of and the actual reset must be done
    >> >                * in two write cycles.
    >> >                */
    >> >               E1000_WRITE_REG(hw, E1000_HICR,
    >> E1000_HICR_FW_RESET_ENABLE);
    >> > @@ -895,17 +867,14 @@ static s32 e1000_update_nvm_checksum_825
    >> >
    >> >       for (i = 0; i < E1000_FLASH_UPDATES; i++) {
    >> >               msec_delay(1);
    >> > -             if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)
    >> == 0)
    >> > +             if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD))
    >> >                       break;
    >> >       }
    >> >
    >> > -     if (i == E1000_FLASH_UPDATES) {
    >> > -             ret_val = -E1000_ERR_NVM;
    >> > -             goto out;
    >> > -     }
    >> > +     if (i == E1000_FLASH_UPDATES)
    >> > +             return -E1000_ERR_NVM;
    >> >
    >> > -out:
    >> > -     return ret_val;
    >> > +     return E1000_SUCCESS;
    >> >  }
    >> >
    >> >  /**
    >> > @@ -944,19 +913,17 @@ static s32 e1000_write_nvm_eewr_82571(st
    >> >  {
    >> >       struct e1000_nvm_info *nvm = &hw->nvm;
    >> >       u32 i, eewr = 0;
    >> > -     s32 ret_val = 0;
    >> > +     s32 ret_val = E1000_SUCCESS;
    >> >
    >> >       DEBUGFUNC("e1000_write_nvm_eewr_82571");
    >> >
    >> > -     /*
    >> > -      * A check for invalid values:  offset too large, too many words,
    >> > +     /* A check for invalid values:  offset too large, too many words,
    >> >        * and not enough words.
    >> >        */
    >> >       if ((offset >= nvm->word_size) || (words > (nvm->word_size -
    >> offset)) ||
    >> >           (words == 0)) {
    >> >               DEBUGOUT("nvm parameter(s) out of bounds\n");
    >> > -             ret_val = -E1000_ERR_NVM;
    >> > -             goto out;
    >> > +             return -E1000_ERR_NVM;
    >> >       }
    >> >
    >> >       for (i = 0; i < words; i++) {
    >> > @@ -975,7 +942,6 @@ static s32 e1000_write_nvm_eewr_82571(st
    >> >                       break;
    >> >       }
    >> >
    >> > -out:
    >> >       return ret_val;
    >> >  }
    >> >
    >> > @@ -988,7 +954,6 @@ out:
    >> >  static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)
    >> >  {
    >> >       s32 timeout = PHY_CFG_TIMEOUT;
    >> > -     s32 ret_val = E1000_SUCCESS;
    >> >
    >> >       DEBUGFUNC("e1000_get_cfg_done_82571");
    >> >
    >> > @@ -1001,12 +966,10 @@ static s32 e1000_get_cfg_done_82571(stru
    >> >       }
    >> >       if (!timeout) {
    >> >               DEBUGOUT("MNG configuration cycle has not completed.\n");
    >> > -             ret_val = -E1000_ERR_RESET;
    >> > -             goto out;
    >> > +             return -E1000_ERR_RESET;
    >> >       }
    >> >
    >> > -out:
    >> > -     return ret_val;
    >> > +     return E1000_SUCCESS;
    >> >  }
    >> >
    >> >  /**
    >> > @@ -1023,39 +986,40 @@ out:
    >> >  static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool
    >> active)
    >> >  {
    >> >       struct e1000_phy_info *phy = &hw->phy;
    >> > -     s32 ret_val = E1000_SUCCESS;
    >> > +     s32 ret_val;
    >> >       u16 data;
    >> >
    >> >       DEBUGFUNC("e1000_set_d0_lplu_state_82571");
    >> >
    >> >       if (!(phy->ops.read_reg))
    >> > -             goto out;
    >> > +             return E1000_SUCCESS;
    >> >
    >> >       ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data);
    >> >       if (ret_val)
    >> > -             goto out;
    >> > +             return ret_val;
    >> >
    >> >       if (active) {
    >> >               data |= IGP02E1000_PM_D0_LPLU;
    >> >               ret_val = phy->ops.write_reg(hw,
    >> IGP02E1000_PHY_POWER_MGMT,
    >> >                                            data);
    >> >               if (ret_val)
    >> > -                     goto out;
    >> > +                     return ret_val;
    >> >
    >> >               /* When LPLU is enabled, we should disable SmartSpeed */
    >> >               ret_val = phy->ops.read_reg(hw,
    >> IGP01E1000_PHY_PORT_CONFIG,
    >> >                                           &data);
    >> > +             if (ret_val)
    >> > +                     return ret_val;
    >> >               data &= ~IGP01E1000_PSCFR_SMART_SPEED;
    >> >               ret_val = phy->ops.write_reg(hw,
    >> IGP01E1000_PHY_PORT_CONFIG,
    >> >                                            data);
    >> >               if (ret_val)
    >> > -                     goto out;
    >> > +                     return ret_val;
    >> >       } else {
    >> >               data &= ~IGP02E1000_PM_D0_LPLU;
    >> >               ret_val = phy->ops.write_reg(hw,
    >> IGP02E1000_PHY_POWER_MGMT,
    >> >                                            data);
    >> > -             /*
    >> > -              * LPLU and SmartSpeed are mutually exclusive.  LPLU is
    >> used
    >> > +             /* LPLU and SmartSpeed are mutually exclusive.  LPLU is
    >> used
    >> >                * during Dx states where the power conservation is most
    >> >                * important.  During driver activity we should enable
    >> >                * SmartSpeed, so performance is maintained.
    >> > @@ -1065,32 +1029,31 @@ static s32 e1000_set_d0_lplu_state_82571
    >> >
    >> IGP01E1000_PHY_PORT_CONFIG,
    >> >                                                   &data);
    >> >                       if (ret_val)
    >> > -                             goto out;
    >> > +                             return ret_val;
    >> >
    >> >                       data |= IGP01E1000_PSCFR_SMART_SPEED;
    >> >                       ret_val = phy->ops.write_reg(hw,
    >> >
    >>  IGP01E1000_PHY_PORT_CONFIG,
    >> >                                                    data);
    >> >                       if (ret_val)
    >> > -                             goto out;
    >> > +                             return ret_val;
    >> >               } else if (phy->smart_speed == e1000_smart_speed_off) {
    >> >                       ret_val = phy->ops.read_reg(hw,
    >> >
    >> IGP01E1000_PHY_PORT_CONFIG,
    >> >                                                   &data);
    >> >                       if (ret_val)
    >> > -                             goto out;
    >> > +                             return ret_val;
    >> >
    >> >                       data &= ~IGP01E1000_PSCFR_SMART_SPEED;
    >> >                       ret_val = phy->ops.write_reg(hw,
    >> >
    >>  IGP01E1000_PHY_PORT_CONFIG,
    >> >                                                    data);
    >> >                       if (ret_val)
    >> > -                             goto out;
    >> > +                             return ret_val;
    >> >               }
    >> >       }
    >> >
    >> > -out:
    >> > -     return ret_val;
    >> > +     return E1000_SUCCESS;
    >> >  }
    >> >
    >> >  /**
    >> > @@ -1101,13 +1064,12 @@ out:
    >> >   **/
    >> >  static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
    >> >  {
    >> > -     u32 ctrl, ctrl_ext;
    >> > +     u32 ctrl, ctrl_ext, eecd, tctl;
    >> >       s32 ret_val;
    >> >
    >> >       DEBUGFUNC("e1000_reset_hw_82571");
    >> >
    >> > -     /*
    >> > -      * Prevent the PCI-E bus from sticking if there is no TLP
    >> connection
    >> > +     /* Prevent the PCI-E bus from sticking if there is no TLP
    >> connection
    >> >        * on the last TLP read/write transaction when MAC is reset.
    >> >        */
    >> >       ret_val = e1000_disable_pcie_master_generic(hw);
    >> > @@ -1118,13 +1080,14 @@ static s32 e1000_reset_hw_82571(struct e
    >> >       E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
    >> >
    >> >       E1000_WRITE_REG(hw, E1000_RCTL, 0);
    >> > -     E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP);
    >> > +     tctl = E1000_READ_REG(hw, E1000_TCTL);
    >> > +     tctl &= ~E1000_TCTL_EN;
    >> > +     E1000_WRITE_REG(hw, E1000_TCTL, tctl);
    >> >       E1000_WRITE_FLUSH(hw);
    >> >
    >> >       msec_delay(10);
    >> >
    >> > -     /*
    >> > -      * Must acquire the MDIO ownership before MAC reset.
    >> > +     /* Must acquire the MDIO ownership before MAC reset.
    >> >        * Ownership defaults to firmware after a reset.
    >> >        */
    >> >       switch (hw->mac.type) {
    >> > @@ -1167,15 +1130,23 @@ static s32 e1000_reset_hw_82571(struct e
    >> >       ret_val = e1000_get_auto_rd_done_generic(hw);
    >> >       if (ret_val)
    >> >               /* We don't want to continue accessing MAC registers. */
    >> > -             goto out;
    >> > +             return ret_val;
    >> >
    >> > -     /*
    >> > -      * Phy configuration from NVM just starts after EECD_AUTO_RD is
    >> set.
    >> > +     /* Phy configuration from NVM just starts after EECD_AUTO_RD is
    >> set.
    >> >        * Need to wait for Phy configuration completion before accessing
    >> >        * NVM and Phy.
    >> >        */
    >> >
    >> >       switch (hw->mac.type) {
    >> > +     case e1000_82571:
    >> > +     case e1000_82572:
    >> > +             /* REQ and GNT bits need to be cleared when using AUTO_RD
    >> > +              * to access the EEPROM.
    >> > +              */
    >> > +             eecd = E1000_READ_REG(hw, E1000_EECD);
    >> > +             eecd &= ~(E1000_EECD_REQ | E1000_EECD_GNT);
    >> > +             E1000_WRITE_REG(hw, E1000_EECD, eecd);
    >> > +             break;
    >> >       case e1000_82573:
    >> >       case e1000_82574:
    >> >       case e1000_82583:
    >> > @@ -1193,7 +1164,7 @@ static s32 e1000_reset_hw_82571(struct e
    >> >               /* Install any alternate MAC address into RAR0 */
    >> >               ret_val = e1000_check_alt_mac_addr_generic(hw);
    >> >               if (ret_val)
    >> > -                     goto out;
    >> > +                     return ret_val;
    >> >
    >> >               e1000_set_laa_state_82571(hw, TRUE);
    >> >       }
    >> > @@ -1202,8 +1173,7 @@ static s32 e1000_reset_hw_82571(struct e
    >> >       if (hw->phy.media_type == e1000_media_type_internal_serdes)
    >> >               hw->mac.serdes_link_state = e1000_serdes_link_down;
    >> >
    >> > -out:
    >> > -     return ret_val;
    >> > +     return E1000_SUCCESS;
    >> >  }
    >> >
    >> >  /**
    >> > @@ -1225,16 +1195,15 @@ static s32 e1000_init_hw_82571(struct e1
    >> >
    >> >       /* Initialize identification LED */
    >> >       ret_val = mac->ops.id_led_init(hw);
    >> > +     /* An error is not fatal and we should not stop init due to this
    >> */
    >> >       if (ret_val)
    >> >               DEBUGOUT("Error initializing identification LED\n");
    >> > -             /* This is not fatal and we should not stop init due to
    >> this */
    >> >
    >> >       /* Disabling VLAN filtering */
    >> >       DEBUGOUT("Initializing the IEEE VLAN\n");
    >> >       mac->ops.clear_vfta(hw);
    >> >
    >> > -     /* Setup the receive address. */
    >> > -     /*
    >> > +     /* Setup the receive address.
    >> >        * If, however, a locally administered address was assigned to the
    >> >        * 82571, we must reserve a RAR for it to work around an issue
    >> where
    >> >        * resetting one port will reload the MAC on the other port.
    >> > @@ -1277,8 +1246,7 @@ static s32 e1000_init_hw_82571(struct e1
    >> >               break;
    >> >       }
    >> >
    >> > -     /*
    >> > -      * Clear all of the statistics registers (clear on read).  It is
    >> > +     /* Clear all of the statistics registers (clear on read).  It is
    >> >        * important that we do this after we have tried to establish link
    >> >        * because the symbol error count will increment wildly if there
    >> >        * is no link.
    >> > @@ -1377,8 +1345,7 @@ static void e1000_initialize_hw_bits_825
    >> >               E1000_WRITE_REG(hw, E1000_PBA_ECC, reg);
    >> >       }
    >> >
    >> > -     /*
    >> > -      * Workaround for hardware errata.
    >> > +     /* Workaround for hardware errata.
    >> >        * Ensure that DMA Dynamic Clock gating is disabled on 82571 and
    >> 82572
    >> >        */
    >> >       if ((hw->mac.type == e1000_82571) ||
    >> > @@ -1388,6 +1355,15 @@ static void e1000_initialize_hw_bits_825
    >> >               E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg);
    >> >       }
    >> >
    >> > +     /* Disable IPv6 extension header parsing because some malformed
    >> > +      * IPv6 headers can hang the Rx.
    >> > +      */
    >> > +     if (hw->mac.type <= e1000_82573) {
    >> > +             reg = E1000_READ_REG(hw, E1000_RFCTL);
    >> > +             reg |= (E1000_RFCTL_IPV6_EX_DIS |
    >> E1000_RFCTL_NEW_IPV6_EXT_DIS);
    >> > +             E1000_WRITE_REG(hw, E1000_RFCTL, reg);
    >> > +     }
    >> > +
    >> >       /* PCI-Ex Control Registers */
    >> >       switch (hw->mac.type) {
    >> >       case e1000_82574:
    >> > @@ -1396,8 +1372,7 @@ static void e1000_initialize_hw_bits_825
    >> >               reg |= (1 << 22);
    >> >               E1000_WRITE_REG(hw, E1000_GCR, reg);
    >> >
    >> > -             /*
    >> > -              * Workaround for hardware errata.
    >> > +             /* Workaround for hardware errata.
    >> >                * apply workaround for hardware errata documented in
    >> errata
    >> >                * docs Fixes issue where some error prone or unreliable
    >> PCIe
    >> >                * completions are occurring, particularly with ASPM
    >> enabled.
    >> > @@ -1435,25 +1410,25 @@ static void e1000_clear_vfta_82571(struc
    >> >       case e1000_82574:
    >> >       case e1000_82583:
    >> >               if (hw->mng_cookie.vlan_id != 0) {
    >> > -                     /*
    >> > -                      * The VFTA is a 4096b bit-field, each identifying
    >> > +                     /* The VFTA is a 4096b bit-field, each identifying
    >> >                        * a single VLAN ID.  The following operations
    >> >                        * determine which 32b entry (i.e. offset) into
    >> the
    >> >                        * array we want to set the VLAN ID (i.e. bit) of
    >> >                        * the manageability unit.
    >> >                        */
    >> >                       vfta_offset = (hw->mng_cookie.vlan_id >>
    >> > -                             E1000_VFTA_ENTRY_SHIFT) &
    >> E1000_VFTA_ENTRY_MASK;
    >> > -                     vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id &
    >> > -                             E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
    >> > +                                    E1000_VFTA_ENTRY_SHIFT) &
    >> > +                         E1000_VFTA_ENTRY_MASK;
    >> > +                     vfta_bit_in_reg =
    >> > +                         1 << (hw->mng_cookie.vlan_id &
    >> > +                               E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
    >> >               }
    >> >               break;
    >> >       default:
    >> >               break;
    >> >       }
    >> >       for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) {
    >> > -             /*
    >> > -              * If the offset we want to clear is the same offset of
    >> the
    >> > +             /* If the offset we want to clear is the same offset of
    >> the
    >> >                * manageability VLAN ID, then clear all bits except that
    >> of
    >> >                * the manageability unit.
    >> >                */
    >> > @@ -1495,8 +1470,7 @@ static s32 e1000_led_on_82574(struct e10
    >> >
    >> >       ctrl = hw->mac.ledctl_mode2;
    >> >       if (!(E1000_STATUS_LU & E1000_READ_REG(hw, E1000_STATUS))) {
    >> > -             /*
    >> > -              * If no link, then turn LED on by setting the invert bit
    >> > +             /* If no link, then turn LED on by setting the invert bit
    >> >                * for each LED that's "on" (0x0E) in ledctl_mode2.
    >> >                */
    >> >               for (i = 0; i < 4; i++)
    >> > @@ -1519,30 +1493,28 @@ bool e1000_check_phy_82574(struct e1000_
    >> >  {
    >> >       u16 status_1kbt = 0;
    >> >       u16 receive_errors = 0;
    >> > -     bool phy_hung = FALSE;
    >> > -     s32 ret_val = E1000_SUCCESS;
    >> > +     s32 ret_val;
    >> >
    >> >       DEBUGFUNC("e1000_check_phy_82574");
    >> >
    >> > -     /*
    >> > -      * Read PHY Receive Error counter first, if its is max - all F's
    >> then
    >> > +     /* Read PHY Receive Error counter first, if its is max - all F's
    >> then
    >> >        * read the Base1000T status register If both are max then PHY is
    >> hung.
    >> >        */
    >> >       ret_val = hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER,
    >> >                                      &receive_errors);
    >> >       if (ret_val)
    >> > -             goto out;
    >> > +             return FALSE;
    >> >       if (receive_errors == E1000_RECEIVE_ERROR_MAX) {
    >> >               ret_val = hw->phy.ops.read_reg(hw, E1000_BASE1000T_STATUS,
    >> >                                              &status_1kbt);
    >> >               if (ret_val)
    >> > -                     goto out;
    >> > +                     return FALSE;
    >> >               if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) ==
    >> >                   E1000_IDLE_ERROR_COUNT_MASK)
    >> > -                     phy_hung = TRUE;
    >> > +                     return TRUE;
    >> >       }
    >> > -out:
    >> > -     return phy_hung;
    >> > +
    >> > +     return FALSE;
    >> >  }
    >> >
    >> >
    >> > @@ -1560,8 +1532,7 @@ static s32 e1000_setup_link_82571(struct
    >> >  {
    >> >       DEBUGFUNC("e1000_setup_link_82571");
    >> >
    >> > -     /*
    >> > -      * 82573 does not have a word in the NVM to determine
    >> > +     /* 82573 does not have a word in the NVM to determine
    >> >        * the default flow control setting, so we explicitly
    >> >        * set it to full.
    >> >        */
    >> > @@ -1608,17 +1579,14 @@ static s32 e1000_setup_copper_link_82571
    >> >               ret_val = e1000_copper_link_setup_igp(hw);
    >> >               break;
    >> >       default:
    >> > -             ret_val = -E1000_ERR_PHY;
    >> > +             return -E1000_ERR_PHY;
    >> >               break;
    >> >       }
    >> >
    >> >       if (ret_val)
    >> > -             goto out;
    >> > -
    >> > -     ret_val = e1000_setup_copper_link_generic(hw);
    >> > +             return ret_val;
    >> >
    >> > -out:
    >> > -     return ret_val;
    >> > +     return e1000_setup_copper_link_generic(hw);
    >> >  }
    >> >
    >> >  /**
    >> > @@ -1635,8 +1603,7 @@ static s32 e1000_setup_fiber_serdes_link
    >> >       switch (hw->mac.type) {
    >> >       case e1000_82571:
    >> >       case e1000_82572:
    >> > -             /*
    >> > -              * If SerDes loopback mode is entered, there is no form
    >> > +             /* If SerDes loopback mode is entered, there is no form
    >> >                * of reset to take the adapter out of that mode.  So we
    >> >                * have to explicitly take the adapter out of loopback
    >> >                * mode.  This prevents drivers from twiddling their
    >> thumbs
    >> > @@ -1685,16 +1652,17 @@ static s32 e1000_check_for_serdes_link_8
    >> >
    >> >       ctrl = E1000_READ_REG(hw, E1000_CTRL);
    >> >       status = E1000_READ_REG(hw, E1000_STATUS);
    >> > +     E1000_READ_REG(hw, E1000_RXCW);
    >> > +     /* SYNCH bit and IV bit are sticky */
    >> > +     usec_delay(10);
    >> >       rxcw = E1000_READ_REG(hw, E1000_RXCW);
    >> >
    >> >       if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) {
    >> > -
    >> >               /* Receiver is synchronized with no invalid bits.  */
    >> >               switch (mac->serdes_link_state) {
    >> >               case e1000_serdes_link_autoneg_complete:
    >> >                       if (!(status & E1000_STATUS_LU)) {
    >> > -                             /*
    >> > -                              * We have lost link, retry autoneg before
    >> > +                             /* We have lost link, retry autoneg before
    >> >                                * reporting link failure
    >> >                                */
    >> >                               mac->serdes_link_state =
    >> > @@ -1707,15 +1675,12 @@ static s32 e1000_check_for_serdes_link_8
    >> >                       break;
    >> >
    >> >               case e1000_serdes_link_forced_up:
    >> > -                     /*
    >> > -                      * If we are receiving /C/ ordered sets, re-enable
    >> > +                     /* If we are receiving /C/ ordered sets, re-enable
    >> >                        * auto-negotiation in the TXCW register and
    >> disable
    >> >                        * forced link in the Device Control register in
    >> an
    >> >                        * attempt to auto-negotiate with our link
    >> partner.
    >> > -                      * If the partner code word is null, stop forcing
    >> > -                      * and restart auto negotiation.
    >> >                        */
    >> > -                     if ((rxcw & E1000_RXCW_C) || !(rxcw &
    >> E1000_RXCW_CW))  {
    >> > +                     if (rxcw & E1000_RXCW_C) {
    >> >                               /* Enable autoneg, and unforce link up */
    >> >                               E1000_WRITE_REG(hw, E1000_TXCW,
    >> mac->txcw);
    >> >                               E1000_WRITE_REG(hw, E1000_CTRL,
    >> > @@ -1731,8 +1696,7 @@ static s32 e1000_check_for_serdes_link_8
    >> >
    >> >               case e1000_serdes_link_autoneg_progress:
    >> >                       if (rxcw & E1000_RXCW_C) {
    >> > -                             /*
    >> > -                              * We received /C/ ordered sets, meaning
    >> the
    >> > +                             /* We received /C/ ordered sets, meaning
    >> the
    >> >                                * link partner has autonegotiated, and
    >> we can
    >> >                                * trust the Link Up (LU) status bit.
    >> >                                */
    >> > @@ -1748,8 +1712,7 @@ static s32 e1000_check_for_serdes_link_8
    >> >                                       DEBUGOUT("AN_PROG   -> DOWN\n");
    >> >                               }
    >> >                       } else {
    >> > -                             /*
    >> > -                              * The link partner did not autoneg.
    >> > +                             /* The link partner did not autoneg.
    >> >                                * Force link up and full duplex, and
    >> change
    >> >                                * state to forced.
    >> >                                */
    >> > @@ -1774,8 +1737,7 @@ static s32 e1000_check_for_serdes_link_8
    >> >
    >> >               case e1000_serdes_link_down:
    >> >               default:
    >> > -                     /*
    >> > -                      * The link was down but the receiver has now
    >> gained
    >> > +                     /* The link was down but the receiver has now
    >> gained
    >> >                        * valid sync, so lets see if we can bring the
    >> link
    >> >                        * up.
    >> >                        */
    >> > @@ -1794,17 +1756,18 @@ static s32 e1000_check_for_serdes_link_8
    >> >                       mac->serdes_link_state = e1000_serdes_link_down;
    >> >                       DEBUGOUT("ANYSTATE  -> DOWN\n");
    >> >               } else {
    >> > -                     /*
    >> > -                      * Check several times, if Sync and Config
    >> > -                      * both are consistently 1 then simply ignore
    >> > -                      * the Invalid bit and restart Autoneg
    >> > +                     /* Check several times, if SYNCH bit and CONFIG
    >> > +                      * bit both are consistently 1 then simply ignore
    >> > +                      * the IV bit and restart Autoneg
    >> >                        */
    >> >                       for (i = 0; i < AN_RETRY_COUNT; i++) {
    >> >                               usec_delay(10);
    >> >                               rxcw = E1000_READ_REG(hw, E1000_RXCW);
    >> > -                             if ((rxcw & E1000_RXCW_IV) &&
    >> > -                                 !((rxcw & E1000_RXCW_SYNCH) &&
    >> > -                                   (rxcw & E1000_RXCW_C))) {
    >> > +                             if ((rxcw & E1000_RXCW_SYNCH) &&
    >> > +                                 (rxcw & E1000_RXCW_C))
    >> > +                                     continue;
    >> > +
    >> > +                             if (rxcw & E1000_RXCW_IV) {
    >> >                                       mac->serdes_has_link = FALSE;
    >> >                                       mac->serdes_link_state =
    >> >
    >> e1000_serdes_link_down;
    >> > @@ -1845,7 +1808,7 @@ static s32 e1000_valid_led_default_82571
    >> >       ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data);
    >> >       if (ret_val) {
    >> >               DEBUGOUT("NVM Read Error\n");
    >> > -             goto out;
    >> > +             return ret_val;
    >> >       }
    >> >
    >> >       switch (hw->mac.type) {
    >> > @@ -1862,8 +1825,7 @@ static s32 e1000_valid_led_default_82571
    >> >               break;
    >> >       }
    >> >
    >> > -out:
    >> > -     return ret_val;
    >> > +     return E1000_SUCCESS;
    >> >  }
    >> >
    >> >  /**
    >> > @@ -1900,15 +1862,14 @@ void e1000_set_laa_state_82571(struct e1
    >> >
    >> >       /* If workaround is activated... */
    >> >       if (state)
    >> > -             /*
    >> > -              * Hold a copy of the LAA in RAR[14] This is done so that
    >> > +             /* Hold a copy of the LAA in RAR[14] This is done so that
    >> >                * between the time RAR[0] gets clobbered and the time it
    >> >                * gets fixed, the actual LAA is in one of the RARs and no
    >> >                * incoming packets directed to this port are dropped.
    >> >                * Eventually the LAA will be in RAR[0] and RAR[14].
    >> >                */
    >> > -             e1000_rar_set_generic(hw, hw->mac.addr,
    >> > -                                   hw->mac.rar_entry_count - 1);
    >> > +             hw->mac.ops.rar_set(hw, hw->mac.addr,
    >> > +                                 hw->mac.rar_entry_count - 1);
    >> >       return;
    >> >  }
    >> >
    >> > @@ -1925,25 +1886,23 @@ void e1000_set_laa_state_82571(struct e1
    >> >  static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
    >> >  {
    >> >       struct e1000_nvm_info *nvm = &hw->nvm;
    >> > -     s32 ret_val = E1000_SUCCESS;
    >> > +     s32 ret_val;
    >> >       u16 data;
    >> >
    >> >       DEBUGFUNC("e1000_fix_nvm_checksum_82571");
    >> >
    >> >       if (nvm->type != e1000_nvm_flash_hw)
    >> > -             goto out;
    >> > +             return E1000_SUCCESS;
    >> >
    >> > -     /*
    >> > -      * Check bit 4 of word 10h.  If it is 0, firmware is done updating
    >> > +     /* Check bit 4 of word 10h.  If it is 0, firmware is done updating
    >> >        * 10h-12h.  Checksum may need to be fixed.
    >> >        */
    >> >
    >> > *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    >> > _______________________________________________
    >> > svn-src-stable-8@freebsd.org mailing list
    >> > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8
    >> > To unsubscribe, send any mail to "
    >> svn-src-stable-8-unsubscribe@freebsd.org"
    >>
    >
    >
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 05:47:54 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id B9075E4A;
     Thu, 28 Feb 2013 05:47:54 +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 95EBAC47;
     Thu, 28 Feb 2013 05:47:54 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S5ls9T064455;
     Thu, 28 Feb 2013 05:47:54 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S5loBf064426;
     Thu, 28 Feb 2013 05:47:50 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201302280547.r1S5loBf064426@svn.freebsd.org>
    From: Xin LI 
    Date: Thu, 28 Feb 2013 05:47:50 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247448 - stable/8/contrib/bzip2
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 05:47:54 -0000
    
    Author: delphij
    Date: Thu Feb 28 05:47:50 2013
    New Revision: 247448
    URL: http://svnweb.freebsd.org/changeset/base/247448
    
    Log:
      MFC r215041 (obrien):
      
      Upgrade to bzip2 version 1.0.6.
    
    Modified:
      stable/8/contrib/bzip2/CHANGES
      stable/8/contrib/bzip2/LICENSE
      stable/8/contrib/bzip2/Makefile
      stable/8/contrib/bzip2/Makefile-libbz2_so
      stable/8/contrib/bzip2/README
      stable/8/contrib/bzip2/README.COMPILATION.PROBLEMS
      stable/8/contrib/bzip2/blocksort.c
      stable/8/contrib/bzip2/bzip2.1
      stable/8/contrib/bzip2/bzip2.c
      stable/8/contrib/bzip2/bzip2recover.c
      stable/8/contrib/bzip2/bzlib.c
      stable/8/contrib/bzip2/bzlib.h
      stable/8/contrib/bzip2/bzlib_private.h
      stable/8/contrib/bzip2/compress.c
      stable/8/contrib/bzip2/crctable.c
      stable/8/contrib/bzip2/decompress.c
      stable/8/contrib/bzip2/huffman.c
      stable/8/contrib/bzip2/randtable.c
      stable/8/contrib/bzip2/spewG.c
      stable/8/contrib/bzip2/unzcrash.c
    Directory Properties:
      stable/8/contrib/bzip2/   (props changed)
    
    Modified: stable/8/contrib/bzip2/CHANGES
    ==============================================================================
    --- stable/8/contrib/bzip2/CHANGES	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/CHANGES	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -2,8 +2,8 @@
      This file is part of bzip2/libbzip2, a program and library for
      lossless, block-sorting data compression.
     
    - bzip2/libbzip2 version 1.0.5 of 10 December 2007
    - Copyright (C) 1996-2007 Julian Seward 
    + bzip2/libbzip2 version 1.0.6 of 6 September 2010
    + Copyright (C) 1996-2010 Julian Seward 
     
      Please read the WARNING, DISCLAIMER and PATENTS sections in the 
      README file.
    @@ -317,3 +317,11 @@ Fixes some minor bugs since the last ver
     ~~~~~~~~~~~~~~~~~
     Security fix only.  Fixes CERT-FI 20469 as it applies to bzip2.
     
    +
    +1.0.6 (6 Sept 10)
    +~~~~~~~~~~~~~~~~~
    +
    +* Security fix for CVE-2010-0405.  This was reported by Mikolaj
    +  Izdebski.
    +
    +* Make the documentation build on Ubuntu 10.04
    
    Modified: stable/8/contrib/bzip2/LICENSE
    ==============================================================================
    --- stable/8/contrib/bzip2/LICENSE	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/LICENSE	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -2,7 +2,7 @@
     --------------------------------------------------------------------------
     
     This program, "bzip2", the associated library "libbzip2", and all
    -documentation, are copyright (C) 1996-2007 Julian R Seward.  All
    +documentation, are copyright (C) 1996-2010 Julian R Seward.  All
     rights reserved.
     
     Redistribution and use in source and binary forms, with or without
    @@ -37,6 +37,6 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY 
     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     
     Julian Seward, jseward@bzip.org
    -bzip2/libbzip2 version 1.0.5 of 10 December 2007
    +bzip2/libbzip2 version 1.0.6 of 6 September 2010
     
     --------------------------------------------------------------------------
    
    Modified: stable/8/contrib/bzip2/Makefile
    ==============================================================================
    --- stable/8/contrib/bzip2/Makefile	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/Makefile	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -2,8 +2,8 @@
     # This file is part of bzip2/libbzip2, a program and library for
     # lossless, block-sorting data compression.
     #
    -# bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -# Copyright (C) 1996-2007 Julian Seward 
    +# bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +# Copyright (C) 1996-2010 Julian Seward 
     #
     # Please read the WARNING, DISCLAIMER and PATENTS sections in the 
     # README file.
    @@ -137,7 +137,7 @@ bzip2recover.o: bzip2recover.c
     distclean: clean
     	rm -f manual.ps manual.html manual.pdf
     
    -DISTNAME=bzip2-1.0.5
    +DISTNAME=bzip2-1.0.6
     dist: check manual
     	rm -f $(DISTNAME)
     	ln -s -f . $(DISTNAME)
    
    Modified: stable/8/contrib/bzip2/Makefile-libbz2_so
    ==============================================================================
    --- stable/8/contrib/bzip2/Makefile-libbz2_so	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/Makefile-libbz2_so	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -1,6 +1,6 @@
     
     # This Makefile builds a shared version of the library, 
    -# libbz2.so.1.0.4, with soname libbz2.so.1.0,
    +# libbz2.so.1.0.6, with soname libbz2.so.1.0,
     # at least on x86-Linux (RedHat 7.2), 
     # with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98).  
     # Please see the README file for some important info 
    @@ -10,8 +10,8 @@
     # This file is part of bzip2/libbzip2, a program and library for
     # lossless, block-sorting data compression.
     #
    -# bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -# Copyright (C) 1996-2007 Julian Seward 
    +# bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +# Copyright (C) 1996-2010 Julian Seward 
     #
     # Please read the WARNING, DISCLAIMER and PATENTS sections in the 
     # README file.
    @@ -35,13 +35,13 @@ OBJS= blocksort.o  \
           bzlib.o
     
     all: $(OBJS)
    -	$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.4 $(OBJS)
    -	$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.4
    +	$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
    +	$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
     	rm -f libbz2.so.1.0
    -	ln -s libbz2.so.1.0.4 libbz2.so.1.0
    +	ln -s libbz2.so.1.0.6 libbz2.so.1.0
     
     clean: 
    -	rm -f $(OBJS) bzip2.o libbz2.so.1.0.4 libbz2.so.1.0 bzip2-shared
    +	rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared
     
     blocksort.o: blocksort.c
     	$(CC) $(CFLAGS) -c blocksort.c
    
    Modified: stable/8/contrib/bzip2/README
    ==============================================================================
    --- stable/8/contrib/bzip2/README	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/README	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -6,8 +6,8 @@ This version is fully compatible with th
     This file is part of bzip2/libbzip2, a program and library for
     lossless, block-sorting data compression.
     
    -bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -Copyright (C) 1996-2007 Julian Seward 
    +bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +Copyright (C) 1996-2010 Julian Seward 
     
     Please read the WARNING, DISCLAIMER and PATENTS sections in this file.
     
    @@ -181,6 +181,10 @@ WHAT'S NEW IN 1.0.5 ?
     
        See the CHANGES file.
     
    +WHAT'S NEW IN 1.0.6 ?
    +
    +   See the CHANGES file.
    +
     
     I hope you find bzip2 useful.  Feel free to contact me at
        jseward@bzip.org
    @@ -208,3 +212,4 @@ Cambridge, UK.
     15 February 2005 (bzip2, version 1.0.3)
     20 December 2006 (bzip2, version 1.0.4)
     10 December 2007 (bzip2, version 1.0.5)
    + 6     Sept 2010 (bzip2, version 1.0.6)
    
    Modified: stable/8/contrib/bzip2/README.COMPILATION.PROBLEMS
    ==============================================================================
    --- stable/8/contrib/bzip2/README.COMPILATION.PROBLEMS	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/README.COMPILATION.PROBLEMS	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -2,8 +2,8 @@
     This file is part of bzip2/libbzip2, a program and library for
     lossless, block-sorting data compression.
     
    -bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -Copyright (C) 1996-2007 Julian Seward 
    +bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +Copyright (C) 1996-2010 Julian Seward 
     
     Please read the WARNING, DISCLAIMER and PATENTS sections in the 
     README file.
    @@ -12,7 +12,7 @@ This program is released under the terms
     in the file LICENSE.
     ------------------------------------------------------------------
     
    -bzip2-1.0.5 should compile without problems on the vast majority of
    +bzip2-1.0.6 should compile without problems on the vast majority of
     platforms.  Using the supplied Makefile, I've built and tested it
     myself for x86-linux and amd64-linux.  With makefile.msc, Visual C++
     6.0 and nmake, you can build a native Win32 version too.  Large file
    
    Modified: stable/8/contrib/bzip2/blocksort.c
    ==============================================================================
    --- stable/8/contrib/bzip2/blocksort.c	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/blocksort.c	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -8,8 +8,8 @@
        This file is part of bzip2/libbzip2, a program and library for
        lossless, block-sorting data compression.
     
    -   bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -   Copyright (C) 1996-2007 Julian Seward 
    +   bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +   Copyright (C) 1996-2010 Julian Seward 
     
        Please read the WARNING, DISCLAIMER and PATENTS sections in the 
        README file.
    
    Modified: stable/8/contrib/bzip2/bzip2.1
    ==============================================================================
    --- stable/8/contrib/bzip2/bzip2.1	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/bzip2.1	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -1,7 +1,7 @@
     .PU
     .TH bzip2 1
     .SH NAME
    -bzip2, bunzip2 \- a block-sorting file compressor, v1.0.4
    +bzip2, bunzip2 \- a block-sorting file compressor, v1.0.6
     .br
     bzcat \- decompresses files to stdout
     .br
    @@ -405,11 +405,11 @@ I/O error messages are not as helpful as
     tries hard to detect I/O errors and exit cleanly, but the details of
     what the problem is sometimes seem rather misleading.
     
    -This manual page pertains to version 1.0.4 of
    +This manual page pertains to version 1.0.6 of
     .I bzip2.  
     Compressed data created by this version is entirely forwards and
     backwards compatible with the previous public releases, versions
    -0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and 1.0.3, but with the following
    +0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and above, but with the following
     exception: 0.9.0 and above can correctly decompress multiple
     concatenated compressed files.  0.1pl2 cannot do this; it will stop
     after decompressing just the first file in the stream.
    
    Modified: stable/8/contrib/bzip2/bzip2.c
    ==============================================================================
    --- stable/8/contrib/bzip2/bzip2.c	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/bzip2.c	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -7,8 +7,8 @@
        This file is part of bzip2/libbzip2, a program and library for
        lossless, block-sorting data compression.
     
    -   bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -   Copyright (C) 1996-2007 Julian Seward 
    +   bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +   Copyright (C) 1996-2010 Julian Seward 
     
        Please read the WARNING, DISCLAIMER and PATENTS sections in the 
        README file.
    @@ -1605,11 +1605,11 @@ void license ( void )
         "bzip2, a block-sorting file compressor.  "
         "Version %s.\n"
         "   \n"
    -    "   Copyright (C) 1996-2007 by Julian Seward.\n"
    +    "   Copyright (C) 1996-2010 by Julian Seward.\n"
         "   \n"
         "   This program is free software; you can redistribute it and/or modify\n"
         "   it under the terms set out in the LICENSE file, which is included\n"
    -    "   in the bzip2-1.0.5 source distribution.\n"
    +    "   in the bzip2-1.0.6 source distribution.\n"
         "   \n"
         "   This program is distributed in the hope that it will be useful,\n"
         "   but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
    
    Modified: stable/8/contrib/bzip2/bzip2recover.c
    ==============================================================================
    --- stable/8/contrib/bzip2/bzip2recover.c	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/bzip2recover.c	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -7,8 +7,8 @@
        This file is part of bzip2/libbzip2, a program and library for
        lossless, block-sorting data compression.
     
    -   bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -   Copyright (C) 1996-2007 Julian Seward 
    +   bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +   Copyright (C) 1996-2010 Julian Seward 
     
        Please read the WARNING, DISCLAIMER and PATENTS sections in the 
        README file.
    @@ -313,7 +313,7 @@ Int32 main ( Int32 argc, Char** argv )
        inFileName[0] = outFileName[0] = 0;
     
        fprintf ( stderr, 
    -             "bzip2recover 1.0.5: extracts blocks from damaged .bz2 files.\n" );
    +             "bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.\n" );
     
        if (argc != 2) {
           fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n",
    
    Modified: stable/8/contrib/bzip2/bzlib.c
    ==============================================================================
    --- stable/8/contrib/bzip2/bzlib.c	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/bzlib.c	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -8,8 +8,8 @@
        This file is part of bzip2/libbzip2, a program and library for
        lossless, block-sorting data compression.
     
    -   bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -   Copyright (C) 1996-2007 Julian Seward 
    +   bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +   Copyright (C) 1996-2010 Julian Seward 
     
        Please read the WARNING, DISCLAIMER and PATENTS sections in the 
        README file.
    
    Modified: stable/8/contrib/bzip2/bzlib.h
    ==============================================================================
    --- stable/8/contrib/bzip2/bzlib.h	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/bzlib.h	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -8,8 +8,8 @@
        This file is part of bzip2/libbzip2, a program and library for
        lossless, block-sorting data compression.
     
    -   bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -   Copyright (C) 1996-2007 Julian Seward 
    +   bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +   Copyright (C) 1996-2010 Julian Seward 
     
        Please read the WARNING, DISCLAIMER and PATENTS sections in the 
        README file.
    
    Modified: stable/8/contrib/bzip2/bzlib_private.h
    ==============================================================================
    --- stable/8/contrib/bzip2/bzlib_private.h	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/bzlib_private.h	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -8,8 +8,8 @@
        This file is part of bzip2/libbzip2, a program and library for
        lossless, block-sorting data compression.
     
    -   bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -   Copyright (C) 1996-2007 Julian Seward 
    +   bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +   Copyright (C) 1996-2010 Julian Seward 
     
        Please read the WARNING, DISCLAIMER and PATENTS sections in the 
        README file.
    @@ -36,7 +36,7 @@
     
     /*-- General stuff. --*/
     
    -#define BZ_VERSION  "1.0.5, 10-Dec-2007"
    +#define BZ_VERSION  "1.0.6, 6-Sept-2010"
     
     typedef char            Char;
     typedef unsigned char   Bool;
    
    Modified: stable/8/contrib/bzip2/compress.c
    ==============================================================================
    --- stable/8/contrib/bzip2/compress.c	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/compress.c	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -8,8 +8,8 @@
        This file is part of bzip2/libbzip2, a program and library for
        lossless, block-sorting data compression.
     
    -   bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -   Copyright (C) 1996-2007 Julian Seward 
    +   bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +   Copyright (C) 1996-2010 Julian Seward 
     
        Please read the WARNING, DISCLAIMER and PATENTS sections in the 
        README file.
    
    Modified: stable/8/contrib/bzip2/crctable.c
    ==============================================================================
    --- stable/8/contrib/bzip2/crctable.c	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/crctable.c	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -8,8 +8,8 @@
        This file is part of bzip2/libbzip2, a program and library for
        lossless, block-sorting data compression.
     
    -   bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -   Copyright (C) 1996-2007 Julian Seward 
    +   bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +   Copyright (C) 1996-2010 Julian Seward 
     
        Please read the WARNING, DISCLAIMER and PATENTS sections in the 
        README file.
    
    Modified: stable/8/contrib/bzip2/decompress.c
    ==============================================================================
    --- stable/8/contrib/bzip2/decompress.c	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/decompress.c	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -8,8 +8,8 @@
        This file is part of bzip2/libbzip2, a program and library for
        lossless, block-sorting data compression.
     
    -   bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -   Copyright (C) 1996-2007 Julian Seward 
    +   bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +   Copyright (C) 1996-2010 Julian Seward 
     
        Please read the WARNING, DISCLAIMER and PATENTS sections in the 
        README file.
    @@ -492,15 +492,28 @@ Int32 BZ2_decompress ( DState* s )
              RETURN(BZ_DATA_ERROR);
     
           /*-- Set up cftab to facilitate generation of T^(-1) --*/
    +      /* Check: unzftab entries in range. */
    +      for (i = 0; i <= 255; i++) {
    +         if (s->unzftab[i] < 0 || s->unzftab[i] > nblock)
    +            RETURN(BZ_DATA_ERROR);
    +      }
    +      /* Actually generate cftab. */
           s->cftab[0] = 0;
           for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1];
           for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1];
    +      /* Check: cftab entries in range. */
           for (i = 0; i <= 256; i++) {
              if (s->cftab[i] < 0 || s->cftab[i] > nblock) {
                 /* s->cftab[i] can legitimately be == nblock */
                 RETURN(BZ_DATA_ERROR);
              }
           }
    +      /* Check: cftab entries non-descending. */
    +      for (i = 1; i <= 256; i++) {
    +         if (s->cftab[i-1] > s->cftab[i]) {
    +            RETURN(BZ_DATA_ERROR);
    +         }
    +      }
     
           s->state_out_len = 0;
           s->state_out_ch  = 0;
    
    Modified: stable/8/contrib/bzip2/huffman.c
    ==============================================================================
    --- stable/8/contrib/bzip2/huffman.c	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/huffman.c	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -8,8 +8,8 @@
        This file is part of bzip2/libbzip2, a program and library for
        lossless, block-sorting data compression.
     
    -   bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -   Copyright (C) 1996-2007 Julian Seward 
    +   bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +   Copyright (C) 1996-2010 Julian Seward 
     
        Please read the WARNING, DISCLAIMER and PATENTS sections in the 
        README file.
    
    Modified: stable/8/contrib/bzip2/randtable.c
    ==============================================================================
    --- stable/8/contrib/bzip2/randtable.c	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/randtable.c	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -8,8 +8,8 @@
        This file is part of bzip2/libbzip2, a program and library for
        lossless, block-sorting data compression.
     
    -   bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -   Copyright (C) 1996-2007 Julian Seward 
    +   bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +   Copyright (C) 1996-2010 Julian Seward 
     
        Please read the WARNING, DISCLAIMER and PATENTS sections in the 
        README file.
    
    Modified: stable/8/contrib/bzip2/spewG.c
    ==============================================================================
    --- stable/8/contrib/bzip2/spewG.c	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/spewG.c	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -13,8 +13,8 @@
        This file is part of bzip2/libbzip2, a program and library for
        lossless, block-sorting data compression.
     
    -   bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -   Copyright (C) 1996-2007 Julian Seward 
    +   bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +   Copyright (C) 1996-2010 Julian Seward 
     
        Please read the WARNING, DISCLAIMER and PATENTS sections in the 
        README file.
    
    Modified: stable/8/contrib/bzip2/unzcrash.c
    ==============================================================================
    --- stable/8/contrib/bzip2/unzcrash.c	Thu Feb 28 05:18:15 2013	(r247447)
    +++ stable/8/contrib/bzip2/unzcrash.c	Thu Feb 28 05:47:50 2013	(r247448)
    @@ -17,8 +17,8 @@
        This file is part of bzip2/libbzip2, a program and library for
        lossless, block-sorting data compression.
     
    -   bzip2/libbzip2 version 1.0.5 of 10 December 2007
    -   Copyright (C) 1996-2007 Julian Seward 
    +   bzip2/libbzip2 version 1.0.6 of 6 September 2010
    +   Copyright (C) 1996-2010 Julian Seward 
     
        Please read the WARNING, DISCLAIMER and PATENTS sections in the 
        README file.
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 06:00:27 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 6082EDC;
     Thu, 28 Feb 2013 06:00:27 +0000 (UTC)
     (envelope-from jfvogel@gmail.com)
    Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com
     [209.85.128.180])
     by mx1.freebsd.org (Postfix) with ESMTP id 98FB0D02;
     Thu, 28 Feb 2013 06:00:26 +0000 (UTC)
    Received: by mail-ve0-f180.google.com with SMTP id jx10so1401167veb.39
     for ; Wed, 27 Feb 2013 22:00:20 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
     h=mime-version:x-received:in-reply-to:references:date:message-id
     :subject:from:to:cc:content-type;
     bh=kWFqQg1D2iSTSqxPV7HXvwQTD5lXWM9o/cj91sIckwI=;
     b=dpMI2Vf4yiK6E//ZGcM4nTVQON0vsPqrA5cGCEcBj/rpl/CbTupJfvaYsHavlWn/d3
     ethCcc04Yg0XmKoqDOdxd6uRvPO7SK30xm/bvn1/H6n8u1HTFTSkE69VX/3RvNsetLTb
     6faCcQiTqDZpH691Yhrx2fH9n3LCAAt+JGpvEqwA1Cwlq5TyzDRpd2JNDjKoOpa7byAY
     rhD4xzcY5yrWwadSlsqVNhCbK/Bll8HUn1zbSCpXaL5gcg1FIJ7mqGnNZ6n+daRAmlsP
     MBZ0IoK6r8/MFM4cfQdDLd70T2FLC41vm1DcUieKNMM4sFJvrytwoEUEUjpPNg8QjA72
     fHMg==
    MIME-Version: 1.0
    X-Received: by 10.58.56.161 with SMTP id b1mr2095922veq.42.1362031220028; Wed,
     27 Feb 2013 22:00:20 -0800 (PST)
    Received: by 10.220.191.132 with HTTP; Wed, 27 Feb 2013 22:00:19 -0800 (PST)
    In-Reply-To: 
    References: <201302280022.r1S0M4vm064514@svn.freebsd.org>
     <20130228022333.GC70215@glenbarber.us>
     
     
    Date: Wed, 27 Feb 2013 22:00:19 -0800
    Message-ID: 
    Subject: Re: svn commit: r247430 - in stable/8/sys: conf dev/e1000 modules/em
     modules/igb
    From: Jack Vogel 
    To: Glen Barber 
    Content-Type: text/plain; charset=ISO-8859-1
    X-Content-Filtered-By: Mailman/MimeDel 2.1.14
    Cc: Jack F Vogel , svn-src-stable@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org,
     svn-src-stable-8@freebsd.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 06:00:27 -0000
    
    I am checking with Luigi to see if an MFC of his code is a viable solution,
    if not I
    will change my core code. Stay tuned...
    
    Jack
    
    
    On Wed, Feb 27, 2013 at 9:41 PM, Jack Vogel  wrote:
    
    > LOL, I would see the messages just as I sent this, never mind.
    >
    > Jack
    >
    >
    > On Wed, Feb 27, 2013 at 9:39 PM, Jack Vogel  wrote:
    >
    >> Oh, that's odd, then HEAD should be broken too, do you have more detail?
    >>
    >> Jack
    >>
    >>
    >> On Wed, Feb 27, 2013 at 6:23 PM, Glen Barber  wrote:
    >>
    >>> Jack,
    >>>
    >>> This commit seems to break the build for at least powerpc and sparc64.
    >>>
    >>> Glen
    >>>
    >>> On Thu, Feb 28, 2013 at 12:22:04AM +0000, Jack F Vogel wrote:
    >>> > Author: jfv
    >>> > Date: Thu Feb 28 00:22:04 2013
    >>> > New Revision: 247430
    >>> > URL: http://svnweb.freebsd.org/changeset/base/247430
    >>> >
    >>> > Log:
    >>> >   MFC of the E1000 drivers to STABLE/8, this includes the follow
    >>> revisions
    >>> >   plus a few tweaks:
    >>> >    196969,196970,211516,214646,215781,215789,215808,215910,223350,
    >>> >    223482,223831,228281,228393,229939,231796,232238,234665,235256,
    >>> >    236406,238148,238151,238214,238765,238770,238953,238981,239105,
    >>> >    239109,239304,240518,240693,240968,241037,241856,241885,243570,
    >>> >    243857,245334,246128,246482,247064
    >>> >
    >>> > Added:
    >>> >   stable/8/sys/dev/e1000/e1000_i210.c
    >>> >      - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c
    >>> >   stable/8/sys/dev/e1000/e1000_i210.h
    >>> >      - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h
    >>> > Modified:
    >>> >   stable/8/sys/conf/files
    >>> >   stable/8/sys/dev/e1000/e1000_82541.c
    >>> >   stable/8/sys/dev/e1000/e1000_82543.c
    >>> >   stable/8/sys/dev/e1000/e1000_82571.c
    >>> >   stable/8/sys/dev/e1000/e1000_82575.c
    >>> >   stable/8/sys/dev/e1000/e1000_82575.h
    >>> >   stable/8/sys/dev/e1000/e1000_api.c
    >>> >   stable/8/sys/dev/e1000/e1000_api.h
    >>> >   stable/8/sys/dev/e1000/e1000_defines.h
    >>> >   stable/8/sys/dev/e1000/e1000_hw.h
    >>> >   stable/8/sys/dev/e1000/e1000_ich8lan.c
    >>> >   stable/8/sys/dev/e1000/e1000_ich8lan.h
    >>> >   stable/8/sys/dev/e1000/e1000_mac.c
    >>> >   stable/8/sys/dev/e1000/e1000_mac.h
    >>> >   stable/8/sys/dev/e1000/e1000_manage.c
    >>> >   stable/8/sys/dev/e1000/e1000_manage.h
    >>> >   stable/8/sys/dev/e1000/e1000_nvm.c
    >>> >   stable/8/sys/dev/e1000/e1000_nvm.h
    >>> >   stable/8/sys/dev/e1000/e1000_osdep.h
    >>> >   stable/8/sys/dev/e1000/e1000_phy.c
    >>> >   stable/8/sys/dev/e1000/e1000_phy.h
    >>> >   stable/8/sys/dev/e1000/e1000_regs.h
    >>> >   stable/8/sys/dev/e1000/if_em.c   (contents, props changed)
    >>> >   stable/8/sys/dev/e1000/if_igb.c   (contents, props changed)
    >>> >   stable/8/sys/dev/e1000/if_igb.h
    >>> >   stable/8/sys/dev/e1000/if_lem.c
    >>> >   stable/8/sys/modules/em/Makefile
    >>> >   stable/8/sys/modules/igb/Makefile
    >>> > Directory Properties:
    >>> >   stable/8/sys/dev/e1000/   (props changed)
    >>> >
    >>> > Modified: stable/8/sys/conf/files
    >>> >
    >>> ==============================================================================
    >>> > --- stable/8/sys/conf/files   Thu Feb 28 00:18:56 2013        (r247429)
    >>> > +++ stable/8/sys/conf/files   Thu Feb 28 00:22:04 2013        (r247430)
    >>> > @@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c           optional em | i
    >>> >       compile-with "${NORMAL_C} -I$S/dev/e1000"
    >>> >  dev/e1000/e1000_ich8lan.c    optional em | igb \
    >>> >       compile-with "${NORMAL_C} -I$S/dev/e1000"
    >>> > +dev/e1000/e1000_i210.c               optional em | igb \
    >>> > +     compile-with "${NORMAL_C} -I$S/dev/e1000"
    >>> >  dev/e1000/e1000_api.c                optional em | igb \
    >>> >       compile-with "${NORMAL_C} -I$S/dev/e1000"
    >>> >  dev/e1000/e1000_mac.c                optional em | igb \
    >>> >
    >>> > Modified: stable/8/sys/dev/e1000/e1000_82541.c
    >>> >
    >>> ==============================================================================
    >>> > --- stable/8/sys/dev/e1000/e1000_82541.c      Thu Feb 28 00:18:56 2013
    >>>        (r247429)
    >>> > +++ stable/8/sys/dev/e1000/e1000_82541.c      Thu Feb 28 00:22:04 2013
    >>>        (r247430)
    >>> > @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st
    >>> >        * of MAC speed/duplex configuration.  So we only need to
    >>> >        * configure Collision Distance in the MAC.
    >>> >        */
    >>> > -     e1000_config_collision_dist_generic(hw);
    >>> > +     mac->ops.config_collision_dist(hw);
    >>> >
    >>> >       /*
    >>> >        * Configure Flow Control now that Auto-Neg has completed.
    >>> >
    >>> > Modified: stable/8/sys/dev/e1000/e1000_82543.c
    >>> >
    >>> ==============================================================================
    >>> > --- stable/8/sys/dev/e1000/e1000_82543.c      Thu Feb 28 00:18:56 2013
    >>>        (r247429)
    >>> > +++ stable/8/sys/dev/e1000/e1000_82543.c      Thu Feb 28 00:22:04 2013
    >>>        (r247430)
    >>> > @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543
    >>> >               DEBUGOUT("Valid link established!!!\n");
    >>> >               /* Config the MAC and PHY after link is up */
    >>> >               if (hw->mac.type == e1000_82544) {
    >>> > -                     e1000_config_collision_dist_generic(hw);
    >>> > +                     hw->mac.ops.config_collision_dist(hw);
    >>> >               } else {
    >>> >                       ret_val = e1000_config_mac_to_phy_82543(hw);
    >>> >                       if (ret_val)
    >>> > @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543(
    >>> >       /* Take the link out of reset */
    >>> >       ctrl &= ~E1000_CTRL_LRST;
    >>> >
    >>> > -     e1000_config_collision_dist_generic(hw);
    >>> > +     hw->mac.ops.config_collision_dist(hw);
    >>> >
    >>> >       ret_val = e1000_commit_fc_settings_generic(hw);
    >>> >       if (ret_val)
    >>> > @@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8
    >>> >        * settings.
    >>> >        */
    >>> >       if (mac->type == e1000_82544)
    >>> > -             e1000_config_collision_dist_generic(hw);
    >>> > +             hw->mac.ops.config_collision_dist(hw);
    >>> >       else {
    >>> >               ret_val = e1000_config_mac_to_phy_82543(hw);
    >>> >               if (ret_val) {
    >>> > @@ -1433,7 +1433,7 @@ static s32 e1000_config_mac_to_phy_82543
    >>> >       if (phy_data & M88E1000_PSSR_DPLX)
    >>> >               ctrl |= E1000_CTRL_FD;
    >>> >
    >>> > -     e1000_config_collision_dist_generic(hw);
    >>> > +     hw->mac.ops.config_collision_dist(hw);
    >>> >
    >>> >       /*
    >>> >        * Set up speed in the Device Control register depending on
    >>> >
    >>> > Modified: stable/8/sys/dev/e1000/e1000_82571.c
    >>> >
    >>> ==============================================================================
    >>> > --- stable/8/sys/dev/e1000/e1000_82571.c      Thu Feb 28 00:18:56 2013
    >>>        (r247429)
    >>> > +++ stable/8/sys/dev/e1000/e1000_82571.c      Thu Feb 28 00:22:04 2013
    >>>        (r247430)
    >>> > @@ -1,6 +1,6 @@
    >>> >
    >>>  /******************************************************************************
    >>> >
    >>> > -  Copyright (c) 2001-2011, Intel Corporation
    >>> > +  Copyright (c) 2001-2013, Intel Corporation
    >>> >    All rights reserved.
    >>> >
    >>> >    Redistribution and use in source and binary forms, with or without
    >>> > @@ -32,8 +32,7 @@
    >>> >
    >>>  ******************************************************************************/
    >>> >  /*$FreeBSD$*/
    >>> >
    >>> > -/*
    >>> > - * 82571EB Gigabit Ethernet Controller
    >>> > +/* 82571EB Gigabit Ethernet Controller
    >>> >   * 82571EB Gigabit Ethernet Controller (Copper)
    >>> >   * 82571EB Gigabit Ethernet Controller (Fiber)
    >>> >   * 82571EB Dual Port Gigabit Mezzanine Adapter
    >>> > @@ -51,9 +50,6 @@
    >>> >
    >>> >  #include "e1000_api.h"
    >>> >
    >>> > -static s32  e1000_init_phy_params_82571(struct e1000_hw *hw);
    >>> > -static s32  e1000_init_nvm_params_82571(struct e1000_hw *hw);
    >>> > -static s32  e1000_init_mac_params_82571(struct e1000_hw *hw);
    >>> >  static s32  e1000_acquire_nvm_82571(struct e1000_hw *hw);
    >>> >  static void e1000_release_nvm_82571(struct e1000_hw *hw);
    >>> >  static s32  e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset,
    >>> > @@ -78,7 +74,6 @@ static s32  e1000_get_hw_semaphore_82571
    >>> >  static s32  e1000_fix_nvm_checksum_82571(struct e1000_hw *hw);
    >>> >  static s32  e1000_get_phy_id_82571(struct e1000_hw *hw);
    >>> >  static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw);
    >>> > -static s32  e1000_get_hw_semaphore_82573(struct e1000_hw *hw);
    >>> >  static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw);
    >>> >  static s32  e1000_get_hw_semaphore_82574(struct e1000_hw *hw);
    >>> >  static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw);
    >>> > @@ -99,13 +94,13 @@ static void e1000_power_down_phy_copper_
    >>> >  static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
    >>> >  {
    >>> >       struct e1000_phy_info *phy = &hw->phy;
    >>> > -     s32 ret_val = E1000_SUCCESS;
    >>> > +     s32 ret_val;
    >>> >
    >>> >       DEBUGFUNC("e1000_init_phy_params_82571");
    >>> >
    >>> >       if (hw->phy.media_type != e1000_media_type_copper) {
    >>> >               phy->type = e1000_phy_none;
    >>> > -             goto out;
    >>> > +             return E1000_SUCCESS;
    >>> >       }
    >>> >
    >>> >       phy->addr                       = 1;
    >>> > @@ -165,8 +160,7 @@ static s32 e1000_init_phy_params_82571(s
    >>> >               phy->ops.set_d3_lplu_state =
    >>> e1000_set_d3_lplu_state_82574;
    >>> >               break;
    >>> >       default:
    >>> > -             ret_val = -E1000_ERR_PHY;
    >>> > -             goto out;
    >>> > +             return -E1000_ERR_PHY;
    >>> >               break;
    >>> >       }
    >>> >
    >>> > @@ -174,7 +168,7 @@ static s32 e1000_init_phy_params_82571(s
    >>> >       ret_val = e1000_get_phy_id_82571(hw);
    >>> >       if (ret_val) {
    >>> >               DEBUGOUT("Error getting PHY ID\n");
    >>> > -             goto out;
    >>> > +             return ret_val;
    >>> >       }
    >>> >
    >>> >       /* Verify phy id */
    >>> > @@ -201,7 +195,6 @@ static s32 e1000_init_phy_params_82571(s
    >>> >       if (ret_val)
    >>> >               DEBUGOUT1("PHY ID unknown: type = 0x%08x\n", phy->id);
    >>> >
    >>> > -out:
    >>> >       return ret_val;
    >>> >  }
    >>> >
    >>> > @@ -241,8 +234,7 @@ static s32 e1000_init_nvm_params_82571(s
    >>> >               if (((eecd >> 15) & 0x3) == 0x3) {
    >>> >                       nvm->type = e1000_nvm_flash_hw;
    >>> >                       nvm->word_size = 2048;
    >>> > -                     /*
    >>> > -                      * Autonomous Flash update bit must be cleared
    >>> due
    >>> > +                     /* Autonomous Flash update bit must be cleared
    >>> due
    >>> >                        * to Flash update issue.
    >>> >                        */
    >>> >                       eecd &= ~E1000_EECD_AUPDEN;
    >>> > @@ -254,8 +246,7 @@ static s32 e1000_init_nvm_params_82571(s
    >>> >               nvm->type = e1000_nvm_eeprom_spi;
    >>> >               size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
    >>> >                            E1000_EECD_SIZE_EX_SHIFT);
    >>> > -             /*
    >>> > -              * Added to a constant, "size" becomes the left-shift
    >>> value
    >>> > +             /* Added to a constant, "size" becomes the left-shift
    >>> value
    >>> >                * for setting word_size.
    >>> >                */
    >>> >               size += NVM_WORD_SIZE_BASE_SHIFT;
    >>> > @@ -382,12 +373,11 @@ static s32 e1000_init_mac_params_82571(s
    >>> >
    >>> >               /* FWSM register */
    >>> >               mac->has_fwsm = TRUE;
    >>> > -             /*
    >>> > -              * ARC supported; valid only if manageability features
    >>> are
    >>> > +             /* ARC supported; valid only if manageability features
    >>> are
    >>> >                * enabled.
    >>> >                */
    >>> > -             mac->arc_subsystem_valid = (E1000_READ_REG(hw,
    >>> E1000_FWSM) &
    >>> > -                                        E1000_FWSM_MODE_MASK) ? TRUE
    >>> : FALSE;
    >>> > +             mac->arc_subsystem_valid = !!(E1000_READ_REG(hw,
    >>> E1000_FWSM) &
    >>> > +                                           E1000_FWSM_MODE_MASK);
    >>> >               break;
    >>> >       case e1000_82574:
    >>> >       case e1000_82583:
    >>> > @@ -405,8 +395,7 @@ static s32 e1000_init_mac_params_82571(s
    >>> >               break;
    >>> >       }
    >>> >
    >>> > -     /*
    >>> > -      * Ensure that the inter-port SWSM.SMBI lock bit is clear before
    >>> > +     /* Ensure that the inter-port SWSM.SMBI lock bit is clear before
    >>> >        * first NVM or PHY acess. This should be done for single-port
    >>> >        * devices, and for one port only on dual-port devices so that
    >>> >        * for those devices we can still use the SMBI lock to
    >>> synchronize
    >>> > @@ -422,8 +411,9 @@ static s32 e1000_init_mac_params_82571(s
    >>> >                       E1000_WRITE_REG(hw, E1000_SWSM2, swsm2 |
    >>> >                                       E1000_SWSM2_LOCK);
    >>> >                       force_clear_smbi = TRUE;
    >>> > -             } else
    >>> > +             } else {
    >>> >                       force_clear_smbi = FALSE;
    >>> > +             }
    >>> >               break;
    >>> >       default:
    >>> >               force_clear_smbi = TRUE;
    >>> > @@ -443,10 +433,7 @@ static s32 e1000_init_mac_params_82571(s
    >>> >               E1000_WRITE_REG(hw, E1000_SWSM, swsm & ~E1000_SWSM_SMBI);
    >>> >       }
    >>> >
    >>> > -     /*
    >>> > -      * Initialze device specific counter of SMBI acquisition
    >>> > -      * timeouts.
    >>> > -      */
    >>> > +     /* Initialze device specific counter of SMBI acquisition
    >>> timeouts. */
    >>> >        hw->dev_spec._82571.smb_counter = 0;
    >>> >
    >>> >       return E1000_SUCCESS;
    >>> > @@ -477,7 +464,7 @@ void e1000_init_function_pointers_82571(
    >>> >  static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
    >>> >  {
    >>> >       struct e1000_phy_info *phy = &hw->phy;
    >>> > -     s32 ret_val = E1000_SUCCESS;
    >>> > +     s32 ret_val;
    >>> >       u16 phy_id = 0;
    >>> >
    >>> >       DEBUGFUNC("e1000_get_phy_id_82571");
    >>> > @@ -485,8 +472,7 @@ static s32 e1000_get_phy_id_82571(struct
    >>> >       switch (hw->mac.type) {
    >>> >       case e1000_82571:
    >>> >       case e1000_82572:
    >>> > -             /*
    >>> > -              * The 82571 firmware may still be configuring the PHY.
    >>> > +             /* The 82571 firmware may still be configuring the PHY.
    >>> >                * In this case, we cannot access the PHY until the
    >>> >                * configuration is done.  So we explicitly set the
    >>> >                * PHY ID.
    >>> > @@ -494,29 +480,29 @@ static s32 e1000_get_phy_id_82571(struct
    >>> >               phy->id = IGP01E1000_I_PHY_ID;
    >>> >               break;
    >>> >       case e1000_82573:
    >>> > -             ret_val = e1000_get_phy_id(hw);
    >>> > +             return e1000_get_phy_id(hw);
    >>> >               break;
    >>> >       case e1000_82574:
    >>> >       case e1000_82583:
    >>> >               ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id);
    >>> >               if (ret_val)
    >>> > -                     goto out;
    >>> > +                     return ret_val;
    >>> >
    >>> >               phy->id = (u32)(phy_id << 16);
    >>> >               usec_delay(20);
    >>> >               ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id);
    >>> >               if (ret_val)
    >>> > -                     goto out;
    >>> > +                     return ret_val;
    >>> >
    >>> >               phy->id |= (u32)(phy_id);
    >>> >               phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK);
    >>> >               break;
    >>> >       default:
    >>> > -             ret_val = -E1000_ERR_PHY;
    >>> > +             return -E1000_ERR_PHY;
    >>> >               break;
    >>> >       }
    >>> > -out:
    >>> > -     return ret_val;
    >>> > +
    >>> > +     return E1000_SUCCESS;
    >>> >  }
    >>> >
    >>> >  /**
    >>> > @@ -528,15 +514,13 @@ out:
    >>> >  static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
    >>> >  {
    >>> >       u32 swsm;
    >>> > -     s32 ret_val = E1000_SUCCESS;
    >>> >       s32 sw_timeout = hw->nvm.word_size + 1;
    >>> >       s32 fw_timeout = hw->nvm.word_size + 1;
    >>> >       s32 i = 0;
    >>> >
    >>> >       DEBUGFUNC("e1000_get_hw_semaphore_82571");
    >>> >
    >>> > -     /*
    >>> > -      * If we have timedout 3 times on trying to acquire
    >>> > +     /* If we have timedout 3 times on trying to acquire
    >>> >        * the inter-port SMBI semaphore, there is old code
    >>> >        * operating on the other port, and it is not
    >>> >        * releasing SMBI. Modify the number of times that
    >>> > @@ -576,12 +560,10 @@ static s32 e1000_get_hw_semaphore_82571(
    >>> >               /* Release semaphores */
    >>> >               e1000_put_hw_semaphore_82571(hw);
    >>> >               DEBUGOUT("Driver can't access the NVM\n");
    >>> > -             ret_val = -E1000_ERR_NVM;
    >>> > -             goto out;
    >>> > +             return -E1000_ERR_NVM;
    >>> >       }
    >>> >
    >>> > -out:
    >>> > -     return ret_val;
    >>> > +     return E1000_SUCCESS;
    >>> >  }
    >>> >
    >>> >  /**
    >>> > @@ -613,22 +595,19 @@ static void e1000_put_hw_semaphore_82571
    >>> >  static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw)
    >>> >  {
    >>> >       u32 extcnf_ctrl;
    >>> > -     s32 ret_val = E1000_SUCCESS;
    >>> >       s32 i = 0;
    >>> >
    >>> >       DEBUGFUNC("e1000_get_hw_semaphore_82573");
    >>> >
    >>> >       extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL);
    >>> > -     extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
    >>> >       do {
    >>> > +             extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
    >>> >               E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl);
    >>> >               extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL);
    >>> >
    >>> >               if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP)
    >>> >                       break;
    >>> >
    >>> > -             extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
    >>> > -
    >>> >               msec_delay(2);
    >>> >               i++;
    >>> >       } while (i < MDIO_OWNERSHIP_TIMEOUT);
    >>> > @@ -637,12 +616,10 @@ static s32 e1000_get_hw_semaphore_82573(
    >>> >               /* Release semaphores */
    >>> >               e1000_put_hw_semaphore_82573(hw);
    >>> >               DEBUGOUT("Driver can't access the PHY\n");
    >>> > -             ret_val = -E1000_ERR_PHY;
    >>> > -             goto out;
    >>> > +             return -E1000_ERR_PHY;
    >>> >       }
    >>> >
    >>> > -out:
    >>> > -     return ret_val;
    >>> > +     return E1000_SUCCESS;
    >>> >  }
    >>> >
    >>> >  /**
    >>> > @@ -712,7 +689,7 @@ static void e1000_put_hw_semaphore_82574
    >>> >   **/
    >>> >  static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool
    >>> active)
    >>> >  {
    >>> > -     u16 data = E1000_READ_REG(hw, E1000_POEMB);
    >>> > +     u32 data = E1000_READ_REG(hw, E1000_POEMB);
    >>> >
    >>> >       DEBUGFUNC("e1000_set_d0_lplu_state_82574");
    >>> >
    >>> > @@ -738,7 +715,7 @@ static s32 e1000_set_d0_lplu_state_82574
    >>> >   **/
    >>> >  static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool
    >>> active)
    >>> >  {
    >>> > -     u16 data = E1000_READ_REG(hw, E1000_POEMB);
    >>> > +     u32 data = E1000_READ_REG(hw, E1000_POEMB);
    >>> >
    >>> >       DEBUGFUNC("e1000_set_d3_lplu_state_82574");
    >>> >
    >>> > @@ -771,7 +748,7 @@ static s32 e1000_acquire_nvm_82571(struc
    >>> >
    >>> >       ret_val = e1000_get_hw_semaphore_82571(hw);
    >>> >       if (ret_val)
    >>> > -             goto out;
    >>> > +             return ret_val;
    >>> >
    >>> >       switch (hw->mac.type) {
    >>> >       case e1000_82573:
    >>> > @@ -784,7 +761,6 @@ static s32 e1000_acquire_nvm_82571(struc
    >>> >       if (ret_val)
    >>> >               e1000_put_hw_semaphore_82571(hw);
    >>> >
    >>> > -out:
    >>> >       return ret_val;
    >>> >  }
    >>> >
    >>> > @@ -817,7 +793,7 @@ static void e1000_release_nvm_82571(stru
    >>> >  static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16
    >>> words,
    >>> >                                u16 *data)
    >>> >  {
    >>> > -     s32 ret_val = E1000_SUCCESS;
    >>> > +     s32 ret_val;
    >>> >
    >>> >       DEBUGFUNC("e1000_write_nvm_82571");
    >>> >
    >>> > @@ -857,31 +833,27 @@ static s32 e1000_update_nvm_checksum_825
    >>> >
    >>> >       ret_val = e1000_update_nvm_checksum_generic(hw);
    >>> >       if (ret_val)
    >>> > -             goto out;
    >>> > +             return ret_val;
    >>> >
    >>> > -     /*
    >>> > -      * If our nvm is an EEPROM, then we're done
    >>> > +     /* If our nvm is an EEPROM, then we're done
    >>> >        * otherwise, commit the checksum to the flash NVM.
    >>> >        */
    >>> >       if (hw->nvm.type != e1000_nvm_flash_hw)
    >>> > -             goto out;
    >>> > +             return E1000_SUCCESS;
    >>> >
    >>> >       /* Check for pending operations. */
    >>> >       for (i = 0; i < E1000_FLASH_UPDATES; i++) {
    >>> >               msec_delay(1);
    >>> > -             if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)
    >>> == 0)
    >>> > +             if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD))
    >>> >                       break;
    >>> >       }
    >>> >
    >>> > -     if (i == E1000_FLASH_UPDATES) {
    >>> > -             ret_val = -E1000_ERR_NVM;
    >>> > -             goto out;
    >>> > -     }
    >>> > +     if (i == E1000_FLASH_UPDATES)
    >>> > +             return -E1000_ERR_NVM;
    >>> >
    >>> >       /* Reset the firmware if using STM opcode. */
    >>> >       if ((E1000_READ_REG(hw, E1000_FLOP) & 0xFF00) ==
    >>> E1000_STM_OPCODE) {
    >>> > -             /*
    >>> > -              * The enabling of and the actual reset must be done
    >>> > +             /* The enabling of and the actual reset must be done
    >>> >                * in two write cycles.
    >>> >                */
    >>> >               E1000_WRITE_REG(hw, E1000_HICR,
    >>> E1000_HICR_FW_RESET_ENABLE);
    >>> > @@ -895,17 +867,14 @@ static s32 e1000_update_nvm_checksum_825
    >>> >
    >>> >       for (i = 0; i < E1000_FLASH_UPDATES; i++) {
    >>> >               msec_delay(1);
    >>> > -             if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD)
    >>> == 0)
    >>> > +             if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_FLUPD))
    >>> >                       break;
    >>> >       }
    >>> >
    >>> > -     if (i == E1000_FLASH_UPDATES) {
    >>> > -             ret_val = -E1000_ERR_NVM;
    >>> > -             goto out;
    >>> > -     }
    >>> > +     if (i == E1000_FLASH_UPDATES)
    >>> > +             return -E1000_ERR_NVM;
    >>> >
    >>> > -out:
    >>> > -     return ret_val;
    >>> > +     return E1000_SUCCESS;
    >>> >  }
    >>> >
    >>> >  /**
    >>> > @@ -944,19 +913,17 @@ static s32 e1000_write_nvm_eewr_82571(st
    >>> >  {
    >>> >       struct e1000_nvm_info *nvm = &hw->nvm;
    >>> >       u32 i, eewr = 0;
    >>> > -     s32 ret_val = 0;
    >>> > +     s32 ret_val = E1000_SUCCESS;
    >>> >
    >>> >       DEBUGFUNC("e1000_write_nvm_eewr_82571");
    >>> >
    >>> > -     /*
    >>> > -      * A check for invalid values:  offset too large, too many words,
    >>> > +     /* A check for invalid values:  offset too large, too many words,
    >>> >        * and not enough words.
    >>> >        */
    >>> >       if ((offset >= nvm->word_size) || (words > (nvm->word_size -
    >>> offset)) ||
    >>> >           (words == 0)) {
    >>> >               DEBUGOUT("nvm parameter(s) out of bounds\n");
    >>> > -             ret_val = -E1000_ERR_NVM;
    >>> > -             goto out;
    >>> > +             return -E1000_ERR_NVM;
    >>> >       }
    >>> >
    >>> >       for (i = 0; i < words; i++) {
    >>> > @@ -975,7 +942,6 @@ static s32 e1000_write_nvm_eewr_82571(st
    >>> >                       break;
    >>> >       }
    >>> >
    >>> > -out:
    >>> >       return ret_val;
    >>> >  }
    >>> >
    >>> > @@ -988,7 +954,6 @@ out:
    >>> >  static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)
    >>> >  {
    >>> >       s32 timeout = PHY_CFG_TIMEOUT;
    >>> > -     s32 ret_val = E1000_SUCCESS;
    >>> >
    >>> >       DEBUGFUNC("e1000_get_cfg_done_82571");
    >>> >
    >>> > @@ -1001,12 +966,10 @@ static s32 e1000_get_cfg_done_82571(stru
    >>> >       }
    >>> >       if (!timeout) {
    >>> >               DEBUGOUT("MNG configuration cycle has not completed.\n");
    >>> > -             ret_val = -E1000_ERR_RESET;
    >>> > -             goto out;
    >>> > +             return -E1000_ERR_RESET;
    >>> >       }
    >>> >
    >>> > -out:
    >>> > -     return ret_val;
    >>> > +     return E1000_SUCCESS;
    >>> >  }
    >>> >
    >>> >  /**
    >>> > @@ -1023,39 +986,40 @@ out:
    >>> >  static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool
    >>> active)
    >>> >  {
    >>> >       struct e1000_phy_info *phy = &hw->phy;
    >>> > -     s32 ret_val = E1000_SUCCESS;
    >>> > +     s32 ret_val;
    >>> >       u16 data;
    >>> >
    >>> >       DEBUGFUNC("e1000_set_d0_lplu_state_82571");
    >>> >
    >>> >       if (!(phy->ops.read_reg))
    >>> > -             goto out;
    >>> > +             return E1000_SUCCESS;
    >>> >
    >>> >       ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT,
    >>> &data);
    >>> >       if (ret_val)
    >>> > -             goto out;
    >>> > +             return ret_val;
    >>> >
    >>> >       if (active) {
    >>> >               data |= IGP02E1000_PM_D0_LPLU;
    >>> >               ret_val = phy->ops.write_reg(hw,
    >>> IGP02E1000_PHY_POWER_MGMT,
    >>> >                                            data);
    >>> >               if (ret_val)
    >>> > -                     goto out;
    >>> > +                     return ret_val;
    >>> >
    >>> >               /* When LPLU is enabled, we should disable SmartSpeed */
    >>> >               ret_val = phy->ops.read_reg(hw,
    >>> IGP01E1000_PHY_PORT_CONFIG,
    >>> >                                           &data);
    >>> > +             if (ret_val)
    >>> > +                     return ret_val;
    >>> >               data &= ~IGP01E1000_PSCFR_SMART_SPEED;
    >>> >               ret_val = phy->ops.write_reg(hw,
    >>> IGP01E1000_PHY_PORT_CONFIG,
    >>> >                                            data);
    >>> >               if (ret_val)
    >>> > -                     goto out;
    >>> > +                     return ret_val;
    >>> >       } else {
    >>> >               data &= ~IGP02E1000_PM_D0_LPLU;
    >>> >               ret_val = phy->ops.write_reg(hw,
    >>> IGP02E1000_PHY_POWER_MGMT,
    >>> >                                            data);
    >>> > -             /*
    >>> > -              * LPLU and SmartSpeed are mutually exclusive.  LPLU is
    >>> used
    >>> > +             /* LPLU and SmartSpeed are mutually exclusive.  LPLU is
    >>> used
    >>> >                * during Dx states where the power conservation is most
    >>> >                * important.  During driver activity we should enable
    >>> >                * SmartSpeed, so performance is maintained.
    >>> > @@ -1065,32 +1029,31 @@ static s32 e1000_set_d0_lplu_state_82571
    >>> >
    >>> IGP01E1000_PHY_PORT_CONFIG,
    >>> >                                                   &data);
    >>> >                       if (ret_val)
    >>> > -                             goto out;
    >>> > +                             return ret_val;
    >>> >
    >>> >                       data |= IGP01E1000_PSCFR_SMART_SPEED;
    >>> >                       ret_val = phy->ops.write_reg(hw,
    >>> >
    >>>  IGP01E1000_PHY_PORT_CONFIG,
    >>> >                                                    data);
    >>> >                       if (ret_val)
    >>> > -                             goto out;
    >>> > +                             return ret_val;
    >>> >               } else if (phy->smart_speed == e1000_smart_speed_off) {
    >>> >                       ret_val = phy->ops.read_reg(hw,
    >>> >
    >>> IGP01E1000_PHY_PORT_CONFIG,
    >>> >                                                   &data);
    >>> >                       if (ret_val)
    >>> > -                             goto out;
    >>> > +                             return ret_val;
    >>> >
    >>> >                       data &= ~IGP01E1000_PSCFR_SMART_SPEED;
    >>> >                       ret_val = phy->ops.write_reg(hw,
    >>> >
    >>>  IGP01E1000_PHY_PORT_CONFIG,
    >>> >                                                    data);
    >>> >                       if (ret_val)
    >>> > -                             goto out;
    >>> > +                             return ret_val;
    >>> >               }
    >>> >       }
    >>> >
    >>> > -out:
    >>> > -     return ret_val;
    >>> > +     return E1000_SUCCESS;
    >>> >  }
    >>> >
    >>> >  /**
    >>> > @@ -1101,13 +1064,12 @@ out:
    >>> >   **/
    >>> >  static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
    >>> >  {
    >>> > -     u32 ctrl, ctrl_ext;
    >>> > +     u32 ctrl, ctrl_ext, eecd, tctl;
    >>> >       s32 ret_val;
    >>> >
    >>> >       DEBUGFUNC("e1000_reset_hw_82571");
    >>> >
    >>> > -     /*
    >>> > -      * Prevent the PCI-E bus from sticking if there is no TLP
    >>> connection
    >>> > +     /* Prevent the PCI-E bus from sticking if there is no TLP
    >>> connection
    >>> >        * on the last TLP read/write transaction when MAC is reset.
    >>> >        */
    >>> >       ret_val = e1000_disable_pcie_master_generic(hw);
    >>> > @@ -1118,13 +1080,14 @@ static s32 e1000_reset_hw_82571(struct e
    >>> >       E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
    >>> >
    >>> >       E1000_WRITE_REG(hw, E1000_RCTL, 0);
    >>> > -     E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP);
    >>> > +     tctl = E1000_READ_REG(hw, E1000_TCTL);
    >>> > +     tctl &= ~E1000_TCTL_EN;
    >>> > +     E1000_WRITE_REG(hw, E1000_TCTL, tctl);
    >>> >       E1000_WRITE_FLUSH(hw);
    >>> >
    >>> >       msec_delay(10);
    >>> >
    >>> > -     /*
    >>> > -      * Must acquire the MDIO ownership before MAC reset.
    >>> > +     /* Must acquire the MDIO ownership before MAC reset.
    >>> >        * Ownership defaults to firmware after a reset.
    >>> >        */
    >>> >       switch (hw->mac.type) {
    >>> > @@ -1167,15 +1130,23 @@ static s32 e1000_reset_hw_82571(struct e
    >>> >       ret_val = e1000_get_auto_rd_done_generic(hw);
    >>> >       if (ret_val)
    >>> >               /* We don't want to continue accessing MAC registers. */
    >>> > -             goto out;
    >>> > +             return ret_val;
    >>> >
    >>> > -     /*
    >>> > -      * Phy configuration from NVM just starts after EECD_AUTO_RD is
    >>> set.
    >>> > +     /* Phy configuration from NVM just starts after EECD_AUTO_RD is
    >>> set.
    >>> >        * Need to wait for Phy configuration completion before accessing
    >>> >        * NVM and Phy.
    >>> >        */
    >>> >
    >>> >       switch (hw->mac.type) {
    >>> > +     case e1000_82571:
    >>> > +     case e1000_82572:
    >>> > +             /* REQ and GNT bits need to be cleared when using AUTO_RD
    >>> > +              * to access the EEPROM.
    >>> > +              */
    >>> > +             eecd = E1000_READ_REG(hw, E1000_EECD);
    >>> > +             eecd &= ~(E1000_EECD_REQ | E1000_EECD_GNT);
    >>> > +             E1000_WRITE_REG(hw, E1000_EECD, eecd);
    >>> > +             break;
    >>> >       case e1000_82573:
    >>> >       case e1000_82574:
    >>> >       case e1000_82583:
    >>> > @@ -1193,7 +1164,7 @@ static s32 e1000_reset_hw_82571(struct e
    >>> >               /* Install any alternate MAC address into RAR0 */
    >>> >               ret_val = e1000_check_alt_mac_addr_generic(hw);
    >>> >               if (ret_val)
    >>> > -                     goto out;
    >>> > +                     return ret_val;
    >>> >
    >>> >               e1000_set_laa_state_82571(hw, TRUE);
    >>> >       }
    >>> > @@ -1202,8 +1173,7 @@ static s32 e1000_reset_hw_82571(struct e
    >>> >       if (hw->phy.media_type == e1000_media_type_internal_serdes)
    >>> >               hw->mac.serdes_link_state = e1000_serdes_link_down;
    >>> >
    >>> > -out:
    >>> > -     return ret_val;
    >>> > +     return E1000_SUCCESS;
    >>> >  }
    >>> >
    >>> >  /**
    >>> > @@ -1225,16 +1195,15 @@ static s32 e1000_init_hw_82571(struct e1
    >>> >
    >>> >       /* Initialize identification LED */
    >>> >       ret_val = mac->ops.id_led_init(hw);
    >>> > +     /* An error is not fatal and we should not stop init due to this
    >>> */
    >>> >       if (ret_val)
    >>> >               DEBUGOUT("Error initializing identification LED\n");
    >>> > -             /* This is not fatal and we should not stop init due to
    >>> this */
    >>> >
    >>> >       /* Disabling VLAN filtering */
    >>> >       DEBUGOUT("Initializing the IEEE VLAN\n");
    >>> >       mac->ops.clear_vfta(hw);
    >>> >
    >>> > -     /* Setup the receive address. */
    >>> > -     /*
    >>> > +     /* Setup the receive address.
    >>> >        * If, however, a locally administered address was assigned to
    >>> the
    >>> >        * 82571, we must reserve a RAR for it to work around an issue
    >>> where
    >>> >        * resetting one port will reload the MAC on the other port.
    >>> > @@ -1277,8 +1246,7 @@ static s32 e1000_init_hw_82571(struct e1
    >>> >               break;
    >>> >       }
    >>> >
    >>> > -     /*
    >>> > -      * Clear all of the statistics registers (clear on read).  It is
    >>> > +     /* Clear all of the statistics registers (clear on read).  It is
    >>> >        * important that we do this after we have tried to establish
    >>> link
    >>> >        * because the symbol error count will increment wildly if there
    >>> >        * is no link.
    >>> > @@ -1377,8 +1345,7 @@ static void e1000_initialize_hw_bits_825
    >>> >               E1000_WRITE_REG(hw, E1000_PBA_ECC, reg);
    >>> >       }
    >>> >
    >>> > -     /*
    >>> > -      * Workaround for hardware errata.
    >>> > +     /* Workaround for hardware errata.
    >>> >        * Ensure that DMA Dynamic Clock gating is disabled on 82571 and
    >>> 82572
    >>> >        */
    >>> >       if ((hw->mac.type == e1000_82571) ||
    >>> > @@ -1388,6 +1355,15 @@ static void e1000_initialize_hw_bits_825
    >>> >               E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg);
    >>> >       }
    >>> >
    >>> > +     /* Disable IPv6 extension header parsing because some malformed
    >>> > +      * IPv6 headers can hang the Rx.
    >>> > +      */
    >>> > +     if (hw->mac.type <= e1000_82573) {
    >>> > +             reg = E1000_READ_REG(hw, E1000_RFCTL);
    >>> > +             reg |= (E1000_RFCTL_IPV6_EX_DIS |
    >>> E1000_RFCTL_NEW_IPV6_EXT_DIS);
    >>> > +             E1000_WRITE_REG(hw, E1000_RFCTL, reg);
    >>> > +     }
    >>> > +
    >>> >       /* PCI-Ex Control Registers */
    >>> >       switch (hw->mac.type) {
    >>> >       case e1000_82574:
    >>> > @@ -1396,8 +1372,7 @@ static void e1000_initialize_hw_bits_825
    >>> >               reg |= (1 << 22);
    >>> >               E1000_WRITE_REG(hw, E1000_GCR, reg);
    >>> >
    >>> > -             /*
    >>> > -              * Workaround for hardware errata.
    >>> > +             /* Workaround for hardware errata.
    >>> >                * apply workaround for hardware errata documented in
    >>> errata
    >>> >                * docs Fixes issue where some error prone or unreliable
    >>> PCIe
    >>> >                * completions are occurring, particularly with ASPM
    >>> enabled.
    >>> > @@ -1435,25 +1410,25 @@ static void e1000_clear_vfta_82571(struc
    >>> >       case e1000_82574:
    >>> >       case e1000_82583:
    >>> >               if (hw->mng_cookie.vlan_id != 0) {
    >>> > -                     /*
    >>> > -                      * The VFTA is a 4096b bit-field, each
    >>> identifying
    >>> > +                     /* The VFTA is a 4096b bit-field, each
    >>> identifying
    >>> >                        * a single VLAN ID.  The following operations
    >>> >                        * determine which 32b entry (i.e. offset) into
    >>> the
    >>> >                        * array we want to set the VLAN ID (i.e. bit) of
    >>> >                        * the manageability unit.
    >>> >                        */
    >>> >                       vfta_offset = (hw->mng_cookie.vlan_id >>
    >>> > -                             E1000_VFTA_ENTRY_SHIFT) &
    >>> E1000_VFTA_ENTRY_MASK;
    >>> > -                     vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id &
    >>> > -                             E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
    >>> > +                                    E1000_VFTA_ENTRY_SHIFT) &
    >>> > +                         E1000_VFTA_ENTRY_MASK;
    >>> > +                     vfta_bit_in_reg =
    >>> > +                         1 << (hw->mng_cookie.vlan_id &
    >>> > +                               E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
    >>> >               }
    >>> >               break;
    >>> >       default:
    >>> >               break;
    >>> >       }
    >>> >       for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) {
    >>> > -             /*
    >>> > -              * If the offset we want to clear is the same offset of
    >>> the
    >>> > +             /* If the offset we want to clear is the same offset of
    >>> the
    >>> >                * manageability VLAN ID, then clear all bits except
    >>> that of
    >>> >                * the manageability unit.
    >>> >                */
    >>> > @@ -1495,8 +1470,7 @@ static s32 e1000_led_on_82574(struct e10
    >>> >
    >>> >       ctrl = hw->mac.ledctl_mode2;
    >>> >       if (!(E1000_STATUS_LU & E1000_READ_REG(hw, E1000_STATUS))) {
    >>> > -             /*
    >>> > -              * If no link, then turn LED on by setting the invert bit
    >>> > +             /* If no link, then turn LED on by setting the invert bit
    >>> >                * for each LED that's "on" (0x0E) in ledctl_mode2.
    >>> >                */
    >>> >               for (i = 0; i < 4; i++)
    >>> > @@ -1519,30 +1493,28 @@ bool e1000_check_phy_82574(struct e1000_
    >>> >  {
    >>> >       u16 status_1kbt = 0;
    >>> >       u16 receive_errors = 0;
    >>> > -     bool phy_hung = FALSE;
    >>> > -     s32 ret_val = E1000_SUCCESS;
    >>> > +     s32 ret_val;
    >>> >
    >>> >       DEBUGFUNC("e1000_check_phy_82574");
    >>> >
    >>> > -     /*
    >>> > -      * Read PHY Receive Error counter first, if its is max - all F's
    >>> then
    >>> > +     /* Read PHY Receive Error counter first, if its is max - all F's
    >>> then
    >>> >        * read the Base1000T status register If both are max then PHY
    >>> is hung.
    >>> >        */
    >>> >       ret_val = hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER,
    >>> >                                      &receive_errors);
    >>> >       if (ret_val)
    >>> > -             goto out;
    >>> > +             return FALSE;
    >>> >       if (receive_errors == E1000_RECEIVE_ERROR_MAX) {
    >>> >               ret_val = hw->phy.ops.read_reg(hw,
    >>> E1000_BASE1000T_STATUS,
    >>> >                                              &status_1kbt);
    >>> >               if (ret_val)
    >>> > -                     goto out;
    >>> > +                     return FALSE;
    >>> >               if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) ==
    >>> >                   E1000_IDLE_ERROR_COUNT_MASK)
    >>> > -                     phy_hung = TRUE;
    >>> > +                     return TRUE;
    >>> >       }
    >>> > -out:
    >>> > -     return phy_hung;
    >>> > +
    >>> > +     return FALSE;
    >>> >  }
    >>> >
    >>> >
    >>> > @@ -1560,8 +1532,7 @@ static s32 e1000_setup_link_82571(struct
    >>> >  {
    >>> >       DEBUGFUNC("e1000_setup_link_82571");
    >>> >
    >>> > -     /*
    >>> > -      * 82573 does not have a word in the NVM to determine
    >>> > +     /* 82573 does not have a word in the NVM to determine
    >>> >        * the default flow control setting, so we explicitly
    >>> >        * set it to full.
    >>> >        */
    >>> > @@ -1608,17 +1579,14 @@ static s32 e1000_setup_copper_link_82571
    >>> >               ret_val = e1000_copper_link_setup_igp(hw);
    >>> >               break;
    >>> >       default:
    >>> > -             ret_val = -E1000_ERR_PHY;
    >>> > +             return -E1000_ERR_PHY;
    >>> >               break;
    >>> >       }
    >>> >
    >>> >       if (ret_val)
    >>> > -             goto out;
    >>> > -
    >>> > -     ret_val = e1000_setup_copper_link_generic(hw);
    >>> > +             return ret_val;
    >>> >
    >>> > -out:
    >>> > -     return ret_val;
    >>> > +     return e1000_setup_copper_link_generic(hw);
    >>> >  }
    >>> >
    >>> >  /**
    >>> > @@ -1635,8 +1603,7 @@ static s32 e1000_setup_fiber_serdes_link
    >>> >       switch (hw->mac.type) {
    >>> >       case e1000_82571:
    >>> >       case e1000_82572:
    >>> > -             /*
    >>> > -              * If SerDes loopback mode is entered, there is no form
    >>> > +             /* If SerDes loopback mode is entered, there is no form
    >>> >                * of reset to take the adapter out of that mode.  So we
    >>> >                * have to explicitly take the adapter out of loopback
    >>> >                * mode.  This prevents drivers from twiddling their
    >>> thumbs
    >>> > @@ -1685,16 +1652,17 @@ static s32 e1000_check_for_serdes_link_8
    >>> >
    >>> >       ctrl = E1000_READ_REG(hw, E1000_CTRL);
    >>> >       status = E1000_READ_REG(hw, E1000_STATUS);
    >>> > +     E1000_READ_REG(hw, E1000_RXCW);
    >>> > +     /* SYNCH bit and IV bit are sticky */
    >>> > +     usec_delay(10);
    >>> >       rxcw = E1000_READ_REG(hw, E1000_RXCW);
    >>> >
    >>> >       if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) {
    >>> > -
    >>> >               /* Receiver is synchronized with no invalid bits.  */
    >>> >               switch (mac->serdes_link_state) {
    >>> >               case e1000_serdes_link_autoneg_complete:
    >>> >                       if (!(status & E1000_STATUS_LU)) {
    >>> > -                             /*
    >>> > -                              * We have lost link, retry autoneg
    >>> before
    >>> > +                             /* We have lost link, retry autoneg
    >>> before
    >>> >                                * reporting link failure
    >>> >                                */
    >>> >                               mac->serdes_link_state =
    >>> > @@ -1707,15 +1675,12 @@ static s32 e1000_check_for_serdes_link_8
    >>> >                       break;
    >>> >
    >>> >               case e1000_serdes_link_forced_up:
    >>> > -                     /*
    >>> > -                      * If we are receiving /C/ ordered sets,
    >>> re-enable
    >>> > +                     /* If we are receiving /C/ ordered sets,
    >>> re-enable
    >>> >                        * auto-negotiation in the TXCW register and
    >>> disable
    >>> >                        * forced link in the Device Control register in
    >>> an
    >>> >                        * attempt to auto-negotiate with our link
    >>> partner.
    >>> > -                      * If the partner code word is null, stop forcing
    >>> > -                      * and restart auto negotiation.
    >>> >                        */
    >>> > -                     if ((rxcw & E1000_RXCW_C) || !(rxcw &
    >>> E1000_RXCW_CW))  {
    >>> > +                     if (rxcw & E1000_RXCW_C) {
    >>> >                               /* Enable autoneg, and unforce link up */
    >>> >                               E1000_WRITE_REG(hw, E1000_TXCW,
    >>> mac->txcw);
    >>> >                               E1000_WRITE_REG(hw, E1000_CTRL,
    >>> > @@ -1731,8 +1696,7 @@ static s32 e1000_check_for_serdes_link_8
    >>> >
    >>> >               case e1000_serdes_link_autoneg_progress:
    >>> >                       if (rxcw & E1000_RXCW_C) {
    >>> > -                             /*
    >>> > -                              * We received /C/ ordered sets, meaning
    >>> the
    >>> > +                             /* We received /C/ ordered sets, meaning
    >>> the
    >>> >                                * link partner has autonegotiated, and
    >>> we can
    >>> >                                * trust the Link Up (LU) status bit.
    >>> >                                */
    >>> > @@ -1748,8 +1712,7 @@ static s32 e1000_check_for_serdes_link_8
    >>> >                                       DEBUGOUT("AN_PROG   -> DOWN\n");
    >>> >                               }
    >>> >                       } else {
    >>> > -                             /*
    >>> > -                              * The link partner did not autoneg.
    >>> > +                             /* The link partner did not autoneg.
    >>> >                                * Force link up and full duplex, and
    >>> change
    >>> >                                * state to forced.
    >>> >                                */
    >>> > @@ -1774,8 +1737,7 @@ static s32 e1000_check_for_serdes_link_8
    >>> >
    >>> >               case e1000_serdes_link_down:
    >>> >               default:
    >>> > -                     /*
    >>> > -                      * The link was down but the receiver has now
    >>> gained
    >>> > +                     /* The link was down but the receiver has now
    >>> gained
    >>> >                        * valid sync, so lets see if we can bring the
    >>> link
    >>> >                        * up.
    >>> >                        */
    >>> > @@ -1794,17 +1756,18 @@ static s32 e1000_check_for_serdes_link_8
    >>> >                       mac->serdes_link_state = e1000_serdes_link_down;
    >>> >                       DEBUGOUT("ANYSTATE  -> DOWN\n");
    >>> >               } else {
    >>> > -                     /*
    >>> > -                      * Check several times, if Sync and Config
    >>> > -                      * both are consistently 1 then simply ignore
    >>> > -                      * the Invalid bit and restart Autoneg
    >>> > +                     /* Check several times, if SYNCH bit and CONFIG
    >>> > +                      * bit both are consistently 1 then simply ignore
    >>> > +                      * the IV bit and restart Autoneg
    >>> >                        */
    >>> >                       for (i = 0; i < AN_RETRY_COUNT; i++) {
    >>> >                               usec_delay(10);
    >>> >                               rxcw = E1000_READ_REG(hw, E1000_RXCW);
    >>> > -                             if ((rxcw & E1000_RXCW_IV) &&
    >>> > -                                 !((rxcw & E1000_RXCW_SYNCH) &&
    >>> > -                                   (rxcw & E1000_RXCW_C))) {
    >>> > +                             if ((rxcw & E1000_RXCW_SYNCH) &&
    >>> > +                                 (rxcw & E1000_RXCW_C))
    >>> > +                                     continue;
    >>> > +
    >>> > +                             if (rxcw & E1000_RXCW_IV) {
    >>> >                                       mac->serdes_has_link = FALSE;
    >>> >                                       mac->serdes_link_state =
    >>> >
    >>> e1000_serdes_link_down;
    >>> > @@ -1845,7 +1808,7 @@ static s32 e1000_valid_led_default_82571
    >>> >       ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data);
    >>> >       if (ret_val) {
    >>> >               DEBUGOUT("NVM Read Error\n");
    >>> > -             goto out;
    >>> > +             return ret_val;
    >>> >       }
    >>> >
    >>> >       switch (hw->mac.type) {
    >>> > @@ -1862,8 +1825,7 @@ static s32 e1000_valid_led_default_82571
    >>> >               break;
    >>> >       }
    >>> >
    >>> > -out:
    >>> > -     return ret_val;
    >>> > +     return E1000_SUCCESS;
    >>> >  }
    >>> >
    >>> >  /**
    >>> > @@ -1900,15 +1862,14 @@ void e1000_set_laa_state_82571(struct e1
    >>> >
    >>> >       /* If workaround is activated... */
    >>> >       if (state)
    >>> > -             /*
    >>> > -              * Hold a copy of the LAA in RAR[14] This is done so that
    >>> > +             /* Hold a copy of the LAA in RAR[14] This is done so that
    >>> >                * between the time RAR[0] gets clobbered and the time it
    >>> >                * gets fixed, the actual LAA is in one of the RARs and
    >>> no
    >>> >                * incoming packets directed to this port are dropped.
    >>> >                * Eventually the LAA will be in RAR[0] and RAR[14].
    >>> >                */
    >>> > -             e1000_rar_set_generic(hw, hw->mac.addr,
    >>> > -                                   hw->mac.rar_entry_count - 1);
    >>> > +             hw->mac.ops.rar_set(hw, hw->mac.addr,
    >>> > +                                 hw->mac.rar_entry_count - 1);
    >>> >       return;
    >>> >  }
    >>> >
    >>> > @@ -1925,25 +1886,23 @@ void e1000_set_laa_state_82571(struct e1
    >>> >  static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
    >>> >  {
    >>> >       struct e1000_nvm_info *nvm = &hw->nvm;
    >>> > -     s32 ret_val = E1000_SUCCESS;
    >>> > +     s32 ret_val;
    >>> >       u16 data;
    >>> >
    >>> >       DEBUGFUNC("e1000_fix_nvm_checksum_82571");
    >>> >
    >>> >       if (nvm->type != e1000_nvm_flash_hw)
    >>> > -             goto out;
    >>> > +             return E1000_SUCCESS;
    >>> >
    >>> > -     /*
    >>> > -      * Check bit 4 of word 10h.  If it is 0, firmware is done
    >>> updating
    >>> > +     /* Check bit 4 of word 10h.  If it is 0, firmware is done
    >>> updating
    >>> >        * 10h-12h.  Checksum may need to be fixed.
    >>> >        */
    >>> >
    >>> > *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    >>> > _______________________________________________
    >>> > svn-src-stable-8@freebsd.org mailing list
    >>> > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8
    >>> > To unsubscribe, send any mail to "
    >>> svn-src-stable-8-unsubscribe@freebsd.org"
    >>>
    >>
    >>
    >
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 08:06:45 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 01A11637;
     Thu, 28 Feb 2013 08:06:45 +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 E87171110;
     Thu, 28 Feb 2013 08:06:44 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S86iTM006389;
     Thu, 28 Feb 2013 08:06:44 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S86iG8006388;
     Thu, 28 Feb 2013 08:06:44 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201302280806.r1S86iG8006388@svn.freebsd.org>
    From: Xin LI 
    Date: Thu, 28 Feb 2013 08:06: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: r247449 - stable/9/etc/rc.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-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 08:06:45 -0000
    
    Author: delphij
    Date: Thu Feb 28 08:06:43 2013
    New Revision: 247449
    URL: http://svnweb.freebsd.org/changeset/base/247449
    
    Log:
      When getting the MIB, remove largest suffix instead of smallest suffix of
      =.  This makes the following syntax work:
      
      	dev.hdaa.4.nid25_config=as=1,seq=15
      
      This is a direct commit to RELENG_9 as this file have been replaced in
      -HEAD.
      
      Submitted by:	Andreas Nilsson 
    
    Modified:
      stable/9/etc/rc.d/sysctl
    
    Modified: stable/9/etc/rc.d/sysctl
    ==============================================================================
    --- stable/9/etc/rc.d/sysctl	Thu Feb 28 05:47:50 2013	(r247448)
    +++ stable/9/etc/rc.d/sysctl	Thu Feb 28 08:06:43 2013	(r247449)
    @@ -26,7 +26,7 @@ parse_file()
     			\#*|'')
     				;;
     			*)
    -				mib=${var%=*}
    +				mib=${var%%=*}
     				val=${var#*=}
     
     				if current_value=`${SYSCTL} -n ${mib} 2>/dev/null`; then
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 08:11:37 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 9FCE5B4D;
     Thu, 28 Feb 2013 08:11: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 78B3D1177;
     Thu, 28 Feb 2013 08:11:37 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S8BbHE008898;
     Thu, 28 Feb 2013 08:11:37 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S8BbnI008897;
     Thu, 28 Feb 2013 08:11:37 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201302280811.r1S8BbnI008897@svn.freebsd.org>
    From: Xin LI 
    Date: Thu, 28 Feb 2013 08:11:37 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247450 - stable/8/etc/rc.d
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 08:11:37 -0000
    
    Author: delphij
    Date: Thu Feb 28 08:11:36 2013
    New Revision: 247450
    URL: http://svnweb.freebsd.org/changeset/base/247450
    
    Log:
      When getting the MIB, remove largest suffix instead of smallest suffix of
      =.  This makes the following syntax work:
      
      	dev.hdaa.4.nid25_config=as=1,seq=15
      
      This is a direct commit to RELENG_8 as this file have been replaced in
      -HEAD.
      
      Submitted by:	Andreas Nilsson 
    
    Modified:
      stable/8/etc/rc.d/sysctl
    
    Modified: stable/8/etc/rc.d/sysctl
    ==============================================================================
    --- stable/8/etc/rc.d/sysctl	Thu Feb 28 08:06:43 2013	(r247449)
    +++ stable/8/etc/rc.d/sysctl	Thu Feb 28 08:11:36 2013	(r247450)
    @@ -26,7 +26,7 @@ parse_file()
     			\#*|'')
     				;;
     			*)
    -				mib=${var%=*}
    +				mib=${var%%=*}
     				val=${var#*=}
     
     				if current_value=`${SYSCTL} -n ${mib} 2>/dev/null`; then
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 08:19:56 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 6A3A9F6E;
     Thu, 28 Feb 2013 08:19:56 +0000 (UTC) (envelope-from jfv@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 5C94711D7;
     Thu, 28 Feb 2013 08:19:56 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1S8Jutv010041;
     Thu, 28 Feb 2013 08:19:56 GMT (envelope-from jfv@svn.freebsd.org)
    Received: (from jfv@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1S8JuOf010040;
     Thu, 28 Feb 2013 08:19:56 GMT (envelope-from jfv@svn.freebsd.org)
    Message-Id: <201302280819.r1S8JuOf010040@svn.freebsd.org>
    From: Jack F Vogel 
    Date: Thu, 28 Feb 2013 08:19:56 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247451 - stable/8/sys/conf
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 08:19:56 -0000
    
    Author: jfv
    Date: Thu Feb 28 08:19:55 2013
    New Revision: 247451
    URL: http://svnweb.freebsd.org/changeset/base/247451
    
    Log:
      Remove DEV_NETMAP from stable/8 options, this was suggested
      and approved by the owner, although there is code in some
      drivers in support of it, the feature itself is not fully
      supported in this release.
    
    Modified:
      stable/8/sys/conf/options
    
    Modified: stable/8/sys/conf/options
    ==============================================================================
    --- stable/8/sys/conf/options	Thu Feb 28 08:11:36 2013	(r247450)
    +++ stable/8/sys/conf/options	Thu Feb 28 08:19:55 2013	(r247451)
    @@ -682,7 +682,6 @@ ISAPNP			opt_isa.h
     
     # various 'device presence' options.
     DEV_BPF			opt_bpf.h
    -DEV_NETMAP		opt_global.h
     DEV_MCA			opt_mca.h
     DEV_CARP		opt_carp.h
     DEV_PTY			opt_tty.h
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 10:21:06 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 16D594B3;
     Thu, 28 Feb 2013 10:21:06 +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 ED824197C;
     Thu, 28 Feb 2013 10:21:05 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SAL5Bn047857;
     Thu, 28 Feb 2013 10:21:05 GMT (envelope-from mav@svn.freebsd.org)
    Received: (from mav@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SAL5NT047856;
     Thu, 28 Feb 2013 10:21:05 GMT (envelope-from mav@svn.freebsd.org)
    Message-Id: <201302281021.r1SAL5NT047856@svn.freebsd.org>
    From: Alexander Motin 
    Date: Thu, 28 Feb 2013 10:21:05 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247452 - head/sys/sys
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 10:21:06 -0000
    
    Author: mav
    Date: Thu Feb 28 10:21:04 2013
    New Revision: 247452
    URL: http://svnweb.freebsd.org/changeset/base/247452
    
    Log:
      Introduce sbintime_t type -- the simplified version of struct bintime,
      using 32.32 fixed point in form of single int64_t.  It is much easier to
      use in cases where additional precision and range of struct bintime is
      not required.
      
      Reviewed by:	bde (previous version), davide
    
    Modified:
      head/sys/sys/time.h
    
    Modified: head/sys/sys/time.h
    ==============================================================================
    --- head/sys/sys/time.h	Thu Feb 28 08:19:55 2013	(r247451)
    +++ head/sys/sys/time.h	Thu Feb 28 10:21:04 2013	(r247452)
    @@ -109,6 +109,37 @@ bintime_mul(struct bintime *bt, u_int x)
     	    ((a)->frac cmp (b)->frac) :					\
     	    ((a)->sec cmp (b)->sec))
     
    +typedef int64_t sbintime_t;
    +#define	SBT_1S	((sbintime_t)1 << 32)
    +#define	SBT_1M	(SBT_1S * 60)
    +#define	SBT_1MS	(SBT_1S / 1000)
    +#define	SBT_1US	(SBT_1S / 1000000)
    +#define	SBT_1NS (SBT_1S / 1000000000)  
    +
    +static __inline int
    +sbintime_getsec(sbintime_t sbt)
    +{
    +
    +	return (sbt >> 32);
    +}
    +
    +static __inline sbintime_t
    +bttosbt(const struct bintime bt)
    +{
    +
    +	return (((sbintime_t)bt.sec << 32) + (bt.frac >> 32));
    +}
    +
    +static __inline struct bintime
    +sbttobt(sbintime_t sbt)
    +{
    +	struct bintime bt;
    +	
    +	bt.sec = sbt >> 32;
    +	bt.frac = sbt << 32;
    +	return (bt);
    +}
    +
     /*-
      * Background information:
      *
    @@ -156,6 +187,42 @@ timeval2bintime(const struct timeval *tv
     	/* 18446744073709 = int(2^64 / 1000000) */
     	bt->frac = tv->tv_usec * (uint64_t)18446744073709LL;
     }
    +
    +static __inline struct timespec
    +sbttots(sbintime_t sbt)
    +{
    +	struct timespec ts;
    +
    +	ts.tv_sec = sbt >> 32;
    +	ts.tv_nsec = ((uint64_t)1000000000 * (uint32_t)sbt) >> 32;
    +	return (ts);
    +}
    +
    +static __inline sbintime_t
    +tstosbt(struct timespec ts)
    +{
    +
    +	return (((sbintime_t)ts.tv_sec << 32) +
    +	    (ts.tv_nsec * (((uint64_t)1 << 63) / 500000000) >> 32));
    +}
    +
    +static __inline struct timeval
    +sbttotv(sbintime_t sbt)
    +{
    +	struct timeval tv;
    +
    +	tv.tv_sec = sbt >> 32;
    +	tv.tv_usec = ((uint64_t)1000000 * (uint32_t)sbt) >> 32;
    +	return (tv);
    +}
    +
    +static __inline sbintime_t
    +tvtosbt(struct timeval tv)
    +{
    +
    +	return (((sbintime_t)tv.tv_sec << 32) +
    +	    (tv.tv_usec * (((uint64_t)1 << 63) / 500000) >> 32));
    +}
     #endif /* __BSD_VISIBLE */
     
     #ifdef _KERNEL
    @@ -317,6 +384,15 @@ void	binuptime(struct bintime *bt);
     void	nanouptime(struct timespec *tsp);
     void	microuptime(struct timeval *tvp);
     
    +static __inline sbintime_t
    +sbinuptime(void)
    +{
    +	struct bintime bt;
    +
    +	binuptime(&bt);
    +	return (bttosbt(bt));
    +}
    +
     void	bintime(struct bintime *bt);
     void	nanotime(struct timespec *tsp);
     void	microtime(struct timeval *tvp);
    @@ -325,6 +401,15 @@ void	getbinuptime(struct bintime *bt);
     void	getnanouptime(struct timespec *tsp);
     void	getmicrouptime(struct timeval *tvp);
     
    +static __inline sbintime_t
    +getsbinuptime(void)
    +{
    +	struct bintime bt;
    +
    +	getbinuptime(&bt);
    +	return (bttosbt(bt));
    +}
    +
     void	getbintime(struct bintime *bt);
     void	getnanotime(struct timespec *tsp);
     void	getmicrotime(struct timeval *tvp);
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 10:46:56 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id D4B87E87;
     Thu, 28 Feb 2013 10:46:56 +0000 (UTC)
     (envelope-from davide@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 AF9EA1A99;
     Thu, 28 Feb 2013 10:46:56 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SAkuJD054835;
     Thu, 28 Feb 2013 10:46:56 GMT (envelope-from davide@svn.freebsd.org)
    Received: (from davide@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SAksKF054820;
     Thu, 28 Feb 2013 10:46:54 GMT (envelope-from davide@svn.freebsd.org)
    Message-Id: <201302281046.r1SAksKF054820@svn.freebsd.org>
    From: Davide Italiano 
    Date: Thu, 28 Feb 2013 10:46:54 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247454 - in head/sys: amd64/amd64 dev/acpica i386/i386
     ia64/ia64 kern pc98/pc98 powerpc/powerpc powerpc/ps3 powerpc/wii sys
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 10:46:57 -0000
    
    Author: davide
    Date: Thu Feb 28 10:46:54 2013
    New Revision: 247454
    URL: http://svnweb.freebsd.org/changeset/base/247454
    
    Log:
      MFcalloutng:
      When CPU becomes idle, cpu_idleclock() calculates time to the next timer
      event in order to reprogram hw timer. Return that time in sbintime_t to
      the caller and pass it to acpi_cpu_idle(), where it can be used as one
      more factor (quite precise) to extimate furter sleep time and choose
      optimal sleep state. This is a preparatory change for further callout
      improvements will be committed in the next days.
      
      The commmit is not targeted for MFC.
    
    Modified:
      head/sys/amd64/amd64/machdep.c
      head/sys/dev/acpica/acpi_cpu.c
      head/sys/i386/i386/machdep.c
      head/sys/ia64/ia64/machdep.c
      head/sys/kern/kern_clocksource.c
      head/sys/pc98/pc98/machdep.c
      head/sys/powerpc/powerpc/cpu.c
      head/sys/powerpc/ps3/platform_ps3.c
      head/sys/powerpc/wii/platform_wii.c
      head/sys/sys/proc.h
      head/sys/sys/systm.h
    
    Modified: head/sys/amd64/amd64/machdep.c
    ==============================================================================
    --- head/sys/amd64/amd64/machdep.c	Thu Feb 28 10:45:16 2013	(r247453)
    +++ head/sys/amd64/amd64/machdep.c	Thu Feb 28 10:46:54 2013	(r247454)
    @@ -658,7 +658,7 @@ cpu_halt(void)
     		halt();
     }
     
    -void (*cpu_idle_hook)(void) = NULL;	/* ACPI idle hook. */
    +void (*cpu_idle_hook)(sbintime_t) = NULL;	/* ACPI idle hook. */
     static int	cpu_ident_amdc1e = 0;	/* AMD C1E supported. */
     static int	idle_mwait = 1;		/* Use MONITOR/MWAIT for short idle. */
     TUNABLE_INT("machdep.idle_mwait", &idle_mwait);
    @@ -670,7 +670,7 @@ SYSCTL_INT(_machdep, OID_AUTO, idle_mwai
     #define	STATE_SLEEPING	0x2
     
     static void
    -cpu_idle_acpi(int busy)
    +cpu_idle_acpi(sbintime_t sbt)
     {
     	int *state;
     
    @@ -682,14 +682,14 @@ cpu_idle_acpi(int busy)
     	if (sched_runnable())
     		enable_intr();
     	else if (cpu_idle_hook)
    -		cpu_idle_hook();
    +		cpu_idle_hook(sbt);
     	else
     		__asm __volatile("sti; hlt");
     	*state = STATE_RUNNING;
     }
     
     static void
    -cpu_idle_hlt(int busy)
    +cpu_idle_hlt(sbintime_t sbt)
     {
     	int *state;
     
    @@ -730,7 +730,7 @@ cpu_idle_hlt(int busy)
     #define	MWAIT_C4	0x30
     
     static void
    -cpu_idle_mwait(int busy)
    +cpu_idle_mwait(sbintime_t sbt)
     {
     	int *state;
     
    @@ -753,7 +753,7 @@ cpu_idle_mwait(int busy)
     }
     
     static void
    -cpu_idle_spin(int busy)
    +cpu_idle_spin(sbintime_t sbt)
     {
     	int *state;
     	int i;
    @@ -802,12 +802,13 @@ cpu_probe_amdc1e(void)
     	}
     }
     
    -void (*cpu_idle_fn)(int) = cpu_idle_acpi;
    +void (*cpu_idle_fn)(sbintime_t) = cpu_idle_acpi;
     
     void
     cpu_idle(int busy)
     {
     	uint64_t msr;
    +	sbintime_t sbt = -1;
     
     	CTR2(KTR_SPARE2, "cpu_idle(%d) at %d",
     	    busy, curcpu);
    @@ -825,7 +826,7 @@ cpu_idle(int busy)
     	/* If we have time - switch timers into idle mode. */
     	if (!busy) {
     		critical_enter();
    -		cpu_idleclock();
    +		sbt = cpu_idleclock();
     	}
     
     	/* Apply AMD APIC timer C1E workaround. */
    @@ -836,7 +837,7 @@ cpu_idle(int busy)
     	}
     
     	/* Call main idle method. */
    -	cpu_idle_fn(busy);
    +	cpu_idle_fn(sbt);
     
     	/* Switch timers mack into active mode. */
     	if (!busy) {
    
    Modified: head/sys/dev/acpica/acpi_cpu.c
    ==============================================================================
    --- head/sys/dev/acpica/acpi_cpu.c	Thu Feb 28 10:45:16 2013	(r247453)
    +++ head/sys/dev/acpica/acpi_cpu.c	Thu Feb 28 10:46:54 2013	(r247454)
    @@ -168,7 +168,7 @@ static int	acpi_cpu_cx_cst(struct acpi_c
     static void	acpi_cpu_startup(void *arg);
     static void	acpi_cpu_startup_cx(struct acpi_cpu_softc *sc);
     static void	acpi_cpu_cx_list(struct acpi_cpu_softc *sc);
    -static void	acpi_cpu_idle(void);
    +static void	acpi_cpu_idle(sbintime_t sbt);
     static void	acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context);
     static int	acpi_cpu_quirks(void);
     static int	acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARGS);
    @@ -954,13 +954,13 @@ acpi_cpu_startup_cx(struct acpi_cpu_soft
      * interrupts are re-enabled.
      */
     static void
    -acpi_cpu_idle()
    +acpi_cpu_idle(sbintime_t sbt)
     {
         struct	acpi_cpu_softc *sc;
         struct	acpi_cx *cx_next;
         uint64_t	cputicks;
         uint32_t	start_time, end_time;
    -    int		bm_active, cx_next_idx, i;
    +    int		bm_active, cx_next_idx, i, us;
     
         /*
          * Look up our CPU id to get our softc.  If it's NULL, we'll use C1
    @@ -980,13 +980,16 @@ acpi_cpu_idle()
         }
     
         /* Find the lowest state that has small enough latency. */
    +    us = sc->cpu_prev_sleep;
    +    if (sbt >= 0 && us > sbt / SBT_1US)
    +	us = sbt / SBT_1US;
         cx_next_idx = 0;
         if (cpu_disable_deep_sleep)
     	i = min(sc->cpu_cx_lowest, sc->cpu_non_c3);
         else
     	i = sc->cpu_cx_lowest;
         for (; i >= 0; i--) {
    -	if (sc->cpu_cx_states[i].trans_lat * 3 <= sc->cpu_prev_sleep) {
    +	if (sc->cpu_cx_states[i].trans_lat * 3 <= us) {
     	    cx_next_idx = i;
     	    break;
     	}
    
    Modified: head/sys/i386/i386/machdep.c
    ==============================================================================
    --- head/sys/i386/i386/machdep.c	Thu Feb 28 10:45:16 2013	(r247453)
    +++ head/sys/i386/i386/machdep.c	Thu Feb 28 10:46:54 2013	(r247454)
    @@ -1220,7 +1220,7 @@ cpu_halt(void)
     int scheduler_running;
     
     static void
    -cpu_idle_hlt(int busy)
    +cpu_idle_hlt(sbintime_t sbt)
     {
     
     	scheduler_running = 1;
    @@ -1241,7 +1241,7 @@ cpu_halt(void)
     
     #endif
     
    -void (*cpu_idle_hook)(void) = NULL;	/* ACPI idle hook. */
    +void (*cpu_idle_hook)(sbintime_t) = NULL;	/* ACPI idle hook. */
     static int	cpu_ident_amdc1e = 0;	/* AMD C1E supported. */
     static int	idle_mwait = 1;		/* Use MONITOR/MWAIT for short idle. */
     TUNABLE_INT("machdep.idle_mwait", &idle_mwait);
    @@ -1253,7 +1253,7 @@ SYSCTL_INT(_machdep, OID_AUTO, idle_mwai
     #define	STATE_SLEEPING	0x2
     
     static void
    -cpu_idle_acpi(int busy)
    +cpu_idle_acpi(sbintime_t sbt)
     {
     	int *state;
     
    @@ -1265,7 +1265,7 @@ cpu_idle_acpi(int busy)
     	if (sched_runnable())
     		enable_intr();
     	else if (cpu_idle_hook)
    -		cpu_idle_hook();
    +		cpu_idle_hook(sbt);
     	else
     		__asm __volatile("sti; hlt");
     	*state = STATE_RUNNING;
    @@ -1273,7 +1273,7 @@ cpu_idle_acpi(int busy)
     
     #ifndef XEN
     static void
    -cpu_idle_hlt(int busy)
    +cpu_idle_hlt(sbintime_t sbt)
     {
     	int *state;
     
    @@ -1315,7 +1315,7 @@ cpu_idle_hlt(int busy)
     #define	MWAIT_C4	0x30
     
     static void
    -cpu_idle_mwait(int busy)
    +cpu_idle_mwait(sbintime_t sbt)
     {
     	int *state;
     
    @@ -1338,7 +1338,7 @@ cpu_idle_mwait(int busy)
     }
     
     static void
    -cpu_idle_spin(int busy)
    +cpu_idle_spin(sbintime_t sbt)
     {
     	int *state;
     	int i;
    @@ -1388,9 +1388,9 @@ cpu_probe_amdc1e(void)
     }
     
     #ifdef XEN
    -void (*cpu_idle_fn)(int) = cpu_idle_hlt;
    +void (*cpu_idle_fn)(sbintime_t) = cpu_idle_hlt;
     #else
    -void (*cpu_idle_fn)(int) = cpu_idle_acpi;
    +void (*cpu_idle_fn)(sbintime_t) = cpu_idle_acpi;
     #endif
     
     void
    @@ -1399,6 +1399,7 @@ cpu_idle(int busy)
     #ifndef XEN
     	uint64_t msr;
     #endif
    +	sbintime_t sbt = -1;
     
     	CTR2(KTR_SPARE2, "cpu_idle(%d) at %d",
     	    busy, curcpu);
    @@ -1418,7 +1419,7 @@ cpu_idle(int busy)
     	/* If we have time - switch timers into idle mode. */
     	if (!busy) {
     		critical_enter();
    -		cpu_idleclock();
    +		sbt = cpu_idleclock();
     	}
     
     #ifndef XEN
    @@ -1431,7 +1432,7 @@ cpu_idle(int busy)
     #endif
     
     	/* Call main idle method. */
    -	cpu_idle_fn(busy);
    +	cpu_idle_fn(sbt);
     
     	/* Switch timers mack into active mode. */
     	if (!busy) {
    
    Modified: head/sys/ia64/ia64/machdep.c
    ==============================================================================
    --- head/sys/ia64/ia64/machdep.c	Thu Feb 28 10:45:16 2013	(r247453)
    +++ head/sys/ia64/ia64/machdep.c	Thu Feb 28 10:46:54 2013	(r247454)
    @@ -171,7 +171,7 @@ extern vm_offset_t ksym_start, ksym_end;
     struct msgbuf *msgbufp = NULL;
     
     /* Other subsystems (e.g., ACPI) can hook this later. */
    -void (*cpu_idle_hook)(void) = NULL;
    +void (*cpu_idle_hook)(sbintime_t) = NULL;
     
     struct kva_md_info kmi;
     
    @@ -408,10 +408,11 @@ void
     cpu_idle(int busy)
     {
     	register_t ie;
    +	sbintime_t sbt = -1;
     
     	if (!busy) {
     		critical_enter();
    -		cpu_idleclock();
    +		sbt = cpu_idleclock();
     	}
     
     	ie = intr_disable();
    @@ -420,7 +421,7 @@ cpu_idle(int busy)
     	if (sched_runnable())
     		ia64_enable_intr();
     	else if (cpu_idle_hook != NULL) {
    -		(*cpu_idle_hook)();
    +		(*cpu_idle_hook)(sbt);
     		/* The hook must enable interrupts! */
     	} else {
     		ia64_call_pal_static(PAL_HALT_LIGHT, 0, 0, 0);
    
    Modified: head/sys/kern/kern_clocksource.c
    ==============================================================================
    --- head/sys/kern/kern_clocksource.c	Thu Feb 28 10:45:16 2013	(r247453)
    +++ head/sys/kern/kern_clocksource.c	Thu Feb 28 10:46:54 2013	(r247454)
    @@ -767,7 +767,7 @@ cpu_stopprofclock(void)
     /*
      * Switch to idle mode (all ticks handled).
      */
    -void
    +sbintime_t
     cpu_idleclock(void)
     {
     	struct bintime now, t;
    @@ -779,7 +779,7 @@ cpu_idleclock(void)
     	    || curcpu == CPU_FIRST()
     #endif
     	    )
    -		return;
    +		return (-1);
     	state = DPCPU_PTR(timerstate);
     	if (periodic)
     		now = state->now;
    @@ -795,6 +795,8 @@ cpu_idleclock(void)
     	if (!periodic)
     		loadtimer(&now, 0);
     	ET_HW_UNLOCK(state);
    +	bintime_sub(&t, &now);
    +	return (MAX(bttosbt(t), 0));
     }
     
     /*
    
    Modified: head/sys/pc98/pc98/machdep.c
    ==============================================================================
    --- head/sys/pc98/pc98/machdep.c	Thu Feb 28 10:45:16 2013	(r247453)
    +++ head/sys/pc98/pc98/machdep.c	Thu Feb 28 10:46:54 2013	(r247454)
    @@ -1145,7 +1145,7 @@ SYSCTL_INT(_machdep, OID_AUTO, idle_mwai
     #define	STATE_SLEEPING	0x2
     
     static void
    -cpu_idle_hlt(int busy)
    +cpu_idle_hlt(sbintime_t sbt)
     {
     	int *state;
     
    @@ -1186,7 +1186,7 @@ cpu_idle_hlt(int busy)
     #define	MWAIT_C4	0x30
     
     static void
    -cpu_idle_mwait(int busy)
    +cpu_idle_mwait(sbintime_t sbt)
     {
     	int *state;
     
    @@ -1209,7 +1209,7 @@ cpu_idle_mwait(int busy)
     }
     
     static void
    -cpu_idle_spin(int busy)
    +cpu_idle_spin(sbintime_t sbt)
     {
     	int *state;
     	int i;
    @@ -1229,11 +1229,12 @@ cpu_idle_spin(int busy)
     	}
     }
     
    -void (*cpu_idle_fn)(int) = cpu_idle_hlt;
    +void (*cpu_idle_fn)(sbintime_t) = cpu_idle_hlt;
     
     void
     cpu_idle(int busy)
     {
    +	sbintime_t sbt = -1;
     
     	CTR2(KTR_SPARE2, "cpu_idle(%d) at %d",
     	    busy, curcpu);
    @@ -1251,11 +1252,11 @@ cpu_idle(int busy)
     	/* If we have time - switch timers into idle mode. */
     	if (!busy) {
     		critical_enter();
    -		cpu_idleclock();
    +		sbt = cpu_idleclock();
     	}
     
     	/* Call main idle method. */
    -	cpu_idle_fn(busy);
    +	cpu_idle_fn(sbt);
     
     	/* Switch timers mack into active mode. */
     	if (!busy) {
    
    Modified: head/sys/powerpc/powerpc/cpu.c
    ==============================================================================
    --- head/sys/powerpc/powerpc/cpu.c	Thu Feb 28 10:45:16 2013	(r247453)
    +++ head/sys/powerpc/powerpc/cpu.c	Thu Feb 28 10:46:54 2013	(r247454)
    @@ -79,9 +79,9 @@ static void	cpu_970_setup(int cpuid, uin
     static void	cpu_booke_setup(int cpuid, uint16_t vers);
     
     int powerpc_pow_enabled;
    -void (*cpu_idle_hook)(void) = NULL;
    -static void	cpu_idle_60x(void);
    -static void	cpu_idle_booke(void);
    +void (*cpu_idle_hook)(sbintime_t) = NULL;
    +static void	cpu_idle_60x(sbintime_t);
    +static void	cpu_idle_booke(sbintime_t);
     
     struct cputab {
     	const char	*name;
    @@ -516,6 +516,7 @@ cpu_feature_bit(SYSCTL_HANDLER_ARGS)
     void
     cpu_idle(int busy)
     {
    +	sbintime_t sbt = -1;
     
     #ifdef INVARIANTS
     	if ((mfmsr() & PSL_EE) != PSL_EE) {
    @@ -531,9 +532,9 @@ cpu_idle(int busy)
     	if (cpu_idle_hook != NULL) {
     		if (!busy) {
     			critical_enter();
    -			cpu_idleclock();
    +			sbt = cpu_idleclock();
     		}
    -		cpu_idle_hook();
    +		cpu_idle_hook(sbt);
     		if (!busy) {
     			cpu_activeclock();
     			critical_exit();
    @@ -551,7 +552,7 @@ cpu_idle_wakeup(int cpu)
     }
     
     static void
    -cpu_idle_60x(void)
    +cpu_idle_60x(sbintime_t sbt)
     {
     	register_t msr;
     	uint16_t vers;
    @@ -586,7 +587,7 @@ cpu_idle_60x(void)
     }
     
     static void
    -cpu_idle_booke(void)
    +cpu_idle_booke(sbintime_t sbt)
     {
     	register_t msr;
     
    
    Modified: head/sys/powerpc/ps3/platform_ps3.c
    ==============================================================================
    --- head/sys/powerpc/ps3/platform_ps3.c	Thu Feb 28 10:45:16 2013	(r247453)
    +++ head/sys/powerpc/ps3/platform_ps3.c	Thu Feb 28 10:46:54 2013	(r247454)
    @@ -70,7 +70,7 @@ static int ps3_smp_start_cpu(platform_t,
     static struct cpu_group *ps3_smp_topo(platform_t);
     #endif
     static void ps3_reset(platform_t);
    -static void ps3_cpu_idle(void);
    +static void ps3_cpu_idle(sbintime_t);
     
     static platform_method_t ps3_methods[] = {
     	PLATFORMMETHOD(platform_probe, 		ps3_probe),
    @@ -245,7 +245,7 @@ ps3_real_maxaddr(platform_t plat)
     }
     
     static void
    -ps3_cpu_idle(void)
    +ps3_cpu_idle(sbintime_t sbt)
     {
     	lv1_pause(0);
     }
    
    Modified: head/sys/powerpc/wii/platform_wii.c
    ==============================================================================
    --- head/sys/powerpc/wii/platform_wii.c	Thu Feb 28 10:45:16 2013	(r247453)
    +++ head/sys/powerpc/wii/platform_wii.c	Thu Feb 28 10:46:54 2013	(r247454)
    @@ -60,7 +60,7 @@ static void		wii_mem_regions(platform_t,
     			    int *, struct mem_region **, int *);
     static unsigned long	wii_timebase_freq(platform_t, struct cpuref *cpuref);
     static void		wii_reset(platform_t);
    -static void		wii_cpu_idle(void);
    +static void		wii_cpu_idle(sbintime_t sbt);
     
     static platform_method_t wii_methods[] = {
     	PLATFORMMETHOD(platform_probe,		wii_probe),
    @@ -155,6 +155,6 @@ wii_reset(platform_t plat)
     }
     
     static void
    -wii_cpu_idle(void)
    +wii_cpu_idle(sbintime_t sbt)
     {
     }
    
    Modified: head/sys/sys/proc.h
    ==============================================================================
    --- head/sys/sys/proc.h	Thu Feb 28 10:45:16 2013	(r247453)
    +++ head/sys/sys/proc.h	Thu Feb 28 10:46:54 2013	(r247454)
    @@ -908,7 +908,7 @@ void	tidhash_add(struct thread *);
     void	tidhash_remove(struct thread *);
     void	cpu_idle(int);
     int	cpu_idle_wakeup(int);
    -extern	void (*cpu_idle_hook)(void);	/* Hook to machdep CPU idler. */
    +extern	void (*cpu_idle_hook)(sbintime_t);	/* Hook to machdep CPU idler. */
     void	cpu_switch(struct thread *, struct thread *, struct mtx *);
     void	cpu_throw(struct thread *, struct thread *) __dead2;
     void	unsleep(struct thread *);
    
    Modified: head/sys/sys/systm.h
    ==============================================================================
    --- head/sys/sys/systm.h	Thu Feb 28 10:45:16 2013	(r247453)
    +++ head/sys/sys/systm.h	Thu Feb 28 10:46:54 2013	(r247454)
    @@ -44,6 +44,7 @@
     #include 
     #include 
     #include 		/* for people using printf mainly */
    +#include 
     
     extern int cold;		/* nonzero if we are doing a cold boot */
     extern int rebooting;		/* kern_reboot() has been called. */
    @@ -267,7 +268,7 @@ void	startprofclock(struct proc *);
     void	stopprofclock(struct proc *);
     void	cpu_startprofclock(void);
     void	cpu_stopprofclock(void);
    -void	cpu_idleclock(void);
    +sbintime_t 	cpu_idleclock(void);
     void	cpu_activeclock(void);
     extern int	cpu_can_deep_sleep;
     extern int	cpu_disable_deep_sleep;
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 11:27:03 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 2A5DCD62;
     Thu, 28 Feb 2013 11:27:03 +0000 (UTC)
     (envelope-from davide@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 05E6A1C0E;
     Thu, 28 Feb 2013 11:27:03 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SBR2oD068277;
     Thu, 28 Feb 2013 11:27:02 GMT (envelope-from davide@svn.freebsd.org)
    Received: (from davide@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SBR2VE068276;
     Thu, 28 Feb 2013 11:27:02 GMT (envelope-from davide@svn.freebsd.org)
    Message-Id: <201302281127.r1SBR2VE068276@svn.freebsd.org>
    From: Davide Italiano 
    Date: Thu, 28 Feb 2013 11:27:02 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247460 - head/sys/dev/acpica
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 11:27:03 -0000
    
    Author: davide
    Date: Thu Feb 28 11:27:01 2013
    New Revision: 247460
    URL: http://svnweb.freebsd.org/changeset/base/247460
    
    Log:
      MFcalloutng (r247427 by mav):
      We don't need any precision here. Let it be fast and dirty shift then
      slow and excessively precise 64-bit division.
    
    Modified:
      head/sys/dev/acpica/acpi_cpu.c
    
    Modified: head/sys/dev/acpica/acpi_cpu.c
    ==============================================================================
    --- head/sys/dev/acpica/acpi_cpu.c	Thu Feb 28 10:59:40 2013	(r247459)
    +++ head/sys/dev/acpica/acpi_cpu.c	Thu Feb 28 11:27:01 2013	(r247460)
    @@ -981,8 +981,8 @@ acpi_cpu_idle(sbintime_t sbt)
     
         /* Find the lowest state that has small enough latency. */
         us = sc->cpu_prev_sleep;
    -    if (sbt >= 0 && us > sbt / SBT_1US)
    -	us = sbt / SBT_1US;
    +    if (sbt >= 0 && us > (sbt >> 12))
    +	us = (sbt >> 12);
         cx_next_idx = 0;
         if (cpu_disable_deep_sleep)
     	i = min(sc->cpu_cx_lowest, sc->cpu_non_c3);
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 12:03:17 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id CEB45770;
     Thu, 28 Feb 2013 12:03:17 +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 C0F7E1E67;
     Thu, 28 Feb 2013 12:03:17 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SC3Hcm079588;
     Thu, 28 Feb 2013 12:03:17 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SC3HYt079587;
     Thu, 28 Feb 2013 12:03:17 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201302281203.r1SC3HYt079587@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Thu, 28 Feb 2013 12:03:17 +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: r247461 - stable/9/etc/rc.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-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 12:03:17 -0000
    
    Author: des
    Date: Thu Feb 28 12:03:17 2013
    New Revision: 247461
    URL: http://svnweb.freebsd.org/changeset/base/247461
    
    Log:
      MFH (r240109): add a configtest command
    
    Modified:
      stable/9/etc/rc.d/sshd
    Directory Properties:
      stable/9/etc/   (props changed)
    
    Modified: stable/9/etc/rc.d/sshd
    ==============================================================================
    --- stable/9/etc/rc.d/sshd	Thu Feb 28 11:27:01 2013	(r247460)
    +++ stable/9/etc/rc.d/sshd	Thu Feb 28 12:03:17 2013	(r247461)
    @@ -14,8 +14,9 @@ rcvar="sshd_enable"
     command="/usr/sbin/${name}"
     keygen_cmd="sshd_keygen"
     start_precmd="sshd_precmd"
    +configtest_cmd="sshd_configtest"
     pidfile="/var/run/${name}.pid"
    -extra_commands="keygen reload"
    +extra_commands="configtest keygen reload"
     
     timeout=300
     
    @@ -87,6 +88,12 @@ sshd_keygen()
     	)
     }
     
    +sshd_configtest()
    +{
    +	echo "Performing sanity check on ${name} configuration."
    +	eval ${command} ${sshd_flags} -t
    +}
    +
     sshd_precmd()
     {
     	if [ ! -f /etc/ssh/ssh_host_key -o \
    @@ -96,6 +103,7 @@ sshd_precmd()
     		user_reseed
     		run_rc_command keygen
     	fi
    +	sshd_configtest
     }
     
     load_rc_config $name
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 13:46:08 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 2EEDFA42;
     Thu, 28 Feb 2013 13:46:08 +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 18F2B66D;
     Thu, 28 Feb 2013 13:46:08 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SDk7Cg010268;
     Thu, 28 Feb 2013 13:46:07 GMT (envelope-from mav@svn.freebsd.org)
    Received: (from mav@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SDk4tv010244;
     Thu, 28 Feb 2013 13:46:04 GMT (envelope-from mav@svn.freebsd.org)
    Message-Id: <201302281346.r1SDk4tv010244@svn.freebsd.org>
    From: Alexander Motin 
    Date: Thu, 28 Feb 2013 13:46:03 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247463 - in head: share/man/man9 sys/arm/allwinner
     sys/arm/arm sys/arm/broadcom/bcm2835 sys/arm/lpc sys/arm/mv sys/arm/ti/am335x
     sys/arm/versatile sys/dev/acpica sys/i386/xen sys/ia64/...
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 13:46:08 -0000
    
    Author: mav
    Date: Thu Feb 28 13:46:03 2013
    New Revision: 247463
    URL: http://svnweb.freebsd.org/changeset/base/247463
    
    Log:
      MFcalloutng:
      Switch eventtimers(9) from using struct bintime to sbintime_t.
      Even before this not a single driver really supported full dynamic range of
      struct bintime even in theory, not speaking about practical inexpediency.
      This change legitimates the status quo and cleans up the code.
    
    Modified:
      head/share/man/man9/eventtimers.9
      head/sys/arm/allwinner/timer.c
      head/sys/arm/arm/mpcore_timer.c
      head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c
      head/sys/arm/lpc/lpc_timer.c
      head/sys/arm/mv/timer.c
      head/sys/arm/ti/am335x/am335x_dmtimer.c
      head/sys/arm/versatile/sp804.c
      head/sys/dev/acpica/acpi_hpet.c
      head/sys/i386/xen/clock.c
      head/sys/ia64/ia64/clock.c
      head/sys/kern/kern_clocksource.c
      head/sys/kern/kern_et.c
      head/sys/mips/mips/tick.c
      head/sys/mips/nlm/tick.c
      head/sys/mips/rmi/tick.c
      head/sys/powerpc/aim/clock.c
      head/sys/powerpc/booke/clock.c
      head/sys/sparc64/sparc64/tick.c
      head/sys/sys/timeet.h
      head/sys/x86/isa/atrtc.c
      head/sys/x86/isa/clock.c
      head/sys/x86/x86/local_apic.c
    
    Modified: head/share/man/man9/eventtimers.9
    ==============================================================================
    --- head/share/man/man9/eventtimers.9	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/share/man/man9/eventtimers.9	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -1,5 +1,5 @@
     .\"
    -.\" Copyright (c) 2011 Alexander Motin 
    +.\" Copyright (c) 2011-2013 Alexander Motin 
     .\" All rights reserved.
     .\"
     .\" Redistribution and use in source and binary forms, with or without
    @@ -24,7 +24,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd December 14, 2011
    +.Dd February 25, 2013
     .Dt EVENTTIMERS 9
     .Os
     .Sh NAME
    @@ -36,7 +36,7 @@
     struct eventtimer;
     
     typedef int et_start_t(struct eventtimer *et,
    -    struct bintime *first, struct bintime *period);
    +    sbintime_t first, sbintime_t period);
     typedef int et_stop_t(struct eventtimer *et);
     typedef void et_event_cb_t(struct eventtimer *et, void *arg);
     typedef int et_deregister_cb_t(struct eventtimer *et, void *arg);
    @@ -53,8 +53,8 @@ struct eventtimer {
     	int			et_quality;
     	int			et_active;
     	uint64_t		et_frequency;
    -	struct bintime		et_min_period;
    -	struct bintime		et_max_period;
    +	sbintime_t		et_min_period;
    +	sbintime_t		et_max_period;
     	et_start_t		*et_start;
     	et_stop_t		*et_stop;
     	et_event_cb_t		*et_event_cb;
    @@ -75,7 +75,7 @@ struct eventtimer {
     .Ft int
     .Fn et_init "struct eventtimer *et" "et_event_cb_t *event" "et_deregister_cb_t *deregister" "void *arg"
     .Ft int
    -.Fn et_start "struct eventtimer *et" "struct bintime *first" "struct bintime *period"
    +.Fn et_start "struct eventtimer *et" "sbintime_t first" "sbintime_t period"
     .Ft int
     .Fn et_stop "struct eventtimer *et"
     .Ft int
    
    Modified: head/sys/arm/allwinner/timer.c
    ==============================================================================
    --- head/sys/arm/allwinner/timer.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/arm/allwinner/timer.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -95,7 +95,7 @@ int a10_timer_get_timerfreq(struct a10_t
     
     static u_int	a10_timer_get_timecount(struct timecounter *);
     static int	a10_timer_timer_start(struct eventtimer *,
    -    struct bintime *, struct bintime *);
    +    sbintime_t first, sbintime_t period);
     static int	a10_timer_timer_stop(struct eventtimer *);
     
     static uint64_t timer_read_counter64(void);
    @@ -193,12 +193,8 @@ a10_timer_attach(device_t dev)
     	sc->et.et_name = "a10_timer Eventtimer";
     	sc->et.et_flags = ET_FLAGS_ONESHOT | ET_FLAGS_PERIODIC;
     	sc->et.et_quality = 1000;
    -	sc->et.et_min_period.sec = 0;
    -	sc->et.et_min_period.frac =
    -	    ((0x00000005LLU << 32) / sc->et.et_frequency) << 32;
    -	sc->et.et_max_period.sec = 0xfffffff0U / sc->et.et_frequency;
    -	sc->et.et_max_period.frac =
    -	    ((0xfffffffeLLU << 32) / sc->et.et_frequency) << 32;
    +	sc->et.et_min_period = (0x00000005LLU << 32) / sc->et.et_frequency;
    +	sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency;
     	sc->et.et_start = a10_timer_timer_start;
     	sc->et.et_stop = a10_timer_timer_stop;
     	sc->et.et_priv = sc;
    @@ -225,8 +221,8 @@ a10_timer_attach(device_t dev)
     }
     
     static int
    -a10_timer_timer_start(struct eventtimer *et, struct bintime *first,
    -    struct bintime *period)
    +a10_timer_timer_start(struct eventtimer *et, sbintime_t first,
    +    sbintime_t period)
     {
     	struct a10_timer_softc *sc;
     	uint32_t count;
    @@ -234,26 +230,21 @@ a10_timer_timer_start(struct eventtimer 
     
     	sc = (struct a10_timer_softc *)et->et_priv;
     
    -	sc->sc_period = 0;
    -
    -	if (period != NULL) {
    -		sc->sc_period = (sc->et.et_frequency * (period->frac >> 32)) >> 32;
    -		sc->sc_period += sc->et.et_frequency * period->sec;
    -	}
    -	if (first == NULL)
    +	if (period != 0)
    +		sc->sc_period = ((uint32_t)et->et_frequency * period) >> 32;
    +	else
    +		sc->sc_period = 0;
    +	if (first != 0)
    +		count = ((uint32_t)et->et_frequency * first) >> 32;
    +	else
     		count = sc->sc_period;
    -	else {
    -		count = (sc->et.et_frequency * (first->frac >> 32)) >> 32;
    -		if (first->sec != 0)
    -			count += sc->et.et_frequency * first->sec;
    -	}
     
     	/* Update timer values */
     	timer_write_4(sc, SW_TIMER0_INT_VALUE_REG, sc->sc_period);
     	timer_write_4(sc, SW_TIMER0_CUR_VALUE_REG, count);
     
     	val = timer_read_4(sc, SW_TIMER0_CTRL_REG);
    -	if (first == NULL) {
    +	if (period != 0) {
     		/* periodic */
     		val |= TIMER_AUTORELOAD;
     	} else {
    
    Modified: head/sys/arm/arm/mpcore_timer.c
    ==============================================================================
    --- head/sys/arm/arm/mpcore_timer.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/arm/arm/mpcore_timer.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -167,31 +167,23 @@ arm_tmr_get_timecount(struct timecounter
      *	Always returns 0
      */
     static int
    -arm_tmr_start(struct eventtimer *et, struct bintime *first,
    -              struct bintime *period)
    +arm_tmr_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
     {
    -	struct arm_tmr_softc *sc = (struct arm_tmr_softc *)et->et_priv;
     	uint32_t load, count;
     	uint32_t ctrl;
     
     	ctrl = PRV_TIMER_CTRL_IRQ_ENABLE | PRV_TIMER_CTRL_TIMER_ENABLE;
     
    -	if (period != NULL) {
    -		load = (et->et_frequency * (period->frac >> 32)) >> 32;
    -		if (period->sec > 0)
    -			load += et->et_frequency * period->sec;
    +	if (period != 0) {
    +		load = ((uint32_t)et->et_frequency * period) >> 32;
     		ctrl |= PRV_TIMER_CTRL_AUTO_RELOAD;
    -	} else {
    +	} else
     		load = 0;
    -	}
     
    -	if (first != NULL) {
    -		count = (sc->et.et_frequency * (first->frac >> 32)) >> 32;
    -		if (first->sec != 0)
    -			count += sc->et.et_frequency * first->sec;
    -	} else {
    +	if (first != 0)
    +		count = ((uint32_t)et->et_frequency * first) >> 32;
    +	else
     		count = load;
    -	}
     
     	tmr_prv_write_4(PRV_TIMER_LOAD, load);
     	tmr_prv_write_4(PRV_TIMER_COUNT, count);
    @@ -330,12 +322,8 @@ arm_tmr_attach(device_t dev)
     	sc->et.et_quality = 1000;
     
     	sc->et.et_frequency = sc->clkfreq;
    -	sc->et.et_min_period.sec = 0;
    -	sc->et.et_min_period.frac =
    -            ((0x00000002LLU << 32) / sc->et.et_frequency) << 32;
    -	sc->et.et_max_period.sec = 0xfffffff0U / sc->et.et_frequency;
    -	sc->et.et_max_period.frac =
    -            ((0xfffffffeLLU << 32) / sc->et.et_frequency) << 32;
    +	sc->et.et_min_period = (0x00000002LLU << 32) / sc->et.et_frequency;
    +	sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency;
     	sc->et.et_start = arm_tmr_start;
     	sc->et.et_stop = arm_tmr_stop;
     	sc->et.et_priv = sc;
    
    Modified: head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c
    ==============================================================================
    --- head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -118,19 +118,16 @@ bcm_systimer_tc_get_timecount(struct tim
     }
     
     static int
    -bcm_systimer_start(struct eventtimer *et, struct bintime *first,
    -              struct bintime *period)
    +bcm_systimer_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
     {
     	struct systimer *st = et->et_priv;
     	uint32_t clo;
     	uint32_t count;
     	register_t s;
     
    -	if (first != NULL) {
    +	if (first != 0) {
     
    -		count = (st->et.et_frequency * (first->frac >> 32)) >> 32;
    -		if (first->sec != 0)
    -			count += st->et.et_frequency * first->sec;
    +		count = ((uint32_t)et->et_frequency * first) >> 32;
     
     		s = intr_disable();
     		clo = bcm_systimer_tc_read_4(SYSTIMER_CLO);
    @@ -238,12 +235,10 @@ bcm_systimer_attach(device_t dev)
     	sc->st[DEFAULT_TIMER].et.et_flags = ET_FLAGS_ONESHOT;
     	sc->st[DEFAULT_TIMER].et.et_quality = 1000;
     	sc->st[DEFAULT_TIMER].et.et_frequency = sc->sysclk_freq;
    -	sc->st[DEFAULT_TIMER].et.et_min_period.sec = 0;
    -	sc->st[DEFAULT_TIMER].et.et_min_period.frac =
    -	    ((MIN_PERIOD << 32) / sc->st[DEFAULT_TIMER].et.et_frequency) << 32;
    -	sc->st[DEFAULT_TIMER].et.et_max_period.sec = 0xfffffff0U / sc->st[DEFAULT_TIMER].et.et_frequency;
    -	sc->st[DEFAULT_TIMER].et.et_max_period.frac =
    -	    ((0xfffffffeLLU << 32) / sc->st[DEFAULT_TIMER].et.et_frequency) << 32;
    +	sc->st[DEFAULT_TIMER].et.et_min_period =
    +	    (MIN_PERIOD << 32) / sc->st[DEFAULT_TIMER].et.et_frequency;
    +	sc->st[DEFAULT_TIMER].et.et_max_period =
    +	    (0xfffffffeLLU << 32) / sc->st[DEFAULT_TIMER].et.et_frequency;
     	sc->st[DEFAULT_TIMER].et.et_start = bcm_systimer_start;
     	sc->st[DEFAULT_TIMER].et.et_stop = bcm_systimer_stop;
     	sc->st[DEFAULT_TIMER].et.et_priv = &sc->st[DEFAULT_TIMER];
    
    Modified: head/sys/arm/lpc/lpc_timer.c
    ==============================================================================
    --- head/sys/arm/lpc/lpc_timer.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/arm/lpc/lpc_timer.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -72,8 +72,8 @@ static struct lpc_timer_softc *timer_sof
     static int lpc_timer_initialized = 0;
     static int lpc_timer_probe(device_t);
     static int lpc_timer_attach(device_t);
    -static int lpc_timer_start(struct eventtimer *, struct bintime *first,
    -    struct bintime *);
    +static int lpc_timer_start(struct eventtimer *,
    +    sbintime_t first, sbintime_t period);
     static int lpc_timer_stop(struct eventtimer *et);
     static unsigned lpc_get_timecount(struct timecounter *);
     static int lpc_hardclock(void *);
    @@ -173,12 +173,8 @@ lpc_timer_attach(device_t dev)
     	sc->lt_et.et_name = "LPC32x0 Timer0";
     	sc->lt_et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT;
     	sc->lt_et.et_quality = 1000;
    -	sc->lt_et.et_min_period.sec = 0;
    -	sc->lt_et.et_min_period.frac =
    -	    ((0x00000002LLU << 32) / sc->lt_et.et_frequency) << 32;
    -	sc->lt_et.et_max_period.sec = 0xfffffff0U / sc->lt_et.et_frequency;
    -	sc->lt_et.et_max_period.frac =
    -	    ((0xfffffffeLLU << 32) / sc->lt_et.et_frequency) << 32;
    +	sc->lt_et.et_min_period = (0x00000002LLU << 32) / sc->lt_et.et_frequency;
    +	sc->lt_et.et_max_period = (0xfffffffeLLU << 32) / sc->lt_et.et_frequency;
     	sc->lt_et.et_start = lpc_timer_start;
     	sc->lt_et.et_stop = lpc_timer_stop;
     	sc->lt_et.et_priv = sc;
    @@ -199,27 +195,23 @@ lpc_timer_attach(device_t dev)
     }
     
     static int
    -lpc_timer_start(struct eventtimer *et, struct bintime *first,
    -    struct bintime *period)
    +lpc_timer_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
     {
     	struct lpc_timer_softc *sc = (struct lpc_timer_softc *)et->et_priv;
     	uint32_t ticks;
     
    -	if (period == NULL)
    +	if (period == 0) {
     		sc->lt_oneshot = 1;
    -	else {
    +		sc->lt_period = 0;
    +	} else {
     		sc->lt_oneshot = 0;
    -		sc->lt_period = (sc->lt_et.et_frequency * (first->frac >> 32)) >> 32;
    -			sc->lt_period += sc->lt_et.et_frequency * first->sec;
    +		sc->lt_period = ((uint32_t)et->et_frequency * period) >> 32;
     	}
     
    -	if (first == NULL)
    +	if (first == 0)
     		ticks = sc->lt_period;
    -	else {
    -		ticks = (sc->lt_et.et_frequency * (first->frac >> 32)) >> 32;
    -		if (first->sec != 0)
    -			ticks += sc->lt_et.et_frequency * first->sec;
    -	}
    +	else
    +		ticks = ((uint32_t)et->et_frequency * first) >> 32;
     
     	/* Reset timer */
     	timer0_write_4(sc, LPC_TIMER_TCR, LPC_TIMER_TCR_RESET);
    
    Modified: head/sys/arm/mv/timer.c
    ==============================================================================
    --- head/sys/arm/mv/timer.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/arm/mv/timer.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -93,7 +93,7 @@ static void	mv_watchdog_enable(void);
     static void	mv_watchdog_disable(void);
     static void	mv_watchdog_event(void *, unsigned int, int *);
     static int	mv_timer_start(struct eventtimer *et,
    -    struct bintime *first, struct bintime *period);
    +    sbintime_t first, sbintime_t period);
     static int	mv_timer_stop(struct eventtimer *et);
     static void	mv_setup_timers(void);
     
    @@ -168,12 +168,8 @@ mv_timer_attach(device_t dev)
     	sc->et.et_quality = 1000;
     
     	sc->et.et_frequency = MV_CLOCK_SRC;
    -	sc->et.et_min_period.sec = 0;
    -	sc->et.et_min_period.frac =
    -	    ((0x00000002LLU << 32) / sc->et.et_frequency) << 32;
    -	sc->et.et_max_period.sec = 0xfffffff0U / sc->et.et_frequency;
    -	sc->et.et_max_period.frac =
    -	    ((0xfffffffeLLU << 32) / sc->et.et_frequency) << 32;
    +	sc->et.et_min_period = (0x00000002LLU << 32) / sc->et.et_frequency;
    +	sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency;
     	sc->et.et_start = mv_timer_start;
     	sc->et.et_stop = mv_timer_stop;
     	sc->et.et_priv = sc;
    @@ -394,25 +390,20 @@ mv_watchdog_event(void *arg, unsigned in
     }
     
     static int
    -mv_timer_start(struct eventtimer *et,
    -    struct bintime *first, struct bintime *period)
    +mv_timer_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
     {
     	struct	mv_timer_softc *sc;
     	uint32_t val, val1;
     
     	/* Calculate dividers. */
     	sc = (struct mv_timer_softc *)et->et_priv;
    -	if (period != NULL) {
    -		val = (sc->et.et_frequency * (period->frac >> 32)) >> 32;
    -		if (period->sec != 0)
    -			val += sc->et.et_frequency * period->sec;
    -	} else
    +	if (period != 0)
    +		val = ((uint32_t)sc->et.et_frequency * period) >> 32;
    +	else
     		val = 0;
    -	if (first != NULL) {
    -		val1 = (sc->et.et_frequency * (first->frac >> 32)) >> 32;
    -		if (first->sec != 0)
    -			val1 += sc->et.et_frequency * first->sec;
    -	} else
    +	if (first != 0)
    +		val1 = ((uint32_t)sc->et.et_frequency * first) >> 32;
    +	else
     		val1 = val;
     
     	/* Apply configuration. */
    @@ -420,7 +411,7 @@ mv_timer_start(struct eventtimer *et,
     	mv_set_timer(0, val1);
     	val = mv_get_timer_control();
     	val |= CPU_TIMER0_EN;
    -	if (period != NULL)
    +	if (period != 0)
     		val |= CPU_TIMER0_AUTO;
     	else
     		val &= ~CPU_TIMER0_AUTO;
    
    Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c
    ==============================================================================
    --- head/sys/arm/ti/am335x/am335x_dmtimer.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/arm/ti/am335x/am335x_dmtimer.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -143,30 +143,24 @@ am335x_dmtimer_tc_get_timecount(struct t
     }
     
     static int
    -am335x_dmtimer_start(struct eventtimer *et, struct bintime *first,
    -              struct bintime *period)
    +am335x_dmtimer_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
     {
     	struct am335x_dmtimer *tmr = (struct am335x_dmtimer *)et->et_priv;
     	uint32_t load, count;
     	uint32_t tclr = 0;
     
    -	if (period != NULL) {
    -		load = (et->et_frequency * (period->frac >> 32)) >> 32;
    -		if (period->sec > 0)
    -			load += et->et_frequency * period->sec;
    +	if (period != 0) {
    +		load = ((uint32_t)et->et_frequency * period) >> 32;
     		tclr |= 2; /* autoreload bit */
     		panic("periodic timer not implemented\n");
     	} else {
     		load = 0;
     	}
     
    -	if (first != NULL) {
    -		count = (tmr->et.et_frequency * (first->frac >> 32)) >> 32;
    -		if (first->sec != 0)
    -			count += tmr->et.et_frequency * first->sec;
    -	} else {
    +	if (first != 0)
    +		count = ((uint32_t)et->et_frequency * first) >> 32;
    +	else
     		count = load;
    -	}
     
     	/* Reset Timer */
     	am335x_dmtimer_et_write_4(DMTIMER_TSICR, 2);
    @@ -316,12 +310,10 @@ am335x_dmtimer_attach(device_t dev)
     	sc->t[3].et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT;
     	sc->t[3].et.et_quality = 1000;
     	sc->t[3].et.et_frequency = sc->sysclk_freq;
    -	sc->t[3].et.et_min_period.sec = 0;
    -	sc->t[3].et.et_min_period.frac =
    -	    ((0x00000002LLU << 32) / sc->t[3].et.et_frequency) << 32;
    -	sc->t[3].et.et_max_period.sec = 0xfffffff0U / sc->t[3].et.et_frequency;
    -	sc->t[3].et.et_max_period.frac =
    -	    ((0xfffffffeLLU << 32) / sc->t[3].et.et_frequency) << 32;
    +	sc->t[3].et.et_min_period =
    +	    (0x00000002LLU << 32) / sc->t[3].et.et_frequency;
    +	sc->t[3].et.et_max_period =
    +	    (0xfffffffeLLU << 32) / sc->t[3].et.et_frequency;
     	sc->t[3].et.et_start = am335x_dmtimer_start;
     	sc->t[3].et.et_stop = am335x_dmtimer_stop;
     	sc->t[3].et.et_priv = &sc->t[3];
    
    Modified: head/sys/arm/versatile/sp804.c
    ==============================================================================
    --- head/sys/arm/versatile/sp804.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/arm/versatile/sp804.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -120,18 +120,15 @@ sp804_timer_tc_get_timecount(struct time
     }
     
     static int
    -sp804_timer_start(struct eventtimer *et, struct bintime *first,
    -              struct bintime *period)
    +sp804_timer_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
     {
     	struct sp804_timer_softc *sc = et->et_priv;
     	uint32_t count, reg;
     
    -	if (first != NULL) {
    +	if (first != 0) {
     		sc->et_enabled = 1;
     
    -		count = (sc->et.et_frequency * (first->frac >> 32)) >> 32;
    -		if (first->sec != 0)
    -			count += sc->et.et_frequency * first->sec;
    +		count = ((uint32_t)et->et_frequency * first) >> 32;
     
     		sp804_timer_tc_write_4(SP804_TIMER2_LOAD, count);
     		reg = TIMER_CONTROL_32BIT | TIMER_CONTROL_INTREN |
    @@ -142,7 +139,7 @@ sp804_timer_start(struct eventtimer *et,
     		return (0);
     	} 
     
    -	if (period != NULL) {
    +	if (period != 0) {
     		panic("period");
     	}
     
    @@ -264,12 +261,8 @@ sp804_timer_attach(device_t dev)
     	sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT;
     	sc->et.et_quality = 1000;
     	sc->et.et_frequency = sc->sysclk_freq / DEFAULT_DIVISOR;
    -	sc->et.et_min_period.sec = 0;
    -	sc->et.et_min_period.frac =
    -	    ((0x00000002LLU << 32) / sc->et.et_frequency) << 32;
    -	sc->et.et_max_period.sec = 0xfffffff0U / sc->et.et_frequency;
    -	sc->et.et_max_period.frac =
    -	    ((0xfffffffeLLU << 32) / sc->et.et_frequency) << 32;
    +	sc->et.et_min_period = (0x00000002LLU << 32) / sc->et.et_frequency;
    +	sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency;
     	sc->et.et_start = sp804_timer_start;
     	sc->et.et_stop = sp804_timer_stop;
     	sc->et.et_priv = sc;
    
    Modified: head/sys/dev/acpica/acpi_hpet.c
    ==============================================================================
    --- head/sys/dev/acpica/acpi_hpet.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/dev/acpica/acpi_hpet.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -147,8 +147,7 @@ hpet_disable(struct hpet_softc *sc)
     }
     
     static int
    -hpet_start(struct eventtimer *et,
    -    struct bintime *first, struct bintime *period)
    +hpet_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
     {
     	struct hpet_timer *mt = (struct hpet_timer *)et->et_priv;
     	struct hpet_timer *t;
    @@ -156,20 +155,16 @@ hpet_start(struct eventtimer *et,
     	uint32_t fdiv, now;
     
     	t = (mt->pcpu_master < 0) ? mt : &sc->t[mt->pcpu_slaves[curcpu]];
    -	if (period != NULL) {
    +	if (period != 0) {
     		t->mode = 1;
    -		t->div = (sc->freq * (period->frac >> 32)) >> 32;
    -		if (period->sec != 0)
    -			t->div += sc->freq * period->sec;
    +		t->div = (sc->freq * period) >> 32;
     	} else {
     		t->mode = 2;
     		t->div = 0;
     	}
    -	if (first != NULL) {
    -		fdiv = (sc->freq * (first->frac >> 32)) >> 32;
    -		if (first->sec != 0)
    -			fdiv += sc->freq * first->sec;
    -	} else
    +	if (first != 0)
    +		fdiv = (sc->freq * first) >> 32;
    +	else
     		fdiv = t->div;
     	if (t->irq < 0)
     		bus_write_4(sc->mem_res, HPET_ISR, 1 << t->num);
    @@ -684,12 +679,9 @@ hpet_attach(device_t dev)
     		if ((t->caps & HPET_TCAP_PER_INT) == 0)
     			t->et.et_quality -= 10;
     		t->et.et_frequency = sc->freq;
    -		t->et.et_min_period.sec = 0;
    -		t->et.et_min_period.frac =
    -		    (((uint64_t)(HPET_MIN_CYCLES * 2) << 32) / sc->freq) << 32;
    -		t->et.et_max_period.sec = 0xfffffffeLLU / sc->freq;
    -		t->et.et_max_period.frac =
    -		    ((0xfffffffeLLU << 32) / sc->freq) << 32;
    +		t->et.et_min_period =
    +		    ((uint64_t)(HPET_MIN_CYCLES * 2) << 32) / sc->freq;
    +		t->et.et_max_period = (0xfffffffeLLU << 32) / sc->freq;
     		t->et.et_start = hpet_start;
     		t->et.et_stop = hpet_stop;
     		t->et.et_priv = &sc->t[i];
    
    Modified: head/sys/i386/xen/clock.c
    ==============================================================================
    --- head/sys/i386/xen/clock.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/i386/xen/clock.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -768,8 +768,7 @@ resettodr()
     #endif
     
     static int
    -xen_et_start(struct eventtimer *et,
    -    struct bintime *first, struct bintime *period)
    +xen_et_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
     {
     	struct xen_et_state *state = DPCPU_PTR(et_state);
     	struct shadow_time_info *shadow;
    @@ -777,21 +776,16 @@ xen_et_start(struct eventtimer *et,
     
     	__get_time_values_from_xen();
     
    -	if (period != NULL) {
    +	if (period != 0) {
     		state->mode = MODE_PERIODIC;
    -		state->period = (1000000000LL *
    -		    (uint32_t)(period->frac >> 32)) >> 32;
    -		if (period->sec != 0)
    -			state->period += 1000000000LL * period->sec;
    +		state->period = (1000000000LLU * period) >> 32;
     	} else {
     		state->mode = MODE_ONESHOT;
     		state->period = 0;
     	}
    -	if (first != NULL) {
    -		fperiod = (1000000000LL * (uint32_t)(first->frac >> 32)) >> 32;
    -		if (first->sec != 0)
    -			fperiod += 1000000000LL * first->sec;
    -	} else
    +	if (first != 0)
    +		fperiod = (1000000000LLU * first) >> 32;
    +	else
     		fperiod = state->period;
     
     	shadow = &per_cpu(shadow_time, smp_processor_id());
    @@ -832,11 +826,9 @@ cpu_initclocks(void)
     	xen_et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT |
     	    ET_FLAGS_PERCPU;
     	xen_et.et_quality = 600;
    -	xen_et.et_frequency = 0;
    -	xen_et.et_min_period.sec = 0;
    -	xen_et.et_min_period.frac = 0x00400000LL << 32;
    -	xen_et.et_max_period.sec = 2;
    -	xen_et.et_max_period.frac = 0;
    +	xen_et.et_frequency = 1000000000;
    +	xen_et.et_min_period = 0x00400000LL;
    +	xen_et.et_max_period = (0xfffffffeLLU << 32) / xen_et.et_frequency;
     	xen_et.et_start = xen_et_start;
     	xen_et.et_stop = xen_et_stop;
     	xen_et.et_priv = NULL;
    
    Modified: head/sys/ia64/ia64/clock.c
    ==============================================================================
    --- head/sys/ia64/ia64/clock.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/ia64/ia64/clock.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -105,17 +105,14 @@ ia64_ih_clock(struct thread *td, u_int x
      * Event timer start method.
      */
     static int
    -ia64_clock_start(struct eventtimer *et, struct bintime *first,
    -    struct bintime *period)
    +ia64_clock_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
     {
     	u_long itc, load;
     	register_t is;
     
    -	if (period != NULL) {
    +	if (period != 0) {
     		PCPU_SET(md.clock_mode, CLOCK_ET_PERIODIC);
    -		load = (et->et_frequency * (period->frac >> 32)) >> 32;
    -		if (period->sec > 0)
    -			load += et->et_frequency * period->sec;
    +		load = (et->et_frequency * period) >> 32;
     	} else {
     		PCPU_SET(md.clock_mode, CLOCK_ET_ONESHOT);
     		load = 0;
    @@ -123,11 +120,8 @@ ia64_clock_start(struct eventtimer *et, 
     
     	PCPU_SET(md.clock_load, load);
     
    -	if (first != NULL) {
    -		load = (et->et_frequency * (first->frac >> 32)) >> 32;
    -		if (first->sec > 0)
    -			load += et->et_frequency * first->sec;
    -	}
    +	if (first != 0)
    +		load = (et->et_frequency * first) >> 32;
     
     	is = intr_disable();
     	itc = ia64_get_itc();
    @@ -185,10 +179,8 @@ clock_configure(void *dummy)
     	et->et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU;
     	et->et_quality = 1000;
     	et->et_frequency = itc_freq;
    -	et->et_min_period.sec = 0;
    -	et->et_min_period.frac = (0x8000000000000000ul / (u_long)(10*hz)) << 1;
    -	et->et_max_period.sec = 0xffffffff;
    -	et->et_max_period.frac = ((0xfffffffeul << 32) / itc_freq) << 32;
    +	et->et_min_period = SBT_1S / (10 * hz);
    +	et->et_max_period = (0xfffffffeul << 32) / itc_freq;
     	et->et_start = ia64_clock_start;
     	et->et_stop = ia64_clock_stop;
     	et->et_priv = NULL;
    
    Modified: head/sys/kern/kern_clocksource.c
    ==============================================================================
    --- head/sys/kern/kern_clocksource.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/kern/kern_clocksource.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -153,6 +153,8 @@ static DPCPU_DEFINE(struct pcpu_state, t
     	(((uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) /		\
     	    ((bt)->frac >> 1))
     
    +#define	SBT2FREQ(sbt)	((SBT_1S + ((sbt) >> 1)) / (sbt))
    +
     /*
      * Timer broadcast IPI handler.
      */
    @@ -442,7 +444,7 @@ loadtimer(struct bintime *now, int start
     			    new.sec, (u_int)(new.frac >> 32));
     			*next = new;
     			bintime_add(next, now);
    -			et_start(timer, &new, &timerperiod);
    +			et_start(timer, bttosbt(new), bttosbt(timerperiod));
     		}
     	} else {
     		getnextevent(&new);
    @@ -454,7 +456,7 @@ loadtimer(struct bintime *now, int start
     		if (!eq) {
     			*next = new;
     			bintime_sub(&new, now);
    -			et_start(timer, &new, NULL);
    +			et_start(timer, bttosbt(new), 0);
     		}
     	}
     }
    @@ -603,13 +605,13 @@ round_freq(struct eventtimer *et, int fr
     			div = 1 << (flsl(div + div / 2) - 1);
     		freq = (et->et_frequency + div / 2) / div;
     	}
    -	if (et->et_min_period.sec > 0)
    +	if (et->et_min_period > SBT_1S)
     		panic("Event timer \"%s\" doesn't support sub-second periods!",
     		    et->et_name);
    -	else if (et->et_min_period.frac != 0)
    -		freq = min(freq, BT2FREQ(&et->et_min_period));
    -	if (et->et_max_period.sec == 0 && et->et_max_period.frac != 0)
    -		freq = max(freq, BT2FREQ(&et->et_max_period));
    +	else if (et->et_min_period != 0)
    +		freq = min(freq, SBT2FREQ(et->et_min_period));
    +	if (et->et_max_period < SBT_1S && et->et_max_period != 0)
    +		freq = max(freq, SBT2FREQ(et->et_max_period));
     	return (freq);
     }
     
    
    Modified: head/sys/kern/kern_et.c
    ==============================================================================
    --- head/sys/kern/kern_et.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/kern/kern_et.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -1,5 +1,5 @@
     /*-
    - * Copyright (c) 2010 Alexander Motin 
    + * Copyright (c) 2010-2013 Alexander Motin 
      * All rights reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    @@ -62,6 +62,7 @@ et_register(struct eventtimer *et)
     			    et->et_quality);
     		}
     	}
    +	KASSERT(et->et_start, ("et_register: timer has no start function"));
     	et->et_sysctl = SYSCTL_ADD_NODE(NULL,
     	    SYSCTL_STATIC_CHILDREN(_kern_eventtimer_et), OID_AUTO, et->et_name,
     	    CTLFLAG_RW, 0, "event timer description");
    @@ -159,43 +160,29 @@ et_init(struct eventtimer *et, et_event_
      * period - period of subsequent periodic ticks.
      */
     int
    -et_start(struct eventtimer *et,
    -    struct bintime *first, struct bintime *period)
    +et_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
     {
     
     	if (!et->et_active)
     		return (ENXIO);
    -	if (first == NULL && period == NULL)
    -		return (EINVAL);
    -	if ((et->et_flags & ET_FLAGS_PERIODIC) == 0 &&
    -	    period != NULL)
    -		return (ENODEV);
    -	if ((et->et_flags & ET_FLAGS_ONESHOT) == 0 &&
    -	    period == NULL)
    -		return (ENODEV);
    -	if (first != NULL) {
    -		if (first->sec < et->et_min_period.sec ||
    -		    (first->sec == et->et_min_period.sec &&
    -		     first->frac < et->et_min_period.frac))
    -		        first = &et->et_min_period;
    -		if (first->sec > et->et_max_period.sec ||
    -		    (first->sec == et->et_max_period.sec &&
    -		     first->frac > et->et_max_period.frac))
    -		        first = &et->et_max_period;
    -	}
    -	if (period != NULL) {
    -		if (period->sec < et->et_min_period.sec ||
    -		    (period->sec == et->et_min_period.sec &&
    -		     period->frac < et->et_min_period.frac))
    -		        period = &et->et_min_period;
    -		if (period->sec > et->et_max_period.sec ||
    -		    (period->sec == et->et_max_period.sec &&
    -		     period->frac > et->et_max_period.frac))
    -		        period = &et->et_max_period;
    +	KASSERT(period >= 0, ("et_start: negative period"));
    +	KASSERT((et->et_flags & ET_FLAGS_PERIODIC) || period == 0,
    +		("et_start: period specified for oneshot-only timer"));
    +	KASSERT((et->et_flags & ET_FLAGS_ONESHOT) && period == 0,
    +		("et_start: period not specified for periodic-only timer"));
    +	if (period != 0) {
    +		if (period < et->et_min_period)
    +		        period = et->et_min_period;
    +		else if (period > et->et_max_period)
    +		        period = et->et_max_period;
    +	}
    +	if (period == 0 || first != 0) {
    +		if (first < et->et_min_period)
    +		        first = et->et_min_period;
    +		else if (first > et->et_max_period)
    +		        first = et->et_max_period;
     	}
    -	if (et->et_start)
    -		return (et->et_start(et, first, period));
    -	return (0);
    +	return (et->et_start(et, first, period));
     }
     
     /* Stop event timer hardware. */
    
    Modified: head/sys/mips/mips/tick.c
    ==============================================================================
    --- head/sys/mips/mips/tick.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/mips/mips/tick.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -217,22 +217,17 @@ DELAY(int n)
     }
     
     static int
    -clock_start(struct eventtimer *et,
    -    struct bintime *first, struct bintime *period)
    +clock_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
     {
     	uint32_t fdiv, div, next;
     
    -	if (period != NULL) {
    -		div = (et->et_frequency * (period->frac >> 32)) >> 32;
    -		if (period->sec != 0)
    -			div += et->et_frequency * period->sec;
    +	if (period != 0) {
    +		div = (et->et_frequency * period) >> 32;
     	} else
     		div = 0;
    -	if (first != NULL) {
    -		fdiv = (et->et_frequency * (first->frac >> 32)) >> 32;
    -		if (first->sec != 0)
    -			fdiv += et->et_frequency * first->sec;
    -	} else 
    +	if (first != 0)
    +		fdiv = (et->et_frequency * first) >> 32;
    +	else 
     		fdiv = div;
     	DPCPU_SET(cycles_per_tick, div);
     	next = mips_rd_count() + fdiv;
    @@ -361,11 +356,8 @@ clock_attach(device_t dev)
     	    ET_FLAGS_PERCPU;
     	sc->et.et_quality = 800;
     	sc->et.et_frequency = counter_freq;
    -	sc->et.et_min_period.sec = 0;
    -	sc->et.et_min_period.frac = 0x00004000LLU << 32; /* To be safe. */
    -	sc->et.et_max_period.sec = 0xfffffffeU / sc->et.et_frequency;
    -	sc->et.et_max_period.frac =
    -	    ((0xfffffffeLLU << 32) / sc->et.et_frequency) << 32;
    +	sc->et.et_min_period = 0x00004000LLU; /* To be safe. */
    +	sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency;
     	sc->et.et_start = clock_start;
     	sc->et.et_stop = clock_stop;
     	sc->et.et_priv = sc;
    
    Modified: head/sys/mips/nlm/tick.c
    ==============================================================================
    --- head/sys/mips/nlm/tick.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/mips/nlm/tick.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -222,22 +222,17 @@ DELAY(int n)
     }
     
     static int
    -clock_start(struct eventtimer *et,
    -    struct bintime *first, struct bintime *period)
    +clock_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
     {
     	uint32_t fdiv, div, next;
     
    -	if (period != NULL) {
    -		div = (et->et_frequency * (period->frac >> 32)) >> 32;
    -		if (period->sec != 0)
    -			div += et->et_frequency * period->sec;
    -	} else
    +	if (period != 0)
    +		div = (et->et_frequency * period) >> 32;
    +	else
     		div = 0;
    -	if (first != NULL) {
    -		fdiv = (et->et_frequency * (first->frac >> 32)) >> 32;
    -		if (first->sec != 0)
    -			fdiv += et->et_frequency * first->sec;
    -	} else 
    +	if (first != 0)
    +		fdiv = (et->et_frequency * first) >> 32;
    +	else
     		fdiv = div;
     	DPCPU_SET(cycles_per_tick, div);
     	next = mips_rd_count() + fdiv;
    @@ -357,11 +352,8 @@ clock_attach(device_t dev)
     	sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_PERCPU;
     	sc->et.et_quality = 800;
     	sc->et.et_frequency = counter_freq;
    -	sc->et.et_min_period.sec = 0;
    -	sc->et.et_min_period.frac = 0x00004000LLU << 32; /* To be safe. */
    -	sc->et.et_max_period.sec = 0xfffffffeU / sc->et.et_frequency;
    -	sc->et.et_max_period.frac =
    -	    ((0xfffffffeLLU << 32) / sc->et.et_frequency) << 32;
    +	sc->et.et_min_period = 0x00004000LLU; /* To be safe. */
    +	sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency;
     	sc->et.et_start = clock_start;
     	sc->et.et_stop = clock_stop;
     	sc->et.et_priv = sc;
    
    Modified: head/sys/mips/rmi/tick.c
    ==============================================================================
    --- head/sys/mips/rmi/tick.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/mips/rmi/tick.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -219,22 +219,17 @@ DELAY(int n)
     }
     
     static int
    -clock_start(struct eventtimer *et,
    -    struct bintime *first, struct bintime *period)
    +clock_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
     {
     	uint32_t fdiv, div, next;
     
    -	if (period != NULL) {
    -		div = (et->et_frequency * (period->frac >> 32)) >> 32;
    -		if (period->sec != 0)
    -			div += et->et_frequency * period->sec;
    -	} else
    +	if (period != 0)
    +		div = (et->et_frequency * period) >> 32;
    +	else
     		div = 0;
    -	if (first != NULL) {
    -		fdiv = (et->et_frequency * (first->frac >> 32)) >> 32;
    -		if (first->sec != 0)
    -			fdiv += et->et_frequency * first->sec;
    -	} else 
    +	if (first != 0)
    +		fdiv = (et->et_frequency * first) >> 32;
    +	else 
     		fdiv = div;
     	DPCPU_SET(cycles_per_tick, div);
     	next = mips_rd_count() + fdiv;
    @@ -351,11 +346,8 @@ clock_attach(device_t dev)
     	    ET_FLAGS_PERCPU;
     	sc->et.et_quality = 800;
     	sc->et.et_frequency = counter_freq;
    -	sc->et.et_min_period.sec = 0;
    -	sc->et.et_min_period.frac = 0x00004000LLU << 32; /* To be safe. */
    -	sc->et.et_max_period.sec = 0xfffffffeU / sc->et.et_frequency;
    -	sc->et.et_max_period.frac =
    -	    ((0xfffffffeLLU << 32) / sc->et.et_frequency) << 32;
    +	sc->et.et_min_period = 0x00004000LLU; /* To be safe. */
    +	sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency;
     	sc->et.et_start = clock_start;
     	sc->et.et_stop = clock_stop;
     	sc->et.et_priv = sc;
    
    Modified: head/sys/powerpc/aim/clock.c
    ==============================================================================
    --- head/sys/powerpc/aim/clock.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/powerpc/aim/clock.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -85,7 +85,7 @@ static u_long		ticks_per_sec = 12500000;
     static u_long		*decr_counts[MAXCPU];
     
     static int		decr_et_start(struct eventtimer *et,
    -    struct bintime *first, struct bintime *period);
    +    sbintime_t first, sbintime_t period);
     static int		decr_et_stop(struct eventtimer *et);
     static timecounter_get_t	decr_get_timecount;
     
    @@ -195,12 +195,8 @@ decr_tc_init(void)
     	    ET_FLAGS_PERCPU;
     	decr_et.et_quality = 1000;
     	decr_et.et_frequency = ticks_per_sec;
    -	decr_et.et_min_period.sec = 0;
    -	decr_et.et_min_period.frac =
    -	    ((0x00000002LLU << 32) / ticks_per_sec) << 32;
    -	decr_et.et_max_period.sec = 0x7fffffffLLU / ticks_per_sec;
    -	decr_et.et_max_period.frac =
    -	    ((0x7fffffffLLU << 32) / ticks_per_sec) << 32;
    +	decr_et.et_min_period = (0x00000002LLU << 32) / ticks_per_sec;
    +	decr_et.et_max_period = (0x7fffffffLLU << 32) / ticks_per_sec;
     	decr_et.et_start = decr_et_start;
     	decr_et.et_stop = decr_et_stop;
     	decr_et.et_priv = NULL;
    @@ -212,24 +208,20 @@ decr_tc_init(void)
      */
     static int
     decr_et_start(struct eventtimer *et,
    -    struct bintime *first, struct bintime *period)
    +    sbintime_t first, sbintime_t period)
     {
     	struct decr_state *s = DPCPU_PTR(decr_state);
     	uint32_t fdiv;
     
    -	if (period != NULL) {
    +	if (period != 0) {
     		s->mode = 1;
    -		s->div = (decr_et.et_frequency * (period->frac >> 32)) >> 32;
    -		if (period->sec != 0)
    -			s->div += decr_et.et_frequency * period->sec;
    +		s->div = (decr_et.et_frequency * period) >> 32;
     	} else {
     		s->mode = 2;
    -		s->div = 0x7fffffff;
    +		s->div = 0;
     	}
    -	if (first != NULL) {
    -		fdiv = (decr_et.et_frequency * (first->frac >> 32)) >> 32;
    -		if (first->sec != 0)
    -			fdiv += decr_et.et_frequency * first->sec;
    +	if (first != 0) {
    +		fdiv = (decr_et.et_frequency * first) >> 32;
     	} else
     		fdiv = s->div;
     
    
    Modified: head/sys/powerpc/booke/clock.c
    ==============================================================================
    --- head/sys/powerpc/booke/clock.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/powerpc/booke/clock.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -88,7 +88,7 @@ static u_long		*decr_counts[MAXCPU];
     #define	DIFF19041970	2082844800
     
     static int		decr_et_start(struct eventtimer *et,
    -    struct bintime *first, struct bintime *period);
    +    sbintime_t first, sbintime_t period);
     static int		decr_et_stop(struct eventtimer *et);
     static timecounter_get_t decr_get_timecount;
     
    @@ -193,12 +193,8 @@ decr_tc_init(void)
     	    ET_FLAGS_PERCPU;
     	decr_et.et_quality = 1000;
     	decr_et.et_frequency = ticks_per_sec;
    -	decr_et.et_min_period.sec = 0;
    -	decr_et.et_min_period.frac =
    -	    ((0x00000002LLU << 32) / ticks_per_sec) << 32;
    -	decr_et.et_max_period.sec = 0xfffffffeLLU / ticks_per_sec;
    -	decr_et.et_max_period.frac =
    -	    ((0xfffffffeLLU << 32) / ticks_per_sec) << 32;
    +	decr_et.et_min_period = (0x00000002LLU << 32) / ticks_per_sec;
    +	decr_et.et_max_period = (0xfffffffeLLU << 32) / ticks_per_sec;
     	decr_et.et_start = decr_et_start;
     	decr_et.et_stop = decr_et_stop;
     	decr_et.et_priv = NULL;
    @@ -209,26 +205,21 @@ decr_tc_init(void)
      * Event timer start method.
      */
     static int
    -decr_et_start(struct eventtimer *et,
    -    struct bintime *first, struct bintime *period)
    +decr_et_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
     {
     	struct decr_state *s = DPCPU_PTR(decr_state);
     	uint32_t fdiv, tcr;
     
    -	if (period != NULL) {
    +	if (period != 0) {
     		s->mode = 1;
    -		s->div = (decr_et.et_frequency * (period->frac >> 32)) >> 32;
    -		if (period->sec != 0)
    -			s->div += decr_et.et_frequency * period->sec;
    +		s->div = (decr_et.et_frequency * period) >> 32;
     	} else {
     		s->mode = 2;
    -		s->div = 0xffffffff;
    +		s->div = 0;
     	}
    -	if (first != NULL) {
    -		fdiv = (decr_et.et_frequency * (first->frac >> 32)) >> 32;
    -		if (first->sec != 0)
    -			fdiv += decr_et.et_frequency * first->sec;
    -	} else
    +	if (first != 0)
    +		fdiv = (decr_et.et_frequency * first) >> 32;
    +	else
     		fdiv = s->div;
     
     	tcr = mfspr(SPR_TCR);
    
    Modified: head/sys/sparc64/sparc64/tick.c
    ==============================================================================
    --- head/sys/sparc64/sparc64/tick.c	Thu Feb 28 12:09:36 2013	(r247462)
    +++ head/sys/sparc64/sparc64/tick.c	Thu Feb 28 13:46:03 2013	(r247463)
    @@ -93,8 +93,8 @@ static timecounter_get_t stick_get_timec
     static timecounter_get_t stick_get_timecount_up;
     static rd_tick_t stick_rd;
     static wr_tick_cmpr_t stick_wr_cmpr;
    -static int tick_et_start(struct eventtimer *et, struct bintime *first,
    -    struct bintime *period);
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 15:17:25 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id DEC2E303;
     Thu, 28 Feb 2013 15:17:25 +0000 (UTC)
     (envelope-from zeising@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 9FD7FAE0;
     Thu, 28 Feb 2013 15:17:25 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SFHPX2037945;
     Thu, 28 Feb 2013 15:17:25 GMT (envelope-from zeising@svn.freebsd.org)
    Received: (from zeising@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SFHPMG037942;
     Thu, 28 Feb 2013 15:17:25 GMT (envelope-from zeising@svn.freebsd.org)
    Message-Id: <201302281517.r1SFHPMG037942@svn.freebsd.org>
    From: Niclas Zeising 
    Date: Thu, 28 Feb 2013 15:17: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: r247465 - stable/9/lib/libc/net
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 15:17:26 -0000
    
    Author: zeising (doc,ports committer)
    Date: Thu Feb 28 15:17:24 2013
    New Revision: 247465
    URL: http://svnweb.freebsd.org/changeset/base/247465
    
    Log:
      MFC r246809:
      
      Change examples to be consistent with what style(9) says.
      
      Approved by:	joel (mentor)
    
    Modified:
      stable/9/lib/libc/net/getaddrinfo.3
      stable/9/lib/libc/net/getnameinfo.3
    Directory Properties:
      stable/9/lib/libc/   (props changed)
    
    Modified: stable/9/lib/libc/net/getaddrinfo.3
    ==============================================================================
    --- stable/9/lib/libc/net/getaddrinfo.3	Thu Feb 28 13:55:05 2013	(r247464)
    +++ stable/9/lib/libc/net/getaddrinfo.3	Thu Feb 28 15:17:24 2013	(r247465)
    @@ -18,7 +18,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd January 6, 2009
    +.Dd February 14, 2013
     .Dt GETADDRINFO 3
     .Os
     .Sh NAME
    @@ -339,7 +339,7 @@ hints.ai_socktype = SOCK_STREAM;
     error = getaddrinfo("www.kame.net", "http", &hints, &res0);
     if (error) {
     	errx(1, "%s", gai_strerror(error));
    -	/*NOTREACHED*/
    +	/* NOTREACHED */
     }
     s = -1;
     for (res = res0; res; res = res->ai_next) {
    @@ -361,7 +361,7 @@ for (res = res0; res; res = res->ai_next
     }
     if (s < 0) {
     	err(1, "%s", cause);
    -	/*NOTREACHED*/
    +	/* NOTREACHED */
     }
     freeaddrinfo(res0);
     .Ed
    @@ -383,7 +383,7 @@ hints.ai_flags = AI_PASSIVE;
     error = getaddrinfo(NULL, "http", &hints, &res0);
     if (error) {
     	errx(1, "%s", gai_strerror(error));
    -	/*NOTREACHED*/
    +	/* NOTREACHED */
     }
     nsock = 0;
     for (res = res0; res && nsock < MAXSOCK; res = res->ai_next) {
    @@ -405,7 +405,7 @@ for (res = res0; res && nsock < MAXSOCK;
     }
     if (nsock == 0) {
     	err(1, "%s", cause);
    -	/*NOTREACHED*/
    +	/* NOTREACHED */
     }
     freeaddrinfo(res0);
     .Ed
    
    Modified: stable/9/lib/libc/net/getnameinfo.3
    ==============================================================================
    --- stable/9/lib/libc/net/getnameinfo.3	Thu Feb 28 13:55:05 2013	(r247464)
    +++ stable/9/lib/libc/net/getnameinfo.3	Thu Feb 28 15:17:24 2013	(r247465)
    @@ -18,7 +18,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd February 28, 2007
    +.Dd February 14, 2013
     .Dt GETNAMEINFO 3
     .Os
     .Sh NAME
    @@ -157,7 +157,7 @@ char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
     if (getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), sbuf,
         sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV)) {
     	errx(1, "could not get numeric hostname");
    -	/*NOTREACHED*/
    +	/* NOTREACHED */
     }
     printf("host=%s, serv=%s\en", hbuf, sbuf);
     .Ed
    @@ -170,7 +170,7 @@ char hbuf[NI_MAXHOST];
     if (getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), NULL, 0,
         NI_NAMEREQD)) {
     	errx(1, "could not resolve hostname");
    -	/*NOTREACHED*/
    +	/* NOTREACHED */
     }
     printf("host=%s\en", hbuf);
     .Ed
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 15:21:14 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 055095E9;
     Thu, 28 Feb 2013 15:21:14 +0000 (UTC)
     (envelope-from zeising@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 BA618B15;
     Thu, 28 Feb 2013 15:21:13 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SFLDGj040122;
     Thu, 28 Feb 2013 15:21:13 GMT (envelope-from zeising@svn.freebsd.org)
    Received: (from zeising@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SFLDrh040120;
     Thu, 28 Feb 2013 15:21:13 GMT (envelope-from zeising@svn.freebsd.org)
    Message-Id: <201302281521.r1SFLDrh040120@svn.freebsd.org>
    From: Niclas Zeising 
    Date: Thu, 28 Feb 2013 15:21:13 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247466 - stable/8/lib/libc/net
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 15:21:14 -0000
    
    Author: zeising (doc,ports committer)
    Date: Thu Feb 28 15:21:12 2013
    New Revision: 247466
    URL: http://svnweb.freebsd.org/changeset/base/247466
    
    Log:
      MFC r246809
      
      Change examples to be consistent with what style(9) says.
      
      Approved by:	joel (mentor)
    
    Modified:
      stable/8/lib/libc/net/getaddrinfo.3
      stable/8/lib/libc/net/getnameinfo.3
    Directory Properties:
      stable/8/lib/libc/   (props changed)
    
    Modified: stable/8/lib/libc/net/getaddrinfo.3
    ==============================================================================
    --- stable/8/lib/libc/net/getaddrinfo.3	Thu Feb 28 15:17:24 2013	(r247465)
    +++ stable/8/lib/libc/net/getaddrinfo.3	Thu Feb 28 15:21:12 2013	(r247466)
    @@ -18,7 +18,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd January 6, 2009
    +.Dd February 14, 2013
     .Dt GETADDRINFO 3
     .Os
     .Sh NAME
    @@ -339,7 +339,7 @@ hints.ai_socktype = SOCK_STREAM;
     error = getaddrinfo("www.kame.net", "http", &hints, &res0);
     if (error) {
     	errx(1, "%s", gai_strerror(error));
    -	/*NOTREACHED*/
    +	/* NOTREACHED */
     }
     s = -1;
     for (res = res0; res; res = res->ai_next) {
    @@ -361,7 +361,7 @@ for (res = res0; res; res = res->ai_next
     }
     if (s < 0) {
     	err(1, "%s", cause);
    -	/*NOTREACHED*/
    +	/* NOTREACHED */
     }
     freeaddrinfo(res0);
     .Ed
    @@ -383,7 +383,7 @@ hints.ai_flags = AI_PASSIVE;
     error = getaddrinfo(NULL, "http", &hints, &res0);
     if (error) {
     	errx(1, "%s", gai_strerror(error));
    -	/*NOTREACHED*/
    +	/* NOTREACHED */
     }
     nsock = 0;
     for (res = res0; res && nsock < MAXSOCK; res = res->ai_next) {
    @@ -405,7 +405,7 @@ for (res = res0; res && nsock < MAXSOCK;
     }
     if (nsock == 0) {
     	err(1, "%s", cause);
    -	/*NOTREACHED*/
    +	/* NOTREACHED */
     }
     freeaddrinfo(res0);
     .Ed
    
    Modified: stable/8/lib/libc/net/getnameinfo.3
    ==============================================================================
    --- stable/8/lib/libc/net/getnameinfo.3	Thu Feb 28 15:17:24 2013	(r247465)
    +++ stable/8/lib/libc/net/getnameinfo.3	Thu Feb 28 15:21:12 2013	(r247466)
    @@ -18,7 +18,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd February 28, 2007
    +.Dd February 14, 2013
     .Dt GETNAMEINFO 3
     .Os
     .Sh NAME
    @@ -157,7 +157,7 @@ char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
     if (getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), sbuf,
         sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV)) {
     	errx(1, "could not get numeric hostname");
    -	/*NOTREACHED*/
    +	/* NOTREACHED */
     }
     printf("host=%s, serv=%s\en", hbuf, sbuf);
     .Ed
    @@ -170,7 +170,7 @@ char hbuf[NI_MAXHOST];
     if (getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), NULL, 0,
         NI_NAMEREQD)) {
     	errx(1, "could not resolve hostname");
    -	/*NOTREACHED*/
    +	/* NOTREACHED */
     }
     printf("host=%s\en", hbuf);
     .Ed
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 16:22:50 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 1C9703A1;
     Thu, 28 Feb 2013 16:22:50 +0000 (UTC)
     (envelope-from davide@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 0F2B5F2B;
     Thu, 28 Feb 2013 16:22:50 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SGMn9e059076;
     Thu, 28 Feb 2013 16:22:49 GMT (envelope-from davide@svn.freebsd.org)
    Received: (from davide@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SGMnCL059075;
     Thu, 28 Feb 2013 16:22:49 GMT (envelope-from davide@svn.freebsd.org)
    Message-Id: <201302281622.r1SGMnCL059075@svn.freebsd.org>
    From: Davide Italiano 
    Date: Thu, 28 Feb 2013 16:22:49 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247467 - head/sys/kern
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 16:22:50 -0000
    
    Author: davide
    Date: Thu Feb 28 16:22:49 2013
    New Revision: 247467
    URL: http://svnweb.freebsd.org/changeset/base/247467
    
    Log:
      MFcalloutng:
      Style fixes.
    
    Modified:
      head/sys/kern/kern_timeout.c
    
    Modified: head/sys/kern/kern_timeout.c
    ==============================================================================
    --- head/sys/kern/kern_timeout.c	Thu Feb 28 15:21:12 2013	(r247466)
    +++ head/sys/kern/kern_timeout.c	Thu Feb 28 16:22:49 2013	(r247467)
    @@ -100,7 +100,7 @@ struct cc_mig_ent {
     	int	ce_migration_ticks;
     #endif
     };
    -	
    +
     /*
      * There is one struct callout_cpu per cpu, holding all relevant
      * state for the callout processing thread on the individual CPU.
    @@ -613,7 +613,7 @@ skip:
     }
     
     /*
    - * The callout mechanism is based on the work of Adam M. Costello and 
    + * The callout mechanism is based on the work of Adam M. Costello and
      * George Varghese, published in a technical report entitled "Redesigning
      * the BSD Callout and Timer Facilities" and modified slightly for inclusion
      * in FreeBSD by Justin T. Gibbs.  The original work on the data structures
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 16:25:23 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: by hub.freebsd.org (Postfix, from userid 1033)
     id 1642D5E6; Thu, 28 Feb 2013 16:25:23 +0000 (UTC)
    Date: Thu, 28 Feb 2013 16:25:23 +0000
    From: Alexey Dokuchaev 
    To: Davide Italiano 
    Subject: Re: svn commit: r247460 - head/sys/dev/acpica
    Message-ID: <20130228162522.GA41693@FreeBSD.org>
    References: <201302281127.r1SBR2VE068276@svn.freebsd.org>
    MIME-Version: 1.0
    Content-Type: text/plain; charset=koi8-r
    Content-Disposition: inline
    In-Reply-To: <201302281127.r1SBR2VE068276@svn.freebsd.org>
    User-Agent: Mutt/1.5.21 (2010-09-15)
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 16:25:23 -0000
    
    On Thu, Feb 28, 2013 at 11:27:02AM +0000, Davide Italiano wrote:
    > New Revision: 247460
    > URL: http://svnweb.freebsd.org/changeset/base/247460
    > 
    > Log:
    >   MFcalloutng (r247427 by mav):
    >   We don't need any precision here. Let it be fast and dirty shift then
    >   slow and excessively precise 64-bit division.
    > 
    > -    if (sbt >= 0 && us > sbt / SBT_1US)
    > -	us = sbt / SBT_1US;
    > +    if (sbt >= 0 && us > (sbt >> 12))
    > +	us = (sbt >> 12);
    
    Does this really buy us anything?  Modern compilers should be smart enough to
    generate correct code.  Do you have evidence that this is not the case here?
    Not to mention that it obfuscates the code by using some magic constant.
    
    ./danfe
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 16:25:34 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id CB9DA738;
     Thu, 28 Feb 2013 16:25:34 +0000 (UTC)
     (envelope-from hselasky@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 BC45FF5F;
     Thu, 28 Feb 2013 16:25:34 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SGPYG7059510;
     Thu, 28 Feb 2013 16:25:34 GMT
     (envelope-from hselasky@svn.freebsd.org)
    Received: (from hselasky@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SGPYB9059509;
     Thu, 28 Feb 2013 16:25:34 GMT
     (envelope-from hselasky@svn.freebsd.org)
    Message-Id: <201302281625.r1SGPYB9059509@svn.freebsd.org>
    From: Hans Petter Selasky 
    Date: Thu, 28 Feb 2013 16:25:34 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247468 - stable/8/sys/dev/usb/input
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 16:25:34 -0000
    
    Author: hselasky
    Date: Thu Feb 28 16:25:34 2013
    New Revision: 247468
    URL: http://svnweb.freebsd.org/changeset/base/247468
    
    Log:
      MFC r235451:
      Move reset of USB mouse parameters from the USB mouse attach to
      the USB mouse device open. Protect against multi character
      device open. Some other nits.
    
    Modified:
      stable/8/sys/dev/usb/input/ums.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/usb/   (props changed)
    
    Modified: stable/8/sys/dev/usb/input/ums.c
    ==============================================================================
    --- stable/8/sys/dev/usb/input/ums.c	Thu Feb 28 16:22:49 2013	(r247467)
    +++ stable/8/sys/dev/usb/input/ums.c	Thu Feb 28 16:25:34 2013	(r247468)
    @@ -134,6 +134,7 @@ struct ums_softc {
     	struct usb_xfer *sc_xfer[UMS_N_TRANSFER];
     
     	int sc_pollrate;
    +	int sc_fflags;
     
     	uint8_t	sc_buttons;
     	uint8_t	sc_iid;
    @@ -648,32 +649,13 @@ ums_attach(device_t dev)
     	DPRINTF("size=%d, id=%d\n", isize, sc->sc_iid);
     #endif
     
    -	if (sc->sc_buttons > MOUSE_MSC_MAXBUTTON)
    -		sc->sc_hw.buttons = MOUSE_MSC_MAXBUTTON;
    -	else
    -		sc->sc_hw.buttons = sc->sc_buttons;
    -
    -	sc->sc_hw.iftype = MOUSE_IF_USB;
    -	sc->sc_hw.type = MOUSE_MOUSE;
    -	sc->sc_hw.model = MOUSE_MODEL_GENERIC;
    -	sc->sc_hw.hwid = 0;
    -
    -	sc->sc_mode.protocol = MOUSE_PROTO_MSC;
    -	sc->sc_mode.rate = -1;
    -	sc->sc_mode.resolution = MOUSE_RES_UNKNOWN;
    -	sc->sc_mode.accelfactor = 0;
    -	sc->sc_mode.level = 0;
    -	sc->sc_mode.packetsize = MOUSE_MSC_PACKETSIZE;
    -	sc->sc_mode.syncmask[0] = MOUSE_MSC_SYNCMASK;
    -	sc->sc_mode.syncmask[1] = MOUSE_MSC_SYNC;
    -
     	err = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx,
     	    &ums_fifo_methods, &sc->sc_fifo,
     	    device_get_unit(dev), -1, uaa->info.bIfaceIndex,
       	    UID_ROOT, GID_OPERATOR, 0644);
    -	if (err) {
    +	if (err)
     		goto detach;
    -	}
    +
     	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
     	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
     	    OID_AUTO, "parseinfo", CTLTYPE_STRING|CTLFLAG_RD,
    @@ -796,7 +778,7 @@ ums_put_queue(struct ums_softc *sc, int3
     static void
     ums_reset_buf(struct ums_softc *sc)
     {
    -	/* reset read queue */
    +	/* reset read queue, must be called locked */
     	usb_fifo_reset(sc->sc_fifo.fp[USB_FIFO_RX]);
     }
     
    @@ -807,7 +789,33 @@ ums_open(struct usb_fifo *fifo, int ffla
     
     	DPRINTFN(2, "\n");
     
    -	if (fflags & FREAD) {
    +	/* check for duplicate open, should not happen */
    +	if (sc->sc_fflags & fflags)
    +		return (EBUSY);
    +
    +	/* check for first open */
    +	if (sc->sc_fflags == 0) {
    +
    +		/* reset all USB mouse parameters */
    +
    +		if (sc->sc_buttons > MOUSE_MSC_MAXBUTTON)
    +			sc->sc_hw.buttons = MOUSE_MSC_MAXBUTTON;
    +		else
    +			sc->sc_hw.buttons = sc->sc_buttons;
    +
    +		sc->sc_hw.iftype = MOUSE_IF_USB;
    +		sc->sc_hw.type = MOUSE_MOUSE;
    +		sc->sc_hw.model = MOUSE_MODEL_GENERIC;
    +		sc->sc_hw.hwid = 0;
    +
    +		sc->sc_mode.protocol = MOUSE_PROTO_MSC;
    +		sc->sc_mode.rate = -1;
    +		sc->sc_mode.resolution = MOUSE_RES_UNKNOWN;
    +		sc->sc_mode.accelfactor = 0;
    +		sc->sc_mode.level = 0;
    +		sc->sc_mode.packetsize = MOUSE_MSC_PACKETSIZE;
    +		sc->sc_mode.syncmask[0] = MOUSE_MSC_SYNCMASK;
    +		sc->sc_mode.syncmask[1] = MOUSE_MSC_SYNC;
     
     		/* reset status */
     
    @@ -818,21 +826,31 @@ ums_open(struct usb_fifo *fifo, int ffla
     		sc->sc_status.dy = 0;
     		sc->sc_status.dz = 0;
     		/* sc->sc_status.dt = 0; */
    +	}
     
    +	if (fflags & FREAD) {
    +		/* allocate RX buffer */
     		if (usb_fifo_alloc_buffer(fifo,
     		    UMS_BUF_SIZE, UMS_IFQ_MAXLEN)) {
     			return (ENOMEM);
     		}
     	}
    +
    +	sc->sc_fflags |= fflags & (FREAD | FWRITE);
     	return (0);
     }
     
     static void
     ums_close(struct usb_fifo *fifo, int fflags)
     {
    -	if (fflags & FREAD) {
    +	struct ums_softc *sc = usb_fifo_softc(fifo);
    +
    +	DPRINTFN(2, "\n");
    +
    +	if (fflags & FREAD)
     		usb_fifo_free_buffer(fifo);
    -	}
    +
    +	sc->sc_fflags &= ~(fflags & (FREAD | FWRITE));
     }
     
     static int
    @@ -862,7 +880,7 @@ ums_ioctl(struct usb_fifo *fifo, u_long 
     			/* don't change the current setting */
     		} else if ((mode.level < 0) || (mode.level > 1)) {
     			error = EINVAL;
    -			goto done;
    +			break;
     		} else {
     			sc->sc_mode.level = mode.level;
     		}
    @@ -899,7 +917,7 @@ ums_ioctl(struct usb_fifo *fifo, u_long 
     	case MOUSE_SETLEVEL:
     		if (*(int *)addr < 0 || *(int *)addr > 1) {
     			error = EINVAL;
    -			goto done;
    +			break;
     		}
     		sc->sc_mode.level = *(int *)addr;
     
    @@ -946,9 +964,9 @@ ums_ioctl(struct usb_fifo *fifo, u_long 
     		}
     	default:
     		error = ENOTTY;
    +		break;
     	}
     
    -done:
     	mtx_unlock(&sc->sc_mtx);
     	return (error);
     }
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 16:32:26 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id B2F90D1B;
     Thu, 28 Feb 2013 16:32:26 +0000 (UTC)
     (envelope-from hselasky@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 A48D6FBC;
     Thu, 28 Feb 2013 16:32:26 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SGWQNW062349;
     Thu, 28 Feb 2013 16:32:26 GMT
     (envelope-from hselasky@svn.freebsd.org)
    Received: (from hselasky@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SGWQ85062342;
     Thu, 28 Feb 2013 16:32:26 GMT
     (envelope-from hselasky@svn.freebsd.org)
    Message-Id: <201302281632.r1SGWQ85062342@svn.freebsd.org>
    From: Hans Petter Selasky 
    Date: Thu, 28 Feb 2013 16:32:25 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247469 - in stable/8/sys/dev/usb: . net
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 16:32:26 -0000
    
    Author: hselasky
    Date: Thu Feb 28 16:32:25 2013
    New Revision: 247469
    URL: http://svnweb.freebsd.org/changeset/base/247469
    
    Log:
      MFC r246021 and r228637:
      Add new USB IDs.
      
      PR:		usb/175639
    
    Modified:
      stable/8/sys/dev/usb/net/if_axe.c
      stable/8/sys/dev/usb/usbdevs
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/usb/   (props changed)
    
    Modified: stable/8/sys/dev/usb/net/if_axe.c
    ==============================================================================
    --- stable/8/sys/dev/usb/net/if_axe.c	Thu Feb 28 16:25:34 2013	(r247468)
    +++ stable/8/sys/dev/usb/net/if_axe.c	Thu Feb 28 16:32:25 2013	(r247469)
    @@ -151,6 +151,7 @@ static const STRUCT_USB_HOST_ID axe_devs
     	AXE_DEV(ASIX, AX88772, AXE_FLAG_772),
     	AXE_DEV(ASIX, AX88772A, AXE_FLAG_772A),
     	AXE_DEV(ASIX, AX88772B, AXE_FLAG_772B),
    +	AXE_DEV(ASIX, AX88772B_1, AXE_FLAG_772B),
     	AXE_DEV(ATEN, UC210T, 0),
     	AXE_DEV(BELKIN, F5D5055, AXE_FLAG_178),
     	AXE_DEV(BILLIONTON, USB2AR, 0),
    @@ -158,6 +159,7 @@ static const STRUCT_USB_HOST_ID axe_devs
     	AXE_DEV(COREGA, FETHER_USB2_TX, 0),
     	AXE_DEV(DLINK, DUBE100, 0),
     	AXE_DEV(DLINK, DUBE100B1, AXE_FLAG_772),
    +	AXE_DEV(DLINK, DUBE100C1, AXE_FLAG_772B),
     	AXE_DEV(GOODWAY, GWUSB2E, 0),
     	AXE_DEV(IODATA, ETGUS2, AXE_FLAG_178),
     	AXE_DEV(JVC, MP_PRX1, 0),
    
    Modified: stable/8/sys/dev/usb/usbdevs
    ==============================================================================
    --- stable/8/sys/dev/usb/usbdevs	Thu Feb 28 16:25:34 2013	(r247468)
    +++ stable/8/sys/dev/usb/usbdevs	Thu Feb 28 16:32:25 2013	(r247469)
    @@ -1486,6 +1486,7 @@ product DIGIANSWER ZIGBEE802154	0x000a	Z
     /* D-Link products */
     /*product DLINK DSBS25		0x0100	DSB-S25 serial*/
     product DLINK DUBE100		0x1a00	10/100 Ethernet
    +product DLINK DUBE100C1		0x1a02	DUB-E100 rev C1
     product DLINK DSB650TX4		0x200c	10/100 Ethernet
     product DLINK DWL120E		0x3200	DWL-120 rev E
     product DLINK DWL122		0x3700	DWL-122
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 16:32:38 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 11EEBED4;
     Thu, 28 Feb 2013 16:32:37 +0000 (UTC)
     (envelope-from gallatin@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 517A2FBF;
     Thu, 28 Feb 2013 16:32:37 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SGWbsG062463;
     Thu, 28 Feb 2013 16:32:37 GMT
     (envelope-from gallatin@svn.freebsd.org)
    Received: (from gallatin@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SGWbTn062462;
     Thu, 28 Feb 2013 16:32:37 GMT
     (envelope-from gallatin@svn.freebsd.org)
    Message-Id: <201302281632.r1SGWbTn062462@svn.freebsd.org>
    From: Andrew Gallatin 
    Date: Thu, 28 Feb 2013 16:32: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: r247470 - stable/9/sys/netinet
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 16:32:38 -0000
    
    Author: gallatin
    Date: Thu Feb 28 16:32:36 2013
    New Revision: 247470
    URL: http://svnweb.freebsd.org/changeset/base/247470
    
    Log:
      MFC r247104:
        Fix tcp_lro_rx_ipv4() for drivers that do not set CSUM_IP_CHECKED.
        Specifcially, in_cksum_hdr() returns 0 (not 0xffff) when the IPv4
        checksum is correct. Without this fix, the tcp_lro code will reject
        good IPv4 traffic from drivers that do not implement IPv4 header
        harder csum offload.
    
    Modified:
      stable/9/sys/netinet/tcp_lro.c
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/netinet/tcp_lro.c
    ==============================================================================
    --- stable/9/sys/netinet/tcp_lro.c	Thu Feb 28 16:32:25 2013	(r247469)
    +++ stable/9/sys/netinet/tcp_lro.c	Thu Feb 28 16:32:36 2013	(r247470)
    @@ -333,7 +333,7 @@ tcp_lro_rx_ipv4(struct lro_ctrl *lc, str
     		}
     	} else {
     		csum = in_cksum_hdr(ip4);
    -		if (__predict_false((csum ^ 0xffff) != 0)) {
    +		if (__predict_false((csum) != 0)) {
     			lc->lro_bad_csum++;
     			return (TCP_LRO_CANNOT);
     		}
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 16:36:12 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id E92682C7;
     Thu, 28 Feb 2013 16:36:12 +0000 (UTC)
     (envelope-from hselasky@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 DB445FF1;
     Thu, 28 Feb 2013 16:36:12 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SGaCqF063145;
     Thu, 28 Feb 2013 16:36:12 GMT
     (envelope-from hselasky@svn.freebsd.org)
    Received: (from hselasky@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SGaCDF063143;
     Thu, 28 Feb 2013 16:36:12 GMT
     (envelope-from hselasky@svn.freebsd.org)
    Message-Id: <201302281636.r1SGaCDF063143@svn.freebsd.org>
    From: Hans Petter Selasky 
    Date: Thu, 28 Feb 2013 16:36:12 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247471 - stable/8/sys/dev/usb/wlan
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 16:36:13 -0000
    
    Author: hselasky
    Date: Thu Feb 28 16:36:12 2013
    New Revision: 247471
    URL: http://svnweb.freebsd.org/changeset/base/247471
    
    Log:
      MFC r246944:
      Fix bad EEPROM parsing code.
    
    Modified:
      stable/8/sys/dev/usb/wlan/if_upgt.c
      stable/8/sys/dev/usb/wlan/if_upgtvar.h
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/usb/   (props changed)
    
    Modified: stable/8/sys/dev/usb/wlan/if_upgt.c
    ==============================================================================
    --- stable/8/sys/dev/usb/wlan/if_upgt.c	Thu Feb 28 16:32:36 2013	(r247470)
    +++ stable/8/sys/dev/usb/wlan/if_upgt.c	Thu Feb 28 16:36:12 2013	(r247471)
    @@ -1122,12 +1122,23 @@ upgt_eeprom_parse(struct upgt_softc *sc)
     	    (sizeof(struct upgt_eeprom_header) + preamble_len));
     
     	while (!option_end) {
    +
    +		/* sanity check */
    +		if (eeprom_option >= (struct upgt_eeprom_option *)
    +		    (sc->sc_eeprom + UPGT_EEPROM_SIZE)) {
    +			return (EINVAL);
    +		}
    +
     		/* the eeprom option length is stored in words */
     		option_len =
     		    (le16toh(eeprom_option->len) - 1) * sizeof(uint16_t);
     		option_type =
     		    le16toh(eeprom_option->type);
     
    +		/* sanity check */
    +		if (option_len == 0 || option_len >= UPGT_EEPROM_SIZE)
    +			return (EINVAL);
    +
     		switch (option_type) {
     		case UPGT_EEPROM_TYPE_NAME:
     			DPRINTF(sc, UPGT_DEBUG_FW,
    @@ -1198,7 +1209,6 @@ upgt_eeprom_parse(struct upgt_softc *sc)
     		eeprom_option = (struct upgt_eeprom_option *)
     		    (eeprom_option->data + option_len);
     	}
    -
     	return (0);
     }
     
    @@ -1207,7 +1217,9 @@ upgt_eeprom_parse_freq3(struct upgt_soft
     {
     	struct upgt_eeprom_freq3_header *freq3_header;
     	struct upgt_lmac_freq3 *freq3;
    -	int i, elements, flags;
    +	int i;
    +	int elements;
    +	int flags;
     	unsigned channel;
     
     	freq3_header = (struct upgt_eeprom_freq3_header *)data;
    @@ -1219,6 +1231,9 @@ upgt_eeprom_parse_freq3(struct upgt_soft
     	DPRINTF(sc, UPGT_DEBUG_FW, "flags=0x%02x elements=%d\n",
     	    flags, elements);
     
    +	if (elements >= (int)(UPGT_EEPROM_SIZE / sizeof(freq3[0])))
    +		return;
    +
     	for (i = 0; i < elements; i++) {
     		channel = ieee80211_mhz2ieee(le16toh(freq3[i].freq), 0);
     		if (channel >= IEEE80211_CHAN_MAX)
    @@ -1237,7 +1252,11 @@ upgt_eeprom_parse_freq4(struct upgt_soft
     	struct upgt_eeprom_freq4_header *freq4_header;
     	struct upgt_eeprom_freq4_1 *freq4_1;
     	struct upgt_eeprom_freq4_2 *freq4_2;
    -	int i, j, elements, settings, flags;
    +	int i;
    +	int j;
    +	int elements;
    +	int settings;
    +	int flags;
     	unsigned channel;
     
     	freq4_header = (struct upgt_eeprom_freq4_header *)data;
    @@ -1252,6 +1271,9 @@ upgt_eeprom_parse_freq4(struct upgt_soft
     	DPRINTF(sc, UPGT_DEBUG_FW, "flags=0x%02x elements=%d settings=%d\n",
     	    flags, elements, settings);
     
    +	if (elements >= (int)(UPGT_EEPROM_SIZE / sizeof(freq4_1[0])))
    +		return;
    +
     	for (i = 0; i < elements; i++) {
     		channel = ieee80211_mhz2ieee(le16toh(freq4_1[i].freq), 0);
     		if (channel >= IEEE80211_CHAN_MAX)
    @@ -1272,7 +1294,8 @@ void
     upgt_eeprom_parse_freq6(struct upgt_softc *sc, uint8_t *data, int len)
     {
     	struct upgt_lmac_freq6 *freq6;
    -	int i, elements;
    +	int i;
    +	int elements;
     	unsigned channel;
     
     	freq6 = (struct upgt_lmac_freq6 *)data;
    @@ -1280,6 +1303,9 @@ upgt_eeprom_parse_freq6(struct upgt_soft
     
     	DPRINTF(sc, UPGT_DEBUG_FW, "elements=%d\n", elements);
     
    +	if (elements >= (int)(UPGT_EEPROM_SIZE / sizeof(freq6[0])))
    +		return;
    +
     	for (i = 0; i < elements; i++) {
     		channel = ieee80211_mhz2ieee(le16toh(freq6[i].freq), 0);
     		if (channel >= IEEE80211_CHAN_MAX)
    
    Modified: stable/8/sys/dev/usb/wlan/if_upgtvar.h
    ==============================================================================
    --- stable/8/sys/dev/usb/wlan/if_upgtvar.h	Thu Feb 28 16:32:36 2013	(r247470)
    +++ stable/8/sys/dev/usb/wlan/if_upgtvar.h	Thu Feb 28 16:36:12 2013	(r247471)
    @@ -451,7 +451,7 @@ struct upgt_softc {
     	struct upgt_memory	 sc_memory;
     
     	/* data which we found in the EEPROM */
    -	uint8_t			 sc_eeprom[UPGT_EEPROM_SIZE];
    +	uint8_t			 sc_eeprom[2 * UPGT_EEPROM_SIZE] __aligned(4);
     	uint16_t		 sc_eeprom_hwrx;
     	struct upgt_lmac_freq3	 sc_eeprom_freq3[IEEE80211_CHAN_MAX];
     	struct upgt_lmac_freq4	 sc_eeprom_freq4[IEEE80211_CHAN_MAX][8];
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 16:38:30 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 0835A540;
     Thu, 28 Feb 2013 16:38:30 +0000 (UTC)
     (envelope-from gallatin@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 EDACC6A;
     Thu, 28 Feb 2013 16:38:29 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SGcTpX063663;
     Thu, 28 Feb 2013 16:38:29 GMT
     (envelope-from gallatin@svn.freebsd.org)
    Received: (from gallatin@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SGcTlk063656;
     Thu, 28 Feb 2013 16:38:29 GMT
     (envelope-from gallatin@svn.freebsd.org)
    Message-Id: <201302281638.r1SGcTlk063656@svn.freebsd.org>
    From: Andrew Gallatin 
    Date: Thu, 28 Feb 2013 16:38: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: r247472 - in stable/9/sys: conf dev/mxge modules/mxge/mxge
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 16:38:30 -0000
    
    Author: gallatin
    Date: Thu Feb 28 16:38:28 2013
    New Revision: 247472
    URL: http://svnweb.freebsd.org/changeset/base/247472
    
    Log:
      MFC r247133 and associated fixes (r247151, r247152):
      
      r247133:
        Improve mxge's receive performance for IPv6:
      
        - Add support for IPv6 rx csum offload
        - Finally switch mxge from using its own driver lro, to
        	using tcp_lro
      
      r247151:
        Fix build.
      
      r247152:
        Try harder to make mxge safe for all combinations of INET and INET6
      
        - Re-fix build by restoring local removed in r247151, but protected
          by #if defined(INET) || defined(INET6) so that the compile
          succeeds in the !(INET||INET6) case.
      
        - Protect call to in_pseudo() with an #ifdef INET, to allow
          a kernel to link with mxge when INET is not compiled in.
      
        - Also remove an errant (improperly commented) obsolete debugging printf
    
    Deleted:
      stable/9/sys/dev/mxge/mxge_lro.c
    Modified:
      stable/9/sys/conf/files
      stable/9/sys/dev/mxge/if_mxge.c
      stable/9/sys/dev/mxge/if_mxge_var.h
      stable/9/sys/modules/mxge/mxge/Makefile
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/conf/   (props changed)
      stable/9/sys/dev/   (props changed)
      stable/9/sys/modules/   (props changed)
    
    Modified: stable/9/sys/conf/files
    ==============================================================================
    --- stable/9/sys/conf/files	Thu Feb 28 16:36:12 2013	(r247471)
    +++ stable/9/sys/conf/files	Thu Feb 28 16:38:28 2013	(r247472)
    @@ -1557,7 +1557,6 @@ mwlboot.fw		optional mwlfw					\
     	no-obj no-implicit-rule						\
     	clean		"mwlboot.fw"
     dev/mxge/if_mxge.c		optional mxge pci
    -dev/mxge/mxge_lro.c		optional mxge pci
     dev/mxge/mxge_eth_z8e.c		optional mxge pci
     dev/mxge/mxge_ethp_z8e.c	optional mxge pci
     dev/mxge/mxge_rss_eth_z8e.c	optional mxge pci
    
    Modified: stable/9/sys/dev/mxge/if_mxge.c
    ==============================================================================
    --- stable/9/sys/dev/mxge/if_mxge.c	Thu Feb 28 16:36:12 2013	(r247471)
    +++ stable/9/sys/dev/mxge/if_mxge.c	Thu Feb 28 16:38:28 2013	(r247472)
    @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    +#include 
     #include 
     
     #include 
    @@ -102,7 +103,6 @@ static int mxge_intr_coal_delay = 30;
     static int mxge_deassert_wait = 1;
     static int mxge_flow_control = 1;
     static int mxge_verbose = 0;
    -static int mxge_lro_cnt = 8;
     static int mxge_ticks;
     static int mxge_max_slices = 1;
     static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_DST_PORT;
    @@ -1310,9 +1310,9 @@ mxge_reset(mxge_softc_t *sc, int interru
     		ss->tx.stall = 0;
     		ss->rx_big.cnt = 0;
     		ss->rx_small.cnt = 0;
    -		ss->lro_bad_csum = 0;
    -		ss->lro_queued = 0;
    -		ss->lro_flushed = 0;
    +		ss->lc.lro_bad_csum = 0;
    +		ss->lc.lro_queued = 0;
    +		ss->lc.lro_flushed = 0;
     		if (ss->fw_stats != NULL) {
     			bzero(ss->fw_stats, sizeof *ss->fw_stats);
     		}
    @@ -1413,50 +1413,6 @@ mxge_change_flow_control(SYSCTL_HANDLER_
     }
     
     static int
    -mxge_change_lro_locked(mxge_softc_t *sc, int lro_cnt)
    -{
    -	struct ifnet *ifp;
    -	int err = 0;
    -
    -	ifp = sc->ifp;
    -	if (lro_cnt == 0) 
    -		ifp->if_capenable &= ~IFCAP_LRO;
    -	else
    -		ifp->if_capenable |= IFCAP_LRO;
    -	sc->lro_cnt = lro_cnt;
    -	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
    -		mxge_close(sc, 0);
    -		err = mxge_open(sc);
    -	}
    -	return err;
    -}
    -
    -static int
    -mxge_change_lro(SYSCTL_HANDLER_ARGS)
    -{
    -	mxge_softc_t *sc;
    -	unsigned int lro_cnt;
    -	int err;
    -
    -	sc = arg1;
    -	lro_cnt = sc->lro_cnt;
    -	err = sysctl_handle_int(oidp, &lro_cnt, arg2, req);
    -	if (err != 0)
    -		return err;
    -
    -	if (lro_cnt == sc->lro_cnt)
    -		return 0;
    -
    -	if (lro_cnt > 128)
    -		return EINVAL;
    -
    -	mtx_lock(&sc->driver_mtx);
    -	err = mxge_change_lro_locked(sc, lro_cnt);
    -	mtx_unlock(&sc->driver_mtx);
    -	return err;
    -}
    -
    -static int
     mxge_handle_be32(SYSCTL_HANDLER_ARGS)
     {
             int err;
    @@ -1652,14 +1608,6 @@ mxge_add_sysctls(mxge_softc_t *sc)
     		       CTLFLAG_RW, &mxge_verbose,
     		       0, "verbose printing");
     
    -	/* lro */
    -	SYSCTL_ADD_PROC(ctx, children, OID_AUTO, 
    -			"lro_cnt",
    -			CTLTYPE_INT|CTLFLAG_RW, sc,
    -			0, mxge_change_lro,
    -			"I", "number of lro merge queues");
    -
    -
     	/* add counters exported for debugging from all slices */
     	sysctl_ctx_init(&sc->slice_sysctl_ctx);
     	sc->slice_sysctl_tree = 
    @@ -1685,11 +1633,15 @@ mxge_add_sysctls(mxge_softc_t *sc)
     			       CTLFLAG_RD, &ss->rx_big.cnt,
     			       0, "rx_small_cnt");
     		SYSCTL_ADD_INT(ctx, children, OID_AUTO,
    -			       "lro_flushed", CTLFLAG_RD, &ss->lro_flushed,
    +			       "lro_flushed", CTLFLAG_RD, &ss->lc.lro_flushed,
     			       0, "number of lro merge queues flushed");
     
     		SYSCTL_ADD_INT(ctx, children, OID_AUTO,
    -			       "lro_queued", CTLFLAG_RD, &ss->lro_queued,
    +			       "lro_bad_csum", CTLFLAG_RD, &ss->lc.lro_bad_csum,
    +			       0, "number of bad csums preventing LRO");
    +
    +		SYSCTL_ADD_INT(ctx, children, OID_AUTO,
    +			       "lro_queued", CTLFLAG_RD, &ss->lc.lro_queued,
     			       0, "number of frames appended to lro merge"
     			       "queues");
     
    @@ -1934,11 +1886,13 @@ mxge_encap_tso(struct mxge_slice_state *
     			    IPPROTO_TCP, 0);
     #endif
     		} else {
    +#ifdef INET
     			m->m_pkthdr.csum_flags |= CSUM_TCP;
     			sum = in_pseudo(pi->ip->ip_src.s_addr,
     			    pi->ip->ip_dst.s_addr,
     			    htons(IPPROTO_TCP + (m->m_pkthdr.len -
     				    cksum_offset)));
    +#endif
     		}
     		m_copyback(m, offsetof(struct tcphdr, th_sum) +
     		    cksum_offset, sizeof(sum), (caddr_t)&sum);
    @@ -2533,6 +2487,62 @@ done:
     	return err;
     }
     
    +#ifdef INET6
    +
    +static uint16_t
    +mxge_csum_generic(uint16_t *raw, int len)
    +{
    +	uint32_t csum;
    +
    +
    +	csum = 0;
    +	while (len > 0) {
    +		csum += *raw;
    +		raw++;
    +		len -= 2;
    +	}
    +	csum = (csum >> 16) + (csum & 0xffff);
    +	csum = (csum >> 16) + (csum & 0xffff);
    +	return (uint16_t)csum;
    +}
    +
    +static inline uint16_t
    +mxge_rx_csum6(void *p, struct mbuf *m, uint32_t csum)
    +{
    +	uint32_t partial;
    +	int nxt, cksum_offset;
    +	struct ip6_hdr *ip6 = p;
    +	uint16_t c;
    +
    +	nxt = ip6->ip6_nxt;
    +	cksum_offset = sizeof (*ip6) + ETHER_HDR_LEN;
    +	if (nxt != IPPROTO_TCP && nxt != IPPROTO_UDP) {
    +		cksum_offset = ip6_lasthdr(m, ETHER_HDR_LEN,
    +					   IPPROTO_IPV6, &nxt);
    +		if (nxt != IPPROTO_TCP && nxt != IPPROTO_UDP)
    +			return (1);
    +	}
    +
    +	/*
    +	 * IPv6 headers do not contain a checksum, and hence
    +	 * do not checksum to zero, so they don't "fall out"
    +	 * of the partial checksum calculation like IPv4
    +	 * headers do.  We need to fix the partial checksum by
    +	 * subtracting the checksum of the IPv6 header.
    +	 */
    +
    +	partial = mxge_csum_generic((uint16_t *)ip6, cksum_offset -
    +				    ETHER_HDR_LEN);
    +	csum += ~partial;
    +	csum +=	 (csum < ~partial);
    +	csum = (csum >> 16) + (csum & 0xFFFF);
    +	csum = (csum >> 16) + (csum & 0xFFFF);
    +	c = in6_cksum_pseudo(ip6, m->m_pkthdr.len - cksum_offset, nxt,
    +			     csum);
    +	c ^= 0xffff;
    +	return (c);
    +}
    +#endif /* INET6 */
     /* 
      *  Myri10GE hardware checksums are not valid if the sender
      *  padded the frame with non-zero padding.  This is because
    @@ -2546,26 +2556,41 @@ static inline uint16_t
     mxge_rx_csum(struct mbuf *m, int csum)
     {
     	struct ether_header *eh;
    +#ifdef INET
     	struct ip *ip;
    -	uint16_t c;
    +#endif
    +#if defined(INET) || defined(INET6)
    +	int cap = m->m_pkthdr.rcvif->if_capenable;
    +#endif
    +	uint16_t c, etype;
     
    -	eh = mtod(m, struct ether_header *);
     
    -	/* only deal with IPv4 TCP & UDP for now */
    -	if (__predict_false(eh->ether_type != htons(ETHERTYPE_IP)))
    -		return 1;
    -	ip = (struct ip *)(eh + 1);
    -	if (__predict_false(ip->ip_p != IPPROTO_TCP &&
    -			    ip->ip_p != IPPROTO_UDP))
    -		return 1;
    +	eh = mtod(m, struct ether_header *);
    +	etype = ntohs(eh->ether_type);
    +	switch (etype) {
     #ifdef INET
    -	c = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr,
    -		      htonl(ntohs(csum) + ntohs(ip->ip_len) +
    -			    - (ip->ip_hl << 2) + ip->ip_p));
    -#else
    -	c = 1;
    +	case ETHERTYPE_IP:
    +		if ((cap & IFCAP_RXCSUM) == 0)
    +			return (1);
    +		ip = (struct ip *)(eh + 1);
    +		if (ip->ip_p != IPPROTO_TCP && ip->ip_p != IPPROTO_UDP)
    +			return (1);
    +		c = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr,
    +			      htonl(ntohs(csum) + ntohs(ip->ip_len) -
    +				    (ip->ip_hl << 2) + ip->ip_p));
    +		c ^= 0xffff;
    +		break;
     #endif
    -	c ^= 0xffff;
    +#ifdef INET6
    +	case ETHERTYPE_IPV6:
    +		if ((cap & IFCAP_RXCSUM_IPV6) == 0)
    +			return (1);
    +		c = mxge_rx_csum6((eh + 1), m, csum);
    +		break;
    +#endif
    +	default:
    +		c = 1;
    +	}
     	return (c);
     }
     
    @@ -2627,7 +2652,8 @@ mxge_vlan_tag_remove(struct mbuf *m, uin
     
     
     static inline void
    -mxge_rx_done_big(struct mxge_slice_state *ss, uint32_t len, uint32_t csum)
    +mxge_rx_done_big(struct mxge_slice_state *ss, uint32_t len,
    +		 uint32_t csum, int lro)
     {
     	mxge_softc_t *sc;
     	struct ifnet *ifp;
    @@ -2636,7 +2662,6 @@ mxge_rx_done_big(struct mxge_slice_state
     	mxge_rx_ring_t *rx;
     	bus_dmamap_t old_map;
     	int idx;
    -	uint16_t tcpudp_csum;
     
     	sc = ss->sc;
     	ifp = sc->ifp;
    @@ -2673,14 +2698,18 @@ mxge_rx_done_big(struct mxge_slice_state
     		mxge_vlan_tag_remove(m, &csum);
     	}
     	/* if the checksum is valid, mark it in the mbuf header */
    -	if (sc->csum_flag && (0 == (tcpudp_csum = mxge_rx_csum(m, csum)))) {
    -		if (sc->lro_cnt && (0 == mxge_lro_rx(ss, m, csum)))
    -			return;
    -		/* otherwise, it was a UDP frame, or a TCP frame which
    -		   we could not do LRO on.  Tell the stack that the
    -		   checksum is good */
    +	
    +	if ((ifp->if_capenable & (IFCAP_RXCSUM_IPV6 | IFCAP_RXCSUM)) &&
    +	    (0 == mxge_rx_csum(m, csum))) {
    +		/* Tell the stack that the  checksum is good */
     		m->m_pkthdr.csum_data = 0xffff;
    -		m->m_pkthdr.csum_flags = CSUM_PSEUDO_HDR | CSUM_DATA_VALID;
    +		m->m_pkthdr.csum_flags = CSUM_PSEUDO_HDR |
    +			CSUM_DATA_VALID;
    +
    +#if defined(INET) || defined (INET6)
    +		if (lro && (0 == tcp_lro_rx(&ss->lc, m, 0)))
    +			return;
    +#endif
     	}
     	/* flowid only valid if RSS hashing is enabled */
     	if (sc->num_slices > 1) {
    @@ -2692,7 +2721,8 @@ mxge_rx_done_big(struct mxge_slice_state
     }
     
     static inline void
    -mxge_rx_done_small(struct mxge_slice_state *ss, uint32_t len, uint32_t csum)
    +mxge_rx_done_small(struct mxge_slice_state *ss, uint32_t len,
    +		   uint32_t csum, int lro)
     {
     	mxge_softc_t *sc;
     	struct ifnet *ifp;
    @@ -2701,7 +2731,6 @@ mxge_rx_done_small(struct mxge_slice_sta
     	mxge_rx_ring_t *rx;
     	bus_dmamap_t old_map;
     	int idx;
    -	uint16_t tcpudp_csum;
     
     	sc = ss->sc;
     	ifp = sc->ifp;
    @@ -2738,14 +2767,17 @@ mxge_rx_done_small(struct mxge_slice_sta
     		mxge_vlan_tag_remove(m, &csum);
     	}
     	/* if the checksum is valid, mark it in the mbuf header */
    -	if (sc->csum_flag && (0 == (tcpudp_csum = mxge_rx_csum(m, csum)))) {
    -		if (sc->lro_cnt && (0 == mxge_lro_rx(ss, m, csum)))
    -			return;
    -		/* otherwise, it was a UDP frame, or a TCP frame which
    -		   we could not do LRO on.  Tell the stack that the
    -		   checksum is good */
    +	if ((ifp->if_capenable & (IFCAP_RXCSUM_IPV6 | IFCAP_RXCSUM)) &&
    +	    (0 == mxge_rx_csum(m, csum))) {
    +		/* Tell the stack that the  checksum is good */
     		m->m_pkthdr.csum_data = 0xffff;
    -		m->m_pkthdr.csum_flags = CSUM_PSEUDO_HDR | CSUM_DATA_VALID;
    +		m->m_pkthdr.csum_flags = CSUM_PSEUDO_HDR |
    +			CSUM_DATA_VALID;
    +
    +#if defined(INET) || defined (INET6)
    +		if (lro && (0 == tcp_lro_rx(&ss->lc, m, csum)))
    +			return;
    +#endif
     	}
     	/* flowid only valid if RSS hashing is enabled */
     	if (sc->num_slices > 1) {
    @@ -2763,16 +2795,17 @@ mxge_clean_rx_done(struct mxge_slice_sta
     	int limit = 0;
     	uint16_t length;
     	uint16_t checksum;
    +	int lro;
     
    -
    +	lro = ss->sc->ifp->if_capenable & IFCAP_LRO;
     	while (rx_done->entry[rx_done->idx].length != 0) {
     		length = ntohs(rx_done->entry[rx_done->idx].length);
     		rx_done->entry[rx_done->idx].length = 0;
     		checksum = rx_done->entry[rx_done->idx].checksum;
     		if (length <= (MHLEN - MXGEFW_PAD))
    -			mxge_rx_done_small(ss, length, checksum);
    +			mxge_rx_done_small(ss, length, checksum, lro);
     		else
    -			mxge_rx_done_big(ss, length, checksum);
    +			mxge_rx_done_big(ss, length, checksum, lro);
     		rx_done->cnt++;
     		rx_done->idx = rx_done->cnt & rx_done->mask;
     
    @@ -2780,11 +2813,11 @@ mxge_clean_rx_done(struct mxge_slice_sta
     		if (__predict_false(++limit > rx_done->mask / 2))
     			break;
     	}
    -#ifdef INET
    -	while (!SLIST_EMPTY(&ss->lro_active)) {
    -		struct lro_entry *lro = SLIST_FIRST(&ss->lro_active);
    -		SLIST_REMOVE_HEAD(&ss->lro_active, next);
    -		mxge_lro_flush(ss, lro);
    +#if defined(INET)  || defined (INET6)
    +	while (!SLIST_EMPTY(&ss->lc.lro_active)) {
    +		struct lro_entry *lro = SLIST_FIRST(&ss->lc.lro_active);
    +		SLIST_REMOVE_HEAD(&ss->lc.lro_active, next);
    +		tcp_lro_flush(&ss->lc, lro);
     	}
     #endif
     }
    @@ -3152,15 +3185,11 @@ mxge_init(void *arg)
     static void
     mxge_free_slice_mbufs(struct mxge_slice_state *ss)
     {
    -	struct lro_entry *lro_entry;
     	int i;
     
    -	while (!SLIST_EMPTY(&ss->lro_free)) {
    -		lro_entry = SLIST_FIRST(&ss->lro_free);
    -		SLIST_REMOVE_HEAD(&ss->lro_free, next);
    -		free(lro_entry, M_DEVBUF);
    -	}
    -
    +#if defined(INET) || defined(INET6)
    +	tcp_lro_free(&ss->lc);
    +#endif
     	for (i = 0; i <= ss->rx_big.mask; i++) {
     		if (ss->rx_big.info[i].m == NULL)
     			continue;
    @@ -3544,26 +3573,17 @@ mxge_slice_open(struct mxge_slice_state 
     	mxge_softc_t *sc;
     	mxge_cmd_t cmd;
     	bus_dmamap_t map;
    -	struct lro_entry *lro_entry;	
     	int err, i, slice;
     
     
     	sc = ss->sc;
     	slice = ss - sc->ss;
     
    -	SLIST_INIT(&ss->lro_free);
    -	SLIST_INIT(&ss->lro_active);
    -
    -	for (i = 0; i < sc->lro_cnt; i++) {
    -		lro_entry = (struct lro_entry *)
    -			malloc(sizeof (*lro_entry), M_DEVBUF,
    -			       M_NOWAIT | M_ZERO);
    -		if (lro_entry == NULL) {
    -			sc->lro_cnt = i;
    -			break;
    -		}
    -		SLIST_INSERT_HEAD(&ss->lro_free, lro_entry, next);
    -	}
    +#if defined(INET) || defined(INET6)
    +	(void)tcp_lro_init(&ss->lc);
    +#endif
    +	ss->lc.ifp = sc->ifp;
    +	
     	/* get the lanai pointers to the send and receive rings */
     
     	err = 0;
    @@ -4218,10 +4238,8 @@ mxge_ioctl(struct ifnet *ifp, u_long com
     		} else if (mask & IFCAP_RXCSUM) {
     			if (IFCAP_RXCSUM & ifp->if_capenable) {
     				ifp->if_capenable &= ~IFCAP_RXCSUM;
    -				sc->csum_flag = 0;
     			} else {
     				ifp->if_capenable |= IFCAP_RXCSUM;
    -				sc->csum_flag = 1;
     			}
     		}
     		if (mask & IFCAP_TSO4) {
    @@ -4248,16 +4266,12 @@ mxge_ioctl(struct ifnet *ifp, u_long com
     				ifp->if_hwassist |= (CSUM_TCP_IPV6
     						     | CSUM_UDP_IPV6);
     			}
    -#ifdef NOTYET
    -		} else if (mask & IFCAP_RXCSUM6) {
    -			if (IFCAP_RXCSUM6 & ifp->if_capenable) {
    -				ifp->if_capenable &= ~IFCAP_RXCSUM6;
    -				sc->csum_flag = 0;
    +		} else if (mask & IFCAP_RXCSUM_IPV6) {
    +			if (IFCAP_RXCSUM_IPV6 & ifp->if_capenable) {
    +				ifp->if_capenable &= ~IFCAP_RXCSUM_IPV6;
     			} else {
    -				ifp->if_capenable |= IFCAP_RXCSUM6;
    -				sc->csum_flag = 1;
    +				ifp->if_capenable |= IFCAP_RXCSUM_IPV6;
     			}
    -#endif
     		}
     		if (mask & IFCAP_TSO6) {
     			if (IFCAP_TSO6 & ifp->if_capenable) {
    @@ -4273,12 +4287,8 @@ mxge_ioctl(struct ifnet *ifp, u_long com
     		}
     #endif /*IFCAP_TSO6 */
     
    -		if (mask & IFCAP_LRO) {
    -			if (IFCAP_LRO & ifp->if_capenable) 
    -				err = mxge_change_lro_locked(sc, 0);
    -			else
    -				err = mxge_change_lro_locked(sc, mxge_lro_cnt);
    -		}
    +		if (mask & IFCAP_LRO)
    +			ifp->if_capenable ^= IFCAP_LRO;
     		if (mask & IFCAP_VLAN_HWTAGGING)
     			ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
     		if (mask & IFCAP_VLAN_HWTSO)
    @@ -4325,14 +4335,11 @@ mxge_fetch_tunables(mxge_softc_t *sc)
     	TUNABLE_INT_FETCH("hw.mxge.verbose", 
     			  &mxge_verbose);	
     	TUNABLE_INT_FETCH("hw.mxge.ticks", &mxge_ticks);
    -	TUNABLE_INT_FETCH("hw.mxge.lro_cnt", &sc->lro_cnt);
     	TUNABLE_INT_FETCH("hw.mxge.always_promisc", &mxge_always_promisc);
     	TUNABLE_INT_FETCH("hw.mxge.rss_hash_type", &mxge_rss_hash_type);
     	TUNABLE_INT_FETCH("hw.mxge.rss_hashtype", &mxge_rss_hash_type);
     	TUNABLE_INT_FETCH("hw.mxge.initial_mtu", &mxge_initial_mtu);
     	TUNABLE_INT_FETCH("hw.mxge.throttle", &mxge_throttle);
    -	if (sc->lro_cnt != 0)
    -		mxge_lro_cnt = sc->lro_cnt;
     
     	if (bootverbose)
     		mxge_verbose = 1;
    @@ -4896,8 +4903,9 @@ mxge_attach(device_t dev)
     
     	ifp->if_baudrate = IF_Gbps(10UL);
     	ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO4 |
    -		IFCAP_VLAN_MTU | IFCAP_LINKSTATE | IFCAP_TXCSUM_IPV6;
    -#ifdef INET
    +		IFCAP_VLAN_MTU | IFCAP_LINKSTATE | IFCAP_TXCSUM_IPV6 |
    +		IFCAP_RXCSUM_IPV6;
    +#if defined(INET) || defined(INET6)
     	ifp->if_capabilities |= IFCAP_LRO;
     #endif
     
    @@ -4928,7 +4936,6 @@ mxge_attach(device_t dev)
     	ifp->if_capenable = ifp->if_capabilities;
     	if (sc->lro_cnt == 0)
     		ifp->if_capenable &= ~IFCAP_LRO;
    -	sc->csum_flag = 1;
             ifp->if_init = mxge_init;
             ifp->if_softc = sc;
             ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
    
    Modified: stable/9/sys/dev/mxge/if_mxge_var.h
    ==============================================================================
    --- stable/9/sys/dev/mxge/if_mxge_var.h	Thu Feb 28 16:36:12 2013	(r247471)
    +++ stable/9/sys/dev/mxge/if_mxge_var.h	Thu Feb 28 16:38:28 2013	(r247472)
    @@ -181,31 +181,6 @@ typedef struct
     	char mtx_name[16];
     } mxge_tx_ring_t;
     
    -struct lro_entry;
    -struct lro_entry
    -{
    -	SLIST_ENTRY(lro_entry) next;
    -	struct mbuf  	*m_head;
    -	struct mbuf	*m_tail;
    -	int		timestamp;
    -	struct ip	*ip;
    -	uint32_t	tsval;
    -	uint32_t	tsecr;
    -	uint32_t	source_ip;
    -	uint32_t	dest_ip;
    -	uint32_t	next_seq;
    -	uint32_t	ack_seq;
    -	uint32_t	len;
    -	uint32_t	data_csum;
    -	uint16_t	window;
    -	uint16_t	source_port;
    -	uint16_t	dest_port;
    -	uint16_t	append_cnt;
    -	uint16_t	mss;
    -	
    -};
    -SLIST_HEAD(lro_head, lro_entry);
    -
     struct mxge_softc;
     typedef struct mxge_softc mxge_softc_t;
     
    @@ -223,11 +198,7 @@ struct mxge_slice_state {
     	u_long omcasts;
     	u_long oerrors;
     	int if_drv_flags;
    -	struct lro_head lro_active;
    -	struct lro_head lro_free;
    -	int lro_queued;
    -	int lro_flushed;
    -	int lro_bad_csum;
    +	struct lro_ctrl lc;
     	mxge_dma_t fw_stats_dma;
     	struct sysctl_oid *sysctl_tree;
     	struct sysctl_ctx_list sysctl_ctx;
    @@ -237,7 +208,6 @@ struct mxge_slice_state {
     struct mxge_softc {
     	struct ifnet* ifp;
     	struct mxge_slice_state *ss;
    -	int csum_flag;			/* rx_csums? 		*/
     	int tx_boundary;		/* boundary transmits cannot cross*/
     	int lro_cnt;
     	bus_dma_tag_t	parent_dmat;
    
    Modified: stable/9/sys/modules/mxge/mxge/Makefile
    ==============================================================================
    --- stable/9/sys/modules/mxge/mxge/Makefile	Thu Feb 28 16:36:12 2013	(r247471)
    +++ stable/9/sys/modules/mxge/mxge/Makefile	Thu Feb 28 16:38:28 2013	(r247472)
    @@ -3,6 +3,6 @@
     .PATH: ${.CURDIR}/../../../dev/mxge
     
     KMOD=	if_mxge
    -SRCS=	if_mxge.c mxge_lro.c device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h
    +SRCS=	if_mxge.c device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h
     
     .include 
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 16:39:45 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 1B1F9796;
     Thu, 28 Feb 2013 16:39:45 +0000 (UTC)
     (envelope-from hselasky@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 01EDC86;
     Thu, 28 Feb 2013 16:39:45 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SGdihe063878;
     Thu, 28 Feb 2013 16:39:44 GMT
     (envelope-from hselasky@svn.freebsd.org)
    Received: (from hselasky@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SGdiDc063874;
     Thu, 28 Feb 2013 16:39:44 GMT
     (envelope-from hselasky@svn.freebsd.org)
    Message-Id: <201302281639.r1SGdiDc063874@svn.freebsd.org>
    From: Hans Petter Selasky 
    Date: Thu, 28 Feb 2013 16:39: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: r247473 - stable/9/sys/dev/usb/wlan
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 16:39:45 -0000
    
    Author: hselasky
    Date: Thu Feb 28 16:39:44 2013
    New Revision: 247473
    URL: http://svnweb.freebsd.org/changeset/base/247473
    
    Log:
      MFC r246944:
      Fix bad EEPROM parsing code.
    
    Modified:
      stable/9/sys/dev/usb/wlan/if_upgt.c
      stable/9/sys/dev/usb/wlan/if_upgtvar.h
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
    
    Modified: stable/9/sys/dev/usb/wlan/if_upgt.c
    ==============================================================================
    --- stable/9/sys/dev/usb/wlan/if_upgt.c	Thu Feb 28 16:38:28 2013	(r247472)
    +++ stable/9/sys/dev/usb/wlan/if_upgt.c	Thu Feb 28 16:39:44 2013	(r247473)
    @@ -1122,12 +1122,23 @@ upgt_eeprom_parse(struct upgt_softc *sc)
     	    (sizeof(struct upgt_eeprom_header) + preamble_len));
     
     	while (!option_end) {
    +
    +		/* sanity check */
    +		if (eeprom_option >= (struct upgt_eeprom_option *)
    +		    (sc->sc_eeprom + UPGT_EEPROM_SIZE)) {
    +			return (EINVAL);
    +		}
    +
     		/* the eeprom option length is stored in words */
     		option_len =
     		    (le16toh(eeprom_option->len) - 1) * sizeof(uint16_t);
     		option_type =
     		    le16toh(eeprom_option->type);
     
    +		/* sanity check */
    +		if (option_len == 0 || option_len >= UPGT_EEPROM_SIZE)
    +			return (EINVAL);
    +
     		switch (option_type) {
     		case UPGT_EEPROM_TYPE_NAME:
     			DPRINTF(sc, UPGT_DEBUG_FW,
    @@ -1198,7 +1209,6 @@ upgt_eeprom_parse(struct upgt_softc *sc)
     		eeprom_option = (struct upgt_eeprom_option *)
     		    (eeprom_option->data + option_len);
     	}
    -
     	return (0);
     }
     
    @@ -1207,7 +1217,9 @@ upgt_eeprom_parse_freq3(struct upgt_soft
     {
     	struct upgt_eeprom_freq3_header *freq3_header;
     	struct upgt_lmac_freq3 *freq3;
    -	int i, elements, flags;
    +	int i;
    +	int elements;
    +	int flags;
     	unsigned channel;
     
     	freq3_header = (struct upgt_eeprom_freq3_header *)data;
    @@ -1219,6 +1231,9 @@ upgt_eeprom_parse_freq3(struct upgt_soft
     	DPRINTF(sc, UPGT_DEBUG_FW, "flags=0x%02x elements=%d\n",
     	    flags, elements);
     
    +	if (elements >= (int)(UPGT_EEPROM_SIZE / sizeof(freq3[0])))
    +		return;
    +
     	for (i = 0; i < elements; i++) {
     		channel = ieee80211_mhz2ieee(le16toh(freq3[i].freq), 0);
     		if (channel >= IEEE80211_CHAN_MAX)
    @@ -1237,7 +1252,11 @@ upgt_eeprom_parse_freq4(struct upgt_soft
     	struct upgt_eeprom_freq4_header *freq4_header;
     	struct upgt_eeprom_freq4_1 *freq4_1;
     	struct upgt_eeprom_freq4_2 *freq4_2;
    -	int i, j, elements, settings, flags;
    +	int i;
    +	int j;
    +	int elements;
    +	int settings;
    +	int flags;
     	unsigned channel;
     
     	freq4_header = (struct upgt_eeprom_freq4_header *)data;
    @@ -1252,6 +1271,9 @@ upgt_eeprom_parse_freq4(struct upgt_soft
     	DPRINTF(sc, UPGT_DEBUG_FW, "flags=0x%02x elements=%d settings=%d\n",
     	    flags, elements, settings);
     
    +	if (elements >= (int)(UPGT_EEPROM_SIZE / sizeof(freq4_1[0])))
    +		return;
    +
     	for (i = 0; i < elements; i++) {
     		channel = ieee80211_mhz2ieee(le16toh(freq4_1[i].freq), 0);
     		if (channel >= IEEE80211_CHAN_MAX)
    @@ -1272,7 +1294,8 @@ void
     upgt_eeprom_parse_freq6(struct upgt_softc *sc, uint8_t *data, int len)
     {
     	struct upgt_lmac_freq6 *freq6;
    -	int i, elements;
    +	int i;
    +	int elements;
     	unsigned channel;
     
     	freq6 = (struct upgt_lmac_freq6 *)data;
    @@ -1280,6 +1303,9 @@ upgt_eeprom_parse_freq6(struct upgt_soft
     
     	DPRINTF(sc, UPGT_DEBUG_FW, "elements=%d\n", elements);
     
    +	if (elements >= (int)(UPGT_EEPROM_SIZE / sizeof(freq6[0])))
    +		return;
    +
     	for (i = 0; i < elements; i++) {
     		channel = ieee80211_mhz2ieee(le16toh(freq6[i].freq), 0);
     		if (channel >= IEEE80211_CHAN_MAX)
    
    Modified: stable/9/sys/dev/usb/wlan/if_upgtvar.h
    ==============================================================================
    --- stable/9/sys/dev/usb/wlan/if_upgtvar.h	Thu Feb 28 16:38:28 2013	(r247472)
    +++ stable/9/sys/dev/usb/wlan/if_upgtvar.h	Thu Feb 28 16:39:44 2013	(r247473)
    @@ -451,7 +451,7 @@ struct upgt_softc {
     	struct upgt_memory	 sc_memory;
     
     	/* data which we found in the EEPROM */
    -	uint8_t			 sc_eeprom[UPGT_EEPROM_SIZE];
    +	uint8_t			 sc_eeprom[2 * UPGT_EEPROM_SIZE] __aligned(4);
     	uint16_t		 sc_eeprom_hwrx;
     	struct upgt_lmac_freq3	 sc_eeprom_freq3[IEEE80211_CHAN_MAX];
     	struct upgt_lmac_freq4	 sc_eeprom_freq4[IEEE80211_CHAN_MAX][8];
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 16:43:42 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 1B498A3F;
     Thu, 28 Feb 2013 16:43:42 +0000 (UTC)
     (envelope-from hselasky@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 0CF4FE1;
     Thu, 28 Feb 2013 16:43:42 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SGhftD066132;
     Thu, 28 Feb 2013 16:43:41 GMT
     (envelope-from hselasky@svn.freebsd.org)
    Received: (from hselasky@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SGhfhp066130;
     Thu, 28 Feb 2013 16:43:41 GMT
     (envelope-from hselasky@svn.freebsd.org)
    Message-Id: <201302281643.r1SGhfhp066130@svn.freebsd.org>
    From: Hans Petter Selasky 
    Date: Thu, 28 Feb 2013 16:43:41 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
    Subject: svn commit: r247474 - in stable/9/sys/dev/usb: . serial
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 16:43:42 -0000
    
    Author: hselasky
    Date: Thu Feb 28 16:43:41 2013
    New Revision: 247474
    URL: http://svnweb.freebsd.org/changeset/base/247474
    
    Log:
      MFC r246753:
      Add new USB ID to FTDI driver.
      
      PR:		kern/175893
    
    Modified:
      stable/9/sys/dev/usb/serial/uftdi.c
      stable/9/sys/dev/usb/usbdevs
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
    
    Modified: stable/9/sys/dev/usb/serial/uftdi.c
    ==============================================================================
    --- stable/9/sys/dev/usb/serial/uftdi.c	Thu Feb 28 16:39:44 2013	(r247473)
    +++ stable/9/sys/dev/usb/serial/uftdi.c	Thu Feb 28 16:43:41 2013	(r247474)
    @@ -378,6 +378,7 @@ static const STRUCT_USB_HOST_ID uftdi_de
     	UFTDI_DEV(FTDI, IPLUS2, UFTDI_TYPE_AUTO),
     	UFTDI_DEV(FTDI, IRTRANS, UFTDI_TYPE_AUTO),
     	UFTDI_DEV(FTDI, KBS, UFTDI_TYPE_8U232AM),
    +	UFTDI_DEV(FTDI, KTLINK, UFTDI_TYPE_8U232AM),
     	UFTDI_DEV(FTDI, LENZ_LIUSB, UFTDI_TYPE_AUTO),
     	UFTDI_DEV(FTDI, LK202, UFTDI_TYPE_8U232AM),
     	UFTDI_DEV(FTDI, LK204, UFTDI_TYPE_8U232AM),
    
    Modified: stable/9/sys/dev/usb/usbdevs
    ==============================================================================
    --- stable/9/sys/dev/usb/usbdevs	Thu Feb 28 16:39:44 2013	(r247473)
    +++ stable/9/sys/dev/usb/usbdevs	Thu Feb 28 16:43:41 2013	(r247474)
    @@ -1713,6 +1713,7 @@ product FTDI 232H		0x6014	FTDI compatibl
     product FTDI SERIAL_2232D	0x9e90	FT2232D Dual port Serial
     product FTDI SERIAL_4232H	0x6011	FT4232H Quad port Serial
     product FTDI BEAGLEBONE		0xa6d0	BeagleBone
    +product FTDI KTLINK		0xbbe2	KT-LINK Embedded Hackers Multitool
     product FTDI TURTELIZER2	0xbdc8	egnite Turtelizer 2 JTAG/RS232 Adapter
     /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */
     product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 16:46:15 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 941C7E0A;
     Thu, 28 Feb 2013 16:46:15 +0000 (UTC)
     (envelope-from rysto32@gmail.com)
    Received: from mail-oa0-f46.google.com (mail-oa0-f46.google.com
     [209.85.219.46]) by mx1.freebsd.org (Postfix) with ESMTP id 17E6310D;
     Thu, 28 Feb 2013 16:46:14 +0000 (UTC)
    Received: by mail-oa0-f46.google.com with SMTP id k1so3960679oag.19
     for ; Thu, 28 Feb 2013 08:46:14 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
     h=mime-version:x-received:in-reply-to:references:date:message-id
     :subject:from:to:cc:content-type;
     bh=fywfp9U4kaC1JGHS+KnXUaSAc0T+nPxqHdk8LVeUpUA=;
     b=Ee273WLIjNqmxEPgkAJsBbzKFlPCzEmNmOFmuBH+j72HCHnYRPffDSjJorzQ/M1H+R
     9O+DP++aVTJ62ih+YqcA3lUm3peW7DiXOpo8Yf4kg7qUADEiSo0Tr4tSqUOmn6uXKrEB
     zLTyLyermTltpPzllVPiVRhyqcFoGfFPSQ+hv8pGcpz0rRmCMDx+7bHv4XfH7sUM5ltu
     E7eh2goc7DQdwlVDNUaOWOpiQPWasRbN6nOdR3vBSagFHT1Zh0CMx4FjrzV7AlFMhriK
     D9jI9TkJohK1TiI0q6CCf+SvWXaTFVYF+yue2WtYMv+W1tE5Zuxn4ke6jT8m+zlDowkD
     On8g==
    MIME-Version: 1.0
    X-Received: by 10.60.172.84 with SMTP id ba20mr6060780oec.10.1362069974546;
     Thu, 28 Feb 2013 08:46:14 -0800 (PST)
    Received: by 10.76.109.236 with HTTP; Thu, 28 Feb 2013 08:46:14 -0800 (PST)
    In-Reply-To: <20130228162522.GA41693@FreeBSD.org>
    References: <201302281127.r1SBR2VE068276@svn.freebsd.org>
     <20130228162522.GA41693@FreeBSD.org>
    Date: Thu, 28 Feb 2013 11:46:14 -0500
    Message-ID: 
    Subject: Re: svn commit: r247460 - head/sys/dev/acpica
    From: Ryan Stone 
    To: Alexey Dokuchaev 
    Content-Type: text/plain; charset=ISO-8859-1
    X-Content-Filtered-By: Mailman/MimeDel 2.1.14
    Cc: Davide Italiano , svn-src-head@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 16:46:15 -0000
    
    On Thu, Feb 28, 2013 at 11:25 AM, Alexey Dokuchaev wrote:
    
    > On Thu, Feb 28, 2013 at 11:27:02AM +0000, Davide Italiano wrote:
    > > New Revision: 247460
    > > URL: http://svnweb.freebsd.org/changeset/base/247460
    > >
    > > Log:
    > >   MFcalloutng (r247427 by mav):
    > >   We don't need any precision here. Let it be fast and dirty shift then
    > >   slow and excessively precise 64-bit division.
    > >
    > > -    if (sbt >= 0 && us > sbt / SBT_1US)
    > > -     us = sbt / SBT_1US;
    > > +    if (sbt >= 0 && us > (sbt >> 12))
    > > +     us = (sbt >> 12);
    >
    > Does this really buy us anything?  Modern compilers should be smart enough
    > to
    > generate correct code.  Do you have evidence that this is not the case
    > here?
    > Not to mention that it obfuscates the code by using some magic constant.
    >
    > ./danfe
    >
    
    SBT_1US is 4294, not 4096 (1 << 12).  This is an approximation, which the
    compiler obviously can't automatically apply.
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 16:56:10 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id EC011276;
     Thu, 28 Feb 2013 16:56:10 +0000 (UTC)
     (envelope-from hselasky@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 D0D3118C;
     Thu, 28 Feb 2013 16:56:10 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SGuALR069607;
     Thu, 28 Feb 2013 16:56:10 GMT
     (envelope-from hselasky@svn.freebsd.org)
    Received: (from hselasky@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SGu9Rr069596;
     Thu, 28 Feb 2013 16:56:09 GMT
     (envelope-from hselasky@svn.freebsd.org)
    Message-Id: <201302281656.r1SGu9Rr069596@svn.freebsd.org>
    From: Hans Petter Selasky 
    Date: Thu, 28 Feb 2013 16:56: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: r247475 - in stable/9: lib/libusb sys/dev/usb
     usr.sbin/usbconfig
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 16:56:11 -0000
    
    Author: hselasky
    Date: Thu Feb 28 16:56:08 2013
    New Revision: 247475
    URL: http://svnweb.freebsd.org/changeset/base/247475
    
    Log:
      MFC r246789:
      Add USB API to read power draw on USB devices.
      Update usbconfig to print power draw on USB devices.
    
    Modified:
      stable/9/lib/libusb/Makefile
      stable/9/lib/libusb/libusb20.3
      stable/9/lib/libusb/libusb20.c
      stable/9/lib/libusb/libusb20.h
      stable/9/lib/libusb/libusb20_int.h
      stable/9/lib/libusb/libusb20_ugen20.c
      stable/9/sys/dev/usb/usb_generic.c
      stable/9/sys/dev/usb/usb_ioctl.h
      stable/9/usr.sbin/usbconfig/dump.c
    Directory Properties:
      stable/9/lib/   (props changed)
      stable/9/lib/libusb/   (props changed)
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
      stable/9/usr.sbin/   (props changed)
    
    Modified: stable/9/lib/libusb/Makefile
    ==============================================================================
    --- stable/9/lib/libusb/Makefile	Thu Feb 28 16:43:41 2013	(r247474)
    +++ stable/9/lib/libusb/Makefile	Thu Feb 28 16:56:08 2013	(r247475)
    @@ -189,6 +189,7 @@ MLINKS += libusb20.3 libusb20_dev_reset.
     MLINKS += libusb20.3 libusb20_dev_check_connected.3
     MLINKS += libusb20.3 libusb20_dev_set_power_mode.3
     MLINKS += libusb20.3 libusb20_dev_get_power_mode.3
    +MLINKS += libusb20.3 libusb20_dev_get_power_usage.3
     MLINKS += libusb20.3 libusb20_dev_set_alt_index.3
     MLINKS += libusb20.3 libusb20_dev_get_device_desc.3
     MLINKS += libusb20.3 libusb20_dev_alloc_config.3
    
    Modified: stable/9/lib/libusb/libusb20.3
    ==============================================================================
    --- stable/9/lib/libusb/libusb20.3	Thu Feb 28 16:43:41 2013	(r247474)
    +++ stable/9/lib/libusb/libusb20.3	Thu Feb 28 16:56:08 2013	(r247475)
    @@ -26,7 +26,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd October 14, 2010
    +.Dd February 14, 2013
     .Dt LIBUSB20 3
     .Os
     .Sh NAME
    @@ -148,6 +148,8 @@ USB access library (libusb -lusb)
     .Fn libusb20_dev_set_power_mode "struct libusb20_device *pdev" "uint8_t power_mode"
     .Ft uint8_t
     .Fn libusb20_dev_get_power_mode "struct libusb20_device *pdev"
    +.Ft uint16_t
    +.Fn libusb20_dev_get_power_usage "struct libusb20_device *pdev"
     .Ft int
     .Fn libusb20_dev_set_alt_index "struct libusb20_device *pdev" "uint8_t iface_index" "uint8_t alt_index"
     .Ft struct LIBUSB20_DEVICE_DESC_DECODED *
    @@ -728,6 +730,12 @@ USB device.
     .
     .Pp
     .
    +.Fn libusb20_dev_get_power_usage
    +returns the reported power usage in milliamps for the given USB device.
    +A power usage of zero typically means that the device is self powered.
    +.
    +.Pp
    +.
     .Fn libusb20_dev_set_alt_index
     will try to set the given alternate index for the given
     USB interface index.
    
    Modified: stable/9/lib/libusb/libusb20.c
    ==============================================================================
    --- stable/9/lib/libusb/libusb20.c	Thu Feb 28 16:43:41 2013	(r247474)
    +++ stable/9/lib/libusb/libusb20.c	Thu Feb 28 16:56:08 2013	(r247475)
    @@ -71,6 +71,7 @@ dummy_callback(struct libusb20_transfer 
     #define	dummy_check_connected (void *)dummy_int
     #define	dummy_set_power_mode (void *)dummy_int
     #define	dummy_get_power_mode (void *)dummy_int
    +#define	dummy_get_power_usage (void *)dummy_int
     #define	dummy_kernel_driver_active (void *)dummy_int
     #define	dummy_detach_kernel_driver (void *)dummy_int
     #define	dummy_do_request_sync (void *)dummy_int
    @@ -710,6 +711,18 @@ libusb20_dev_get_power_mode(struct libus
     	return (power_mode);
     }
     
    +uint16_t
    +libusb20_dev_get_power_usage(struct libusb20_device *pdev)
    +{
    +	int error;
    +	uint16_t power_usage;
    +
    +	error = pdev->methods->get_power_usage(pdev, &power_usage);
    +	if (error)
    +		power_usage = 0;
    +	return (power_usage);
    +}
    +
     int
     libusb20_dev_set_alt_index(struct libusb20_device *pdev, uint8_t ifaceIndex, uint8_t altIndex)
     {
    
    Modified: stable/9/lib/libusb/libusb20.h
    ==============================================================================
    --- stable/9/lib/libusb/libusb20.h	Thu Feb 28 16:43:41 2013	(r247474)
    +++ stable/9/lib/libusb/libusb20.h	Thu Feb 28 16:56:08 2013	(r247475)
    @@ -254,6 +254,7 @@ int	libusb20_dev_reset(struct libusb20_d
     int	libusb20_dev_check_connected(struct libusb20_device *pdev);
     int	libusb20_dev_set_power_mode(struct libusb20_device *pdev, uint8_t power_mode);
     uint8_t	libusb20_dev_get_power_mode(struct libusb20_device *pdev);
    +uint16_t	libusb20_dev_get_power_usage(struct libusb20_device *pdev);
     int	libusb20_dev_set_alt_index(struct libusb20_device *pdev, uint8_t iface_index, uint8_t alt_index);
     int	libusb20_dev_get_info(struct libusb20_device *pdev, struct usb_device_info *pinfo);
     int	libusb20_dev_get_iface_desc(struct libusb20_device *pdev, uint8_t iface_index, char *buf, uint8_t len);
    
    Modified: stable/9/lib/libusb/libusb20_int.h
    ==============================================================================
    --- stable/9/lib/libusb/libusb20_int.h	Thu Feb 28 16:43:41 2013	(r247474)
    +++ stable/9/lib/libusb/libusb20_int.h	Thu Feb 28 16:56:08 2013	(r247475)
    @@ -105,6 +105,7 @@ typedef int (libusb20_process_t)(struct 
     typedef int (libusb20_reset_device_t)(struct libusb20_device *pdev);
     typedef int (libusb20_set_power_mode_t)(struct libusb20_device *pdev, uint8_t power_mode);
     typedef int (libusb20_get_power_mode_t)(struct libusb20_device *pdev, uint8_t *power_mode);
    +typedef int (libusb20_get_power_usage_t)(struct libusb20_device *pdev, uint16_t *power_usage);
     typedef int (libusb20_set_alt_index_t)(struct libusb20_device *pdev, uint8_t iface_index, uint8_t alt_index);
     typedef int (libusb20_set_config_index_t)(struct libusb20_device *pdev, uint8_t index);
     typedef int (libusb20_check_connected_t)(struct libusb20_device *pdev);
    @@ -127,6 +128,7 @@ typedef void (libusb20_tr_cancel_async_t
       m(n, check_connected) \
       m(n, set_power_mode) \
       m(n, get_power_mode) \
    +  m(n, get_power_usage) \
       m(n, set_alt_index) \
       m(n, set_config_index) \
       m(n, tr_cancel_async) \
    
    Modified: stable/9/lib/libusb/libusb20_ugen20.c
    ==============================================================================
    --- stable/9/lib/libusb/libusb20_ugen20.c	Thu Feb 28 16:43:41 2013	(r247474)
    +++ stable/9/lib/libusb/libusb20_ugen20.c	Thu Feb 28 16:56:08 2013	(r247475)
    @@ -69,6 +69,7 @@ static libusb20_reset_device_t ugen20_re
     static libusb20_check_connected_t ugen20_check_connected;
     static libusb20_set_power_mode_t ugen20_set_power_mode;
     static libusb20_get_power_mode_t ugen20_get_power_mode;
    +static libusb20_get_power_usage_t ugen20_get_power_usage;
     static libusb20_kernel_driver_active_t ugen20_kernel_driver_active;
     static libusb20_detach_kernel_driver_t ugen20_detach_kernel_driver;
     static libusb20_do_request_sync_t ugen20_do_request_sync;
    @@ -639,6 +640,18 @@ ugen20_get_power_mode(struct libusb20_de
     }
     
     static int
    +ugen20_get_power_usage(struct libusb20_device *pdev, uint16_t *power_usage)
    +{
    +	int temp;
    +
    +	if (ioctl(pdev->file_ctrl, USB_GET_POWER_USAGE, &temp)) {
    +		return (LIBUSB20_ERROR_OTHER);
    +	}
    +	*power_usage = temp;
    +	return (0);			/* success */
    +}
    +
    +static int
     ugen20_kernel_driver_active(struct libusb20_device *pdev,
         uint8_t iface_index)
     {
    
    Modified: stable/9/sys/dev/usb/usb_generic.c
    ==============================================================================
    --- stable/9/sys/dev/usb/usb_generic.c	Thu Feb 28 16:43:41 2013	(r247474)
    +++ stable/9/sys/dev/usb/usb_generic.c	Thu Feb 28 16:56:08 2013	(r247475)
    @@ -1831,6 +1831,17 @@ ugen_get_power_mode(struct usb_fifo *f)
     }
     
     static int
    +ugen_get_power_usage(struct usb_fifo *f)
    +{
    +	struct usb_device *udev = f->udev;
    +
    +	if (udev == NULL)
    +		return (0);
    +
    +	return (udev->power);
    +}
    +
    +static int
     ugen_do_port_feature(struct usb_fifo *f, uint8_t port_no,
         uint8_t set, uint16_t feature)
     {
    @@ -2192,6 +2203,10 @@ ugen_ioctl_post(struct usb_fifo *f, u_lo
     		*u.pint = ugen_get_power_mode(f);
     		break;
     
    +	case USB_GET_POWER_USAGE:
    +		*u.pint = ugen_get_power_usage(f);
    +		break;
    +
     	case USB_SET_PORT_ENABLE:
     		error = ugen_do_port_feature(f,
     		    *u.pint, 1, UHF_PORT_ENABLE);
    
    Modified: stable/9/sys/dev/usb/usb_ioctl.h
    ==============================================================================
    --- stable/9/sys/dev/usb/usb_ioctl.h	Thu Feb 28 16:43:41 2013	(r247474)
    +++ stable/9/sys/dev/usb/usb_ioctl.h	Thu Feb 28 16:56:08 2013	(r247475)
    @@ -270,7 +270,8 @@ struct usb_gen_quirk {
     #define	USB_IFACE_DRIVER_DETACH	_IOW ('U', 125, int)
     #define	USB_GET_PLUGTIME	_IOR ('U', 126, uint32_t)
     #define	USB_READ_DIR		_IOW ('U', 127, struct usb_read_dir)
    -/* 128 - 135 unused */
    +/* 128 - 134 unused */
    +#define	USB_GET_POWER_USAGE	_IOR ('U', 135, int)
     #define	USB_SET_TX_FORCE_SHORT	_IOW ('U', 136, int)
     #define	USB_SET_TX_TIMEOUT	_IOW ('U', 137, int)
     #define	USB_GET_TX_FRAME_SIZE	_IOR ('U', 138, int)
    
    Modified: stable/9/usr.sbin/usbconfig/dump.c
    ==============================================================================
    --- stable/9/usr.sbin/usbconfig/dump.c	Thu Feb 28 16:43:41 2013	(r247474)
    +++ stable/9/usr.sbin/usbconfig/dump.c	Thu Feb 28 16:56:08 2013	(r247475)
    @@ -225,13 +225,17 @@ dump_device_info(struct libusb20_device 
     {
     	char buf[128];
     	uint8_t n;
    +	unsigned int usage;
     
    -	printf("%s, cfg=%u md=%s spd=%s pwr=%s\n",
    +	usage = libusb20_dev_get_power_usage(pdev);
    +
    +	printf("%s, cfg=%u md=%s spd=%s pwr=%s (%umA)\n",
     	    libusb20_dev_get_desc(pdev),
     	    libusb20_dev_get_config_index(pdev),
     	    dump_mode(libusb20_dev_get_mode(pdev)),
     	    dump_speed(libusb20_dev_get_speed(pdev)),
    -	    dump_power_mode(libusb20_dev_get_power_mode(pdev)));
    +	    dump_power_mode(libusb20_dev_get_power_mode(pdev)),
    +	    usage);
     
     	if (!show_ifdrv)
     		return;
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 17:09:53 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 4651BC0D;
     Thu, 28 Feb 2013 17:09:53 +0000 (UTC) (envelope-from jhb@freebsd.org)
    Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net
     [IPv6:2001:470:1f10:75::2])
     by mx1.freebsd.org (Postfix) with ESMTP id 22AEB27D;
     Thu, 28 Feb 2013 17:09:53 +0000 (UTC)
    Received: from jhbbsd.localnet (unknown [209.249.190.124])
     by bigwig.baldwin.cx (Postfix) with ESMTPSA id 83AB8B9BA;
     Thu, 28 Feb 2013 12:09:52 -0500 (EST)
    From: John Baldwin 
    To: "Daniel O'Connor" 
    Subject: Re: svn commit: r247359 - head/sbin/reboot
    Date: Thu, 28 Feb 2013 11:01:15 -0500
    User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; )
    References: <201302262318.r1QNIauL003863@svn.freebsd.org>
     <201302271138.24452.jhb@freebsd.org>
     <4602D40D-C4B2-4FB5-8E3B-8D74E19118FD@gsoft.com.au>
    In-Reply-To: <4602D40D-C4B2-4FB5-8E3B-8D74E19118FD@gsoft.com.au>
    MIME-Version: 1.0
    Content-Type: Text/Plain;
      charset="iso-8859-1"
    Content-Transfer-Encoding: 7bit
    Message-Id: <201302281101.15493.jhb@freebsd.org>
    X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
     (bigwig.baldwin.cx); Thu, 28 Feb 2013 12:09:52 -0500 (EST)
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org, Nick Hibma 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 17:09:53 -0000
    
    On Wednesday, February 27, 2013 6:23:02 pm Daniel O'Connor wrote:
    > 
    > On 28/02/2013, at 3:08, John Baldwin  wrote:
    > >> URL: http://svnweb.freebsd.org/changeset/base/247359
    > >> 
    > >> Log:
    > >>  Clarify that overriding the -h/-D flags through flags in device.hints
    > >>  only works for sio(4) but not for uart(4) which no longer has this flag.
    > > 
    > > You should probably just remove the flag entirely.  sio(4) doesn't build on 
    > > 8.x and later.
    > 
    > 
    > The handbook will need fixing too since it mentions sio(4) and -D/-h.
    
    -D/-h are still valid and work fine with uart.
    
    -- 
    John Baldwin
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 17:10:31 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 117ACFC2;
     Thu, 28 Feb 2013 17:10:31 +0000 (UTC)
     (envelope-from davide@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 047E12B3;
     Thu, 28 Feb 2013 17:10:31 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SHAUvG074124;
     Thu, 28 Feb 2013 17:10:30 GMT (envelope-from davide@svn.freebsd.org)
    Received: (from davide@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SHAUW7074119;
     Thu, 28 Feb 2013 17:10:30 GMT (envelope-from davide@svn.freebsd.org)
    Message-Id: <201302281710.r1SHAUW7074119@svn.freebsd.org>
    From: Davide Italiano 
    Date: Thu, 28 Feb 2013 17:10:30 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247476 - head/sys/sys
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 17:10:31 -0000
    
    Author: davide
    Date: Thu Feb 28 17:10:30 2013
    New Revision: 247476
    URL: http://svnweb.freebsd.org/changeset/base/247476
    
    Log:
      Move the definition of sbintime_t type from  to .
      With this change we prevent gross namespace pollution.
      
      Reported by:	bde
      Suggested by:	attilio
    
    Modified:
      head/sys/sys/time.h
      head/sys/sys/types.h
    
    Modified: head/sys/sys/time.h
    ==============================================================================
    --- head/sys/sys/time.h	Thu Feb 28 16:56:08 2013	(r247475)
    +++ head/sys/sys/time.h	Thu Feb 28 17:10:30 2013	(r247476)
    @@ -109,7 +109,6 @@ bintime_mul(struct bintime *bt, u_int x)
     	    ((a)->frac cmp (b)->frac) :					\
     	    ((a)->sec cmp (b)->sec))
     
    -typedef int64_t sbintime_t;
     #define	SBT_1S	((sbintime_t)1 << 32)
     #define	SBT_1M	(SBT_1S * 60)
     #define	SBT_1MS	(SBT_1S / 1000)
    
    Modified: head/sys/sys/types.h
    ==============================================================================
    --- head/sys/sys/types.h	Thu Feb 28 16:56:08 2013	(r247475)
    +++ head/sys/sys/types.h	Thu Feb 28 17:10:30 2013	(r247476)
    @@ -188,6 +188,8 @@ typedef	__rlim_t	rlim_t;		/* resource li
     #define	_RLIM_T_DECLARED
     #endif
     
    +typedef	__int64_t	sbintime_t;
    +
     typedef	__segsz_t	segsz_t;	/* segment size (in pages) */
     
     #ifndef _SIZE_T_DECLARED
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 17:37:40 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 24107D70;
     Thu, 28 Feb 2013 17:37:40 +0000 (UTC)
     (envelope-from mavbsd@gmail.com)
    Received: from mail-la0-x236.google.com (mail-la0-x236.google.com
     [IPv6:2a00:1450:4010:c03::236])
     by mx1.freebsd.org (Postfix) with ESMTP id BB8B6648;
     Thu, 28 Feb 2013 17:37:38 +0000 (UTC)
    Received: by mail-la0-f54.google.com with SMTP id gw10so2069204lab.13
     for ; Thu, 28 Feb 2013 09:37:37 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
     h=x-received:sender:message-id:date:from:user-agent:mime-version:to
     :cc:subject:references:in-reply-to:content-type
     :content-transfer-encoding;
     bh=jCdrLhoE/cGnjXIpGbqErhcv/tx4PuHRtejlMG06LFE=;
     b=uC1hE68earCTHYv7JN5H1mVh8//msP77UA9qbAY3NqGGYTMrXQH06TJb4zAOXxGQmX
     G4DkJLObHtZCzuSmv22wr0s/Rq1gPyf8wIcwBlipCL1G021YdW70FTV0/CphyIyiOaV2
     G4BerHEkMP3BGVwpMdJohouF2i+gLNgAITcsN9oiOoNqSHPH6NCnxU6/yiSvbvRY1LVB
     0wBbQjny7mFjJ9XVDbJMmI3tvWfkbDcdwfOzCmyJh0FEnhE9Tuc63NwG2ZDTrJDD6Qu6
     QOsX8VhU3RhY0P5XzlMvBFKALjJQbK7Ox/hwZeXRfOvncDyZxhK1HYDbAAUpmJfe6bGL
     lf8A==
    X-Received: by 10.112.87.132 with SMTP id ay4mr3906045lbb.87.1362073057587;
     Thu, 28 Feb 2013 09:37:37 -0800 (PST)
    Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37])
     by mx.google.com with ESMTPS id g6sm3176128lbd.14.2013.02.28.09.37.34
     (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
     Thu, 28 Feb 2013 09:37:36 -0800 (PST)
    Sender: Alexander Motin 
    Message-ID: <512F95DC.1040005@FreeBSD.org>
    Date: Thu, 28 Feb 2013 19:37:32 +0200
    From: Alexander Motin 
    User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
     rv:17.0) Gecko/20130125 Thunderbird/17.0.2
    MIME-Version: 1.0
    To: Alexey Dokuchaev 
    Subject: Re: svn commit: r247460 - head/sys/dev/acpica
    References: <201302281127.r1SBR2VE068276@svn.freebsd.org>
     <20130228162522.GA41693@FreeBSD.org>
    In-Reply-To: <20130228162522.GA41693@FreeBSD.org>
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 7bit
    Cc: Davide Italiano , svn-src-head@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 17:37:40 -0000
    
    On 28.02.2013 18:25, Alexey Dokuchaev wrote:
    > On Thu, Feb 28, 2013 at 11:27:02AM +0000, Davide Italiano wrote:
    >> New Revision: 247460
    >> URL: http://svnweb.freebsd.org/changeset/base/247460
    >>
    >> Log:
    >>   MFcalloutng (r247427 by mav):
    >>   We don't need any precision here. Let it be fast and dirty shift then
    >>   slow and excessively precise 64-bit division.
    >>
    >> -    if (sbt >= 0 && us > sbt / SBT_1US)
    >> -	us = sbt / SBT_1US;
    >> +    if (sbt >= 0 && us > (sbt >> 12))
    >> +	us = (sbt >> 12);
    > 
    > Does this really buy us anything?  Modern compilers should be smart enough to
    > generate correct code.  Do you have evidence that this is not the case here?
    > Not to mention that it obfuscates the code by using some magic constant.
    
    SBT_1US is 4294 (0x10c6). The best that compiler may do is replace
    division with multiplication. In fact, Clang even does this on amd64.
    But on i386 it calls __divdi3(), doing 64bit division in software. Shift
    is definitely cheaper and 5% precision is fine here.
    
    -- 
    Alexander Motin
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 17:42:57 2013
    Return-Path: 
    Delivered-To: svn-src-all@FreeBSD.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 34099F62;
     Thu, 28 Feb 2013 17:42:57 +0000 (UTC)
     (envelope-from brde@optusnet.com.au)
    Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au
     [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id E7E21688;
     Thu, 28 Feb 2013 17:42:56 +0000 (UTC)
    Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au
     (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106])
     by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 54747122EA2;
     Fri,  1 Mar 2013 04:14:41 +1100 (EST)
    Date: Fri, 1 Mar 2013 04:14:41 +1100 (EST)
    From: Bruce Evans 
    X-X-Sender: bde@besplex.bde.org
    To: Alexey Dokuchaev 
    Subject: Re: svn commit: r247460 - head/sys/dev/acpica
    In-Reply-To: <20130228162522.GA41693@FreeBSD.org>
    Message-ID: <20130301034553.J3187@besplex.bde.org>
    References: <201302281127.r1SBR2VE068276@svn.freebsd.org>
     <20130228162522.GA41693@FreeBSD.org>
    MIME-Version: 1.0
    Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
    X-Optus-CM-Score: 0
    X-Optus-CM-Analysis: v=2.0 cv=D4sfsYtj c=1 sm=1 a=f5xiIF61AdoA:10
     a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=7E17uGdFteIA:10
     a=6I5d2MoRAAAA:8 a=oT54Gf4zYM1ZF3CoQrEA:9 a=CjuIK1q_8ugA:10
     a=TEtd8y5WR3g2ypngnwZWYw==:117
    Cc: Davide Italiano , svn-src-head@FreeBSD.org,
     svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 17:42:57 -0000
    
    On Thu, 28 Feb 2013, Alexey Dokuchaev wrote:
    
    > On Thu, Feb 28, 2013 at 11:27:02AM +0000, Davide Italiano wrote:
    >> New Revision: 247460
    >> URL: http://svnweb.freebsd.org/changeset/base/247460
    >>
    >> Log:
    >>   MFcalloutng (r247427 by mav):
    >>   We don't need any precision here. Let it be fast and dirty shift then
    >>   slow and excessively precise 64-bit division.
    >>
    >> -    if (sbt >= 0 && us > sbt / SBT_1US)
    >> -	us = sbt / SBT_1US;
    >> +    if (sbt >= 0 && us > (sbt >> 12))
    >> +	us = (sbt >> 12);
    >
    > Does this really buy us anything?
    
    Only a little.
    
    > Modern compilers should be smart enough to
    > generate correct code.  Do you have evidence that this is not the case here?
    > Not to mention that it obfuscates the code by using some magic constant.
    
    Modern compilers aren't smart enough to generate optimal code for this.
    But they can be helped by casting sbt to uint64_t before dividing it by
    the power of 2.
    
    Testing showed the following non-optimal code:
    - clang on amd64: generates 2 extra shifts and 1 more addition for signed
       division.  It apparently doesn't notice that the tst ensures that sbt
       is >= 0.  It reduces the division to a shift but this needs fixups if
       the result might be negative.
    - gcc on amd64: turns the division into a single shift without help.
    - clang on i386: as on amd64.  Nice code except for the poor algorithm.
    - gcc on i386: uses the poor algorithm and generates fairly horrible code
       for it, with about 6 more register move instuctions than clang.
    
    Correct code for signed division by a power of 2 is different from
    correct code for unsigned division by a power of 2.  The former can't
    use a a shift, because C99 specifies division to be broken (that it
    rounds towards zero).  C90 permitted signed division to work correctly
    (to round towards minus infinity, or towards zero, in an
    implementation-defined way), but most hardware does the broken rounding
    so not many C implementations do correct rounding.
    
    Bruce
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 17:50:10 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 75E163BD;
     Thu, 28 Feb 2013 17:50:10 +0000 (UTC)
     (envelope-from yaneurabeya@gmail.com)
    Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com
     [209.85.220.43]) by mx1.freebsd.org (Postfix) with ESMTP id 3B36D6D4;
     Thu, 28 Feb 2013 17:50:10 +0000 (UTC)
    Received: by mail-pa0-f43.google.com with SMTP id bh2so1280787pad.30
     for ; Thu, 28 Feb 2013 09:50:09 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
     h=x-received:references:mime-version:in-reply-to:content-type
     :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date
     :to; bh=GGVBwb8n+5dZsc5boh8tFzj7V6oYh8fEjhtCuPV/eFo=;
     b=cpFYLCpIYzhwp/R+0TF/xXj5yGJU02Nu4yCkt/0uJO9L0uGwp7ZMUpl0uYQ4iszBLD
     0jWBK7sg1xFje2cE4Et9g+5nwreUr8mVEWfs8MNi6Yu7bTeKc03iHHZSxRAi6YWtsp92
     vtRVqlczJ9xdy+0TgQ5lnuWZ4OA3g/sODGKPMXTmeTQg0E+9pay5njZO6Q0iJCHN69aA
     fSbzBYGGUPU0XXErii3ZZD3LpsJ74My70C+KHgvopbBje0xx58p1pgKhgWf2NU30L3CT
     mpQ9i96fuxZV+M13qItbGtZGmBK24v4mAz7MgOMEEgKqhtfWGVz3dyxjiY0NvVJEd+12
     VYCQ==
    X-Received: by 10.68.213.132 with SMTP id ns4mr10628907pbc.84.1362073809010;
     Thu, 28 Feb 2013 09:50:09 -0800 (PST)
    Received: from [10.155.32.40] (mobile-166-147-082-043.mycingular.net.
     [166.147.82.43])
     by mx.google.com with ESMTPS id vd4sm9028328pbc.35.2013.02.28.09.50.06
     (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
     Thu, 28 Feb 2013 09:50:08 -0800 (PST)
    References: <201302262318.r1QNIauL003863@svn.freebsd.org>
     <201302271138.24452.jhb@freebsd.org>
     <4602D40D-C4B2-4FB5-8E3B-8D74E19118FD@gsoft.com.au>
     <201302281101.15493.jhb@freebsd.org>
    Mime-Version: 1.0 (1.0)
    In-Reply-To: <201302281101.15493.jhb@freebsd.org>
    Content-Type: text/plain;
    	charset=us-ascii
    Content-Transfer-Encoding: quoted-printable
    Message-Id: <683610EF-6A53-4E4A-9EF9-3021029CB84C@gmail.com>
    X-Mailer: iPhone Mail (10B146)
    From: Garrett Cooper 
    Subject: Re: svn commit: r247359 - head/sbin/reboot
    Date: Thu, 28 Feb 2013 09:50:00 -0800
    To: John Baldwin 
    Cc: "svn-src-head@freebsd.org" ,
     Daniel O'Connor ,
     "svn-src-all@freebsd.org" ,
     "src-committers@freebsd.org" ,
     Nick Hibma 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 17:50:10 -0000
    
    On Feb 28, 2013, at 8:01 AM, John Baldwin  wrote:
    
    > On Wednesday, February 27, 2013 6:23:02 pm Daniel O'Connor wrote:
    >>=20
    >> On 28/02/2013, at 3:08, John Baldwin  wrote:
    >>>> URL: http://svnweb.freebsd.org/changeset/base/247359
    >>>>=20
    >>>> Log:
    >>>> Clarify that overriding the -h/-D flags through flags in device.hints
    >>>> only works for sio(4) but not for uart(4) which no longer has this flag=
    .
    >>>=20
    >>> You should probably just remove the flag entirely.  sio(4) doesn't build=
     on=20
    >>> 8.x and later.
    >>=20
    >>=20
    >> The handbook will need fixing too since it mentions sio(4) and -D/-h.
    >=20
    > -D/-h are still valid and work fine with uart.
    
    +1
    
    The only thing that isn't really there is symmetry in the .flags hint.. I'll=
     file a pr for that today so it doesn't get forgotten..
    Thanks,
    -Garrett=
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 17:52:27 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id CE30D613;
     Thu, 28 Feb 2013 17:52:27 +0000 (UTC)
     (envelope-from carpeddiem@gmail.com)
    Received: from mail-oa0-f41.google.com (mail-oa0-f41.google.com
     [209.85.219.41]) by mx1.freebsd.org (Postfix) with ESMTP id 74C3F6ED;
     Thu, 28 Feb 2013 17:52:27 +0000 (UTC)
    Received: by mail-oa0-f41.google.com with SMTP id i10so4176219oag.14
     for ; Thu, 28 Feb 2013 09:52:27 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
     h=mime-version:x-received:sender:in-reply-to:references:date
     :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
     bh=p/SVAaCU2S0Q3gzbxnTKtzc4jIqyy8FhnEcOeOtP2Wc=;
     b=VKqbYuluzawffirRVmlEATJuKSO+0KkluoU6st4+N0R6sIlpFVFg2nA2/SUFRKTyuk
     ASTt69Mwy5clI+tV2FO7eJgFcA7h9OmAwEJgVBqsxSb+qdjp1G3kknF7tZFYPkYgpNtQ
     Ak1XevdqmtdAmOngi10wK4IS5cY2ctMiRTYqswRmCbytGfS4CanbafXHWUTM+VZd+XQn
     IoLxHzaCNUJuXXQL1NaABEs/Nba/tFNs9N/jBMiO4/zFsfV8DDRK89Y9POnRQkNCJCX+
     aLT7F5UQSHQ5XRco2XoG/UYhJe/v6EiBp7FcpUE4qr77HGTsdYbb0VqNqpsY8Qqcm47h
     2Oug==
    MIME-Version: 1.0
    X-Received: by 10.60.169.231 with SMTP id ah7mr6109646oec.142.1362073947011;
     Thu, 28 Feb 2013 09:52:27 -0800 (PST)
    Sender: carpeddiem@gmail.com
    Received: by 10.60.150.239 with HTTP; Thu, 28 Feb 2013 09:52:26 -0800 (PST)
    In-Reply-To: <201212121741.qBCHfM6Q008489@svn.freebsd.org>
    References: <201212121741.qBCHfM6Q008489@svn.freebsd.org>
    Date: Thu, 28 Feb 2013 12:52:26 -0500
    X-Google-Sender-Auth: tAK49L4Z8deqlIXWlPY5jzD5NCA
    Message-ID: 
    Subject: Re: svn commit: r244157 - head/sys/netinet
    From: Ed Maste 
    To: Gleb Smirnoff 
    Content-Type: text/plain; charset=ISO-8859-1
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 17:52:27 -0000
    
    On 12 December 2012 12:41, Gleb Smirnoff  wrote:
    > Author: glebius
    > Date: Wed Dec 12 17:41:21 2012
    > New Revision: 244157
    > URL: http://svnweb.freebsd.org/changeset/base/244157
    >
    > Log:
    >     Fix a crash in tcp_input(), that happens when mbuf has a fwd_tag on it,
    >   but later after processing and freeing the tag, we need to jump back again
    >   to the findpcb label. Since the fwd_tag pointer wasn't NULL we tried to
    >   process and free the tag for second time.
    
    This will fix the crash, but I worry that packets matching the
    TIMEWAIT cases that previously caused the crash will now fail to be
    forwarded instead.
    
    I'm looking at separating the detach and free of the fwd_tag to address this.
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 18:10:21 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 70E8BDED;
     Thu, 28 Feb 2013 18:10:21 +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 626CA89D;
     Thu, 28 Feb 2013 18:10:21 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SIALMd093025;
     Thu, 28 Feb 2013 18:10:21 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SIAKZf093019;
     Thu, 28 Feb 2013 18:10:20 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302281810.r1SIAKZf093019@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 18:10: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: r247478 - in stable/9/sys/dev: e1000 ixgbe
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 18:10:21 -0000
    
    Author: jhb
    Date: Thu Feb 28 18:10:20 2013
    New Revision: 247478
    URL: http://svnweb.freebsd.org/changeset/base/247478
    
    Log:
      MFC 240968:
      Merge similar fixes from 223198 from igb to ixgbe:
      - Use a dedicated task to handle deferred transmits from the if_transmit
        method instead of reusing the existing per-queue interrupt task.
        Reusing the per-queue interrupt task could result in both an interrupt
        thread and the taskqueue thread trying to handle received packets on a
        single queue resulting in out-of-order packet processing and lock
        contention.
      - Don't define ixgbe_start() at all when if_transmit is used.
    
    Modified:
      stable/9/sys/dev/e1000/if_igb.h
      stable/9/sys/dev/ixgbe/ixgbe.c
      stable/9/sys/dev/ixgbe/ixgbe.h
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
      stable/9/sys/dev/e1000/   (props changed)
      stable/9/sys/dev/ixgbe/   (props changed)
    
    Modified: stable/9/sys/dev/e1000/if_igb.h
    ==============================================================================
    --- stable/9/sys/dev/e1000/if_igb.h	Thu Feb 28 17:30:19 2013	(r247477)
    +++ stable/9/sys/dev/e1000/if_igb.h	Thu Feb 28 18:10:20 2013	(r247478)
    @@ -299,9 +299,9 @@ struct tx_ring {
     	struct igb_tx_buffer	*tx_buffers;
     #if __FreeBSD_version >= 800000
     	struct buf_ring		*br;
    +	struct task		txq_task;
     #endif
     	bus_dma_tag_t		txtag;
    -	struct task		txq_task;
     
     	u32			bytes;
     	u32			packets;
    
    Modified: stable/9/sys/dev/ixgbe/ixgbe.c
    ==============================================================================
    --- stable/9/sys/dev/ixgbe/ixgbe.c	Thu Feb 28 17:30:19 2013	(r247477)
    +++ stable/9/sys/dev/ixgbe/ixgbe.c	Thu Feb 28 18:10:20 2013	(r247478)
    @@ -104,13 +104,15 @@ static int      ixgbe_probe(device_t);
     static int      ixgbe_attach(device_t);
     static int      ixgbe_detach(device_t);
     static int      ixgbe_shutdown(device_t);
    -static void     ixgbe_start(struct ifnet *);
    -static void     ixgbe_start_locked(struct tx_ring *, struct ifnet *);
     #if __FreeBSD_version >= 800000
     static int	ixgbe_mq_start(struct ifnet *, struct mbuf *);
     static int	ixgbe_mq_start_locked(struct ifnet *,
                         struct tx_ring *, struct mbuf *);
     static void	ixgbe_qflush(struct ifnet *);
    +static void	ixgbe_deferred_mq_start(void *, int);
    +#else
    +static void     ixgbe_start(struct ifnet *);
    +static void     ixgbe_start_locked(struct tx_ring *, struct ifnet *);
     #endif
     static int      ixgbe_ioctl(struct ifnet *, u_long, caddr_t);
     static void	ixgbe_init(void *);
    @@ -626,6 +628,7 @@ ixgbe_detach(device_t dev)
     {
     	struct adapter *adapter = device_get_softc(dev);
     	struct ix_queue *que = adapter->queues;
    +	struct tx_ring *txr = adapter->tx_rings;
     	u32	ctrl_ext;
     
     	INIT_DEBUGOUT("ixgbe_detach: begin");
    @@ -640,8 +643,11 @@ ixgbe_detach(device_t dev)
     	ixgbe_stop(adapter);
     	IXGBE_CORE_UNLOCK(adapter);
     
    -	for (int i = 0; i < adapter->num_queues; i++, que++) {
    +	for (int i = 0; i < adapter->num_queues; i++, que++, txr++) {
     		if (que->tq) {
    +#if __FreeBSD_version >= 800000
    +			taskqueue_drain(que->tq, &txr->txq_task);
    +#endif
     			taskqueue_drain(que->tq, &que->que_task);
     			taskqueue_free(que->tq);
     		}
    @@ -703,6 +709,7 @@ ixgbe_shutdown(device_t dev)
     }
     
     
    +#if __FreeBSD_version < 800000
     /*********************************************************************
      *  Transmit entry point
      *
    @@ -774,7 +781,7 @@ ixgbe_start(struct ifnet *ifp)
     	return;
     }
     
    -#if __FreeBSD_version >= 800000
    +#else
     /*
     ** Multiqueue Transmit driver
     **
    @@ -802,7 +809,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct
     		IXGBE_TX_UNLOCK(txr);
     	} else {
     		err = drbr_enqueue(ifp, txr->br, m);
    -		taskqueue_enqueue(que->tq, &que->que_task);
    +		taskqueue_enqueue(que->tq, &txr->txq_task);
     	}
     
     	return (err);
    @@ -867,6 +874,22 @@ ixgbe_mq_start_locked(struct ifnet *ifp,
     }
     
     /*
    + * Called from a taskqueue to drain queued transmit packets.
    + */
    +static void
    +ixgbe_deferred_mq_start(void *arg, int pending)
    +{
    +	struct tx_ring *txr = arg;
    +	struct adapter *adapter = txr->adapter;
    +	struct ifnet *ifp = adapter->ifp;
    +
    +	IXGBE_TX_LOCK(txr);
    +	if (!drbr_empty(ifp, txr->br))
    +		ixgbe_mq_start_locked(ifp, txr, NULL);
    +	IXGBE_TX_UNLOCK(txr);
    +}
    +
    +/*
     ** Flush all ring buffers
     */
     static void
    @@ -2223,6 +2246,9 @@ ixgbe_allocate_legacy(struct adapter *ad
     {
     	device_t dev = adapter->dev;
     	struct		ix_queue *que = adapter->queues;
    +#if __FreeBSD_version >= 800000
    +	struct tx_ring		*txr = adapter->tx_rings;
    +#endif
     	int error, rid = 0;
     
     	/* MSI RID at 1 */
    @@ -2242,6 +2268,9 @@ ixgbe_allocate_legacy(struct adapter *ad
     	 * Try allocating a fast interrupt and the associated deferred
     	 * processing contexts.
     	 */
    +#if __FreeBSD_version >= 800000
    +	TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr);
    +#endif
     	TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que);
     	que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT,
                 taskqueue_thread_enqueue, &que->tq);
    @@ -2288,9 +2317,10 @@ ixgbe_allocate_msix(struct adapter *adap
     {
     	device_t        dev = adapter->dev;
     	struct 		ix_queue *que = adapter->queues;
    +	struct  	tx_ring *txr = adapter->tx_rings;
     	int 		error, rid, vector = 0;
     
    -	for (int i = 0; i < adapter->num_queues; i++, vector++, que++) {
    +	for (int i = 0; i < adapter->num_queues; i++, vector++, que++, txr++) {
     		rid = vector + 1;
     		que->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
     		    RF_SHAREABLE | RF_ACTIVE);
    @@ -2320,6 +2350,9 @@ ixgbe_allocate_msix(struct adapter *adap
     		if (adapter->num_queues > 1)
     			bus_bind_intr(dev, que->res, i);
     
    +#if __FreeBSD_version >= 800000
    +		TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr);
    +#endif
     		TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que);
     		que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT,
     		    taskqueue_thread_enqueue, &que->tq);
    @@ -2563,12 +2596,13 @@ ixgbe_setup_interface(device_t dev, stru
     	ifp->if_softc = adapter;
     	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
     	ifp->if_ioctl = ixgbe_ioctl;
    -	ifp->if_start = ixgbe_start;
     #if __FreeBSD_version >= 800000
     	ifp->if_transmit = ixgbe_mq_start;
     	ifp->if_qflush = ixgbe_qflush;
    +#else
    +	ifp->if_start = ixgbe_start;
    +	IFQ_SET_MAXLEN(&ifp->if_snd, adapter->num_tx_desc - 2);
     #endif
    -	ifp->if_snd.ifq_maxlen = adapter->num_tx_desc - 2;
     
     	ether_ifattach(ifp, adapter->hw.mac.addr);
     
    
    Modified: stable/9/sys/dev/ixgbe/ixgbe.h
    ==============================================================================
    --- stable/9/sys/dev/ixgbe/ixgbe.h	Thu Feb 28 17:30:19 2013	(r247477)
    +++ stable/9/sys/dev/ixgbe/ixgbe.h	Thu Feb 28 18:10:20 2013	(r247478)
    @@ -314,6 +314,7 @@ struct tx_ring {
     	char			mtx_name[16];
     #if __FreeBSD_version >= 800000
     	struct buf_ring		*br;
    +	struct task		txq_task;
     #endif
     #ifdef IXGBE_FDIR
     	u16			atr_sample;
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 18:10:36 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 94C17F81;
     Thu, 28 Feb 2013 18:10:36 +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 769538B8;
     Thu, 28 Feb 2013 18:10:36 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SIAaoA093102;
     Thu, 28 Feb 2013 18:10:36 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SIAa41093100;
     Thu, 28 Feb 2013 18:10:36 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302281810.r1SIAa41093100@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 18:10:36 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247479 - stable/8/sys/dev/ixgbe
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 18:10:36 -0000
    
    Author: jhb
    Date: Thu Feb 28 18:10:35 2013
    New Revision: 247479
    URL: http://svnweb.freebsd.org/changeset/base/247479
    
    Log:
      MFC 240968:
      Merge similar fixes from 223198 from igb to ixgbe:
      - Use a dedicated task to handle deferred transmits from the if_transmit
        method instead of reusing the existing per-queue interrupt task.
        Reusing the per-queue interrupt task could result in both an interrupt
        thread and the taskqueue thread trying to handle received packets on a
        single queue resulting in out-of-order packet processing and lock
        contention.
      - Don't define ixgbe_start() at all when if_transmit is used.
    
    Modified:
      stable/8/sys/dev/ixgbe/ixgbe.c
      stable/8/sys/dev/ixgbe/ixgbe.h
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/ixgbe/   (props changed)
    
    Modified: stable/8/sys/dev/ixgbe/ixgbe.c
    ==============================================================================
    --- stable/8/sys/dev/ixgbe/ixgbe.c	Thu Feb 28 18:10:20 2013	(r247478)
    +++ stable/8/sys/dev/ixgbe/ixgbe.c	Thu Feb 28 18:10:35 2013	(r247479)
    @@ -102,13 +102,15 @@ static int      ixgbe_probe(device_t);
     static int      ixgbe_attach(device_t);
     static int      ixgbe_detach(device_t);
     static int      ixgbe_shutdown(device_t);
    -static void     ixgbe_start(struct ifnet *);
    -static void     ixgbe_start_locked(struct tx_ring *, struct ifnet *);
     #if __FreeBSD_version >= 800000
     static int	ixgbe_mq_start(struct ifnet *, struct mbuf *);
     static int	ixgbe_mq_start_locked(struct ifnet *,
                         struct tx_ring *, struct mbuf *);
     static void	ixgbe_qflush(struct ifnet *);
    +static void	ixgbe_deferred_mq_start(void *, int);
    +#else
    +static void     ixgbe_start(struct ifnet *);
    +static void     ixgbe_start_locked(struct tx_ring *, struct ifnet *);
     #endif
     static int      ixgbe_ioctl(struct ifnet *, u_long, caddr_t);
     static void	ixgbe_init(void *);
    @@ -621,6 +623,7 @@ ixgbe_detach(device_t dev)
     {
     	struct adapter *adapter = device_get_softc(dev);
     	struct ix_queue *que = adapter->queues;
    +	struct tx_ring *txr = adapter->tx_rings;
     	u32	ctrl_ext;
     
     	INIT_DEBUGOUT("ixgbe_detach: begin");
    @@ -635,8 +638,11 @@ ixgbe_detach(device_t dev)
     	ixgbe_stop(adapter);
     	IXGBE_CORE_UNLOCK(adapter);
     
    -	for (int i = 0; i < adapter->num_queues; i++, que++) {
    +	for (int i = 0; i < adapter->num_queues; i++, que++, txr++) {
     		if (que->tq) {
    +#if __FreeBSD_version >= 800000
    +			taskqueue_drain(que->tq, &txr->txq_task);
    +#endif
     			taskqueue_drain(que->tq, &que->que_task);
     			taskqueue_free(que->tq);
     		}
    @@ -695,6 +701,7 @@ ixgbe_shutdown(device_t dev)
     }
     
     
    +#if __FreeBSD_version < 800000
     /*********************************************************************
      *  Transmit entry point
      *
    @@ -766,7 +773,7 @@ ixgbe_start(struct ifnet *ifp)
     	return;
     }
     
    -#if __FreeBSD_version >= 800000
    +#else
     /*
     ** Multiqueue Transmit driver
     **
    @@ -794,7 +801,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct
     		IXGBE_TX_UNLOCK(txr);
     	} else {
     		err = drbr_enqueue(ifp, txr->br, m);
    -		taskqueue_enqueue(que->tq, &que->que_task);
    +		taskqueue_enqueue(que->tq, &txr->txq_task);
     	}
     
     	return (err);
    @@ -864,6 +871,22 @@ ixgbe_mq_start_locked(struct ifnet *ifp,
     }
     
     /*
    + * Called from a taskqueue to drain queued transmit packets.
    + */
    +static void
    +ixgbe_deferred_mq_start(void *arg, int pending)
    +{
    +	struct tx_ring *txr = arg;
    +	struct adapter *adapter = txr->adapter;
    +	struct ifnet *ifp = adapter->ifp;
    +
    +	IXGBE_TX_LOCK(txr);
    +	if (!drbr_empty(ifp, txr->br))
    +		ixgbe_mq_start_locked(ifp, txr, NULL);
    +	IXGBE_TX_UNLOCK(txr);
    +}
    +
    +/*
     ** Flush all ring buffers
     */
     static void
    @@ -2158,6 +2181,9 @@ ixgbe_allocate_legacy(struct adapter *ad
     {
     	device_t dev = adapter->dev;
     	struct		ix_queue *que = adapter->queues;
    +#if __FreeBSD_version >= 800000
    +	struct tx_ring		*txr = adapter->tx_rings;
    +#endif
     	int error, rid = 0;
     
     	/* MSI RID at 1 */
    @@ -2177,6 +2203,9 @@ ixgbe_allocate_legacy(struct adapter *ad
     	 * Try allocating a fast interrupt and the associated deferred
     	 * processing contexts.
     	 */
    +#if __FreeBSD_version >= 800000
    +	TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr);
    +#endif
     	TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que);
     	que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT,
                 taskqueue_thread_enqueue, &que->tq);
    @@ -2223,9 +2252,10 @@ ixgbe_allocate_msix(struct adapter *adap
     {
     	device_t        dev = adapter->dev;
     	struct 		ix_queue *que = adapter->queues;
    +	struct  	tx_ring *txr = adapter->tx_rings;
     	int 		error, rid, vector = 0;
     
    -	for (int i = 0; i < adapter->num_queues; i++, vector++, que++) {
    +	for (int i = 0; i < adapter->num_queues; i++, vector++, que++, txr++) {
     		rid = vector + 1;
     		que->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
     		    RF_SHAREABLE | RF_ACTIVE);
    @@ -2255,6 +2285,9 @@ ixgbe_allocate_msix(struct adapter *adap
     		if (adapter->num_queues > 1)
     			bus_bind_intr(dev, que->res, i);
     
    +#if __FreeBSD_version >= 800000
    +		TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr);
    +#endif
     		TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que);
     		que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT,
     		    taskqueue_thread_enqueue, &que->tq);
    @@ -2499,12 +2532,13 @@ ixgbe_setup_interface(device_t dev, stru
     	ifp->if_softc = adapter;
     	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
     	ifp->if_ioctl = ixgbe_ioctl;
    -	ifp->if_start = ixgbe_start;
     #if __FreeBSD_version >= 800000
     	ifp->if_transmit = ixgbe_mq_start;
     	ifp->if_qflush = ixgbe_qflush;
    +#else
    +	ifp->if_start = ixgbe_start;
    +	IFQ_SET_MAXLEN(&ifp->if_snd, adapter->num_tx_desc - 2);
     #endif
    -	ifp->if_snd.ifq_maxlen = adapter->num_tx_desc - 2;
     
     	ether_ifattach(ifp, adapter->hw.mac.addr);
     
    
    Modified: stable/8/sys/dev/ixgbe/ixgbe.h
    ==============================================================================
    --- stable/8/sys/dev/ixgbe/ixgbe.h	Thu Feb 28 18:10:20 2013	(r247478)
    +++ stable/8/sys/dev/ixgbe/ixgbe.h	Thu Feb 28 18:10:35 2013	(r247479)
    @@ -298,6 +298,7 @@ struct tx_ring {
     	char			mtx_name[16];
     #if __FreeBSD_version >= 800000
     	struct buf_ring		*br;
    +	struct task		txq_task;
     #endif
     #ifdef IXGBE_FDIR
     	u16			atr_sample;
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 18:12:56 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id EE6DB626;
     Thu, 28 Feb 2013 18:12:56 +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 C3FFB90D;
     Thu, 28 Feb 2013 18:12:56 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SICuqE094995;
     Thu, 28 Feb 2013 18:12:56 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SICuFs094994;
     Thu, 28 Feb 2013 18:12:56 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302281812.r1SICuFs094994@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 18:12: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: r247480 - stable/9/usr.sbin/acpi/acpidump
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 18:12:57 -0000
    
    Author: jhb
    Date: Thu Feb 28 18:12:56 2013
    New Revision: 247480
    URL: http://svnweb.freebsd.org/changeset/base/247480
    
    Log:
      MFC 241198:
      Display the matrix of inter-domain distances in the SLIT table.  This is
      used to complement the SRAT table on NUMA machines.
    
    Modified:
      stable/9/usr.sbin/acpi/acpidump/acpi.c
    Directory Properties:
      stable/9/usr.sbin/acpi/acpidump/   (props changed)
    
    Modified: stable/9/usr.sbin/acpi/acpidump/acpi.c
    ==============================================================================
    --- stable/9/usr.sbin/acpi/acpidump/acpi.c	Thu Feb 28 18:10:35 2013	(r247479)
    +++ stable/9/usr.sbin/acpi/acpidump/acpi.c	Thu Feb 28 18:12:56 2013	(r247480)
    @@ -63,6 +63,7 @@ static void	acpi_handle_madt(ACPI_TABLE_
     static void	acpi_handle_ecdt(ACPI_TABLE_HEADER *sdp);
     static void	acpi_handle_hpet(ACPI_TABLE_HEADER *sdp);
     static void	acpi_handle_mcfg(ACPI_TABLE_HEADER *sdp);
    +static void	acpi_handle_slit(ACPI_TABLE_HEADER *sdp);
     static void	acpi_print_srat_cpu(uint32_t apic_id, uint32_t proximity_domain,
     		    uint32_t flags);
     static void	acpi_print_srat_memory(ACPI_SRAT_MEM_AFFINITY *mp);
    @@ -519,6 +520,33 @@ acpi_handle_mcfg(ACPI_TABLE_HEADER *sdp)
     }
     
     static void
    +acpi_handle_slit(ACPI_TABLE_HEADER *sdp)
    +{
    +	ACPI_TABLE_SLIT *slit;
    +	UINT64 i, j;
    +
    +	printf(BEGIN_COMMENT);
    +	acpi_print_sdt(sdp);
    +	slit = (ACPI_TABLE_SLIT *)sdp;
    +	printf("\tLocality Count=%jd\n", slit->LocalityCount);
    +	printf("\n\t      ");
    +	for (i = 0; i < slit->LocalityCount; i++)
    +		printf(" %3jd", i);
    +	printf("\n\t     +");
    +	for (i = 0; i < slit->LocalityCount; i++)
    +		printf("----");
    +	printf("\n");
    +	for (i = 0; i < slit->LocalityCount; i++) {
    +		printf("\t %3jd |", i);
    +		for (j = 0; j < slit->LocalityCount; j++)
    +			printf(" %3d",
    +			    slit->Entry[i * slit->LocalityCount + j]);
    +		printf("\n");
    +	}
    +	printf(END_COMMENT);
    +}
    +
    +static void
     acpi_print_srat_cpu(uint32_t apic_id, uint32_t proximity_domain,
         uint32_t flags)
     {
    @@ -1084,6 +1112,8 @@ acpi_handle_rsdt(ACPI_TABLE_HEADER *rsdp
     			acpi_handle_ecdt(sdp);
     		else if (!memcmp(sdp->Signature, ACPI_SIG_MCFG, 4))
     			acpi_handle_mcfg(sdp);
    +		else if (!memcmp(sdp->Signature, ACPI_SIG_SLIT, 4))
    +			acpi_handle_slit(sdp);
     		else if (!memcmp(sdp->Signature, ACPI_SIG_SRAT, 4))
     			acpi_handle_srat(sdp);
     		else if (!memcmp(sdp->Signature, ACPI_SIG_TCPA, 4))
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 18:22:42 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id B5A1372D;
     Thu, 28 Feb 2013 18:22:42 +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 998B7A31;
     Thu, 28 Feb 2013 18:22:42 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SIMgU8098000;
     Thu, 28 Feb 2013 18:22:42 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SIMfNk097995;
     Thu, 28 Feb 2013 18:22:41 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302281822.r1SIMfNk097995@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 18:22:41 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
    Subject: svn commit: r247481 - in stable/9/sys: amd64/include/pc dev/ipmi
     i386/include/pc x86/bios
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 18:22:42 -0000
    
    Author: jhb
    Date: Thu Feb 28 18:22:41 2013
    New Revision: 247481
    URL: http://svnweb.freebsd.org/changeset/base/247481
    
    Log:
      MFC 241027:
      - Re-shuffle the  headers to move all kernel-specific
        bits under #ifdef _KERNEL but leave definitions for various structures
        defined by standards ($PIR table, SMAP entries, etc.) available to
        userland.
      - Consolidate duplicate SMBIOS table structure definitions in ipmi(4)
        and smbios(4) in  and make them available to
        userland.
    
    Modified:
      stable/9/sys/amd64/include/pc/bios.h
      stable/9/sys/dev/ipmi/ipmi_smbios.c
      stable/9/sys/i386/include/pc/bios.h
      stable/9/sys/x86/bios/smbios.c
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
    
    Modified: stable/9/sys/amd64/include/pc/bios.h
    ==============================================================================
    --- stable/9/sys/amd64/include/pc/bios.h	Thu Feb 28 18:12:56 2013	(r247480)
    +++ stable/9/sys/amd64/include/pc/bios.h	Thu Feb 28 18:22:41 2013	(r247481)
    @@ -30,16 +30,9 @@
     #ifndef _MACHINE_PC_BIOS_H_
     #define _MACHINE_PC_BIOS_H_
     
    -extern u_int32_t	bios_sigsearch(u_int32_t start, u_char *sig, int siglen, 
    -					 int paralen, int sigofs);
    -
    -#define BIOS_PADDRTOVADDR(x)	((x) + KERNBASE)
    -#define BIOS_VADDRTOPADDR(x)	((x) - KERNBASE)
    -
     /*
      * Int 15:E820 'SMAP' structure
      */
    -
     #define SMAP_SIG	0x534D4150			/* 'SMAP' */
     
     #define	SMAP_TYPE_MEMORY	1
    @@ -58,22 +51,61 @@ struct bios_smap {
         u_int32_t	type;
     } __packed;
     
    +/*
    + * System Management BIOS
    + */
    +#define	SMBIOS_START	0xf0000
    +#define	SMBIOS_STEP	0x10
    +#define	SMBIOS_OFF	0
    +#define	SMBIOS_LEN	4
    +#define	SMBIOS_SIG	"_SM_"
    +
    +struct smbios_eps {
    +	uint8_t		anchor_string[4];		/* '_SM_' */
    +	uint8_t		checksum;
    +	uint8_t		length;
    +	uint8_t		major_version;
    +	uint8_t		minor_version;
    +	uint16_t	maximum_structure_size;
    +	uint8_t		entry_point_revision;
    +	uint8_t		formatted_area[5];
    +	uint8_t		intermediate_anchor_string[5];	/* '_DMI_' */
    +	uint8_t		intermediate_checksum;
    +	uint16_t	structure_table_length;
    +	uint32_t	structure_table_address;
    +	uint16_t	number_structures;
    +	uint8_t		BCD_revision;
    +};
    +
    +struct smbios_structure_header {
    +	uint8_t		type;
    +	uint8_t		length;
    +	uint16_t	handle;
    +};
    +
    +#ifdef _KERNEL
    +#define BIOS_PADDRTOVADDR(x)	((x) + KERNBASE)
    +#define BIOS_VADDRTOPADDR(x)	((x) - KERNBASE)
    +
     struct bios_oem_signature {
     	char * anchor;		/* search anchor string in BIOS memory */
     	size_t offset;		/* offset from anchor (may be negative) */
     	size_t totlen;		/* total length of BIOS string to copy */
     } __packed;
    +
     struct bios_oem_range {
     	u_int from;		/* shouldn't be below 0xe0000 */
     	u_int to;		/* shouldn't be above 0xfffff */
     } __packed;
    +
     struct bios_oem {
     	struct bios_oem_range range;
     	struct bios_oem_signature signature[];
     } __packed;
     
    -extern int
    -bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen);
    -
    +int	bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen);
    +uint32_t bios_sigsearch(uint32_t start, u_char *sig, int siglen, int paralen,
    +	    int sigofs);
    +#endif
     
     #endif /* _MACHINE_PC_BIOS_H_ */
    
    Modified: stable/9/sys/dev/ipmi/ipmi_smbios.c
    ==============================================================================
    --- stable/9/sys/dev/ipmi/ipmi_smbios.c	Thu Feb 28 18:12:56 2013	(r247480)
    +++ stable/9/sys/dev/ipmi/ipmi_smbios.c	Thu Feb 28 18:22:41 2013	(r247481)
    @@ -52,29 +52,6 @@ __FBSDID("$FreeBSD$");
     #define	pmap_unmapbios		pmap_unmapdev
     #endif
     
    -struct smbios_table {
    -	uint8_t		anchor_string[4];
    -	uint8_t		checksum;
    -	uint8_t		length;
    -	uint8_t		major_version;
    -	uint8_t		minor_version;
    -	uint16_t	maximum_structure_size;
    -	uint8_t		entry_point_revision;
    -	uint8_t		formatted_area[5];
    -	uint8_t		DMI_anchor_string[5];
    -	uint8_t		intermediate_checksum;
    -	uint16_t	structure_table_length;
    -	uint32_t	structure_table_address;
    -	uint16_t	number_structures;
    -	uint8_t		BCD_revision;
    -};
    -
    -struct structure_header {
    -	uint8_t		type;
    -	uint8_t		length;
    -	uint16_t	handle;
    -};
    -
     struct ipmi_entry {
     	uint8_t		type;
     	uint8_t		length;
    @@ -102,13 +79,7 @@ struct ipmi_entry {
     #define	SPACING_32		0x1
     #define	SPACING_16		0x2
     
    -#define	SMBIOS_START		0xf0000
    -#define	SMBIOS_STEP		0x10
    -#define	SMBIOS_OFF		0
    -#define	SMBIOS_LEN		4
    -#define	SMBIOS_SIG		"_SM_"
    -
    -typedef void (*smbios_callback_t)(struct structure_header *, void *);
    +typedef void (*smbios_callback_t)(struct smbios_structure_header *, void *);
     
     static struct ipmi_get_info ipmi_info;
     static int ipmi_probed;
    @@ -116,13 +87,13 @@ static struct mtx ipmi_info_mtx;
     MTX_SYSINIT(ipmi_info, &ipmi_info_mtx, "ipmi info", MTX_DEF);
     
     static void	ipmi_smbios_probe(struct ipmi_get_info *);
    -static int	smbios_cksum(struct smbios_table *);
    +static int	smbios_cksum(struct smbios_eps *);
     static void	smbios_walk_table(uint8_t *, int, smbios_callback_t,
     		    void *);
    -static void	smbios_ipmi_info(struct structure_header *, void *);
    +static void	smbios_ipmi_info(struct smbios_structure_header *, void *);
     
     static void
    -smbios_ipmi_info(struct structure_header *h, void *arg)
    +smbios_ipmi_info(struct smbios_structure_header *h, void *arg)
     {
     	struct ipmi_get_info *info;
     	struct ipmi_entry *s;
    @@ -178,10 +149,10 @@ smbios_ipmi_info(struct structure_header
     static void
     smbios_walk_table(uint8_t *p, int entries, smbios_callback_t cb, void *arg)
     {
    -	struct structure_header *s;
    +	struct smbios_structure_header *s;
     
     	while (entries--) {
    -		s = (struct structure_header *)p;
    +		s = (struct smbios_structure_header *)p;
     		cb(s, arg);
     
     		/*
    @@ -208,7 +179,7 @@ smbios_walk_table(uint8_t *p, int entrie
     static void
     ipmi_smbios_probe(struct ipmi_get_info *info)
     {
    -	struct smbios_table *header;
    +	struct smbios_eps *header;
     	void *table;
     	u_int32_t addr;
     
    @@ -225,9 +196,9 @@ ipmi_smbios_probe(struct ipmi_get_info *
     	 * length and then map it a second time with the actual length so
     	 * we can verify the checksum.
     	 */
    -	header = pmap_mapbios(addr, sizeof(struct smbios_table));
    +	header = pmap_mapbios(addr, sizeof(struct smbios_eps));
     	table = pmap_mapbios(addr, header->length);
    -	pmap_unmapbios((vm_offset_t)header, sizeof(struct smbios_table));
    +	pmap_unmapbios((vm_offset_t)header, sizeof(struct smbios_eps));
     	header = table;
     	if (smbios_cksum(header) != 0) {
     		pmap_unmapbios((vm_offset_t)header, header->length);
    @@ -282,7 +253,7 @@ ipmi_smbios_identify(struct ipmi_get_inf
     }
     
     static int
    -smbios_cksum(struct smbios_table *e)
    +smbios_cksum(struct smbios_eps *e)
     {
     	u_int8_t *ptr;
     	u_int8_t cksum;
    
    Modified: stable/9/sys/i386/include/pc/bios.h
    ==============================================================================
    --- stable/9/sys/i386/include/pc/bios.h	Thu Feb 28 18:12:56 2013	(r247480)
    +++ stable/9/sys/i386/include/pc/bios.h	Thu Feb 28 18:22:41 2013	(r247481)
    @@ -44,31 +44,6 @@ struct bios32_SDheader 
     };
     
     /* 
    - * BIOS32 Service Directory entry.  Caller supplies name, bios32_SDlookup
    - * fills in the rest of the details.
    - */
    -struct bios32_SDentry 
    -{
    -    union 
    -    {
    -	u_int8_t	name[4];	/* service identifier */
    -	u_int32_t	id;		/* as a 32-bit value */
    -    } ident;
    -    u_int32_t	base;			/* base of service */
    -    u_int32_t	len;			/* service length */
    -    u_int32_t	entry;			/* entrypoint offset from base */
    -    vm_offset_t	ventry;			/* entrypoint in kernel virtual segment */
    -};
    -
    -extern int		bios32_SDlookup(struct bios32_SDentry *ent);
    -extern u_int32_t	bios_sigsearch(u_int32_t start, u_char *sig, int siglen, 
    -					 int paralen, int sigofs);
    -
    -#define BIOS_PADDRTOVADDR(x)	((x) + KERNBASE)
    -#define BIOS_VADDRTOPADDR(x)	((x) - KERNBASE)
    -
    -
    -/* 
      * PnP BIOS presence structure
      */
     struct PnPBIOS_table 
    @@ -88,52 +63,13 @@ struct PnPBIOS_table 
         u_int32_t	pmdataseg;		/* protected-mode data segment */
     } __packed;
     
    -
    -/* 
    - * Exported lookup results 
    - */
    -extern struct bios32_SDentry	PCIbios;
    -
    -struct segment_info {
    -	u_int	base;
    -	u_int	limit;
    -};
    -
    -#define BIOSCODE_FLAG	0x01
    -#define BIOSDATA_FLAG	0x02
    -#define BIOSUTIL_FLAG	0x04
    -#define BIOSARGS_FLAG	0x08
    -
    -struct bios_segments {
    -	struct	segment_info code32;		/* 32-bit code (mandatory) */
    -	struct	segment_info code16;		/* 16-bit code */
    -	struct	segment_info data;		/* 16-bit data */
    -	struct	segment_info util;		/* 16-bit utility */
    -	struct	segment_info args;		/* 16-bit args */
    -};
    -
    -struct bios_regs {
    -	u_int	eax;
    -	u_int	ebx;
    -	u_int	ecx;
    -	u_int	edx;
    -	u_int	esi;
    -	u_int	edi;
    -};
    -
    -struct bios_args {
    -	u_int	entry;				/* entry point of routine */
    -	struct	bios_regs r;
    -	struct	bios_segments seg;
    -};
    -
     /*
      * PnP BIOS return codes
      */
     #define PNP_SUCCESS				0x00
     #define PNP_NOT_SET_STATICALLY			0x7f
     #define PNP_UNKNOWN_FUNCTION			0x81
    -#define PNP_FUNTION_NOT_SUPPORTED		0x82
    +#define PNP_FUNCTION_NOT_SUPPORTED		0x82
     #define PNP_INVALID_HANDLE			0x83
     #define PNP_BAD_PARAMETER			0x84
     #define PNP_SET_FAILED				0x85
    @@ -219,11 +155,6 @@ struct bios_args {
     #define PCIBIOS_GET_IRQ_ROUTING		0xb10e
     #define PCIBIOS_ROUTE_INTERRUPT		0xb10f
     
    -extern int bios16(struct bios_args *, char *, ...);
    -extern int bios16_call(struct bios_regs *, char *);
    -extern int bios32(struct bios_regs *, u_int, u_short);
    -extern void set_bios_selectors(struct bios_segments *, int);
    -
     /*
      * PCI interrupt routing table.
      *
    @@ -272,7 +203,6 @@ struct PIR_table 
     /*
      * Int 15:E820 'SMAP' structure
      */
    -
     #define SMAP_SIG	0x534D4150			/* 'SMAP' */
     
     #define	SMAP_TYPE_MEMORY	1
    @@ -291,22 +221,122 @@ struct bios_smap {
         u_int32_t	type;
     } __packed;
     
    +/*
    + * System Management BIOS
    + */
    +#define	SMBIOS_START	0xf0000
    +#define	SMBIOS_STEP	0x10
    +#define	SMBIOS_OFF	0
    +#define	SMBIOS_LEN	4
    +#define	SMBIOS_SIG	"_SM_"
    +
    +struct smbios_eps {
    +	uint8_t		anchor_string[4];		/* '_SM_' */
    +	uint8_t		checksum;
    +	uint8_t		length;
    +	uint8_t		major_version;
    +	uint8_t		minor_version;
    +	uint16_t	maximum_structure_size;
    +	uint8_t		entry_point_revision;
    +	uint8_t		formatted_area[5];
    +	uint8_t		intermediate_anchor_string[5];	/* '_DMI_' */
    +	uint8_t		intermediate_checksum;
    +	uint16_t	structure_table_length;
    +	uint32_t	structure_table_address;
    +	uint16_t	number_structures;
    +	uint8_t		BCD_revision;
    +};
    +
    +struct smbios_structure_header {
    +	uint8_t		type;
    +	uint8_t		length;
    +	uint16_t	handle;
    +};
    +
    +#ifdef _KERNEL
    +#define BIOS_PADDRTOVADDR(x)	((x) + KERNBASE)
    +#define BIOS_VADDRTOPADDR(x)	((x) - KERNBASE)
    +
     struct bios_oem_signature {
     	char * anchor;		/* search anchor string in BIOS memory */
     	size_t offset;		/* offset from anchor (may be negative) */
     	size_t totlen;		/* total length of BIOS string to copy */
     } __packed;
    +
     struct bios_oem_range {
     	u_int from;		/* shouldn't be below 0xe0000 */
     	u_int to;		/* shouldn't be above 0xfffff */
     } __packed;
    +
     struct bios_oem {
     	struct bios_oem_range range;
     	struct bios_oem_signature signature[];
     } __packed;
     
    -extern int
    -bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen);
    +struct segment_info {
    +	u_int	base;
    +	u_int	limit;
    +};
    +
    +#define BIOSCODE_FLAG	0x01
    +#define BIOSDATA_FLAG	0x02
    +#define BIOSUTIL_FLAG	0x04
    +#define BIOSARGS_FLAG	0x08
    +
    +struct bios_segments {
    +	struct	segment_info code32;		/* 32-bit code (mandatory) */
    +	struct	segment_info code16;		/* 16-bit code */
    +	struct	segment_info data;		/* 16-bit data */
    +	struct	segment_info util;		/* 16-bit utility */
    +	struct	segment_info args;		/* 16-bit args */
    +};
    +
    +struct bios_regs {
    +	u_int	eax;
    +	u_int	ebx;
    +	u_int	ecx;
    +	u_int	edx;
    +	u_int	esi;
    +	u_int	edi;
    +};
    +
    +struct bios_args {
    +	u_int	entry;				/* entry point of routine */
    +	struct	bios_regs r;
    +	struct	bios_segments seg;
    +};
    +
    +/* 
    + * BIOS32 Service Directory entry.  Caller supplies name, bios32_SDlookup
    + * fills in the rest of the details.
    + */
    +struct bios32_SDentry 
    +{
    +    union 
    +    {
    +	u_int8_t	name[4];	/* service identifier */
    +	u_int32_t	id;		/* as a 32-bit value */
    +    } ident;
    +    u_int32_t	base;			/* base of service */
    +    u_int32_t	len;			/* service length */
    +    u_int32_t	entry;			/* entrypoint offset from base */
    +    vm_offset_t	ventry;			/* entrypoint in kernel virtual segment */
    +};
    +
    +/*
    + * Exported lookup results 
    + */
    +extern struct bios32_SDentry	PCIbios;
    +
    +int	bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen);
    +uint32_t bios_sigsearch(uint32_t start, u_char *sig, int siglen, int paralen,
    +	    int sigofs);
    +int	bios16(struct bios_args *, char *, ...);
    +int	bios16_call(struct bios_regs *, char *);
    +int	bios32(struct bios_regs *, u_int, u_short);
    +int	bios32_SDlookup(struct bios32_SDentry *ent);
    +void	set_bios_selectors(struct bios_segments *, int);
     
    +#endif
     
     #endif /* _MACHINE_PC_BIOS_H_ */
    
    Modified: stable/9/sys/x86/bios/smbios.c
    ==============================================================================
    --- stable/9/sys/x86/bios/smbios.c	Thu Feb 28 18:12:56 2013	(r247480)
    +++ stable/9/sys/x86/bios/smbios.c	Thu Feb 28 18:22:41 2013	(r247481)
    @@ -50,30 +50,6 @@ __FBSDID("$FreeBSD$");
      * http://www.dmtf.org/standards/published_documents/DSP0134.pdf
      */
     
    -/*
    - * SMBIOS Entry Point Structure
    - */
    -struct smbios_eps {
    -	u_int8_t	Anchor[4];		/* '_SM_' */
    -	u_int8_t	Checksum;
    -	u_int8_t	Length;
    -
    -	u_int8_t	SMBIOS_Major;
    -	u_int8_t	SMBIOS_Minor;
    -	u_int16_t	Max_Size;
    -	u_int8_t	Revision;
    -	u_int8_t	Formatted_Area[5];
    -
    -	u_int8_t	Intermediate_Anchor[5];	/* '_DMI_' */
    -	u_int8_t	Intermediate_Checksum;
    -
    -	u_int16_t	Structure_Table_Length;
    -	u_int32_t	Structure_Table_Address;
    -	u_int16_t	Structure_Count;
    -
    -	u_int8_t	SMBIOS_BCD_Revision;
    -} __packed;
    -
     struct smbios_softc {
     	device_t		dev;
     	struct resource *	res;
    @@ -82,12 +58,6 @@ struct smbios_softc {
     	struct smbios_eps *	eps;
     };
     
    -#define	SMBIOS_START	0xf0000
    -#define	SMBIOS_STEP	0x10
    -#define	SMBIOS_OFF	0
    -#define	SMBIOS_LEN	4
    -#define	SMBIOS_SIG	"_SM_"
    -
     #define	RES2EPS(res)	((struct smbios_eps *)rman_get_virtual(res))
     #define	ADDR2EPS(addr)  ((struct smbios_eps *)BIOS_PADDRTOVADDR(addr))
     
    @@ -116,13 +86,13 @@ smbios_identify (driver_t *driver, devic
     			      SMBIOS_STEP, SMBIOS_OFF);
     	if (addr != 0) {
     		rid = 0;
    -		length = ADDR2EPS(addr)->Length;
    +		length = ADDR2EPS(addr)->length;
     
     		if (length != 0x1f) {
     			u_int8_t major, minor;
     
    -			major = ADDR2EPS(addr)->SMBIOS_Major;
    -			minor = ADDR2EPS(addr)->SMBIOS_Minor;
    +			major = ADDR2EPS(addr)->major_version;
    +			minor = ADDR2EPS(addr)->minor_version;
     
     			/* SMBIOS v2.1 implementation might use 0x1e. */
     			if (length == 0x1e && major == 2 && minor == 1)
    @@ -189,11 +159,11 @@ smbios_attach (device_t dev)
     	sc->eps = RES2EPS(sc->res);
     
     	device_printf(dev, "Version: %u.%u",
    -		sc->eps->SMBIOS_Major, sc->eps->SMBIOS_Minor);
    -	if (bcd2bin(sc->eps->SMBIOS_BCD_Revision))
    +	    sc->eps->major_version, sc->eps->minor_version);
    +	if (bcd2bin(sc->eps->BCD_revision))
     		printf(", BCD Revision: %u.%u",
    -			bcd2bin(sc->eps->SMBIOS_BCD_Revision >> 4),
    -			bcd2bin(sc->eps->SMBIOS_BCD_Revision & 0x0f));
    +			bcd2bin(sc->eps->BCD_revision >> 4),
    +			bcd2bin(sc->eps->BCD_revision & 0x0f));
     	printf("\n");
     
     	return (0);
    @@ -269,7 +239,7 @@ smbios_cksum (struct smbios_eps *e)
     
     	ptr = (u_int8_t *)e;
     	cksum = 0;
    -	for (i = 0; i < e->Length; i++) {
    +	for (i = 0; i < e->length; i++) {
     		cksum += ptr[i];
     	}
     
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 18:22:51 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 90E41840;
     Thu, 28 Feb 2013 18:22:51 +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 757B9A32;
     Thu, 28 Feb 2013 18:22:51 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SIMpDg098062;
     Thu, 28 Feb 2013 18:22:51 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SIMoBV098058;
     Thu, 28 Feb 2013 18:22:50 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302281822.r1SIMoBV098058@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 18:22:50 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247482 - in stable/8/sys: amd64/include/pc dev/ipmi
     i386/include/pc x86/bios
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 18:22:51 -0000
    
    Author: jhb
    Date: Thu Feb 28 18:22:50 2013
    New Revision: 247482
    URL: http://svnweb.freebsd.org/changeset/base/247482
    
    Log:
      MFC 241027:
      - Re-shuffle the  headers to move all kernel-specific
        bits under #ifdef _KERNEL but leave definitions for various structures
        defined by standards ($PIR table, SMAP entries, etc.) available to
        userland.
      - Consolidate duplicate SMBIOS table structure definitions in ipmi(4)
        and smbios(4) in  and make them available to
        userland.
    
    Modified:
      stable/8/sys/amd64/include/pc/bios.h
      stable/8/sys/dev/ipmi/ipmi_smbios.c
      stable/8/sys/i386/include/pc/bios.h
      stable/8/sys/x86/bios/smbios.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/amd64/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/ipmi/   (props changed)
      stable/8/sys/i386/   (props changed)
      stable/8/sys/x86/   (props changed)
    
    Modified: stable/8/sys/amd64/include/pc/bios.h
    ==============================================================================
    --- stable/8/sys/amd64/include/pc/bios.h	Thu Feb 28 18:22:41 2013	(r247481)
    +++ stable/8/sys/amd64/include/pc/bios.h	Thu Feb 28 18:22:50 2013	(r247482)
    @@ -30,16 +30,9 @@
     #ifndef _MACHINE_PC_BIOS_H_
     #define _MACHINE_PC_BIOS_H_
     
    -extern u_int32_t	bios_sigsearch(u_int32_t start, u_char *sig, int siglen, 
    -					 int paralen, int sigofs);
    -
    -#define BIOS_PADDRTOVADDR(x)	((x) + KERNBASE)
    -#define BIOS_VADDRTOPADDR(x)	((x) - KERNBASE)
    -
     /*
      * Int 15:E820 'SMAP' structure
      */
    -
     #define SMAP_SIG	0x534D4150			/* 'SMAP' */
     
     #define	SMAP_TYPE_MEMORY	1
    @@ -58,22 +51,61 @@ struct bios_smap {
         u_int32_t	type;
     } __packed;
     
    +/*
    + * System Management BIOS
    + */
    +#define	SMBIOS_START	0xf0000
    +#define	SMBIOS_STEP	0x10
    +#define	SMBIOS_OFF	0
    +#define	SMBIOS_LEN	4
    +#define	SMBIOS_SIG	"_SM_"
    +
    +struct smbios_eps {
    +	uint8_t		anchor_string[4];		/* '_SM_' */
    +	uint8_t		checksum;
    +	uint8_t		length;
    +	uint8_t		major_version;
    +	uint8_t		minor_version;
    +	uint16_t	maximum_structure_size;
    +	uint8_t		entry_point_revision;
    +	uint8_t		formatted_area[5];
    +	uint8_t		intermediate_anchor_string[5];	/* '_DMI_' */
    +	uint8_t		intermediate_checksum;
    +	uint16_t	structure_table_length;
    +	uint32_t	structure_table_address;
    +	uint16_t	number_structures;
    +	uint8_t		BCD_revision;
    +};
    +
    +struct smbios_structure_header {
    +	uint8_t		type;
    +	uint8_t		length;
    +	uint16_t	handle;
    +};
    +
    +#ifdef _KERNEL
    +#define BIOS_PADDRTOVADDR(x)	((x) + KERNBASE)
    +#define BIOS_VADDRTOPADDR(x)	((x) - KERNBASE)
    +
     struct bios_oem_signature {
     	char * anchor;		/* search anchor string in BIOS memory */
     	size_t offset;		/* offset from anchor (may be negative) */
     	size_t totlen;		/* total length of BIOS string to copy */
     } __packed;
    +
     struct bios_oem_range {
     	u_int from;		/* shouldn't be below 0xe0000 */
     	u_int to;		/* shouldn't be above 0xfffff */
     } __packed;
    +
     struct bios_oem {
     	struct bios_oem_range range;
     	struct bios_oem_signature signature[];
     } __packed;
     
    -extern int
    -bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen);
    -
    +int	bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen);
    +uint32_t bios_sigsearch(uint32_t start, u_char *sig, int siglen, int paralen,
    +	    int sigofs);
    +#endif
     
     #endif /* _MACHINE_PC_BIOS_H_ */
    
    Modified: stable/8/sys/dev/ipmi/ipmi_smbios.c
    ==============================================================================
    --- stable/8/sys/dev/ipmi/ipmi_smbios.c	Thu Feb 28 18:22:41 2013	(r247481)
    +++ stable/8/sys/dev/ipmi/ipmi_smbios.c	Thu Feb 28 18:22:50 2013	(r247482)
    @@ -52,29 +52,6 @@ __FBSDID("$FreeBSD$");
     #define	pmap_unmapbios		pmap_unmapdev
     #endif
     
    -struct smbios_table {
    -	uint8_t		anchor_string[4];
    -	uint8_t		checksum;
    -	uint8_t		length;
    -	uint8_t		major_version;
    -	uint8_t		minor_version;
    -	uint16_t	maximum_structure_size;
    -	uint8_t		entry_point_revision;
    -	uint8_t		formatted_area[5];
    -	uint8_t		DMI_anchor_string[5];
    -	uint8_t		intermediate_checksum;
    -	uint16_t	structure_table_length;
    -	uint32_t	structure_table_address;
    -	uint16_t	number_structures;
    -	uint8_t		BCD_revision;
    -};
    -
    -struct structure_header {
    -	uint8_t		type;
    -	uint8_t		length;
    -	uint16_t	handle;
    -};
    -
     struct ipmi_entry {
     	uint8_t		type;
     	uint8_t		length;
    @@ -102,13 +79,7 @@ struct ipmi_entry {
     #define	SPACING_32		0x1
     #define	SPACING_16		0x2
     
    -#define	SMBIOS_START		0xf0000
    -#define	SMBIOS_STEP		0x10
    -#define	SMBIOS_OFF		0
    -#define	SMBIOS_LEN		4
    -#define	SMBIOS_SIG		"_SM_"
    -
    -typedef void (*smbios_callback_t)(struct structure_header *, void *);
    +typedef void (*smbios_callback_t)(struct smbios_structure_header *, void *);
     
     static struct ipmi_get_info ipmi_info;
     static int ipmi_probed;
    @@ -116,13 +87,13 @@ static struct mtx ipmi_info_mtx;
     MTX_SYSINIT(ipmi_info, &ipmi_info_mtx, "ipmi info", MTX_DEF);
     
     static void	ipmi_smbios_probe(struct ipmi_get_info *);
    -static int	smbios_cksum(struct smbios_table *);
    +static int	smbios_cksum(struct smbios_eps *);
     static void	smbios_walk_table(uint8_t *, int, smbios_callback_t,
     		    void *);
    -static void	smbios_ipmi_info(struct structure_header *, void *);
    +static void	smbios_ipmi_info(struct smbios_structure_header *, void *);
     
     static void
    -smbios_ipmi_info(struct structure_header *h, void *arg)
    +smbios_ipmi_info(struct smbios_structure_header *h, void *arg)
     {
     	struct ipmi_get_info *info;
     	struct ipmi_entry *s;
    @@ -178,10 +149,10 @@ smbios_ipmi_info(struct structure_header
     static void
     smbios_walk_table(uint8_t *p, int entries, smbios_callback_t cb, void *arg)
     {
    -	struct structure_header *s;
    +	struct smbios_structure_header *s;
     
     	while (entries--) {
    -		s = (struct structure_header *)p;
    +		s = (struct smbios_structure_header *)p;
     		cb(s, arg);
     
     		/*
    @@ -208,7 +179,7 @@ smbios_walk_table(uint8_t *p, int entrie
     static void
     ipmi_smbios_probe(struct ipmi_get_info *info)
     {
    -	struct smbios_table *header;
    +	struct smbios_eps *header;
     	void *table;
     	u_int32_t addr;
     
    @@ -225,9 +196,9 @@ ipmi_smbios_probe(struct ipmi_get_info *
     	 * length and then map it a second time with the actual length so
     	 * we can verify the checksum.
     	 */
    -	header = pmap_mapbios(addr, sizeof(struct smbios_table));
    +	header = pmap_mapbios(addr, sizeof(struct smbios_eps));
     	table = pmap_mapbios(addr, header->length);
    -	pmap_unmapbios((vm_offset_t)header, sizeof(struct smbios_table));
    +	pmap_unmapbios((vm_offset_t)header, sizeof(struct smbios_eps));
     	header = table;
     	if (smbios_cksum(header) != 0) {
     		pmap_unmapbios((vm_offset_t)header, header->length);
    @@ -282,7 +253,7 @@ ipmi_smbios_identify(struct ipmi_get_inf
     }
     
     static int
    -smbios_cksum(struct smbios_table *e)
    +smbios_cksum(struct smbios_eps *e)
     {
     	u_int8_t *ptr;
     	u_int8_t cksum;
    
    Modified: stable/8/sys/i386/include/pc/bios.h
    ==============================================================================
    --- stable/8/sys/i386/include/pc/bios.h	Thu Feb 28 18:22:41 2013	(r247481)
    +++ stable/8/sys/i386/include/pc/bios.h	Thu Feb 28 18:22:50 2013	(r247482)
    @@ -44,31 +44,6 @@ struct bios32_SDheader 
     };
     
     /* 
    - * BIOS32 Service Directory entry.  Caller supplies name, bios32_SDlookup
    - * fills in the rest of the details.
    - */
    -struct bios32_SDentry 
    -{
    -    union 
    -    {
    -	u_int8_t	name[4];	/* service identifier */
    -	u_int32_t	id;		/* as a 32-bit value */
    -    } ident;
    -    u_int32_t	base;			/* base of service */
    -    u_int32_t	len;			/* service length */
    -    u_int32_t	entry;			/* entrypoint offset from base */
    -    vm_offset_t	ventry;			/* entrypoint in kernel virtual segment */
    -};
    -
    -extern int		bios32_SDlookup(struct bios32_SDentry *ent);
    -extern u_int32_t	bios_sigsearch(u_int32_t start, u_char *sig, int siglen, 
    -					 int paralen, int sigofs);
    -
    -#define BIOS_PADDRTOVADDR(x)	((x) + KERNBASE)
    -#define BIOS_VADDRTOPADDR(x)	((x) - KERNBASE)
    -
    -
    -/* 
      * PnP BIOS presence structure
      */
     struct PnPBIOS_table 
    @@ -88,52 +63,13 @@ struct PnPBIOS_table 
         u_int32_t	pmdataseg;		/* protected-mode data segment */
     } __packed;
     
    -
    -/* 
    - * Exported lookup results 
    - */
    -extern struct bios32_SDentry	PCIbios;
    -
    -struct segment_info {
    -	u_int	base;
    -	u_int	limit;
    -};
    -
    -#define BIOSCODE_FLAG	0x01
    -#define BIOSDATA_FLAG	0x02
    -#define BIOSUTIL_FLAG	0x04
    -#define BIOSARGS_FLAG	0x08
    -
    -struct bios_segments {
    -	struct	segment_info code32;		/* 32-bit code (mandatory) */
    -	struct	segment_info code16;		/* 16-bit code */
    -	struct	segment_info data;		/* 16-bit data */
    -	struct	segment_info util;		/* 16-bit utility */
    -	struct	segment_info args;		/* 16-bit args */
    -};
    -
    -struct bios_regs {
    -	u_int	eax;
    -	u_int	ebx;
    -	u_int	ecx;
    -	u_int	edx;
    -	u_int	esi;
    -	u_int	edi;
    -};
    -
    -struct bios_args {
    -	u_int	entry;				/* entry point of routine */
    -	struct	bios_regs r;
    -	struct	bios_segments seg;
    -};
    -
     /*
      * PnP BIOS return codes
      */
     #define PNP_SUCCESS				0x00
     #define PNP_NOT_SET_STATICALLY			0x7f
     #define PNP_UNKNOWN_FUNCTION			0x81
    -#define PNP_FUNTION_NOT_SUPPORTED		0x82
    +#define PNP_FUNCTION_NOT_SUPPORTED		0x82
     #define PNP_INVALID_HANDLE			0x83
     #define PNP_BAD_PARAMETER			0x84
     #define PNP_SET_FAILED				0x85
    @@ -219,11 +155,6 @@ struct bios_args {
     #define PCIBIOS_GET_IRQ_ROUTING		0xb10e
     #define PCIBIOS_ROUTE_INTERRUPT		0xb10f
     
    -extern int bios16(struct bios_args *, char *, ...);
    -extern int bios16_call(struct bios_regs *, char *);
    -extern int bios32(struct bios_regs *, u_int, u_short);
    -extern void set_bios_selectors(struct bios_segments *, int);
    -
     /*
      * PCI interrupt routing table.
      *
    @@ -272,7 +203,6 @@ struct PIR_table 
     /*
      * Int 15:E820 'SMAP' structure
      */
    -
     #define SMAP_SIG	0x534D4150			/* 'SMAP' */
     
     #define	SMAP_TYPE_MEMORY	1
    @@ -291,22 +221,122 @@ struct bios_smap {
         u_int32_t	type;
     } __packed;
     
    +/*
    + * System Management BIOS
    + */
    +#define	SMBIOS_START	0xf0000
    +#define	SMBIOS_STEP	0x10
    +#define	SMBIOS_OFF	0
    +#define	SMBIOS_LEN	4
    +#define	SMBIOS_SIG	"_SM_"
    +
    +struct smbios_eps {
    +	uint8_t		anchor_string[4];		/* '_SM_' */
    +	uint8_t		checksum;
    +	uint8_t		length;
    +	uint8_t		major_version;
    +	uint8_t		minor_version;
    +	uint16_t	maximum_structure_size;
    +	uint8_t		entry_point_revision;
    +	uint8_t		formatted_area[5];
    +	uint8_t		intermediate_anchor_string[5];	/* '_DMI_' */
    +	uint8_t		intermediate_checksum;
    +	uint16_t	structure_table_length;
    +	uint32_t	structure_table_address;
    +	uint16_t	number_structures;
    +	uint8_t		BCD_revision;
    +};
    +
    +struct smbios_structure_header {
    +	uint8_t		type;
    +	uint8_t		length;
    +	uint16_t	handle;
    +};
    +
    +#ifdef _KERNEL
    +#define BIOS_PADDRTOVADDR(x)	((x) + KERNBASE)
    +#define BIOS_VADDRTOPADDR(x)	((x) - KERNBASE)
    +
     struct bios_oem_signature {
     	char * anchor;		/* search anchor string in BIOS memory */
     	size_t offset;		/* offset from anchor (may be negative) */
     	size_t totlen;		/* total length of BIOS string to copy */
     } __packed;
    +
     struct bios_oem_range {
     	u_int from;		/* shouldn't be below 0xe0000 */
     	u_int to;		/* shouldn't be above 0xfffff */
     } __packed;
    +
     struct bios_oem {
     	struct bios_oem_range range;
     	struct bios_oem_signature signature[];
     } __packed;
     
    -extern int
    -bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen);
    +struct segment_info {
    +	u_int	base;
    +	u_int	limit;
    +};
    +
    +#define BIOSCODE_FLAG	0x01
    +#define BIOSDATA_FLAG	0x02
    +#define BIOSUTIL_FLAG	0x04
    +#define BIOSARGS_FLAG	0x08
    +
    +struct bios_segments {
    +	struct	segment_info code32;		/* 32-bit code (mandatory) */
    +	struct	segment_info code16;		/* 16-bit code */
    +	struct	segment_info data;		/* 16-bit data */
    +	struct	segment_info util;		/* 16-bit utility */
    +	struct	segment_info args;		/* 16-bit args */
    +};
    +
    +struct bios_regs {
    +	u_int	eax;
    +	u_int	ebx;
    +	u_int	ecx;
    +	u_int	edx;
    +	u_int	esi;
    +	u_int	edi;
    +};
    +
    +struct bios_args {
    +	u_int	entry;				/* entry point of routine */
    +	struct	bios_regs r;
    +	struct	bios_segments seg;
    +};
    +
    +/* 
    + * BIOS32 Service Directory entry.  Caller supplies name, bios32_SDlookup
    + * fills in the rest of the details.
    + */
    +struct bios32_SDentry 
    +{
    +    union 
    +    {
    +	u_int8_t	name[4];	/* service identifier */
    +	u_int32_t	id;		/* as a 32-bit value */
    +    } ident;
    +    u_int32_t	base;			/* base of service */
    +    u_int32_t	len;			/* service length */
    +    u_int32_t	entry;			/* entrypoint offset from base */
    +    vm_offset_t	ventry;			/* entrypoint in kernel virtual segment */
    +};
    +
    +/*
    + * Exported lookup results 
    + */
    +extern struct bios32_SDentry	PCIbios;
    +
    +int	bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen);
    +uint32_t bios_sigsearch(uint32_t start, u_char *sig, int siglen, int paralen,
    +	    int sigofs);
    +int	bios16(struct bios_args *, char *, ...);
    +int	bios16_call(struct bios_regs *, char *);
    +int	bios32(struct bios_regs *, u_int, u_short);
    +int	bios32_SDlookup(struct bios32_SDentry *ent);
    +void	set_bios_selectors(struct bios_segments *, int);
     
    +#endif
     
     #endif /* _MACHINE_PC_BIOS_H_ */
    
    Modified: stable/8/sys/x86/bios/smbios.c
    ==============================================================================
    --- stable/8/sys/x86/bios/smbios.c	Thu Feb 28 18:22:41 2013	(r247481)
    +++ stable/8/sys/x86/bios/smbios.c	Thu Feb 28 18:22:50 2013	(r247482)
    @@ -50,30 +50,6 @@ __FBSDID("$FreeBSD$");
      * http://www.dmtf.org/standards/published_documents/DSP0134.pdf
      */
     
    -/*
    - * SMBIOS Entry Point Structure
    - */
    -struct smbios_eps {
    -	u_int8_t	Anchor[4];		/* '_SM_' */
    -	u_int8_t	Checksum;
    -	u_int8_t	Length;
    -
    -	u_int8_t	SMBIOS_Major;
    -	u_int8_t	SMBIOS_Minor;
    -	u_int16_t	Max_Size;
    -	u_int8_t	Revision;
    -	u_int8_t	Formatted_Area[5];
    -
    -	u_int8_t	Intermediate_Anchor[5];	/* '_DMI_' */
    -	u_int8_t	Intermediate_Checksum;
    -
    -	u_int16_t	Structure_Table_Length;
    -	u_int32_t	Structure_Table_Address;
    -	u_int16_t	Structure_Count;
    -
    -	u_int8_t	SMBIOS_BCD_Revision;
    -} __packed;
    -
     struct smbios_softc {
     	device_t		dev;
     	struct resource *	res;
    @@ -82,12 +58,6 @@ struct smbios_softc {
     	struct smbios_eps *	eps;
     };
     
    -#define	SMBIOS_START	0xf0000
    -#define	SMBIOS_STEP	0x10
    -#define	SMBIOS_OFF	0
    -#define	SMBIOS_LEN	4
    -#define	SMBIOS_SIG	"_SM_"
    -
     #define	RES2EPS(res)	((struct smbios_eps *)rman_get_virtual(res))
     #define	ADDR2EPS(addr)  ((struct smbios_eps *)BIOS_PADDRTOVADDR(addr))
     
    @@ -116,13 +86,13 @@ smbios_identify (driver_t *driver, devic
     			      SMBIOS_STEP, SMBIOS_OFF);
     	if (addr != 0) {
     		rid = 0;
    -		length = ADDR2EPS(addr)->Length;
    +		length = ADDR2EPS(addr)->length;
     
     		if (length != 0x1f) {
     			u_int8_t major, minor;
     
    -			major = ADDR2EPS(addr)->SMBIOS_Major;
    -			minor = ADDR2EPS(addr)->SMBIOS_Minor;
    +			major = ADDR2EPS(addr)->major_version;
    +			minor = ADDR2EPS(addr)->minor_version;
     
     			/* SMBIOS v2.1 implementation might use 0x1e. */
     			if (length == 0x1e && major == 2 && minor == 1)
    @@ -189,11 +159,11 @@ smbios_attach (device_t dev)
     	sc->eps = RES2EPS(sc->res);
     
     	device_printf(dev, "Version: %u.%u",
    -		sc->eps->SMBIOS_Major, sc->eps->SMBIOS_Minor);
    -	if (bcd2bin(sc->eps->SMBIOS_BCD_Revision))
    +	    sc->eps->major_version, sc->eps->minor_version);
    +	if (bcd2bin(sc->eps->BCD_revision))
     		printf(", BCD Revision: %u.%u",
    -			bcd2bin(sc->eps->SMBIOS_BCD_Revision >> 4),
    -			bcd2bin(sc->eps->SMBIOS_BCD_Revision & 0x0f));
    +			bcd2bin(sc->eps->BCD_revision >> 4),
    +			bcd2bin(sc->eps->BCD_revision & 0x0f));
     	printf("\n");
     
     	return (0);
    @@ -269,7 +239,7 @@ smbios_cksum (struct smbios_eps *e)
     
     	ptr = (u_int8_t *)e;
     	cksum = 0;
    -	for (i = 0; i < e->Length; i++) {
    +	for (i = 0; i < e->length; i++) {
     		cksum += ptr[i];
     	}
     
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 18:24:08 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 4F98AA9E;
     Thu, 28 Feb 2013 18:24:08 +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 4066DA51;
     Thu, 28 Feb 2013 18:24:08 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SIO8Jo098294;
     Thu, 28 Feb 2013 18:24:08 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SIO8Cu098293;
     Thu, 28 Feb 2013 18:24:08 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302281824.r1SIO8Cu098293@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 18: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: r247483 - stable/9/usr.bin/top
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 18:24:08 -0000
    
    Author: jhb
    Date: Thu Feb 28 18:24:07 2013
    New Revision: 247483
    URL: http://svnweb.freebsd.org/changeset/base/247483
    
    Log:
      MFC 241730: Correct the order of the MFU and MRU labels.
    
    Modified:
      stable/9/usr.bin/top/machine.c
    Directory Properties:
      stable/9/usr.bin/top/   (props changed)
    
    Modified: stable/9/usr.bin/top/machine.c
    ==============================================================================
    --- stable/9/usr.bin/top/machine.c	Thu Feb 28 18:22:50 2013	(r247482)
    +++ stable/9/usr.bin/top/machine.c	Thu Feb 28 18:24:07 2013	(r247483)
    @@ -178,7 +178,7 @@ char *memorynames[] = {
     
     int arc_stats[7];
     char *arcnames[] = {
    -	"K Total, ", "K MRU, ", "K MFU, ", "K Anon, ", "K Header, ", "K Other",
    +	"K Total, ", "K MFU, ", "K MRU, ", "K Anon, ", "K Header, ", "K Other",
     	NULL
     };
     
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 18:24:16 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id CB582BA7;
     Thu, 28 Feb 2013 18:24:15 +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 83215A54;
     Thu, 28 Feb 2013 18:24:15 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SIOFAG098346;
     Thu, 28 Feb 2013 18:24:15 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SIOFJL098345;
     Thu, 28 Feb 2013 18:24:15 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302281824.r1SIOFJL098345@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 18:24:15 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247484 - stable/8/usr.bin/top
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 18:24:16 -0000
    
    Author: jhb
    Date: Thu Feb 28 18:24:14 2013
    New Revision: 247484
    URL: http://svnweb.freebsd.org/changeset/base/247484
    
    Log:
      MFC 241730: Correct the order of the MFU and MRU labels.
    
    Modified:
      stable/8/usr.bin/top/machine.c
    Directory Properties:
      stable/8/usr.bin/top/   (props changed)
    
    Modified: stable/8/usr.bin/top/machine.c
    ==============================================================================
    --- stable/8/usr.bin/top/machine.c	Thu Feb 28 18:24:07 2013	(r247483)
    +++ stable/8/usr.bin/top/machine.c	Thu Feb 28 18:24:14 2013	(r247484)
    @@ -178,7 +178,7 @@ char *memorynames[] = {
     
     int arc_stats[7];
     char *arcnames[] = {
    -	"K Total, ", "K MRU, ", "K MFU, ", "K Anon, ", "K Header, ", "K Other",
    +	"K Total, ", "K MFU, ", "K MRU, ", "K Anon, ", "K Header, ", "K Other",
     	NULL
     };
     
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 18:43:50 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id DC1ADEB;
     Thu, 28 Feb 2013 18:43:50 +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 C6A08B31;
     Thu, 28 Feb 2013 18:43:50 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SIhovv004373;
     Thu, 28 Feb 2013 18:43:50 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SIhoaq004371;
     Thu, 28 Feb 2013 18:43:50 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201302281843.r1SIhoaq004371@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Thu, 28 Feb 2013 18:43:50 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
    Subject: svn commit: r247485 - in stable/9: crypto/openssh
     crypto/openssh/openbsd-compat secure/lib/libssh secure/usr.sbin/sshd
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 18:43:50 -0000
    
    Author: des
    Date: Thu Feb 28 18:43:50 2013
    New Revision: 247485
    URL: http://svnweb.freebsd.org/changeset/base/247485
    
    Log:
      Pull in OpenSSH 6.1 from head.
    
    Added:
      stable/9/crypto/openssh/sandbox-darwin.c
         - copied unchanged from r226046, head/crypto/openssh/sandbox-darwin.c
      stable/9/crypto/openssh/sandbox-null.c
         - copied unchanged from r226046, head/crypto/openssh/sandbox-null.c
      stable/9/crypto/openssh/sandbox-rlimit.c
         - copied, changed from r226046, head/crypto/openssh/sandbox-rlimit.c
      stable/9/crypto/openssh/sandbox-systrace.c
         - copied, changed from r226046, head/crypto/openssh/sandbox-systrace.c
      stable/9/crypto/openssh/ssh-sandbox.h
         - copied unchanged from r226046, head/crypto/openssh/ssh-sandbox.h
    Deleted:
      stable/9/crypto/openssh/WARNING.RNG
      stable/9/crypto/openssh/ssh-rand-helper.8
      stable/9/crypto/openssh/ssh-rand-helper.c
      stable/9/crypto/openssh/version.c
    Modified:
      stable/9/crypto/openssh/ChangeLog
      stable/9/crypto/openssh/INSTALL
      stable/9/crypto/openssh/LICENCE
      stable/9/crypto/openssh/PROTOCOL.certkeys
      stable/9/crypto/openssh/PROTOCOL.mux
      stable/9/crypto/openssh/README
      stable/9/crypto/openssh/aclocal.m4
      stable/9/crypto/openssh/addrmatch.c
      stable/9/crypto/openssh/audit-bsm.c
      stable/9/crypto/openssh/audit-linux.c   (contents, props changed)
      stable/9/crypto/openssh/auth-krb5.c
      stable/9/crypto/openssh/auth-options.c
      stable/9/crypto/openssh/auth-passwd.c
      stable/9/crypto/openssh/auth-rsa.c
      stable/9/crypto/openssh/auth-skey.c
      stable/9/crypto/openssh/auth.c
      stable/9/crypto/openssh/auth.h
      stable/9/crypto/openssh/auth2-gss.c
      stable/9/crypto/openssh/auth2-pubkey.c
      stable/9/crypto/openssh/auth2.c
      stable/9/crypto/openssh/authfd.c
      stable/9/crypto/openssh/authfile.c
      stable/9/crypto/openssh/authfile.h
      stable/9/crypto/openssh/channels.c
      stable/9/crypto/openssh/channels.h
      stable/9/crypto/openssh/clientloop.c
      stable/9/crypto/openssh/clientloop.h
      stable/9/crypto/openssh/compat.c
      stable/9/crypto/openssh/compat.h
      stable/9/crypto/openssh/config.guess
      stable/9/crypto/openssh/config.h
      stable/9/crypto/openssh/config.h.in
      stable/9/crypto/openssh/defines.h
      stable/9/crypto/openssh/dh.c
      stable/9/crypto/openssh/dns.c
      stable/9/crypto/openssh/dns.h
      stable/9/crypto/openssh/entropy.c
      stable/9/crypto/openssh/entropy.h
      stable/9/crypto/openssh/gss-serv.c
      stable/9/crypto/openssh/jpake.c
      stable/9/crypto/openssh/kex.c
      stable/9/crypto/openssh/key.c
      stable/9/crypto/openssh/key.h
      stable/9/crypto/openssh/log.c
      stable/9/crypto/openssh/log.h
      stable/9/crypto/openssh/loginrec.c   (contents, props changed)
      stable/9/crypto/openssh/mac.c
      stable/9/crypto/openssh/misc.c
      stable/9/crypto/openssh/misc.h
      stable/9/crypto/openssh/moduli
      stable/9/crypto/openssh/moduli.5
      stable/9/crypto/openssh/moduli.c
      stable/9/crypto/openssh/monitor.c
      stable/9/crypto/openssh/monitor.h
      stable/9/crypto/openssh/monitor_wrap.c
      stable/9/crypto/openssh/monitor_wrap.h
      stable/9/crypto/openssh/mux.c
      stable/9/crypto/openssh/myproposal.h
      stable/9/crypto/openssh/openbsd-compat/bsd-cygwin_util.c
      stable/9/crypto/openssh/openbsd-compat/bsd-cygwin_util.h
      stable/9/crypto/openssh/openbsd-compat/bsd-misc.h
      stable/9/crypto/openssh/openbsd-compat/getcwd.c
      stable/9/crypto/openssh/openbsd-compat/getgrouplist.c
      stable/9/crypto/openssh/openbsd-compat/getrrsetbyname.c
      stable/9/crypto/openssh/openbsd-compat/glob.c
      stable/9/crypto/openssh/openbsd-compat/inet_ntop.c
      stable/9/crypto/openssh/openbsd-compat/mktemp.c
      stable/9/crypto/openssh/openbsd-compat/openbsd-compat.h
      stable/9/crypto/openssh/openbsd-compat/openssl-compat.c
      stable/9/crypto/openssh/openbsd-compat/openssl-compat.h
      stable/9/crypto/openssh/openbsd-compat/port-linux.c
      stable/9/crypto/openssh/openbsd-compat/port-linux.h
      stable/9/crypto/openssh/openbsd-compat/setenv.c
      stable/9/crypto/openssh/openbsd-compat/sha2.c   (contents, props changed)
      stable/9/crypto/openssh/openbsd-compat/sha2.h   (contents, props changed)
      stable/9/crypto/openssh/openbsd-compat/strlcpy.c
      stable/9/crypto/openssh/packet.c
      stable/9/crypto/openssh/packet.h
      stable/9/crypto/openssh/pathnames.h
      stable/9/crypto/openssh/readconf.c
      stable/9/crypto/openssh/readconf.h
      stable/9/crypto/openssh/roaming.h
      stable/9/crypto/openssh/roaming_client.c
      stable/9/crypto/openssh/roaming_common.c
      stable/9/crypto/openssh/scp.1
      stable/9/crypto/openssh/scp.c
      stable/9/crypto/openssh/servconf.c
      stable/9/crypto/openssh/servconf.h
      stable/9/crypto/openssh/serverloop.c
      stable/9/crypto/openssh/session.c
      stable/9/crypto/openssh/sftp-client.c
      stable/9/crypto/openssh/sftp-glob.c
      stable/9/crypto/openssh/sftp-server.c
      stable/9/crypto/openssh/sftp.1
      stable/9/crypto/openssh/sftp.c
      stable/9/crypto/openssh/ssh-add.1
      stable/9/crypto/openssh/ssh-add.c
      stable/9/crypto/openssh/ssh-agent.1
      stable/9/crypto/openssh/ssh-agent.c
      stable/9/crypto/openssh/ssh-ecdsa.c   (contents, props changed)
      stable/9/crypto/openssh/ssh-keygen.1
      stable/9/crypto/openssh/ssh-keygen.c
      stable/9/crypto/openssh/ssh-keyscan.c
      stable/9/crypto/openssh/ssh-keysign.c
      stable/9/crypto/openssh/ssh-pkcs11-client.c
      stable/9/crypto/openssh/ssh-pkcs11-helper.c
      stable/9/crypto/openssh/ssh-pkcs11.c
      stable/9/crypto/openssh/ssh.1
      stable/9/crypto/openssh/ssh.c
      stable/9/crypto/openssh/ssh_config
      stable/9/crypto/openssh/ssh_config.5
      stable/9/crypto/openssh/ssh_namespace.h
      stable/9/crypto/openssh/sshconnect.c
      stable/9/crypto/openssh/sshconnect2.c
      stable/9/crypto/openssh/sshd.8
      stable/9/crypto/openssh/sshd.c
      stable/9/crypto/openssh/sshd_config
      stable/9/crypto/openssh/sshd_config.5
      stable/9/crypto/openssh/umac.c
      stable/9/crypto/openssh/version.h
      stable/9/secure/lib/libssh/Makefile
      stable/9/secure/usr.sbin/sshd/Makefile
    Directory Properties:
      stable/9/crypto/openssh/   (props changed)
      stable/9/crypto/openssh/bufec.c   (props changed)
      stable/9/crypto/openssh/kexecdh.c   (props changed)
      stable/9/crypto/openssh/kexecdhc.c   (props changed)
      stable/9/crypto/openssh/kexecdhs.c   (props changed)
      stable/9/crypto/openssh/openbsd-compat/charclass.h   (props changed)
      stable/9/crypto/openssh/openbsd-compat/strptime.c   (props changed)
      stable/9/crypto/openssh/openbsd-compat/timingsafe_bcmp.c   (props changed)
      stable/9/secure/lib/libssh/   (props changed)
      stable/9/secure/usr.sbin/sshd/   (props changed)
    
    Modified: stable/9/crypto/openssh/ChangeLog
    ==============================================================================
    --- stable/9/crypto/openssh/ChangeLog	Thu Feb 28 18:24:14 2013	(r247484)
    +++ stable/9/crypto/openssh/ChangeLog	Thu Feb 28 18:43:50 2013	(r247485)
    @@ -1,13 +1,1089 @@
    -20110403
    +20120828
    + - (djm) Release openssh-6.1
    +
    +20120828
    + - (dtucker) [openbsd-compat/bsd-cygwin_util.h] define WIN32_LEAN_AND_MEAN
    +   for compatibility with future mingw-w64 headers.  Patch from vinschen at
    +   redhat com.
    +
    +20120822
      - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
    -   [contrib/suse/openssh.spec] Prepare for 5.8p2 release.
    - - (djm) [version.h] crank version
    - - Release 5.8p2
    -
    -20110329
    - - (djm) [entropy.c] closefrom() before running ssh-rand-helper; leftover fds
    -   noticed by tmraz AT redhat.com
    - 
    +   [contrib/suse/openssh.spec] Update version numbers
    +
    +20120731
    + - (djm) OpenBSD CVS Sync
    +   - jmc@cvs.openbsd.org 2012/07/06 06:38:03
    +     [ssh-keygen.c]
    +     missing full stop in usage();
    +   - djm@cvs.openbsd.org 2012/07/10 02:19:15
    +     [servconf.c servconf.h sshd.c sshd_config]
    +     Turn on systrace sandboxing of pre-auth sshd by default for new installs
    +     by shipping a config that overrides the current UsePrivilegeSeparation=yes
    +     default. Make it easier to flip the default in the future by adding too.
    +     prodded markus@ feedback dtucker@ "get it in" deraadt@
    +   - dtucker@cvs.openbsd.org 2012/07/13 01:35:21
    +     [servconf.c]
    +     handle long comments in config files better.  bz#2025, ok markus
    +   - markus@cvs.openbsd.org 2012/07/22 18:19:21
    +     [version.h]
    +     openssh 6.1
    +
    +20120720
    + - (dtucker) Import regened moduli file.
    +
    +20120706
    + - (djm) [sandbox-seccomp-filter.c] fallback to rlimit if seccomp filter is
    +   not available. Allows use of sshd compiled on host with a filter-capable
    +   kernel on hosts that lack the support. bz#2011 ok dtucker@
    + - (djm) [configure.ac] Recursively expand $(bindir) to ensure it has no
    +   unexpanded $(prefix) embedded. bz#2007 patch from nix-corp AT
    +   esperi.org.uk; ok dtucker@
    +- (djm) OpenBSD CVS Sync
    +   - dtucker@cvs.openbsd.org 2012/07/06 00:41:59
    +     [moduli.c ssh-keygen.1 ssh-keygen.c]
    +     Add options to specify starting line number and number of lines to process
    +     when screening moduli candidates.  This allows processing of different
    +     parts of a candidate moduli file in parallel.  man page help jmc@, ok djm@
    +   - djm@cvs.openbsd.org 2012/07/06 01:37:21
    +     [mux.c]
    +     fix memory leak of passed-in environment variables and connection
    +     context when new session message is malformed; bz#2003 from Bert.Wesarg
    +     AT googlemail.com
    +   - djm@cvs.openbsd.org 2012/07/06 01:47:38
    +     [ssh.c]
    +     move setting of tty_flag to after config parsing so RequestTTY options
    +     are correctly picked up. bz#1995 patch from przemoc AT gmail.com;
    +     ok dtucker@
    +
    +20120704
    + - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] Add setlinebuf for
    +   platforms that don't have it.  "looks good" tim@
    +
    +20120703
    + - (dtucker) [configure.ac] Detect platforms that can't use select(2) with
    +   setrlimit(RLIMIT_NOFILE, rl_zero) and disable the rlimit sandbox on those.
    + - (dtucker) [configure.ac sandbox-rlimit.c] Test whether or not
    +   setrlimit(RLIMIT_FSIZE, rl_zero) and skip it if it's not supported.  Its
    +   benefit is minor, so it's not worth disabling the sandbox if it doesn't
    +   work.
    +
    +20120702
    +- (dtucker) OpenBSD CVS Sync
    +   - naddy@cvs.openbsd.org 2012/06/29 13:57:25
    +     [ssh_config.5 sshd_config.5]
    +     match the documented MAC order of preference to the actual one;
    +     ok dtucker@
    +   - markus@cvs.openbsd.org 2012/06/30 14:35:09
    +     [sandbox-systrace.c sshd.c]
    +     fix a during the load of the sandbox policies (child can still make
    +     the read-syscall and wait forever for systrace-answers) by replacing
    +     the read/write synchronisation with SIGSTOP/SIGCONT;
    +     report and help hshoexer@; ok djm@, dtucker@
    +   - dtucker@cvs.openbsd.org 2012/07/02 08:50:03
    +     [ssh.c]
    +     set interactive ToS for forwarded X11 sessions.  ok djm@
    +   - dtucker@cvs.openbsd.org 2012/07/02 12:13:26
    +     [ssh-pkcs11-helper.c sftp-client.c]
    +     fix a couple of "assigned but not used" warnings.  ok markus@
    +   - dtucker@cvs.openbsd.org 2012/07/02 14:37:06
    +     [regress/connect-privsep.sh]
    +     remove exit from end of test since it prevents reporting failure
    + - (dtucker) [regress/reexec.sh regress/sftp-cmds.sh regress/test-exec.sh]
    +   Move cygwin detection to test-exec and use to skip reexec test on cygwin.
    + - (dtucker) [regress/test-exec.sh] Correct uname for cygwin/w2k.
    +
    +20120629
    + - OpenBSD CVS Sync
    +   - dtucker@cvs.openbsd.org 2012/06/21 00:16:07
    +     [addrmatch.c]
    +     fix strlcpy truncation check.  from carsten at debian org, ok markus
    +   - dtucker@cvs.openbsd.org 2012/06/22 12:30:26
    +     [monitor.c sshconnect2.c]
    +     remove dead code following 'for (;;)' loops.
    +     From Steve.McClellan at radisys com, ok markus@
    +   - dtucker@cvs.openbsd.org 2012/06/22 14:36:33
    +     [sftp.c]
    +     Remove unused variable leftover from tab-completion changes.
    +     From Steve.McClellan at radisys com, ok markus@
    +   - dtucker@cvs.openbsd.org 2012/06/26 11:02:30
    +     [sandbox-systrace.c]
    +     Add mquery to the list of allowed syscalls for "UsePrivilegeSeparation
    +     sandbox" since malloc now uses it.  From johnw.mail at gmail com.
    +   - dtucker@cvs.openbsd.org 2012/06/28 05:07:45
    +     [mac.c myproposal.h ssh_config.5 sshd_config.5]
    +     Remove hmac-sha2-256-96 and hmac-sha2-512-96 MACs since they were removed
    +     from draft6 of the spec and will not be in the RFC when published.  Patch
    +     from mdb at juniper net via bz#2023, ok markus.
    +   - naddy@cvs.openbsd.org 2012/06/29 13:57:25
    +     [ssh_config.5 sshd_config.5]
    +     match the documented MAC order of preference to the actual one; ok dtucker@
    +   - dtucker@cvs.openbsd.org 2012/05/13 01:42:32
    +     [regress/addrmatch.sh]
    +     Add "Match LocalAddress" and "Match LocalPort" to sshd and adjust tests
    +     to match.  Feedback and ok djm@ markus@.
    +   - djm@cvs.openbsd.org 2012/06/01 00:47:35
    +     [regress/multiplex.sh regress/forwarding.sh]
    +     append to rather than truncate test log; bz#2013 from openssh AT
    +     roumenpetrov.info
    +   - djm@cvs.openbsd.org 2012/06/01 00:52:52
    +     [regress/sftp-cmds.sh]
    +     don't delete .* on cleanup due to unintended env expansion; pointed out in
    +     bz#2014 by openssh AT roumenpetrov.info
    +   - dtucker@cvs.openbsd.org 2012/06/26 12:06:59
    +     [regress/connect-privsep.sh]
    +     test sandbox with every malloc option
    +   - dtucker@cvs.openbsd.org 2012/06/28 05:07:45
    +     [regress/try-ciphers.sh regress/cipher-speed.sh]
    +     Remove hmac-sha2-256-96 and hmac-sha2-512-96 MACs since they were removed
    +     from draft6 of the spec and will not be in the RFC when published.  Patch
    +     from mdb at juniper net via bz#2023, ok markus.
    + - (dtucker) [myproposal.h] Remove trailing backslash to fix compile error.
    + - (dtucker) [key.c] ifdef out sha256 key types on platforms that don't have
    +   the required functions in libcrypto.
    +
    +20120628
    + - (dtucker) [openbsd-compat/getrrsetbyname-ldns.c] bz #2022: prevent null
    +   pointer deref in the client when built with LDNS and using DNSSEC with a
    +   CNAME.  Patch from gregdlg+mr at hochet info.
    +
    +20120622
    + - (dtucker) [contrib/cygwin/ssh-host-config] Ensure that user sshd runs as
    +   can logon as a service.  Patch from vinschen at redhat com.
    +
    +20120620
    + - (djm) OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/12/02 00:41:56
    +     [mux.c]
    +     fix bz#1948: ssh -f doesn't fork for multiplexed connection.
    +     ok dtucker@
    +   - djm@cvs.openbsd.org 2011/12/04 23:16:12
    +     [mux.c]
    +     revert:
    +     > revision 1.32
    +     > date: 2011/12/02 00:41:56;  author: djm;  state: Exp;  lines: +4 -1
    +     > fix bz#1948: ssh -f doesn't fork for multiplexed connection.
    +     > ok dtucker@
    +     it interacts badly with ControlPersist
    +   - djm@cvs.openbsd.org 2012/01/07 21:11:36
    +     [mux.c]
    +     fix double-free in new session handler
    +     NB. Id sync only
    +   - djm@cvs.openbsd.org 2012/05/23 03:28:28
    +     [dns.c dns.h key.c key.h ssh-keygen.c]
    +     add support for RFC6594 SSHFP DNS records for ECDSA key types.
    +     patch from bugzilla-m67 AT nulld.me in bz#1978; ok + tweak markus@
    +   - djm@cvs.openbsd.org 2012/06/01 00:49:35
    +     [PROTOCOL.mux]
    +     correct types of port numbers (integers, not strings); bz#2004 from
    +     bert.wesarg AT googlemail.com
    +   - djm@cvs.openbsd.org 2012/06/01 01:01:22
    +     [mux.c]
    +     fix memory leak when mux socket creation fails; bz#2002 from bert.wesarg
    +     AT googlemail.com
    +   - dtucker@cvs.openbsd.org 2012/06/18 11:43:53
    +     [jpake.c]
    +     correct sizeof usage.  patch from saw at online.de, ok deraadt
    +   - dtucker@cvs.openbsd.org 2012/06/18 11:49:58
    +     [ssh_config.5]
    +     RSA instead of DSA twice.  From Steve.McClellan at radisys com
    +   - dtucker@cvs.openbsd.org 2012/06/18 12:07:07
    +     [ssh.1 sshd.8]
    +     Remove mention of 'three' key files since there are now four.  From
    +     Steve.McClellan at radisys com.
    +   - dtucker@cvs.openbsd.org 2012/06/18 12:17:18
    +     [ssh.1]
    +     Clarify description of -W.  Noted by Steve.McClellan at radisys com,
    +     ok jmc
    +   - markus@cvs.openbsd.org 2012/06/19 18:25:28
    +     [servconf.c servconf.h sshd_config.5]
    +     sshd_config: extend Match to allow AcceptEnv and {Allow,Deny}{Users,Groups}
    +     this allows 'Match LocalPort 1022' combined with 'AllowUser bauer'
    +     ok djm@ (back in March)
    +   - jmc@cvs.openbsd.org 2012/06/19 21:35:54
    +     [sshd_config.5]
    +     tweak previous; ok markus
    +   - djm@cvs.openbsd.org 2012/06/20 04:42:58
    +     [clientloop.c serverloop.c]
    +     initialise accept() backoff timer to avoid EINVAL from select(2) in
    +     rekeying
    +
    +20120519
    + - (dtucker) [configure.ac] bz#2010: fix non-portable shell construct.  Patch
    +   from cjwatson at debian org.
    + - (dtucker) [configure.ac contrib/Makefile] bz#1996: use AC_PATH_TOOL to find
    +   pkg-config so it does the right thing when cross-compiling.  Patch from
    +   cjwatson at debian org.
    +- (dtucker) OpenBSD CVS Sync
    +   - dtucker@cvs.openbsd.org 2012/05/13 01:42:32
    +     [servconf.h servconf.c sshd.8 sshd.c auth.c sshd_config.5]
    +     Add "Match LocalAddress" and "Match LocalPort" to sshd and adjust tests
    +     to match.  Feedback and ok djm@ markus@.
    +   - dtucker@cvs.openbsd.org 2012/05/19 06:30:30
    +     [sshd_config.5]
    +     Document PermitOpen none.  bz#2001, patch from Loganaden Velvindron
    +
    +20120504
    + - (dtucker) [configure.ac] Include  rather than 
    +   to fix building on some plaforms.  Fom bowman at math utah edu and
    +   des at des no.
    +
    +20120427
    + - (dtucker) [regress/addrmatch.sh] skip tests when running on a non-ipv6
    +   platform rather than exiting early, so that we still clean up and return
    +   success or failure to test-exec.sh
    +
    +20120426
    + - (djm) [auth-passwd.c] Handle crypt() returning NULL; from Paul Wouters
    +   via Niels
    + - (djm) [auth-krb5.c] Save errno across calls that might modify it;
    +   ok dtucker@
    +
    +20120423
    + - OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2012/04/23 08:18:17
    +     [channels.c]
    +     fix function proto/source mismatch
    +
    +20120422
    + - OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2012/02/29 11:21:26
    +     [ssh-keygen.c]
    +     allow conversion of RSA1 keys to public PEM and PKCS8; "nice" markus@
    +   - guenther@cvs.openbsd.org 2012/03/15 03:10:27
    +     [session.c]
    +     root should always be excluded from the test for /etc/nologin instead
    +     of having it always enforced even when marked as ignorenologin.  This
    +     regressed when the logic was incompletely flipped around in rev 1.251
    +     ok halex@ millert@
    +   - djm@cvs.openbsd.org 2012/03/28 07:23:22
    +     [PROTOCOL.certkeys]
    +     explain certificate extensions/crit split rationale. Mention requirement
    +     that each appear at most once per cert.
    +   - dtucker@cvs.openbsd.org 2012/03/29 23:54:36
    +     [channels.c channels.h servconf.c]
    +     Add PermitOpen none option based on patch from Loganaden Velvindron
    +     (bz #1949).  ok djm@
    +   - djm@cvs.openbsd.org 2012/04/11 13:16:19
    +     [channels.c channels.h clientloop.c serverloop.c]
    +     don't spin in accept() when out of fds (ENFILE/ENFILE) - back off for a
    +     while; ok deraadt@ markus@
    +   - djm@cvs.openbsd.org 2012/04/11 13:17:54
    +     [auth.c]
    +     Support "none" as an argument for AuthorizedPrincipalsFile to indicate
    +     no file should be read.
    +   - djm@cvs.openbsd.org 2012/04/11 13:26:40
    +     [sshd.c]
    +     don't spin in accept() when out of fds (ENFILE/ENFILE) - back off for a
    +     while; ok deraadt@ markus@
    +   - djm@cvs.openbsd.org 2012/04/11 13:34:17
    +     [ssh-keyscan.1 ssh-keyscan.c]
    +     now that sshd defaults to offering ECDSA keys, ssh-keyscan should also
    +     look for them by default; bz#1971
    +   - djm@cvs.openbsd.org 2012/04/12 02:42:32
    +     [servconf.c servconf.h sshd.c sshd_config sshd_config.5]
    +     VersionAddendum option to allow server operators to append some arbitrary
    +     text to the SSH-... banner; ok deraadt@ "don't care" markus@
    +   - djm@cvs.openbsd.org 2012/04/12 02:43:55
    +     [sshd_config sshd_config.5]
    +     mention AuthorizedPrincipalsFile=none default
    +   - djm@cvs.openbsd.org 2012/04/20 03:24:23
    +     [sftp.c]
    +     setlinebuf(3) is more readable than setvbuf(.., _IOLBF, ...)
    +   - jmc@cvs.openbsd.org 2012/04/20 16:26:22
    +     [ssh.1]
    +     use "brackets" instead of "braces", for consistency;
    +
    +20120420
    + - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
    +   [contrib/suse/openssh.spec] Update for release 6.0
    + - (djm) [README] Update URL to release notes.
    + - (djm) Release openssh-6.0
    +
    +20120419
    + - (djm) [configure.ac] Fix compilation error on FreeBSD, whose libutil
    +   contains openpty() but not login()
    +
    +20120404
    + - (djm) [Makefile.in configure.ac sandbox-seccomp-filter.c] Add sandbox
    +   mode for Linux's new seccomp filter; patch from Will Drewry; feedback
    +   and ok dtucker@
    +
    +20120330
    + - (dtucker) [contrib/redhat/openssh.spec] Bug #1992: remove now-gone WARNING
    +   file from spec file.  From crighter at nuclioss com.
    + - (djm) [entropy.c] bz#1991: relax OpenSSL version test to allow running
    +   openssh binaries on a newer fix release than they were compiled on.
    +   with and ok dtucker@
    + - (djm) [openbsd-compat/bsd-cygwin_util.h] #undef _WIN32 to avoid incorrect
    +   assumptions when building on Cygwin; patch from Corinna Vinschen
    +
    +20120309
    + - (djm) [openbsd-compat/port-linux.c] bz#1960: fix crash on SELinux 
    +   systems where sshd is run in te wrong context. Patch from Sven
    +   Vermeulen; ok dtucker@
    + - (djm) [packet.c] bz#1963: Fix IPQoS not being set on non-mapped v4-in-v6
    +   addressed connections. ok dtucker@
    +
    +20120224
    + - (dtucker) [audit-bsm.c configure.ac] bug #1968: enable workarounds for BSM
    +   audit breakage in Solaris 11.  Patch from Magnus Johansson.
    +
    +20120215
    + - (tim) [openbsd-compat/bsd-misc.h sshd.c] Fix conflicting return type for
    +   unsetenv due to rev 1.14 change to setenv.c. Cast unsetenv to void in sshd.c
    +   ok dtucker@
    + - (tim) [defines.h] move chunk introduced in 1.125 before MAXPATHLEN so
    +   it actually works.
    + - (tim) [regress/keytype.sh] stderr redirection needs to be inside back quote
    +   to work. Spotted by Angel Gonzalez
    +
    +20120214
    + - (djm) [openbsd-compat/bsd-cygwin_util.c] Add PROGRAMFILES to list of
    +   preserved Cygwin environment variables; from Corinna Vinschen
    +
    +20120211
    + - (djm) OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2012/01/05 00:16:56
    +     [monitor.c]
    +     memleak on error path
    +   - djm@cvs.openbsd.org 2012/01/07 21:11:36
    +     [mux.c]
    +     fix double-free in new session handler
    +   - miod@cvs.openbsd.org 2012/01/08 13:17:11
    +     [ssh-ecdsa.c]
    +     Fix memory leak in ssh_ecdsa_verify(); from Loganaden Velvindron,
    +     ok markus@
    +   - miod@cvs.openbsd.org 2012/01/16 20:34:09
    +     [ssh-pkcs11-client.c]
    +     Fix a memory leak in pkcs11_rsa_private_encrypt(), reported by Jan Klemkow.
    +     While there, be sure to buffer_clear() between send_msg() and recv_msg().
    +     ok markus@
    +   - dtucker@cvs.openbsd.org 2012/01/18 21:46:43
    +     [clientloop.c]
    +     Ensure that $DISPLAY contains only valid characters before using it to
    +     extract xauth data so that it can't be used to play local shell
    +     metacharacter games.  Report from r00t_ati at ihteam.net, ok markus.
    +   - markus@cvs.openbsd.org 2012/01/25 19:26:43
    +     [packet.c]
    +     do not permit SSH2_MSG_SERVICE_REQUEST/ACCEPT during rekeying;
    +     ok dtucker@, djm@
    +   - markus@cvs.openbsd.org 2012/01/25 19:36:31
    +     [authfile.c]
    +     memleak in key_load_file(); from Jan Klemkow
    +   - markus@cvs.openbsd.org 2012/01/25 19:40:09
    +     [packet.c packet.h]
    +     packet_read_poll() is not used anymore.
    +   - markus@cvs.openbsd.org 2012/02/09 20:00:18
    +     [version.h]
    +     move from 6.0-beta to 6.0
    +
    +20120206
    + - (djm) [ssh-keygen.c] Don't fail in do_gen_all_hostkeys on platforms
    +   that don't support ECC. Patch from Phil Oleson
    +
    +20111219
    + - OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/12/02 00:41:56
    +     [mux.c]
    +     fix bz#1948: ssh -f doesn't fork for multiplexed connection.
    +     ok dtucker@
    +   - djm@cvs.openbsd.org 2011/12/02 00:43:57
    +     [mac.c]
    +     fix bz#1934: newer OpenSSL versions will require HMAC_CTX_Init before
    +     HMAC_init (this change in policy seems insane to me)
    +     ok dtucker@
    +   - djm@cvs.openbsd.org 2011/12/04 23:16:12
    +     [mux.c]
    +     revert:
    +     > revision 1.32
    +     > date: 2011/12/02 00:41:56;  author: djm;  state: Exp;  lines: +4 -1
    +     > fix bz#1948: ssh -f doesn't fork for multiplexed connection.
    +     > ok dtucker@
    +     it interacts badly with ControlPersist
    +   - djm@cvs.openbsd.org 2011/12/07 05:44:38
    +     [auth2.c dh.c packet.c roaming.h roaming_client.c roaming_common.c]
    +     fix some harmless and/or unreachable int overflows;
    +     reported Xi Wang, ok markus@
    +
    +20111125
    + - OpenBSD CVS Sync
    +   - oga@cvs.openbsd.org 2011/11/16 12:24:28
    +     [sftp.c]
    +     Don't leak list in complete_cmd_parse if there are no commands found.
    +     Discovered when I was ``borrowing'' this code for something else.
    +     ok djm@
    +
    +20111121
    + - (dtucker) [configure.ac] Set _FORTIFY_SOURCE.  ok djm@
    +
    +20111104
    + - (dtucker) OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/10/18 05:15:28
    +     [ssh.c]
    +     ssh(1): skip attempting to create ~/.ssh when -F is passed; ok markus@
    +   - djm@cvs.openbsd.org 2011/10/18 23:37:42
    +     [ssh-add.c]
    +     add -k to usage(); reminded by jmc@
    +   - djm@cvs.openbsd.org 2011/10/19 00:06:10
    +     [moduli.c]
    +     s/tmpfile/tmp/ to make this -Wshadow clean
    +   - djm@cvs.openbsd.org 2011/10/19 10:39:48
    +     [umac.c]
    +     typo in comment; patch from Michael W. Bombardieri
    +   - djm@cvs.openbsd.org 2011/10/24 02:10:46
    +     [ssh.c]
    +     bz#1943: unbreak stdio forwarding when ControlPersist is in user - ssh
    +     was incorrectly requesting the forward in both the control master and
    +     slave. skip requesting it in the master to fix. ok markus@
    +   - djm@cvs.openbsd.org 2011/10/24 02:13:13
    +     [session.c]
    +     bz#1859: send tty break to pty master instead of (probably already
    +     closed) slave side; "looks good" markus@
    +   - dtucker@cvs.openbsd.org 011/11/04 00:09:39
    +     [moduli]
    +     regenerated moduli file; ok deraadt
    + - (dtucker) [INSTALL LICENCE configure.ac openbsd-compat/Makefile.in
    +   openbsd-compat/getrrsetbyname-ldns.c openbsd-compat/getrrsetbyname.c]
    +   bz 1320: Add optional support for LDNS, a BSD licensed DNS resolver library
    +   which supports DNSSEC.  Patch from Simon Vallet (svallet at genoscope cns fr)
    +   with some rework from myself and djm.  ok djm.
    +
    +20111025
    + - (dtucker) [contrib/cygwin/Makefile] Continue if installing a doc file
    +   fails.  Patch from Corinna Vinschen.
    +
    +20111018
    + - (djm) OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/10/04 14:17:32
    +     [sftp-glob.c]
    +     silence error spam for "ls */foo" in directory with files; bz#1683
    +   - dtucker@cvs.openbsd.org 2011/10/16 11:02:46
    +     [moduli.c ssh-keygen.1 ssh-keygen.c]
    +     Add optional checkpoints for moduli screening.  feedback & ok deraadt
    +   - jmc@cvs.openbsd.org 2011/10/16 15:02:41
    +     [ssh-keygen.c]
    +     put -K in the right place (usage());
    +   - stsp@cvs.openbsd.org 2011/10/16 15:51:39
    +     [moduli.c]
    +     add missing includes to unbreak tree; fix from rpointel
    +   - djm@cvs.openbsd.org 2011/10/18 04:58:26
    +     [auth-options.c key.c]
    +     remove explict search for \0 in packet strings, this job is now done
    +     implicitly by buffer_get_cstring; ok markus
    +   - djm@cvs.openbsd.org 2011/10/18 05:00:48
    +     [ssh-add.1 ssh-add.c]
    +     new "ssh-add -k" option to load plain keys (skipping certificates);
    +     "looks ok" markus@
    +
    +20111001
    + - (dtucker) [openbsd-compat/mktemp.c] Fix compiler warning.  ok djm
    + - (dtucker) OpenBSD CVS Sync
    +   - dtucker@cvs.openbsd.org 2011/09/23 00:22:04
    +     [channels.c auth-options.c servconf.c channels.h sshd.8]
    +     Add wildcard support to PermitOpen, allowing things like "PermitOpen
    +     localhost:*".  bz #1857, ok djm markus.
    +   - markus@cvs.openbsd.org 2011/09/23 07:45:05
    +     [mux.c readconf.h channels.h compat.h compat.c ssh.c readconf.c channels.c
    +     version.h]
    +     unbreak remote portforwarding with dynamic allocated listen ports:
    +     1) send the actual listen port in the open message (instead of 0).
    +        this allows multiple forwardings with a dynamic listen port
    +     2) update the matching permit-open entry, so we can identify where
    +        to connect to
    +     report: den at skbkontur.ru and P. Szczygielski
    +     feedback and ok djm@
    +   - djm@cvs.openbsd.org 2011/09/25 05:44:47
    +     [auth2-pubkey.c]
    +     improve the AuthorizedPrincipalsFile debug log message to include
    +     file and line number
    +   - dtucker@cvs.openbsd.org 2011/09/30 00:47:37
    +     [sshd.c]
    +     don't attempt privsep cleanup when not using privsep; ok markus@
    +   - djm@cvs.openbsd.org 2011/09/30 21:22:49
    +     [sshd.c]
    +     fix inverted test that caused logspam; spotted by henning@
    +
    +20110929
    + - (djm) [configure.ac defines.h] No need to detect sizeof(char); patch
    +   from des AT des.no
    + - (dtucker) [configure.ac openbsd-compat/Makefile.in
    +   openbsd-compat/strnlen.c] Add strnlen to the compat library.
    +
    +20110923
    + - (djm) [openbsd-compat/getcwd.c] Remove OpenBSD rcsid marker since we no
    +   longer want to sync this file (OpenBSD uses a __getcwd syscall now, we
    +   want this longhand version)
    + - (djm) [openbsd-compat/getgrouplist.c] Remove OpenBSD rcsid marker: the
    +   upstream version is YPified and we don't want this
    + - (djm) [openbsd-compat/mktemp.c] forklift upgrade to -current version.
    +   The file was totally rewritten between what we had in tree and -current.
    + - (djm) [openbsd-compat/sha2.c openbsd-compat/sha2.h] Remove OpenBSD rcsid
    +   marker. The upstream API has changed (function and structure names)
    +   enough to put it out of sync with other providers of this interface.
    + - (djm) [openbsd-compat/setenv.c] Forklift upgrade, including inclusion
    +   of static __findenv() function from upstream setenv.c
    + - OpenBSD CVS Sync
    +   - millert@cvs.openbsd.org 2006/05/05 15:27:38
    +     [openbsd-compat/strlcpy.c]
    +     Convert do {} while loop -> while {} for clarity.  No binary change
    +     on most architectures.  From Oliver Smith.  OK deraadt@ and henning@
    +   - tobias@cvs.openbsd.org 2007/10/21 11:09:30
    +     [openbsd-compat/mktemp.c]
    +     Comment fix about time consumption of _gettemp.
    +     FreeBSD did this in revision 1.20.
    +     OK deraadt@, krw@
    +   - deraadt@cvs.openbsd.org 2008/07/22 21:47:45
    +     [openbsd-compat/mktemp.c]
    +     use arc4random_uniform(); ok djm millert
    +   - millert@cvs.openbsd.org 2008/08/21 16:54:44
    +     [openbsd-compat/mktemp.c]
    +     Remove useless code, the kernel will set errno appropriately if an
    +     element in the path does not exist.  OK deraadt@ pvalchev@
    +   - otto@cvs.openbsd.org 2008/12/09 19:38:38
    +     [openbsd-compat/inet_ntop.c]
    +     fix inet_ntop(3) prototype; ok millert@ libc to be bumbed very soon
    +
    +20110922
    + - OpenBSD CVS Sync
    +   - pyr@cvs.openbsd.org 2011/05/12 07:15:10
    +     [openbsd-compat/glob.c]
    +     When the max number of items for a directory has reached GLOB_LIMIT_READDIR
    +     an error is returned but closedir() is not called.
    +     spotted and fix provided by Frank Denis obsd-tech@pureftpd.org
    +     ok otto@, millert@
    +   - stsp@cvs.openbsd.org 2011/09/20 10:18:46
    +     [glob.c]
    +     In glob(3), limit recursion during matching attempts. Similar to
    +     fnmatch fix. Also collapse consecutive '*' (from NetBSD).
    +     ok miod deraadt
    +   - djm@cvs.openbsd.org 2011/09/22 06:27:29
    +     [glob.c]
    +     fix GLOB_KEEPSTAT without GLOB_NOSORT; the implicit sort was being
    +     applied only to the gl_pathv vector and not the corresponding gl_statv
    +     array. reported in OpenSSH bz#1935; feedback and okay matthew@
    +   - djm@cvs.openbsd.org 2011/08/26 01:45:15
    +     [ssh.1]
    +     Add some missing ssh_config(5) options that can be used in ssh(1)'s
    +     -o argument. Patch from duclare AT guu.fi
    +   - djm@cvs.openbsd.org 2011/09/05 05:56:13
    +     [scp.1 sftp.1]
    +     mention ControlPersist and KbdInteractiveAuthentication in the -o
    +     verbiage in these pages too (prompted by jmc@)
    +   - djm@cvs.openbsd.org 2011/09/05 05:59:08
    +     [misc.c]
    +     fix typo in IPQoS parsing: there is no "AF14" class, but there is
    +     an "AF21" class. Spotted by giesen AT snickers.org; ok markus stevesk
    +   - jmc@cvs.openbsd.org 2011/09/05 07:01:44
    +     [scp.1]
    +     knock out a useless Ns;
    +   - deraadt@cvs.openbsd.org 2011/09/07 02:18:31
    +     [ssh-keygen.1]
    +     typo (they vs the) found by Lawrence Teo
    +   - djm@cvs.openbsd.org 2011/09/09 00:43:00
    +     [ssh_config.5 sshd_config.5]
    +     fix typo in IPQoS parsing: there is no "AF14" class, but there is
    +     an "AF21" class. Spotted by giesen AT snickers.org; ok markus stevesk
    +   - djm@cvs.openbsd.org 2011/09/09 00:44:07
    +     [PROTOCOL.mux]
    +     MUX_C_CLOSE_FWD includes forward type in message (though it isn't
    +     implemented anyway)
    +   - djm@cvs.openbsd.org 2011/09/09 22:37:01
    +     [scp.c]
    +     suppress adding '--' to remote commandlines when the first argument
    +     does not start with '-'. saves breakage on some difficult-to-upgrade
    +     embedded/router platforms; feedback & ok dtucker ok markus
    +   - djm@cvs.openbsd.org 2011/09/09 22:38:21
    +     [sshd.c]
    +     kill the preauth privsep child on fatal errors in the monitor;
    +     ok markus@
    +   - djm@cvs.openbsd.org 2011/09/09 22:46:44
    +     [channels.c channels.h clientloop.h mux.c ssh.c]
    +     support for cancelling local and remote port forwards via the multiplex
    +     socket. Use ssh -O cancel -L xx:xx:xx -R yy:yy:yy user@host" to request
    +     the cancellation of the specified forwardings; ok markus@
    +   - markus@cvs.openbsd.org 2011/09/10 22:26:34
    +     [channels.c channels.h clientloop.c ssh.1]
    +     support cancellation of local/dynamic forwardings from ~C commandline;
    +     ok & feedback djm@
    +   - okan@cvs.openbsd.org 2011/09/11 06:59:05
    +     [ssh.1]
    +     document new -O cancel command; ok djm@
    +   - markus@cvs.openbsd.org 2011/09/11 16:07:26
    +     [sftp-client.c]
    +     fix leaks in do_hardlink() and do_readlink(); bz#1921
    +     from Loganaden Velvindron
    +   - markus@cvs.openbsd.org 2011/09/12 08:46:15
    +     [sftp-client.c]
    +     fix leak in do_lsreaddir(); ok djm
    +   - djm@cvs.openbsd.org 2011/09/22 06:29:03
    +     [sftp.c]
    +     don't let remote_glob() implicitly sort its results in do_globbed_ls() -
    +     in all likelihood, they will be resorted anyway
    +
    +20110909
    + - (dtucker) [entropy.h] Bug #1932: remove old definition of init_rng.  From
    +   Colin Watson.
    +
    +20110906
    + - (djm) [README version.h] Correct version
    + - (djm) [contrib/redhat/openssh.spec] Correct restorcon => restorecon
    + - (djm) Respin OpenSSH-5.9p1 release
    +
    +20110905
    + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
    +   [contrib/suse/openssh.spec] Update version numbers.
    +
    +20110904
    + - (djm) [regress/connect-privsep.sh regress/test-exec.sh] demote fatal
    +   regress errors for the sandbox to warnings. ok tim dtucker
    + - (dtucker) [ssh-keygen.c ssh-pkcs11.c] Bug #1929: add null implementations
    +   ofsh-pkcs11.cpkcs_init and pkcs_terminate for building without dlopen
    +   support.
    +
    +20110829
    + - (djm) [openbsd-compat/port-linux.c] Suppress logging when attempting
    +   to switch SELinux context away from unconfined_t, based on patch from
    +   Jan Chadima; bz#1919 ok dtucker@
    +
    +20110827
    + - (dtucker) [auth-skey.c] Add log.h to fix build --with-skey.
    +
    +20110818
    + - (tim) [configure.ac] Typo in error message spotted by Andy Tsouladze
    +
    +20110817
    + - (tim) [mac.c myproposal.h] Wrap SHA256 and SHA512 in ifdefs for
    +   OpenSSL 0.9.7. ok djm
    + - (djm) [ openbsd-compat/bsd-cygwin_util.c openbsd-compat/bsd-cygwin_util.h]
    +   binary_pipe is no longer required on Cygwin; patch from Corinna Vinschen
    + - (djm) [configure.ac] error out if the host lacks the necessary bits for
    +   an explicitly requested sandbox type
    + - (djm) [contrib/ssh-copy-id] Missing backlslash; spotted by
    +   bisson AT archlinux.org
    + - (djm) OpenBSD CVS Sync
    +   - dtucker@cvs.openbsd.org 2011/06/03 05:35:10
    +     [regress/cfgmatch.sh]
    +     use OBJ to find test configs, patch from Tim Rice
    +   - markus@cvs.openbsd.org 2011/06/30 22:44:43
    +     [regress/connect-privsep.sh]
    +     test with sandbox enabled; ok djm@
    +   - djm@cvs.openbsd.org 2011/08/02 01:23:41
    +     [regress/cipher-speed.sh regress/try-ciphers.sh]
    +     add SHA256/SHA512 based HMAC modes
    + - (djm) [regress/cipher-speed.sh regress/try-ciphers.sh] disable HMAC-SHA2
    +   MAC tests for platforms that hack EVP_SHA2 support
    +
    +20110812
    + - (dtucker) [openbsd-compat/port-linux.c] Bug 1924: Improve selinux context
    +   change error by reporting old and new context names  Patch from
    +   jchadima at redhat.
    + - (djm) [contrib/redhat/openssh.spec contrib/redhat/sshd.init]
    +   [contrib/suse/openssh.spec contrib/suse/rc.sshd] Updated RHEL and SLES
    +   init scrips from imorgan AT nas.nasa.gov; bz#1920
    + - (djm) [contrib/ssh-copy-id] Fix failure for cases where the path to the
    +   identify file contained whitespace. bz#1828 patch from gwenael.lambrouin
    +   AT gmail.com; ok dtucker@
    +
    +20110807
    + - (dtucker) OpenBSD CVS Sync
    +   - jmc@cvs.openbsd.org 2008/06/26 06:59:39
    +     [moduli.5]
    +     tweak previous;
    +   - sobrado@cvs.openbsd.org 2009/10/28 08:56:54
    +     [moduli.5]
    +     "Diffie-Hellman" is the usual spelling for the cryptographic protocol
    +     first published by Whitfield Diffie and Martin Hellman in 1976.
    +     ok jmc@
    +   - jmc@cvs.openbsd.org 2010/10/14 20:41:28
    +     [moduli.5]
    +     probabalistic -> probabilistic; from naddy
    +   - dtucker@cvs.openbsd.org 2011/08/07 12:55:30
    +     [sftp.1]
    +     typo, fix from Laurent Gautrot
    +
    +20110805
    + - OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/06/23 23:35:42
    +     [monitor.c]
    +     ignore EINTR errors from poll()
    +   - tedu@cvs.openbsd.org 2011/07/06 18:09:21
    +     [authfd.c]
    +     bzero the agent address.  the kernel was for a while very cranky about
    +     these things.  evne though that's fixed, always good to initialize
    +     memory.  ok deraadt djm
    +   - djm@cvs.openbsd.org 2011/07/29 14:42:45
    +     [sandbox-systrace.c]
    +     fail open(2) with EPERM rather than SIGKILLing the whole process. libc
    +     will call open() to do strerror() when NLS is enabled;
    +     feedback and ok markus@
    +   - markus@cvs.openbsd.org 2011/08/01 19:18:15
    +     [gss-serv.c]
    +     prevent post-auth resource exhaustion (int overflow leading to 4GB malloc);
    +     report Adam Zabrock; ok djm@, deraadt@
    +   - djm@cvs.openbsd.org 2011/08/02 01:22:11
    +     [mac.c myproposal.h ssh.1 ssh_config.5 sshd.8 sshd_config.5]
    +     Add new SHA256 and SHA512 based HMAC modes from
    +     http://www.ietf.org/id/draft-dbider-sha2-mac-for-ssh-02.txt
    +     Patch from mdb AT juniper.net; feedback and ok markus@
    +   - djm@cvs.openbsd.org 2011/08/02 23:13:01
    +     [version.h]
    +     crank now, release later
    +   - djm@cvs.openbsd.org 2011/08/02 23:15:03
    +     [ssh.c]
    +     typo in comment
    +
    +20110624
    + - (djm) [configure.ac Makefile.in sandbox-darwin.c] Add a sandbox for
    +   Darwin/OS X using sandbox_init() + setrlimit(); feedback and testing
    +   markus@
    +
    +20110623
    + - OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/06/22 21:47:28
    +     [servconf.c]
    +     reuse the multistate option arrays to pretty-print options for "sshd -T"
    +   - djm@cvs.openbsd.org 2011/06/22 21:57:01
    +     [servconf.c servconf.h sshd.c sshd_config.5]
    +     [configure.ac Makefile.in]
    +     introduce sandboxing of the pre-auth privsep child using systrace(4).
    +     
    +     This introduces a new "UsePrivilegeSeparation=sandbox" option for
    +     sshd_config that applies mandatory restrictions on the syscalls the
    +     privsep child can perform. This prevents a compromised privsep child
    +     from being used to attack other hosts (by opening sockets and proxying)
    +     or probing local kernel attack surface.
    +     
    +     The sandbox is implemented using systrace(4) in unsupervised "fast-path"
    +     mode, where a list of permitted syscalls is supplied. Any syscall not
    +     on the list results in SIGKILL being sent to the privsep child. Note
    +     that this requires a kernel with the new SYSTR_POLICY_KILL option.
    +     
    +     UsePrivilegeSeparation=sandbox will become the default in the future
    +     so please start testing it now.
    +     
    +     feedback dtucker@; ok markus@
    +   - djm@cvs.openbsd.org 2011/06/22 22:08:42
    +     [channels.c channels.h clientloop.c clientloop.h mux.c ssh.c]
    +     hook up a channel confirm callback to warn the user then requested X11
    +     forwarding was refused by the server; ok markus@
    +   - djm@cvs.openbsd.org 2011/06/23 09:34:13
    +     [sshd.c ssh-sandbox.h sandbox.h sandbox-rlimit.c sandbox-systrace.c]
    +     [sandbox-null.c]
    +     rename sandbox.h => ssh-sandbox.h to make things easier for portable
    + - (djm) [sandbox-null.c] Dummy sandbox for platforms that don't support
    +   setrlimit(2)
    +
    +20110620
    + - OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/06/04 00:10:26
    +     [ssh_config.5]
    +     explain IdentifyFile's semantics a little better, prompted by bz#1898
    +     ok dtucker jmc
    +   - markus@cvs.openbsd.org 2011/06/14 22:49:18
    +     [authfile.c]
    +     make sure key_parse_public/private_rsa1() no longer consumes its input
    +     buffer.  fixes ssh-add for passphrase-protected ssh1-keys;
    +     noted by naddy@; ok djm@
    +   - djm@cvs.openbsd.org 2011/06/17 21:44:31
    +     [log.c log.h monitor.c monitor.h monitor_wrap.c monitor_wrap.h sshd.c]
    +     make the pre-auth privsep slave log via a socketpair shared with the
    +     monitor rather than /var/empty/dev/log; ok dtucker@ deraadt@ markus@
    +   - djm@cvs.openbsd.org 2011/06/17 21:46:16
    +     [sftp-server.c]
    +     the protocol version should be unsigned; bz#1913 reported by mb AT
    +     smartftp.com
    +   - djm@cvs.openbsd.org 2011/06/17 21:47:35
    +     [servconf.c]
    +     factor out multi-choice option parsing into a parse_multistate label
    +     and some support structures; ok dtucker@
    +   - djm@cvs.openbsd.org 2011/06/17 21:57:25
    +     [clientloop.c]
    +     setproctitle for a mux master that has been gracefully stopped;
    +     bz#1911 from Bert.Wesarg AT googlemail.com
    +
    +20110603
    + - (dtucker) [README version.h contrib/caldera/openssh.spec
    +   contrib/redhat/openssh.spec contrib/suse/openssh.spec] Pull the version
    +   bumps from the 5.8p2 branch into HEAD.  ok djm.
    + - (tim) [configure.ac defines.h] Run test program to detect system mail
    +   directory. Add --with-maildir option to override. Fixed OpenServer 6
    +   getting it wrong. Fixed many systems having MAIL=/var/mail//username
    +   ok dtucker
    + - (dtucker) [monitor.c] Remove the !HAVE_SOCKETPAIR case.  We use socketpair
    +   unconditionally in other places and the survey data we have does not show
    +   any systems that use it.  "nuke it" djm@
    + - (djm) [configure.ac] enable setproctitle emulation for OS X
    + - (djm) OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/06/03 00:54:38
    +     [ssh.c]
    +     bz#1883 - setproctitle() to identify mux master; patch from Bert.Wesarg
    +     AT googlemail.com; ok dtucker@
    +     NB. includes additional portability code to enable setproctitle emulation
    +     on platforms that don't support it.
    +   - dtucker@cvs.openbsd.org 2011/06/03 01:37:40
    +     [ssh-agent.c]
    +     Check current parent process ID against saved one to determine if the parent
    +     has exited, rather than attempting to send a zero signal, since the latter
    +     won't work if the parent has changed privs.  bz#1905, patch from Daniel Kahn
    +     Gillmor, ok djm@
    +    - dtucker@cvs.openbsd.org 2011/05/31 02:01:58
    +     [regress/dynamic-forward.sh]
    +     back out revs 1.6 and 1.5 since it's not reliable
    +   - dtucker@cvs.openbsd.org 2011/05/31 02:03:34
    +     [regress/dynamic-forward.sh]
    +     work around startup and teardown races; caught by deraadt
    +   - dtucker@cvs.openbsd.org 2011/06/03 00:29:52
    +     [regress/dynamic-forward.sh]
    +     Retry establishing the port forwarding after a small delay, should make
    +     the tests less flaky when the previous test is slow to shut down and free
    +     up the port.
    + - (tim) [regress/cfgmatch.sh] Build/test out of tree fix.
    +
    +20110529
    + - (djm) OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/05/23 03:30:07
    +     [auth-rsa.c auth.c auth.h auth2-pubkey.c monitor.c monitor_wrap.c]
    +     [pathnames.h servconf.c servconf.h sshd.8 sshd_config sshd_config.5]
    +     allow AuthorizedKeysFile to specify multiple files, separated by spaces.
    +     Bring back authorized_keys2 as a default search path (to avoid breaking
    +     existing users of this file), but override this in sshd_config so it will
    +     be no longer used on fresh installs. Maybe in 2015 we can remove it
    +     entierly :)
    +     
    +     feedback and ok markus@ dtucker@
    +   - djm@cvs.openbsd.org 2011/05/23 03:33:38
    +     [auth.c]
    +     make secure_filename() spam debug logs less
    +   - djm@cvs.openbsd.org 2011/05/23 03:52:55
    +     [sshconnect.c]
    +     remove extra newline
    +   - jmc@cvs.openbsd.org 2011/05/23 07:10:21
    +     [sshd.8 sshd_config.5]
    +     tweak previous; ok djm
    +   - djm@cvs.openbsd.org 2011/05/23 07:24:57
    +     [authfile.c]
    +     read in key comments for v.2 keys (though note that these are not
    +     passed over the agent protocol); bz#439, based on patch from binder
    +     AT arago.de; ok markus@
    +   - djm@cvs.openbsd.org 2011/05/24 07:15:47
    +     [readconf.c readconf.h ssh.c ssh_config.5 sshconnect.c sshconnect2.c]
    +     Remove undocumented legacy options UserKnownHostsFile2 and
    +     GlobalKnownHostsFile2 by making UserKnownHostsFile/GlobalKnownHostsFile
    +     accept multiple paths per line and making their defaults include
    +     known_hosts2; ok markus
    +   - djm@cvs.openbsd.org 2011/05/23 03:31:31
    +     [regress/cfgmatch.sh]
    +     include testing of multiple/overridden AuthorizedKeysFiles
    +     refactor to simply daemon start/stop and get rid of racy constructs
    +
    +20110520
    + - (djm) [session.c] call setexeccon() before executing passwd for pw
    +   changes; bz#1891 reported by jchadima AT redhat.com; ok dtucker@
    + - (djm) [aclocal.m4 configure.ac] since gcc-4.x ignores all -Wno-options
    +   options, we should corresponding -W-option when trying to determine
    +   whether it is accepted.  Also includes a warning fix on the program
    +   fragment uses (bad main() return type).
    +   bz#1900 and bz#1901 reported by g.esp AT free.fr; ok dtucker@
    + - (djm) [servconf.c] remove leftover droppings of AuthorizedKeysFile2
    + - OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/05/15 08:09:01
    +     [authfd.c monitor.c serverloop.c]
    +     use FD_CLOEXEC consistently; patch from zion AT x96.org
    +   - djm@cvs.openbsd.org 2011/05/17 07:13:31
    +     [key.c]
    +     fatal() if asked to generate a legacy ECDSA cert (these don't exist)
    +     and fix the regress test that was trying to generate them :)
    +   - djm@cvs.openbsd.org 2011/05/20 00:55:02
    +     [servconf.c]
    +     the options TrustedUserCAKeys, RevokedKeysFile, AuthorizedKeysFile
    +     and AuthorizedPrincipalsFile were not being correctly applied in
    +     Match blocks, despite being overridable there; ok dtucker@
    +   - dtucker@cvs.openbsd.org 2011/05/20 02:00:19
    +     [servconf.c]
    +     Add comment documenting what should be after the preauth check.  ok djm
    +   - djm@cvs.openbsd.org 2011/05/20 03:25:45
    +     [monitor.c monitor_wrap.c servconf.c servconf.h]
    +     use a macro to define which string options to copy between configs
    +     for Match. This avoids problems caused by forgetting to keep three
    +     code locations in perfect sync and ordering
    +     
    +     "this is at once beautiful and horrible" + ok dtucker@
    +   - djm@cvs.openbsd.org 2011/05/17 07:13:31
    +     [regress/cert-userkey.sh]
    +     fatal() if asked to generate a legacy ECDSA cert (these don't exist)
    +     and fix the regress test that was trying to generate them :)
    +   - djm@cvs.openbsd.org 2011/05/20 02:43:36
    +     [cert-hostkey.sh]
    +     another attempt to generate a v00 ECDSA key that broke the test
    +     ID sync only - portable already had this somehow
    +   - dtucker@cvs.openbsd.org 2011/05/20 05:19:50
    +     [dynamic-forward.sh]
    +     Prevent races in dynamic forwarding test; ok djm
    +   - dtucker@cvs.openbsd.org 2011/05/20 06:32:30
    +     [dynamic-forward.sh]
    +     fix dumb error in dynamic-forward test
    +
    +20110515
    + - (djm) OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/05/05 05:12:08
    +     [mux.c]
    +     gracefully fall back when ControlPath is too large for a
    +     sockaddr_un. ok markus@ as part of a larger diff
    +   - dtucker@cvs.openbsd.org 2011/05/06 01:03:35
    +     [sshd_config]
    +     clarify language about overriding defaults.  bz#1892, from Petr Cerny
    +   - djm@cvs.openbsd.org 2011/05/06 01:09:53
    +     [sftp.1]
    +     mention that IPv6 addresses must be enclosed in square brackets;
    +     bz#1845
    +   - djm@cvs.openbsd.org 2011/05/06 02:05:41
    +     [sshconnect2.c]
    +     fix memory leak; bz#1849 ok dtucker@
    +   - djm@cvs.openbsd.org 2011/05/06 21:14:05
    +     [packet.c packet.h]
    +     set traffic class for IPv6 traffic as we do for IPv4 TOS;
    +     patch from lionel AT mamane.lu via Colin Watson in bz#1855;
    +     ok markus@
    +   - djm@cvs.openbsd.org 2011/05/06 21:18:02
    +     [ssh.c ssh_config.5]
    +     add a %L expansion (short-form of the local host name) for ControlPath;
    +     sync some more expansions with LocalCommand; ok markus@
    +   - djm@cvs.openbsd.org 2011/05/06 21:31:38
    +     [readconf.c ssh_config.5]
    +     support negated Host matching, e.g.
    +     
    +     Host *.example.org !c.example.org
    +        User mekmitasdigoat
    +     
    +     Will match "a.example.org", "b.example.org", but not "c.example.org"
    +     ok markus@
    +   - djm@cvs.openbsd.org 2011/05/06 21:34:32
    +     [clientloop.c mux.c readconf.c readconf.h ssh.c ssh_config.5]
    +     Add a RequestTTY ssh_config option to allow configuration-based
    +     control over tty allocation (like -t/-T); ok markus@
    +   - djm@cvs.openbsd.org 2011/05/06 21:38:58
    +     [ssh.c]
    +     fix dropping from previous diff
    +   - djm@cvs.openbsd.org 2011/05/06 22:20:10
    +     [PROTOCOL.mux]
    +     fix numbering; from bert.wesarg AT googlemail.com
    +   - jmc@cvs.openbsd.org 2011/05/07 23:19:39
    +     [ssh_config.5]
    +     - tweak previous
    +     - come consistency fixes
    +     ok djm
    +   - jmc@cvs.openbsd.org 2011/05/07 23:20:25
    +     [ssh.1]
    +     +.It RequestTTY
    +   - djm@cvs.openbsd.org 2011/05/08 12:52:01
    +     [PROTOCOL.mux clientloop.c clientloop.h mux.c]
    +     improve our behaviour when TTY allocation fails: if we are in
    +     RequestTTY=auto mode (the default), then do not treat at TTY
    +     allocation error as fatal but rather just restore the local TTY
    +     to cooked mode and continue. This is more graceful on devices that
    +     never allocate TTYs.
    +     
    +     If RequestTTY is set to "yes" or "force", then failure to allocate
    +     a TTY is fatal.
    +     
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 18:46:57 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 23BAB3E1;
     Thu, 28 Feb 2013 18:46:57 +0000 (UTC)
     (envelope-from jamie@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 16774B66;
     Thu, 28 Feb 2013 18:46:57 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SIku3k004918;
     Thu, 28 Feb 2013 18:46:56 GMT (envelope-from jamie@svn.freebsd.org)
    Received: (from jamie@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SIkuFK004917;
     Thu, 28 Feb 2013 18:46:56 GMT (envelope-from jamie@svn.freebsd.org)
    Message-Id: <201302281846.r1SIkuFK004917@svn.freebsd.org>
    From: Jamie Gritton 
    Date: Thu, 28 Feb 2013 18:46: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: r247486 - stable/9/sys/kern
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 18:46:57 -0000
    
    Author: jamie
    Date: Thu Feb 28 18:46:56 2013
    New Revision: 247486
    URL: http://svnweb.freebsd.org/changeset/base/247486
    
    Log:
      MFC r247071:
      
        Don't worry if a module is already loaded when looking for a fstype to mount
        (possible in a race condition).
      
      Reviewed by:	kib
    
    Modified:
      stable/9/sys/kern/vfs_init.c
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/kern/vfs_init.c
    ==============================================================================
    --- stable/9/sys/kern/vfs_init.c	Thu Feb 28 18:43:50 2013	(r247485)
    +++ stable/9/sys/kern/vfs_init.c	Thu Feb 28 18:46:56 2013	(r247486)
    @@ -122,7 +122,7 @@ struct vfsconf *
     vfs_byname_kld(const char *fstype, struct thread *td, int *error)
     {
     	struct vfsconf *vfsp;
    -	int fileid;
    +	int fileid, loaded;
     
     	vfsp = vfs_byname(fstype);
     	if (vfsp != NULL)
    @@ -130,13 +130,17 @@ vfs_byname_kld(const char *fstype, struc
     
     	/* Try to load the respective module. */
     	*error = kern_kldload(td, fstype, &fileid);
    +	loaded = (*error == 0);
    +	if (*error == EEXIST)
    +		*error = 0;
     	if (*error)
     		return (NULL);
     
     	/* Look up again to see if the VFS was loaded. */
     	vfsp = vfs_byname(fstype);
     	if (vfsp == NULL) {
    -		(void)kern_kldunload(td, fileid, LINKER_UNLOAD_FORCE);
    +		if (loaded)
    +			(void)kern_kldunload(td, fileid, LINKER_UNLOAD_FORCE);
     		*error = ENODEV;
     		return (NULL);
     	}
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 18:49:32 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 9485B5A5;
     Thu, 28 Feb 2013 18:49:32 +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 82602BE6;
     Thu, 28 Feb 2013 18:49:32 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SInWUI005383;
     Thu, 28 Feb 2013 18:49:32 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SInW12005382;
     Thu, 28 Feb 2013 18:49:32 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302281849.r1SInW12005382@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 18:49: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: r247487 - stable/9/sys/dev/acpica
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 18:49:32 -0000
    
    Author: jhb
    Date: Thu Feb 28 18:49:31 2013
    New Revision: 247487
    URL: http://svnweb.freebsd.org/changeset/base/247487
    
    Log:
      MFC 241748:
      When checking to see if a video output's _ADR matches an entry in the
      parent adapter's _DOD list, only check the low 16 bits of both _ADR and
      _DOD.  The language in the ACPI spec seems to indicate that the _ADR values
      should exactly match the entries in _DOD.  However, I assume that the
      masking added to _DOD values was added to work around some known busted
      machines (the commit history doesn't indicate either way), and the ACPI
      spec does require that the low 16 bits are unique for all video outputs,
      so only checking the low 16 bits should be fine.
      
      This fixes recognition of video outputs that use the new standardized
      device ID scheme in ACPI 3.0 that set bit 31 such as certain Dell laptops.
    
    Modified:
      stable/9/sys/dev/acpica/acpi_video.c
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
    
    Modified: stable/9/sys/dev/acpica/acpi_video.c
    ==============================================================================
    --- stable/9/sys/dev/acpica/acpi_video.c	Thu Feb 28 18:46:56 2013	(r247486)
    +++ stable/9/sys/dev/acpica/acpi_video.c	Thu Feb 28 18:49:31 2013	(r247487)
    @@ -906,7 +906,8 @@ vid_enum_outputs_subr(ACPI_HANDLE handle
     
     	for (i = 0; i < argset->dod_pkg->Package.Count; i++) {
     		if (acpi_PkgInt32(argset->dod_pkg, i, &val) == 0 &&
    -		    (val & DOD_DEVID_MASK_FULL) == adr) {
    +		    (val & DOD_DEVID_MASK_FULL) ==
    +		    (adr & DOD_DEVID_MASK_FULL)) {
     			argset->callback(handle, val, argset->context);
     			argset->count++;
     		}
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 18:49:41 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 7AF5D6BC;
     Thu, 28 Feb 2013 18:49:41 +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 6DA1FBE7;
     Thu, 28 Feb 2013 18:49:41 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SInfnV005445;
     Thu, 28 Feb 2013 18:49:41 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SInfpn005444;
     Thu, 28 Feb 2013 18:49:41 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302281849.r1SInfpn005444@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 18:49:41 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247488 - stable/8/sys/dev/acpica
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 18:49:41 -0000
    
    Author: jhb
    Date: Thu Feb 28 18:49:40 2013
    New Revision: 247488
    URL: http://svnweb.freebsd.org/changeset/base/247488
    
    Log:
      MFC 241748:
      When checking to see if a video output's _ADR matches an entry in the
      parent adapter's _DOD list, only check the low 16 bits of both _ADR and
      _DOD.  The language in the ACPI spec seems to indicate that the _ADR values
      should exactly match the entries in _DOD.  However, I assume that the
      masking added to _DOD values was added to work around some known busted
      machines (the commit history doesn't indicate either way), and the ACPI
      spec does require that the low 16 bits are unique for all video outputs,
      so only checking the low 16 bits should be fine.
      
      This fixes recognition of video outputs that use the new standardized
      device ID scheme in ACPI 3.0 that set bit 31 such as certain Dell laptops.
    
    Modified:
      stable/8/sys/dev/acpica/acpi_video.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/acpica/   (props changed)
    
    Modified: stable/8/sys/dev/acpica/acpi_video.c
    ==============================================================================
    --- stable/8/sys/dev/acpica/acpi_video.c	Thu Feb 28 18:49:31 2013	(r247487)
    +++ stable/8/sys/dev/acpica/acpi_video.c	Thu Feb 28 18:49:40 2013	(r247488)
    @@ -874,7 +874,8 @@ vid_enum_outputs_subr(ACPI_HANDLE handle
     
     	for (i = 0; i < argset->dod_pkg->Package.Count; i++) {
     		if (acpi_PkgInt32(argset->dod_pkg, i, &val) == 0 &&
    -		    (val & DOD_DEVID_MASK_FULL) == adr) {
    +		    (val & DOD_DEVID_MASK_FULL) ==
    +		    (adr & DOD_DEVID_MASK_FULL)) {
     			argset->callback(handle, val, argset->context);
     			argset->count++;
     		}
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 18:58:37 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id C884A91A;
     Thu, 28 Feb 2013 18:58:37 +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 A3812C36;
     Thu, 28 Feb 2013 18:58:37 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SIwblQ008553;
     Thu, 28 Feb 2013 18:58:37 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SIwbVm008552;
     Thu, 28 Feb 2013 18:58:37 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302281858.r1SIwbVm008552@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 18:58: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: r247489 - stable/9/sys/dev/puc
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 18:58:37 -0000
    
    Author: jhb
    Date: Thu Feb 28 18:58:37 2013
    New Revision: 247489
    URL: http://svnweb.freebsd.org/changeset/base/247489
    
    Log:
      MFC 245471:
      Do not require a filter-only interrupt handler for puc ports that are not
      serial devices (such as printer ports).  This allows ppc devices attached
      to puc to correctly setup an interrupt handler and work.
    
    Modified:
      stable/9/sys/dev/puc/puc.c
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
      stable/9/sys/dev/puc/   (props changed)
    
    Modified: stable/9/sys/dev/puc/puc.c
    ==============================================================================
    --- stable/9/sys/dev/puc/puc.c	Thu Feb 28 18:49:40 2013	(r247488)
    +++ stable/9/sys/dev/puc/puc.c	Thu Feb 28 18:58:37 2013	(r247489)
    @@ -622,7 +622,7 @@ puc_bus_setup_intr(device_t dev, device_
     	if (cookiep == NULL || res != port->p_ires)
     		return (EINVAL);
     	/* We demand that serdev devices use filter_only interrupts. */
    -	if (ihand != NULL)
    +	if (port->p_type == PUC_TYPE_SERIAL && ihand != NULL)
     		return (ENXIO);
     	if (rman_get_device(port->p_ires) != originator)
     		return (ENXIO);
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 18:59:01 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 25D04A87;
     Thu, 28 Feb 2013 18:59:01 +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 18C61C3D;
     Thu, 28 Feb 2013 18:59:01 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SIx0jp008648;
     Thu, 28 Feb 2013 18:59:00 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SIx0fo008647;
     Thu, 28 Feb 2013 18:59:00 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302281859.r1SIx0fo008647@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 18:59:00 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247490 - stable/8/sys/dev/puc
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 18:59:01 -0000
    
    Author: jhb
    Date: Thu Feb 28 18:59:00 2013
    New Revision: 247490
    URL: http://svnweb.freebsd.org/changeset/base/247490
    
    Log:
      MFC 245471:
      Do not require a filter-only interrupt handler for puc ports that are not
      serial devices (such as printer ports).  This allows ppc devices attached
      to puc to correctly setup an interrupt handler and work.
    
    Modified:
      stable/8/sys/dev/puc/puc.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/puc/   (props changed)
    
    Modified: stable/8/sys/dev/puc/puc.c
    ==============================================================================
    --- stable/8/sys/dev/puc/puc.c	Thu Feb 28 18:58:37 2013	(r247489)
    +++ stable/8/sys/dev/puc/puc.c	Thu Feb 28 18:59:00 2013	(r247490)
    @@ -622,7 +622,7 @@ puc_bus_setup_intr(device_t dev, device_
     	if (cookiep == NULL || res != port->p_ires)
     		return (EINVAL);
     	/* We demand that serdev devices use filter_only interrupts. */
    -	if (ihand != NULL)
    +	if (port->p_type == PUC_TYPE_SERIAL && ihand != NULL)
     		return (ENXIO);
     	if (rman_get_device(port->p_ires) != originator)
     		return (ENXIO);
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 19:00:58 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 5E770C0B;
     Thu, 28 Feb 2013 19:00: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 382F3CC0;
     Thu, 28 Feb 2013 19:00:58 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SJ0wUa010679;
     Thu, 28 Feb 2013 19:00:58 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SJ0vsw010675;
     Thu, 28 Feb 2013 19:00:57 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302281900.r1SJ0vsw010675@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 19:00: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: r247491 - in stable/9/sys: fs/nfs nfsclient
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 19:00:58 -0000
    
    Author: jhb
    Date: Thu Feb 28 19:00:57 2013
    New Revision: 247491
    URL: http://svnweb.freebsd.org/changeset/base/247491
    
    Log:
      MFC 245476:
      - More properly handle interrupted NFS requests on an interruptible mount
        by returning an error of EINTR rather than EACCES.
      - While here, bring back some (but not all) of the NFS RPC statistics lost
        when krpc was committed.
    
    Modified:
      stable/9/sys/fs/nfs/nfs_commonkrpc.c
      stable/9/sys/nfsclient/nfs_krpc.c
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/fs/   (props changed)
    
    Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c
    ==============================================================================
    --- stable/9/sys/fs/nfs/nfs_commonkrpc.c	Thu Feb 28 18:59:00 2013	(r247490)
    +++ stable/9/sys/fs/nfs/nfs_commonkrpc.c	Thu Feb 28 19:00:57 2013	(r247491)
    @@ -741,12 +741,18 @@ tryagain:
     	if (stat == RPC_SUCCESS) {
     		error = 0;
     	} else if (stat == RPC_TIMEDOUT) {
    +		NFSINCRGLOBAL(newnfsstats.rpctimeouts);
     		error = ETIMEDOUT;
     	} else if (stat == RPC_VERSMISMATCH) {
    +		NFSINCRGLOBAL(newnfsstats.rpcinvalid);
     		error = EOPNOTSUPP;
     	} else if (stat == RPC_PROGVERSMISMATCH) {
    +		NFSINCRGLOBAL(newnfsstats.rpcinvalid);
     		error = EPROTONOSUPPORT;
    +	} else if (stat == RPC_INTR) {
    +		error = EINTR;
     	} else {
    +		NFSINCRGLOBAL(newnfsstats.rpcinvalid);
     		error = EACCES;
     	}
     	if (error) {
    
    Modified: stable/9/sys/nfsclient/nfs_krpc.c
    ==============================================================================
    --- stable/9/sys/nfsclient/nfs_krpc.c	Thu Feb 28 18:59:00 2013	(r247490)
    +++ stable/9/sys/nfsclient/nfs_krpc.c	Thu Feb 28 19:00:57 2013	(r247491)
    @@ -549,14 +549,21 @@ tryagain:
     	 */
     	if (stat == RPC_SUCCESS)
     		error = 0;
    -	else if (stat == RPC_TIMEDOUT)
    +	else if (stat == RPC_TIMEDOUT) {
    +		nfsstats.rpctimeouts++;
     		error = ETIMEDOUT;
    -	else if (stat == RPC_VERSMISMATCH)
    +	} else if (stat == RPC_VERSMISMATCH) {
    +		nfsstats.rpcinvalid++;
     		error = EOPNOTSUPP;
    -	else if (stat == RPC_PROGVERSMISMATCH)
    +	} else if (stat == RPC_PROGVERSMISMATCH) {
    +		nfsstats.rpcinvalid++;
     		error = EPROTONOSUPPORT;
    -	else
    +	} else if (stat == RPC_INTR) {
    +		error = EINTR;
    +	} else {
    +		nfsstats.rpcinvalid++;
     		error = EACCES;
    +	}
     	if (error)
     		goto nfsmout;
     
    @@ -572,6 +579,7 @@ tryagain:
     	if (error == ENOMEM) {
     		m_freem(mrep);
     		AUTH_DESTROY(auth);
    +		nfsstats.rpcinvalid++;
     		return (error);
     	}
     
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 19:01:05 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 7EDE1D5E;
     Thu, 28 Feb 2013 19:01:05 +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 59205CC2;
     Thu, 28 Feb 2013 19:01:05 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SJ154I010764;
     Thu, 28 Feb 2013 19:01:05 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SJ15tH010762;
     Thu, 28 Feb 2013 19:01:05 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302281901.r1SJ15tH010762@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 19:01:05 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247492 - in stable/8/sys: fs/nfs nfsclient
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 19:01:05 -0000
    
    Author: jhb
    Date: Thu Feb 28 19:01:04 2013
    New Revision: 247492
    URL: http://svnweb.freebsd.org/changeset/base/247492
    
    Log:
      MFC 245476:
      - More properly handle interrupted NFS requests on an interruptible mount
        by returning an error of EINTR rather than EACCES.
      - While here, bring back some (but not all) of the NFS RPC statistics lost
        when krpc was committed.
    
    Modified:
      stable/8/sys/fs/nfs/nfs_commonkrpc.c
      stable/8/sys/nfsclient/nfs_krpc.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/fs/   (props changed)
      stable/8/sys/nfsclient/   (props changed)
    
    Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c
    ==============================================================================
    --- stable/8/sys/fs/nfs/nfs_commonkrpc.c	Thu Feb 28 19:00:57 2013	(r247491)
    +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c	Thu Feb 28 19:01:04 2013	(r247492)
    @@ -695,12 +695,18 @@ tryagain:
     	if (stat == RPC_SUCCESS) {
     		error = 0;
     	} else if (stat == RPC_TIMEDOUT) {
    +		NFSINCRGLOBAL(newnfsstats.rpctimeouts);
     		error = ETIMEDOUT;
     	} else if (stat == RPC_VERSMISMATCH) {
    +		NFSINCRGLOBAL(newnfsstats.rpcinvalid);
     		error = EOPNOTSUPP;
     	} else if (stat == RPC_PROGVERSMISMATCH) {
    +		NFSINCRGLOBAL(newnfsstats.rpcinvalid);
     		error = EPROTONOSUPPORT;
    +	} else if (stat == RPC_INTR) {
    +		error = EINTR;
     	} else {
    +		NFSINCRGLOBAL(newnfsstats.rpcinvalid);
     		error = EACCES;
     	}
     	if (error) {
    
    Modified: stable/8/sys/nfsclient/nfs_krpc.c
    ==============================================================================
    --- stable/8/sys/nfsclient/nfs_krpc.c	Thu Feb 28 19:00:57 2013	(r247491)
    +++ stable/8/sys/nfsclient/nfs_krpc.c	Thu Feb 28 19:01:04 2013	(r247492)
    @@ -549,14 +549,21 @@ tryagain:
     	 */
     	if (stat == RPC_SUCCESS)
     		error = 0;
    -	else if (stat == RPC_TIMEDOUT)
    +	else if (stat == RPC_TIMEDOUT) {
    +		nfsstats.rpctimeouts++;
     		error = ETIMEDOUT;
    -	else if (stat == RPC_VERSMISMATCH)
    +	} else if (stat == RPC_VERSMISMATCH) {
    +		nfsstats.rpcinvalid++;
     		error = EOPNOTSUPP;
    -	else if (stat == RPC_PROGVERSMISMATCH)
    +	} else if (stat == RPC_PROGVERSMISMATCH) {
    +		nfsstats.rpcinvalid++;
     		error = EPROTONOSUPPORT;
    -	else
    +	} else if (stat == RPC_INTR) {
    +		error = EINTR;
    +	} else {
    +		nfsstats.rpcinvalid++;
     		error = EACCES;
    +	}
     	if (error)
     		goto nfsmout;
     
    @@ -572,6 +579,7 @@ tryagain:
     	if (error == ENOMEM) {
     		m_freem(mrep);
     		AUTH_DESTROY(auth);
    +		nfsstats.rpcinvalid++;
     		return (error);
     	}
     
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 19:43:15 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 5243E85F;
     Thu, 28 Feb 2013 19:43:15 +0000 (UTC)
     (envelope-from gonzo@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 35A6AE7D;
     Thu, 28 Feb 2013 19:43:15 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SJhFvS023268;
     Thu, 28 Feb 2013 19:43:15 GMT (envelope-from gonzo@svn.freebsd.org)
    Received: (from gonzo@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SJhEmC023261;
     Thu, 28 Feb 2013 19:43:14 GMT (envelope-from gonzo@svn.freebsd.org)
    Message-Id: <201302281943.r1SJhEmC023261@svn.freebsd.org>
    From: Oleksandr Tymoshenko 
    Date: Thu, 28 Feb 2013 19:43:14 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247495 - head/sys/dev/sdhci
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 19:43:15 -0000
    
    Author: gonzo
    Date: Thu Feb 28 19:43:14 2013
    New Revision: 247495
    URL: http://svnweb.freebsd.org/changeset/base/247495
    
    Log:
      Add hooks for plugging platform-provided transfer backend.
      
      In order to use platorm backend hardware driver should
      impement three methods:
      - platform_start_transfer and platform_finish_transfer
          to start and finish transfer
      - platform_will_handle - check whether transaction is
          suitable for backend. If not - driver will fall back
          to PIO mode.
      
      Submitted by:	Daisuke Aoyama 
      Approved by:	ian@
    
    Modified:
      head/sys/dev/sdhci/sdhci.c
      head/sys/dev/sdhci/sdhci.h
      head/sys/dev/sdhci/sdhci_if.m
    
    Modified: head/sys/dev/sdhci/sdhci.c
    ==============================================================================
    --- head/sys/dev/sdhci/sdhci.c	Thu Feb 28 19:36:22 2013	(r247494)
    +++ head/sys/dev/sdhci/sdhci.c	Thu Feb 28 19:43:14 2013	(r247495)
    @@ -573,6 +573,13 @@ sdhci_init_slot(device_t dev, struct sdh
     	if (slot->quirks & SDHCI_QUIRK_FORCE_DMA)
     		slot->opt |= SDHCI_HAVE_DMA;
     
    +	/* 
    +	 * Use platform-provided transfer backend
    +	 * with PIO as a fallback mechanism
    +	 */
    +	if (slot->opt & SDHCI_PLATFORM_TRANSFER)
    +		slot->opt &= ~SDHCI_HAVE_DMA;
    +
     	if (bootverbose || sdhci_debug) {
     		slot_printf(slot, "%uMHz%s 4bits%s%s%s %s\n",
     		    slot->max_clk / 1000000,
    @@ -909,7 +916,7 @@ sdhci_start_data(struct sdhci_slot *slot
     	WR2(slot, SDHCI_BLOCK_COUNT, (data->len + 511) / 512);
     }
     
    -static void
    +void
     sdhci_finish_data(struct sdhci_slot *slot)
     {
     	struct mmc_data *data = slot->curcmd->data;
    @@ -1102,13 +1109,23 @@ sdhci_data_irq(struct sdhci_slot *slot, 
     	}
     	if (slot->curcmd->error) {
     		/* No need to continue after any error. */
    -		sdhci_finish_data(slot);
    +		if (slot->flags & PLATFORM_DATA_STARTED) {
    +			slot->flags &= ~PLATFORM_DATA_STARTED;
    +			SDHCI_PLATFORM_FINISH_TRANSFER(slot->bus, slot);
    +		} else
    +			sdhci_finish_data(slot);
     		return;
     	}
     
     	/* Handle PIO interrupt. */
    -	if (intmask & (SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL))
    -		sdhci_transfer_pio(slot);
    +	if (intmask & (SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL)) {
    +		if ((slot->opt & SDHCI_PLATFORM_TRANSFER) && 
    +		    SDHCI_PLATFORM_WILL_HANDLE(slot->bus, slot)) {
    +			SDHCI_PLATFORM_START_TRANSFER(slot->bus, slot, &intmask);
    +			slot->flags |= PLATFORM_DATA_STARTED;
    +		} else
    +			sdhci_transfer_pio(slot);
    +	}
     	/* Handle DMA border. */
     	if (intmask & SDHCI_INT_DMA_END) {
     		struct mmc_data *data = slot->curcmd->data;
    @@ -1147,8 +1164,13 @@ sdhci_data_irq(struct sdhci_slot *slot, 
     		WR4(slot, SDHCI_DMA_ADDRESS, slot->paddr);
     	}
     	/* We have got all data. */
    -	if (intmask & SDHCI_INT_DATA_END)
    -		sdhci_finish_data(slot);
    +	if (intmask & SDHCI_INT_DATA_END) {
    +		if (slot->flags & PLATFORM_DATA_STARTED) {
    +			slot->flags &= ~PLATFORM_DATA_STARTED;
    +			SDHCI_PLATFORM_FINISH_TRANSFER(slot->bus, slot);
    +		} else
    +			sdhci_finish_data(slot);
    +	}
     }
     
     static void
    
    Modified: head/sys/dev/sdhci/sdhci.h
    ==============================================================================
    --- head/sys/dev/sdhci/sdhci.h	Thu Feb 28 19:36:22 2013	(r247494)
    +++ head/sys/dev/sdhci/sdhci.h	Thu Feb 28 19:43:14 2013	(r247495)
    @@ -224,8 +224,9 @@ struct sdhci_slot {
     	device_t	dev;		/* Slot device */
     	u_char		num;		/* Slot number */
     	u_char		opt;		/* Slot options */
    +#define SDHCI_HAVE_DMA			1
    +#define SDHCI_PLATFORM_TRANSFER		2
     	u_char		version;
    -#define SDHCI_HAVE_DMA		1
     	uint32_t	max_clk;	/* Max possible freq */
     	uint32_t	timeout_clk;	/* Timeout freq */
     	bus_dma_tag_t 	dmatag;
    @@ -250,6 +251,7 @@ struct sdhci_slot {
     #define CMD_STARTED		1
     #define STOP_STARTED		2
     #define SDHCI_USE_DMA		4	/* Use DMA for this req. */
    +#define PLATFORM_DATA_STARTED	8	/* Data transfer is handled by platform */
     	struct mtx	mtx;		/* Slot mutex */
     };
     
    @@ -257,6 +259,8 @@ int sdhci_generic_read_ivar(device_t bus
     int sdhci_generic_write_ivar(device_t bus, device_t child, int which, uintptr_t value);
     int sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num);
     void sdhci_start_slot(struct sdhci_slot *slot);
    +/* performs generic clean-up for platform transfers */
    +void sdhci_finish_data(struct sdhci_slot *slot);
     int sdhci_cleanup_slot(struct sdhci_slot *slot);
     int sdhci_generic_suspend(struct sdhci_slot *slot);
     int sdhci_generic_resume(struct sdhci_slot *slot);
    
    Modified: head/sys/dev/sdhci/sdhci_if.m
    ==============================================================================
    --- head/sys/dev/sdhci/sdhci_if.m	Thu Feb 28 19:36:22 2013	(r247494)
    +++ head/sys/dev/sdhci/sdhci_if.m	Thu Feb 28 19:43:14 2013	(r247495)
    @@ -131,6 +131,22 @@ METHOD void write_multi_4 {
     	bus_size_t		count;
     }
     
    +METHOD int platform_will_handle {
    +	device_t		brdev;
    +	struct sdhci_slot	*slot;
    +}
    +
    +METHOD void platform_start_transfer {
    +	device_t		brdev;
    +	struct sdhci_slot	*slot;
    +	uint32_t		*intmask;
    +}
    +
    +METHOD void platform_finish_transfer {
    +	device_t		brdev;
    +	struct sdhci_slot	*slot;
    +}
    +
     METHOD uint32_t min_freq {
     	device_t		brdev;
     	struct sdhci_slot	*slot;
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 19:48:20 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id BD6A0A29;
     Thu, 28 Feb 2013 19:48:20 +0000 (UTC)
     (envelope-from gonzo@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 AF951EAC;
     Thu, 28 Feb 2013 19:48:20 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SJmKjV024120;
     Thu, 28 Feb 2013 19:48:20 GMT (envelope-from gonzo@svn.freebsd.org)
    Received: (from gonzo@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SJmK3f024116;
     Thu, 28 Feb 2013 19:48:20 GMT (envelope-from gonzo@svn.freebsd.org)
    Message-Id: <201302281948.r1SJmK3f024116@svn.freebsd.org>
    From: Oleksandr Tymoshenko 
    Date: Thu, 28 Feb 2013 19:48:20 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247496 - head/sys/arm/broadcom/bcm2835
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 19:48:20 -0000
    
    Author: gonzo
    Date: Thu Feb 28 19:48:19 2013
    New Revision: 247496
    URL: http://svnweb.freebsd.org/changeset/base/247496
    
    Log:
      Add driver for BCM2835's DMA engine
      
      This is a version of code submitted by Daisuke Aoyama 
      with some architectural changes.
    
    Added:
      head/sys/arm/broadcom/bcm2835/bcm2835_dma.c   (contents, props changed)
      head/sys/arm/broadcom/bcm2835/bcm2835_dma.h   (contents, props changed)
    Modified:
      head/sys/arm/broadcom/bcm2835/files.bcm2835
    
    Added: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/sys/arm/broadcom/bcm2835/bcm2835_dma.c	Thu Feb 28 19:48:19 2013	(r247496)
    @@ -0,0 +1,727 @@
    +/*
    + * Copyright (c) 2013 Daisuke Aoyama 
    + * Copyright (c) 2013 Oleksandr Tymoshenko 
    + *
    + * 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 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +#include "bcm2835_dma.h"
    +#include "bcm2835_vcbus.h"
    +
    +#define	MAX_REG			9
    +
    +/* private flags */
    +#define	BCM_DMA_CH_USED		0x00000001
    +#define	BCM_DMA_CH_FREE		0x40000000
    +#define	BCM_DMA_CH_UNMAP	0x80000000
    +
    +/* Register Map (4.2.1.2) */
    +#define	BCM_DMA_CS(n)		(0x100*(n) + 0x00)
    +#define		CS_ACTIVE		(1 <<  0)
    +#define		CS_END			(1 <<  1)
    +#define		CS_INT			(1 <<  2)
    +#define		CS_DREQ			(1 <<  3)
    +#define		CS_ISPAUSED		(1 <<  4)
    +#define		CS_ISHELD		(1 <<  5)
    +#define		CS_ISWAIT		(1 <<  6)
    +#define		CS_ERR			(1 <<  8)
    +#define		CS_WAITWRT		(1 << 28)
    +#define		CS_DISDBG		(1 << 29)
    +#define		CS_ABORT		(1 << 30)
    +#define		CS_RESET		(1 << 31)
    +#define	BCM_DMA_CBADDR(n)	(0x100*(n) + 0x04)
    +#define	BCM_DMA_INFO(n)		(0x100*(n) + 0x08)
    +#define		INFO_INT_EN		(1 << 0)
    +#define		INFO_TDMODE		(1 << 1)
    +#define		INFO_WAIT_RESP		(1 << 3)
    +#define		INFO_D_INC		(1 << 4)
    +#define		INFO_D_WIDTH		(1 << 5)
    +#define		INFO_D_DREQ		(1 << 6)
    +#define		INFO_S_INC		(1 << 8)
    +#define		INFO_S_WIDTH		(1 << 9)
    +#define		INFO_S_DREQ		(1 << 10)
    +#define		INFO_WAITS_SHIFT	(21)
    +#define		INFO_PERMAP_SHIFT	(16)
    +#define		INFO_PERMAP_MASK	(0x1f << INFO_PERMAP_SHIFT)
    +
    +#define	BCM_DMA_SRC(n)		(0x100*(n) + 0x0C)
    +#define	BCM_DMA_DST(n)		(0x100*(n) + 0x10)
    +#define	BCM_DMA_LEN(n)		(0x100*(n) + 0x14)
    +#define	BCM_DMA_STRIDE(n)	(0x100*(n) + 0x18)
    +#define	BCM_DMA_CBNEXT(n)	(0x100*(n) + 0x1C)
    +#define	BCM_DMA_DEBUG(n)	(0x100*(n) + 0x20)
    +#define		DEBUG_ERROR_MASK	(7)
    +
    +#define	BCM_DMA_INT_STATUS	0xfe0
    +#define	BCM_DMA_ENABLE		0xff0
    +
    +/* relative offset from BCM_VC_DMA0_BASE (p.39) */
    +#define	BCM_DMA_CH(n)		(0x100*(n))
    +
    +/* DMA Control Block - 256bit aligned (p.40) */
    +struct bcm_dma_cb {
    +	uint32_t info;		/* Transfer Information */
    +	uint32_t src;		/* Source Address */
    +	uint32_t dst;		/* Destination Address */
    +	uint32_t len;		/* Transfer Length */
    +	uint32_t stride;	/* 2D Mode Stride */
    +	uint32_t next;		/* Next Control Block Address */
    +	uint32_t rsvd1;		/* Reserved */
    +	uint32_t rsvd2;		/* Reserved */
    +};
    +
    +#ifdef DEBUG
    +static void bcm_dma_cb_dump(struct bcm_dma_cb *cb);
    +static void bcm_dma_reg_dump(int ch);
    +#endif
    +
    +/* DMA channel private info */
    +struct bcm_dma_ch {
    +	int			ch;
    +	uint32_t		flags;
    +	struct bcm_dma_cb *	cb;
    +	uint32_t		vc_cb;
    +	bus_dmamap_t		dma_map;
    +	void 			(*intr_func)(int, void *);
    +	void *			intr_arg;
    +};
    +
    +struct bcm_dma_softc {
    +	device_t		sc_dev;
    +	struct mtx		sc_mtx;
    +	struct resource *	sc_mem;
    +	struct resource *	sc_irq[BCM_DMA_CH_MAX];
    +	void *			sc_intrhand[BCM_DMA_CH_MAX];
    +	struct bcm_dma_ch	sc_dma_ch[BCM_DMA_CH_MAX];
    +	bus_dma_tag_t		sc_dma_tag;
    +};
    +
    +static struct bcm_dma_softc *bcm_dma_sc = NULL;
    +
    +static void
    +bcm_dmamap_cb(void *arg, bus_dma_segment_t *segs,
    +	int nseg, int err)
    +{
    +        bus_addr_t *addr;
    +
    +        if (err)
    +                return;
    +
    +        addr = (bus_addr_t*)arg;
    +        *addr = PHYS_TO_VCBUS(segs[0].ds_addr);
    +}
    +
    +static void
    +bcm_dma_reset(device_t dev, int ch)
    +{
    +	struct bcm_dma_softc *sc = device_get_softc(dev);
    +	struct bcm_dma_cb *cb;
    +	uint32_t cs;
    +	int count;
    +
    +	if (ch < 0 || ch >= BCM_DMA_CH_MAX)
    +		return;
    +
    +	cs = bus_read_4(sc->sc_mem, BCM_DMA_CS(ch));
    +
    +	if (cs & CS_ACTIVE) {
    +		/* pause current task */
    +		bus_write_4(sc->sc_mem, BCM_DMA_CS(ch), 0);
    +
    +		count = 1000;
    +		do {
    +			cs = bus_read_4(sc->sc_mem, BCM_DMA_CS(ch));
    +		} while (!(cs & CS_ISPAUSED) && (count-- > 0));
    +
    +		if (!(cs & CS_ISPAUSED)) {
    +			device_printf(dev,
    +			    "Can't abort DMA transfer at channel %d\n", ch);
    +		}
    +
    +		bus_write_4(sc->sc_mem, BCM_DMA_CBNEXT(ch), 0);
    +
    +		/* Complete everything, clear interrupt */
    +		bus_write_4(sc->sc_mem, BCM_DMA_CS(ch),
    +		    CS_ABORT | CS_INT | CS_END| CS_ACTIVE);
    +	}
    +
    +	/* clear control blocks */
    +	bus_write_4(sc->sc_mem, BCM_DMA_CBADDR(ch), 0);
    +	bus_write_4(sc->sc_mem, BCM_DMA_CBNEXT(ch), 0);
    +
    +	/* Reset control block */
    +	cb = sc->sc_dma_ch[ch].cb;
    +	bzero(cb, sizeof(cb));
    +}
    +
    +static int
    +bcm_dma_init(device_t dev)
    +{
    +	struct bcm_dma_softc *sc = device_get_softc(dev);
    +	uint32_t mask;
    +	struct bcm_dma_ch *ch;
    +	void *cb_virt;
    +	vm_paddr_t cb_phys;
    +	int err;
    +	int i;
    +
    +	/* disable and clear interrupt status */
    +	bus_write_4(sc->sc_mem, BCM_DMA_ENABLE, 0);
    +	bus_write_4(sc->sc_mem, BCM_DMA_INT_STATUS, 0);
    +
    +	/* Allocate DMA chunks control blocks */
    +	/* p.40 of spec - control block should be 32-bit aligned */
    +	err = bus_dma_tag_create(bus_get_dma_tag(dev),
    +	    1, 0, BUS_SPACE_MAXADDR_32BIT,
    +	    BUS_SPACE_MAXADDR, NULL, NULL,
    +	    sizeof(struct bcm_dma_cb), 1,
    +	    sizeof(struct bcm_dma_cb),
    +	    BUS_DMA_ALLOCNOW, NULL, NULL,
    +	    &sc->sc_dma_tag);
    +
    +	if (err) {
    +		device_printf(dev, "failed allocate DMA tag");
    +		return (err);
    +	}
    +
    +	/* setup initial settings */
    +	for (i = 0; i < BCM_DMA_CH_MAX; i++) {
    +		ch = &sc->sc_dma_ch[i];
    +
    +		err = bus_dmamem_alloc(sc->sc_dma_tag, &cb_virt,
    +		    BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO,
    +		    &ch->dma_map);
    +		if (err) {
    +			device_printf(dev, "cannot allocate DMA memory\n");
    +			break;
    +		}
    +
    +		/* 
    +		 * Least alignment for busdma-allocated stuff is cache 
    +		 * line size, so just make sure nothing stupid happend
    +		 * and we got properly aligned address
    +		 */
    +		if ((uintptr_t)cb_virt & 0x1f) {
    +			device_printf(dev,
    +			    "DMA address is not 32-bytes aligned: %p\n",
    +			    (void*)cb_virt);
    +			break;
    +		}
    +
    +		err = bus_dmamap_load(sc->sc_dma_tag, ch->dma_map, cb_virt,
    +		    sizeof(struct bcm_dma_cb), bcm_dmamap_cb, &cb_phys,
    +		    BUS_DMA_WAITOK);
    +		if (err) {
    +			device_printf(dev, "cannot load DMA memory\n");
    +			break;
    +		}
    +
    +		bzero(ch, sizeof(struct bcm_dma_ch));
    +		ch->ch = i;
    +		ch->cb = cb_virt;
    +		ch->vc_cb = cb_phys;
    +		ch->intr_func = NULL;
    +		ch->intr_arg = NULL;
    +		ch->flags = BCM_DMA_CH_UNMAP;
    +
    +		ch->cb->info = INFO_WAIT_RESP;
    +
    +		/* reset DMA engine */
    +		bcm_dma_reset(dev, i);
    +	}
    +
    +	/* now use DMA2/DMA3 only */
    +	sc->sc_dma_ch[2].flags = BCM_DMA_CH_FREE;
    +	sc->sc_dma_ch[3].flags = BCM_DMA_CH_FREE;
    +
    +	/* enable DMAs */
    +	mask = 0;
    +
    +	for (i = 0; i < BCM_DMA_CH_MAX; i++)
    +		if (sc->sc_dma_ch[i].flags & BCM_DMA_CH_FREE)
    +			mask |= (1 << i);
    +
    +	bus_write_4(sc->sc_mem, BCM_DMA_ENABLE, mask);
    +
    +	return (0);
    +}
    +
    +/*
    + * Allocate DMA channel for further use, returns channel # or
    + *     BCM_DMA_CH_INVALID
    + */
    +int
    +bcm_dma_allocate(int req_ch)
    +{
    +	struct bcm_dma_softc *sc = bcm_dma_sc;
    +	int ch = BCM_DMA_CH_INVALID;
    +	int i;
    +
    +	if (req_ch >= BCM_DMA_CH_MAX)
    +		return (BCM_DMA_CH_INVALID);
    +
    +	/* Auto(req_ch < 0) or CH specified */
    +	mtx_lock(&sc->sc_mtx);
    +
    +	if (req_ch < 0) {
    +		for (i = 0; i < BCM_DMA_CH_MAX; i++) {
    +			if (sc->sc_dma_ch[i].flags & BCM_DMA_CH_FREE) {
    +				ch = i;
    +				sc->sc_dma_ch[ch].flags &= ~BCM_DMA_CH_FREE;
    +				sc->sc_dma_ch[ch].flags |= BCM_DMA_CH_USED;
    +				break;
    +			}
    +		}
    +	}
    +	else {
    +		if (sc->sc_dma_ch[req_ch].flags & BCM_DMA_CH_FREE) {
    +			ch = req_ch;
    +			sc->sc_dma_ch[ch].flags &= ~BCM_DMA_CH_FREE;
    +			sc->sc_dma_ch[ch].flags |= BCM_DMA_CH_USED;
    +		}
    +	}
    +
    +	mtx_unlock(&sc->sc_mtx);
    +	return (ch);
    +}
    +
    +/*
    + * Frees allocated channel. Returns 0 on success, -1 otherwise
    + */
    +int
    +bcm_dma_free(int ch)
    +{
    +	struct bcm_dma_softc *sc = bcm_dma_sc;
    +
    +	if (ch < 0 || ch >= BCM_DMA_CH_MAX)
    +		return (-1);
    +
    +	mtx_lock(&sc->sc_mtx);
    +	if (sc->sc_dma_ch[ch].flags & BCM_DMA_CH_USED) {
    +		sc->sc_dma_ch[ch].flags |= BCM_DMA_CH_FREE;
    +		sc->sc_dma_ch[ch].flags &= ~BCM_DMA_CH_USED;
    +		sc->sc_dma_ch[ch].intr_func = NULL;
    +		sc->sc_dma_ch[ch].intr_arg = NULL;
    +
    +		/* reset DMA engine */
    +		bcm_dma_reset(sc->sc_dev, ch);
    +	}
    +
    +	mtx_unlock(&sc->sc_mtx);
    +	return (0);
    +}
    +
    +/*
    + * Assign handler function for channel interrupt
    + * Returns 0 on success, -1 otherwise
    + */
    +int
    +bcm_dma_setup_intr(int ch, void (*func)(int, void *), void *arg)
    +{
    +	struct bcm_dma_softc *sc = bcm_dma_sc;
    +	struct bcm_dma_cb *cb;
    +
    +	if (ch < 0 || ch >= BCM_DMA_CH_MAX)
    +		return (-1);
    +
    +	if (!(sc->sc_dma_ch[ch].flags & BCM_DMA_CH_USED))
    +		return (-1);
    +
    +	sc->sc_dma_ch[ch].intr_func = func;
    +	sc->sc_dma_ch[ch].intr_arg = arg;
    +	cb = sc->sc_dma_ch[ch].cb;
    +	cb->info |= INFO_INT_EN;
    +
    +	return (0);
    +}
    +
    +/*
    + * Setup DMA source parameters
    + *     ch - channel number
    + *     dreq - hardware DREQ # or BCM_DMA_DREQ_NONE if
    + *         source is physical memory
    + *     inc_addr - BCM_DMA_INC_ADDR if source address
    + *         should be increased after each access or 
    + *         BCM_DMA_SAME_ADDR if address should remain 
    + *         the same
    + *     width - size of read operation, BCM_DMA_32BIT
    + *         for 32bit bursts, BCM_DMA_128BIT for 128 bits
    + *	  
    + * Returns 0 on success, -1 otherwise
    + */
    +int
    +bcm_dma_setup_src(int ch, int dreq, int inc_addr, int width)
    +{
    +	struct bcm_dma_softc *sc = bcm_dma_sc;
    +	uint32_t info;
    +
    +	if (ch < 0 || ch >= BCM_DMA_CH_MAX)
    +		return (-1);
    +
    +	if (!(sc->sc_dma_ch[ch].flags & BCM_DMA_CH_USED))
    +		return (-1);
    +
    +	info = sc->sc_dma_ch[ch].cb->info;
    +	info &= ~INFO_PERMAP_MASK;
    +	info |= (dreq << INFO_PERMAP_SHIFT) & INFO_PERMAP_MASK;
    +
    +	if (dreq)
    +		info |= INFO_S_DREQ;
    +	else
    +		info &= ~INFO_S_DREQ;
    +
    +	if (width == BCM_DMA_128BIT)
    +		info |= INFO_S_WIDTH;
    +	else
    +		info &= ~INFO_S_WIDTH;
    +
    +	if (inc_addr == BCM_DMA_INC_ADDR)
    +		info |= INFO_S_INC;
    +	else
    +		info &= ~INFO_S_INC;
    +
    +	sc->sc_dma_ch[ch].cb->info = info;
    +
    +	return (0);
    +}
    +
    +/*
    + * Setup DMA destination parameters
    + *     ch - channel number
    + *     dreq - hardware DREQ # or BCM_DMA_DREQ_NONE if
    + *         destination is physical memory
    + *     inc_addr - BCM_DMA_INC_ADDR if source address
    + *         should be increased after each access or 
    + *         BCM_DMA_SAME_ADDR if address should remain 
    + *         the same
    + *     width - size of write operation, BCM_DMA_32BIT
    + *         for 32bit bursts, BCM_DMA_128BIT for 128 bits
    + *	  
    + * Returns 0 on success, -1 otherwise
    + */
    +int
    +bcm_dma_setup_dst(int ch, int dreq, int inc_addr, int width)
    +{
    +	struct bcm_dma_softc *sc = bcm_dma_sc;
    +	uint32_t info;
    +
    +	if (ch < 0 || ch >= BCM_DMA_CH_MAX)
    +		return (-1);
    +
    +	if (!(sc->sc_dma_ch[ch].flags & BCM_DMA_CH_USED))
    +		return (-1);
    +
    +	info = sc->sc_dma_ch[ch].cb->info;
    +	info &= ~INFO_PERMAP_MASK;
    +	info |= (dreq << INFO_PERMAP_SHIFT) & INFO_PERMAP_MASK;
    +
    +	if (dreq)
    +		info |= INFO_D_DREQ;
    +	else
    +		info &= ~INFO_D_DREQ;
    +
    +	if (width == BCM_DMA_128BIT)
    +		info |= INFO_D_WIDTH;
    +	else
    +		info &= ~INFO_D_WIDTH;
    +
    +	if (inc_addr == BCM_DMA_INC_ADDR)
    +		info |= INFO_D_INC;
    +	else
    +		info &= ~INFO_D_INC;
    +
    +	sc->sc_dma_ch[ch].cb->info = info;
    +
    +	return (0);
    +}
    +
    +#ifdef DEBUG
    +void
    +bcm_dma_cb_dump(struct bcm_dma_cb *cb)
    +{
    +
    +	printf("DMA CB ");
    +	printf("INFO: %8.8x ", cb->info);
    +	printf("SRC: %8.8x ", cb->src);
    +	printf("DST: %8.8x ", cb->dst);
    +	printf("LEN: %8.8x ", cb->len);
    +	printf("\n");
    +	printf("STRIDE: %8.8x ", cb->stride);
    +	printf("NEXT: %8.8x ", cb->next);
    +	printf("RSVD1: %8.8x ", cb->rsvd1);
    +	printf("RSVD2: %8.8x ", cb->rsvd2);
    +	printf("\n");
    +}
    +
    +void
    +bcm_dma_reg_dump(int ch)
    +{
    +	struct bcm_dma_softc *sc = bcm_dma_sc;
    +	int i;
    +	uint32_t reg;
    +
    +	if (ch < 0 || ch >= BCM_DMA_CH_MAX)
    +		return;
    +
    +	printf("DMA%d: ", ch);
    +	for (i = 0; i < MAX_REG; i++) {
    +		reg = bus_read_4(sc->sc_mem, BCM_DMA_CH(ch) + i*4);
    +		printf("%8.8x ", reg);
    +	}
    +	printf("\n");
    +}
    +#endif
    +
    +/*
    + * Start DMA transaction
    + *     ch - channel number
    + *     src, dst - source and destination address in
    + *         ARM physical memory address space. 
    + *     len - amount of bytes to be transfered
    + *	  
    + * Returns 0 on success, -1 otherwise
    + */
    +int
    +bcm_dma_start(int ch, vm_paddr_t src, vm_paddr_t dst, int len)
    +{
    +	struct bcm_dma_softc *sc = bcm_dma_sc;
    +	struct bcm_dma_cb *cb;
    +
    +	if (ch < 0 || ch >= BCM_DMA_CH_MAX)
    +		return (-1);
    +
    +	if (!(sc->sc_dma_ch[ch].flags & BCM_DMA_CH_USED))
    +		return (-1);
    +
    +	cb = sc->sc_dma_ch[ch].cb;
    +	if (BCM2835_ARM_IS_IO(src))
    +		cb->src = IO_TO_VCBUS(src);
    +	else
    +		cb->src = PHYS_TO_VCBUS(src);
    +	if (BCM2835_ARM_IS_IO(dst))
    +		cb->dst = IO_TO_VCBUS(dst);
    +	else
    +		cb->dst = PHYS_TO_VCBUS(dst);
    +	cb->len = len;
    +
    +	bus_dmamap_sync(sc->sc_dma_tag,
    +	    sc->sc_dma_ch[ch].dma_map, BUS_DMASYNC_PREWRITE);
    +
    +	bus_write_4(sc->sc_mem, BCM_DMA_CBADDR(ch),
    +	    sc->sc_dma_ch[ch].vc_cb);
    +	bus_write_4(sc->sc_mem, BCM_DMA_CS(ch), CS_ACTIVE);
    +
    +#ifdef DEBUG
    +	bcm_dma_cb_dump(sc->sc_dma_ch[ch].cb);
    +	bcm_dma_reg_dump(ch);
    +#endif
    +
    +	return (0);
    +}
    +
    +/*
    + * Get length requested for DMA transaction
    + *     ch - channel number
    + *	  
    + * Returns size of transaction, 0 if channel is invalid
    + */
    +uint32_t
    +bcm_dma_length(int ch)
    +{
    +	struct bcm_dma_softc *sc = bcm_dma_sc;
    +	struct bcm_dma_cb *cb;
    +
    +	if (ch < 0 || ch >= BCM_DMA_CH_MAX)
    +		return (0);
    +
    +	if (!(sc->sc_dma_ch[ch].flags & BCM_DMA_CH_USED))
    +		return (0);
    +
    +	cb = sc->sc_dma_ch[ch].cb;
    +
    +	return (cb->len);
    +}
    +
    +static void
    +bcm_dma_intr(void *arg)
    +{
    +	struct bcm_dma_softc *sc = bcm_dma_sc;
    +	struct bcm_dma_ch *ch = (struct bcm_dma_ch *)arg;
    +	uint32_t cs, debug;
    +
    +	/* my interrupt? */
    +	cs = bus_read_4(sc->sc_mem, BCM_DMA_CS(ch->ch));
    +
    +	if (!(cs & (CS_INT | CS_ERR)))
    +		return;
    +
    +	/* running? */
    +	if (!(ch->flags & BCM_DMA_CH_USED)) {
    +		device_printf(sc->sc_dev,
    +		    "unused DMA intr CH=%d, CS=%x\n", ch->ch, cs);
    +		return;
    +	}
    +
    +	if (cs & CS_ERR) {
    +		debug = bus_read_4(sc->sc_mem, BCM_DMA_DEBUG(ch->ch));
    +		device_printf(sc->sc_dev, "DMA error %d on CH%d\n",
    +			debug & DEBUG_ERROR_MASK, ch->ch);
    +		bus_write_4(sc->sc_mem, BCM_DMA_DEBUG(ch->ch), 
    +		    debug & DEBUG_ERROR_MASK);
    +	}
    +
    +	if (cs & CS_INT) {
    +		/* acknowledge interrupt */
    +		bus_write_4(sc->sc_mem, BCM_DMA_CS(ch->ch), 
    +		    CS_INT | CS_END);
    +
    +		/* Prepare for possible access to len field */
    +		bus_dmamap_sync(sc->sc_dma_tag, ch->dma_map,
    +		    BUS_DMASYNC_POSTWRITE);
    +
    +		/* save callback function and argument */
    +		if (ch->intr_func)
    +			ch->intr_func(ch->ch, ch->intr_arg);
    +	}
    +}
    +
    +static int
    +bcm_dma_probe(device_t dev)
    +{
    +
    +	if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-dma"))
    +		return (ENXIO);
    +
    +	device_set_desc(dev, "BCM2835 DMA Controller");
    +	return (BUS_PROBE_DEFAULT);
    +}
    +
    +static int
    +bcm_dma_attach(device_t dev)
    +{
    +	struct bcm_dma_softc *sc = device_get_softc(dev);
    +	int rid, err = 0;
    +	int i;
    +
    +	sc->sc_dev = dev;
    +
    +	if (bcm_dma_sc)
    +		return (ENXIO);
    +
    +	for (i = 0; i < BCM_DMA_CH_MAX; i++) {
    +		sc->sc_irq[i] = NULL;
    +		sc->sc_intrhand[i] = NULL;
    +	}
    +
    +	/* DMA0 - DMA14 */
    +	rid = 0;
    +	sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
    +	if (sc->sc_mem == NULL) {
    +		device_printf(dev, "could not allocate memory resource\n");
    +		return (ENXIO);
    +	}
    +
    +	/* IRQ DMA0 - DMA11 XXX NOT USE DMA12(spurious?) */
    +	for (rid = 0; rid < BCM_DMA_CH_MAX; rid++) {
    +		sc->sc_irq[rid] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
    +						       RF_ACTIVE);
    +		if (sc->sc_irq[rid] == NULL) {
    +			device_printf(dev, "cannot allocate interrupt\n");
    +			err = ENXIO;
    +			goto fail;
    +		}
    +		if (bus_setup_intr(dev, sc->sc_irq[rid], INTR_TYPE_MISC | INTR_MPSAFE,
    +				   NULL, bcm_dma_intr, &sc->sc_dma_ch[rid],
    +				   &sc->sc_intrhand[rid])) {
    +			device_printf(dev, "cannot setup interrupt handler\n");
    +			err = ENXIO;
    +			goto fail;
    +		}
    +	}
    +
    +	mtx_init(&sc->sc_mtx, "bcmdma", "bcmdma", MTX_DEF);
    +	bcm_dma_sc = sc;
    +
    +	err = bcm_dma_init(dev);
    +	if (err)
    +		goto fail;
    +
    +	return (err);
    +
    +fail:
    +	if (sc->sc_mem)
    +		bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem);
    +
    +	for (i = 0; i < BCM_DMA_CH_MAX; i++) {
    +		if (sc->sc_intrhand[i])
    +			bus_teardown_intr(dev, sc->sc_irq[i], sc->sc_intrhand[i]);
    +		if (sc->sc_irq[i])
    +			bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq[i]);
    +	}
    +
    +	return (err);
    +}
    +
    +static device_method_t bcm_dma_methods[] = {
    +	DEVMETHOD(device_probe,		bcm_dma_probe),
    +	DEVMETHOD(device_attach,	bcm_dma_attach),
    +	{ 0, 0 }
    +};
    +
    +static driver_t bcm_dma_driver = {
    +	"bcm_dma",
    +	bcm_dma_methods,
    +	sizeof(struct bcm_dma_softc),
    +};
    +
    +static devclass_t bcm_dma_devclass;
    +
    +DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, bcm_dma_devclass, 0, 0);
    +MODULE_VERSION(bcm_dma, 1);
    
    Added: head/sys/arm/broadcom/bcm2835/bcm2835_dma.h
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/sys/arm/broadcom/bcm2835/bcm2835_dma.h	Thu Feb 28 19:48:19 2013	(r247496)
    @@ -0,0 +1,62 @@
    +/*
    + * Copyright (c) 2013 Daisuke Aoyama 
    + * Copyright (c) 2013 Oleksandr Tymoshenko 
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in the
    + *    documentation and/or other materials provided with the distribution.
    + *
    + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
    + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
    + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + *
    + * $FreeBSD$
    + */
    +
    +#ifndef	_BCM2835_DMA_H_
    +#define	_BCM2835_DMA_H_
    +
    +#define	BCM_DMA_BLOCK_SIZE	512
    +
    +/* DMA0-DMA15 but DMA15 is special */
    +#define	BCM_DMA_CH_MAX		12
    +
    +/* request CH for any nubmer */
    +#define	BCM_DMA_CH_INVALID	(-1)
    +#define	BCM_DMA_CH_ANY		(-1)
    +#define	BCM_DMA_CH_FAST1	(2)
    +#define	BCM_DMA_CH_FAST2	(3)
    +
    +/* Peripheral DREQ Signals (4.2.1.3) */
    +#define	BCM_DMA_DREQ_NONE	0
    +#define	BCM_DMA_DREQ_EMMC	11
    +#define	BCM_DMA_DREQ_SDHOST	13
    +
    +#define	BCM_DMA_SAME_ADDR	0
    +#define	BCM_DMA_INC_ADDR	1
    +
    +#define	BCM_DMA_32BIT		0
    +#define	BCM_DMA_128BIT		1
    +
    +int bcm_dma_allocate(int req_ch);
    +int bcm_dma_free(int ch);
    +int bcm_dma_setup_intr(int ch, void (*func)(int, void *), void *arg);
    +int bcm_dma_setup_src(int ch, int dreq, int inc_addr, int width);
    +int bcm_dma_setup_dst(int ch, int dreq, int inc_addr, int width);
    +int bcm_dma_start(int ch, vm_paddr_t src, vm_paddr_t dst, int len);
    +uint32_t bcm_dma_length(int ch);
    +
    +#endif	/* _BCM2835_DMA_H_ */
    
    Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835
    ==============================================================================
    --- head/sys/arm/broadcom/bcm2835/files.bcm2835	Thu Feb 28 19:43:14 2013	(r247495)
    +++ head/sys/arm/broadcom/bcm2835/files.bcm2835	Thu Feb 28 19:48:19 2013	(r247496)
    @@ -1,5 +1,6 @@
     # $FreeBSD$
     
    +arm/broadcom/bcm2835/bcm2835_dma.c		standard
     arm/broadcom/bcm2835/bcm2835_fb.c		optional sc
     arm/broadcom/bcm2835/bcm2835_gpio.c		optional gpio
     arm/broadcom/bcm2835/bcm2835_intr.c		standard
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 19:51:31 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 69531BC7;
     Thu, 28 Feb 2013 19:51:31 +0000 (UTC)
     (envelope-from gonzo@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 4C400EC4;
     Thu, 28 Feb 2013 19:51:31 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SJpVg0026152;
     Thu, 28 Feb 2013 19:51:31 GMT (envelope-from gonzo@svn.freebsd.org)
    Received: (from gonzo@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SJpVc6026151;
     Thu, 28 Feb 2013 19:51:31 GMT (envelope-from gonzo@svn.freebsd.org)
    Message-Id: <201302281951.r1SJpVc6026151@svn.freebsd.org>
    From: Oleksandr Tymoshenko 
    Date: Thu, 28 Feb 2013 19:51:31 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247497 - head/sys/arm/broadcom/bcm2835
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 19:51:31 -0000
    
    Author: gonzo
    Date: Thu Feb 28 19:51:30 2013
    New Revision: 247497
    URL: http://svnweb.freebsd.org/changeset/base/247497
    
    Log:
      Add platform DMA support to SDHCI driver for BCM2835
      
      Submitted by:	Daisuke Aoyama 
      Reviewed by:	ian@
    
    Modified:
      head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
    
    Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
    ==============================================================================
    --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c	Thu Feb 28 19:48:19 2013	(r247496)
    +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c	Thu Feb 28 19:51:30 2013	(r247497)
    @@ -67,8 +67,13 @@ __FBSDID("$FreeBSD$");
     #include 
     #include "sdhci_if.h"
     
    +#include "bcm2835_dma.h"
    +#include "bcm2835_vcbus.h"
    +
     #define	BCM2835_DEFAULT_SDHCI_FREQ	50
     
    +#define	BCM_SDHCI_BUFFER_SIZE		512
    +
     #define	DEBUG
     
     #ifdef DEBUG
    @@ -85,9 +90,11 @@ __FBSDID("$FreeBSD$");
      */
     static int bcm2835_sdhci_min_freq = 400000;
     static int bcm2835_sdhci_hs = 1;
    +static int bcm2835_sdhci_pio_mode = 0;
     
     TUNABLE_INT("hw.bcm2835.sdhci.min_freq", &bcm2835_sdhci_min_freq);
     TUNABLE_INT("hw.bcm2835.sdhci.hs", &bcm2835_sdhci_hs);
    +TUNABLE_INT("hw.bcm2835.sdhci.pio_mode", &bcm2835_sdhci_pio_mode);
     
     struct bcm_sdhci_dmamap_arg {
     	bus_addr_t		sc_dma_busaddr;
    @@ -111,23 +118,41 @@ struct bcm_sdhci_softc {
     	int			sc_xfer_done;
     	int			sc_bus_busy;
     	struct sdhci_slot	sc_slot;
    +	int			sc_dma_inuse;
    +	int			sc_dma_ch;
    +	bus_dma_tag_t		sc_dma_tag;
    +	bus_dmamap_t		sc_dma_map;
    +	void			*sc_dma_buffer;
    +	vm_paddr_t		sc_dma_buffer_phys;
    +	vm_paddr_t		sc_sdhci_buffer_phys;;
     };
     
    -#define	SD_MAX_BLOCKSIZE	1024
    -/* XXX */
    -
     static int bcm_sdhci_probe(device_t);
     static int bcm_sdhci_attach(device_t);
     static int bcm_sdhci_detach(device_t);
     static void bcm_sdhci_intr(void *);
     
     static int bcm_sdhci_get_ro(device_t, device_t);
    +static void bcm_sdhci_dma_intr(int ch, void *arg);
     
     #define	bcm_sdhci_lock(_sc)						\
         mtx_lock(&_sc->sc_mtx);
     #define	bcm_sdhci_unlock(_sc)						\
         mtx_unlock(&_sc->sc_mtx);
     
    +static void
    +bcm_dmamap_cb(void *arg, bus_dma_segment_t *segs,
    +	int nseg, int err)
    +{
    +        bus_addr_t *addr;
    +
    +        if (err)
    +                return;
    +
    +        addr = (bus_addr_t*)arg;
    +        *addr = segs[0].ds_addr;
    +}
    +
     static int
     bcm_sdhci_probe(device_t dev)
     {
    @@ -146,9 +171,13 @@ bcm_sdhci_attach(device_t dev)
     	phandle_t node;
     	pcell_t cell;
     	int default_freq;
    +	void *buffer;
    +	vm_paddr_t buffer_phys;
    +	void *va;
     
     	sc->sc_dev = dev;
     	sc->sc_req = NULL;
    +	err = 0;
     
     	default_freq = BCM2835_DEFAULT_SDHCI_FREQ;
     	node = ofw_bus_get_node(sc->sc_dev);
    @@ -191,6 +220,9 @@ bcm_sdhci_attach(device_t dev)
     		goto fail;
     	}
     
    +	if (!bcm2835_sdhci_pio_mode)
    +		sc->sc_slot.opt = SDHCI_PLATFORM_TRANSFER;
    +
     	sc->sc_slot.caps = SDHCI_CAN_VDD_330 | SDHCI_CAN_VDD_180;
     	if (bcm2835_sdhci_hs)
     		sc->sc_slot.caps |= SDHCI_CAN_DO_HISPD;
    @@ -201,6 +233,61 @@ bcm_sdhci_attach(device_t dev)
      
     	sdhci_init_slot(dev, &sc->sc_slot, 0);
     
    +	sc->sc_dma_ch = bcm_dma_allocate(BCM_DMA_CH_FAST1);
    +	if (sc->sc_dma_ch == BCM_DMA_CH_INVALID)
    +		sc->sc_dma_ch = bcm_dma_allocate(BCM_DMA_CH_FAST2);
    +	if (sc->sc_dma_ch == BCM_DMA_CH_INVALID)
    +		sc->sc_dma_ch = bcm_dma_allocate(BCM_DMA_CH_ANY);
    +	if (sc->sc_dma_ch == BCM_DMA_CH_INVALID)
    +		goto fail;
    +
    +	bcm_dma_setup_intr(sc->sc_dma_ch, bcm_sdhci_dma_intr, sc);
    +
    +	/* Allocate DMA buffers */
    +	err = bus_dma_tag_create(bus_get_dma_tag(dev),
    +	    1, 0, BUS_SPACE_MAXADDR_32BIT,
    +	    BUS_SPACE_MAXADDR, NULL, NULL,
    +	    BCM_SDHCI_BUFFER_SIZE, 1, BCM_SDHCI_BUFFER_SIZE,
    +	    BUS_DMA_ALLOCNOW, NULL, NULL,
    +	    &sc->sc_dma_tag);
    +
    +	if (err) {
    +		device_printf(dev, "failed allocate DMA tag");
    +		goto fail;
    +	}
    +
    +	err = bus_dmamem_alloc(sc->sc_dma_tag, &buffer,
    +	    BUS_DMA_WAITOK | BUS_DMA_COHERENT| BUS_DMA_ZERO,
    +	    &sc->sc_dma_map);
    +
    +	if (err) {
    +		device_printf(dev, "cannot allocate DMA memory\n");
    +		goto fail;
    +	}
    +
    +	err = bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, buffer,
    +	    BCM_SDHCI_BUFFER_SIZE, bcm_dmamap_cb, &buffer_phys,
    +	    BUS_DMA_WAITOK);
    +	if (err) {
    +		device_printf(dev, "cannot load DMA memory\n");
    +		goto fail;
    +	}
    +
    +	/* 
    +	 * Sanity check: two least bits of address should be zero
    +	 */
    +	if ((uintptr_t)buffer & 3) {
    +		device_printf(dev,
    +		    "DMA address is not word-aligned\n");
    +		goto fail;
    +	}
    +
    +	sc->sc_dma_buffer = buffer;
    +	sc->sc_dma_buffer_phys = buffer_phys;
    +	va = (void*)rman_get_start(sc->sc_mem_res);
    +	sc->sc_sdhci_buffer_phys =
    +	    pmap_kextract((vm_offset_t)va) + SDHCI_BUFFER;
    +
     	bus_generic_probe(dev);
     	bus_generic_attach(dev);
     
    @@ -354,6 +441,211 @@ bcm_sdhci_min_freq(device_t dev, struct 
     	return bcm2835_sdhci_min_freq;
     }
     
    +static void
    +bcm_sdhci_dma_intr(int ch, void *arg)
    +{
    +	struct bcm_sdhci_softc *sc = (struct bcm_sdhci_softc *)arg;
    +	struct sdhci_slot *slot = &sc->sc_slot;
    +	uint32_t reg, mask;
    +	void *buffer;
    +	size_t len;
    +	int left;
    +
    +	mtx_lock(&slot->mtx);
    +
    +	/* copy DMA buffer to VA if READ */
    +	len = bcm_dma_length(sc->sc_dma_ch);
    +	if (slot->curcmd->data->flags & MMC_DATA_READ) {
    +		bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
    +		    BUS_DMASYNC_POSTREAD);
    +
    +		mask = SDHCI_INT_DATA_AVAIL;
    +		/* all dma data in single or contiguous page */
    +		buffer = (uint8_t*)(slot->curcmd->data->data) + slot->offset;
    +		memcpy(buffer, sc->sc_dma_buffer, len);
    +	} else {
    +		bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
    +		    BUS_DMASYNC_POSTWRITE);
    +		mask = SDHCI_INT_SPACE_AVAIL;
    +	}
    +
    +	slot->offset += len;
    +	sc->sc_dma_inuse = 0;
    +
    +	left = min(BCM_SDHCI_BUFFER_SIZE,
    +	    slot->curcmd->data->len - slot->offset);
    +
    +	/* DATA END? */
    +	reg = bcm_sdhci_read_4(slot->bus, slot, SDHCI_INT_STATUS);
    +
    +	if (reg & SDHCI_INT_DATA_END) {
    +		/* ACK for all outstanding interrupts */
    +		bcm_sdhci_write_4(slot->bus, slot, SDHCI_INT_STATUS, reg);
    +
    +		/* enable INT */
    +		slot->intmask |= SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL
    +		    | SDHCI_INT_DATA_END;
    +		bcm_sdhci_write_4(slot->bus, slot, SDHCI_SIGNAL_ENABLE,
    +		    slot->intmask);
    +
    +		/* finish this data */
    +		sdhci_finish_data(slot);
    +	} 
    +	else {
    +		/* already available? */
    +		if (reg & mask) {
    +			sc->sc_dma_inuse = 1;
    +
    +			/* ACK for DATA_AVAIL or SPACE_AVAIL */
    +			bcm_sdhci_write_4(slot->bus, slot,
    +			    SDHCI_INT_STATUS, mask);
    +
    +			/* continue next DMA transfer */
    +			if (slot->curcmd->data->flags & MMC_DATA_READ) {
    +				bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
    +				    BUS_DMASYNC_PREREAD);
    +
    +				/* DMA start */
    +				if (bcm_dma_start(sc->sc_dma_ch,
    +				    sc->sc_sdhci_buffer_phys,
    +				    sc->sc_dma_buffer_phys, left) != 0)
    +					device_printf(sc->sc_dev, "failed DMA start\n");
    +			} else {
    +				buffer = (char*)slot->curcmd->data->data + slot->offset;
    +				memcpy(sc->sc_dma_buffer, buffer, left);
    +
    +				bus_dmamap_sync(sc->sc_dma_tag,
    +				    sc->sc_dma_map, BUS_DMASYNC_PREWRITE);
    +
    +				/* DMA start */
    +				if (bcm_dma_start(sc->sc_dma_ch, 
    +				    sc->sc_dma_buffer_phys,
    +				    sc->sc_sdhci_buffer_phys, left) != 0)
    +					device_printf(sc->sc_dev, "failed DMA start\n");
    +			}
    +		} else {
    +			/* wait for next data by INT */
    +
    +			/* enable INT */
    +			slot->intmask |= SDHCI_INT_DATA_AVAIL |
    +			    SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DATA_END;
    +			bcm_sdhci_write_4(slot->bus, slot, SDHCI_SIGNAL_ENABLE,
    +			    slot->intmask);
    +		}
    +	}
    +
    +	mtx_unlock(&slot->mtx);
    +}
    +
    +static void
    +bcm_sdhci_read_dma(struct sdhci_slot *slot)
    +{
    +	struct bcm_sdhci_softc *sc = device_get_softc(slot->bus);
    +	size_t left;
    +
    +	if (sc->sc_dma_inuse) {
    +		device_printf(sc->sc_dev, "DMA in use\n");
    +		return;
    +	}
    +
    +	sc->sc_dma_inuse = 1;
    +
    +	left = min(BCM_SDHCI_BUFFER_SIZE,
    +	    slot->curcmd->data->len - slot->offset);
    +
    +	KASSERT((left & 3) == 0,
    +	    ("%s: len = %d, not word-aligned", __func__, left));
    +
    +	bcm_dma_setup_src(sc->sc_dma_ch, BCM_DMA_DREQ_EMMC,
    +	    BCM_DMA_SAME_ADDR, BCM_DMA_32BIT); 
    +	bcm_dma_setup_dst(sc->sc_dma_ch, BCM_DMA_DREQ_NONE,
    +	    BCM_DMA_INC_ADDR,
    +	    (left & 0xf) ? BCM_DMA_32BIT : BCM_DMA_128BIT);
    +
    +	bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
    +	    BUS_DMASYNC_PREREAD);
    +
    +	/* DMA start */
    +	if (bcm_dma_start(sc->sc_dma_ch, sc->sc_sdhci_buffer_phys,
    +	    sc->sc_dma_buffer_phys, left) != 0)
    +		device_printf(sc->sc_dev, "failed DMA start\n");
    +}
    +
    +static void
    +bcm_sdhci_write_dma(struct sdhci_slot *slot)
    +{
    +	struct bcm_sdhci_softc *sc = device_get_softc(slot->bus);
    +	char *buffer;
    +	size_t left;
    +
    +	if (sc->sc_dma_inuse) {
    +		device_printf(sc->sc_dev, "DMA in use\n");
    +		return;
    +	}
    +
    +	sc->sc_dma_inuse = 1;
    +
    +	left = min(BCM_SDHCI_BUFFER_SIZE,
    +	    slot->curcmd->data->len - slot->offset);
    +
    +	KASSERT((left & 3) == 0,
    +	    ("%s: len = %d, not word-aligned", __func__, left));
    +
    +	buffer = (char*)slot->curcmd->data->data + slot->offset;
    +	memcpy(sc->sc_dma_buffer, buffer, left);
    +
    +	bcm_dma_setup_src(sc->sc_dma_ch, BCM_DMA_DREQ_NONE,
    +	    BCM_DMA_INC_ADDR,
    +	    (left & 0xf) ? BCM_DMA_32BIT : BCM_DMA_128BIT);
    +	bcm_dma_setup_dst(sc->sc_dma_ch, BCM_DMA_DREQ_EMMC,
    +	    BCM_DMA_SAME_ADDR, BCM_DMA_32BIT);
    +
    +	bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
    +	    BUS_DMASYNC_PREWRITE);
    +
    +	/* DMA start */
    +	if (bcm_dma_start(sc->sc_dma_ch, sc->sc_dma_buffer_phys,
    +	    sc->sc_sdhci_buffer_phys, left) != 0)
    +		device_printf(sc->sc_dev, "failed DMA start\n");
    +}
    +
    +static int
    +bcm_sdhci_will_handle_transfer(device_t dev, struct sdhci_slot *slot)
    +{
    +	size_t left;
    +
    +	/* Do not use DMA for transfers less then block size */
    +	left = min(BCM_DMA_BLOCK_SIZE,
    +	    slot->curcmd->data->len - slot->offset);
    +	if (left < BCM_DMA_BLOCK_SIZE)
    +		return (0);
    +
    +	return (1);
    +}
    +
    +static void
    +bcm_sdhci_start_transfer(device_t dev, struct sdhci_slot *slot,
    +    uint32_t *intmask)
    +{
    +
    +	/* Disable INT */
    +	slot->intmask &= ~(SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DATA_END);
    +	bcm_sdhci_write_4(dev, slot, SDHCI_SIGNAL_ENABLE, slot->intmask);
    +
    +	/* DMA transfer FIFO 1KB */
    +	if (slot->curcmd->data->flags & MMC_DATA_READ)
    +		bcm_sdhci_read_dma(slot);
    +	else
    +		bcm_sdhci_write_dma(slot);
    +}
    +
    +static void
    +bcm_sdhci_finish_transfer(device_t dev, struct sdhci_slot *slot)
    +{
    +
    +	sdhci_finish_data(slot);
    +}
    +
     static device_method_t bcm_sdhci_methods[] = {
     	/* Device interface */
     	DEVMETHOD(device_probe,		bcm_sdhci_probe),
    @@ -372,8 +664,12 @@ static device_method_t bcm_sdhci_methods
     	DEVMETHOD(mmcbr_acquire_host,	sdhci_generic_acquire_host),
     	DEVMETHOD(mmcbr_release_host,	sdhci_generic_release_host),
     
    -	/* SDHCI registers accessors */
     	DEVMETHOD(sdhci_min_freq,	bcm_sdhci_min_freq),
    +	/* Platform transfer methods */
    +	DEVMETHOD(sdhci_platform_will_handle,		bcm_sdhci_will_handle_transfer),
    +	DEVMETHOD(sdhci_platform_start_transfer,	bcm_sdhci_start_transfer),
    +	DEVMETHOD(sdhci_platform_finish_transfer,	bcm_sdhci_finish_transfer),
    +	/* SDHCI registers accessors */
     	DEVMETHOD(sdhci_read_1,		bcm_sdhci_read_1),
     	DEVMETHOD(sdhci_read_2,		bcm_sdhci_read_2),
     	DEVMETHOD(sdhci_read_4,		bcm_sdhci_read_4),
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 20:02:33 2013
    Return-Path: 
    Delivered-To: svn-src-all@FreeBSD.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 7594EEE4;
     Thu, 28 Feb 2013 20:02:33 +0000 (UTC) (envelope-from ian@FreeBSD.org)
    Received: from mho-02-ewr.mailhop.org (mho-04-ewr.mailhop.org [204.13.248.74])
     by mx1.freebsd.org (Postfix) with ESMTP id 4D5FFF4F;
     Thu, 28 Feb 2013 20:02:33 +0000 (UTC)
    Received: from c-24-8-232-202.hsd1.co.comcast.net ([24.8.232.202]
     helo=damnhippie.dyndns.org)
     by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256)
     (Exim 4.72) (envelope-from )
     id 1UB9gW-0009iV-C9; Thu, 28 Feb 2013 20:02:32 +0000
    Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240])
     by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r1SK2Ufr085696;
     Thu, 28 Feb 2013 13:02:30 -0700 (MST) (envelope-from ian@FreeBSD.org)
    X-Mail-Handler: Dyn Standard SMTP by Dyn
    X-Originating-IP: 24.8.232.202
    X-Report-Abuse-To: abuse@dyndns.com (see
     http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse
     reporting information)
    X-MHO-User: U2FsdGVkX193HzQ61HZO7nWQBJG4J876
    Subject: Re: svn commit: r247495 - head/sys/dev/sdhci
    From: Ian Lepore 
    To: Oleksandr Tymoshenko 
    In-Reply-To: <201302281943.r1SJhEmC023261@svn.freebsd.org>
    References: <201302281943.r1SJhEmC023261@svn.freebsd.org>
    Content-Type: text/plain; charset="us-ascii"
    Date: Thu, 28 Feb 2013 13:02:30 -0700
    Message-ID: <1362081750.1195.65.camel@revolution.hippie.lan>
    Mime-Version: 1.0
    X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port 
    Content-Transfer-Encoding: 7bit
    Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
     src-committers@FreeBSD.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 20:02:33 -0000
    
    On Thu, 2013-02-28 at 19:43 +0000, Oleksandr Tymoshenko wrote:
    > Author: gonzo
    > Date: Thu Feb 28 19:43:14 2013
    > New Revision: 247495
    > URL: http://svnweb.freebsd.org/changeset/base/247495
    > 
    > Log:
    >   Add hooks for plugging platform-provided transfer backend.
    >   
    >   In order to use platorm backend hardware driver should
    >   impement three methods:
    >   - platform_start_transfer and platform_finish_transfer
    >       to start and finish transfer
    >   - platform_will_handle - check whether transaction is
    >       suitable for backend. If not - driver will fall back
    >       to PIO mode.
    >   
    >   Submitted by:	Daisuke Aoyama 
    >   Approved by:	ian@
    > 
    > Modified:
    >   head/sys/dev/sdhci/sdhci.c
    >   head/sys/dev/sdhci/sdhci.h
    >   head/sys/dev/sdhci/sdhci_if.m
    > 
    
    I think that was meant to be "Reviewed by" rather than "Approved by".  I
    do very much approve of the changes, but not in any formal
    administrative sense, I'm just happy the sdcard IO is faster. :)
    
    -- Ian
    
    
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 21:24:11 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 1F753E1A;
     Thu, 28 Feb 2013 21:24:11 +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 0CB1E2B3;
     Thu, 28 Feb 2013 21:24:11 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SLOAtC054782;
     Thu, 28 Feb 2013 21:24:10 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SLOAZ6054781;
     Thu, 28 Feb 2013 21:24:10 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302282124.r1SLOAZ6054781@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 21:24: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: r247498 - stable/9/sys/netinet
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 21:24:11 -0000
    
    Author: jhb
    Date: Thu Feb 28 21:24:10 2013
    New Revision: 247498
    URL: http://svnweb.freebsd.org/changeset/base/247498
    
    Log:
      MFC 245238:
      Add an option to not drop options from the third retransmitted SYN.  If the
      SYNs (or SYN/ACK replies) are dropped due to network congestion, then the
      remote end of the connection may act as if options such as window scaling
      are enabled but the local end will think they are not.  This can result in
      very slow data transfers in the case of window scaling disagreements.
      
      Note that the unlike HEAD the existing behavior is preserved by default,
      but it can be disabled by setting the
      net.inet.tcp.rexmit_drop_options sysctl to zero.
    
    Modified:
      stable/9/sys/netinet/tcp_timer.c
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/netinet/tcp_timer.c
    ==============================================================================
    --- stable/9/sys/netinet/tcp_timer.c	Thu Feb 28 19:51:30 2013	(r247497)
    +++ stable/9/sys/netinet/tcp_timer.c	Thu Feb 28 21:24:10 2013	(r247498)
    @@ -118,6 +118,11 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, keep
     	/* max idle probes */
     int	tcp_maxpersistidle;
     
    +static int	tcp_rexmit_drop_options = 1;
    +SYSCTL_INT(_net_inet_tcp, OID_AUTO, rexmit_drop_options, CTLFLAG_RW,
    +    &tcp_rexmit_drop_options, 0,
    +    "Drop TCP options from 3rd and later retransmitted SYN");
    +
     static int	per_cpu_timers = 0;
     SYSCTL_INT(_net_inet_tcp, OID_AUTO, per_cpu_timers, CTLFLAG_RW,
         &per_cpu_timers , 0, "run tcp timers on all cpus");
    @@ -578,7 +583,8 @@ tcp_timer_rexmt(void * xtp)
     	 * header compression code which trashes TCP segments containing
     	 * unknown-to-them TCP options.
     	 */
    -	if ((tp->t_state == TCPS_SYN_SENT) && (tp->t_rxtshift == 3))
    +	if (tcp_rexmit_drop_options && (tp->t_state == TCPS_SYN_SENT) &&
    +	    (tp->t_rxtshift == 3))
     		tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP);
     	/*
     	 * If we backed off this far, our srtt estimate is probably bogus.
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 21:24:20 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 57A0EF6D;
     Thu, 28 Feb 2013 21:24:20 +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 4ABAF2B5;
     Thu, 28 Feb 2013 21:24:20 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SLOKwk054837;
     Thu, 28 Feb 2013 21:24:20 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SLOKrV054836;
     Thu, 28 Feb 2013 21:24:20 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302282124.r1SLOKrV054836@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 21:24:20 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247499 - stable/8/sys/netinet
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 21:24:20 -0000
    
    Author: jhb
    Date: Thu Feb 28 21:24:19 2013
    New Revision: 247499
    URL: http://svnweb.freebsd.org/changeset/base/247499
    
    Log:
      MFC 245238:
      Add an option to not drop options from the third retransmitted SYN.  If the
      SYNs (or SYN/ACK replies) are dropped due to network congestion, then the
      remote end of the connection may act as if options such as window scaling
      are enabled but the local end will think they are not.  This can result in
      very slow data transfers in the case of window scaling disagreements.
      
      Note that the unlike HEAD the existing behavior is preserved by default,
      but it can be disabled by setting the
      net.inet.tcp.rexmit_drop_options sysctl to zero.
    
    Modified:
      stable/8/sys/netinet/tcp_timer.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/netinet/   (props changed)
    
    Modified: stable/8/sys/netinet/tcp_timer.c
    ==============================================================================
    --- stable/8/sys/netinet/tcp_timer.c	Thu Feb 28 21:24:10 2013	(r247498)
    +++ stable/8/sys/netinet/tcp_timer.c	Thu Feb 28 21:24:19 2013	(r247499)
    @@ -117,6 +117,11 @@ int	tcp_maxpersistidle;
     	/* max idle time in persist */
     int	tcp_maxidle;
     
    +static int	tcp_rexmit_drop_options = 1;
    +SYSCTL_INT(_net_inet_tcp, OID_AUTO, rexmit_drop_options, CTLFLAG_RW,
    +    &tcp_rexmit_drop_options, 0,
    +    "Drop TCP options from 3rd and later retransmitted SYN");
    +
     /*
      * Tcp protocol timeout routine called every 500 ms.
      * Updates timestamps used for TCP
    @@ -552,7 +557,8 @@ tcp_timer_rexmt(void * xtp)
     	 * header compression code which trashes TCP segments containing
     	 * unknown-to-them TCP options.
     	 */
    -	if ((tp->t_state == TCPS_SYN_SENT) && (tp->t_rxtshift == 3))
    +	if (tcp_rexmit_drop_options && (tp->t_state == TCPS_SYN_SENT) &&
    +	    (tp->t_rxtshift == 3))
     		tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP);
     	/*
     	 * If we backed off this far, our srtt estimate is probably bogus.
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 21:32:48 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id BEC242B7;
     Thu, 28 Feb 2013 21:32:48 +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 ABFE331E;
     Thu, 28 Feb 2013 21:32:48 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SLWm5B057727;
     Thu, 28 Feb 2013 21:32:48 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SLWlXQ057721;
     Thu, 28 Feb 2013 21:32:47 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201302282132.r1SLWlXQ057721@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Thu, 28 Feb 2013 21:32:47 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247500 - in stable/8/lib/libc: gen stdlib
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 21:32:48 -0000
    
    Author: des
    Date: Thu Feb 28 21:32:47 2013
    New Revision: 247500
    URL: http://svnweb.freebsd.org/changeset/base/247500
    
    Log:
      MFH (r240107,240111,240361): warn against using weak PRNGs
    
    Modified:
      stable/8/lib/libc/gen/rand48.3
      stable/8/lib/libc/stdlib/rand.3
      stable/8/lib/libc/stdlib/random.3
    Directory Properties:
      stable/8/lib/libc/   (props changed)
    
    Modified: stable/8/lib/libc/gen/rand48.3
    ==============================================================================
    --- stable/8/lib/libc/gen/rand48.3	Thu Feb 28 21:24:19 2013	(r247499)
    +++ stable/8/lib/libc/gen/rand48.3	Thu Feb 28 21:32:47 2013	(r247500)
    @@ -12,7 +12,7 @@
     .\"     @(#)rand48.3 V1.0 MB 8 Oct 1993
     .\" $FreeBSD$
     .\"
    -.Dd February 2, 2010
    +.Dd September 4, 2012
     .Dt RAND48 3
     .Os
     .Sh NAME
    @@ -49,6 +49,14 @@
     .Ft void
     .Fn lcong48 "unsigned short p[7]"
     .Sh DESCRIPTION
    +.Bf -symbolic
    +The functions described in this manual page are not cryptographically
    +secure.
    +Cryptographic applications should use
    +.Xr arc4random 3
    +instead.
    +.Ef
    +.Pp
     The
     .Fn rand48
     family of functions generates pseudo-random numbers using a linear
    @@ -174,10 +182,8 @@ It is thus not possible to use values gr
     Note that all three methods of seeding the random number generator
     always also set the multiplicand and addend for any of the six
     generator calls.
    -.Pp
    -For a more powerful random number generator, see
    -.Xr random 3 .
     .Sh SEE ALSO
    +.Xr arc4random 3 ,
     .Xr rand 3 ,
     .Xr random 3
     .Sh AUTHORS
    
    Modified: stable/8/lib/libc/stdlib/rand.3
    ==============================================================================
    --- stable/8/lib/libc/stdlib/rand.3	Thu Feb 28 21:24:19 2013	(r247499)
    +++ stable/8/lib/libc/stdlib/rand.3	Thu Feb 28 21:32:47 2013	(r247500)
    @@ -32,7 +32,7 @@
     .\"     @(#)rand.3	8.1 (Berkeley) 6/4/93
     .\" $FreeBSD$
     .\"
    -.Dd October 6, 2010
    +.Dd September 4, 2012
     .Dt RAND 3
     .Os
     .Sh NAME
    @@ -55,9 +55,15 @@
     .Fn rand_r "unsigned *ctx"
     .Sh DESCRIPTION
     .Bf -symbolic
    +The functions described in this manual page are not cryptographically
    +secure.
    +Cryptographic applications should use
    +.Xr arc4random 3
    +instead.
    +.Ef
    +.Pp
     These interfaces are obsoleted by
     .Xr random 3 .
    -.Ef
     .Pp
     The
     .Fn rand
    @@ -88,9 +94,6 @@ The
     function initializes a seed using the
     .Xr random 4
     random number device which returns good random numbers.
    -However, the
    -.Fn rand
    -function still remains unsuitable for cryptographic use.
     .Pp
     The
     .Fn rand_r
    @@ -105,8 +108,6 @@ For better generator quality, use
     .Xr random 3
     or
     .Xr lrand48 3 .
    -Applications requiring cryptographic quality randomness should use
    -.Xr arc4random 3 .
     .Sh SEE ALSO
     .Xr arc4random 3 ,
     .Xr lrand48 3 ,
    
    Modified: stable/8/lib/libc/stdlib/random.3
    ==============================================================================
    --- stable/8/lib/libc/stdlib/random.3	Thu Feb 28 21:24:19 2013	(r247499)
    +++ stable/8/lib/libc/stdlib/random.3	Thu Feb 28 21:32:47 2013	(r247500)
    @@ -28,7 +28,7 @@
     .\"     @(#)random.3	8.1 (Berkeley) 6/4/93
     .\" $FreeBSD$
     .\"
    -.Dd June 4, 1993
    +.Dd September 4, 2012
     .Dt RANDOM 3
     .Os
     .Sh NAME
    @@ -53,6 +53,14 @@
     .Ft char *
     .Fn setstate "char *state"
     .Sh DESCRIPTION
    +.Bf -symbolic
    +The functions described in this manual page are not cryptographically
    +secure.
    +Cryptographic applications should use
    +.Xr arc4random 3
    +instead.
    +.Ef
    +.Pp
     The
     .Fn random
     function
    @@ -98,10 +106,8 @@ as the seed.
     .Pp
     The
     .Fn srandomdev
    -routine initializes a state array using the
    -.Xr random 4
    -random number device which returns good random numbers,
    -suitable for cryptographic use.
    +routine initializes a state array using data from
    +.Xr random 4 .
     Note that this particular seeding
     procedure can generate states which are impossible to reproduce by
     calling
    @@ -175,7 +181,6 @@ messages are printed on the standard err
     .Xr arc4random 3 ,
     .Xr lrand48 3 ,
     .Xr rand 3 ,
    -.Xr srand 3 ,
     .Xr random 4
     .Sh HISTORY
     These
    @@ -191,6 +196,3 @@ The historical implementation used to ha
     random sequence did not vary much with the seed.
     The current implementation employs a better pseudo-random number
     generator for the initial state calculation.
    -.Pp
    -Applications requiring cryptographic quality randomness should use
    -.Xr arc4random 3 .
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 21:55:58 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 8270B7C3;
     Thu, 28 Feb 2013 21:55:58 +0000 (UTC) (envelope-from jfv@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 6EB9F402;
     Thu, 28 Feb 2013 21:55:58 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SLtwrF064119;
     Thu, 28 Feb 2013 21:55:58 GMT (envelope-from jfv@svn.freebsd.org)
    Received: (from jfv@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SLtwBE064117;
     Thu, 28 Feb 2013 21:55:58 GMT (envelope-from jfv@svn.freebsd.org)
    Message-Id: <201302282155.r1SLtwBE064117@svn.freebsd.org>
    From: Jack F Vogel 
    Date: Thu, 28 Feb 2013 21:55:58 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247501 - stable/8/sys/dev/ixgbe
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 21:55:58 -0000
    
    Author: jfv
    Date: Thu Feb 28 21:55:57 2013
    New Revision: 247501
    URL: http://svnweb.freebsd.org/changeset/base/247501
    
    Log:
      MFC of the ixgbe driver including revisions:
      
      217556,219902,228276,229767,229939,230572,231796,232238,
      234137,234229,235547,235964,236627,236729,238149,239940,
      240155,240366,240968,241037,241616,241646,241856,241885,
      242403,242421,243714,243716,243718,243721,243724,243725,
      243728,243729,243733,243735,243736,243741,243833,243857,
      244514,245952,246128,246482,247035,247056
    
    Modified:
      stable/8/sys/dev/ixgbe/ixgbe.c   (contents, props changed)
      stable/8/sys/dev/ixgbe/ixgbe.h
      stable/8/sys/dev/ixgbe/ixgbe_82598.c
      stable/8/sys/dev/ixgbe/ixgbe_82598.h   (contents, props changed)
      stable/8/sys/dev/ixgbe/ixgbe_82599.c
      stable/8/sys/dev/ixgbe/ixgbe_api.c
      stable/8/sys/dev/ixgbe/ixgbe_api.h
      stable/8/sys/dev/ixgbe/ixgbe_common.c
      stable/8/sys/dev/ixgbe/ixgbe_common.h
      stable/8/sys/dev/ixgbe/ixgbe_osdep.h
      stable/8/sys/dev/ixgbe/ixgbe_phy.c
      stable/8/sys/dev/ixgbe/ixgbe_type.h
      stable/8/sys/dev/ixgbe/ixgbe_vf.c
      stable/8/sys/dev/ixgbe/ixgbe_x540.c   (contents, props changed)
      stable/8/sys/dev/ixgbe/ixv.c
    Directory Properties:
      stable/8/sys/dev/ixgbe/   (props changed)
      stable/8/sys/dev/ixgbe/ixgbe_82599.h   (props changed)
      stable/8/sys/dev/ixgbe/ixgbe_x540.h   (props changed)
    
    Modified: stable/8/sys/dev/ixgbe/ixgbe.c
    ==============================================================================
    --- stable/8/sys/dev/ixgbe/ixgbe.c	Thu Feb 28 21:32:47 2013	(r247500)
    +++ stable/8/sys/dev/ixgbe/ixgbe.c	Thu Feb 28 21:55:57 2013	(r247501)
    @@ -1,6 +1,6 @@
     /******************************************************************************
     
    -  Copyright (c) 2001-2012, Intel Corporation 
    +  Copyright (c) 2001-2013, Intel Corporation 
       All rights reserved.
       
       Redistribution and use in source and binary forms, with or without 
    @@ -47,7 +47,7 @@ int             ixgbe_display_debug_stat
     /*********************************************************************
      *  Driver version
      *********************************************************************/
    -char ixgbe_driver_version[] = "2.4.5";
    +char ixgbe_driver_version[] = "2.5.0 - 8";
     
     /*********************************************************************
      *  PCI Device ID Table
    @@ -80,8 +80,10 @@ static ixgbe_vendor_info_t ixgbe_vendor_
     	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_T3_LOM, 0, 0, 0},
     	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_COMBO_BACKPLANE, 0, 0, 0},
     	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BACKPLANE_FCOE, 0, 0, 0},
    +	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF2, 0, 0, 0},
     	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, 0, 0, 0},
     	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, 0, 0, 0},
    +	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, 0, 0, 0},
     	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0},
     	/* required last entry */
     	{0, 0, 0, 0, 0}
    @@ -102,16 +104,16 @@ static int      ixgbe_probe(device_t);
     static int      ixgbe_attach(device_t);
     static int      ixgbe_detach(device_t);
     static int      ixgbe_shutdown(device_t);
    -#if __FreeBSD_version >= 800000
    +#ifdef IXGBE_LEGACY_TX
    +static void     ixgbe_start(struct ifnet *);
    +static void     ixgbe_start_locked(struct tx_ring *, struct ifnet *);
    +#else /* ! IXGBE_LEGACY_TX */
     static int	ixgbe_mq_start(struct ifnet *, struct mbuf *);
     static int	ixgbe_mq_start_locked(struct ifnet *,
                         struct tx_ring *, struct mbuf *);
     static void	ixgbe_qflush(struct ifnet *);
     static void	ixgbe_deferred_mq_start(void *, int);
    -#else
    -static void     ixgbe_start(struct ifnet *);
    -static void     ixgbe_start_locked(struct tx_ring *, struct ifnet *);
    -#endif
    +#endif /* IXGBE_LEGACY_TX */
     static int      ixgbe_ioctl(struct ifnet *, u_long, caddr_t);
     static void	ixgbe_init(void *);
     static void	ixgbe_init_locked(struct adapter *);
    @@ -148,7 +150,7 @@ static void     ixgbe_enable_intr(struct
     static void     ixgbe_disable_intr(struct adapter *);
     static void     ixgbe_update_stats_counters(struct adapter *);
     static bool	ixgbe_txeof(struct tx_ring *);
    -static bool	ixgbe_rxeof(struct ix_queue *, int);
    +static bool	ixgbe_rxeof(struct ix_queue *);
     static void	ixgbe_rx_checksum(u32, struct mbuf *, u32);
     static void     ixgbe_set_promisc(struct adapter *);
     static void     ixgbe_set_multi(struct adapter *);
    @@ -161,10 +163,10 @@ static int	ixgbe_set_thermal_test(SYSCTL
     static int	ixgbe_dma_malloc(struct adapter *, bus_size_t,
     		    struct ixgbe_dma_alloc *, int);
     static void     ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *);
    -static void	ixgbe_add_rx_process_limit(struct adapter *, const char *,
    -		    const char *, int *, int);
    -static bool	ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *);
    -static bool	ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *);
    +static int	ixgbe_tx_ctx_setup(struct tx_ring *,
    +		    struct mbuf *, u32 *, u32 *);
    +static int	ixgbe_tso_setup(struct tx_ring *,
    +		    struct mbuf *, u32 *, u32 *);
     static void	ixgbe_set_ivar(struct adapter *, u8, u8, s8);
     static void	ixgbe_configure_ivars(struct adapter *);
     static u8 *	ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *);
    @@ -179,6 +181,9 @@ static __inline void ixgbe_rx_discard(st
     static __inline void ixgbe_rx_input(struct rx_ring *, struct ifnet *,
     		    struct mbuf *, u32);
     
    +static void	ixgbe_enable_rx_drop(struct adapter *);
    +static void	ixgbe_disable_rx_drop(struct adapter *);
    +
     /* Support for pluggable optic modules */
     static bool	ixgbe_sfp_probe(struct adapter *);
     static void	ixgbe_setup_optics(struct adapter *);
    @@ -211,7 +216,8 @@ static device_method_t ixgbe_methods[] =
     	DEVMETHOD(device_attach, ixgbe_attach),
     	DEVMETHOD(device_detach, ixgbe_detach),
     	DEVMETHOD(device_shutdown, ixgbe_shutdown),
    -	{0, 0}
    +
    +	DEVMETHOD_END
     };
     
     static driver_t ixgbe_driver = {
    @@ -237,16 +243,16 @@ MODULE_DEPEND(ixgbe, ether, 1, 1, 1);
     static int ixgbe_enable_aim = TRUE;
     TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim);
     
    -static int ixgbe_max_interrupt_rate = (8000000 / IXGBE_LOW_LATENCY);
    +static int ixgbe_max_interrupt_rate = (4000000 / IXGBE_LOW_LATENCY);
     TUNABLE_INT("hw.ixgbe.max_interrupt_rate", &ixgbe_max_interrupt_rate);
     
     /* How many packets rxeof tries to clean at a time */
    -static int ixgbe_rx_process_limit = 128;
    +static int ixgbe_rx_process_limit = 256;
     TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit);
     
    -/* Flow control setting, default to full */
    -static int ixgbe_flow_control = ixgbe_fc_full;
    -TUNABLE_INT("hw.ixgbe.flow_control", &ixgbe_flow_control);
    +/* How many packets txeof tries to clean at a time */
    +static int ixgbe_tx_process_limit = 256;
    +TUNABLE_INT("hw.ixgbe.tx_process_limit", &ixgbe_tx_process_limit);
     
     /*
     ** Smart speed setting, default to on
    @@ -265,15 +271,6 @@ static int ixgbe_enable_msix = 1;
     TUNABLE_INT("hw.ixgbe.enable_msix", &ixgbe_enable_msix);
     
     /*
    - * Header split: this causes the hardware to DMA
    - * the header into a separate mbuf from the payload,
    - * it can be a performance win in some workloads, but
    - * in others it actually hurts, its off by default. 
    - */
    -static int ixgbe_header_split = FALSE;
    -TUNABLE_INT("hw.ixgbe.hdr_split", &ixgbe_header_split);
    -
    -/*
      * Number of Queues, can be set to 0,
      * it then autoconfigures based on the
      * number of cpus with a max of 8. This
    @@ -294,6 +291,20 @@ TUNABLE_INT("hw.ixgbe.txd", &ixgbe_txd);
     static int ixgbe_rxd = PERFORM_RXD;
     TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd);
     
    +/*
    +** HW RSC control: 
    +**  this feature only works with
    +**  IPv4, and only on 82599 and later.
    +**  Also this will cause IP forwarding to
    +**  fail and that can't be controlled by
    +**  the stack as LRO can. For all these
    +**  reasons I've deemed it best to leave
    +**  this off and not bother with a tuneable
    +**  interface, this would need to be compiled
    +**  to enable.
    +*/
    +static bool ixgbe_rsc_enable = FALSE;
    +
     /* Keep running tab on them for sanity check */
     static int ixgbe_total_ports;
     
    @@ -318,6 +329,18 @@ static int atr_sample_rate = 20;
     static int fdir_pballoc = 1;
     #endif
     
    +#ifdef DEV_NETMAP
    +/*
    + * The #ifdef DEV_NETMAP / #endif blocks in this file are meant to
    + * be a reference on how to implement netmap support in a driver.
    + * Additional comments are in ixgbe_netmap.h .
    + *
    + *  contains functions for netmap support
    + * that extend the standard driver.
    + */
    +#include 
    +#endif /* DEV_NETMAP */
    +
     /*********************************************************************
      *  Device identification routine
      *
    @@ -406,11 +429,6 @@ ixgbe_attach(device_t dev)
     			OID_AUTO, "fc", CTLTYPE_INT | CTLFLAG_RW,
     			adapter, 0, ixgbe_set_flowcntl, "I", "Flow Control");
     
    -	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
    -			SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
    -			OID_AUTO, "advertise_gig", CTLTYPE_INT | CTLFLAG_RW,
    -			adapter, 0, ixgbe_set_advertise, "I", "1G Link");
    -
             SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
     			SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
     			OID_AUTO, "enable_aim", CTLTYPE_INT|CTLFLAG_RW,
    @@ -516,28 +534,24 @@ ixgbe_attach(device_t dev)
     		goto err_late;
     	}
     
    -	/* Get Hardware Flow Control setting */
    -	hw->fc.requested_mode = ixgbe_fc_full;
    -	adapter->fc = hw->fc.requested_mode;
    -	hw->fc.pause_time = IXGBE_FC_PAUSE;
    -	hw->fc.low_water = IXGBE_FC_LO;
    -	hw->fc.high_water[0] = IXGBE_FC_HI;
    -	hw->fc.send_xon = TRUE;
    -
     	error = ixgbe_init_hw(hw);
    -	if (error == IXGBE_ERR_EEPROM_VERSION) {
    +	switch (error) {
    +	case IXGBE_ERR_EEPROM_VERSION:
     		device_printf(dev, "This device is a pre-production adapter/"
     		    "LOM.  Please be aware there may be issues associated "
     		    "with your hardware.\n If you are experiencing problems "
     		    "please contact your Intel or hardware representative "
     		    "who provided you with this hardware.\n");
    -	} else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED)
    +		break;
    +	case IXGBE_ERR_SFP_NOT_SUPPORTED:
     		device_printf(dev,"Unsupported SFP+ Module\n");
    -
    -	if (error) {
     		error = EIO;
    -		device_printf(dev,"Hardware Initialization Failure\n");
     		goto err_late;
    +	case IXGBE_ERR_SFP_NOT_PRESENT:
    +		device_printf(dev,"No SFP+ Module found\n");
    +		/* falls thru */
    +	default:
    +		break;
     	}
     
     	/* Detect and set physical type */
    @@ -554,11 +568,6 @@ ixgbe_attach(device_t dev)
     	if (ixgbe_setup_interface(dev, adapter) != 0)
     		goto err_late;
     
    -	/* Sysctl for limiting the amount of work done in the taskqueue */
    -	ixgbe_add_rx_process_limit(adapter, "rx_processing_limit",
    -	    "max number of rx packets to process", &adapter->rx_process_limit,
    -	    ixgbe_rx_process_limit);
    -
     	/* Initialize statistics */
     	ixgbe_update_stats_counters(adapter);
     
    @@ -594,6 +603,9 @@ ixgbe_attach(device_t dev)
     
     	ixgbe_add_hw_stats(adapter);
     
    +#ifdef DEV_NETMAP
    +	ixgbe_netmap_attach(adapter);
    +#endif /* DEV_NETMAP */
     	INIT_DEBUGOUT("ixgbe_attach: end");
     	return (0);
     err_late:
    @@ -640,7 +652,7 @@ ixgbe_detach(device_t dev)
     
     	for (int i = 0; i < adapter->num_queues; i++, que++, txr++) {
     		if (que->tq) {
    -#if __FreeBSD_version >= 800000
    +#ifdef IXGBE_LEGACY_TX
     			taskqueue_drain(que->tq, &txr->txq_task);
     #endif
     			taskqueue_drain(que->tq, &que->que_task);
    @@ -672,6 +684,9 @@ ixgbe_detach(device_t dev)
     
     	ether_ifdetach(adapter->ifp);
     	callout_drain(&adapter->timer);
    +#ifdef DEV_NETMAP
    +	netmap_detach(adapter->ifp);
    +#endif /* DEV_NETMAP */
     	ixgbe_free_pci_resources(adapter);
     	bus_generic_detach(dev);
     	if_free(adapter->ifp);
    @@ -701,7 +716,7 @@ ixgbe_shutdown(device_t dev)
     }
     
     
    -#if __FreeBSD_version < 800000
    +#ifdef IXGBE_LEGACY_TX
     /*********************************************************************
      *  Transmit entry point
      *
    @@ -720,17 +735,14 @@ ixgbe_start_locked(struct tx_ring *txr, 
     
     	IXGBE_TX_LOCK_ASSERT(txr);
     
    -	if ((ifp->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) !=
    -	    IFF_DRV_RUNNING)
    +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
     		return;
     	if (!adapter->link_active)
     		return;
     
     	while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
    -		if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE) {
    -			txr->queue_status |= IXGBE_QUEUE_DEPLETED;
    +		if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE)
     			break;
    -                }
     
     		IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
     		if (m_head == NULL)
    @@ -739,8 +751,6 @@ ixgbe_start_locked(struct tx_ring *txr, 
     		if (ixgbe_xmit(txr, &m_head)) {
     			if (m_head != NULL)
     				IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
    -			if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE)
    -				txr->queue_status |= IXGBE_QUEUE_DEPLETED;
     			break;
     		}
     		/* Send a copy of the frame to the BPF listener */
    @@ -773,7 +783,8 @@ ixgbe_start(struct ifnet *ifp)
     	return;
     }
     
    -#else
    +#else /* ! IXGBE_LEGACY_TX */
    +
     /*
     ** Multiqueue Transmit driver
     **
    @@ -795,8 +806,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct
     	txr = &adapter->tx_rings[i];
     	que = &adapter->queues[i];
     
    -	if (((txr->queue_status & IXGBE_QUEUE_DEPLETED) == 0) &&
    -	    IXGBE_TX_TRYLOCK(txr)) {
    +	if (IXGBE_TX_TRYLOCK(txr)) {
     		err = ixgbe_mq_start_locked(ifp, txr, m);
     		IXGBE_TX_UNLOCK(txr);
     	} else {
    @@ -815,17 +825,12 @@ ixgbe_mq_start_locked(struct ifnet *ifp,
             int             enqueued, err = 0;
     
     	if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) ||
    -	    (txr->queue_status == IXGBE_QUEUE_DEPLETED) ||
     	    adapter->link_active == 0) {
     		if (m != NULL)
     			err = drbr_enqueue(ifp, txr->br, m);
     		return (err);
     	}
     
    -	/* Call cleanup if number of TX descriptors low */
    -	if (txr->tx_avail <= IXGBE_TX_CLEANUP_THRESHOLD)
    -		ixgbe_txeof(txr);
    -
     	enqueued = 0;
     	if (m == NULL) {
     		next = drbr_dequeue(ifp, txr->br);
    @@ -844,23 +849,21 @@ ixgbe_mq_start_locked(struct ifnet *ifp,
     			break;
     		}
     		enqueued++;
    -		drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags);
    +		ifp->if_obytes += next->m_pkthdr.len;
    +		if (next->m_flags & M_MCAST)
    +			ifp->if_omcasts++;
     		/* Send a copy of the frame to the BPF listener */
     		ETHER_BPF_MTAP(ifp, next);
     		if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
     			break;
     		if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD)
     			ixgbe_txeof(txr);
    -		if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD) {
    -			txr->queue_status |= IXGBE_QUEUE_DEPLETED;
    -			break;
    -		}
     		next = drbr_dequeue(ifp, txr->br);
     	}
     
     	if (enqueued > 0) {
     		/* Set watchdog on */
    -		txr->queue_status |= IXGBE_QUEUE_WORKING;
    +		txr->queue_status = IXGBE_QUEUE_WORKING;
     		txr->watchdog_time = ticks;
     	}
     
    @@ -904,7 +907,7 @@ ixgbe_qflush(struct ifnet *ifp)
     	}
     	if_qflush(ifp);
     }
    -#endif /* __FreeBSD_version >= 800000 */
    +#endif /* IXGBE_LEGACY_TX */
     
     /*********************************************************************
      *  Ioctl entry point
    @@ -919,6 +922,7 @@ static int
     ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data)
     {
     	struct adapter	*adapter = ifp->if_softc;
    +	struct ixgbe_hw *hw = &adapter->hw;
     	struct ifreq	*ifr = (struct ifreq *) data;
     #if defined(INET) || defined(INET6)
     	struct ifaddr *ifa = (struct ifaddr *)data;
    @@ -1006,6 +1010,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c
     			ifp->if_capenable ^= IFCAP_HWCSUM;
     		if (mask & IFCAP_TSO4)
     			ifp->if_capenable ^= IFCAP_TSO4;
    +		if (mask & IFCAP_TSO6)
    +			ifp->if_capenable ^= IFCAP_TSO6;
     		if (mask & IFCAP_LRO)
     			ifp->if_capenable ^= IFCAP_LRO;
     		if (mask & IFCAP_VLAN_HWTAGGING)
    @@ -1022,7 +1028,22 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c
     		VLAN_CAPABILITIES(ifp);
     		break;
     	}
    -
    +	case SIOCGI2C:
    +	{
    +		struct ixgbe_i2c_req	i2c;
    +		IOCTL_DEBUGOUT("ioctl: SIOCGI2C (Get I2C Data)");
    +		error = copyin(ifr->ifr_data, &i2c, sizeof(i2c));
    +		if (error)
    +			break;
    +		if ((i2c.dev_addr != 0xA0) || (i2c.dev_addr != 0xA2)){
    +			error = EINVAL;
    +			break;
    +		}
    +		hw->phy.ops.read_i2c_byte(hw, i2c.offset,
    +		    i2c.dev_addr, i2c.data);
    +		error = copyout(&i2c, ifr->ifr_data, sizeof(i2c));
    +		break;
    +	}
     	default:
     		IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)\n", (int)command);
     		error = ether_ioctl(ifp, command, data);
    @@ -1070,7 +1091,7 @@ ixgbe_init_locked(struct adapter *adapte
     
     	/* Set the various hardware offload abilities */
     	ifp->if_hwassist = 0;
    -	if (ifp->if_capenable & IFCAP_TSO4)
    +	if (ifp->if_capenable & IFCAP_TSO)
     		ifp->if_hwassist |= CSUM_TSO;
     	if (ifp->if_capenable & IFCAP_TXCSUM) {
     		ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP);
    @@ -1095,7 +1116,7 @@ ixgbe_init_locked(struct adapter *adapte
     
     	/*
     	** Determine the correct mbuf pool
    -	** for doing jumbo/headersplit
    +	** for doing jumbo frames
     	*/
     	if (adapter->max_frame_size <= 2048)
     		adapter->rx_mbuf_sz = MCLBYTES;
    @@ -1152,6 +1173,14 @@ ixgbe_init_locked(struct adapter *adapte
     		txdctl |= IXGBE_TXDCTL_ENABLE;
     		/* Set WTHRESH to 8, burst writeback */
     		txdctl |= (8 << 16);
    +		/*
    +		 * When the internal queue falls below PTHRESH (32),
    +		 * start prefetching as long as there are at least
    +		 * HTHRESH (1) buffers ready. The values are taken
    +		 * from the Intel linux driver 3.8.21.
    +		 * Prefetching enables tx line rate even with 1 queue.
    +		 */
    +		txdctl |= (32 << 0) | (1 << 8);
     		IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), txdctl);
     	}
     
    @@ -1176,6 +1205,31 @@ ixgbe_init_locked(struct adapter *adapte
     				msec_delay(1);
     		}
     		wmb();
    +#ifdef DEV_NETMAP
    +		/*
    +		 * In netmap mode, we must preserve the buffers made
    +		 * available to userspace before the if_init()
    +		 * (this is true by default on the TX side, because
    +		 * init makes all buffers available to userspace).
    +		 *
    +		 * netmap_reset() and the device specific routines
    +		 * (e.g. ixgbe_setup_receive_rings()) map these
    +		 * buffers at the end of the NIC ring, so here we
    +		 * must set the RDT (tail) register to make sure
    +		 * they are not overwritten.
    +		 *
    +		 * In this driver the NIC ring starts at RDH = 0,
    +		 * RDT points to the last slot available for reception (?),
    +		 * so RDT = num_rx_desc - 1 means the whole ring is available.
    +		 */
    +		if (ifp->if_capenable & IFCAP_NETMAP) {
    +			struct netmap_adapter *na = NA(adapter->ifp);
    +			struct netmap_kring *kring = &na->rx_rings[i];
    +			int t = na->num_rx_desc - 1 - kring->nr_hwavail;
    +
    +			IXGBE_WRITE_REG(hw, IXGBE_RDT(i), t);
    +		} else
    +#endif /* DEV_NETMAP */
     		IXGBE_WRITE_REG(hw, IXGBE_RDT(i), adapter->num_rx_desc - 1);
     	}
     
    @@ -1210,7 +1264,7 @@ ixgbe_init_locked(struct adapter *adapte
     #ifdef IXGBE_FDIR
     	/* Init Flow director */
     	if (hw->mac.type != ixgbe_mac_82598EB) {
    -		u32 hdrm = 64 << fdir_pballoc;
    +		u32 hdrm = 32 << fdir_pballoc;
     
     		hw->mac.ops.setup_rxpba(hw, 0, hdrm, PBA_STRATEGY_EQUAL);
     		ixgbe_init_fdir_signature_82599(&adapter->hw, fdir_pballoc);
    @@ -1236,12 +1290,40 @@ ixgbe_init_locked(struct adapter *adapte
     	/* Config/Enable Link */
     	ixgbe_config_link(adapter);
     
    +	/* Hardware Packet Buffer & Flow Control setup */
    +	{
    +		u32 rxpb, frame, size, tmp;
    +
    +		frame = adapter->max_frame_size;
    +
    +		/* Calculate High Water */
    +		if (hw->mac.type == ixgbe_mac_X540)
    +			tmp = IXGBE_DV_X540(frame, frame);
    +		else
    +			tmp = IXGBE_DV(frame, frame);
    +		size = IXGBE_BT2KB(tmp);
    +		rxpb = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(0)) >> 10;
    +		hw->fc.high_water[0] = rxpb - size;
    +
    +		/* Now calculate Low Water */
    +		if (hw->mac.type == ixgbe_mac_X540)
    +			tmp = IXGBE_LOW_DV_X540(frame);
    +		else
    +			tmp = IXGBE_LOW_DV(frame);
    +		hw->fc.low_water[0] = IXGBE_BT2KB(tmp);
    +		
    +		adapter->fc = hw->fc.requested_mode = ixgbe_fc_full;
    +		hw->fc.pause_time = IXGBE_FC_PAUSE;
    +		hw->fc.send_xon = TRUE;
    +	}
    +	/* Initialize the FC settings */
    +	ixgbe_start_hw(hw);
    +
     	/* And now turn on interrupts */
     	ixgbe_enable_intr(adapter);
     
     	/* Now inform the stack we're ready */
     	ifp->if_drv_flags |= IFF_DRV_RUNNING;
    -	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
     
     	return;
     }
    @@ -1331,10 +1413,10 @@ ixgbe_handle_que(void *context, int pend
     	bool		more;
     
     	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
    -		more = ixgbe_rxeof(que, adapter->rx_process_limit);
    +		more = ixgbe_rxeof(que);
     		IXGBE_TX_LOCK(txr);
     		ixgbe_txeof(txr);
    -#if __FreeBSD_version >= 800000
    +#ifndef IXGBE_LEGACY_TX
     		if (!drbr_empty(ifp, txr->br))
     			ixgbe_mq_start_locked(ifp, txr, NULL);
     #else
    @@ -1342,7 +1424,7 @@ ixgbe_handle_que(void *context, int pend
     			ixgbe_start_locked(txr, ifp);
     #endif
     		IXGBE_TX_UNLOCK(txr);
    -		if (more || (ifp->if_drv_flags & IFF_DRV_OACTIVE)) {
    +		if (more) {
     			taskqueue_enqueue(que->tq, &que->que_task);
     			return;
     		}
    @@ -1379,7 +1461,7 @@ ixgbe_legacy_irq(void *arg)
     		return;
     	}
     
    -	more_rx = ixgbe_rxeof(que, adapter->rx_process_limit);
    +	more_rx = ixgbe_rxeof(que);
     
     	IXGBE_TX_LOCK(txr);
     	do {
    @@ -1425,7 +1507,7 @@ ixgbe_msix_que(void *arg)
     	ixgbe_disable_queue(adapter, que->msix);
     	++que->irqs;
     
    -	more_rx = ixgbe_rxeof(que, adapter->rx_process_limit);
    +	more_rx = ixgbe_rxeof(que);
     
     	IXGBE_TX_LOCK(txr);
     	more_tx = ixgbe_txeof(txr);
    @@ -1434,7 +1516,7 @@ ixgbe_msix_que(void *arg)
     	** has anything queued the task gets
     	** scheduled to handle it.
     	*/
    -#if __FreeBSD_version < 800000
    +#ifdef IXGBE_LEGACY_TX
     	if (!IFQ_DRV_IS_EMPTY(&adapter->ifp->if_snd))
     #else
     	if (!drbr_empty(adapter->ifp, txr->br))
    @@ -1525,10 +1607,8 @@ ixgbe_msix_link(void *arg)
     			/* This is probably overkill :) */
     			if (!atomic_cmpset_int(&adapter->fdir_reinit, 0, 1))
     				return;
    -                	/* Clear the interrupt */
    -			IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_FLOW_DIR);
    -			/* Turn off the interface */
    -			adapter->ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
    +                	/* Disable the interrupt */
    +			IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EICR_FLOW_DIR);
     			taskqueue_enqueue(adapter->tq, &adapter->fdir_task);
     		} else
     #endif
    @@ -1602,7 +1682,7 @@ ixgbe_media_status(struct ifnet * ifp, s
     			ifmr->ifm_active |= IFM_100_TX | IFM_FDX;
     			break;
     		case IXGBE_LINK_SPEED_1GB_FULL:
    -			ifmr->ifm_active |= IFM_1000_T | IFM_FDX;
    +			ifmr->ifm_active |= adapter->optics | IFM_FDX;
     			break;
     		case IXGBE_LINK_SPEED_10GB_FULL:
     			ifmr->ifm_active |= adapter->optics | IFM_FDX;
    @@ -1661,9 +1741,9 @@ ixgbe_xmit(struct tx_ring *txr, struct m
     {
     	struct adapter  *adapter = txr->adapter;
     	u32		olinfo_status = 0, cmd_type_len;
    -	u32		paylen = 0;
     	int             i, j, error, nsegs;
    -	int		first, last = 0;
    +	int		first;
    +	bool		remap = TRUE;
     	struct mbuf	*m_head;
     	bus_dma_segment_t segs[adapter->num_segs];
     	bus_dmamap_t	map;
    @@ -1691,74 +1771,58 @@ ixgbe_xmit(struct tx_ring *txr, struct m
     	/*
     	 * Map the packet for DMA.
     	 */
    +retry:
     	error = bus_dmamap_load_mbuf_sg(txr->txtag, map,
     	    *m_headp, segs, &nsegs, BUS_DMA_NOWAIT);
     
    -	if (error == EFBIG) {
    +	if (__predict_false(error)) {
     		struct mbuf *m;
     
    -		m = m_defrag(*m_headp, M_DONTWAIT);
    -		if (m == NULL) {
    -			adapter->mbuf_defrag_failed++;
    -			m_freem(*m_headp);
    -			*m_headp = NULL;
    -			return (ENOBUFS);
    -		}
    -		*m_headp = m;
    -
    -		/* Try it again */
    -		error = bus_dmamap_load_mbuf_sg(txr->txtag, map,
    -		    *m_headp, segs, &nsegs, BUS_DMA_NOWAIT);
    -
    -		if (error == ENOMEM) {
    -			adapter->no_tx_dma_setup++;
    +		switch (error) {
    +		case EFBIG:
    +			/* Try it again? - one try */
    +			if (remap == TRUE) {
    +				remap = FALSE;
    +				m = m_defrag(*m_headp, M_NOWAIT);
    +				if (m == NULL) {
    +					adapter->mbuf_defrag_failed++;
    +					m_freem(*m_headp);
    +					*m_headp = NULL;
    +					return (ENOBUFS);
    +				}
    +				*m_headp = m;
    +				goto retry;
    +			} else
    +				return (error);
    +		case ENOMEM:
    +			txr->no_tx_dma_setup++;
     			return (error);
    -		} else if (error != 0) {
    -			adapter->no_tx_dma_setup++;
    +		default:
    +			txr->no_tx_dma_setup++;
     			m_freem(*m_headp);
     			*m_headp = NULL;
     			return (error);
     		}
    -	} else if (error == ENOMEM) {
    -		adapter->no_tx_dma_setup++;
    -		return (error);
    -	} else if (error != 0) {
    -		adapter->no_tx_dma_setup++;
    -		m_freem(*m_headp);
    -		*m_headp = NULL;
    -		return (error);
     	}
     
     	/* Make certain there are enough descriptors */
     	if (nsegs > txr->tx_avail - 2) {
     		txr->no_desc_avail++;
    -		error = ENOBUFS;
    -		goto xmit_fail;
    +		bus_dmamap_unload(txr->txtag, map);
    +		return (ENOBUFS);
     	}
     	m_head = *m_headp;
     
     	/*
     	** Set up the appropriate offload context
    -	** this becomes the first descriptor of 
    -	** a packet.
    +	** this will consume the first descriptor
     	*/
    -	if (m_head->m_pkthdr.csum_flags & CSUM_TSO) {
    -		if (ixgbe_tso_setup(txr, m_head, &paylen)) {
    -			cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE;
    -			olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8;
    -			olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8;
    -			olinfo_status |= paylen << IXGBE_ADVTXD_PAYLEN_SHIFT;
    -			++adapter->tso_tx;
    -		} else
    -			return (ENXIO);
    -	} else if (ixgbe_tx_ctx_setup(txr, m_head))
    -		olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8;
    -
    -#ifdef IXGBE_IEEE1588
    -        /* This is changing soon to an mtag detection */
    -        if (we detect this mbuf has a TSTAMP mtag)
    -                cmd_type_len |= IXGBE_ADVTXD_MAC_TSTAMP;
    -#endif
    +	error = ixgbe_tx_ctx_setup(txr, m_head, &cmd_type_len, &olinfo_status);
    +	if (__predict_false(error)) {
    +		if (error == ENOBUFS)
    +			*m_headp = NULL;
    +		return (error);
    +	}
     
     #ifdef IXGBE_FDIR
     	/* Do the flow director magic */
    @@ -1770,10 +1834,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m
     		}
     	}
     #endif
    -        /* Record payload length */
    -	if (paylen == 0)
    -        	olinfo_status |= m_head->m_pkthdr.len <<
    -		    IXGBE_ADVTXD_PAYLEN_SHIFT;
     
     	i = txr->next_avail_desc;
     	for (j = 0; j < nsegs; j++) {
    @@ -1789,13 +1849,9 @@ ixgbe_xmit(struct tx_ring *txr, struct m
     		txd->read.cmd_type_len = htole32(txr->txd_cmd |
     		    cmd_type_len |seglen);
     		txd->read.olinfo_status = htole32(olinfo_status);
    -		last = i; /* descriptor that will get completion IRQ */
     
    -		if (++i == adapter->num_tx_desc)
    +		if (++i == txr->num_desc)
     			i = 0;
    -
    -		txbuf->m_head = NULL;
    -		txbuf->eop_index = -1;
     	}
     
     	txd->read.cmd_type_len |=
    @@ -1804,14 +1860,19 @@ ixgbe_xmit(struct tx_ring *txr, struct m
     	txr->next_avail_desc = i;
     
     	txbuf->m_head = m_head;
    -	/* Swap the dma map between the first and last descriptor */
    +	/*
    +	** Here we swap the map so the last descriptor,
    +	** which gets the completion interrupt has the
    +	** real map, and the first descriptor gets the
    +	** unused map from this descriptor.
    +	*/
     	txr->tx_buffers[first].map = txbuf->map;
     	txbuf->map = map;
     	bus_dmamap_sync(txr->txtag, map, BUS_DMASYNC_PREWRITE);
     
    -        /* Set the index of the descriptor that will be marked done */
    +        /* Set the EOP descriptor that will be marked done */
             txbuf = &txr->tx_buffers[first];
    -	txbuf->eop_index = last;
    +	txbuf->eop = txd;
     
             bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map,
                 BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
    @@ -1824,10 +1885,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m
     
     	return (0);
     
    -xmit_fail:
    -	bus_dmamap_unload(txr->txtag, txbuf->map);
    -	return (error);
    -
     }
     
     static void
    @@ -1946,13 +2003,11 @@ ixgbe_local_timer(void *arg)
     {
     	struct adapter	*adapter = arg;
     	device_t	dev = adapter->dev;
    -	struct ifnet	*ifp = adapter->ifp;
     	struct ix_queue *que = adapter->queues;
     	struct tx_ring	*txr = adapter->tx_rings;
    -	int		hung, busy, paused;
    +	int		hung = 0, paused = 0;
     
     	mtx_assert(&adapter->core_mtx, MA_OWNED);
    -	hung = busy = paused = 0;
     
     	/* Check for pluggable optics */
     	if (adapter->sfp_probe)
    @@ -1971,27 +2026,18 @@ ixgbe_local_timer(void *arg)
     
     	/*
     	** Check the TX queues status
    -	**      - central locked handling of OACTIVE
     	**      - watchdog only if all queues show hung
     	*/          
     	for (int i = 0; i < adapter->num_queues; i++, que++, txr++) {
    -		if ((txr->queue_status & IXGBE_QUEUE_HUNG) &&
    +		if ((txr->queue_status == IXGBE_QUEUE_HUNG) &&
     		    (paused == 0))
     			++hung;
    -		if (txr->queue_status & IXGBE_QUEUE_DEPLETED)
    -			++busy;
    -		if ((txr->queue_status & IXGBE_QUEUE_IDLE) == 0)
    +		else if (txr->queue_status == IXGBE_QUEUE_WORKING)
     			taskqueue_enqueue(que->tq, &que->que_task);
             }
     	/* Only truely watchdog if all queues show hung */
             if (hung == adapter->num_queues)
                     goto watchdog;
    -	/* Only turn off the stack flow when ALL are depleted */
    -        if (busy == adapter->num_queues)
    -                ifp->if_drv_flags |= IFF_DRV_OACTIVE;
    -        else if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) &&
    -            (busy < adapter->num_queues))
    -                ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
     
     out:
     	ixgbe_rearm_queues(adapter, adapter->que_mask);
    @@ -2020,7 +2066,6 @@ static void
     ixgbe_update_link_status(struct adapter *adapter)
     {
     	struct ifnet	*ifp = adapter->ifp;
    -	struct tx_ring *txr = adapter->tx_rings;
     	device_t dev = adapter->dev;
     
     
    @@ -2031,6 +2076,8 @@ ixgbe_update_link_status(struct adapter 
     				    ((adapter->link_speed == 128)? 10:1),
     				    "Full Duplex");
     			adapter->link_active = TRUE;
    +			/* Update any Flow Control changes */
    +			ixgbe_fc_enable(&adapter->hw);
     			if_link_state_change(ifp, LINK_STATE_UP);
     		}
     	} else { /* Link down */
    @@ -2039,9 +2086,6 @@ ixgbe_update_link_status(struct adapter 
     				device_printf(dev,"Link is Down\n");
     			if_link_state_change(ifp, LINK_STATE_DOWN);
     			adapter->link_active = FALSE;
    -			for (int i = 0; i < adapter->num_queues;
    -			    i++, txr++)
    -				txr->queue_status = IXGBE_QUEUE_IDLE;
     		}
     	}
     
    @@ -2072,7 +2116,6 @@ ixgbe_stop(void *arg)
     
     	/* Let the stack know...*/
     	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
    -	ifp->if_drv_flags |= IFF_DRV_OACTIVE;
     
     	ixgbe_reset_hw(hw);
     	hw->adapter_stopped = FALSE;
    @@ -2144,6 +2187,11 @@ ixgbe_setup_optics(struct adapter *adapt
     		return;
     	}
     
    +	if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX) {
    +		adapter->optics = IFM_1000_SX;
    +		return;
    +	}
    +
     	if (layer & (IXGBE_PHYSICAL_LAYER_10GBASE_LR |
     	    IXGBE_PHYSICAL_LAYER_10GBASE_LRM)) {
     		adapter->optics = IFM_10G_LR;
    @@ -2179,12 +2227,12 @@ ixgbe_setup_optics(struct adapter *adapt
     static int
     ixgbe_allocate_legacy(struct adapter *adapter)
     {
    -	device_t dev = adapter->dev;
    +	device_t	dev = adapter->dev;
     	struct		ix_queue *que = adapter->queues;
    -#if __FreeBSD_version >= 800000
    +#ifndef IXGBE_LEGACY_TX
     	struct tx_ring		*txr = adapter->tx_rings;
     #endif
    -	int error, rid = 0;
    +	int		error, rid = 0;
     
     	/* MSI RID at 1 */
     	if (adapter->msix == 1)
    @@ -2203,7 +2251,7 @@ ixgbe_allocate_legacy(struct adapter *ad
     	 * Try allocating a fast interrupt and the associated deferred
     	 * processing contexts.
     	 */
    -#if __FreeBSD_version >= 800000
    +#ifndef IXGBE_LEGACY_TX
     	TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr);
     #endif
     	TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que);
    @@ -2285,7 +2333,7 @@ ixgbe_allocate_msix(struct adapter *adap
     		if (adapter->num_queues > 1)
     			bus_bind_intr(dev, que->res, i);
     
    -#if __FreeBSD_version >= 800000
    +#ifndef IXGBE_LEGACY_TX
     		TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr);
     #endif
     		TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que);
    @@ -2526,13 +2574,12 @@ ixgbe_setup_interface(device_t dev, stru
     		return (-1);
     	}
     	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
    -	ifp->if_mtu = ETHERMTU;
     	ifp->if_baudrate = 1000000000;
     	ifp->if_init = ixgbe_init;
     	ifp->if_softc = adapter;
     	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
     	ifp->if_ioctl = ixgbe_ioctl;
    -#if __FreeBSD_version >= 800000
    +#ifndef IXGBE_LEGACY_TX
     	ifp->if_transmit = ixgbe_mq_start;
     	ifp->if_qflush = ixgbe_qflush;
     #else
    @@ -2550,16 +2597,14 @@ ixgbe_setup_interface(device_t dev, stru
     	 */
     	ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
     
    -	ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO4 | IFCAP_VLAN_HWCSUM;
    +	ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO | IFCAP_VLAN_HWCSUM;
     	ifp->if_capabilities |= IFCAP_JUMBO_MTU;
    +	ifp->if_capabilities |= IFCAP_LRO;
     	ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING
     			     |  IFCAP_VLAN_HWTSO
     			     |  IFCAP_VLAN_MTU;
     	ifp->if_capenable = ifp->if_capabilities;
     
    -	/* Don't enable LRO by default */
    -	ifp->if_capabilities |= IFCAP_LRO;
    -
     	/*
     	** Don't turn this on by default, if vlans are
     	** created on another pseudo device (eg. lagg)
    @@ -2759,6 +2804,7 @@ ixgbe_allocate_queues(struct adapter *ad
     		txr = &adapter->tx_rings[i];
     		txr->adapter = adapter;
     		txr->me = i;
    +		txr->num_desc = adapter->num_tx_desc;
     
     		/* Initialize the TX side lock */
     		snprintf(txr->mtx_name, sizeof(txr->mtx_name), "%s:tx(%d)",
    @@ -2782,7 +2828,7 @@ ixgbe_allocate_queues(struct adapter *ad
     			error = ENOMEM;
     			goto err_tx_desc;
             	}
    -#if __FreeBSD_version >= 800000
    +#ifndef IXGBE_LEGACY_TX
     		/* Allocate a buf ring */
     		txr->br = buf_ring_alloc(IXGBE_BR_SIZE, M_DEVBUF,
     		    M_WAITOK, &txr->tx_mtx);
    @@ -2805,6 +2851,7 @@ ixgbe_allocate_queues(struct adapter *ad
     		/* Set up some basics */
     		rxr->adapter = adapter;
     		rxr->me = i;
    +		rxr->num_desc = adapter->num_rx_desc;
     
     		/* Initialize the RX side lock */
     		snprintf(rxr->mtx_name, sizeof(rxr->mtx_name), "%s:rx(%d)",
    @@ -2928,9 +2975,20 @@ ixgbe_setup_transmit_ring(struct tx_ring
     	struct adapter *adapter = txr->adapter;
     	struct ixgbe_tx_buf *txbuf;
     	int i;
    +#ifdef DEV_NETMAP
    +	struct netmap_adapter *na = NA(adapter->ifp);
    +	struct netmap_slot *slot;
    +#endif /* DEV_NETMAP */
     
     	/* Clear the old ring contents */
     	IXGBE_TX_LOCK(txr);
    +#ifdef DEV_NETMAP
    +	/*
    +	 * (under lock): if in netmap mode, do some consistency
    +	 * checks and set slot to entry 0 of the netmap ring.
    +	 */
    +	slot = netmap_reset(na, NR_TX, txr->me, 0);
    +#endif /* DEV_NETMAP */
     	bzero((void *)txr->tx_base,
     	      (sizeof(union ixgbe_adv_tx_desc)) * adapter->num_tx_desc);
     	/* Reset indices */
    @@ -2939,7 +2997,7 @@ ixgbe_setup_transmit_ring(struct tx_ring
     
     	/* Free any existing tx buffers. */
             txbuf = txr->tx_buffers;
    -	for (i = 0; i < adapter->num_tx_desc; i++, txbuf++) {
    +	for (i = 0; i < txr->num_desc; i++, txbuf++) {
     		if (txbuf->m_head != NULL) {
     			bus_dmamap_sync(txr->txtag, txbuf->map,
     			    BUS_DMASYNC_POSTWRITE);
    @@ -2947,8 +3005,24 @@ ixgbe_setup_transmit_ring(struct tx_ring
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 21:57:42 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 5734194D;
     Thu, 28 Feb 2013 21:57:42 +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 3AB7462A;
     Thu, 28 Feb 2013 21:57:42 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SLvg9b064385;
     Thu, 28 Feb 2013 21:57:42 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SLvdfe064363;
     Thu, 28 Feb 2013 21:57:39 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302282157.r1SLvdfe064363@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 21:57: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: r247502 - in stable/9/sys: fs/nfs fs/nfsclient
     fs/nfsserver nfs nfsclient nfsserver
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 21:57:42 -0000
    
    Author: jhb
    Date: Thu Feb 28 21:57:38 2013
    New Revision: 247502
    URL: http://svnweb.freebsd.org/changeset/base/247502
    
    Log:
      MFC 245508,245566,245568,245611,245909:
      Various fixes to timestamps in NFS:
      - Use the VA_UTIMES_NULL flag to detect when NULL was passed to utimes()
        instead of comparing the desired time against the current time as a
        heuristic.
      - Remove unused nfs_curusec().
      - Use vfs_timestamp() to set file timestamps rather than invoking
        getmicrotime() or getnanotime() directly in NFS.
      - Use NFSD_MONOSEC (which maps to time_uptime) instead of the seconds
        portion of wall-time stamps to manage timeouts on events.
      - Remove unused nd_starttime from the per-request structure in the new
        NFS server.
      - Use nanotime() for the modification time on a delegation to get as
        precise a time as possible.
      - Use time_second instead of extracting the second from a call to
        getmicrotime().
    
    Modified:
      stable/9/sys/fs/nfs/nfs.h
      stable/9/sys/fs/nfs/nfs_commonkrpc.c
      stable/9/sys/fs/nfs/nfs_commonsubs.c
      stable/9/sys/fs/nfs/nfsport.h
      stable/9/sys/fs/nfsclient/nfs_clport.c
      stable/9/sys/fs/nfsclient/nfs_clstate.c
      stable/9/sys/fs/nfsclient/nfs_clvnops.c
      stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c
      stable/9/sys/fs/nfsserver/nfs_nfsdport.c
      stable/9/sys/fs/nfsserver/nfs_nfsdstate.c
      stable/9/sys/nfs/nfs_common.c
      stable/9/sys/nfs/nfs_common.h
      stable/9/sys/nfsclient/nfs_krpc.c
      stable/9/sys/nfsclient/nfs_subs.c
      stable/9/sys/nfsclient/nfs_vnops.c
      stable/9/sys/nfsserver/nfs_srvsubs.c
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/fs/   (props changed)
    
    Modified: stable/9/sys/fs/nfs/nfs.h
    ==============================================================================
    --- stable/9/sys/fs/nfs/nfs.h	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/fs/nfs/nfs.h	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -519,7 +519,6 @@ struct nfsrv_descript {
     	int			*nd_errp;	/* Pointer to ret status */
     	u_int32_t		nd_retxid;	/* Reply xid */
     	struct nfsrvcache	*nd_rp;		/* Assoc. cache entry */
    -	struct timeval		nd_starttime;	/* Time RPC initiated */
     	fhandle_t		nd_fh;		/* File handle */
     	struct ucred		*nd_cred;	/* Credentials */
     	uid_t			nd_saveduid;	/* Saved uid */
    
    Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c
    ==============================================================================
    --- stable/9/sys/fs/nfs/nfs_commonkrpc.c	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/fs/nfs/nfs_commonkrpc.c	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -436,18 +436,17 @@ nfs_feedback(int type, int proc, void *a
     {
     	struct nfs_feedback_arg *nf = (struct nfs_feedback_arg *) arg;
     	struct nfsmount *nmp = nf->nf_mount;
    -	struct timeval now;
    -
    -	getmicrouptime(&now);
    +	time_t now;
     
     	switch (type) {
     	case FEEDBACK_REXMIT2:
     	case FEEDBACK_RECONNECT:
    -		if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now.tv_sec) {
    +		now = NFSD_MONOSEC;
    +		if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now) {
     			nfs_down(nmp, nf->nf_td,
     			    "not responding", 0, NFSSTA_TIMEO);
     			nf->nf_tprintfmsg = TRUE;
    -			nf->nf_lastmsg = now.tv_sec;
    +			nf->nf_lastmsg = now;
     		}
     		break;
     
    @@ -477,7 +476,7 @@ newnfs_request(struct nfsrv_descript *nd
     	u_int16_t procnum;
     	u_int trylater_delay = 1;
     	struct nfs_feedback_arg nf;
    -	struct timeval timo, now;
    +	struct timeval timo;
     	AUTH *auth;
     	struct rpc_callextra ext;
     	enum clnt_stat stat;
    @@ -593,8 +592,7 @@ newnfs_request(struct nfsrv_descript *nd
     		bzero(&nf, sizeof(struct nfs_feedback_arg));
     		nf.nf_mount = nmp;
     		nf.nf_td = td;
    -		getmicrouptime(&now);
    -		nf.nf_lastmsg = now.tv_sec -
    +		nf.nf_lastmsg = NFSD_MONOSEC -
     		    ((nmp->nm_tprintf_delay)-(nmp->nm_tprintf_initial_delay));
     	}
     
    
    Modified: stable/9/sys/fs/nfs/nfs_commonsubs.c
    ==============================================================================
    --- stable/9/sys/fs/nfs/nfs_commonsubs.c	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/fs/nfs/nfs_commonsubs.c	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -1980,7 +1980,6 @@ nfsv4_fillattr(struct nfsrv_descript *nd
     	struct statfs fs;
     	struct nfsfsinfo fsinf;
     	struct timespec temptime;
    -	struct timeval curtime;
     	NFSACL_T *aclp, *naclp = NULL;
     #ifdef QUOTA
     	struct dqblk dqb;
    @@ -2394,8 +2393,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd
     			retnum += NFSX_V4TIME;
     			break;
     		case NFSATTRBIT_TIMEACCESSSET:
    -			NFSGETTIME(&curtime);
    -			if (vap->va_atime.tv_sec != curtime.tv_sec) {
    +			if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
     				NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME);
     				*tl++ = txdr_unsigned(NFSV4SATTRTIME_TOCLIENT);
     				txdr_nfsv4time(&vap->va_atime, tl);
    @@ -2424,8 +2422,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd
     			retnum += NFSX_V4TIME;
     			break;
     		case NFSATTRBIT_TIMEMODIFYSET:
    -			NFSGETTIME(&curtime);
    -			if (vap->va_mtime.tv_sec != curtime.tv_sec) {
    +			if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
     				NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME);
     				*tl++ = txdr_unsigned(NFSV4SATTRTIME_TOCLIENT);
     				txdr_nfsv4time(&vap->va_mtime, tl);
    
    Modified: stable/9/sys/fs/nfs/nfsport.h
    ==============================================================================
    --- stable/9/sys/fs/nfs/nfsport.h	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/fs/nfs/nfsport.h	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -526,12 +526,6 @@ void nfsrvd_rcv(struct socket *, void *,
     #define	NCHNAMLEN	9999999
     
     /*
    - * Define these to use the time of day clock.
    - */
    -#define	NFSGETTIME(t)		(getmicrotime(t))
    -#define	NFSGETNANOTIME(t)	(getnanotime(t))
    -
    -/*
      * These macros are defined to initialize and set the timer routine.
      */
     #define	NFS_TIMERINIT \
    
    Modified: stable/9/sys/fs/nfsclient/nfs_clport.c
    ==============================================================================
    --- stable/9/sys/fs/nfsclient/nfs_clport.c	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/fs/nfsclient/nfs_clport.c	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -732,7 +732,6 @@ nfscl_fillsattr(struct nfsrv_descript *n
     	u_int32_t *tl;
     	struct nfsv2_sattr *sp;
     	nfsattrbit_t attrbits;
    -	struct timeval curtime;
     
     	switch (nd->nd_flag & (ND_NFSV2 | ND_NFSV3 | ND_NFSV4)) {
     	case ND_NFSV2:
    @@ -761,7 +760,6 @@ nfscl_fillsattr(struct nfsrv_descript *n
     		txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
     		break;
     	case ND_NFSV3:
    -		getmicrotime(&curtime);
     		if (vap->va_mode != (mode_t)VNOVAL) {
     			NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
     			*tl++ = newnfs_true;
    @@ -795,7 +793,7 @@ nfscl_fillsattr(struct nfsrv_descript *n
     			*tl = newnfs_false;
     		}
     		if (vap->va_atime.tv_sec != VNOVAL) {
    -			if (vap->va_atime.tv_sec != curtime.tv_sec) {
    +			if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
     				NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
     				*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
     				txdr_nfsv3time(&vap->va_atime, tl);
    @@ -808,7 +806,7 @@ nfscl_fillsattr(struct nfsrv_descript *n
     			*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
     		}
     		if (vap->va_mtime.tv_sec != VNOVAL) {
    -			if (vap->va_mtime.tv_sec != curtime.tv_sec) {
    +			if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
     				NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
     				*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
     				txdr_nfsv3time(&vap->va_mtime, tl);
    
    Modified: stable/9/sys/fs/nfsclient/nfs_clstate.c
    ==============================================================================
    --- stable/9/sys/fs/nfsclient/nfs_clstate.c	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/fs/nfsclient/nfs_clstate.c	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -2394,7 +2394,7 @@ nfscl_renewthread(struct nfsclclient *cl
     	u_int32_t clidrev;
     	int error, cbpathdown, islept, igotlock, ret, clearok;
     	uint32_t recover_done_time = 0;
    -	struct timespec mytime;
    +	time_t mytime;
     	static time_t prevsec = 0;
     	struct nfscllockownerfh *lfhp, *nlfhp;
     	struct nfscllockownerfhhead lfh;
    @@ -2559,9 +2559,9 @@ tryagain:
     		 * Call nfscl_cleanupkext() once per second to check for
     		 * open/lock owners where the process has exited.
     		 */
    -		NFSGETNANOTIME(&mytime);
    -		if (prevsec != mytime.tv_sec) {
    -			prevsec = mytime.tv_sec;
    +		mytime = NFSD_MONOSEC;
    +		if (prevsec != mytime) {
    +			prevsec = mytime;
     			nfscl_cleanupkext(clp, &lfh);
     		}
     
    @@ -4174,7 +4174,7 @@ nfscl_delegmodtime(vnode_t vp)
     	}
     	dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len);
     	if (dp != NULL && (dp->nfsdl_flags & NFSCLDL_WRITE)) {
    -		NFSGETNANOTIME(&dp->nfsdl_modtime);
    +		nanotime(&dp->nfsdl_modtime);
     		dp->nfsdl_flags |= NFSCLDL_MODTIMESET;
     	}
     	NFSUNLOCKCLSTATE();
    
    Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c
    ==============================================================================
    --- stable/9/sys/fs/nfsclient/nfs_clvnops.c	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/fs/nfsclient/nfs_clvnops.c	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -3229,7 +3229,7 @@ nfsfifo_read(struct vop_read_args *ap)
     	 */
     	mtx_lock(&np->n_mtx);
     	np->n_flag |= NACC;
    -	getnanotime(&np->n_atim);
    +	vfs_timestamp(&np->n_atim);
     	mtx_unlock(&np->n_mtx);
     	error = fifo_specops.vop_read(ap);
     	return error;	
    @@ -3248,7 +3248,7 @@ nfsfifo_write(struct vop_write_args *ap)
     	 */
     	mtx_lock(&np->n_mtx);
     	np->n_flag |= NUPD;
    -	getnanotime(&np->n_mtim);
    +	vfs_timestamp(&np->n_mtim);
     	mtx_unlock(&np->n_mtx);
     	return(fifo_specops.vop_write(ap));
     }
    @@ -3268,7 +3268,7 @@ nfsfifo_close(struct vop_close_args *ap)
     
     	mtx_lock(&np->n_mtx);
     	if (np->n_flag & (NACC | NUPD)) {
    -		getnanotime(&ts);
    +		vfs_timestamp(&ts);
     		if (np->n_flag & NACC)
     			np->n_atim = ts;
     		if (np->n_flag & NUPD)
    
    Modified: stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c
    ==============================================================================
    --- stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/fs/nfsserver/nfs_nfsdkrpc.c	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -310,7 +310,6 @@ nfs_proc(struct nfsrv_descript *nd, u_in
     	} else {
     		isdgram = 1;
     	}
    -	NFSGETTIME(&nd->nd_starttime);
     
     	/*
     	 * Two cases:
    
    Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c
    ==============================================================================
    --- stable/9/sys/fs/nfsserver/nfs_nfsdport.c	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/fs/nfsserver/nfs_nfsdport.c	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -1477,7 +1477,7 @@ nfsvno_updfilerev(struct vnode *vp, stru
     	struct vattr va;
     
     	VATTR_NULL(&va);
    -	getnanotime(&va.va_mtime);
    +	vfs_timestamp(&va.va_mtime);
     	(void) VOP_SETATTR(vp, &va, cred);
     	(void) nfsvno_getattr(vp, nvap, cred, p, 1);
     }
    @@ -2250,7 +2250,6 @@ nfsrv_sattr(struct nfsrv_descript *nd, s
     {
     	u_int32_t *tl;
     	struct nfsv2_sattr *sp;
    -	struct timeval curtime;
     	int error = 0, toclient = 0;
     
     	switch (nd->nd_flag & (ND_NFSV2 | ND_NFSV3 | ND_NFSV4)) {
    @@ -2309,9 +2308,7 @@ nfsrv_sattr(struct nfsrv_descript *nd, s
     			toclient = 1;
     			break;
     		case NFSV3SATTRTIME_TOSERVER:
    -			NFSGETTIME(&curtime);
    -			nvap->na_atime.tv_sec = curtime.tv_sec;
    -			nvap->na_atime.tv_nsec = curtime.tv_usec * 1000;
    +			vfs_timestamp(&nvap->na_atime);
     			nvap->na_vaflags |= VA_UTIMES_NULL;
     			break;
     		};
    @@ -2323,9 +2320,7 @@ nfsrv_sattr(struct nfsrv_descript *nd, s
     			nvap->na_vaflags &= ~VA_UTIMES_NULL;
     			break;
     		case NFSV3SATTRTIME_TOSERVER:
    -			NFSGETTIME(&curtime);
    -			nvap->na_mtime.tv_sec = curtime.tv_sec;
    -			nvap->na_mtime.tv_nsec = curtime.tv_usec * 1000;
    +			vfs_timestamp(&nvap->na_mtime);
     			if (!toclient)
     				nvap->na_vaflags |= VA_UTIMES_NULL;
     			break;
    @@ -2355,7 +2350,6 @@ nfsv4_sattr(struct nfsrv_descript *nd, s
     	u_char *cp, namestr[NFSV4_SMALLSTR + 1];
     	uid_t uid;
     	gid_t gid;
    -	struct timeval curtime;
     
     	error = nfsrv_getattrbits(nd, attrbitp, NULL, &retnotsup);
     	if (error)
    @@ -2490,9 +2484,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, s
     			    toclient = 1;
     			    attrsum += NFSX_V4TIME;
     			} else {
    -			    NFSGETTIME(&curtime);
    -			    nvap->na_atime.tv_sec = curtime.tv_sec;
    -			    nvap->na_atime.tv_nsec = curtime.tv_usec * 1000;
    +			    vfs_timestamp(&nvap->na_atime);
     			    nvap->na_vaflags |= VA_UTIMES_NULL;
     			}
     			break;
    @@ -2517,9 +2509,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, s
     			    nvap->na_vaflags &= ~VA_UTIMES_NULL;
     			    attrsum += NFSX_V4TIME;
     			} else {
    -			    NFSGETTIME(&curtime);
    -			    nvap->na_mtime.tv_sec = curtime.tv_sec;
    -			    nvap->na_mtime.tv_nsec = curtime.tv_usec * 1000;
    +			    vfs_timestamp(&nvap->na_mtime);
     			    if (!toclient)
     				nvap->na_vaflags |= VA_UTIMES_NULL;
     			}
    
    Modified: stable/9/sys/fs/nfsserver/nfs_nfsdstate.c
    ==============================================================================
    --- stable/9/sys/fs/nfsserver/nfs_nfsdstate.c	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/fs/nfsserver/nfs_nfsdstate.c	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -3966,7 +3966,6 @@ nfsrv_setupstable(NFSPROC_T *p)
     	int error, i, tryagain;
     	off_t off = 0;
     	ssize_t aresid, len;
    -	struct timeval curtime;
     
     	/*
     	 * If NFSNSF_UPDATEDONE is set, this is a restart of the nfsds without
    @@ -3977,8 +3976,7 @@ nfsrv_setupstable(NFSPROC_T *p)
     	/*
     	 * Set Grace over just until the file reads successfully.
     	 */
    -	NFSGETTIME(&curtime);
    -	nfsrvboottime = curtime.tv_sec;
    +	nfsrvboottime = time_second;
     	LIST_INIT(&sf->nsf_head);
     	sf->nsf_flags = (NFSNSF_GRACEOVER | NFSNSF_NEEDLOCK);
     	sf->nsf_eograce = NFSD_MONOSEC + NFSRV_LEASEDELTA;
    @@ -4649,8 +4647,7 @@ out:
     APPLESTATIC void
     nfsd_recalldelegation(vnode_t vp, NFSPROC_T *p)
     {
    -	struct timespec mytime;
    -	int32_t starttime;
    +	time_t starttime;
     	int error;
     
     	/*
    @@ -4674,8 +4671,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO
     	 * Now, call nfsrv_checkremove() in a loop while it returns
     	 * NFSERR_DELAY. Return upon any other error or when timed out.
     	 */
    -	NFSGETNANOTIME(&mytime);
    -	starttime = (u_int32_t)mytime.tv_sec;
    +	starttime = NFSD_MONOSEC;
     	do {
     		if (NFSVOPLOCK(vp, LK_EXCLUSIVE) == 0) {
     			error = nfsrv_checkremove(vp, 0, p);
    @@ -4683,11 +4679,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO
     		} else
     			error = EPERM;
     		if (error == NFSERR_DELAY) {
    -			NFSGETNANOTIME(&mytime);
    -			if (((u_int32_t)mytime.tv_sec - starttime) >
    -			    NFS_REMOVETIMEO &&
    -			    ((u_int32_t)mytime.tv_sec - starttime) <
    -			    100000)
    +			if (NFSD_MONOSEC - starttime > NFS_REMOVETIMEO)
     				break;
     			/* Sleep for a short period of time */
     			(void) nfs_catnap(PZERO, 0, "nfsremove");
    @@ -4948,9 +4940,7 @@ nfsrv_notsamecredname(struct nfsrv_descr
     static time_t
     nfsrv_leaseexpiry(void)
     {
    -	struct timeval curtime;
     
    -	NFSGETTIME(&curtime);
     	if (nfsrv_stablefirst.nsf_eograce > NFSD_MONOSEC)
     		return (NFSD_MONOSEC + 2 * (nfsrv_lease + NFSRV_LEASEDELTA));
     	return (NFSD_MONOSEC + nfsrv_lease + NFSRV_LEASEDELTA);
    
    Modified: stable/9/sys/nfs/nfs_common.c
    ==============================================================================
    --- stable/9/sys/nfs/nfs_common.c	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/nfs/nfs_common.c	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -90,15 +90,6 @@ static int nfs_realign_count;
     SYSCTL_INT(_vfs_nfs_common, OID_AUTO, realign_count, CTLFLAG_RD,
         &nfs_realign_count, 0, "Number of mbuf realignments done");
     
    -u_quad_t
    -nfs_curusec(void)
    -{
    -	struct timeval tv;
    -
    -	getmicrotime(&tv);
    -	return ((u_quad_t)tv.tv_sec * 1000000 + (u_quad_t)tv.tv_usec);
    -}
    -
     /*
      * copies mbuf chain to the uio scatter/gather list
      */
    
    Modified: stable/9/sys/nfs/nfs_common.h
    ==============================================================================
    --- stable/9/sys/nfs/nfs_common.h	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/nfs/nfs_common.h	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -46,7 +46,6 @@ extern nfstype nfsv3_type[];
     #define	vtonfsv3_type(a)	txdr_unsigned(nfsv3_type[((int32_t)(a))])
     
     int	nfs_adv(struct mbuf **, caddr_t *, int, int);
    -u_quad_t nfs_curusec(void);
     void	*nfsm_disct(struct mbuf **, caddr_t *, int, int, int);
     int	nfs_realign(struct mbuf **, int);
     
    
    Modified: stable/9/sys/nfsclient/nfs_krpc.c
    ==============================================================================
    --- stable/9/sys/nfsclient/nfs_krpc.c	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/nfsclient/nfs_krpc.c	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -394,18 +394,17 @@ nfs_feedback(int type, int proc, void *a
     {
     	struct nfs_feedback_arg *nf = (struct nfs_feedback_arg *) arg;
     	struct nfsmount *nmp = nf->nf_mount;
    -	struct timeval now;
    -
    -	getmicrouptime(&now);
    +	time_t now;
     
     	switch (type) {
     	case FEEDBACK_REXMIT2:
     	case FEEDBACK_RECONNECT:
    -		if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now.tv_sec) {
    +		now = time_uptime;
    +		if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now) {
     			nfs_down(nmp, nf->nf_td,
     			    "not responding", 0, NFSSTA_TIMEO);
     			nf->nf_tprintfmsg = TRUE;
    -			nf->nf_lastmsg = now.tv_sec;
    +			nf->nf_lastmsg = now;
     		}
     		break;
     
    @@ -438,7 +437,6 @@ nfs_request(struct vnode *vp, struct mbu
     	time_t waituntil;
     	caddr_t dpos;
     	int error = 0, timeo;
    -	struct timeval now;
     	AUTH *auth = NULL;
     	enum nfs_rto_timer_t timer;
     	struct nfs_feedback_arg nf;
    @@ -455,8 +453,7 @@ nfs_request(struct vnode *vp, struct mbu
     	bzero(&nf, sizeof(struct nfs_feedback_arg));
     	nf.nf_mount = nmp;
     	nf.nf_td = td;
    -	getmicrouptime(&now);
    -	nf.nf_lastmsg = now.tv_sec -
    +	nf.nf_lastmsg = time_uptime -
     	    ((nmp->nm_tprintf_delay) - (nmp->nm_tprintf_initial_delay));
     
     	/*
    
    Modified: stable/9/sys/nfsclient/nfs_subs.c
    ==============================================================================
    --- stable/9/sys/nfsclient/nfs_subs.c	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/nfsclient/nfs_subs.c	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -1110,7 +1110,7 @@ nfsm_v3attrbuild_xx(struct vattr *va, in
     		*tl = nfs_false;
     	}
     	if (va->va_atime.tv_sec != VNOVAL) {
    -		if (va->va_atime.tv_sec != time_second) {
    +		if ((va->va_vaflags & VA_UTIMES_NULL) == 0) {
     			tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos);
     			*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
     			txdr_nfsv3time(&va->va_atime, tl);
    @@ -1123,7 +1123,7 @@ nfsm_v3attrbuild_xx(struct vattr *va, in
     		*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
     	}
     	if (va->va_mtime.tv_sec != VNOVAL) {
    -		if (va->va_mtime.tv_sec != time_second) {
    +		if ((va->va_vaflags & VA_UTIMES_NULL) == 0) {
     			tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos);
     			*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
     			txdr_nfsv3time(&va->va_mtime, tl);
    
    Modified: stable/9/sys/nfsclient/nfs_vnops.c
    ==============================================================================
    --- stable/9/sys/nfsclient/nfs_vnops.c	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/nfsclient/nfs_vnops.c	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -3460,7 +3460,7 @@ nfsfifo_read(struct vop_read_args *ap)
     	 */
     	mtx_lock(&np->n_mtx);
     	np->n_flag |= NACC;
    -	getnanotime(&np->n_atim);
    +	vfs_timestamp(&np->n_atim);
     	mtx_unlock(&np->n_mtx);
     	error = fifo_specops.vop_read(ap);
     	return error;	
    @@ -3479,7 +3479,7 @@ nfsfifo_write(struct vop_write_args *ap)
     	 */
     	mtx_lock(&np->n_mtx);
     	np->n_flag |= NUPD;
    -	getnanotime(&np->n_mtim);
    +	vfs_timestamp(&np->n_mtim);
     	mtx_unlock(&np->n_mtx);
     	return(fifo_specops.vop_write(ap));
     }
    @@ -3499,7 +3499,7 @@ nfsfifo_close(struct vop_close_args *ap)
     
     	mtx_lock(&np->n_mtx);
     	if (np->n_flag & (NACC | NUPD)) {
    -		getnanotime(&ts);
    +		vfs_timestamp(&ts);
     		if (np->n_flag & NACC)
     			np->n_atim = ts;
     		if (np->n_flag & NUPD)
    
    Modified: stable/9/sys/nfsserver/nfs_srvsubs.c
    ==============================================================================
    --- stable/9/sys/nfsserver/nfs_srvsubs.c	Thu Feb 28 21:55:57 2013	(r247501)
    +++ stable/9/sys/nfsserver/nfs_srvsubs.c	Thu Feb 28 21:57:38 2013	(r247502)
    @@ -1430,7 +1430,7 @@ nfsm_srvsattr_xx(struct vattr *a, struct
     		toclient = 1;
     		break;
     	case NFSV3SATTRTIME_TOSERVER:
    -		getnanotime(&(a)->va_atime);
    +		vfs_timestamp(&a->va_atime);
     		a->va_vaflags |= VA_UTIMES_NULL;
     		break;
     	}
    @@ -1446,7 +1446,7 @@ nfsm_srvsattr_xx(struct vattr *a, struct
     		a->va_vaflags &= ~VA_UTIMES_NULL;
     		break;
     	case NFSV3SATTRTIME_TOSERVER:
    -		getnanotime(&(a)->va_mtime);
    +		vfs_timestamp(&a->va_mtime);
     		if (toclient == 0)
     			a->va_vaflags |= VA_UTIMES_NULL;
     		break;
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 21:58:11 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 1FAFCACA;
     Thu, 28 Feb 2013 21:58:11 +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 03DF8638;
     Thu, 28 Feb 2013 21:58:11 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SLwAO2064515;
     Thu, 28 Feb 2013 21:58:11 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SLw7cA064499;
     Thu, 28 Feb 2013 21:58:07 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201302282158.r1SLw7cA064499@svn.freebsd.org>
    From: John Baldwin 
    Date: Thu, 28 Feb 2013 21:58:07 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247503 - in stable/8/sys: fs/nfs fs/nfsclient
     fs/nfsserver nfs nfsclient nfsserver
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 21:58:11 -0000
    
    Author: jhb
    Date: Thu Feb 28 21:58:07 2013
    New Revision: 247503
    URL: http://svnweb.freebsd.org/changeset/base/247503
    
    Log:
      MFC 245508,245566,245568,245611,245909:
      Various fixes to timestamps in NFS:
      - Use the VA_UTIMES_NULL flag to detect when NULL was passed to utimes()
        instead of comparing the desired time against the current time as a
        heuristic.
      - Remove unused nfs_curusec().
      - Use vfs_timestamp() to set file timestamps rather than invoking
        getmicrotime() or getnanotime() directly in NFS.
      - Use NFSD_MONOSEC (which maps to time_uptime) instead of the seconds
        portion of wall-time stamps to manage timeouts on events.
      - Remove unused nd_starttime from the per-request structure in the new
        NFS server.
      - Use nanotime() for the modification time on a delegation to get as
        precise a time as possible.
      - Use time_second instead of extracting the second from a call to
        getmicrotime().
    
    Modified:
      stable/8/sys/fs/nfs/nfs.h
      stable/8/sys/fs/nfs/nfs_commonkrpc.c
      stable/8/sys/fs/nfs/nfs_commonsubs.c
      stable/8/sys/fs/nfs/nfsport.h
      stable/8/sys/fs/nfsclient/nfs_clport.c
      stable/8/sys/fs/nfsclient/nfs_clstate.c
      stable/8/sys/fs/nfsclient/nfs_clvnops.c
      stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c
      stable/8/sys/fs/nfsserver/nfs_nfsdport.c
      stable/8/sys/fs/nfsserver/nfs_nfsdstate.c
      stable/8/sys/nfs/nfs_common.c
      stable/8/sys/nfs/nfs_common.h
      stable/8/sys/nfsclient/nfs_krpc.c
      stable/8/sys/nfsclient/nfs_subs.c
      stable/8/sys/nfsclient/nfs_vnops.c
      stable/8/sys/nfsserver/nfs_srvsubs.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/fs/   (props changed)
      stable/8/sys/nfs/   (props changed)
      stable/8/sys/nfsclient/   (props changed)
      stable/8/sys/nfsserver/   (props changed)
    
    Modified: stable/8/sys/fs/nfs/nfs.h
    ==============================================================================
    --- stable/8/sys/fs/nfs/nfs.h	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/fs/nfs/nfs.h	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -519,7 +519,6 @@ struct nfsrv_descript {
     	int			*nd_errp;	/* Pointer to ret status */
     	u_int32_t		nd_retxid;	/* Reply xid */
     	struct nfsrvcache	*nd_rp;		/* Assoc. cache entry */
    -	struct timeval		nd_starttime;	/* Time RPC initiated */
     	fhandle_t		nd_fh;		/* File handle */
     	struct ucred		*nd_cred;	/* Credentials */
     	uid_t			nd_saveduid;	/* Saved uid */
    
    Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c
    ==============================================================================
    --- stable/8/sys/fs/nfs/nfs_commonkrpc.c	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -413,18 +413,17 @@ nfs_feedback(int type, int proc, void *a
     {
     	struct nfs_feedback_arg *nf = (struct nfs_feedback_arg *) arg;
     	struct nfsmount *nmp = nf->nf_mount;
    -	struct timeval now;
    -
    -	getmicrouptime(&now);
    +	time_t now;
     
     	switch (type) {
     	case FEEDBACK_REXMIT2:
     	case FEEDBACK_RECONNECT:
    -		if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now.tv_sec) {
    +		now = NFSD_MONOSEC;
    +		if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now) {
     			nfs_down(nmp, nf->nf_td,
     			    "not responding", 0, NFSSTA_TIMEO);
     			nf->nf_tprintfmsg = TRUE;
    -			nf->nf_lastmsg = now.tv_sec;
    +			nf->nf_lastmsg = now;
     		}
     		break;
     
    @@ -454,7 +453,7 @@ newnfs_request(struct nfsrv_descript *nd
     	u_int16_t procnum;
     	u_int trylater_delay = 1;
     	struct nfs_feedback_arg nf;
    -	struct timeval timo, now;
    +	struct timeval timo;
     	AUTH *auth;
     	struct rpc_callextra ext;
     	enum clnt_stat stat;
    @@ -570,8 +569,7 @@ newnfs_request(struct nfsrv_descript *nd
     		bzero(&nf, sizeof(struct nfs_feedback_arg));
     		nf.nf_mount = nmp;
     		nf.nf_td = td;
    -		getmicrouptime(&now);
    -		nf.nf_lastmsg = now.tv_sec -
    +		nf.nf_lastmsg = NFSD_MONOSEC -
     		    ((nmp->nm_tprintf_delay)-(nmp->nm_tprintf_initial_delay));
     	}
     
    
    Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c
    ==============================================================================
    --- stable/8/sys/fs/nfs/nfs_commonsubs.c	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/fs/nfs/nfs_commonsubs.c	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -1979,7 +1979,6 @@ nfsv4_fillattr(struct nfsrv_descript *nd
     	struct statfs fs;
     	struct nfsfsinfo fsinf;
     	struct timespec temptime;
    -	struct timeval curtime;
     	NFSACL_T *aclp, *naclp = NULL;
     #ifdef QUOTA
     	struct dqblk dqb;
    @@ -2393,8 +2392,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd
     			retnum += NFSX_V4TIME;
     			break;
     		case NFSATTRBIT_TIMEACCESSSET:
    -			NFSGETTIME(&curtime);
    -			if (vap->va_atime.tv_sec != curtime.tv_sec) {
    +			if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
     				NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME);
     				*tl++ = txdr_unsigned(NFSV4SATTRTIME_TOCLIENT);
     				txdr_nfsv4time(&vap->va_atime, tl);
    @@ -2423,8 +2421,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd
     			retnum += NFSX_V4TIME;
     			break;
     		case NFSATTRBIT_TIMEMODIFYSET:
    -			NFSGETTIME(&curtime);
    -			if (vap->va_mtime.tv_sec != curtime.tv_sec) {
    +			if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
     				NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME);
     				*tl++ = txdr_unsigned(NFSV4SATTRTIME_TOCLIENT);
     				txdr_nfsv4time(&vap->va_mtime, tl);
    
    Modified: stable/8/sys/fs/nfs/nfsport.h
    ==============================================================================
    --- stable/8/sys/fs/nfs/nfsport.h	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/fs/nfs/nfsport.h	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -522,12 +522,6 @@ void nfsrvd_rcv(struct socket *, void *,
     #define	NCHNAMLEN	9999999
     
     /*
    - * Define these to use the time of day clock.
    - */
    -#define	NFSGETTIME(t)		(getmicrotime(t))
    -#define	NFSGETNANOTIME(t)	(getnanotime(t))
    -
    -/*
      * These macros are defined to initialize and set the timer routine.
      */
     #define	NFS_TIMERINIT \
    
    Modified: stable/8/sys/fs/nfsclient/nfs_clport.c
    ==============================================================================
    --- stable/8/sys/fs/nfsclient/nfs_clport.c	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/fs/nfsclient/nfs_clport.c	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -702,7 +702,6 @@ nfscl_fillsattr(struct nfsrv_descript *n
     	u_int32_t *tl;
     	struct nfsv2_sattr *sp;
     	nfsattrbit_t attrbits;
    -	struct timeval curtime;
     
     	switch (nd->nd_flag & (ND_NFSV2 | ND_NFSV3 | ND_NFSV4)) {
     	case ND_NFSV2:
    @@ -731,7 +730,6 @@ nfscl_fillsattr(struct nfsrv_descript *n
     		txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
     		break;
     	case ND_NFSV3:
    -		getmicrotime(&curtime);
     		if (vap->va_mode != (mode_t)VNOVAL) {
     			NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
     			*tl++ = newnfs_true;
    @@ -765,7 +763,7 @@ nfscl_fillsattr(struct nfsrv_descript *n
     			*tl = newnfs_false;
     		}
     		if (vap->va_atime.tv_sec != VNOVAL) {
    -			if (vap->va_atime.tv_sec != curtime.tv_sec) {
    +			if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
     				NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
     				*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
     				txdr_nfsv3time(&vap->va_atime, tl);
    @@ -778,7 +776,7 @@ nfscl_fillsattr(struct nfsrv_descript *n
     			*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
     		}
     		if (vap->va_mtime.tv_sec != VNOVAL) {
    -			if (vap->va_mtime.tv_sec != curtime.tv_sec) {
    +			if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
     				NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
     				*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
     				txdr_nfsv3time(&vap->va_mtime, tl);
    
    Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c
    ==============================================================================
    --- stable/8/sys/fs/nfsclient/nfs_clstate.c	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/fs/nfsclient/nfs_clstate.c	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -2394,7 +2394,7 @@ nfscl_renewthread(struct nfsclclient *cl
     	u_int32_t clidrev;
     	int error, cbpathdown, islept, igotlock, ret, clearok;
     	uint32_t recover_done_time = 0;
    -	struct timespec mytime;
    +	time_t mytime;
     	static time_t prevsec = 0;
     	struct nfscllockownerfh *lfhp, *nlfhp;
     	struct nfscllockownerfhhead lfh;
    @@ -2559,9 +2559,9 @@ tryagain:
     		 * Call nfscl_cleanupkext() once per second to check for
     		 * open/lock owners where the process has exited.
     		 */
    -		NFSGETNANOTIME(&mytime);
    -		if (prevsec != mytime.tv_sec) {
    -			prevsec = mytime.tv_sec;
    +		mytime = NFSD_MONOSEC;
    +		if (prevsec != mytime) {
    +			prevsec = mytime;
     			nfscl_cleanupkext(clp, &lfh);
     		}
     
    @@ -4174,7 +4174,7 @@ nfscl_delegmodtime(vnode_t vp)
     	}
     	dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len);
     	if (dp != NULL && (dp->nfsdl_flags & NFSCLDL_WRITE)) {
    -		NFSGETNANOTIME(&dp->nfsdl_modtime);
    +		nanotime(&dp->nfsdl_modtime);
     		dp->nfsdl_flags |= NFSCLDL_MODTIMESET;
     	}
     	NFSUNLOCKCLSTATE();
    
    Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c
    ==============================================================================
    --- stable/8/sys/fs/nfsclient/nfs_clvnops.c	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -3162,7 +3162,7 @@ nfsfifo_read(struct vop_read_args *ap)
     	 */
     	mtx_lock(&np->n_mtx);
     	np->n_flag |= NACC;
    -	getnanotime(&np->n_atim);
    +	vfs_timestamp(&np->n_atim);
     	mtx_unlock(&np->n_mtx);
     	error = fifo_specops.vop_read(ap);
     	return error;	
    @@ -3181,7 +3181,7 @@ nfsfifo_write(struct vop_write_args *ap)
     	 */
     	mtx_lock(&np->n_mtx);
     	np->n_flag |= NUPD;
    -	getnanotime(&np->n_mtim);
    +	vfs_timestamp(&np->n_mtim);
     	mtx_unlock(&np->n_mtx);
     	return(fifo_specops.vop_write(ap));
     }
    @@ -3201,7 +3201,7 @@ nfsfifo_close(struct vop_close_args *ap)
     
     	mtx_lock(&np->n_mtx);
     	if (np->n_flag & (NACC | NUPD)) {
    -		getnanotime(&ts);
    +		vfs_timestamp(&ts);
     		if (np->n_flag & NACC)
     			np->n_atim = ts;
     		if (np->n_flag & NUPD)
    
    Modified: stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c
    ==============================================================================
    --- stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -290,7 +290,6 @@ nfs_proc(struct nfsrv_descript *nd, u_in
     	} else {
     		isdgram = 1;
     	}
    -	NFSGETTIME(&nd->nd_starttime);
     
     	/*
     	 * Two cases:
    
    Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c
    ==============================================================================
    --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -1471,7 +1471,7 @@ nfsvno_updfilerev(struct vnode *vp, stru
     	struct vattr va;
     
     	VATTR_NULL(&va);
    -	getnanotime(&va.va_mtime);
    +	vfs_timestamp(&va.va_mtime);
     	(void) VOP_SETATTR(vp, &va, cred);
     	(void) nfsvno_getattr(vp, nvap, cred, p, 1);
     }
    @@ -2244,7 +2244,6 @@ nfsrv_sattr(struct nfsrv_descript *nd, s
     {
     	u_int32_t *tl;
     	struct nfsv2_sattr *sp;
    -	struct timeval curtime;
     	int error = 0, toclient = 0;
     
     	switch (nd->nd_flag & (ND_NFSV2 | ND_NFSV3 | ND_NFSV4)) {
    @@ -2303,9 +2302,7 @@ nfsrv_sattr(struct nfsrv_descript *nd, s
     			toclient = 1;
     			break;
     		case NFSV3SATTRTIME_TOSERVER:
    -			NFSGETTIME(&curtime);
    -			nvap->na_atime.tv_sec = curtime.tv_sec;
    -			nvap->na_atime.tv_nsec = curtime.tv_usec * 1000;
    +			vfs_timestamp(&nvap->na_atime);
     			nvap->na_vaflags |= VA_UTIMES_NULL;
     			break;
     		};
    @@ -2317,9 +2314,7 @@ nfsrv_sattr(struct nfsrv_descript *nd, s
     			nvap->na_vaflags &= ~VA_UTIMES_NULL;
     			break;
     		case NFSV3SATTRTIME_TOSERVER:
    -			NFSGETTIME(&curtime);
    -			nvap->na_mtime.tv_sec = curtime.tv_sec;
    -			nvap->na_mtime.tv_nsec = curtime.tv_usec * 1000;
    +			vfs_timestamp(&nvap->na_mtime);
     			if (!toclient)
     				nvap->na_vaflags |= VA_UTIMES_NULL;
     			break;
    @@ -2349,7 +2344,6 @@ nfsv4_sattr(struct nfsrv_descript *nd, s
     	u_char *cp, namestr[NFSV4_SMALLSTR + 1];
     	uid_t uid;
     	gid_t gid;
    -	struct timeval curtime;
     
     	error = nfsrv_getattrbits(nd, attrbitp, NULL, &retnotsup);
     	if (error)
    @@ -2484,9 +2478,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, s
     			    toclient = 1;
     			    attrsum += NFSX_V4TIME;
     			} else {
    -			    NFSGETTIME(&curtime);
    -			    nvap->na_atime.tv_sec = curtime.tv_sec;
    -			    nvap->na_atime.tv_nsec = curtime.tv_usec * 1000;
    +			    vfs_timestamp(&nvap->na_atime);
     			    nvap->na_vaflags |= VA_UTIMES_NULL;
     			}
     			break;
    @@ -2511,9 +2503,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, s
     			    nvap->na_vaflags &= ~VA_UTIMES_NULL;
     			    attrsum += NFSX_V4TIME;
     			} else {
    -			    NFSGETTIME(&curtime);
    -			    nvap->na_mtime.tv_sec = curtime.tv_sec;
    -			    nvap->na_mtime.tv_nsec = curtime.tv_usec * 1000;
    +			    vfs_timestamp(&nvap->na_mtime);
     			    if (!toclient)
     				nvap->na_vaflags |= VA_UTIMES_NULL;
     			}
    
    Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c
    ==============================================================================
    --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -3966,7 +3966,6 @@ nfsrv_setupstable(NFSPROC_T *p)
     	int error, i, tryagain;
     	off_t off = 0;
     	int aresid, len;
    -	struct timeval curtime;
     
     	/*
     	 * If NFSNSF_UPDATEDONE is set, this is a restart of the nfsds without
    @@ -3977,8 +3976,7 @@ nfsrv_setupstable(NFSPROC_T *p)
     	/*
     	 * Set Grace over just until the file reads successfully.
     	 */
    -	NFSGETTIME(&curtime);
    -	nfsrvboottime = curtime.tv_sec;
    +	nfsrvboottime = time_second;
     	LIST_INIT(&sf->nsf_head);
     	sf->nsf_flags = (NFSNSF_GRACEOVER | NFSNSF_NEEDLOCK);
     	sf->nsf_eograce = NFSD_MONOSEC + NFSRV_LEASEDELTA;
    @@ -4649,8 +4647,7 @@ out:
     APPLESTATIC void
     nfsd_recalldelegation(vnode_t vp, NFSPROC_T *p)
     {
    -	struct timespec mytime;
    -	int32_t starttime;
    +	time_t starttime;
     	int error;
     
     	/*
    @@ -4674,8 +4671,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO
     	 * Now, call nfsrv_checkremove() in a loop while it returns
     	 * NFSERR_DELAY. Return upon any other error or when timed out.
     	 */
    -	NFSGETNANOTIME(&mytime);
    -	starttime = (u_int32_t)mytime.tv_sec;
    +	starttime = NFSD_MONOSEC;
     	do {
     		if (NFSVOPLOCK(vp, LK_EXCLUSIVE) == 0) {
     			error = nfsrv_checkremove(vp, 0, p);
    @@ -4683,11 +4679,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO
     		} else
     			error = EPERM;
     		if (error == NFSERR_DELAY) {
    -			NFSGETNANOTIME(&mytime);
    -			if (((u_int32_t)mytime.tv_sec - starttime) >
    -			    NFS_REMOVETIMEO &&
    -			    ((u_int32_t)mytime.tv_sec - starttime) <
    -			    100000)
    +			if (NFSD_MONOSEC - starttime > NFS_REMOVETIMEO)
     				break;
     			/* Sleep for a short period of time */
     			(void) nfs_catnap(PZERO, 0, "nfsremove");
    @@ -4948,9 +4940,7 @@ nfsrv_notsamecredname(struct nfsrv_descr
     static time_t
     nfsrv_leaseexpiry(void)
     {
    -	struct timeval curtime;
     
    -	NFSGETTIME(&curtime);
     	if (nfsrv_stablefirst.nsf_eograce > NFSD_MONOSEC)
     		return (NFSD_MONOSEC + 2 * (nfsrv_lease + NFSRV_LEASEDELTA));
     	return (NFSD_MONOSEC + nfsrv_lease + NFSRV_LEASEDELTA);
    
    Modified: stable/8/sys/nfs/nfs_common.c
    ==============================================================================
    --- stable/8/sys/nfs/nfs_common.c	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/nfs/nfs_common.c	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -90,15 +90,6 @@ static int nfs_realign_count;
     SYSCTL_INT(_vfs_nfs_common, OID_AUTO, realign_count, CTLFLAG_RD,
         &nfs_realign_count, 0, "Number of mbuf realignments done");
     
    -u_quad_t
    -nfs_curusec(void)
    -{
    -	struct timeval tv;
    -
    -	getmicrotime(&tv);
    -	return ((u_quad_t)tv.tv_sec * 1000000 + (u_quad_t)tv.tv_usec);
    -}
    -
     /*
      * copies mbuf chain to the uio scatter/gather list
      */
    
    Modified: stable/8/sys/nfs/nfs_common.h
    ==============================================================================
    --- stable/8/sys/nfs/nfs_common.h	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/nfs/nfs_common.h	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -46,7 +46,6 @@ extern nfstype nfsv3_type[];
     #define	vtonfsv3_type(a)	txdr_unsigned(nfsv3_type[((int32_t)(a))])
     
     int	nfs_adv(struct mbuf **, caddr_t *, int, int);
    -u_quad_t nfs_curusec(void);
     void	*nfsm_disct(struct mbuf **, caddr_t *, int, int, int);
     int	nfs_realign(struct mbuf **, int);
     
    
    Modified: stable/8/sys/nfsclient/nfs_krpc.c
    ==============================================================================
    --- stable/8/sys/nfsclient/nfs_krpc.c	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/nfsclient/nfs_krpc.c	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -394,18 +394,17 @@ nfs_feedback(int type, int proc, void *a
     {
     	struct nfs_feedback_arg *nf = (struct nfs_feedback_arg *) arg;
     	struct nfsmount *nmp = nf->nf_mount;
    -	struct timeval now;
    -
    -	getmicrouptime(&now);
    +	time_t now;
     
     	switch (type) {
     	case FEEDBACK_REXMIT2:
     	case FEEDBACK_RECONNECT:
    -		if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now.tv_sec) {
    +		now = time_uptime;
    +		if (nf->nf_lastmsg + nmp->nm_tprintf_delay < now) {
     			nfs_down(nmp, nf->nf_td,
     			    "not responding", 0, NFSSTA_TIMEO);
     			nf->nf_tprintfmsg = TRUE;
    -			nf->nf_lastmsg = now.tv_sec;
    +			nf->nf_lastmsg = now;
     		}
     		break;
     
    @@ -438,7 +437,6 @@ nfs_request(struct vnode *vp, struct mbu
     	time_t waituntil;
     	caddr_t dpos;
     	int error = 0, timeo;
    -	struct timeval now;
     	AUTH *auth = NULL;
     	enum nfs_rto_timer_t timer;
     	struct nfs_feedback_arg nf;
    @@ -455,8 +453,7 @@ nfs_request(struct vnode *vp, struct mbu
     	bzero(&nf, sizeof(struct nfs_feedback_arg));
     	nf.nf_mount = nmp;
     	nf.nf_td = td;
    -	getmicrouptime(&now);
    -	nf.nf_lastmsg = now.tv_sec -
    +	nf.nf_lastmsg = time_uptime -
     	    ((nmp->nm_tprintf_delay) - (nmp->nm_tprintf_initial_delay));
     
     	/*
    
    Modified: stable/8/sys/nfsclient/nfs_subs.c
    ==============================================================================
    --- stable/8/sys/nfsclient/nfs_subs.c	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/nfsclient/nfs_subs.c	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -1119,7 +1119,7 @@ nfsm_v3attrbuild_xx(struct vattr *va, in
     		*tl = nfs_false;
     	}
     	if (va->va_atime.tv_sec != VNOVAL) {
    -		if (va->va_atime.tv_sec != time_second) {
    +		if ((va->va_vaflags & VA_UTIMES_NULL) == 0) {
     			tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos);
     			*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
     			txdr_nfsv3time(&va->va_atime, tl);
    @@ -1132,7 +1132,7 @@ nfsm_v3attrbuild_xx(struct vattr *va, in
     		*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
     	}
     	if (va->va_mtime.tv_sec != VNOVAL) {
    -		if (va->va_mtime.tv_sec != time_second) {
    +		if ((va->va_vaflags & VA_UTIMES_NULL) == 0) {
     			tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos);
     			*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
     			txdr_nfsv3time(&va->va_mtime, tl);
    
    Modified: stable/8/sys/nfsclient/nfs_vnops.c
    ==============================================================================
    --- stable/8/sys/nfsclient/nfs_vnops.c	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/nfsclient/nfs_vnops.c	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -3461,7 +3461,7 @@ nfsfifo_read(struct vop_read_args *ap)
     	 */
     	mtx_lock(&np->n_mtx);
     	np->n_flag |= NACC;
    -	getnanotime(&np->n_atim);
    +	vfs_timestamp(&np->n_atim);
     	mtx_unlock(&np->n_mtx);
     	error = fifo_specops.vop_read(ap);
     	return error;	
    @@ -3480,7 +3480,7 @@ nfsfifo_write(struct vop_write_args *ap)
     	 */
     	mtx_lock(&np->n_mtx);
     	np->n_flag |= NUPD;
    -	getnanotime(&np->n_mtim);
    +	vfs_timestamp(&np->n_mtim);
     	mtx_unlock(&np->n_mtx);
     	return(fifo_specops.vop_write(ap));
     }
    @@ -3500,7 +3500,7 @@ nfsfifo_close(struct vop_close_args *ap)
     
     	mtx_lock(&np->n_mtx);
     	if (np->n_flag & (NACC | NUPD)) {
    -		getnanotime(&ts);
    +		vfs_timestamp(&ts);
     		if (np->n_flag & NACC)
     			np->n_atim = ts;
     		if (np->n_flag & NUPD)
    
    Modified: stable/8/sys/nfsserver/nfs_srvsubs.c
    ==============================================================================
    --- stable/8/sys/nfsserver/nfs_srvsubs.c	Thu Feb 28 21:57:38 2013	(r247502)
    +++ stable/8/sys/nfsserver/nfs_srvsubs.c	Thu Feb 28 21:58:07 2013	(r247503)
    @@ -1430,7 +1430,7 @@ nfsm_srvsattr_xx(struct vattr *a, struct
     		toclient = 1;
     		break;
     	case NFSV3SATTRTIME_TOSERVER:
    -		getnanotime(&(a)->va_atime);
    +		vfs_timestamp(&a->va_atime);
     		a->va_vaflags |= VA_UTIMES_NULL;
     		break;
     	}
    @@ -1446,7 +1446,7 @@ nfsm_srvsattr_xx(struct vattr *a, struct
     		a->va_vaflags &= ~VA_UTIMES_NULL;
     		break;
     	case NFSV3SATTRTIME_TOSERVER:
    -		getnanotime(&(a)->va_mtime);
    +		vfs_timestamp(&a->va_mtime);
     		if (toclient == 0)
     			a->va_vaflags |= VA_UTIMES_NULL;
     		break;
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 22:30:04 2013
    Return-Path: 
    Delivered-To: svn-src-all@FreeBSD.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 44E57260;
     Thu, 28 Feb 2013 22:30:04 +0000 (UTC)
     (envelope-from gonzo@id.bluezbox.com)
    Received: from id.bluezbox.com (id.bluezbox.com [88.198.91.248])
     by mx1.freebsd.org (Postfix) with ESMTP id EB69E73F;
     Thu, 28 Feb 2013 22:30:03 +0000 (UTC)
    Received: from [88.198.91.248] (helo=[IPv6:::1])
     by id.bluezbox.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256)
     (Exim 4.77 (FreeBSD)) (envelope-from )
     id 1UBBzE-000DdV-Ps; Thu, 28 Feb 2013 14:30:03 -0800
    Message-ID: <512FDA67.80200@freebsd.org>
    Date: Thu, 28 Feb 2013 14:29:59 -0800
    From: Oleksandr Tymoshenko 
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
     rv:17.0) Gecko/20130215 Thunderbird/17.0.3
    MIME-Version: 1.0
    To: Ian Lepore 
    Subject: Re: svn commit: r247495 - head/sys/dev/sdhci
    References: <201302281943.r1SJhEmC023261@svn.freebsd.org>
     <1362081750.1195.65.camel@revolution.hippie.lan>
    In-Reply-To: <1362081750.1195.65.camel@revolution.hippie.lan>
    Content-Type: text/plain; charset=ISO-8859-1; format=flowed
    Content-Transfer-Encoding: 7bit
    Sender: gonzo@id.bluezbox.com
    X-Spam-Level: --
    X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com",
     has
     identified this incoming email as possible spam.  The original message
     has been attached to this so you can view it (if it isn't spam) or label
     similar future email.  If you have any questions, see
     The administrator of that system for details.
     Content preview:  On 2/28/2013 12:02 PM, Ian Lepore wrote: > On Thu, 2013-02-28
     at 19:43 +0000, Oleksandr Tymoshenko wrote: >> Author: gonzo >> Date: Thu
     Feb 28 19:43:14 2013 >> New Revision: 247495 >> URL:
     http://svnweb.freebsd.org/changeset/base/247495
     >> >> Log: >> Add hooks for plugging platform-provided transfer backend.
     >> >> In order to use platorm backend hardware driver should >> impement three
     methods: >> - platform_start_transfer and platform_finish_transfer >> to
     start and finish transfer >> - platform_will_handle - check whether
     transaction
     is >> suitable for backend. If not - driver will fall back >> to PIO mode.
     >> >> Submitted by: Daisuke Aoyama  >> Approved by:
     ian@ >> >> Modified: >> head/sys/dev/sdhci/sdhci.c >>
     head/sys/dev/sdhci/sdhci.h
     >> head/sys/dev/sdhci/sdhci_if.m >> > I think that was meant to be "Reviewed
     by" rather than "Approved by". I > do very much approve of the changes, but
     not in any formal > administrative sense, I'm just happy the sdcard IO is
     faster. :) > [...] 
     Content analysis details:   (-2.9 points, 5.0 required)
     pts rule name              description
     ---- ---------------------- --------------------------------------------------
     -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
     -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
     [score: 0.0000]
    Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
     src-committers@FreeBSD.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 22:30:04 -0000
    
    On 2/28/2013 12:02 PM, Ian Lepore wrote:
    > On Thu, 2013-02-28 at 19:43 +0000, Oleksandr Tymoshenko wrote:
    >> Author: gonzo
    >> Date: Thu Feb 28 19:43:14 2013
    >> New Revision: 247495
    >> URL: http://svnweb.freebsd.org/changeset/base/247495
    >>
    >> Log:
    >>    Add hooks for plugging platform-provided transfer backend.
    >>    
    >>    In order to use platorm backend hardware driver should
    >>    impement three methods:
    >>    - platform_start_transfer and platform_finish_transfer
    >>        to start and finish transfer
    >>    - platform_will_handle - check whether transaction is
    >>        suitable for backend. If not - driver will fall back
    >>        to PIO mode.
    >>    
    >>    Submitted by:	Daisuke Aoyama 
    >>    Approved by:	ian@
    >>
    >> Modified:
    >>    head/sys/dev/sdhci/sdhci.c
    >>    head/sys/dev/sdhci/sdhci.h
    >>    head/sys/dev/sdhci/sdhci_if.m
    >>
    > I think that was meant to be "Reviewed by" rather than "Approved by".  I
    > do very much approve of the changes, but not in any formal
    > administrative sense, I'm just happy the sdcard IO is faster. :)
    >
    
    Yeah, wrong "to:" field :)
    Thanks for reviewing these patches
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 22:48:00 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id CA82360A;
     Thu, 28 Feb 2013 22:48:00 +0000 (UTC) (envelope-from jfv@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 B36C87DE;
     Thu, 28 Feb 2013 22:48:00 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SMm0GH079903;
     Thu, 28 Feb 2013 22:48:00 GMT (envelope-from jfv@svn.freebsd.org)
    Received: (from jfv@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SMm00t079901;
     Thu, 28 Feb 2013 22:48:00 GMT (envelope-from jfv@svn.freebsd.org)
    Message-Id: <201302282248.r1SMm00t079901@svn.freebsd.org>
    From: Jack F Vogel 
    Date: Thu, 28 Feb 2013 22:48:00 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247505 - head/sys/modules/ixgbe
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 22:48:00 -0000
    
    Author: jfv
    Date: Thu Feb 28 22:48:00 2013
    New Revision: 247505
    URL: http://svnweb.freebsd.org/changeset/base/247505
    
    Log:
      Change the ixgbe module name to if_ixgbe to conform
      to the usual naming convention.
    
    Modified:
      head/sys/modules/ixgbe/Makefile
    
    Modified: head/sys/modules/ixgbe/Makefile
    ==============================================================================
    --- head/sys/modules/ixgbe/Makefile	Thu Feb 28 22:31:26 2013	(r247504)
    +++ head/sys/modules/ixgbe/Makefile	Thu Feb 28 22:48:00 2013	(r247505)
    @@ -4,7 +4,7 @@
     
     .PATH:  ${.CURDIR}/../../dev/ixgbe
     
    -KMOD    = ixgbe
    +KMOD    = if_ixgbe
     SRCS    = device_if.h bus_if.h pci_if.h
     SRCS	+= opt_inet.h opt_inet6.h
     SRCS    += ixgbe.c ixv.c
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 23:02:23 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id CC6098D4;
     Thu, 28 Feb 2013 23:02:23 +0000 (UTC)
     (envelope-from delphij@delphij.net)
    Received: from anubis.delphij.net (anubis.delphij.net
     [IPv6:2001:470:1:117::25])
     by mx1.freebsd.org (Postfix) with ESMTP id B15A985C;
     Thu, 28 Feb 2013 23:02:23 +0000 (UTC)
    Received: from epsilon.delphij.net (drawbridge.ixsystems.com [206.40.55.65])
     (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
     (No client certificate requested)
     by anubis.delphij.net (Postfix) with ESMTPSA id 0DE212492D;
     Thu, 28 Feb 2013 15:02:22 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis;
     t=1362092543; bh=nX53KiEc98OsaaWafYhLrqM9nz8WSJ4kBIkwlncm4Lo=;
     h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To;
     b=G6KvAKMNMKG3+Ex/LQ4SnD6k9MWT+GDK2WDUs4zuB3q86oYJ3ZXbMQEyJxyFELWft
     HckHAh4eSi8TjL+kmAKhMepoj7LRtMZPzNSJaIq2PjlCytcAGw3bBlC/G8PQ8st9Nb
     zZ2VlIVqI32NVsKcFCy04/WibYW/dtuA/D/6gB0g=
    Message-ID: <512FE1FD.8020502@delphij.net>
    Date: Thu, 28 Feb 2013 15:02:21 -0800
    From: Xin Li 
    Organization: The FreeBSD Project
    MIME-Version: 1.0
    To: Gennady Proskurin 
    Subject: Re: svn commit: r246877 - head/sys/ufs/ffs
    References: <201302161511.r1GFBesh029301@svn.freebsd.org>
     <20130218095640.GA35293@gpr.nnz-home.ru>
    In-Reply-To: <20130218095640.GA35293@gpr.nnz-home.ru>
    X-Enigmail-Version: 1.5.1
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: 7bit
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org, Kirk McKusick 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    Reply-To: d@delphij.net
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 23:02:23 -0000
    
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    On 02/18/13 01:56, Gennady Proskurin wrote:
    > May be a dumb question, but I want to be explicit here.
    > 
    > Can system before this commit crash here or filesystem corruption
    > happen during ordinary work? (I mean no power loss and no crashes
    > in other kernel code)
    > 
    > Or filesystem can be corrupted only if system crashes by other
    > means (power loss or something) during inode block allocation?
    
    There has to be some kind of crashes to get corruption on system
    running without this changeset.
    
    If the system runs and shutdowns normally, eventually the initialized
    inode would be written and therefore there would be no inconsistency.
    
    Kirk, I think this is a good MFC candidate, do you have plan to merge
    it back to stable branches?
    
    Cheers,
    - -- 
    Xin LI     https://www.delphij.net/
    FreeBSD - The Power to Serve!           Live free or die
    -----BEGIN PGP SIGNATURE-----
    
    iQEcBAEBCgAGBQJRL+H9AAoJEG80Jeu8UPuzHHcH/jma0S+9tMpPVD9zODXFaPhU
    Uib+qSBoQ/7pXsidGd+Cm5nI5duvpe2KGbNWomOQFy3Ovllzjg6CPHfTPo6ZXYkX
    FpOr93IPcbkEIiwSVP7yXhgp1r5BH3SmV3ulx6SkgKkf8kd8Ir+dif/X+Z695Ot+
    M1y8suSXlYQs4z7ZHWMkVJcZ3VhH/oPJVpUQCZ7uqXeZQuquW4BLuKBYirGiGZrL
    77QbQa4OunUMJN4XbU/WmEh/TGkvSRKuWfCYq9JHAXiQ4ItqhD5bGCUh0AZ0iOgq
    y94ydCOUojI65VX8yBzlR1VyOi0ba3k3JSt/GmIEGvFu2ZcBW+nPXG+hjRJaKKk=
    =sj5S
    -----END PGP SIGNATURE-----
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 23:31:24 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 13833C01;
     Thu, 28 Feb 2013 23:31:24 +0000 (UTC)
     (envelope-from adrian@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 E27B4935;
     Thu, 28 Feb 2013 23:31:23 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SNVNVs094382;
     Thu, 28 Feb 2013 23:31:23 GMT (envelope-from adrian@svn.freebsd.org)
    Received: (from adrian@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SNVNBY094381;
     Thu, 28 Feb 2013 23:31:23 GMT (envelope-from adrian@svn.freebsd.org)
    Message-Id: <201302282331.r1SNVNBY094381@svn.freebsd.org>
    From: Adrian Chadd 
    Date: Thu, 28 Feb 2013 23:31:23 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247506 - head/sys/dev/ath
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 23:31:24 -0000
    
    Author: adrian
    Date: Thu Feb 28 23:31:23 2013
    New Revision: 247506
    URL: http://svnweb.freebsd.org/changeset/base/247506
    
    Log:
      Don't enable the HT flags for legacy rates.
      
      I stumbled across this whilst trying to debug another weird hang reported
      on the freebsd-wireless list.
      
      Whilst here, add in the STBC check to ath_rateseries_setup().
      
      Whilst here, fix the short preamble flag to be set only for legacy rates.
      
      Whilst here, comment that we should be using the full set of decisions
      made by ath_rateseries_setup() rather than recalculating them!
    
    Modified:
      head/sys/dev/ath/if_ath_tx_ht.c
    
    Modified: head/sys/dev/ath/if_ath_tx_ht.c
    ==============================================================================
    --- head/sys/dev/ath/if_ath_tx_ht.c	Thu Feb 28 22:48:00 2013	(r247505)
    +++ head/sys/dev/ath/if_ath_tx_ht.c	Thu Feb 28 23:31:23 2013	(r247506)
    @@ -236,9 +236,9 @@ ath_tx_rate_fill_rcflags(struct ath_soft
     		rate = rt->info[rc[i].rix].rateCode;
     
     		/*
    -		 * XXX only do this for legacy rates?
    +		 * Only enable short preamble for legacy rates
     		 */
    -		if (bf->bf_state.bfs_shpream)
    +		if (IS_HT_RATE(rate) && bf->bf_state.bfs_shpream)
     			rate |= rt->info[rc[i].rix].shortPreamble;
     
     		/*
    @@ -267,6 +267,19 @@ ath_tx_rate_fill_rcflags(struct ath_soft
     			    ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20)
     				rc[i].flags |= ATH_RC_SGI_FLAG;
     
    +			/*
    +			 * If we have STBC TX enabled and the receiver
    +			 * can receive (at least) 1 stream STBC, AND it's
    +			 * MCS 0-7, AND we have at least two chains enabled,
    +			 * enable STBC.
    +			 */
    +			if (ic->ic_htcaps & IEEE80211_HTCAP_TXSTBC &&
    +			    ni->ni_htcap & IEEE80211_HTCAP_RXSTBC_1STREAM &&
    +			    (sc->sc_cur_txchainmask > 1) &&
    +			    HT_RC_2_STREAMS(rate) == 1) {
    +				rc[i].flags |= ATH_RC_STBC_FLAG;
    +			}
    +
     			/* XXX dual stream? and 3-stream? */
     		}
     
    @@ -459,6 +472,9 @@ ath_get_aggr_limit(struct ath_softc *sc,
      *
      * It, along with ath_buf_set_rate, must be called -after- a burst
      * or aggregate is setup.
    + *
    + * XXX TODO: it should use the rate series information from the
    + * ath_buf, rather than recalculating it here!
      */
     static void
     ath_rateseries_setup(struct ath_softc *sc, struct ieee80211_node *ni,
    @@ -507,34 +523,6 @@ ath_rateseries_setup(struct ath_softc *s
     		 */
     		series[i].ChSel = sc->sc_cur_txchainmask;
     
    -		if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA))
    -			series[i].RateFlags |= HAL_RATESERIES_RTS_CTS;
    -
    -		/*
    -		 * Transmit 40MHz frames only if the node has negotiated
    -		 * it rather than whether the node is capable of it or not.
    -	 	 * It's subtly different in the hostap case.
    -	 	 */
    -		if (ni->ni_chw == 40)
    -			series[i].RateFlags |= HAL_RATESERIES_2040;
    -
    -		/*
    -		 * Set short-GI only if the node has advertised it
    -		 * the channel width is suitable, and we support it.
    -		 * We don't currently have a "negotiated" set of bits -
    -		 * ni_htcap is what the remote end sends, not what this
    -		 * node is capable of.
    -		 */
    -		if (ni->ni_chw == 40 &&
    -		    ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI40 &&
    -		    ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40)
    -			series[i].RateFlags |= HAL_RATESERIES_HALFGI;
    -
    -		if (ni->ni_chw == 20 &&
    -		    ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI20 &&
    -		    ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20)
    -			series[i].RateFlags |= HAL_RATESERIES_HALFGI;
    -
     		/*
     		 * Setup rate and TX power cap for this series.
     		 */
    @@ -542,23 +530,55 @@ ath_rateseries_setup(struct ath_softc *s
     		series[i].RateIndex = rc[i].rix;
     		series[i].tx_power_cap = 0x3f;	/* XXX for now */
     
    -
     		/*
    -		 * If we have STBC TX enabled and the receiver
    -		 * can receive (at least) 1 stream STBC, AND it's
    -		 * MCS 0-7, AND we have at least two chains enabled,
    -		 * enable STBC.
    +		 * Enable RTS/CTS as appropriate.
     		 */
    -		if (ic->ic_htcaps & IEEE80211_HTCAP_TXSTBC &&
    -		    ni->ni_htcap & IEEE80211_HTCAP_RXSTBC_1STREAM &&
    -		    (sc->sc_cur_txchainmask > 1) &&
    -		    HT_RC_2_STREAMS(series[i].Rate) == 1) {
    -			series[i].RateFlags |= HAL_RATESERIES_STBC;
    -		}
    +		if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA))
    +			series[i].RateFlags |= HAL_RATESERIES_RTS_CTS;
     
    -		/*
    -		 * XXX TODO: LDPC if it's possible
    -		 */
    +
    +		if (IS_HT_RATE(rt->info[rc[i].rix].rateCode)) {
    +			/*
    +			 * Transmit 40MHz frames only if the node has negotiated
    +			 * it rather than whether the node is capable of it or not.
    +			 * It's subtly different in the hostap case.
    +			 */
    +			if (ni->ni_chw == 40)
    +				series[i].RateFlags |= HAL_RATESERIES_2040;
    +
    +			/*
    +			 * Set short-GI only if the node has advertised it
    +			 * the channel width is suitable, and we support it.
    +			 * We don't currently have a "negotiated" set of bits -
    +			 * ni_htcap is what the remote end sends, not what this
    +			 * node is capable of.
    +			 */
    +			if (ni->ni_chw == 40 &&
    +			    ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI40 &&
    +			    ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40)
    +				series[i].RateFlags |= HAL_RATESERIES_HALFGI;
    +
    +			if (ni->ni_chw == 20 &&
    +			    ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI20 &&
    +			    ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20)
    +				series[i].RateFlags |= HAL_RATESERIES_HALFGI;
    +
    +			/*
    +			 * If we have STBC TX enabled and the receiver
    +			 * can receive (at least) 1 stream STBC, AND it's
    +			 * MCS 0-7, AND we have at least two chains enabled,
    +			 * enable STBC.
    +			 */
    +			if (ic->ic_htcaps & IEEE80211_HTCAP_TXSTBC &&
    +			    ni->ni_htcap & IEEE80211_HTCAP_RXSTBC_1STREAM &&
    +			    (sc->sc_cur_txchainmask > 1) &&
    +			    HT_RC_2_STREAMS(series[i].Rate) == 1) {
    +				series[i].RateFlags |= HAL_RATESERIES_STBC;
    +			}
    +			/*
    +			 * XXX TODO: LDPC if it's possible
    +			 */
    +		}
     
     		/*
     		 * PktDuration doesn't include slot, ACK, RTS, etc timing -
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 23:39:22 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id E700AECA;
     Thu, 28 Feb 2013 23:39:22 +0000 (UTC)
     (envelope-from adrian@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 D9C5A97A;
     Thu, 28 Feb 2013 23:39:22 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SNdMLx095488;
     Thu, 28 Feb 2013 23:39:22 GMT (envelope-from adrian@svn.freebsd.org)
    Received: (from adrian@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SNdMAf095487;
     Thu, 28 Feb 2013 23:39:22 GMT (envelope-from adrian@svn.freebsd.org)
    Message-Id: <201302282339.r1SNdMAf095487@svn.freebsd.org>
    From: Adrian Chadd 
    Date: Thu, 28 Feb 2013 23:39:22 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247507 - head/sys/dev/ath
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 23:39:23 -0000
    
    Author: adrian
    Date: Thu Feb 28 23:39:22 2013
    New Revision: 247507
    URL: http://svnweb.freebsd.org/changeset/base/247507
    
    Log:
      Oops - fix an incorrect test.
    
    Modified:
      head/sys/dev/ath/if_ath_tx_ht.c
    
    Modified: head/sys/dev/ath/if_ath_tx_ht.c
    ==============================================================================
    --- head/sys/dev/ath/if_ath_tx_ht.c	Thu Feb 28 23:31:23 2013	(r247506)
    +++ head/sys/dev/ath/if_ath_tx_ht.c	Thu Feb 28 23:39:22 2013	(r247507)
    @@ -238,7 +238,7 @@ ath_tx_rate_fill_rcflags(struct ath_soft
     		/*
     		 * Only enable short preamble for legacy rates
     		 */
    -		if (IS_HT_RATE(rate) && bf->bf_state.bfs_shpream)
    +		if ((! IS_HT_RATE(rate)) && bf->bf_state.bfs_shpream)
     			rate |= rt->info[rc[i].rix].shortPreamble;
     
     		/*
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 23:39:39 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 246A1CA;
     Thu, 28 Feb 2013 23:39:39 +0000 (UTC)
     (envelope-from adrian@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 176EE97E;
     Thu, 28 Feb 2013 23:39:39 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SNdcS2095562;
     Thu, 28 Feb 2013 23:39:38 GMT (envelope-from adrian@svn.freebsd.org)
    Received: (from adrian@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SNdcWu095561;
     Thu, 28 Feb 2013 23:39:38 GMT (envelope-from adrian@svn.freebsd.org)
    Message-Id: <201302282339.r1SNdcWu095561@svn.freebsd.org>
    From: Adrian Chadd 
    Date: Thu, 28 Feb 2013 23:39:38 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247508 - head/sys/dev/ath
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 23:39:39 -0000
    
    Author: adrian
    Date: Thu Feb 28 23:39:38 2013
    New Revision: 247508
    URL: http://svnweb.freebsd.org/changeset/base/247508
    
    Log:
      Add missing flags.
    
    Modified:
      head/sys/dev/ath/if_athrate.h
    
    Modified: head/sys/dev/ath/if_athrate.h
    ==============================================================================
    --- head/sys/dev/ath/if_athrate.h	Thu Feb 28 23:39:22 2013	(r247507)
    +++ head/sys/dev/ath/if_athrate.h	Thu Feb 28 23:39:38 2013	(r247508)
    @@ -84,6 +84,8 @@ void	ath_rate_detach(struct ath_ratectrl
     #define	ATH_RC_SGI_FLAG		0x04	/* use short-GI */
     #define	ATH_RC_HT_FLAG		0x08	/* use HT */
     #define	ATH_RC_RTSCTS_FLAG	0x10	/* enable RTS/CTS protection */
    +#define	ATH_RC_STBC_FLAG	0x20	/* enable STBC */
    +#define	ATH_RC_LDPC_FLAG	0x40	/* enable STBC */
     
     struct ath_rc_series {
     	uint8_t rix;		/* ratetable index, not rate code */
    
    From owner-svn-src-all@FreeBSD.ORG  Thu Feb 28 23:45:41 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id E634F28C;
     Thu, 28 Feb 2013 23:45:41 +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 D7CC19AC;
     Thu, 28 Feb 2013 23:45:41 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1SNjfCg098012;
     Thu, 28 Feb 2013 23:45:41 GMT (envelope-from gjb@svn.freebsd.org)
    Received: (from gjb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1SNjfbl098011;
     Thu, 28 Feb 2013 23:45:41 GMT (envelope-from gjb@svn.freebsd.org)
    Message-Id: <201302282345.r1SNjfbl098011@svn.freebsd.org>
    From: Glen Barber 
    Date: Thu, 28 Feb 2013 23:45:41 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247509 - head
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Thu, 28 Feb 2013 23:45:42 -0000
    
    Author: gjb (doc,ports committer)
    Date: Thu Feb 28 23:45:41 2013
    New Revision: 247509
    URL: http://svnweb.freebsd.org/changeset/base/247509
    
    Log:
      Minor wordsmithing.
      
      X-MFC-Needs:	r245617
    
    Modified:
      head/UPDATING
    
    Modified: head/UPDATING
    ==============================================================================
    --- head/UPDATING	Thu Feb 28 23:39:38 2013	(r247508)
    +++ head/UPDATING	Thu Feb 28 23:45:41 2013	(r247509)
    @@ -46,8 +46,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
     	unlikely event that -M was the last option on the command line
     	and the command line contained at least two files and a target
     	directory the first file will have logs appended to it.  The -M
    -	option served little practical purpose in the last decade so it's
    -	used expected to be extremely rare.
    +	option served little practical purpose in the last decade so its
    +	use is expected to be extremely rare.
     
     20121223:
     	After switching to Clang as the default compiler some users of ZFS
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 00:46:42 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 3A7DCCAB;
     Fri,  1 Mar 2013 00:46:42 +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 2C08BBE9;
     Fri,  1 Mar 2013 00:46:42 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r210kg56016617;
     Fri, 1 Mar 2013 00:46:42 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r210kgmM016616;
     Fri, 1 Mar 2013 00:46:42 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201303010046.r210kgmM016616@svn.freebsd.org>
    From: Xin LI 
    Date: Fri, 1 Mar 2013 00: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: r247511 - in stable: 6/sys/dev/random 7/sys/dev/random
     8/sys/dev/random 9/sys/dev/random
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 00:46:42 -0000
    
    Author: delphij
    Date: Fri Mar  1 00:46:41 2013
    New Revision: 247511
    URL: http://svnweb.freebsd.org/changeset/base/247511
    
    Log:
      MFC r247334:
      
      Correct a typo introduced in r153575, which gives inverted logic when
      handling blocking semantics when seeding.
      
      PR:		kern/143298
      Submitted by:	James Juran 
      Reviewed by:	markm
    
    Modified:
      stable/9/sys/dev/random/randomdev_soft.c
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
    
    Changes in other areas also in this revision:
    Modified:
      stable/6/sys/dev/random/randomdev_soft.c
      stable/7/sys/dev/random/randomdev_soft.c
      stable/8/sys/dev/random/randomdev_soft.c
    Directory Properties:
      stable/6/sys/   (props changed)
      stable/7/sys/   (props changed)
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/random/   (props changed)
    
    Modified: stable/9/sys/dev/random/randomdev_soft.c
    ==============================================================================
    --- stable/9/sys/dev/random/randomdev_soft.c	Fri Mar  1 00:15:58 2013	(r247510)
    +++ stable/9/sys/dev/random/randomdev_soft.c	Fri Mar  1 00:46:41 2013	(r247511)
    @@ -391,7 +391,7 @@ random_yarrow_block(int flag)
     	mtx_lock(&random_reseed_mtx);
     
     	/* Blocking logic */
    -	while (random_systat.seeded && !error) {
    +	while (!random_systat.seeded && !error) {
     		if (flag & O_NONBLOCK)
     			error = EWOULDBLOCK;
     		else {
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 00:46:42 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 8FC77CAC;
     Fri,  1 Mar 2013 00:46:42 +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 819A7BEA;
     Fri,  1 Mar 2013 00:46:42 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r210kgEh016623;
     Fri, 1 Mar 2013 00:46:42 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r210kgKv016622;
     Fri, 1 Mar 2013 00:46:42 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201303010046.r210kgKv016622@svn.freebsd.org>
    From: Xin LI 
    Date: Fri, 1 Mar 2013 00:46:42 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247511 - in stable: 6/sys/dev/random 7/sys/dev/random
     8/sys/dev/random 9/sys/dev/random
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 00:46:42 -0000
    
    Author: delphij
    Date: Fri Mar  1 00:46:41 2013
    New Revision: 247511
    URL: http://svnweb.freebsd.org/changeset/base/247511
    
    Log:
      MFC r247334:
      
      Correct a typo introduced in r153575, which gives inverted logic when
      handling blocking semantics when seeding.
      
      PR:		kern/143298
      Submitted by:	James Juran 
      Reviewed by:	markm
    
    Modified:
      stable/8/sys/dev/random/randomdev_soft.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/random/   (props changed)
    
    Changes in other areas also in this revision:
    Modified:
      stable/6/sys/dev/random/randomdev_soft.c
      stable/7/sys/dev/random/randomdev_soft.c
      stable/9/sys/dev/random/randomdev_soft.c
    Directory Properties:
      stable/6/sys/   (props changed)
      stable/7/sys/   (props changed)
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
    
    Modified: stable/8/sys/dev/random/randomdev_soft.c
    ==============================================================================
    --- stable/8/sys/dev/random/randomdev_soft.c	Fri Mar  1 00:15:58 2013	(r247510)
    +++ stable/8/sys/dev/random/randomdev_soft.c	Fri Mar  1 00:46:41 2013	(r247511)
    @@ -391,7 +391,7 @@ random_yarrow_block(int flag)
     	mtx_lock(&random_reseed_mtx);
     
     	/* Blocking logic */
    -	while (random_systat.seeded && !error) {
    +	while (!random_systat.seeded && !error) {
     		if (flag & O_NONBLOCK)
     			error = EWOULDBLOCK;
     		else {
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 00:46:42 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id E6502CAD;
     Fri,  1 Mar 2013 00:46:42 +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 D8305BEB;
     Fri,  1 Mar 2013 00:46:42 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r210kgBm016629;
     Fri, 1 Mar 2013 00:46:42 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r210kg5S016628;
     Fri, 1 Mar 2013 00:46:42 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201303010046.r210kg5S016628@svn.freebsd.org>
    From: Xin LI 
    Date: Fri, 1 Mar 2013 00:46:42 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
    Subject: svn commit: r247511 - in stable: 6/sys/dev/random 7/sys/dev/random
     8/sys/dev/random 9/sys/dev/random
    X-SVN-Group: stable-7
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 00:46:43 -0000
    
    Author: delphij
    Date: Fri Mar  1 00:46:41 2013
    New Revision: 247511
    URL: http://svnweb.freebsd.org/changeset/base/247511
    
    Log:
      MFC r247334:
      
      Correct a typo introduced in r153575, which gives inverted logic when
      handling blocking semantics when seeding.
      
      PR:		kern/143298
      Submitted by:	James Juran 
      Reviewed by:	markm
    
    Modified:
      stable/7/sys/dev/random/randomdev_soft.c
    Directory Properties:
      stable/7/sys/   (props changed)
    
    Changes in other areas also in this revision:
    Modified:
      stable/6/sys/dev/random/randomdev_soft.c
      stable/8/sys/dev/random/randomdev_soft.c
      stable/9/sys/dev/random/randomdev_soft.c
    Directory Properties:
      stable/6/sys/   (props changed)
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/random/   (props changed)
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
    
    Modified: stable/7/sys/dev/random/randomdev_soft.c
    ==============================================================================
    --- stable/7/sys/dev/random/randomdev_soft.c	Fri Mar  1 00:15:58 2013	(r247510)
    +++ stable/7/sys/dev/random/randomdev_soft.c	Fri Mar  1 00:46:41 2013	(r247511)
    @@ -394,7 +394,7 @@ random_yarrow_block(int flag)
     	mtx_lock(&random_reseed_mtx);
     
     	/* Blocking logic */
    -	while (random_systat.seeded && !error) {
    +	while (!random_systat.seeded && !error) {
     		if (flag & O_NONBLOCK)
     			error = EWOULDBLOCK;
     		else {
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 00:46:43 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 4787ECAE;
     Fri,  1 Mar 2013 00:46:43 +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 3966EBEC;
     Fri,  1 Mar 2013 00:46:43 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r210kh9O016635;
     Fri, 1 Mar 2013 00:46:43 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r210khP5016634;
     Fri, 1 Mar 2013 00:46:43 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201303010046.r210khP5016634@svn.freebsd.org>
    From: Xin LI 
    Date: Fri, 1 Mar 2013 00:46:43 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
    Subject: svn commit: r247511 - in stable: 6/sys/dev/random 7/sys/dev/random
     8/sys/dev/random 9/sys/dev/random
    X-SVN-Group: stable-6
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 00:46:43 -0000
    
    Author: delphij
    Date: Fri Mar  1 00:46:41 2013
    New Revision: 247511
    URL: http://svnweb.freebsd.org/changeset/base/247511
    
    Log:
      MFC r247334:
      
      Correct a typo introduced in r153575, which gives inverted logic when
      handling blocking semantics when seeding.
      
      PR:		kern/143298
      Submitted by:	James Juran 
      Reviewed by:	markm
    
    Modified:
      stable/6/sys/dev/random/randomdev_soft.c
    Directory Properties:
      stable/6/sys/   (props changed)
    
    Changes in other areas also in this revision:
    Modified:
      stable/7/sys/dev/random/randomdev_soft.c
      stable/8/sys/dev/random/randomdev_soft.c
      stable/9/sys/dev/random/randomdev_soft.c
    Directory Properties:
      stable/7/sys/   (props changed)
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/random/   (props changed)
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
    
    Modified: stable/6/sys/dev/random/randomdev_soft.c
    ==============================================================================
    --- stable/6/sys/dev/random/randomdev_soft.c	Fri Mar  1 00:15:58 2013	(r247510)
    +++ stable/6/sys/dev/random/randomdev_soft.c	Fri Mar  1 00:46:41 2013	(r247511)
    @@ -400,7 +400,7 @@ random_yarrow_block(int flag)
     	mtx_lock(&random_reseed_mtx);
     
     	/* Blocking logic */
    -	while (random_systat.seeded && !error) {
    +	while (!random_systat.seeded && !error) {
     		if (flag & O_NONBLOCK)
     			error = EWOULDBLOCK;
     		else {
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 00:52:19 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 210F43CD;
     Fri,  1 Mar 2013 00:52:19 +0000 (UTC) (envelope-from des@des.no)
    Received: from smtp.des.no (smtp.des.no [194.63.250.102])
     by mx1.freebsd.org (Postfix) with ESMTP id D21C3CBE;
     Fri,  1 Mar 2013 00:52:18 +0000 (UTC)
    Received: from ds4.des.no (smtp.des.no [194.63.250.102])
     by smtp-int.des.no (Postfix) with ESMTP id 32316827D;
     Fri,  1 Mar 2013 00:52:17 +0000 (UTC)
    Received: by ds4.des.no (Postfix, from userid 1001)
     id BA7C99C4E; Fri,  1 Mar 2013 01:52:16 +0100 (CET)
    From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
    To: src-committers@freebsd.org
    Subject: Re: svn commit: r247500 - in stable/8/lib/libc: gen stdlib
    References: <201302282132.r1SLWlXQ057721@svn.freebsd.org>
    Date: Fri, 01 Mar 2013 01:52:15 +0100
    In-Reply-To: <201302282132.r1SLWlXQ057721@svn.freebsd.org> (Dag-Erling
     SmXXrgrav's message of "Thu, 28 Feb 2013 21:32:47 +0000 (UTC)")
    Message-ID: <868v6854cg.fsf@ds4.des.no>
    User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (berkeley-unix)
    MIME-Version: 1.0
    Content-Type: text/plain; charset=utf-8
    Content-Transfer-Encoding: quoted-printable
    Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable-8@freebsd.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 00:52:19 -0000
    
    Dag-Erling SmXXrgrav  writes:
    > Log:
    >   MFH (r240107,240111,240361): warn against using weak PRNGs
    
    I just realized I never merged this into 9 either...
    
    DES
    --=20
    Dag-Erling Sm=C3=B8rgrav - des@des.no
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 00:52:58 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 85251534;
     Fri,  1 Mar 2013 00:52:58 +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 5D72ECC4;
     Fri,  1 Mar 2013 00:52:58 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r210qwM1019141;
     Fri, 1 Mar 2013 00:52:58 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r210qwgh019138;
     Fri, 1 Mar 2013 00:52:58 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010052.r210qwgh019138@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 00:52: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: r247512 - in stable/9/lib/libc: gen stdlib
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 00:52:58 -0000
    
    Author: des
    Date: Fri Mar  1 00:52:57 2013
    New Revision: 247512
    URL: http://svnweb.freebsd.org/changeset/base/247512
    
    Log:
      MFH (r240107,240111,240361): warn against using weak PRNGs
    
    Modified:
      stable/9/lib/libc/gen/rand48.3
      stable/9/lib/libc/stdlib/random.3
    Directory Properties:
      stable/9/lib/libc/   (props changed)
    
    Modified: stable/9/lib/libc/gen/rand48.3
    ==============================================================================
    --- stable/9/lib/libc/gen/rand48.3	Fri Mar  1 00:46:41 2013	(r247511)
    +++ stable/9/lib/libc/gen/rand48.3	Fri Mar  1 00:52:57 2013	(r247512)
    @@ -12,7 +12,7 @@
     .\"     @(#)rand48.3 V1.0 MB 8 Oct 1993
     .\" $FreeBSD$
     .\"
    -.Dd February 2, 2010
    +.Dd September 4, 2012
     .Dt RAND48 3
     .Os
     .Sh NAME
    @@ -49,6 +49,14 @@
     .Ft void
     .Fn lcong48 "unsigned short p[7]"
     .Sh DESCRIPTION
    +.Bf -symbolic
    +The functions described in this manual page are not cryptographically
    +secure.
    +Cryptographic applications should use
    +.Xr arc4random 3
    +instead.
    +.Ef
    +.Pp
     The
     .Fn rand48
     family of functions generates pseudo-random numbers using a linear
    @@ -174,10 +182,8 @@ It is thus not possible to use values gr
     Note that all three methods of seeding the random number generator
     always also set the multiplicand and addend for any of the six
     generator calls.
    -.Pp
    -For a more powerful random number generator, see
    -.Xr random 3 .
     .Sh SEE ALSO
    +.Xr arc4random 3 ,
     .Xr rand 3 ,
     .Xr random 3
     .Sh AUTHORS
    
    Modified: stable/9/lib/libc/stdlib/random.3
    ==============================================================================
    --- stable/9/lib/libc/stdlib/random.3	Fri Mar  1 00:46:41 2013	(r247511)
    +++ stable/9/lib/libc/stdlib/random.3	Fri Mar  1 00:52:57 2013	(r247512)
    @@ -181,7 +181,6 @@ messages are printed on the standard err
     .Xr arc4random 3 ,
     .Xr lrand48 3 ,
     .Xr rand 3 ,
    -.Xr srand 3 ,
     .Xr random 4
     .Sh HISTORY
     These
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 00:56:59 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id D709E6D5;
     Fri,  1 Mar 2013 00:56:59 +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 A7FE5CEB;
     Fri,  1 Mar 2013 00:56:59 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r210uxAe019799;
     Fri, 1 Mar 2013 00:56:59 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r210uvoi019781;
     Fri, 1 Mar 2013 00:56:57 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201303010056.r210uvoi019781@svn.freebsd.org>
    From: Xin LI 
    Date: Fri, 1 Mar 2013 00:56: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: r247513 - in stable/9: contrib/expat contrib/expat/doc
     contrib/expat/examples contrib/expat/lib contrib/expat/tests
     contrib/expat/tests/benchmark contrib/expat/xmlwf lib/libexpat
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 00:56:59 -0000
    
    Author: delphij
    Date: Fri Mar  1 00:56:57 2013
    New Revision: 247513
    URL: http://svnweb.freebsd.org/changeset/base/247513
    
    Log:
      MFC r247296: libexpat 2.1.0.
    
    Added:
      stable/9/contrib/expat/FREEBSD-Xlist
         - copied unchanged from r247511, head/contrib/expat/FREEBSD-Xlist
    Deleted:
      stable/9/contrib/expat/FREEBSD-upgrade
      stable/9/contrib/expat/configure
      stable/9/contrib/expat/doc/valid-xhtml10.png
      stable/9/contrib/expat/lib/winconfig.h
      stable/9/contrib/expat/tests/benchmark/benchmark.dsp
      stable/9/contrib/expat/tests/benchmark/benchmark.dsw
    Modified:
      stable/9/contrib/expat/Changes   (contents, props changed)
      stable/9/contrib/expat/MANIFEST   (contents, props changed)
      stable/9/contrib/expat/Makefile.in   (contents, props changed)
      stable/9/contrib/expat/README   (contents, props changed)
      stable/9/contrib/expat/configure.in   (contents, props changed)
      stable/9/contrib/expat/doc/reference.html   (contents, props changed)
      stable/9/contrib/expat/doc/xmlwf.sgml   (contents, props changed)
      stable/9/contrib/expat/expat_config.h.in   (contents, props changed)
      stable/9/contrib/expat/lib/expat.h   (contents, props changed)
      stable/9/contrib/expat/lib/xmlparse.c   (contents, props changed)
      stable/9/contrib/expat/lib/xmlrole.c   (contents, props changed)
      stable/9/contrib/expat/lib/xmltok.c   (contents, props changed)
      stable/9/contrib/expat/lib/xmltok_impl.c   (contents, props changed)
      stable/9/contrib/expat/tests/README.txt   (contents, props changed)
      stable/9/contrib/expat/tests/minicheck.h
      stable/9/contrib/expat/tests/runtests.c   (contents, props changed)
      stable/9/contrib/expat/tests/xmltest.sh   (contents, props changed)
      stable/9/contrib/expat/xmlwf/readfilemap.c   (contents, props changed)
      stable/9/contrib/expat/xmlwf/xmlwf.c   (contents, props changed)
      stable/9/lib/libexpat/expat_config.h
      stable/9/lib/libexpat/libbsdxml.3
    Directory Properties:
      stable/9/contrib/expat/   (props changed)
      stable/9/contrib/expat/COPYING   (props changed)
      stable/9/contrib/expat/doc/style.css   (props changed)
      stable/9/contrib/expat/doc/xmlwf.1   (props changed)
      stable/9/contrib/expat/examples/elements.c   (props changed)
      stable/9/contrib/expat/examples/outline.c   (props changed)
      stable/9/contrib/expat/lib/ascii.h   (props changed)
      stable/9/contrib/expat/lib/asciitab.h   (props changed)
      stable/9/contrib/expat/lib/iasciitab.h   (props changed)
      stable/9/contrib/expat/lib/internal.h   (props changed)
      stable/9/contrib/expat/lib/latin1tab.h   (props changed)
      stable/9/contrib/expat/lib/nametab.h   (props changed)
      stable/9/contrib/expat/lib/utf8tab.h   (props changed)
      stable/9/contrib/expat/lib/xmlrole.h   (props changed)
      stable/9/contrib/expat/lib/xmltok.h   (props changed)
      stable/9/contrib/expat/lib/xmltok_impl.h   (props changed)
      stable/9/contrib/expat/lib/xmltok_ns.c   (props changed)
      stable/9/contrib/expat/tests/chardata.c   (props changed)
      stable/9/contrib/expat/tests/chardata.h   (props changed)
      stable/9/contrib/expat/xmlwf/codepage.c   (props changed)
      stable/9/contrib/expat/xmlwf/codepage.h   (props changed)
      stable/9/contrib/expat/xmlwf/ct.c   (props changed)
      stable/9/contrib/expat/xmlwf/filemap.h   (props changed)
      stable/9/contrib/expat/xmlwf/unixfilemap.c   (props changed)
      stable/9/contrib/expat/xmlwf/win32filemap.c   (props changed)
      stable/9/contrib/expat/xmlwf/xmlfile.c   (props changed)
      stable/9/contrib/expat/xmlwf/xmlfile.h   (props changed)
      stable/9/contrib/expat/xmlwf/xmlmime.c   (props changed)
      stable/9/contrib/expat/xmlwf/xmlmime.h   (props changed)
      stable/9/contrib/expat/xmlwf/xmltchar.h   (props changed)
      stable/9/contrib/expat/xmlwf/xmlurl.h   (props changed)
      stable/9/contrib/expat/xmlwf/xmlwin32url.cxx   (props changed)
      stable/9/lib/libexpat/   (props changed)
    
    Modified: stable/9/contrib/expat/Changes
    ==============================================================================
    --- stable/9/contrib/expat/Changes	Fri Mar  1 00:52:57 2013	(r247512)
    +++ stable/9/contrib/expat/Changes	Fri Mar  1 00:56:57 2013	(r247513)
    @@ -1,5 +1,41 @@
    +Release 2.1.0 Sat March 24 2012
    +        - Bug Fixes:
    +          #1742315: Harmful XML_ParserCreateNS suggestion.
    +          #2895533: CVE-2012-1147 - Resource leak in readfilemap.c.
    +          #1785430: Expat build fails on linux-amd64 with gcc version>=4.1 -O3.
    +          #1983953, 2517952, 2517962, 2649838: 
    +                Build modifications using autoreconf instead of buildconf.sh.
    +          #2815947, #2884086: OBJEXT and EXEEXT support while building.
    +          #1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences.
    +          #2517938: xmlwf should return non-zero exit status if not well-formed.
    +          #2517946: Wrong statement about XMLDecl in xmlwf.1 and xmlwf.sgml.
    +          #2855609: Dangling positionPtr after error.
    +          #2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8().
    +          #2958794: CVE-2012-1148 - Memory leak in poolGrow.
    +          #2990652: CMake support.
    +          #3010819: UNEXPECTED_STATE with a trailing "%" in entity value.
    +          #3206497: Unitialized memory returned from XML_Parse.
    +          #3287849: make check fails on mingw-w64.
    +          #3496608: CVE-2012-0876 - Hash DOS attack.
    +        - Patches:
    +          #1749198: pkg-config support.
    +          #3010222: Fix for bug #3010819.
    +          #3312568: CMake support.
    +          #3446384: Report byte offsets for attr names and values.
    +        - New Features / API changes:
    +          Added new API member XML_SetHashSalt() that allows setting an intial
    +                value (salt) for hash calculations. This is part of the fix for
    +                bug #3496608 to randomize hash parameters.
    +          When compiled with XML_ATTR_INFO defined, adds new API member
    +                XML_GetAttributeInfo() that allows retrieving the byte
    +                offsets for attribute names and values (patch #3446384).
    +          Added CMake build system.
    +                See bug #2990652 and patch #3312568.
    +          Added run-benchmark target to Makefile.in - relies on testdata module
    +                present in the same relative location as in the repository.
    +          
     Release 2.0.1 Tue June 5 2007
    -        - Fixed bugs #1515266, 1515600: The character data handler's calling
    +        - Fixed bugs #1515266, #1515600: The character data handler's calling
               of XML_StopParser() was not handled properly; if the parser was
               stopped and the handler set to NULL, the parser would segfault.
             - Fixed bug #1690883: Expat failed on EBCDIC systems as it assumed
    @@ -8,7 +44,7 @@ Release 2.0.1 Tue June 5 2007
             - Fixed xmlwf bug #1513566: "out of memory" error on file size zero.
             - Fixed outline.c bug #1543233: missing a final XML_ParserFree() call.
             - Fixes and improvements for Windows platform:
    -          bugs #1409451, #1476160, 1548182, 1602769, 1717322.
    +          bugs #1409451, #1476160, #1548182, #1602769, #1717322.
             - Build fixes for various platforms:
               HP-UX, Tru64, Solaris 9: patch #1437840, bug #1196180.
               All Unix: #1554618 (refreshed config.sub/config.guess).
    @@ -30,8 +66,8 @@ Release 2.0.0 Wed Jan 11 2006
               byte indexes and line/column numbers.
             - Updated to use libtool 1.5.22 (the most recent).
             - Added support for AmigaOS.
    -        - Some mostly minor bug fixes. SF issues include: 1006708,
    -          1021776, 1023646, 1114960, 1156398, 1221160, 1271642.
    +        - Some mostly minor bug fixes. SF issues include: #1006708,
    +          #1021776, #1023646, #1114960, #1156398, #1221160, #1271642.
     
     Release 1.95.8 Fri Jul 23 2004
             - Major new feature: suspend/resume.  Handlers can now request
    @@ -40,8 +76,8 @@ Release 1.95.8 Fri Jul 23 2004
               documentation for more details.
             - Some mostly minor bug fixes, but compilation should no
               longer generate warnings on most platforms.  SF issues
    -          include: 827319, 840173, 846309, 888329, 896188, 923913,
    -          928113, 961698, 985192.
    +          include: #827319, #840173, #846309, #888329, #896188, #923913,
    +          #928113, #961698, #985192.
     
     Release 1.95.7 Mon Oct 20 2003
             - Fixed enum XML_Status issue (reported on SourceForge many
    @@ -54,19 +90,19 @@ Release 1.95.7 Mon Oct 20 2003
             - Improved ability to build without the configure-generated
               expat_config.h header.  This is useful for applications
               which embed Expat rather than linking in the library.
    -        - Fixed a variety of bugs: see SF issues 458907, 609603,
    -          676844, 679754, 692878, 692964, 695401, 699323, 699487,
    -          820946.
    +        - Fixed a variety of bugs: see SF issues #458907, #609603,
    +          #676844, #679754, #692878, #692964, #695401, #699323, #699487,
    +          #820946.
             - Improved hash table lookups.
             - Added more regression tests and improved documentation.
     
     Release 1.95.6 Tue Jan 28 2003
             - Added XML_FreeContentModel().
             - Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree().
    -        - Fixed a variety of bugs: see SF issues 615606, 616863,
    -          618199, 653180, 673791.
    +        - Fixed a variety of bugs: see SF issues #615606, #616863,
    +          #618199, #653180, #673791.
             - Enhanced the regression test suite.
    -        - Man page improvements: includes SF issue 632146.
    +        - Man page improvements: includes SF issue #632146.
     
     Release 1.95.5 Fri Sep 6 2002
             - Added XML_UseForeignDTD() for improved SAX2 support.
    @@ -84,9 +120,9 @@ Release 1.95.5 Fri Sep 6 2002
             - Reduced line-length for all source code and headers to be
               no longer than 80 characters, to help with AS/400 support.
             - Reduced memory copying during parsing (SF patch #600964).
    -        - Fixed a variety of bugs: see SF issues 580793, 434664,
    -          483514, 580503, 581069, 584041, 584183, 584832, 585537,
    -          596555, 596678, 598352, 598944, 599715, 600479, 600971.
    +        - Fixed a variety of bugs: see SF issues #580793, #434664,
    +          #483514, #580503, #581069, #584041, #584183, #584832, #585537,
    +          #596555, #596678, #598352, #598944, #599715, #600479, #600971.
     
     Release 1.95.4 Fri Jul 12 2002
             - Added support for VMS, contributed by Craig Berry.  See
    @@ -95,14 +131,14 @@ Release 1.95.4 Fri Jul 12 2002
               contributed by Thomas Wegner and Daryle Walker.
             - Added Borland C++ Builder 5 / BCC 5.5 support, contributed
               by Patrick McConnell (SF patch #538032).
    -        - Fixed a variety of bugs: see SF issues 441449, 563184,
    -          564342, 566334, 566901, 569461, 570263, 575168, 579196.
    +        - Fixed a variety of bugs: see SF issues #441449, #563184,
    +          #564342, #566334, #566901, #569461, #570263, #575168, #579196.
             - Made skippedEntityHandler conform to SAX2 (see source comment)
             - Re-implemented WFC: Entity Declared from XML 1.0 spec and
               added a new error "entity declared in parameter entity":
    -          see SF bug report 569461 and SF patch 578161
    +          see SF bug report #569461 and SF patch #578161
             - Re-implemented section 5.1 from XML 1.0 spec:
    -          see SF bug report 570263 and SF patch 578161
    +          see SF bug report #570263 and SF patch #578161
     
     Release 1.95.3 Mon Jun 3 2002
             - Added a project to the MSVC workspace to create a wchar_t
    @@ -114,9 +150,9 @@ Release 1.95.3 Mon Jun 3 2002
             - Made the XML_UNICODE builds usable (thanks, Karl!).
             - Allow xmlwf to read from standard input.
             - Install a man page for xmlwf on Unix systems.
    -        - Fixed many bugs; see SF bug reports 231864, 461380, 464837,
    -          466885, 469226, 477667, 484419, 487840, 494749, 496505,
    -          547350.  Other bugs which we can't test as easily may also
    +        - Fixed many bugs; see SF bug reports #231864, #461380, #464837,
    +          #466885, #469226, #477667, #484419, #487840, #494749, #496505,
    +          #547350.  Other bugs which we can't test as easily may also
               have been fixed, especially in the area of build support.
     
     Release 1.95.2 Fri Jul 27 2001
    
    Copied: stable/9/contrib/expat/FREEBSD-Xlist (from r247511, head/contrib/expat/FREEBSD-Xlist)
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ stable/9/contrib/expat/FREEBSD-Xlist	Fri Mar  1 00:56:57 2013	(r247513, copy of r247511, head/contrib/expat/FREEBSD-Xlist)
    @@ -0,0 +1,19 @@
    +# $FreeBSD$
    +*.MPW
    +*.cmake
    +*.def
    +*.dsp
    +*.dsw
    +*.m4
    +*.pc.in
    +*config.h
    +CMake*
    +Configure*
    +amiga
    +bcb5
    +configure
    +conftools
    +doc/valid-xhtml10.png
    +m4
    +vms
    +win32
    
    Modified: stable/9/contrib/expat/MANIFEST
    ==============================================================================
    --- stable/9/contrib/expat/MANIFEST	Fri Mar  1 00:52:57 2013	(r247512)
    +++ stable/9/contrib/expat/MANIFEST	Fri Mar  1 00:56:57 2013	(r247513)
    @@ -1,5 +1,8 @@
    -amiga/stdlib.c
     amiga/launch.c
    +amiga/expat_68k.c
    +amiga/expat_68k.h
    +amiga/expat_68k_handler_stubs.c
    +amiga/expat_base.h
     amiga/expat_vectors.c
     amiga/expat_lib.c
     amiga/expat.xml
    @@ -42,25 +45,35 @@ doc/style.css
     doc/valid-xhtml10.png
     doc/xmlwf.1
     doc/xmlwf.sgml
    +CMakeLists.txt
    +CMake.README
     COPYING
     Changes
    +ConfigureChecks.cmake
     MANIFEST
     Makefile.in
     README
     configure
     configure.in
     expat_config.h.in
    +expat_config.h.cmake
    +expat.pc.in
     expat.dsw
    +aclocal.m4
     conftools/PrintPath
     conftools/ac_c_bigendian_cross.m4
    -conftools/config.guess
    -conftools/config.sub
     conftools/expat.m4
     conftools/get-version.sh
    +conftools/mkinstalldirs
    +conftools/config.guess
    +conftools/config.sub
     conftools/install-sh
    -conftools/libtool.m4
     conftools/ltmain.sh
    -conftools/mkinstalldirs
    +m4/libtool.m4
    +m4/ltversion.m4
    +m4/ltoptions.m4
    +m4/ltsugar.m4
    +m4/lt~obsolete.m4
     examples/elements.c
     examples/elements.dsp
     examples/outline.c
    
    Modified: stable/9/contrib/expat/Makefile.in
    ==============================================================================
    --- stable/9/contrib/expat/Makefile.in	Fri Mar  1 00:52:57 2013	(r247512)
    +++ stable/9/contrib/expat/Makefile.in	Fri Mar  1 00:56:57 2013	(r247513)
    @@ -31,6 +31,7 @@ bindir = @bindir@
     libdir = @libdir@
     includedir = @includedir@
     man1dir = @mandir@/man1
    +pkgconfigdir = $(libdir)/pkgconfig
     
     top_builddir = .
     
    @@ -46,18 +47,18 @@ LIBRARY = libexpat.la
     
     DESTDIR = $(INSTALL_ROOT)
     
    -default:  buildlib xmlwf/xmlwf
    +default:  buildlib xmlwf/xmlwf@EXEEXT@
     
    -buildlib: $(LIBRARY)
    +buildlib: $(LIBRARY) expat.pc
     
    -all: $(LIBRARY) xmlwf/xmlwf examples/elements examples/outline
    +all: $(LIBRARY) expat.pc xmlwf/xmlwf@EXEEXT@ examples/elements examples/outline
     
     clean:
    -	cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs
    -	cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs
    -	cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs
    -	cd tests && rm -rf .libs runtests runtests.o runtestspp runtestspp.o
    -	cd tests && rm -f chardata.o minicheck.o
    +	cd lib && rm -f $(LIBRARY) *.@OBJEXT@ *.lo && rm -rf .libs _libs
    +	cd xmlwf && rm -f xmlwf *.@OBJEXT@ *.lo && rm -rf .libs _libs
    +	cd examples && rm -f elements outline *.@OBJEXT@ *.lo && rm -rf .libs _libs
    +	cd tests && rm -rf .libs runtests runtests.@OBJEXT@ runtestspp runtestspp.@OBJEXT@
    +	cd tests && rm -f chardata.@OBJEXT@ minicheck.@OBJEXT@
     	rm -rf .libs libexpat.la
     	rm -f examples/core tests/core xmlwf/core
     
    @@ -65,34 +66,37 @@ clobber: clean
     
     distclean: clean
     	rm -f expat_config.h config.status config.log config.cache libtool
    -	rm -f Makefile
    +	rm -f Makefile expat.pc
     
     extraclean: distclean
     	rm -f expat_config.h.in configure
    -	rm -f conftools/ltconfig conftools/ltmain.sh conftools/libtool.m4
    +	rm -f aclocal.m4 m4/*
    +	rm -f conftools/ltmain.sh conftools/install-sh conftools/config.guess conftools/config.sub
     
     check: tests/runtests tests/runtestspp
     	tests/runtests
     	tests/runtestspp
     
    -install: xmlwf/xmlwf installlib
    +install: xmlwf/xmlwf@EXEEXT@ installlib
     	$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
    -	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(DESTDIR)$(bindir)/xmlwf
    +	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf@EXEEXT@ $(DESTDIR)$(bindir)/xmlwf
     	$(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(man1dir)
     
    -installlib: $(LIBRARY) $(APIHEADER)
    -	$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
    +installlib: $(LIBRARY) $(APIHEADER) expat.pc
    +	$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) $(DESTDIR)$(pkgconfigdir)
     	$(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)/$(LIBRARY)
     	for FN in $(APIHEADER) ; do $(INSTALL_DATA) $$FN $(DESTDIR)$(includedir) ; done
    +	$(INSTALL_DATA) expat.pc $(DESTDIR)$(pkgconfigdir)/expat.pc
     
     uninstall: uninstalllib
    -	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf
    +	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf@EXEEXT@
     	rm -f $(DESTDIR)$(man1dir)/xmlwf.1
     
     uninstalllib:
     	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIBRARY)
     	rm -f $(DESTDIR)$(includedir)/expat.h
     	rm -f $(DESTDIR)$(includedir)/expat_external.h
    +	rm -f $(DESTDIR)$(pkgconfigdir)/expat.pc
     
     # for VPATH builds (invoked by configure)
     mkdir-init:
    @@ -125,6 +129,9 @@ LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo
     $(LIBRARY): $(LIB_OBJS)
     	$(LINK_LIB) $(LIB_OBJS)
     
    +expat.pc: $(top_builddir)/config.status
    +	cd $(top_builddir) && $(SHELL) ./config.status $@
    +
     lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \
     	$(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h
     
    @@ -137,46 +144,53 @@ lib/xmltok.lo: lib/xmltok.c lib/xmltok_i
     	$(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h
     
     
    -XMLWF_OBJS = xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/@FILEMAP@.o
    -xmlwf/xmlwf.o: xmlwf/xmlwf.c
    -xmlwf/xmlfile.o: xmlwf/xmlfile.c
    -xmlwf/codepage.o: xmlwf/codepage.c
    -xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c
    -xmlwf/xmlwf: $(XMLWF_OBJS) $(LIBRARY)
    +XMLWF_OBJS = xmlwf/xmlwf.@OBJEXT@ xmlwf/xmlfile.@OBJEXT@ xmlwf/codepage.@OBJEXT@ xmlwf/@FILEMAP@.@OBJEXT@
    +xmlwf/xmlwf.@OBJEXT@: xmlwf/xmlwf.c
    +xmlwf/xmlfile.@OBJEXT@: xmlwf/xmlfile.c
    +xmlwf/codepage.@OBJEXT@: xmlwf/codepage.c
    +xmlwf/@FILEMAP@.@OBJEXT@: xmlwf/@FILEMAP@.c
    +xmlwf/xmlwf@EXEEXT@: $(XMLWF_OBJS) $(LIBRARY)
     	$(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY)
     
    -examples/elements.o: examples/elements.c
    -examples/elements: examples/elements.o $(LIBRARY)
    +examples/elements.@OBJEXT@: examples/elements.c
    +examples/elements: examples/elements.@OBJEXT@ $(LIBRARY)
     	$(LINK_EXE) $< $(LIBRARY)
     
    -examples/outline.o: examples/outline.c
    -examples/outline: examples/outline.o $(LIBRARY)
    +examples/outline.@OBJEXT@: examples/outline.c
    +examples/outline: examples/outline.@OBJEXT@ $(LIBRARY)
     	$(LINK_EXE) $< $(LIBRARY)
     
    -tests/chardata.o: tests/chardata.c tests/chardata.h
    -tests/minicheck.o: tests/minicheck.c tests/minicheck.h
    -tests/runtests.o: tests/runtests.c tests/chardata.h
    -tests/runtests: tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY)
    -	$(LINK_EXE) tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY)
    -tests/runtestspp.o: tests/runtestspp.cpp tests/runtests.c tests/chardata.h
    -tests/runtestspp: tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY)
    -	$(LINK_CXX_EXE) tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY)
    +tests/chardata.@OBJEXT@: tests/chardata.c tests/chardata.h
    +tests/minicheck.@OBJEXT@: tests/minicheck.c tests/minicheck.h
    +tests/runtests.@OBJEXT@: tests/runtests.c tests/chardata.h
    +tests/runtests: tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
    +	$(LINK_EXE) tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
    +tests/runtestspp.@OBJEXT@: tests/runtestspp.cpp tests/runtests.c tests/chardata.h
    +tests/runtestspp: tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
    +	$(LINK_CXX_EXE) tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
    +
    +tests/benchmark/benchmark.@OBJEXT@: tests/benchmark/benchmark.c
    +tests/benchmark/benchmark: tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY)
    +	$(LINK_EXE) tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY)
    +
    +run-benchmark: tests/benchmark/benchmark
    +	tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
     
     tests/xmlts.zip:
     	wget --output-document=tests/xmlts.zip \
    -		http://www.w3.org/XML/Test/xmlts20020606.zip
    +		http://www.w3.org/XML/Test/xmlts20080827.zip
     
     tests/XML-Test-Suite: tests/xmlts.zip
     	cd tests && unzip -q xmlts.zip
     
    -run-xmltest: xmlwf/xmlwf tests/XML-Test-Suite
    +run-xmltest: xmlwf/xmlwf@EXEEXT@ tests/XML-Test-Suite
     	tests/xmltest.sh
     
    -.SUFFIXES: .c .cpp .lo .o
    +.SUFFIXES: .c .cpp .lo .@OBJEXT@
     
    -.cpp.o:
    +.cpp.@OBJEXT@:
     	$(CXXCOMPILE) -o $@ -c $<
    -.c.o:
    +.c.@OBJEXT@:
     	$(COMPILE) -o $@ -c $<
     .c.lo:
     	$(LTCOMPILE) -o $@ -c $<
    
    Modified: stable/9/contrib/expat/README
    ==============================================================================
    --- stable/9/contrib/expat/README	Fri Mar  1 00:52:57 2013	(r247512)
    +++ stable/9/contrib/expat/README	Fri Mar  1 00:56:57 2013	(r247513)
    @@ -1,5 +1,5 @@
     
    -                        Expat, Release 2.0.1
    +                        Expat, Release 2.1.0
     
     This is Expat, a C library for parsing XML, written by James Clark.
     Expat is a stream-oriented XML parser.  This means that you register
    @@ -25,8 +25,7 @@ intended to be production grade software
     If you are building Expat from a check-out from the CVS repository,
     you need to run a script that generates the configure script using the
     GNU autoconf and libtool tools.  To do this, you need to have
    -autoconf 2.52 or newer and libtool 1.4 or newer (1.5 or newer preferred).
    -Run the script like this:
    +autoconf 2.58 or newer. Run the script like this:
     
             ./buildconf.sh
     
    @@ -65,8 +64,8 @@ location.  Have a look at the "Makefile"
     the directories into which things will be installed.
     
     If you are interested in building Expat to provide document
    -information in UTF-16 rather than the default UTF-8, follow these
    -instructions (after having run "make distclean"):
    +information in UTF-16 encoding rather than the default UTF-8, follow
    +these instructions (after having run "make distclean"):
     
             1. For UTF-16 output as unsigned short (and version/error
                strings as char), run:
    @@ -106,7 +105,10 @@ use DESTDIR=$(INSTALL_ROOT), even if DES
     environment, because variable-setting priority is
     1) commandline
     2) in-makefile
    -3) environment           
    +3) environment  
    +
    +Note: This only applies to the Expat library itself, building UTF-16 versions
    +of xmlwf and the tests is currently not supported.         
     
     Note for Solaris users:  The "ar" command is usually located in
     "/usr/ccs/bin", which is not in the default PATH.  You will need to
    
    Modified: stable/9/contrib/expat/configure.in
    ==============================================================================
    --- stable/9/contrib/expat/configure.in	Fri Mar  1 00:52:57 2013	(r247512)
    +++ stable/9/contrib/expat/configure.in	Fri Mar  1 00:56:57 2013	(r247513)
    @@ -10,8 +10,8 @@ dnl   under the terms of the License (ba
     dnl   in the file COPYING that comes with this distribution.
     dnl
     
    -dnl Ensure that Expat is configured with autoconf 2.52 or newer
    -AC_PREREQ(2.52)
    +dnl Ensure that Expat is configured with autoconf 2.58 or newer
    +AC_PREREQ(2.58)
     
     dnl Get the version number of Expat, using m4's esyscmd() command to run
     dnl the command at m4-generation time. This allows us to create an m4
    @@ -25,12 +25,13 @@ dnl test. I believe this test will work,
     dnl GNU M4 to test it right now.
     define([expat_version], ifdef([__gnu__],
                                   [esyscmd(conftools/get-version.sh lib/expat.h)],
    -                              [2.0.x]))
    +                              [2.1.x]))
     AC_INIT(expat, expat_version, expat-bugs@libexpat.org)
     undefine([expat_version])
     
     AC_CONFIG_SRCDIR(Makefile.in)
     AC_CONFIG_AUX_DIR(conftools)
    +AC_CONFIG_MACRO_DIR([m4])
     
     
     dnl
    @@ -44,13 +45,12 @@ dnl 
     dnl If the API changes incompatibly set LIBAGE back to 0
     dnl
     
    -LIBCURRENT=6
    -LIBREVISION=2
    -LIBAGE=5
    +LIBCURRENT=7
    +LIBREVISION=0
    +LIBAGE=6
     
     AC_CONFIG_HEADER(expat_config.h)
     
    -sinclude(conftools/libtool.m4)
     sinclude(conftools/ac_c_bigendian_cross.m4)
     
     AC_LIBTOOL_WIN32_DLL
    @@ -62,6 +62,7 @@ AC_SUBST(LIBAGE)
     
     dnl Checks for programs.
     AC_PROG_CC
    +AC_PROG_CXX
     AC_PROG_INSTALL
     
     if test "$GCC" = yes ; then
    @@ -144,7 +145,7 @@ AC_DEFINE([XML_DTD], 1,
     AC_DEFINE([XML_CONTEXT_BYTES], 1024,
               [Define to specify how much context to retain around the current parse point.])
     
    -AC_CONFIG_FILES(Makefile)
    +AC_CONFIG_FILES([Makefile expat.pc])
     AC_OUTPUT
     
     abs_srcdir="`cd $srcdir && pwd`"
    
    Modified: stable/9/contrib/expat/doc/reference.html
    ==============================================================================
    --- stable/9/contrib/expat/doc/reference.html	Fri Mar  1 00:52:57 2013	(r247512)
    +++ stable/9/contrib/expat/doc/reference.html	Fri Mar  1 00:56:57 2013	(r247513)
    @@ -129,8 +129,10 @@ interface.

  • XML_GetBase
  • XML_GetSpecifiedAttributeCount
  • XML_GetIdAttributeIndex
  • +
  • XML_GetAttributeInfo
  • XML_SetEncoding
  • XML_SetParamEntityParsing
  • +
  • XML_SetHashSalt
  • XML_UseForeignDTD
  • XML_SetReturnNSTriplet
  • XML_DefaultCurrent
  • @@ -369,6 +371,11 @@ footprint and can be faster. statically with the code that calls it; this is required to get all the right MSVC magic annotations correct. This is ignored on other platforms. + +
    XML_ATTR_INFO
    +
    If defined, makes the the additional function XML_GetAttributeInfo available +for reporting attribute byte offsets.

    @@ -917,12 +924,15 @@ XML_ParserCreateNS(const XML_Char *encod Constructs a new parser that has namespace processing in effect. Namespace expanded element names and attribute names are returned as a concatenation of the namespace URI, sep, and the local part of the name. This -means that you should pick a character for sep that can't be -part of a legal URI. There is a special case when sep is the null -character '\0': the namespace URI and the local part will be -concatenated without any separator - this is intended to support RDF processors. -It is a programming error to use the null separator with -namespace triplets. +means that you should pick a character for sep that can't be part +of an URI. Since Expat does not check namespace URIs for conformance, the +only safe choice for a namespace separator is a character that is illegal +in XML. For instance, '\xFF' is not legal in UTF-8, and +'\xFFFF' is not legal in UTF-16. There is a special case when +sep is the null character '\0': the namespace URI and +the local part will be concatenated without any separator - this is intended +to support RDF processors. It is a programming error to use the null separator +with namespace triplets.
     XML_Parser XMLCALL
    @@ -2074,6 +2084,27 @@ attribute. If called inside a start hand
     current call.
     
     
    +
    +const XML_AttrInfo * XMLCALL
    +XML_GetAttributeInfo(XML_Parser parser);
    +
    +
    +typedef struct {
    +  XML_Index  nameStart;  /* Offset to beginning of the attribute name. */
    +  XML_Index  nameEnd;    /* Offset after the attribute name's last byte. */
    +  XML_Index  valueStart; /* Offset to beginning of the attribute value. */
    +  XML_Index  valueEnd;   /* Offset after the attribute value's last byte. */
    +} XML_AttrInfo;
    +
    +
    +Returns an array of XML_AttrInfo structures for the +attribute/value pairs passed in the last call to the +XML_StartElementHandler that were specified +in the start-tag rather than defaulted. Each attribute/value pair counts +as 1; thus the number of entries in the array is +XML_GetSpecifiedAttributeCount(parser) / 2. +
    +
     enum XML_Status XMLCALL
     XML_SetEncoding(XML_Parser p,
    @@ -2104,6 +2135,24 @@ The choices for code are:
     
  • XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE
  • XML_PARAM_ENTITY_PARSING_ALWAYS
  • +Note: If XML_SetParamEntityParsing is called after +XML_Parse or XML_ParseBuffer, then it has +no effect and will always return 0. + + +
    +int XMLCALL
    +XML_SetHashSalt(XML_Parser p,
    +                unsigned long hash_salt);
    +
    +
    +Sets the hash salt to use for internal hash calculations. +Helps in preventing DoS attacks based on predicting hash +function behavior. In order to have an effect this must be called +before parsing has started. Returns 1 if successful, 0 when called +after XML_Parse or XML_ParseBuffer. +

    Note: This call is optional, as the parser will auto-generate a new +random salt value if no value has been set at the start of parsing.

    
    Modified: stable/9/contrib/expat/doc/xmlwf.sgml
    ==============================================================================
    --- stable/9/contrib/expat/doc/xmlwf.sgml	Fri Mar  1 00:52:57 2013	(r247512)
    +++ stable/9/contrib/expat/doc/xmlwf.sgml	Fri Mar  1 00:56:57 2013	(r247513)
    @@ -389,11 +389,6 @@ supports both.
       
         BUGS
     	
    -	According to the W3C standard, an XML file without a
    -	declaration at the beginning is not considered well-formed.
    -	However, &dhpackage; allows this to pass.
    -	
    -	
     	&dhpackage; returns a 0 - noerr result,
     	even if the file is not well-formed.  There is no good way for
     	a program to use &dhpackage; to quickly
    
    Modified: stable/9/contrib/expat/expat_config.h.in
    ==============================================================================
    --- stable/9/contrib/expat/expat_config.h.in	Fri Mar  1 00:52:57 2013	(r247512)
    +++ stable/9/contrib/expat/expat_config.h.in	Fri Mar  1 00:56:57 2013	(r247513)
    @@ -39,6 +39,9 @@
     /* Define to 1 if you have the  header file. */
     #undef HAVE_STRING_H
     
    +/* Define to 1 if you have the  header file. */
    +#undef HAVE_SYS_PARAM_H
    +
     /* Define to 1 if you have the  header file. */
     #undef HAVE_SYS_STAT_H
     
    @@ -48,6 +51,10 @@
     /* Define to 1 if you have the  header file. */
     #undef HAVE_UNISTD_H
     
    +/* Define to the sub-directory in which libtool stores uninstalled libraries.
    +   */
    +#undef LT_OBJDIR
    +
     /* Define to the address where bug reports for this package should be sent. */
     #undef PACKAGE_BUGREPORT
     
    @@ -60,6 +67,9 @@
     /* Define to the one symbol short name of this package. */
     #undef PACKAGE_TARNAME
     
    +/* Define to the home page for this package. */
    +#undef PACKAGE_URL
    +
     /* Define to the version of this package. */
     #undef PACKAGE_VERSION
     
    @@ -85,8 +95,8 @@
     /* Define to empty if `const' does not conform to ANSI C. */
     #undef const
     
    -/* Define to `long' if  does not define. */
    +/* Define to `long int' if  does not define. */
     #undef off_t
     
    -/* Define to `unsigned' if  does not define. */
    +/* Define to `unsigned int' if  does not define. */
     #undef size_t
    
    Modified: stable/9/contrib/expat/lib/expat.h
    ==============================================================================
    --- stable/9/contrib/expat/lib/expat.h	Fri Mar  1 00:52:57 2013	(r247512)
    +++ stable/9/contrib/expat/lib/expat.h	Fri Mar  1 00:56:57 2013	(r247513)
    @@ -742,6 +742,29 @@ XML_GetSpecifiedAttributeCount(XML_Parse
     XMLPARSEAPI(int)
     XML_GetIdAttributeIndex(XML_Parser parser);
     
    +#ifdef XML_ATTR_INFO
    +/* Source file byte offsets for the start and end of attribute names and values.
    +   The value indices are exclusive of surrounding quotes; thus in a UTF-8 source
    +   file an attribute value of "blah" will yield:
    +   info->valueEnd - info->valueStart = 4 bytes.
    +*/
    +typedef struct {
    +  XML_Index  nameStart;  /* Offset to beginning of the attribute name. */
    +  XML_Index  nameEnd;    /* Offset after the attribute name's last byte. */
    +  XML_Index  valueStart; /* Offset to beginning of the attribute value. */
    +  XML_Index  valueEnd;   /* Offset after the attribute value's last byte. */
    +} XML_AttrInfo;
    +
    +/* Returns an array of XML_AttrInfo structures for the attribute/value pairs
    +   passed in last call to the XML_StartElementHandler that were specified
    +   in the start-tag rather than defaulted. Each attribute/value pair counts
    +   as 1; thus the number of entries in the array is
    +   XML_GetSpecifiedAttributeCount(parser) / 2.
    +*/
    +XMLPARSEAPI(const XML_AttrInfo *)
    +XML_GetAttributeInfo(XML_Parser parser);
    +#endif
    +
     /* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
        detected.  The last call to XML_Parse must have isFinal true; len
        may be zero for this call (or any other).
    @@ -883,6 +906,15 @@ XMLPARSEAPI(int)
     XML_SetParamEntityParsing(XML_Parser parser,
                               enum XML_ParamEntityParsing parsing);
     
    +/* Sets the hash salt to use for internal hash calculations.
    +   Helps in preventing DoS attacks based on predicting hash
    +   function behavior. This must be called before parsing is started.
    +   Returns 1 if successful, 0 when called after parsing has started.
    +*/
    +XMLPARSEAPI(int)
    +XML_SetHashSalt(XML_Parser parser,
    +                unsigned long hash_salt);
    +
     /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
        XML_GetErrorCode returns information about the error.
     */
    @@ -984,7 +1016,8 @@ enum XML_FeatureEnum {
       XML_FEATURE_SIZEOF_XML_CHAR,
       XML_FEATURE_SIZEOF_XML_LCHAR,
       XML_FEATURE_NS,
    -  XML_FEATURE_LARGE_SIZE
    +  XML_FEATURE_LARGE_SIZE,
    +  XML_FEATURE_ATTR_INFO
       /* Additional features must be added to the end of this enum. */
     };
     
    @@ -1004,8 +1037,8 @@ XML_GetFeatureList(void);
        change to major or minor version.
     */
     #define XML_MAJOR_VERSION 2
    -#define XML_MINOR_VERSION 0
    -#define XML_MICRO_VERSION 1
    +#define XML_MINOR_VERSION 1
    +#define XML_MICRO_VERSION 0
     
     #ifdef __cplusplus
     }
    
    Modified: stable/9/contrib/expat/lib/xmlparse.c
    ==============================================================================
    --- stable/9/contrib/expat/lib/xmlparse.c	Fri Mar  1 00:52:57 2013	(r247512)
    +++ stable/9/contrib/expat/lib/xmlparse.c	Fri Mar  1 00:56:57 2013	(r247513)
    @@ -5,6 +5,8 @@
     #include 
     #include                      /* memset(), memcpy() */
     #include 
    +#include                      /* UINT_MAX */
    +#include                        /* time() */
     
     #define XML_BUILDING_EXPAT 1
     
    @@ -12,7 +14,7 @@
     #include "winconfig.h"
     #elif defined(MACOS_CLASSIC)
     #include "macconfig.h"
    -#elif defined(__amigaos4__)
    +#elif defined(__amigaos__)
     #include "amigaconfig.h"
     #elif defined(__WATCOMC__)
     #include "watcomconfig.h"
    @@ -327,15 +329,15 @@ processXmlDecl(XML_Parser parser, int is
     static enum XML_Error
     initializeEncoding(XML_Parser parser);
     static enum XML_Error
    -doProlog(XML_Parser parser, const ENCODING *enc, const char *s, 
    -         const char *end, int tok, const char *next, const char **nextPtr, 
    +doProlog(XML_Parser parser, const ENCODING *enc, const char *s,
    +         const char *end, int tok, const char *next, const char **nextPtr,
              XML_Bool haveMore);
     static enum XML_Error
    -processInternalEntity(XML_Parser parser, ENTITY *entity, 
    +processInternalEntity(XML_Parser parser, ENTITY *entity,
                           XML_Bool betweenDecl);
     static enum XML_Error
     doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
    -          const char *start, const char *end, const char **endPtr, 
    +          const char *start, const char *end, const char **endPtr,
               XML_Bool haveMore);
     static enum XML_Error
     doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr,
    @@ -353,7 +355,7 @@ static enum XML_Error
     addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
                const XML_Char *uri, BINDING **bindingsPtr);
     static int
    -defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata, 
    +defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata,
                     XML_Bool isId, const XML_Char *dfltValue, XML_Parser parser);
     static enum XML_Error
     storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata,
    @@ -391,12 +393,13 @@ static void dtdReset(DTD *p, const XML_M
     static void
     dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms);
     static int
    -dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
    +dtdCopy(XML_Parser oldParser,
    +        DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
     static int
    -copyEntityTable(HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
    -
    +copyEntityTable(XML_Parser oldParser,
    +                HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
     static NAMED *
    -lookup(HASH_TABLE *table, KEY name, size_t createSize);
    +lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize);
     static void FASTCALL
     hashTableInit(HASH_TABLE *, const XML_Memory_Handling_Suite *ms);
     static void FASTCALL hashTableClear(HASH_TABLE *);
    @@ -429,11 +432,15 @@ static ELEMENT_TYPE *
     getElementType(XML_Parser parser, const ENCODING *enc,
                    const char *ptr, const char *end);
     
    +static unsigned long generate_hash_secret_salt(void);
    +static XML_Bool startParsing(XML_Parser parser);
    +
     static XML_Parser
     parserCreate(const XML_Char *encodingName,
                  const XML_Memory_Handling_Suite *memsuite,
                  const XML_Char *nameSep,
                  DTD *dtd);
    +
     static void
     parserInit(XML_Parser parser, const XML_Char *encodingName);
     
    @@ -533,6 +540,9 @@ struct XML_ParserStruct {
       NS_ATT *m_nsAtts;
       unsigned long m_nsAttsVersion;
       unsigned char m_nsAttsPower;
    +#ifdef XML_ATTR_INFO
    +  XML_AttrInfo *m_attInfo;
    +#endif
       POSITION m_position;
       STRING_POOL m_tempPool;
       STRING_POOL m_temp2Pool;
    @@ -546,6 +556,7 @@ struct XML_ParserStruct {
       XML_Bool m_useForeignDTD;
       enum XML_ParamEntityParsing m_paramEntityParsing;
     #endif
    +  unsigned long m_hash_secret_salt;
     };
     
     #define MALLOC(s) (parser->m_mem.malloc_fcn((s)))
    @@ -640,6 +651,7 @@ struct XML_ParserStruct {
     #define nsAtts (parser->m_nsAtts)
     #define nsAttsVersion (parser->m_nsAttsVersion)
     #define nsAttsPower (parser->m_nsAttsPower)
    +#define attInfo (parser->m_attInfo)
     #define tempPool (parser->m_tempPool)
     #define temp2Pool (parser->m_temp2Pool)
     #define groupConnector (parser->m_groupConnector)
    @@ -653,6 +665,7 @@ struct XML_ParserStruct {
     #define useForeignDTD (parser->m_useForeignDTD)
     #define paramEntityParsing (parser->m_paramEntityParsing)
     #endif /* XML_DTD */
    +#define hash_secret_salt (parser->m_hash_secret_salt)
     
     XML_Parser XMLCALL
     XML_ParserCreate(const XML_Char *encodingName)
    @@ -670,29 +683,42 @@ XML_ParserCreateNS(const XML_Char *encod
     
     static const XML_Char implicitContext[] = {
       ASCII_x, ASCII_m, ASCII_l, ASCII_EQUALS, ASCII_h, ASCII_t, ASCII_t, ASCII_p,
    -  ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w, 
    +  ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w,
       ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD, ASCII_o, ASCII_r, ASCII_g,
       ASCII_SLASH, ASCII_X, ASCII_M, ASCII_L, ASCII_SLASH, ASCII_1, ASCII_9,
       ASCII_9, ASCII_8, ASCII_SLASH, ASCII_n, ASCII_a, ASCII_m, ASCII_e,
       ASCII_s, ASCII_p, ASCII_a, ASCII_c, ASCII_e, '\0'
     };
     
    +static unsigned long
    +generate_hash_secret_salt(void)
    +{
    +  unsigned int seed = time(NULL) % UINT_MAX;
    +  srand(seed);
    +  return rand();
    +}
    +
    +static XML_Bool  /* only valid for root parser */
    +startParsing(XML_Parser parser)
    +{
    +    /* hash functions must be initialized before setContext() is called */
    +    if (hash_secret_salt == 0)
    +      hash_secret_salt = generate_hash_secret_salt();
    +    if (ns) {
    +      /* implicit context only set for root parser, since child
    +         parsers (i.e. external entity parsers) will inherit it
    +      */
    +      return setContext(parser, implicitContext);
    +    }
    +    return XML_TRUE;
    +}
    +
     XML_Parser XMLCALL
     XML_ParserCreate_MM(const XML_Char *encodingName,
                         const XML_Memory_Handling_Suite *memsuite,
                         const XML_Char *nameSep)
     {
    -  XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL);
    -  if (parser != NULL && ns) {
    -    /* implicit context only set for root parser, since child
    -       parsers (i.e. external entity parsers) will inherit it
    -    */
    -    if (!setContext(parser, implicitContext)) {
    -      XML_ParserFree(parser);
    -      return NULL;
    -    }
    -  }
    -  return parser;
    +  return parserCreate(encodingName, memsuite, nameSep, NULL);
     }
     
     static XML_Parser
    @@ -737,9 +763,20 @@ parserCreate(const XML_Char *encodingNam
         FREE(parser);
         return NULL;
       }
    +#ifdef XML_ATTR_INFO
    +  attInfo = (XML_AttrInfo*)MALLOC(attsSize * sizeof(XML_AttrInfo));
    +  if (attInfo == NULL) {
    +    FREE(atts);
    +    FREE(parser);
    +    return NULL;
    +  }
    +#endif
       dataBuf = (XML_Char *)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));
       if (dataBuf == NULL) {
         FREE(atts);
    +#ifdef XML_ATTR_INFO
    +    FREE(attInfo);
    +#endif
         FREE(parser);
         return NULL;
       }
    @@ -752,6 +789,9 @@ parserCreate(const XML_Char *encodingNam
         if (_dtd == NULL) {
           FREE(dataBuf);
           FREE(atts);
    +#ifdef XML_ATTR_INFO
    +      FREE(attInfo);
    +#endif
           FREE(parser);
           return NULL;
         }
    @@ -866,6 +906,7 @@ parserInit(XML_Parser parser, const XML_
       useForeignDTD = XML_FALSE;
       paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
     #endif
    +  hash_secret_salt = 0;
     }
     
     /* moves list of bindings to freeBindingList */
    @@ -913,7 +954,7 @@ XML_ParserReset(XML_Parser parser, const
       poolClear(&temp2Pool);
       parserInit(parser, encodingName);
       dtdReset(_dtd, &parser->m_mem);
    -  return setContext(parser, implicitContext);
    +  return XML_TRUE;
     }
     
     enum XML_Status XMLCALL
    @@ -982,6 +1023,12 @@ XML_ExternalEntityParserCreate(XML_Parse
       int oldInEntityValue = prologState.inEntityValue;
     #endif
       XML_Bool oldns_triplets = ns_triplets;
    +  /* Note that the new parser shares the same hash secret as the old
    +     parser, so that dtdCopy and copyEntityTable can lookup values
    +     from hash tables associated with either parser without us having
    +     to worry which hash secrets each table has.
    +  */
    +  unsigned long oldhash_secret_salt = hash_secret_salt;
     
     #ifdef XML_DTD
       if (!context)
    @@ -1035,13 +1082,14 @@ XML_ExternalEntityParserCreate(XML_Parse
         externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg;
       defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
       ns_triplets = oldns_triplets;
    +  hash_secret_salt = oldhash_secret_salt;
       parentParser = oldParser;
     #ifdef XML_DTD
       paramEntityParsing = oldParamEntityParsing;
       prologState.inEntityValue = oldInEntityValue;
       if (context) {
     #endif /* XML_DTD */
    -    if (!dtdCopy(_dtd, oldDtd, &parser->m_mem)
    +    if (!dtdCopy(oldParser, _dtd, oldDtd, &parser->m_mem)
           || !setContext(parser, context)) {
           XML_ParserFree(parser);
           return NULL;
    @@ -1130,6 +1178,9 @@ XML_ParserFree(XML_Parser parser)
     #endif /* XML_DTD */
         dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem);
       FREE((void *)atts);
    +#ifdef XML_ATTR_INFO
    +  FREE((void *)attInfo);
    +#endif
       FREE(groupConnector);
       FREE(buffer);
       FREE(dataBuf);
    @@ -1210,6 +1261,14 @@ XML_GetIdAttributeIndex(XML_Parser parse
       return idAttIndex;
     }
     
    +#ifdef XML_ATTR_INFO
    +const XML_AttrInfo * XMLCALL
    +XML_GetAttributeInfo(XML_Parser parser)
    +{
    +  return attInfo;
    +}
    +#endif
    +
     void XMLCALL
     XML_SetElementHandler(XML_Parser parser,
                           XML_StartElementHandler start,
    @@ -1426,6 +1485,17 @@ XML_SetParamEntityParsing(XML_Parser par
     #endif
     }
     
    +int XMLCALL
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 00:58:47 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 654C4849;
     Fri,  1 Mar 2013 00:58:47 +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 544B1CF6;
     Fri,  1 Mar 2013 00:58:47 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r210wlqi020108;
     Fri, 1 Mar 2013 00:58:47 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r210wj3S020087;
     Fri, 1 Mar 2013 00:58:45 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201303010058.r210wj3S020087@svn.freebsd.org>
    From: Xin LI 
    Date: Fri, 1 Mar 2013 00:58:45 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247514 - in stable/8: contrib/expat contrib/expat/doc
     contrib/expat/examples contrib/expat/lib contrib/expat/tests
     contrib/expat/tests/benchmark contrib/expat/xmlwf lib/libexpat
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 00:58:47 -0000
    
    Author: delphij
    Date: Fri Mar  1 00:58:44 2013
    New Revision: 247514
    URL: http://svnweb.freebsd.org/changeset/base/247514
    
    Log:
      MFC: libexpat 2.1.0.
    
    Added:
      stable/8/contrib/expat/FREEBSD-Xlist
         - copied unchanged from r247511, head/contrib/expat/FREEBSD-Xlist
    Deleted:
      stable/8/contrib/expat/FREEBSD-upgrade
      stable/8/contrib/expat/configure
      stable/8/contrib/expat/doc/valid-xhtml10.png
      stable/8/contrib/expat/lib/winconfig.h
      stable/8/contrib/expat/tests/benchmark/benchmark.dsp
      stable/8/contrib/expat/tests/benchmark/benchmark.dsw
    Modified:
      stable/8/contrib/expat/Changes   (contents, props changed)
      stable/8/contrib/expat/MANIFEST   (contents, props changed)
      stable/8/contrib/expat/Makefile.in   (contents, props changed)
      stable/8/contrib/expat/README   (contents, props changed)
      stable/8/contrib/expat/configure.in   (contents, props changed)
      stable/8/contrib/expat/doc/reference.html   (contents, props changed)
      stable/8/contrib/expat/doc/xmlwf.sgml   (contents, props changed)
      stable/8/contrib/expat/expat_config.h.in   (contents, props changed)
      stable/8/contrib/expat/lib/expat.h   (contents, props changed)
      stable/8/contrib/expat/lib/xmlparse.c   (contents, props changed)
      stable/8/contrib/expat/lib/xmlrole.c   (contents, props changed)
      stable/8/contrib/expat/lib/xmltok.c   (contents, props changed)
      stable/8/contrib/expat/lib/xmltok_impl.c   (contents, props changed)
      stable/8/contrib/expat/tests/README.txt   (contents, props changed)
      stable/8/contrib/expat/tests/minicheck.h   (contents, props changed)
      stable/8/contrib/expat/tests/runtests.c   (contents, props changed)
      stable/8/contrib/expat/tests/xmltest.sh   (contents, props changed)
      stable/8/contrib/expat/xmlwf/readfilemap.c   (contents, props changed)
      stable/8/contrib/expat/xmlwf/xmlwf.c   (contents, props changed)
      stable/8/lib/libexpat/expat_config.h
      stable/8/lib/libexpat/libbsdxml.3
    Directory Properties:
      stable/8/contrib/expat/   (props changed)
      stable/8/contrib/expat/COPYING   (props changed)
      stable/8/contrib/expat/doc/expat.png   (props changed)
      stable/8/contrib/expat/doc/style.css   (props changed)
      stable/8/contrib/expat/doc/xmlwf.1   (props changed)
      stable/8/contrib/expat/examples/elements.c   (props changed)
      stable/8/contrib/expat/examples/outline.c   (props changed)
      stable/8/contrib/expat/lib/ascii.h   (props changed)
      stable/8/contrib/expat/lib/asciitab.h   (props changed)
      stable/8/contrib/expat/lib/expat_external.h   (props changed)
      stable/8/contrib/expat/lib/iasciitab.h   (props changed)
      stable/8/contrib/expat/lib/internal.h   (props changed)
      stable/8/contrib/expat/lib/latin1tab.h   (props changed)
      stable/8/contrib/expat/lib/nametab.h   (props changed)
      stable/8/contrib/expat/lib/utf8tab.h   (props changed)
      stable/8/contrib/expat/lib/xmlrole.h   (props changed)
      stable/8/contrib/expat/lib/xmltok.h   (props changed)
      stable/8/contrib/expat/lib/xmltok_impl.h   (props changed)
      stable/8/contrib/expat/lib/xmltok_ns.c   (props changed)
      stable/8/contrib/expat/tests/benchmark/README.txt   (props changed)
      stable/8/contrib/expat/tests/benchmark/benchmark.c   (props changed)
      stable/8/contrib/expat/tests/chardata.c   (props changed)
      stable/8/contrib/expat/tests/chardata.h   (props changed)
      stable/8/contrib/expat/tests/minicheck.c   (props changed)
      stable/8/contrib/expat/tests/runtestspp.cpp   (props changed)
      stable/8/contrib/expat/xmlwf/codepage.c   (props changed)
      stable/8/contrib/expat/xmlwf/codepage.h   (props changed)
      stable/8/contrib/expat/xmlwf/ct.c   (props changed)
      stable/8/contrib/expat/xmlwf/filemap.h   (props changed)
      stable/8/contrib/expat/xmlwf/unixfilemap.c   (props changed)
      stable/8/contrib/expat/xmlwf/win32filemap.c   (props changed)
      stable/8/contrib/expat/xmlwf/xmlfile.c   (props changed)
      stable/8/contrib/expat/xmlwf/xmlfile.h   (props changed)
      stable/8/contrib/expat/xmlwf/xmlmime.c   (props changed)
      stable/8/contrib/expat/xmlwf/xmlmime.h   (props changed)
      stable/8/contrib/expat/xmlwf/xmltchar.h   (props changed)
      stable/8/contrib/expat/xmlwf/xmlurl.h   (props changed)
      stable/8/contrib/expat/xmlwf/xmlwin32url.cxx   (props changed)
      stable/8/lib/libexpat/   (props changed)
    
    Modified: stable/8/contrib/expat/Changes
    ==============================================================================
    --- stable/8/contrib/expat/Changes	Fri Mar  1 00:56:57 2013	(r247513)
    +++ stable/8/contrib/expat/Changes	Fri Mar  1 00:58:44 2013	(r247514)
    @@ -1,5 +1,41 @@
    +Release 2.1.0 Sat March 24 2012
    +        - Bug Fixes:
    +          #1742315: Harmful XML_ParserCreateNS suggestion.
    +          #2895533: CVE-2012-1147 - Resource leak in readfilemap.c.
    +          #1785430: Expat build fails on linux-amd64 with gcc version>=4.1 -O3.
    +          #1983953, 2517952, 2517962, 2649838: 
    +                Build modifications using autoreconf instead of buildconf.sh.
    +          #2815947, #2884086: OBJEXT and EXEEXT support while building.
    +          #1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences.
    +          #2517938: xmlwf should return non-zero exit status if not well-formed.
    +          #2517946: Wrong statement about XMLDecl in xmlwf.1 and xmlwf.sgml.
    +          #2855609: Dangling positionPtr after error.
    +          #2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8().
    +          #2958794: CVE-2012-1148 - Memory leak in poolGrow.
    +          #2990652: CMake support.
    +          #3010819: UNEXPECTED_STATE with a trailing "%" in entity value.
    +          #3206497: Unitialized memory returned from XML_Parse.
    +          #3287849: make check fails on mingw-w64.
    +          #3496608: CVE-2012-0876 - Hash DOS attack.
    +        - Patches:
    +          #1749198: pkg-config support.
    +          #3010222: Fix for bug #3010819.
    +          #3312568: CMake support.
    +          #3446384: Report byte offsets for attr names and values.
    +        - New Features / API changes:
    +          Added new API member XML_SetHashSalt() that allows setting an intial
    +                value (salt) for hash calculations. This is part of the fix for
    +                bug #3496608 to randomize hash parameters.
    +          When compiled with XML_ATTR_INFO defined, adds new API member
    +                XML_GetAttributeInfo() that allows retrieving the byte
    +                offsets for attribute names and values (patch #3446384).
    +          Added CMake build system.
    +                See bug #2990652 and patch #3312568.
    +          Added run-benchmark target to Makefile.in - relies on testdata module
    +                present in the same relative location as in the repository.
    +          
     Release 2.0.1 Tue June 5 2007
    -        - Fixed bugs #1515266, 1515600: The character data handler's calling
    +        - Fixed bugs #1515266, #1515600: The character data handler's calling
               of XML_StopParser() was not handled properly; if the parser was
               stopped and the handler set to NULL, the parser would segfault.
             - Fixed bug #1690883: Expat failed on EBCDIC systems as it assumed
    @@ -8,7 +44,7 @@ Release 2.0.1 Tue June 5 2007
             - Fixed xmlwf bug #1513566: "out of memory" error on file size zero.
             - Fixed outline.c bug #1543233: missing a final XML_ParserFree() call.
             - Fixes and improvements for Windows platform:
    -          bugs #1409451, #1476160, 1548182, 1602769, 1717322.
    +          bugs #1409451, #1476160, #1548182, #1602769, #1717322.
             - Build fixes for various platforms:
               HP-UX, Tru64, Solaris 9: patch #1437840, bug #1196180.
               All Unix: #1554618 (refreshed config.sub/config.guess).
    @@ -30,8 +66,8 @@ Release 2.0.0 Wed Jan 11 2006
               byte indexes and line/column numbers.
             - Updated to use libtool 1.5.22 (the most recent).
             - Added support for AmigaOS.
    -        - Some mostly minor bug fixes. SF issues include: 1006708,
    -          1021776, 1023646, 1114960, 1156398, 1221160, 1271642.
    +        - Some mostly minor bug fixes. SF issues include: #1006708,
    +          #1021776, #1023646, #1114960, #1156398, #1221160, #1271642.
     
     Release 1.95.8 Fri Jul 23 2004
             - Major new feature: suspend/resume.  Handlers can now request
    @@ -40,8 +76,8 @@ Release 1.95.8 Fri Jul 23 2004
               documentation for more details.
             - Some mostly minor bug fixes, but compilation should no
               longer generate warnings on most platforms.  SF issues
    -          include: 827319, 840173, 846309, 888329, 896188, 923913,
    -          928113, 961698, 985192.
    +          include: #827319, #840173, #846309, #888329, #896188, #923913,
    +          #928113, #961698, #985192.
     
     Release 1.95.7 Mon Oct 20 2003
             - Fixed enum XML_Status issue (reported on SourceForge many
    @@ -54,19 +90,19 @@ Release 1.95.7 Mon Oct 20 2003
             - Improved ability to build without the configure-generated
               expat_config.h header.  This is useful for applications
               which embed Expat rather than linking in the library.
    -        - Fixed a variety of bugs: see SF issues 458907, 609603,
    -          676844, 679754, 692878, 692964, 695401, 699323, 699487,
    -          820946.
    +        - Fixed a variety of bugs: see SF issues #458907, #609603,
    +          #676844, #679754, #692878, #692964, #695401, #699323, #699487,
    +          #820946.
             - Improved hash table lookups.
             - Added more regression tests and improved documentation.
     
     Release 1.95.6 Tue Jan 28 2003
             - Added XML_FreeContentModel().
             - Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree().
    -        - Fixed a variety of bugs: see SF issues 615606, 616863,
    -          618199, 653180, 673791.
    +        - Fixed a variety of bugs: see SF issues #615606, #616863,
    +          #618199, #653180, #673791.
             - Enhanced the regression test suite.
    -        - Man page improvements: includes SF issue 632146.
    +        - Man page improvements: includes SF issue #632146.
     
     Release 1.95.5 Fri Sep 6 2002
             - Added XML_UseForeignDTD() for improved SAX2 support.
    @@ -84,9 +120,9 @@ Release 1.95.5 Fri Sep 6 2002
             - Reduced line-length for all source code and headers to be
               no longer than 80 characters, to help with AS/400 support.
             - Reduced memory copying during parsing (SF patch #600964).
    -        - Fixed a variety of bugs: see SF issues 580793, 434664,
    -          483514, 580503, 581069, 584041, 584183, 584832, 585537,
    -          596555, 596678, 598352, 598944, 599715, 600479, 600971.
    +        - Fixed a variety of bugs: see SF issues #580793, #434664,
    +          #483514, #580503, #581069, #584041, #584183, #584832, #585537,
    +          #596555, #596678, #598352, #598944, #599715, #600479, #600971.
     
     Release 1.95.4 Fri Jul 12 2002
             - Added support for VMS, contributed by Craig Berry.  See
    @@ -95,14 +131,14 @@ Release 1.95.4 Fri Jul 12 2002
               contributed by Thomas Wegner and Daryle Walker.
             - Added Borland C++ Builder 5 / BCC 5.5 support, contributed
               by Patrick McConnell (SF patch #538032).
    -        - Fixed a variety of bugs: see SF issues 441449, 563184,
    -          564342, 566334, 566901, 569461, 570263, 575168, 579196.
    +        - Fixed a variety of bugs: see SF issues #441449, #563184,
    +          #564342, #566334, #566901, #569461, #570263, #575168, #579196.
             - Made skippedEntityHandler conform to SAX2 (see source comment)
             - Re-implemented WFC: Entity Declared from XML 1.0 spec and
               added a new error "entity declared in parameter entity":
    -          see SF bug report 569461 and SF patch 578161
    +          see SF bug report #569461 and SF patch #578161
             - Re-implemented section 5.1 from XML 1.0 spec:
    -          see SF bug report 570263 and SF patch 578161
    +          see SF bug report #570263 and SF patch #578161
     
     Release 1.95.3 Mon Jun 3 2002
             - Added a project to the MSVC workspace to create a wchar_t
    @@ -114,9 +150,9 @@ Release 1.95.3 Mon Jun 3 2002
             - Made the XML_UNICODE builds usable (thanks, Karl!).
             - Allow xmlwf to read from standard input.
             - Install a man page for xmlwf on Unix systems.
    -        - Fixed many bugs; see SF bug reports 231864, 461380, 464837,
    -          466885, 469226, 477667, 484419, 487840, 494749, 496505,
    -          547350.  Other bugs which we can't test as easily may also
    +        - Fixed many bugs; see SF bug reports #231864, #461380, #464837,
    +          #466885, #469226, #477667, #484419, #487840, #494749, #496505,
    +          #547350.  Other bugs which we can't test as easily may also
               have been fixed, especially in the area of build support.
     
     Release 1.95.2 Fri Jul 27 2001
    
    Copied: stable/8/contrib/expat/FREEBSD-Xlist (from r247511, head/contrib/expat/FREEBSD-Xlist)
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ stable/8/contrib/expat/FREEBSD-Xlist	Fri Mar  1 00:58:44 2013	(r247514, copy of r247511, head/contrib/expat/FREEBSD-Xlist)
    @@ -0,0 +1,19 @@
    +# $FreeBSD$
    +*.MPW
    +*.cmake
    +*.def
    +*.dsp
    +*.dsw
    +*.m4
    +*.pc.in
    +*config.h
    +CMake*
    +Configure*
    +amiga
    +bcb5
    +configure
    +conftools
    +doc/valid-xhtml10.png
    +m4
    +vms
    +win32
    
    Modified: stable/8/contrib/expat/MANIFEST
    ==============================================================================
    --- stable/8/contrib/expat/MANIFEST	Fri Mar  1 00:56:57 2013	(r247513)
    +++ stable/8/contrib/expat/MANIFEST	Fri Mar  1 00:58:44 2013	(r247514)
    @@ -1,5 +1,8 @@
    -amiga/stdlib.c
     amiga/launch.c
    +amiga/expat_68k.c
    +amiga/expat_68k.h
    +amiga/expat_68k_handler_stubs.c
    +amiga/expat_base.h
     amiga/expat_vectors.c
     amiga/expat_lib.c
     amiga/expat.xml
    @@ -42,25 +45,35 @@ doc/style.css
     doc/valid-xhtml10.png
     doc/xmlwf.1
     doc/xmlwf.sgml
    +CMakeLists.txt
    +CMake.README
     COPYING
     Changes
    +ConfigureChecks.cmake
     MANIFEST
     Makefile.in
     README
     configure
     configure.in
     expat_config.h.in
    +expat_config.h.cmake
    +expat.pc.in
     expat.dsw
    +aclocal.m4
     conftools/PrintPath
     conftools/ac_c_bigendian_cross.m4
    -conftools/config.guess
    -conftools/config.sub
     conftools/expat.m4
     conftools/get-version.sh
    +conftools/mkinstalldirs
    +conftools/config.guess
    +conftools/config.sub
     conftools/install-sh
    -conftools/libtool.m4
     conftools/ltmain.sh
    -conftools/mkinstalldirs
    +m4/libtool.m4
    +m4/ltversion.m4
    +m4/ltoptions.m4
    +m4/ltsugar.m4
    +m4/lt~obsolete.m4
     examples/elements.c
     examples/elements.dsp
     examples/outline.c
    
    Modified: stable/8/contrib/expat/Makefile.in
    ==============================================================================
    --- stable/8/contrib/expat/Makefile.in	Fri Mar  1 00:56:57 2013	(r247513)
    +++ stable/8/contrib/expat/Makefile.in	Fri Mar  1 00:58:44 2013	(r247514)
    @@ -31,6 +31,7 @@ bindir = @bindir@
     libdir = @libdir@
     includedir = @includedir@
     man1dir = @mandir@/man1
    +pkgconfigdir = $(libdir)/pkgconfig
     
     top_builddir = .
     
    @@ -46,18 +47,18 @@ LIBRARY = libexpat.la
     
     DESTDIR = $(INSTALL_ROOT)
     
    -default:  buildlib xmlwf/xmlwf
    +default:  buildlib xmlwf/xmlwf@EXEEXT@
     
    -buildlib: $(LIBRARY)
    +buildlib: $(LIBRARY) expat.pc
     
    -all: $(LIBRARY) xmlwf/xmlwf examples/elements examples/outline
    +all: $(LIBRARY) expat.pc xmlwf/xmlwf@EXEEXT@ examples/elements examples/outline
     
     clean:
    -	cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs
    -	cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs
    -	cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs
    -	cd tests && rm -rf .libs runtests runtests.o runtestspp runtestspp.o
    -	cd tests && rm -f chardata.o minicheck.o
    +	cd lib && rm -f $(LIBRARY) *.@OBJEXT@ *.lo && rm -rf .libs _libs
    +	cd xmlwf && rm -f xmlwf *.@OBJEXT@ *.lo && rm -rf .libs _libs
    +	cd examples && rm -f elements outline *.@OBJEXT@ *.lo && rm -rf .libs _libs
    +	cd tests && rm -rf .libs runtests runtests.@OBJEXT@ runtestspp runtestspp.@OBJEXT@
    +	cd tests && rm -f chardata.@OBJEXT@ minicheck.@OBJEXT@
     	rm -rf .libs libexpat.la
     	rm -f examples/core tests/core xmlwf/core
     
    @@ -65,34 +66,37 @@ clobber: clean
     
     distclean: clean
     	rm -f expat_config.h config.status config.log config.cache libtool
    -	rm -f Makefile
    +	rm -f Makefile expat.pc
     
     extraclean: distclean
     	rm -f expat_config.h.in configure
    -	rm -f conftools/ltconfig conftools/ltmain.sh conftools/libtool.m4
    +	rm -f aclocal.m4 m4/*
    +	rm -f conftools/ltmain.sh conftools/install-sh conftools/config.guess conftools/config.sub
     
     check: tests/runtests tests/runtestspp
     	tests/runtests
     	tests/runtestspp
     
    -install: xmlwf/xmlwf installlib
    +install: xmlwf/xmlwf@EXEEXT@ installlib
     	$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
    -	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(DESTDIR)$(bindir)/xmlwf
    +	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf@EXEEXT@ $(DESTDIR)$(bindir)/xmlwf
     	$(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(man1dir)
     
    -installlib: $(LIBRARY) $(APIHEADER)
    -	$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
    +installlib: $(LIBRARY) $(APIHEADER) expat.pc
    +	$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) $(DESTDIR)$(pkgconfigdir)
     	$(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)/$(LIBRARY)
     	for FN in $(APIHEADER) ; do $(INSTALL_DATA) $$FN $(DESTDIR)$(includedir) ; done
    +	$(INSTALL_DATA) expat.pc $(DESTDIR)$(pkgconfigdir)/expat.pc
     
     uninstall: uninstalllib
    -	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf
    +	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf@EXEEXT@
     	rm -f $(DESTDIR)$(man1dir)/xmlwf.1
     
     uninstalllib:
     	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIBRARY)
     	rm -f $(DESTDIR)$(includedir)/expat.h
     	rm -f $(DESTDIR)$(includedir)/expat_external.h
    +	rm -f $(DESTDIR)$(pkgconfigdir)/expat.pc
     
     # for VPATH builds (invoked by configure)
     mkdir-init:
    @@ -125,6 +129,9 @@ LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo
     $(LIBRARY): $(LIB_OBJS)
     	$(LINK_LIB) $(LIB_OBJS)
     
    +expat.pc: $(top_builddir)/config.status
    +	cd $(top_builddir) && $(SHELL) ./config.status $@
    +
     lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \
     	$(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h
     
    @@ -137,46 +144,53 @@ lib/xmltok.lo: lib/xmltok.c lib/xmltok_i
     	$(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h
     
     
    -XMLWF_OBJS = xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/@FILEMAP@.o
    -xmlwf/xmlwf.o: xmlwf/xmlwf.c
    -xmlwf/xmlfile.o: xmlwf/xmlfile.c
    -xmlwf/codepage.o: xmlwf/codepage.c
    -xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c
    -xmlwf/xmlwf: $(XMLWF_OBJS) $(LIBRARY)
    +XMLWF_OBJS = xmlwf/xmlwf.@OBJEXT@ xmlwf/xmlfile.@OBJEXT@ xmlwf/codepage.@OBJEXT@ xmlwf/@FILEMAP@.@OBJEXT@
    +xmlwf/xmlwf.@OBJEXT@: xmlwf/xmlwf.c
    +xmlwf/xmlfile.@OBJEXT@: xmlwf/xmlfile.c
    +xmlwf/codepage.@OBJEXT@: xmlwf/codepage.c
    +xmlwf/@FILEMAP@.@OBJEXT@: xmlwf/@FILEMAP@.c
    +xmlwf/xmlwf@EXEEXT@: $(XMLWF_OBJS) $(LIBRARY)
     	$(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY)
     
    -examples/elements.o: examples/elements.c
    -examples/elements: examples/elements.o $(LIBRARY)
    +examples/elements.@OBJEXT@: examples/elements.c
    +examples/elements: examples/elements.@OBJEXT@ $(LIBRARY)
     	$(LINK_EXE) $< $(LIBRARY)
     
    -examples/outline.o: examples/outline.c
    -examples/outline: examples/outline.o $(LIBRARY)
    +examples/outline.@OBJEXT@: examples/outline.c
    +examples/outline: examples/outline.@OBJEXT@ $(LIBRARY)
     	$(LINK_EXE) $< $(LIBRARY)
     
    -tests/chardata.o: tests/chardata.c tests/chardata.h
    -tests/minicheck.o: tests/minicheck.c tests/minicheck.h
    -tests/runtests.o: tests/runtests.c tests/chardata.h
    -tests/runtests: tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY)
    -	$(LINK_EXE) tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY)
    -tests/runtestspp.o: tests/runtestspp.cpp tests/runtests.c tests/chardata.h
    -tests/runtestspp: tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY)
    -	$(LINK_CXX_EXE) tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY)
    +tests/chardata.@OBJEXT@: tests/chardata.c tests/chardata.h
    +tests/minicheck.@OBJEXT@: tests/minicheck.c tests/minicheck.h
    +tests/runtests.@OBJEXT@: tests/runtests.c tests/chardata.h
    +tests/runtests: tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
    +	$(LINK_EXE) tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
    +tests/runtestspp.@OBJEXT@: tests/runtestspp.cpp tests/runtests.c tests/chardata.h
    +tests/runtestspp: tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
    +	$(LINK_CXX_EXE) tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
    +
    +tests/benchmark/benchmark.@OBJEXT@: tests/benchmark/benchmark.c
    +tests/benchmark/benchmark: tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY)
    +	$(LINK_EXE) tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY)
    +
    +run-benchmark: tests/benchmark/benchmark
    +	tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
     
     tests/xmlts.zip:
     	wget --output-document=tests/xmlts.zip \
    -		http://www.w3.org/XML/Test/xmlts20020606.zip
    +		http://www.w3.org/XML/Test/xmlts20080827.zip
     
     tests/XML-Test-Suite: tests/xmlts.zip
     	cd tests && unzip -q xmlts.zip
     
    -run-xmltest: xmlwf/xmlwf tests/XML-Test-Suite
    +run-xmltest: xmlwf/xmlwf@EXEEXT@ tests/XML-Test-Suite
     	tests/xmltest.sh
     
    -.SUFFIXES: .c .cpp .lo .o
    +.SUFFIXES: .c .cpp .lo .@OBJEXT@
     
    -.cpp.o:
    +.cpp.@OBJEXT@:
     	$(CXXCOMPILE) -o $@ -c $<
    -.c.o:
    +.c.@OBJEXT@:
     	$(COMPILE) -o $@ -c $<
     .c.lo:
     	$(LTCOMPILE) -o $@ -c $<
    
    Modified: stable/8/contrib/expat/README
    ==============================================================================
    --- stable/8/contrib/expat/README	Fri Mar  1 00:56:57 2013	(r247513)
    +++ stable/8/contrib/expat/README	Fri Mar  1 00:58:44 2013	(r247514)
    @@ -1,5 +1,5 @@
     
    -                        Expat, Release 2.0.1
    +                        Expat, Release 2.1.0
     
     This is Expat, a C library for parsing XML, written by James Clark.
     Expat is a stream-oriented XML parser.  This means that you register
    @@ -25,8 +25,7 @@ intended to be production grade software
     If you are building Expat from a check-out from the CVS repository,
     you need to run a script that generates the configure script using the
     GNU autoconf and libtool tools.  To do this, you need to have
    -autoconf 2.52 or newer and libtool 1.4 or newer (1.5 or newer preferred).
    -Run the script like this:
    +autoconf 2.58 or newer. Run the script like this:
     
             ./buildconf.sh
     
    @@ -65,8 +64,8 @@ location.  Have a look at the "Makefile"
     the directories into which things will be installed.
     
     If you are interested in building Expat to provide document
    -information in UTF-16 rather than the default UTF-8, follow these
    -instructions (after having run "make distclean"):
    +information in UTF-16 encoding rather than the default UTF-8, follow
    +these instructions (after having run "make distclean"):
     
             1. For UTF-16 output as unsigned short (and version/error
                strings as char), run:
    @@ -106,7 +105,10 @@ use DESTDIR=$(INSTALL_ROOT), even if DES
     environment, because variable-setting priority is
     1) commandline
     2) in-makefile
    -3) environment           
    +3) environment  
    +
    +Note: This only applies to the Expat library itself, building UTF-16 versions
    +of xmlwf and the tests is currently not supported.         
     
     Note for Solaris users:  The "ar" command is usually located in
     "/usr/ccs/bin", which is not in the default PATH.  You will need to
    
    Modified: stable/8/contrib/expat/configure.in
    ==============================================================================
    --- stable/8/contrib/expat/configure.in	Fri Mar  1 00:56:57 2013	(r247513)
    +++ stable/8/contrib/expat/configure.in	Fri Mar  1 00:58:44 2013	(r247514)
    @@ -10,8 +10,8 @@ dnl   under the terms of the License (ba
     dnl   in the file COPYING that comes with this distribution.
     dnl
     
    -dnl Ensure that Expat is configured with autoconf 2.52 or newer
    -AC_PREREQ(2.52)
    +dnl Ensure that Expat is configured with autoconf 2.58 or newer
    +AC_PREREQ(2.58)
     
     dnl Get the version number of Expat, using m4's esyscmd() command to run
     dnl the command at m4-generation time. This allows us to create an m4
    @@ -25,12 +25,13 @@ dnl test. I believe this test will work,
     dnl GNU M4 to test it right now.
     define([expat_version], ifdef([__gnu__],
                                   [esyscmd(conftools/get-version.sh lib/expat.h)],
    -                              [2.0.x]))
    +                              [2.1.x]))
     AC_INIT(expat, expat_version, expat-bugs@libexpat.org)
     undefine([expat_version])
     
     AC_CONFIG_SRCDIR(Makefile.in)
     AC_CONFIG_AUX_DIR(conftools)
    +AC_CONFIG_MACRO_DIR([m4])
     
     
     dnl
    @@ -44,13 +45,12 @@ dnl 
     dnl If the API changes incompatibly set LIBAGE back to 0
     dnl
     
    -LIBCURRENT=6
    -LIBREVISION=2
    -LIBAGE=5
    +LIBCURRENT=7
    +LIBREVISION=0
    +LIBAGE=6
     
     AC_CONFIG_HEADER(expat_config.h)
     
    -sinclude(conftools/libtool.m4)
     sinclude(conftools/ac_c_bigendian_cross.m4)
     
     AC_LIBTOOL_WIN32_DLL
    @@ -62,6 +62,7 @@ AC_SUBST(LIBAGE)
     
     dnl Checks for programs.
     AC_PROG_CC
    +AC_PROG_CXX
     AC_PROG_INSTALL
     
     if test "$GCC" = yes ; then
    @@ -144,7 +145,7 @@ AC_DEFINE([XML_DTD], 1,
     AC_DEFINE([XML_CONTEXT_BYTES], 1024,
               [Define to specify how much context to retain around the current parse point.])
     
    -AC_CONFIG_FILES(Makefile)
    +AC_CONFIG_FILES([Makefile expat.pc])
     AC_OUTPUT
     
     abs_srcdir="`cd $srcdir && pwd`"
    
    Modified: stable/8/contrib/expat/doc/reference.html
    ==============================================================================
    --- stable/8/contrib/expat/doc/reference.html	Fri Mar  1 00:56:57 2013	(r247513)
    +++ stable/8/contrib/expat/doc/reference.html	Fri Mar  1 00:58:44 2013	(r247514)
    @@ -129,8 +129,10 @@ interface.

  • XML_GetBase
  • XML_GetSpecifiedAttributeCount
  • XML_GetIdAttributeIndex
  • +
  • XML_GetAttributeInfo
  • XML_SetEncoding
  • XML_SetParamEntityParsing
  • +
  • XML_SetHashSalt
  • XML_UseForeignDTD
  • XML_SetReturnNSTriplet
  • XML_DefaultCurrent
  • @@ -369,6 +371,11 @@ footprint and can be faster. statically with the code that calls it; this is required to get all the right MSVC magic annotations correct. This is ignored on other platforms. + +
    XML_ATTR_INFO
    +
    If defined, makes the the additional function XML_GetAttributeInfo available +for reporting attribute byte offsets.

    @@ -917,12 +924,15 @@ XML_ParserCreateNS(const XML_Char *encod Constructs a new parser that has namespace processing in effect. Namespace expanded element names and attribute names are returned as a concatenation of the namespace URI, sep, and the local part of the name. This -means that you should pick a character for sep that can't be -part of a legal URI. There is a special case when sep is the null -character '\0': the namespace URI and the local part will be -concatenated without any separator - this is intended to support RDF processors. -It is a programming error to use the null separator with -namespace triplets. +means that you should pick a character for sep that can't be part +of an URI. Since Expat does not check namespace URIs for conformance, the +only safe choice for a namespace separator is a character that is illegal +in XML. For instance, '\xFF' is not legal in UTF-8, and +'\xFFFF' is not legal in UTF-16. There is a special case when +sep is the null character '\0': the namespace URI and +the local part will be concatenated without any separator - this is intended +to support RDF processors. It is a programming error to use the null separator +with namespace triplets.
     XML_Parser XMLCALL
    @@ -2074,6 +2084,27 @@ attribute. If called inside a start hand
     current call.
     
     
    +
    +const XML_AttrInfo * XMLCALL
    +XML_GetAttributeInfo(XML_Parser parser);
    +
    +
    +typedef struct {
    +  XML_Index  nameStart;  /* Offset to beginning of the attribute name. */
    +  XML_Index  nameEnd;    /* Offset after the attribute name's last byte. */
    +  XML_Index  valueStart; /* Offset to beginning of the attribute value. */
    +  XML_Index  valueEnd;   /* Offset after the attribute value's last byte. */
    +} XML_AttrInfo;
    +
    +
    +Returns an array of XML_AttrInfo structures for the +attribute/value pairs passed in the last call to the +XML_StartElementHandler that were specified +in the start-tag rather than defaulted. Each attribute/value pair counts +as 1; thus the number of entries in the array is +XML_GetSpecifiedAttributeCount(parser) / 2. +
    +
     enum XML_Status XMLCALL
     XML_SetEncoding(XML_Parser p,
    @@ -2104,6 +2135,24 @@ The choices for code are:
     
  • XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE
  • XML_PARAM_ENTITY_PARSING_ALWAYS
  • +Note: If XML_SetParamEntityParsing is called after +XML_Parse or XML_ParseBuffer, then it has +no effect and will always return 0. + + +
    +int XMLCALL
    +XML_SetHashSalt(XML_Parser p,
    +                unsigned long hash_salt);
    +
    +
    +Sets the hash salt to use for internal hash calculations. +Helps in preventing DoS attacks based on predicting hash +function behavior. In order to have an effect this must be called +before parsing has started. Returns 1 if successful, 0 when called +after XML_Parse or XML_ParseBuffer. +

    Note: This call is optional, as the parser will auto-generate a new +random salt value if no value has been set at the start of parsing.

    
    Modified: stable/8/contrib/expat/doc/xmlwf.sgml
    ==============================================================================
    --- stable/8/contrib/expat/doc/xmlwf.sgml	Fri Mar  1 00:56:57 2013	(r247513)
    +++ stable/8/contrib/expat/doc/xmlwf.sgml	Fri Mar  1 00:58:44 2013	(r247514)
    @@ -389,11 +389,6 @@ supports both.
       
         BUGS
     	
    -	According to the W3C standard, an XML file without a
    -	declaration at the beginning is not considered well-formed.
    -	However, &dhpackage; allows this to pass.
    -	
    -	
     	&dhpackage; returns a 0 - noerr result,
     	even if the file is not well-formed.  There is no good way for
     	a program to use &dhpackage; to quickly
    
    Modified: stable/8/contrib/expat/expat_config.h.in
    ==============================================================================
    --- stable/8/contrib/expat/expat_config.h.in	Fri Mar  1 00:56:57 2013	(r247513)
    +++ stable/8/contrib/expat/expat_config.h.in	Fri Mar  1 00:58:44 2013	(r247514)
    @@ -39,6 +39,9 @@
     /* Define to 1 if you have the  header file. */
     #undef HAVE_STRING_H
     
    +/* Define to 1 if you have the  header file. */
    +#undef HAVE_SYS_PARAM_H
    +
     /* Define to 1 if you have the  header file. */
     #undef HAVE_SYS_STAT_H
     
    @@ -48,6 +51,10 @@
     /* Define to 1 if you have the  header file. */
     #undef HAVE_UNISTD_H
     
    +/* Define to the sub-directory in which libtool stores uninstalled libraries.
    +   */
    +#undef LT_OBJDIR
    +
     /* Define to the address where bug reports for this package should be sent. */
     #undef PACKAGE_BUGREPORT
     
    @@ -60,6 +67,9 @@
     /* Define to the one symbol short name of this package. */
     #undef PACKAGE_TARNAME
     
    +/* Define to the home page for this package. */
    +#undef PACKAGE_URL
    +
     /* Define to the version of this package. */
     #undef PACKAGE_VERSION
     
    @@ -85,8 +95,8 @@
     /* Define to empty if `const' does not conform to ANSI C. */
     #undef const
     
    -/* Define to `long' if  does not define. */
    +/* Define to `long int' if  does not define. */
     #undef off_t
     
    -/* Define to `unsigned' if  does not define. */
    +/* Define to `unsigned int' if  does not define. */
     #undef size_t
    
    Modified: stable/8/contrib/expat/lib/expat.h
    ==============================================================================
    --- stable/8/contrib/expat/lib/expat.h	Fri Mar  1 00:56:57 2013	(r247513)
    +++ stable/8/contrib/expat/lib/expat.h	Fri Mar  1 00:58:44 2013	(r247514)
    @@ -742,6 +742,29 @@ XML_GetSpecifiedAttributeCount(XML_Parse
     XMLPARSEAPI(int)
     XML_GetIdAttributeIndex(XML_Parser parser);
     
    +#ifdef XML_ATTR_INFO
    +/* Source file byte offsets for the start and end of attribute names and values.
    +   The value indices are exclusive of surrounding quotes; thus in a UTF-8 source
    +   file an attribute value of "blah" will yield:
    +   info->valueEnd - info->valueStart = 4 bytes.
    +*/
    +typedef struct {
    +  XML_Index  nameStart;  /* Offset to beginning of the attribute name. */
    +  XML_Index  nameEnd;    /* Offset after the attribute name's last byte. */
    +  XML_Index  valueStart; /* Offset to beginning of the attribute value. */
    +  XML_Index  valueEnd;   /* Offset after the attribute value's last byte. */
    +} XML_AttrInfo;
    +
    +/* Returns an array of XML_AttrInfo structures for the attribute/value pairs
    +   passed in last call to the XML_StartElementHandler that were specified
    +   in the start-tag rather than defaulted. Each attribute/value pair counts
    +   as 1; thus the number of entries in the array is
    +   XML_GetSpecifiedAttributeCount(parser) / 2.
    +*/
    +XMLPARSEAPI(const XML_AttrInfo *)
    +XML_GetAttributeInfo(XML_Parser parser);
    +#endif
    +
     /* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
        detected.  The last call to XML_Parse must have isFinal true; len
        may be zero for this call (or any other).
    @@ -883,6 +906,15 @@ XMLPARSEAPI(int)
     XML_SetParamEntityParsing(XML_Parser parser,
                               enum XML_ParamEntityParsing parsing);
     
    +/* Sets the hash salt to use for internal hash calculations.
    +   Helps in preventing DoS attacks based on predicting hash
    +   function behavior. This must be called before parsing is started.
    +   Returns 1 if successful, 0 when called after parsing has started.
    +*/
    +XMLPARSEAPI(int)
    +XML_SetHashSalt(XML_Parser parser,
    +                unsigned long hash_salt);
    +
     /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
        XML_GetErrorCode returns information about the error.
     */
    @@ -984,7 +1016,8 @@ enum XML_FeatureEnum {
       XML_FEATURE_SIZEOF_XML_CHAR,
       XML_FEATURE_SIZEOF_XML_LCHAR,
       XML_FEATURE_NS,
    -  XML_FEATURE_LARGE_SIZE
    +  XML_FEATURE_LARGE_SIZE,
    +  XML_FEATURE_ATTR_INFO
       /* Additional features must be added to the end of this enum. */
     };
     
    @@ -1004,8 +1037,8 @@ XML_GetFeatureList(void);
        change to major or minor version.
     */
     #define XML_MAJOR_VERSION 2
    -#define XML_MINOR_VERSION 0
    -#define XML_MICRO_VERSION 1
    +#define XML_MINOR_VERSION 1
    +#define XML_MICRO_VERSION 0
     
     #ifdef __cplusplus
     }
    
    Modified: stable/8/contrib/expat/lib/xmlparse.c
    ==============================================================================
    --- stable/8/contrib/expat/lib/xmlparse.c	Fri Mar  1 00:56:57 2013	(r247513)
    +++ stable/8/contrib/expat/lib/xmlparse.c	Fri Mar  1 00:58:44 2013	(r247514)
    @@ -5,6 +5,8 @@
     #include 
     #include                      /* memset(), memcpy() */
     #include 
    +#include                      /* UINT_MAX */
    +#include                        /* time() */
     
     #define XML_BUILDING_EXPAT 1
     
    @@ -12,7 +14,7 @@
     #include "winconfig.h"
     #elif defined(MACOS_CLASSIC)
     #include "macconfig.h"
    -#elif defined(__amigaos4__)
    +#elif defined(__amigaos__)
     #include "amigaconfig.h"
     #elif defined(__WATCOMC__)
     #include "watcomconfig.h"
    @@ -327,15 +329,15 @@ processXmlDecl(XML_Parser parser, int is
     static enum XML_Error
     initializeEncoding(XML_Parser parser);
     static enum XML_Error
    -doProlog(XML_Parser parser, const ENCODING *enc, const char *s, 
    -         const char *end, int tok, const char *next, const char **nextPtr, 
    +doProlog(XML_Parser parser, const ENCODING *enc, const char *s,
    +         const char *end, int tok, const char *next, const char **nextPtr,
              XML_Bool haveMore);
     static enum XML_Error
    -processInternalEntity(XML_Parser parser, ENTITY *entity, 
    +processInternalEntity(XML_Parser parser, ENTITY *entity,
                           XML_Bool betweenDecl);
     static enum XML_Error
     doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
    -          const char *start, const char *end, const char **endPtr, 
    +          const char *start, const char *end, const char **endPtr,
               XML_Bool haveMore);
     static enum XML_Error
     doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr,
    @@ -353,7 +355,7 @@ static enum XML_Error
     addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
                const XML_Char *uri, BINDING **bindingsPtr);
     static int
    -defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata, 
    +defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata,
                     XML_Bool isId, const XML_Char *dfltValue, XML_Parser parser);
     static enum XML_Error
     storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata,
    @@ -391,12 +393,13 @@ static void dtdReset(DTD *p, const XML_M
     static void
     dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms);
     static int
    -dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
    +dtdCopy(XML_Parser oldParser,
    +        DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms);
     static int
    -copyEntityTable(HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
    -
    +copyEntityTable(XML_Parser oldParser,
    +                HASH_TABLE *, STRING_POOL *, const HASH_TABLE *);
     static NAMED *
    -lookup(HASH_TABLE *table, KEY name, size_t createSize);
    +lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize);
     static void FASTCALL
     hashTableInit(HASH_TABLE *, const XML_Memory_Handling_Suite *ms);
     static void FASTCALL hashTableClear(HASH_TABLE *);
    @@ -429,11 +432,15 @@ static ELEMENT_TYPE *
     getElementType(XML_Parser parser, const ENCODING *enc,
                    const char *ptr, const char *end);
     
    +static unsigned long generate_hash_secret_salt(void);
    +static XML_Bool startParsing(XML_Parser parser);
    +
     static XML_Parser
     parserCreate(const XML_Char *encodingName,
                  const XML_Memory_Handling_Suite *memsuite,
                  const XML_Char *nameSep,
                  DTD *dtd);
    +
     static void
     parserInit(XML_Parser parser, const XML_Char *encodingName);
     
    @@ -533,6 +540,9 @@ struct XML_ParserStruct {
       NS_ATT *m_nsAtts;
       unsigned long m_nsAttsVersion;
       unsigned char m_nsAttsPower;
    +#ifdef XML_ATTR_INFO
    +  XML_AttrInfo *m_attInfo;
    +#endif
       POSITION m_position;
       STRING_POOL m_tempPool;
       STRING_POOL m_temp2Pool;
    @@ -546,6 +556,7 @@ struct XML_ParserStruct {
       XML_Bool m_useForeignDTD;
       enum XML_ParamEntityParsing m_paramEntityParsing;
     #endif
    +  unsigned long m_hash_secret_salt;
     };
     
     #define MALLOC(s) (parser->m_mem.malloc_fcn((s)))
    @@ -640,6 +651,7 @@ struct XML_ParserStruct {
     #define nsAtts (parser->m_nsAtts)
     #define nsAttsVersion (parser->m_nsAttsVersion)
     #define nsAttsPower (parser->m_nsAttsPower)
    +#define attInfo (parser->m_attInfo)
     #define tempPool (parser->m_tempPool)
     #define temp2Pool (parser->m_temp2Pool)
     #define groupConnector (parser->m_groupConnector)
    @@ -653,6 +665,7 @@ struct XML_ParserStruct {
     #define useForeignDTD (parser->m_useForeignDTD)
     #define paramEntityParsing (parser->m_paramEntityParsing)
     #endif /* XML_DTD */
    +#define hash_secret_salt (parser->m_hash_secret_salt)
     
     XML_Parser XMLCALL
     XML_ParserCreate(const XML_Char *encodingName)
    @@ -670,29 +683,42 @@ XML_ParserCreateNS(const XML_Char *encod
     
     static const XML_Char implicitContext[] = {
       ASCII_x, ASCII_m, ASCII_l, ASCII_EQUALS, ASCII_h, ASCII_t, ASCII_t, ASCII_p,
    -  ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w, 
    +  ASCII_COLON, ASCII_SLASH, ASCII_SLASH, ASCII_w, ASCII_w, ASCII_w,
       ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD, ASCII_o, ASCII_r, ASCII_g,
       ASCII_SLASH, ASCII_X, ASCII_M, ASCII_L, ASCII_SLASH, ASCII_1, ASCII_9,
       ASCII_9, ASCII_8, ASCII_SLASH, ASCII_n, ASCII_a, ASCII_m, ASCII_e,
       ASCII_s, ASCII_p, ASCII_a, ASCII_c, ASCII_e, '\0'
     };
     
    +static unsigned long
    +generate_hash_secret_salt(void)
    +{
    +  unsigned int seed = time(NULL) % UINT_MAX;
    +  srand(seed);
    +  return rand();
    +}
    +
    +static XML_Bool  /* only valid for root parser */
    +startParsing(XML_Parser parser)
    +{
    +    /* hash functions must be initialized before setContext() is called */
    +    if (hash_secret_salt == 0)
    +      hash_secret_salt = generate_hash_secret_salt();
    +    if (ns) {
    +      /* implicit context only set for root parser, since child
    +         parsers (i.e. external entity parsers) will inherit it
    +      */
    +      return setContext(parser, implicitContext);
    +    }
    +    return XML_TRUE;
    +}
    +
     XML_Parser XMLCALL
     XML_ParserCreate_MM(const XML_Char *encodingName,
                         const XML_Memory_Handling_Suite *memsuite,
                         const XML_Char *nameSep)
     {
    -  XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL);
    -  if (parser != NULL && ns) {
    -    /* implicit context only set for root parser, since child
    -       parsers (i.e. external entity parsers) will inherit it
    -    */
    -    if (!setContext(parser, implicitContext)) {
    -      XML_ParserFree(parser);
    -      return NULL;
    -    }
    -  }
    -  return parser;
    +  return parserCreate(encodingName, memsuite, nameSep, NULL);
     }
     
     static XML_Parser
    @@ -737,9 +763,20 @@ parserCreate(const XML_Char *encodingNam
         FREE(parser);
         return NULL;
       }
    +#ifdef XML_ATTR_INFO
    +  attInfo = (XML_AttrInfo*)MALLOC(attsSize * sizeof(XML_AttrInfo));
    +  if (attInfo == NULL) {
    +    FREE(atts);
    +    FREE(parser);
    +    return NULL;
    +  }
    +#endif
       dataBuf = (XML_Char *)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));
       if (dataBuf == NULL) {
         FREE(atts);
    +#ifdef XML_ATTR_INFO
    +    FREE(attInfo);
    +#endif
         FREE(parser);
         return NULL;
       }
    @@ -752,6 +789,9 @@ parserCreate(const XML_Char *encodingNam
         if (_dtd == NULL) {
           FREE(dataBuf);
           FREE(atts);
    +#ifdef XML_ATTR_INFO
    +      FREE(attInfo);
    +#endif
           FREE(parser);
           return NULL;
         }
    @@ -866,6 +906,7 @@ parserInit(XML_Parser parser, const XML_
       useForeignDTD = XML_FALSE;
       paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
     #endif
    +  hash_secret_salt = 0;
     }
     
     /* moves list of bindings to freeBindingList */
    @@ -913,7 +954,7 @@ XML_ParserReset(XML_Parser parser, const
       poolClear(&temp2Pool);
       parserInit(parser, encodingName);
       dtdReset(_dtd, &parser->m_mem);
    -  return setContext(parser, implicitContext);
    +  return XML_TRUE;
     }
     
     enum XML_Status XMLCALL
    @@ -982,6 +1023,12 @@ XML_ExternalEntityParserCreate(XML_Parse
       int oldInEntityValue = prologState.inEntityValue;
     #endif
       XML_Bool oldns_triplets = ns_triplets;
    +  /* Note that the new parser shares the same hash secret as the old
    +     parser, so that dtdCopy and copyEntityTable can lookup values
    +     from hash tables associated with either parser without us having
    +     to worry which hash secrets each table has.
    +  */
    +  unsigned long oldhash_secret_salt = hash_secret_salt;
     
     #ifdef XML_DTD
       if (!context)
    @@ -1035,13 +1082,14 @@ XML_ExternalEntityParserCreate(XML_Parse
         externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg;
       defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
       ns_triplets = oldns_triplets;
    +  hash_secret_salt = oldhash_secret_salt;
       parentParser = oldParser;
     #ifdef XML_DTD
       paramEntityParsing = oldParamEntityParsing;
       prologState.inEntityValue = oldInEntityValue;
       if (context) {
     #endif /* XML_DTD */
    -    if (!dtdCopy(_dtd, oldDtd, &parser->m_mem)
    +    if (!dtdCopy(oldParser, _dtd, oldDtd, &parser->m_mem)
           || !setContext(parser, context)) {
           XML_ParserFree(parser);
           return NULL;
    @@ -1130,6 +1178,9 @@ XML_ParserFree(XML_Parser parser)
     #endif /* XML_DTD */
         dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem);
       FREE((void *)atts);
    +#ifdef XML_ATTR_INFO
    +  FREE((void *)attInfo);
    +#endif
       FREE(groupConnector);
       FREE(buffer);
       FREE(dataBuf);
    @@ -1210,6 +1261,14 @@ XML_GetIdAttributeIndex(XML_Parser parse
       return idAttIndex;
     }
     
    +#ifdef XML_ATTR_INFO
    +const XML_AttrInfo * XMLCALL
    +XML_GetAttributeInfo(XML_Parser parser)
    +{
    +  return attInfo;
    +}
    +#endif
    +
     void XMLCALL
     XML_SetElementHandler(XML_Parser parser,
                           XML_StartElementHandler start,
    @@ -1426,6 +1485,17 @@ XML_SetParamEntityParsing(XML_Parser par
     #endif
     }
     
    +int XMLCALL
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 01:02:27 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 926D5B0D;
     Fri,  1 Mar 2013 01:02:27 +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 82337D2F;
     Fri,  1 Mar 2013 01:02:27 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2112R7X022500;
     Fri, 1 Mar 2013 01:02:27 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2112QFI022491;
     Fri, 1 Mar 2013 01:02:26 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010102.r2112QFI022491@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 01: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: r247515 - in stable/9: secure/lib/libssh
     secure/usr.bin/ssh secure/usr.sbin/sshd share/mk tools/build/options
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 01:02:27 -0000
    
    Author: des
    Date: Fri Mar  1 01:02:26 2013
    New Revision: 247515
    URL: http://svnweb.freebsd.org/changeset/base/247515
    
    Log:
      MFH (r245527): add OPENSSH_NONE_CIPHER build option
    
    Added:
      stable/9/tools/build/options/WITH_OPENSSH_NONE_CIPHER
         - copied unchanged from r245527, head/tools/build/options/WITH_OPENSSH_NONE_CIPHER
    Modified:
      stable/9/secure/lib/libssh/Makefile
      stable/9/secure/usr.bin/ssh/Makefile
      stable/9/secure/usr.sbin/sshd/Makefile
      stable/9/share/mk/bsd.own.mk
    Directory Properties:
      stable/9/secure/lib/libssh/   (props changed)
      stable/9/secure/usr.bin/ssh/   (props changed)
      stable/9/secure/usr.sbin/sshd/   (props changed)
      stable/9/share/mk/   (props changed)
      stable/9/tools/build/options/   (props changed)
    
    Modified: stable/9/secure/lib/libssh/Makefile
    ==============================================================================
    --- stable/9/secure/lib/libssh/Makefile	Fri Mar  1 00:58:44 2013	(r247514)
    +++ stable/9/secure/lib/libssh/Makefile	Fri Mar  1 01:02:26 2013	(r247515)
    @@ -38,6 +38,10 @@ DPADD+=	${LIBGSSAPI} ${LIBKRB5} ${LIBHX5
     LDADD+=	-lgssapi -lkrb5 -lhx509 -lasn1 -lcom_err -lmd -lroken
     .endif
     
    +.if ${MK_OPENSSH_NONE_CIPHER} != "no"
    +CFLAGS+= -DNONE_CIPHER_ENABLED
    +.endif
    +
     NO_LINT=
     
     DPADD+=	${LIBCRYPTO} ${LIBCRYPT}
    
    Modified: stable/9/secure/usr.bin/ssh/Makefile
    ==============================================================================
    --- stable/9/secure/usr.bin/ssh/Makefile	Fri Mar  1 00:58:44 2013	(r247514)
    +++ stable/9/secure/usr.bin/ssh/Makefile	Fri Mar  1 01:02:26 2013	(r247515)
    @@ -25,6 +25,10 @@ DPADD+=	 ${LIBGSSAPI}
     LDADD+=	 -lgssapi
     .endif
     
    +.if ${MK_OPENSSH_NONE_CIPHER} != "no"
    +CFLAGS+= -DNONE_CIPHER_ENABLED
    +.endif
    +
     DPADD+=	${LIBCRYPT} ${LIBCRYPTO}
     LDADD+=	-lcrypt -lcrypto
     
    
    Modified: stable/9/secure/usr.sbin/sshd/Makefile
    ==============================================================================
    --- stable/9/secure/usr.sbin/sshd/Makefile	Fri Mar  1 00:58:44 2013	(r247514)
    +++ stable/9/secure/usr.sbin/sshd/Makefile	Fri Mar  1 01:02:26 2013	(r247515)
    @@ -40,6 +40,10 @@ DPADD+=	 ${LIBGSSAPI_KRB5} ${LIBGSSAPI} 
     LDADD+=	 -lgssapi_krb5 -lgssapi -lkrb5 -lasn1
     .endif
     
    +.if ${MK_OPENSSH_NONE_CIPHER} != "no"
    +CFLAGS+= -DNONE_CIPHER_ENABLED
    +.endif
    +
     DPADD+=	${LIBCRYPTO} ${LIBCRYPT}
     LDADD+=	-lcrypto -lcrypt
     
    
    Modified: stable/9/share/mk/bsd.own.mk
    ==============================================================================
    --- stable/9/share/mk/bsd.own.mk	Fri Mar  1 00:58:44 2013	(r247514)
    +++ stable/9/share/mk/bsd.own.mk	Fri Mar  1 01:02:26 2013	(r247515)
    @@ -431,6 +431,7 @@ __DEFAULT_NO_OPTIONS = \
         LIBCPLUSPLUS \
         NMTREE \
         OFED \
    +    OPENSSH_NONE_CIPHER \
         SHARED_TOOLCHAIN
     
     #
    
    Copied: stable/9/tools/build/options/WITH_OPENSSH_NONE_CIPHER (from r245527, head/tools/build/options/WITH_OPENSSH_NONE_CIPHER)
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ stable/9/tools/build/options/WITH_OPENSSH_NONE_CIPHER	Fri Mar  1 01:02:26 2013	(r247515, copy of r245527, head/tools/build/options/WITH_OPENSSH_NONE_CIPHER)
    @@ -0,0 +1,9 @@
    +.\" $FreeBSD$
    +Set to include the "None" cipher support in OpenSSH and its libraries.
    +Additional adjustments may need to be done to system configuration
    +files, such as
    +.Xr sshd_config 5 ,
    +to enable this cipher.
    +Please see
    +.Pa /usr/src/crypto/openssh/README.hpn
    +for full details.
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 01:02:30 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 36EF7B0E;
     Fri,  1 Mar 2013 01:02:30 +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 1AD98D30;
     Fri,  1 Mar 2013 01:02:30 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2112TcX022543;
     Fri, 1 Mar 2013 01:02:29 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2112TFI022539;
     Fri, 1 Mar 2013 01:02:29 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303010102.r2112TFI022539@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 01:02: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: r247516 - in stable/9: bin/ps usr.bin/w
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 01:02:30 -0000
    
    Author: jhb
    Date: Fri Mar  1 01:02:28 2013
    New Revision: 247516
    URL: http://svnweb.freebsd.org/changeset/base/247516
    
    Log:
      MFC 245610,245633,245635:
      Include the thread name along with the command name when displaying the
      command name of a thread from a multi-threaded process that doesn't have
      an available argument list (such as kernel processes) and threads display
      is enabled via -H.
    
    Modified:
      stable/9/bin/ps/extern.h
      stable/9/bin/ps/fmt.c
      stable/9/bin/ps/ps.c
      stable/9/usr.bin/w/w.c
    Directory Properties:
      stable/9/bin/ps/   (props changed)
      stable/9/usr.bin/w/   (props changed)
    
    Modified: stable/9/bin/ps/extern.h
    ==============================================================================
    --- stable/9/bin/ps/extern.h	Fri Mar  1 01:02:26 2013	(r247515)
    +++ stable/9/bin/ps/extern.h	Fri Mar  1 01:02:28 2013	(r247516)
    @@ -51,7 +51,7 @@ char	 *elapsed(KINFO *, VARENT *);
     char	 *elapseds(KINFO *, VARENT *);
     char	 *emulname(KINFO *, VARENT *);
     VARENT	*find_varentry(VAR *);
    -const	 char *fmt_argv(char **, char *, size_t);
    +const	 char *fmt_argv(char **, char *, char *, size_t);
     double	 getpcpu(const KINFO *);
     char	 *kvar(KINFO *, VARENT *);
     char	 *label(KINFO *, VARENT *);
    
    Modified: stable/9/bin/ps/fmt.c
    ==============================================================================
    --- stable/9/bin/ps/fmt.c	Fri Mar  1 01:02:26 2013	(r247515)
    +++ stable/9/bin/ps/fmt.c	Fri Mar  1 01:02:28 2013	(r247516)
    @@ -105,7 +105,7 @@ cmdpart(char *arg0)
     }
     
     const char *
    -fmt_argv(char **argv, char *cmd, size_t maxlen)
    +fmt_argv(char **argv, char *cmd, char *thread, size_t maxlen)
     {
     	size_t len;
     	char *ap, *cp;
    @@ -122,9 +122,14 @@ fmt_argv(char **argv, char *cmd, size_t 
     	cp = malloc(len);
     	if (cp == NULL)
     		errx(1, "malloc failed");
    -	if (ap == NULL)
    -		sprintf(cp, "[%.*s]", (int)maxlen, cmd);
    -	else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0)
    +	if (ap == NULL) {
    +		if (thread != NULL) {
    +			asprintf(&ap, "%s/%s", cmd, thread);
    +			sprintf(cp, "[%.*s]", (int)maxlen, ap);
    +			free(ap);
    +		} else
    +			sprintf(cp, "[%.*s]", (int)maxlen, cmd);
    +	} else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0)
     		sprintf(cp, "%s (%.*s)", ap, (int)maxlen, cmd);
     	else
     		strcpy(cp, ap);
    
    Modified: stable/9/bin/ps/ps.c
    ==============================================================================
    --- stable/9/bin/ps/ps.c	Fri Mar  1 01:02:26 2013	(r247515)
    +++ stable/9/bin/ps/ps.c	Fri Mar  1 01:02:28 2013	(r247516)
    @@ -140,7 +140,7 @@ static void	 format_output(KINFO *);
     static void	*expand_list(struct listinfo *);
     static const char *
     		 fmt(char **(*)(kvm_t *, const struct kinfo_proc *, int),
    -		    KINFO *, char *, int);
    +		    KINFO *, char *, char *, int);
     static void	 free_list(struct listinfo *);
     static void	 init_list(struct listinfo *, addelem_rtn, int, const char *);
     static char	*kludge_oldps_options(const char *, char *, const char *);
    @@ -1161,11 +1161,12 @@ sizevars(void)
     
     static const char *
     fmt(char **(*fn)(kvm_t *, const struct kinfo_proc *, int), KINFO *ki,
    -    char *comm, int maxlen)
    +    char *comm, char *thread, int maxlen)
     {
     	const char *s;
     
    -	s = fmt_argv((*fn)(kd, ki->ki_p, termwidth), comm, maxlen);
    +	s = fmt_argv((*fn)(kd, ki->ki_p, termwidth), comm,
    +	    showthreads && ki->ki_p->ki_numthreads > 1 ? thread : NULL, maxlen);
     	return (s);
     }
     
    @@ -1193,7 +1194,7 @@ saveuser(KINFO *ki)
     			ki->ki_args = strdup("");
     		else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL))
     			ki->ki_args = strdup(fmt(kvm_getargv, ki,
    -			    ki->ki_p->ki_comm, MAXCOMLEN));
    +			    ki->ki_p->ki_comm, ki->ki_p->ki_tdname, MAXCOMLEN));
     		else
     			asprintf(&ki->ki_args, "(%s)", ki->ki_p->ki_comm);
     		if (ki->ki_args == NULL)
    @@ -1204,7 +1205,7 @@ saveuser(KINFO *ki)
     	if (needenv) {
     		if (UREADOK(ki))
     			ki->ki_env = strdup(fmt(kvm_getenvv, ki,
    -			    (char *)NULL, 0));
    +			    (char *)NULL, (char *)NULL, 0));
     		else
     			ki->ki_env = strdup("()");
     		if (ki->ki_env == NULL)
    
    Modified: stable/9/usr.bin/w/w.c
    ==============================================================================
    --- stable/9/usr.bin/w/w.c	Fri Mar  1 01:02:26 2013	(r247515)
    +++ stable/9/usr.bin/w/w.c	Fri Mar  1 01:02:28 2013	(r247516)
    @@ -124,7 +124,7 @@ static struct stat	*ttystat(char *);
     static void		 usage(int);
     static int		 this_is_uptime(const char *s);
     
    -char *fmt_argv(char **, char *, int);	/* ../../bin/ps/fmt.c */
    +char *fmt_argv(char **, char *, char *, size_t);	/* ../../bin/ps/fmt.c */
     
     int
     main(int argc, char *argv[])
    @@ -321,7 +321,7 @@ main(int argc, char *argv[])
     			continue;
     		}
     		ep->args = fmt_argv(kvm_getargv(kd, ep->kp, argwidth),
    -		    ep->kp->ki_comm, MAXCOMLEN);
    +		    ep->kp->ki_comm, NULL, MAXCOMLEN);
     		if (ep->args == NULL)
     			err(1, NULL);
     	}
    @@ -405,7 +405,7 @@ main(int argc, char *argv[])
     				const char *ptr;
     
     				ptr = fmt_argv(kvm_getargv(kd, dkp, argwidth),
    -				    dkp->ki_comm, MAXCOMLEN);
    +				    dkp->ki_comm, NULL, MAXCOMLEN);
     				if (ptr == NULL)
     					ptr = "-";
     				(void)printf("\t\t%-9d %s\n",
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 01:02:46 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 3604DD84;
     Fri,  1 Mar 2013 01:02:46 +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 1A01ED34;
     Fri,  1 Mar 2013 01:02:46 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2112jhE022637;
     Fri, 1 Mar 2013 01:02:45 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2112jZY022632;
     Fri, 1 Mar 2013 01:02:45 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303010102.r2112jZY022632@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 01:02:45 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247517 - in stable/8: bin/ps usr.bin/w
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 01:02:46 -0000
    
    Author: jhb
    Date: Fri Mar  1 01:02:44 2013
    New Revision: 247517
    URL: http://svnweb.freebsd.org/changeset/base/247517
    
    Log:
      MFC 245610,245633,245635:
      Include the thread name along with the command name when displaying the
      command name of a thread from a multi-threaded process that doesn't have
      an available argument list (such as kernel processes) and threads display
      is enabled via -H.
    
    Modified:
      stable/8/bin/ps/extern.h
      stable/8/bin/ps/fmt.c
      stable/8/bin/ps/ps.c
      stable/8/usr.bin/w/w.c
    Directory Properties:
      stable/8/bin/ps/   (props changed)
      stable/8/usr.bin/w/   (props changed)
    
    Modified: stable/8/bin/ps/extern.h
    ==============================================================================
    --- stable/8/bin/ps/extern.h	Fri Mar  1 01:02:28 2013	(r247516)
    +++ stable/8/bin/ps/extern.h	Fri Mar  1 01:02:44 2013	(r247517)
    @@ -50,7 +50,7 @@ int	 donlist(void);
     void	 elapsed(KINFO *, VARENT *);
     void	 emulname(KINFO *, VARENT *);
     VARENT	*find_varentry(VAR *);
    -const	 char *fmt_argv(char **, char *, size_t);
    +const	 char *fmt_argv(char **, char *, char *, size_t);
     double	 getpcpu(const KINFO *);
     void	 kvar(KINFO *, VARENT *);
     void	 label(KINFO *, VARENT *);
    
    Modified: stable/8/bin/ps/fmt.c
    ==============================================================================
    --- stable/8/bin/ps/fmt.c	Fri Mar  1 01:02:28 2013	(r247516)
    +++ stable/8/bin/ps/fmt.c	Fri Mar  1 01:02:44 2013	(r247517)
    @@ -105,7 +105,7 @@ cmdpart(char *arg0)
     }
     
     const char *
    -fmt_argv(char **argv, char *cmd, size_t maxlen)
    +fmt_argv(char **argv, char *cmd, char *thread, size_t maxlen)
     {
     	size_t len;
     	char *ap, *cp;
    @@ -122,9 +122,14 @@ fmt_argv(char **argv, char *cmd, size_t 
     	cp = malloc(len);
     	if (cp == NULL)
     		errx(1, "malloc failed");
    -	if (ap == NULL)
    -		sprintf(cp, "[%.*s]", (int)maxlen, cmd);
    -	else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0)
    +	if (ap == NULL) {
    +		if (thread != NULL) {
    +			asprintf(&ap, "%s/%s", cmd, thread);
    +			sprintf(cp, "[%.*s]", (int)maxlen, ap);
    +			free(ap);
    +		} else
    +			sprintf(cp, "[%.*s]", (int)maxlen, cmd);
    +	} else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0)
     		sprintf(cp, "%s (%.*s)", ap, (int)maxlen, cmd);
     	else
     		strcpy(cp, ap);
    
    Modified: stable/8/bin/ps/ps.c
    ==============================================================================
    --- stable/8/bin/ps/ps.c	Fri Mar  1 01:02:28 2013	(r247516)
    +++ stable/8/bin/ps/ps.c	Fri Mar  1 01:02:44 2013	(r247517)
    @@ -143,7 +143,7 @@ static void	 dynsizevars(KINFO *);
     static void	*expand_list(struct listinfo *);
     static const char *
     		 fmt(char **(*)(kvm_t *, const struct kinfo_proc *, int),
    -		    KINFO *, char *, int);
    +		    KINFO *, char *, char *, int);
     static void	 free_list(struct listinfo *);
     static void	 init_list(struct listinfo *, addelem_rtn, int, const char *);
     static char	*kludge_oldps_options(const char *, char *, const char *);
    @@ -1127,11 +1127,12 @@ sizevars(void)
     
     static const char *
     fmt(char **(*fn)(kvm_t *, const struct kinfo_proc *, int), KINFO *ki,
    -    char *comm, int maxlen)
    +    char *comm, char *thread, int maxlen)
     {
     	const char *s;
     
    -	s = fmt_argv((*fn)(kd, ki->ki_p, termwidth), comm, maxlen);
    +	s = fmt_argv((*fn)(kd, ki->ki_p, termwidth), comm,
    +	    showthreads && ki->ki_p->ki_numthreads > 1 ? thread : NULL, maxlen);
     	return (s);
     }
     
    @@ -1159,7 +1160,7 @@ saveuser(KINFO *ki)
     			ki->ki_args = strdup("");
     		else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL))
     			ki->ki_args = strdup(fmt(kvm_getargv, ki,
    -			    ki->ki_p->ki_comm, MAXCOMLEN));
    +			    ki->ki_p->ki_comm, ki->ki_p->ki_ocomm, MAXCOMLEN));
     		else
     			asprintf(&ki->ki_args, "(%s)", ki->ki_p->ki_comm);
     		if (ki->ki_args == NULL)
    @@ -1170,7 +1171,7 @@ saveuser(KINFO *ki)
     	if (needenv) {
     		if (UREADOK(ki))
     			ki->ki_env = strdup(fmt(kvm_getenvv, ki,
    -			    (char *)NULL, 0));
    +			    (char *)NULL, (char *)NULL, 0));
     		else
     			ki->ki_env = strdup("()");
     		if (ki->ki_env == NULL)
    
    Modified: stable/8/usr.bin/w/w.c
    ==============================================================================
    --- stable/8/usr.bin/w/w.c	Fri Mar  1 01:02:28 2013	(r247516)
    +++ stable/8/usr.bin/w/w.c	Fri Mar  1 01:02:44 2013	(r247517)
    @@ -127,7 +127,7 @@ static struct stat	*ttystat(char *, int)
     static void		 usage(int);
     static int		 this_is_uptime(const char *s);
     
    -char *fmt_argv(char **, char *, int);	/* ../../bin/ps/fmt.c */
    +char *fmt_argv(char **, char *, char *, size_t);	/* ../../bin/ps/fmt.c */
     
     int
     main(int argc, char *argv[])
    @@ -325,7 +325,7 @@ main(int argc, char *argv[])
     			continue;
     		}
     		ep->args = fmt_argv(kvm_getargv(kd, ep->kp, argwidth),
    -		    ep->kp->ki_comm, MAXCOMLEN);
    +		    ep->kp->ki_comm, NULL, MAXCOMLEN);
     		if (ep->args == NULL)
     			err(1, NULL);
     	}
    @@ -392,7 +392,7 @@ main(int argc, char *argv[])
     				const char *ptr;
     
     				ptr = fmt_argv(kvm_getargv(kd, dkp, argwidth),
    -				    dkp->ki_comm, MAXCOMLEN);
    +				    dkp->ki_comm, NULL, MAXCOMLEN);
     				if (ptr == NULL)
     					ptr = "-";
     				(void)printf("\t\t%-9d %s\n",
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 01:03:28 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 6B93DF40;
     Fri,  1 Mar 2013 01:03:28 +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 5DBA0D41;
     Fri,  1 Mar 2013 01:03:28 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2113Su1022801;
     Fri, 1 Mar 2013 01:03:28 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2113SbW022799;
     Fri, 1 Mar 2013 01:03:28 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010103.r2113SbW022799@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 01:03: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: r247518 - stable/9/share/man/man5
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 01:03:28 -0000
    
    Author: des
    Date: Fri Mar  1 01:03:27 2013
    New Revision: 247518
    URL: http://svnweb.freebsd.org/changeset/base/247518
    
    Log:
      Regenerate
    
    Modified:
      stable/9/share/man/man5/src.conf.5
    
    Modified: stable/9/share/man/man5/src.conf.5
    ==============================================================================
    --- stable/9/share/man/man5/src.conf.5	Fri Mar  1 01:02:44 2013	(r247517)
    +++ stable/9/share/man/man5/src.conf.5	Fri Mar  1 01:03:27 2013	(r247518)
    @@ -1,7 +1,7 @@
     .\" DO NOT EDIT-- this file is automatically generated.
     .\" from FreeBSD: stable/9/tools/build/options/makeman 236430 2012-06-02 02:26:37Z gjb
     .\" $FreeBSD$
    -.Dd February 10, 2013
    +.Dd March 1, 2013
     .Dt SRC.CONF 5
     .Os
     .Sh NAME
    @@ -801,6 +801,16 @@ Infiniband software stack.
     .It Va WITHOUT_OPENSSH
     .\" from FreeBSD: stable/9/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru
     Set to not build OpenSSH.
    +.It Va WITH_OPENSSH_NONE_CIPHER
    +.\" from FreeBSD: stable/9/tools/build/options/WITH_OPENSSH_NONE_CIPHER 247515 2013-03-01 01:02:26Z des
    +Set to include the "None" cipher support in OpenSSH and its libraries.
    +Additional adjustments may need to be done to system configuration
    +files, such as
    +.Xr sshd_config 5 ,
    +to enable this cipher.
    +Please see
    +.Pa /usr/src/crypto/openssh/README.hpn
    +for full details.
     .It Va WITHOUT_OPENSSL
     .\" from FreeBSD: stable/9/tools/build/options/WITHOUT_OPENSSL 156932 2006-03-21 07:50:50Z ru
     Set to not build OpenSSL.
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 01:42:33 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 4A58C3A9;
     Fri,  1 Mar 2013 01:42:33 +0000 (UTC)
     (envelope-from ganbold@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 3C767E39;
     Fri,  1 Mar 2013 01:42:33 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r211gWmw035128;
     Fri, 1 Mar 2013 01:42:32 GMT (envelope-from ganbold@svn.freebsd.org)
    Received: (from ganbold@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r211gWjt035125;
     Fri, 1 Mar 2013 01:42:32 GMT (envelope-from ganbold@svn.freebsd.org)
    Message-Id: <201303010142.r211gWjt035125@svn.freebsd.org>
    From: Ganbold Tsagaankhuu 
    Date: Fri, 1 Mar 2013 01:42:32 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247519 - in head/sys/dev: ic uart
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 01:42:33 -0000
    
    Author: ganbold (doc committer)
    Date: Fri Mar  1 01:42:31 2013
    New Revision: 247519
    URL: http://svnweb.freebsd.org/changeset/base/247519
    
    Log:
      Add support for A10 uart.
      A10 uart is derived from Synopsys DesignWare uart and requires
      to read Uart Status Register when IIR_BUSY has detected.
      Also this change includes FDT check, where it checks device
      specific properties defined in dts and sets the busy_detect variable.
      broken_txfifo is also needed to be set in order to make it work for
      A10 uart case.
      
      Reviewed by: marcel@
      Approved by: gonzo@
    
    Modified:
      head/sys/dev/ic/ns16550.h
      head/sys/dev/uart/uart_dev_ns8250.c
    
    Modified: head/sys/dev/ic/ns16550.h
    ==============================================================================
    --- head/sys/dev/ic/ns16550.h	Fri Mar  1 01:03:27 2013	(r247518)
    +++ head/sys/dev/ic/ns16550.h	Fri Mar  1 01:42:31 2013	(r247519)
    @@ -182,6 +182,7 @@
     #define	com_xoff1	6	/* XOFF 1 character (R/W) */
     #define	com_xoff2	7	/* XOFF 2 character (R/W) */
     
    +#define DW_REG_USR	31	/* DesignWare derived Uart Status Reg */
     #define com_usr		39	/* Octeon 16750/16550 Uart Status Reg */
     #define REG_USR		com_usr
     #define USR_TXFIFO_NOTFULL 2    /* Uart TX FIFO Not full */
    
    Modified: head/sys/dev/uart/uart_dev_ns8250.c
    ==============================================================================
    --- head/sys/dev/uart/uart_dev_ns8250.c	Fri Mar  1 01:03:27 2013	(r247518)
    +++ head/sys/dev/uart/uart_dev_ns8250.c	Fri Mar  1 01:42:31 2013	(r247519)
    @@ -24,6 +24,8 @@
      * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      */
     
    +#include "opt_platform.h"
    +
     #include 
     __FBSDID("$FreeBSD$");
     
    @@ -35,6 +37,12 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     
    +#ifdef FDT
    +#include 
    +#include 
    +#include 
    +#endif
    +
     #include 
     #include 
     #include 
    @@ -45,6 +53,11 @@ __FBSDID("$FreeBSD$");
     
     #define	DEFAULT_RCLK	1843200
     
    +static int broken_txfifo = 0;
    +SYSCTL_INT(_hw, OID_AUTO, broken_txfifo, CTLFLAG_RW | CTLFLAG_TUN,
    +	&broken_txfifo, 0, "UART FIFO has QEMU emulation bug");
    +TUNABLE_INT("hw.broken_txfifo", &broken_txfifo);
    +
     /*
      * Clear pending interrupts. THRE is cleared by reading IIR. Data
      * that may have been received gets lost here.
    @@ -350,6 +363,7 @@ struct ns8250_softc {
     	
     	uint8_t		ier_mask;
     	uint8_t		ier_rxbits;
    +	uint8_t		busy_detect;
     };
     
     static int ns8250_bus_attach(struct uart_softc *);
    @@ -401,6 +415,24 @@ ns8250_bus_attach(struct uart_softc *sc)
     	struct ns8250_softc *ns8250 = (struct ns8250_softc*)sc;
     	struct uart_bas *bas;
     	unsigned int ivar;
    +#ifdef FDT
    +	phandle_t node;
    +	pcell_t cell;
    +#endif
    +
    +	ns8250->busy_detect = 0;
    +
    +#ifdef FDT
    +	/* 
    +	 * Check whether uart requires to read USR reg when IIR_BUSY and 
    +	 * has broken txfifo. 
    +	 */
    +	node = ofw_bus_get_node(sc->sc_dev);
    +	if ((OF_getprop(node, "busy-detect", &cell, sizeof(cell))) > 0)
    +		ns8250->busy_detect = 1;
    +	if ((OF_getprop(node, "broken-txfifo", &cell, sizeof(cell))) > 0)
    +		broken_txfifo = 1;
    +#endif
     
     	bas = &sc->sc_bas;
     
    @@ -592,6 +624,12 @@ ns8250_bus_ipend(struct uart_softc *sc)
     	bas = &sc->sc_bas;
     	uart_lock(sc->sc_hwmtx);
     	iir = uart_getreg(bas, REG_IIR);
    +
    +	if (ns8250->busy_detect && (iir & IIR_BUSY) == IIR_BUSY) {
    +		(void)uart_getreg(bas, DW_REG_USR);
    +		uart_unlock(sc->sc_hwmtx);
    +		return (0);
    +	}
     	if (iir & IIR_NOPEND) {
     		uart_unlock(sc->sc_hwmtx);
     		return (0);
    @@ -847,11 +885,6 @@ ns8250_bus_setsig(struct uart_softc *sc,
     	return (0);
     }
     
    -static int broken_txfifo = 0;
    -SYSCTL_INT(_hw, OID_AUTO, broken_txfifo, CTLFLAG_RW | CTLFLAG_TUN,
    -	&broken_txfifo, 0, "UART FIFO has QEMU emulation bug");
    -TUNABLE_INT("hw.broken_txfifo", &broken_txfifo);
    -
     static int
     ns8250_bus_transmit(struct uart_softc *sc)
     {
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 01:47:14 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id E580553A;
     Fri,  1 Mar 2013 01:47:14 +0000 (UTC)
     (envelope-from ganbold@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 BEFF1E53;
     Fri,  1 Mar 2013 01:47:14 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r211lCcQ035811;
     Fri, 1 Mar 2013 01:47:12 GMT (envelope-from ganbold@svn.freebsd.org)
    Received: (from ganbold@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r211lCxP035808;
     Fri, 1 Mar 2013 01:47:12 GMT (envelope-from ganbold@svn.freebsd.org)
    Message-Id: <201303010147.r211lCxP035808@svn.freebsd.org>
    From: Ganbold Tsagaankhuu 
    Date: Fri, 1 Mar 2013 01:47:12 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247520 - in head/sys: arm/allwinner arm/conf boot/fdt/dts
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 01:47:15 -0000
    
    Author: ganbold (doc committer)
    Date: Fri Mar  1 01:47:11 2013
    New Revision: 247520
    URL: http://svnweb.freebsd.org/changeset/base/247520
    
    Log:
      Enable uart driver for A10.
      
      Approved by: gonzo@
    
    Modified:
      head/sys/arm/allwinner/files.a10
      head/sys/arm/conf/CUBIEBOARD
      head/sys/boot/fdt/dts/cubieboard.dts
    
    Modified: head/sys/arm/allwinner/files.a10
    ==============================================================================
    --- head/sys/arm/allwinner/files.a10	Fri Mar  1 01:42:31 2013	(r247519)
    +++ head/sys/arm/allwinner/files.a10	Fri Mar  1 01:47:11 2013	(r247520)
    @@ -17,5 +17,5 @@ arm/allwinner/timer.c			standard
     arm/allwinner/aintc.c			standard
     arm/allwinner/bus_space.c		standard
     arm/allwinner/common.c			standard
    -arm/allwinner/console.c			standard
    +#arm/allwinner/console.c			standard
     arm/allwinner/a10_machdep.c		standard
    
    Modified: head/sys/arm/conf/CUBIEBOARD
    ==============================================================================
    --- head/sys/arm/conf/CUBIEBOARD	Fri Mar  1 01:42:31 2013	(r247519)
    +++ head/sys/arm/conf/CUBIEBOARD	Fri Mar  1 01:47:11 2013	(r247520)
    @@ -87,8 +87,8 @@ options		ROOTDEVNAME=\"ufs:/dev/da0s2\"
     #options	ATA_STATIC_ID	# Static device numbering
     
     # Console and misc
    -#device		uart
    -#device		uart_ns8250
    +device		uart
    +device		uart_ns8250
     device		pty
     device		snp
     device		md
    
    Modified: head/sys/boot/fdt/dts/cubieboard.dts
    ==============================================================================
    --- head/sys/boot/fdt/dts/cubieboard.dts	Fri Mar  1 01:42:31 2013	(r247519)
    +++ head/sys/boot/fdt/dts/cubieboard.dts	Fri Mar  1 01:47:11 2013	(r247520)
    @@ -121,6 +121,8 @@
     			interrupt-parent = <&AINTC>;
     			current-speed = <115200>;
     			clock-frequency = < 24000000 >;
    +			busy-detect = <1>;
    +			broken-txfifo = <1>;
     		};
     	};
     
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 02:06:05 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 2118F9B9;
     Fri,  1 Mar 2013 02:06:05 +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 E448EF04;
     Fri,  1 Mar 2013 02:06:04 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21264e2041884;
     Fri, 1 Mar 2013 02:06:04 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21264rB041882;
     Fri, 1 Mar 2013 02:06:04 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010206.r21264rB041882@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 02:06:04 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247521 - in stable/8: crypto/openssh
     crypto/openssh/openbsd-compat etc/rc.d secure/lib/libssh secure/usr.bin/ssh
     secure/usr.sbin/sshd share/mk tools/build/options
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 02:06:05 -0000
    
    Author: des
    Date: Fri Mar  1 02:06:04 2013
    New Revision: 247521
    URL: http://svnweb.freebsd.org/changeset/base/247521
    
    Log:
      Pull in OpenSSH 6.1 from head.
      
      Although ECC-based algorithms are now supported, the order of preference
      has been changed so that RSA and DSA are still the preferred algorithms.
    
    Added:
      stable/8/crypto/openssh/audit-linux.c   (contents, props changed)
         - copied, changed from r221420, head/crypto/openssh/audit-linux.c
         - copied unchanged from r221420, head/crypto/openssh/bufec.c
         - copied unchanged from r221420, head/crypto/openssh/kexecdh.c
         - copied unchanged from r221420, head/crypto/openssh/kexecdhc.c
         - copied unchanged from r221420, head/crypto/openssh/kexecdhs.c
         - copied unchanged from r221420, head/crypto/openssh/openbsd-compat/charclass.h
         - copied unchanged from r215116, head/crypto/openssh/openbsd-compat/strptime.c
         - copied unchanged from r221420, head/crypto/openssh/openbsd-compat/timingsafe_bcmp.c
      stable/8/crypto/openssh/sandbox-darwin.c
         - copied unchanged from r226046, head/crypto/openssh/sandbox-darwin.c
      stable/8/crypto/openssh/sandbox-null.c
         - copied unchanged from r226046, head/crypto/openssh/sandbox-null.c
      stable/8/crypto/openssh/sandbox-rlimit.c
         - copied, changed from r226046, head/crypto/openssh/sandbox-rlimit.c
      stable/8/crypto/openssh/sandbox-systrace.c
         - copied, changed from r226046, head/crypto/openssh/sandbox-systrace.c
      stable/8/crypto/openssh/ssh-ecdsa.c   (contents, props changed)
         - copied, changed from r221420, head/crypto/openssh/ssh-ecdsa.c
      stable/8/crypto/openssh/ssh-sandbox.h
         - copied unchanged from r226046, head/crypto/openssh/ssh-sandbox.h
      stable/8/tools/build/options/WITH_OPENSSH_NONE_CIPHER
         - copied unchanged from r245527, head/tools/build/options/WITH_OPENSSH_NONE_CIPHER
    Directory Properties:
      stable/8/crypto/openssh/bufec.c   (props changed)
      stable/8/crypto/openssh/kexecdh.c   (props changed)
      stable/8/crypto/openssh/kexecdhc.c   (props changed)
      stable/8/crypto/openssh/kexecdhs.c   (props changed)
      stable/8/crypto/openssh/openbsd-compat/charclass.h   (props changed)
      stable/8/crypto/openssh/openbsd-compat/strptime.c   (props changed)
      stable/8/crypto/openssh/openbsd-compat/timingsafe_bcmp.c   (props changed)
    Deleted:
      stable/8/crypto/openssh/WARNING.RNG
      stable/8/crypto/openssh/ssh-pkcs11-helper.0
      stable/8/crypto/openssh/ssh-rand-helper.8
      stable/8/crypto/openssh/ssh-rand-helper.c
      stable/8/crypto/openssh/version.c
    Modified:
      stable/8/crypto/openssh/ChangeLog
      stable/8/crypto/openssh/INSTALL
      stable/8/crypto/openssh/LICENCE
      stable/8/crypto/openssh/PROTOCOL
      stable/8/crypto/openssh/PROTOCOL.agent
      stable/8/crypto/openssh/PROTOCOL.certkeys
      stable/8/crypto/openssh/PROTOCOL.mux
      stable/8/crypto/openssh/README
      stable/8/crypto/openssh/aclocal.m4
      stable/8/crypto/openssh/addrmatch.c
      stable/8/crypto/openssh/atomicio.c
      stable/8/crypto/openssh/atomicio.h
      stable/8/crypto/openssh/audit-bsm.c
      stable/8/crypto/openssh/audit.c
      stable/8/crypto/openssh/audit.h
      stable/8/crypto/openssh/auth-krb5.c
      stable/8/crypto/openssh/auth-options.c
      stable/8/crypto/openssh/auth-options.h
      stable/8/crypto/openssh/auth-pam.c   (contents, props changed)
      stable/8/crypto/openssh/auth-passwd.c
      stable/8/crypto/openssh/auth-rsa.c
      stable/8/crypto/openssh/auth-skey.c
      stable/8/crypto/openssh/auth.c
      stable/8/crypto/openssh/auth.h
      stable/8/crypto/openssh/auth1.c
      stable/8/crypto/openssh/auth2-gss.c
      stable/8/crypto/openssh/auth2-hostbased.c
      stable/8/crypto/openssh/auth2-jpake.c
      stable/8/crypto/openssh/auth2-none.c
      stable/8/crypto/openssh/auth2-pubkey.c
      stable/8/crypto/openssh/auth2.c
      stable/8/crypto/openssh/authfd.c
      stable/8/crypto/openssh/authfile.c
      stable/8/crypto/openssh/authfile.h
      stable/8/crypto/openssh/bufaux.c
      stable/8/crypto/openssh/buffer.h
      stable/8/crypto/openssh/canohost.c
      stable/8/crypto/openssh/channels.c
      stable/8/crypto/openssh/channels.h
      stable/8/crypto/openssh/cipher-3des1.c
      stable/8/crypto/openssh/cipher-acss.c
      stable/8/crypto/openssh/cipher-aes.c
      stable/8/crypto/openssh/cipher-bf1.c
      stable/8/crypto/openssh/cipher-ctr.c
      stable/8/crypto/openssh/clientloop.c
      stable/8/crypto/openssh/clientloop.h
      stable/8/crypto/openssh/compat.c
      stable/8/crypto/openssh/compat.h
      stable/8/crypto/openssh/compress.c
      stable/8/crypto/openssh/config.guess
      stable/8/crypto/openssh/config.h
      stable/8/crypto/openssh/config.h.in
      stable/8/crypto/openssh/defines.h
      stable/8/crypto/openssh/dh.c
      stable/8/crypto/openssh/dns.c
      stable/8/crypto/openssh/dns.h
      stable/8/crypto/openssh/entropy.c
      stable/8/crypto/openssh/entropy.h
      stable/8/crypto/openssh/gss-serv.c
      stable/8/crypto/openssh/hostfile.c
      stable/8/crypto/openssh/hostfile.h
      stable/8/crypto/openssh/includes.h
      stable/8/crypto/openssh/jpake.c
      stable/8/crypto/openssh/kex.c
      stable/8/crypto/openssh/kex.h
      stable/8/crypto/openssh/kexdhc.c
      stable/8/crypto/openssh/kexdhs.c
      stable/8/crypto/openssh/kexgexc.c
      stable/8/crypto/openssh/kexgexs.c
      stable/8/crypto/openssh/key.c
      stable/8/crypto/openssh/key.h
      stable/8/crypto/openssh/log.c
      stable/8/crypto/openssh/log.h
      stable/8/crypto/openssh/loginrec.c   (contents, props changed)
      stable/8/crypto/openssh/loginrec.h
      stable/8/crypto/openssh/logintest.c
      stable/8/crypto/openssh/mac.c
      stable/8/crypto/openssh/misc.c
      stable/8/crypto/openssh/misc.h
      stable/8/crypto/openssh/moduli
      stable/8/crypto/openssh/moduli.5
      stable/8/crypto/openssh/moduli.c
      stable/8/crypto/openssh/monitor.c
      stable/8/crypto/openssh/monitor.h
      stable/8/crypto/openssh/monitor_wrap.c
      stable/8/crypto/openssh/monitor_wrap.h
      stable/8/crypto/openssh/mux.c
      stable/8/crypto/openssh/myproposal.h
      stable/8/crypto/openssh/openbsd-compat/bindresvport.c
      stable/8/crypto/openssh/openbsd-compat/bsd-arc4random.c
      stable/8/crypto/openssh/openbsd-compat/bsd-cygwin_util.c
      stable/8/crypto/openssh/openbsd-compat/bsd-cygwin_util.h
      stable/8/crypto/openssh/openbsd-compat/bsd-misc.c
      stable/8/crypto/openssh/openbsd-compat/bsd-misc.h
      stable/8/crypto/openssh/openbsd-compat/getcwd.c
      stable/8/crypto/openssh/openbsd-compat/getgrouplist.c
      stable/8/crypto/openssh/openbsd-compat/getrrsetbyname.c
      stable/8/crypto/openssh/openbsd-compat/glob.c
      stable/8/crypto/openssh/openbsd-compat/glob.h
      stable/8/crypto/openssh/openbsd-compat/inet_ntop.c
      stable/8/crypto/openssh/openbsd-compat/mktemp.c
      stable/8/crypto/openssh/openbsd-compat/openbsd-compat.h
      stable/8/crypto/openssh/openbsd-compat/openssl-compat.c
      stable/8/crypto/openssh/openbsd-compat/openssl-compat.h
      stable/8/crypto/openssh/openbsd-compat/port-linux.c
      stable/8/crypto/openssh/openbsd-compat/port-linux.h
      stable/8/crypto/openssh/openbsd-compat/port-solaris.c
      stable/8/crypto/openssh/openbsd-compat/port-solaris.h
      stable/8/crypto/openssh/openbsd-compat/port-tun.c
      stable/8/crypto/openssh/openbsd-compat/port-uw.c
      stable/8/crypto/openssh/openbsd-compat/setenv.c
      stable/8/crypto/openssh/openbsd-compat/sha2.c   (contents, props changed)
      stable/8/crypto/openssh/openbsd-compat/sha2.h   (contents, props changed)
      stable/8/crypto/openssh/openbsd-compat/strlcpy.c
      stable/8/crypto/openssh/packet.c
      stable/8/crypto/openssh/packet.h
      stable/8/crypto/openssh/pathnames.h
      stable/8/crypto/openssh/platform.c
      stable/8/crypto/openssh/platform.h
      stable/8/crypto/openssh/readconf.c
      stable/8/crypto/openssh/readconf.h
      stable/8/crypto/openssh/readpass.c
      stable/8/crypto/openssh/roaming.h
      stable/8/crypto/openssh/roaming_client.c
      stable/8/crypto/openssh/roaming_common.c
      stable/8/crypto/openssh/schnorr.c
      stable/8/crypto/openssh/scp.1
      stable/8/crypto/openssh/scp.c
      stable/8/crypto/openssh/servconf.c
      stable/8/crypto/openssh/servconf.h
      stable/8/crypto/openssh/serverloop.c
      stable/8/crypto/openssh/session.c
      stable/8/crypto/openssh/sftp-client.c
      stable/8/crypto/openssh/sftp-client.h
      stable/8/crypto/openssh/sftp-glob.c
      stable/8/crypto/openssh/sftp-server.c
      stable/8/crypto/openssh/sftp.1
      stable/8/crypto/openssh/sftp.c
      stable/8/crypto/openssh/ssh-add.1
      stable/8/crypto/openssh/ssh-add.c
      stable/8/crypto/openssh/ssh-agent.1
      stable/8/crypto/openssh/ssh-agent.c
      stable/8/crypto/openssh/ssh-dss.c
      stable/8/crypto/openssh/ssh-keygen.1
      stable/8/crypto/openssh/ssh-keygen.c
      stable/8/crypto/openssh/ssh-keyscan.1
      stable/8/crypto/openssh/ssh-keyscan.c
      stable/8/crypto/openssh/ssh-keysign.8
      stable/8/crypto/openssh/ssh-keysign.c
      stable/8/crypto/openssh/ssh-pkcs11-client.c
      stable/8/crypto/openssh/ssh-pkcs11-helper.c
      stable/8/crypto/openssh/ssh-pkcs11.c
      stable/8/crypto/openssh/ssh-rsa.c
      stable/8/crypto/openssh/ssh.1
      stable/8/crypto/openssh/ssh.c
      stable/8/crypto/openssh/ssh.h
      stable/8/crypto/openssh/ssh2.h
      stable/8/crypto/openssh/ssh_config
      stable/8/crypto/openssh/ssh_config.5
      stable/8/crypto/openssh/ssh_namespace.h
      stable/8/crypto/openssh/sshconnect.c
      stable/8/crypto/openssh/sshconnect.h
      stable/8/crypto/openssh/sshconnect2.c
      stable/8/crypto/openssh/sshd.8
      stable/8/crypto/openssh/sshd.c
      stable/8/crypto/openssh/sshd_config
      stable/8/crypto/openssh/sshd_config.5
      stable/8/crypto/openssh/sshlogin.c
      stable/8/crypto/openssh/umac.c
      stable/8/crypto/openssh/uuencode.c
      stable/8/crypto/openssh/uuencode.h
      stable/8/crypto/openssh/version.h
      stable/8/etc/rc.d/sshd
      stable/8/secure/lib/libssh/Makefile
      stable/8/secure/usr.bin/ssh/Makefile
      stable/8/secure/usr.sbin/sshd/Makefile
      stable/8/share/mk/bsd.own.mk
    Directory Properties:
      stable/8/crypto/openssh/   (props changed)
      stable/8/etc/   (props changed)
      stable/8/secure/lib/libssh/   (props changed)
      stable/8/secure/usr.bin/ssh/   (props changed)
      stable/8/secure/usr.sbin/sshd/   (props changed)
      stable/8/share/mk/   (props changed)
      stable/8/tools/build/options/   (props changed)
    
    Modified: stable/8/crypto/openssh/ChangeLog
    ==============================================================================
    --- stable/8/crypto/openssh/ChangeLog	Fri Mar  1 01:47:11 2013	(r247520)
    +++ stable/8/crypto/openssh/ChangeLog	Fri Mar  1 02:06:04 2013	(r247521)
    @@ -1,2627 +1,2349 @@
    -20100307
    +20120828
    + - (djm) Release openssh-6.1
    +
    +20120828
    + - (dtucker) [openbsd-compat/bsd-cygwin_util.h] define WIN32_LEAN_AND_MEAN
    +   for compatibility with future mingw-w64 headers.  Patch from vinschen at
    +   redhat com.
    +
    +20120822
    + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
    +   [contrib/suse/openssh.spec] Update version numbers
    +
    +20120731
      - (djm) OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/03/07 22:16:01
    +   - jmc@cvs.openbsd.org 2012/07/06 06:38:03
          [ssh-keygen.c]
    -     make internal strptime string match strftime format;
    -     suggested by vinschen AT redhat.com and markus@
    -   - djm@cvs.openbsd.org 2010/03/08 00:28:55
    -     [ssh-keygen.1]
    -     document permit-agent-forwarding certificate constraint; patch from
    -     stevesk@
    -   - djm@cvs.openbsd.org 2010/03/07 22:01:32
    +     missing full stop in usage();
    +   - djm@cvs.openbsd.org 2012/07/10 02:19:15
    +     [servconf.c servconf.h sshd.c sshd_config]
    +     Turn on systrace sandboxing of pre-auth sshd by default for new installs
    +     by shipping a config that overrides the current UsePrivilegeSeparation=yes
    +     default. Make it easier to flip the default in the future by adding too.
    +     prodded markus@ feedback dtucker@ "get it in" deraadt@
    +   - dtucker@cvs.openbsd.org 2012/07/13 01:35:21
    +     [servconf.c]
    +     handle long comments in config files better.  bz#2025, ok markus
    +   - markus@cvs.openbsd.org 2012/07/22 18:19:21
          [version.h]
    -     openssh-5.4
    - - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
    -   crank version numbers
    - - (djm) Release OpenSSH-5.4p1
    +     openssh 6.1
     
    -20100307
    - - (dtucker) [auth.c] Bug #1710: call setauthdb on AIX before getpwuid so that
    -   it gets the passwd struct from the LAM that knows about the user which is
    -   not necessarily the default.  Patch from Alexandre Letourneau.
    - - (dtucker) [session.c] Bug #1567: move setpcred call to before chroot and
    -   do not set real uid, since that's needed for the chroot, and will be set
    -   by permanently_set_uid.
    - - (dtucker) [session.c] Also initialize creds to NULL for handing to
    -    setpcred.
    - - (dtucker) OpenBSD CVS Sync
    -   - dtucker@cvs.openbsd.org 2010/03/07 11:57:13
    -     [auth-rhosts.c monitor.c monitor_wrap.c session.c auth-options.c sshd.c]
    -     Hold authentication debug messages until after successful authentication.
    -     Fixes an info leak of environment variables specified in authorized_keys,
    -     reported by Jacob Appelbaum.  ok djm@
    +20120720
    + - (dtucker) Import regened moduli file.
     
    -20100305
    - - OpenBSD CVS Sync
    -   - jmc@cvs.openbsd.org 2010/03/04 12:51:25
    -     [ssh.1 sshd_config.5]
    -     tweak previous;
    -   - djm@cvs.openbsd.org 2010/03/04 20:35:08
    -     [ssh-keygen.1 ssh-keygen.c]
    -     Add a -L flag to print the contents of a certificate; ok markus@
    -   - jmc@cvs.openbsd.org 2010/03/04 22:52:40
    -     [ssh-keygen.1]
    -     fix Bk/Ek;
    -   - djm@cvs.openbsd.org 2010/03/04 23:17:25
    -     [sshd_config.5]
    -     missing word; spotted by jmc@
    -   - djm@cvs.openbsd.org 2010/03/04 23:19:29
    -     [ssh.1 sshd.8]
    -     move section on CA and revoked keys from ssh.1 to sshd.8's known hosts
    -     format section and rework it a bit; requested by jmc@
    -   - djm@cvs.openbsd.org 2010/03/04 23:27:25
    -     [auth-options.c ssh-keygen.c]
    -     "force-command" is not spelled "forced-command"; spotted by
    -     imorgan AT nas.nasa.gov
    -   - djm@cvs.openbsd.org 2010/03/05 02:58:11
    -     [auth.c]
    -     make the warning for a revoked key louder and more noticable
    -   - jmc@cvs.openbsd.org 2010/03/05 06:50:35
    -     [ssh.1 sshd.8]
    -     tweak previous;
    -   - jmc@cvs.openbsd.org 2010/03/05 08:31:20
    -     [ssh.1]
    -     document certificate authentication; help/ok djm
    -   - djm@cvs.openbsd.org 2010/03/05 10:28:21
    -     [ssh-add.1 ssh.1 ssh_config.5]
    -     mention loading of certificate files from [private]-cert.pub when
    -     they are present; feedback and ok jmc@
    - - (tim) [ssh-pkcs11.c] Fix "non-constant initializer" errors in older
    -   compilers. OK djm@
    - - (djm) [ssh-rand-helper.c] declare optind, avoiding compilation failure
    -   on some platforms
    - - (djm) [configure.ac] set -fno-strict-aliasing for gcc4; ok dtucker@
    -
    -20100304
    - - (djm) [ssh-keygen.c] Use correct local variable, instead of
    -   maybe-undefined global "optarg"
    - - (djm) [contrib/redhat/openssh.spec] Replace obsolete BuildPreReq
    -   on XFree86-devel with neutral /usr/include/X11/Xlib.h;
    -   imorgan AT nas.nasa.gov in bz#1731
    - - (djm) [.cvsignore] Ignore ssh-pkcs11-helper
    - - (djm) [regress/Makefile] Cleanup sshd_proxy_orig
    - - OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/03/03 01:44:36
    -     [auth-options.c key.c]
    -     reject strings with embedded ASCII nul chars in certificate key IDs,
    -     principal names and constraints
    -   - djm@cvs.openbsd.org 2010/03/03 22:49:50
    -     [sshd.8]
    -     the authorized_keys option for CA keys is "cert-authority", not
    -     "from=cert-authority". spotted by imorgan AT nas.nasa.gov
    -   - djm@cvs.openbsd.org 2010/03/03 22:50:40
    -     [PROTOCOL.certkeys]
    -     s/similar same/similar/; from imorgan AT nas.nasa.gov
    -   - djm@cvs.openbsd.org 2010/03/04 01:44:57
    -     [key.c]
    -     use buffer_get_string_ptr_ret() where we are checking the return
    -     value explicitly instead of the fatal()-causing buffer_get_string_ptr()
    -   - djm@cvs.openbsd.org 2010/03/04 10:36:03
    -     [auth-rh-rsa.c auth-rsa.c auth.c auth.h auth2-hostbased.c auth2-pubkey.c]
    -     [authfile.c authfile.h hostfile.c hostfile.h servconf.c servconf.h]
    -     [ssh-keygen.c ssh.1 sshconnect.c sshd_config.5]
    -     Add a TrustedUserCAKeys option to sshd_config to specify CA keys that
    -     are trusted to authenticate users (in addition than doing it per-user
    -     in authorized_keys).
    -     
    -     Add a RevokedKeys option to sshd_config and a @revoked marker to
    -     known_hosts to allow keys to me revoked and banned for user or host
    -     authentication.
    -     
    -     feedback and ok markus@
    -   - djm@cvs.openbsd.org 2010/03/03 00:47:23
    -     [regress/cert-hostkey.sh regress/cert-userkey.sh]
    -     add an extra test to ensure that authentication with the wrong
    -     certificate fails as it should (and it does)
    -   - djm@cvs.openbsd.org 2010/03/04 10:38:23
    -     [regress/cert-hostkey.sh regress/cert-userkey.sh]
    -     additional regression tests for revoked keys and TrustedUserCAKeys
    +20120706
    + - (djm) [sandbox-seccomp-filter.c] fallback to rlimit if seccomp filter is
    +   not available. Allows use of sshd compiled on host with a filter-capable
    +   kernel on hosts that lack the support. bz#2011 ok dtucker@
    + - (djm) [configure.ac] Recursively expand $(bindir) to ensure it has no
    +   unexpanded $(prefix) embedded. bz#2007 patch from nix-corp AT
    +   esperi.org.uk; ok dtucker@
    +- (djm) OpenBSD CVS Sync
    +   - dtucker@cvs.openbsd.org 2012/07/06 00:41:59
    +     [moduli.c ssh-keygen.1 ssh-keygen.c]
    +     Add options to specify starting line number and number of lines to process
    +     when screening moduli candidates.  This allows processing of different
    +     parts of a candidate moduli file in parallel.  man page help jmc@, ok djm@
    +   - djm@cvs.openbsd.org 2012/07/06 01:37:21
    +     [mux.c]
    +     fix memory leak of passed-in environment variables and connection
    +     context when new session message is malformed; bz#2003 from Bert.Wesarg
    +     AT googlemail.com
    +   - djm@cvs.openbsd.org 2012/07/06 01:47:38
    +     [ssh.c]
    +     move setting of tty_flag to after config parsing so RequestTTY options
    +     are correctly picked up. bz#1995 patch from przemoc AT gmail.com;
    +     ok dtucker@
    +
    +20120704
    + - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] Add setlinebuf for
    +   platforms that don't have it.  "looks good" tim@
    +
    +20120703
    + - (dtucker) [configure.ac] Detect platforms that can't use select(2) with
    +   setrlimit(RLIMIT_NOFILE, rl_zero) and disable the rlimit sandbox on those.
    + - (dtucker) [configure.ac sandbox-rlimit.c] Test whether or not
    +   setrlimit(RLIMIT_FSIZE, rl_zero) and skip it if it's not supported.  Its
    +   benefit is minor, so it's not worth disabling the sandbox if it doesn't
    +   work.
    +
    +20120702
    +- (dtucker) OpenBSD CVS Sync
    +   - naddy@cvs.openbsd.org 2012/06/29 13:57:25
    +     [ssh_config.5 sshd_config.5]
    +     match the documented MAC order of preference to the actual one;
    +     ok dtucker@
    +   - markus@cvs.openbsd.org 2012/06/30 14:35:09
    +     [sandbox-systrace.c sshd.c]
    +     fix a during the load of the sandbox policies (child can still make
    +     the read-syscall and wait forever for systrace-answers) by replacing
    +     the read/write synchronisation with SIGSTOP/SIGCONT;
    +     report and help hshoexer@; ok djm@, dtucker@
    +   - dtucker@cvs.openbsd.org 2012/07/02 08:50:03
    +     [ssh.c]
    +     set interactive ToS for forwarded X11 sessions.  ok djm@
    +   - dtucker@cvs.openbsd.org 2012/07/02 12:13:26
    +     [ssh-pkcs11-helper.c sftp-client.c]
    +     fix a couple of "assigned but not used" warnings.  ok markus@
    +   - dtucker@cvs.openbsd.org 2012/07/02 14:37:06
    +     [regress/connect-privsep.sh]
    +     remove exit from end of test since it prevents reporting failure
    + - (dtucker) [regress/reexec.sh regress/sftp-cmds.sh regress/test-exec.sh]
    +   Move cygwin detection to test-exec and use to skip reexec test on cygwin.
    + - (dtucker) [regress/test-exec.sh] Correct uname for cygwin/w2k.
     
    -20100303
    - - (djm) [PROTOCOL.certkeys] Add RCS Ident
    +20120629
      - OpenBSD CVS Sync
    -   - jmc@cvs.openbsd.org 2010/02/26 22:09:28
    -     [ssh-keygen.1 ssh.1 sshd.8]
    -     tweak previous;
    -   - otto@cvs.openbsd.org 2010/03/01 11:07:06
    -     [ssh-add.c]
    -     zap what seems to be a left-over debug message; ok markus@
    -   - djm@cvs.openbsd.org 2010/03/02 23:20:57
    -     [ssh-keygen.c]
    -     POSIX strptime is stricter than OpenBSD's so do a little dance to
    -     appease it.
    - - (djm) [regress/cert-userkey.sh] s/echo -n/echon/ here too
    -
    -20100302
    - - (tim) [config.guess config.sub] Bug 1722: Update to latest versions from
    -   http://git.savannah.gnu.org/gitweb/ (2009-12-30 and 2010-01-22
    -   respectively).
    -
    -20100301
    - - (dtucker) [regress/{cert-hostkey,cfgmatch,cipher-speed}.sh} Replace
    -   "echo -n" with "echon" for portability.
    - - (dtucker) [openbsd-compat/port-linux.c] Make failure to write to the OOM
    -   adjust log at verbose only, since according to cjwatson in bug #1470
    -   some virtualization platforms don't allow writes.
    -
    -20100228
    - - (djm) [auth.c] On Cygwin, refuse usernames that have differences in
    -   case from that matched in the system password database. On this
    -   platform, passwords are stored case-insensitively, but sshd requires
    -   exact case matching for Match blocks in sshd_config(5). Based on
    -   a patch from vinschen AT redhat.com.
    - - (tim) [ssh-pkcs11-helper.c] Move declarations before calling functions
    -   to make older compilers (gcc 2.95) happy.
    -
    -20100227
    - - (djm) [ssh-pkcs11-helper.c ] Ensure RNG is initialised and seeded
    - - (djm) [openbsd-compat/bsd-cygwin_util.c] Reduce the set of environment
    -   variables copied into sshd child processes. From vinschen AT redhat.com
    -
    -20100226
    - - OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/02/26 20:29:54
    -     [PROTOCOL PROTOCOL.agent PROTOCOL.certkeys addrmatch.c auth-options.c]
    -     [auth-options.h auth.h auth2-pubkey.c authfd.c dns.c dns.h hostfile.c]
    -     [hostfile.h kex.h kexdhs.c kexgexs.c key.c key.h match.h monitor.c]
    -     [myproposal.h servconf.c servconf.h ssh-add.c ssh-agent.c ssh-dss.c]
    -     [ssh-keygen.1 ssh-keygen.c ssh-rsa.c ssh.1 ssh.c ssh2.h sshconnect.c]
    -     [sshconnect2.c sshd.8 sshd.c sshd_config.5]
    -     Add support for certificate key types for users and hosts.
    -     
    -     OpenSSH certificate key types are not X.509 certificates, but a much
    -     simpler format that encodes a public key, identity information and
    -     some validity constraints and signs it with a CA key. CA keys are
    -     regular SSH keys. This certificate style avoids the attack surface
    -     of X.509 certificates and is very easy to deploy.
    -     
    -     Certified host keys allow automatic acceptance of new host keys
    -     when a CA certificate is marked as trusted in ~/.ssh/known_hosts.
    -     see VERIFYING HOST KEYS in ssh(1) for details.
    -     
    -     Certified user keys allow authentication of users when the signing
    -     CA key is marked as trusted in authorized_keys. See "AUTHORIZED_KEYS
    -     FILE FORMAT" in sshd(8) for details.
    -     
    -     Certificates are minted using ssh-keygen(1), documentation is in
    -     the "CERTIFICATES" section of that manpage.
    -     
    -     Documentation on the format of certificates is in the file
    -     PROTOCOL.certkeys
    -     
    -     feedback and ok markus@
    -   - djm@cvs.openbsd.org 2010/02/26 20:33:21
    -     [Makefile regress/cert-hostkey.sh regress/cert-userkey.sh]
    -     regression tests for certified keys
    -
    -20100224
    - - (djm) [pkcs11.h ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c]
    -   [ssh-pkcs11.h] Add $OpenBSD$ RCS idents so we can sync portable
    - - (djm) OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/02/11 20:37:47
    -     [pathnames.h]
    -     correct comment
    -   - dtucker@cvs.openbsd.org 2009/11/09 04:20:04
    -     [regress/Makefile]
    -     add regression test for ssh-keygen pubkey conversions
    -   - dtucker@cvs.openbsd.org 2010/01/11 02:53:44
    -     [regress/forwarding.sh]
    -     regress test for stdio forwarding
    -   - djm@cvs.openbsd.org 2010/02/09 04:57:36
    +   - dtucker@cvs.openbsd.org 2012/06/21 00:16:07
    +     [addrmatch.c]
    +     fix strlcpy truncation check.  from carsten at debian org, ok markus
    +   - dtucker@cvs.openbsd.org 2012/06/22 12:30:26
    +     [monitor.c sshconnect2.c]
    +     remove dead code following 'for (;;)' loops.
    +     From Steve.McClellan at radisys com, ok markus@
    +   - dtucker@cvs.openbsd.org 2012/06/22 14:36:33
    +     [sftp.c]
    +     Remove unused variable leftover from tab-completion changes.
    +     From Steve.McClellan at radisys com, ok markus@
    +   - dtucker@cvs.openbsd.org 2012/06/26 11:02:30
    +     [sandbox-systrace.c]
    +     Add mquery to the list of allowed syscalls for "UsePrivilegeSeparation
    +     sandbox" since malloc now uses it.  From johnw.mail at gmail com.
    +   - dtucker@cvs.openbsd.org 2012/06/28 05:07:45
    +     [mac.c myproposal.h ssh_config.5 sshd_config.5]
    +     Remove hmac-sha2-256-96 and hmac-sha2-512-96 MACs since they were removed
    +     from draft6 of the spec and will not be in the RFC when published.  Patch
    +     from mdb at juniper net via bz#2023, ok markus.
    +   - naddy@cvs.openbsd.org 2012/06/29 13:57:25
    +     [ssh_config.5 sshd_config.5]
    +     match the documented MAC order of preference to the actual one; ok dtucker@
    +   - dtucker@cvs.openbsd.org 2012/05/13 01:42:32
          [regress/addrmatch.sh]
    -     clean up droppings
    -   - djm@cvs.openbsd.org 2010/02/09 06:29:02
    -     [regress/Makefile]
    -     turn on all the malloc(3) checking options when running regression
    -     tests. this has caught a few bugs for me in the past; ok dtucker@
    -   - djm@cvs.openbsd.org 2010/02/24 06:21:56
    -     [regress/test-exec.sh]
    -     wait for sshd to fully stop in cleanup() function; avoids races in tests
    -     that do multiple start_sshd/cleanup cycles; "I hate pidfiles" deraadt@
    -   - markus@cvs.openbsd.org 2010/02/08 10:52:47
    -     [regress/agent-pkcs11.sh]
    -     test for PKCS#11 support (currently disabled)
    - - (djm) [Makefile.in ssh-pkcs11-helper.8] Add manpage for PKCS#11 helper
    - - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
    -   [contrib/suse/openssh.spec] Add PKCS#11 helper binary and manpage
    +     Add "Match LocalAddress" and "Match LocalPort" to sshd and adjust tests
    +     to match.  Feedback and ok djm@ markus@.
    +   - djm@cvs.openbsd.org 2012/06/01 00:47:35
    +     [regress/multiplex.sh regress/forwarding.sh]
    +     append to rather than truncate test log; bz#2013 from openssh AT
    +     roumenpetrov.info
    +   - djm@cvs.openbsd.org 2012/06/01 00:52:52
    +     [regress/sftp-cmds.sh]
    +     don't delete .* on cleanup due to unintended env expansion; pointed out in
    +     bz#2014 by openssh AT roumenpetrov.info
    +   - dtucker@cvs.openbsd.org 2012/06/26 12:06:59
    +     [regress/connect-privsep.sh]
    +     test sandbox with every malloc option
    +   - dtucker@cvs.openbsd.org 2012/06/28 05:07:45
    +     [regress/try-ciphers.sh regress/cipher-speed.sh]
    +     Remove hmac-sha2-256-96 and hmac-sha2-512-96 MACs since they were removed
    +     from draft6 of the spec and will not be in the RFC when published.  Patch
    +     from mdb at juniper net via bz#2023, ok markus.
    + - (dtucker) [myproposal.h] Remove trailing backslash to fix compile error.
    + - (dtucker) [key.c] ifdef out sha256 key types on platforms that don't have
    +   the required functions in libcrypto.
    +
    +20120628
    + - (dtucker) [openbsd-compat/getrrsetbyname-ldns.c] bz #2022: prevent null
    +   pointer deref in the client when built with LDNS and using DNSSEC with a
    +   CNAME.  Patch from gregdlg+mr at hochet info.
    +
    +20120622
    + - (dtucker) [contrib/cygwin/ssh-host-config] Ensure that user sshd runs as
    +   can logon as a service.  Patch from vinschen at redhat com.
     
    -20100212
    +20120620
      - (djm) OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/02/02 22:49:34
    -     [bufaux.c]
    -     make buffer_get_string_ret() really non-fatal in all cases (it was
    -     using buffer_get_int(), which could fatal() on buffer empty);
    -     ok markus dtucker
    -   - markus@cvs.openbsd.org 2010/02/08 10:50:20
    -     [pathnames.h readconf.c readconf.h scp.1 sftp.1 ssh-add.1 ssh-add.c]
    -     [ssh-agent.c ssh-keygen.1 ssh-keygen.c ssh.1 ssh.c ssh_config.5]
    -     replace our obsolete smartcard code with PKCS#11.
    -        ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs-11v2-20.pdf
    -     ssh(1) and ssh-keygen(1) use dlopen(3) directly to talk to a PKCS#11
    -     provider (shared library) while ssh-agent(1) delegates PKCS#11 to
    -     a forked a ssh-pkcs11-helper process.
    -     PKCS#11 is currently a compile time option.
    -     feedback and ok djm@; inspired by patches from Alon Bar-Lev
    -   - jmc@cvs.openbsd.org 2010/02/08 22:03:05
    -     [ssh-add.1 ssh-keygen.1 ssh.1 ssh.c]
    +   - djm@cvs.openbsd.org 2011/12/02 00:41:56
    +     [mux.c]
    +     fix bz#1948: ssh -f doesn't fork for multiplexed connection.
    +     ok dtucker@
    +   - djm@cvs.openbsd.org 2011/12/04 23:16:12
    +     [mux.c]
    +     revert:
    +     > revision 1.32
    +     > date: 2011/12/02 00:41:56;  author: djm;  state: Exp;  lines: +4 -1
    +     > fix bz#1948: ssh -f doesn't fork for multiplexed connection.
    +     > ok dtucker@
    +     it interacts badly with ControlPersist
    +   - djm@cvs.openbsd.org 2012/01/07 21:11:36
    +     [mux.c]
    +     fix double-free in new session handler
    +     NB. Id sync only
    +   - djm@cvs.openbsd.org 2012/05/23 03:28:28
    +     [dns.c dns.h key.c key.h ssh-keygen.c]
    +     add support for RFC6594 SSHFP DNS records for ECDSA key types.
    +     patch from bugzilla-m67 AT nulld.me in bz#1978; ok + tweak markus@
    +   - djm@cvs.openbsd.org 2012/06/01 00:49:35
    +     [PROTOCOL.mux]
    +     correct types of port numbers (integers, not strings); bz#2004 from
    +     bert.wesarg AT googlemail.com
    +   - djm@cvs.openbsd.org 2012/06/01 01:01:22
    +     [mux.c]
    +     fix memory leak when mux socket creation fails; bz#2002 from bert.wesarg
    +     AT googlemail.com
    +   - dtucker@cvs.openbsd.org 2012/06/18 11:43:53
    +     [jpake.c]
    +     correct sizeof usage.  patch from saw at online.de, ok deraadt
    +   - dtucker@cvs.openbsd.org 2012/06/18 11:49:58
    +     [ssh_config.5]
    +     RSA instead of DSA twice.  From Steve.McClellan at radisys com
    +   - dtucker@cvs.openbsd.org 2012/06/18 12:07:07
    +     [ssh.1 sshd.8]
    +     Remove mention of 'three' key files since there are now four.  From
    +     Steve.McClellan at radisys com.
    +   - dtucker@cvs.openbsd.org 2012/06/18 12:17:18
    +     [ssh.1]
    +     Clarify description of -W.  Noted by Steve.McClellan at radisys com,
    +     ok jmc
    +   - markus@cvs.openbsd.org 2012/06/19 18:25:28
    +     [servconf.c servconf.h sshd_config.5]
    +     sshd_config: extend Match to allow AcceptEnv and {Allow,Deny}{Users,Groups}
    +     this allows 'Match LocalPort 1022' combined with 'AllowUser bauer'
    +     ok djm@ (back in March)
    +   - jmc@cvs.openbsd.org 2012/06/19 21:35:54
    +     [sshd_config.5]
          tweak previous; ok markus
    -   - djm@cvs.openbsd.org 2010/02/09 00:50:36
    -     [ssh-agent.c]
    -     fallout from PKCS#11: unbreak -D
    -   - djm@cvs.openbsd.org 2010/02/09 00:50:59
    +   - djm@cvs.openbsd.org 2012/06/20 04:42:58
    +     [clientloop.c serverloop.c]
    +     initialise accept() backoff timer to avoid EINVAL from select(2) in
    +     rekeying
    +
    +20120519
    + - (dtucker) [configure.ac] bz#2010: fix non-portable shell construct.  Patch
    +   from cjwatson at debian org.
    + - (dtucker) [configure.ac contrib/Makefile] bz#1996: use AC_PATH_TOOL to find
    +   pkg-config so it does the right thing when cross-compiling.  Patch from
    +   cjwatson at debian org.
    +- (dtucker) OpenBSD CVS Sync
    +   - dtucker@cvs.openbsd.org 2012/05/13 01:42:32
    +     [servconf.h servconf.c sshd.8 sshd.c auth.c sshd_config.5]
    +     Add "Match LocalAddress" and "Match LocalPort" to sshd and adjust tests
    +     to match.  Feedback and ok djm@ markus@.
    +   - dtucker@cvs.openbsd.org 2012/05/19 06:30:30
    +     [sshd_config.5]
    +     Document PermitOpen none.  bz#2001, patch from Loganaden Velvindron
    +
    +20120504
    + - (dtucker) [configure.ac] Include  rather than 
    +   to fix building on some plaforms.  Fom bowman at math utah edu and
    +   des at des no.
    +
    +20120427
    + - (dtucker) [regress/addrmatch.sh] skip tests when running on a non-ipv6
    +   platform rather than exiting early, so that we still clean up and return
    +   success or failure to test-exec.sh
    +
    +20120426
    + - (djm) [auth-passwd.c] Handle crypt() returning NULL; from Paul Wouters
    +   via Niels
    + - (djm) [auth-krb5.c] Save errno across calls that might modify it;
    +   ok dtucker@
    +
    +20120423
    + - OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2012/04/23 08:18:17
    +     [channels.c]
    +     fix function proto/source mismatch
    +
    +20120422
    + - OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2012/02/29 11:21:26
          [ssh-keygen.c]
    -     fix -Wall
    -   - djm@cvs.openbsd.org 2010/02/09 03:56:28
    -     [buffer.c buffer.h]
    -     constify the arguments to buffer_len, buffer_ptr and buffer_dump
    -   - djm@cvs.openbsd.org 2010/02/09 06:18:46
    +     allow conversion of RSA1 keys to public PEM and PKCS8; "nice" markus@
    +   - guenther@cvs.openbsd.org 2012/03/15 03:10:27
    +     [session.c]
    +     root should always be excluded from the test for /etc/nologin instead
    +     of having it always enforced even when marked as ignorenologin.  This
    +     regressed when the logic was incompletely flipped around in rev 1.251
    +     ok halex@ millert@
    +   - djm@cvs.openbsd.org 2012/03/28 07:23:22
    +     [PROTOCOL.certkeys]
    +     explain certificate extensions/crit split rationale. Mention requirement
    +     that each appear at most once per cert.
    +   - dtucker@cvs.openbsd.org 2012/03/29 23:54:36
    +     [channels.c channels.h servconf.c]
    +     Add PermitOpen none option based on patch from Loganaden Velvindron
    +     (bz #1949).  ok djm@
    +   - djm@cvs.openbsd.org 2012/04/11 13:16:19
    +     [channels.c channels.h clientloop.c serverloop.c]
    +     don't spin in accept() when out of fds (ENFILE/ENFILE) - back off for a
    +     while; ok deraadt@ markus@
    +   - djm@cvs.openbsd.org 2012/04/11 13:17:54
          [auth.c]
    -     unbreak ChrootDirectory+internal-sftp by skipping check for executable
    -     shell when chrooting; reported by danh AT wzrd.com; ok dtucker@
    -   - markus@cvs.openbsd.org 2010/02/10 23:20:38
    -     [ssh-add.1 ssh-keygen.1 ssh.1 ssh_config.5]
    -     pkcs#11 is no longer optional; improve wording; ok jmc@
    -   - jmc@cvs.openbsd.org 2010/02/11 13:23:29
    +     Support "none" as an argument for AuthorizedPrincipalsFile to indicate
    +     no file should be read.
    +   - djm@cvs.openbsd.org 2012/04/11 13:26:40
    +     [sshd.c]
    +     don't spin in accept() when out of fds (ENFILE/ENFILE) - back off for a
    +     while; ok deraadt@ markus@
    +   - djm@cvs.openbsd.org 2012/04/11 13:34:17
    +     [ssh-keyscan.1 ssh-keyscan.c]
    +     now that sshd defaults to offering ECDSA keys, ssh-keyscan should also
    +     look for them by default; bz#1971
    +   - djm@cvs.openbsd.org 2012/04/12 02:42:32
    +     [servconf.c servconf.h sshd.c sshd_config sshd_config.5]
    +     VersionAddendum option to allow server operators to append some arbitrary
    +     text to the SSH-... banner; ok deraadt@ "don't care" markus@
    +   - djm@cvs.openbsd.org 2012/04/12 02:43:55
    +     [sshd_config sshd_config.5]
    +     mention AuthorizedPrincipalsFile=none default
    +   - djm@cvs.openbsd.org 2012/04/20 03:24:23
    +     [sftp.c]
    +     setlinebuf(3) is more readable than setvbuf(.., _IOLBF, ...)
    +   - jmc@cvs.openbsd.org 2012/04/20 16:26:22
          [ssh.1]
    -     libarary -> library;
    - - (djm) [INSTALL Makefile.in README.smartcard configure.ac scard-opensc.c]
    -   [scard.c scard.h pkcs11.h scard/Makefile.in scard/Ssh.bin.uu scard/Ssh.java]
    -   Remove obsolete smartcard support
    - - (djm) [ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c]
    -   Make it compile on OSX
    - - (djm) [ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c]
    -   Use ssh_get_progname to fill __progname
    - - (djm) [configure.ac] Enable PKCS#11 support only when we find a working
    -   dlopen()
    -
    -20100210
    - - (djm) add -lselinux to LIBS before calling AC_CHECK_FUNCS for
    -   getseuserbyname; patch from calebcase AT gmail.com via
    -   cjwatson AT debian.org
    +     use "brackets" instead of "braces", for consistency;
     
    -20100202
    - - (djm) OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/01/30 21:08:33
    -     [sshd.8]
    -     debug output goes to stderr, not "the system log"; ok markus dtucker
    -   - djm@cvs.openbsd.org 2010/01/30 21:12:08
    -     [channels.c]
    -     fake local addr:port when stdio fowarding as some servers (Tectia at
    -     least) validate that they are well-formed;
    -     reported by imorgan AT nas.nasa.gov
    -     ok dtucker
    +20120420
    + - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
    +   [contrib/suse/openssh.spec] Update for release 6.0
    + - (djm) [README] Update URL to release notes.
    + - (djm) Release openssh-6.0
    +
    +20120419
    + - (djm) [configure.ac] Fix compilation error on FreeBSD, whose libutil
    +   contains openpty() but not login()
    +
    +20120404
    + - (djm) [Makefile.in configure.ac sandbox-seccomp-filter.c] Add sandbox
    +   mode for Linux's new seccomp filter; patch from Will Drewry; feedback
    +   and ok dtucker@
    +
    +20120330
    + - (dtucker) [contrib/redhat/openssh.spec] Bug #1992: remove now-gone WARNING
    +   file from spec file.  From crighter at nuclioss com.
    + - (djm) [entropy.c] bz#1991: relax OpenSSL version test to allow running
    +   openssh binaries on a newer fix release than they were compiled on.
    +   with and ok dtucker@
    + - (djm) [openbsd-compat/bsd-cygwin_util.h] #undef _WIN32 to avoid incorrect
    +   assumptions when building on Cygwin; patch from Corinna Vinschen
    +
    +20120309
    + - (djm) [openbsd-compat/port-linux.c] bz#1960: fix crash on SELinux 
    +   systems where sshd is run in te wrong context. Patch from Sven
    +   Vermeulen; ok dtucker@
    + - (djm) [packet.c] bz#1963: Fix IPQoS not being set on non-mapped v4-in-v6
    +   addressed connections. ok dtucker@
    +
    +20120224
    + - (dtucker) [audit-bsm.c configure.ac] bug #1968: enable workarounds for BSM
    +   audit breakage in Solaris 11.  Patch from Magnus Johansson.
    +
    +20120215
    + - (tim) [openbsd-compat/bsd-misc.h sshd.c] Fix conflicting return type for
    +   unsetenv due to rev 1.14 change to setenv.c. Cast unsetenv to void in sshd.c
    +   ok dtucker@
    + - (tim) [defines.h] move chunk introduced in 1.125 before MAXPATHLEN so
    +   it actually works.
    + - (tim) [regress/keytype.sh] stderr redirection needs to be inside back quote
    +   to work. Spotted by Angel Gonzalez
    +
    +20120214
    + - (djm) [openbsd-compat/bsd-cygwin_util.c] Add PROGRAMFILES to list of
    +   preserved Cygwin environment variables; from Corinna Vinschen
     
    -20100130
    +20120211
      - (djm) OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/01/28 00:21:18
    -     [clientloop.c]
    -     downgrade an error() to a debug() - this particular case can be hit in
    -     normal operation for certain sequences of mux slave vs session closure
    -     and is harmless
    -   - djm@cvs.openbsd.org 2010/01/29 00:20:41
    -     [sshd.c]
    -     set FD_CLOEXEC on sock_in/sock_out; bz#1706 from jchadima AT redhat.com
    -     ok dtucker@
    -   - djm@cvs.openbsd.org 2010/01/29 20:16:17
    -     [mux.c]
    -     kill correct channel (was killing already-dead mux channel, not
    -     its session channel)
    -   - djm@cvs.openbsd.org 2010/01/30 02:54:53
    +   - djm@cvs.openbsd.org 2012/01/05 00:16:56
    +     [monitor.c]
    +     memleak on error path
    +   - djm@cvs.openbsd.org 2012/01/07 21:11:36
          [mux.c]
    -     don't mark channel as read failed if it is already closing; suppresses
    -     harmless error messages when connecting to SSH.COM Tectia server
    -     report by imorgan AT nas.nasa.gov
    -
    -20100129
    - - (dtucker) [openbsd-compat/openssl-compat.c] Bug #1707: Call OPENSSL_config()
    -   after registering the hardware engines, which causes the openssl.cnf file to
    -   be processed.  See OpenSSL's man page for OPENSSL_config(3) for details.
    -   Patch from Solomon Peachy, ok djm@.
    +     fix double-free in new session handler
    +   - miod@cvs.openbsd.org 2012/01/08 13:17:11
    +     [ssh-ecdsa.c]
    +     Fix memory leak in ssh_ecdsa_verify(); from Loganaden Velvindron,
    +     ok markus@
    +   - miod@cvs.openbsd.org 2012/01/16 20:34:09
    +     [ssh-pkcs11-client.c]
    +     Fix a memory leak in pkcs11_rsa_private_encrypt(), reported by Jan Klemkow.
    +     While there, be sure to buffer_clear() between send_msg() and recv_msg().
    +     ok markus@
    +   - dtucker@cvs.openbsd.org 2012/01/18 21:46:43
    +     [clientloop.c]
    +     Ensure that $DISPLAY contains only valid characters before using it to
    +     extract xauth data so that it can't be used to play local shell
    +     metacharacter games.  Report from r00t_ati at ihteam.net, ok markus.
    +   - markus@cvs.openbsd.org 2012/01/25 19:26:43
    +     [packet.c]
    +     do not permit SSH2_MSG_SERVICE_REQUEST/ACCEPT during rekeying;
    +     ok dtucker@, djm@
    +   - markus@cvs.openbsd.org 2012/01/25 19:36:31
    +     [authfile.c]
    +     memleak in key_load_file(); from Jan Klemkow
    +   - markus@cvs.openbsd.org 2012/01/25 19:40:09
    +     [packet.c packet.h]
    +     packet_read_poll() is not used anymore.
    +   - markus@cvs.openbsd.org 2012/02/09 20:00:18
    +     [version.h]
    +     move from 6.0-beta to 6.0
     
    -20100128
    - - (djm) OpenBSD CVS Sync
    -   - djm@cvs.openbsd.org 2010/01/26 02:15:20
    +20120206
    + - (djm) [ssh-keygen.c] Don't fail in do_gen_all_hostkeys on platforms
    +   that don't support ECC. Patch from Phil Oleson
    +
    +20111219
    + - OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/12/02 00:41:56
          [mux.c]
    -     -Wuninitialized and remove a // comment; from portable
    -     (Id sync only)
    -   - djm@cvs.openbsd.org 2010/01/27 13:26:17
    +     fix bz#1948: ssh -f doesn't fork for multiplexed connection.
    +     ok dtucker@
    +   - djm@cvs.openbsd.org 2011/12/02 00:43:57
    +     [mac.c]
    +     fix bz#1934: newer OpenSSL versions will require HMAC_CTX_Init before
    +     HMAC_init (this change in policy seems insane to me)
    +     ok dtucker@
    +   - djm@cvs.openbsd.org 2011/12/04 23:16:12
          [mux.c]
    -     fix bug introduced in mux rewrite:
    -     
    -     In a mux master, when a socket to a mux slave closes before its server
    -     session (as may occur when the slave has been signalled), gracefully
    -     close the server session rather than deleting its channel immediately.
    -     A server may have more messages on that channel to send (e.g. an exit
    -     message) that will fatal() the client if they are sent to a channel that
    -     has been prematurely deleted.
    -     
    -     spotted by imorgan AT nas.nasa.gov
    -   - djm@cvs.openbsd.org 2010/01/27 19:21:39
    -     [sftp.c]
    -     add missing "p" flag to getopt optstring;
    -     bz#1704 from imorgan AT nas.nasa.gov
    +     revert:
    +     > revision 1.32
    +     > date: 2011/12/02 00:41:56;  author: djm;  state: Exp;  lines: +4 -1
    +     > fix bz#1948: ssh -f doesn't fork for multiplexed connection.
    +     > ok dtucker@
    +     it interacts badly with ControlPersist
    +   - djm@cvs.openbsd.org 2011/12/07 05:44:38
    +     [auth2.c dh.c packet.c roaming.h roaming_client.c roaming_common.c]
    +     fix some harmless and/or unreachable int overflows;
    +     reported Xi Wang, ok markus@
     
    -20100126
    - - (djm) OpenBSD CVS Sync
    -   - tedu@cvs.openbsd.org 2010/01/17 21:49:09
    -     [ssh-agent.1]
    -     Correct and clarify ssh-add's password asking behavior.
    -     Improved text dtucker and ok jmc
    -   - dtucker@cvs.openbsd.org 2010/01/18 01:50:27
    -     [roaming_client.c]
    -     s/long long unsigned/unsigned long long/, from tim via portable
    -     (Id sync only, change already in portable)
    -   - djm@cvs.openbsd.org 2010/01/26 01:28:35
    -     [channels.c channels.h clientloop.c clientloop.h mux.c nchan.c ssh.c]
    -     rewrite ssh(1) multiplexing code to a more sensible protocol.
    -     
    -     The new multiplexing code uses channels for the listener and
    -     accepted control sockets to make the mux master non-blocking, so
    -     no stalls when processing messages from a slave.
    -     
    -     avoid use of fatal() in mux master protocol parsing so an errant slave
    -     process cannot take down a running master.
    -     
    -     implement requesting of port-forwards over multiplexed sessions. Any
    -     port forwards requested by the slave are added to those the master has
    -     established.
    -     
    -     add support for stdio forwarding ("ssh -W host:port ...") in mux slaves.
    -     
    -     document master/slave mux protocol so that other tools can use it to
    -     control a running ssh(1). Note: there are no guarantees that this
    -     protocol won't be incompatibly changed (though it is versioned).
    -     
    -     feedback Salvador Fandino, dtucker@
    -     channel changes ok markus@
    -
    -20100122
    - - (tim) [configure.ac] Due to constraints in Windows Sockets in terms of
    -   socket inheritance, reduce the default SO_RCVBUF/SO_SNDBUF buffer size
    -   in Cygwin to 65535. Patch from Corinna Vinschen.
    -
    -20100117
    - - (tim) [configure.ac] OpenServer 5 needs BROKEN_GETADDRINFO too.
    - - (tim) [configure.ac] On SVR5 systems, use the C99-conforming functions
    -   snprintf() and vsnprintf() named _xsnprintf() and _xvsnprintf().
    -
    -20100116
    - - (dtucker) [openbsd-compat/pwcache.c] Pull in includes.h and thus defines.h
    -   so we correctly detect whether or not we have a native user_from_uid.
    - - (dtucker) [openbsd-compat/openbsd-compat.h] Prototypes for user_from_uid
    -   and group_from_gid.
    - - (dtucker) [openbsd-compat/openbsd-compat.h] Fix prototypes, spotted by
    -   Tim.
    - - (dtucker) OpenBSD CVS Sync
    -   - markus@cvs.openbsd.org 2010/01/15 09:24:23
    -     [sftp-common.c]
    -     unused
    - - (dtucker) [openbsd-compat/pwcache.c] Shrink ifdef area to prevent unused
    -   variable warnings.
    - - (dtucker) [openbsd-compat/openbsd-compat.h] Typo.
    - - (tim) [regress/portnum.sh] Shell portability fix.
    - - (tim) [configure.ac] Define BROKEN_GETADDRINFO on SVR5 systems. The native
    -   getaddrinfo() is too old and limited for addr_pton() in addrmatch.c.
    - - (tim) [roaming_client.c] Use of  is not really portable so we
    -   use "openbsd-compat/sys-queue.h". s/long long unsigned/unsigned long long/
    -   to keep USL compilers happy.
    -
    -20100115
    - - (dtucker) OpenBSD CVS Sync
    -   - jmc@cvs.openbsd.org 2010/01/13 12:48:34
    -     [sftp.1 sftp.c]
    -     sftp.1: put ls -h in the right place
    -     sftp.c: as above, plus add -p to get/put, and shorten their arg names
    -     to keep the help usage nicely aligned
    -     ok djm
    -   - djm@cvs.openbsd.org 2010/01/13 23:47:26
    -     [auth.c]
    -     when using ChrootDirectory, make sure we test for the existence of the
    -     user's shell inside the chroot; bz #1679, patch from alex AT rtfs.hu;
    -     ok dtucker
    -   - dtucker@cvs.openbsd.org 2010/01/14 23:41:49
    -     [sftp-common.c]
    -     use user_from{uid,gid} to lookup up ids since it keeps a small cache.
    -     ok djm
    -   - guenther@cvs.openbsd.org 2010/01/15 00:05:22
    -     [sftp.c]
    -     Reset SIGTERM to SIG_DFL before executing ssh, so that even if sftp
    -     inherited SIGTERM as ignored it will still be able to kill the ssh it
    -     starts.
    -     ok dtucker@
    - - (dtucker) [openbsd-compat/pwcache.c] Pull in pwcache.c from OpenBSD (no
    -   changes yet but there will be some to come).
    - - (dtucker) [configure.ac openbsd-compat/{Makefile.in,pwcache.c} Portability
    -   for pwcache.  Also, added caching of negative hits.
    -
    -20100114
    - - (djm) [platform.h] Add missing prototype for
    -   platform_krb5_get_principal_name
    -
    -20100113
    - - (dtucker) [monitor_fdpass.c] Wrap poll.h include in ifdefs.
    - - (dtucker) [openbsd-compat/readpassphrase.c] Resync against OpenBSD's r1.18:
    -   missing restore of SIGTTOU and some whitespace.
    - - (dtucker) [openbsd-compat/readpassphrase.c] Update to OpenBSD's r1.21.
    - - (dtucker) [openbsd-compat/readpassphrase.c] Update to OpenBSD's r1.22.
    -   Fixes bz #1590, where sometimes you could not interrupt a connection while
    -   ssh was prompting for a passphrase or password.
    - - (dtucker) OpenBSD CVS Sync
    -   - dtucker@cvs.openbsd.org 2010/01/13 00:19:04
    -     [sshconnect.c auth.c]
    -     Fix a couple of typos/mispellings in comments
    -   - dtucker@cvs.openbsd.org 2010/01/13 01:10:56
    -     [key.c]
    -     Ignore and log any Protocol 1 keys where the claimed size is not equal to
    -     the actual size.  Noted by Derek Martin, ok djm@
    -   - dtucker@cvs.openbsd.org 2010/01/13 01:20:20
    -     [canohost.c ssh-keysign.c sshconnect2.c]
    -     Make HostBased authentication work with a ProxyCommand.  bz #1569, patch
    -     from imorgan at nas nasa gov, ok djm@
    -   - djm@cvs.openbsd.org 2010/01/13 01:40:16
    -     [sftp.c sftp-server.c sftp.1 sftp-common.c sftp-common.h]
    -     support '-h' (human-readable units) for sftp's ls command, just like
    -     ls(1); ok dtucker@
    -   - djm@cvs.openbsd.org 2010/01/13 03:48:13
    -     [servconf.c servconf.h sshd.c]
    -     avoid run-time failures when specifying hostkeys via a relative
    -     path by prepending the cwd in these cases; bz#1290; ok dtucker@
    -   - djm@cvs.openbsd.org 2010/01/13 04:10:50
    +20111125
    + - OpenBSD CVS Sync
    +   - oga@cvs.openbsd.org 2011/11/16 12:24:28
          [sftp.c]
    -     don't append a space after inserting a completion of a directory (i.e.
    -     a path ending in '/') for a slightly better user experience; ok dtucker@
    - - (dtucker) [sftp-common.c] Wrap include of util.h in an ifdef.
    - - (tim) [defines.h] openbsd-compat/readpassphrase.c now needs _NSIG. 
    -   feedback and ok dtucker@
    +     Don't leak list in complete_cmd_parse if there are no commands found.
    +     Discovered when I was ``borrowing'' this code for something else.
    +     ok djm@
     
    -20100112
    - - (dtucker) OpenBSD CVS Sync
    -   - dtucker@cvs.openbsd.org 2010/01/11 01:39:46
    -     [ssh_config channels.c ssh.1 channels.h ssh.c]
    -     Add a 'netcat mode' (ssh -W).  This connects stdio on the client to a
    -     single port forward on the server.  This allows, for example, using ssh as
    -     a ProxyCommand to route connections via intermediate servers.
    -     bz #1618, man page help from jmc@, ok markus@
    -   - dtucker@cvs.openbsd.org 2010/01/11 04:46:45
    -     [authfile.c sshconnect2.c]
    -     Do not prompt for a passphrase if we fail to open a keyfile, and log the
    -     reason the open failed to debug.
    -     bz #1693, found by tj AT castaglia org, ok djm@
    -   - djm@cvs.openbsd.org 2010/01/11 10:51:07
    -     [ssh-keygen.c]
    -     when converting keys, truncate key comments at 72 chars as per RFC4716;
    -     bz#1630 reported by tj AT castaglia.org; ok markus@
    -   - dtucker@cvs.openbsd.org 2010/01/12 00:16:47
    -     [authfile.c]
    -     Fix bug introduced in r1.78 (incorrect brace location) that broke key auth.
    -     Patch from joachim joachimschipper nl.
    -   - djm@cvs.openbsd.org 2010/01/12 00:58:25
    -     [monitor_fdpass.c]
    -     avoid spinning when fd passing on nonblocking sockets by calling poll()
    -     in the EINTR/EAGAIN path, much like we do in atomicio; ok dtucker@
    -   - djm@cvs.openbsd.org 2010/01/12 00:59:29
    -     [roaming_common.c]
    -     delete with extreme prejudice a debug() that fired with every keypress;
    -     ok dtucker deraadt
    -   - dtucker@cvs.openbsd.org 2010/01/12 01:31:05
    -     [session.c]
    -     Do not allow logins if /etc/nologin exists but is not readable by the user
    -     logging in.  Noted by Jan.Pechanec at Sun, ok djm@ deraadt@
    -   - djm@cvs.openbsd.org 2010/01/12 01:36:08
    -     [buffer.h bufaux.c]
    -     add a buffer_get_string_ptr_ret() that does the same as
    -     buffer_get_string_ptr() but does not fatal() on error; ok dtucker@
    -   - dtucker@cvs.openbsd.org 2010/01/12 08:33:17
    -     [session.c]
    -     Add explicit stat so we reliably detect nologin with bad perms.
    -     ok djm markus
    +20111121
    + - (dtucker) [configure.ac] Set _FORTIFY_SOURCE.  ok djm@
     
    -20100110
    - - (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c]
    -   Remove hacks add for RoutingDomain in preparation for its removal.
    +20111104
      - (dtucker) OpenBSD CVS Sync
    -   - dtucker@cvs.openbsd.org 2010/01/09 23:04:13
    -     [channels.c ssh.1 servconf.c sshd_config.5 sshd.c channels.h servconf.h
    -     ssh-keyscan.1 ssh-keyscan.c readconf.c sshconnect.c misc.c ssh.c
    -     readconf.h scp.1 sftp.1 ssh_config.5 misc.h]
    -     Remove RoutingDomain from ssh since it's now not needed.  It can be
    -     replaced with "route exec" or "nc -V" as a proxycommand.  "route exec"
    -     also ensures that trafic such as DNS lookups stays withing the specified
    -     routingdomain.  For example (from reyk):
    -     # route -T 2 exec /usr/sbin/sshd
    -     or inherited from the parent process
    -     $ route -T 2 exec sh
    -     $ ssh 10.1.2.3
    -     ok deraadt@ markus@ stevesk@ reyk@
    -   - dtucker@cvs.openbsd.org 2010/01/10 03:51:17
    -     [servconf.c]
    -     Add ChrootDirectory to sshd.c test-mode output
    -   - dtucker@cvs.openbsd.org 2010/01/10 07:15:56
    -     [auth.c]
    -     Output a debug if we can't open an existing keyfile.  bz#1694, ok djm@
    +   - djm@cvs.openbsd.org 2011/10/18 05:15:28
    +     [ssh.c]
    +     ssh(1): skip attempting to create ~/.ssh when -F is passed; ok markus@
    +   - djm@cvs.openbsd.org 2011/10/18 23:37:42
    +     [ssh-add.c]
    +     add -k to usage(); reminded by jmc@
    +   - djm@cvs.openbsd.org 2011/10/19 00:06:10
    +     [moduli.c]
    +     s/tmpfile/tmp/ to make this -Wshadow clean
    +   - djm@cvs.openbsd.org 2011/10/19 10:39:48
    +     [umac.c]
    +     typo in comment; patch from Michael W. Bombardieri
    +   - djm@cvs.openbsd.org 2011/10/24 02:10:46
    +     [ssh.c]
    +     bz#1943: unbreak stdio forwarding when ControlPersist is in user - ssh
    +     was incorrectly requesting the forward in both the control master and
    +     slave. skip requesting it in the master to fix. ok markus@
    +   - djm@cvs.openbsd.org 2011/10/24 02:13:13
    +     [session.c]
    +     bz#1859: send tty break to pty master instead of (probably already
    +     closed) slave side; "looks good" markus@
    +   - dtucker@cvs.openbsd.org 011/11/04 00:09:39
    +     [moduli]
    +     regenerated moduli file; ok deraadt
    + - (dtucker) [INSTALL LICENCE configure.ac openbsd-compat/Makefile.in
    +   openbsd-compat/getrrsetbyname-ldns.c openbsd-compat/getrrsetbyname.c]
    +   bz 1320: Add optional support for LDNS, a BSD licensed DNS resolver library
    +   which supports DNSSEC.  Patch from Simon Vallet (svallet at genoscope cns fr)
    +   with some rework from myself and djm.  ok djm.
    +
    +20111025
    + - (dtucker) [contrib/cygwin/Makefile] Continue if installing a doc file
    +   fails.  Patch from Corinna Vinschen.
    +
    +20111018
    + - (djm) OpenBSD CVS Sync
    +   - djm@cvs.openbsd.org 2011/10/04 14:17:32
    +     [sftp-glob.c]
    +     silence error spam for "ls */foo" in directory with files; bz#1683
    +   - dtucker@cvs.openbsd.org 2011/10/16 11:02:46
    +     [moduli.c ssh-keygen.1 ssh-keygen.c]
    +     Add optional checkpoints for moduli screening.  feedback & ok deraadt
    +   - jmc@cvs.openbsd.org 2011/10/16 15:02:41
    +     [ssh-keygen.c]
    +     put -K in the right place (usage());
    +   - stsp@cvs.openbsd.org 2011/10/16 15:51:39
    +     [moduli.c]
    +     add missing includes to unbreak tree; fix from rpointel
    +   - djm@cvs.openbsd.org 2011/10/18 04:58:26
    +     [auth-options.c key.c]
    +     remove explict search for \0 in packet strings, this job is now done
    +     implicitly by buffer_get_cstring; ok markus
    +   - djm@cvs.openbsd.org 2011/10/18 05:00:48
    +     [ssh-add.1 ssh-add.c]
    +     new "ssh-add -k" option to load plain keys (skipping certificates);
    +     "looks ok" markus@
     
    -20100109
    - - (dtucker) Wrap use of IPPROTO_IPV6 in an ifdef for platforms that don't
    -   have it.
    - - (dtucker) [defines.h] define PRIu64 for platforms that don't have it.
    - - (dtucker) [roaming_client.c] Wrap inttypes.h in an ifdef.
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 02:09:06 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id DC2DEC54;
     Fri,  1 Mar 2013 02:09:06 +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 CE63AF26;
     Fri,  1 Mar 2013 02:09:06 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21296Xt042516;
     Fri, 1 Mar 2013 02:09:06 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21296YZ042515;
     Fri, 1 Mar 2013 02:09:06 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010209.r21296YZ042515@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 02:09:06 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247522 - stable/8/share/man/man5
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 02:09:06 -0000
    
    Author: des
    Date: Fri Mar  1 02:09:06 2013
    New Revision: 247522
    URL: http://svnweb.freebsd.org/changeset/base/247522
    
    Log:
      Regenerate
    
    Modified:
      stable/8/share/man/man5/src.conf.5
    
    Modified: stable/8/share/man/man5/src.conf.5
    ==============================================================================
    --- stable/8/share/man/man5/src.conf.5	Fri Mar  1 02:06:04 2013	(r247521)
    +++ stable/8/share/man/man5/src.conf.5	Fri Mar  1 02:09:06 2013	(r247522)
    @@ -1,7 +1,7 @@
     .\" DO NOT EDIT-- this file is automatically generated.
    -.\" from FreeBSD: stable/8/tools/build/options/makeman 188848 2009-02-20 11:09:55Z mtm
    +.\" from FreeBSD: stable/8/tools/build/options/makeman 236431 2012-06-02 02:26:49Z gjb
     .\" $FreeBSD$
    -.Dd January  4, 2012
    +.Dd March  1, 2013
     .Dt SRC.CONF 5
     .Os
     .Sh NAME
    @@ -204,6 +204,14 @@ and
     .\" from FreeBSD: stable/8/tools/build/options/WITH_BIND_XML 193280 2009-06-01 21:58:59Z dougb
     Set to enable the http statistics interface for named.
     This requires ports/textproc/libxml2 to be installed in /usr/local.
    +.It Va WITHOUT_BINUTILS
    +.\" from FreeBSD: stable/8/tools/build/options/WITHOUT_BINUTILS 236342 2012-05-30 22:31:45Z obrien
    +Set to not install binutils (as, c++-filt, gconv, gnu-ar, gnu-randlib,
    +ld, nm, objcopy, objdump, readelf, size and strip)
    +.Bf -symbolic
    +The option does not generally work for build targets, unless some alternative
    +toolchain is enabled.
    +.Ef
     .It Va WITHOUT_BLUETOOTH
     .\" from FreeBSD: stable/8/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru
     Set to not build Bluetooth related kernel modules, programs and libraries.
    @@ -316,6 +324,13 @@ Set to not build
     .It Va WITHOUT_GAMES
     .\" from FreeBSD: stable/8/tools/build/options/WITHOUT_GAMES 156932 2006-03-21 07:50:50Z ru
     Set to not build games.
    +.It Va WITHOUT_GCC
    +.\" from FreeBSD: stable/8/tools/build/options/WITHOUT_GCC 236342 2012-05-30 22:31:45Z obrien
    +Set to not install gcc and g++.
    +.Bf -symbolic
    +The option does not generally work for build targets, unless some alternative
    +toolchain is enabled.
    +.Ef
     .It Va WITHOUT_GCOV
     .\" from FreeBSD: stable/8/tools/build/options/WITHOUT_GCOV 156932 2006-03-21 07:50:50Z ru
     Set to not build the
    @@ -652,6 +667,16 @@ Set to not build Objective C support.
     .It Va WITHOUT_OPENSSH
     .\" from FreeBSD: stable/8/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru
     Set to not build OpenSSH.
    +.It Va WITH_OPENSSH_NONE_CIPHER
    +.\" $FreeBSD$
    +Set to include the "None" cipher support in OpenSSH and its libraries.
    +Additional adjustments may need to be done to system configuration
    +files, such as
    +.Xr sshd_config 5 ,
    +to enable this cipher.
    +Please see
    +.Pa /usr/src/crypto/openssh/README.hpn
    +for full details.
     .It Va WITHOUT_OPENSSL
     .\" from FreeBSD: stable/8/tools/build/options/WITHOUT_OPENSSL 156932 2006-03-21 07:50:50Z ru
     Set to not build OpenSSL.
    @@ -811,6 +836,10 @@ When set, it also enforces the following
     .Pp
     .Bl -item -compact
     .It
    +.Va WITHOUT_BINUTILS
    +.It
    +.Va WITHOUT_GCC
    +.It
     .Va WITHOUT_GDB
     .El
     .It Va WITHOUT_USB
    @@ -843,11 +872,11 @@ protocols (usable only via 802.1X).
     .\" from FreeBSD: stable/8/tools/build/options/WITHOUT_ZFS 168409 2007-04-06 02:13:30Z pjd
     Set to not build ZFS file system.
     .It Va WITHOUT_ZONEINFO
    -.\" from FreeBSD: stable/8/tools/build/options/WITHOUT_ZONEINFO 171994 2007-08-27 20:01:08Z remko
    +.\" from FreeBSD: stable/8/tools/build/options/WITHOUT_ZONEINFO 235588 2012-05-18 02:00:41Z gjb
     Set to not build the timezone database.
     .El
     .Sh FILES
    -.Bl -tag -compact
    +.Bl -tag -compact -width Pa
     .It Pa /etc/src.conf
     .It Pa /usr/share/mk/bsd.own.mk
     .El
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 02:26:30 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id E79FCEE3;
     Fri,  1 Mar 2013 02:26:30 +0000 (UTC)
     (envelope-from neel@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 C0D50FBC;
     Fri,  1 Mar 2013 02:26:30 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r212QUZV048349;
     Fri, 1 Mar 2013 02:26:30 GMT (envelope-from neel@svn.freebsd.org)
    Received: (from neel@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r212QTG8048342;
     Fri, 1 Mar 2013 02:26:29 GMT (envelope-from neel@svn.freebsd.org)
    Message-Id: <201303010226.r212QTG8048342@svn.freebsd.org>
    From: Neel Natu 
    Date: Fri, 1 Mar 2013 02:26:29 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247523 - head/usr.sbin/bhyve
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 02:26:31 -0000
    
    Author: neel
    Date: Fri Mar  1 02:26:28 2013
    New Revision: 247523
    URL: http://svnweb.freebsd.org/changeset/base/247523
    
    Log:
      Specify the length of the mapping requested from 'paddr_guest2host()'.
      
      This seems prudent to do in its own right but it also opens up the possibility
      of not having to mmap the entire guest address space in the 'bhyve' process
      context.
      
      Discussed with:	grehan
      Obtained from:	NetApp
    
    Modified:
      head/usr.sbin/bhyve/acpi.c
      head/usr.sbin/bhyve/bhyverun.c
      head/usr.sbin/bhyve/bhyverun.h
      head/usr.sbin/bhyve/mptbl.c
      head/usr.sbin/bhyve/pci_virtio_block.c
      head/usr.sbin/bhyve/pci_virtio_net.c
      head/usr.sbin/bhyve/virtio.h
    
    Modified: head/usr.sbin/bhyve/acpi.c
    ==============================================================================
    --- head/usr.sbin/bhyve/acpi.c	Fri Mar  1 02:09:06 2013	(r247522)
    +++ head/usr.sbin/bhyve/acpi.c	Fri Mar  1 02:26:28 2013	(r247523)
    @@ -683,13 +683,16 @@ static int
     basl_load(int fd, uint64_t off)
     {
             struct stat sb;
    +	void *gaddr;
     	int err;
     
     	err = 0;
    -
    -	if (fstat(fd, &sb) < 0 ||
    -	    read(fd, paddr_guest2host(basl_acpi_base + off), sb.st_size) < 0)
    +	gaddr = paddr_guest2host(basl_acpi_base + off, sb.st_size);
    +	if (gaddr != NULL) {
    +		if (fstat(fd, &sb) < 0 || read(fd, gaddr, sb.st_size) < 0)
     			err = errno;
    +	} else
    +		err = EFAULT;
     
     	return (err);
     }
    
    Modified: head/usr.sbin/bhyve/bhyverun.c
    ==============================================================================
    --- head/usr.sbin/bhyve/bhyverun.c	Fri Mar  1 02:09:06 2013	(r247522)
    +++ head/usr.sbin/bhyve/bhyverun.c	Fri Mar  1 02:26:28 2013	(r247523)
    @@ -157,17 +157,19 @@ usage(int code)
     }
     
     void *
    -paddr_guest2host(uintptr_t gaddr)
    +paddr_guest2host(uintptr_t gaddr, size_t len)
     {
    -	if (lomem_sz == 0)
    -		return (NULL);
     
    -	if (gaddr < lomem_sz) {
    +	if (gaddr < lomem_sz && gaddr + len <= lomem_sz)
     		return ((void *)(lomem_addr + gaddr));
    -	} else if (gaddr >= 4*GB && gaddr < (4*GB + himem_sz)) {
    -		return ((void *)(himem_addr + gaddr - 4*GB));
    -	} else
    -		return (NULL);
    +
    +	if (gaddr >= 4*GB) {
    +		gaddr -= 4*GB;
    +		if (gaddr < himem_sz && gaddr + len <= himem_sz)
    +			return ((void *)(himem_addr + gaddr));
    +	}
    +
    +	return (NULL);
     }
     
     int
    
    Modified: head/usr.sbin/bhyve/bhyverun.h
    ==============================================================================
    --- head/usr.sbin/bhyve/bhyverun.h	Fri Mar  1 02:09:06 2013	(r247522)
    +++ head/usr.sbin/bhyve/bhyverun.h	Fri Mar  1 02:26:28 2013	(r247523)
    @@ -43,7 +43,7 @@ extern char *vmname;
     
     extern u_long lomem_sz, himem_sz;
     
    -void *paddr_guest2host(uintptr_t);
    +void *paddr_guest2host(uintptr_t addr, size_t len);
     
     void fbsdrun_addcpu(struct vmctx *ctx, int cpu, uint64_t rip);
     int  fbsdrun_muxed(void);
    
    Modified: head/usr.sbin/bhyve/mptbl.c
    ==============================================================================
    --- head/usr.sbin/bhyve/mptbl.c	Fri Mar  1 02:09:06 2013	(r247522)
    +++ head/usr.sbin/bhyve/mptbl.c	Fri Mar  1 02:26:28 2013	(r247523)
    @@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$");
     
     #define MPTABLE_BASE		0xF0000
     
    +/* floating pointer length + maximum length of configuration table */
    +#define	MPTABLE_MAX_LENGTH	(65536 + 16)
    +
     #define LAPIC_PADDR		0xFEE00000
     #define LAPIC_VERSION 		16
     
    @@ -346,13 +349,13 @@ mptable_build(struct vmctx *ctx, int ncp
     	char 			*curraddr;
     	char 			*startaddr;
     
    -	if (paddr_guest2host(0) == NULL) {
    +	startaddr = paddr_guest2host(MPTABLE_BASE, MPTABLE_MAX_LENGTH);
    +	if (startaddr == NULL) {
     		printf("mptable requires mapped mem\n");
     		return (ENOMEM);
     	}
     
    -	startaddr = curraddr = paddr_guest2host(MPTABLE_BASE);
    -
    +	curraddr = startaddr;
     	mpfp = (mpfps_t)curraddr;
     	mpt_build_mpfp(mpfp, MPTABLE_BASE);
     	curraddr += sizeof(*mpfp);
    
    Modified: head/usr.sbin/bhyve/pci_virtio_block.c
    ==============================================================================
    --- head/usr.sbin/bhyve/pci_virtio_block.c	Fri Mar  1 02:09:06 2013	(r247522)
    +++ head/usr.sbin/bhyve/pci_virtio_block.c	Fri Mar  1 02:26:28 2013	(r247523)
    @@ -222,13 +222,13 @@ pci_vtblk_proc(struct pci_vtblk_softc *s
     	assert(nsegs >= 3);
     	assert(nsegs < VTBLK_MAXSEGS + 2);
     
    -	vid = paddr_guest2host(vd->vd_addr);
    +	vid = paddr_guest2host(vd->vd_addr, vd->vd_len);
     	assert((vid->vd_flags & VRING_DESC_F_INDIRECT) == 0);
     
     	/*
     	 * The first descriptor will be the read-only fixed header
     	 */
    -	vbh = paddr_guest2host(vid[0].vd_addr);
    +	vbh = paddr_guest2host(vid[0].vd_addr, sizeof(struct virtio_blk_hdr));
     	assert(vid[0].vd_len == sizeof(struct virtio_blk_hdr));
     	assert(vid[0].vd_flags & VRING_DESC_F_NEXT);
     	assert((vid[0].vd_flags & VRING_DESC_F_WRITE) == 0);
    @@ -247,7 +247,8 @@ pci_vtblk_proc(struct pci_vtblk_softc *s
     	 * Build up the iovec based on the guest's data descriptors
     	 */
     	for (i = 1, iolen = 0; i < nsegs - 1; i++) {
    -		iov[i-1].iov_base = paddr_guest2host(vid[i].vd_addr);
    +		iov[i-1].iov_base = paddr_guest2host(vid[i].vd_addr,
    +						     vid[i].vd_len);
     		iov[i-1].iov_len = vid[i].vd_len;
     		iolen += vid[i].vd_len;
     
    @@ -265,7 +266,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *s
     	}
     
     	/* Lastly, get the address of the status byte */
    -	status = paddr_guest2host(vid[nsegs - 1].vd_addr);
    +	status = paddr_guest2host(vid[nsegs - 1].vd_addr, 1);
     	assert(vid[nsegs - 1].vd_len == 1);
     	assert((vid[nsegs - 1].vd_flags & VRING_DESC_F_NEXT) == 0);
     	assert(vid[nsegs - 1].vd_flags & VRING_DESC_F_WRITE);
    @@ -341,7 +342,8 @@ pci_vtblk_ring_init(struct pci_vtblk_sof
     	hq = &sc->vbsc_q;
     	hq->hq_size = VTBLK_RINGSZ;
     
    -	hq->hq_dtable = paddr_guest2host(pfn << VRING_PFN);
    +	hq->hq_dtable = paddr_guest2host(pfn << VRING_PFN,
    +					 vring_size(VTBLK_RINGSZ));
     	hq->hq_avail_flags =  (uint16_t *)(hq->hq_dtable + hq->hq_size);
     	hq->hq_avail_idx = hq->hq_avail_flags + 1;
     	hq->hq_avail_ring = hq->hq_avail_flags + 2;
    @@ -372,13 +374,6 @@ pci_vtblk_init(struct vmctx *ctx, struct
     	}
     
     	/*
    -	 * Access to guest memory is required. Fail if
    -	 * memory not mapped
    -	 */
    -	if (paddr_guest2host(0) == NULL)
    -		return (1);
    -
    -	/*
     	 * The supplied backing file has to exist
     	 */
     	fd = open(opts, O_RDWR);
    
    Modified: head/usr.sbin/bhyve/pci_virtio_net.c
    ==============================================================================
    --- head/usr.sbin/bhyve/pci_virtio_net.c	Fri Mar  1 02:09:06 2013	(r247522)
    +++ head/usr.sbin/bhyve/pci_virtio_net.c	Fri Mar  1 02:26:28 2013	(r247523)
    @@ -326,7 +326,7 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc 
     		 * Get a pointer to the rx header, and use the
     		 * data immediately following it for the packet buffer.
     		 */
    -		vrx = (struct virtio_net_rxhdr *)paddr_guest2host(vd->vd_addr);
    +		vrx = paddr_guest2host(vd->vd_addr, vd->vd_len);
     		buf = (uint8_t *)(vrx + 1);
     
     		len = read(sc->vsc_tapfd, buf,
    @@ -434,7 +434,7 @@ pci_vtnet_proctx(struct pci_vtnet_softc 
     	for (i = 0, plen = 0;
     	     i < VTNET_MAXSEGS;
     	     i++, vd = &hq->hq_dtable[vd->vd_next]) {
    -		iov[i].iov_base = paddr_guest2host(vd->vd_addr);
    +		iov[i].iov_base = paddr_guest2host(vd->vd_addr, vd->vd_len);
     		iov[i].iov_len = vd->vd_len;
     		plen += vd->vd_len;
     		tlen += vd->vd_len;
    @@ -517,7 +517,8 @@ pci_vtnet_ring_init(struct pci_vtnet_sof
     	hq = &sc->vsc_hq[qnum];
     	hq->hq_size = pci_vtnet_qsize(qnum);
     
    -	hq->hq_dtable = paddr_guest2host(pfn << VRING_PFN);
    +	hq->hq_dtable = paddr_guest2host(pfn << VRING_PFN,
    +					 vring_size(hq->hq_size));
     	hq->hq_avail_flags =  (uint16_t *)(hq->hq_dtable + hq->hq_size);
     	hq->hq_avail_idx = hq->hq_avail_flags + 1;
     	hq->hq_avail_ring = hq->hq_avail_flags + 2;
    @@ -541,13 +542,6 @@ pci_vtnet_init(struct vmctx *ctx, struct
     	struct pci_vtnet_softc *sc;
     	const char *env_msi;
     
    -	/*
    -	 * Access to guest memory is required. Fail if
    -	 * memory not mapped
    -	 */
    -	if (paddr_guest2host(0) == NULL)
    -		return (1);
    -
     	sc = malloc(sizeof(struct pci_vtnet_softc));
     	memset(sc, 0, sizeof(struct pci_vtnet_softc));
     
    
    Modified: head/usr.sbin/bhyve/virtio.h
    ==============================================================================
    --- head/usr.sbin/bhyve/virtio.h	Fri Mar  1 02:09:06 2013	(r247522)
    +++ head/usr.sbin/bhyve/virtio.h	Fri Mar  1 02:26:28 2013	(r247523)
    @@ -85,4 +85,19 @@ struct virtio_used {
     #define VTCFG_R_CFG1		24	/* With MSI-X */
     #define VTCFG_R_MSIX		20
     
    +/* From section 2.3, "Virtqueue Configuration", of the virtio specification */
    +static inline u_int
    +vring_size(u_int qsz)
    +{
    +	u_int size;
    +
    +	size = sizeof(struct virtio_desc) * qsz + sizeof(uint16_t) * (3 + qsz);
    +	size = roundup2(size, VRING_ALIGN);
    +
    +	size += sizeof(uint16_t) * 3 + sizeof(struct virtio_used) * qsz;
    +	size = roundup2(size, VRING_ALIGN);
    +
    +	return (size);
    +}
    +
     #endif	/* _VIRTIO_H_ */
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 02:46:41 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: by hub.freebsd.org (Postfix, from userid 1033)
     id 598F728A; Fri,  1 Mar 2013 02:46:41 +0000 (UTC)
    Date: Fri, 1 Mar 2013 02:46:41 +0000
    From: Alexey Dokuchaev 
    To: Alexander Motin 
    Subject: Re: svn commit: r247460 - head/sys/dev/acpica
    Message-ID: <20130301024641.GA88239@FreeBSD.org>
    References: <201302281127.r1SBR2VE068276@svn.freebsd.org>
     <20130228162522.GA41693@FreeBSD.org> <512F95DC.1040005@FreeBSD.org>
    MIME-Version: 1.0
    Content-Type: text/plain; charset=koi8-r
    Content-Disposition: inline
    In-Reply-To: <512F95DC.1040005@FreeBSD.org>
    User-Agent: Mutt/1.5.21 (2010-09-15)
    Cc: Davide Italiano , svn-src-head@freebsd.org,
     svn-src-all@freebsd.org, src-committers@freebsd.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 02:46:41 -0000
    
    On Thu, Feb 28, 2013 at 07:37:32PM +0200, Alexander Motin wrote:
    > SBT_1US is 4294 (0x10c6). The best that compiler may do is replace
    > division with multiplication. In fact, Clang even does this on amd64.
    > But on i386 it calls __divdi3(), doing 64bit division in software. Shift
    > is definitely cheaper and 5% precision is fine here.
    
    I see, thanks for explanation.  I overlooked SBT_1US definition.
    
    ./danfe
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 03:04:58 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id D6AA866E;
     Fri,  1 Mar 2013 03:04: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 C460E212;
     Fri,  1 Mar 2013 03:04:58 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2134wix061257;
     Fri, 1 Mar 2013 03:04:58 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2134wBl061250;
     Fri, 1 Mar 2013 03:04:58 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303010304.r2134wBl061250@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 03:04: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: r247525 - in stable/9/sys: netinet sys
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 03:04:58 -0000
    
    Author: jhb
    Date: Fri Mar  1 03:04:57 2013
    New Revision: 247525
    URL: http://svnweb.freebsd.org/changeset/base/247525
    
    Log:
      MFC 245823,245824,246210
      - Use decimal values for UDP, TCP, and UNIX domain socket options rather
        than hex to avoid implying that these constants should be treated as bit
        masks.
      - Add placeholder constants to reserve a portion of the socket option
        name space for use by downstream vendors to add custom options.
    
    Modified:
      stable/9/sys/netinet/tcp.h
      stable/9/sys/netinet/udp.h
      stable/9/sys/sys/socket.h
      stable/9/sys/sys/un.h
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/netinet/tcp.h
    ==============================================================================
    --- stable/9/sys/netinet/tcp.h	Fri Mar  1 02:59:56 2013	(r247524)
    +++ stable/9/sys/netinet/tcp.h	Fri Mar  1 03:04:57 2013	(r247525)
    @@ -149,20 +149,25 @@ struct tcphdr {
     #endif /* __BSD_VISIBLE */
     
     /*
    - * User-settable options (used with setsockopt).
    + * User-settable options (used with setsockopt).  These are discrete
    + * values and are not masked together.  Some values appear to be
    + * bitmasks for historical reasons.
      */
    -#define	TCP_NODELAY	0x01	/* don't delay send to coalesce packets */
    +#define	TCP_NODELAY	1	/* don't delay send to coalesce packets */
     #if __BSD_VISIBLE
    -#define	TCP_MAXSEG	0x02	/* set maximum segment size */
    -#define TCP_NOPUSH	0x04	/* don't push last block of write */
    -#define TCP_NOOPT	0x08	/* don't use TCP options */
    -#define TCP_MD5SIG	0x10	/* use MD5 digests (RFC2385) */
    -#define	TCP_INFO	0x20	/* retrieve tcp_info structure */
    -#define	TCP_CONGESTION	0x40	/* get/set congestion control algorithm */
    -#define	TCP_KEEPINIT	0x80	/* N, time to establish connection */
    -#define	TCP_KEEPIDLE	0x100	/* L,N,X start keeplives after this period */
    -#define	TCP_KEEPINTVL	0x200	/* L,N interval between keepalives */
    -#define	TCP_KEEPCNT	0x400	/* L,N number of keepalives before close */
    +#define	TCP_MAXSEG	2	/* set maximum segment size */
    +#define TCP_NOPUSH	4	/* don't push last block of write */
    +#define TCP_NOOPT	8	/* don't use TCP options */
    +#define TCP_MD5SIG	16	/* use MD5 digests (RFC2385) */
    +#define	TCP_INFO	32	/* retrieve tcp_info structure */
    +#define	TCP_CONGESTION	64	/* get/set congestion control algorithm */
    +#define	TCP_KEEPINIT	128	/* N, time to establish connection */
    +#define	TCP_KEEPIDLE	256	/* L,N,X start keeplives after this period */
    +#define	TCP_KEEPINTVL	512	/* L,N interval between keepalives */
    +#define	TCP_KEEPCNT	1024	/* L,N number of keepalives before close */
    +
    +/* Start of reserved space for third-party user-settable options. */
    +#define	TCP_VENDOR	SO_VENDOR
     
     #define	TCP_CA_NAME_MAX	16	/* max congestion control name length */
     
    
    Modified: stable/9/sys/netinet/udp.h
    ==============================================================================
    --- stable/9/sys/netinet/udp.h	Fri Mar  1 02:59:56 2013	(r247524)
    +++ stable/9/sys/netinet/udp.h	Fri Mar  1 03:04:57 2013	(r247525)
    @@ -48,8 +48,10 @@ struct udphdr {
     /* 
      * User-settable options (used with setsockopt).
      */
    -#define	UDP_ENCAP			0x01
    +#define	UDP_ENCAP			1
     
    +/* Start of reserved space for third-party user-settable options. */
    +#define	UDP_VENDOR			SO_VENDOR
     
     /*
      * UDP Encapsulation of IPsec Packets options.
    
    Modified: stable/9/sys/sys/socket.h
    ==============================================================================
    --- stable/9/sys/sys/socket.h	Fri Mar  1 02:59:56 2013	(r247524)
    +++ stable/9/sys/sys/socket.h	Fri Mar  1 03:04:57 2013	(r247525)
    @@ -143,6 +143,15 @@ typedef	__uid_t		uid_t;
     #endif
     
     /*
    + * Space reserved for new socket options added by third-party vendors.
    + * This range applies to all socket option levels.  New socket options
    + * in FreeBSD should always use an option value less than SO_VENDOR.
    + */
    +#if __BSD_VISIBLE
    +#define	SO_VENDOR	0x80000000
    +#endif
    +
    +/*
      * Structure used for manipulating linger option.
      */
     struct linger {
    
    Modified: stable/9/sys/sys/un.h
    ==============================================================================
    --- stable/9/sys/sys/un.h	Fri Mar  1 02:59:56 2013	(r247524)
    +++ stable/9/sys/sys/un.h	Fri Mar  1 03:04:57 2013	(r247525)
    @@ -53,9 +53,12 @@ struct sockaddr_un {
     #if __BSD_VISIBLE
     
     /* Socket options. */
    -#define	LOCAL_PEERCRED		0x001	/* retrieve peer credentials */
    -#define	LOCAL_CREDS		0x002	/* pass credentials to receiver */
    -#define	LOCAL_CONNWAIT		0x004	/* connects block until accepted */
    +#define	LOCAL_PEERCRED		1	/* retrieve peer credentials */
    +#define	LOCAL_CREDS		2	/* pass credentials to receiver */
    +#define	LOCAL_CONNWAIT		4	/* connects block until accepted */
    +
    +/* Start of reserved space for third-party socket options. */
    +#define	LOCAL_VENDOR		SO_VENDOR
     
     #ifndef _KERNEL
     
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 03:05:09 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 60EC57BF;
     Fri,  1 Mar 2013 03:05:09 +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 53B91213;
     Fri,  1 Mar 2013 03:05:09 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r213597Z061350;
     Fri, 1 Mar 2013 03:05:09 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21358Dm061345;
     Fri, 1 Mar 2013 03:05:08 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303010305.r21358Dm061345@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 03:05:08 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247526 - in stable/8/sys: netinet sys
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 03:05:09 -0000
    
    Author: jhb
    Date: Fri Mar  1 03:05:08 2013
    New Revision: 247526
    URL: http://svnweb.freebsd.org/changeset/base/247526
    
    Log:
      MFC 245823,245824,246210
      - Use decimal values for UDP, TCP, and UNIX domain socket options rather
        than hex to avoid implying that these constants should be treated as bit
        masks.
      - Add placeholder constants to reserve a portion of the socket option
        name space for use by downstream vendors to add custom options.
    
    Modified:
      stable/8/sys/netinet/tcp.h
      stable/8/sys/netinet/udp.h
      stable/8/sys/sys/socket.h
      stable/8/sys/sys/un.h
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/netinet/   (props changed)
      stable/8/sys/sys/   (props changed)
    
    Modified: stable/8/sys/netinet/tcp.h
    ==============================================================================
    --- stable/8/sys/netinet/tcp.h	Fri Mar  1 03:04:57 2013	(r247525)
    +++ stable/8/sys/netinet/tcp.h	Fri Mar  1 03:05:08 2013	(r247526)
    @@ -140,16 +140,21 @@ struct tcphdr {
     #endif /* __BSD_VISIBLE */
     
     /*
    - * User-settable options (used with setsockopt).
    + * User-settable options (used with setsockopt).  These are discrete
    + * values and are not masked together.  Some values appear to be
    + * bitmasks for historical reasons.
      */
    -#define	TCP_NODELAY	0x01	/* don't delay send to coalesce packets */
    +#define	TCP_NODELAY	1	/* don't delay send to coalesce packets */
     #if __BSD_VISIBLE
    -#define	TCP_MAXSEG	0x02	/* set maximum segment size */
    -#define TCP_NOPUSH	0x04	/* don't push last block of write */
    -#define TCP_NOOPT	0x08	/* don't use TCP options */
    -#define TCP_MD5SIG	0x10	/* use MD5 digests (RFC2385) */
    -#define	TCP_INFO	0x20	/* retrieve tcp_info structure */
    -#define	TCP_CONGESTION	0x40	/* get/set congestion control algorithm */
    +#define	TCP_MAXSEG	2	/* set maximum segment size */
    +#define TCP_NOPUSH	4	/* don't push last block of write */
    +#define TCP_NOOPT	8	/* don't use TCP options */
    +#define TCP_MD5SIG	16	/* use MD5 digests (RFC2385) */
    +#define	TCP_INFO	32	/* retrieve tcp_info structure */
    +#define	TCP_CONGESTION	64	/* get/set congestion control algorithm */
    +
    +/* Start of reserved space for third-party user-settable options. */
    +#define	TCP_VENDOR	SO_VENDOR
     
     #define	TCP_CA_NAME_MAX	16	/* max congestion control name length */
     
    
    Modified: stable/8/sys/netinet/udp.h
    ==============================================================================
    --- stable/8/sys/netinet/udp.h	Fri Mar  1 03:04:57 2013	(r247525)
    +++ stable/8/sys/netinet/udp.h	Fri Mar  1 03:05:08 2013	(r247526)
    @@ -48,8 +48,10 @@ struct udphdr {
     /* 
      * User-settable options (used with setsockopt).
      */
    -#define	UDP_ENCAP			0x01
    +#define	UDP_ENCAP			1
     
    +/* Start of reserved space for third-party user-settable options. */
    +#define	UDP_VENDOR			SO_VENDOR
     
     /*
      * UDP Encapsulation of IPsec Packets options.
    
    Modified: stable/8/sys/sys/socket.h
    ==============================================================================
    --- stable/8/sys/sys/socket.h	Fri Mar  1 03:04:57 2013	(r247525)
    +++ stable/8/sys/sys/socket.h	Fri Mar  1 03:05:08 2013	(r247526)
    @@ -144,6 +144,15 @@ typedef	__uid_t		uid_t;
     #endif
     
     /*
    + * Space reserved for new socket options added by third-party vendors.
    + * This range applies to all socket option levels.  New socket options
    + * in FreeBSD should always use an option value less than SO_VENDOR.
    + */
    +#if __BSD_VISIBLE
    +#define	SO_VENDOR	0x80000000
    +#endif
    +
    +/*
      * Structure used for manipulating linger option.
      */
     struct linger {
    
    Modified: stable/8/sys/sys/un.h
    ==============================================================================
    --- stable/8/sys/sys/un.h	Fri Mar  1 03:04:57 2013	(r247525)
    +++ stable/8/sys/sys/un.h	Fri Mar  1 03:05:08 2013	(r247526)
    @@ -53,9 +53,12 @@ struct sockaddr_un {
     #if __BSD_VISIBLE
     
     /* Socket options. */
    -#define	LOCAL_PEERCRED		0x001	/* retrieve peer credentials */
    -#define	LOCAL_CREDS		0x002	/* pass credentials to receiver */
    -#define	LOCAL_CONNWAIT		0x004	/* connects block until accepted */
    +#define	LOCAL_PEERCRED		1	/* retrieve peer credentials */
    +#define	LOCAL_CREDS		2	/* pass credentials to receiver */
    +#define	LOCAL_CONNWAIT		4	/* connects block until accepted */
    +
    +/* Start of reserved space for third-party socket options. */
    +#define	LOCAL_VENDOR		SO_VENDOR
     
     #ifndef _KERNEL
     
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 03:25:43 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id DB0C8B12;
     Fri,  1 Mar 2013 03:25:43 +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 B80962C0;
     Fri,  1 Mar 2013 03:25:43 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r213Ph6Q067559;
     Fri, 1 Mar 2013 03:25:43 GMT (envelope-from brooks@svn.freebsd.org)
    Received: (from brooks@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r213PhXh067558;
     Fri, 1 Mar 2013 03:25:43 GMT (envelope-from brooks@svn.freebsd.org)
    Message-Id: <201303010325.r213PhXh067558@svn.freebsd.org>
    From: Brooks Davis 
    Date: Fri, 1 Mar 2013 03:25:43 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247527 - head/share/mk
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 03:25:43 -0000
    
    Author: brooks
    Date: Fri Mar  1 03:25:43 2013
    New Revision: 247527
    URL: http://svnweb.freebsd.org/changeset/base/247527
    
    Log:
      Provide slightly more helpful feedback when we can't figure out what
      compiler the user is using.
      
      PR:		misc/173914
    
    Modified:
      head/share/mk/bsd.compiler.mk
    
    Modified: head/share/mk/bsd.compiler.mk
    ==============================================================================
    --- head/share/mk/bsd.compiler.mk	Fri Mar  1 03:05:08 2013	(r247526)
    +++ head/share/mk/bsd.compiler.mk	Fri Mar  1 03:25:43 2013	(r247527)
    @@ -14,7 +14,7 @@ COMPILER_TYPE:=	gcc
     .  elif ${_COMPILER_VERSION:Mclang}
     COMPILER_TYPE:=	clang
     .  else
    -.error Unable to determine compiler type for ${CC}
    +.error Unable to determine compiler type for ${CC}.  Consider setting COMPILER_TYPE.
     .  endif
     .  undef _COMPILER_VERSION
     . endif
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 04:16:04 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id AEECF31A;
     Fri,  1 Mar 2013 04:16:04 +0000 (UTC)
     (envelope-from brde@optusnet.com.au)
    Received: from fallbackmx07.syd.optusnet.com.au
     (fallbackmx07.syd.optusnet.com.au [211.29.132.9])
     by mx1.freebsd.org (Postfix) with ESMTP id E05326A3;
     Fri,  1 Mar 2013 04:16:03 +0000 (UTC)
    Received: from mail28.syd.optusnet.com.au (mail28.syd.optusnet.com.au
     [211.29.133.169])
     by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
     r214FvXH023251; Fri, 1 Mar 2013 15:15:57 +1100
    Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au
     (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106])
     by mail28.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r214Fh0f022953
     (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
     Fri, 1 Mar 2013 15:15:44 +1100
    Date: Fri, 1 Mar 2013 15:15:43 +1100 (EST)
    From: Bruce Evans 
    X-X-Sender: bde@besplex.bde.org
    To: Alexander Motin 
    Subject: Re: svn commit: r247460 - head/sys/dev/acpica
    In-Reply-To: <512F95DC.1040005@FreeBSD.org>
    Message-ID: <20130301151538.G959@besplex.bde.org>
    References: <201302281127.r1SBR2VE068276@svn.freebsd.org>
     <20130228162522.GA41693@FreeBSD.org> <512F95DC.1040005@FreeBSD.org>
    MIME-Version: 1.0
    Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
    X-Optus-CM-Score: 0
    X-Optus-CM-Analysis: v=2.0 cv=bNdOu4CZ c=1 sm=1 a=f5xiIF61AdoA:10
     a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=7E17uGdFteIA:10
     a=6I5d2MoRAAAA:8 a=ba2XAj07wnl6R86JeWQA:9 a=CjuIK1q_8ugA:10
     a=TEtd8y5WR3g2ypngnwZWYw==:117
    Cc: Davide Italiano , svn-src-head@freebsd.org,
     Alexey Dokuchaev , src-committers@freebsd.org,
     svn-src-all@freebsd.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 04:16:04 -0000
    
    On Thu, 28 Feb 2013, Alexander Motin wrote:
    
    > On 28.02.2013 18:25, Alexey Dokuchaev wrote:
    >> On Thu, Feb 28, 2013 at 11:27:02AM +0000, Davide Italiano wrote:
    >>> New Revision: 247460
    >>> URL: http://svnweb.freebsd.org/changeset/base/247460
    >>>
    >>> Log:
    >>>   MFcalloutng (r247427 by mav):
    >>>   We don't need any precision here. Let it be fast and dirty shift then
    >>>   slow and excessively precise 64-bit division.
    >>>
    >>> -    if (sbt >= 0 && us > sbt / SBT_1US)
    >>> -	us = sbt / SBT_1US;
    >>> +    if (sbt >= 0 && us > (sbt >> 12))
    >>> +	us = (sbt >> 12);
    >>
    >> Does this really buy us anything?  Modern compilers should be smart enough to
    >> generate correct code.  Do you have evidence that this is not the case here?
    >> Not to mention that it obfuscates the code by using some magic constant.
    >
    > SBT_1US is 4294 (0x10c6). The best that compiler may do is replace
    > division with multiplication. In fact, Clang even does this on amd64.
    > But on i386 it calls __divdi3(), doing 64bit division in software. Shift
    > is definitely cheaper and 5% precision is fine here.
    
    I missed the additional magic in my previous reply.
    
    But you should write the sloppy scaling as division by a sloppy factor:
    
    #define	SSBT_1us	4096		/* power of 2 closest to SSBT_1US */
    
          if (sbt >= 0 && us > (uint64_t)sbt / SSBT_1us)
      	us = (uint64_t)sbt / SSBT_1us;
    
    or provide and use conversion functions that do sloppy and non-sloppy
    scaling.  I don't like having conversion functions for every possible
    conversion, but this one is much more magic than for example
    TIMEVAL_TO_TIMESPEC().  The casts to (uint64_t) are to help the compiler
    understand that the sign bit is not there.
    
    The need for magic scaling shows that the binary representation given
    by sbintime_t isn't very good.  Mose clients want natural units of
    microseconds or nanoseconds and need scale factors like
    (4294.967206 / 4096) to adjust (4294 is already sloppy).  The binary
    representation allows some minor internal optimizations and APIs are
    made unnatural to avoid double conversions.
    
    While here, I will point out style bugs introduced in the above:
    - parentheses in "us = (sbt >> 12);" are redundant and reduce clarity,
        like parentheses in "us = (sbt / N);" would have, since the shift
        operator binds much more tightly than the assignment operator.
    - parentheses in "us > (sbt >> 12);" are redundant but may increase
        clarity, since the shift operator doesn't bind much more tightly
        than the '<' comparison operator.  This one is hard to remember, but
        looking it up confirms that the precedence is not broken as designed
        in this case, but that the precedence is only 1 level higher for the
        shift operator.  The main broken as designed cases are the shift
        operator being 1 level lower than addition and subtraction, and
        bitwise operators being many more levels lower than other aritmetic
        operators and even below all comparision operators.
    
    Bruce
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 07:39:15 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id C3A15C81;
     Fri,  1 Mar 2013 07:39:15 +0000 (UTC) (envelope-from ru@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 ABDC2DA4;
     Fri,  1 Mar 2013 07:39:15 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r217dFkP044413;
     Fri, 1 Mar 2013 07:39:15 GMT (envelope-from ru@svn.freebsd.org)
    Received: (from ru@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r217dElT044409;
     Fri, 1 Mar 2013 07:39:14 GMT (envelope-from ru@svn.freebsd.org)
    Message-Id: <201303010739.r217dElT044409@svn.freebsd.org>
    From: Ruslan Ermilov 
    Date: Fri, 1 Mar 2013 07:39:14 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247534 - head/lib/libutil
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 07:39:15 -0000
    
    Author: ru
    Date: Fri Mar  1 07:39:14 2013
    New Revision: 247534
    URL: http://svnweb.freebsd.org/changeset/base/247534
    
    Log:
      Fixed documented prototype of kinfo_getproc(3).
    
    Modified:
      head/lib/libutil/kinfo_getproc.3
    
    Modified: head/lib/libutil/kinfo_getproc.3
    ==============================================================================
    --- head/lib/libutil/kinfo_getproc.3	Fri Mar  1 07:01:24 2013	(r247533)
    +++ head/lib/libutil/kinfo_getproc.3	Fri Mar  1 07:39:14 2013	(r247534)
    @@ -25,7 +25,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd February 25, 2012
    +.Dd March 1, 2013
     .Dt KINFO_GETPROC 3
     .Os
     .Sh NAME
    @@ -37,7 +37,7 @@
     .In sys/types.h
     .In libutil.h
     .Ft struct kinfo_proc *
    -.Fn kinfo_getproc "pid_t pid" "int *cntp"
    +.Fn kinfo_getproc "pid_t pid"
     .Sh DESCRIPTION
     This function is used for obtaining process information from the kernel.
     .Pp
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 08:30:32 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 1AD07B76;
     Fri,  1 Mar 2013 08:30:32 +0000 (UTC) (envelope-from alc@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 08100FD3;
     Fri,  1 Mar 2013 08:30:32 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r218UV1Y060021;
     Fri, 1 Mar 2013 08:30:31 GMT (envelope-from alc@svn.freebsd.org)
    Received: (from alc@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r218UVB8060020;
     Fri, 1 Mar 2013 08:30:31 GMT (envelope-from alc@svn.freebsd.org)
    Message-Id: <201303010830.r218UVB8060020@svn.freebsd.org>
    From: Alan Cox 
    Date: Fri, 1 Mar 2013 08:30:31 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247535 - head/sys/arm/include
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 08:30:32 -0000
    
    Author: alc
    Date: Fri Mar  1 08:30:31 2013
    New Revision: 247535
    URL: http://svnweb.freebsd.org/changeset/base/247535
    
    Log:
      Copy the definition of VM_MAX_AUTOTUNE_MAXUSERS from i386.  (See r242847.)
      
      Tested by:	andrew
    
    Modified:
      head/sys/arm/include/vmparam.h
    
    Modified: head/sys/arm/include/vmparam.h
    ==============================================================================
    --- head/sys/arm/include/vmparam.h	Fri Mar  1 07:39:14 2013	(r247534)
    +++ head/sys/arm/include/vmparam.h	Fri Mar  1 08:30:31 2013	(r247535)
    @@ -178,4 +178,8 @@ extern vm_offset_t vm_max_kernel_address
     
     #define	ZERO_REGION_SIZE	(64 * 1024)	/* 64KB */
     
    +#ifndef VM_MAX_AUTOTUNE_MAXUSERS
    +#define	VM_MAX_AUTOTUNE_MAXUSERS	384
    +#endif
    +
     #endif	/* _MACHINE_VMPARAM_H_ */
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 09:39:31 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 1857A40B;
     Fri,  1 Mar 2013 09:39:31 +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 E2F2C255;
     Fri,  1 Mar 2013 09:39:30 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r219dUQZ080668;
     Fri, 1 Mar 2013 09:39:30 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r219dUKm080666;
     Fri, 1 Mar 2013 09:39:30 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010939.r219dUKm080666@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 09:39:30 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247537 - in stable/8: . contrib/bsnmp/snmpd contrib/xz
     gnu/usr.bin share/misc usr.bin/chpass usr.bin/su
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 09:39:31 -0000
    
    Author: des
    Date: Fri Mar  1 09:39:29 2013
    New Revision: 247537
    URL: http://svnweb.freebsd.org/changeset/base/247537
    
    Log:
      Fix a few instances of broken mergeinfo
    
    Modified:
    Directory Properties:
      stable/8/   (props changed)
      stable/8/COPYRIGHT   (props changed)
      stable/8/LOCKS   (props changed)
      stable/8/MAINTAINERS   (props changed)
      stable/8/Makefile   (props changed)
      stable/8/Makefile.inc1   (props changed)
      stable/8/README   (props changed)
      stable/8/bin/   (props changed)
      stable/8/bin/cat/   (props changed)
      stable/8/bin/chio/   (props changed)
      stable/8/bin/chmod/   (props changed)
      stable/8/bin/cp/   (props changed)
      stable/8/bin/date/   (props changed)
      stable/8/bin/df/   (props changed)
      stable/8/bin/echo/   (props changed)
      stable/8/bin/ed/   (props changed)
      stable/8/bin/expr/   (props changed)
      stable/8/bin/getfacl/   (props changed)
      stable/8/bin/kenv/   (props changed)
      stable/8/bin/kill/   (props changed)
      stable/8/bin/ln/   (props changed)
      stable/8/bin/ls/   (props changed)
      stable/8/bin/mv/   (props changed)
      stable/8/bin/pax/   (props changed)
      stable/8/bin/pkill/   (props changed)
      stable/8/bin/ps/   (props changed)
      stable/8/bin/pwait/   (props changed)
      stable/8/bin/rm/   (props changed)
      stable/8/bin/setfacl/   (props changed)
      stable/8/bin/sleep/   (props changed)
      stable/8/bin/stty/   (props changed)
      stable/8/bin/test/   (props changed)
      stable/8/bin/uuidgen/   (props changed)
      stable/8/cddl/   (props changed)
      stable/8/cddl/compat/opensolaris/   (props changed)
      stable/8/cddl/contrib/dtracetoolkit/   (props changed)
      stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/   (props changed)
      stable/8/cddl/contrib/opensolaris/cmd/zfs/   (props changed)
      stable/8/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
      stable/8/cddl/lib/   (props changed)
      stable/8/cddl/lib/libzpool/   (props changed)
      stable/8/cddl/sbin/   (props changed)
      stable/8/cddl/usr.bin/   (props changed)
      stable/8/cddl/usr.sbin/   (props changed)
      stable/8/contrib/bsnmp/   (props changed)
      stable/8/contrib/bsnmp/snmpd/bsnmpd.1   (props changed)
      stable/8/contrib/expat/   (props changed)
      stable/8/contrib/gcc/   (props changed)
      stable/8/contrib/groff/   (props changed)
      stable/8/contrib/one-true-awk/   (props changed)
      stable/8/contrib/pf/   (props changed)
      stable/8/contrib/tcp_wrappers/   (props changed)
      stable/8/contrib/telnet/   (props changed)
      stable/8/contrib/xz/   (props changed)
      stable/8/contrib/xz/AUTHORS   (props changed)
      stable/8/contrib/xz/ChangeLog   (props changed)
      stable/8/contrib/xz/README   (props changed)
      stable/8/contrib/xz/THANKS   (props changed)
      stable/8/contrib/xz/po/   (props changed)
      stable/8/contrib/xz/src/   (props changed)
      stable/8/crypto/   (props changed)
      stable/8/crypto/heimdal/   (props changed)
      stable/8/games/   (props changed)
      stable/8/games/bcd/   (props changed)
      stable/8/games/caesar/   (props changed)
      stable/8/games/factor/   (props changed)
      stable/8/games/fortune/   (props changed)
      stable/8/games/grdc/   (props changed)
      stable/8/games/pom/   (props changed)
      stable/8/games/random/   (props changed)
      stable/8/gnu/   (props changed)
      stable/8/gnu/lib/csu/   (props changed)
      stable/8/gnu/lib/libgcc/   (props changed)
      stable/8/gnu/lib/libstdc++/   (props changed)
      stable/8/gnu/usr.bin/   (props changed)
      stable/8/gnu/usr.bin/Makefile   (props changed)
      stable/8/gnu/usr.bin/cc/include/   (props changed)
      stable/8/gnu/usr.bin/dialog/   (props changed)
      stable/8/gnu/usr.bin/gdb/   (props changed)
      stable/8/gnu/usr.bin/gdb/arch/sparc64/   (props changed)
      stable/8/gnu/usr.bin/gdb/kgdb/   (props changed)
      stable/8/gnu/usr.bin/gperf/   (props changed)
      stable/8/gnu/usr.bin/groff/   (props changed)
      stable/8/gnu/usr.bin/send-pr/   (props changed)
      stable/8/kerberos5/   (props changed)
      stable/8/kerberos5/usr.bin/kdestroy/   (props changed)
      stable/8/kerberos5/usr.bin/kpasswd/   (props changed)
      stable/8/lib/csu/   (props changed)
      stable/8/lib/libbluetooth/   (props changed)
      stable/8/lib/libc_r/   (props changed)
      stable/8/lib/libelf/   (props changed)
      stable/8/lib/libexpat/   (props changed)
      stable/8/lib/libfetch/   (props changed)
      stable/8/lib/libgpib/   (props changed)
      stable/8/lib/libgssapi/   (props changed)
      stable/8/lib/libjail/   (props changed)
      stable/8/lib/libkse/   (props changed)
      stable/8/lib/liblzma/   (props changed)
      stable/8/lib/libpam/   (props changed)
      stable/8/lib/libpmc/   (props changed)
      stable/8/lib/libradius/   (props changed)
      stable/8/lib/librpcsec_gss/   (props changed)
      stable/8/lib/libsm/   (props changed)
      stable/8/lib/libstand/   (props changed)
      stable/8/lib/libtacplus/   (props changed)
      stable/8/lib/libufs/   (props changed)
      stable/8/lib/libusbhid/   (props changed)
      stable/8/lib/libz/   (props changed)
      stable/8/lib/msun/   (props changed)
      stable/8/libexec/   (props changed)
      stable/8/libexec/atrun/   (props changed)
      stable/8/libexec/comsat/   (props changed)
      stable/8/libexec/ftpd/   (props changed)
      stable/8/libexec/rshd/   (props changed)
      stable/8/libexec/save-entropy/   (props changed)
      stable/8/libexec/tftpd/   (props changed)
      stable/8/libexec/ypxfr/   (props changed)
      stable/8/rescue/   (props changed)
      stable/8/rescue/rescue/   (props changed)
      stable/8/secure/   (props changed)
      stable/8/secure/lib/libcrypto/   (props changed)
      stable/8/secure/lib/libssh/   (props changed)
      stable/8/secure/lib/libssl/   (props changed)
      stable/8/secure/usr.bin/bdes/   (props changed)
      stable/8/secure/usr.bin/openssl/   (props changed)
      stable/8/secure/usr.bin/ssh/   (props changed)
      stable/8/share/   (props changed)
      stable/8/share/dict/   (props changed)
      stable/8/share/doc/   (props changed)
      stable/8/share/doc/bind9/   (props changed)
      stable/8/share/doc/papers/devfs/   (props changed)
      stable/8/share/doc/papers/jail/   (props changed)
      stable/8/share/doc/smm/01.setup/   (props changed)
      stable/8/share/examples/   (props changed)
      stable/8/share/examples/csh/   (props changed)
      stable/8/share/examples/cvsup/   (props changed)
      stable/8/share/man/   (props changed)
      stable/8/share/man/man1/   (props changed)
      stable/8/share/man/man3/   (props changed)
      stable/8/share/man/man8/   (props changed)
      stable/8/share/misc/   (props changed)
      stable/8/share/misc/bsd-family-tree   (props changed)
      stable/8/share/mk/   (props changed)
      stable/8/share/skel/   (props changed)
      stable/8/share/syscons/   (props changed)
      stable/8/share/syscons/keymaps/   (props changed)
      stable/8/share/termcap/   (props changed)
      stable/8/tools/   (props changed)
      stable/8/tools/build/mk/   (props changed)
      stable/8/tools/build/options/   (props changed)
      stable/8/tools/debugscripts/   (props changed)
      stable/8/tools/diag/   (props changed)
      stable/8/tools/kerneldoc/   (props changed)
      stable/8/tools/kerneldoc/subsys/   (props changed)
      stable/8/tools/regression/acct/   (props changed)
      stable/8/tools/regression/acltools/   (props changed)
      stable/8/tools/regression/aio/aiotest/   (props changed)
      stable/8/tools/regression/bin/   (props changed)
      stable/8/tools/regression/bin/date/   (props changed)
      stable/8/tools/regression/bin/test/   (props changed)
      stable/8/tools/regression/doat/   (props changed)
      stable/8/tools/regression/fifo/   (props changed)
      stable/8/tools/regression/geom/   (props changed)
      stable/8/tools/regression/lib/libc/   (props changed)
      stable/8/tools/regression/mqueue/mqtest1/   (props changed)
      stable/8/tools/regression/mqueue/mqtest2/   (props changed)
      stable/8/tools/regression/mqueue/mqtest3/   (props changed)
      stable/8/tools/regression/mqueue/mqtest4/   (props changed)
      stable/8/tools/regression/mqueue/mqtest5/   (props changed)
      stable/8/tools/regression/netinet/   (props changed)
      stable/8/tools/regression/pipe/   (props changed)
      stable/8/tools/regression/posixsem/   (props changed)
      stable/8/tools/regression/sockets/   (props changed)
      stable/8/tools/regression/sockets/unix_gc/   (props changed)
      stable/8/tools/regression/usr.bin/   (props changed)
      stable/8/tools/regression/usr.bin/pkill/   (props changed)
      stable/8/tools/regression/usr.bin/sed/   (props changed)
      stable/8/tools/regression/usr.bin/tr/   (props changed)
      stable/8/tools/test/   (props changed)
      stable/8/tools/test/malloc/   (props changed)
      stable/8/tools/tools/   (props changed)
      stable/8/tools/tools/aac/   (props changed)
      stable/8/tools/tools/ath/   (props changed)
      stable/8/tools/tools/cfi/   (props changed)
      stable/8/tools/tools/ether_reflect/   (props changed)
      stable/8/tools/tools/iwi/   (props changed)
      stable/8/tools/tools/mctest/   (props changed)
      stable/8/tools/tools/nanobsd/   (props changed)
      stable/8/tools/tools/netrate/   (props changed)
      stable/8/tools/tools/netrate/netblast/   (props changed)
      stable/8/tools/tools/netrate/netsend/   (props changed)
      stable/8/tools/tools/netrate/tcpp/   (props changed)
      stable/8/tools/tools/sysdoc/   (props changed)
      stable/8/tools/tools/umastat/   (props changed)
      stable/8/usr.bin/   (props changed)
      stable/8/usr.bin/apply/   (props changed)
      stable/8/usr.bin/ar/   (props changed)
      stable/8/usr.bin/awk/   (props changed)
      stable/8/usr.bin/biff/   (props changed)
      stable/8/usr.bin/brandelf/   (props changed)
      stable/8/usr.bin/bsdiff/   (props changed)
      stable/8/usr.bin/c89/   (props changed)
      stable/8/usr.bin/c99/   (props changed)
      stable/8/usr.bin/catman/   (props changed)
      stable/8/usr.bin/checknr/   (props changed)
      stable/8/usr.bin/chpass/   (props changed)
      stable/8/usr.bin/chpass/Makefile   (props changed)
      stable/8/usr.bin/column/   (props changed)
      stable/8/usr.bin/comm/   (props changed)
      stable/8/usr.bin/compress/   (props changed)
      stable/8/usr.bin/cpio/   (props changed)
      stable/8/usr.bin/cpuset/   (props changed)
      stable/8/usr.bin/cut/   (props changed)
      stable/8/usr.bin/du/   (props changed)
      stable/8/usr.bin/ee/   (props changed)
      stable/8/usr.bin/enigma/   (props changed)
      stable/8/usr.bin/find/   (props changed)
      stable/8/usr.bin/finger/   (props changed)
      stable/8/usr.bin/fold/   (props changed)
      stable/8/usr.bin/gcore/   (props changed)
      stable/8/usr.bin/getopt/   (props changed)
      stable/8/usr.bin/gprof/   (props changed)
      stable/8/usr.bin/gzip/   (props changed)
      stable/8/usr.bin/hexdump/   (props changed)
      stable/8/usr.bin/indent/   (props changed)
      stable/8/usr.bin/ipcrm/   (props changed)
      stable/8/usr.bin/ipcs/   (props changed)
      stable/8/usr.bin/join/   (props changed)
      stable/8/usr.bin/jot/   (props changed)
      stable/8/usr.bin/kdump/   (props changed)
      stable/8/usr.bin/killall/   (props changed)
      stable/8/usr.bin/ktrace/   (props changed)
      stable/8/usr.bin/lastcomm/   (props changed)
      stable/8/usr.bin/ldd/   (props changed)
      stable/8/usr.bin/less/   (props changed)
      stable/8/usr.bin/lex/   (props changed)
      stable/8/usr.bin/limits/   (props changed)
      stable/8/usr.bin/locale/   (props changed)
      stable/8/usr.bin/locate/   (props changed)
      stable/8/usr.bin/lock/   (props changed)
      stable/8/usr.bin/lockf/   (props changed)
      stable/8/usr.bin/logger/   (props changed)
      stable/8/usr.bin/m4/   (props changed)
      stable/8/usr.bin/mail/   (props changed)
      stable/8/usr.bin/make/   (props changed)
      stable/8/usr.bin/makewhatis/   (props changed)
      stable/8/usr.bin/minigzip/   (props changed)
      stable/8/usr.bin/mktemp/   (props changed)
      stable/8/usr.bin/msgs/   (props changed)
      stable/8/usr.bin/ncal/   (props changed)
      stable/8/usr.bin/ncplist/   (props changed)
      stable/8/usr.bin/ncplogin/   (props changed)
      stable/8/usr.bin/newgrp/   (props changed)
      stable/8/usr.bin/nfsstat/   (props changed)
      stable/8/usr.bin/nsupdate/   (props changed)
      stable/8/usr.bin/pathchk/   (props changed)
      stable/8/usr.bin/perror/   (props changed)
      stable/8/usr.bin/pr/   (props changed)
      stable/8/usr.bin/printf/   (props changed)
      stable/8/usr.bin/rlogin/   (props changed)
      stable/8/usr.bin/rpcgen/   (props changed)
      stable/8/usr.bin/rpcinfo/   (props changed)
      stable/8/usr.bin/rs/   (props changed)
      stable/8/usr.bin/ruptime/   (props changed)
      stable/8/usr.bin/script/   (props changed)
      stable/8/usr.bin/sed/   (props changed)
      stable/8/usr.bin/showmount/   (props changed)
      stable/8/usr.bin/sockstat/   (props changed)
      stable/8/usr.bin/split/   (props changed)
      stable/8/usr.bin/stat/   (props changed)
      stable/8/usr.bin/stdbuf/   (props changed)
      stable/8/usr.bin/su/   (props changed)
      stable/8/usr.bin/su/Makefile   (props changed)
      stable/8/usr.bin/su/su.1   (props changed)
      stable/8/usr.bin/su/su.c   (props changed)
      stable/8/usr.bin/systat/   (props changed)
      stable/8/usr.bin/tail/   (props changed)
      stable/8/usr.bin/tar/   (props changed)
      stable/8/usr.bin/tftp/   (props changed)
      stable/8/usr.bin/tip/   (props changed)
      stable/8/usr.bin/top/   (props changed)
      stable/8/usr.bin/touch/   (props changed)
      stable/8/usr.bin/tr/   (props changed)
      stable/8/usr.bin/truss/   (props changed)
      stable/8/usr.bin/uname/   (props changed)
      stable/8/usr.bin/unifdef/   (props changed)
      stable/8/usr.bin/uniq/   (props changed)
      stable/8/usr.bin/unzip/   (props changed)
      stable/8/usr.bin/usbhidaction/   (props changed)
      stable/8/usr.bin/usbhidctl/   (props changed)
      stable/8/usr.bin/uudecode/   (props changed)
      stable/8/usr.bin/uuencode/   (props changed)
      stable/8/usr.bin/vmstat/   (props changed)
      stable/8/usr.bin/wall/   (props changed)
      stable/8/usr.bin/who/   (props changed)
      stable/8/usr.bin/xargs/   (props changed)
      stable/8/usr.bin/xinstall/   (props changed)
      stable/8/usr.bin/xlint/   (props changed)
      stable/8/usr.bin/xz/   (props changed)
      stable/8/usr.bin/yacc/   (props changed)
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 09:39:54 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 1FB87577;
     Fri,  1 Mar 2013 09:39:54 +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 EDC65259;
     Fri,  1 Mar 2013 09:39:53 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r219drfa080761;
     Fri, 1 Mar 2013 09:39:53 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r219dr0C080759;
     Fri, 1 Mar 2013 09:39:53 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010939.r219dr0C080759@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 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: r247538 - stable/9/usr.bin/du
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 09:39:54 -0000
    
    Author: des
    Date: Fri Mar  1 09:39:53 2013
    New Revision: 247538
    URL: http://svnweb.freebsd.org/changeset/base/247538
    
    Log:
      MFH (r238602): add -g (gigabyte) flag
    
    Modified:
      stable/9/usr.bin/du/du.1
      stable/9/usr.bin/du/du.c
    Directory Properties:
      stable/9/usr.bin/du/   (props changed)
    
    Modified: stable/9/usr.bin/du/du.1
    ==============================================================================
    --- stable/9/usr.bin/du/du.1	Fri Mar  1 09:39:29 2013	(r247537)
    +++ stable/9/usr.bin/du/du.1	Fri Mar  1 09:39:53 2013	(r247538)
    @@ -28,7 +28,7 @@
     .\"	@(#)du.1	8.2 (Berkeley) 4/1/94
     .\" $FreeBSD$
     .\"
    -.Dd December 17, 2011
    +.Dd July 18, 2012
     .Dt DU 1
     .Os
     .Sh NAME
    @@ -38,7 +38,7 @@
     .Nm
     .Op Fl Aclnx
     .Op Fl H | L | P
    -.Op Fl h | k | m
    +.Op Fl g | h | k | m
     .Op Fl a | s | d Ar depth
     .Op Fl B Ar blocksize
     .Op Fl I Ar mask
    @@ -63,9 +63,9 @@ Calculate block counts in
     .Ar blocksize
     byte blocks.
     This is different from the
    -.Fl h, k
    +.Fl h, k, m
     and
    -.Fl  m
    +.Fl  g
     options or setting
     .Ev BLOCKSIZE
     and gives an estimate of how much space the examined file hierarchy would
    @@ -95,13 +95,15 @@ Display a grand total.
     Display an entry for all files and directories
     .Ar depth
     directories deep.
    +.It Fl g
    +Display block counts in 1073741824-byte (1 GiB) blocks.
     .It Fl h
     .Dq Human-readable
     output.
     Use unit suffixes: Byte, Kilobyte, Megabyte,
     Gigabyte, Terabyte and Petabyte.
     .It Fl k
    -Display block counts in 1024-byte (1-Kbyte) blocks.
    +Display block counts in 1024-byte (1 kiB) blocks.
     .It Fl l
     If a file has multiple hard links, count its size multiple times.
     The default behavior of
    @@ -112,7 +114,7 @@ When the
     option is specified, the hard link checks are disabled, and these files
     are counted (and displayed) as many times as they are found.
     .It Fl m
    -Display block counts in 1048576-byte (1-Mbyte) blocks.
    +Display block counts in 1048576-byte (1 MiB) blocks.
     .It Fl n
     Ignore files and directories with user
     .Dq nodump
    
    Modified: stable/9/usr.bin/du/du.c
    ==============================================================================
    --- stable/9/usr.bin/du/du.c	Fri Mar  1 09:39:29 2013	(r247537)
    +++ stable/9/usr.bin/du/du.c	Fri Mar  1 09:39:53 2013	(r247538)
    @@ -110,7 +110,7 @@ main(int argc, char *argv[])
     	depth = INT_MAX;
     	SLIST_INIT(&ignores);
     
    -	while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrt:x")) != -1)
    +	while ((ch = getopt(argc, argv, "AB:HI:LPasd:cghklmnrt:x")) != -1)
     		switch (ch) {
     		case 'A':
     			Aflag = 1;
    @@ -157,6 +157,10 @@ main(int argc, char *argv[])
     		case 'c':
     			cflag = 1;
     			break;
    +		case 'g':
    +			hflag = 0;
    +			blocksize = 1073741824;
    +			break;
     		case 'h':
     			hflag = 1;
     			break;
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 09:40:03 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id D35536CF;
     Fri,  1 Mar 2013 09:40:03 +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 ADEE225D;
     Fri,  1 Mar 2013 09:40:03 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r219e3Cj080864;
     Fri, 1 Mar 2013 09:40:03 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r219e3TG080861;
     Fri, 1 Mar 2013 09:40:03 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010940.r219e3TG080861@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 09:40:03 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247539 - stable/8/usr.bin/du
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 09:40:03 -0000
    
    Author: des
    Date: Fri Mar  1 09:40:02 2013
    New Revision: 247539
    URL: http://svnweb.freebsd.org/changeset/base/247539
    
    Log:
      MFH (r238602): add -g (gigabyte) flag
    
    Modified:
      stable/8/usr.bin/du/du.1
      stable/8/usr.bin/du/du.c
    Directory Properties:
      stable/8/usr.bin/du/   (props changed)
    
    Modified: stable/8/usr.bin/du/du.1
    ==============================================================================
    --- stable/8/usr.bin/du/du.1	Fri Mar  1 09:39:53 2013	(r247538)
    +++ stable/8/usr.bin/du/du.1	Fri Mar  1 09:40:02 2013	(r247539)
    @@ -32,7 +32,7 @@
     .\"	@(#)du.1	8.2 (Berkeley) 4/1/94
     .\" $FreeBSD$
     .\"
    -.Dd December 17, 2011
    +.Dd July 18, 2012
     .Dt DU 1
     .Os
     .Sh NAME
    @@ -42,7 +42,7 @@
     .Nm
     .Op Fl Aclnx
     .Op Fl H | L | P
    -.Op Fl h | k | m
    +.Op Fl g | h | k | m
     .Op Fl a | s | d Ar depth
     .Op Fl B Ar blocksize
     .Op Fl I Ar mask
    @@ -67,9 +67,9 @@ Calculate block counts in
     .Ar blocksize
     byte blocks.
     This is different from the
    -.Fl h, k
    +.Fl h, k, m
     and
    -.Fl  m
    +.Fl  g
     options or setting
     .Ev BLOCKSIZE
     and gives an estimate of how much space the examined file hierarchy would
    @@ -99,13 +99,15 @@ Display a grand total.
     Display an entry for all files and directories
     .Ar depth
     directories deep.
    +.It Fl g
    +Display block counts in 1073741824-byte (1 GiB) blocks.
     .It Fl h
     .Dq Human-readable
     output.
     Use unit suffixes: Byte, Kilobyte, Megabyte,
     Gigabyte, Terabyte and Petabyte.
     .It Fl k
    -Display block counts in 1024-byte (1-Kbyte) blocks.
    +Display block counts in 1024-byte (1 kiB) blocks.
     .It Fl l
     If a file has multiple hard links, count its size multiple times.
     The default behavior of
    @@ -116,7 +118,7 @@ When the
     option is specified, the hard link checks are disabled, and these files
     are counted (and displayed) as many times as they are found.
     .It Fl m
    -Display block counts in 1048576-byte (1-Mbyte) blocks.
    +Display block counts in 1048576-byte (1 MiB) blocks.
     .It Fl n
     Ignore files and directories with user
     .Dq nodump
    
    Modified: stable/8/usr.bin/du/du.c
    ==============================================================================
    --- stable/8/usr.bin/du/du.c	Fri Mar  1 09:39:53 2013	(r247538)
    +++ stable/8/usr.bin/du/du.c	Fri Mar  1 09:40:02 2013	(r247539)
    @@ -114,7 +114,7 @@ main(int argc, char *argv[])
     	depth = INT_MAX;
     	SLIST_INIT(&ignores);
     
    -	while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrt:x")) != -1)
    +	while ((ch = getopt(argc, argv, "AB:HI:LPasd:cghklmnrt:x")) != -1)
     		switch (ch) {
     		case 'A':
     			Aflag = 1;
    @@ -161,6 +161,10 @@ main(int argc, char *argv[])
     		case 'c':
     			cflag = 1;
     			break;
    +		case 'g':
    +			hflag = 0;
    +			blocksize = 1073741824;
    +			break;
     		case 'h':
     			hflag = 1;
     			break;
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 09:43:00 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 2FEB1883;
     Fri,  1 Mar 2013 09:43:00 +0000 (UTC) (envelope-from mm@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 13FF6283;
     Fri,  1 Mar 2013 09:43:00 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r219h00U082822;
     Fri, 1 Mar 2013 09:43:00 GMT (envelope-from mm@svn.freebsd.org)
    Received: (from mm@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r219gxH0082811;
     Fri, 1 Mar 2013 09:42:59 GMT (envelope-from mm@svn.freebsd.org)
    Message-Id: <201303010942.r219gxH0082811@svn.freebsd.org>
    From: Martin Matuska 
    Date: Fri, 1 Mar 2013 09:42:59 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247540 - in head:
     cddl/contrib/opensolaris/lib/libzfs/common
     sys/cddl/contrib/opensolaris/common/zfs
     sys/cddl/contrib/opensolaris/uts/common/fs/zfs
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 09:43:00 -0000
    
    Author: mm
    Date: Fri Mar  1 09:42:58 2013
    New Revision: 247540
    URL: http://svnweb.freebsd.org/changeset/base/247540
    
    Log:
      Fix the zfs_ioctl compat layer to support zfs_cmd size change introduced
      in r247265 (ZFS deadman thread). Both new utilities now support the old
      kernel and new kernel properly detects old utilities.
      
      For future backwards compatibility, the vfs.zfs.version.ioctl read-only
      sysctl has been introduced. With this sysctl zfs utilities will be able
      to detect the ioctl interface version of the currently loaded zfs module.
      
      As a side effect, the zfs utilities between r247265 and this revision don't
      support the old kernel module. If you are using HEAD newer or equal than
      r247265, install the new kernel module (or whole kernel) first.
      
      MFC after:	10 days
    
    Modified:
      head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h
      head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c
      head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h
      head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
    
    Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h
    ==============================================================================
    --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h	Fri Mar  1 09:40:02 2013	(r247539)
    +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h	Fri Mar  1 09:42:58 2013	(r247540)
    @@ -24,6 +24,7 @@
      * Copyright (c) 2011 Pawel Jakub Dawidek .
      * All rights reserved.
      * Copyright (c) 2011 by Delphix. All rights reserved.
    + * Copyright (c) 2013 Martin Matuska . All rights reserved.
      */
     
     #ifndef	_LIBFS_IMPL_H
    @@ -216,6 +217,7 @@ extern void libzfs_fru_clear(libzfs_hand
     
     #ifndef sun
     static int zfs_kernel_version = 0;
    +static int zfs_ioctl_version = 0;
     
     /*
      * This is FreeBSD version of ioctl, because Solaris' ioctl() updates
    @@ -225,19 +227,34 @@ static int zfs_kernel_version = 0;
     static __inline int
     zcmd_ioctl(int fd, unsigned long cmd, zfs_cmd_t *zc)
     {
    -	size_t oldsize, zfs_kernel_version_size;
    +	size_t oldsize, zfs_kernel_version_size, zfs_ioctl_version_size;
     	int version, ret, cflag = ZFS_CMD_COMPAT_NONE;
     
    -	zfs_kernel_version_size = sizeof(zfs_kernel_version);
    -	if (zfs_kernel_version == 0) {
    -		sysctlbyname("vfs.zfs.version.spa", &zfs_kernel_version,
    -		    &zfs_kernel_version_size, NULL, 0);
    +	zfs_ioctl_version_size = sizeof(zfs_ioctl_version);
    +	if (zfs_ioctl_version == 0) {
    +		sysctlbyname("vfs.zfs.version.ioctl", &zfs_ioctl_version,
    +		    &zfs_ioctl_version_size, NULL, 0);
     	}
     
    -	if (zfs_kernel_version == SPA_VERSION_15 ||
    -	    zfs_kernel_version == SPA_VERSION_14 ||
    -	    zfs_kernel_version == SPA_VERSION_13)
    -		cflag = ZFS_CMD_COMPAT_V15;
    +	/*
    +	 * If vfs.zfs.version.ioctl is not defined, assume we have v28
    +	 * compatible binaries and use vfs.zfs.version.spa to test for v15
    +	 */
    +	if (zfs_ioctl_version < ZFS_IOCVER_DEADMAN) {
    +		cflag = ZFS_CMD_COMPAT_V28;
    +		zfs_kernel_version_size = sizeof(zfs_kernel_version);
    +
    +		if (zfs_kernel_version == 0) {
    +			sysctlbyname("vfs.zfs.version.spa",
    +			    &zfs_kernel_version,
    +			    &zfs_kernel_version_size, NULL, 0);
    +		}
    +
    +		if (zfs_kernel_version == SPA_VERSION_15 ||
    +		    zfs_kernel_version == SPA_VERSION_14 ||
    +		    zfs_kernel_version == SPA_VERSION_13)
    +			cflag = ZFS_CMD_COMPAT_V15;
    +	}
     
     	oldsize = zc->zc_nvlist_dst_size;
     	ret = zcmd_ioctl_compat(fd, cmd, zc, cflag);
    
    Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c
    ==============================================================================
    --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c	Fri Mar  1 09:40:02 2013	(r247539)
    +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c	Fri Mar  1 09:42:58 2013	(r247540)
    @@ -19,7 +19,7 @@
      * CDDL HEADER END
      */
     /*
    - * Copyright 2010 Martin Matuska . All rights reserved.
    + * Copyright 2013 Martin Matuska . All rights reserved.
      * Portions Copyright 2005, 2010, Oracle and/or its affiliates.
      * All rights reserved.
      * Use is subject to license terms.
    @@ -35,22 +35,100 @@
     #include 
     #include "zfs_ioctl_compat.h"
     
    +static int zfs_version_ioctl = ZFS_IOCVER_CURRENT;
    +SYSCTL_DECL(_vfs_zfs_version);
    +SYSCTL_INT(_vfs_zfs_version, OID_AUTO, ioctl, CTLFLAG_RD, &zfs_version_ioctl,
    +    0, "ZFS_IOCTL_VERSION");
    +
     /*
    - * FreeBSD zfs_cmd compatibility with v15 and older binaries
    + * FreeBSD zfs_cmd compatibility with older binaries
      * appropriately remap/extend the zfs_cmd_t structure
      */
     void
     zfs_cmd_compat_get(zfs_cmd_t *zc, caddr_t addr, const int cflag)
     {
     	zfs_cmd_v15_t *zc_c;
    +	zfs_cmd_v28_t *zc28_c;
     
    -	if (cflag == ZFS_CMD_COMPAT_V15) {
    +	switch (cflag) {
    +	case ZFS_CMD_COMPAT_V28:
    +		zc28_c = (void *)addr;
    +
    +		/* zc */
    +		strlcpy(zc->zc_name, zc28_c->zc_name, MAXPATHLEN);
    +		strlcpy(zc->zc_value, zc28_c->zc_value, MAXPATHLEN * 2);
    +		strlcpy(zc->zc_string, zc28_c->zc_string, MAXPATHLEN);
    +		strlcpy(zc->zc_top_ds, zc28_c->zc_top_ds, MAXPATHLEN);
    +		zc->zc_guid = zc28_c->zc_guid;
    +		zc->zc_nvlist_conf = zc28_c->zc_nvlist_conf;
    +		zc->zc_nvlist_conf_size = zc28_c->zc_nvlist_conf_size;
    +		zc->zc_nvlist_src = zc28_c->zc_nvlist_src;
    +		zc->zc_nvlist_src_size = zc28_c->zc_nvlist_src_size;
    +		zc->zc_nvlist_dst = zc28_c->zc_nvlist_dst;
    +		zc->zc_nvlist_dst_size = zc28_c->zc_nvlist_dst_size;
    +		zc->zc_cookie = zc28_c->zc_cookie;
    +		zc->zc_objset_type = zc28_c->zc_objset_type;
    +		zc->zc_perm_action = zc28_c->zc_perm_action;
    +		zc->zc_history = zc28_c->zc_history;
    +		zc->zc_history_len = zc28_c->zc_history_len;
    +		zc->zc_history_offset = zc28_c->zc_history_offset;
    +		zc->zc_obj = zc28_c->zc_obj;
    +		zc->zc_iflags = zc28_c->zc_iflags;
    +		zc->zc_share = zc28_c->zc_share;
    +		zc->zc_jailid = zc28_c->zc_jailid;
    +		zc->zc_objset_stats = zc28_c->zc_objset_stats;
    +		zc->zc_begin_record = zc28_c->zc_begin_record;
    +		zc->zc_defer_destroy = zc28_c->zc_defer_destroy;
    +		zc->zc_temphold = zc28_c->zc_temphold;
    +		zc->zc_action_handle = zc28_c->zc_action_handle;
    +		zc->zc_cleanup_fd = zc28_c->zc_cleanup_fd;
    +		zc->zc_simple = zc28_c->zc_simple;
    +		bcopy(zc28_c->zc_pad, zc->zc_pad, sizeof(zc->zc_pad));
    +		zc->zc_sendobj = zc28_c->zc_sendobj;
    +		zc->zc_fromobj = zc28_c->zc_fromobj;
    +		zc->zc_createtxg = zc28_c->zc_createtxg;
    +		zc->zc_stat = zc28_c->zc_stat;
    +
    +		/* zc->zc_inject_record */
    +		zc->zc_inject_record.zi_objset =
    +		    zc28_c->zc_inject_record.zi_objset;
    +		zc->zc_inject_record.zi_object =
    +		    zc28_c->zc_inject_record.zi_object;
    +		zc->zc_inject_record.zi_start =
    +		    zc28_c->zc_inject_record.zi_start;
    +		zc->zc_inject_record.zi_end =
    +		    zc28_c->zc_inject_record.zi_end;
    +		zc->zc_inject_record.zi_guid =
    +		    zc28_c->zc_inject_record.zi_guid;
    +		zc->zc_inject_record.zi_level =
    +		    zc28_c->zc_inject_record.zi_level;
    +		zc->zc_inject_record.zi_error =
    +		    zc28_c->zc_inject_record.zi_error;
    +		zc->zc_inject_record.zi_type =
    +		    zc28_c->zc_inject_record.zi_type;
    +		zc->zc_inject_record.zi_freq =
    +		    zc28_c->zc_inject_record.zi_freq;
    +		zc->zc_inject_record.zi_failfast =
    +		    zc28_c->zc_inject_record.zi_failfast;
    +		strlcpy(zc->zc_inject_record.zi_func,
    +		    zc28_c->zc_inject_record.zi_func, MAXNAMELEN);
    +		zc->zc_inject_record.zi_iotype =
    +		    zc28_c->zc_inject_record.zi_iotype;
    +		zc->zc_inject_record.zi_duration =
    +		    zc28_c->zc_inject_record.zi_duration;
    +		zc->zc_inject_record.zi_timer =
    +		    zc28_c->zc_inject_record.zi_timer;
    +		zc->zc_inject_record.zi_cmd = ZINJECT_UNINITIALIZED;
    +		zc->zc_inject_record.zi_pad = 0;
    +		break;
    +
    +	case ZFS_CMD_COMPAT_V15:
     		zc_c = (void *)addr;
     
     		/* zc */
    -		strlcpy(zc->zc_name,zc_c->zc_name,MAXPATHLEN);
    -		strlcpy(zc->zc_value,zc_c->zc_value,MAXPATHLEN);
    -		strlcpy(zc->zc_string,zc_c->zc_string,MAXPATHLEN);
    +		strlcpy(zc->zc_name, zc_c->zc_name, MAXPATHLEN);
    +		strlcpy(zc->zc_value, zc_c->zc_value, MAXPATHLEN);
    +		strlcpy(zc->zc_string, zc_c->zc_string, MAXPATHLEN);
     		zc->zc_guid = zc_c->zc_guid;
     		zc->zc_nvlist_conf = zc_c->zc_nvlist_conf;
     		zc->zc_nvlist_conf_size = zc_c->zc_nvlist_conf_size;
    @@ -91,6 +169,7 @@ zfs_cmd_compat_get(zfs_cmd_t *zc, caddr_
     		    zc_c->zc_inject_record.zi_freq;
     		zc->zc_inject_record.zi_failfast =
     		    zc_c->zc_inject_record.zi_failfast;
    +		break;
     	}
     }
     
    @@ -98,15 +177,84 @@ void
     zfs_cmd_compat_put(zfs_cmd_t *zc, caddr_t addr, const int cflag)
     {
     	zfs_cmd_v15_t *zc_c;
    +	zfs_cmd_v28_t *zc28_c;
     
     	switch (cflag) {
    +	case ZFS_CMD_COMPAT_V28:
    +		zc28_c = (void *)addr;
    +
    +		strlcpy(zc28_c->zc_name, zc->zc_name, MAXPATHLEN);
    +		strlcpy(zc28_c->zc_value, zc->zc_value, MAXPATHLEN * 2);
    +		strlcpy(zc28_c->zc_string, zc->zc_string, MAXPATHLEN);
    +		strlcpy(zc28_c->zc_top_ds, zc->zc_top_ds, MAXPATHLEN);
    +		zc28_c->zc_guid = zc->zc_guid;
    +		zc28_c->zc_nvlist_conf = zc->zc_nvlist_conf;
    +		zc28_c->zc_nvlist_conf_size = zc->zc_nvlist_conf_size;
    +		zc28_c->zc_nvlist_src = zc->zc_nvlist_src;
    +		zc28_c->zc_nvlist_src_size = zc->zc_nvlist_src_size;
    +		zc28_c->zc_nvlist_dst = zc->zc_nvlist_dst;
    +		zc28_c->zc_nvlist_dst_size = zc->zc_nvlist_dst_size;
    +		zc28_c->zc_cookie = zc->zc_cookie;
    +		zc28_c->zc_objset_type = zc->zc_objset_type;
    +		zc28_c->zc_perm_action = zc->zc_perm_action;
    +		zc28_c->zc_history = zc->zc_history;
    +		zc28_c->zc_history_len = zc->zc_history_len;
    +		zc28_c->zc_history_offset = zc->zc_history_offset;
    +		zc28_c->zc_obj = zc->zc_obj;
    +		zc28_c->zc_iflags = zc->zc_iflags;
    +		zc28_c->zc_share = zc->zc_share;
    +		zc28_c->zc_jailid = zc->zc_jailid;
    +		zc28_c->zc_objset_stats = zc->zc_objset_stats;
    +		zc28_c->zc_begin_record = zc->zc_begin_record;
    +		zc28_c->zc_defer_destroy = zc->zc_defer_destroy;
    +		zc28_c->zc_temphold = zc->zc_temphold;
    +		zc28_c->zc_action_handle = zc->zc_action_handle;
    +		zc28_c->zc_cleanup_fd = zc->zc_cleanup_fd;
    +		zc28_c->zc_simple = zc->zc_simple;
    +		bcopy(zc->zc_pad, zc28_c->zc_pad, sizeof(zc28_c->zc_pad));
    +		zc28_c->zc_sendobj = zc->zc_sendobj;
    +		zc28_c->zc_fromobj = zc->zc_fromobj;
    +		zc28_c->zc_createtxg = zc->zc_createtxg;
    +		zc28_c->zc_stat = zc->zc_stat;
    +
    +		/* zc_inject_record */
    +		zc28_c->zc_inject_record.zi_objset =
    +		    zc->zc_inject_record.zi_objset;
    +		zc28_c->zc_inject_record.zi_object =
    +		    zc->zc_inject_record.zi_object;
    +		zc28_c->zc_inject_record.zi_start =
    +		    zc->zc_inject_record.zi_start;
    +		zc28_c->zc_inject_record.zi_end =
    +		    zc->zc_inject_record.zi_end;
    +		zc28_c->zc_inject_record.zi_guid =
    +		    zc->zc_inject_record.zi_guid;
    +		zc28_c->zc_inject_record.zi_level =
    +		    zc->zc_inject_record.zi_level;
    +		zc28_c->zc_inject_record.zi_error =
    +		    zc->zc_inject_record.zi_error;
    +		zc28_c->zc_inject_record.zi_type =
    +		    zc->zc_inject_record.zi_type;
    +		zc28_c->zc_inject_record.zi_freq =
    +		    zc->zc_inject_record.zi_freq;
    +		zc28_c->zc_inject_record.zi_failfast =
    +		    zc->zc_inject_record.zi_failfast;
    +		strlcpy(zc28_c->zc_inject_record.zi_func,
    +		    zc->zc_inject_record.zi_func, MAXNAMELEN);
    +		zc28_c->zc_inject_record.zi_iotype =
    +		    zc->zc_inject_record.zi_iotype;
    +		zc28_c->zc_inject_record.zi_duration =
    +		    zc->zc_inject_record.zi_duration;
    +		zc28_c->zc_inject_record.zi_timer =
    +		    zc->zc_inject_record.zi_timer;
    +		break;
    +
     	case ZFS_CMD_COMPAT_V15:
     		zc_c = (void *)addr;
     
     		/* zc */
    -		strlcpy(zc_c->zc_name,zc->zc_name,MAXPATHLEN);
    -		strlcpy(zc_c->zc_value,zc->zc_value,MAXPATHLEN);
    -		strlcpy(zc_c->zc_string,zc->zc_string,MAXPATHLEN);
    +		strlcpy(zc_c->zc_name, zc->zc_name, MAXPATHLEN);
    +		strlcpy(zc_c->zc_value, zc->zc_value, MAXPATHLEN);
    +		strlcpy(zc_c->zc_string, zc->zc_string, MAXPATHLEN);
     		zc_c->zc_guid = zc->zc_guid;
     		zc_c->zc_nvlist_conf = zc->zc_nvlist_conf;
     		zc_c->zc_nvlist_conf_size = zc->zc_nvlist_conf_size;
    @@ -260,7 +408,7 @@ zfs_ioctl_compat_fix_stats_nvlist(nvlist
     }
     
     static int
    -zfs_ioctl_compat_fix_stats(zfs_cmd_t *zc, const int cflag)
    +zfs_ioctl_compat_fix_stats(zfs_cmd_t *zc, const int nc)
     {
     	nvlist_t *nv, *nvp = NULL;
     	nvpair_t *elem;
    @@ -270,7 +418,7 @@ zfs_ioctl_compat_fix_stats(zfs_cmd_t *zc
     	    zc->zc_nvlist_dst_size, zc->zc_iflags, &nv)) != 0)
     		return (error);
     
    -	if (cflag == 5) { /* ZFS_IOC_POOL_STATS */
    +	if (nc == 5) { /* ZFS_IOC_POOL_STATS */
     		elem = NULL;
     		while ((elem = nvlist_next_nvpair(nv, elem)) != NULL) {
     			if (nvpair_value_nvlist(elem, &nvp) == 0)
    @@ -334,17 +482,22 @@ zcmd_ioctl_compat(int fd, unsigned long 
     	void *zc_c;
     	unsigned long ncmd;
     
    -	if (cflag == ZFS_CMD_COMPAT_NONE) {
    +	switch (cflag) {
    +	case ZFS_CMD_COMPAT_NONE:
     		ret = ioctl(fd, cmd, zc);
     		return (ret);
    -	}
    -
    -	if (cflag == ZFS_CMD_COMPAT_V15) {
    +	case ZFS_CMD_COMPAT_V28:
    +		zc_c = malloc(sizeof(zfs_cmd_v28_t));
    +		ncmd = _IOWR('Z', ZFS_IOC(cmd), struct zfs_cmd_v28);
    +		break;
    +	case ZFS_CMD_COMPAT_V15:
     		nc = zfs_ioctl_v28_to_v15[ZFS_IOC(cmd)];
     		zc_c = malloc(sizeof(zfs_cmd_v15_t));
     		ncmd = _IOWR('Z', nc, struct zfs_cmd_v15);
    -	} else
    +		break;
    +	default:
     		return (EINVAL);
    +	}
     
     	if (ZFS_IOC(ncmd) == ZFS_IOC_COMPAT_FAIL)
     		return (ENOTSUP);
    @@ -358,16 +511,18 @@ zcmd_ioctl_compat(int fd, unsigned long 
     	zfs_cmd_compat_get(zc, (caddr_t)zc_c, cflag);
     	free(zc_c);
     
    -	switch (nc) {
    -	case 2:	/* ZFS_IOC_POOL_IMPORT */
    -	case 4: /* ZFS_IOC_POOL_CONFIGS */
    -	case 5: /* ZFS_IOC_POOL_STATS */
    -	case 6: /* ZFS_IOC_POOL_TRYIMPORT */
    -		zfs_ioctl_compat_fix_stats(zc, nc);
    -		break;
    -	case 41: /* ZFS_IOC_POOL_GET_PROPS (v15) */
    -		zfs_ioctl_compat_pool_get_props(zc);
    -		break;
    +	if (cflag == ZFS_CMD_COMPAT_V15) {
    +		switch (nc) {
    +		case 2:	/* ZFS_IOC_POOL_IMPORT */
    +		case 4: /* ZFS_IOC_POOL_CONFIGS */
    +		case 5: /* ZFS_IOC_POOL_STATS */
    +		case 6: /* ZFS_IOC_POOL_TRYIMPORT */
    +			zfs_ioctl_compat_fix_stats(zc, nc);
    +			break;
    +		case 41: /* ZFS_IOC_POOL_GET_PROPS (v15) */
    +			zfs_ioctl_compat_pool_get_props(zc);
    +			break;
    +		}
     	}
     
     	return (ret);
    
    Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h
    ==============================================================================
    --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h	Fri Mar  1 09:40:02 2013	(r247539)
    +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h	Fri Mar  1 09:42:58 2013	(r247540)
    @@ -19,7 +19,7 @@
      * CDDL HEADER END
      */
     /*
    - * Copyright 2010 Martin Matuska .  All rights reserved.
    + * Copyright 2013 Martin Matuska .  All rights reserved.
      * Use is subject to license terms.
      */
     
    @@ -40,11 +40,21 @@
     extern "C" {
     #endif
     
    -#define ZFS_CMD_COMPAT_NONE	0
    +/*
    + * Backwards ioctl compatibility
    + */
    +
    +/* ioctl versions for vfs.zfs.version.ioctl */
    +#define	ZFS_IOCVER_DEADMAN	1
    +#define	ZFS_IOCVER_CURRENT	ZFS_IOCVER_DEADMAN
    +
    +/* compatibility conversion flag */
    +#define	ZFS_CMD_COMPAT_NONE	0
     #define	ZFS_CMD_COMPAT_V15	1
    +#define	ZFS_CMD_COMPAT_V28	2
     
    -#define ZFS_IOC_COMPAT_PASS	254
    -#define ZFS_IOC_COMPAT_FAIL	255
    +#define	ZFS_IOC_COMPAT_PASS	254
    +#define	ZFS_IOC_COMPAT_FAIL	255
     
     typedef struct zinject_record_v15 {
     	uint64_t	zi_objset;
    @@ -84,6 +94,60 @@ typedef struct zfs_cmd_v15 {
     	zinject_record_v15_t zc_inject_record;
     } zfs_cmd_v15_t;
     
    +typedef struct zinject_record_v28 {
    +	uint64_t	zi_objset;
    +	uint64_t	zi_object;
    +	uint64_t	zi_start;
    +	uint64_t	zi_end;
    +	uint64_t	zi_guid;
    +	uint32_t	zi_level;
    +	uint32_t	zi_error;
    +	uint64_t	zi_type;
    +	uint32_t	zi_freq;
    +	uint32_t	zi_failfast;
    +	char		zi_func[MAXNAMELEN];
    +	uint32_t	zi_iotype;
    +	int32_t		zi_duration;
    +	uint64_t	zi_timer;
    +} zinject_record_v28_t;
    +
    +typedef struct zfs_cmd_v28 {
    +	char		zc_name[MAXPATHLEN];
    +	char		zc_value[MAXPATHLEN * 2];
    +	char		zc_string[MAXNAMELEN];
    +	char		zc_top_ds[MAXPATHLEN];
    +	uint64_t	zc_guid;
    +	uint64_t	zc_nvlist_conf;		/* really (char *) */
    +	uint64_t	zc_nvlist_conf_size;
    +	uint64_t	zc_nvlist_src;		/* really (char *) */
    +	uint64_t	zc_nvlist_src_size;
    +	uint64_t	zc_nvlist_dst;		/* really (char *) */
    +	uint64_t	zc_nvlist_dst_size;
    +	uint64_t	zc_cookie;
    +	uint64_t	zc_objset_type;
    +	uint64_t	zc_perm_action;
    +	uint64_t 	zc_history;		/* really (char *) */
    +	uint64_t 	zc_history_len;
    +	uint64_t	zc_history_offset;
    +	uint64_t	zc_obj;
    +	uint64_t	zc_iflags;		/* internal to zfs(7fs) */
    +	zfs_share_t	zc_share;
    +	uint64_t	zc_jailid;
    +	dmu_objset_stats_t zc_objset_stats;
    +	struct drr_begin zc_begin_record;
    +	zinject_record_v28_t zc_inject_record;
    +	boolean_t	zc_defer_destroy;
    +	boolean_t	zc_temphold;
    +	uint64_t	zc_action_handle;
    +	int		zc_cleanup_fd;
    +	uint8_t		zc_simple;
    +	uint8_t		zc_pad[3];		/* alignment */
    +	uint64_t	zc_sendobj;
    +	uint64_t	zc_fromobj;
    +	uint64_t	zc_createtxg;
    +	zfs_stat_t	zc_stat;
    +} zfs_cmd_v28_t;
    +
     #ifdef _KERNEL
     unsigned static long zfs_ioctl_v15_to_v28[] = {
     	0,	/*  0 ZFS_IOC_POOL_CREATE */
    
    Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
    ==============================================================================
    --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Fri Mar  1 09:40:02 2013	(r247539)
    +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Fri Mar  1 09:42:58 2013	(r247540)
    @@ -23,7 +23,7 @@
      * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
      * Copyright (c) 2011-2012 Pawel Jakub Dawidek .
      * All rights reserved.
    - * Portions Copyright 2011 Martin Matuska 
    + * Copyright 2013 Martin Matuska . All rights reserved.
      * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
      * Copyright (c) 2012 by Delphix. All rights reserved.
      * Copyright (c) 2012, Joyent, Inc. All rights reserved.
    @@ -5331,12 +5331,14 @@ zfsdev_ioctl(struct cdev *dev, u_long cm
     	len = IOCPARM_LEN(cmd);
     
     	/*
    -	 * Check if we have sufficient kernel memory allocated
    -	 * for the zfs_cmd_t request.  Bail out if not so we
    -	 * will not access undefined memory region.
    +	 * Check if we are talking to supported older binaries
    +	 * and translate zfs_cmd if necessary
     	 */
     	if (len < sizeof(zfs_cmd_t))
    -		if (len == sizeof(zfs_cmd_v15_t)) {
    +		if (len == sizeof(zfs_cmd_v28_t)) {
    +			cflag = ZFS_CMD_COMPAT_V28;
    +			vec = ZFS_IOC(cmd);
    +		} else if (len == sizeof(zfs_cmd_v15_t)) {
     			cflag = ZFS_CMD_COMPAT_V15;
     			vec = zfs_ioctl_v15_to_v28[ZFS_IOC(cmd)];
     		} else
    @@ -5351,6 +5353,11 @@ zfsdev_ioctl(struct cdev *dev, u_long cm
     			return (ENOTSUP);
     	}
     
    +	/*
    +	 * Check if we have sufficient kernel memory allocated
    +	 * for the zfs_cmd_t request.  Bail out if not so we
    +	 * will not access undefined memory region.
    +	 */
     	if (vec >= sizeof (zfs_ioc_vec) / sizeof (zfs_ioc_vec[0]))
     		return (EINVAL);
     
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 09:49:55 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id EABD1B69;
     Fri,  1 Mar 2013 09:49:55 +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 C30012D1;
     Fri,  1 Mar 2013 09:49:55 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r219nt2x083863;
     Fri, 1 Mar 2013 09:49:55 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r219ntc0083862;
     Fri, 1 Mar 2013 09:49:55 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010949.r219ntc0083862@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 09:49: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: r247541 - stable/9/usr.bin/find
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 09:49:56 -0000
    
    Author: des
    Date: Fri Mar  1 09:49:55 2013
    New Revision: 247541
    URL: http://svnweb.freebsd.org/changeset/base/247541
    
    Log:
      MFH (r240278): document -quit
    
    Modified:
      stable/9/usr.bin/find/find.1
    Directory Properties:
      stable/9/usr.bin/find/   (props changed)
    
    Modified: stable/9/usr.bin/find/find.1
    ==============================================================================
    --- stable/9/usr.bin/find/find.1	Fri Mar  1 09:42:58 2013	(r247540)
    +++ stable/9/usr.bin/find/find.1	Fri Mar  1 09:49:55 2013	(r247541)
    @@ -31,7 +31,7 @@
     .\"	@(#)find.1	8.7 (Berkeley) 5/9/95
     .\" $FreeBSD$
     .\"
    -.Dd June 13, 2012
    +.Dd September 9, 2012
     .Dt FIND 1
     .Os
     .Sh NAME
    @@ -735,6 +735,10 @@ Note, the
     primary has no effect if the
     .Fl d
     option was specified.
    +.It Ic -quit
    +Causes
    +.Nm
    +to immediately terminate.
     .It Ic -regex Ar pattern
     True if the whole path of the file matches
     .Ar pattern
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 09:50:45 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id E32A5D1F;
     Fri,  1 Mar 2013 09:50:45 +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 C73682DF;
     Fri,  1 Mar 2013 09:50:45 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r219ojtZ085569;
     Fri, 1 Mar 2013 09:50:45 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r219ojkj085568;
     Fri, 1 Mar 2013 09:50:45 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303010950.r219ojkj085568@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 09:50:45 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247542 - in stable/8/sys: . dev/sound
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 09:50:46 -0000
    
    Author: des
    Date: Fri Mar  1 09:50:45 2013
    New Revision: 247542
    URL: http://svnweb.freebsd.org/changeset/base/247542
    
    Log:
      More misapplied mergeinfo.
    
    Modified:
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/Makefile   (props changed)
      stable/8/sys/amd64/   (props changed)
      stable/8/sys/amd64/include/xen/   (props changed)
      stable/8/sys/arm/   (props changed)
      stable/8/sys/boot/   (props changed)
      stable/8/sys/bsm/   (props changed)
      stable/8/sys/cam/   (props changed)
      stable/8/sys/cddl/   (props changed)
      stable/8/sys/cddl/contrib/opensolaris/   (props changed)
      stable/8/sys/compat/   (props changed)
      stable/8/sys/conf/   (props changed)
      stable/8/sys/contrib/   (props changed)
      stable/8/sys/contrib/dev/acpica/   (props changed)
      stable/8/sys/contrib/pf/   (props changed)
      stable/8/sys/crypto/   (props changed)
      stable/8/sys/ddb/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/aac/   (props changed)
      stable/8/sys/dev/acpi_support/   (props changed)
      stable/8/sys/dev/acpica/   (props changed)
      stable/8/sys/dev/adb/   (props changed)
      stable/8/sys/dev/adlink/   (props changed)
      stable/8/sys/dev/advansys/   (props changed)
      stable/8/sys/dev/ae/   (props changed)
      stable/8/sys/dev/age/   (props changed)
      stable/8/sys/dev/agp/   (props changed)
      stable/8/sys/dev/aha/   (props changed)
      stable/8/sys/dev/ahb/   (props changed)
      stable/8/sys/dev/ahci/   (props changed)
      stable/8/sys/dev/aic/   (props changed)
      stable/8/sys/dev/aic7xxx/   (props changed)
      stable/8/sys/dev/alc/   (props changed)
      stable/8/sys/dev/ale/   (props changed)
      stable/8/sys/dev/amd/   (props changed)
      stable/8/sys/dev/amdsbwd/   (props changed)
      stable/8/sys/dev/amdtemp/   (props changed)
      stable/8/sys/dev/amr/   (props changed)
      stable/8/sys/dev/an/   (props changed)
      stable/8/sys/dev/arcmsr/   (props changed)
      stable/8/sys/dev/asmc/   (props changed)
      stable/8/sys/dev/asr/   (props changed)
      stable/8/sys/dev/ata/   (props changed)
      stable/8/sys/dev/ath/   (props changed)
      stable/8/sys/dev/atkbdc/   (props changed)
      stable/8/sys/dev/auxio/   (props changed)
      stable/8/sys/dev/bce/   (props changed)
      stable/8/sys/dev/bfe/   (props changed)
      stable/8/sys/dev/bge/   (props changed)
      stable/8/sys/dev/bktr/   (props changed)
      stable/8/sys/dev/bm/   (props changed)
      stable/8/sys/dev/buslogic/   (props changed)
      stable/8/sys/dev/bwi/   (props changed)
      stable/8/sys/dev/bwn/   (props changed)
      stable/8/sys/dev/cardbus/   (props changed)
      stable/8/sys/dev/cas/   (props changed)
      stable/8/sys/dev/ce/   (props changed)
      stable/8/sys/dev/cfe/   (props changed)
      stable/8/sys/dev/cfi/   (props changed)
      stable/8/sys/dev/ciss/   (props changed)
      stable/8/sys/dev/cm/   (props changed)
      stable/8/sys/dev/cmx/   (props changed)
      stable/8/sys/dev/coretemp/   (props changed)
      stable/8/sys/dev/cp/   (props changed)
      stable/8/sys/dev/cpuctl/   (props changed)
      stable/8/sys/dev/cpufreq/   (props changed)
      stable/8/sys/dev/cs/   (props changed)
      stable/8/sys/dev/ct/   (props changed)
      stable/8/sys/dev/ctau/   (props changed)
      stable/8/sys/dev/cx/   (props changed)
      stable/8/sys/dev/cxgb/   (props changed)
      stable/8/sys/dev/cxgbe/   (props changed)
      stable/8/sys/dev/cy/   (props changed)
      stable/8/sys/dev/dc/   (props changed)
      stable/8/sys/dev/dcons/   (props changed)
      stable/8/sys/dev/de/   (props changed)
      stable/8/sys/dev/digi/   (props changed)
      stable/8/sys/dev/dpms/   (props changed)
      stable/8/sys/dev/dpt/   (props changed)
      stable/8/sys/dev/drm/   (props changed)
      stable/8/sys/dev/e1000/   (props changed)
      stable/8/sys/dev/ed/   (props changed)
      stable/8/sys/dev/eisa/   (props changed)
      stable/8/sys/dev/en/   (props changed)
      stable/8/sys/dev/ep/   (props changed)
      stable/8/sys/dev/esp/   (props changed)
      stable/8/sys/dev/et/   (props changed)
      stable/8/sys/dev/ex/   (props changed)
      stable/8/sys/dev/exca/   (props changed)
      stable/8/sys/dev/fatm/   (props changed)
      stable/8/sys/dev/fb/   (props changed)
      stable/8/sys/dev/fdc/   (props changed)
      stable/8/sys/dev/fe/   (props changed)
      stable/8/sys/dev/firewire/   (props changed)
      stable/8/sys/dev/flash/   (props changed)
      stable/8/sys/dev/fxp/   (props changed)
      stable/8/sys/dev/gem/   (props changed)
      stable/8/sys/dev/glxsb/   (props changed)
      stable/8/sys/dev/hatm/   (props changed)
      stable/8/sys/dev/hifn/   (props changed)
      stable/8/sys/dev/hme/   (props changed)
      stable/8/sys/dev/hpt27xx/   (props changed)
      stable/8/sys/dev/hptiop/   (props changed)
      stable/8/sys/dev/hptmv/   (props changed)
      stable/8/sys/dev/hptrr/   (props changed)
      stable/8/sys/dev/hwpmc/   (props changed)
      stable/8/sys/dev/ic/   (props changed)
      stable/8/sys/dev/ichsmb/   (props changed)
      stable/8/sys/dev/ichwd/   (props changed)
      stable/8/sys/dev/ida/   (props changed)
      stable/8/sys/dev/ie/   (props changed)
      stable/8/sys/dev/ieee488/   (props changed)
      stable/8/sys/dev/if_ndis/   (props changed)
      stable/8/sys/dev/iicbus/   (props changed)
      stable/8/sys/dev/iir/   (props changed)
      stable/8/sys/dev/io/   (props changed)
      stable/8/sys/dev/ipmi/   (props changed)
      stable/8/sys/dev/ips/   (props changed)
      stable/8/sys/dev/ipw/   (props changed)
      stable/8/sys/dev/isci/   (props changed)
      stable/8/sys/dev/iscsi/   (props changed)
      stable/8/sys/dev/isp/   (props changed)
      stable/8/sys/dev/ispfw/   (props changed)
      stable/8/sys/dev/iwi/   (props changed)
      stable/8/sys/dev/iwn/   (props changed)
      stable/8/sys/dev/ixgb/   (props changed)
      stable/8/sys/dev/ixgbe/   (props changed)
      stable/8/sys/dev/jme/   (props changed)
      stable/8/sys/dev/joy/   (props changed)
      stable/8/sys/dev/kbd/   (props changed)
      stable/8/sys/dev/kbdmux/   (props changed)
      stable/8/sys/dev/ksyms/   (props changed)
      stable/8/sys/dev/le/   (props changed)
      stable/8/sys/dev/led/   (props changed)
      stable/8/sys/dev/lge/   (props changed)
      stable/8/sys/dev/lindev/   (props changed)
      stable/8/sys/dev/lmc/   (props changed)
      stable/8/sys/dev/malo/   (props changed)
      stable/8/sys/dev/mc146818/   (props changed)
      stable/8/sys/dev/mca/   (props changed)
      stable/8/sys/dev/mcd/   (props changed)
      stable/8/sys/dev/md/   (props changed)
      stable/8/sys/dev/mem/   (props changed)
      stable/8/sys/dev/mfi/   (props changed)
      stable/8/sys/dev/mge/   (props changed)
      stable/8/sys/dev/mii/   (props changed)
      stable/8/sys/dev/mk48txx/   (props changed)
      stable/8/sys/dev/mlx/   (props changed)
      stable/8/sys/dev/mly/   (props changed)
      stable/8/sys/dev/mmc/   (props changed)
      stable/8/sys/dev/mn/   (props changed)
      stable/8/sys/dev/mps/   (props changed)
      stable/8/sys/dev/mpt/   (props changed)
      stable/8/sys/dev/mse/   (props changed)
      stable/8/sys/dev/msk/   (props changed)
      stable/8/sys/dev/mvs/   (props changed)
      stable/8/sys/dev/mwl/   (props changed)
      stable/8/sys/dev/mxge/   (props changed)
      stable/8/sys/dev/my/   (props changed)
      stable/8/sys/dev/ncv/   (props changed)
      stable/8/sys/dev/netmap/   (props changed)
      stable/8/sys/dev/nfe/   (props changed)
      stable/8/sys/dev/nge/   (props changed)
      stable/8/sys/dev/nmdm/   (props changed)
      stable/8/sys/dev/nsp/   (props changed)
      stable/8/sys/dev/null/   (props changed)
      stable/8/sys/dev/nve/   (props changed)
      stable/8/sys/dev/nvram/   (props changed)
      stable/8/sys/dev/nxge/   (props changed)
      stable/8/sys/dev/oce/   (props changed)
      stable/8/sys/dev/ofw/   (props changed)
      stable/8/sys/dev/patm/   (props changed)
      stable/8/sys/dev/pbio/   (props changed)
      stable/8/sys/dev/pccard/   (props changed)
      stable/8/sys/dev/pccbb/   (props changed)
      stable/8/sys/dev/pcf/   (props changed)
      stable/8/sys/dev/pci/   (props changed)
      stable/8/sys/dev/pcn/   (props changed)
      stable/8/sys/dev/pdq/   (props changed)
      stable/8/sys/dev/powermac_nvram/   (props changed)
      stable/8/sys/dev/ppbus/   (props changed)
      stable/8/sys/dev/ppc/   (props changed)
      stable/8/sys/dev/pst/   (props changed)
      stable/8/sys/dev/puc/   (props changed)
      stable/8/sys/dev/quicc/   (props changed)
      stable/8/sys/dev/ral/   (props changed)
      stable/8/sys/dev/random/   (props changed)
      stable/8/sys/dev/rc/   (props changed)
      stable/8/sys/dev/re/   (props changed)
      stable/8/sys/dev/rndtest/   (props changed)
      stable/8/sys/dev/rp/   (props changed)
      stable/8/sys/dev/safe/   (props changed)
      stable/8/sys/dev/sbni/   (props changed)
      stable/8/sys/dev/scc/   (props changed)
      stable/8/sys/dev/scd/   (props changed)
      stable/8/sys/dev/sdhci/   (props changed)
      stable/8/sys/dev/sec/   (props changed)
      stable/8/sys/dev/sf/   (props changed)
      stable/8/sys/dev/sge/   (props changed)
      stable/8/sys/dev/si/   (props changed)
      stable/8/sys/dev/siba/   (props changed)
      stable/8/sys/dev/siis/   (props changed)
      stable/8/sys/dev/sio/   (props changed)
      stable/8/sys/dev/sis/   (props changed)
      stable/8/sys/dev/sk/   (props changed)
      stable/8/sys/dev/smbus/   (props changed)
      stable/8/sys/dev/smc/   (props changed)
      stable/8/sys/dev/sn/   (props changed)
      stable/8/sys/dev/snc/   (props changed)
      stable/8/sys/dev/snp/   (props changed)
      stable/8/sys/dev/sound/   (props changed)
      stable/8/sys/dev/sound/chip.h   (props changed)
      stable/8/sys/dev/sound/clone.c   (props changed)
      stable/8/sys/dev/sound/clone.h   (props changed)
      stable/8/sys/dev/sound/driver.c   (props changed)
      stable/8/sys/dev/sound/isa/   (props changed)
      stable/8/sys/dev/sound/macio/   (props changed)
      stable/8/sys/dev/sound/midi/   (props changed)
      stable/8/sys/dev/sound/pci/   (props changed)
      stable/8/sys/dev/sound/pcm/   (props changed)
      stable/8/sys/dev/sound/sbus/   (props changed)
      stable/8/sys/dev/sound/unit.c   (props changed)
      stable/8/sys/dev/sound/unit.h   (props changed)
      stable/8/sys/dev/sound/usb/   (props changed)
      stable/8/sys/dev/sound/version.h   (props changed)
      stable/8/sys/dev/speaker/   (props changed)
      stable/8/sys/dev/spibus/   (props changed)
      stable/8/sys/dev/ste/   (props changed)
      stable/8/sys/dev/stg/   (props changed)
      stable/8/sys/dev/stge/   (props changed)
      stable/8/sys/dev/streams/   (props changed)
      stable/8/sys/dev/sym/   (props changed)
      stable/8/sys/dev/syscons/   (props changed)
      stable/8/sys/dev/tdfx/   (props changed)
      stable/8/sys/dev/ti/   (props changed)
      stable/8/sys/dev/tl/   (props changed)
      stable/8/sys/dev/tpm/   (props changed)
      stable/8/sys/dev/trm/   (props changed)
      stable/8/sys/dev/tsec/   (props changed)
      stable/8/sys/dev/twa/   (props changed)
      stable/8/sys/dev/twe/   (props changed)
      stable/8/sys/dev/tws/   (props changed)
      stable/8/sys/dev/tx/   (props changed)
      stable/8/sys/dev/txp/   (props changed)
      stable/8/sys/dev/uart/   (props changed)
      stable/8/sys/dev/ubsec/   (props changed)
      stable/8/sys/dev/usb/   (props changed)
      stable/8/sys/dev/utopia/   (props changed)
      stable/8/sys/dev/vge/   (props changed)
      stable/8/sys/dev/viawd/   (props changed)
      stable/8/sys/dev/virtio/   (props changed)
      stable/8/sys/dev/vkbd/   (props changed)
      stable/8/sys/dev/vr/   (props changed)
      stable/8/sys/dev/vte/   (props changed)
      stable/8/sys/dev/vx/   (props changed)
      stable/8/sys/dev/watchdog/   (props changed)
      stable/8/sys/dev/wb/   (props changed)
      stable/8/sys/dev/wbwd/   (props changed)
      stable/8/sys/dev/wds/   (props changed)
      stable/8/sys/dev/wi/   (props changed)
      stable/8/sys/dev/wl/   (props changed)
      stable/8/sys/dev/wpi/   (props changed)
      stable/8/sys/dev/xe/   (props changed)
      stable/8/sys/dev/xen/   (props changed)
      stable/8/sys/dev/xl/   (props changed)
      stable/8/sys/fs/   (props changed)
      stable/8/sys/gdb/   (props changed)
      stable/8/sys/geom/   (props changed)
      stable/8/sys/gnu/   (props changed)
      stable/8/sys/i386/   (props changed)
      stable/8/sys/ia64/   (props changed)
      stable/8/sys/isa/   (props changed)
      stable/8/sys/kern/   (props changed)
      stable/8/sys/kgssapi/   (props changed)
      stable/8/sys/libkern/   (props changed)
      stable/8/sys/mips/   (props changed)
      stable/8/sys/modules/   (props changed)
      stable/8/sys/net/   (props changed)
      stable/8/sys/net80211/   (props changed)
      stable/8/sys/netatalk/   (props changed)
      stable/8/sys/netgraph/   (props changed)
      stable/8/sys/netinet/   (props changed)
      stable/8/sys/netinet6/   (props changed)
      stable/8/sys/netipsec/   (props changed)
      stable/8/sys/netipx/   (props changed)
      stable/8/sys/netnatm/   (props changed)
      stable/8/sys/netncp/   (props changed)
      stable/8/sys/netsmb/   (props changed)
      stable/8/sys/nfs/   (props changed)
      stable/8/sys/nfsclient/   (props changed)
      stable/8/sys/nfsserver/   (props changed)
      stable/8/sys/nlm/   (props changed)
      stable/8/sys/opencrypto/   (props changed)
      stable/8/sys/pc98/   (props changed)
      stable/8/sys/pci/   (props changed)
      stable/8/sys/powerpc/   (props changed)
      stable/8/sys/rpc/   (props changed)
      stable/8/sys/security/   (props changed)
      stable/8/sys/sparc64/   (props changed)
      stable/8/sys/sun4v/   (props changed)
      stable/8/sys/sys/   (props changed)
      stable/8/sys/tools/   (props changed)
      stable/8/sys/ufs/   (props changed)
      stable/8/sys/vm/   (props changed)
      stable/8/sys/x86/   (props changed)
      stable/8/sys/xdr/   (props changed)
      stable/8/sys/xen/   (props changed)
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 10:23:37 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 578B9365;
     Fri,  1 Mar 2013 10:23:37 +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 44164648;
     Fri,  1 Mar 2013 10:23:37 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21ANbOB095486;
     Fri, 1 Mar 2013 10:23:37 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21ANbsX095485;
     Fri, 1 Mar 2013 10:23:37 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303011023.r21ANbsX095485@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 10:23:37 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247543 - stable/8/usr.bin/find
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 10:23:37 -0000
    
    Author: des
    Date: Fri Mar  1 10:23:36 2013
    New Revision: 247543
    URL: http://svnweb.freebsd.org/changeset/base/247543
    
    Log:
      MFH (r240278): document -quit
    
    Modified:
      stable/8/usr.bin/find/find.1
    Directory Properties:
      stable/8/usr.bin/find/   (props changed)
    
    Modified: stable/8/usr.bin/find/find.1
    ==============================================================================
    --- stable/8/usr.bin/find/find.1	Fri Mar  1 09:50:45 2013	(r247542)
    +++ stable/8/usr.bin/find/find.1	Fri Mar  1 10:23:36 2013	(r247543)
    @@ -35,7 +35,7 @@
     .\"	@(#)find.1	8.7 (Berkeley) 5/9/95
     .\" $FreeBSD$
     .\"
    -.Dd February 24, 2008
    +.Dd September 9, 2012
     .Dt FIND 1
     .Os
     .Sh NAME
    @@ -741,6 +741,10 @@ Note, the
     primary has no effect if the
     .Fl d
     option was specified.
    +.It Ic -quit
    +Causes
    +.Nm
    +to immediately terminate.
     .It Ic -regex Ar pattern
     True if the whole path of the file matches
     .Ar pattern
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 10:33:31 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id D817A52D;
     Fri,  1 Mar 2013 10:33:31 +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 CA775695;
     Fri,  1 Mar 2013 10:33:31 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21AXVQQ098499;
     Fri, 1 Mar 2013 10:33:31 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21AXVBN098498;
     Fri, 1 Mar 2013 10:33:31 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303011033.r21AXVBN098498@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 10:33: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: r247544 - stable/9/lib
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 10:33:31 -0000
    
    Author: des
    Date: Fri Mar  1 10:33:31 2013
    New Revision: 247544
    URL: http://svnweb.freebsd.org/changeset/base/247544
    
    Log:
      MFH (r246328): sort knobs
    
    Modified:
      stable/9/lib/Makefile   (contents, props changed)
    Directory Properties:
      stable/9/lib/   (props changed)
    
    Modified: stable/9/lib/Makefile
    ==============================================================================
    --- stable/9/lib/Makefile	Fri Mar  1 10:23:36 2013	(r247543)
    +++ stable/9/lib/Makefile	Fri Mar  1 10:33:31 2013	(r247544)
    @@ -169,6 +169,11 @@ _libiconv_modules=	libiconv_modules
     _libipx=	libipx
     .endif
     
    +.if ${MK_LIBCPLUSPLUS} != "no"
    +_libcxxrt=	libcxxrt
    +_libcplusplus=	libc++
    +.endif
    +
     .if ${MK_LIBTHR} != "no"
     _libthr=	libthr
     .endif
    @@ -214,11 +219,6 @@ _libsmb=	libsmb
     _libmp=		libmp
     .endif
     
    -.if ${MK_LIBCPLUSPLUS} != "no"
    -_libcxxrt=	libcxxrt
    -_libcplusplus=	libc++
    -.endif
    -
     .if ${MK_PMC} != "no"
     _libpmc=	libpmc
     .endif
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 14:26:51 2013
    Return-Path: 
    Delivered-To: svn-src-all@FreeBSD.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id EFC8C6BC;
     Fri,  1 Mar 2013 14:26:50 +0000 (UTC) (envelope-from jilles@stack.nl)
    Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107])
     by mx1.freebsd.org (Postfix) with ESMTP id 9C811FC8;
     Fri,  1 Mar 2013 14:26:50 +0000 (UTC)
    Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131])
     by mx1.stack.nl (Postfix) with ESMTP id 28AD01203C4;
     Fri,  1 Mar 2013 15:26:34 +0100 (CET)
    Received: by snail.stack.nl (Postfix, from userid 1677)
     id 0A4DA2848C; Fri,  1 Mar 2013 15:26:34 +0100 (CET)
    Date: Fri, 1 Mar 2013 15:26:33 +0100
    From: Jilles Tjoelker 
    To: Peter Jeremy 
    Subject: Re: svn commit: r247274 - in head: bin/test tools/regression/bin/test
    Message-ID: <20130301142633.GA49921@stack.nl>
    References: <201302251905.r1PJ5fKF085179@svn.freebsd.org>
     <20130226000227.GA80718@stack.nl>
     <20130227082548.GF99210@server.rulingia.com>
    MIME-Version: 1.0
    Content-Type: text/plain; charset=iso-8859-1
    Content-Disposition: inline
    Content-Transfer-Encoding: 8bit
    In-Reply-To: <20130227082548.GF99210@server.rulingia.com>
    User-Agent: Mutt/1.5.21 (2010-09-15)
    Cc: grog@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
     src-committers@FreeBSD.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 14:26:51 -0000
    
    On Wed, Feb 27, 2013 at 07:25:48PM +1100, Peter Jeremy wrote:
    > On 2013-Feb-26 01:02:27 +0100, Jilles Tjoelker  wrote:
    > >>   Enhance test(1) by adding provision to compare any combination of the
    > >>   access, birth, change and modify times of two files, instead of only
    > >>   being able to compare modify times.  The builtin test in sh(1) will
    > >>   automagically acquire the same expansion.
    
    > >What do you need this for? If it is not needed very often, this test can
    > >be done more portably (older FreeBSD and GNU) as
    > >  [ -n "$(find -L FILE1 -prune -newerXY FILE2 2>/dev/null)" ]
    
    > In my case I needed to compare the ctime on one set of files with the
    > mtime in another set.  I had a think about using find(1) and gave it
    > away as too ugly.  That expression needs serious thought to understand
    > and about ½ the tokens in the find(1) are to handle special cases -
    > which is a further indication that it isn't ideal.
    
    Making everything ideal out of the box is not possible; it would bloat
    up things too much and make scripts harder to read. There are many
    possible extensions to avoid problems with special cases that would be
    useful more frequently, such as arrays, ${PARAM/WORD/REPLACEMENT},
    ${PARAM:START:LENGTH} and optional more useful signal handling.
    
    And I don't think this case is particularly bad. By defining the below
    function
    
    file_newer() {
    	test -n "$(find -L -- "$2" -prune -newer$1$3 "$4" 2>/dev/null)"
    }
    
    you can do things like  file_newer m file1 c file2  to compare file1's
    mtime to file2's ctime. The ugliness is isolated to the function
    definition.
    
    The birth time is designated by B instead of b. This is because find(1)
    wants B, and so does stat(1).
    
    Furthermore, it also allows  file_newer m file1 t '2 days ago'  to
    compare to a specified time; however, only the second time can be 't'.
    
    It is also possible to query file times using stat(1). This allows
    intuitive constructions like
      [ $(stat -f %m FILE1) -gt $(stat -f %c FILE2) ]
    lets you compare to things like  $(($(date +%s) - 86400))  and allows
    control whether symlinks should be followed. However, this may fork more
    often than the find(1)-based approach and hard-codes the limitation to
    seconds into the script unless you do something more complicated like
      [ $(stat -f %040.9Fm FILE1) \> $(stat -f %040.9Fc FILE2) ]
    The test(1) syntax will also be incorrect if the files do not exist.
    
    The find(1) and stat(1) approaches also work in other shells such as
    bash, ksh and zsh. An extension to test(1) can only be used by writing
    ugly things like /bin/test. Whatever you may think of it, people write
    scripts for those other shells and it is somewhat unfortunate that they
    cannot use all FreeBSD-specific features.
    
    > >I have generally been rather reluctant in adding things to sh(1) and
    > >even more so if they are completely new. Someone proposed something
    > >rather similar (except that it added a time string parser -- even more
    > >code) in PR bin/57054 and I rejected it in 2009.
    
    > Time parsing is a large can of worms - getting it right is messy (that
    > patch includes 1KLOC of new code and still isn't locale aware).  And
    > the work-around of touching a dummy file to the wanted age isn't too
    > horrrible.  This is a much smaller patch and there's no equally clean
    > work-around.
    
    I think my function definition is a clean enough workaround.
    
    I wouldn't mind having more such functions somewhere part of the base
    system, perhaps somewhat like rc.subr and dteske's bsdconfig scripts.
    There are some such functions in src/bin/sh/funcs/ but they are not
    installed.
    
    When I add things to sh, I usually include the new feature in a message
    to a mailing list like
    http://lists.freebsd.org/pipermail/freebsd-arch/2010-June/010353.html
    and
    http://lists.freebsd.org/pipermail/freebsd-arch/2011-December/011976.html
    first. Randomly adding features interferes with the design and the
    process.
    
    > >> +a=/tmp/test$$.1
    > >> +b=/tmp/test$$.2
    
    > >Please use mktemp(1). Using $$ for temporary files is insecure on
    > >multiuser systems.
    
    > In this case, I want filenames that don't exist.  I will look at using
    > mktemp(1) to create a temporary directory.
    
    That's what I usually do in sh testcases. The directory usually serves
    to contain temporary fifos. Fifos are both faster and more reliable to
    enforce ordering than sleeps.
    
    > >> +sleep 2    # Ensure $b is newer than $a
    > >> +touch $b
    
    > >Please use touch -t instead of sleeping. I'm impatient while running
    > >tests :)
    
    > In this case, I want all the timestamps on $b to be later than $a.  I
    > initially tried without the sleep but that failed with the builtin
    > test(1) because the FS timestamps weren't sufficiently granular to
    > report the difference.  I could create one of the files much earlier
    > during the test and then use a conditional test to only sleep if the
    > timestamps were indistinguishable (this probably needs to use the
    > above find(1) horror to avoid using test(1) to test itself).
    
    You can compare to a file somewhere else on the system.
    
    > I agree the other sleep(1)s should be able to be replaced with
    > touch(1) but I ran into problems with my initial efforts to do
    > everything using touch(1).  I will revisit it.
    
    The tests can still be used to test the above find(1)-based
    implementation. I have done this locally and it works.
    
    -- 
    Jilles Tjoelker
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 14:54:28 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 6B973F09;
     Fri,  1 Mar 2013 14:54:28 +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 581E51A8;
     Fri,  1 Mar 2013 14:54:28 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21EsRNP077056;
     Fri, 1 Mar 2013 14:54:27 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21EsRQU077053;
     Fri, 1 Mar 2013 14:54:27 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011454.r21EsRQU077053@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 14:54: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: r247547 - in stable/9/sys: amd64/amd64 i386/i386 x86/x86
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 14:54:28 -0000
    
    Author: jhb
    Date: Fri Mar  1 14:54:26 2013
    New Revision: 247547
    URL: http://svnweb.freebsd.org/changeset/base/247547
    
    Log:
      MFC 245577,245640:
      Don't attempt to use clflush on the local APIC register window.  Various
      CPUs exhibit bad behavior if this is done (Intel Errata AAJ3, hangs on
      Pentium-M, and trashing of the local APIC registers on a VIA C7).  The
      local APIC is implicitly mapped UC already via MTRRs, so the clflush isn't
      necessary anyway.
    
    Modified:
      stable/9/sys/amd64/amd64/pmap.c
      stable/9/sys/i386/i386/pmap.c
      stable/9/sys/x86/x86/local_apic.c
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/amd64/amd64/pmap.c
    ==============================================================================
    --- stable/9/sys/amd64/amd64/pmap.c	Fri Mar  1 13:27:32 2013	(r247546)
    +++ stable/9/sys/amd64/amd64/pmap.c	Fri Mar  1 14:54:26 2013	(r247547)
    @@ -109,6 +109,7 @@ __FBSDID("$FreeBSD$");
     #include "opt_vm.h"
     
     #include 
    +#include 
     #include 
     #include 
     #include 
    @@ -140,6 +141,8 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     
    +#include 
    +#include 
     #include 
     #include 
     #include 
    @@ -1166,6 +1169,15 @@ pmap_invalidate_cache_range(vm_offset_t 
     	    eva - sva < PMAP_CLFLUSH_THRESHOLD) {
     
     		/*
    +		 * XXX: Some CPUs fault, hang, or trash the local APIC
    +		 * registers if we use CLFLUSH on the local APIC
    +		 * range.  The local APIC is always uncached, so we
    +		 * don't need to flush for that range anyway.
    +		 */
    +		if (pmap_kextract(sva) == lapic_paddr)
    +			return;
    +
    +		/*
     		 * Otherwise, do per-cache line flush.  Use the mfence
     		 * instruction to insure that previous stores are
     		 * included in the write-back.  The processor
    
    Modified: stable/9/sys/i386/i386/pmap.c
    ==============================================================================
    --- stable/9/sys/i386/i386/pmap.c	Fri Mar  1 13:27:32 2013	(r247546)
    +++ stable/9/sys/i386/i386/pmap.c	Fri Mar  1 14:54:26 2013	(r247547)
    @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$");
      *	and to when physical maps must be made correct.
      */
     
    +#include "opt_apic.h"
     #include "opt_cpu.h"
     #include "opt_pmap.h"
     #include "opt_smp.h"
    @@ -142,6 +143,11 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     
    +#ifdef DEV_APIC
    +#include 
    +#include 
    +#include 
    +#endif
     #include 
     #include 
     #include 
    @@ -1191,6 +1197,16 @@ pmap_invalidate_cache_range(vm_offset_t 
     	else if ((cpu_feature & CPUID_CLFSH) != 0 &&
     	    eva - sva < PMAP_CLFLUSH_THRESHOLD) {
     
    +#ifdef DEV_APIC
    +		/*
    +		 * XXX: Some CPUs fault, hang, or trash the local APIC
    +		 * registers if we use CLFLUSH on the local APIC
    +		 * range.  The local APIC is always uncached, so we
    +		 * don't need to flush for that range anyway.
    +		 */
    +		if (pmap_kextract(sva) == lapic_paddr)
    +			return;
    +#endif
     		/*
     		 * Otherwise, do per-cache line flush.  Use the mfence
     		 * instruction to insure that previous stores are
    
    Modified: stable/9/sys/x86/x86/local_apic.c
    ==============================================================================
    --- stable/9/sys/x86/x86/local_apic.c	Fri Mar  1 13:27:32 2013	(r247546)
    +++ stable/9/sys/x86/x86/local_apic.c	Fri Mar  1 14:54:26 2013	(r247547)
    @@ -223,8 +223,8 @@ lapic_init(vm_paddr_t addr)
     	/* Map the local APIC and setup the spurious interrupt handler. */
     	KASSERT(trunc_page(addr) == addr,
     	    ("local APIC not aligned on a page boundary"));
    -	lapic = pmap_mapdev(addr, sizeof(lapic_t));
     	lapic_paddr = addr;
    +	lapic = pmap_mapdev(addr, sizeof(lapic_t));
     	setidt(APIC_SPURIOUS_INT, IDTVEC(spuriousint), SDT_APIC, SEL_KPL,
     	    GSEL_APIC);
     
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 14:54:38 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id ED07F91;
     Fri,  1 Mar 2013 14:54:38 +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 DF25F1A9;
     Fri,  1 Mar 2013 14:54:38 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21Esc8m077121;
     Fri, 1 Mar 2013 14:54:38 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21Esckw077117;
     Fri, 1 Mar 2013 14:54:38 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011454.r21Esckw077117@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 14:54:38 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247548 - in stable/8/sys: amd64/amd64 i386/i386 x86/x86
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 14:54:39 -0000
    
    Author: jhb
    Date: Fri Mar  1 14:54:37 2013
    New Revision: 247548
    URL: http://svnweb.freebsd.org/changeset/base/247548
    
    Log:
      MFC 245577,245640:
      Don't attempt to use clflush on the local APIC register window.  Various
      CPUs exhibit bad behavior if this is done (Intel Errata AAJ3, hangs on
      Pentium-M, and trashing of the local APIC registers on a VIA C7).  The
      local APIC is implicitly mapped UC already via MTRRs, so the clflush isn't
      necessary anyway.
    
    Modified:
      stable/8/sys/amd64/amd64/pmap.c
      stable/8/sys/i386/i386/pmap.c
      stable/8/sys/x86/x86/local_apic.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/amd64/   (props changed)
      stable/8/sys/i386/   (props changed)
      stable/8/sys/x86/   (props changed)
    
    Modified: stable/8/sys/amd64/amd64/pmap.c
    ==============================================================================
    --- stable/8/sys/amd64/amd64/pmap.c	Fri Mar  1 14:54:26 2013	(r247547)
    +++ stable/8/sys/amd64/amd64/pmap.c	Fri Mar  1 14:54:37 2013	(r247548)
    @@ -109,6 +109,7 @@ __FBSDID("$FreeBSD$");
     #include "opt_vm.h"
     
     #include 
    +#include 
     #include 
     #include 
     #include 
    @@ -137,6 +138,8 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     
    +#include 
    +#include 
     #include 
     #include 
     #include 
    @@ -1054,6 +1057,15 @@ pmap_invalidate_cache_range(vm_offset_t 
     		 eva - sva < 2 * 1024 * 1024) {
     
     		/*
    +		 * XXX: Some CPUs fault, hang, or trash the local APIC
    +		 * registers if we use CLFLUSH on the local APIC
    +		 * range.  The local APIC is always uncached, so we
    +		 * don't need to flush for that range anyway.
    +		 */
    +		if (pmap_kextract(sva) == lapic_paddr)
    +			return;
    +
    +		/*
     		 * Otherwise, do per-cache line flush.  Use the mfence
     		 * instruction to insure that previous stores are
     		 * included in the write-back.  The processor
    
    Modified: stable/8/sys/i386/i386/pmap.c
    ==============================================================================
    --- stable/8/sys/i386/i386/pmap.c	Fri Mar  1 14:54:26 2013	(r247547)
    +++ stable/8/sys/i386/i386/pmap.c	Fri Mar  1 14:54:37 2013	(r247548)
    @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$");
      *	and to when physical maps must be made correct.
      */
     
    +#include "opt_apic.h"
     #include "opt_cpu.h"
     #include "opt_pmap.h"
     #include "opt_smp.h"
    @@ -139,6 +140,11 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     
    +#ifdef DEV_APIC
    +#include 
    +#include 
    +#include 
    +#endif
     #include 
     #include 
     #include 
    @@ -1164,6 +1170,16 @@ pmap_invalidate_cache_range(vm_offset_t 
     	else if ((cpu_feature & CPUID_CLFSH) != 0 &&
     		 eva - sva < 2 * 1024 * 1024) {
     
    +#ifdef DEV_APIC
    +		/*
    +		 * XXX: Some CPUs fault, hang, or trash the local APIC
    +		 * registers if we use CLFLUSH on the local APIC
    +		 * range.  The local APIC is always uncached, so we
    +		 * don't need to flush for that range anyway.
    +		 */
    +		if (pmap_kextract(sva) == lapic_paddr)
    +			return;
    +#endif
     		/*
     		 * Otherwise, do per-cache line flush.  Use the mfence
     		 * instruction to insure that previous stores are
    
    Modified: stable/8/sys/x86/x86/local_apic.c
    ==============================================================================
    --- stable/8/sys/x86/x86/local_apic.c	Fri Mar  1 14:54:26 2013	(r247547)
    +++ stable/8/sys/x86/x86/local_apic.c	Fri Mar  1 14:54:37 2013	(r247548)
    @@ -223,8 +223,8 @@ lapic_init(vm_paddr_t addr)
     	/* Map the local APIC and setup the spurious interrupt handler. */
     	KASSERT(trunc_page(addr) == addr,
     	    ("local APIC not aligned on a page boundary"));
    -	lapic = pmap_mapdev(addr, sizeof(lapic_t));
     	lapic_paddr = addr;
    +	lapic = pmap_mapdev(addr, sizeof(lapic_t));
     	setidt(APIC_SPURIOUS_INT, IDTVEC(spuriousint), SDT_APIC, SEL_KPL,
     	    GSEL_APIC);
     
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 15:45:58 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 5F0AE1D0;
     Fri,  1 Mar 2013 15:45:58 +0000 (UTC)
     (envelope-from kevlo@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 50837642;
     Fri,  1 Mar 2013 15:45:58 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21FjwAC092516;
     Fri, 1 Mar 2013 15:45:58 GMT (envelope-from kevlo@svn.freebsd.org)
    Received: (from kevlo@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21FjwtH092514;
     Fri, 1 Mar 2013 15:45:58 GMT (envelope-from kevlo@svn.freebsd.org)
    Message-Id: <201303011545.r21FjwtH092514@svn.freebsd.org>
    From: Kevin Lo 
    Date: Fri, 1 Mar 2013 15:45:58 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247550 - head/lib/libc/rpc
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 15:45:58 -0000
    
    Author: kevlo
    Date: Fri Mar  1 15:45:57 2013
    New Revision: 247550
    URL: http://svnweb.freebsd.org/changeset/base/247550
    
    Log:
      Assign the len field of the netbuf structure to the current length of
      a sockaddr.
      
      Obtained from:	NetBSD
    
    Modified:
      head/lib/libc/rpc/clnt_vc.c
    
    Modified: head/lib/libc/rpc/clnt_vc.c
    ==============================================================================
    --- head/lib/libc/rpc/clnt_vc.c	Fri Mar  1 15:09:23 2013	(r247549)
    +++ head/lib/libc/rpc/clnt_vc.c	Fri Mar  1 15:45:57 2013	(r247550)
    @@ -260,7 +260,7 @@ clnt_vc_create(fd, raddr, prog, vers, se
     	if (ct->ct_addr.buf == NULL)
     		goto err;
     	memcpy(ct->ct_addr.buf, raddr->buf, raddr->len);
    -	ct->ct_addr.len = raddr->maxlen;
    +	ct->ct_addr.len = raddr->len;
     	ct->ct_addr.maxlen = raddr->maxlen;
     
     	/*
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 15:48:31 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id EB7E63B9;
     Fri,  1 Mar 2013 15:48:31 +0000 (UTC)
     (envelope-from kevlo@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 DD798681;
     Fri,  1 Mar 2013 15:48:31 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21FmV5X092922;
     Fri, 1 Mar 2013 15:48:31 GMT (envelope-from kevlo@svn.freebsd.org)
    Received: (from kevlo@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21FmVZ0092921;
     Fri, 1 Mar 2013 15:48:31 GMT (envelope-from kevlo@svn.freebsd.org)
    Message-Id: <201303011548.r21FmVZ0092921@svn.freebsd.org>
    From: Kevin Lo 
    Date: Fri, 1 Mar 2013 15:48:31 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247551 - head/sys/dev/tws
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 15:48:32 -0000
    
    Author: kevlo
    Date: Fri Mar  1 15:48:31 2013
    New Revision: 247551
    URL: http://svnweb.freebsd.org/changeset/base/247551
    
    Log:
      Fix typo.
    
    Modified:
      head/sys/dev/tws/tws_hdm.c
    
    Modified: head/sys/dev/tws/tws_hdm.c
    ==============================================================================
    --- head/sys/dev/tws/tws_hdm.c	Fri Mar  1 15:45:57 2013	(r247550)
    +++ head/sys/dev/tws/tws_hdm.c	Fri Mar  1 15:48:31 2013	(r247551)
    @@ -99,7 +99,7 @@ tws_init_ctlr(struct tws_softc *sc)
             regh = tws_read_reg(sc, TWS_I2O0_IOPOBQPH, 4);
             regl = tws_read_reg(sc, TWS_I2O0_IOPOBQPL, 4);
             reg = (((u_int64_t)regh) << 32) | regl;
    -        TWS_TRACE_DEBUG(sc, "host outbound clenup",reg, regl);
    +        TWS_TRACE_DEBUG(sc, "host outbound cleanup",reg, regl);
             if ( regh == TWS_FIFO_EMPTY32 )
                 break;
         } 
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 16:18:41 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id A9300F9F;
     Fri,  1 Mar 2013 16:18:41 +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 834DE7E4;
     Fri,  1 Mar 2013 16:18:41 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21GIfW8002434;
     Fri, 1 Mar 2013 16:18:41 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21GIfIT002433;
     Fri, 1 Mar 2013 16:18:41 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011618.r21GIfIT002433@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 16:18:41 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
    Subject: svn commit: r247553 - stable/9/lib/libproc
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 16:18:41 -0000
    
    Author: jhb
    Date: Fri Mar  1 16:18:40 2013
    New Revision: 247553
    URL: http://svnweb.freebsd.org/changeset/base/247553
    
    Log:
      MFC 246035:
      - Compute the correct size to reallocate when doubling the size of the
        array of loaded objects to avoid a buffer overrun.
      - Use reallocf() to avoid leaking memory if the realloc() fails.
      
      PR:		kern/175648
    
    Modified:
      stable/9/lib/libproc/proc_rtld.c
    Directory Properties:
      stable/9/lib/libproc/   (props changed)
    
    Modified: stable/9/lib/libproc/proc_rtld.c
    ==============================================================================
    --- stable/9/lib/libproc/proc_rtld.c	Fri Mar  1 15:59:14 2013	(r247552)
    +++ stable/9/lib/libproc/proc_rtld.c	Fri Mar  1 16:18:40 2013	(r247553)
    @@ -44,7 +44,8 @@ map_iter(const rd_loadobj_t *lop, void *
     
     	if (phdl->nobjs >= phdl->rdobjsz) {
     		phdl->rdobjsz *= 2;
    -		phdl->rdobjs = realloc(phdl->rdobjs, phdl->rdobjsz);
    +		phdl->rdobjs = reallocf(phdl->rdobjs, sizeof(*phdl->rdobjs) *
    +		    phdl->rdobjsz);
     		if (phdl->rdobjs == NULL)
     			return (-1);
     	}
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 16:19:10 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 10A40219;
     Fri,  1 Mar 2013 16:19:10 +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 02C6B7ED;
     Fri,  1 Mar 2013 16:19:10 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21GJ952002536;
     Fri, 1 Mar 2013 16:19:09 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21GJ9wn002534;
     Fri, 1 Mar 2013 16:19:09 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011619.r21GJ9wn002534@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 16:19:09 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247554 - stable/8/lib/libproc
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 16:19:10 -0000
    
    Author: jhb
    Date: Fri Mar  1 16:19:09 2013
    New Revision: 247554
    URL: http://svnweb.freebsd.org/changeset/base/247554
    
    Log:
      MFC 246035:
      - Compute the correct size to reallocate when doubling the size of the
        array of loaded objects to avoid a buffer overrun.
      - Use reallocf() to avoid leaking memory if the realloc() fails.
      
      PR:		kern/175648
    
    Modified:
      stable/8/lib/libproc/proc_rtld.c
    Directory Properties:
      stable/8/lib/libproc/   (props changed)
    
    Modified: stable/8/lib/libproc/proc_rtld.c
    ==============================================================================
    --- stable/8/lib/libproc/proc_rtld.c	Fri Mar  1 16:18:40 2013	(r247553)
    +++ stable/8/lib/libproc/proc_rtld.c	Fri Mar  1 16:19:09 2013	(r247554)
    @@ -44,7 +44,8 @@ map_iter(const rd_loadobj_t *lop, void *
     
     	if (phdl->nobjs >= phdl->rdobjsz) {
     		phdl->rdobjsz *= 2;
    -		phdl->rdobjs = realloc(phdl->rdobjs, phdl->rdobjsz);
    +		phdl->rdobjs = reallocf(phdl->rdobjs, sizeof(*phdl->rdobjs) *
    +		    phdl->rdobjsz);
     		if (phdl->rdobjs == NULL)
     			return (-1);
     	}
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 17:10:46 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 12068264;
     Fri,  1 Mar 2013 17:10:46 +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 ECADBA49;
     Fri,  1 Mar 2013 17:10:45 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21HAjIU019336;
     Fri, 1 Mar 2013 17:10:45 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21HAiq8019330;
     Fri, 1 Mar 2013 17:10:44 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011710.r21HAiq8019330@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 17:10: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: r247555 - in stable/9/sys: dev/usb/net kern pci sys
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 17:10:46 -0000
    
    Author: jhb
    Date: Fri Mar  1 17:10:43 2013
    New Revision: 247555
    URL: http://svnweb.freebsd.org/changeset/base/247555
    
    Log:
      MFC 246037:
      Mark 'ticks', 'time_second', and 'time_uptime' as volatile to prevent the
      compiler from caching their values in tight loops.
    
    Modified:
      stable/9/sys/dev/usb/net/if_cdce.c
      stable/9/sys/kern/kern_clock.c
      stable/9/sys/kern/kern_tc.c
      stable/9/sys/pci/ncr.c
      stable/9/sys/sys/kernel.h
      stable/9/sys/sys/time.h
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
    
    Modified: stable/9/sys/dev/usb/net/if_cdce.c
    ==============================================================================
    --- stable/9/sys/dev/usb/net/if_cdce.c	Fri Mar  1 16:19:09 2013	(r247554)
    +++ stable/9/sys/dev/usb/net/if_cdce.c	Fri Mar  1 17:10:43 2013	(r247555)
    @@ -500,6 +500,7 @@ cdce_attach(device_t dev)
     	const struct usb_interface_descriptor *id;
     	const struct usb_cdc_ethernet_descriptor *ued;
     	const struct usb_config *pcfg;
    +	uint32_t seed;
     	int error;
     	uint8_t i;
     	uint8_t data_iface_no;
    @@ -612,8 +613,9 @@ alloc_transfers:
     		/* fake MAC address */
     
     		device_printf(dev, "faking MAC address\n");
    +		seed = ticks;
     		sc->sc_ue.ue_eaddr[0] = 0x2a;
    -		memcpy(&sc->sc_ue.ue_eaddr[1], &ticks, sizeof(uint32_t));
    +		memcpy(&sc->sc_ue.ue_eaddr[1], &seed, sizeof(uint32_t));
     		sc->sc_ue.ue_eaddr[5] = device_get_unit(dev);
     
     	} else {
    
    Modified: stable/9/sys/kern/kern_clock.c
    ==============================================================================
    --- stable/9/sys/kern/kern_clock.c	Fri Mar  1 16:19:09 2013	(r247554)
    +++ stable/9/sys/kern/kern_clock.c	Fri Mar  1 17:10:43 2013	(r247555)
    @@ -381,7 +381,7 @@ static void watchdog_config(void *, u_in
     int	stathz;
     int	profhz;
     int	profprocs;
    -int	ticks;
    +volatile int	ticks;
     int	psratio;
     
     static DPCPU_DEFINE(int, pcputicks);	/* Per-CPU version of ticks. */
    @@ -468,7 +468,7 @@ void
     hardclock(int usermode, uintfptr_t pc)
     {
     
    -	atomic_add_int((volatile int *)&ticks, 1);
    +	atomic_add_int(&ticks, 1);
     	hardclock_cpu(usermode);
     	tc_ticktock(1);
     	cpu_tick_calibration();
    
    Modified: stable/9/sys/kern/kern_tc.c
    ==============================================================================
    --- stable/9/sys/kern/kern_tc.c	Fri Mar  1 16:19:09 2013	(r247554)
    +++ stable/9/sys/kern/kern_tc.c	Fri Mar  1 17:10:43 2013	(r247555)
    @@ -91,8 +91,8 @@ static struct timecounter *timecounters 
     
     int tc_min_ticktock_freq = 1;
     
    -time_t time_second = 1;
    -time_t time_uptime = 1;
    +volatile time_t time_second = 1;
    +volatile time_t time_uptime = 1;
     
     struct bintime boottimebin;
     struct timeval boottime;
    
    Modified: stable/9/sys/pci/ncr.c
    ==============================================================================
    --- stable/9/sys/pci/ncr.c	Fri Mar  1 16:19:09 2013	(r247554)
    +++ stable/9/sys/pci/ncr.c	Fri Mar  1 17:10:43 2013	(r247555)
    @@ -1386,7 +1386,7 @@ static char *ncr_name (ncb_p np)
      * Kernel variables referenced in the scripts.
      * THESE MUST ALL BE ALIGNED TO A 4-BYTE BOUNDARY.
      */
    -static void *script_kvars[] =
    +static volatile void *script_kvars[] =
     	{ &time_second, &ticks, &ncr_cache };
     
     static	struct script script0 = {
    
    Modified: stable/9/sys/sys/kernel.h
    ==============================================================================
    --- stable/9/sys/sys/kernel.h	Fri Mar  1 16:19:09 2013	(r247554)
    +++ stable/9/sys/sys/kernel.h	Fri Mar  1 17:10:43 2013	(r247555)
    @@ -63,7 +63,7 @@ extern int psratio;			/* ratio: prof / s
     extern int stathz;			/* statistics clock's frequency */
     extern int profhz;			/* profiling clock's frequency */
     extern int profprocs;			/* number of process's profiling */
    -extern int ticks;
    +extern volatile int ticks;
     
     #endif /* _KERNEL */
     
    
    Modified: stable/9/sys/sys/time.h
    ==============================================================================
    --- stable/9/sys/sys/time.h	Fri Mar  1 16:19:09 2013	(r247554)
    +++ stable/9/sys/sys/time.h	Fri Mar  1 17:10:43 2013	(r247555)
    @@ -281,8 +281,8 @@ struct clockinfo {
     void	inittodr(time_t base);
     void	resettodr(void);
     
    -extern time_t	time_second;
    -extern time_t	time_uptime;
    +extern volatile time_t	time_second;
    +extern volatile time_t	time_uptime;
     extern struct bintime boottimebin;
     extern struct timeval boottime;
     
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 17:10:53 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id B43063B8;
     Fri,  1 Mar 2013 17:10:53 +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 A6251A4B;
     Fri,  1 Mar 2013 17:10:53 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21HAr82019408;
     Fri, 1 Mar 2013 17:10:53 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21HAqHR019398;
     Fri, 1 Mar 2013 17:10:52 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011710.r21HAqHR019398@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 17:10:52 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247556 - in stable/8/sys: dev/usb/net kern pci sys
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 17:10:53 -0000
    
    Author: jhb
    Date: Fri Mar  1 17:10:52 2013
    New Revision: 247556
    URL: http://svnweb.freebsd.org/changeset/base/247556
    
    Log:
      MFC 246037:
      Mark 'ticks', 'time_second', and 'time_uptime' as volatile to prevent the
      compiler from caching their values in tight loops.
    
    Modified:
      stable/8/sys/dev/usb/net/if_cdce.c
      stable/8/sys/kern/kern_clock.c
      stable/8/sys/kern/kern_tc.c
      stable/8/sys/pci/ncr.c
      stable/8/sys/sys/kernel.h
      stable/8/sys/sys/time.h
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/usb/   (props changed)
      stable/8/sys/kern/   (props changed)
      stable/8/sys/pci/   (props changed)
      stable/8/sys/sys/   (props changed)
    
    Modified: stable/8/sys/dev/usb/net/if_cdce.c
    ==============================================================================
    --- stable/8/sys/dev/usb/net/if_cdce.c	Fri Mar  1 17:10:43 2013	(r247555)
    +++ stable/8/sys/dev/usb/net/if_cdce.c	Fri Mar  1 17:10:52 2013	(r247556)
    @@ -500,6 +500,7 @@ cdce_attach(device_t dev)
     	const struct usb_interface_descriptor *id;
     	const struct usb_cdc_ethernet_descriptor *ued;
     	const struct usb_config *pcfg;
    +	uint32_t seed;
     	int error;
     	uint8_t i;
     	uint8_t data_iface_no;
    @@ -612,8 +613,9 @@ alloc_transfers:
     		/* fake MAC address */
     
     		device_printf(dev, "faking MAC address\n");
    +		seed = ticks;
     		sc->sc_ue.ue_eaddr[0] = 0x2a;
    -		memcpy(&sc->sc_ue.ue_eaddr[1], &ticks, sizeof(uint32_t));
    +		memcpy(&sc->sc_ue.ue_eaddr[1], &seed, sizeof(uint32_t));
     		sc->sc_ue.ue_eaddr[5] = device_get_unit(dev);
     
     	} else {
    
    Modified: stable/8/sys/kern/kern_clock.c
    ==============================================================================
    --- stable/8/sys/kern/kern_clock.c	Fri Mar  1 17:10:43 2013	(r247555)
    +++ stable/8/sys/kern/kern_clock.c	Fri Mar  1 17:10:52 2013	(r247556)
    @@ -379,7 +379,7 @@ static void watchdog_config(void *, u_in
     int	stathz;
     int	profhz;
     int	profprocs;
    -int	ticks;
    +volatile int	ticks;
     int	psratio;
     
     /*
    @@ -461,7 +461,7 @@ void
     hardclock(int usermode, uintfptr_t pc)
     {
     
    -	atomic_add_int((volatile int *)&ticks, 1);
    +	atomic_add_int(&ticks, 1);
     	hardclock_cpu(usermode);
     	tc_ticktock();
     	/*
    
    Modified: stable/8/sys/kern/kern_tc.c
    ==============================================================================
    --- stable/8/sys/kern/kern_tc.c	Fri Mar  1 17:10:43 2013	(r247555)
    +++ stable/8/sys/kern/kern_tc.c	Fri Mar  1 17:10:52 2013	(r247556)
    @@ -87,8 +87,8 @@ static struct timehands *volatile timeha
     struct timecounter *timecounter = &dummy_timecounter;
     static struct timecounter *timecounters = &dummy_timecounter;
     
    -time_t time_second = 1;
    -time_t time_uptime = 1;
    +volatile time_t time_second = 1;
    +volatile time_t time_uptime = 1;
     
     static struct bintime boottimebin;
     struct timeval boottime;
    
    Modified: stable/8/sys/pci/ncr.c
    ==============================================================================
    --- stable/8/sys/pci/ncr.c	Fri Mar  1 17:10:43 2013	(r247555)
    +++ stable/8/sys/pci/ncr.c	Fri Mar  1 17:10:52 2013	(r247556)
    @@ -1386,7 +1386,7 @@ static char *ncr_name (ncb_p np)
      * Kernel variables referenced in the scripts.
      * THESE MUST ALL BE ALIGNED TO A 4-BYTE BOUNDARY.
      */
    -static void *script_kvars[] =
    +static volatile void *script_kvars[] =
     	{ &time_second, &ticks, &ncr_cache };
     
     static	struct script script0 = {
    
    Modified: stable/8/sys/sys/kernel.h
    ==============================================================================
    --- stable/8/sys/sys/kernel.h	Fri Mar  1 17:10:43 2013	(r247555)
    +++ stable/8/sys/sys/kernel.h	Fri Mar  1 17:10:52 2013	(r247556)
    @@ -63,7 +63,7 @@ extern int psratio;			/* ratio: prof / s
     extern int stathz;			/* statistics clock's frequency */
     extern int profhz;			/* profiling clock's frequency */
     extern int profprocs;			/* number of process's profiling */
    -extern int ticks;
    +extern volatile int ticks;
     
     #endif /* _KERNEL */
     
    
    Modified: stable/8/sys/sys/time.h
    ==============================================================================
    --- stable/8/sys/sys/time.h	Fri Mar  1 17:10:43 2013	(r247555)
    +++ stable/8/sys/sys/time.h	Fri Mar  1 17:10:52 2013	(r247556)
    @@ -262,8 +262,8 @@ struct clockinfo {
     void	inittodr(time_t base);
     void	resettodr(void);
     
    -extern time_t	time_second;
    -extern time_t	time_uptime;
    +extern volatile time_t	time_second;
    +extern volatile time_t	time_uptime;
     extern struct timeval boottime;
     
     /*
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 17:13:51 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id A72A556A;
     Fri,  1 Mar 2013 17:13:51 +0000 (UTC)
     (envelope-from utisoft@gmail.com)
    Received: from mail-ia0-x230.google.com (mail-ia0-x230.google.com
     [IPv6:2607:f8b0:4001:c02::230])
     by mx1.freebsd.org (Postfix) with ESMTP id 29381A73;
     Fri,  1 Mar 2013 17:13:51 +0000 (UTC)
    Received: by mail-ia0-f176.google.com with SMTP id i18so2829689iac.35
     for ; Fri, 01 Mar 2013 09:13:50 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
     h=mime-version:x-received:in-reply-to:references:date:message-id
     :subject:from:to:cc:content-type;
     bh=aGA73waN9C3Lsyks7sCp7WrreV7pL9j1hx1Q5bYRnNM=;
     b=PXsWtY5/taT2rj9Gr7FjtaSPNLAtJya0N8ULNRKuayza2S7gWxkslBb7YQsybcWVUj
     s8+ld7xad0jVL1vInN0kiL7mGfJkryITdjkqv9IYSghQy49cZd016kQpwOtetcyC2gFl
     VA/C5wiZ8+2eJy5v/M3M5txeDDBG+j/BJ54zFizsSHzbhfS7S8x6v7RMVyWlK2FObxkZ
     15s/SjnC05devr2T3rvGiQbw3kGJXLubqYAifQDlKDj8/bu2pNuOqvU7fcBc2y8QR3gY
     X0NyXucrWihgXjltzPFMoxV3WatEszA+wLPz4hXoMAf9C3NQtFXqbgHDZIvyg7dVYSjK
     fq+w==
    MIME-Version: 1.0
    X-Received: by 10.50.42.165 with SMTP id p5mr13594041igl.75.1362158025688;
     Fri, 01 Mar 2013 09:13:45 -0800 (PST)
    Received: by 10.64.63.12 with HTTP; Fri, 1 Mar 2013 09:13:45 -0800 (PST)
    Received: by 10.64.63.12 with HTTP; Fri, 1 Mar 2013 09:13:45 -0800 (PST)
    In-Reply-To: <20130301142633.GA49921@stack.nl>
    References: <201302251905.r1PJ5fKF085179@svn.freebsd.org>
     <20130226000227.GA80718@stack.nl>
     <20130227082548.GF99210@server.rulingia.com>
     <20130301142633.GA49921@stack.nl>
    Date: Fri, 1 Mar 2013 17:13:45 +0000
    Message-ID: 
    Subject: Re: svn commit: r247274 - in head: bin/test tools/regression/bin/test
    From: Chris Rees 
    To: Jilles Tjoelker 
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: quoted-printable
    X-Content-Filtered-By: Mailman/MimeDel 2.1.14
    Cc: svn-src-head@freebsd.org, grog@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org, Peter Jeremy 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 17:13:51 -0000
    
    On 1 Mar 2013 14:27, "Jilles Tjoelker"  wrote:
    >
    > On Wed, Feb 27, 2013 at 07:25:48PM +1100, Peter Jeremy wrote:
    > > On 2013-Feb-26 01:02:27 +0100, Jilles Tjoelker  wrote:
    > > >>   Enhance test(1) by adding provision to compare any combination of
    the
    > > >>   access, birth, change and modify times of two files, instead of
    only
    > > >>   being able to compare modify times.  The builtin test in sh(1) wil=
    l
    > > >>   automagically acquire the same expansion.
    >
    > > >What do you need this for? If it is not needed very often, this test
    can
    > > >be done more portably (older FreeBSD and GNU) as
    > > >  [ -n "$(find -L FILE1 -prune -newerXY FILE2 2>/dev/null)" ]
    >
    > > In my case I needed to compare the ctime on one set of files with the
    > > mtime in another set.  I had a think about using find(1) and gave it
    > > away as too ugly.  That expression needs serious thought to understand
    > > and about =BD the tokens in the find(1) are to handle special cases -
    > > which is a further indication that it isn't ideal.
    >
    > Making everything ideal out of the box is not possible; it would bloat
    > up things too much and make scripts harder to read. There are many
    > possible extensions to avoid problems with special cases that would be
    > useful more frequently, such as arrays, ${PARAM/WORD/REPLACEMENT},
    > ${PARAM:START:LENGTH} and optional more useful signal handling.
    >
    > And I don't think this case is particularly bad. By defining the below
    > function
    >
    > file_newer() {
    >         test -n "$(find -L -- "$2" -prune -newer$1$3 "$4" 2>/dev/null)"
    > }
    >
    > you can do things like  file_newer m file1 c file2  to compare file1's
    > mtime to file2's ctime. The ugliness is isolated to the function
    > definition.
    >
    > The birth time is designated by B instead of b. This is because find(1)
    > wants B, and so does stat(1).
    >
    > Furthermore, it also allows  file_newer m file1 t '2 days ago'  to
    > compare to a specified time; however, only the second time can be 't'.
    >
    > It is also possible to query file times using stat(1). This allows
    > intuitive constructions like
    >   [ $(stat -f %m FILE1) -gt $(stat -f %c FILE2) ]
    > lets you compare to things like  $(($(date +%s) - 86400))  and allows
    > control whether symlinks should be followed. However, this may fork more
    > often than the find(1)-based approach and hard-codes the limitation to
    > seconds into the script unless you do something more complicated like
    >   [ $(stat -f %040.9Fm FILE1) \> $(stat -f %040.9Fc FILE2) ]
    > The test(1) syntax will also be incorrect if the files do not exist.
    >
    > The find(1) and stat(1) approaches also work in other shells such as
    > bash, ksh and zsh. An extension to test(1) can only be used by writing
    > ugly things like /bin/test. Whatever you may think of it, people write
    > scripts for those other shells and it is somewhat unfortunate that they
    > cannot use all FreeBSD-specific features.
    
    +1
    
    While I'm aware that we have many very useful extensions to sh, we should
    not sacrifice portability.
    
    We (porters) are on thin ground when complaining at upstream for assuming
    /bin/sh is bash when we have extensions such as these.
    
    Chris
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 17:37:59 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id EF9D9CB9;
     Fri,  1 Mar 2013 17:37:58 +0000 (UTC) (envelope-from dim@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 DFA21B62;
     Fri,  1 Mar 2013 17:37:58 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21Hbwsf026404;
     Fri, 1 Mar 2013 17:37:58 GMT (envelope-from dim@svn.freebsd.org)
    Received: (from dim@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21Hbw8i026402;
     Fri, 1 Mar 2013 17:37:58 GMT (envelope-from dim@svn.freebsd.org)
    Message-Id: <201303011737.r21Hbw8i026402@svn.freebsd.org>
    From: Dimitry Andric 
    Date: Fri, 1 Mar 2013 17:37: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: r247557 - stable/9/contrib/llvm/tools/clang/lib/Driver
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 17:37:59 -0000
    
    Author: dim
    Date: Fri Mar  1 17:37:57 2013
    New Revision: 247557
    URL: http://svnweb.freebsd.org/changeset/base/247557
    
    Log:
      MFC r247166:
      
      Pull in r172354 from upstream clang trunk:
      
        Refactor the x86 CPU name logic in the driver and pass -march and -mcpu
        flag information down from the Clang driver into the Gold linker plugin
        for LTO. This allows specifying -march on the linker commandline and
        should hopefully have it pass all the way through to the LTO optimizer.
      
        Fixes PR14697.
      
      Pull in r175919 from upstream clang trunk:
      
        Driver: Pass down the -march setting down to -cc1as on x86 too.
      
        The assembler historically didn't make use of any target features, but this has
        changed when support for old CPUs that don't support long nops was added.
      
      This should fix the long nops that still occurred in crt*.o, and
      possibly other object files, if the system was compiled for a CPU that
      does not support those, such as Geode.
      
      Note that gcc on i386 also does not pass through any -march, -mcpu or
      -mtune setting to gas, but this has not caused any trouble yet, because
      gas defaults to i386.
      
      Reported by:	lev
    
    Modified:
      stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
      stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.h
    Directory Properties:
      stable/9/contrib/llvm/   (props changed)
      stable/9/contrib/llvm/tools/clang/   (props changed)
    
    Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
    ==============================================================================
    --- stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp	Fri Mar  1 17:10:52 2013	(r247556)
    +++ stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp	Fri Mar  1 17:37:57 2013	(r247557)
    @@ -1114,10 +1114,59 @@ void Clang::AddSparcTargetArgs(const Arg
       }
     }
     
    +static const char *getX86TargetCPU(const ArgList &Args,
    +                                   const llvm::Triple &Triple) {
    +  if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) {
    +    if (StringRef(A->getValue()) != "native")
    +      return A->getValue();
    +
    +    // FIXME: Reject attempts to use -march=native unless the target matches
    +    // the host.
    +    //
    +    // FIXME: We should also incorporate the detected target features for use
    +    // with -native.
    +    std::string CPU = llvm::sys::getHostCPUName();
    +    if (!CPU.empty() && CPU != "generic")
    +      return Args.MakeArgString(CPU);
    +  }
    +
    +  // Select the default CPU if none was given (or detection failed).
    +
    +  if (Triple.getArch() != llvm::Triple::x86_64 &&
    +      Triple.getArch() != llvm::Triple::x86)
    +    return 0; // This routine is only handling x86 targets.
    +
    +  bool Is64Bit = Triple.getArch() == llvm::Triple::x86_64;
    +
    +  // FIXME: Need target hooks.
    +  if (Triple.isOSDarwin())
    +    return Is64Bit ? "core2" : "yonah";
    +
    +  // Everything else goes to x86-64 in 64-bit mode.
    +  if (Is64Bit)
    +    return "x86-64";
    +
    +  if (Triple.getOSName().startswith("haiku"))
    +    return "i586";
    +  if (Triple.getOSName().startswith("openbsd"))
    +    return "i486";
    +  if (Triple.getOSName().startswith("bitrig"))
    +    return "i686";
    +  if (Triple.getOSName().startswith("freebsd"))
    +    return "i486";
    +  if (Triple.getOSName().startswith("netbsd"))
    +    return "i486";
    +  // All x86 devices running Android have core2 as their common
    +  // denominator. This makes a better choice than pentium4.
    +  if (Triple.getEnvironment() == llvm::Triple::Android)
    +    return "core2";
    +
    +  // Fallback to p4.
    +  return "pentium4";
    +}
    +
     void Clang::AddX86TargetArgs(const ArgList &Args,
                                  ArgStringList &CmdArgs) const {
    -  const bool isAndroid =
    -    getToolChain().getTriple().getEnvironment() == llvm::Triple::Android;
       if (!Args.hasFlag(options::OPT_mred_zone,
                         options::OPT_mno_red_zone,
                         true) ||
    @@ -1130,65 +1179,7 @@ void Clang::AddX86TargetArgs(const ArgLi
                        false))
         CmdArgs.push_back("-no-implicit-float");
     
    -  const char *CPUName = 0;
    -  if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) {
    -    if (StringRef(A->getValue()) == "native") {
    -      // FIXME: Reject attempts to use -march=native unless the target matches
    -      // the host.
    -      //
    -      // FIXME: We should also incorporate the detected target features for use
    -      // with -native.
    -      std::string CPU = llvm::sys::getHostCPUName();
    -      if (!CPU.empty() && CPU != "generic")
    -        CPUName = Args.MakeArgString(CPU);
    -    } else
    -      CPUName = A->getValue();
    -  }
    -
    -  // Select the default CPU if none was given (or detection failed).
    -  if (!CPUName) {
    -    // FIXME: Need target hooks.
    -    if (getToolChain().getTriple().isOSDarwin()) {
    -      if (getToolChain().getArch() == llvm::Triple::x86_64)
    -        CPUName = "core2";
    -      else if (getToolChain().getArch() == llvm::Triple::x86)
    -        CPUName = "yonah";
    -    } else if (getToolChain().getOS().startswith("haiku"))  {
    -      if (getToolChain().getArch() == llvm::Triple::x86_64)
    -        CPUName = "x86-64";
    -      else if (getToolChain().getArch() == llvm::Triple::x86)
    -        CPUName = "i586";
    -    } else if (getToolChain().getOS().startswith("openbsd"))  {
    -      if (getToolChain().getArch() == llvm::Triple::x86_64)
    -        CPUName = "x86-64";
    -      else if (getToolChain().getArch() == llvm::Triple::x86)
    -        CPUName = "i486";
    -    } else if (getToolChain().getOS().startswith("bitrig"))  {
    -      if (getToolChain().getArch() == llvm::Triple::x86_64)
    -        CPUName = "x86-64";
    -      else if (getToolChain().getArch() == llvm::Triple::x86)
    -        CPUName = "i686";
    -    } else if (getToolChain().getOS().startswith("freebsd"))  {
    -      if (getToolChain().getArch() == llvm::Triple::x86_64)
    -        CPUName = "x86-64";
    -      else if (getToolChain().getArch() == llvm::Triple::x86)
    -        CPUName = "i486";
    -    } else if (getToolChain().getOS().startswith("netbsd"))  {
    -      if (getToolChain().getArch() == llvm::Triple::x86_64)
    -        CPUName = "x86-64";
    -      else if (getToolChain().getArch() == llvm::Triple::x86)
    -        CPUName = "i486";
    -    } else {
    -      if (getToolChain().getArch() == llvm::Triple::x86_64)
    -        CPUName = "x86-64";
    -      else if (getToolChain().getArch() == llvm::Triple::x86)
    -        // All x86 devices running Android have core2 as their common
    -        // denominator. This makes a better choice than pentium4.
    -        CPUName = isAndroid ? "core2" : "pentium4";
    -    }
    -  }
    -
    -  if (CPUName) {
    +  if (const char *CPUName = getX86TargetCPU(Args, getToolChain().getTriple())) {
         CmdArgs.push_back("-target-cpu");
         CmdArgs.push_back(CPUName);
       }
    @@ -3091,6 +3082,15 @@ void ClangAs::AddARMTargetArgs(const Arg
         addFPMathArgs(D, A, Args, CmdArgs, getARMTargetCPU(Args, Triple));
     }
     
    +void ClangAs::AddX86TargetArgs(const ArgList &Args,
    +                               ArgStringList &CmdArgs) const {
    +  // Set the CPU based on -march=.
    +  if (const char *CPUName = getX86TargetCPU(Args, getToolChain().getTriple())) {
    +    CmdArgs.push_back("-target-cpu");
    +    CmdArgs.push_back(CPUName);
    +  }
    +}
    +
     /// Add options related to the Objective-C runtime/ABI.
     ///
     /// Returns true if the runtime is non-fragile.
    @@ -3261,6 +3261,11 @@ void ClangAs::ConstructJob(Compilation &
       case llvm::Triple::thumb:
         AddARMTargetArgs(Args, CmdArgs);
         break;
    +
    +  case llvm::Triple::x86:
    +  case llvm::Triple::x86_64:
    +    AddX86TargetArgs(Args, CmdArgs);
    +    break;
       }
     
       // Ignore explicit -force_cpusubtype_ALL option.
    @@ -6068,8 +6073,27 @@ void linuxtools::Link::ConstructJob(Comp
         CmdArgs.push_back("-plugin");
         std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
         CmdArgs.push_back(Args.MakeArgString(Plugin));
    +
    +    // Try to pass driver level flags relevant to LTO code generation down to
    +    // the plugin.
    +
    +    // Handle architecture-specific flags for selecting CPU variants.
    +    if (ToolChain.getArch() == llvm::Triple::x86 ||
    +        ToolChain.getArch() == llvm::Triple::x86_64)
    +      CmdArgs.push_back(
    +          Args.MakeArgString(Twine("-plugin-opt=mcpu=") +
    +                             getX86TargetCPU(Args, ToolChain.getTriple())));
    +    else if (ToolChain.getArch() == llvm::Triple::arm ||
    +             ToolChain.getArch() == llvm::Triple::thumb)
    +      CmdArgs.push_back(
    +          Args.MakeArgString(Twine("-plugin-opt=mcpu=") +
    +                             getARMTargetCPU(Args, ToolChain.getTriple())));
    +
    +    // FIXME: Factor out logic for MIPS, PPC, and other targets to support this
    +    // as well.
       }
     
    +
       if (Args.hasArg(options::OPT_Z_Xlinker__no_demangle))
         CmdArgs.push_back("--no-demangle");
     
    
    Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.h
    ==============================================================================
    --- stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.h	Fri Mar  1 17:10:52 2013	(r247556)
    +++ stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.h	Fri Mar  1 17:37:57 2013	(r247557)
    @@ -68,6 +68,7 @@ namespace tools {
       /// \brief Clang integrated assembler tool.
       class LLVM_LIBRARY_VISIBILITY ClangAs : public Tool {
         void AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
    +    void AddX86TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
       public:
         ClangAs(const ToolChain &TC) : Tool("clang::as",
                                             "clang integrated assembler", TC) {}
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 18:39:47 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id EC6EDB5D;
     Fri,  1 Mar 2013 18:39:47 +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 DDF67F20;
     Fri,  1 Mar 2013 18:39:47 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21IdluV044651;
     Fri, 1 Mar 2013 18:39:47 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21Idlr6044648;
     Fri, 1 Mar 2013 18:39:47 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011839.r21Idlr6044648@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 18:39:47 +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: r247558 - in stable/9/sys: amd64/linux32 compat/linux
     i386/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-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 18:39:48 -0000
    
    Author: jhb
    Date: Fri Mar  1 18:39:46 2013
    New Revision: 247558
    URL: http://svnweb.freebsd.org/changeset/base/247558
    
    Log:
      MFC 245849:
      Don't assume that all Linux TCP-level socket options are identical to
      FreeBSD TCP-level socket options (only the first two are).  Instead,
      using a mapping function and fail unsupported options as we do for other
      socket option levels.
    
    Modified:
      stable/9/sys/amd64/linux32/linux.h
      stable/9/sys/compat/linux/linux_socket.c
      stable/9/sys/i386/linux/linux.h
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/amd64/linux32/linux.h
    ==============================================================================
    --- stable/9/sys/amd64/linux32/linux.h	Fri Mar  1 17:37:57 2013	(r247557)
    +++ stable/9/sys/amd64/linux32/linux.h	Fri Mar  1 18:39:46 2013	(r247558)
    @@ -725,6 +725,13 @@ union l_semun {
     #define	LINUX_IP_ADD_MEMBERSHIP		35
     #define	LINUX_IP_DROP_MEMBERSHIP	36
     
    +#define	LINUX_TCP_NODELAY	1
    +#define	LINUX_TCP_MAXSEG	2
    +#define	LINUX_TCP_KEEPIDLE	4
    +#define	LINUX_TCP_KEEPINTVL	5
    +#define	LINUX_TCP_KEEPCNT	6
    +#define	LINUX_TCP_MD5SIG	14
    +
     struct l_sockaddr {
     	l_ushort	sa_family;
     	char		sa_data[14];
    
    Modified: stable/9/sys/compat/linux/linux_socket.c
    ==============================================================================
    --- stable/9/sys/compat/linux/linux_socket.c	Fri Mar  1 17:37:57 2013	(r247557)
    +++ stable/9/sys/compat/linux/linux_socket.c	Fri Mar  1 18:39:46 2013	(r247558)
    @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    +#include 
     #ifdef INET6
     #include 
     #include 
    @@ -326,6 +327,27 @@ linux_to_bsd_so_sockopt(int opt)
     }
     
     static int
    +linux_to_bsd_tcp_sockopt(int opt)
    +{
    +
    +	switch (opt) {
    +	case LINUX_TCP_NODELAY:
    +		return (TCP_NODELAY);
    +	case LINUX_TCP_MAXSEG:
    +		return (TCP_MAXSEG);
    +	case LINUX_TCP_KEEPIDLE:
    +		return (TCP_KEEPIDLE);
    +	case LINUX_TCP_KEEPINTVL:
    +		return (TCP_KEEPINTVL);
    +	case LINUX_TCP_KEEPCNT:
    +		return (TCP_KEEPCNT);
    +	case LINUX_TCP_MD5SIG:
    +		return (TCP_MD5SIG);
    +	}
    +	return (-1);
    +}
    +
    +static int
     linux_to_bsd_msg_flags(int flags)
     {
     	int ret_flags = 0;
    @@ -1496,8 +1518,7 @@ linux_setsockopt(struct thread *td, stru
     		name = linux_to_bsd_ip_sockopt(args->optname);
     		break;
     	case IPPROTO_TCP:
    -		/* Linux TCP option values match BSD's */
    -		name = args->optname;
    +		name = linux_to_bsd_tcp_sockopt(args->optname);
     		break;
     	default:
     		name = -1;
    @@ -1591,8 +1612,7 @@ linux_getsockopt(struct thread *td, stru
     		name = linux_to_bsd_ip_sockopt(args->optname);
     		break;
     	case IPPROTO_TCP:
    -		/* Linux TCP option values match BSD's */
    -		name = args->optname;
    +		name = linux_to_bsd_tcp_sockopt(args->optname);
     		break;
     	default:
     		name = -1;
    
    Modified: stable/9/sys/i386/linux/linux.h
    ==============================================================================
    --- stable/9/sys/i386/linux/linux.h	Fri Mar  1 17:37:57 2013	(r247557)
    +++ stable/9/sys/i386/linux/linux.h	Fri Mar  1 18:39:46 2013	(r247558)
    @@ -701,6 +701,13 @@ union l_semun {
     #define	LINUX_IP_ADD_MEMBERSHIP		35
     #define	LINUX_IP_DROP_MEMBERSHIP	36
     
    +#define	LINUX_TCP_NODELAY	1
    +#define	LINUX_TCP_MAXSEG	2
    +#define	LINUX_TCP_KEEPIDLE	4
    +#define	LINUX_TCP_KEEPINTVL	5
    +#define	LINUX_TCP_KEEPCNT	6
    +#define	LINUX_TCP_MD5SIG	14
    +
     struct l_sockaddr {
     	l_ushort	sa_family;
     	char		sa_data[14];
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 18:39:56 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 760E0CBB;
     Fri,  1 Mar 2013 18:39:56 +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 688C5F22;
     Fri,  1 Mar 2013 18:39:56 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21IduOJ044708;
     Fri, 1 Mar 2013 18:39:56 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21IdtfS044705;
     Fri, 1 Mar 2013 18:39:55 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011839.r21IdtfS044705@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 18:39:55 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247559 - in stable/8/sys: amd64/linux32 compat/linux
     i386/linux
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 18:39:56 -0000
    
    Author: jhb
    Date: Fri Mar  1 18:39:55 2013
    New Revision: 247559
    URL: http://svnweb.freebsd.org/changeset/base/247559
    
    Log:
      MFC 245849:
      Don't assume that all Linux TCP-level socket options are identical to
      FreeBSD TCP-level socket options (only the first two are).  Instead,
      using a mapping function and fail unsupported options as we do for other
      socket option levels.
    
    Modified:
      stable/8/sys/amd64/linux32/linux.h
      stable/8/sys/compat/linux/linux_socket.c
      stable/8/sys/i386/linux/linux.h
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/amd64/   (props changed)
      stable/8/sys/compat/   (props changed)
      stable/8/sys/i386/   (props changed)
    
    Modified: stable/8/sys/amd64/linux32/linux.h
    ==============================================================================
    --- stable/8/sys/amd64/linux32/linux.h	Fri Mar  1 18:39:46 2013	(r247558)
    +++ stable/8/sys/amd64/linux32/linux.h	Fri Mar  1 18:39:55 2013	(r247559)
    @@ -721,6 +721,13 @@ union l_semun {
     #define	LINUX_IP_ADD_MEMBERSHIP		35
     #define	LINUX_IP_DROP_MEMBERSHIP	36
     
    +#define	LINUX_TCP_NODELAY	1
    +#define	LINUX_TCP_MAXSEG	2
    +#define	LINUX_TCP_KEEPIDLE	4
    +#define	LINUX_TCP_KEEPINTVL	5
    +#define	LINUX_TCP_KEEPCNT	6
    +#define	LINUX_TCP_MD5SIG	14
    +
     struct l_sockaddr {
     	l_ushort	sa_family;
     	char		sa_data[14];
    
    Modified: stable/8/sys/compat/linux/linux_socket.c
    ==============================================================================
    --- stable/8/sys/compat/linux/linux_socket.c	Fri Mar  1 18:39:46 2013	(r247558)
    +++ stable/8/sys/compat/linux/linux_socket.c	Fri Mar  1 18:39:55 2013	(r247559)
    @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    +#include 
     #ifdef INET6
     #include 
     #include 
    @@ -334,6 +335,21 @@ linux_to_bsd_so_sockopt(int opt)
     }
     
     static int
    +linux_to_bsd_tcp_sockopt(int opt)
    +{
    +
    +	switch (opt) {
    +	case LINUX_TCP_NODELAY:
    +		return (TCP_NODELAY);
    +	case LINUX_TCP_MAXSEG:
    +		return (TCP_MAXSEG);
    +	case LINUX_TCP_MD5SIG:
    +		return (TCP_MD5SIG);
    +	}
    +	return (-1);
    +}
    +
    +static int
     linux_to_bsd_msg_flags(int flags)
     {
     	int ret_flags = 0;
    @@ -1504,8 +1520,7 @@ linux_setsockopt(struct thread *td, stru
     		name = linux_to_bsd_ip_sockopt(args->optname);
     		break;
     	case IPPROTO_TCP:
    -		/* Linux TCP option values match BSD's */
    -		name = args->optname;
    +		name = linux_to_bsd_tcp_sockopt(args->optname);
     		break;
     	default:
     		name = -1;
    @@ -1599,8 +1614,7 @@ linux_getsockopt(struct thread *td, stru
     		name = linux_to_bsd_ip_sockopt(args->optname);
     		break;
     	case IPPROTO_TCP:
    -		/* Linux TCP option values match BSD's */
    -		name = args->optname;
    +		name = linux_to_bsd_tcp_sockopt(args->optname);
     		break;
     	default:
     		name = -1;
    
    Modified: stable/8/sys/i386/linux/linux.h
    ==============================================================================
    --- stable/8/sys/i386/linux/linux.h	Fri Mar  1 18:39:46 2013	(r247558)
    +++ stable/8/sys/i386/linux/linux.h	Fri Mar  1 18:39:55 2013	(r247559)
    @@ -697,6 +697,13 @@ union l_semun {
     #define	LINUX_IP_ADD_MEMBERSHIP		35
     #define	LINUX_IP_DROP_MEMBERSHIP	36
     
    +#define	LINUX_TCP_NODELAY	1
    +#define	LINUX_TCP_MAXSEG	2
    +#define	LINUX_TCP_KEEPIDLE	4
    +#define	LINUX_TCP_KEEPINTVL	5
    +#define	LINUX_TCP_KEEPCNT	6
    +#define	LINUX_TCP_MD5SIG	14
    +
     struct l_sockaddr {
     	l_ushort	sa_family;
     	char		sa_data[14];
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 18:40:15 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 3EDA9DED;
     Fri,  1 Mar 2013 18:40:15 +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 30486F2C;
     Fri,  1 Mar 2013 18:40:15 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21IeFYY046236;
     Fri, 1 Mar 2013 18:40:15 GMT (envelope-from kib@svn.freebsd.org)
    Received: (from kib@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21IeF27046235;
     Fri, 1 Mar 2013 18:40:15 GMT (envelope-from kib@svn.freebsd.org)
    Message-Id: <201303011840.r21IeF27046235@svn.freebsd.org>
    From: Konstantin Belousov 
    Date: Fri, 1 Mar 2013 18:40:15 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247560 - head/sys/kern
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 18:40:15 -0000
    
    Author: kib
    Date: Fri Mar  1 18:40:14 2013
    New Revision: 247560
    URL: http://svnweb.freebsd.org/changeset/base/247560
    
    Log:
      Make the default implementation of the VOP_VPTOCNP() fail if the
      directory entry, matched by the inode number, is ".".
      
      NFSv4 client might instantiate the distinct vnodes which have the same
      inode number, since single v4 export can be combined from several
      filesystems on the server.  For instance, a case when the nested
      server mount point is exactly one directory below the top of the
      export, causes directory and its parent to have the same inode number
      2.  The vop_stdvptocnp() algorithm then returns "." as the name of the
      lower directory.
      
      Filtering out the "." entry with ENOENT works around this behaviour,
      the error forces getcwd(3) to fall back to usermode implementation,
      which compares both st_dev and st_ino.
      
      Based on the submission by:	rmacklem
      Tested by:	rmacklem
      MFC after:	1 week
    
    Modified:
      head/sys/kern/vfs_default.c
    
    Modified: head/sys/kern/vfs_default.c
    ==============================================================================
    --- head/sys/kern/vfs_default.c	Fri Mar  1 18:39:55 2013	(r247559)
    +++ head/sys/kern/vfs_default.c	Fri Mar  1 18:40:14 2013	(r247560)
    @@ -856,8 +856,12 @@ vop_stdvptocnp(struct vop_vptocnp_args *
     				error = ENOMEM;
     				goto out;
     			}
    -			bcopy(dp->d_name, buf + i, dp->d_namlen);
    -			error = 0;
    +			if (dp->d_namlen == 1 && dp->d_name[0] == '.') {
    +				error = ENOENT;
    +			} else {
    +				bcopy(dp->d_name, buf + i, dp->d_namlen);
    +				error = 0;
    +			}
     			goto out;
     		}
     	} while (len > 0 || !eofflag);
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 18:49:14 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id EEDFA127;
     Fri,  1 Mar 2013 18:49: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 E19EBF67;
     Fri,  1 Mar 2013 18:49:14 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21InEFl047655;
     Fri, 1 Mar 2013 18:49:14 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21InEL3047654;
     Fri, 1 Mar 2013 18:49:14 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303011849.r21InEL3047654@svn.freebsd.org>
    From: Marius Strobl 
    Date: Fri, 1 Mar 2013 18:49:14 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247561 - head/sys/kern
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 18:49:15 -0000
    
    Author: marius
    Date: Fri Mar  1 18:49:14 2013
    New Revision: 247561
    URL: http://svnweb.freebsd.org/changeset/base/247561
    
    Log:
      - Use strdup(9) instead of reimplementing it.
      - Use __DECONST instead of strange casts.
      - Reduce code duplication and simplify name2oid().
      
      PR:		176373
      Submitted by:	Christoph Mallon
      MFC after:	1 week
    
    Modified:
      head/sys/kern/kern_sysctl.c
    
    Modified: head/sys/kern/kern_sysctl.c
    ==============================================================================
    --- head/sys/kern/kern_sysctl.c	Fri Mar  1 18:40:14 2013	(r247560)
    +++ head/sys/kern/kern_sysctl.c	Fri Mar  1 18:49:14 2013	(r247561)
    @@ -444,9 +444,9 @@ sysctl_remove_oid_locked(struct sysctl_o
     				SYSCTL_SLEEP(&oidp->oid_running, "oidrm", 0);
     			}
     			if (oidp->oid_descr)
    -				free((void *)(uintptr_t)(const void *)oidp->oid_descr, M_SYSCTLOID);
    -			free((void *)(uintptr_t)(const void *)oidp->oid_name,
    -			     M_SYSCTLOID);
    +				free(__DECONST(char *, oidp->oid_descr),
    +				    M_SYSCTLOID);
    +			free(__DECONST(char *, oidp->oid_name), M_SYSCTLOID);
     			free(oidp, M_SYSCTLOID);
     		}
     	}
    @@ -462,8 +462,6 @@ sysctl_add_oid(struct sysctl_ctx_list *c
     	int (*handler)(SYSCTL_HANDLER_ARGS), const char *fmt, const char *descr)
     {
     	struct sysctl_oid *oidp;
    -	ssize_t len;
    -	char *newname;
     
     	/* You have to hook up somewhere.. */
     	if (parent == NULL)
    @@ -490,11 +488,7 @@ sysctl_add_oid(struct sysctl_ctx_list *c
     	SLIST_NEXT(oidp, oid_link) = NULL;
     	oidp->oid_number = number;
     	oidp->oid_refcnt = 1;
    -	len = strlen(name);
    -	newname = malloc(len + 1, M_SYSCTLOID, M_WAITOK);
    -	bcopy(name, newname, len + 1);
    -	newname[len] = '\0';
    -	oidp->oid_name = newname;
    +	oidp->oid_name = strdup(name, M_SYSCTLOID);
     	oidp->oid_handler = handler;
     	oidp->oid_kind = CTLFLAG_DYN | kind;
     	if ((kind & CTLTYPE) == CTLTYPE_NODE) {
    @@ -508,12 +502,8 @@ sysctl_add_oid(struct sysctl_ctx_list *c
     		oidp->oid_arg2 = arg2;
     	}
     	oidp->oid_fmt = fmt;
    -	if (descr) {
    -		int len = strlen(descr) + 1;
    -		oidp->oid_descr = malloc(len, M_SYSCTLOID, M_WAITOK);
    -		if (oidp->oid_descr)
    -			strcpy((char *)(uintptr_t)(const void *)oidp->oid_descr, descr);
    -	}
    +	if (descr)
    +		oidp->oid_descr = strdup(descr, M_SYSCTLOID);
     	/* Update the context, if used */
     	if (clist != NULL)
     		sysctl_ctx_entry_add(clist, oidp);
    @@ -529,16 +519,12 @@ sysctl_add_oid(struct sysctl_ctx_list *c
     void
     sysctl_rename_oid(struct sysctl_oid *oidp, const char *name)
     {
    -	ssize_t len;
     	char *newname;
    -	void *oldname;
    +	char *oldname;
     
    -	len = strlen(name);
    -	newname = malloc(len + 1, M_SYSCTLOID, M_WAITOK);
    -	bcopy(name, newname, len + 1);
    -	newname[len] = '\0';
    +	newname = strdup(name, M_SYSCTLOID);
     	SYSCTL_XLOCK();
    -	oldname = (void *)(uintptr_t)(const void *)oidp->oid_name;
    +	oldname = __DECONST(char *, oidp->oid_name);
     	oidp->oid_name = newname;
     	SYSCTL_XUNLOCK();
     	free(oldname, M_SYSCTLOID);
    @@ -823,39 +809,26 @@ static SYSCTL_NODE(_sysctl, 2, next, CTL
     static int
     name2oid(char *name, int *oid, int *len, struct sysctl_oid **oidpp)
     {
    -	int i;
     	struct sysctl_oid *oidp;
     	struct sysctl_oid_list *lsp = &sysctl__children;
     	char *p;
     
     	SYSCTL_ASSERT_XLOCKED();
     
    -	if (!*name)
    -		return (ENOENT);
    +	for (*len = 0; *len < CTL_MAXNAME;) {
    +		p = strsep(&name, ".");
     
    -	p = name + strlen(name) - 1 ;
    -	if (*p == '.')
    -		*p = '\0';
    -
    -	*len = 0;
    -
    -	for (p = name; *p && *p != '.'; p++) 
    -		;
    -	i = *p;
    -	if (i == '.')
    -		*p = '\0';
    -
    -	oidp = SLIST_FIRST(lsp);
    -
    -	while (oidp && *len < CTL_MAXNAME) {
    -		if (strcmp(name, oidp->oid_name)) {
    -			oidp = SLIST_NEXT(oidp, oid_link);
    -			continue;
    +		oidp = SLIST_FIRST(lsp);
    +		for (;; oidp = SLIST_NEXT(oidp, oid_link)) {
    +			if (oidp == NULL)
    +				return (ENOENT);
    +			if (strcmp(p, oidp->oid_name) == 0)
    +				break;
     		}
     		*oid++ = oidp->oid_number;
     		(*len)++;
     
    -		if (!i) {
    +		if (name == NULL || *name == '\0') {
     			if (oidpp)
     				*oidpp = oidp;
     			return (0);
    @@ -868,13 +841,6 @@ name2oid(char *name, int *oid, int *len,
     			break;
     
     		lsp = SYSCTL_CHILDREN(oidp);
    -		oidp = SLIST_FIRST(lsp);
    -		name = p+1;
    -		for (p = name; *p && *p != '.'; p++) 
    -				;
    -		i = *p;
    -		if (i == '.')
    -			*p = '\0';
     	}
     	return (ENOENT);
     }
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 19:01:41 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 2B1A36A7;
     Fri,  1 Mar 2013 19:01:41 +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 1CE0E1018;
     Fri,  1 Mar 2013 19:01:41 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21J1eu3052710;
     Fri, 1 Mar 2013 19:01:41 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21J1eGq052708;
     Fri, 1 Mar 2013 19:01:40 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011901.r21J1eGq052708@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 19:01: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: r247562 - stable/9/usr.sbin/tcpdrop
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 19:01:41 -0000
    
    Author: jhb
    Date: Fri Mar  1 19:01:40 2013
    New Revision: 247562
    URL: http://svnweb.freebsd.org/changeset/base/247562
    
    Log:
      MFC 246129:
      Allow the address and ports to be separated by a colon or period rather
      than a space to permit directly pasting the output of commands such as
      netstat and sockstat on the command line.
    
    Modified:
      stable/9/usr.sbin/tcpdrop/tcpdrop.8
      stable/9/usr.sbin/tcpdrop/tcpdrop.c
    Directory Properties:
      stable/9/usr.sbin/tcpdrop/   (props changed)
    
    Modified: stable/9/usr.sbin/tcpdrop/tcpdrop.8
    ==============================================================================
    --- stable/9/usr.sbin/tcpdrop/tcpdrop.8	Fri Mar  1 18:49:14 2013	(r247561)
    +++ stable/9/usr.sbin/tcpdrop/tcpdrop.8	Fri Mar  1 19:01:40 2013	(r247562)
    @@ -17,7 +17,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd March 24, 2009
    +.Dd January 30, 2013
     .Dt TCPDROP 8
     .Os
     .Sh NAME
    @@ -62,6 +62,9 @@ will be dropped.
     .Pp
     Addresses and ports may be specified by name or numeric value.
     Both IPv4 and IPv6 address formats are supported.
    +.Pp
    +The addresses and ports may be separated by periods or colons
    +instead of spaces.
     .Sh EXIT STATUS
     .Ex -std
     .Sh EXAMPLES
    
    Modified: stable/9/usr.sbin/tcpdrop/tcpdrop.c
    ==============================================================================
    --- stable/9/usr.sbin/tcpdrop/tcpdrop.c	Fri Mar  1 18:49:14 2013	(r247561)
    +++ stable/9/usr.sbin/tcpdrop/tcpdrop.c	Fri Mar  1 19:01:40 2013	(r247562)
    @@ -50,6 +50,7 @@ struct host_service {
     
     static bool tcpdrop_list_commands = false;
     
    +static char *findport(const char *);
     static struct xinpgen *getxpcblist(const char *);
     static void sockinfo(const struct sockaddr *, struct host_service *);
     static bool tcpdrop(const struct sockaddr *, const struct sockaddr *);
    @@ -65,6 +66,7 @@ static void usage(void);
     int
     main(int argc, char *argv[])
     {
    +	char *lport, *fport;
     	bool dropall;
     	int ch;
     
    @@ -93,15 +95,43 @@ main(int argc, char *argv[])
     		exit(0);
     	}
     
    -	if (argc != 4 || tcpdrop_list_commands)
    +	if ((argc != 2 && argc != 4) || tcpdrop_list_commands)
     		usage();
     
    -	if (!tcpdropbyname(argv[0], argv[1], argv[2], argv[3]))
    +	if (argc == 2) {
    +		lport = findport(argv[0]);
    +		fport = findport(argv[1]);
    +		if (lport == NULL || lport[1] == '\0' || fport == NULL ||
    +		    fport[1] == '\0')
    +			usage();
    +		*lport++ = '\0';
    +		*fport++ = '\0';
    +		if (!tcpdropbyname(argv[0], lport, argv[1], fport))
    +			exit(1);
    +	} else if (!tcpdropbyname(argv[0], argv[1], argv[2], argv[3]))
     		exit(1);
     
     	exit(0);
     }
     
    +static char *
    +findport(const char *arg)
    +{
    +	char *dot, *colon;
    +
    +	/* A strrspn() or strrpbrk() would be nice. */
    +	dot = strrchr(arg, '.');
    +	colon = strrchr(arg, ':');
    +	if (dot == NULL)
    +		return (colon);
    +	if (colon == NULL)
    +		return (dot);
    +	if (dot < colon)
    +		return (colon);
    +	else
    +		return (dot);
    +}
    +
     static struct xinpgen *
     getxpcblist(const char *name)
     {
    @@ -237,7 +267,7 @@ tcpdropbyname(const char *lhost, const c
     	error = getaddrinfo(fhost, fport, &hints, &foreign);
     	if (error != 0) {
     		freeaddrinfo(local); /* XXX gratuitous */
    -		errx(1, "getaddrinfo: %s port %s: %s", lhost, lport,
    +		errx(1, "getaddrinfo: %s port %s: %s", fhost, fport,
     		    gai_strerror(error));
     	}
     
    @@ -318,6 +348,8 @@ usage(void)
     {
     	fprintf(stderr,
     "usage: tcpdrop local-address local-port foreign-address foreign-port\n"
    +"       tcpdrop local-address:local-port foreign-address:foreign-port\n"
    +"       tcpdrop local-address.local-port foreign-address.foreign-port\n"
     "       tcpdrop [-l] -a\n");
     	exit(1);
     }
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 19:01:53 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id AF1BD7C5;
     Fri,  1 Mar 2013 19:01:53 +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 A20A71019;
     Fri,  1 Mar 2013 19:01:53 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21J1rJY052785;
     Fri, 1 Mar 2013 19:01:53 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21J1rJ9052783;
     Fri, 1 Mar 2013 19:01:53 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011901.r21J1rJ9052783@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 19:01:53 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247563 - stable/8/usr.sbin/tcpdrop
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 19:01:53 -0000
    
    Author: jhb
    Date: Fri Mar  1 19:01:52 2013
    New Revision: 247563
    URL: http://svnweb.freebsd.org/changeset/base/247563
    
    Log:
      MFC 246129:
      Allow the address and ports to be separated by a colon or period rather
      than a space to permit directly pasting the output of commands such as
      netstat and sockstat on the command line.
    
    Modified:
      stable/8/usr.sbin/tcpdrop/tcpdrop.8
      stable/8/usr.sbin/tcpdrop/tcpdrop.c
    Directory Properties:
      stable/8/usr.sbin/tcpdrop/   (props changed)
    
    Modified: stable/8/usr.sbin/tcpdrop/tcpdrop.8
    ==============================================================================
    --- stable/8/usr.sbin/tcpdrop/tcpdrop.8	Fri Mar  1 19:01:40 2013	(r247562)
    +++ stable/8/usr.sbin/tcpdrop/tcpdrop.8	Fri Mar  1 19:01:52 2013	(r247563)
    @@ -17,7 +17,7 @@
     .\"
     .\" $FreeBSD$
     .\"
    -.Dd March 24, 2009
    +.Dd January 30, 2013
     .Dt TCPDROP 8
     .Os
     .Sh NAME
    @@ -62,6 +62,9 @@ will be dropped.
     .Pp
     Addresses and ports may be specified by name or numeric value.
     Both IPv4 and IPv6 address formats are supported.
    +.Pp
    +The addresses and ports may be separated by periods or colons
    +instead of spaces.
     .Sh EXIT STATUS
     .Ex -std
     .Sh EXAMPLES
    
    Modified: stable/8/usr.sbin/tcpdrop/tcpdrop.c
    ==============================================================================
    --- stable/8/usr.sbin/tcpdrop/tcpdrop.c	Fri Mar  1 19:01:40 2013	(r247562)
    +++ stable/8/usr.sbin/tcpdrop/tcpdrop.c	Fri Mar  1 19:01:52 2013	(r247563)
    @@ -49,6 +49,7 @@ struct host_service {
     
     static bool tcpdrop_list_commands = false;
     
    +static char *findport(const char *);
     static struct xinpgen *getxpcblist(const char *);
     static void sockinfo(const struct sockaddr *, struct host_service *);
     static bool tcpdrop(const struct sockaddr *, const struct sockaddr *);
    @@ -64,6 +65,7 @@ static void usage(void);
     int
     main(int argc, char *argv[])
     {
    +	char *lport, *fport;
     	bool dropall;
     	int ch;
     
    @@ -92,15 +94,43 @@ main(int argc, char *argv[])
     		exit(0);
     	}
     
    -	if (argc != 4 || tcpdrop_list_commands)
    +	if ((argc != 2 && argc != 4) || tcpdrop_list_commands)
     		usage();
     
    -	if (!tcpdropbyname(argv[0], argv[1], argv[2], argv[3]))
    +	if (argc == 2) {
    +		lport = findport(argv[0]);
    +		fport = findport(argv[1]);
    +		if (lport == NULL || lport[1] == '\0' || fport == NULL ||
    +		    fport[1] == '\0')
    +			usage();
    +		*lport++ = '\0';
    +		*fport++ = '\0';
    +		if (!tcpdropbyname(argv[0], lport, argv[1], fport))
    +			exit(1);
    +	} else if (!tcpdropbyname(argv[0], argv[1], argv[2], argv[3]))
     		exit(1);
     
     	exit(0);
     }
     
    +static char *
    +findport(const char *arg)
    +{
    +	char *dot, *colon;
    +
    +	/* A strrspn() or strrpbrk() would be nice. */
    +	dot = strrchr(arg, '.');
    +	colon = strrchr(arg, ':');
    +	if (dot == NULL)
    +		return (colon);
    +	if (colon == NULL)
    +		return (dot);
    +	if (dot < colon)
    +		return (colon);
    +	else
    +		return (dot);
    +}
    +
     static struct xinpgen *
     getxpcblist(const char *name)
     {
    @@ -236,7 +266,7 @@ tcpdropbyname(const char *lhost, const c
     	error = getaddrinfo(fhost, fport, &hints, &foreign);
     	if (error != 0) {
     		freeaddrinfo(local); /* XXX gratuitous */
    -		errx(1, "getaddrinfo: %s port %s: %s", lhost, lport,
    +		errx(1, "getaddrinfo: %s port %s: %s", fhost, fport,
     		    gai_strerror(error));
     	}
     
    @@ -317,6 +347,8 @@ usage(void)
     {
     	fprintf(stderr,
     "usage: tcpdrop local-address local-port foreign-address foreign-port\n"
    +"       tcpdrop local-address:local-port foreign-address:foreign-port\n"
    +"       tcpdrop local-address.local-port foreign-address.foreign-port\n"
     "       tcpdrop [-l] -a\n");
     	exit(1);
     }
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 19:02:43 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id B64B399D;
     Fri,  1 Mar 2013 19:02:43 +0000 (UTC) (envelope-from alc@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 9D121102F;
     Fri,  1 Mar 2013 19:02:43 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21J2hji052968;
     Fri, 1 Mar 2013 19:02:43 GMT (envelope-from alc@svn.freebsd.org)
    Received: (from alc@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21J2gDC052959;
     Fri, 1 Mar 2013 19:02:42 GMT (envelope-from alc@svn.freebsd.org)
    Message-Id: <201303011902.r21J2gDC052959@svn.freebsd.org>
    From: Alan Cox 
    Date: Fri, 1 Mar 2013 19:02:42 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247564 - in head/sys/arm: econa s3c2xx0 xscale/i80321
     xscale/i8134x xscale/ixp425 xscale/pxa
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 19:02:43 -0000
    
    Author: alc
    Date: Fri Mar  1 19:02:41 2013
    New Revision: 247564
    URL: http://svnweb.freebsd.org/changeset/base/247564
    
    Log:
      Eliminate a redundant #include: machine/pmap.h is already included
      through vm/pmap.h.
    
    Modified:
      head/sys/arm/econa/econa_machdep.c
      head/sys/arm/s3c2xx0/s3c24x0_machdep.c
      head/sys/arm/xscale/i80321/ep80219_machdep.c
      head/sys/arm/xscale/i80321/iq31244_machdep.c
      head/sys/arm/xscale/i8134x/crb_machdep.c
      head/sys/arm/xscale/ixp425/avila_machdep.c
      head/sys/arm/xscale/pxa/pxa_machdep.c
    
    Modified: head/sys/arm/econa/econa_machdep.c
    ==============================================================================
    --- head/sys/arm/econa/econa_machdep.c	Fri Mar  1 19:01:52 2013	(r247563)
    +++ head/sys/arm/econa/econa_machdep.c	Fri Mar  1 19:02:41 2013	(r247564)
    @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c
    ==============================================================================
    --- head/sys/arm/s3c2xx0/s3c24x0_machdep.c	Fri Mar  1 19:01:52 2013	(r247563)
    +++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c	Fri Mar  1 19:02:41 2013	(r247564)
    @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c
    ==============================================================================
    --- head/sys/arm/xscale/i80321/ep80219_machdep.c	Fri Mar  1 19:01:52 2013	(r247563)
    +++ head/sys/arm/xscale/i80321/ep80219_machdep.c	Fri Mar  1 19:02:41 2013	(r247564)
    @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c
    ==============================================================================
    --- head/sys/arm/xscale/i80321/iq31244_machdep.c	Fri Mar  1 19:01:52 2013	(r247563)
    +++ head/sys/arm/xscale/i80321/iq31244_machdep.c	Fri Mar  1 19:02:41 2013	(r247564)
    @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/arm/xscale/i8134x/crb_machdep.c
    ==============================================================================
    --- head/sys/arm/xscale/i8134x/crb_machdep.c	Fri Mar  1 19:01:52 2013	(r247563)
    +++ head/sys/arm/xscale/i8134x/crb_machdep.c	Fri Mar  1 19:02:41 2013	(r247564)
    @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/arm/xscale/ixp425/avila_machdep.c
    ==============================================================================
    --- head/sys/arm/xscale/ixp425/avila_machdep.c	Fri Mar  1 19:01:52 2013	(r247563)
    +++ head/sys/arm/xscale/ixp425/avila_machdep.c	Fri Mar  1 19:02:41 2013	(r247564)
    @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    Modified: head/sys/arm/xscale/pxa/pxa_machdep.c
    ==============================================================================
    --- head/sys/arm/xscale/pxa/pxa_machdep.c	Fri Mar  1 19:01:52 2013	(r247563)
    +++ head/sys/arm/xscale/pxa/pxa_machdep.c	Fri Mar  1 19:02:41 2013	(r247564)
    @@ -80,7 +80,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    -#include 
     #include 
     #include 
     #include 
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 19:12:39 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id C235ED4E;
     Fri,  1 Mar 2013 19:12:39 +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 AF0B11094;
     Fri,  1 Mar 2013 19:12:39 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21JCd3A056479;
     Fri, 1 Mar 2013 19:12:39 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21JCdRw056476;
     Fri, 1 Mar 2013 19:12:39 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303011912.r21JCdRw056476@svn.freebsd.org>
    From: Marius Strobl 
    Date: Fri, 1 Mar 2013 19:12:38 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247565 - head/sys/dev/bce
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 19:12:39 -0000
    
    Author: marius
    Date: Fri Mar  1 19:12:38 2013
    New Revision: 247565
    URL: http://svnweb.freebsd.org/changeset/base/247565
    
    Log:
      - Make tables, device ID strings etc const.
      - Use NULL instead of 0 for pointers.
      - Remove redundant bzero(9)'ing of the softc.
      - Remove redundant/unused softc members.
      - Don't allocate MSI/MSI-X as RF_SHAREABLE.
      - Re-use bus accessor macros instead of duplicating them.
      - In bce_miibus_{read,write}_reg(), remove superfluous limiting of the PHY
        address (missed in r213893).
      
      MFC after:	1 week
    
    Modified:
      head/sys/dev/bce/if_bce.c
      head/sys/dev/bce/if_bcereg.h
    
    Modified: head/sys/dev/bce/if_bce.c
    ==============================================================================
    --- head/sys/dev/bce/if_bce.c	Fri Mar  1 19:02:41 2013	(r247564)
    +++ head/sys/dev/bce/if_bce.c	Fri Mar  1 19:12:38 2013	(r247565)
    @@ -95,7 +95,7 @@ __FBSDID("$FreeBSD$");
     /****************************************************************************/
     #define BCE_DEVDESC_MAX		64
     
    -static struct bce_type bce_devs[] = {
    +static const struct bce_type bce_devs[] = {
     	/* BCM5706C Controllers and OEM boards. */
     	{ BRCM_VENDORID, BRCM_DEVICEID_BCM5706,  HP_VENDORID, 0x3101,
     		"HP NC370T Multifunction Gigabit Server Adapter" },
    @@ -161,7 +161,7 @@ static struct bce_type bce_devs[] = {
     /****************************************************************************/
     /* Supported Flash NVRAM device data.                                       */
     /****************************************************************************/
    -static struct flash_spec flash_table[] =
    +static const struct flash_spec flash_table[] =
     {
     #define BUFFERED_FLAGS		(BCE_NV_BUFFERED | BCE_NV_TRANSLATE)
     #define NONBUFFERED_FLAGS	(BCE_NV_WREN)
    @@ -258,7 +258,7 @@ static struct flash_spec flash_table[] =
      * logical-to-physical mapping is required in the
      * driver.
      */
    -static struct flash_spec flash_5709 = {
    +static const struct flash_spec flash_5709 = {
     	.flags		= BCE_NV_BUFFERED,
     	.page_bits	= BCM5709_FLASH_PAGE_BITS,
     	.page_size	= BCM5709_FLASH_PAGE_SIZE,
    @@ -481,8 +481,8 @@ MODULE_DEPEND(bce, pci, 1, 1, 1);
     MODULE_DEPEND(bce, ether, 1, 1, 1);
     MODULE_DEPEND(bce, miibus, 1, 1, 1);
     
    -DRIVER_MODULE(bce, pci, bce_driver, bce_devclass, 0, 0);
    -DRIVER_MODULE(miibus, bce, miibus_driver, miibus_devclass, 0, 0);
    +DRIVER_MODULE(bce, pci, bce_driver, bce_devclass, NULL, NULL);
    +DRIVER_MODULE(miibus, bce, miibus_driver, miibus_devclass, NULL, NULL);
     
     
     /****************************************************************************/
    @@ -647,7 +647,7 @@ SYSCTL_UINT(_hw_bce, OID_AUTO, rx_ticks,
     static int
     bce_probe(device_t dev)
     {
    -	struct bce_type *t;
    +	const struct bce_type *t;
     	struct bce_softc *sc;
     	char *descbuf;
     	u16 vid = 0, did = 0, svid = 0, sdid = 0;
    @@ -655,7 +655,6 @@ bce_probe(device_t dev)
     	t = bce_devs;
     
     	sc = device_get_softc(dev);
    -	bzero(sc, sizeof(struct bce_softc));
     	sc->bce_unit = device_get_unit(dev);
     	sc->bce_dev = dev;
     
    @@ -1040,7 +1039,7 @@ bce_attach(device_t dev)
     	struct bce_softc *sc;
     	struct ifnet *ifp;
     	u32 val;
    -	int error, rid, rc = 0;
    +	int count, error, rc = 0, rid;
     
     	sc = device_get_softc(dev);
     	sc->bce_dev = dev;
    @@ -1084,14 +1083,14 @@ bce_attach(device_t dev)
     		((sc->bce_res_irq = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
     		&rid, RF_ACTIVE)) != NULL)) {
     
    -		msi_needed = sc->bce_msi_count = 1;
    +		msi_needed = count = 1;
     
    -		if (((error = pci_alloc_msix(dev, &sc->bce_msi_count)) != 0) ||
    -			(sc->bce_msi_count != msi_needed)) {
    +		if (((error = pci_alloc_msix(dev, &count)) != 0) ||
    +			(count != msi_needed)) {
     			BCE_PRINTF("%s(%d): MSI-X allocation failed! Requested = %d,"
     				"Received = %d, error = %d\n", __FILE__, __LINE__,
    -				msi_needed, sc->bce_msi_count, error);
    -			sc->bce_msi_count = 0;
    +				msi_needed, count, error);
    +			count = 0;
     			pci_release_msi(dev);
     			bus_release_resource(dev, SYS_RES_MEMORY, rid,
     				sc->bce_res_irq);
    @@ -1100,19 +1099,18 @@ bce_attach(device_t dev)
     			DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using MSI-X interrupt.\n",
     				__FUNCTION__);
     			sc->bce_flags |= BCE_USING_MSIX_FLAG;
    -			sc->bce_intr = bce_intr;
     		}
     	}
     #endif
     
     	/* Try allocating a MSI interrupt. */
     	if ((sc->bce_cap_flags & BCE_MSI_CAPABLE_FLAG) &&
    -		(bce_msi_enable >= 1) && (sc->bce_msi_count == 0)) {
    -		sc->bce_msi_count = 1;
    -		if ((error = pci_alloc_msi(dev, &sc->bce_msi_count)) != 0) {
    +		(bce_msi_enable >= 1) && (count == 0)) {
    +		count = 1;
    +		if ((error = pci_alloc_msi(dev, &count)) != 0) {
     			BCE_PRINTF("%s(%d): MSI allocation failed! "
     			    "error = %d\n", __FILE__, __LINE__, error);
    -			sc->bce_msi_count = 0;
    +			count = 0;
     			pci_release_msi(dev);
     		} else {
     			DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using MSI "
    @@ -1120,23 +1118,19 @@ bce_attach(device_t dev)
     			sc->bce_flags |= BCE_USING_MSI_FLAG;
     			if (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709)
     				sc->bce_flags |= BCE_ONE_SHOT_MSI_FLAG;
    -			sc->bce_irq_rid = 1;
    -			sc->bce_intr = bce_intr;
    +			rid = 1;
     		}
     	}
     
     	/* Try allocating a legacy interrupt. */
    -	if (sc->bce_msi_count == 0) {
    +	if (count == 0) {
     		DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using INTx interrupt.\n",
     			__FUNCTION__);
     		rid = 0;
    -		sc->bce_intr = bce_intr;
     	}
     
     	sc->bce_res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
    -	    &rid, RF_SHAREABLE | RF_ACTIVE);
    -
    -	sc->bce_irq_rid = rid;
    +	    &rid, RF_ACTIVE | (count != 0 ? 0 : RF_SHAREABLE));
     
     	/* Report any IRQ allocation errors. */
     	if (sc->bce_res_irq == NULL) {
    @@ -1635,7 +1629,7 @@ bce_shutdown(device_t dev)
     static u32
     bce_reg_rd(struct bce_softc *sc, u32 offset)
     {
    -	u32 val = bus_space_read_4(sc->bce_btag, sc->bce_bhandle, offset);
    +	u32 val = REG_RD(sc, offset);
     	DBPRINT(sc, BCE_INSANE_REG, "%s(); offset = 0x%08X, val = 0x%08X\n",
     		__FUNCTION__, offset, val);
     	return val;
    @@ -1653,7 +1647,7 @@ bce_reg_wr16(struct bce_softc *sc, u32 o
     {
     	DBPRINT(sc, BCE_INSANE_REG, "%s(); offset = 0x%08X, val = 0x%04X\n",
     		__FUNCTION__, offset, val);
    -	bus_space_write_2(sc->bce_btag, sc->bce_bhandle, offset, val);
    +	REG_WR16(sc, offset, val);
     }
     
     
    @@ -1668,7 +1662,7 @@ bce_reg_wr(struct bce_softc *sc, u32 off
     {
     	DBPRINT(sc, BCE_INSANE_REG, "%s(); offset = 0x%08X, val = 0x%08X\n",
     		__FUNCTION__, offset, val);
    -	bus_space_write_4(sc->bce_btag, sc->bce_bhandle, offset, val);
    +	REG_WR(sc, offset, val);
     }
     #endif
     
    @@ -1879,13 +1873,6 @@ bce_miibus_read_reg(device_t dev, int ph
     
     	sc = device_get_softc(dev);
     
    -	/* Make sure we are accessing the correct PHY address. */
    -	if (phy != sc->bce_phy_addr) {
    -		DBPRINT(sc, BCE_INSANE_PHY, "Invalid PHY address %d "
    -		    "for PHY read!\n", phy);
    -		return(0);
    -	}
    -
         /*
          * The 5709S PHY is an IEEE Clause 45 PHY
          * with special mappings to work with IEEE
    @@ -1968,13 +1955,6 @@ bce_miibus_write_reg(device_t dev, int p
     
     	sc = device_get_softc(dev);
     
    -	/* Make sure we are accessing the correct PHY address. */
    -	if (phy != sc->bce_phy_addr) {
    -		DBPRINT(sc, BCE_INSANE_PHY, "Invalid PHY address %d "
    -		    "for PHY write!\n", phy);
    -		return(0);
    -	}
    -
     	DB_PRINT_PHY_REG(reg, val);
     
     	/*
    @@ -2535,7 +2515,7 @@ bce_init_nvram(struct bce_softc *sc)
     {
     	u32 val;
     	int j, entry_count, rc = 0;
    -	struct flash_spec *flash;
    +	const struct flash_spec *flash;
     
     	DBENTER(BCE_VERBOSE_NVRAM);
     
    @@ -3949,8 +3929,8 @@ bce_release_resources(struct bce_softc *
     
     	if (sc->bce_res_irq != NULL) {
     		DBPRINT(sc, BCE_INFO_RESET, "Releasing IRQ.\n");
    -		bus_release_resource(dev, SYS_RES_IRQ, sc->bce_irq_rid,
    -		    sc->bce_res_irq);
    +		bus_release_resource(dev, SYS_RES_IRQ,
    +		    rman_get_rid(sc->bce_res_irq), sc->bce_res_irq);
     	}
     
     	if (sc->bce_flags & (BCE_USING_MSI_FLAG | BCE_USING_MSIX_FLAG)) {
    @@ -11650,4 +11630,3 @@ bce_breakpoint(struct bce_softc *sc)
     	return;
     }
     #endif
    -
    
    Modified: head/sys/dev/bce/if_bcereg.h
    ==============================================================================
    --- head/sys/dev/bce/if_bcereg.h	Fri Mar  1 19:02:41 2013	(r247564)
    +++ head/sys/dev/bce/if_bcereg.h	Fri Mar  1 19:12:38 2013	(r247565)
    @@ -622,7 +622,7 @@ struct bce_type {
     	u_int16_t bce_did;
     	u_int16_t bce_svid;
     	u_int16_t bce_sdid;
    -	char      *bce_name;
    +	const char *bce_name;
     };
     
     /****************************************************************************/
    @@ -716,7 +716,7 @@ struct flash_spec {
     	u32 page_size;
     	u32 addr_mask;
     	u32 total_size;
    -	u8  *name;
    +	const u8 *name;
     };
     
     
    @@ -2001,7 +2001,7 @@ struct l2_fhdr {
     #define BCE_MISC_ENABLE_CLR_BITS_UMP_ENABLE				(1L<<27)
     #define BCE_MISC_ENABLE_CLR_BITS_RV2P_CMD_SCHEDULER_ENABLE	(1L<<28)
     #define BCE_MISC_ENABLE_CLR_BITS_RSVD_FUTURE_ENABLE		(0x7L<<29)
    -
    +
     #define BCE_MISC_ENABLE_CLR_DEFAULT						0x17ffffff
     
     #define BCE_MISC_CLOCK_CONTROL_BITS			0x00000818
    @@ -6318,19 +6318,19 @@ struct fw_info {
     	u32 text_addr;
     	u32 text_len;
     	u32 text_index;
    -	u32 *text;
    +	const u32 *text;
     
     	/* Data section. */
     	u32 data_addr;
     	u32 data_len;
     	u32 data_index;
    -	u32 *data;
    +	const u32 *data;
     
     	/* SBSS section. */
     	u32 sbss_addr;
     	u32 sbss_len;
     	u32 sbss_index;
    -	u32 *sbss;
    +	const u32 *sbss;
     
     	/* BSS section. */
     	u32 bss_addr;
    @@ -6421,7 +6421,7 @@ struct fw_info {
     
     struct bce_softc
     {
    -	/* Interface info.  Must be first!! */
    +	/* Interface info */
     	struct ifnet		*bce_ifp;
     
     	/* Parent device handle */
    @@ -6451,10 +6451,7 @@ struct bce_softc
     	struct mtx		bce_mtx;
     
     	/* Interrupt handler. */
    -	driver_intr_t		*bce_intr;
     	void			*bce_intrhand;
    -	int			bce_irq_rid;
    -	int			bce_msi_count;
     
     	/* ASIC Chip ID. */
     	u32			bce_chipid;
    @@ -6509,7 +6506,7 @@ struct bce_softc
     	u16			link_speed;
     
     	/* Flash NVRAM settings */
    -	struct flash_spec	*bce_flash_info;
    +	const struct flash_spec	*bce_flash_info;
     
     	/* Flash NVRAM size */
     	u32			bce_flash_size;
    @@ -6518,7 +6515,7 @@ struct bce_softc
     	u32			bce_shmem_base;
     
     	/* Name string */
    -	char			*bce_name;
    +	const char		*bce_name;
     
     	/* Tracks the version of bootcode firmware. */
     	char			bce_bc_ver[32];
    @@ -6834,4 +6831,3 @@ struct bce_softc
     };
     
     #endif /* __BCEREG_H_DEFINED */
    -
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 19:39:55 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id A65118C0;
     Fri,  1 Mar 2013 19:39:55 +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 97B3411CD;
     Fri,  1 Mar 2013 19:39:55 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21Jdtan063628;
     Fri, 1 Mar 2013 19:39:55 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21JdtJE063625;
     Fri, 1 Mar 2013 19:39:55 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011939.r21JdtJE063625@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 19:39: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: r247566 - in stable/9: etc/mtree include usr.sbin/pciconf
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 19:39:55 -0000
    
    Author: jhb
    Date: Fri Mar  1 19:39:54 2013
    New Revision: 247566
    URL: http://svnweb.freebsd.org/changeset/base/247566
    
    Log:
      MFC 246367:
      Install  and  as userland headers
      in /usr/include.
    
    Modified:
      stable/9/etc/mtree/BSD.include.dist
      stable/9/include/Makefile
      stable/9/usr.sbin/pciconf/Makefile
    Directory Properties:
      stable/9/etc/   (props changed)
      stable/9/include/   (props changed)
      stable/9/usr.sbin/pciconf/   (props changed)
    
    Modified: stable/9/etc/mtree/BSD.include.dist
    ==============================================================================
    --- stable/9/etc/mtree/BSD.include.dist	Fri Mar  1 19:12:38 2013	(r247565)
    +++ stable/9/etc/mtree/BSD.include.dist	Fri Mar  1 19:39:54 2013	(r247566)
    @@ -96,6 +96,8 @@
         dev
             acpica
             ..
    +        agp
    +        ..
             an
             ..
             bktr
    @@ -128,6 +130,8 @@
             ..
             pbio
             ..
    +        pci
    +        ..
             powermac_nvram
             ..
             ppbus
    
    Modified: stable/9/include/Makefile
    ==============================================================================
    --- stable/9/include/Makefile	Fri Mar  1 19:12:38 2013	(r247565)
    +++ stable/9/include/Makefile	Fri Mar  1 19:39:54 2013	(r247566)
    @@ -42,9 +42,10 @@ LDIRS=	bsm cam geom net net80211 netatal
     	sys vm
     
     LSUBDIRS=	cam/ata cam/scsi \
    -	dev/acpica dev/an dev/bktr dev/ciss dev/filemon dev/firewire dev/hwpmc \
    +	dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \
    +	dev/hwpmc \
     	dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \
    -	dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \
    +	dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \
     	dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \
     	fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/nfs fs/ntfs fs/nullfs \
     	${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \
    @@ -160,7 +161,7 @@ copies:
     	done
     .endif
     .endfor
    -.for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS}
    +.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/pci} ${LSUBSUBDIRS}
     	cd ${.CURDIR}/../sys; \
     	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
     	    ${DESTDIR}${INCLUDEDIR}/$i
    @@ -168,9 +169,15 @@ copies:
     	cd ${.CURDIR}/../sys/dev/acpica; \
     	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
     	    ${DESTDIR}${INCLUDEDIR}/dev/acpica
    +	cd ${.CURDIR}/../sys/dev/agp; \
    +	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 agpreg.h \
    +	    ${DESTDIR}${INCLUDEDIR}/dev/agp
     	cd ${.CURDIR}/../sys/dev/bktr; \
     	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
     	    ${DESTDIR}${INCLUDEDIR}/dev/bktr
    +	cd ${.CURDIR}/../sys/dev/pci; \
    +	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \
    +	    ${DESTDIR}${INCLUDEDIR}/dev/pci
     	cd ${.CURDIR}/../sys/contrib/altq/altq; \
     	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
     	    ${DESTDIR}${INCLUDEDIR}/altq
    @@ -227,7 +234,7 @@ symlinks:
     		ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
     	done
     .endfor
    -.for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr}
    +.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/pci}
     	cd ${.CURDIR}/../sys/$i; \
     	for h in *.h; do \
     		ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
    @@ -238,11 +245,21 @@ symlinks:
     		ln -fs ../../../../sys/dev/acpica/$$h \
     		    ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
     	done
    +	cd ${.CURDIR}/../sys/dev/agp; \
    +	for h in agpreg.h; do \
    +		ln -fs ../../../../sys/dev/agp/$$h \
    +		    ${DESTDIR}${INCLUDEDIR}/dev/agp; \
    +	done
     	cd ${.CURDIR}/../sys/dev/bktr; \
     	for h in ioctl_*.h; do \
     		ln -fs ../../../../sys/dev/bktr/$$h \
     		    ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
     	done
    +	cd ${.CURDIR}/../sys/dev/pci; \
    +	for h in pcireg.h; do \
    +		ln -fs ../../../../sys/dev/pci/$$h \
    +		    ${DESTDIR}${INCLUDEDIR}/dev/pci; \
    +	done
     .for i in ${LSUBSUBDIRS}
     	cd ${.CURDIR}/../sys/$i; \
     	for h in *.h; do \
    
    Modified: stable/9/usr.sbin/pciconf/Makefile
    ==============================================================================
    --- stable/9/usr.sbin/pciconf/Makefile	Fri Mar  1 19:12:38 2013	(r247565)
    +++ stable/9/usr.sbin/pciconf/Makefile	Fri Mar  1 19:39:54 2013	(r247566)
    @@ -5,8 +5,6 @@ PROG=	pciconf
     SRCS=	pciconf.c cap.c err.c
     MAN=	pciconf.8
     
    -CFLAGS+= -I${.CURDIR}/../../sys
    -
     WARNS?=	3
     
     .include 
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 19:40:03 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 3BA35A11;
     Fri,  1 Mar 2013 19:40:03 +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 2E1E111CE;
     Fri,  1 Mar 2013 19:40:03 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21Je3am063722;
     Fri, 1 Mar 2013 19:40:03 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21Je20Z063717;
     Fri, 1 Mar 2013 19:40:02 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303011940.r21Je20Z063717@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 19:40:02 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247567 - in stable/8: etc/mtree include usr.sbin/pciconf
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 19:40:03 -0000
    
    Author: jhb
    Date: Fri Mar  1 19:40:02 2013
    New Revision: 247567
    URL: http://svnweb.freebsd.org/changeset/base/247567
    
    Log:
      MFC 246367:
      Install  and  as userland headers
      in /usr/include.
    
    Modified:
      stable/8/etc/mtree/BSD.include.dist
      stable/8/include/Makefile
      stable/8/usr.sbin/pciconf/Makefile
    Directory Properties:
      stable/8/etc/   (props changed)
      stable/8/include/   (props changed)
      stable/8/usr.sbin/pciconf/   (props changed)
    
    Modified: stable/8/etc/mtree/BSD.include.dist
    ==============================================================================
    --- stable/8/etc/mtree/BSD.include.dist	Fri Mar  1 19:39:54 2013	(r247566)
    +++ stable/8/etc/mtree/BSD.include.dist	Fri Mar  1 19:40:02 2013	(r247567)
    @@ -88,6 +88,8 @@
         dev
             acpica
             ..
    +        agp
    +        ..
             an
             ..
             bktr
    @@ -118,6 +120,8 @@
             ..
             pbio
             ..
    +        pci
    +        ..
             powermac_nvram
             ..
             ppbus
    
    Modified: stable/8/include/Makefile
    ==============================================================================
    --- stable/8/include/Makefile	Fri Mar  1 19:39:54 2013	(r247566)
    +++ stable/8/include/Makefile	Fri Mar  1 19:40:02 2013	(r247567)
    @@ -39,9 +39,9 @@ LDIRS=	bsm cam geom net net80211 netatal
     	sys vm
     
     LSUBDIRS=	cam/ata cam/scsi \
    -	dev/acpica dev/an dev/bktr dev/ciss dev/firewire dev/hwpmc \
    +	dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/firewire dev/hwpmc \
     	dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \
    -	dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \
    +	dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \
     	dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \
     	fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/nfs fs/ntfs fs/nullfs \
     	${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \
    @@ -150,7 +150,7 @@ copies:
     	done
     .endif
     .endfor
    -.for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS}
    +.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/pci} ${LSUBSUBDIRS}
     	cd ${.CURDIR}/../sys; \
     	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
     	    ${DESTDIR}${INCLUDEDIR}/$i
    @@ -158,9 +158,15 @@ copies:
     	cd ${.CURDIR}/../sys/dev/acpica; \
     	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
     	    ${DESTDIR}${INCLUDEDIR}/dev/acpica
    +	cd ${.CURDIR}/../sys/dev/agp; \
    +	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 agpreg.h \
    +	    ${DESTDIR}${INCLUDEDIR}/dev/agp
     	cd ${.CURDIR}/../sys/dev/bktr; \
     	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
     	    ${DESTDIR}${INCLUDEDIR}/dev/bktr
    +	cd ${.CURDIR}/../sys/dev/pci; \
    +	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \
    +	    ${DESTDIR}${INCLUDEDIR}/dev/pci
     	cd ${.CURDIR}/../sys/contrib/altq/altq; \
     	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
     	    ${DESTDIR}${INCLUDEDIR}/altq
    @@ -215,7 +221,7 @@ symlinks:
     		ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
     	done
     .endfor
    -.for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr}
    +.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/pci}
     	cd ${.CURDIR}/../sys/$i; \
     	for h in *.h; do \
     		ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
    @@ -226,11 +232,21 @@ symlinks:
     		ln -fs ../../../../sys/dev/acpica/$$h \
     		    ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
     	done
    +	cd ${.CURDIR}/../sys/dev/agp; \
    +	for h in agpreg.h; do \
    +		ln -fs ../../../../sys/dev/agp/$$h \
    +		    ${DESTDIR}${INCLUDEDIR}/dev/agp; \
    +	done
     	cd ${.CURDIR}/../sys/dev/bktr; \
     	for h in ioctl_*.h; do \
     		ln -fs ../../../../sys/dev/bktr/$$h \
     		    ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
     	done
    +	cd ${.CURDIR}/../sys/dev/pci; \
    +	for h in pcireg.h; do \
    +		ln -fs ../../../../sys/dev/pci/$$h \
    +		    ${DESTDIR}${INCLUDEDIR}/dev/pci; \
    +	done
     .for i in ${LSUBSUBDIRS}
     	cd ${.CURDIR}/../sys/$i; \
     	for h in *.h; do \
    
    Modified: stable/8/usr.sbin/pciconf/Makefile
    ==============================================================================
    --- stable/8/usr.sbin/pciconf/Makefile	Fri Mar  1 19:39:54 2013	(r247566)
    +++ stable/8/usr.sbin/pciconf/Makefile	Fri Mar  1 19:40:02 2013	(r247567)
    @@ -5,6 +5,4 @@ PROG=	pciconf
     SRCS=	pciconf.c cap.c err.c
     MAN=	pciconf.8
     
    -CFLAGS+= -I${.CURDIR}/../../sys
    -
     .include 
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 19:42:53 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 086B8C84;
     Fri,  1 Mar 2013 19:42:53 +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 CBE9E11ED;
     Fri,  1 Mar 2013 19:42:52 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21JgqVT065737;
     Fri, 1 Mar 2013 19:42:52 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21JgpOO065726;
     Fri, 1 Mar 2013 19:42:51 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303011942.r21JgpOO065726@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 19:42:51 +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: r247568 - in stable/9: contrib/openpam
     contrib/openpam/bin contrib/openpam/bin/openpam_dump_policy
     contrib/openpam/bin/pamtest contrib/openpam/bin/su contrib/openpam/doc
     contrib/openpam...
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 19:42:53 -0000
    
    Author: des
    Date: Fri Mar  1 19:42:50 2013
    New Revision: 247568
    URL: http://svnweb.freebsd.org/changeset/base/247568
    
    Log:
      Pull in OpenPAM Micrampelis from head.  Also merge a few minor module
      changes, most importantly support for ECDSA keys in pam_ssh.
    
    Added:
      stable/9/contrib/openpam/TODO
         - copied unchanged from r236109, head/contrib/openpam/TODO
      stable/9/contrib/openpam/bin/openpam_dump_policy/
         - copied from r236109, head/contrib/openpam/bin/openpam_dump_policy/
      stable/9/contrib/openpam/bin/pamtest/
         - copied from r228692, head/contrib/openpam/bin/pamtest/
      stable/9/contrib/openpam/bin/su/su.1
         - copied, changed from r228692, head/contrib/openpam/bin/su/su.1
      stable/9/contrib/openpam/doc/man/openpam_get_feature.3
         - copied unchanged from r236109, head/contrib/openpam/doc/man/openpam_get_feature.3
      stable/9/contrib/openpam/doc/man/openpam_readlinev.3
         - copied unchanged from r236109, head/contrib/openpam/doc/man/openpam_readlinev.3
      stable/9/contrib/openpam/doc/man/openpam_readword.3
         - copied unchanged from r236109, head/contrib/openpam/doc/man/openpam_readword.3
      stable/9/contrib/openpam/doc/man/openpam_set_feature.3
         - copied unchanged from r236109, head/contrib/openpam/doc/man/openpam_set_feature.3
      stable/9/contrib/openpam/doc/man/openpam_straddch.3
         - copied unchanged from r236109, head/contrib/openpam/doc/man/openpam_straddch.3
      stable/9/contrib/openpam/doc/man/openpam_subst.3
         - copied, changed from r228692, head/contrib/openpam/doc/man/openpam_subst.3
      stable/9/contrib/openpam/lib/openpam_check_owner_perms.c
         - copied, changed from r228692, head/contrib/openpam/lib/openpam_check_owner_perms.c
      stable/9/contrib/openpam/lib/openpam_constants.c
         - copied unchanged from r228692, head/contrib/openpam/lib/openpam_constants.c
      stable/9/contrib/openpam/lib/openpam_constants.h
         - copied, changed from r228692, head/contrib/openpam/lib/openpam_constants.h
      stable/9/contrib/openpam/lib/openpam_ctype.h
         - copied unchanged from r236109, head/contrib/openpam/lib/openpam_ctype.h
      stable/9/contrib/openpam/lib/openpam_debug.h
         - copied, changed from r228692, head/contrib/openpam/lib/openpam_debug.h
      stable/9/contrib/openpam/lib/openpam_features.c
         - copied unchanged from r236109, head/contrib/openpam/lib/openpam_features.c
      stable/9/contrib/openpam/lib/openpam_features.h
         - copied unchanged from r236109, head/contrib/openpam/lib/openpam_features.h
      stable/9/contrib/openpam/lib/openpam_get_feature.c
         - copied unchanged from r236109, head/contrib/openpam/lib/openpam_get_feature.c
      stable/9/contrib/openpam/lib/openpam_readlinev.c
         - copied unchanged from r236109, head/contrib/openpam/lib/openpam_readlinev.c
      stable/9/contrib/openpam/lib/openpam_readword.c
         - copied unchanged from r236109, head/contrib/openpam/lib/openpam_readword.c
      stable/9/contrib/openpam/lib/openpam_set_feature.c
         - copied unchanged from r236109, head/contrib/openpam/lib/openpam_set_feature.c
      stable/9/contrib/openpam/lib/openpam_straddch.c
         - copied unchanged from r236109, head/contrib/openpam/lib/openpam_straddch.c
      stable/9/contrib/openpam/lib/openpam_strlcat.h
         - copied unchanged from r236109, head/contrib/openpam/lib/openpam_strlcat.h
      stable/9/contrib/openpam/lib/openpam_strlcmp.h
         - copied, changed from r228692, head/contrib/openpam/lib/openpam_strlcmp.h
      stable/9/contrib/openpam/lib/openpam_strlcpy.h
         - copied, changed from r228692, head/contrib/openpam/lib/openpam_strlcpy.h
      stable/9/contrib/openpam/lib/openpam_subst.c
         - copied, changed from r228692, head/contrib/openpam/lib/openpam_subst.c
      stable/9/contrib/openpam/pamgdb.in
         - copied unchanged from r236109, head/contrib/openpam/pamgdb.in
      stable/9/contrib/openpam/t/
         - copied from r236109, head/contrib/openpam/t/
    Modified:
      stable/9/contrib/openpam/CREDITS
      stable/9/contrib/openpam/HISTORY
      stable/9/contrib/openpam/LICENSE
      stable/9/contrib/openpam/Makefile.am
      stable/9/contrib/openpam/Makefile.in
      stable/9/contrib/openpam/README
      stable/9/contrib/openpam/RELNOTES
      stable/9/contrib/openpam/aclocal.m4
      stable/9/contrib/openpam/bin/Makefile.am
      stable/9/contrib/openpam/bin/Makefile.in
      stable/9/contrib/openpam/bin/pamtest/pamtest.1
      stable/9/contrib/openpam/bin/pamtest/pamtest.c
      stable/9/contrib/openpam/bin/su/Makefile.am
      stable/9/contrib/openpam/bin/su/Makefile.in
      stable/9/contrib/openpam/bin/su/su.c
      stable/9/contrib/openpam/config.h.in
      stable/9/contrib/openpam/configure
      stable/9/contrib/openpam/configure.ac
      stable/9/contrib/openpam/depcomp
      stable/9/contrib/openpam/doc/Makefile.in
      stable/9/contrib/openpam/doc/man/Makefile.am
      stable/9/contrib/openpam/doc/man/Makefile.in
      stable/9/contrib/openpam/doc/man/openpam.3
      stable/9/contrib/openpam/doc/man/openpam_borrow_cred.3
      stable/9/contrib/openpam/doc/man/openpam_free_data.3
      stable/9/contrib/openpam/doc/man/openpam_free_envlist.3
      stable/9/contrib/openpam/doc/man/openpam_get_option.3
      stable/9/contrib/openpam/doc/man/openpam_log.3
      stable/9/contrib/openpam/doc/man/openpam_nullconv.3
      stable/9/contrib/openpam/doc/man/openpam_readline.3
      stable/9/contrib/openpam/doc/man/openpam_restore_cred.3
      stable/9/contrib/openpam/doc/man/openpam_set_option.3
      stable/9/contrib/openpam/doc/man/openpam_ttyconv.3
      stable/9/contrib/openpam/doc/man/pam.3
      stable/9/contrib/openpam/doc/man/pam.conf.5
      stable/9/contrib/openpam/doc/man/pam_acct_mgmt.3
      stable/9/contrib/openpam/doc/man/pam_authenticate.3
      stable/9/contrib/openpam/doc/man/pam_chauthtok.3
      stable/9/contrib/openpam/doc/man/pam_close_session.3
      stable/9/contrib/openpam/doc/man/pam_conv.3
      stable/9/contrib/openpam/doc/man/pam_end.3
      stable/9/contrib/openpam/doc/man/pam_error.3
      stable/9/contrib/openpam/doc/man/pam_get_authtok.3
      stable/9/contrib/openpam/doc/man/pam_get_data.3
      stable/9/contrib/openpam/doc/man/pam_get_item.3
      stable/9/contrib/openpam/doc/man/pam_get_user.3
      stable/9/contrib/openpam/doc/man/pam_getenv.3
      stable/9/contrib/openpam/doc/man/pam_getenvlist.3
      stable/9/contrib/openpam/doc/man/pam_info.3
      stable/9/contrib/openpam/doc/man/pam_open_session.3
      stable/9/contrib/openpam/doc/man/pam_prompt.3
      stable/9/contrib/openpam/doc/man/pam_putenv.3
      stable/9/contrib/openpam/doc/man/pam_set_data.3
      stable/9/contrib/openpam/doc/man/pam_set_item.3
      stable/9/contrib/openpam/doc/man/pam_setcred.3
      stable/9/contrib/openpam/doc/man/pam_setenv.3
      stable/9/contrib/openpam/doc/man/pam_sm_acct_mgmt.3
      stable/9/contrib/openpam/doc/man/pam_sm_authenticate.3
      stable/9/contrib/openpam/doc/man/pam_sm_chauthtok.3
      stable/9/contrib/openpam/doc/man/pam_sm_close_session.3
      stable/9/contrib/openpam/doc/man/pam_sm_open_session.3
      stable/9/contrib/openpam/doc/man/pam_sm_setcred.3
      stable/9/contrib/openpam/doc/man/pam_start.3
      stable/9/contrib/openpam/doc/man/pam_strerror.3
      stable/9/contrib/openpam/doc/man/pam_verror.3
      stable/9/contrib/openpam/doc/man/pam_vinfo.3
      stable/9/contrib/openpam/doc/man/pam_vprompt.3
      stable/9/contrib/openpam/include/Makefile.in
      stable/9/contrib/openpam/include/security/Makefile.in
      stable/9/contrib/openpam/include/security/openpam.h
      stable/9/contrib/openpam/include/security/openpam_version.h
      stable/9/contrib/openpam/include/security/pam_appl.h
      stable/9/contrib/openpam/include/security/pam_constants.h
      stable/9/contrib/openpam/include/security/pam_modules.h
      stable/9/contrib/openpam/include/security/pam_types.h
      stable/9/contrib/openpam/install-sh
      stable/9/contrib/openpam/lib/Makefile.am
      stable/9/contrib/openpam/lib/Makefile.in
      stable/9/contrib/openpam/lib/openpam_borrow_cred.c
      stable/9/contrib/openpam/lib/openpam_configure.c
      stable/9/contrib/openpam/lib/openpam_dispatch.c
      stable/9/contrib/openpam/lib/openpam_dynamic.c
      stable/9/contrib/openpam/lib/openpam_findenv.c
      stable/9/contrib/openpam/lib/openpam_free_data.c
      stable/9/contrib/openpam/lib/openpam_free_envlist.c
      stable/9/contrib/openpam/lib/openpam_get_option.c
      stable/9/contrib/openpam/lib/openpam_impl.h
      stable/9/contrib/openpam/lib/openpam_load.c
      stable/9/contrib/openpam/lib/openpam_log.c
      stable/9/contrib/openpam/lib/openpam_nullconv.c
      stable/9/contrib/openpam/lib/openpam_readline.c
      stable/9/contrib/openpam/lib/openpam_restore_cred.c
      stable/9/contrib/openpam/lib/openpam_set_option.c
      stable/9/contrib/openpam/lib/openpam_static.c
      stable/9/contrib/openpam/lib/openpam_ttyconv.c
      stable/9/contrib/openpam/lib/pam_acct_mgmt.c
      stable/9/contrib/openpam/lib/pam_authenticate.c
      stable/9/contrib/openpam/lib/pam_authenticate_secondary.c
      stable/9/contrib/openpam/lib/pam_chauthtok.c
      stable/9/contrib/openpam/lib/pam_close_session.c
      stable/9/contrib/openpam/lib/pam_end.c
      stable/9/contrib/openpam/lib/pam_error.c
      stable/9/contrib/openpam/lib/pam_get_authtok.c
      stable/9/contrib/openpam/lib/pam_get_data.c
      stable/9/contrib/openpam/lib/pam_get_item.c
      stable/9/contrib/openpam/lib/pam_get_mapped_authtok.c
      stable/9/contrib/openpam/lib/pam_get_mapped_username.c
      stable/9/contrib/openpam/lib/pam_get_user.c
      stable/9/contrib/openpam/lib/pam_getenv.c
      stable/9/contrib/openpam/lib/pam_getenvlist.c
      stable/9/contrib/openpam/lib/pam_info.c
      stable/9/contrib/openpam/lib/pam_open_session.c
      stable/9/contrib/openpam/lib/pam_prompt.c
      stable/9/contrib/openpam/lib/pam_putenv.c
      stable/9/contrib/openpam/lib/pam_set_data.c
      stable/9/contrib/openpam/lib/pam_set_item.c
      stable/9/contrib/openpam/lib/pam_set_mapped_authtok.c
      stable/9/contrib/openpam/lib/pam_set_mapped_username.c
      stable/9/contrib/openpam/lib/pam_setcred.c
      stable/9/contrib/openpam/lib/pam_setenv.c
      stable/9/contrib/openpam/lib/pam_sm_acct_mgmt.c
      stable/9/contrib/openpam/lib/pam_sm_authenticate.c
      stable/9/contrib/openpam/lib/pam_sm_authenticate_secondary.c
      stable/9/contrib/openpam/lib/pam_sm_chauthtok.c
      stable/9/contrib/openpam/lib/pam_sm_close_session.c
      stable/9/contrib/openpam/lib/pam_sm_get_mapped_authtok.c
      stable/9/contrib/openpam/lib/pam_sm_get_mapped_username.c
      stable/9/contrib/openpam/lib/pam_sm_open_session.c
      stable/9/contrib/openpam/lib/pam_sm_set_mapped_authtok.c
      stable/9/contrib/openpam/lib/pam_sm_set_mapped_username.c
      stable/9/contrib/openpam/lib/pam_sm_setcred.c
      stable/9/contrib/openpam/lib/pam_start.c
      stable/9/contrib/openpam/lib/pam_strerror.c
      stable/9/contrib/openpam/lib/pam_verror.c
      stable/9/contrib/openpam/lib/pam_vinfo.c
      stable/9/contrib/openpam/lib/pam_vprompt.c
      stable/9/contrib/openpam/ltmain.sh
      stable/9/contrib/openpam/misc/gendoc.pl
      stable/9/contrib/openpam/missing
      stable/9/contrib/openpam/modules/Makefile.in
      stable/9/contrib/openpam/modules/pam_deny/Makefile.in
      stable/9/contrib/openpam/modules/pam_deny/pam_deny.c
      stable/9/contrib/openpam/modules/pam_permit/Makefile.in
      stable/9/contrib/openpam/modules/pam_permit/pam_permit.c
      stable/9/contrib/openpam/modules/pam_unix/Makefile.am
      stable/9/contrib/openpam/modules/pam_unix/Makefile.in
      stable/9/contrib/openpam/modules/pam_unix/pam_unix.c
      stable/9/lib/libpam/libpam/Makefile
      stable/9/lib/libpam/modules/pam_radius/pam_radius.c
      stable/9/lib/libpam/modules/pam_ssh/pam_ssh.8
      stable/9/lib/libpam/modules/pam_ssh/pam_ssh.c
      stable/9/lib/libpam/modules/pam_unix/Makefile
      stable/9/lib/libpam/modules/pam_unix/pam_unix.8
      stable/9/lib/libpam/modules/pam_unix/pam_unix.c
    Directory Properties:
      stable/9/contrib/openpam/   (props changed)
      stable/9/lib/libpam/   (props changed)
    
    Modified: stable/9/contrib/openpam/CREDITS
    ==============================================================================
    --- stable/9/contrib/openpam/CREDITS	Fri Mar  1 19:40:02 2013	(r247567)
    +++ stable/9/contrib/openpam/CREDITS	Fri Mar  1 19:42:50 2013	(r247568)
    @@ -6,32 +6,41 @@ Network Associates, Inc.  under DARPA/SP
     
     Principal design and development by:
     
    -	 Dag-Erling Smørgrav 
    +	 Dag-Erling Smørgrav 
     
    -The following persons (in no particular order) have contributed, directly
    -or indirectly, with patches, criticism, suggestions, or ideas:
    +The following persons (in alphabetical order) have contributed,
    +directly or indirectly, with patches, criticism, suggestions, or
    +ideas:
     
     	Andrew Morgan 
     	Brian Fundakowski Feldman 
     	Christos Zoulas 
     	Daniel Richard G. 
    -	Darren J. Moffat 
    +	Darren J. Moffat 
     	Dmitry V. Levin 
    +	Don Lewis 
     	Emmanuel Dreyfus 
     	Eric Melville 
    -	Gary Winiger 
    +	Gary Winiger 
    +	Gleb Smirnoff 
    +	Hubert Feyrer 
    +	Jason Evans 
     	Joe Marcus Clarke 
     	Juli Mallett 
    -	Hubert Feyrer 
    +	Jörg Sonnenberger 
    +	Maëlle Lesage 
     	Mark Murray 
    +	Matthias Drochner 
     	Mike Petullo 
     	Mikhail Teterin 
    -	Mikko Työläjärvi 
    +	Mikko Työläjärvi 
    +	Nick Hibma 
     	Robert Watson 
     	Ruslan Ermilov 
    +	Sebastian Krahmer 
     	Solar Designer 
     	Takanori Saneto 
     	Wojciech A. Koszek 
     	Yar Tikhiy 
     
    -$Id: CREDITS 400 2007-10-24 15:04:23Z des $
    +$Id: CREDITS 587 2012-04-08 11:12:10Z des $
    
    Modified: stable/9/contrib/openpam/HISTORY
    ==============================================================================
    --- stable/9/contrib/openpam/HISTORY	Fri Mar  1 19:40:02 2013	(r247567)
    +++ stable/9/contrib/openpam/HISTORY	Fri Mar  1 19:42:50 2013	(r247568)
    @@ -1,3 +1,77 @@
    +OpenPAM Micrampelis						2012-05-26
    +
    + - FEATURE: Add an openpam_readword(3) function which reads the next
    +   word from an input stream, applying shell quoting and escaping
    +   rules.  Add numerous unit tests for openpam_readword(3).
    +
    + - FEATURE: Add an openpam_readlinev(3) function which uses the
    +   openpam_readword(3) function to read words from an input stream one
    +   at a time until it reaches an unquoted, unescaped newline, and
    +   returns an array of those words.  Add several unit tests for
    +   openpam_readlinev(3).
    +
    + - FEATURE: Add a PAM_HOST item which pam_start(3) initializes to the
    +   machine's hostname.  This was implemented in Lycopsida but
    +   inadvertantly left out of the release notes.
    +
    + - FEATURE: In pam_get_authtok(3), if neither the application nor the
    +   module have specified a prompt and PAM_HOST and PAM_RHOST are both
    +   defined but not equal, use a different default prompt that includes
    +   PAM_USER and PAM_HOST.
    +
    + - ENHANCE: Rewrite the policy parser to used openpam_readlinev(),
    +   which greatly simplifies the code.
    +
    + - ENHANCE: The previous implementation of the policy parser relied on
    +   the openpam_readline(3) function, which (by design) munges
    +   whitespace and understands neither quotes nor backslash escapes.
    +   As a result of the aforementioned rewrite, whitespace, quotes and
    +   backslash escapes in policy files are now handled in a consistent
    +   and predictable manner.
    +
    + - ENHANCE: On platforms that have it, use fdlopen(3) to load modules.
    +   This closes the race between the ownership / permission check and
    +   the dlopen(3) call.
    +
    + - ENHANCE: Reduce the amount of pointless error messages generated
    +   while searching for a module.
    +
    + - ENHANCE: Numerous documentation improvements, both in content and
    +   formatting.
    +
    + - BUGFIX: A patch incorporated in Lycopsida inadvertantly changed
    +   OpenPAM's behavior when several policies exist for the same
    +   service, from ignoring all but the first to concatenating them all.
    +   Revert to the original behavior.
    +
    + - BUGFIX: Plug a memory leak in the policy parser.
    +============================================================================
    +OpenPAM Lycopsida						2011-12-18
    +
    + - ENHANCE: removed static build autodetection, which didn't work
    +   anyway.  Use an explicit, user-specified preprocessor variable
    +   instead.
    +
    + - ENHANCE: cleaned up the documentation a bit.
    +
    + - ENHANCE: added openpam_subst(3), allowing certain PAM items to be
    +   embedded in strings such as prompts.  Apply it to the prompts used
    +   by pam_get_user(3) and pam_get_authtok(3).
    +
    + - ENHANCE: added support for the user_prompt, authtok_prompt and
    +   oldauthtok_prompt module options, which override the prompts passed
    +   by the module to pam_set_user(3) and pam_get_authtok(3).
    +
    + - ENHANCE: rewrote the policy parser to support quoted option values.
    +
    + - ENHANCE: added pamtest(1), a tool for testing modules and policies.
    +
    + - ENHANCE: added code to check the ownership and permissions of a
    +   module before loading it.
    +
    + - ENHANCE: added / improved input validation in many cases, including
    +   the policy file and some function arguments.
    +============================================================================
     OpenPAM Hydrangea						2007-12-21
     
      - ENHANCE: when compiling with GCC, mark up API functions with GCC
    @@ -21,7 +95,7 @@ OpenPAM Hydrangea						2007-12-21
        contexts), since the module cache was the only part of OpenPAM that
        was not thread-safe.
     ============================================================================
    -OpenPAM Figwort 2005-06-16
    +OpenPAM Figwort							2005-06-16
     
      - BUGFIX: Correct several small signedness and initialization bugs
        discovered during review by the NetBSD team.
    @@ -243,7 +317,7 @@ OpenPAM Cinchona						2002-04-08
      - ENHANCE: Add openpam_free_data(), a generic cleanup function for
        pam_set_data() consumers.
     ============================================================================
    -OpenPAM	Centaury						2002-03-14
    +OpenPAM Centaury						2002-03-14
     
      - BUGFIX: Add missing #include  to openpam_log.c.
     
    @@ -282,7 +356,7 @@ OpenPAM Celandine						2002-03-05
        module with the same version number as the library itself to one
        with no version number at all.
     ============================================================================
    -OpenPAM	Cantaloupe						2002-02-22
    +OpenPAM Cantaloupe						2002-02-22
     
      - BUGFIX: The proper use of PAM_SYMBOL_ERR is to indicate an invalid
        argument to pam_[gs]et_item(3), not to indicate dlsym(3) failures.
    @@ -312,7 +386,7 @@ OpenPAM	Cantaloupe						2002-02-22
      - ENHANCE: openpam_get_authtok() now respects the echo_pass,
        try_first_pass, and use_first_pass options.
     ============================================================================
    -OpenPAM	Caliopsis						2002-02-13
    +OpenPAM Caliopsis						2002-02-13
     
     Fixed a number of bugs in the previous release, including:
       - a number of bugs in and related to pam_[gs]et_item(3)
    @@ -323,8 +397,8 @@ Fixed a number of bugs in the previous r
       - missing 'continue' in openpam_dispatch.c caused successes to be
         counted as failures
     ============================================================================
    -OpenPAM	Calamite						2002-02-09
    +OpenPAM Calamite						2002-02-09
     
     First (beta) release.
     ============================================================================
    -$Id: HISTORY 409 2007-12-21 11:38:50Z des $
    +$Id: HISTORY 609 2012-05-26 13:57:45Z des $
    
    Modified: stable/9/contrib/openpam/LICENSE
    ==============================================================================
    --- stable/9/contrib/openpam/LICENSE	Fri Mar  1 19:40:02 2013	(r247567)
    +++ stable/9/contrib/openpam/LICENSE	Fri Mar  1 19:42:50 2013	(r247568)
    @@ -1,6 +1,6 @@
     
     Copyright (c) 2002-2003 Networks Associates Technology, Inc.
    -Copyright (c) 2004-2007 Dag-Erling Smørgrav
    +Copyright (c) 2004-2012 Dag-Erling Smørgrav
     All rights reserved.
     
     This software was developed for the FreeBSD Project by ThinkSec AS and
    @@ -32,4 +32,4 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     SUCH DAMAGE.
     
    -$Id: LICENSE 408 2007-12-21 11:36:24Z des $
    +$Id: LICENSE 546 2012-03-31 23:13:20Z des $
    
    Modified: stable/9/contrib/openpam/Makefile.am
    ==============================================================================
    --- stable/9/contrib/openpam/Makefile.am	Fri Mar  1 19:40:02 2013	(r247567)
    +++ stable/9/contrib/openpam/Makefile.am	Fri Mar  1 19:42:50 2013	(r247568)
    @@ -1,4 +1,6 @@
    -# $Id: Makefile.am 395 2007-06-03 20:26:18Z des $
    +# $Id: Makefile.am 549 2012-04-01 20:38:30Z des $
    +
    +ACLOCAL_AMFLAGS = -I m4
     
     SUBDIRS = lib bin modules include
     
    @@ -6,6 +8,8 @@ if WITH_DOC
     SUBDIRS += doc
     endif
     
    +SUBDIRS += t
    +
     EXTRA_DIST = \
     	CREDITS \
     	HISTORY \
    
    Modified: stable/9/contrib/openpam/Makefile.in
    ==============================================================================
    --- stable/9/contrib/openpam/Makefile.in	Fri Mar  1 19:40:02 2013	(r247567)
    +++ stable/9/contrib/openpam/Makefile.in	Fri Mar  1 19:42:50 2013	(r247568)
    @@ -1,8 +1,9 @@
    -# Makefile.in generated by automake 1.9.6 from Makefile.am.
    +# Makefile.in generated by automake 1.11.1 from Makefile.am.
     # @configure_input@
     
     # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
    -# 2003, 2004, 2005  Free Software Foundation, Inc.
    +# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
    +# Inc.
     # This Makefile.in is free software; the Free Software Foundation
     # gives unlimited permission to copy and/or distribute it,
     # with or without modifications, as long as this notice is preserved.
    @@ -14,16 +15,13 @@
     
     @SET_MAKE@
     
    -# $Id: Makefile.am 395 2007-06-03 20:26:18Z des $
    -srcdir = @srcdir@
    -top_srcdir = @top_srcdir@
    +# $Id: Makefile.am 549 2012-04-01 20:38:30Z des $
     VPATH = @srcdir@
     pkgdatadir = $(datadir)/@PACKAGE@
    -pkglibdir = $(libdir)/@PACKAGE@
     pkgincludedir = $(includedir)/@PACKAGE@
    -top_builddir = .
    +pkglibdir = $(libdir)/@PACKAGE@
    +pkglibexecdir = $(libexecdir)/@PACKAGE@
     am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    -INSTALL = @INSTALL@
     install_sh_DATA = $(install_sh) -c -m 644
     install_sh_PROGRAM = $(install_sh) -c
     install_sh_SCRIPT = $(install_sh) -c
    @@ -37,47 +35,76 @@ PRE_UNINSTALL = :
     POST_UNINSTALL = :
     build_triplet = @build@
     host_triplet = @host@
    -target_triplet = @target@
     @WITH_DOC_TRUE@am__append_1 = doc
    +subdir = .
     DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
     	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
    -	$(top_srcdir)/configure INSTALL compile config.guess \
    -	config.sub depcomp install-sh ltmain.sh missing
    -subdir = .
    +	$(srcdir)/pamgdb.in $(top_srcdir)/configure INSTALL TODO \
    +	config.guess config.sub depcomp install-sh ltmain.sh missing
     ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     am__aclocal_m4_deps = $(top_srcdir)/configure.ac
     am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
     	$(ACLOCAL_M4)
     am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
    - configure.lineno configure.status.lineno
    + configure.lineno config.status.lineno
     mkinstalldirs = $(install_sh) -d
     CONFIG_HEADER = config.h
    -CONFIG_CLEAN_FILES =
    +CONFIG_CLEAN_FILES = pamgdb
    +CONFIG_CLEAN_VPATH_FILES =
     SOURCES =
     DIST_SOURCES =
     RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
     	html-recursive info-recursive install-data-recursive \
    -	install-exec-recursive install-info-recursive \
    -	install-recursive installcheck-recursive installdirs-recursive \
    -	pdf-recursive ps-recursive uninstall-info-recursive \
    -	uninstall-recursive
    +	install-dvi-recursive install-exec-recursive \
    +	install-html-recursive install-info-recursive \
    +	install-pdf-recursive install-ps-recursive install-recursive \
    +	installcheck-recursive installdirs-recursive pdf-recursive \
    +	ps-recursive uninstall-recursive
    +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
    +  distclean-recursive maintainer-clean-recursive
    +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
    +	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
    +	distdir dist dist-all distcheck
     ETAGS = etags
     CTAGS = ctags
    -DIST_SUBDIRS = lib bin modules include doc
    +DIST_SUBDIRS = lib bin modules include doc t
     DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
     distdir = $(PACKAGE)-$(VERSION)
     top_distdir = $(distdir)
     am__remove_distdir = \
    -  { test ! -d $(distdir) \
    -    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
    -         && rm -fr $(distdir); }; }
    +  { test ! -d "$(distdir)" \
    +    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
    +         && rm -fr "$(distdir)"; }; }
    +am__relativize = \
    +  dir0=`pwd`; \
    +  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
    +  sed_rest='s,^[^/]*/*,,'; \
    +  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
    +  sed_butlast='s,/*[^/]*$$,,'; \
    +  while test -n "$$dir1"; do \
    +    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
    +    if test "$$first" != "."; then \
    +      if test "$$first" = ".."; then \
    +        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
    +        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
    +      else \
    +        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
    +        if test "$$first2" = "$$first"; then \
    +          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
    +        else \
    +          dir2="../$$dir2"; \
    +        fi; \
    +        dir0="$$dir0"/"$$first"; \
    +      fi; \
    +    fi; \
    +    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
    +  done; \
    +  reldir="$$dir2"
     DIST_ARCHIVES = $(distdir).tar.gz
     GZIP_ENV = --best
     distuninstallcheck_listfiles = find . -type f -print
     distcleancheck_listfiles = find . -type f -print
     ACLOCAL = @ACLOCAL@
    -AMDEP_FALSE = @AMDEP_FALSE@
    -AMDEP_TRUE = @AMDEP_TRUE@
     AMTAR = @AMTAR@
     AR = @AR@
     AUTOCONF = @AUTOCONF@
    @@ -90,42 +117,50 @@ CFLAGS = @CFLAGS@
     CPP = @CPP@
     CPPFLAGS = @CPPFLAGS@
     CRYPT_LIBS = @CRYPT_LIBS@
    -CXX = @CXX@
    -CXXCPP = @CXXCPP@
    -CXXDEPMODE = @CXXDEPMODE@
    -CXXFLAGS = @CXXFLAGS@
     CYGPATH_W = @CYGPATH_W@
     DEFS = @DEFS@
     DEPDIR = @DEPDIR@
    +DLLTOOL = @DLLTOOL@
     DL_LIBS = @DL_LIBS@
    -ECHO = @ECHO@
    +DSYMUTIL = @DSYMUTIL@
    +DUMPBIN = @DUMPBIN@
     ECHO_C = @ECHO_C@
     ECHO_N = @ECHO_N@
     ECHO_T = @ECHO_T@
     EGREP = @EGREP@
     EXEEXT = @EXEEXT@
    -F77 = @F77@
    -FFLAGS = @FFLAGS@
    +FGREP = @FGREP@
     GREP = @GREP@
    +INSTALL = @INSTALL@
     INSTALL_DATA = @INSTALL_DATA@
     INSTALL_PROGRAM = @INSTALL_PROGRAM@
     INSTALL_SCRIPT = @INSTALL_SCRIPT@
     INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
    +LD = @LD@
     LDFLAGS = @LDFLAGS@
     LIBOBJS = @LIBOBJS@
     LIBS = @LIBS@
     LIBTOOL = @LIBTOOL@
     LIB_MAJ = @LIB_MAJ@
    +LIPO = @LIPO@
     LN_S = @LN_S@
     LTLIBOBJS = @LTLIBOBJS@
     MAKEINFO = @MAKEINFO@
    +MANIFEST_TOOL = @MANIFEST_TOOL@
    +MKDIR_P = @MKDIR_P@
    +NM = @NM@
    +NMEDIT = @NMEDIT@
    +OBJDUMP = @OBJDUMP@
     OBJEXT = @OBJEXT@
     OPENPAM_MODULES_DIR = @OPENPAM_MODULES_DIR@
    +OTOOL = @OTOOL@
    +OTOOL64 = @OTOOL64@
     PACKAGE = @PACKAGE@
     PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
     PACKAGE_NAME = @PACKAGE_NAME@
     PACKAGE_STRING = @PACKAGE_STRING@
     PACKAGE_TARNAME = @PACKAGE_TARNAME@
    +PACKAGE_URL = @PACKAGE_URL@
     PACKAGE_VERSION = @PACKAGE_VERSION@
     PATH_SEPARATOR = @PATH_SEPARATOR@
     RANLIB = @RANLIB@
    @@ -134,19 +169,13 @@ SET_MAKE = @SET_MAKE@
     SHELL = @SHELL@
     STRIP = @STRIP@
     VERSION = @VERSION@
    -WITH_DOC_FALSE = @WITH_DOC_FALSE@
    -WITH_DOC_TRUE = @WITH_DOC_TRUE@
    -WITH_PAM_UNIX_FALSE = @WITH_PAM_UNIX_FALSE@
    -WITH_PAM_UNIX_TRUE = @WITH_PAM_UNIX_TRUE@
    -WITH_SU_FALSE = @WITH_SU_FALSE@
    -WITH_SU_TRUE = @WITH_SU_TRUE@
    +abs_builddir = @abs_builddir@
    +abs_srcdir = @abs_srcdir@
    +abs_top_builddir = @abs_top_builddir@
    +abs_top_srcdir = @abs_top_srcdir@
    +ac_ct_AR = @ac_ct_AR@
     ac_ct_CC = @ac_ct_CC@
    -ac_ct_CXX = @ac_ct_CXX@
    -ac_ct_F77 = @ac_ct_F77@
    -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
    -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
    -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
    -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
    +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
     am__include = @am__include@
     am__leading_dot = @am__leading_dot@
     am__quote = @am__quote@
    @@ -158,6 +187,7 @@ build_alias = @build_alias@
     build_cpu = @build_cpu@
     build_os = @build_os@
     build_vendor = @build_vendor@
    +builddir = @builddir@
     datadir = @datadir@
     datarootdir = @datarootdir@
     docdir = @docdir@
    @@ -185,13 +215,14 @@ program_transform_name = @program_transf
     psdir = @psdir@
     sbindir = @sbindir@
     sharedstatedir = @sharedstatedir@
    +srcdir = @srcdir@
     sysconfdir = @sysconfdir@
    -target = @target@
     target_alias = @target_alias@
    -target_cpu = @target_cpu@
    -target_os = @target_os@
    -target_vendor = @target_vendor@
    -SUBDIRS = lib bin modules include $(am__append_1)
    +top_build_prefix = @top_build_prefix@
    +top_builddir = @top_builddir@
    +top_srcdir = @top_srcdir@
    +ACLOCAL_AMFLAGS = -I m4
    +SUBDIRS = lib bin modules include $(am__append_1) t
     EXTRA_DIST = \
     	CREDITS \
     	HISTORY \
    @@ -212,15 +243,15 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefi
     	@for dep in $?; do \
     	  case '$(am__configure_deps)' in \
     	    *$$dep*) \
    -	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
    -	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
    +	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
    +	      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
     		&& exit 0; \
     	      exit 1;; \
     	  esac; \
     	done; \
    -	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
    -	cd $(top_srcdir) && \
    -	  $(AUTOMAKE) --foreign  Makefile
    +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
    +	$(am__cd) $(top_srcdir) && \
    +	  $(AUTOMAKE) --foreign Makefile
     .PRECIOUS: Makefile
     Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
     	@case '$?' in \
    @@ -236,26 +267,29 @@ $(top_builddir)/config.status: $(top_src
     	$(SHELL) ./config.status --recheck
     
     $(top_srcdir)/configure:  $(am__configure_deps)
    -	cd $(srcdir) && $(AUTOCONF)
    +	$(am__cd) $(srcdir) && $(AUTOCONF)
     $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
    -	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
    +	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
    +$(am__aclocal_m4_deps):
     
     config.h: stamp-h1
     	@if test ! -f $@; then \
     	  rm -f stamp-h1; \
    -	  $(MAKE) stamp-h1; \
    +	  $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
     	else :; fi
     
     stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
     	@rm -f stamp-h1
     	cd $(top_builddir) && $(SHELL) ./config.status config.h
     $(srcdir)/config.h.in:  $(am__configure_deps) 
    -	cd $(top_srcdir) && $(AUTOHEADER)
    +	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
     	rm -f stamp-h1
     	touch $@
     
     distclean-hdr:
     	-rm -f config.h stamp-h1
    +pamgdb: $(top_builddir)/config.status $(srcdir)/pamgdb.in
    +	cd $(top_builddir) && $(SHELL) ./config.status $@
     
     mostlyclean-libtool:
     	-rm -f *.lo
    @@ -264,8 +298,7 @@ clean-libtool:
     	-rm -rf .libs _libs
     
     distclean-libtool:
    -	-rm -f libtool
    -uninstall-info-am:
    +	-rm -f libtool config.lt
     
     # This directory's subdirectories are mostly independent; you can cd
     # into them and run `make' without going through this Makefile.
    @@ -274,7 +307,7 @@ uninstall-info-am:
     #     (which will cause the Makefiles to be regenerated when you run `make');
     # (2) otherwise, pass the desired values on the `make' command line.
     $(RECURSIVE_TARGETS):
    -	@failcom='exit 1'; \
    +	@fail= failcom='exit 1'; \
     	for f in x $$MAKEFLAGS; do \
     	  case $$f in \
     	    *=* | --[!k]*);; \
    @@ -291,16 +324,15 @@ $(RECURSIVE_TARGETS):
     	  else \
     	    local_target="$$target"; \
     	  fi; \
    -	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
    +	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
     	  || eval $$failcom; \
     	done; \
     	if test "$$dot_seen" = "no"; then \
     	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
     	fi; test -z "$$fail"
     
    -mostlyclean-recursive clean-recursive distclean-recursive \
    -maintainer-clean-recursive:
    -	@failcom='exit 1'; \
    +$(RECURSIVE_CLEAN_TARGETS):
    +	@fail= failcom='exit 1'; \
     	for f in x $$MAKEFLAGS; do \
     	  case $$f in \
     	    *=* | --[!k]*);; \
    @@ -326,16 +358,16 @@ maintainer-clean-recursive:
     	  else \
     	    local_target="$$target"; \
     	  fi; \
    -	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
    +	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
     	  || eval $$failcom; \
     	done && test -z "$$fail"
     tags-recursive:
     	list='$(SUBDIRS)'; for subdir in $$list; do \
    -	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
    +	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
     	done
     ctags-recursive:
     	list='$(SUBDIRS)'; for subdir in $$list; do \
    -	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
    +	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
     	done
     
     ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
    @@ -343,14 +375,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS
     	unique=`for i in $$list; do \
     	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
     	  done | \
    -	  $(AWK) '    { files[$$0] = 1; } \
    -	       END { for (i in files) print i; }'`; \
    +	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
    +	      END { if (nonempty) { for (i in files) print i; }; }'`; \
     	mkid -fID $$unique
     tags: TAGS
     
     TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
     		$(TAGS_FILES) $(LISP)
    -	tags=; \
    +	set x; \
     	here=`pwd`; \
     	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
     	  include_option=--etags-include; \
    @@ -362,93 +394,114 @@ TAGS: tags-recursive $(HEADERS) $(SOURCE
     	list='$(SUBDIRS)'; for subdir in $$list; do \
     	  if test "$$subdir" = .; then :; else \
     	    test ! -f $$subdir/TAGS || \
    -	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
    +	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
     	  fi; \
     	done; \
     	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
     	unique=`for i in $$list; do \
     	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
     	  done | \
    -	  $(AWK) '    { files[$$0] = 1; } \
    -	       END { for (i in files) print i; }'`; \
    -	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
    +	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
    +	      END { if (nonempty) { for (i in files) print i; }; }'`; \
    +	shift; \
    +	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
     	  test -n "$$unique" || unique=$$empty_fix; \
    -	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    -	    $$tags $$unique; \
    +	  if test $$# -gt 0; then \
    +	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    +	      "$$@" $$unique; \
    +	  else \
    +	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    +	      $$unique; \
    +	  fi; \
     	fi
     ctags: CTAGS
     CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
     		$(TAGS_FILES) $(LISP)
    -	tags=; \
    -	here=`pwd`; \
     	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
     	unique=`for i in $$list; do \
     	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
     	  done | \
    -	  $(AWK) '    { files[$$0] = 1; } \
    -	       END { for (i in files) print i; }'`; \
    -	test -z "$(CTAGS_ARGS)$$tags$$unique" \
    +	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
    +	      END { if (nonempty) { for (i in files) print i; }; }'`; \
    +	test -z "$(CTAGS_ARGS)$$unique" \
     	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
    -	     $$tags $$unique
    +	     $$unique
     
     GTAGS:
     	here=`$(am__cd) $(top_builddir) && pwd` \
    -	  && cd $(top_srcdir) \
    -	  && gtags -i $(GTAGS_ARGS) $$here
    +	  && $(am__cd) $(top_srcdir) \
    +	  && gtags -i $(GTAGS_ARGS) "$$here"
     
     distclean-tags:
     	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
     
     distdir: $(DISTFILES)
     	$(am__remove_distdir)
    -	mkdir $(distdir)
    -	$(mkdir_p) $(distdir)/misc
    -	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
    -	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
    -	list='$(DISTFILES)'; for file in $$list; do \
    -	  case $$file in \
    -	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
    -	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
    -	  esac; \
    +	test -d "$(distdir)" || mkdir "$(distdir)"
    +	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
    +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
    +	list='$(DISTFILES)'; \
    +	  dist_files=`for file in $$list; do echo $$file; done | \
    +	  sed -e "s|^$$srcdirstrip/||;t" \
    +	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
    +	case $$dist_files in \
    +	  */*) $(MKDIR_P) `echo "$$dist_files" | \
    +			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
    +			   sort -u` ;; \
    +	esac; \
    +	for file in $$dist_files; do \
     	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
    -	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
    -	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
    -	    dir="/$$dir"; \
    -	    $(mkdir_p) "$(distdir)$$dir"; \
    -	  else \
    -	    dir=''; \
    -	  fi; \
     	  if test -d $$d/$$file; then \
    +	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
    +	    if test -d "$(distdir)/$$file"; then \
    +	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
    +	    fi; \
     	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
    -	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
    +	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
    +	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
     	    fi; \
    -	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
    +	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
     	  else \
    -	    test -f $(distdir)/$$file \
    -	    || cp -p $$d/$$file $(distdir)/$$file \
    +	    test -f "$(distdir)/$$file" \
    +	    || cp -p $$d/$$file "$(distdir)/$$file" \
     	    || exit 1; \
     	  fi; \
     	done
    -	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
    +	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
     	  if test "$$subdir" = .; then :; else \
     	    test -d "$(distdir)/$$subdir" \
    -	    || $(mkdir_p) "$(distdir)/$$subdir" \
    +	    || $(MKDIR_P) "$(distdir)/$$subdir" \
     	    || exit 1; \
    -	    distdir=`$(am__cd) $(distdir) && pwd`; \
    -	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
    -	    (cd $$subdir && \
    +	  fi; \
    +	done
    +	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
    +	  if test "$$subdir" = .; then :; else \
    +	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
    +	    $(am__relativize); \
    +	    new_distdir=$$reldir; \
    +	    dir1=$$subdir; dir2="$(top_distdir)"; \
    +	    $(am__relativize); \
    +	    new_top_distdir=$$reldir; \
    +	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
    +	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
    +	    ($(am__cd) $$subdir && \
     	      $(MAKE) $(AM_MAKEFLAGS) \
    -	        top_distdir="$$top_distdir" \
    -	        distdir="$$distdir/$$subdir" \
    +	        top_distdir="$$new_top_distdir" \
    +	        distdir="$$new_distdir" \
    +		am__remove_distdir=: \
    +		am__skip_length_check=: \
    +		am__skip_mode_fix=: \
     	        distdir) \
     	      || exit 1; \
     	  fi; \
     	done
    -	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
    +	-test -n "$(am__skip_mode_fix)" \
    +	|| find "$(distdir)" -type d ! -perm -755 \
    +		-exec chmod u+rwx,go+rx {} \; -o \
     	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
     	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
    -	  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
    -	|| chmod -R a+r $(distdir)
    +	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
    +	|| chmod -R a+r "$(distdir)"
     dist-gzip: distdir
     	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
     	$(am__remove_distdir)
    @@ -457,6 +510,14 @@ dist-bzip2: distdir
     	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
     	$(am__remove_distdir)
     
    +dist-lzma: distdir
    +	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
    +	$(am__remove_distdir)
    +
    +dist-xz: distdir
    +	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
    +	$(am__remove_distdir)
    +
     dist-tarZ: distdir
     	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
     	$(am__remove_distdir)
    @@ -480,13 +541,17 @@ dist dist-all: distdir
     distcheck: dist
     	case '$(DIST_ARCHIVES)' in \
     	*.tar.gz*) \
    -	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
    +	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
     	*.tar.bz2*) \
    -	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
    +	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
    +	*.tar.lzma*) \
    +	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
    +	*.tar.xz*) \
    +	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
     	*.tar.Z*) \
     	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
     	*.shar.gz*) \
    -	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
    +	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
     	*.zip*) \
     	  unzip $(distdir).zip ;;\
     	esac
    @@ -494,9 +559,11 @@ distcheck: dist
     	mkdir $(distdir)/_build
     	mkdir $(distdir)/_inst
     	chmod a-w $(distdir)
    +	test -d $(distdir)/_build || exit 0; \
     	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
     	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
    -	  && cd $(distdir)/_build \
    +	  && am__cwd=`pwd` \
    +	  && $(am__cd) $(distdir)/_build \
     	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
     	    $(DISTCHECK_CONFIGURE_FLAGS) \
     	  && $(MAKE) $(AM_MAKEFLAGS) \
    @@ -518,13 +585,15 @@ distcheck: dist
     	  && rm -rf "$$dc_destdir" \
     	  && $(MAKE) $(AM_MAKEFLAGS) dist \
     	  && rm -rf $(DIST_ARCHIVES) \
    -	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
    +	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
    +	  && cd "$$am__cwd" \
    +	  || exit 1
     	$(am__remove_distdir)
     	@(echo "$(distdir) archives ready for distribution: "; \
     	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
    -	  sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
    +	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
     distuninstallcheck:
    -	@cd $(distuninstallcheck_dir) \
    +	@$(am__cd) '$(distuninstallcheck_dir)' \
     	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
     	   || { echo "ERROR: files left after uninstall:" ; \
     	        if test -n "$(DESTDIR)"; then \
    @@ -566,6 +635,7 @@ clean-generic:
     
     distclean-generic:
     	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
    +	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
     
     maintainer-clean-generic:
     	@echo "This command is intended for maintainers to use"
    @@ -586,18 +656,38 @@ dvi-am:
     
     html: html-recursive
     
    +html-am:
    +
     info: info-recursive
     
     info-am:
     
     install-data-am:
     
    +install-dvi: install-dvi-recursive
    +
    +install-dvi-am:
    +
     install-exec-am:
     
    +install-html: install-html-recursive
    +
    +install-html-am:
    +
     install-info: install-info-recursive
     
    +install-info-am:
    +
     install-man:
     
    +install-pdf: install-pdf-recursive
    +
    +install-pdf-am:
    +
    +install-ps: install-ps-recursive
    +
    +install-ps-am:
    +
     installcheck-am:
     
     maintainer-clean: maintainer-clean-recursive
    @@ -618,24 +708,27 @@ ps: ps-recursive
     
     ps-am:
     
    -uninstall-am: uninstall-info-am
    +uninstall-am:
     
    -uninstall-info: uninstall-info-recursive
    +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
    +	ctags-recursive install-am install-strip tags-recursive
     
    -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
    -	check-am clean clean-generic clean-libtool clean-recursive \
    -	ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
    -	dist-shar dist-tarZ dist-zip distcheck distclean \
    -	distclean-generic distclean-hdr distclean-libtool \
    -	distclean-recursive distclean-tags distcleancheck distdir \
    +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
    +	all all-am am--refresh check check-am clean clean-generic \
    +	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
    +	dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
    +	distcheck distclean distclean-generic distclean-hdr \
    +	distclean-libtool distclean-tags distcleancheck distdir \
     	distuninstallcheck dvi dvi-am html html-am info info-am \
    -	install install-am install-data install-data-am install-exec \
    -	install-exec-am install-info install-info-am install-man \
    +	install install-am install-data install-data-am install-dvi \
    +	install-dvi-am install-exec install-exec-am install-html \
    +	install-html-am install-info install-info-am install-man \
    +	install-pdf install-pdf-am install-ps install-ps-am \
     	install-strip installcheck installcheck-am installdirs \
     	installdirs-am maintainer-clean maintainer-clean-generic \
    -	maintainer-clean-recursive mostlyclean mostlyclean-generic \
    -	mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
    -	tags tags-recursive uninstall uninstall-am uninstall-info-am
    +	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
    +	ps ps-am tags tags-recursive uninstall uninstall-am
    +
     
     # Tell versions [3.59,3.63) of GNU make to not export all variables.
     # Otherwise a system limit (for SysV at least) may be exceeded.
    
    Modified: stable/9/contrib/openpam/README
    ==============================================================================
    --- stable/9/contrib/openpam/README	Fri Mar  1 19:40:02 2013	(r247567)
    +++ stable/9/contrib/openpam/README	Fri Mar  1 19:42:50 2013	(r247568)
    @@ -22,6 +22,6 @@ These are some of OpenPAM's features:
          /usr/local/etc/pam.d/ and /usr/local/etc/pam.conf, in that order;
          this will be made configurable in a future release.
     
    -Please direct bug reports and inquiries to des@freebsd.org.
    +Please direct bug reports and inquiries to .
     
    -$Id: README 320 2006-02-16 20:33:19Z des $
    +$Id: README 424 2009-10-29 17:10:22Z des $
    
    Modified: stable/9/contrib/openpam/RELNOTES
    ==============================================================================
    --- stable/9/contrib/openpam/RELNOTES	Fri Mar  1 19:40:02 2013	(r247567)
    +++ stable/9/contrib/openpam/RELNOTES	Fri Mar  1 19:42:50 2013	(r247568)
    @@ -1,13 +1,11 @@
     
    -		 Release notes for OpenPAM Hydrangea
    -		 ===================================
    +		Release notes for OpenPAM Micrampelis
    +		=====================================
     
    -This release corresponds to the code used in FreeBSD-CURRENT as of the
    -release date.  It has also been tested on several other platforms, and
    -is expected to work on almost any POSIX-like platform that has GNU
    -autotools, GNU make and the GNU compiler suite installed.  One notable
    -exception is MacOS X, which ships with a very weird, heavily modified
    -version of GCC.
    +This release corresponds to the code used in FreeBSD HEAD as of the
    +release date, and is also expected to work on almost any POSIX-like
    +platform that has GNU autotools, GNU make and the GNU compiler suite
    +installed.
     
     The library itself is complete.  Documentation exists in the form of
     man pages for the library functions.  These man pages are generated by
    @@ -18,12 +16,12 @@ of date.
     The distribution also includes three sample modules (pam_deny,
     pam_permit and pam_unix) and a sample application (su).  These are not
     intended for actual use, but rather to serve as examples for module or
    -application developers.
    +application developers.  It also includes a command-line application
    +(pamtest) which can be used to test policies and modules.
     
    -NOTE: to the person who sent me MacOS patches in July 2002: I have
    -lost your name and email address.  Please contact me so I can give you
    -proper credit for your contribution.
    +Unit tests for limited portions of the library can be found in the t
    +subdirectory.
     
    -Please direct bug reports and inquiries to .
    +Please direct bug reports and inquiries to .
     
    -$Id: RELNOTES 404 2007-11-28 12:31:04Z des $
    +$Id: RELNOTES 609 2012-05-26 13:57:45Z des $
    
    Copied: stable/9/contrib/openpam/TODO (from r236109, head/contrib/openpam/TODO)
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ stable/9/contrib/openpam/TODO	Fri Mar  1 19:42:50 2013	(r247568, copy of r236109, head/contrib/openpam/TODO)
    @@ -0,0 +1,13 @@
    +Before the next release:
    +
    + - Complete the transition from PAM_LOG_DEBUG to PAM_LOG_LIBDEBUG.
    +
    +Whenever:
    +
    + - Implement mechanism to enable / disable optional features.  Use it
    +   to disable strict error checking so pamtest and unit tests can do
    +   things that we don't allow in production.
    +
    + - Rewrite the module-loading code.
    +
    +$Id: TODO 592 2012-04-08 13:19:51Z des $
    
    Modified: stable/9/contrib/openpam/aclocal.m4
    ==============================================================================
    --- stable/9/contrib/openpam/aclocal.m4	Fri Mar  1 19:40:02 2013	(r247567)
    +++ stable/9/contrib/openpam/aclocal.m4	Fri Mar  1 19:42:50 2013	(r247568)
    @@ -1,7 +1,7 @@
    -# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
    +# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
     
     # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
    -# 2005  Free Software Foundation, Inc.
    +# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
     # This file is free software; the Free Software Foundation
     # gives unlimited permission to copy and/or distribute it,
     # with or without modifications, as long as this notice is preserved.
    @@ -11,103 +11,208 @@
     # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
     # PARTICULAR PURPOSE.
     
    +m4_ifndef([AC_AUTOCONF_VERSION],
    +  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
    +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
    +[m4_warning([this file was generated for autoconf 2.68.
    +You have another version of autoconf.  It may work, but is not guaranteed to.
    +If you have problems, you may need to regenerate the build system entirely.
    +To do so, use the procedure documented by the package, typically `autoreconf'.])])
    +
     # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
    +#
    +#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
    +#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
    +#                 Foundation, Inc.
    +#   Written by Gordon Matzigkeit, 1996
    +#
    +# This file is free software; the Free Software Foundation gives
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 19:55:12 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 25ECD2F9;
     Fri,  1 Mar 2013 19:55:12 +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 07A0112DA;
     Fri,  1 Mar 2013 19:55:12 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21JtCff069129;
     Fri, 1 Mar 2013 19:55:12 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21JtAqn069123;
     Fri, 1 Mar 2013 19:55:10 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303011955.r21JtAqn069123@svn.freebsd.org>
    From: Marius Strobl 
    Date: Fri, 1 Mar 2013 19:55:10 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247570 - head/sys/dev/aac
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 19:55:12 -0000
    
    Author: marius
    Date: Fri Mar  1 19:55:10 2013
    New Revision: 247570
    URL: http://svnweb.freebsd.org/changeset/base/247570
    
    Log:
      - Make tables, device ID strings etc const. This includes #ifdef'ing 0
        aac_command_status_table, which is actually unused since r111532.
        While at it, make aac_if a pointer to the now const interface tables
        instead of copying them over to the softc (this alone already reduces the
        size of aac.ko on amd64 by ~1 KiB).
      - Remove redundant softc members.
      - Use DEVMETHOD_END.
      - Use NULL instead of 0 for pointers.
      - Remove redundant bzero(9)'ing of the softc.
      - Use pci_enable_busmaster(9) instead of duplicating it.
      - Remove redundant checking for PCIM_CMD_MEMEN (resource allocation will
        just fail).
      - Canonicalize the error messages in case of resource allocation failures.
      - Add support for using MSI instead of INTx, controllable via the tunable
        hw.aac.enable_msi (defaulting to on).
      
      MFC after:	1 month
    
    Modified:
      head/sys/dev/aac/aac.c
      head/sys/dev/aac/aac_cam.c
      head/sys/dev/aac/aac_disk.c
      head/sys/dev/aac/aac_pci.c
      head/sys/dev/aac/aac_tables.h
      head/sys/dev/aac/aacvar.h
    
    Modified: head/sys/dev/aac/aac.c
    ==============================================================================
    --- head/sys/dev/aac/aac.c	Fri Mar  1 19:54:25 2013	(r247569)
    +++ head/sys/dev/aac/aac.c	Fri Mar  1 19:55:10 2013	(r247570)
    @@ -117,7 +117,7 @@ static void	aac_sa_set_mailbox(struct aa
     static int	aac_sa_get_mailbox(struct aac_softc *sc, int mb);
     static void	aac_sa_set_interrupts(struct aac_softc *sc, int enable);
     
    -struct aac_interface aac_sa_interface = {
    +const struct aac_interface aac_sa_interface = {
     	aac_sa_get_fwstatus,
     	aac_sa_qnotify,
     	aac_sa_get_istatus,
    @@ -142,7 +142,7 @@ static int aac_rx_send_command(struct aa
     static int aac_rx_get_outb_queue(struct aac_softc *sc);
     static void aac_rx_set_outb_queue(struct aac_softc *sc, int index);
     
    -struct aac_interface aac_rx_interface = {
    +const struct aac_interface aac_rx_interface = {
     	aac_rx_get_fwstatus,
     	aac_rx_qnotify,
     	aac_rx_get_istatus,
    @@ -169,7 +169,7 @@ static int aac_rkt_send_command(struct a
     static int aac_rkt_get_outb_queue(struct aac_softc *sc);
     static void aac_rkt_set_outb_queue(struct aac_softc *sc, int index);
     
    -struct aac_interface aac_rkt_interface = {
    +const struct aac_interface aac_rkt_interface = {
     	aac_rkt_get_fwstatus,
     	aac_rkt_qnotify,
     	aac_rkt_get_istatus,
    @@ -183,8 +183,8 @@ struct aac_interface aac_rkt_interface =
     };
     
     /* Debugging and Diagnostics */
    -static void	aac_describe_controller(struct aac_softc *sc);
    -static char	*aac_describe_code(struct aac_code_lookup *table,
    +static void		aac_describe_controller(struct aac_softc *sc);
    +static const char	*aac_describe_code(const struct aac_code_lookup *table,
     				   u_int32_t code);
     
     /* Management Interface */
    @@ -222,7 +222,7 @@ static struct cdevsw aac_cdevsw = {
     static MALLOC_DEFINE(M_AACBUF, "aacbuf", "Buffers for the AAC driver");
     
     /* sysctl node */
    -static SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters");
    +SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters");
     
     /*
      * Device Interface
    @@ -634,8 +634,8 @@ aac_free(struct aac_softc *sc)
     	if (sc->aac_intr)
     		bus_teardown_intr(sc->aac_dev, sc->aac_irq, sc->aac_intr);
     	if (sc->aac_irq != NULL)
    -		bus_release_resource(sc->aac_dev, SYS_RES_IRQ, sc->aac_irq_rid,
    -				     sc->aac_irq);
    +		bus_release_resource(sc->aac_dev, SYS_RES_IRQ,
    +		    rman_get_rid(sc->aac_irq), sc->aac_irq);
     
     	/* destroy data-transfer DMA tag */
     	if (sc->aac_buffer_dmat)
    @@ -648,10 +648,10 @@ aac_free(struct aac_softc *sc)
     	/* release the register window mapping */
     	if (sc->aac_regs_res0 != NULL)
     		bus_release_resource(sc->aac_dev, SYS_RES_MEMORY,
    -				     sc->aac_regs_rid0, sc->aac_regs_res0);
    +		    rman_get_rid(sc->aac_regs_res0), sc->aac_regs_res0);
     	if (sc->aac_hwif == AAC_HWIF_NARK && sc->aac_regs_res1 != NULL)
     		bus_release_resource(sc->aac_dev, SYS_RES_MEMORY,
    -				     sc->aac_regs_rid1, sc->aac_regs_res1);
    +		    rman_get_rid(sc->aac_regs_res1), sc->aac_regs_res1);
     }
     
     /*
    @@ -1333,9 +1333,6 @@ aac_bio_complete(struct aac_command *cm)
     	} else {
     		bp->bio_error = EIO;
     		bp->bio_flags |= BIO_ERROR;
    -		/* pass an error string out to the disk layer */
    -		bp->bio_driver1 = aac_describe_code(aac_command_status_table,
    -						    status);
     	}
     	aac_biodone(bp);
     }
    @@ -1687,7 +1684,7 @@ static int
     aac_check_firmware(struct aac_softc *sc)
     {
     	u_int32_t code, major, minor, options = 0, atu_size = 0;
    -	int status;
    +	int rid, status;
     	time_t then;
     
     	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
    @@ -1765,7 +1762,7 @@ aac_check_firmware(struct aac_softc *sc)
     			sc->flags |= AAC_FLAGS_SG_64BIT;
     		}
     		if ((options & AAC_SUPPORTED_NEW_COMM)
    -		 && sc->aac_if.aif_send_command)
    +		 && sc->aac_if->aif_send_command)
     			sc->flags |= AAC_FLAGS_NEW_COMM;
     		if (options & AAC_SUPPORTED_64BIT_ARRAYSIZE)
     			sc->flags |= AAC_FLAGS_ARRAY_64BIT;
    @@ -1776,17 +1773,15 @@ aac_check_firmware(struct aac_softc *sc)
     
     	/* Remap mem. resource, if required */
     	if ((sc->flags & AAC_FLAGS_NEW_COMM) &&
    -		atu_size > rman_get_size(sc->aac_regs_res1)) {
    -		bus_release_resource(
    -			sc->aac_dev, SYS_RES_MEMORY,
    -			sc->aac_regs_rid1, sc->aac_regs_res1);
    -		sc->aac_regs_res1 = bus_alloc_resource(
    -			sc->aac_dev, SYS_RES_MEMORY, &sc->aac_regs_rid1,
    -			0ul, ~0ul, atu_size, RF_ACTIVE);
    +	    atu_size > rman_get_size(sc->aac_regs_res1)) {
    +		rid = rman_get_rid(sc->aac_regs_res1);
    +		bus_release_resource(sc->aac_dev, SYS_RES_MEMORY, rid,
    +		    sc->aac_regs_res1);
    +		sc->aac_regs_res1 = bus_alloc_resource(sc->aac_dev,
    +		    SYS_RES_MEMORY, &rid, 0ul, ~0ul, atu_size, RF_ACTIVE);
     		if (sc->aac_regs_res1 == NULL) {
     			sc->aac_regs_res1 = bus_alloc_resource_any(
    -				sc->aac_dev, SYS_RES_MEMORY,
    -				&sc->aac_regs_rid1, RF_ACTIVE);
    +			    sc->aac_dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
     			if (sc->aac_regs_res1 == NULL) {
     				device_printf(sc->aac_dev,
     				    "couldn't allocate register window\n");
    @@ -1799,7 +1794,6 @@ aac_check_firmware(struct aac_softc *sc)
     
     		if (sc->aac_hwif == AAC_HWIF_NARK) {
     			sc->aac_regs_res0 = sc->aac_regs_res1;
    -			sc->aac_regs_rid0 = sc->aac_regs_rid1;
     			sc->aac_btag0 = sc->aac_btag1;
     			sc->aac_bhandle0 = sc->aac_bhandle1;
     		}
    @@ -2003,14 +1997,7 @@ out:
     static int
     aac_setup_intr(struct aac_softc *sc)
     {
    -	sc->aac_irq_rid = 0;
    -	if ((sc->aac_irq = bus_alloc_resource_any(sc->aac_dev, SYS_RES_IRQ,
    -			   			  &sc->aac_irq_rid,
    -			   			  RF_SHAREABLE |
    -						  RF_ACTIVE)) == NULL) {
    -		device_printf(sc->aac_dev, "can't allocate interrupt\n");
    -		return (EINVAL);
    -	}
    +
     	if (sc->flags & AAC_FLAGS_NEW_COMM) {
     		if (bus_setup_intr(sc->aac_dev, sc->aac_irq,
     				   INTR_MPSAFE|INTR_TYPE_BIO, NULL,
    @@ -2119,7 +2106,7 @@ aac_sync_fib(struct aac_softc *sc, u_int
      * Note that the queue implementation here is a little funky; neither the PI or
      * CI will ever be zero.  This behaviour is a controller feature.
      */
    -static struct {
    +static const struct {
     	int		size;
     	int		notify;
     } aac_qinfo[] = {
    @@ -2786,8 +2773,8 @@ aac_describe_controller(struct aac_softc
      * Look up a text description of a numeric error code and return a pointer to
      * same.
      */
    -static char *
    -aac_describe_code(struct aac_code_lookup *table, u_int32_t code)
    +static const char *
    +aac_describe_code(const struct aac_code_lookup *table, u_int32_t code)
     {
     	int i;
     
    
    Modified: head/sys/dev/aac/aac_cam.c
    ==============================================================================
    --- head/sys/dev/aac/aac_cam.c	Fri Mar  1 19:54:25 2013	(r247569)
    +++ head/sys/dev/aac/aac_cam.c	Fri Mar  1 19:55:10 2013	(r247570)
    @@ -92,7 +92,7 @@ static device_method_t	aac_pass_methods[
     	DEVMETHOD(device_probe,		aac_cam_probe),
     	DEVMETHOD(device_attach,	aac_cam_attach),
     	DEVMETHOD(device_detach,	aac_cam_detach),
    -	{ 0, 0 }
    +	DEVMETHOD_END
     };
     
     static driver_t	aac_pass_driver = {
    @@ -101,7 +101,7 @@ static driver_t	aac_pass_driver = {
     	sizeof(struct aac_cam)
     };
     
    -DRIVER_MODULE(aacp, aac, aac_pass_driver, aac_pass_devclass, 0, 0);
    +DRIVER_MODULE(aacp, aac, aac_pass_driver, aac_pass_devclass, NULL, NULL);
     MODULE_DEPEND(aacp, cam, 1, 1, 1);
     
     static MALLOC_DEFINE(M_AACCAM, "aaccam", "AAC CAM info");
    @@ -685,4 +685,3 @@ aac_cam_term_io(struct cam_sim *sim, uni
     {
     	return (CAM_UA_TERMIO);
     }
    -
    
    Modified: head/sys/dev/aac/aac_disk.c
    ==============================================================================
    --- head/sys/dev/aac/aac_disk.c	Fri Mar  1 19:54:25 2013	(r247569)
    +++ head/sys/dev/aac/aac_disk.c	Fri Mar  1 19:55:10 2013	(r247570)
    @@ -73,7 +73,7 @@ static device_method_t aac_disk_methods[
     	DEVMETHOD(device_probe,	aac_disk_probe),
     	DEVMETHOD(device_attach,	aac_disk_attach),
     	DEVMETHOD(device_detach,	aac_disk_detach),
    -	{ 0, 0 }
    +	DEVMETHOD_END
     };
     
     static driver_t aac_disk_driver = {
    @@ -82,7 +82,7 @@ static driver_t aac_disk_driver = {
     	sizeof(struct aac_disk)
     };
     
    -DRIVER_MODULE(aacd, aac, aac_disk_driver, aac_disk_devclass, 0, 0);
    +DRIVER_MODULE(aacd, aac, aac_disk_driver, aac_disk_devclass, NULL, NULL);
     
     /*
      * Handle open from generic layer.
    
    Modified: head/sys/dev/aac/aac_pci.c
    ==============================================================================
    --- head/sys/dev/aac/aac_pci.c	Fri Mar  1 19:54:25 2013	(r247569)
    +++ head/sys/dev/aac/aac_pci.c	Fri Mar  1 19:55:10 2013	(r247570)
    @@ -60,6 +60,11 @@ __FBSDID("$FreeBSD$");
     static int	aac_pci_probe(device_t dev);
     static int	aac_pci_attach(device_t dev);
     
    +static int aac_enable_msi = 1;
    +TUNABLE_INT("hw.aac.enable_msi", &aac_enable_msi);
    +SYSCTL_INT(_hw_aac, OID_AUTO, enable_msi, CTLFLAG_RDTUN, &aac_enable_msi, 0,
    +    "Enable MSI interrupts");
    +
     static device_method_t aac_methods[] = {
     	/* Device interface */
     	DEVMETHOD(device_probe,		aac_pci_probe),
    @@ -79,11 +84,10 @@ static driver_t aac_pci_driver = {
     
     static devclass_t	aac_devclass;
     
    -DRIVER_MODULE(aac, pci, aac_pci_driver, aac_devclass, 0, 0);
    +DRIVER_MODULE(aac, pci, aac_pci_driver, aac_devclass, NULL, NULL);
     MODULE_DEPEND(aac, pci, 1, 1, 1);
     
    -
    -struct aac_ident
    +static const struct aac_ident
     {
     	u_int16_t		vendor;
     	u_int16_t		device;
    @@ -91,7 +95,7 @@ struct aac_ident
     	u_int16_t		subdevice;
     	int			hwif;
     	int			quirks;
    -	char			*desc;
    +	const char		*desc;
     } aac_identifiers[] = {
     	{0x1028, 0x0001, 0x1028, 0x0001, AAC_HWIF_I960RX, 0,
     	"Dell PERC 2/Si"},
    @@ -139,7 +143,6 @@ struct aac_ident
     	 "Adaptec SCSI RAID 2230S"},
     	{0x9005, 0x0286, 0x9005, 0x028d, AAC_HWIF_RKT, 0,
     	 "Adaptec SCSI RAID 2130S"},
    -
     	{0x9005, 0x0285, 0x9005, 0x0287, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB |
     	 AAC_FLAGS_256FIBS, "Adaptec SCSI RAID 2200S"},
     	{0x9005, 0x0285, 0x17aa, 0x0286, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB |
    @@ -276,7 +279,8 @@ struct aac_ident
     	 "AOC-USAS-S8iR-LP"},
     	{0, 0, 0, 0, 0, 0, 0}
     };
    -struct aac_ident
    +
    +static const struct aac_ident
     aac_family_identifiers[] = {
     	{0x9005, 0x0285, 0, 0, AAC_HWIF_I960RX, 0,
     	 "Adaptec RAID Controller"},
    @@ -285,10 +289,10 @@ aac_family_identifiers[] = {
     	{0, 0, 0, 0, 0, 0, 0}
     };
     
    -static struct aac_ident *
    +static const struct aac_ident *
     aac_find_ident(device_t dev)
     {
    -	struct aac_ident *m;
    +	const struct aac_ident *m;
     	u_int16_t vendid, devid, sub_vendid, sub_devid;
     
     	vendid = pci_get_vendor(dev);
    @@ -317,7 +321,7 @@ aac_find_ident(device_t dev)
     static int
     aac_pci_probe(device_t dev)
     {
    -	struct aac_ident *id;
    +	const struct aac_ident *id;
     
     	fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
     
    @@ -335,9 +339,8 @@ static int
     aac_pci_attach(device_t dev)
     {
     	struct aac_softc *sc;
    -	struct aac_ident *id;
    -	int error;
    -	u_int32_t command;
    +	const struct aac_ident *id;
    +	int count, error, reg, rid;
     
     	fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
     
    @@ -345,7 +348,6 @@ aac_pci_attach(device_t dev)
     	 * Initialise softc.
     	 */
     	sc = device_get_softc(dev);
    -	bzero(sc, sizeof(*sc));
     	sc->aac_dev = dev;
     
     	/* assume failure is 'not configured' */
    @@ -354,55 +356,65 @@ aac_pci_attach(device_t dev)
     	/*
     	 * Verify that the adapter is correctly set up in PCI space.
     	 */
    -	command = pci_read_config(sc->aac_dev, PCIR_COMMAND, 2);
    -	command |= PCIM_CMD_BUSMASTEREN;
    -	pci_write_config(dev, PCIR_COMMAND, command, 2);
    -	command = pci_read_config(sc->aac_dev, PCIR_COMMAND, 2);
    -	if (!(command & PCIM_CMD_BUSMASTEREN)) {
    -		device_printf(sc->aac_dev, "can't enable bus-master feature\n");
    -		goto out;
    -	}
    -	if ((command & PCIM_CMD_MEMEN) == 0) {
    -		device_printf(sc->aac_dev, "memory window not available\n");
    +	pci_enable_busmaster(dev);
    +	if (!(pci_read_config(dev, PCIR_COMMAND, 2) & PCIM_CMD_BUSMASTEREN)) {
    +		device_printf(dev, "can't enable bus-master feature\n");
     		goto out;
     	}
     
     	/*
    -	 * Allocate the PCI register window.
    +	 * Allocate the PCI register window(s).
     	 */
    -	sc->aac_regs_rid0 = PCIR_BAR(0);
    -	if ((sc->aac_regs_res0 = bus_alloc_resource_any(sc->aac_dev,
    -	    SYS_RES_MEMORY, &sc->aac_regs_rid0, RF_ACTIVE)) == NULL) {
    -		device_printf(sc->aac_dev,
    -		    "couldn't allocate register window 0\n");
    +	rid = PCIR_BAR(0);
    +	if ((sc->aac_regs_res0 = bus_alloc_resource_any(dev,
    +	    SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) {
    +		device_printf(dev, "can't allocate register window 0\n");
     		goto out;
     	}
     	sc->aac_btag0 = rman_get_bustag(sc->aac_regs_res0);
     	sc->aac_bhandle0 = rman_get_bushandle(sc->aac_regs_res0);
     
     	if (sc->aac_hwif == AAC_HWIF_NARK) {
    -		sc->aac_regs_rid1 = PCIR_BAR(1);
    -		if ((sc->aac_regs_res1 = bus_alloc_resource_any(sc->aac_dev,
    -		    SYS_RES_MEMORY, &sc->aac_regs_rid1, RF_ACTIVE)) == NULL) {
    -			device_printf(sc->aac_dev,
    -			    "couldn't allocate register window 1\n");
    +		rid = PCIR_BAR(1);
    +		if ((sc->aac_regs_res1 = bus_alloc_resource_any(dev,
    +		    SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) {
    +			device_printf(dev,
    +			    "can't allocate register window 1\n");
     			goto out;
     		}
     		sc->aac_btag1 = rman_get_bustag(sc->aac_regs_res1);
     		sc->aac_bhandle1 = rman_get_bushandle(sc->aac_regs_res1);
     	} else {
     		sc->aac_regs_res1 = sc->aac_regs_res0;
    -		sc->aac_regs_rid1 = sc->aac_regs_rid0;
     		sc->aac_btag1 = sc->aac_btag0;
     		sc->aac_bhandle1 = sc->aac_bhandle0;
     	}
     
     	/*
    +	 * Allocate the interrupt.
    +	 */
    +	rid = 0;
    +	if (aac_enable_msi != 0 && pci_find_cap(dev, PCIY_MSI, ®) == 0) {
    +		count = pci_msi_count(dev);
    +		if (count > 1)
    +			count = 1;
    +		else
    +			count = 0;
    +		if (count == 1 && pci_alloc_msi(dev, &count) == 0)
    +			rid = 1;
    +	}
    +	if ((sc->aac_irq = bus_alloc_resource_any(sc->aac_dev, SYS_RES_IRQ,
    +	    &rid, RF_ACTIVE | (count != 0 ? 0 : RF_SHAREABLE))) == NULL) {
    +		device_printf(dev, "can't allocate interrupt\n");
    +		goto out;
    +	}
    +
    +	/*
     	 * Allocate the parent bus DMA tag appropriate for our PCI interface.
     	 *
     	 * Note that some of these controllers are 64-bit capable.
     	 */
    -	if (bus_dma_tag_create(bus_get_dma_tag(sc->aac_dev), /* parent */
    +	if (bus_dma_tag_create(bus_get_dma_tag(dev),	/* parent */
     			       PAGE_SIZE, 0,		/* algnmnt, boundary */
     			       BUS_SPACE_MAXADDR,	/* lowaddr */
     			       BUS_SPACE_MAXADDR, 	/* highaddr */
    @@ -413,7 +425,7 @@ aac_pci_attach(device_t dev)
     			       0,			/* flags */
     			       NULL, NULL,		/* No locking needed */
     			       &sc->aac_parent_dmat)) {
    -		device_printf(sc->aac_dev, "can't allocate parent DMA tag\n");
    +		device_printf(dev, "can't allocate parent DMA tag\n");
     		goto out;
     	}
     
    @@ -427,19 +439,19 @@ aac_pci_attach(device_t dev)
     	case AAC_HWIF_I960RX:
     	case AAC_HWIF_NARK:
     		fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for i960Rx/NARK");
    -		sc->aac_if = aac_rx_interface;
    +		sc->aac_if = &aac_rx_interface;
     		break;
     	case AAC_HWIF_STRONGARM:
     		fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for StrongARM");
    -		sc->aac_if = aac_sa_interface;
    +		sc->aac_if = &aac_sa_interface;
     		break;
     	case AAC_HWIF_RKT:
     		fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for Rocket/MIPS");
    -		sc->aac_if = aac_rkt_interface;
    +		sc->aac_if = &aac_rkt_interface;
     		break;
     	default:
     		sc->aac_hwif = AAC_HWIF_UNKNOWN;
    -		device_printf(sc->aac_dev, "unknown hardware type\n");
    +		device_printf(dev, "unknown hardware type\n");
     		error = ENXIO;
     		goto out;
     	}
    @@ -472,7 +484,7 @@ static device_method_t aacch_methods[] =
     	DEVMETHOD(device_probe,		aacch_probe),
     	DEVMETHOD(device_attach,	aacch_attach),
     	DEVMETHOD(device_detach,	aacch_detach),
    -	{ 0, 0 }
    +	DEVMETHOD_END
     };
     
     struct aacch_softc {
    @@ -486,7 +498,7 @@ static driver_t aacch_driver = {
     };
     
     static devclass_t	aacch_devclass;
    -DRIVER_MODULE(aacch, pci, aacch_driver, aacch_devclass, 0, 0);
    +DRIVER_MODULE(aacch, pci, aacch_driver, aacch_devclass, NULL, NULL);
     
     static int
     aacch_probe(device_t dev)
    
    Modified: head/sys/dev/aac/aac_tables.h
    ==============================================================================
    --- head/sys/dev/aac/aac_tables.h	Fri Mar  1 19:54:25 2013	(r247569)
    +++ head/sys/dev/aac/aac_tables.h	Fri Mar  1 19:55:10 2013	(r247570)
    @@ -27,13 +27,14 @@
      *	$FreeBSD$
      */
     
    +#if 0
     /*
      * Status codes for block read/write commands, etc.
      *
      * XXX many of these would not normally be returned, as they are
      * relevant only to FSA operations.
      */
    -static struct aac_code_lookup aac_command_status_table[] = {
    +static const struct aac_code_lookup aac_command_status_table[] = {
     	{"OK",					ST_OK},
     	{"operation not permitted",		ST_PERM},
     	{"not found",				ST_NOENT},
    @@ -75,8 +76,9 @@ static struct aac_code_lookup aac_comman
     };
     
     #define AAC_COMMAND_STATUS(x)	aac_describe_code(aac_command_status_table, x)
    +#endif
     
    -static struct aac_code_lookup aac_cpu_variant[] = {
    +static const struct aac_code_lookup aac_cpu_variant[] = {
     	{"i960JX",		CPUI960_JX},
     	{"i960CX",		CPUI960_CX},
     	{"i960HX",		CPUI960_HX},
    @@ -93,7 +95,7 @@ static struct aac_code_lookup aac_cpu_va
     	{"Unknown processor",	0}
     };
     
    -static struct aac_code_lookup aac_battery_platform[] = {
    +static const struct aac_code_lookup aac_battery_platform[] = {
     	{"required battery present",		PLATFORM_BAT_REQ_PRESENT},
     	{"REQUIRED BATTERY NOT PRESENT",	PLATFORM_BAT_REQ_NOTPRESENT},
     	{"optional battery present",		PLATFORM_BAT_OPT_PRESENT},
    @@ -103,7 +105,7 @@ static struct aac_code_lookup aac_batter
     	{"unknown battery platform",		0}
     };
     
    -static struct aac_code_lookup aac_container_types[] = {
    +static const struct aac_code_lookup aac_container_types[] = {
     	{"Volume",		CT_VOLUME},
     	{"RAID 1 (Mirror)",	CT_MIRROR},
     	{"RAID 0 (Stripe)",	CT_STRIPE},
    @@ -126,4 +128,3 @@ static struct aac_code_lookup aac_contai
     	{NULL, 0},
     	{"unknown",		0}
     };
    -
    
    Modified: head/sys/dev/aac/aacvar.h
    ==============================================================================
    --- head/sys/dev/aac/aacvar.h	Fri Mar  1 19:54:25 2013	(r247569)
    +++ head/sys/dev/aac/aacvar.h	Fri Mar  1 19:55:10 2013	(r247570)
    @@ -33,10 +33,13 @@
     #include 
     #include 
     #include 
    -#include 
     #include 
    +#include 
    +#include 
     #include 
     
    +SYSCTL_DECL(_hw_aac);
    +
     #define	AAC_TYPE_DEVO			1
     #define	AAC_TYPE_ALPHA			2
     #define	AAC_TYPE_BETA			3
    @@ -242,28 +245,28 @@ struct aac_interface
     	int (*aif_get_outb_queue)(struct aac_softc *sc);
     	void (*aif_set_outb_queue)(struct aac_softc *sc, int index);
     };
    -extern struct aac_interface	aac_rx_interface;
    -extern struct aac_interface	aac_sa_interface;
    -extern struct aac_interface	aac_fa_interface;
    -extern struct aac_interface	aac_rkt_interface;
    -
    -#define AAC_GET_FWSTATUS(sc)		((sc)->aac_if.aif_get_fwstatus((sc)))
    -#define AAC_QNOTIFY(sc, qbit)		((sc)->aac_if.aif_qnotify((sc), (qbit)))
    -#define AAC_GET_ISTATUS(sc)		((sc)->aac_if.aif_get_istatus((sc)))
    -#define AAC_CLEAR_ISTATUS(sc, mask)	((sc)->aac_if.aif_clr_istatus((sc), \
    +extern const struct aac_interface	aac_rx_interface;
    +extern const struct aac_interface	aac_sa_interface;
    +extern const struct aac_interface	aac_fa_interface;
    +extern const struct aac_interface	aac_rkt_interface;
    +
    +#define AAC_GET_FWSTATUS(sc)		((sc)->aac_if->aif_get_fwstatus((sc)))
    +#define AAC_QNOTIFY(sc, qbit)		((sc)->aac_if->aif_qnotify((sc), (qbit)))
    +#define AAC_GET_ISTATUS(sc)		((sc)->aac_if->aif_get_istatus((sc)))
    +#define AAC_CLEAR_ISTATUS(sc, mask)	((sc)->aac_if->aif_clr_istatus((sc), \
     					(mask)))
     #define AAC_SET_MAILBOX(sc, command, arg0, arg1, arg2, arg3) \
    -	((sc)->aac_if.aif_set_mailbox((sc), (command), (arg0), (arg1), (arg2), \
    +	((sc)->aac_if->aif_set_mailbox((sc), (command), (arg0), (arg1), (arg2), \
     	(arg3)))
    -#define AAC_GET_MAILBOX(sc, mb)		((sc)->aac_if.aif_get_mailbox((sc), \
    +#define AAC_GET_MAILBOX(sc, mb)		((sc)->aac_if->aif_get_mailbox((sc), \
     					(mb)))
    -#define	AAC_MASK_INTERRUPTS(sc)		((sc)->aac_if.aif_set_interrupts((sc), \
    +#define	AAC_MASK_INTERRUPTS(sc)		((sc)->aac_if->aif_set_interrupts((sc), \
     					0))
    -#define AAC_UNMASK_INTERRUPTS(sc)	((sc)->aac_if.aif_set_interrupts((sc), \
    +#define AAC_UNMASK_INTERRUPTS(sc)	((sc)->aac_if->aif_set_interrupts((sc), \
     					1))
    -#define AAC_SEND_COMMAND(sc, cm)	((sc)->aac_if.aif_send_command((sc), (cm)))
    -#define AAC_GET_OUTB_QUEUE(sc)		((sc)->aac_if.aif_get_outb_queue((sc)))
    -#define AAC_SET_OUTB_QUEUE(sc, idx)	((sc)->aac_if.aif_set_outb_queue((sc), (idx)))
    +#define AAC_SEND_COMMAND(sc, cm)	((sc)->aac_if->aif_send_command((sc), (cm)))
    +#define AAC_GET_OUTB_QUEUE(sc)		((sc)->aac_if->aif_get_outb_queue((sc)))
    +#define AAC_SET_OUTB_QUEUE(sc, idx)	((sc)->aac_if->aif_set_outb_queue((sc), (idx)))
     
     #define AAC_MEM0_SETREG4(sc, reg, val)	bus_space_write_4(sc->aac_btag0, \
     					sc->aac_bhandle0, reg, val)
    @@ -307,14 +310,12 @@ struct aac_softc
     	/* bus connections */
     	device_t		aac_dev;
     	struct resource		*aac_regs_res0, *aac_regs_res1; /* reg. if. window */
    -	int			aac_regs_rid0, aac_regs_rid1;		/* resource ID */
     	bus_space_handle_t	aac_bhandle0, aac_bhandle1;		/* bus space handle */
     	bus_space_tag_t		aac_btag0, aac_btag1;		/* bus space tag */
     	bus_dma_tag_t		aac_parent_dmat;	/* parent DMA tag */
     	bus_dma_tag_t		aac_buffer_dmat;	/* data buffer/command
     							 * DMA tag */
     	struct resource		*aac_irq;		/* interrupt */
    -	int			aac_irq_rid;
     	void			*aac_intr;		/* interrupt handle */
     	eventhandler_tag	eh;
     
    @@ -339,7 +340,7 @@ struct aac_softc
     							 * DMA map */
     	struct aac_common	*aac_common;
     	u_int32_t		aac_common_busaddr;
    -	struct aac_interface	aac_if;
    +	const struct aac_interface	*aac_if;
     
     	/* command/fib resources */
     	bus_dma_tag_t		aac_fib_dmat;	/* DMA tag for allocing FIBs */
    @@ -499,7 +500,7 @@ extern void	aac_print_aif(struct aac_sof
     #endif
     
     struct aac_code_lookup {
    -	char	*string;
    +	const char	*string;
     	u_int32_t	code;
     };
     
    @@ -581,7 +582,6 @@ aac_remove_ ## name (struct aac_command 
     	cm->cm_flags &= ~AAC_ON_ ## index;				\
     	AACQ_REMOVE(cm->cm_sc, index);					\
     }									\
    -struct hack
     
     AACQ_COMMAND_QUEUE(free, AACQ_FREE);
     AACQ_COMMAND_QUEUE(ready, AACQ_READY);
    @@ -644,4 +644,3 @@ aac_release_sync_fib(struct aac_softc *s
     
     	mtx_assert(&sc->aac_io_lock, MA_OWNED);
     }
    -
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 20:16:07 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 84537C41;
     Fri,  1 Mar 2013 20:16: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 67C76158A;
     Fri,  1 Mar 2013 20:16:07 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21KG7Jx076008;
     Fri, 1 Mar 2013 20:16:07 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21KG7ne076007;
     Fri, 1 Mar 2013 20:16:07 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303012016.r21KG7ne076007@svn.freebsd.org>
    From: Marius Strobl 
    Date: Fri, 1 Mar 2013 20:16:07 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247571 - head/sys/dev/puc
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 20:16:07 -0000
    
    Author: marius
    Date: Fri Mar  1 20:16:06 2013
    New Revision: 247571
    URL: http://svnweb.freebsd.org/changeset/base/247571
    
    Log:
      - Apparently, r186520 was just wrong and the clock of Oxford OX16PCI958 is
        neither DEFAULT_RCLK * 2 nor DEFAULT_RCLK * 10 but plain DEFAULT_RCLK
        and there's no (open) source indicating otherwise. This was tested with
        an EXSYS EX-41098-2, whose clock is not configurable and identifies as:
        puc0@pci0:5:1:0:        class=0x070200 card=0x06711415 chip=0x95381415 rev=0x01 hdr=0x00
            vendor     = 'Oxford Semiconductor Ltd'
            class      = simple comms
            subclass   = multiport serial
      
        Note that this exactly matches the card mentioned in PR 129665 so no
        sub-device/sub-vendor based quirking of the latter is possible. So maybe
        we should grow some sort of tunable, in case non-default cards such as
        the latter aren't configurable either (this also wouldn't be the first
        time an allegedly tested commit turns out to be wrong though).
      - Make the TiMedia tables const.
      
      MFC after:	1 week
    
    Modified:
      head/sys/dev/puc/pucdata.c
    
    Modified: head/sys/dev/puc/pucdata.c
    ==============================================================================
    --- head/sys/dev/puc/pucdata.c	Fri Mar  1 19:55:10 2013	(r247570)
    +++ head/sys/dev/puc/pucdata.c	Fri Mar  1 20:16:06 2013	(r247571)
    @@ -769,7 +769,7 @@ const struct puc_cfg puc_pci_devices[] =
     
     	{   0x1415, 0x9538, 0xffff, 0,
     	    "Oxford Semiconductor OX16PCI958 UARTs",
    -	    DEFAULT_RCLK * 10,
    +	    DEFAULT_RCLK,
     	    PUC_PORT_8S, 0x18, 0, 8,
     	},
     
    @@ -918,6 +918,7 @@ const struct puc_cfg puc_pci_devices[] =
     	    DEFAULT_RCLK * 8,
     	    PUC_PORT_4S, 0x10, 0, 8,
     	},
    +
     	{   0x14d2, 0xa004, 0xffff, 0,
     	    "Titan PCI-800H",
     	    DEFAULT_RCLK * 8,
    @@ -1060,7 +1061,7 @@ const struct puc_cfg puc_pci_devices[] =
     	{   0x9710, 0x9865, 0xa000, 0x3004,
     	    "NetMos NM9865 Quad UART",
     	    DEFAULT_RCLK,
    -	    PUC_PORT_4S, 0x10, 4, 0,0
    +	    PUC_PORT_4S, 0x10, 4, 0,
     	},
     
     	{   0x9710, 0x9865, 0xa000, 0x3011,
    @@ -1420,26 +1421,26 @@ static int
     puc_config_timedia(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
         intptr_t *res)
     {
    -	static uint16_t dual[] = {
    +	static const uint16_t dual[] = {
     	    0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
     	    0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079, 
     	    0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079, 
     	    0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079,
     	    0xD079, 0
     	};
    -	static uint16_t quad[] = {
    +	static const uint16_t quad[] = {
     	    0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157, 
     	    0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159, 
     	    0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056,
     	    0xB157, 0
     	};
    -	static uint16_t octa[] = {
    +	static const uint16_t octa[] = {
     	    0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166, 
     	    0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
     	};
    -	static struct {
    +	static const struct {
     		int ports;
    -		uint16_t *ids;
    +		const uint16_t *ids;
     	} subdevs[] = {
     	    { 2, dual },
     	    { 4, quad },
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 20:33:36 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 7BE8F1AE;
     Fri,  1 Mar 2013 20:33:36 +0000 (UTC)
     (envelope-from jpaetzel@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 3D5301666;
     Fri,  1 Mar 2013 20:33:36 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21KXa6J081620;
     Fri, 1 Mar 2013 20:33:36 GMT (envelope-from jpaetzel@svn.freebsd.org)
    Received: (from jpaetzel@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21KXZqc081618;
     Fri, 1 Mar 2013 20:33:35 GMT (envelope-from jpaetzel@svn.freebsd.org)
    Message-Id: <201303012033.r21KXZqc081618@svn.freebsd.org>
    From: Josh Paetzel 
    Date: Fri, 1 Mar 2013 20:33: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: r247572 - stable/9/sys/dev/oce
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 20:33:36 -0000
    
    Author: jpaetzel
    Date: Fri Mar  1 20:33:35 2013
    New Revision: 247572
    URL: http://svnweb.freebsd.org/changeset/base/247572
    
    Log:
      MFC 246799:
      
      Resolve issue that caused WITNESS to report LORs.
    
    Modified:
      stable/9/sys/dev/oce/oce_if.c
      stable/9/sys/dev/oce/oce_if.h
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
    
    Modified: stable/9/sys/dev/oce/oce_if.c
    ==============================================================================
    --- stable/9/sys/dev/oce/oce_if.c	Fri Mar  1 20:16:06 2013	(r247571)
    +++ stable/9/sys/dev/oce/oce_if.c	Fri Mar  1 20:33:35 2013	(r247572)
    @@ -1856,6 +1856,9 @@ oce_local_timer(void *arg)
     }
     
     
    +/* NOTE : This should only be called holding
    + *        DEVICE_LOCK.
    +*/
     static void
     oce_if_deactivate(POCE_SOFTC sc)
     {
    @@ -1885,11 +1888,17 @@ oce_if_deactivate(POCE_SOFTC sc)
     	/* Stop intrs and finish any bottom halves pending */
     	oce_hw_intr_disable(sc);
     
    +    /* Since taskqueue_drain takes a Giant Lock, We should not acquire
    +       any other lock. So unlock device lock and require after
    +       completing taskqueue_drain.
    +    */
    +    UNLOCK(&sc->dev_lock);
     	for (i = 0; i < sc->intr_count; i++) {
     		if (sc->intrs[i].tq != NULL) {
     			taskqueue_drain(sc->intrs[i].tq, &sc->intrs[i].task);
     		}
     	}
    +    LOCK(&sc->dev_lock);
     
     	/* Delete RX queue in card with flush param */
     	oce_stop_rx(sc);
    
    Modified: stable/9/sys/dev/oce/oce_if.h
    ==============================================================================
    --- stable/9/sys/dev/oce/oce_if.h	Fri Mar  1 20:16:06 2013	(r247571)
    +++ stable/9/sys/dev/oce/oce_if.h	Fri Mar  1 20:33:35 2013	(r247572)
    @@ -491,7 +491,7 @@ struct oce_lock {
     #define LOCK_CREATE(lock, desc) 		{ \
     	strncpy((lock)->name, (desc), MAX_LOCK_DESC_LEN); \
     	(lock)->name[MAX_LOCK_DESC_LEN] = '\0'; \
    -	mtx_init(&(lock)->mutex, (lock)->name, MTX_NETWORK_LOCK, MTX_DEF); \
    +	mtx_init(&(lock)->mutex, (lock)->name, NULL, MTX_DEF); \
     }
     #define LOCK_DESTROY(lock) 			\
     		if (mtx_initialized(&(lock)->mutex))\
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 20:34:02 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id A8328318;
     Fri,  1 Mar 2013 20:34:02 +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 9AEE4166B;
     Fri,  1 Mar 2013 20:34:02 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21KY2KL081718;
     Fri, 1 Mar 2013 20:34:02 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21KY2jv081717;
     Fri, 1 Mar 2013 20:34:02 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303012034.r21KY2jv081717@svn.freebsd.org>
    From: Marius Strobl 
    Date: Fri, 1 Mar 2013 20:34:02 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247573 - head/sys/sparc64/pci
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 20:34:02 -0000
    
    Author: marius
    Date: Fri Mar  1 20:34:02 2013
    New Revision: 247573
    URL: http://svnweb.freebsd.org/changeset/base/247573
    
    Log:
      - Remove an unused header.
      - Use NULL instead of 0 for pointers.
      - Let ofw_pcib_probe() return BUS_PROBE_DEFAULT instead of 0 so specialized
        PCI-PCI-bridge drivers may attach instead.
      - Add WARs for PLX Technology PEX 8114 bridges and PEX 8532 switches.
        Ideally, these should live in MI code but at least for the latter we're
        missing the necessary infrastructure there.
      
      MFC after:	1 week
    
    Modified:
      head/sys/sparc64/pci/ofw_pcib.c
    
    Modified: head/sys/sparc64/pci/ofw_pcib.c
    ==============================================================================
    --- head/sys/sparc64/pci/ofw_pcib.c	Fri Mar  1 20:33:35 2013	(r247572)
    +++ head/sys/sparc64/pci/ofw_pcib.c	Fri Mar  1 20:34:02 2013	(r247573)
    @@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     
    -#include 
    -
     #include 
     #include 
     #include 
    @@ -58,8 +56,12 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     
    +#define	PCI_DEVID_ALI_M5249	0x524910b9
    +#define	PCI_VENDOR_PLX		0x10b5
    +
     static device_probe_t ofw_pcib_probe;
     static device_attach_t ofw_pcib_attach;
    +static ofw_pci_setup_device_t ofw_pcib_setup_device;
     
     static device_method_t ofw_pcib_methods[] = {
     	/* Device interface */
    @@ -73,6 +75,7 @@ static device_method_t ofw_pcib_methods[
     
     	/* ofw_bus interface */
     	DEVMETHOD(ofw_bus_get_node,	ofw_pcib_gen_get_node),
    +	DEVMETHOD(ofw_pci_setup_device, ofw_pcib_setup_device),
     
     	DEVMETHOD_END
     };
    @@ -81,7 +84,7 @@ static devclass_t pcib_devclass;
     
     DEFINE_CLASS_1(pcib, ofw_pcib_driver, ofw_pcib_methods,
         sizeof(struct ofw_pcib_gen_softc), pcib_driver);
    -EARLY_DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0,
    +EARLY_DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, NULL, NULL,
         BUS_PASS_BUS);
     MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1);
     
    @@ -104,7 +107,7 @@ ofw_pcib_probe(device_t dev)
     		    ISDTYPE(pbdtype, OFW_TYPE_PCIE) ? "e" : "",
     		    ISDTYPE(dtype, OFW_TYPE_PCIE) ? "e" : "");
     		device_set_desc_copy(dev, desc);
    -		return (0);
    +		return (BUS_PROBE_DEFAULT);
     	}
     
     #undef ISDTYPE
    @@ -119,7 +122,6 @@ ofw_pcib_attach(device_t dev)
     
     	sc = device_get_softc(dev);
     
    -	/* Quirk handling */
     	switch (pci_get_devid(dev)) {
     	/*
     	 * The ALi M5249 found in Fire-based machines by definition must me
    @@ -127,13 +129,46 @@ ofw_pcib_attach(device_t dev)
     	 * don't indicate this in the class code although the ISA I/O range
     	 * isn't included in their bridge decode.
     	 */
    -	case 0x524910b9:
    +	case PCI_DEVID_ALI_M5249:
     		sc->ops_pcib_sc.flags |= PCIB_SUBTRACTIVE;
     		break;
     	}
     
    +	switch (pci_get_vendor(dev)) {
    +	/*
    +	 * Concurrently write the primary and secondary bus numbers in order
    +	 * to work around a bug in PLX PEX 8114 causing the internal shadow
    +	 * copies of these not to be updated when setting them bytewise.
    +	 */
    +	case PCI_VENDOR_PLX:
    +		pci_write_config(dev, PCIR_PRIBUS_1,
    +		    pci_read_config(dev, PCIR_SECBUS_1, 1) << 8 |
    +		    pci_read_config(dev, PCIR_PRIBUS_1, 1), 2);
    +		break;
    +	}
    +
     	ofw_pcib_gen_setup(dev);
     	pcib_attach_common(dev);
     	device_add_child(dev, "pci", -1);
     	return (bus_generic_attach(dev));
     }
    +
    +static void
    +ofw_pcib_setup_device(device_t bus, device_t child)
    +{
    +	int i;
    +	uint16_t reg;
    +
    +	switch (pci_get_vendor(bus)) {
    +	/*
    +	 * For PLX PEX 8532 issue 64 TLPs to the child from the downstream
    +	 * port to the child device in order to work around a hardware bug.
    +	 */
    +	case PCI_VENDOR_PLX:
    +		for (i = 0, reg = 0; i < 64; i++)
    +			reg |= pci_get_devid(child);
    +		break;
    +	}
    +
    +	OFW_PCI_SETUP_DEVICE(device_get_parent(bus), child);
    +}
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 20:37:00 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 4C21A76B;
     Fri,  1 Mar 2013 20:37: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 3EF3316B1;
     Fri,  1 Mar 2013 20:37:00 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21Kb0cT082138;
     Fri, 1 Mar 2013 20:37:00 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21Kb0Zg082137;
     Fri, 1 Mar 2013 20:37:00 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303012037.r21Kb0Zg082137@svn.freebsd.org>
    From: Marius Strobl 
    Date: Fri, 1 Mar 2013 20:37:00 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247574 - head/sys/sparc64/pci
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 20:37:00 -0000
    
    Author: marius
    Date: Fri Mar  1 20:36:59 2013
    New Revision: 247574
    URL: http://svnweb.freebsd.org/changeset/base/247574
    
    Log:
      - In sbbc_pci_attach() just pass the already obtained bus tag and handle
        instead of acquiring these anew.
      - Use NULL instead of 0 for pointers.
      
      MFC after:	1 week
    
    Modified:
      head/sys/sparc64/pci/sbbc.c
    
    Modified: head/sys/sparc64/pci/sbbc.c
    ==============================================================================
    --- head/sys/sparc64/pci/sbbc.c	Fri Mar  1 20:34:02 2013	(r247573)
    +++ head/sys/sparc64/pci/sbbc.c	Fri Mar  1 20:36:59 2013	(r247574)
    @@ -299,7 +299,7 @@ static device_method_t sbbc_pci_methods[
     static devclass_t sbbc_devclass;
     
     DEFINE_CLASS_0(sbbc, sbbc_driver, sbbc_pci_methods, sizeof(struct sbbc_softc));
    -DRIVER_MODULE(sbbc, pci, sbbc_driver, sbbc_devclass, 0, 0);
    +DRIVER_MODULE(sbbc, pci, sbbc_driver, sbbc_devclass, NULL, NULL);
     
     static int
     sbbc_pci_probe(device_t dev)
    @@ -358,8 +358,7 @@ sbbc_pci_attach(device_t dev)
     		if (error != 0)
     			device_printf(dev, "failed to attach UART device\n");
     	} else {
    -		error = sbbc_parse_toc(rman_get_bustag(sc->sc_res),
    -		    rman_get_bushandle(sc->sc_res));
    +		error = sbbc_parse_toc(bst, bsh);
     		if (error != 0) {
     			device_printf(dev, "failed to parse TOC\n");
     			if (sbbc_console != 0) {
    @@ -609,7 +608,7 @@ static device_method_t sbbc_uart_sbbc_me
     
     DEFINE_CLASS_0(uart, sbbc_uart_driver, sbbc_uart_sbbc_methods,
         sizeof(struct uart_softc));
    -DRIVER_MODULE(uart, sbbc, sbbc_uart_driver, uart_devclass, 0, 0);
    +DRIVER_MODULE(uart, sbbc, sbbc_uart_driver, uart_devclass, NULL, NULL);
     
     static int
     sbbc_uart_sbbc_probe(device_t dev)
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 20:48:08 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 47C0DD7D;
     Fri,  1 Mar 2013 20:48:08 +0000 (UTC) (envelope-from mm@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 2F768174D;
     Fri,  1 Mar 2013 20:48:08 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21Km8EL085262;
     Fri, 1 Mar 2013 20:48:08 GMT (envelope-from mm@svn.freebsd.org)
    Received: (from mm@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21Km7IK085259;
     Fri, 1 Mar 2013 20:48:07 GMT (envelope-from mm@svn.freebsd.org)
    Message-Id: <201303012048.r21Km7IK085259@svn.freebsd.org>
    From: Martin Matuska 
    Date: Fri, 1 Mar 2013 20:48:07 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-vendor@freebsd.org
    Subject: svn commit: r247575 - vendor-sys/illumos/dist/uts/common/fs/zfs
    X-SVN-Group: vendor-sys
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 20:48:08 -0000
    
    Author: mm
    Date: Fri Mar  1 20:48:07 2013
    New Revision: 247575
    URL: http://svnweb.freebsd.org/changeset/base/247575
    
    Log:
      Update vendor-sys/illumos/dist to illumos-gate 13970:c9a5683da38e
      
      Illumos ZFS issues:
        3543 Feature flags causes assertion in spa.c to miss certain cases
    
    Modified:
      vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c	Fri Mar  1 20:36:59 2013	(r247574)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c	Fri Mar  1 20:48:07 2013	(r247575)
    @@ -5747,7 +5747,7 @@ spa_sync_version(void *arg1, void *arg2,
     	 */
     	ASSERT(tx->tx_txg != TXG_INITIAL);
     
    -	ASSERT(version <= SPA_VERSION);
    +	ASSERT(SPA_VERSION_IS_SUPPORTED(version));
     	ASSERT(version >= spa_version(spa));
     
     	spa->spa_uberblock.ub_version = version;
    @@ -6276,7 +6276,7 @@ spa_upgrade(spa_t *spa, uint64_t version
     	 * future version would result in an unopenable pool, this shouldn't be
     	 * possible.
     	 */
    -	ASSERT(spa->spa_uberblock.ub_version <= SPA_VERSION);
    +	ASSERT(SPA_VERSION_IS_SUPPORTED(spa->spa_uberblock.ub_version));
     	ASSERT(version >= spa->spa_uberblock.ub_version);
     
     	spa->spa_uberblock.ub_version = version;
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 20:48:54 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 02B26EE1;
     Fri,  1 Mar 2013 20:48:54 +0000 (UTC) (envelope-from ian@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 DC11F1754;
     Fri,  1 Mar 2013 20:48:53 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21KmroR085425;
     Fri, 1 Mar 2013 20:48:53 GMT (envelope-from ian@svn.freebsd.org)
    Received: (from ian@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21KmrUw085421;
     Fri, 1 Mar 2013 20:48:53 GMT (envelope-from ian@svn.freebsd.org)
    Message-Id: <201303012048.r21KmrUw085421@svn.freebsd.org>
    From: Ian Lepore 
    Date: Fri, 1 Mar 2013 20:48: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: r247576 - stable/9/sbin/devd
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 20:48:54 -0000
    
    Author: ian
    Date: Fri Mar  1 20:48:53 2013
    New Revision: 247576
    URL: http://svnweb.freebsd.org/changeset/base/247576
    
    Log:
      MFC r246121 ...
      
      Fix a descriptor leak in devd.  Clients reading /var/run/devd.pipe can close
      their socket connection any time, and devd only notices that when it gets an
      error trying to write an event to the client.  On a system with no device
      change activity, clients could connect and disappear repeatedly without devd
      noticing, leading to an ever-growing list of open socket descriptors in devd.
      
      Now devd uses poll(2) looking for POLLHUP on all existing clients every time
      a new client connection is established, and also periodically (once a minute)
      to proactively find zombie clients and reap the socket descriptors.  It also
      now has a connection limit, configurable with a new -l  command line arg.
      When the maximum number of connections is reached it stops accepting new
      connections until some current clients drop off.
    
    Modified:
      stable/9/sbin/devd/devd.8
      stable/9/sbin/devd/devd.cc
    Directory Properties:
      stable/9/sbin/devd/   (props changed)
    
    Modified: stable/9/sbin/devd/devd.8
    ==============================================================================
    --- stable/9/sbin/devd/devd.8	Fri Mar  1 20:48:07 2013	(r247575)
    +++ stable/9/sbin/devd/devd.8	Fri Mar  1 20:48:53 2013	(r247576)
    @@ -35,6 +35,7 @@
     .Nm
     .Op Fl Ddn
     .Op Fl f Ar file
    +.Op Fl l Ar num
     .Sh DESCRIPTION
     The
     .Nm
    @@ -55,6 +56,12 @@ instead of the default
     If option
     .Fl f
     is specified more than once, the last file specified is used.
    +.It Fl l Ar num
    +Limit concurrent
    +.Pa /var/run/devd.pipe
    +connections to
    +.Ar num .
    +The default connection limit is 10.
     .It Fl n
     Do not process all pending events before becoming a daemon.
     Instead, call daemon right away.
    
    Modified: stable/9/sbin/devd/devd.cc
    ==============================================================================
    --- stable/9/sbin/devd/devd.cc	Fri Mar  1 20:48:07 2013	(r247575)
    +++ stable/9/sbin/devd/devd.cc	Fri Mar  1 20:48:53 2013	(r247576)
    @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    +#include 
     #include 
     #include 
     #include 
    @@ -805,23 +806,58 @@ create_socket(const char *name)
     	return (fd);
     }
     
    +unsigned int max_clients = 10;	/* Default, can be overriden on cmdline. */
    +unsigned int num_clients;
     list clients;
     
     void
     notify_clients(const char *data, int len)
     {
    -	list bad;
    -	list::const_iterator i;
    +	list::iterator i;
     
    -	for (i = clients.begin(); i != clients.end(); ++i) {
    -		if (write(*i, data, len) <= 0) {
    -			bad.push_back(*i);
    +	/*
    +	 * Deliver the data to all clients.  Throw clients overboard at the
    +	 * first sign of trouble.  This reaps clients who've died or closed
    +	 * their sockets, and also clients who are alive but failing to keep up
    +	 * (or who are maliciously not reading, to consume buffer space in
    +	 * kernel memory or tie up the limited number of available connections).
    +	 */
    +	for (i = clients.begin(); i != clients.end(); ) {
    +		if (write(*i, data, len) != len) {
    +			--num_clients;
     			close(*i);
    -		}
    +			i = clients.erase(i);
    +		} else
    +			++i;
     	}
    +}
    +
    +void
    +check_clients(void)
    +{
    +	int s;
    +	struct pollfd pfd;
    +	list::iterator i;
     
    -	for (i = bad.begin(); i != bad.end(); ++i)
    -		clients.erase(find(clients.begin(), clients.end(), *i));
    +	/*
    +	 * Check all existing clients to see if any of them have disappeared.
    +	 * Normally we reap clients when we get an error trying to send them an
    +	 * event.  This check eliminates the problem of an ever-growing list of
    +	 * zombie clients because we're never writing to them on a system
    +	 * without frequent device-change activity.
    +	 */
    +	pfd.events = 0;
    +	for (i = clients.begin(); i != clients.end(); ) {
    +		pfd.fd = *i;
    +		s = poll(&pfd, 1, 0);
    +		if ((s < 0 && s != EINTR ) ||
    +		    (s > 0 && (pfd.revents & POLLHUP))) {
    +			--num_clients;
    +			close(*i);
    +			i = clients.erase(i);
    +		} else
    +			++i;
    +	}
     }
     
     void
    @@ -829,9 +865,18 @@ new_client(int fd)
     {
     	int s;
     
    +	/*
    +	 * First go reap any zombie clients, then accept the connection, and
    +	 * shut down the read side to stop clients from consuming kernel memory
    +	 * by sending large buffers full of data we'll never read.
    +	 */
    +	check_clients();
     	s = accept(fd, NULL, NULL);
    -	if (s != -1)
    +	if (s != -1) {
    +		shutdown(s, SHUT_RD);
     		clients.push_back(s);
    +		++num_clients;
    +	}
     }
     
     static void
    @@ -842,6 +887,7 @@ event_loop(void)
     	char buffer[DEVCTL_MAXBUF];
     	int once = 0;
     	int server_fd, max_fd;
    +	int accepting;
     	timeval tv;
     	fd_set fds;
     
    @@ -851,6 +897,7 @@ event_loop(void)
     	if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0)
     		err(1, "Can't set close-on-exec flag on devctl");
     	server_fd = create_socket(PIPE);
    +	accepting = 1;
     	max_fd = max(fd, server_fd) + 1;
     	while (1) {
     		if (romeo_must_die)
    @@ -873,15 +920,38 @@ event_loop(void)
     				once++;
     			}
     		}
    +		/*
    +		 * When we've already got the max number of clients, stop
    +		 * accepting new connections (don't put server_fd in the set),
    +		 * shrink the accept() queue to reject connections quickly, and
    +		 * poll the existing clients more often, so that we notice more
    +		 * quickly when any of them disappear to free up client slots.
    +		 */
     		FD_ZERO(&fds);
     		FD_SET(fd, &fds);
    -		FD_SET(server_fd, &fds);
    -		rv = select(max_fd, &fds, NULL, NULL, NULL);
    +		if (num_clients < max_clients) {
    +			if (!accepting) {
    +				listen(server_fd, max_clients);
    +				accepting = 1;
    +			}
    +			FD_SET(server_fd, &fds);
    +			tv.tv_sec = 60;
    +			tv.tv_usec = 0;
    +		} else {
    +			if (accepting) {
    +				listen(server_fd, 0);
    +				accepting = 0;
    +			}
    +			tv.tv_sec = 2;
    +			tv.tv_usec = 0;
    +		}
    +		rv = select(max_fd, &fds, NULL, NULL, &tv);
     		if (rv == -1) {
     			if (errno == EINTR)
     				continue;
     			err(1, "select");
    -		}
    +		} else if (rv == 0)
    +			check_clients();
     		if (FD_ISSET(fd, &fds)) {
     			rv = read(fd, buffer, sizeof(buffer) - 1);
     			if (rv > 0) {
    @@ -1000,7 +1070,8 @@ gensighand(int)
     static void
     usage()
     {
    -	fprintf(stderr, "usage: %s [-Ddn] [-f file]\n", getprogname());
    +	fprintf(stderr, "usage: %s [-Ddn] [-l connlimit] [-f file]\n",
    +	    getprogname());
     	exit(1);
     }
     
    @@ -1029,7 +1100,7 @@ main(int argc, char **argv)
     	int ch;
     
     	check_devd_enabled();
    -	while ((ch = getopt(argc, argv, "Ddf:n")) != -1) {
    +	while ((ch = getopt(argc, argv, "Ddf:l:n")) != -1) {
     		switch (ch) {
     		case 'D':
     			Dflag++;
    @@ -1040,6 +1111,9 @@ main(int argc, char **argv)
     		case 'f':
     			configfile = optarg;
     			break;
    +		case 'l':
    +			max_clients = MAX(1, strtoul(optarg, NULL, 0));
    +			break;
     		case 'n':
     			nflag++;
     			break;
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 20:49:57 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 7A206202;
     Fri,  1 Mar 2013 20:49:57 +0000 (UTC) (envelope-from mm@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 57CF91762;
     Fri,  1 Mar 2013 20:49:57 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21KnvWQ085608;
     Fri, 1 Mar 2013 20:49:57 GMT (envelope-from mm@svn.freebsd.org)
    Received: (from mm@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21Knu1t085604;
     Fri, 1 Mar 2013 20:49:56 GMT (envelope-from mm@svn.freebsd.org)
    Message-Id: <201303012049.r21Knu1t085604@svn.freebsd.org>
    From: Martin Matuska 
    Date: Fri, 1 Mar 2013 20:49:56 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-vendor@freebsd.org
    Subject: svn commit: r247578 - in vendor-sys/illumos/dist/uts/common/fs/zfs: .
     sys
    X-SVN-Group: vendor-sys
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 20:49:57 -0000
    
    Author: mm
    Date: Fri Mar  1 20:49:56 2013
    New Revision: 247578
    URL: http://svnweb.freebsd.org/changeset/base/247578
    
    Log:
      Update vendor-sys/illumos/dist to illumos-gate 13971:d1648d817bd6
      
      Illumos ZFS issues:
        3581 spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE]->tq_lock is piping hot
    
    Modified:
      vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c	Fri Mar  1 20:48:53 2013	(r247577)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c	Fri Mar  1 20:49:56 2013	(r247578)
    @@ -77,23 +77,25 @@
     #include "zfs_comutil.h"
     
     typedef enum zti_modes {
    -	zti_mode_fixed,			/* value is # of threads (min 1) */
    -	zti_mode_online_percent,	/* value is % of online CPUs */
    -	zti_mode_batch,			/* cpu-intensive; value is ignored */
    -	zti_mode_null,			/* don't create a taskq */
    -	zti_nmodes
    +	ZTI_MODE_FIXED,			/* value is # of threads (min 1) */
    +	ZTI_MODE_ONLINE_PERCENT,	/* value is % of online CPUs */
    +	ZTI_MODE_BATCH,			/* cpu-intensive; value is ignored */
    +	ZTI_MODE_NULL,			/* don't create a taskq */
    +	ZTI_NMODES
     } zti_modes_t;
     
    -#define	ZTI_FIX(n)	{ zti_mode_fixed, (n) }
    -#define	ZTI_PCT(n)	{ zti_mode_online_percent, (n) }
    -#define	ZTI_BATCH	{ zti_mode_batch, 0 }
    -#define	ZTI_NULL	{ zti_mode_null, 0 }
    +#define	ZTI_P(n, q)	{ ZTI_MODE_FIXED, (n), (q) }
    +#define	ZTI_PCT(n)	{ ZTI_MODE_ONLINE_PERCENT, (n), 1 }
    +#define	ZTI_BATCH	{ ZTI_MODE_BATCH, 0, 1 }
    +#define	ZTI_NULL	{ ZTI_MODE_NULL, 0, 0 }
     
    -#define	ZTI_ONE		ZTI_FIX(1)
    +#define	ZTI_N(n)	ZTI_P(n, 1)
    +#define	ZTI_ONE		ZTI_N(1)
     
     typedef struct zio_taskq_info {
    -	enum zti_modes zti_mode;
    +	zti_modes_t zti_mode;
     	uint_t zti_value;
    +	uint_t zti_count;
     } zio_taskq_info_t;
     
     static const char *const zio_taskq_types[ZIO_TASKQ_TYPES] = {
    @@ -101,17 +103,30 @@ static const char *const zio_taskq_types
     };
     
     /*
    - * Define the taskq threads for the following I/O types:
    - * 	NULL, READ, WRITE, FREE, CLAIM, and IOCTL
    + * This table defines the taskq settings for each ZFS I/O type. When
    + * initializing a pool, we use this table to create an appropriately sized
    + * taskq. Some operations are low volume and therefore have a small, static
    + * number of threads assigned to their taskqs using the ZTI_N(#) or ZTI_ONE
    + * macros. Other operations process a large amount of data; the ZTI_BATCH
    + * macro causes us to create a taskq oriented for throughput. Some operations
    + * are so high frequency and short-lived that the taskq itself can become a a
    + * point of lock contention. The ZTI_P(#, #) macro indicates that we need an
    + * additional degree of parallelism specified by the number of threads per-
    + * taskq and the number of taskqs; when dispatching an event in this case, the
    + * particular taskq is chosen at random.
    + *
    + * The different taskq priorities are to handle the different contexts (issue
    + * and interrupt) and then to reserve threads for ZIO_PRIORITY_NOW I/Os that
    + * need to be handled with minimum delay.
      */
     const zio_taskq_info_t zio_taskqs[ZIO_TYPES][ZIO_TASKQ_TYPES] = {
     	/* ISSUE	ISSUE_HIGH	INTR		INTR_HIGH */
    -	{ ZTI_ONE,	ZTI_NULL,	ZTI_ONE,	ZTI_NULL },
    -	{ ZTI_FIX(8),	ZTI_NULL,	ZTI_BATCH,	ZTI_NULL },
    -	{ ZTI_BATCH,	ZTI_FIX(5),	ZTI_FIX(8),	ZTI_FIX(5) },
    -	{ ZTI_FIX(100),	ZTI_NULL,	ZTI_ONE,	ZTI_NULL },
    -	{ ZTI_ONE,	ZTI_NULL,	ZTI_ONE,	ZTI_NULL },
    -	{ ZTI_ONE,	ZTI_NULL,	ZTI_ONE,	ZTI_NULL },
    +	{ ZTI_ONE,	ZTI_NULL,	ZTI_ONE,	ZTI_NULL }, /* NULL */
    +	{ ZTI_N(8),	ZTI_NULL,	ZTI_BATCH,	ZTI_NULL }, /* READ */
    +	{ ZTI_BATCH,	ZTI_N(5),	ZTI_N(8),	ZTI_N(5) }, /* WRITE */
    +	{ ZTI_P(12, 8),	ZTI_NULL,	ZTI_ONE,	ZTI_NULL }, /* FREE */
    +	{ ZTI_ONE,	ZTI_NULL,	ZTI_ONE,	ZTI_NULL }, /* CLAIM */
    +	{ ZTI_ONE,	ZTI_NULL,	ZTI_ONE,	ZTI_NULL }, /* IOCTL */
     };
     
     static dsl_syncfunc_t spa_sync_version;
    @@ -794,48 +809,120 @@ spa_get_errlists(spa_t *spa, avl_tree_t 
     	    offsetof(spa_error_entry_t, se_avl));
     }
     
    -static taskq_t *
    -spa_taskq_create(spa_t *spa, const char *name, enum zti_modes mode,
    -    uint_t value)
    +static void
    +spa_taskqs_init(spa_t *spa, zio_type_t t, zio_taskq_type_t q)
     {
    +	const zio_taskq_info_t *ztip = &zio_taskqs[t][q];
    +	enum zti_modes mode = ztip->zti_mode;
    +	uint_t value = ztip->zti_value;
    +	uint_t count = ztip->zti_count;
    +	spa_taskqs_t *tqs = &spa->spa_zio_taskq[t][q];
    +	char name[32];
     	uint_t flags = 0;
     	boolean_t batch = B_FALSE;
     
    -	switch (mode) {
    -	case zti_mode_null:
    -		return (NULL);		/* no taskq needed */
    -
    -	case zti_mode_fixed:
    -		ASSERT3U(value, >=, 1);
    -		value = MAX(value, 1);
    -		break;
    +	if (mode == ZTI_MODE_NULL) {
    +		tqs->stqs_count = 0;
    +		tqs->stqs_taskq = NULL;
    +		return;
    +	}
     
    -	case zti_mode_batch:
    -		batch = B_TRUE;
    -		flags |= TASKQ_THREADS_CPU_PCT;
    -		value = zio_taskq_batch_pct;
    -		break;
    +	ASSERT3U(count, >, 0);
     
    -	case zti_mode_online_percent:
    -		flags |= TASKQ_THREADS_CPU_PCT;
    -		break;
    +	tqs->stqs_count = count;
    +	tqs->stqs_taskq = kmem_alloc(count * sizeof (taskq_t *), KM_SLEEP);
     
    -	default:
    -		panic("unrecognized mode for %s taskq (%u:%u) in "
    -		    "spa_activate()",
    -		    name, mode, value);
    -		break;
    +	for (uint_t i = 0; i < count; i++) {
    +		taskq_t *tq;
    +
    +		switch (mode) {
    +		case ZTI_MODE_FIXED:
    +			ASSERT3U(value, >=, 1);
    +			value = MAX(value, 1);
    +			break;
    +
    +		case ZTI_MODE_BATCH:
    +			batch = B_TRUE;
    +			flags |= TASKQ_THREADS_CPU_PCT;
    +			value = zio_taskq_batch_pct;
    +			break;
    +
    +		case ZTI_MODE_ONLINE_PERCENT:
    +			flags |= TASKQ_THREADS_CPU_PCT;
    +			break;
    +
    +		default:
    +			panic("unrecognized mode for %s_%s taskq (%u:%u) in "
    +			    "spa_activate()",
    +			    zio_type_name[t], zio_taskq_types[q], mode, value);
    +			break;
    +		}
    +
    +		if (count > 1) {
    +			(void) snprintf(name, sizeof (name), "%s_%s_%u",
    +			    zio_type_name[t], zio_taskq_types[q], i);
    +		} else {
    +			(void) snprintf(name, sizeof (name), "%s_%s",
    +			    zio_type_name[t], zio_taskq_types[q]);
    +		}
    +
    +		if (zio_taskq_sysdc && spa->spa_proc != &p0) {
    +			if (batch)
    +				flags |= TASKQ_DC_BATCH;
    +
    +			tq = taskq_create_sysdc(name, value, 50, INT_MAX,
    +			    spa->spa_proc, zio_taskq_basedc, flags);
    +		} else {
    +			tq = taskq_create_proc(name, value, maxclsyspri, 50,
    +			    INT_MAX, spa->spa_proc, flags);
    +		}
    +
    +		tqs->stqs_taskq[i] = tq;
     	}
    +}
    +
    +static void
    +spa_taskqs_fini(spa_t *spa, zio_type_t t, zio_taskq_type_t q)
    +{
    +	spa_taskqs_t *tqs = &spa->spa_zio_taskq[t][q];
     
    -	if (zio_taskq_sysdc && spa->spa_proc != &p0) {
    -		if (batch)
    -			flags |= TASKQ_DC_BATCH;
    +	if (tqs->stqs_taskq == NULL) {
    +		ASSERT0(tqs->stqs_count);
    +		return;
    +	}
     
    -		return (taskq_create_sysdc(name, value, 50, INT_MAX,
    -		    spa->spa_proc, zio_taskq_basedc, flags));
    +	for (uint_t i = 0; i < tqs->stqs_count; i++) {
    +		ASSERT3P(tqs->stqs_taskq[i], !=, NULL);
    +		taskq_destroy(tqs->stqs_taskq[i]);
     	}
    -	return (taskq_create_proc(name, value, maxclsyspri, 50, INT_MAX,
    -	    spa->spa_proc, flags));
    +
    +	kmem_free(tqs->stqs_taskq, tqs->stqs_count * sizeof (taskq_t *));
    +	tqs->stqs_taskq = NULL;
    +}
    +
    +/*
    + * Dispatch a task to the appropriate taskq for the ZFS I/O type and priority.
    + * Note that a type may have multiple discrete taskqs to avoid lock contention
    + * on the taskq itself. In that case we choose which taskq at random by using
    + * the low bits of gethrtime().
    + */
    +void
    +spa_taskq_dispatch_ent(spa_t *spa, zio_type_t t, zio_taskq_type_t q,
    +    task_func_t *func, void *arg, uint_t flags, taskq_ent_t *ent)
    +{
    +	spa_taskqs_t *tqs = &spa->spa_zio_taskq[t][q];
    +	taskq_t *tq;
    +
    +	ASSERT3P(tqs->stqs_taskq, !=, NULL);
    +	ASSERT3U(tqs->stqs_count, !=, 0);
    +
    +	if (tqs->stqs_count == 1) {
    +		tq = tqs->stqs_taskq[0];
    +	} else {
    +		tq = tqs->stqs_taskq[gethrtime() % tqs->stqs_count];
    +	}
    +
    +	taskq_dispatch_ent(tq, func, arg, flags, ent);
     }
     
     static void
    @@ -843,16 +930,7 @@ spa_create_zio_taskqs(spa_t *spa)
     {
     	for (int t = 0; t < ZIO_TYPES; t++) {
     		for (int q = 0; q < ZIO_TASKQ_TYPES; q++) {
    -			const zio_taskq_info_t *ztip = &zio_taskqs[t][q];
    -			enum zti_modes mode = ztip->zti_mode;
    -			uint_t value = ztip->zti_value;
    -			char name[32];
    -
    -			(void) snprintf(name, sizeof (name),
    -			    "%s_%s", zio_type_name[t], zio_taskq_types[q]);
    -
    -			spa->spa_zio_taskq[t][q] =
    -			    spa_taskq_create(spa, name, mode, value);
    +			spa_taskqs_init(spa, t, q);
     		}
     	}
     }
    @@ -1009,9 +1087,7 @@ spa_deactivate(spa_t *spa)
     
     	for (int t = 0; t < ZIO_TYPES; t++) {
     		for (int q = 0; q < ZIO_TASKQ_TYPES; q++) {
    -			if (spa->spa_zio_taskq[t][q] != NULL)
    -				taskq_destroy(spa->spa_zio_taskq[t][q]);
    -			spa->spa_zio_taskq[t][q] = NULL;
    +			spa_taskqs_fini(spa, t, q);
     		}
     	}
     
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h	Fri Mar  1 20:48:53 2013	(r247577)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h	Fri Mar  1 20:49:56 2013	(r247578)
    @@ -80,16 +80,16 @@ typedef struct spa_config_dirent {
     	char		*scd_path;
     } spa_config_dirent_t;
     
    -enum zio_taskq_type {
    +typedef enum zio_taskq_type {
     	ZIO_TASKQ_ISSUE = 0,
     	ZIO_TASKQ_ISSUE_HIGH,
     	ZIO_TASKQ_INTERRUPT,
     	ZIO_TASKQ_INTERRUPT_HIGH,
     	ZIO_TASKQ_TYPES
    -};
    +} zio_taskq_type_t;
     
     /*
    - * State machine for the zpool-pooname process.  The states transitions
    + * State machine for the zpool-poolname process.  The states transitions
      * are done as follows:
      *
      *	From		   To			Routine
    @@ -107,6 +107,11 @@ typedef enum spa_proc_state {
     	SPA_PROC_GONE		/* spa_thread() is exiting, spa_proc = &p0 */
     } spa_proc_state_t;
     
    +typedef struct spa_taskqs {
    +	uint_t stqs_count;
    +	taskq_t **stqs_taskq;
    +} spa_taskqs_t;
    +
     struct spa {
     	/*
     	 * Fields protected by spa_namespace_lock.
    @@ -125,7 +130,7 @@ struct spa {
     	uint8_t		spa_sync_on;		/* sync threads are running */
     	spa_load_state_t spa_load_state;	/* current load operation */
     	uint64_t	spa_import_flags;	/* import specific flags */
    -	taskq_t		*spa_zio_taskq[ZIO_TYPES][ZIO_TASKQ_TYPES];
    +	spa_taskqs_t	spa_zio_taskq[ZIO_TYPES][ZIO_TASKQ_TYPES];
     	dsl_pool_t	*spa_dsl_pool;
     	boolean_t	spa_is_initializing;	/* true while opening pool */
     	metaslab_class_t *spa_normal_class;	/* normal data class */
    @@ -245,6 +250,9 @@ struct spa {
     
     extern const char *spa_config_path;
     
    +extern void spa_taskq_dispatch_ent(spa_t *spa, zio_type_t t, zio_taskq_type_t q,
    +    task_func_t *func, void *arg, uint_t flags, taskq_ent_t *ent);
    +
     #ifdef	__cplusplus
     }
     #endif
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c	Fri Mar  1 20:48:53 2013	(r247577)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c	Fri Mar  1 20:49:56 2013	(r247578)
    @@ -224,7 +224,7 @@ vdev_file_io_start(zio_t *zio)
     	bp->b_private = vf->vf_vnode;
     	bp->b_iodone = (int (*)())vdev_file_io_intr;
     
    -	taskq_dispatch_ent(spa->spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE],
    +	spa_taskq_dispatch_ent(spa, ZIO_TYPE_FREE, ZIO_TASKQ_ISSUE,
     	    vdev_file_io_strategy, bp, 0, &zio->io_tqent);
     
     	return (ZIO_PIPELINE_STOP);
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c	Fri Mar  1 20:48:53 2013	(r247577)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c	Fri Mar  1 20:49:56 2013	(r247578)
    @@ -1107,7 +1107,7 @@ zio_free_bp_init(zio_t *zio)
      */
     
     static void
    -zio_taskq_dispatch(zio_t *zio, enum zio_taskq_type q, boolean_t cutinline)
    +zio_taskq_dispatch(zio_t *zio, zio_taskq_type_t q, boolean_t cutinline)
     {
     	spa_t *spa = zio->io_spa;
     	zio_type_t t = zio->io_type;
    @@ -1128,10 +1128,11 @@ zio_taskq_dispatch(zio_t *zio, enum zio_
     		t = ZIO_TYPE_NULL;
     
     	/*
    -	 * If this is a high priority I/O, then use the high priority taskq.
    +	 * If this is a high priority I/O, then use the high priority taskq if
    +	 * available.
     	 */
     	if (zio->io_priority == ZIO_PRIORITY_NOW &&
    -	    spa->spa_zio_taskq[t][q + 1] != NULL)
    +	    spa->spa_zio_taskq[t][q + 1].stqs_count != 0)
     		q++;
     
     	ASSERT3U(q, <, ZIO_TASKQ_TYPES);
    @@ -1142,19 +1143,24 @@ zio_taskq_dispatch(zio_t *zio, enum zio_
     	 * to dispatch the zio to another taskq at the same time.
     	 */
     	ASSERT(zio->io_tqent.tqent_next == NULL);
    -	taskq_dispatch_ent(spa->spa_zio_taskq[t][q],
    -	    (task_func_t *)zio_execute, zio, flags, &zio->io_tqent);
    +	spa_taskq_dispatch_ent(spa, t, q, (task_func_t *)zio_execute, zio,
    +	    flags, &zio->io_tqent);
     }
     
     static boolean_t
    -zio_taskq_member(zio_t *zio, enum zio_taskq_type q)
    +zio_taskq_member(zio_t *zio, zio_taskq_type_t q)
     {
     	kthread_t *executor = zio->io_executor;
     	spa_t *spa = zio->io_spa;
     
    -	for (zio_type_t t = 0; t < ZIO_TYPES; t++)
    -		if (taskq_member(spa->spa_zio_taskq[t][q], executor))
    -			return (B_TRUE);
    +	for (zio_type_t t = 0; t < ZIO_TYPES; t++) {
    +		spa_taskqs_t *tqs = &spa->spa_zio_taskq[t][q];
    +		uint_t i;
    +		for (i = 0; i < tqs->stqs_count; i++) {
    +			if (taskq_member(tqs->stqs_taskq[i], executor))
    +				return (B_TRUE);
    +		}
    +	}
     
     	return (B_FALSE);
     }
    @@ -3017,10 +3023,9 @@ zio_done(zio_t *zio)
     			 * Hand it off to the otherwise-unused claim taskq.
     			 */
     			ASSERT(zio->io_tqent.tqent_next == NULL);
    -			taskq_dispatch_ent(
    -			    spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE],
    -			    (task_func_t *)zio_reexecute, zio, 0,
    -			    &zio->io_tqent);
    +			spa_taskq_dispatch_ent(spa, ZIO_TYPE_CLAIM,
    +			    ZIO_TASKQ_ISSUE, (task_func_t *)zio_reexecute, zio,
    +			    0, &zio->io_tqent);
     		}
     		return (ZIO_PIPELINE_STOP);
     	}
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 20:51:54 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 7B7BD378;
     Fri,  1 Mar 2013 20:51:54 +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 55B8A1774;
     Fri,  1 Mar 2013 20:51:54 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21Kpskw087513;
     Fri, 1 Mar 2013 20:51:54 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21Kps4k087512;
     Fri, 1 Mar 2013 20:51:54 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303012051.r21Kps4k087512@svn.freebsd.org>
    From: Marius Strobl 
    Date: Fri, 1 Mar 2013 20:51:54 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247579 - head/sys/dev/cas
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 20:51:54 -0000
    
    Author: marius
    Date: Fri Mar  1 20:51:53 2013
    New Revision: 247579
    URL: http://svnweb.freebsd.org/changeset/base/247579
    
    Log:
      - Move reporting of failures to disable RX/TX MAC under bootverbose as at
        least the Saturn chips of 501-6738 cards may fail to do so the first
        time, which isn't fatal though.
        Reported by: Paul Keusemann
      - Explain why we don't enable infinite bursts on sparc64.
      - Given that these chips support memory write invalidate, make sure that
        it's enabled in the command register. Also make sure that PERR# and
        SERR# assertion is enabled.
      
      MFC after:	1 week
    
    Modified:
      head/sys/dev/cas/if_cas.c
    
    Modified: head/sys/dev/cas/if_cas.c
    ==============================================================================
    --- head/sys/dev/cas/if_cas.c	Fri Mar  1 20:49:56 2013	(r247578)
    +++ head/sys/dev/cas/if_cas.c	Fri Mar  1 20:51:53 2013	(r247579)
    @@ -824,7 +824,8 @@ cas_disable_rx(struct cas_softc *sc)
     	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
     	if (cas_bitwait(sc, CAS_MAC_RX_CONF, CAS_MAC_RX_CONF_EN, 0))
     		return (1);
    -	device_printf(sc->sc_dev, "cannot disable RX MAC\n");
    +	if (bootverbose)
    +		device_printf(sc->sc_dev, "cannot disable RX MAC\n");
     	return (0);
     }
     
    @@ -838,7 +839,8 @@ cas_disable_tx(struct cas_softc *sc)
     	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
     	if (cas_bitwait(sc, CAS_MAC_TX_CONF, CAS_MAC_TX_CONF_EN, 0))
     		return (1);
    -	device_printf(sc->sc_dev, "cannot disable TX MAC\n");
    +	if (bootverbose)
    +		device_printf(sc->sc_dev, "cannot disable TX MAC\n");
     	return (0);
     }
     
    @@ -1041,7 +1043,8 @@ cas_init_locked(struct cas_softc *sc)
     	/*
     	 * Enable infinite bursts for revisions without PCI issues if
     	 * applicable.  Doing so greatly improves the TX performance on
    -	 * !__sparc64__.
    +	 * !__sparc64__ (on sparc64, setting CAS_INF_BURST improves TX
    +	 * performance only marginally but hurts RX throughput quite a bit).
     	 */
     	CAS_WRITE_4(sc, CAS_INF_BURST,
     #if !defined(__sparc64__)
    @@ -2691,7 +2694,10 @@ cas_pci_attach(device_t dev)
     		return (ENXIO);
     	}
     
    -	pci_enable_busmaster(dev);
    +	/* PCI configuration */
    +	pci_write_config(dev, PCIR_COMMAND,
    +	    pci_read_config(dev, PCIR_COMMAND, 2) | PCIM_CMD_BUSMASTEREN |
    +	    PCIM_CMD_MWRICEN | PCIM_CMD_PERRESPEN | PCIM_CMD_SERRESPEN, 2);
     
     	sc->sc_dev = dev;
     	if (sc->sc_variant == CAS_CAS && pci_get_devid(dev) < 0x02)
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 21:01:47 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 5203D5E5;
     Fri,  1 Mar 2013 21:01:47 +0000 (UTC) (envelope-from mm@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 3464017C7;
     Fri,  1 Mar 2013 21:01:47 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21L1lhL090760;
     Fri, 1 Mar 2013 21:01:47 GMT (envelope-from mm@svn.freebsd.org)
    Received: (from mm@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21L1jFF090742;
     Fri, 1 Mar 2013 21:01:45 GMT (envelope-from mm@svn.freebsd.org)
    Message-Id: <201303012101.r21L1jFF090742@svn.freebsd.org>
    From: Martin Matuska 
    Date: Fri, 1 Mar 2013 21:01:45 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-vendor@freebsd.org
    Subject: svn commit: r247580 - vendor-sys/illumos/dist/common/nvpair
     vendor-sys/illumos/dist/uts/common vendor-sys/illumos/dist/uts/common/fs/zfs
     vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor-sys/ill...
    X-SVN-Group: vendor-sys
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 21:01:47 -0000
    
    Author: mm
    Date: Fri Mar  1 21:01:45 2013
    New Revision: 247580
    URL: http://svnweb.freebsd.org/changeset/base/247580
    
    Log:
      Update vendor/illumos/dist and vendor-sys/illumos/dist
      to illumos-gate 13973:4972ab336f54
      
      Illumos ZFS issues:
        3464 zfs synctask code needs restructuring
    
    Added:
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_userhold.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_send.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_destroy.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_userhold.h
    Modified:
      vendor-sys/illumos/dist/common/nvpair/fnvpair.c
      vendor-sys/illumos/dist/uts/common/Makefile.files
      vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/bplist.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deleg.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_synctask.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/refcount.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/rrwlock.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_tx.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dir.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_prop.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_synctask.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/rrwlock.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_map.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_debug.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ctldir.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c
      vendor-sys/illumos/dist/uts/common/sys/nvpair.h
    
    Changes in other areas also in this revision:
    Modified:
      vendor/illumos/dist/cmd/zdb/zdb.c
      vendor/illumos/dist/cmd/zfs/zfs_main.c
      vendor/illumos/dist/cmd/zhack/zhack.c
      vendor/illumos/dist/cmd/ztest/ztest.c
      vendor/illumos/dist/lib/libzfs/common/libzfs.h
      vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c
      vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c
      vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c
      vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h
      vendor/illumos/dist/lib/libzpool/common/kernel.c
      vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h
      vendor/illumos/dist/man/man1m/zfs.1m
    
    Modified: vendor-sys/illumos/dist/common/nvpair/fnvpair.c
    ==============================================================================
    --- vendor-sys/illumos/dist/common/nvpair/fnvpair.c	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor-sys/illumos/dist/common/nvpair/fnvpair.c	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -26,6 +26,7 @@
     #include 
     #include 
     #include 
    +#include 
     #ifndef _KERNEL
     #include 
     #endif
    @@ -114,6 +115,18 @@ fnvlist_merge(nvlist_t *dst, nvlist_t *s
     	VERIFY0(nvlist_merge(dst, src, KM_SLEEP));
     }
     
    +size_t
    +fnvlist_num_pairs(nvlist_t *nvl)
    +{
    +	size_t count = 0;
    +	nvpair_t *pair;
    +
    +	for (pair = nvlist_next_nvpair(nvl, 0); pair != NULL;
    +	    pair = nvlist_next_nvpair(nvl, pair))
    +		count++;
    +	return (count);
    +}
    +
     void
     fnvlist_add_boolean(nvlist_t *nvl, const char *name)
     {
    
    Modified: vendor-sys/illumos/dist/uts/common/Makefile.files
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/Makefile.files	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor-sys/illumos/dist/uts/common/Makefile.files	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -1346,8 +1346,10 @@ ZFS_COMMON_OBJS +=		\
     	dsl_dir.o		\
     	dsl_dataset.o		\
     	dsl_deadlist.o		\
    +	dsl_destroy.o		\
     	dsl_pool.o		\
     	dsl_synctask.o		\
    +	dsl_userhold.o		\
     	dmu_zfetch.o		\
     	dsl_deleg.o		\
     	dsl_prop.o		\
    @@ -1358,6 +1360,7 @@ ZFS_COMMON_OBJS +=		\
     	lzjb.o			\
     	metaslab.o		\
     	refcount.o		\
    +	rrwlock.o		\
     	sa.o			\
     	sha256.o		\
     	spa.o			\
    @@ -1417,7 +1420,6 @@ ZFS_OBJS +=			\
     	zfs_onexit.o		\
     	zfs_replay.o		\
     	zfs_rlock.o		\
    -	rrwlock.o		\
     	zfs_vfsops.o		\
     	zfs_vnops.o		\
     	zvol.o
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -1633,12 +1633,12 @@ arc_buf_free(arc_buf_t *buf, void *tag)
     	}
     }
     
    -int
    +boolean_t
     arc_buf_remove_ref(arc_buf_t *buf, void* tag)
     {
     	arc_buf_hdr_t *hdr = buf->b_hdr;
     	kmutex_t *hash_lock = HDR_LOCK(hdr);
    -	int no_callback = (buf->b_efunc == NULL);
    +	boolean_t no_callback = (buf->b_efunc == NULL);
     
     	if (hdr->b_state == arc_anon) {
     		ASSERT(hdr->b_datacnt == 1);
    @@ -1843,7 +1843,7 @@ arc_evict(arc_state_t *state, uint64_t s
     		ARCSTAT_INCR(arcstat_mutex_miss, missed);
     
     	/*
    -	 * We have just evicted some date into the ghost state, make
    +	 * We have just evicted some data into the ghost state, make
     	 * sure we also adjust the ghost state size if necessary.
     	 */
     	if (arc_no_grow &&
    @@ -2622,7 +2622,7 @@ arc_bcopy_func(zio_t *zio, arc_buf_t *bu
     {
     	if (zio == NULL || zio->io_error == 0)
     		bcopy(buf->b_data, arg, buf->b_hdr->b_size);
    -	VERIFY(arc_buf_remove_ref(buf, arg) == 1);
    +	VERIFY(arc_buf_remove_ref(buf, arg));
     }
     
     /* a generic arc_done_func_t */
    @@ -2631,7 +2631,7 @@ arc_getbuf_func(zio_t *zio, arc_buf_t *b
     {
     	arc_buf_t **bufp = arg;
     	if (zio && zio->io_error) {
    -		VERIFY(arc_buf_remove_ref(buf, arg) == 1);
    +		VERIFY(arc_buf_remove_ref(buf, arg));
     		*bufp = NULL;
     	} else {
     		*bufp = buf;
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bplist.c
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/bplist.c	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bplist.c	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -20,6 +20,7 @@
      */
     /*
      * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2012 by Delphix. All rights reserved.
      */
     
     #include 
    @@ -52,6 +53,12 @@ bplist_append(bplist_t *bpl, const blkpt
     	mutex_exit(&bpl->bpl_lock);
     }
     
    +/*
    + * To aid debugging, we keep the most recently removed entry.  This way if
    + * we are in the callback, we can easily locate the entry.
    + */
    +static bplist_entry_t *bplist_iterate_last_removed;
    +
     void
     bplist_iterate(bplist_t *bpl, bplist_itor_t *func, void *arg, dmu_tx_t *tx)
     {
    @@ -59,6 +66,7 @@ bplist_iterate(bplist_t *bpl, bplist_ito
     
     	mutex_enter(&bpl->bpl_lock);
     	while (bpe = list_head(&bpl->bpl_list)) {
    +		bplist_iterate_last_removed = bpe;
     		list_remove(&bpl->bpl_list, bpe);
     		mutex_exit(&bpl->bpl_lock);
     		func(arg, &bpe->bpe_blk, tx);
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -392,6 +392,10 @@ bpobj_enqueue_subobj(bpobj_t *bpo, uint6
     		    DMU_OT_BPOBJ_SUBOBJ, SPA_MAXBLOCKSIZE, DMU_OT_NONE, 0, tx);
     	}
     
    +	dmu_object_info_t doi;
    +	ASSERT0(dmu_object_info(bpo->bpo_os, bpo->bpo_phys->bpo_subobjs, &doi));
    +	ASSERT3U(doi.doi_type, ==, DMU_OT_BPOBJ_SUBOBJ);
    +
     	mutex_enter(&bpo->bpo_lock);
     	dmu_write(bpo->bpo_os, bpo->bpo_phys->bpo_subobjs,
     	    bpo->bpo_phys->bpo_num_subobjs * sizeof (subobj),
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -39,7 +39,7 @@
     #include 
     
     static void dbuf_destroy(dmu_buf_impl_t *db);
    -static int dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx);
    +static boolean_t dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx);
     static void dbuf_write(dbuf_dirty_record_t *dr, arc_buf_t *data, dmu_tx_t *tx);
     
     /*
    @@ -499,7 +499,7 @@ dbuf_read_done(zio_t *zio, arc_buf_t *bu
     	} else {
     		ASSERT(db->db_blkid != DMU_BONUS_BLKID);
     		ASSERT3P(db->db_buf, ==, NULL);
    -		VERIFY(arc_buf_remove_ref(buf, db) == 1);
    +		VERIFY(arc_buf_remove_ref(buf, db));
     		db->db_state = DB_UNCACHED;
     	}
     	cv_broadcast(&db->db_changed);
    @@ -828,10 +828,12 @@ dbuf_free_range(dnode_t *dn, uint64_t st
     			continue;
     
     		/* found a level 0 buffer in the range */
    -		if (dbuf_undirty(db, tx))
    +		mutex_enter(&db->db_mtx);
    +		if (dbuf_undirty(db, tx)) {
    +			/* mutex has been dropped and dbuf destroyed */
     			continue;
    +		}
     
    -		mutex_enter(&db->db_mtx);
     		if (db->db_state == DB_UNCACHED ||
     		    db->db_state == DB_NOFILL ||
     		    db->db_state == DB_EVICTING) {
    @@ -958,7 +960,7 @@ dbuf_new_size(dmu_buf_impl_t *db, int si
     
     	mutex_enter(&db->db_mtx);
     	dbuf_set_data(db, buf);
    -	VERIFY(arc_buf_remove_ref(obuf, db) == 1);
    +	VERIFY(arc_buf_remove_ref(obuf, db));
     	db->db.db_size = size;
     
     	if (db->db_level == 0) {
    @@ -1258,7 +1260,10 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t 
     	return (dr);
     }
     
    -static int
    +/*
    + * Return TRUE if this evicted the dbuf.
    + */
    +static boolean_t
     dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx)
     {
     	dnode_t *dn;
    @@ -1267,18 +1272,17 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
     
     	ASSERT(txg != 0);
     	ASSERT(db->db_blkid != DMU_BONUS_BLKID);
    +	ASSERT0(db->db_level);
    +	ASSERT(MUTEX_HELD(&db->db_mtx));
     
    -	mutex_enter(&db->db_mtx);
     	/*
     	 * If this buffer is not dirty, we're done.
     	 */
     	for (drp = &db->db_last_dirty; (dr = *drp) != NULL; drp = &dr->dr_next)
     		if (dr->dr_txg <= txg)
     			break;
    -	if (dr == NULL || dr->dr_txg < txg) {
    -		mutex_exit(&db->db_mtx);
    -		return (0);
    -	}
    +	if (dr == NULL || dr->dr_txg < txg)
    +		return (B_FALSE);
     	ASSERT(dr->dr_txg == txg);
     	ASSERT(dr->dr_dbuf == db);
     
    @@ -1286,24 +1290,12 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
     	dn = DB_DNODE(db);
     
     	/*
    -	 * If this buffer is currently held, we cannot undirty
    -	 * it, since one of the current holders may be in the
    -	 * middle of an update.  Note that users of dbuf_undirty()
    -	 * should not place a hold on the dbuf before the call.
    -	 * Also note: we can get here with a spill block, so
    -	 * test for that similar to how dbuf_dirty does.
    +	 * Note:  This code will probably work even if there are concurrent
    +	 * holders, but it is untested in that scenerio, as the ZPL and
    +	 * ztest have additional locking (the range locks) that prevents
    +	 * that type of concurrent access.
     	 */
    -	if (refcount_count(&db->db_holds) > db->db_dirtycnt) {
    -		mutex_exit(&db->db_mtx);
    -		/* Make sure we don't toss this buffer at sync phase */
    -		if (db->db_blkid != DMU_SPILL_BLKID) {
    -			mutex_enter(&dn->dn_mtx);
    -			dnode_clear_range(dn, db->db_blkid, 1, tx);
    -			mutex_exit(&dn->dn_mtx);
    -		}
    -		DB_DNODE_EXIT(db);
    -		return (0);
    -	}
    +	ASSERT3U(refcount_count(&db->db_holds), ==, db->db_dirtycnt);
     
     	dprintf_dbuf(db, "size=%llx\n", (u_longlong_t)db->db.db_size);
     
    @@ -1332,21 +1324,13 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
     	}
     	DB_DNODE_EXIT(db);
     
    -	if (db->db_level == 0) {
    -		if (db->db_state != DB_NOFILL) {
    -			dbuf_unoverride(dr);
    +	if (db->db_state != DB_NOFILL) {
    +		dbuf_unoverride(dr);
     
    -			ASSERT(db->db_buf != NULL);
    -			ASSERT(dr->dt.dl.dr_data != NULL);
    -			if (dr->dt.dl.dr_data != db->db_buf)
    -				VERIFY(arc_buf_remove_ref(dr->dt.dl.dr_data,
    -				    db) == 1);
    -		}
    -	} else {
     		ASSERT(db->db_buf != NULL);
    -		ASSERT(list_head(&dr->dt.di.dr_children) == NULL);
    -		mutex_destroy(&dr->dt.di.dr_mtx);
    -		list_destroy(&dr->dt.di.dr_children);
    +		ASSERT(dr->dt.dl.dr_data != NULL);
    +		if (dr->dt.dl.dr_data != db->db_buf)
    +			VERIFY(arc_buf_remove_ref(dr->dt.dl.dr_data, db));
     	}
     	kmem_free(dr, sizeof (dbuf_dirty_record_t));
     
    @@ -1358,13 +1342,12 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
     
     		ASSERT(db->db_state == DB_NOFILL || arc_released(buf));
     		dbuf_set_data(db, NULL);
    -		VERIFY(arc_buf_remove_ref(buf, db) == 1);
    +		VERIFY(arc_buf_remove_ref(buf, db));
     		dbuf_evict(db);
    -		return (1);
    +		return (B_TRUE);
     	}
     
    -	mutex_exit(&db->db_mtx);
    -	return (0);
    +	return (B_FALSE);
     }
     
     #pragma weak dmu_buf_will_dirty = dbuf_will_dirty
    @@ -1463,7 +1446,7 @@ dbuf_assign_arcbuf(dmu_buf_impl_t *db, a
     		mutex_exit(&db->db_mtx);
     		(void) dbuf_dirty(db, tx);
     		bcopy(buf->b_data, db->db.db_data, db->db.db_size);
    -		VERIFY(arc_buf_remove_ref(buf, db) == 1);
    +		VERIFY(arc_buf_remove_ref(buf, db));
     		xuio_stat_wbuf_copied();
     		return;
     	}
    @@ -1481,10 +1464,10 @@ dbuf_assign_arcbuf(dmu_buf_impl_t *db, a
     				arc_release(db->db_buf, db);
     			}
     			dr->dt.dl.dr_data = buf;
    -			VERIFY(arc_buf_remove_ref(db->db_buf, db) == 1);
    +			VERIFY(arc_buf_remove_ref(db->db_buf, db));
     		} else if (dr == NULL || dr->dt.dl.dr_data != db->db_buf) {
     			arc_release(db->db_buf, db);
    -			VERIFY(arc_buf_remove_ref(db->db_buf, db) == 1);
    +			VERIFY(arc_buf_remove_ref(db->db_buf, db));
     		}
     		db->db_buf = NULL;
     	}
    @@ -2067,10 +2050,10 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db,
     			 * This dbuf has anonymous data associated with it.
     			 */
     			dbuf_set_data(db, NULL);
    -			VERIFY(arc_buf_remove_ref(buf, db) == 1);
    +			VERIFY(arc_buf_remove_ref(buf, db));
     			dbuf_evict(db);
     		} else {
    -			VERIFY(arc_buf_remove_ref(db->db_buf, db) == 0);
    +			VERIFY(!arc_buf_remove_ref(db->db_buf, db));
     
     			/*
     			 * A dbuf will be eligible for eviction if either the
    @@ -2567,7 +2550,7 @@ dbuf_write_done(zio_t *zio, arc_buf_t *b
     		if (db->db_state != DB_NOFILL) {
     			if (dr->dt.dl.dr_data != db->db_buf)
     				VERIFY(arc_buf_remove_ref(dr->dt.dl.dr_data,
    -				    db) == 1);
    +				    db));
     			else if (!arc_released(db->db_buf))
     				arc_set_callback(db->db_buf, dbuf_do_evict, db);
     		}
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -1194,7 +1194,7 @@ void
     dmu_return_arcbuf(arc_buf_t *buf)
     {
     	arc_return_buf(buf, FTAG);
    -	VERIFY(arc_buf_remove_ref(buf, FTAG) == 1);
    +	VERIFY(arc_buf_remove_ref(buf, FTAG));
     }
     
     /*
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -20,6 +20,7 @@
      */
     /*
      * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2012 by Delphix. All rights reserved.
      */
     
     #include 
    @@ -155,51 +156,49 @@ diff_cb(spa_t *spa, zilog_t *zilog, cons
     }
     
     int
    -dmu_diff(objset_t *tosnap, objset_t *fromsnap, struct vnode *vp, offset_t *offp)
    +dmu_diff(const char *tosnap_name, const char *fromsnap_name,
    +    struct vnode *vp, offset_t *offp)
     {
     	struct diffarg da;
    -	dsl_dataset_t *ds = tosnap->os_dsl_dataset;
    -	dsl_dataset_t *fromds = fromsnap->os_dsl_dataset;
    -	dsl_dataset_t *findds;
    -	dsl_dataset_t *relds;
    -	int err = 0;
    +	dsl_dataset_t *fromsnap;
    +	dsl_dataset_t *tosnap;
    +	dsl_pool_t *dp;
    +	int error;
    +	uint64_t fromtxg;
     
    -	/* make certain we are looking at snapshots */
    -	if (!dsl_dataset_is_snapshot(ds) || !dsl_dataset_is_snapshot(fromds))
    +	if (strchr(tosnap_name, '@') == NULL ||
    +	    strchr(fromsnap_name, '@') == NULL)
     		return (EINVAL);
     
    -	/* fromsnap must be earlier and from the same lineage as tosnap */
    -	if (fromds->ds_phys->ds_creation_txg >= ds->ds_phys->ds_creation_txg)
    +	error = dsl_pool_hold(tosnap_name, FTAG, &dp);
    +	if (error != 0)
    +		return (error);
    +
    +	error = dsl_dataset_hold(dp, tosnap_name, FTAG, &tosnap);
    +	if (error != 0) {
    +		dsl_pool_rele(dp, FTAG);
    +		return (error);
    +	}
    +
    +	error = dsl_dataset_hold(dp, fromsnap_name, FTAG, &fromsnap);
    +	if (error != 0) {
    +		dsl_dataset_rele(tosnap, FTAG);
    +		dsl_pool_rele(dp, FTAG);
    +		return (error);
    +	}
    +
    +	if (!dsl_dataset_is_before(tosnap, fromsnap)) {
    +		dsl_dataset_rele(fromsnap, FTAG);
    +		dsl_dataset_rele(tosnap, FTAG);
    +		dsl_pool_rele(dp, FTAG);
     		return (EXDEV);
    -
    -	relds = NULL;
    -	findds = ds;
    -
    -	while (fromds->ds_dir != findds->ds_dir) {
    -		dsl_pool_t *dp = ds->ds_dir->dd_pool;
    -
    -		if (!dsl_dir_is_clone(findds->ds_dir)) {
    -			if (relds)
    -				dsl_dataset_rele(relds, FTAG);
    -			return (EXDEV);
    -		}
    -
    -		rw_enter(&dp->dp_config_rwlock, RW_READER);
    -		err = dsl_dataset_hold_obj(dp,
    -		    findds->ds_dir->dd_phys->dd_origin_obj, FTAG, &findds);
    -		rw_exit(&dp->dp_config_rwlock);
    -
    -		if (relds)
    -			dsl_dataset_rele(relds, FTAG);
    -
    -		if (err)
    -			return (EXDEV);
    -
    -		relds = findds;
     	}
     
    -	if (relds)
    -		dsl_dataset_rele(relds, FTAG);
    +	fromtxg = fromsnap->ds_phys->ds_creation_txg;
    +	dsl_dataset_rele(fromsnap, FTAG);
    +
    +	dsl_dataset_long_hold(tosnap, FTAG);
    +	dsl_pool_rele(dp, FTAG);
     
     	da.da_vp = vp;
     	da.da_offp = offp;
    @@ -207,15 +206,18 @@ dmu_diff(objset_t *tosnap, objset_t *fro
     	da.da_ddr.ddr_first = da.da_ddr.ddr_last = 0;
     	da.da_err = 0;
     
    -	err = traverse_dataset(ds, fromds->ds_phys->ds_creation_txg,
    +	error = traverse_dataset(tosnap, fromtxg,
     	    TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA, diff_cb, &da);
     
    -	if (err) {
    -		da.da_err = err;
    +	if (error != 0) {
    +		da.da_err = error;
     	} else {
     		/* we set the da.da_err we return as side-effect */
     		(void) write_record(&da);
     	}
     
    +	dsl_dataset_long_rele(tosnap, FTAG);
    +	dsl_dataset_rele(tosnap, FTAG);
    +
     	return (da.da_err);
     }
    
    Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c
    ==============================================================================
    --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -44,6 +44,7 @@
     #include 
     #include 
     #include 
    +#include 
     
     /*
      * Needed to close a window in dnode_move() that allows the objset to be freed
    @@ -280,7 +281,7 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat
     		err = arc_read(NULL, spa, os->os_rootbp,
     		    arc_getbuf_func, &os->os_phys_buf,
     		    ZIO_PRIORITY_SYNC_READ, ZIO_FLAG_CANFAIL, &aflags, &zb);
    -		if (err) {
    +		if (err != 0) {
     			kmem_free(os, sizeof (objset_t));
     			/* convert checksum errors into IO errors */
     			if (err == ECKSUM)
    @@ -320,34 +321,49 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat
     	 * checksum/compression/copies.
     	 */
     	if (ds) {
    -		err = dsl_prop_register(ds, "primarycache",
    +		err = dsl_prop_register(ds,
    +		    zfs_prop_to_name(ZFS_PROP_PRIMARYCACHE),
     		    primary_cache_changed_cb, os);
    -		if (err == 0)
    -			err = dsl_prop_register(ds, "secondarycache",
    +		if (err == 0) {
    +			err = dsl_prop_register(ds,
    +			    zfs_prop_to_name(ZFS_PROP_SECONDARYCACHE),
     			    secondary_cache_changed_cb, os);
    +		}
     		if (!dsl_dataset_is_snapshot(ds)) {
    -			if (err == 0)
    -				err = dsl_prop_register(ds, "checksum",
    +			if (err == 0) {
    +				err = dsl_prop_register(ds,
    +				    zfs_prop_to_name(ZFS_PROP_CHECKSUM),
     				    checksum_changed_cb, os);
    -			if (err == 0)
    -				err = dsl_prop_register(ds, "compression",
    +			}
    +			if (err == 0) {
    +				err = dsl_prop_register(ds,
    +				    zfs_prop_to_name(ZFS_PROP_COMPRESSION),
     				    compression_changed_cb, os);
    -			if (err == 0)
    -				err = dsl_prop_register(ds, "copies",
    +			}
    +			if (err == 0) {
    +				err = dsl_prop_register(ds,
    +				    zfs_prop_to_name(ZFS_PROP_COPIES),
     				    copies_changed_cb, os);
    -			if (err == 0)
    -				err = dsl_prop_register(ds, "dedup",
    +			}
    +			if (err == 0) {
    +				err = dsl_prop_register(ds,
    +				    zfs_prop_to_name(ZFS_PROP_DEDUP),
     				    dedup_changed_cb, os);
    -			if (err == 0)
    -				err = dsl_prop_register(ds, "logbias",
    +			}
    +			if (err == 0) {
    +				err = dsl_prop_register(ds,
    +				    zfs_prop_to_name(ZFS_PROP_LOGBIAS),
     				    logbias_changed_cb, os);
    -			if (err == 0)
    -				err = dsl_prop_register(ds, "sync",
    +			}
    +			if (err == 0) {
    +				err = dsl_prop_register(ds,
    +				    zfs_prop_to_name(ZFS_PROP_SYNC),
     				    sync_changed_cb, os);
    +			}
     		}
    -		if (err) {
    +		if (err != 0) {
     			VERIFY(arc_buf_remove_ref(os->os_phys_buf,
    -			    &os->os_phys_buf) == 1);
    +			    &os->os_phys_buf));
     			kmem_free(os, sizeof (objset_t));
     			return (err);
     		}
    @@ -425,44 +441,66 @@ dmu_objset_from_ds(dsl_dataset_t *ds, ob
     	return (err);
     }
     
    -/* called from zpl */
    +/*
    + * Holds the pool while the objset is held.  Therefore only one objset
    + * can be held at a time.
    + */
     int
     dmu_objset_hold(const char *name, void *tag, objset_t **osp)
     {
    +	dsl_pool_t *dp;
     	dsl_dataset_t *ds;
     	int err;
     
    -	err = dsl_dataset_hold(name, tag, &ds);
    -	if (err)
    +	err = dsl_pool_hold(name, tag, &dp);
    +	if (err != 0)
     		return (err);
    +	err = dsl_dataset_hold(dp, name, tag, &ds);
    +	if (err != 0) {
    +		dsl_pool_rele(dp, tag);
    +		return (err);
    +	}
     
     	err = dmu_objset_from_ds(ds, osp);
    -	if (err)
    +	if (err != 0) {
     		dsl_dataset_rele(ds, tag);
    +		dsl_pool_rele(dp, tag);
    +	}
     
     	return (err);
     }
     
    -/* called from zpl */
    +/*
    + * dsl_pool must not be held when this is called.
    + * Upon successful return, there will be a longhold on the dataset,
    + * and the dsl_pool will not be held.
    + */
     int
     dmu_objset_own(const char *name, dmu_objset_type_t type,
         boolean_t readonly, void *tag, objset_t **osp)
     {
    +	dsl_pool_t *dp;
     	dsl_dataset_t *ds;
     	int err;
     
    -	err = dsl_dataset_own(name, B_FALSE, tag, &ds);
    -	if (err)
    +	err = dsl_pool_hold(name, FTAG, &dp);
    +	if (err != 0)
     		return (err);
    +	err = dsl_dataset_own(dp, name, tag, &ds);
    +	if (err != 0) {
    +		dsl_pool_rele(dp, FTAG);
    +		return (err);
    +	}
     
     	err = dmu_objset_from_ds(ds, osp);
    -	if (err) {
    +	dsl_pool_rele(dp, FTAG);
    +	if (err != 0) {
     		dsl_dataset_disown(ds, tag);
     	} else if (type != DMU_OST_ANY && type != (*osp)->os_phys->os_type) {
    -		dmu_objset_disown(*osp, tag);
    +		dsl_dataset_disown(ds, tag);
     		return (EINVAL);
     	} else if (!readonly && dsl_dataset_is_snapshot(ds)) {
    -		dmu_objset_disown(*osp, tag);
    +		dsl_dataset_disown(ds, tag);
     		return (EROFS);
     	}
     	return (err);
    @@ -471,7 +509,9 @@ dmu_objset_own(const char *name, dmu_obj
     void
     dmu_objset_rele(objset_t *os, void *tag)
     {
    +	dsl_pool_t *dp = dmu_objset_pool(os);
     	dsl_dataset_rele(os->os_dsl_dataset, tag);
    +	dsl_pool_rele(dp, tag);
     }
     
     void
    @@ -480,7 +520,7 @@ dmu_objset_disown(objset_t *os, void *ta
     	dsl_dataset_disown(os->os_dsl_dataset, tag);
     }
     
    -int
    +void
     dmu_objset_evict_dbufs(objset_t *os)
     {
     	dnode_t *dn;
    @@ -515,9 +555,7 @@ dmu_objset_evict_dbufs(objset_t *os)
     		mutex_enter(&os->os_lock);
     		dn = next_dn;
     	}
    -	dn = list_head(&os->os_dnodes);
     	mutex_exit(&os->os_lock);
    -	return (dn != DMU_META_DNODE(os));
     }
     
     void
    @@ -530,33 +568,37 @@ dmu_objset_evict(objset_t *os)
     
     	if (ds) {
     		if (!dsl_dataset_is_snapshot(ds)) {
    -			VERIFY(0 == dsl_prop_unregister(ds, "checksum",
    +			VERIFY0(dsl_prop_unregister(ds,
    +			    zfs_prop_to_name(ZFS_PROP_CHECKSUM),
     			    checksum_changed_cb, os));
    -			VERIFY(0 == dsl_prop_unregister(ds, "compression",
    +			VERIFY0(dsl_prop_unregister(ds,
    +			    zfs_prop_to_name(ZFS_PROP_COMPRESSION),
     			    compression_changed_cb, os));
    -			VERIFY(0 == dsl_prop_unregister(ds, "copies",
    +			VERIFY0(dsl_prop_unregister(ds,
    +			    zfs_prop_to_name(ZFS_PROP_COPIES),
     			    copies_changed_cb, os));
    -			VERIFY(0 == dsl_prop_unregister(ds, "dedup",
    +			VERIFY0(dsl_prop_unregister(ds,
    +			    zfs_prop_to_name(ZFS_PROP_DEDUP),
     			    dedup_changed_cb, os));
    -			VERIFY(0 == dsl_prop_unregister(ds, "logbias",
    +			VERIFY0(dsl_prop_unregister(ds,
    +			    zfs_prop_to_name(ZFS_PROP_LOGBIAS),
     			    logbias_changed_cb, os));
    -			VERIFY(0 == dsl_prop_unregister(ds, "sync",
    +			VERIFY0(dsl_prop_unregister(ds,
    +			    zfs_prop_to_name(ZFS_PROP_SYNC),
     			    sync_changed_cb, os));
     		}
    -		VERIFY(0 == dsl_prop_unregister(ds, "primarycache",
    +		VERIFY0(dsl_prop_unregister(ds,
    +		    zfs_prop_to_name(ZFS_PROP_PRIMARYCACHE),
     		    primary_cache_changed_cb, os));
    -		VERIFY(0 == dsl_prop_unregister(ds, "secondarycache",
    +		VERIFY0(dsl_prop_unregister(ds,
    +		    zfs_prop_to_name(ZFS_PROP_SECONDARYCACHE),
     		    secondary_cache_changed_cb, os));
     	}
     
     	if (os->os_sa)
     		sa_tear_down(os);
     
    -	/*
    -	 * We should need only a single pass over the dnode list, since
    -	 * nothing can be added to the list at this point.
    -	 */
    -	(void) dmu_objset_evict_dbufs(os);
    +	dmu_objset_evict_dbufs(os);
     
     	dnode_special_close(&os->os_meta_dnode);
     	if (DMU_USERUSED_DNODE(os)) {
    @@ -567,7 +609,7 @@ dmu_objset_evict(objset_t *os)
     
     	ASSERT3P(list_head(&os->os_dnodes), ==, NULL);
     
    -	VERIFY(arc_buf_remove_ref(os->os_phys_buf, &os->os_phys_buf) == 1);
    +	VERIFY(arc_buf_remove_ref(os->os_phys_buf, &os->os_phys_buf));
     
     	/*
     	 * This is a barrier to prevent the objset from going away in
    @@ -599,10 +641,11 @@ dmu_objset_create_impl(spa_t *spa, dsl_d
     	dnode_t *mdn;
     
     	ASSERT(dmu_tx_is_syncing(tx));
    +
     	if (ds != NULL)
    -		VERIFY(0 == dmu_objset_from_ds(ds, &os));
    +		VERIFY0(dmu_objset_from_ds(ds, &os));
     	else
    -		VERIFY(0 == dmu_objset_open_impl(spa, NULL, bp, &os));
    +		VERIFY0(dmu_objset_open_impl(spa, NULL, bp, &os));
     
     	mdn = DMU_META_DNODE(os);
     
    @@ -650,359 +693,181 @@ dmu_objset_create_impl(spa_t *spa, dsl_d
     	return (os);
     }
     
    -struct oscarg {
    -	void (*userfunc)(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx);
    -	void *userarg;
    -	dsl_dataset_t *clone_origin;
    -	const char *lastname;
    -	dmu_objset_type_t type;
    -	uint64_t flags;
    -	cred_t *cr;
    -};
    +typedef struct dmu_objset_create_arg {
    +	const char *doca_name;
    +	cred_t *doca_cred;
    +	void (*doca_userfunc)(objset_t *os, void *arg,
    +	    cred_t *cr, dmu_tx_t *tx);
    +	void *doca_userarg;
    +	dmu_objset_type_t doca_type;
    +	uint64_t doca_flags;
    +} dmu_objset_create_arg_t;
     
     /*ARGSUSED*/
     static int
    -dmu_objset_create_check(void *arg1, void *arg2, dmu_tx_t *tx)
    +dmu_objset_create_check(void *arg, dmu_tx_t *tx)
     {
    -	dsl_dir_t *dd = arg1;
    -	struct oscarg *oa = arg2;
    -	objset_t *mos = dd->dd_pool->dp_meta_objset;
    -	int err;
    -	uint64_t ddobj;
    +	dmu_objset_create_arg_t *doca = arg;
    +	dsl_pool_t *dp = dmu_tx_pool(tx);
    +	dsl_dir_t *pdd;
    +	const char *tail;
    +	int error;
    +
    +	if (strchr(doca->doca_name, '@') != NULL)
    +		return (EINVAL);
     
    -	err = zap_lookup(mos, dd->dd_phys->dd_child_dir_zapobj,
    -	    oa->lastname, sizeof (uint64_t), 1, &ddobj);
    -	if (err != ENOENT)
    -		return (err ? err : EEXIST);
    -
    -	if (oa->clone_origin != NULL) {
    -		/* You can't clone across pools. */
    -		if (oa->clone_origin->ds_dir->dd_pool != dd->dd_pool)
    -			return (EXDEV);
    -
    -		/* You can only clone snapshots, not the head datasets. */
    -		if (!dsl_dataset_is_snapshot(oa->clone_origin))
    -			return (EINVAL);
    +	error = dsl_dir_hold(dp, doca->doca_name, FTAG, &pdd, &tail);
    +	if (error != 0)
    +		return (error);
    +	if (tail == NULL) {
    +		dsl_dir_rele(pdd, FTAG);
    +		return (EEXIST);
     	}
    +	dsl_dir_rele(pdd, FTAG);
     
     	return (0);
     }
     
     static void
    -dmu_objset_create_sync(void *arg1, void *arg2, dmu_tx_t *tx)
    +dmu_objset_create_sync(void *arg, dmu_tx_t *tx)
     {
    -	dsl_dir_t *dd = arg1;
    -	spa_t *spa = dd->dd_pool->dp_spa;
    -	struct oscarg *oa = arg2;
    -	uint64_t obj;
    +	dmu_objset_create_arg_t *doca = arg;
    +	dsl_pool_t *dp = dmu_tx_pool(tx);
    +	dsl_dir_t *pdd;
    +	const char *tail;
     	dsl_dataset_t *ds;
    +	uint64_t obj;
     	blkptr_t *bp;
    +	objset_t *os;
     
    -	ASSERT(dmu_tx_is_syncing(tx));
    +	VERIFY0(dsl_dir_hold(dp, doca->doca_name, FTAG, &pdd, &tail));
     
    -	obj = dsl_dataset_create_sync(dd, oa->lastname,
    -	    oa->clone_origin, oa->flags, oa->cr, tx);
    +	obj = dsl_dataset_create_sync(pdd, tail, NULL, doca->doca_flags,
    +	    doca->doca_cred, tx);
     
    -	VERIFY3U(0, ==, dsl_dataset_hold_obj(dd->dd_pool, obj, FTAG, &ds));
    +	VERIFY0(dsl_dataset_hold_obj(pdd->dd_pool, obj, FTAG, &ds));
     	bp = dsl_dataset_get_blkptr(ds);
    -	if (BP_IS_HOLE(bp)) {
    -		objset_t *os =
    -		    dmu_objset_create_impl(spa, ds, bp, oa->type, tx);
    +	os = dmu_objset_create_impl(pdd->dd_pool->dp_spa,
    +	    ds, bp, doca->doca_type, tx);
     
    -		if (oa->userfunc)
    -			oa->userfunc(os, oa->userarg, oa->cr, tx);
    +	if (doca->doca_userfunc != NULL) {
    +		doca->doca_userfunc(os, doca->doca_userarg,
    +		    doca->doca_cred, tx);
     	}
     
    -	if (oa->clone_origin == NULL) {
    -		spa_history_log_internal_ds(ds, "create", tx, "");
    -	} else {
    -		char namebuf[MAXNAMELEN];
    -		dsl_dataset_name(oa->clone_origin, namebuf);
    -		spa_history_log_internal_ds(ds, "clone", tx,
    -		    "origin=%s (%llu)", namebuf, oa->clone_origin->ds_object);
    -	}
    +	spa_history_log_internal_ds(ds, "create", tx, "");
     	dsl_dataset_rele(ds, FTAG);
    +	dsl_dir_rele(pdd, FTAG);
     }
     
     int
     dmu_objset_create(const char *name, dmu_objset_type_t type, uint64_t flags,
         void (*func)(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx), void *arg)
     {
    -	dsl_dir_t *pdd;
    -	const char *tail;
    -	int err = 0;
    -	struct oscarg oa = { 0 };
    +	dmu_objset_create_arg_t doca;
     
    -	ASSERT(strchr(name, '@') == NULL);
    -	err = dsl_dir_open(name, FTAG, &pdd, &tail);
    -	if (err)
    -		return (err);
    -	if (tail == NULL) {
    -		dsl_dir_close(pdd, FTAG);
    -		return (EEXIST);
    -	}
    +	doca.doca_name = name;
    +	doca.doca_cred = CRED();
    +	doca.doca_flags = flags;
    +	doca.doca_userfunc = func;
    +	doca.doca_userarg = arg;
    +	doca.doca_type = type;
    +
    +	return (dsl_sync_task(name,
    +	    dmu_objset_create_check, dmu_objset_create_sync, &doca, 5));
    +}
    +
    +typedef struct dmu_objset_clone_arg {
    +	const char *doca_clone;
    +	const char *doca_origin;
    +	cred_t *doca_cred;
    +} dmu_objset_clone_arg_t;
     
    -	oa.userfunc = func;
    -	oa.userarg = arg;
    -	oa.lastname = tail;
    -	oa.type = type;
    -	oa.flags = flags;
    -	oa.cr = CRED();
    -
    -	err = dsl_sync_task_do(pdd->dd_pool, dmu_objset_create_check,
    -	    dmu_objset_create_sync, pdd, &oa, 5);
    -	dsl_dir_close(pdd, FTAG);
    -	return (err);
    -}
    -
    -int
    -dmu_objset_clone(const char *name, dsl_dataset_t *clone_origin, uint64_t flags)
    +/*ARGSUSED*/
    +static int
    +dmu_objset_clone_check(void *arg, dmu_tx_t *tx)
     {
    +	dmu_objset_clone_arg_t *doca = arg;
     	dsl_dir_t *pdd;
     	const char *tail;
    -	int err = 0;
    -	struct oscarg oa = { 0 };
    +	int error;
    +	dsl_dataset_t *origin;
    +	dsl_pool_t *dp = dmu_tx_pool(tx);
     
    -	ASSERT(strchr(name, '@') == NULL);
    -	err = dsl_dir_open(name, FTAG, &pdd, &tail);
    -	if (err)
    -		return (err);
    +	if (strchr(doca->doca_clone, '@') != NULL)
    +		return (EINVAL);
    +
    +	error = dsl_dir_hold(dp, doca->doca_clone, FTAG, &pdd, &tail);
    +	if (error != 0)
    +		return (error);
     	if (tail == NULL) {
    -		dsl_dir_close(pdd, FTAG);
    +		dsl_dir_rele(pdd, FTAG);
     		return (EEXIST);
     	}
    -
    -	oa.lastname = tail;
    -	oa.clone_origin = clone_origin;
    -	oa.flags = flags;
    -	oa.cr = CRED();
    -
    -	err = dsl_sync_task_do(pdd->dd_pool, dmu_objset_create_check,
    -	    dmu_objset_create_sync, pdd, &oa, 5);
    -	dsl_dir_close(pdd, FTAG);
    -	return (err);
    -}
    -
    -int
    -dmu_objset_destroy(const char *name, boolean_t defer)
    -{
    -	dsl_dataset_t *ds;
    -	int error;
    -
    -	error = dsl_dataset_own(name, B_TRUE, FTAG, &ds);
    -	if (error == 0) {
    -		error = dsl_dataset_destroy(ds, FTAG, defer);
    -		/* dsl_dataset_destroy() closes the ds. */
    +	/* You can't clone across pools. */
    +	if (pdd->dd_pool != dp) {
    +		dsl_dir_rele(pdd, FTAG);
    +		return (EXDEV);
     	}
    +	dsl_dir_rele(pdd, FTAG);
     
    -	return (error);
    -}
    -
    -typedef struct snapallarg {
    -	dsl_sync_task_group_t *saa_dstg;
    -	boolean_t saa_needsuspend;
    -	nvlist_t *saa_props;
    -
    -	/* the following are used only if 'temporary' is set: */
    -	boolean_t saa_temporary;
    -	const char *saa_htag;
    -	struct dsl_ds_holdarg *saa_ha;
    -	dsl_dataset_t *saa_newds;
    -} snapallarg_t;
    -
    -typedef struct snaponearg {
    -	const char *soa_longname; /* long snap name */
    -	const char *soa_snapname; /* short snap name */
    -	snapallarg_t *soa_saa;
    -} snaponearg_t;
    -
    -static int
    -snapshot_check(void *arg1, void *arg2, dmu_tx_t *tx)
    -{
    -	objset_t *os = arg1;
    -	snaponearg_t *soa = arg2;
    -	snapallarg_t *saa = soa->soa_saa;
    -	int error;
    -
    -	/* The props have already been checked by zfs_check_userprops(). */
    -
    -	error = dsl_dataset_snapshot_check(os->os_dsl_dataset,
    -	    soa->soa_snapname, tx);
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 21:01:48 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 975BA5E6;
     Fri,  1 Mar 2013 21:01:48 +0000 (UTC) (envelope-from mm@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 79AD517C8;
     Fri,  1 Mar 2013 21:01:48 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21L1m70090775;
     Fri, 1 Mar 2013 21:01:48 GMT (envelope-from mm@svn.freebsd.org)
    Received: (from mm@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21L1lBk090765;
     Fri, 1 Mar 2013 21:01:47 GMT (envelope-from mm@svn.freebsd.org)
    Message-Id: <201303012101.r21L1lBk090765@svn.freebsd.org>
    From: Martin Matuska 
    Date: Fri, 1 Mar 2013 21:01:47 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-vendor@freebsd.org
    Subject: svn commit: r247580 - vendor-sys/illumos/dist/common/nvpair
     vendor-sys/illumos/dist/uts/common vendor-sys/illumos/dist/uts/common/fs/zfs
     vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor-sys/ill...
    X-SVN-Group: vendor
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 21:01:48 -0000
    
    Author: mm
    Date: Fri Mar  1 21:01:45 2013
    New Revision: 247580
    URL: http://svnweb.freebsd.org/changeset/base/247580
    
    Log:
      Update vendor/illumos/dist and vendor-sys/illumos/dist
      to illumos-gate 13973:4972ab336f54
      
      Illumos ZFS issues:
        3464 zfs synctask code needs restructuring
    
    Modified:
      vendor/illumos/dist/cmd/zdb/zdb.c
      vendor/illumos/dist/cmd/zfs/zfs_main.c
      vendor/illumos/dist/cmd/zhack/zhack.c
      vendor/illumos/dist/cmd/ztest/ztest.c
      vendor/illumos/dist/lib/libzfs/common/libzfs.h
      vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c
      vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c
      vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c
      vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h
      vendor/illumos/dist/lib/libzpool/common/kernel.c
      vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h
      vendor/illumos/dist/man/man1m/zfs.1m
    
    Changes in other areas also in this revision:
    Added:
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_userhold.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_send.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_destroy.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_userhold.h
    Modified:
      vendor-sys/illumos/dist/common/nvpair/fnvpair.c
      vendor-sys/illumos/dist/uts/common/Makefile.files
      vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/bplist.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deleg.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_synctask.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/refcount.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/rrwlock.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/space_map.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_tx.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dir.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_prop.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_synctask.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/rrwlock.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/space_map.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_debug.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h
      vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ctldir.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c
      vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c
      vendor-sys/illumos/dist/uts/common/sys/nvpair.h
    
    Modified: vendor/illumos/dist/cmd/zdb/zdb.c
    ==============================================================================
    --- vendor/illumos/dist/cmd/zdb/zdb.c	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor/illumos/dist/cmd/zdb/zdb.c	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -1658,7 +1658,9 @@ dump_dir(objset_t *os)
     	int print_header = 1;
     	int i, error;
     
    +	dsl_pool_config_enter(dmu_objset_pool(os), FTAG);
     	dmu_objset_fast_stat(os, &dds);
    +	dsl_pool_config_exit(dmu_objset_pool(os), FTAG);
     
     	if (dds.dds_type < DMU_OST_NUMTYPES)
     		type = objset_types[dds.dds_type];
    @@ -2109,7 +2111,6 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog
     
     		zio_nowait(zio_read(NULL, spa, bp, data, size,
     		    zdb_blkptr_done, zcb, ZIO_PRIORITY_ASYNC_READ, flags, zb));
    -
     	}
     
     	zcb->zcb_readfails = 0;
    @@ -2297,8 +2298,10 @@ dump_block_stats(spa_t *spa)
     	 */
     	(void) bpobj_iterate_nofree(&spa->spa_deferred_bpobj,
     	    count_block_cb, &zcb, NULL);
    -	(void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj,
    -	    count_block_cb, &zcb, NULL);
    +	if (spa_version(spa) >= SPA_VERSION_DEADLISTS) {
    +		(void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj,
    +		    count_block_cb, &zcb, NULL);
    +	}
     	if (spa_feature_is_active(spa,
     	    &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) {
     		VERIFY3U(0, ==, bptree_iterate(spa->spa_meta_objset,
    
    Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c
    ==============================================================================
    --- vendor/illumos/dist/cmd/zfs/zfs_main.c	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor/illumos/dist/cmd/zfs/zfs_main.c	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -898,6 +898,7 @@ typedef struct destroy_cbdata {
     	boolean_t	cb_parsable;
     	boolean_t	cb_dryrun;
     	nvlist_t	*cb_nvl;
    +	nvlist_t	*cb_batchedsnaps;
     
     	/* first snap in contiguous run */
     	char		*cb_firstsnap;
    @@ -994,9 +995,27 @@ destroy_callback(zfs_handle_t *zhp, void
     		zfs_close(zhp);
     		return (0);
     	}
    +	if (cb->cb_dryrun) {
    +		zfs_close(zhp);
    +		return (0);
    +	}
    +
    +	/*
    +	 * We batch up all contiguous snapshots (even of different
    +	 * filesystems) and destroy them with one ioctl.  We can't
    +	 * simply do all snap deletions and then all fs deletions,
    +	 * because we must delete a clone before its origin.
    +	 */
    +	if (zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT) {
    +		fnvlist_add_boolean(cb->cb_batchedsnaps, name);
    +	} else {
    +		int error = zfs_destroy_snaps_nvl(g_zfs,
    +		    cb->cb_batchedsnaps, B_FALSE);
    +		fnvlist_free(cb->cb_batchedsnaps);
    +		cb->cb_batchedsnaps = fnvlist_alloc();
     
    -	if (!cb->cb_dryrun) {
    -		if (zfs_unmount(zhp, NULL, cb->cb_force ? MS_FORCE : 0) != 0 ||
    +		if (error != 0 ||
    +		    zfs_unmount(zhp, NULL, cb->cb_force ? MS_FORCE : 0) != 0 ||
     		    zfs_destroy(zhp, cb->cb_defer_destroy) != 0) {
     			zfs_close(zhp);
     			return (-1);
    @@ -1152,8 +1171,10 @@ static int
     zfs_do_destroy(int argc, char **argv)
     {
     	destroy_cbdata_t cb = { 0 };
    +	int rv = 0;
    +	int err = 0;
     	int c;
    -	zfs_handle_t *zhp;
    +	zfs_handle_t *zhp = NULL;
     	char *at;
     	zfs_type_t type = ZFS_TYPE_DATASET;
     
    @@ -1207,11 +1228,9 @@ zfs_do_destroy(int argc, char **argv)
     
     	at = strchr(argv[0], '@');
     	if (at != NULL) {
    -		int err = 0;
     
     		/* Build the list of snaps to destroy in cb_nvl. */
    -		if (nvlist_alloc(&cb.cb_nvl, NV_UNIQUE_NAME, 0) != 0)
    -			nomem();
    +		cb.cb_nvl = fnvlist_alloc();
     
     		*at = '\0';
     		zhp = zfs_open(g_zfs, argv[0],
    @@ -1222,17 +1241,15 @@ zfs_do_destroy(int argc, char **argv)
     		cb.cb_snapspec = at + 1;
     		if (gather_snapshots(zfs_handle_dup(zhp), &cb) != 0 ||
     		    cb.cb_error) {
    -			zfs_close(zhp);
    -			nvlist_free(cb.cb_nvl);
    -			return (1);
    +			rv = 1;
    +			goto out;
     		}
     
     		if (nvlist_empty(cb.cb_nvl)) {
     			(void) fprintf(stderr, gettext("could not find any "
     			    "snapshots to destroy; check snapshot names.\n"));
    -			zfs_close(zhp);
    -			nvlist_free(cb.cb_nvl);
    -			return (1);
    +			rv = 1;
    +			goto out;
     		}
     
     		if (cb.cb_verbose) {
    @@ -1251,18 +1268,26 @@ zfs_do_destroy(int argc, char **argv)
     		}
     
     		if (!cb.cb_dryrun) {
    -			if (cb.cb_doclones)
    +			if (cb.cb_doclones) {
    +				cb.cb_batchedsnaps = fnvlist_alloc();
     				err = destroy_clones(&cb);
    +				if (err == 0) {
    +					err = zfs_destroy_snaps_nvl(g_zfs,
    +					    cb.cb_batchedsnaps, B_FALSE);
    +				}
    +				if (err != 0) {
    +					rv = 1;
    +					goto out;
    +				}
    +			}
     			if (err == 0) {
    -				err = zfs_destroy_snaps_nvl(zhp, cb.cb_nvl,
    +				err = zfs_destroy_snaps_nvl(g_zfs, cb.cb_nvl,
     				    cb.cb_defer_destroy);
     			}
     		}
     
    -		zfs_close(zhp);
    -		nvlist_free(cb.cb_nvl);
     		if (err != 0)
    -			return (1);
    +			rv = 1;
     	} else {
     		/* Open the given dataset */
     		if ((zhp = zfs_open(g_zfs, argv[0], type)) == NULL)
    @@ -1283,8 +1308,8 @@ zfs_do_destroy(int argc, char **argv)
     			    zfs_get_name(zhp));
     			(void) fprintf(stderr, gettext("use 'zpool destroy %s' "
     			    "to destroy the pool itself\n"), zfs_get_name(zhp));
    -			zfs_close(zhp);
    -			return (1);
    +			rv = 1;
    +			goto out;
     		}
     
     		/*
    @@ -1294,30 +1319,42 @@ zfs_do_destroy(int argc, char **argv)
     		if (!cb.cb_doclones &&
     		    zfs_iter_dependents(zhp, B_TRUE, destroy_check_dependent,
     		    &cb) != 0) {
    -			zfs_close(zhp);
    -			return (1);
    +			rv = 1;
    +			goto out;
     		}
     
     		if (cb.cb_error) {
    -			zfs_close(zhp);
    -			return (1);
    +			rv = 1;
    +			goto out;
     		}
     
    +		cb.cb_batchedsnaps = fnvlist_alloc();
     		if (zfs_iter_dependents(zhp, B_FALSE, destroy_callback,
     		    &cb) != 0) {
    -			zfs_close(zhp);
    -			return (1);
    +			rv = 1;
    +			goto out;
     		}
     
     		/*
     		 * Do the real thing.  The callback will close the
     		 * handle regardless of whether it succeeds or not.
     		 */
    -		if (destroy_callback(zhp, &cb) != 0)
    -			return (1);
    +		err = destroy_callback(zhp, &cb);
    +		zhp = NULL;
    +		if (err == 0) {
    +			err = zfs_destroy_snaps_nvl(g_zfs,
    +			    cb.cb_batchedsnaps, cb.cb_defer_destroy);
    +		}
    +		if (err != 0)
    +			rv = 1;
     	}
     
    -	return (0);
    +out:
    +	fnvlist_free(cb.cb_batchedsnaps);
    +	fnvlist_free(cb.cb_nvl);
    +	if (zhp != NULL)
    +		zfs_close(zhp);
    +	return (rv);
     }
     
     static boolean_t
    @@ -5052,28 +5089,12 @@ cleanup2:
     	return (error);
     }
     
    -/*
    - * zfs allow [-r] [-t]   ...
    - *
    - *	-r	Recursively hold
    - *	-t	Temporary hold (hidden option)
    - *
    - * Apply a user-hold with the given tag to the list of snapshots.
    - */
     static int
     zfs_do_allow(int argc, char **argv)
     {
     	return (zfs_do_allow_unallow_impl(argc, argv, B_FALSE));
     }
     
    -/*
    - * zfs unallow [-r] [-t]   ...
    - *
    - *	-r	Recursively hold
    - *	-t	Temporary hold (hidden option)
    - *
    - * Apply a user-hold with the given tag to the list of snapshots.
    - */
     static int
     zfs_do_unallow(int argc, char **argv)
     {
    @@ -5087,7 +5108,6 @@ zfs_do_hold_rele_impl(int argc, char **a
     	int i;
     	const char *tag;
     	boolean_t recursive = B_FALSE;
    -	boolean_t temphold = B_FALSE;
     	const char *opts = holding ? "rt" : "r";
     	int c;
     
    @@ -5097,9 +5117,6 @@ zfs_do_hold_rele_impl(int argc, char **a
     		case 'r':
     			recursive = B_TRUE;
     			break;
    -		case 't':
    -			temphold = B_TRUE;
    -			break;
     		case '?':
     			(void) fprintf(stderr, gettext("invalid option '%c'\n"),
     			    optopt);
    @@ -5148,7 +5165,7 @@ zfs_do_hold_rele_impl(int argc, char **a
     		}
     		if (holding) {
     			if (zfs_hold(zhp, delim+1, tag, recursive,
    -			    temphold, B_FALSE, -1, 0, 0) != 0)
    +			    B_FALSE, -1) != 0)
     				++errors;
     		} else {
     			if (zfs_release(zhp, delim+1, tag, recursive) != 0)
    @@ -5164,7 +5181,6 @@ zfs_do_hold_rele_impl(int argc, char **a
      * zfs hold [-r] [-t]   ...
      *
      *	-r	Recursively hold
    - *	-t	Temporary hold (hidden option)
      *
      * Apply a user-hold with the given tag to the list of snapshots.
      */
    
    Modified: vendor/illumos/dist/cmd/zhack/zhack.c
    ==============================================================================
    --- vendor/illumos/dist/cmd/zhack/zhack.c	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor/illumos/dist/cmd/zhack/zhack.c	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -46,6 +46,7 @@
     #include 
     #include 
     #include 
    +#include 
     #undef ZFS_MAXNAMELEN
     #undef verify
     #include 
    @@ -273,10 +274,10 @@ zhack_do_feature_stat(int argc, char **a
     }
     
     static void
    -feature_enable_sync(void *arg1, void *arg2, dmu_tx_t *tx)
    +feature_enable_sync(void *arg, dmu_tx_t *tx)
     {
    -	spa_t *spa = arg1;
    -	zfeature_info_t *feature = arg2;
    +	spa_t *spa = dmu_tx_pool(tx)->dp_spa;
    +	zfeature_info_t *feature = arg;
     
     	spa_feature_enable(spa, feature, tx);
     	spa_history_log_internal(spa, "zhack enable feature", tx,
    @@ -344,8 +345,8 @@ zhack_do_feature_enable(int argc, char *
     	if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid))
     		fatal("feature already enabled: %s", feature.fi_guid);
     
    -	VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL,
    -	    feature_enable_sync, spa, &feature, 5));
    +	VERIFY0(dsl_sync_task(spa_name(spa), NULL,
    +	    feature_enable_sync, &feature, 5));
     
     	spa_close(spa, FTAG);
     
    @@ -353,10 +354,10 @@ zhack_do_feature_enable(int argc, char *
     }
     
     static void
    -feature_incr_sync(void *arg1, void *arg2, dmu_tx_t *tx)
    +feature_incr_sync(void *arg, dmu_tx_t *tx)
     {
    -	spa_t *spa = arg1;
    -	zfeature_info_t *feature = arg2;
    +	spa_t *spa = dmu_tx_pool(tx)->dp_spa;
    +	zfeature_info_t *feature = arg;
     
     	spa_feature_incr(spa, feature, tx);
     	spa_history_log_internal(spa, "zhack feature incr", tx,
    @@ -364,10 +365,10 @@ feature_incr_sync(void *arg1, void *arg2
     }
     
     static void
    -feature_decr_sync(void *arg1, void *arg2, dmu_tx_t *tx)
    +feature_decr_sync(void *arg, dmu_tx_t *tx)
     {
    -	spa_t *spa = arg1;
    -	zfeature_info_t *feature = arg2;
    +	spa_t *spa = dmu_tx_pool(tx)->dp_spa;
    +	zfeature_info_t *feature = arg;
     
     	spa_feature_decr(spa, feature, tx);
     	spa_history_log_internal(spa, "zhack feature decr", tx,
    @@ -442,8 +443,8 @@ zhack_do_feature_ref(int argc, char **ar
     	if (decr && !spa_feature_is_active(spa, &feature))
     		fatal("feature refcount already 0: %s", feature.fi_guid);
     
    -	VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL,
    -	    decr ? feature_decr_sync : feature_incr_sync, spa, &feature, 5));
    +	VERIFY0(dsl_sync_task(spa_name(spa), NULL,
    +	    decr ? feature_decr_sync : feature_incr_sync, &feature, 5));
     
     	spa_close(spa, FTAG);
     }
    
    Modified: vendor/illumos/dist/cmd/ztest/ztest.c
    ==============================================================================
    --- vendor/illumos/dist/cmd/ztest/ztest.c	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor/illumos/dist/cmd/ztest/ztest.c	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -103,10 +103,12 @@
     #include 
     #include 
     #include 
    +#include 
     #include 
     #include 
     #include 
     #include 
    +#include 
     #include 
     #include 
     #include 
    @@ -365,7 +367,7 @@ ztest_info_t ztest_info[] = {
     	{ ztest_scrub,				1,	&zopt_rarely	},
     	{ ztest_spa_upgrade,			1,	&zopt_rarely	},
     	{ ztest_dsl_dataset_promote_busy,	1,	&zopt_rarely	},
    -	{ ztest_vdev_attach_detach,		1,	&zopt_rarely	},
    +	{ ztest_vdev_attach_detach,		1,	&zopt_sometimes	},
     	{ ztest_vdev_LUN_growth,		1,	&zopt_rarely	},
     	{ ztest_vdev_add_remove,		1,
     	    &ztest_opts.zo_vdevtime				},
    @@ -1006,9 +1008,8 @@ ztest_dsl_prop_set_uint64(char *osname, 
     	uint64_t curval;
     	int error;
     
    -	error = dsl_prop_set(osname, propname,
    -	    (inherit ? ZPROP_SRC_NONE : ZPROP_SRC_LOCAL),
    -	    sizeof (value), 1, &value);
    +	error = dsl_prop_set_int(osname, propname,
    +	    (inherit ? ZPROP_SRC_NONE : ZPROP_SRC_LOCAL), value);
     
     	if (error == ENOSPC) {
     		ztest_record_enospc(FTAG);
    @@ -1016,8 +1017,7 @@ ztest_dsl_prop_set_uint64(char *osname, 
     	}
     	ASSERT0(error);
     
    -	VERIFY3U(dsl_prop_get(osname, propname, sizeof (curval),
    -	    1, &curval, setpoint), ==, 0);
    +	VERIFY0(dsl_prop_get_integer(osname, propname, &curval, setpoint));
     
     	if (ztest_opts.zo_verbose >= 6) {
     		VERIFY(zfs_prop_index_to_string(prop, curval, &valname) == 0);
    @@ -2479,8 +2479,7 @@ ztest_vdev_add_remove(ztest_ds_t *zd, ui
     	int error;
     
     	VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
    -	leaves =
    -	    MAX(zs->zs_mirrors + zs->zs_splits, 1) * ztest_opts.zo_raidz;
    +	leaves = MAX(zs->zs_mirrors + zs->zs_splits, 1) * ztest_opts.zo_raidz;
     
     	spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER);
     
    @@ -3180,7 +3179,7 @@ ztest_objset_destroy_cb(const char *name
     	/*
     	 * Verify that the dataset contains a directory object.
     	 */
    -	VERIFY3U(0, ==, dmu_objset_hold(name, FTAG, &os));
    +	VERIFY0(dmu_objset_own(name, DMU_OST_OTHER, B_TRUE, FTAG, &os));
     	error = dmu_object_info(os, ZTEST_DIROBJ, &doi);
     	if (error != ENOENT) {
     		/* We could have crashed in the middle of destroying it */
    @@ -3188,12 +3187,16 @@ ztest_objset_destroy_cb(const char *name
     		ASSERT3U(doi.doi_type, ==, DMU_OT_ZAP_OTHER);
     		ASSERT3S(doi.doi_physical_blocks_512, >=, 0);
     	}
    -	dmu_objset_rele(os, FTAG);
    +	dmu_objset_disown(os, FTAG);
     
     	/*
     	 * Destroy the dataset.
     	 */
    -	VERIFY3U(0, ==, dmu_objset_destroy(name, B_FALSE));
    +	if (strchr(name, '@') != NULL) {
    +		VERIFY0(dsl_destroy_snapshot(name, B_FALSE));
    +	} else {
    +		VERIFY0(dsl_destroy_head(name));
    +	}
     	return (0);
     }
     
    @@ -3203,16 +3206,17 @@ ztest_snapshot_create(char *osname, uint
     	char snapname[MAXNAMELEN];
     	int error;
     
    -	(void) snprintf(snapname, MAXNAMELEN, "%s@%llu", osname,
    -	    (u_longlong_t)id);
    +	(void) snprintf(snapname, sizeof (snapname), "%llu", (u_longlong_t)id);
     
    -	error = dmu_objset_snapshot_one(osname, strchr(snapname, '@') + 1);
    +	error = dmu_objset_snapshot_one(osname, snapname);
     	if (error == ENOSPC) {
     		ztest_record_enospc(FTAG);
     		return (B_FALSE);
     	}
    -	if (error != 0 && error != EEXIST)
    -		fatal(0, "ztest_snapshot_create(%s) = %d", snapname, error);
    +	if (error != 0 && error != EEXIST) {
    +		fatal(0, "ztest_snapshot_create(%s@%s) = %d", osname,
    +		    snapname, error);
    +	}
     	return (B_TRUE);
     }
     
    @@ -3225,7 +3229,7 @@ ztest_snapshot_destroy(char *osname, uin
     	(void) snprintf(snapname, MAXNAMELEN, "%s@%llu", osname,
     	    (u_longlong_t)id);
     
    -	error = dmu_objset_destroy(snapname, B_FALSE);
    +	error = dsl_destroy_snapshot(snapname, B_FALSE);
     	if (error != 0 && error != ENOENT)
     		fatal(0, "ztest_snapshot_destroy(%s) = %d", snapname, error);
     	return (B_TRUE);
    @@ -3271,7 +3275,8 @@ ztest_dmu_objset_create_destroy(ztest_ds
     	/*
     	 * Verify that the destroyed dataset is no longer in the namespace.
     	 */
    -	VERIFY3U(ENOENT, ==, dmu_objset_hold(name, FTAG, &os));
    +	VERIFY3U(ENOENT, ==, dmu_objset_own(name, DMU_OST_OTHER, B_TRUE,
    +	    FTAG, &os));
     
     	/*
     	 * Verify that we can create a new dataset.
    @@ -3286,8 +3291,7 @@ ztest_dmu_objset_create_destroy(ztest_ds
     		fatal(0, "dmu_objset_create(%s) = %d", name, error);
     	}
     
    -	VERIFY3U(0, ==,
    -	    dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, FTAG, &os));
    +	VERIFY0(dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, FTAG, &os));
     
     	ztest_zd_init(&zdtmp, NULL, os);
     
    @@ -3363,21 +3367,21 @@ ztest_dsl_dataset_cleanup(char *osname, 
     	(void) snprintf(clone2name, MAXNAMELEN, "%s/c2_%llu", osname, id);
     	(void) snprintf(snap3name, MAXNAMELEN, "%s@s3_%llu", clone1name, id);
     
    -	error = dmu_objset_destroy(clone2name, B_FALSE);
    +	error = dsl_destroy_head(clone2name);
     	if (error && error != ENOENT)
    -		fatal(0, "dmu_objset_destroy(%s) = %d", clone2name, error);
    -	error = dmu_objset_destroy(snap3name, B_FALSE);
    +		fatal(0, "dsl_destroy_head(%s) = %d", clone2name, error);
    +	error = dsl_destroy_snapshot(snap3name, B_FALSE);
     	if (error && error != ENOENT)
    -		fatal(0, "dmu_objset_destroy(%s) = %d", snap3name, error);
    -	error = dmu_objset_destroy(snap2name, B_FALSE);
    +		fatal(0, "dsl_destroy_snapshot(%s) = %d", snap3name, error);
    +	error = dsl_destroy_snapshot(snap2name, B_FALSE);
     	if (error && error != ENOENT)
    -		fatal(0, "dmu_objset_destroy(%s) = %d", snap2name, error);
    -	error = dmu_objset_destroy(clone1name, B_FALSE);
    +		fatal(0, "dsl_destroy_snapshot(%s) = %d", snap2name, error);
    +	error = dsl_destroy_head(clone1name);
     	if (error && error != ENOENT)
    -		fatal(0, "dmu_objset_destroy(%s) = %d", clone1name, error);
    -	error = dmu_objset_destroy(snap1name, B_FALSE);
    +		fatal(0, "dsl_destroy_head(%s) = %d", clone1name, error);
    +	error = dsl_destroy_snapshot(snap1name, B_FALSE);
     	if (error && error != ENOENT)
    -		fatal(0, "dmu_objset_destroy(%s) = %d", snap1name, error);
    +		fatal(0, "dsl_destroy_snapshot(%s) = %d", snap1name, error);
     }
     
     /*
    @@ -3386,8 +3390,7 @@ ztest_dsl_dataset_cleanup(char *osname, 
     void
     ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
     {
    -	objset_t *clone;
    -	dsl_dataset_t *ds;
    +	objset_t *os;
     	char snap1name[MAXNAMELEN];
     	char clone1name[MAXNAMELEN];
     	char snap2name[MAXNAMELEN];
    @@ -3415,12 +3418,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_
     		fatal(0, "dmu_take_snapshot(%s) = %d", snap1name, error);
     	}
     
    -	error = dmu_objset_hold(snap1name, FTAG, &clone);
    -	if (error)
    -		fatal(0, "dmu_open_snapshot(%s) = %d", snap1name, error);
    -
    -	error = dmu_objset_clone(clone1name, dmu_objset_ds(clone), 0);
    -	dmu_objset_rele(clone, FTAG);
    +	error = dmu_objset_clone(clone1name, snap1name);
     	if (error) {
     		if (error == ENOSPC) {
     			ztest_record_enospc(FTAG);
    @@ -3447,12 +3445,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_
     		fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error);
     	}
     
    -	error = dmu_objset_hold(snap3name, FTAG, &clone);
    -	if (error)
    -		fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error);
    -
    -	error = dmu_objset_clone(clone2name, dmu_objset_ds(clone), 0);
    -	dmu_objset_rele(clone, FTAG);
    +	error = dmu_objset_clone(clone2name, snap3name);
     	if (error) {
     		if (error == ENOSPC) {
     			ztest_record_enospc(FTAG);
    @@ -3461,14 +3454,14 @@ ztest_dsl_dataset_promote_busy(ztest_ds_
     		fatal(0, "dmu_objset_create(%s) = %d", clone2name, error);
     	}
     
    -	error = dsl_dataset_own(snap2name, B_FALSE, FTAG, &ds);
    +	error = dmu_objset_own(snap2name, DMU_OST_ANY, B_TRUE, FTAG, &os);
     	if (error)
    -		fatal(0, "dsl_dataset_own(%s) = %d", snap2name, error);
    +		fatal(0, "dmu_objset_own(%s) = %d", snap2name, error);
     	error = dsl_dataset_promote(clone2name, NULL);
     	if (error != EBUSY)
     		fatal(0, "dsl_dataset_promote(%s), %d, not EBUSY", clone2name,
     		    error);
    -	dsl_dataset_disown(ds, FTAG);
    +	dmu_objset_disown(os, FTAG);
     
     out:
     	ztest_dsl_dataset_cleanup(osname, id);
    @@ -4280,7 +4273,7 @@ ztest_zap_parallel(ztest_ds_t *zd, uint6
     	}
     
     	count = -1ULL;
    -	VERIFY(zap_count(os, object, &count) == 0);
    +	VERIFY0(zap_count(os, object, &count));
     	ASSERT(count != -1ULL);
     
     	/*
    @@ -4591,6 +4584,22 @@ ztest_spa_prop_get_set(ztest_ds_t *zd, u
     	(void) rw_unlock(&ztest_name_lock);
     }
     
    +static int
    +user_release_one(const char *snapname, const char *holdname)
    +{
    +	nvlist_t *snaps, *holds;
    +	int error;
    +
    +	snaps = fnvlist_alloc();
    +	holds = fnvlist_alloc();
    +	fnvlist_add_boolean(holds, holdname);
    +	fnvlist_add_nvlist(snaps, snapname, holds);
    +	fnvlist_free(holds);
    +	error = dsl_dataset_user_release(snaps, NULL);
    +	fnvlist_free(snaps);
    +	return (error);
    +}
    +
     /*
      * Test snapshot hold/release and deferred destroy.
      */
    @@ -4605,22 +4614,30 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, 
     	char clonename[100];
     	char tag[100];
     	char osname[MAXNAMELEN];
    +	nvlist_t *holds;
     
     	(void) rw_rdlock(&ztest_name_lock);
     
     	dmu_objset_name(os, osname);
     
    -	(void) snprintf(snapname, 100, "sh1_%llu", id);
    -	(void) snprintf(fullname, 100, "%s@%s", osname, snapname);
    -	(void) snprintf(clonename, 100, "%s/ch1_%llu", osname, id);
    -	(void) snprintf(tag, 100, "%tag_%llu", id);
    +	(void) snprintf(snapname, sizeof (snapname), "sh1_%llu", id);
    +	(void) snprintf(fullname, sizeof (fullname), "%s@%s", osname, snapname);
    +	(void) snprintf(clonename, sizeof (clonename),
    +	    "%s/ch1_%llu", osname, id);
    +	(void) snprintf(tag, sizeof (tag), "tag_%llu", id);
     
     	/*
     	 * Clean up from any previous run.
     	 */
    -	(void) dmu_objset_destroy(clonename, B_FALSE);
    -	(void) dsl_dataset_user_release(osname, snapname, tag, B_FALSE);
    -	(void) dmu_objset_destroy(fullname, B_FALSE);
    +	error = dsl_destroy_head(clonename);
    +	if (error != ENOENT)
    +		ASSERT0(error);
    +	error = user_release_one(fullname, tag);
    +	if (error != ESRCH && error != ENOENT)
    +		ASSERT0(error);
    +	error = dsl_destroy_snapshot(fullname, B_FALSE);
    +	if (error != ENOENT)
    +		ASSERT0(error);
     
     	/*
     	 * Create snapshot, clone it, mark snap for deferred destroy,
    @@ -4635,12 +4652,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, 
     		fatal(0, "dmu_objset_snapshot(%s) = %d", fullname, error);
     	}
     
    -	error = dmu_objset_hold(fullname, FTAG, &origin);
    -	if (error)
    -		fatal(0, "dmu_objset_hold(%s) = %d", fullname, error);
    -
    -	error = dmu_objset_clone(clonename, dmu_objset_ds(origin), 0);
    -	dmu_objset_rele(origin, FTAG);
    +	error = dmu_objset_clone(clonename, fullname);
     	if (error) {
     		if (error == ENOSPC) {
     			ztest_record_enospc("dmu_objset_clone");
    @@ -4649,15 +4661,15 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, 
     		fatal(0, "dmu_objset_clone(%s) = %d", clonename, error);
     	}
     
    -	error = dmu_objset_destroy(fullname, B_TRUE);
    +	error = dsl_destroy_snapshot(fullname, B_TRUE);
     	if (error) {
    -		fatal(0, "dmu_objset_destroy(%s, B_TRUE) = %d",
    +		fatal(0, "dsl_destroy_snapshot(%s, B_TRUE) = %d",
     		    fullname, error);
     	}
     
    -	error = dmu_objset_destroy(clonename, B_FALSE);
    +	error = dsl_destroy_head(clonename);
     	if (error)
    -		fatal(0, "dmu_objset_destroy(%s) = %d", clonename, error);
    +		fatal(0, "dsl_destroy_head(%s) = %d", clonename, error);
     
     	error = dmu_objset_hold(fullname, FTAG, &origin);
     	if (error != ENOENT)
    @@ -4677,28 +4689,31 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, 
     		fatal(0, "dmu_objset_snapshot(%s) = %d", fullname, error);
     	}
     
    -	error = dsl_dataset_user_hold(osname, snapname, tag, B_FALSE,
    -	    B_TRUE, -1);
    +	holds = fnvlist_alloc();
    +	fnvlist_add_string(holds, fullname, tag);
    +	error = dsl_dataset_user_hold(holds, 0, NULL);
    +	fnvlist_free(holds);
    +
     	if (error)
     		fatal(0, "dsl_dataset_user_hold(%s)", fullname, tag);
     
    -	error = dmu_objset_destroy(fullname, B_FALSE);
    +	error = dsl_destroy_snapshot(fullname, B_FALSE);
     	if (error != EBUSY) {
    -		fatal(0, "dmu_objset_destroy(%s, B_FALSE) = %d",
    +		fatal(0, "dsl_destroy_snapshot(%s, B_FALSE) = %d",
     		    fullname, error);
     	}
     
    -	error = dmu_objset_destroy(fullname, B_TRUE);
    +	error = dsl_destroy_snapshot(fullname, B_TRUE);
     	if (error) {
    -		fatal(0, "dmu_objset_destroy(%s, B_TRUE) = %d",
    +		fatal(0, "dsl_destroy_snapshot(%s, B_TRUE) = %d",
     		    fullname, error);
     	}
     
    -	error = dsl_dataset_user_release(osname, snapname, tag, B_FALSE);
    +	error = user_release_one(fullname, tag);
     	if (error)
    -		fatal(0, "dsl_dataset_user_release(%s)", fullname, tag);
    +		fatal(0, "user_release_one(%s)", fullname, tag);
     
    -	VERIFY(dmu_objset_hold(fullname, FTAG, &origin) == ENOENT);
    +	VERIFY3U(dmu_objset_hold(fullname, FTAG, &origin), ==, ENOENT);
     
     out:
     	(void) rw_unlock(&ztest_name_lock);
    @@ -4952,8 +4967,12 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_
     	 */
     	for (int i = 0; i < copies; i++) {
     		uint64_t offset = i * blocksize;
    -		VERIFY0(dmu_buf_hold(os, object, offset, FTAG, &db,
    -		    DMU_READ_NO_PREFETCH));
    +		int error = dmu_buf_hold(os, object, offset, FTAG, &db,
    +		    DMU_READ_NO_PREFETCH);
    +		if (error != 0) {
    +			fatal(B_FALSE, "dmu_buf_hold(%p, %llu, %llu) = %u",
    +			    os, (long long)object, (long long) offset, error);
    +		}
     		ASSERT(db->db_offset == offset);
     		ASSERT(db->db_size == blocksize);
     		ASSERT(ztest_pattern_match(db->db_data, db->db_size, pattern) ||
    @@ -5163,6 +5182,7 @@ ztest_spa_import_export(char *oldname, c
     	nvlist_t *config, *newconfig;
     	uint64_t pool_guid;
     	spa_t *spa;
    +	int error;
     
     	if (ztest_opts.zo_verbose >= 4) {
     		(void) printf("import/export: old = %s, new = %s\n",
    @@ -5207,7 +5227,12 @@ ztest_spa_import_export(char *oldname, c
     	/*
     	 * Import it under the new name.
     	 */
    -	VERIFY3U(0, ==, spa_import(newname, config, NULL, 0));
    +	error = spa_import(newname, config, NULL, 0);
    +	if (error != 0) {
    +		dump_nvlist(config, 0);
    +		fatal(B_FALSE, "couldn't import pool %s as %s: error %u",
    +		    oldname, newname, error);
    +	}
     
     	ztest_walk_pool_directory("pools after import");
     
    @@ -5414,7 +5439,7 @@ ztest_dataset_open(int d)
     	}
     	ASSERT(error == 0 || error == EEXIST);
     
    -	VERIFY0(dmu_objset_hold(name, zd, &os));
    +	VERIFY0(dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, zd, &os));
     	(void) rw_unlock(&ztest_name_lock);
     
     	ztest_zd_init(zd, ZTEST_GET_SHARED_DS(d), os);
    @@ -5455,7 +5480,7 @@ ztest_dataset_close(int d)
     	ztest_ds_t *zd = &ztest_ds[d];
     
     	zil_close(zd->zd_zilog);
    -	dmu_objset_rele(zd->zd_os, zd);
    +	dmu_objset_disown(zd->zd_os, zd);
     
     	ztest_zd_fini(zd);
     }
    @@ -5499,13 +5524,14 @@ ztest_run(ztest_shared_t *zs)
     	 * Open our pool.
     	 */
     	kernel_init(FREAD | FWRITE);
    -	VERIFY(spa_open(ztest_opts.zo_pool, &spa, FTAG) == 0);
    +	VERIFY0(spa_open(ztest_opts.zo_pool, &spa, FTAG));
     	spa->spa_debug = B_TRUE;
     	ztest_spa = spa;
     
    -	VERIFY3U(0, ==, dmu_objset_hold(ztest_opts.zo_pool, FTAG, &os));
    +	VERIFY0(dmu_objset_own(ztest_opts.zo_pool,
    +	    DMU_OST_ANY, B_TRUE, FTAG, &os));
     	zs->zs_guid = dmu_objset_fsid_guid(os);
    -	dmu_objset_rele(os, FTAG);
    +	dmu_objset_disown(os, FTAG);
     
     	spa->spa_dedup_ditto = 2 * ZIO_DEDUPDITTO_MIN;
     
    
    Modified: vendor/illumos/dist/lib/libzfs/common/libzfs.h
    ==============================================================================
    --- vendor/illumos/dist/lib/libzfs/common/libzfs.h	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor/illumos/dist/lib/libzfs/common/libzfs.h	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -550,7 +550,7 @@ extern int zfs_create(libzfs_handle_t *,
     extern int zfs_create_ancestors(libzfs_handle_t *, const char *);
     extern int zfs_destroy(zfs_handle_t *, boolean_t);
     extern int zfs_destroy_snaps(zfs_handle_t *, char *, boolean_t);
    -extern int zfs_destroy_snaps_nvl(zfs_handle_t *, nvlist_t *, boolean_t);
    +extern int zfs_destroy_snaps_nvl(libzfs_handle_t *, nvlist_t *, boolean_t);
     extern int zfs_clone(zfs_handle_t *, const char *, nvlist_t *);
     extern int zfs_snapshot(libzfs_handle_t *, const char *, boolean_t, nvlist_t *);
     extern int zfs_snapshot_nvl(libzfs_handle_t *hdl, nvlist_t *snaps,
    @@ -593,8 +593,8 @@ extern int zfs_send(zfs_handle_t *, cons
         sendflags_t *, int, snapfilter_cb_t, void *, nvlist_t **);
     
     extern int zfs_promote(zfs_handle_t *);
    -extern int zfs_hold(zfs_handle_t *, const char *, const char *, boolean_t,
    -    boolean_t, boolean_t, int, uint64_t, uint64_t);
    +extern int zfs_hold(zfs_handle_t *, const char *, const char *,
    +    boolean_t, boolean_t, int);
     extern int zfs_release(zfs_handle_t *, const char *, const char *, boolean_t);
     extern int zfs_get_holds(zfs_handle_t *, nvlist_t **);
     extern uint64_t zvol_volsize_to_reservation(uint64_t, nvlist_t *);
    
    Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c
    ==============================================================================
    --- vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c	Fri Mar  1 20:51:53 2013	(r247579)
    +++ vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c	Fri Mar  1 21:01:45 2013	(r247580)
    @@ -1973,10 +1973,7 @@ get_clones_cb(zfs_handle_t *zhp, void *a
     	    NULL, NULL, 0, B_TRUE) != 0)
     		goto out;
     	if (strcmp(gca->buf, gca->origin) == 0) {
    -		if (nvlist_add_boolean(gca->value, zfs_get_name(zhp)) != 0) {
    -			zfs_close(zhp);
    -			return (no_memory(zhp->zfs_hdl));
    -		}
    +		fnvlist_add_boolean(gca->value, zfs_get_name(zhp));
     		gca->numclones--;
     	}
     
    @@ -3142,45 +3139,49 @@ zfs_destroy_snaps(zfs_handle_t *zhp, cha
     		    dgettext(TEXT_DOMAIN, "cannot destroy '%s@%s'"),
     		    zhp->zfs_name, snapname);
     	} else {
    -		ret = zfs_destroy_snaps_nvl(zhp, dd.nvl, defer);
    +		ret = zfs_destroy_snaps_nvl(zhp->zfs_hdl, dd.nvl, defer);
     	}
     	nvlist_free(dd.nvl);
     	return (ret);
     }
     
     /*
    - * Destroys all the snapshots named in the nvlist.  They must be underneath
    - * the zhp (either snapshots of it, or snapshots of its descendants).
    + * Destroys all the snapshots named in the nvlist.
      */
     int
    -zfs_destroy_snaps_nvl(zfs_handle_t *zhp, nvlist_t *snaps, boolean_t defer)
    +zfs_destroy_snaps_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, boolean_t defer)
     {
     	int ret;
     	nvlist_t *errlist;
     
     	ret = lzc_destroy_snaps(snaps, defer, &errlist);
     
    -	if (ret != 0) {
    -		for (nvpair_t *pair = nvlist_next_nvpair(errlist, NULL);
    -		    pair != NULL; pair = nvlist_next_nvpair(errlist, pair)) {
    -			char errbuf[1024];
    -			(void) snprintf(errbuf, sizeof (errbuf),
    -			    dgettext(TEXT_DOMAIN, "cannot destroy snapshot %s"),
    -			    nvpair_name(pair));
    +	if (ret == 0)
    +		return (0);
     
    -			switch (fnvpair_value_int32(pair)) {
    -			case EEXIST:
    -				zfs_error_aux(zhp->zfs_hdl,
    -				    dgettext(TEXT_DOMAIN,
    -				    "snapshot is cloned"));
    -				ret = zfs_error(zhp->zfs_hdl, EZFS_EXISTS,
    -				    errbuf);
    -				break;
    -			default:
    -				ret = zfs_standard_error(zhp->zfs_hdl, errno,
    -				    errbuf);
    -				break;
    -			}
    +	if (nvlist_next_nvpair(errlist, NULL) == NULL) {
    +		char errbuf[1024];
    +		(void) snprintf(errbuf, sizeof (errbuf),
    +		    dgettext(TEXT_DOMAIN, "cannot destroy snapshots"));
    +
    +		ret = zfs_standard_error(hdl, ret, errbuf);
    +	}
    +	for (nvpair_t *pair = nvlist_next_nvpair(errlist, NULL);
    +	    pair != NULL; pair = nvlist_next_nvpair(errlist, pair)) {
    +		char errbuf[1024];
    +		(void) snprintf(errbuf, sizeof (errbuf),
    +		    dgettext(TEXT_DOMAIN, "cannot destroy snapshot %s"),
    +		    nvpair_name(pair));
    +
    +		switch (fnvpair_value_int32(pair)) {
    +		case EEXIST:
    +			zfs_error_aux(hdl,
    +			    dgettext(TEXT_DOMAIN, "snapshot is cloned"));
    +			ret = zfs_error(hdl, EZFS_EXISTS, errbuf);
    +			break;
    +		default:
    +			ret = zfs_standard_error(hdl, errno, errbuf);
    +			break;
     		}
     	}
     
    @@ -4047,7 +4048,7 @@ zfs_userspace(zfs_handle_t *zhp, zfs_use
     
     		zc.zc_nvlist_dst_size = sizeof (buf);
     		if (zfs_ioctl(hdl, ZFS_IOC_USERSPACE_MANY, &zc) != 0) {
    -			char errbuf[ZFS_MAXNAMELEN + 32];
    +			char errbuf[1024];
     
     			(void) snprintf(errbuf, sizeof (errbuf),
     			    dgettext(TEXT_DOMAIN,
    @@ -4069,37 +4070,83 @@ zfs_userspace(zfs_handle_t *zhp, zfs_use
     	return (0);
     }
     
    +struct holdarg {
    +	nvlist_t *nvl;
    +	const char *snapname;
    +	const char *tag;
    +	boolean_t recursive;
    +};
    +
    +static int
    +zfs_hold_one(zfs_handle_t *zhp, void *arg)
    +{
    +	struct holdarg *ha = arg;
    +	zfs_handle_t *szhp;
    +	char name[ZFS_MAXNAMELEN];
    +	int rv = 0;
    +
    +	(void) snprintf(name, sizeof (name),
    +	    "%s@%s", zhp->zfs_name, ha->snapname);
    +
    +	szhp = make_dataset_handle(zhp->zfs_hdl, name);
    +	if (szhp) {
    +		fnvlist_add_string(ha->nvl, name, ha->tag);
    +		zfs_close(szhp);
    +	}
    +
    +	if (ha->recursive)
    +		rv = zfs_iter_filesystems(zhp, zfs_hold_one, ha);
    +	zfs_close(zhp);
    +	return (rv);
    +}
    +
     int
     zfs_hold(zfs_handle_t *zhp, const char *snapname, const char *tag,
    -    boolean_t recursive, boolean_t temphold, boolean_t enoent_ok,
    -    int cleanup_fd, uint64_t dsobj, uint64_t createtxg)
    +    boolean_t recursive, boolean_t enoent_ok, int cleanup_fd)
     {
    -	zfs_cmd_t zc = { 0 };
    +	int ret;
    +	struct holdarg ha;
    +	nvlist_t *errors;
     	libzfs_handle_t *hdl = zhp->zfs_hdl;
    +	char errbuf[1024];
    +	nvpair_t *elem;
     
    -	ASSERT(!recursive || dsobj == 0);
    +	ha.nvl = fnvlist_alloc();
    +	ha.snapname = snapname;
    +	ha.tag = tag;
    +	ha.recursive = recursive;
    +	(void) zfs_hold_one(zfs_handle_dup(zhp), &ha);
    +	ret = lzc_hold(ha.nvl, cleanup_fd, &errors);
    +	fnvlist_free(ha.nvl);
     
    -	(void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
    -	(void) strlcpy(zc.zc_value, snapname, sizeof (zc.zc_value));
    -	if (strlcpy(zc.zc_string, tag, sizeof (zc.zc_string))
    -	    >= sizeof (zc.zc_string))
    -		return (zfs_error(hdl, EZFS_TAGTOOLONG, tag));
    -	zc.zc_cookie = recursive;
    -	zc.zc_temphold = temphold;
    -	zc.zc_cleanup_fd = cleanup_fd;
    -	zc.zc_sendobj = dsobj;
    -	zc.zc_createtxg = createtxg;
    +	if (ret == 0)
    +		return (0);
     
    -	if (zfs_ioctl(hdl, ZFS_IOC_HOLD, &zc) != 0) {
    -		char errbuf[ZFS_MAXNAMELEN+32];
    +	if (nvlist_next_nvpair(errors, NULL) == NULL) {
    +		/* no hold-specific errors */
    +		(void) snprintf(errbuf, sizeof (errbuf),
    +		    dgettext(TEXT_DOMAIN, "cannot hold"));
    +		switch (ret) {
    +		case ENOTSUP:
    +			zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
    +			    "pool must be upgraded"));
    +			(void) zfs_error(hdl, EZFS_BADVERSION, errbuf);
    +			break;
    +		case EINVAL:
    +			(void) zfs_error(hdl, EZFS_BADTYPE, errbuf);
    +			break;
    +		default:
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 21:35:53 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id C449EF6C;
     Fri,  1 Mar 2013 21:35:53 +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 B69E918C8;
     Fri,  1 Mar 2013 21:35:53 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21LZrMK000711;
     Fri, 1 Mar 2013 21:35:53 GMT (envelope-from des@svn.freebsd.org)
    Received: (from des@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21LZrMK000710;
     Fri, 1 Mar 2013 21:35:53 GMT (envelope-from des@svn.freebsd.org)
    Message-Id: <201303012135.r21LZrMK000710@svn.freebsd.org>
    From: Dag-Erling Smørgrav 
    Date: Fri, 1 Mar 2013 21:35:53 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247583 - stable/8/share/misc
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 21:35:53 -0000
    
    Author: des
    Date: Fri Mar  1 21:35:53 2013
    New Revision: 247583
    URL: http://svnweb.freebsd.org/changeset/base/247583
    
    Log:
      Manually fix screwed-up mergeinfo.
    
    Modified:
    Directory Properties:
      stable/8/cddl/compat/opensolaris/   (props changed)
      stable/8/cddl/contrib/opensolaris/   (props changed)
      stable/8/cddl/contrib/opensolaris/cmd/zfs/   (props changed)
      stable/8/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
      stable/8/contrib/pf/   (props changed)
      stable/8/games/fortune/   (props changed)
      stable/8/gnu/usr.bin/groff/   (props changed)
      stable/8/lib/libradius/   (props changed)
      stable/8/lib/libstand/   (props changed)
      stable/8/share/misc/   (props changed)
      stable/8/share/misc/bsd-family-tree   (props changed)
      stable/8/tools/kerneldoc/subsys/   (props changed)
      stable/8/usr.bin/find/   (props changed)
      stable/8/usr.bin/gcore/   (props changed)
      stable/8/usr.bin/locale/   (props changed)
      stable/8/usr.bin/systat/   (props changed)
      stable/8/usr.bin/vmstat/   (props changed)
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 21:57:03 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 1B35D471;
     Fri,  1 Mar 2013 21:57:03 +0000 (UTC) (envelope-from pjd@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 EB6B11981;
     Fri,  1 Mar 2013 21:57:02 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21Lv2UO006767;
     Fri, 1 Mar 2013 21:57:02 GMT (envelope-from pjd@svn.freebsd.org)
    Received: (from pjd@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21Lv2aO006765;
     Fri, 1 Mar 2013 21:57:02 GMT (envelope-from pjd@svn.freebsd.org)
    Message-Id: <201303012157.r21Lv2aO006765@svn.freebsd.org>
    From: Pawel Jakub Dawidek 
    Date: Fri, 1 Mar 2013 21:57:02 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247584 - head/sys/kern
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 21:57:03 -0000
    
    Author: pjd
    Date: Fri Mar  1 21:57:02 2013
    New Revision: 247584
    URL: http://svnweb.freebsd.org/changeset/base/247584
    
    Log:
      Reduce lock scope a little.
    
    Modified:
      head/sys/kern/vfs_syscalls.c
    
    Modified: head/sys/kern/vfs_syscalls.c
    ==============================================================================
    --- head/sys/kern/vfs_syscalls.c	Fri Mar  1 21:35:53 2013	(r247583)
    +++ head/sys/kern/vfs_syscalls.c	Fri Mar  1 21:57:02 2013	(r247584)
    @@ -2633,9 +2633,9 @@ setfflags(td, vp, flags)
     
     	if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0)
     		return (error);
    -	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
     	VATTR_NULL(&vattr);
     	vattr.va_flags = flags;
    +	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
     #ifdef MAC
     	error = mac_vnode_check_setflags(td->td_ucred, vp, vattr.va_flags);
     	if (error == 0)
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 21:58:52 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id AB5A57AD;
     Fri,  1 Mar 2013 21:58:52 +0000 (UTC) (envelope-from mm@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 8095A1999;
     Fri,  1 Mar 2013 21:58:52 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21LwqQB007074;
     Fri, 1 Mar 2013 21:58:52 GMT (envelope-from mm@svn.freebsd.org)
    Received: (from mm@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21Lwprk007068;
     Fri, 1 Mar 2013 21:58:51 GMT (envelope-from mm@svn.freebsd.org)
    Message-Id: <201303012158.r21Lwprk007068@svn.freebsd.org>
    From: Martin Matuska 
    Date: Fri, 1 Mar 2013 21:58:51 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247585 - in head: cddl/contrib/opensolaris/cmd/zfs
     sys/cddl/contrib/opensolaris/common/zfs
     sys/cddl/contrib/opensolaris/uts/common/fs/zfs
     sys/cddl/contrib/opensolaris/uts/common/sys/fs
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 21:58:52 -0000
    
    Author: mm
    Date: Fri Mar  1 21:58:51 2013
    New Revision: 247585
    URL: http://svnweb.freebsd.org/changeset/base/247585
    
    Log:
      MFV r247316:
      Merge new read-only zfs properties from vendor (illumos)
      
      Illumos ZFS issues:
        3588 provide zfs properties for logical (uncompressed) space used and
             referenced
      
      References:
        https://www.illumos.org/issues/3588
      
      MFC after:	2 weeks
    
    Modified:
      head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
      head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
      head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
      head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
      head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
    Directory Properties:
      head/sys/cddl/contrib/opensolaris/   (props changed)
    
    Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
    ==============================================================================
    --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Fri Mar  1 21:57:02 2013	(r247584)
    +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Fri Mar  1 21:58:51 2013	(r247585)
    @@ -526,6 +526,39 @@ if the snapshot has been marked for defe
     .Qq Nm Cm destroy -d
     command. Otherwise, the property is
     .Cm off .
    +.It Sy logicalreferenced
    +The amount of space that is
    +.Qq logically
    +accessible by this dataset.
    +See the
    +.Sy referenced
    +property.
    +The logical space ignores the effect of the
    +.Sy compression
    +and
    +.Sy copies
    +properties, giving a quantity closer to the amount of data that applications
    +see.
    +However, it does include space consumed by metadata.
    +.Pp
    +This property can also be referred to by its shortened column name,
    +.Sy lrefer .
    +.It Sy logicalused
    +The amount of space that is
    +.Qq logically
    +consumed by this dataset and all its descendents.
    +See the
    +.Sy used
    +property.
    +The logical space ignores the effect of the
    +.Sy compression
    +and
    +.Sy copies
    +properties, giving a quantity closer to the amount of data that applications
    +see.
    +.Pp
    +This property can also be referred to by its shortened column name,
    +.Sy lused .
     .It Sy mounted
     For file systems, indicates whether the file system is currently mounted. This
     property can be either
    
    Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
    ==============================================================================
    --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c	Fri Mar  1 21:57:02 2013	(r247584)
    +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c	Fri Mar  1 21:58:51 2013	(r247585)
    @@ -20,7 +20,7 @@
      */
     /*
      * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    - * Copyright (c) 2011 by Delphix. All rights reserved.
    + * Copyright (c) 2012 by Delphix. All rights reserved.
      * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
      */
     
    @@ -350,6 +350,10 @@ zfs_prop_init(void)
     	    ZFS_TYPE_SNAPSHOT, "", "USERREFS");
     	zprop_register_number(ZFS_PROP_WRITTEN, "written", 0, PROP_READONLY,
     	    ZFS_TYPE_DATASET, "", "WRITTEN");
    +	zprop_register_number(ZFS_PROP_LOGICALUSED, "logicalused", 0,
    +	    PROP_READONLY, ZFS_TYPE_DATASET, "", "LUSED");
    +	zprop_register_number(ZFS_PROP_LOGICALREFERENCED, "logicalreferenced",
    +	    0, PROP_READONLY, ZFS_TYPE_DATASET, "", "LREFER");
     
     	/* default number properties */
     	zprop_register_number(ZFS_PROP_QUOTA, "quota", 0, PROP_DEFAULT,
    
    Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
    ==============================================================================
    --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Fri Mar  1 21:57:02 2013	(r247584)
    +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Fri Mar  1 21:58:51 2013	(r247585)
    @@ -2344,6 +2344,8 @@ dsl_dataset_stats(dsl_dataset_t *ds, nvl
     	    (ds->ds_phys->ds_uncompressed_bytes * 100 /
     	    ds->ds_phys->ds_compressed_bytes);
     	dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_REFRATIO, ratio);
    +	dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_LOGICALREFERENCED,
    +	    ds->ds_phys->ds_uncompressed_bytes);
     
     	if (ds->ds_phys->ds_next_snap_obj) {
     		/*
    
    Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
    ==============================================================================
    --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c	Fri Mar  1 21:57:02 2013	(r247584)
    +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c	Fri Mar  1 21:58:51 2013	(r247585)
    @@ -541,6 +541,8 @@ dsl_dir_stats(dsl_dir_t *dd, nvlist_t *n
     	    dd->dd_phys->dd_compressed_bytes == 0 ? 100 :
     	    (dd->dd_phys->dd_uncompressed_bytes * 100 /
     	    dd->dd_phys->dd_compressed_bytes));
    +	dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_LOGICALUSED,
    +	    dd->dd_phys->dd_uncompressed_bytes);
     	if (dd->dd_phys->dd_flags & DD_FLAG_USED_BREAKDOWN) {
     		dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_USEDSNAP,
     		    dd->dd_phys->dd_used_breakdown[DD_USED_SNAP]);
    
    Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
    ==============================================================================
    --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h	Fri Mar  1 21:57:02 2013	(r247584)
    +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h	Fri Mar  1 21:58:51 2013	(r247585)
    @@ -131,6 +131,8 @@ typedef enum {
     	ZFS_PROP_REFRATIO,
     	ZFS_PROP_WRITTEN,
     	ZFS_PROP_CLONES,
    +	ZFS_PROP_LOGICALUSED,
    +	ZFS_PROP_LOGICALREFERENCED,
     	ZFS_NUM_PROPS
     } zfs_prop_t;
     
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 21:58:56 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id A92E47B0;
     Fri,  1 Mar 2013 21:58:56 +0000 (UTC) (envelope-from pjd@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 9C024199B;
     Fri,  1 Mar 2013 21:58:56 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21LwuBM007120;
     Fri, 1 Mar 2013 21:58:56 GMT (envelope-from pjd@svn.freebsd.org)
    Received: (from pjd@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21Lwu9k007119;
     Fri, 1 Mar 2013 21:58:56 GMT (envelope-from pjd@svn.freebsd.org)
    Message-Id: <201303012158.r21Lwu9k007119@svn.freebsd.org>
    From: Pawel Jakub Dawidek 
    Date: Fri, 1 Mar 2013 21:58:56 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247586 - head/sys/kern
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 21:58:56 -0000
    
    Author: pjd
    Date: Fri Mar  1 21:58:56 2013
    New Revision: 247586
    URL: http://svnweb.freebsd.org/changeset/base/247586
    
    Log:
      Remove unnecessary variables.
    
    Modified:
      head/sys/kern/vfs_vnops.c
    
    Modified: head/sys/kern/vfs_vnops.c
    ==============================================================================
    --- head/sys/kern/vfs_vnops.c	Fri Mar  1 21:58:51 2013	(r247585)
    +++ head/sys/kern/vfs_vnops.c	Fri Mar  1 21:58:56 2013	(r247586)
    @@ -1860,7 +1860,6 @@ vn_chmod(struct file *fp, mode_t mode, s
         struct thread *td)
     {
     	struct vnode *vp;
    -	int error;
     
     	vp = fp->f_vnode;
     #ifdef AUDIT
    @@ -1868,8 +1867,7 @@ vn_chmod(struct file *fp, mode_t mode, s
     	AUDIT_ARG_VNODE1(vp);
     	VOP_UNLOCK(vp, 0);
     #endif
    -	error = setfmode(td, active_cred, vp, mode);
    -	return (error);
    +	return (setfmode(td, active_cred, vp, mode));
     }
     
     int
    @@ -1877,7 +1875,6 @@ vn_chown(struct file *fp, uid_t uid, gid
         struct thread *td)
     {
     	struct vnode *vp;
    -	int error;
     
     	vp = fp->f_vnode;
     #ifdef AUDIT
    @@ -1885,8 +1882,7 @@ vn_chown(struct file *fp, uid_t uid, gid
     	AUDIT_ARG_VNODE1(vp);
     	VOP_UNLOCK(vp, 0);
     #endif
    -	error = setfown(td, active_cred, vp, uid, gid);
    -	return (error);
    +	return (setfown(td, active_cred, vp, uid, gid));
     }
     
     void
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 21:59:24 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 67C2BA8D;
     Fri,  1 Mar 2013 21:59:24 +0000 (UTC)
     (envelope-from andrew@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 5AFAA19A7;
     Fri,  1 Mar 2013 21:59:24 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21LxOUg007244;
     Fri, 1 Mar 2013 21:59:24 GMT (envelope-from andrew@svn.freebsd.org)
    Received: (from andrew@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21LxOgj007243;
     Fri, 1 Mar 2013 21:59:24 GMT (envelope-from andrew@svn.freebsd.org)
    Message-Id: <201303012159.r21LxOgj007243@svn.freebsd.org>
    From: Andrew Turner 
    Date: Fri, 1 Mar 2013 21:59:24 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247587 - head/sys/arm/include
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 21:59:24 -0000
    
    Author: andrew
    Date: Fri Mar  1 21:59:23 2013
    New Revision: 247587
    URL: http://svnweb.freebsd.org/changeset/base/247587
    
    Log:
      Increase the maximum text size on ARM to 64MiB. Without this clang would be
      sent a SIGABRT when it is loaded as it is too large. This is the smallest
      power of two MiB value that allows us to execute clang.
      
      While here wrap it in an #ifndef to be consistent with the other
      architectures.
      
      Submitted by:	Daisuke Aoyama 
    
    Modified:
      head/sys/arm/include/vmparam.h
    
    Modified: head/sys/arm/include/vmparam.h
    ==============================================================================
    --- head/sys/arm/include/vmparam.h	Fri Mar  1 21:58:56 2013	(r247586)
    +++ head/sys/arm/include/vmparam.h	Fri Mar  1 21:59:23 2013	(r247587)
    @@ -153,7 +153,9 @@
         VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
     #endif
     
    -#define MAXTSIZ 	(16*1024*1024)
    +#ifndef MAXTSIZ
    +#define MAXTSIZ 	(64*1024*1024)
    +#endif
     #ifndef DFLDSIZ
     #define DFLDSIZ         (128*1024*1024)
     #endif
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 22:03:33 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 4819FC38;
     Fri,  1 Mar 2013 22:03:33 +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 22C2D19C9;
     Fri,  1 Mar 2013 22:03:33 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21M3X4x009668;
     Fri, 1 Mar 2013 22:03:33 GMT (envelope-from jhb@svn.freebsd.org)
    Received: (from jhb@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21M3WU8009662;
     Fri, 1 Mar 2013 22:03:32 GMT (envelope-from jhb@svn.freebsd.org)
    Message-Id: <201303012203.r21M3WU8009662@svn.freebsd.org>
    From: John Baldwin 
    Date: Fri, 1 Mar 2013 22:03:32 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247588 - in head/sys: dev/mps kern sys
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 22:03:33 -0000
    
    Author: jhb
    Date: Fri Mar  1 22:03:31 2013
    New Revision: 247588
    URL: http://svnweb.freebsd.org/changeset/base/247588
    
    Log:
      Replace the TDP_NOSLEEPING flag with a counter so that the
      THREAD_NO_SLEEPING() and THREAD_SLEEPING_OK() macros can nest.
      
      Reviewed by:	attilio
    
    Modified:
      head/sys/dev/mps/mps.c
      head/sys/kern/subr_sleepqueue.c
      head/sys/kern/subr_trap.c
      head/sys/sys/proc.h
      head/sys/sys/rmlock.h
    
    Modified: head/sys/dev/mps/mps.c
    ==============================================================================
    --- head/sys/dev/mps/mps.c	Fri Mar  1 21:59:23 2013	(r247587)
    +++ head/sys/dev/mps/mps.c	Fri Mar  1 22:03:31 2013	(r247588)
    @@ -136,8 +136,8 @@ mps_diag_reset(struct mps_softc *sc,int 
     
     	/*Force NO_SLEEP for threads prohibited to sleep
      	* e.a Thread from interrupt handler are prohibited to sleep.
    - 	*/	
    -	if(curthread->td_pflags & TDP_NOSLEEPING)
    + 	*/
    +	if (curthread->td_no_sleeping != 0)
     		sleep_flag = NO_SLEEP;
      
     	/* Push the magic sequence */
    @@ -469,8 +469,8 @@ mps_request_sync(struct mps_softc *sc, v
     	uint16_t *data16;
     	int i, count, ioc_sz, residual;
     	int sleep_flags = CAN_SLEEP;
    -	
    -	if(curthread->td_pflags & TDP_NOSLEEPING)
    +
    +	if (curthread->td_no_sleeping != 0)
     		sleep_flags = NO_SLEEP;
     
     	/* Step 1 */
    
    Modified: head/sys/kern/subr_sleepqueue.c
    ==============================================================================
    --- head/sys/kern/subr_sleepqueue.c	Fri Mar  1 21:59:23 2013	(r247587)
    +++ head/sys/kern/subr_sleepqueue.c	Fri Mar  1 22:03:31 2013	(r247588)
    @@ -296,8 +296,8 @@ sleepq_add(void *wchan, struct lock_obje
     	MPASS((queue >= 0) && (queue < NR_SLEEPQS));
     
     	/* If this thread is not allowed to sleep, die a horrible death. */
    -	KASSERT(!(td->td_pflags & TDP_NOSLEEPING),
    -	    ("%s: td %p to sleep on wchan %p with TDP_NOSLEEPING on",
    +	KASSERT(td->td_no_sleeping == 0,
    +	    ("%s: td %p to sleep on wchan %p with sleeping prohibited",
     	    __func__, td, wchan));
     
     	/* Look up the sleep queue associated with the wait channel 'wchan'. */
    
    Modified: head/sys/kern/subr_trap.c
    ==============================================================================
    --- head/sys/kern/subr_trap.c	Fri Mar  1 21:59:23 2013	(r247587)
    +++ head/sys/kern/subr_trap.c	Fri Mar  1 22:03:31 2013	(r247588)
    @@ -158,7 +158,7 @@ userret(struct thread *td, struct trapfr
     	    ("userret: Returning with %d locks held", td->td_locks));
     	KASSERT((td->td_pflags & TDP_NOFAULTING) == 0,
     	    ("userret: Returning with pagefaults disabled"));
    -	KASSERT((td->td_pflags & TDP_NOSLEEPING) == 0,
    +	KASSERT(td->td_no_sleeping == 0,
     	    ("userret: Returning with sleep disabled"));
     	KASSERT(td->td_pinned == 0 || (td->td_pflags & TDP_CALLCHAIN) != 0,
     	    ("userret: Returning with with pinned thread"));
    
    Modified: head/sys/sys/proc.h
    ==============================================================================
    --- head/sys/sys/proc.h	Fri Mar  1 21:59:23 2013	(r247587)
    +++ head/sys/sys/proc.h	Fri Mar  1 22:03:31 2013	(r247588)
    @@ -273,6 +273,7 @@ struct thread {
     	struct vm_map_entry *td_map_def_user; /* (k) Deferred entries. */
     	pid_t		td_dbg_forked;	/* (c) Child pid for debugger. */
     	u_int		td_vp_reserv;	/* (k) Count of reserved vnodes. */
    +	int		td_no_sleeping;	/* (k) Sleeping disabled count. */
     #define	td_endzero td_sigmask
     
     /* Copied during fork1() or create_thread(). */
    @@ -404,7 +405,7 @@ do {									\
     #define	TDP_ALTSTACK	0x00000020 /* Have alternate signal stack. */
     #define	TDP_DEADLKTREAT	0x00000040 /* Lock aquisition - deadlock treatment. */
     #define	TDP_NOFAULTING	0x00000080 /* Do not handle page faults. */
    -#define	TDP_NOSLEEPING	0x00000100 /* Thread is not allowed to sleep on a sq. */
    +#define	TDP_UNUSED9	0x00000100 /* --available-- */
     #define	TDP_OWEUPC	0x00000200 /* Call addupc() at next AST. */
     #define	TDP_ITHREAD	0x00000400 /* Thread is an interrupt thread. */
     #define	TDP_SYNCIO	0x00000800 /* Local override, disable async i/o. */
    @@ -790,17 +791,9 @@ extern pid_t pid_max;
     #define	thread_safetoswapout(td)	((td)->td_flags & TDF_CANSWAP)
     
     /* Control whether or not it is safe for curthread to sleep. */
    -#define	THREAD_NO_SLEEPING() do {					\
    -	KASSERT(!(curthread->td_pflags & TDP_NOSLEEPING),		\
    -	    ("nested no sleeping"));					\
    -	curthread->td_pflags |= TDP_NOSLEEPING;				\
    -} while (0)
    +#define	THREAD_NO_SLEEPING()		((curthread)->td_no_sleeping++)
     
    -#define	THREAD_SLEEPING_OK() do {					\
    -	KASSERT((curthread->td_pflags & TDP_NOSLEEPING),		\
    -	    ("nested sleeping ok"));					\
    -	curthread->td_pflags &= ~TDP_NOSLEEPING;			\
    -} while (0)
    +#define	THREAD_SLEEPING_OK()		((curthread)->td_no_sleeping--)
     
     #define	PIDHASH(pid)	(&pidhashtbl[(pid) & pidhash])
     extern LIST_HEAD(pidhashhead, proc) *pidhashtbl;
    
    Modified: head/sys/sys/rmlock.h
    ==============================================================================
    --- head/sys/sys/rmlock.h	Fri Mar  1 21:59:23 2013	(r247587)
    +++ head/sys/sys/rmlock.h	Fri Mar  1 22:03:31 2013	(r247588)
    @@ -40,7 +40,7 @@
     #ifdef _KERNEL
     
     /*
    - * Flags passed to rm_init(9).
    + * Flags passed to rm_init_flags(9).
      */
     #define	RM_NOWITNESS	0x00000001
     #define	RM_RECURSE	0x00000002
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 22:03:58 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 05C92DB2;
     Fri,  1 Mar 2013 22:03:58 +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 EC35E19D0;
     Fri,  1 Mar 2013 22:03:57 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21M3vnl009791;
     Fri, 1 Mar 2013 22:03:57 GMT (envelope-from pfg@svn.freebsd.org)
    Received: (from pfg@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21M3vRA009788;
     Fri, 1 Mar 2013 22:03:57 GMT (envelope-from pfg@svn.freebsd.org)
    Message-Id: <201303012203.r21M3vRA009788@svn.freebsd.org>
    From: "Pedro F. Giffuni" 
    Date: Fri, 1 Mar 2013 22:03: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: r247589 - in stable/9/sys: fs/ext2fs ufs/ufs
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 22:03:58 -0000
    
    Author: pfg
    Date: Fri Mar  1 22:03:57 2013
    New Revision: 247589
    URL: http://svnweb.freebsd.org/changeset/base/247589
    
    Log:
      MFC	r246562:
      
      Remove unused MAXSYMLINKLEN macro.
      
      Reviewed by:	mckusick
      PR:		kern/175794
    
    Modified:
      stable/9/sys/fs/ext2fs/inode.h
      stable/9/sys/ufs/ufs/inode.h
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/fs/   (props changed)
    
    Modified: stable/9/sys/fs/ext2fs/inode.h
    ==============================================================================
    --- stable/9/sys/fs/ext2fs/inode.h	Fri Mar  1 22:03:31 2013	(r247588)
    +++ stable/9/sys/fs/ext2fs/inode.h	Fri Mar  1 22:03:57 2013	(r247589)
    @@ -108,7 +108,6 @@ struct inode {
      */
     #define	i_shortlink	i_db
     #define	i_rdev		i_db[0]
    -#define	MAXSYMLINKLEN	((NDADDR + NIADDR) * sizeof(int32_t))
     
     /* File permissions. */
     #define	IEXEC		0000100		/* Executable. */
    
    Modified: stable/9/sys/ufs/ufs/inode.h
    ==============================================================================
    --- stable/9/sys/ufs/ufs/inode.h	Fri Mar  1 22:03:31 2013	(r247588)
    +++ stable/9/sys/ufs/ufs/inode.h	Fri Mar  1 22:03:57 2013	(r247589)
    @@ -151,10 +151,6 @@ struct inode {
     		(ip)->i_din2->d##field = (val); \
     	} while (0)
     
    -#define	MAXSYMLINKLEN(ip) \
    -	((ip)->i_ump->um_fstype == UFS1) ? \
    -	((NDADDR + NIADDR) * sizeof(ufs1_daddr_t)) : \
    -	((NDADDR + NIADDR) * sizeof(ufs2_daddr_t))
     #define	SHORTLINK(ip) \
     	(((ip)->i_ump->um_fstype == UFS1) ? \
     	(caddr_t)(ip)->i_din1->di_db : (caddr_t)(ip)->i_din2->di_db)
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 22:05:21 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id A8166F2C;
     Fri,  1 Mar 2013 22:05:21 +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 82F0B19DD;
     Fri,  1 Mar 2013 22:05:21 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21M5L7V010104;
     Fri, 1 Mar 2013 22:05:21 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21M5L6Y010103;
     Fri, 1 Mar 2013 22:05:21 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303012205.r21M5L6Y010103@svn.freebsd.org>
    From: Marius Strobl 
    Date: Fri, 1 Mar 2013 22:05:21 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247590 - head/sys/dev/bce
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 22:05:21 -0000
    
    Author: marius
    Date: Fri Mar  1 22:05:20 2013
    New Revision: 247590
    URL: http://svnweb.freebsd.org/changeset/base/247590
    
    Log:
      Initialize count in order to appease clang.
      
      Submitted by:	delphij
    
    Modified:
      head/sys/dev/bce/if_bce.c
    
    Modified: head/sys/dev/bce/if_bce.c
    ==============================================================================
    --- head/sys/dev/bce/if_bce.c	Fri Mar  1 22:03:57 2013	(r247589)
    +++ head/sys/dev/bce/if_bce.c	Fri Mar  1 22:05:20 2013	(r247590)
    @@ -1076,6 +1076,7 @@ bce_attach(device_t dev)
     	bce_probe_pci_caps(dev, sc);
     
     	rid = 1;
    +	count = 0;
     #if 0
     	/* Try allocating MSI-X interrupts. */
     	if ((sc->bce_cap_flags & BCE_MSIX_CAPABLE_FLAG) &&
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 22:09:08 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id D4C1E150;
     Fri,  1 Mar 2013 22:09:08 +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 C36B719F4;
     Fri,  1 Mar 2013 22:09:08 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21M98fm010789;
     Fri, 1 Mar 2013 22:09:08 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21M98S4010788;
     Fri, 1 Mar 2013 22:09:08 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303012209.r21M98S4010788@svn.freebsd.org>
    From: Marius Strobl 
    Date: Fri, 1 Mar 2013 22:09:08 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247591 - head/sys/dev/aac
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 22:09:08 -0000
    
    Author: marius
    Date: Fri Mar  1 22:09:08 2013
    New Revision: 247591
    URL: http://svnweb.freebsd.org/changeset/base/247591
    
    Log:
      Initialize count in order to appease clang.
      
      Submitted by:	delphij
    
    Modified:
      head/sys/dev/aac/aac_pci.c
    
    Modified: head/sys/dev/aac/aac_pci.c
    ==============================================================================
    --- head/sys/dev/aac/aac_pci.c	Fri Mar  1 22:05:20 2013	(r247590)
    +++ head/sys/dev/aac/aac_pci.c	Fri Mar  1 22:09:08 2013	(r247591)
    @@ -394,6 +394,7 @@ aac_pci_attach(device_t dev)
     	 * Allocate the interrupt.
     	 */
     	rid = 0;
    +	count = 0;
     	if (aac_enable_msi != 0 && pci_find_cap(dev, PCIY_MSI, ®) == 0) {
     		count = pci_msi_count(dev);
     		if (count > 1)
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 22:20:14 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 74444397;
     Fri,  1 Mar 2013 22:20: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 5D2E41A3E;
     Fri,  1 Mar 2013 22:20:14 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21MKEbT014258;
     Fri, 1 Mar 2013 22:20:14 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21MKEWl014257;
     Fri, 1 Mar 2013 22:20:14 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201303012220.r21MKEWl014257@svn.freebsd.org>
    From: Xin LI 
    Date: Fri, 1 Mar 2013 22:20:13 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247592 -
     head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 22:20:14 -0000
    
    Author: delphij
    Date: Fri Mar  1 22:20:13 2013
    New Revision: 247592
    URL: http://svnweb.freebsd.org/changeset/base/247592
    
    Log:
      MFV r247575:
      
      Import a fix tighten assertion on SPA versions from vendor (Illumos).
      
      Illumos ZFS issue:
      
        3543 Feature flags causes assertion in spa.c to miss certain cases
      
      MFC after:	2 weeks
    
    Modified:
      head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
    Directory Properties:
      head/sys/cddl/contrib/opensolaris/   (props changed)
    
    Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
    ==============================================================================
    --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Fri Mar  1 22:09:08 2013	(r247591)
    +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Fri Mar  1 22:20:13 2013	(r247592)
    @@ -6018,7 +6018,7 @@ spa_sync_version(void *arg1, void *arg2,
     	 */
     	ASSERT(tx->tx_txg != TXG_INITIAL);
     
    -	ASSERT(version <= SPA_VERSION);
    +	ASSERT(SPA_VERSION_IS_SUPPORTED(version));
     	ASSERT(version >= spa_version(spa));
     
     	spa->spa_uberblock.ub_version = version;
    @@ -6559,7 +6559,7 @@ spa_upgrade(spa_t *spa, uint64_t version
     	 * future version would result in an unopenable pool, this shouldn't be
     	 * possible.
     	 */
    -	ASSERT(spa->spa_uberblock.ub_version <= SPA_VERSION);
    +	ASSERT(SPA_VERSION_IS_SUPPORTED(spa->spa_uberblock.ub_version));
     	ASSERT(version >= spa->spa_uberblock.ub_version);
     
     	spa->spa_uberblock.ub_version = version;
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 23:10:00 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id D71AA3A5;
     Fri,  1 Mar 2013 23:10:00 +0000 (UTC)
     (envelope-from asmrookie@gmail.com)
    Received: from mail-ie0-x229.google.com (mail-ie0-x229.google.com
     [IPv6:2607:f8b0:4001:c03::229])
     by mx1.freebsd.org (Postfix) with ESMTP id 900CB1C05;
     Fri,  1 Mar 2013 23:10:00 +0000 (UTC)
    Received: by mail-ie0-f169.google.com with SMTP id 13so4295422iea.0
     for ; Fri, 01 Mar 2013 15:10:00 -0800 (PST)
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
     h=mime-version:x-received:reply-to:sender:in-reply-to:references:date
     :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
     bh=mJrTczQxM0XIjOCVC/F6aKZff1EDdDin3ir/qI7CWsg=;
     b=JJj7B73Qvl9YnTt7fxCXEPgH0bxiwpd3xb6k67uGPugzJwOuuGs6sNPjRL2U6upevT
     w4Do2yzIJAAQ1VQLpNy9hI+7p2I+6pWB1aqwaOnb1sD0y4b3hjOQdMNQMGgL4O+1JzpV
     SdN8dwR+0szt64wcWpHtL41KbGmUVhlF9rGxFB9sROJdfE63YKxKSlS3WWvCqTW9jDr3
     WyS8rYNccdU6/ZRCYgxdCEpNmUciZ/w6AHi5gUPYAK2460DqIOAgYebNTNLov84aqyMk
     kGtAOs5u6WbWR772yv96vehdO1emhywm/GS+18F5JD9d9nzEGfc1S0punaDLxhbZ237c
     usCg==
    MIME-Version: 1.0
    X-Received: by 10.42.54.5 with SMTP id p5mr8469565icg.49.1362179400090; Fri,
     01 Mar 2013 15:10:00 -0800 (PST)
    Sender: asmrookie@gmail.com
    Received: by 10.42.117.134 with HTTP; Fri, 1 Mar 2013 15:09:59 -0800 (PST)
    In-Reply-To: <201303012203.r21M3WU8009662@svn.freebsd.org>
    References: <201303012203.r21M3WU8009662@svn.freebsd.org>
    Date: Sat, 2 Mar 2013 00:09:59 +0100
    X-Google-Sender-Auth: tiQbcJt0lrO7FbE-QsUaXLJzNLs
    Message-ID: 
    Subject: Re: svn commit: r247588 - in head/sys: dev/mps kern sys
    From: Attilio Rao 
    To: John Baldwin 
    Content-Type: text/plain; charset=UTF-8
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    Reply-To: attilio@FreeBSD.org
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 23:10:00 -0000
    
    On Fri, Mar 1, 2013 at 11:03 PM, John Baldwin  wrote:
    > Author: jhb
    > Date: Fri Mar  1 22:03:31 2013
    > New Revision: 247588
    > URL: http://svnweb.freebsd.org/changeset/base/247588
    >
    > Log:
    >   Replace the TDP_NOSLEEPING flag with a counter so that the
    >   THREAD_NO_SLEEPING() and THREAD_SLEEPING_OK() macros can nest.
    >
    >   Reviewed by:  attilio
    
    My cleanup had some small tweaks like:
    - No trailing white space cleanup in mps
    - td_no_sleeping u_int rather than int
    - s/TDP_UNUSED9/TDP_UNUSED09 (consistency with others definitions)
    - There is no need to use braces around curthread
    
    Also the rmlock part doesn't belong to this patchset.
    
    http://www.freebsd.org/~attilio/jhbnosleep.patch
    
    Attilio
    
    
    -- 
    Peace can only be achieved by understanding - A. Einstein
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 23:18:20 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id CCEB868D;
     Fri,  1 Mar 2013 23:18:20 +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 BD0E01C3B;
     Fri,  1 Mar 2013 23:18:20 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21NIKcH032715;
     Fri, 1 Mar 2013 23:18:20 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21NIKw8032714;
     Fri, 1 Mar 2013 23:18:20 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201303012318.r21NIKw8032714@svn.freebsd.org>
    From: Xin LI 
    Date: Fri, 1 Mar 2013 23:18:20 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247594 - head/sys/dev/mfi
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 23:18:20 -0000
    
    Author: delphij
    Date: Fri Mar  1 23:18:20 2013
    New Revision: 247594
    URL: http://svnweb.freebsd.org/changeset/base/247594
    
    Log:
      Fix a typo in mfi_stp_cmd() that would give wrong assignment.
      
      Submitted by:	Sascha Wildner 
      Obtained from:	DragonFly rev 0dc98fff2206d7bb78ce5e07ac34d6954e4bd96a
      MFC after:	3 days
    
    Modified:
      head/sys/dev/mfi/mfi.c
    
    Modified: head/sys/dev/mfi/mfi.c
    ==============================================================================
    --- head/sys/dev/mfi/mfi.c	Fri Mar  1 22:40:30 2013	(r247593)
    +++ head/sys/dev/mfi/mfi.c	Fri Mar  1 23:18:20 2013	(r247594)
    @@ -2997,7 +2997,7 @@ mfi_stp_cmd(struct mfi_softc *sc, struct
     			cm->cm_frame->stp.sgl.sg64[i].len =
     			    ioc->mfi_sgl[i].iov_len;
     		} else {
    -			cm->cm_frame->stp.sgl.sg32[i].len =
    +			cm->cm_frame->stp.sgl.sg32[i].addr =
     			    kern_sge[i].phys_addr;
     			cm->cm_frame->stp.sgl.sg32[i].len =
     			    ioc->mfi_sgl[i].iov_len;
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 23:21:19 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id C3956855;
     Fri,  1 Mar 2013 23:21:19 +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 AC54A1C5B;
     Fri,  1 Mar 2013 23:21:19 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21NLJk5034725;
     Fri, 1 Mar 2013 23:21:19 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21NLJtU034724;
     Fri, 1 Mar 2013 23:21:19 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201303012321.r21NLJtU034724@svn.freebsd.org>
    From: Xin LI 
    Date: Fri, 1 Mar 2013 23:21:19 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247595 - head/sys/compat/ndis
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 23:21:19 -0000
    
    Author: delphij
    Date: Fri Mar  1 23:21:18 2013
    New Revision: 247595
    URL: http://svnweb.freebsd.org/changeset/base/247595
    
    Log:
      Fix wrong assignment.
      
      Submitted by:	Sascha Wildner 
      Obtained from:	DragonFly rev 9568dd07a22a136e380e6c19a8ea188eb92976d5
      MFC after:	2 weeks
    
    Modified:
      head/sys/compat/ndis/kern_ndis.c
    
    Modified: head/sys/compat/ndis/kern_ndis.c
    ==============================================================================
    --- head/sys/compat/ndis/kern_ndis.c	Fri Mar  1 23:18:20 2013	(r247594)
    +++ head/sys/compat/ndis/kern_ndis.c	Fri Mar  1 23:21:18 2013	(r247595)
    @@ -566,7 +566,7 @@ ndis_convert_res(arg)
     		return (ENOMEM);
     
     	rl->cprl_version = 5;
    -	rl->cprl_version = 1;
    +	rl->cprl_revision = 1;
     	rl->cprl_count = sc->ndis_rescnt;
     	prd = rl->cprl_partial_descs;
     
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 23:24:26 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 490809E9;
     Fri,  1 Mar 2013 23:24:26 +0000 (UTC) (envelope-from grog@lemis.com)
    Received: from w3.lemis.com (w3.lemis.com [208.86.224.149])
     by mx1.freebsd.org (Postfix) with ESMTP id F1DBF1C72;
     Fri,  1 Mar 2013 23:24:25 +0000 (UTC)
    Received: from eureka.lemis.com (1032.x.rootbsd.net [208.86.224.149])
     by w3.lemis.com (Postfix) with ESMTP id 369DD3B952;
     Fri,  1 Mar 2013 23:24:18 +0000 (UTC)
    Received: by eureka.lemis.com (Postfix, from userid 1004)
     id 6058DF74FA; Sat,  2 Mar 2013 10:24:14 +1100 (EST)
    Date: Sat, 2 Mar 2013 10:24:14 +1100
    From: Greg 'groggy' Lehey 
    To: Chris Rees 
    Subject: Re: svn commit: r247274 - in head: bin/test tools/regression/bin/test
    Message-ID: <20130301232414.GO7223@eureka.lemis.com>
    References: <201302251905.r1PJ5fKF085179@svn.freebsd.org>
     <20130226000227.GA80718@stack.nl>
     <20130227082548.GF99210@server.rulingia.com>
     <20130301142633.GA49921@stack.nl>
     
    Mime-Version: 1.0
    Content-Type: multipart/signed; micalg=pgp-sha1;
     protocol="application/pgp-signature"; boundary="8RsyD0KswhpoK73Z"
    Content-Disposition: inline
    In-Reply-To: 
    User-Agent: Mutt/1.4.2.3i
    Organization: The FreeBSD Project
    Phone: +61-3-5346-1370
    Mobile: +61-418-838-708
    WWW-Home-Page: http://www.FreeBSD.org/
    X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F  09AC 22E6 F290 507A 4223
    Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
     src-committers@freebsd.org, Peter Jeremy ,
     Jilles Tjoelker 
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 23:24:26 -0000
    
    
    --8RsyD0KswhpoK73Z
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    
    On Friday,  1 March 2013 at 17:13:45 +0000, Chris Rees wrote:
    > On 1 Mar 2013 14:27, "Jilles Tjoelker"  wrote:
    >> The find(1) and stat(1) approaches also work in other shells such as
    >> bash, ksh and zsh. An extension to test(1) can only be used by writing
    >> ugly things like /bin/test. Whatever you may think of it, people write
    >> scripts for those other shells and it is somewhat unfortunate that they
    >> cannot use all FreeBSD-specific features.
    >
    > +1
    >
    > While I'm aware that we have many very useful extensions to sh, we
    > should not sacrifice portability.
    
    This doesn't sacrifice portability.  If you're aiming for complete
    portability, you may choose not to use these extensions, or to find
    alternatives for non-FreeBSD systems.  This goes for just about every
    utility.
    
    > We (porters) are on thin ground when complaining at upstream for
    > assuming /bin/sh is bash when we have extensions such as these.
    
    There's a difference between having extensions and expecting them to
    be present everywhere.  But you have a point: it should be documented
    that these extensions (and also <, >, -nt, -ot and -ef) are not
    portable.
    
    Greg
    --
    Sent from my desktop computer.
    Finger grog@FreeBSD.org for PGP public key.
    See complete headers for address and phone numbers.
    This message is digitally signed.  If your Microsoft MUA reports
    problems, please read http://tinyurl.com/broken-mua
    
    --8RsyD0KswhpoK73Z
    Content-Type: application/pgp-signature
    Content-Disposition: inline
    
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.19 (FreeBSD)
    
    iEYEARECAAYFAlExOJ0ACgkQIubykFB6QiMy6ACdGQB9OTQRtNA5oxWcQeTBV4RP
    WHIAnjjthY1lzHsSlbmADE1qfG09LID7
    =x2mO
    -----END PGP SIGNATURE-----
    
    --8RsyD0KswhpoK73Z--
    
    From owner-svn-src-all@FreeBSD.ORG  Fri Mar  1 23:26:13 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id D9483B8C;
     Fri,  1 Mar 2013 23:26:13 +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 C14AD1C8A;
     Fri,  1 Mar 2013 23:26:13 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r21NQD8m035440;
     Fri, 1 Mar 2013 23:26:13 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r21NQDFT035439;
     Fri, 1 Mar 2013 23:26:13 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201303012326.r21NQDFT035439@svn.freebsd.org>
    From: Xin LI 
    Date: Fri, 1 Mar 2013 23:26:13 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247596 - head/lib/libc/regex
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Fri, 01 Mar 2013 23:26:13 -0000
    
    Author: delphij
    Date: Fri Mar  1 23:26:13 2013
    New Revision: 247596
    URL: http://svnweb.freebsd.org/changeset/base/247596
    
    Log:
      Fix assignment of maximum bounadary.
      
      Submitted by:	Sascha Wildner 
      Obtained from:	DragonFly rev fd39c81ba220f7ad6e4dc9b30d45e828cf58a1ad
      MFC after:	2 weeks
    
    Modified:
      head/lib/libc/regex/regcomp.c
    
    Modified: head/lib/libc/regex/regcomp.c
    ==============================================================================
    --- head/lib/libc/regex/regcomp.c	Fri Mar  1 23:21:18 2013	(r247595)
    +++ head/lib/libc/regex/regcomp.c	Fri Mar  1 23:26:13 2013	(r247596)
    @@ -1212,7 +1212,7 @@ CHaddrange(struct parse *p, cset *cs, wi
     	}
     	cs->ranges = newranges;
     	cs->ranges[cs->nranges].min = min;
    -	cs->ranges[cs->nranges].min = max;
    +	cs->ranges[cs->nranges].max = max;
     	cs->nranges++;
     }
     
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 00:11:28 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 8DB8B4F4;
     Sat,  2 Mar 2013 00:11:28 +0000 (UTC) (envelope-from pjd@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 748FF1DFC;
     Sat,  2 Mar 2013 00:11:28 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r220BSYv050400;
     Sat, 2 Mar 2013 00:11:28 GMT (envelope-from pjd@svn.freebsd.org)
    Received: (from pjd@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r220BRPg050395;
     Sat, 2 Mar 2013 00:11:27 GMT (envelope-from pjd@svn.freebsd.org)
    Message-Id: <201303020011.r220BRPg050395@svn.freebsd.org>
    From: Pawel Jakub Dawidek 
    Date: Sat, 2 Mar 2013 00:11:27 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247598 - in head/lib/libc: gen sys
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 00:11:28 -0000
    
    Author: pjd
    Date: Sat Mar  2 00:11:27 2013
    New Revision: 247598
    URL: http://svnweb.freebsd.org/changeset/base/247598
    
    Log:
      Provide cap_sandboxed(3) function, which is a wrapper around cap_getmode(2)
      system call, which has a nice property - it never fails, so it is a bit
      easier to use. If there is no support for capability mode in the kernel
      the function will return false (not in a sandbox). If the kernel is compiled
      with the support for capability mode, the function will return true or false
      depending if the calling process is in the capability mode sandbox or not
      respectively.
      
      Sponsored by:	The FreeBSD Foundation
    
    Added:
      head/lib/libc/gen/cap_sandboxed.3   (contents, props changed)
      head/lib/libc/gen/cap_sandboxed.c   (contents, props changed)
    Modified:
      head/lib/libc/gen/Makefile.inc
      head/lib/libc/sys/Symbol.map
      head/lib/libc/sys/cap_enter.2
    
    Modified: head/lib/libc/gen/Makefile.inc
    ==============================================================================
    --- head/lib/libc/gen/Makefile.inc	Sat Mar  2 00:04:07 2013	(r247597)
    +++ head/lib/libc/gen/Makefile.inc	Sat Mar  2 00:11:27 2013	(r247598)
    @@ -16,6 +16,7 @@ SRCS+=	__getosreldate.c \
     	assert.c \
     	auxv.c \
     	basename.c \
    +	cap_sandboxed.c \
     	check_utility_compat.c \
     	clock.c \
     	clock_getcpuclockid.c \
    @@ -168,6 +169,7 @@ SYM_MAPS+=${.CURDIR}/gen/Symbol.map
     MAN+=	alarm.3 \
     	arc4random.3 \
     	basename.3 \
    +	cap_sandboxed.3 \
     	check_utility_compat.3 \
     	clock.3 \
     	clock_getcpuclockid.3 \
    
    Added: head/lib/libc/gen/cap_sandboxed.3
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/lib/libc/gen/cap_sandboxed.3	Sat Mar  2 00:11:27 2013	(r247598)
    @@ -0,0 +1,70 @@
    +.\" Copyright (c) 2012 The FreeBSD Foundation
    +.\" All rights reserved.
    +.\"
    +.\" This documentation was written by Pawel Jakub Dawidek under sponsorship
    +.\" from the FreeBSD Foundation.
    +.\"
    +.\" Redistribution and use in source and binary forms, with or without
    +.\" modification, are permitted provided that the following conditions
    +.\" are met:
    +.\" 1. Redistributions of source code must retain the above copyright
    +.\"    notice, this list of conditions and the following disclaimer.
    +.\" 2. Redistributions in binary form must reproduce the above copyright
    +.\"    notice, this list of conditions and the following disclaimer in the
    +.\"    documentation and/or other materials provided with the distribution.
    +.\"
    +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
    +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    +.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
    +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    +.\" SUCH DAMAGE.
    +.\"
    +.\" $FreeBSD$
    +.\"
    +.Dd September 18, 2012
    +.Dt CAP_SANDBOXED 3
    +.Os
    +.Sh NAME
    +.Nm cap_sandboxed
    +.Nd Check if in a capability mode sandbox
    +.Sh LIBRARY
    +.Lb libc
    +.Sh SYNOPSIS
    +.In sys/capability.h
    +.In stdbool.h
    +.Ft bool
    +.Fn cap_sandboxed "void"
    +.Sh DESCRIPTION
    +.Fn cap_sandboxed
    +returns
    +.Va true
    +if the process is in a capability mode sandbox or
    +.Va false
    +if it is not.
    +This function is a more handy alternative to the
    +.Xr cap_getmode 2
    +system call as it always succeeds, so there is no need for error checking.
    +If the support for capability mode is not compiled into the kernel,
    +.Fn cap_sandboxed
    +will always return
    +.Va false .
    +.Sh RETURN VALUES
    +Function
    +.Fn cap_sandboxed
    +is always successful and will return either
    +.Va true
    +or
    +.Va false .
    +.Sh SEE ALSO
    +.Xr cap_enter 2 ,
    +.Xr capsicum 4
    +.Sh AUTHORS
    +This function was implemented and manual page was written by
    +.An Pawel Jakub Dawidek Aq pawel@dawidek.net
    +under sponsorship of the FreeBSD Foundation.
    
    Added: head/lib/libc/gen/cap_sandboxed.c
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/lib/libc/gen/cap_sandboxed.c	Sat Mar  2 00:11:27 2013	(r247598)
    @@ -0,0 +1,50 @@
    +/*-
    + * Copyright (c) 2012 The FreeBSD Foundation
    + * All rights reserved.
    + *
    + * This software was developed by Pawel Jakub Dawidek under sponsorship from
    + * the FreeBSD Foundation.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in the
    + *    documentation and/or other materials provided with the distribution.
    + *
    + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
    + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
    + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + */
    +
    +#include 
    +__FBSDID("$FreeBSD$");
    +
    +#include 
    +
    +#include 
    +#include 
    +#include 
    +
    +bool
    +cap_sandboxed(void)
    +{
    +	u_int mode;
    +
    +	if (cap_getmode(&mode) != 0) {
    +		assert(errno == ENOSYS);
    +		return (false);
    +	}
    +	assert(mode == 0 || mode == 1);
    +	return (mode == 1);
    +}
    
    Modified: head/lib/libc/sys/Symbol.map
    ==============================================================================
    --- head/lib/libc/sys/Symbol.map	Sat Mar  2 00:04:07 2013	(r247597)
    +++ head/lib/libc/sys/Symbol.map	Sat Mar  2 00:11:27 2013	(r247598)
    @@ -379,6 +379,7 @@ FBSD_1.2 {
     };
     
     FBSD_1.3 {
    +	cap_sandboxed;
     	clock_getcpuclockid2;
     	ffclock_getcounter;
     	ffclock_getestimate;
    
    Modified: head/lib/libc/sys/cap_enter.2
    ==============================================================================
    --- head/lib/libc/sys/cap_enter.2	Sat Mar  2 00:04:07 2013	(r247597)
    +++ head/lib/libc/sys/cap_enter.2	Sat Mar  2 00:11:27 2013	(r247598)
    @@ -90,6 +90,7 @@ acquired rights as possible.
     .Sh SEE ALSO
     .Xr cap_new 2 ,
     .Xr fexecve 2 ,
    +.Xr cap_sandboxed 3 ,
     .Xr capsicum 4
     .Sh HISTORY
     Support for capabilities and capabilities mode was developed as part of the
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 00:37:32 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id BD9DE9F1;
     Sat,  2 Mar 2013 00:37:32 +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 AFB331EC0;
     Sat,  2 Mar 2013 00:37:32 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r220bWta057331;
     Sat, 2 Mar 2013 00:37:32 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r220bWJg057328;
     Sat, 2 Mar 2013 00:37:32 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303020037.r220bWJg057328@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 00:37:32 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247600 - in head/sys: conf sparc64/pci
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 00:37:32 -0000
    
    Author: marius
    Date: Sat Mar  2 00:37:31 2013
    New Revision: 247600
    URL: http://svnweb.freebsd.org/changeset/base/247600
    
    Log:
      - While Netra X1 generally show no ill effects when registering a power
        fail interrupt handler, there seems to be either a broken batch of them
        or a tendency to develop a defect which causes this interrupt to fire
        inadvertedly. Given that apart from this problem these machines work
        just fine, add a tunable allowing the setup of the power fail interrupt
        to be disabled.
        While at it, remove the DEBUGGER_ON_POWERFAIL compile time option and
        make that behavior also selectable via the newly added tunable.
      - Apparently, it's no longer a problem to call shutdown_nice(9) from within
        an interrupt filter (some other drivers in the tree do the same). So
        change the power fail interrupt from an handler in order to simplify the
        code and get rid of a !INTR_MPSAFE handler.
      - Use NULL instead of 0 for pointers.
      
      MFC after:	1 week
    
    Modified:
      head/sys/conf/options.sparc64
      head/sys/sparc64/pci/psycho.c
    
    Modified: head/sys/conf/options.sparc64
    ==============================================================================
    --- head/sys/conf/options.sparc64	Sat Mar  2 00:21:29 2013	(r247599)
    +++ head/sys/conf/options.sparc64	Sat Mar  2 00:37:31 2013	(r247600)
    @@ -23,7 +23,6 @@ PSM_DEBUG		opt_psm.h
     PSM_HOOKRESUME		opt_psm.h
     PSM_RESETAFTERSUSPEND	opt_psm.h
     
    -DEBUGGER_ON_POWERFAIL	opt_psycho.h
     PSYCHO_DEBUG		opt_psycho.h
     
     SCHIZO_DEBUG		opt_schizo.h
    
    Modified: head/sys/sparc64/pci/psycho.c
    ==============================================================================
    --- head/sys/sparc64/pci/psycho.c	Sat Mar  2 00:21:29 2013	(r247599)
    +++ head/sys/sparc64/pci/psycho.c	Sat Mar  2 00:37:31 2013	(r247600)
    @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    +#include 
     
     #include 
     #include 
    @@ -80,7 +81,7 @@ static const struct psycho_desc *psycho_
         const char *);
     static const struct psycho_desc *psycho_get_desc(device_t);
     static void psycho_set_intr(struct psycho_softc *, u_int, bus_addr_t,
    -    driver_filter_t, driver_intr_t);
    +    driver_filter_t);
     static int psycho_find_intrmap(struct psycho_softc *, u_int, bus_addr_t *,
         bus_addr_t *, u_long *);
     static void sabre_dmamap_sync(bus_dma_tag_t dt, bus_dmamap_t map,
    @@ -94,8 +95,9 @@ static void psycho_intr_clear(void *);
     static driver_filter_t psycho_ue;
     static driver_filter_t psycho_ce;
     static driver_filter_t psycho_pci_bus;
    -static driver_filter_t psycho_powerfail;
    -static driver_intr_t psycho_overtemp;
    +static driver_filter_t psycho_powerdebug;
    +static driver_filter_t psycho_powerdown;
    +static driver_filter_t psycho_overtemp;
     #ifdef PSYCHO_MAP_WAKEUP
     static driver_filter_t psycho_wakeup;
     #endif
    @@ -159,9 +161,16 @@ static devclass_t psycho_devclass;
     
     DEFINE_CLASS_0(pcib, psycho_driver, psycho_methods,
         sizeof(struct psycho_softc));
    -EARLY_DRIVER_MODULE(psycho, nexus, psycho_driver, psycho_devclass, 0, 0,
    +EARLY_DRIVER_MODULE(psycho, nexus, psycho_driver, psycho_devclass, NULL, NULL,
         BUS_PASS_BUS);
     
    +static SYSCTL_NODE(_hw, OID_AUTO, psycho, CTLFLAG_RD, 0, "psycho parameters");
    +
    +static u_int psycho_powerfail = 1;
    +TUNABLE_INT("hw.psycho.powerfail", &psycho_powerfail);
    +SYSCTL_UINT(_hw_psycho, OID_AUTO, powerfail, CTLFLAG_RDTUN, &psycho_powerfail,
    +    0, "powerfail action (0: none, 1: shutdown (default), 2: debugger)");
    +
     static SLIST_HEAD(, psycho_softc) psycho_softcs =
         SLIST_HEAD_INITIALIZER(psycho_softcs);
     
    @@ -610,15 +619,20 @@ psycho_attach(device_t dev)
     		 * XXX Not all controllers have these, but installing them
     		 * is better than trying to sort through this mess.
     		 */
    -		psycho_set_intr(sc, 1, PSR_UE_INT_MAP, psycho_ue, NULL);
    -		psycho_set_intr(sc, 2, PSR_CE_INT_MAP, psycho_ce, NULL);
    -#ifdef DEBUGGER_ON_POWERFAIL
    -		psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, psycho_powerfail,
    -		    NULL);
    -#else
    -		psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, NULL,
    -		    (driver_intr_t *)psycho_powerfail);
    -#endif
    +		psycho_set_intr(sc, 1, PSR_UE_INT_MAP, psycho_ue);
    +		psycho_set_intr(sc, 2, PSR_CE_INT_MAP, psycho_ce);
    +		switch (psycho_powerfail) {
    +		case 0:
    +			break;
    +		case 2:
    +			psycho_set_intr(sc, 3, PSR_POWER_INT_MAP,
    +			    psycho_powerdebug);
    +			break;
    +		default:
    +			psycho_set_intr(sc, 3, PSR_POWER_INT_MAP,
    +			    psycho_powerdown);
    +			break;
    +		}
     		if (sc->sc_mode == PSYCHO_MODE_PSYCHO) {
     			/*
     			 * Hummingbirds/Sabres do not have the following two
    @@ -630,14 +644,14 @@ psycho_attach(device_t dev)
     			 * over-temperature interrupt.
     			 */
     			psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP,
    -			    NULL, psycho_overtemp);
    +			    psycho_overtemp);
     #ifdef PSYCHO_MAP_WAKEUP
     			/*
     			 * psycho_wakeup() doesn't do anything useful right
     			 * now.
     			 */
     			psycho_set_intr(sc, 5, PSR_PWRMGT_INT_MAP,
    -			    psycho_wakeup, NULL);
    +			    psycho_wakeup);
     #endif /* PSYCHO_MAP_WAKEUP */
     		}
     	}
    @@ -647,7 +661,7 @@ psycho_attach(device_t dev)
     	 * interrupt but they are also only used for PCI bus A.
     	 */
     	psycho_set_intr(sc, 0, sc->sc_half == 0 ? PSR_PCIAERR_INT_MAP :
    -	    PSR_PCIBERR_INT_MAP, psycho_pci_bus, NULL);
    +	    PSR_PCIBERR_INT_MAP, psycho_pci_bus);
     
     	/*
     	 * Set the latency timer register as this isn't always done by the
    @@ -687,7 +701,7 @@ psycho_attach(device_t dev)
     
     static void
     psycho_set_intr(struct psycho_softc *sc, u_int index, bus_addr_t intrmap,
    -    driver_filter_t filt, driver_intr_t intr)
    +    driver_filter_t handler)
     {
     	u_long vec;
     	int rid;
    @@ -708,7 +722,7 @@ psycho_set_intr(struct psycho_softc *sc,
     	    INTVEC(PSYCHO_READ8(sc, intrmap)) != vec ||
     	    intr_vectors[vec].iv_ic != &psycho_ic ||
     	    bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index],
    -	    INTR_TYPE_MISC | INTR_BRIDGE, filt, intr, sc,
    +	    INTR_TYPE_MISC | INTR_BRIDGE, handler, NULL, sc,
     	    &sc->sc_ihand[index]) != 0)
     		panic("%s: failed to set up interrupt %d", __func__, index);
     }
    @@ -837,13 +851,16 @@ psycho_pci_bus(void *arg)
     }
     
     static int
    -psycho_powerfail(void *arg)
    +psycho_powerdebug(void *arg __unused)
     {
    -#ifdef DEBUGGER_ON_POWERFAIL
    -	struct psycho_softc *sc = arg;
     
     	kdb_enter(KDB_WHY_POWERFAIL, "powerfail");
    -#else
    +	return (FILTER_HANDLED);
    +}
    +
    +static int
    +psycho_powerdown(void *arg __unused)
    +{
     	static int shutdown;
     
     	/* As the interrupt is cleared we may be called multiple times. */
    @@ -851,22 +868,22 @@ psycho_powerfail(void *arg)
     		return (FILTER_HANDLED);
     	shutdown++;
     	printf("Power Failure Detected: Shutting down NOW.\n");
    -	shutdown_nice(0);
    -#endif
    +	shutdown_nice(RB_POWEROFF);
     	return (FILTER_HANDLED);
     }
     
    -static void
    -psycho_overtemp(void *arg)
    +static int
    +psycho_overtemp(void *arg __unused)
     {
     	static int shutdown;
     
     	/* As the interrupt is cleared we may be called multiple times. */
     	if (shutdown != 0)
    -		return;
    +		return (FILTER_HANDLED);
     	shutdown++;
     	printf("DANGER: OVER TEMPERATURE detected.\nShutting down NOW.\n");
     	shutdown_nice(RB_POWEROFF);
    +	return (FILTER_HANDLED);
     }
     
     #ifdef PSYCHO_MAP_WAKEUP
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 00:41:53 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 0DD86C6C;
     Sat,  2 Mar 2013 00:41: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 E9E1A1EE3;
     Sat,  2 Mar 2013 00:41:52 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r220fqwh059800;
     Sat, 2 Mar 2013 00:41:52 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r220fq5N059799;
     Sat, 2 Mar 2013 00:41:52 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303020041.r220fq5N059799@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 00:41:52 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247601 - head/sys/sparc64/sbus
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 00:41:53 -0000
    
    Author: marius
    Date: Sat Mar  2 00:41:51 2013
    New Revision: 247601
    URL: http://svnweb.freebsd.org/changeset/base/247601
    
    Log:
      - Apparently, it's no longer a problem to call shutdown_nice(9) from within
        an interrupt filter (some other drivers in the tree do the same). So
        change the overtemperature and power fail interrupts from handlers in order
        to code and get rid of a !INTR_MPSAFE handlers.
      - Mark unused parameters as such.
      - Use NULL instead of 0 for pointers.
      
      MFC after:	1 week
    
    Modified:
      head/sys/sparc64/sbus/sbus.c
    
    Modified: head/sys/sparc64/sbus/sbus.c
    ==============================================================================
    --- head/sys/sparc64/sbus/sbus.c	Sat Mar  2 00:37:31 2013	(r247600)
    +++ head/sys/sparc64/sbus/sbus.c	Sat Mar  2 00:41:51 2013	(r247601)
    @@ -152,8 +152,8 @@ static void sbus_intr_assign(void *);
     static void sbus_intr_clear(void *);
     static int sbus_find_intrmap(struct sbus_softc *, u_int, bus_addr_t *,
         bus_addr_t *);
    -static driver_intr_t sbus_overtemp;
    -static driver_intr_t sbus_pwrfail;
    +static driver_filter_t sbus_overtemp;
    +static driver_filter_t sbus_pwrfail;
     static int sbus_print_res(struct sbus_devinfo *);
     
     static device_method_t sbus_methods[] = {
    @@ -199,7 +199,7 @@ static driver_t sbus_driver = {
     
     static devclass_t sbus_devclass;
     
    -EARLY_DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, 0, 0,
    +EARLY_DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, NULL, NULL,
         BUS_PASS_BUS);
     MODULE_DEPEND(sbus, nexus, 1, 1, 1);
     MODULE_VERSION(sbus, 1);
    @@ -410,7 +410,7 @@ sbus_attach(device_t dev)
     	    INTVEC(SYSIO_READ8(sc, SBR_THERM_INT_MAP)) != vec ||
     	    intr_vectors[vec].iv_ic != &sbus_ic ||
     	    bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC | INTR_BRIDGE,
    -	    NULL, sbus_overtemp, sc, &sc->sc_ot_ihand) != 0)
    +	    sbus_overtemp, NULL, sc, &sc->sc_ot_ihand) != 0)
     		panic("%s: failed to set up temperature interrupt", __func__);
     	i = 3;
     	sc->sc_pf_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i,
    @@ -420,7 +420,7 @@ sbus_attach(device_t dev)
     	    INTVEC(SYSIO_READ8(sc, SBR_POWER_INT_MAP)) != vec ||
     	    intr_vectors[vec].iv_ic != &sbus_ic ||
     	    bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC | INTR_BRIDGE,
    -	    NULL, sbus_pwrfail, sc, &sc->sc_pf_ihand) != 0)
    +	    sbus_pwrfail, NULL, sc, &sc->sc_pf_ihand) != 0)
     		panic("%s: failed to set up power fail interrupt", __func__);
     
     	/* Initialize the counter-timer. */
    @@ -897,31 +897,33 @@ sbus_get_devinfo(device_t bus, device_t 
      * This handles the interrupt and powers off the machine.
      * The same needs to be done to PCI controller drivers.
      */
    -static void
    -sbus_overtemp(void *arg)
    +static int
    +sbus_overtemp(void *arg __unused)
     {
     	static int shutdown;
     
     	/* As the interrupt is cleared we may be called multiple times. */
     	if (shutdown != 0)
    -		return;
    +		return (FILTER_HANDLED);
     	shutdown++;
     	printf("DANGER: OVER TEMPERATURE detected\nShutting down NOW.\n");
     	shutdown_nice(RB_POWEROFF);
    +	return (FILTER_HANDLED);
     }
     
     /* Try to shut down in time in case of power failure. */
    -static void
    -sbus_pwrfail(void *arg)
    +static int
    +sbus_pwrfail(void *arg __unused)
     {
     	static int shutdown;
     
     	/* As the interrupt is cleared we may be called multiple times. */
     	if (shutdown != 0)
    -		return;
    +		return (FILTER_HANDLED);
     	shutdown++;
     	printf("Power failure detected\nShutting down NOW.\n");
    -	shutdown_nice(0);
    +	shutdown_nice(FILTER_HANDLED);
    +	return (FILTER_HANDLED);
     }
     
     static int
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 00:53:14 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id EF6687B;
     Sat,  2 Mar 2013 00:53:14 +0000 (UTC) (envelope-from pjd@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 DFB611F3C;
     Sat,  2 Mar 2013 00:53:14 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r220rEmT063453;
     Sat, 2 Mar 2013 00:53:14 GMT (envelope-from pjd@svn.freebsd.org)
    Received: (from pjd@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r220rDU7063441;
     Sat, 2 Mar 2013 00:53:13 GMT (envelope-from pjd@svn.freebsd.org)
    Message-Id: <201303020053.r220rDU7063441@svn.freebsd.org>
    From: Pawel Jakub Dawidek 
    Date: Sat, 2 Mar 2013 00:53:13 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247602 - in head: contrib/openbsm/etc lib/libc/include
     lib/libc/sys lib/libprocstat sys/bsm sys/cddl/compat/opensolaris/sys
     sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/fr...
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 00:53:15 -0000
    
    Author: pjd
    Date: Sat Mar  2 00:53:12 2013
    New Revision: 247602
    URL: http://svnweb.freebsd.org/changeset/base/247602
    
    Log:
      Merge Capsicum overhaul:
      
      - Capability is no longer separate descriptor type. Now every descriptor
        has set of its own capability rights.
      
      - The cap_new(2) system call is left, but it is no longer documented and
        should not be used in new code.
      
      - The new syscall cap_rights_limit(2) should be used instead of
        cap_new(2), which limits capability rights of the given descriptor
        without creating a new one.
      
      - The cap_getrights(2) syscall is renamed to cap_rights_get(2).
      
      - If CAP_IOCTL capability right is present we can further reduce allowed
        ioctls list with the new cap_ioctls_limit(2) syscall. List of allowed
        ioctls can be retrived with cap_ioctls_get(2) syscall.
      
      - If CAP_FCNTL capability right is present we can further reduce fcntls
        that can be used with the new cap_fcntls_limit(2) syscall and retrive
        them with cap_fcntls_get(2).
      
      - To support ioctl and fcntl white-listing the filedesc structure was
        heavly modified.
      
      - The audit subsystem, kdump and procstat tools were updated to
        recognize new syscalls.
      
      - Capability rights were revised and eventhough I tried hard to provide
        backward API and ABI compatibility there are some incompatible changes
        that are described in detail below:
      
      	CAP_CREATE old behaviour:
      	- Allow for openat(2)+O_CREAT.
      	- Allow for linkat(2).
      	- Allow for symlinkat(2).
      	CAP_CREATE new behaviour:
      	- Allow for openat(2)+O_CREAT.
      
      	Added CAP_LINKAT:
      	- Allow for linkat(2). ABI: Reuses CAP_RMDIR bit.
      	- Allow to be target for renameat(2).
      
      	Added CAP_SYMLINKAT:
      	- Allow for symlinkat(2).
      
      	Removed CAP_DELETE. Old behaviour:
      	- Allow for unlinkat(2) when removing non-directory object.
      	- Allow to be source for renameat(2).
      
      	Removed CAP_RMDIR. Old behaviour:
      	- Allow for unlinkat(2) when removing directory.
      
      	Added CAP_RENAMEAT:
      	- Required for source directory for the renameat(2) syscall.
      
      	Added CAP_UNLINKAT (effectively it replaces CAP_DELETE and CAP_RMDIR):
      	- Allow for unlinkat(2) on any object.
      	- Required if target of renameat(2) exists and will be removed by this
      	  call.
      
      	Removed CAP_MAPEXEC.
      
      	CAP_MMAP old behaviour:
      	- Allow for mmap(2) with any combination of PROT_NONE, PROT_READ and
      	  PROT_WRITE.
      	CAP_MMAP new behaviour:
      	- Allow for mmap(2)+PROT_NONE.
      
      	Added CAP_MMAP_R:
      	- Allow for mmap(PROT_READ).
      	Added CAP_MMAP_W:
      	- Allow for mmap(PROT_WRITE).
      	Added CAP_MMAP_X:
      	- Allow for mmap(PROT_EXEC).
      	Added CAP_MMAP_RW:
      	- Allow for mmap(PROT_READ | PROT_WRITE).
      	Added CAP_MMAP_RX:
      	- Allow for mmap(PROT_READ | PROT_EXEC).
      	Added CAP_MMAP_WX:
      	- Allow for mmap(PROT_WRITE | PROT_EXEC).
      	Added CAP_MMAP_RWX:
      	- Allow for mmap(PROT_READ | PROT_WRITE | PROT_EXEC).
      
      	Renamed CAP_MKDIR to CAP_MKDIRAT.
      	Renamed CAP_MKFIFO to CAP_MKFIFOAT.
      	Renamed CAP_MKNODE to CAP_MKNODEAT.
      
      	CAP_READ old behaviour:
      	- Allow pread(2).
      	- Disallow read(2), readv(2) (if there is no CAP_SEEK).
      	CAP_READ new behaviour:
      	- Allow read(2), readv(2).
      	- Disallow pread(2) (CAP_SEEK was also required).
      
      	CAP_WRITE old behaviour:
      	- Allow pwrite(2).
      	- Disallow write(2), writev(2) (if there is no CAP_SEEK).
      	CAP_WRITE new behaviour:
      	- Allow write(2), writev(2).
      	- Disallow pwrite(2) (CAP_SEEK was also required).
      
      	Added convinient defines:
      
      	#define	CAP_PREAD		(CAP_SEEK | CAP_READ)
      	#define	CAP_PWRITE		(CAP_SEEK | CAP_WRITE)
      	#define	CAP_MMAP_R		(CAP_MMAP | CAP_SEEK | CAP_READ)
      	#define	CAP_MMAP_W		(CAP_MMAP | CAP_SEEK | CAP_WRITE)
      	#define	CAP_MMAP_X		(CAP_MMAP | CAP_SEEK | 0x0000000000000008ULL)
      	#define	CAP_MMAP_RW		(CAP_MMAP_R | CAP_MMAP_W)
      	#define	CAP_MMAP_RX		(CAP_MMAP_R | CAP_MMAP_X)
      	#define	CAP_MMAP_WX		(CAP_MMAP_W | CAP_MMAP_X)
      	#define	CAP_MMAP_RWX		(CAP_MMAP_R | CAP_MMAP_W | CAP_MMAP_X)
      	#define	CAP_RECV		CAP_READ
      	#define	CAP_SEND		CAP_WRITE
      
      	#define	CAP_SOCK_CLIENT \
      		(CAP_CONNECT | CAP_GETPEERNAME | CAP_GETSOCKNAME | CAP_GETSOCKOPT | \
      		 CAP_PEELOFF | CAP_RECV | CAP_SEND | CAP_SETSOCKOPT | CAP_SHUTDOWN)
      	#define	CAP_SOCK_SERVER \
      		(CAP_ACCEPT | CAP_BIND | CAP_GETPEERNAME | CAP_GETSOCKNAME | \
      		 CAP_GETSOCKOPT | CAP_LISTEN | CAP_PEELOFF | CAP_RECV | CAP_SEND | \
      		 CAP_SETSOCKOPT | CAP_SHUTDOWN)
      
      	Added defines for backward API compatibility:
      
      	#define	CAP_MAPEXEC		CAP_MMAP_X
      	#define	CAP_DELETE		CAP_UNLINKAT
      	#define	CAP_MKDIR		CAP_MKDIRAT
      	#define	CAP_RMDIR		CAP_UNLINKAT
      	#define	CAP_MKFIFO		CAP_MKFIFOAT
      	#define	CAP_MKNOD		CAP_MKNODAT
      	#define	CAP_SOCK_ALL		(CAP_SOCK_CLIENT | CAP_SOCK_SERVER)
      
      Sponsored by:	The FreeBSD Foundation
      Reviewed by:	Christoph Mallon 
      Many aspects discussed with:	rwatson, benl, jonathan
      ABI compatibility discussed with:	kib
    
    Added:
      head/lib/libc/sys/cap_fcntls_limit.2   (contents, props changed)
      head/lib/libc/sys/cap_ioctls_limit.2   (contents, props changed)
      head/lib/libc/sys/cap_rights_limit.2   (contents, props changed)
    Deleted:
      head/lib/libc/sys/cap_new.2
    Modified:
      head/contrib/openbsm/etc/audit_event
      head/lib/libc/include/compat.h
      head/lib/libc/sys/Makefile.inc
      head/lib/libc/sys/Symbol.map
      head/lib/libc/sys/cap_enter.2
      head/lib/libc/sys/dup.2
      head/lib/libprocstat/libprocstat.c
      head/lib/libprocstat/libprocstat.h
      head/sys/bsm/audit_kevents.h
      head/sys/cddl/compat/opensolaris/sys/file.h
      head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
      head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c
      head/sys/compat/freebsd32/syscalls.master
      head/sys/compat/linux/linux_file.c
      head/sys/compat/svr4/svr4_fcntl.c
      head/sys/compat/svr4/svr4_filio.c
      head/sys/compat/svr4/svr4_misc.c
      head/sys/compat/svr4/svr4_stream.c
      head/sys/dev/iscsi/initiator/iscsi.c
      head/sys/fs/fdescfs/fdesc_vfsops.c
      head/sys/fs/fdescfs/fdesc_vnops.c
      head/sys/fs/nfs/nfsdport.h
      head/sys/fs/nfsclient/nfs_clport.c
      head/sys/fs/nfsserver/nfs_nfsdport.c
      head/sys/i386/ibcs2/ibcs2_misc.c
      head/sys/kern/capabilities.conf
      head/sys/kern/kern_descrip.c
      head/sys/kern/kern_exec.c
      head/sys/kern/kern_exit.c
      head/sys/kern/kern_fork.c
      head/sys/kern/sys_capability.c
      head/sys/kern/sys_generic.c
      head/sys/kern/syscalls.master
      head/sys/kern/tty.c
      head/sys/kern/uipc_mqueue.c
      head/sys/kern/uipc_sem.c
      head/sys/kern/uipc_shm.c
      head/sys/kern/uipc_syscalls.c
      head/sys/kern/uipc_usrreq.c
      head/sys/kern/vfs_aio.c
      head/sys/kern/vfs_lookup.c
      head/sys/kern/vfs_syscalls.c
      head/sys/netsmb/smb_dev.c
      head/sys/nfsserver/nfs_srvkrpc.c
      head/sys/ofed/include/linux/file.h
      head/sys/security/audit/audit.h
      head/sys/security/audit/audit_arg.c
      head/sys/security/audit/audit_bsm.c
      head/sys/security/audit/audit_private.h
      head/sys/sys/capability.h
      head/sys/sys/file.h
      head/sys/sys/filedesc.h
      head/sys/sys/namei.h
      head/sys/sys/user.h
      head/sys/vm/vm_mmap.c
      head/usr.bin/kdump/kdump.c
      head/usr.bin/kdump/mksubr
      head/usr.bin/procstat/procstat_files.c
    
    Modified: head/contrib/openbsm/etc/audit_event
    ==============================================================================
    --- head/contrib/openbsm/etc/audit_event	Sat Mar  2 00:41:51 2013	(r247601)
    +++ head/contrib/openbsm/etc/audit_event	Sat Mar  2 00:53:12 2013	(r247602)
    @@ -548,7 +548,7 @@
     43184:AUE_OPENAT:openat(2) - attr only:fa
     43185:AUE_POSIX_OPENPT:posix_openpt(2):ip
     43186:AUE_CAP_NEW:cap_new(2):fm
    -43187:AUE_CAP_GETRIGHTS:cap_getrights(2):fm
    +43187:AUE_CAP_RIGHTS_GET:cap_rights_get(2):fm
     43188:AUE_CAP_ENTER:cap_enter(2):pc
     43189:AUE_CAP_GETMODE:cap_getmode(2):pc
     43190:AUE_POSIX_SPAWN:posix_spawn(2):pc
    @@ -563,6 +563,11 @@
     43199:AUE_PDGETPID:pdgetpid(2):pc
     43200:AUE_PDWAIT:pdwait(2):pc
     43201:AUE_WAIT6:wait6(2):pc
    +43202:AUE_CAP_RIGHTS_LIMIT:cap_rights_limit(2):fm
    +43203:AUE_CAP_IOCTLS_LIMIT:cap_ioctls_limit(2):fm
    +43204:AUE_CAP_IOCTLS_GET:cap_ioctls_get(2):fm
    +43205:AUE_CAP_FCNTLS_LIMIT:cap_fcntls_limit(2):fm
    +43206:AUE_CAP_FCNTLS_GET:cap_fcntls_get(2):fm
     #
     # Solaris userspace events.
     #
    
    Modified: head/lib/libc/include/compat.h
    ==============================================================================
    --- head/lib/libc/include/compat.h	Sat Mar  2 00:41:51 2013	(r247601)
    +++ head/lib/libc/include/compat.h	Sat Mar  2 00:53:12 2013	(r247602)
    @@ -42,6 +42,8 @@ __sym_compat(__semctl, freebsd7___semctl
     __sym_compat(msgctl, freebsd7_msgctl, FBSD_1.0);
     __sym_compat(shmctl, freebsd7_shmctl, FBSD_1.0);
     
    +__sym_compat(cap_getrights, cap_rights_get, FBSD_1.2);
    +
     #undef __sym_compat
     
     #endif	/* __LIBC_COMPAT_H__ */
    
    Modified: head/lib/libc/sys/Makefile.inc
    ==============================================================================
    --- head/lib/libc/sys/Makefile.inc	Sat Mar  2 00:41:51 2013	(r247601)
    +++ head/lib/libc/sys/Makefile.inc	Sat Mar  2 00:53:12 2013	(r247602)
    @@ -93,7 +93,9 @@ MAN+=	abort2.2 \
     	bind.2 \
     	brk.2 \
     	cap_enter.2 \
    -	cap_new.2 \
    +	cap_fcntls_limit.2 \
    +	cap_ioctls_limit.2 \
    +	cap_rights_limit.2 \
     	chdir.2 \
     	chflags.2 \
     	chmod.2 \
    @@ -270,7 +272,9 @@ MLINKS+=access.2 eaccess.2 \
     	access.2 faccessat.2
     MLINKS+=brk.2 sbrk.2
     MLINKS+=cap_enter.2 cap_getmode.2
    -MLINKS+=cap_new.2 cap_getrights.2
    +MLINKS+=cap_fcntls_limit.2 cap_fcntls_get.2
    +MLINKS+=cap_ioctls_limit.2 cap_ioctls_get.2
    +MLINKS+=cap_rights_limit.2 cap_rights_get.2
     MLINKS+=chdir.2 fchdir.2
     MLINKS+=chflags.2 fchflags.2 \
     	chflags.2 lchflags.2
    
    Modified: head/lib/libc/sys/Symbol.map
    ==============================================================================
    --- head/lib/libc/sys/Symbol.map	Sat Mar  2 00:41:51 2013	(r247601)
    +++ head/lib/libc/sys/Symbol.map	Sat Mar  2 00:53:12 2013	(r247602)
    @@ -364,7 +364,6 @@ FBSD_1.2 {
     	cap_enter;
     	cap_getmode;
     	cap_new;
    -	cap_getrights;
     	getloginclass;
     	pdfork;
     	pdgetpid;
    @@ -379,6 +378,12 @@ FBSD_1.2 {
     };
     
     FBSD_1.3 {
    +	cap_fcntls_get;
    +	cap_fcntls_limit;
    +	cap_ioctls_get;
    +	cap_ioctls_limit;
    +	cap_rights_get;
    +	cap_rights_limit;
     	cap_sandboxed;
     	clock_getcpuclockid2;
     	ffclock_getcounter;
    
    Modified: head/lib/libc/sys/cap_enter.2
    ==============================================================================
    --- head/lib/libc/sys/cap_enter.2	Sat Mar  2 00:41:51 2013	(r247601)
    +++ head/lib/libc/sys/cap_enter.2	Sat Mar  2 00:53:12 2013	(r247602)
    @@ -58,8 +58,10 @@ or
     .Xr pdfork 2
     will be placed in capability mode from inception.
     .Pp
    -When combined with capabilities created with
    -.Xr cap_new 2 ,
    +When combined with
    +.Xr cap_rights_limit 2 ,
    +.Xr cap_ioctls_limit 2 ,
    +.Xr cap_fcntls_limit 2 ,
     .Fn cap_enter
     may be used to create kernel-enforced sandboxes in which
     appropriately-crafted applications or application components may be run.
    @@ -71,11 +73,6 @@ sandbox.
     Creating effective process sandboxes is a tricky process that involves
     identifying the least possible rights required by the process and then
     passing those rights into the process in a safe manner.
    -See the CAVEAT
    -section of
    -.Xr cap_new 2
    -for why this is particularly tricky with UNIX file descriptors as the
    -canonical representation of a right.
     Consumers of
     .Fn cap_enter
     should also be aware of other inherited rights, such as access to VM
    @@ -87,8 +84,33 @@ to create a runtime environment inside t
     acquired rights as possible.
     .Sh RETURN VALUES
     .Rv -std cap_enter cap_getmode
    +.Sh ERRORS
    +The
    +.Fn cap_enter
    +and
    +.Fn cap_getmode
    +system calls
    +will fail if:
    +.Bl -tag -width Er
    +.It Bq Er ENOSYS
    +The kernel is compiled without:
    +.Pp
    +.Cd "options CAPABILITY_MODE"
    +.El
    +.Pp
    +The
    +.Fn cap_getmode
    +system call may also return the following error:
    +.Bl -tag -width Er
    +.It Bq Er EFAULT
    +Pointer
    +.Fa modep
    +points outside the process's allocated address space.
    +.El
     .Sh SEE ALSO
    -.Xr cap_new 2 ,
    +.Xr cap_fcntls_limit 2 ,
    +.Xr cap_ioctls_limit 2 ,
    +.Xr cap_rights_limit 2 ,
     .Xr fexecve 2 ,
     .Xr cap_sandboxed 3 ,
     .Xr capsicum 4
    
    Added: head/lib/libc/sys/cap_fcntls_limit.2
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/lib/libc/sys/cap_fcntls_limit.2	Sat Mar  2 00:53:12 2013	(r247602)
    @@ -0,0 +1,127 @@
    +.\"
    +.\" Copyright (c) 2012 The FreeBSD Foundation
    +.\" All rights reserved.
    +.\"
    +.\" This documentation was written by Pawel Jakub Dawidek under sponsorship
    +.\" the FreeBSD Foundation.
    +.\"
    +.\" Redistribution and use in source and binary forms, with or without
    +.\" modification, are permitted provided that the following conditions
    +.\" are met:
    +.\" 1. Redistributions of source code must retain the above copyright
    +.\"    notice, this list of conditions and the following disclaimer.
    +.\" 2. Redistributions in binary form must reproduce the above copyright
    +.\"    notice, this list of conditions and the following disclaimer in the
    +.\"    documentation and/or other materials provided with the distribution.
    +.\"
    +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
    +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    +.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
    +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    +.\" SUCH DAMAGE.
    +.\"
    +.\" $FreeBSD$
    +.\"
    +.Dd September 20, 2012
    +.Dt CAP_FCNTLS_LIMIT 2
    +.Os
    +.Sh NAME
    +.Nm cap_fcntls_limit ,
    +.Nm cap_fcntls_get
    +.Nd manage allowed fcntl commands
    +.Sh LIBRARY
    +.Lb libc
    +.Sh SYNOPSIS
    +.In sys/capability.h
    +.Ft int
    +.Fn cap_fcntls_limit "int fd" "uint32_t fcntlrights"
    +.Ft int
    +.Fn cap_fcntls_get "int fd" "uint32_t *fcntlrightsp"
    +.Sh DESCRIPTION
    +If a file descriptor is granted the
    +.Dv CAP_FCNTL
    +capability right, the list of allowed
    +.Xr fcntl 2
    +commands can be selectively reduced (but never expanded) with the
    +.Fn cap_fcntls_limit
    +system call.
    +.Pp
    +A bitmask of allowed fcntls commands for a given file descriptor can be obtained
    +with the
    +.Fn cap_fcntls_get
    +system call.
    +.Sh FLAGS
    +The following flags may be specified in the
    +.Fa fcntlrights
    +argument or returned in the
    +.Fa fcntlrightsp
    +argument:
    +.Bl -tag -width CAP_FCNTL_GETOWN
    +.It Dv CAP_FCNTL_GETFL
    +Permit
    +.Dv F_GETFL
    +command.
    +.It Dv CAP_FCNTL_SETFL
    +Permit
    +.Dv F_SETFL
    +command.
    +.It Dv CAP_FCNTL_GETOWN
    +Permit
    +.Dv F_GETOWN
    +command.
    +.It Dv CAP_FCNTL_SETOWN
    +Permit
    +.Dv F_SETOWN
    +command.
    +.El
    +.Sh RETURN VALUES
    +.Rv -std
    +.Sh ERRORS
    +.Fn cap_fcntls_limit
    +succeeds unless:
    +.Bl -tag -width Er
    +.It Bq Er EBADF
    +The
    +.Fa fd
    +argument is not a valid descriptor.
    +.It Bq Er EINVAL
    +An invalid flag has been passed in
    +.Fa fcntlrights .
    +.It Bq Er ENOTCAPABLE
    +.Fa fcntlrights
    +would expand the list of allowed
    +.Xr fcntl 2
    +commands.
    +.El
    +.Pp
    +.Fn cap_fcntls_get
    +succeeds unless:
    +.Bl -tag -width Er
    +.It Bq Er EBADF
    +The
    +.Fa fd
    +argument is not a valid descriptor.
    +.It Bq Er EFAULT
    +The
    +.Fa fcntlrightsp
    +argument points at an invalid address.
    +.El
    +.Sh SEE ALSO
    +.Xr cap_ioctls_limit 2 ,
    +.Xr cap_rights_limit 2 ,
    +.Xr fcntl 2
    +.Sh HISTORY
    +Support for capabilities and capabilities mode was developed as part of the
    +.Tn TrustedBSD
    +Project.
    +.Pp
    +.Sh AUTHORS
    +This function was created by
    +.An Pawel Jakub Dawidek Aq pawel@dawidek.net
    +under sponsorship of the FreeBSD Foundation.
    
    Added: head/lib/libc/sys/cap_ioctls_limit.2
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/lib/libc/sys/cap_ioctls_limit.2	Sat Mar  2 00:53:12 2013	(r247602)
    @@ -0,0 +1,158 @@
    +.\"
    +.\" Copyright (c) 2012 The FreeBSD Foundation
    +.\" All rights reserved.
    +.\"
    +.\" This documentation was written by Pawel Jakub Dawidek under sponsorship
    +.\" the FreeBSD Foundation.
    +.\"
    +.\" Redistribution and use in source and binary forms, with or without
    +.\" modification, are permitted provided that the following conditions
    +.\" are met:
    +.\" 1. Redistributions of source code must retain the above copyright
    +.\"    notice, this list of conditions and the following disclaimer.
    +.\" 2. Redistributions in binary form must reproduce the above copyright
    +.\"    notice, this list of conditions and the following disclaimer in the
    +.\"    documentation and/or other materials provided with the distribution.
    +.\"
    +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
    +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    +.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
    +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    +.\" SUCH DAMAGE.
    +.\"
    +.\" $FreeBSD$
    +.\"
    +.Dd September 20, 2012
    +.Dt CAP_IOCTLS_LIMIT 2
    +.Os
    +.Sh NAME
    +.Nm cap_ioctls_limit ,
    +.Nm cap_ioctls_get
    +.Nd manage allowed ioctl commands
    +.Sh LIBRARY
    +.Lb libc
    +.Sh SYNOPSIS
    +.In sys/capability.h
    +.Ft int
    +.Fn cap_ioctls_limit "int fd" "const unsigned long *cmds" "size_t ncmds"
    +.Ft ssize_t
    +.Fn cap_ioctls_get "int fd" "unsigned long *cmds" "size_t maxcmds"
    +.Sh DESCRIPTION
    +If a file descriptor is granted the
    +.Dv CAP_IOCTL
    +capability right, the list of allowed
    +.Xr ioctl 2
    +commands can be selectively reduced (but never expanded) with the
    +.Fn cap_ioctls_limit
    +system call.
    +The
    +.Fa cmds
    +argument is an array of
    +.Xr ioctl 2
    +commands and the
    +.Fa ncmds
    +argument specifies the number of elements in the array.
    +There might be up to
    +.Va 256
    +elements in the array.
    +.Pp
    +The list of allowed ioctl commands for a given file descriptor can be obtained
    +with the
    +.Fn cap_ioctls_get
    +system call.
    +The
    +.Fa cmds
    +argument points at memory that can hold up to
    +.Fa maxcmds
    +values.
    +The function populates the provided buffer with up to
    +.Fa maxcmds
    +elements, but always returns the total number of ioctl commands allowed for the
    +given file descriptor.
    +The total number of ioctls commands for the given file descriptor can be
    +obtained by passing
    +.Dv NULL as the
    +.Fa cmds
    +argument and
    +.Va 0
    +as the
    +.Fa maxcmds
    +argument.
    +If all ioctl commands are allowed
    +.Dv ( CAP_IOCTL
    +capability right is assigned to the file descriptor and the
    +.Fn cap_ioctls_limit
    +system call was never called for this file descriptor), the
    +.Fn cap_ioctls_get
    +system call will return
    +.Dv CAP_IOCTLS_ALL
    +and won't modify the buffer pointed out by the
    +.Fa cmds
    +argument.
    +.Sh RETURN VALUES
    +.Rv -std cap_ioctls_limit
    +.Pp
    +The
    +.Fn cap_ioctls_limit
    +function, if successfull, returns the total number of allowed ioctl commands or
    +the value
    +.Dv INT_MAX
    +if all ioctls commands are allowed.
    +On failure the value
    +.Va -1
    +is returned and the global variable errno is set to indicate the error.
    +.Sh ERRORS
    +.Fn cap_ioctls_limit
    +succeeds unless:
    +.Bl -tag -width Er
    +.It Bq Er EBADF
    +The
    +.Fa fd
    +argument is not a valid descriptor.
    +.It Bq Er EFAULT
    +The
    +.Fa cmds
    +argument points at an invalid address.
    +.It Bq Er EINVAL
    +The
    +.Fa ncmds
    +argument is greater than
    +.Va 256 .
    +.It Bq Er ENOTCAPABLE
    +.Fa cmds
    +would expand the list of allowed
    +.Xr ioctl 2
    +commands.
    +.El
    +.Pp
    +.Fn cap_ioctls_get
    +succeeds unless:
    +.Bl -tag -width Er
    +.It Bq Er EBADF
    +The
    +.Fa fd
    +argument is not a valid descriptor.
    +.It Bq Er EFAULT
    +The
    +.Fa cmds
    +argument points at invalid address.
    +.El
    +.Sh SEE ALSO
    +.Xr cap_fcntls_limit 2 ,
    +.Xr cap_rights_limit 2 ,
    +.Xr ioctl 2
    +.Sh HISTORY
    +Support for capabilities and capabilities mode was developed as part of the
    +.Tn TrustedBSD
    +Project.
    +.Pp
    +.Sh AUTHORS
    +This function was created by
    +.An Pawel Jakub Dawidek Aq pawel@dawidek.net
    +under sponsorship of the FreeBSD Foundation.
    
    Added: head/lib/libc/sys/cap_rights_limit.2
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/lib/libc/sys/cap_rights_limit.2	Sat Mar  2 00:53:12 2013	(r247602)
    @@ -0,0 +1,603 @@
    +.\"
    +.\" Copyright (c) 2008-2010 Robert N. M. Watson
    +.\" Copyright (c) 2012-2013 The FreeBSD Foundation
    +.\" All rights reserved.
    +.\"
    +.\" This software was developed at the University of Cambridge Computer
    +.\" Laboratory with support from a grant from Google, Inc.
    +.\"
    +.\" Portions of this documentation were written by Pawel Jakub Dawidek
    +.\" under sponsorship from the FreeBSD Foundation.
    +.\"
    +.\" Redistribution and use in source and binary forms, with or without
    +.\" modification, are permitted provided that the following conditions
    +.\" are met:
    +.\" 1. Redistributions of source code must retain the above copyright
    +.\"    notice, this list of conditions and the following disclaimer.
    +.\" 2. Redistributions in binary form must reproduce the above copyright
    +.\"    notice, this list of conditions and the following disclaimer in the
    +.\"    documentation and/or other materials provided with the distribution.
    +.\"
    +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
    +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    +.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
    +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    +.\" SUCH DAMAGE.
    +.\"
    +.\" $FreeBSD$
    +.\"
    +.Dd February 23, 2013
    +.Dt CAP_RIGHTS_LIMIT 2
    +.Os
    +.Sh NAME
    +.Nm cap_rights_limit ,
    +.Nm cap_rights_get
    +.Nd manage capability rights
    +.Sh LIBRARY
    +.Lb libc
    +.Sh SYNOPSIS
    +.In sys/capability.h
    +.Ft int
    +.Fn cap_rights_limit "int fd" "cap_rights_t rights"
    +.Ft int
    +.Fn cap_rights_get "int fd" "cap_rights_t *rightsp"
    +.Sh DESCRIPTION
    +When a file descriptor is created by a function such as
    +.Xr fhopen 2 ,
    +.Xr kqueue 2 ,
    +.Xr mq_open 2 ,
    +.Xr open 2 ,
    +.Xr openat 2 ,
    +.Xr pdfork 2 ,
    +.Xr pipe 2 ,
    +.Xr shm_open 2 ,
    +.Xr socket 2 ,
    +or
    +.Xr socketpair 2 ,
    +it is assigned all capability rights.
    +Those rights can be reduced (but never expanded) by using the
    +.Fn cap_rights_limit
    +system call.
    +Once capability rights are reduced, operations on the file descriptor will be
    +limited to those permitted by
    +.Fa rights .
    +.Pp
    +A bitmask of capability rights assigned to a file descriptor can be obtained with
    +the
    +.Fn cap_rights_get
    +system call.
    +.Sh RIGHTS
    +The following rights may be specified in a rights mask:
    +.Bl -tag -width CAP_EXTATTR_DELETE
    +.It Dv CAP_ACCEPT
    +Permit
    +.Xr accept 2 .
    +.It Dv CAP_ACL_CHECK
    +Permit checking of an ACL on a file descriptor; there is no cross-reference
    +for this system call.
    +.It Dv CAP_ACL_DELETE
    +Permit
    +.Xr acl_delete_fd_np 3 .
    +.It Dv CAP_ACL_GET
    +Permit
    +.Xr acl_get_fd 3
    +and
    +.Xr acl_get_fd_np 3 .
    +.It Dv CAP_ACL_SET
    +Permit
    +.Xr acl_set_fd 3
    +and
    +.Xr acl_set_fd_np 3 .
    +.It Dv CAP_BIND
    +Permit
    +.Xr bind 2 .
    +Note that sockets can also become bound implicitly as a result of
    +.Xr connect 2
    +or
    +.Xr send 2 ,
    +and that socket options set with
    +.Xr setsockopt 2
    +may also affect binding behavior.
    +.It Dv CAP_CONNECT
    +Permit
    +.Xr connect 2 ;
    +also required for
    +.Xr sendto 2
    +with a non-NULL destination address.
    +.It Dv CAP_CREATE
    +Permit
    +.Xr openat 2
    +with the
    +.Dv O_CREAT
    +flag.
    +.\" XXXPJD: Doesn't exist anymore.
    +.It Dv CAP_EVENT
    +Permit
    +.Xr select 2 ,
    +.Xr poll 2 ,
    +and
    +.Xr kevent 2
    +to be used in monitoring the file descriptor for events.
    +.It Dv CAP_FEXECVE
    +Permit
    +.Xr fexecve 2
    +and
    +.Xr openat 2
    +with the
    +.Dv O_EXEC
    +flag;
    +.Dv CAP_READ
    +will also be required.
    +.It Dv CAP_EXTATTR_DELETE
    +Permit
    +.Xr extattr_delete_fd 2 .
    +.It Dv CAP_EXTATTR_GET
    +Permit
    +.Xr extattr_get_fd 2 .
    +.It Dv CAP_EXTATTR_LIST
    +Permit
    +.Xr extattr_list_fd 2 .
    +.It Dv CAP_EXTATTR_SET
    +Permit
    +.Xr extattr_set_fd 2 .
    +.It Dv CAP_FCHDIR
    +Permit
    +.Xr fchdir 2 .
    +.It Dv CAP_FCHFLAGS
    +Permit
    +.Xr fchflags 2 .
    +.It Dv CAP_FCHMOD
    +Permit
    +.Xr fchmod 2
    +and
    +.Xr fchmodat 2 .
    +.It Dv CAP_FCHMODAT
    +An alias to
    +.Dv CAP_FCHMOD .
    +.It Dv CAP_FCHOWN
    +Permit
    +.Xr fchown 2
    +and
    +.Xr fchownat 2 .
    +.It Dv CAP_FCHOWNAT
    +An alias to
    +.Dv CAP_FCHOWN .
    +.It Dv CAP_FCNTL
    +Permit
    +.Xr fcntl 2 .
    +Note that only the
    +.Dv F_GETFL ,
    +.Dv F_SETFL ,
    +.Dv F_GETOWN
    +and
    +.Dv F_SETOWN
    +commands require this capability right.
    +Also note that the list of permitted commands can be further limited with the
    +.Xr cap_fcntls_limit 2
    +system call.
    +.It Dv CAP_FLOCK
    +Permit
    +.Xr flock 2 ,
    +.Xr fcntl 2
    +(with
    +.Dv F_GETLK ,
    +.Dv F_SETLK
    +or
    +.Dv F_SETLKW
    +flag) and
    +.Xr openat 2
    +(with
    +.Dv O_EXLOCK
    +or
    +.Dv O_SHLOCK
    +flag).
    +.It Dv CAP_FPATHCONF
    +Permit
    +.Xr fpathconf 2 .
    +.It Dv CAP_FSCK
    +Permit UFS background-fsck operations on the descriptor.
    +.It Dv CAP_FSTAT
    +Permit
    +.Xr fstat 2
    +and
    +.Xr fstatat 2 .
    +.It Dv CAP_FSTATAT
    +An alias to
    +.Dv CAP_FSTAT .
    +.It Dv CAP_FSTATFS
    +Permit
    +.Xr fstatfs 2 .
    +.It Dv CAP_FSYNC
    +Permit
    +.Xr aio_fsync 2 ,
    +.Xr fsync 2
    +and
    +.Xr openat 2
    +with
    +.Dv O_FSYNC
    +or
    +.Dv O_SYNC
    +flag.
    +.It Dv CAP_FTRUNCATE
    +Permit
    +.Xr ftruncate 2
    +and
    +.Xr openat 2
    +with the
    +.Dv O_TRUNC
    +flag.
    +.It Dv CAP_FUTIMES
    +Permit
    +.Xr futimes 2
    +and
    +.Xr futimesat 2 .
    +.It Dv CAP_FUTIMESAT
    +An alias to
    +.Dv CAP_FUTIMES .
    +.It Dv CAP_GETPEERNAME
    +Permit
    +.Xr getpeername 2 .
    +.It Dv CAP_GETSOCKNAME
    +Permit
    +.Xr getsockname 2 .
    +.It Dv CAP_GETSOCKOPT
    +Permit
    +.Xr getsockopt 2 .
    +.It Dv CAP_IOCTL
    +Permit
    +.Xr ioctl 2 .
    +Be aware that this system call has enormous scope, including potentially
    +global scope for some objects.
    +The list of permitted ioctl commands can be further limited with the
    +.Xr cap_ioctls_limit 2
    +system call.
    +.\" XXXPJD: Doesn't exist anymore.
    +.It Dv CAP_KEVENT
    +Permit
    +.Xr kevent 2 ;
    +.Dv CAP_EVENT
    +is also required on file descriptors that will be monitored using
    +.Xr kevent 2 .
    +.It Dv CAP_LINKAT
    +Permit
    +.Xr linkat 2
    +and
    +.Xr renameat 2 .
    +This right is required for the destination directory descriptor.
    +.It Dv CAP_LISTEN
    +Permit
    +.Xr listen 2 ;
    +not much use (generally) without
    +.Dv CAP_BIND .
    +.It Dv CAP_LOOKUP
    +Permit the file descriptor to be used as a starting directory for calls such as
    +.Xr linkat 2 ,
    +.Xr openat 2 ,
    +and
    +.Xr unlinkat 2 .
    +.It Dv CAP_MAC_GET
    +Permit
    +.Xr mac_get_fd 3 .
    +.It Dv CAP_MAC_SET
    +Permit
    +.Xr mac_set_fd 3 .
    +.It Dv CAP_MKDIRAT
    +Permit
    +.Xr mkdirat 2 .
    +.It Dv CAP_MKFIFOAT
    +Permit
    +.Xr mkfifoat 2 .
    +.It Dv CAP_MKNODAT
    +Permit
    +.Xr mknodat 2 .
    +.It Dv CAP_MMAP
    +Permit
    +.Xr mmap 2
    +with the
    +.Dv PROT_NONE
    +protection.
    +.It Dv CAP_MMAP_R
    +Permit
    +.Xr mmap 2
    +with the
    +.Dv PROT_READ
    +protection.
    +This also implies
    +.Dv CAP_READ
    +and
    +.Dv CAP_SEEK
    +rights.
    +.It Dv CAP_MMAP_W
    +Permit
    +.Xr mmap 2
    +with the
    +.Dv PROT_WRITE
    +protection.
    +This also implies
    +.Dv CAP_WRITE
    +and
    +.Dv CAP_SEEK
    +rights.
    +.It Dv CAP_MMAP_X
    +Permit
    +.Xr mmap 2
    +with the
    +.Dv PROT_EXEC
    +protection.
    +This also implies
    +.Dv CAP_SEEK
    +right.
    +.It Dv CAP_MMAP_RW
    +Implies
    +.Dv CAP_MMAP_R
    +and
    +.Dv CAP_MMAP_W .
    +.It Dv CAP_MMAP_RX
    +Implies
    +.Dv CAP_MMAP_R
    +and
    +.Dv CAP_MMAP_X .
    +.It Dv CAP_MMAP_WX
    +Implies
    +.Dv CAP_MMAP_W
    +and
    +.Dv CAP_MMAP_X .
    +.It Dv CAP_MMAP_RWX
    +Implies
    +.Dv CAP_MMAP_R ,
    +.Dv CAP_MMAP_W
    +and
    +.Dv CAP_MMAP_X .
    +.It Dv CAP_PDGETPID
    +Permit
    +.Xr pdgetpid 2 .
    +.It Dv CAP_PDKILL
    +Permit
    +.Xr pdkill 2 .
    +.It Dv CAP_PDWAIT
    +Permit
    +.Xr pdwait4 2 .
    +.It Dv CAP_PEELOFF
    +Permit
    +.Xr sctp_peeloff 2 .
    +.\" XXXPJD: Not documented.
    +.It Dv CAP_POLL_EVENT
    +.\" XXXPJD: Not documented.
    +.It Dv CAP_POST_EVENT
    +.It Dv CAP_PREAD
    +Implies
    +.Dv CAP_SEEK
    +and
    +.Dv CAP_READ .
    +.It Dv CAP_PWRITE
    +Implies
    +.Dv CAP_SEEK
    +and
    +.Dv CAP_WRITE .
    +.It Dv CAP_READ
    +Allow
    +.Xr aio_read 2 ,
    +.Xr openat
    +with the
    +.Dv O_RDONLY flag,
    +.Xr read 2 ,
    +.Xr recv 2 ,
    +.Xr recvfrom 2 ,
    +.Xr recvmsg 2
    +and related system calls.
    +.It Dv CAP_RECV
    +An alias to
    +.Dv CAP_READ .
    +.It Dv CAP_RENAMEAT
    +Permit
    +.Xr renameat 2 .
    +This right is required for the source directory descriptor.
    +.It Dv CAP_SEEK
    +Permit operations that seek on the file descriptor, such as
    +.Xr lseek 2 ,
    +but also required for I/O system calls that can read or write at any position
    +in the file, such as
    +.Xr pread 2
    +and
    +.Xr pwrite 2 .
    +.It Dv CAP_SEM_GETVALUE
    +Permit
    +.Xr sem_getvalue 3 .
    +.It Dv CAP_SEM_POST
    +Permit
    +.Xr sem_post 3 .
    +.It Dv CAP_SEM_WAIT
    +Permit
    +.Xr sem_wait 3
    +and
    +.Xr sem_trywait 3 .
    +.It Dv CAP_SEND
    +An alias to
    +.Dv CAP_WRITE .
    +.It Dv CAP_SETSOCKOPT
    +Permit
    +.Xr setsockopt 2 ;
    +this controls various aspects of socket behavior and may affect binding,
    +connecting, and other behaviors with global scope.
    +.It Dv CAP_SHUTDOWN
    +Permit explicit
    +.Xr shutdown 2 ;
    +closing the socket will also generally shut down any connections on it.
    +.It Dv CAP_SYMLINKAT
    +Permit
    +.Xr symlinkat 2 .
    +.It Dv CAP_TTYHOOK
    +Allow configuration of TTY hooks, such as
    +.Xr snp 4 ,
    +on the file descriptor.
    +.It Dv CAP_UNLINKAT
    +Permit
    +.Xr unlinkat 2
    +and
    +.Xr renameat 2 .
    +This right is only required for
    +.Xr renameat 2
    +on the destination directory descriptor if the destination object already
    +exists and will be removed by the rename.
    +.It Dv CAP_WRITE
    +Allow
    +.Xr aio_write 2 ,
    +.Xr openat 2
    +with
    +.Dv O_WRONLY
    +and
    +.Dv O_APPEND
    +flags,
    +.Xr send 2 ,
    +.Xr sendmsg 2 ,
    +.Xr sendto 2 ,
    +.Xr write 2 ,
    +and related system calls.
    +For
    +.Xr sendto 2
    +with a non-NULL connection address,
    +.Dv CAP_CONNECT
    +is also required.
    +For
    +.Xr openat 2
    +with the
    +.Dv O_WRONLY
    +flag, but without the
    +.Dv O_APPEND
    +flag,
    +.Dv CAP_SEEK
    +is also required.
    +.El
    +.Sh RETURN VALUES
    +.Rv -std
    +.Sh ERRORS
    +.Fn cap_rights_limit
    +succeeds unless:
    +.Bl -tag -width Er
    +.It Bq Er EBADF
    +The
    +.Fa fd
    +argument is not a valid active descriptor.
    +.It Bq Er EINVAL
    +An invalid right has been requested in
    +.Fa rights .
    +.It Bq Er ENOTCAPABLE
    +.Fa rights
    +contains requested rights not present in the current rights mask associated
    +with the given file descriptor.
    +.El
    +.Pp
    +.Fn cap_rights_get
    +succeeds unless:
    +.Bl -tag -width Er
    +.It Bq Er EBADF
    +The
    +.Fa fd
    +argument is not a valid active descriptor.
    +.It Bq Er EFAULT
    +The
    +.Fa rightsp
    +argument points at an invalid address.
    +.El
    +.Sh SEE ALSO
    +.Xr accept 2 ,
    +.Xr aio_fsync 2 ,
    +.Xr aio_read 2 ,
    +.Xr aio_write 2 ,
    +.Xr bind 2 ,
    +.Xr cap_enter 2 ,
    +.Xr cap_fcntls_limit 2 ,
    +.Xr cap_ioctls_limit 2 ,
    +.Xr cap_rights_limit 2 ,
    +.Xr connect 2 ,
    +.Xr dup 2 ,
    +.Xr dup2 2 ,
    +.Xr extattr_delete_fd 2 ,
    +.Xr extattr_get_fd 2 ,
    +.Xr extattr_list_fd 2 ,
    +.Xr extattr_set_fd 2 ,
    +.Xr fchflags 2 ,
    +.Xr fchown 2 ,
    +.Xr fcntl 2 ,
    +.Xr fexecve 2 ,
    +.Xr fhopen 2 ,
    +.Xr flock 2 ,
    +.Xr fpathconf 2 ,
    +.Xr fstat 2 ,
    +.Xr fstatfs 2 ,
    +.Xr fsync 2 ,
    +.Xr ftruncate 2 ,
    +.Xr futimes 2 ,
    +.Xr getpeername 2 ,
    +.Xr getsockname 2 ,
    +.Xr getsockopt 2 ,
    +.Xr ioctl 2 ,
    +.Xr kevent 2 ,
    +.Xr kqueue 2 ,
    +.Xr linkat 2 ,
    +.Xr listen 2 ,
    +.Xr mmap 2 ,
    +.Xr mq_open 2 ,
    +.Xr open 2 ,
    +.Xr openat 2 ,
    +.Xr pdfork 2 ,
    +.Xr pdgetpid 2 ,
    +.Xr pdkill 2 ,
    +.Xr pdwait4 2 ,
    +.Xr pipe 2 ,
    +.Xr poll 2 ,
    +.Xr pread 2 ,
    +.Xr pwrite 2 ,
    +.Xr read 2 ,
    +.Xr recv 2 ,
    +.Xr recvfrom 2 ,
    +.Xr recvmsg 2 ,
    +.Xr renameat 2 ,
    +.Xr sctp_peeloff 2 ,
    +.Xr select 2 ,
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 00:55:12 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 4BBAA370;
     Sat,  2 Mar 2013 00:55:12 +0000 (UTC) (envelope-from pjd@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 23D3F1F59;
     Sat,  2 Mar 2013 00:55:12 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r220tChN063862;
     Sat, 2 Mar 2013 00:55:12 GMT (envelope-from pjd@svn.freebsd.org)
    Received: (from pjd@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r220tAE1063847;
     Sat, 2 Mar 2013 00:55:10 GMT (envelope-from pjd@svn.freebsd.org)
    Message-Id: <201303020055.r220tAE1063847@svn.freebsd.org>
    From: Pawel Jakub Dawidek 
    Date: Sat, 2 Mar 2013 00:55:10 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247604 - in head/sys: compat/freebsd32 kern sys
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 00:55:12 -0000
    
    Author: pjd
    Date: Sat Mar  2 00:55:09 2013
    New Revision: 247604
    URL: http://svnweb.freebsd.org/changeset/base/247604
    
    Log:
      Regen after r247602.
    
    Modified:
      head/sys/compat/freebsd32/freebsd32_proto.h
      head/sys/compat/freebsd32/freebsd32_syscall.h
      head/sys/compat/freebsd32/freebsd32_syscalls.c
      head/sys/compat/freebsd32/freebsd32_sysent.c
      head/sys/compat/freebsd32/freebsd32_systrace_args.c
      head/sys/kern/init_sysent.c
      head/sys/kern/syscalls.c
      head/sys/kern/systrace_args.c
      head/sys/sys/syscall.h
      head/sys/sys/syscall.mk
      head/sys/sys/sysproto.h
    
    Modified: head/sys/compat/freebsd32/freebsd32_proto.h
    ==============================================================================
    --- head/sys/compat/freebsd32/freebsd32_proto.h	Sat Mar  2 00:53:16 2013	(r247603)
    +++ head/sys/compat/freebsd32/freebsd32_proto.h	Sat Mar  2 00:55:09 2013	(r247604)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 242958 2012-11-13 12:52:31Z kib 
    + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
      */
     
     #ifndef _FREEBSD32_SYSPROTO_H_
    
    Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
    ==============================================================================
    --- head/sys/compat/freebsd32/freebsd32_syscall.h	Sat Mar  2 00:53:16 2013	(r247603)
    +++ head/sys/compat/freebsd32/freebsd32_syscall.h	Sat Mar  2 00:55:09 2013	(r247604)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 242958 2012-11-13 12:52:31Z kib 
    + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
      */
     
     #define	FREEBSD32_SYS_syscall	0
    @@ -416,7 +416,7 @@
     #define	FREEBSD32_SYS_freebsd32_shmctl	512
     #define	FREEBSD32_SYS_lpathconf	513
     #define	FREEBSD32_SYS_cap_new	514
    -#define	FREEBSD32_SYS_cap_getrights	515
    +#define	FREEBSD32_SYS_cap_rights_get	515
     #define	FREEBSD32_SYS_cap_enter	516
     #define	FREEBSD32_SYS_cap_getmode	517
     #define	FREEBSD32_SYS_freebsd32_pselect	522
    @@ -430,4 +430,9 @@
     #define	FREEBSD32_SYS_freebsd32_posix_fallocate	530
     #define	FREEBSD32_SYS_freebsd32_posix_fadvise	531
     #define	FREEBSD32_SYS_freebsd32_wait6	532
    -#define	FREEBSD32_SYS_MAXSYSCALL	533
    +#define	FREEBSD32_SYS_cap_rights_limit	533
    +#define	FREEBSD32_SYS_cap_ioctls_limit	534
    +#define	FREEBSD32_SYS_cap_ioctls_get	535
    +#define	FREEBSD32_SYS_cap_fcntls_limit	536
    +#define	FREEBSD32_SYS_cap_fcntls_get	537
    +#define	FREEBSD32_SYS_MAXSYSCALL	538
    
    Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
    ==============================================================================
    --- head/sys/compat/freebsd32/freebsd32_syscalls.c	Sat Mar  2 00:53:16 2013	(r247603)
    +++ head/sys/compat/freebsd32/freebsd32_syscalls.c	Sat Mar  2 00:55:09 2013	(r247604)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 242958 2012-11-13 12:52:31Z kib 
    + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
      */
     
     const char *freebsd32_syscallnames[] = {
    @@ -538,7 +538,7 @@ const char *freebsd32_syscallnames[] = {
     	"freebsd32_shmctl",			/* 512 = freebsd32_shmctl */
     	"lpathconf",			/* 513 = lpathconf */
     	"cap_new",			/* 514 = cap_new */
    -	"cap_getrights",			/* 515 = cap_getrights */
    +	"cap_rights_get",			/* 515 = cap_rights_get */
     	"cap_enter",			/* 516 = cap_enter */
     	"cap_getmode",			/* 517 = cap_getmode */
     	"#518",			/* 518 = pdfork */
    @@ -556,4 +556,9 @@ const char *freebsd32_syscallnames[] = {
     	"freebsd32_posix_fallocate",			/* 530 = freebsd32_posix_fallocate */
     	"freebsd32_posix_fadvise",			/* 531 = freebsd32_posix_fadvise */
     	"freebsd32_wait6",			/* 532 = freebsd32_wait6 */
    +	"cap_rights_limit",			/* 533 = cap_rights_limit */
    +	"cap_ioctls_limit",			/* 534 = cap_ioctls_limit */
    +	"cap_ioctls_get",			/* 535 = cap_ioctls_get */
    +	"cap_fcntls_limit",			/* 536 = cap_fcntls_limit */
    +	"cap_fcntls_get",			/* 537 = cap_fcntls_get */
     };
    
    Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
    ==============================================================================
    --- head/sys/compat/freebsd32/freebsd32_sysent.c	Sat Mar  2 00:53:16 2013	(r247603)
    +++ head/sys/compat/freebsd32/freebsd32_sysent.c	Sat Mar  2 00:55:09 2013	(r247604)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 242958 2012-11-13 12:52:31Z kib 
    + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
      */
     
     #include "opt_compat.h"
    @@ -575,7 +575,7 @@ struct sysent freebsd32_sysent[] = {
     	{ AS(freebsd32_shmctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },	/* 512 = freebsd32_shmctl */
     	{ AS(lpathconf_args), (sy_call_t *)sys_lpathconf, AUE_LPATHCONF, NULL, 0, 0, 0, SY_THR_STATIC },	/* 513 = lpathconf */
     	{ AS(cap_new_args), (sy_call_t *)sys_cap_new, AUE_CAP_NEW, NULL, 0, 0, 0, SY_THR_STATIC },	/* 514 = cap_new */
    -	{ AS(cap_getrights_args), (sy_call_t *)sys_cap_getrights, AUE_CAP_GETRIGHTS, NULL, 0, 0, 0, SY_THR_STATIC },	/* 515 = cap_getrights */
    +	{ AS(cap_rights_get_args), (sy_call_t *)sys_cap_rights_get, AUE_CAP_RIGHTS_GET, NULL, 0, 0, 0, SY_THR_STATIC },	/* 515 = cap_rights_get */
     	{ 0, (sy_call_t *)sys_cap_enter, AUE_CAP_ENTER, NULL, 0, 0, 0, SY_THR_STATIC },	/* 516 = cap_enter */
     	{ AS(cap_getmode_args), (sy_call_t *)sys_cap_getmode, AUE_CAP_GETMODE, NULL, 0, 0, 0, SY_THR_STATIC },	/* 517 = cap_getmode */
     	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 518 = pdfork */
    @@ -593,4 +593,9 @@ struct sysent freebsd32_sysent[] = {
     	{ AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 530 = freebsd32_posix_fallocate */
     	{ AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 531 = freebsd32_posix_fadvise */
     	{ AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC },	/* 532 = freebsd32_wait6 */
    +	{ AS(cap_rights_limit_args), (sy_call_t *)sys_cap_rights_limit, AUE_CAP_RIGHTS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 533 = cap_rights_limit */
    +	{ AS(cap_ioctls_limit_args), (sy_call_t *)sys_cap_ioctls_limit, AUE_CAP_IOCTLS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 534 = cap_ioctls_limit */
    +	{ AS(cap_ioctls_get_args), (sy_call_t *)sys_cap_ioctls_get, AUE_CAP_IOCTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC },	/* 535 = cap_ioctls_get */
    +	{ AS(cap_fcntls_limit_args), (sy_call_t *)sys_cap_fcntls_limit, AUE_CAP_FCNTLS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 536 = cap_fcntls_limit */
    +	{ AS(cap_fcntls_get_args), (sy_call_t *)sys_cap_fcntls_get, AUE_CAP_FCNTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC },	/* 537 = cap_fcntls_get */
     };
    
    Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c
    ==============================================================================
    --- head/sys/compat/freebsd32/freebsd32_systrace_args.c	Sat Mar  2 00:53:16 2013	(r247603)
    +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c	Sat Mar  2 00:55:09 2013	(r247604)
    @@ -2956,9 +2956,9 @@ systrace_args(int sysnum, void *params, 
     		*n_args = 2;
     		break;
     	}
    -	/* cap_getrights */
    +	/* cap_rights_get */
     	case 515: {
    -		struct cap_getrights_args *p = params;
    +		struct cap_rights_get_args *p = params;
     		iarg[0] = p->fd; /* int */
     		uarg[1] = (intptr_t) p->rightsp; /* uint64_t * */
     		*n_args = 2;
    @@ -3088,6 +3088,48 @@ systrace_args(int sysnum, void *params, 
     		*n_args = 6;
     		break;
     	}
    +	/* cap_rights_limit */
    +	case 533: {
    +		struct cap_rights_limit_args *p = params;
    +		iarg[0] = p->fd; /* int */
    +		uarg[1] = p->rights; /* uint64_t */
    +		*n_args = 2;
    +		break;
    +	}
    +	/* cap_ioctls_limit */
    +	case 534: {
    +		struct cap_ioctls_limit_args *p = params;
    +		iarg[0] = p->fd; /* int */
    +		uarg[1] = (intptr_t) p->cmds; /* const u_long * */
    +		uarg[2] = p->ncmds; /* size_t */
    +		*n_args = 3;
    +		break;
    +	}
    +	/* cap_ioctls_get */
    +	case 535: {
    +		struct cap_ioctls_get_args *p = params;
    +		iarg[0] = p->fd; /* int */
    +		uarg[1] = (intptr_t) p->cmds; /* u_long * */
    +		uarg[2] = p->maxcmds; /* size_t */
    +		*n_args = 3;
    +		break;
    +	}
    +	/* cap_fcntls_limit */
    +	case 536: {
    +		struct cap_fcntls_limit_args *p = params;
    +		iarg[0] = p->fd; /* int */
    +		uarg[1] = p->fcntlrights; /* uint32_t */
    +		*n_args = 2;
    +		break;
    +	}
    +	/* cap_fcntls_get */
    +	case 537: {
    +		struct cap_fcntls_get_args *p = params;
    +		iarg[0] = p->fd; /* int */
    +		uarg[1] = (intptr_t) p->fcntlrightsp; /* uint32_t * */
    +		*n_args = 2;
    +		break;
    +	}
     	default:
     		*n_args = 0;
     		break;
    @@ -8002,7 +8044,7 @@ systrace_entry_setargdesc(int sysnum, in
     			break;
     		};
     		break;
    -	/* cap_getrights */
    +	/* cap_rights_get */
     	case 515:
     		switch(ndx) {
     		case 0:
    @@ -8243,6 +8285,77 @@ systrace_entry_setargdesc(int sysnum, in
     			break;
     		};
     		break;
    +	/* cap_rights_limit */
    +	case 533:
    +		switch(ndx) {
    +		case 0:
    +			p = "int";
    +			break;
    +		case 1:
    +			p = "uint64_t";
    +			break;
    +		default:
    +			break;
    +		};
    +		break;
    +	/* cap_ioctls_limit */
    +	case 534:
    +		switch(ndx) {
    +		case 0:
    +			p = "int";
    +			break;
    +		case 1:
    +			p = "const u_long *";
    +			break;
    +		case 2:
    +			p = "size_t";
    +			break;
    +		default:
    +			break;
    +		};
    +		break;
    +	/* cap_ioctls_get */
    +	case 535:
    +		switch(ndx) {
    +		case 0:
    +			p = "int";
    +			break;
    +		case 1:
    +			p = "u_long *";
    +			break;
    +		case 2:
    +			p = "size_t";
    +			break;
    +		default:
    +			break;
    +		};
    +		break;
    +	/* cap_fcntls_limit */
    +	case 536:
    +		switch(ndx) {
    +		case 0:
    +			p = "int";
    +			break;
    +		case 1:
    +			p = "uint32_t";
    +			break;
    +		default:
    +			break;
    +		};
    +		break;
    +	/* cap_fcntls_get */
    +	case 537:
    +		switch(ndx) {
    +		case 0:
    +			p = "int";
    +			break;
    +		case 1:
    +			p = "uint32_t *";
    +			break;
    +		default:
    +			break;
    +		};
    +		break;
     	default:
     		break;
     	};
    @@ -9938,7 +10051,7 @@ systrace_return_setargdesc(int sysnum, i
     		if (ndx == 0 || ndx == 1)
     			p = "int";
     		break;
    -	/* cap_getrights */
    +	/* cap_rights_get */
     	case 515:
     		if (ndx == 0 || ndx == 1)
     			p = "int";
    @@ -10005,6 +10118,31 @@ systrace_return_setargdesc(int sysnum, i
     		if (ndx == 0 || ndx == 1)
     			p = "int";
     		break;
    +	/* cap_rights_limit */
    +	case 533:
    +		if (ndx == 0 || ndx == 1)
    +			p = "int";
    +		break;
    +	/* cap_ioctls_limit */
    +	case 534:
    +		if (ndx == 0 || ndx == 1)
    +			p = "int";
    +		break;
    +	/* cap_ioctls_get */
    +	case 535:
    +		if (ndx == 0 || ndx == 1)
    +			p = "ssize_t";
    +		break;
    +	/* cap_fcntls_limit */
    +	case 536:
    +		if (ndx == 0 || ndx == 1)
    +			p = "int";
    +		break;
    +	/* cap_fcntls_get */
    +	case 537:
    +		if (ndx == 0 || ndx == 1)
    +			p = "int";
    +		break;
     	default:
     		break;
     	};
    
    Modified: head/sys/kern/init_sysent.c
    ==============================================================================
    --- head/sys/kern/init_sysent.c	Sat Mar  2 00:53:16 2013	(r247603)
    +++ head/sys/kern/init_sysent.c	Sat Mar  2 00:55:09 2013	(r247604)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/kern/syscalls.master 242958 2012-11-13 12:52:31Z kib 
    + * created from FreeBSD: head/sys/kern/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
      */
     
     #include "opt_compat.h"
    @@ -88,7 +88,7 @@ struct sysent sysent[] = {
     	{ AS(acct_args), (sy_call_t *)sys_acct, AUE_ACCT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 51 = acct */
     	{ compat(0,sigpending), AUE_SIGPENDING, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 52 = old sigpending */
     	{ AS(sigaltstack_args), (sy_call_t *)sys_sigaltstack, AUE_SIGALTSTACK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 53 = sigaltstack */
    -	{ AS(ioctl_args), (sy_call_t *)sys_ioctl, AUE_IOCTL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 54 = ioctl */
    +	{ AS(ioctl_args), (sy_call_t *)sys_ioctl, AUE_IOCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 54 = ioctl */
     	{ AS(reboot_args), (sy_call_t *)sys_reboot, AUE_REBOOT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 55 = reboot */
     	{ AS(revoke_args), (sy_call_t *)sys_revoke, AUE_REVOKE, NULL, 0, 0, 0, SY_THR_STATIC },	/* 56 = revoke */
     	{ AS(symlink_args), (sy_call_t *)sys_symlink, AUE_SYMLINK, NULL, 0, 0, 0, SY_THR_STATIC },	/* 57 = symlink */
    @@ -549,7 +549,7 @@ struct sysent sysent[] = {
     	{ AS(shmctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },	/* 512 = shmctl */
     	{ AS(lpathconf_args), (sy_call_t *)sys_lpathconf, AUE_LPATHCONF, NULL, 0, 0, 0, SY_THR_STATIC },	/* 513 = lpathconf */
     	{ AS(cap_new_args), (sy_call_t *)sys_cap_new, AUE_CAP_NEW, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 514 = cap_new */
    -	{ AS(cap_getrights_args), (sy_call_t *)sys_cap_getrights, AUE_CAP_GETRIGHTS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 515 = cap_getrights */
    +	{ AS(cap_rights_get_args), (sy_call_t *)sys_cap_rights_get, AUE_CAP_RIGHTS_GET, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 515 = cap_rights_get */
     	{ 0, (sy_call_t *)sys_cap_enter, AUE_CAP_ENTER, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 516 = cap_enter */
     	{ AS(cap_getmode_args), (sy_call_t *)sys_cap_getmode, AUE_CAP_GETMODE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 517 = cap_getmode */
     	{ AS(pdfork_args), (sy_call_t *)sys_pdfork, AUE_PDFORK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 518 = pdfork */
    @@ -567,4 +567,9 @@ struct sysent sysent[] = {
     	{ AS(posix_fallocate_args), (sy_call_t *)sys_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 530 = posix_fallocate */
     	{ AS(posix_fadvise_args), (sy_call_t *)sys_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 531 = posix_fadvise */
     	{ AS(wait6_args), (sy_call_t *)sys_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC },	/* 532 = wait6 */
    +	{ AS(cap_rights_limit_args), (sy_call_t *)sys_cap_rights_limit, AUE_CAP_RIGHTS_LIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 533 = cap_rights_limit */
    +	{ AS(cap_ioctls_limit_args), (sy_call_t *)sys_cap_ioctls_limit, AUE_CAP_IOCTLS_LIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 534 = cap_ioctls_limit */
    +	{ AS(cap_ioctls_get_args), (sy_call_t *)sys_cap_ioctls_get, AUE_CAP_IOCTLS_GET, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 535 = cap_ioctls_get */
    +	{ AS(cap_fcntls_limit_args), (sy_call_t *)sys_cap_fcntls_limit, AUE_CAP_FCNTLS_LIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 536 = cap_fcntls_limit */
    +	{ AS(cap_fcntls_get_args), (sy_call_t *)sys_cap_fcntls_get, AUE_CAP_FCNTLS_GET, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 537 = cap_fcntls_get */
     };
    
    Modified: head/sys/kern/syscalls.c
    ==============================================================================
    --- head/sys/kern/syscalls.c	Sat Mar  2 00:53:16 2013	(r247603)
    +++ head/sys/kern/syscalls.c	Sat Mar  2 00:55:09 2013	(r247604)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/kern/syscalls.master 242958 2012-11-13 12:52:31Z kib 
    + * created from FreeBSD: head/sys/kern/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
      */
     
     const char *syscallnames[] = {
    @@ -522,7 +522,7 @@ const char *syscallnames[] = {
     	"shmctl",			/* 512 = shmctl */
     	"lpathconf",			/* 513 = lpathconf */
     	"cap_new",			/* 514 = cap_new */
    -	"cap_getrights",			/* 515 = cap_getrights */
    +	"cap_rights_get",			/* 515 = cap_rights_get */
     	"cap_enter",			/* 516 = cap_enter */
     	"cap_getmode",			/* 517 = cap_getmode */
     	"pdfork",			/* 518 = pdfork */
    @@ -540,4 +540,9 @@ const char *syscallnames[] = {
     	"posix_fallocate",			/* 530 = posix_fallocate */
     	"posix_fadvise",			/* 531 = posix_fadvise */
     	"wait6",			/* 532 = wait6 */
    +	"cap_rights_limit",			/* 533 = cap_rights_limit */
    +	"cap_ioctls_limit",			/* 534 = cap_ioctls_limit */
    +	"cap_ioctls_get",			/* 535 = cap_ioctls_get */
    +	"cap_fcntls_limit",			/* 536 = cap_fcntls_limit */
    +	"cap_fcntls_get",			/* 537 = cap_fcntls_get */
     };
    
    Modified: head/sys/kern/systrace_args.c
    ==============================================================================
    --- head/sys/kern/systrace_args.c	Sat Mar  2 00:53:16 2013	(r247603)
    +++ head/sys/kern/systrace_args.c	Sat Mar  2 00:55:09 2013	(r247604)
    @@ -3134,9 +3134,9 @@ systrace_args(int sysnum, void *params, 
     		*n_args = 2;
     		break;
     	}
    -	/* cap_getrights */
    +	/* cap_rights_get */
     	case 515: {
    -		struct cap_getrights_args *p = params;
    +		struct cap_rights_get_args *p = params;
     		iarg[0] = p->fd; /* int */
     		uarg[1] = (intptr_t) p->rightsp; /* uint64_t * */
     		*n_args = 2;
    @@ -3286,6 +3286,48 @@ systrace_args(int sysnum, void *params, 
     		*n_args = 6;
     		break;
     	}
    +	/* cap_rights_limit */
    +	case 533: {
    +		struct cap_rights_limit_args *p = params;
    +		iarg[0] = p->fd; /* int */
    +		uarg[1] = p->rights; /* uint64_t */
    +		*n_args = 2;
    +		break;
    +	}
    +	/* cap_ioctls_limit */
    +	case 534: {
    +		struct cap_ioctls_limit_args *p = params;
    +		iarg[0] = p->fd; /* int */
    +		uarg[1] = (intptr_t) p->cmds; /* const u_long * */
    +		uarg[2] = p->ncmds; /* size_t */
    +		*n_args = 3;
    +		break;
    +	}
    +	/* cap_ioctls_get */
    +	case 535: {
    +		struct cap_ioctls_get_args *p = params;
    +		iarg[0] = p->fd; /* int */
    +		uarg[1] = (intptr_t) p->cmds; /* u_long * */
    +		uarg[2] = p->maxcmds; /* size_t */
    +		*n_args = 3;
    +		break;
    +	}
    +	/* cap_fcntls_limit */
    +	case 536: {
    +		struct cap_fcntls_limit_args *p = params;
    +		iarg[0] = p->fd; /* int */
    +		uarg[1] = p->fcntlrights; /* uint32_t */
    +		*n_args = 2;
    +		break;
    +	}
    +	/* cap_fcntls_get */
    +	case 537: {
    +		struct cap_fcntls_get_args *p = params;
    +		iarg[0] = p->fd; /* int */
    +		uarg[1] = (intptr_t) p->fcntlrightsp; /* uint32_t * */
    +		*n_args = 2;
    +		break;
    +	}
     	default:
     		*n_args = 0;
     		break;
    @@ -8477,7 +8519,7 @@ systrace_entry_setargdesc(int sysnum, in
     			break;
     		};
     		break;
    -	/* cap_getrights */
    +	/* cap_rights_get */
     	case 515:
     		switch(ndx) {
     		case 0:
    @@ -8745,6 +8787,77 @@ systrace_entry_setargdesc(int sysnum, in
     			break;
     		};
     		break;
    +	/* cap_rights_limit */
    +	case 533:
    +		switch(ndx) {
    +		case 0:
    +			p = "int";
    +			break;
    +		case 1:
    +			p = "uint64_t";
    +			break;
    +		default:
    +			break;
    +		};
    +		break;
    +	/* cap_ioctls_limit */
    +	case 534:
    +		switch(ndx) {
    +		case 0:
    +			p = "int";
    +			break;
    +		case 1:
    +			p = "const u_long *";
    +			break;
    +		case 2:
    +			p = "size_t";
    +			break;
    +		default:
    +			break;
    +		};
    +		break;
    +	/* cap_ioctls_get */
    +	case 535:
    +		switch(ndx) {
    +		case 0:
    +			p = "int";
    +			break;
    +		case 1:
    +			p = "u_long *";
    +			break;
    +		case 2:
    +			p = "size_t";
    +			break;
    +		default:
    +			break;
    +		};
    +		break;
    +	/* cap_fcntls_limit */
    +	case 536:
    +		switch(ndx) {
    +		case 0:
    +			p = "int";
    +			break;
    +		case 1:
    +			p = "uint32_t";
    +			break;
    +		default:
    +			break;
    +		};
    +		break;
    +	/* cap_fcntls_get */
    +	case 537:
    +		switch(ndx) {
    +		case 0:
    +			p = "int";
    +			break;
    +		case 1:
    +			p = "uint32_t *";
    +			break;
    +		default:
    +			break;
    +		};
    +		break;
     	default:
     		break;
     	};
    @@ -10556,7 +10669,7 @@ systrace_return_setargdesc(int sysnum, i
     		if (ndx == 0 || ndx == 1)
     			p = "int";
     		break;
    -	/* cap_getrights */
    +	/* cap_rights_get */
     	case 515:
     		if (ndx == 0 || ndx == 1)
     			p = "int";
    @@ -10638,6 +10751,31 @@ systrace_return_setargdesc(int sysnum, i
     		if (ndx == 0 || ndx == 1)
     			p = "int";
     		break;
    +	/* cap_rights_limit */
    +	case 533:
    +		if (ndx == 0 || ndx == 1)
    +			p = "int";
    +		break;
    +	/* cap_ioctls_limit */
    +	case 534:
    +		if (ndx == 0 || ndx == 1)
    +			p = "int";
    +		break;
    +	/* cap_ioctls_get */
    +	case 535:
    +		if (ndx == 0 || ndx == 1)
    +			p = "ssize_t";
    +		break;
    +	/* cap_fcntls_limit */
    +	case 536:
    +		if (ndx == 0 || ndx == 1)
    +			p = "int";
    +		break;
    +	/* cap_fcntls_get */
    +	case 537:
    +		if (ndx == 0 || ndx == 1)
    +			p = "int";
    +		break;
     	default:
     		break;
     	};
    
    Modified: head/sys/sys/syscall.h
    ==============================================================================
    --- head/sys/sys/syscall.h	Sat Mar  2 00:53:16 2013	(r247603)
    +++ head/sys/sys/syscall.h	Sat Mar  2 00:55:09 2013	(r247604)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/kern/syscalls.master 242958 2012-11-13 12:52:31Z kib 
    + * created from FreeBSD: head/sys/kern/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
      */
     
     #define	SYS_syscall	0
    @@ -435,7 +435,7 @@
     #define	SYS_shmctl	512
     #define	SYS_lpathconf	513
     #define	SYS_cap_new	514
    -#define	SYS_cap_getrights	515
    +#define	SYS_cap_rights_get	515
     #define	SYS_cap_enter	516
     #define	SYS_cap_getmode	517
     #define	SYS_pdfork	518
    @@ -452,4 +452,9 @@
     #define	SYS_posix_fallocate	530
     #define	SYS_posix_fadvise	531
     #define	SYS_wait6	532
    -#define	SYS_MAXSYSCALL	533
    +#define	SYS_cap_rights_limit	533
    +#define	SYS_cap_ioctls_limit	534
    +#define	SYS_cap_ioctls_get	535
    +#define	SYS_cap_fcntls_limit	536
    +#define	SYS_cap_fcntls_get	537
    +#define	SYS_MAXSYSCALL	538
    
    Modified: head/sys/sys/syscall.mk
    ==============================================================================
    --- head/sys/sys/syscall.mk	Sat Mar  2 00:53:16 2013	(r247603)
    +++ head/sys/sys/syscall.mk	Sat Mar  2 00:55:09 2013	(r247604)
    @@ -1,7 +1,7 @@
     # FreeBSD system call names.
     # DO NOT EDIT-- this file is automatically generated.
     # $FreeBSD$
    -# created from FreeBSD: head/sys/kern/syscalls.master 242958 2012-11-13 12:52:31Z kib 
    +# created from FreeBSD: head/sys/kern/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
     MIASM =  \
     	syscall.o \
     	exit.o \
    @@ -384,7 +384,7 @@ MIASM =  \
     	shmctl.o \
     	lpathconf.o \
     	cap_new.o \
    -	cap_getrights.o \
    +	cap_rights_get.o \
     	cap_enter.o \
     	cap_getmode.o \
     	pdfork.o \
    @@ -400,4 +400,9 @@ MIASM =  \
     	rctl_remove_rule.o \
     	posix_fallocate.o \
     	posix_fadvise.o \
    -	wait6.o
    +	wait6.o \
    +	cap_rights_limit.o \
    +	cap_ioctls_limit.o \
    +	cap_ioctls_get.o \
    +	cap_fcntls_limit.o \
    +	cap_fcntls_get.o
    
    Modified: head/sys/sys/sysproto.h
    ==============================================================================
    --- head/sys/sys/sysproto.h	Sat Mar  2 00:53:16 2013	(r247603)
    +++ head/sys/sys/sysproto.h	Sat Mar  2 00:55:09 2013	(r247604)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/kern/syscalls.master 242958 2012-11-13 12:52:31Z kib 
    + * created from FreeBSD: head/sys/kern/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
      */
     
     #ifndef _SYS_SYSPROTO_H_
    @@ -1676,7 +1676,7 @@ struct cap_new_args {
     	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
     	char rights_l_[PADL_(uint64_t)]; uint64_t rights; char rights_r_[PADR_(uint64_t)];
     };
    -struct cap_getrights_args {
    +struct cap_rights_get_args {
     	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
     	char rightsp_l_[PADL_(uint64_t *)]; uint64_t * rightsp; char rightsp_r_[PADR_(uint64_t *)];
     };
    @@ -1762,6 +1762,28 @@ struct wait6_args {
     	char wrusage_l_[PADL_(struct __wrusage *)]; struct __wrusage * wrusage; char wrusage_r_[PADR_(struct __wrusage *)];
     	char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)];
     };
    +struct cap_rights_limit_args {
    +	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
    +	char rights_l_[PADL_(uint64_t)]; uint64_t rights; char rights_r_[PADR_(uint64_t)];
    +};
    +struct cap_ioctls_limit_args {
    +	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
    +	char cmds_l_[PADL_(const u_long *)]; const u_long * cmds; char cmds_r_[PADR_(const u_long *)];
    +	char ncmds_l_[PADL_(size_t)]; size_t ncmds; char ncmds_r_[PADR_(size_t)];
    +};
    +struct cap_ioctls_get_args {
    +	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
    +	char cmds_l_[PADL_(u_long *)]; u_long * cmds; char cmds_r_[PADR_(u_long *)];
    +	char maxcmds_l_[PADL_(size_t)]; size_t maxcmds; char maxcmds_r_[PADR_(size_t)];
    +};
    +struct cap_fcntls_limit_args {
    +	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
    +	char fcntlrights_l_[PADL_(uint32_t)]; uint32_t fcntlrights; char fcntlrights_r_[PADR_(uint32_t)];
    +};
    +struct cap_fcntls_get_args {
    +	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
    +	char fcntlrightsp_l_[PADL_(uint32_t *)]; uint32_t * fcntlrightsp; char fcntlrightsp_r_[PADR_(uint32_t *)];
    +};
     int	nosys(struct thread *, struct nosys_args *);
     void	sys_sys_exit(struct thread *, struct sys_exit_args *);
     int	sys_fork(struct thread *, struct fork_args *);
    @@ -2127,7 +2149,7 @@ int	sys_msgctl(struct thread *, struct m
     int	sys_shmctl(struct thread *, struct shmctl_args *);
     int	sys_lpathconf(struct thread *, struct lpathconf_args *);
     int	sys_cap_new(struct thread *, struct cap_new_args *);
    -int	sys_cap_getrights(struct thread *, struct cap_getrights_args *);
    +int	sys_cap_rights_get(struct thread *, struct cap_rights_get_args *);
     int	sys_cap_enter(struct thread *, struct cap_enter_args *);
     int	sys_cap_getmode(struct thread *, struct cap_getmode_args *);
     int	sys_pdfork(struct thread *, struct pdfork_args *);
    @@ -2144,6 +2166,11 @@ int	sys_rctl_remove_rule(struct thread *
     int	sys_posix_fallocate(struct thread *, struct posix_fallocate_args *);
     int	sys_posix_fadvise(struct thread *, struct posix_fadvise_args *);
     int	sys_wait6(struct thread *, struct wait6_args *);
    +int	sys_cap_rights_limit(struct thread *, struct cap_rights_limit_args *);
    +int	sys_cap_ioctls_limit(struct thread *, struct cap_ioctls_limit_args *);
    +int	sys_cap_ioctls_get(struct thread *, struct cap_ioctls_get_args *);
    +int	sys_cap_fcntls_limit(struct thread *, struct cap_fcntls_limit_args *);
    +int	sys_cap_fcntls_get(struct thread *, struct cap_fcntls_get_args *);
     
     #ifdef COMPAT_43
     
    @@ -2823,7 +2850,7 @@ int	freebsd7_shmctl(struct thread *, str
     #define	SYS_AUE_shmctl	AUE_SHMCTL
     #define	SYS_AUE_lpathconf	AUE_LPATHCONF
     #define	SYS_AUE_cap_new	AUE_CAP_NEW
    -#define	SYS_AUE_cap_getrights	AUE_CAP_GETRIGHTS
    +#define	SYS_AUE_cap_rights_get	AUE_CAP_RIGHTS_GET
     #define	SYS_AUE_cap_enter	AUE_CAP_ENTER
     #define	SYS_AUE_cap_getmode	AUE_CAP_GETMODE
     #define	SYS_AUE_pdfork	AUE_PDFORK
    @@ -2840,6 +2867,11 @@ int	freebsd7_shmctl(struct thread *, str
     #define	SYS_AUE_posix_fallocate	AUE_NULL
     #define	SYS_AUE_posix_fadvise	AUE_NULL
     #define	SYS_AUE_wait6	AUE_WAIT6
    +#define	SYS_AUE_cap_rights_limit	AUE_CAP_RIGHTS_LIMIT
    +#define	SYS_AUE_cap_ioctls_limit	AUE_CAP_IOCTLS_LIMIT
    +#define	SYS_AUE_cap_ioctls_get	AUE_CAP_IOCTLS_GET
    +#define	SYS_AUE_cap_fcntls_limit	AUE_CAP_FCNTLS_LIMIT
    +#define	SYS_AUE_cap_fcntls_get	AUE_CAP_FCNTLS_GET
     
     #undef PAD_
     #undef PADL_
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 00:56:54 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 5B9B3505;
     Sat,  2 Mar 2013 00:56:54 +0000 (UTC) (envelope-from pjd@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 4CFE31F70;
     Sat,  2 Mar 2013 00:56:54 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r220usbO064141;
     Sat, 2 Mar 2013 00:56:54 GMT (envelope-from pjd@svn.freebsd.org)
    Received: (from pjd@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r220us8E064137;
     Sat, 2 Mar 2013 00:56:54 GMT (envelope-from pjd@svn.freebsd.org)
    Message-Id: <201303020056.r220us8E064137@svn.freebsd.org>
    From: Pawel Jakub Dawidek 
    Date: Sat, 2 Mar 2013 00:56:54 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247605 - head/tools/regression/security/cap_test
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 00:56:54 -0000
    
    Author: pjd
    Date: Sat Mar  2 00:56:53 2013
    New Revision: 247605
    URL: http://svnweb.freebsd.org/changeset/base/247605
    
    Log:
      Update existing regression tests after Capsicum overhaul.
    
    Modified:
      head/tools/regression/security/cap_test/cap_test_capabilities.c
      head/tools/regression/security/cap_test/cap_test_relative.c
    
    Modified: head/tools/regression/security/cap_test/cap_test_capabilities.c
    ==============================================================================
    --- head/tools/regression/security/cap_test/cap_test_capabilities.c	Sat Mar  2 00:55:09 2013	(r247604)
    +++ head/tools/regression/security/cap_test/cap_test_capabilities.c	Sat Mar  2 00:56:53 2013	(r247605)
    @@ -1,8 +1,12 @@
     /*-
      * Copyright (c) 2009-2011 Robert N. M. Watson
      * Copyright (c) 2011 Jonathan Anderson
    + * Copyright (c) 2012 FreeBSD Foundation
      * All rights reserved.
      *
    + * Portions of this software were developed by Pawel Jakub Dawidek 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:
    @@ -43,6 +47,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    +#include 
     #include 
     #include 
     #include 
    @@ -60,14 +65,20 @@ __FBSDID("$FreeBSD$");
      */
     #define	CHECK_RESULT(syscall, rights_needed, succeeded)	do {		\
     	if ((rights & (rights_needed)) == (rights_needed)) {		\
    -		if (!(succeeded))					\
    +		if (succeeded) {					\
    +			if (success == -1)				\
    +				success = PASSED;			\
    +		} else {						\
     			SYSCALL_FAIL(syscall, "failed");		\
    +		}							\
     	} else {							\
    -		if (succeeded)						\
    +		if (succeeded) {					\
     			FAILX("%s:\tsucceeded when it shouldn't have"	\
    -			    " (rights 0x%jx)", #syscall, rights);	\
    -		else if (errno != ENOTCAPABLE)				\
    +			    " (rights 0x%jx)", #syscall,		\
    +			    (uintmax_t)rights);				\
    +		} else if (errno != ENOTCAPABLE) {			\
     			SYSCALL_FAIL(syscall, "errno != ENOTCAPABLE");	\
    +		}							\
     	}								\
     	errno = 0;							\
     } while (0)
    @@ -79,8 +90,11 @@ __FBSDID("$FreeBSD$");
     	if ((rights & (rights_needed)) == (rights_needed)) {		\
     		if (p == MAP_FAILED)					\
     			SYSCALL_FAIL(mmap, "failed");			\
    -		else							\
    +		else {							\
     			(void)munmap(p, getpagesize());			\
    +			if (success == -1)				\
    +				success = PASSED;			\
    +		}							\
     	} else {							\
     		if (p != MAP_FAILED) {					\
     			FAILX("%s:\tsucceeded when it shouldn't have"	\
    @@ -97,96 +111,200 @@ __FBSDID("$FreeBSD$");
      * make sure only those rights work. 
     */
     static int
    -try_file_ops(int fd, cap_rights_t rights)
    +try_file_ops(int filefd, int dirfd, cap_rights_t rights)
     {
     	struct stat sb;
     	struct statfs sf;
    -	int fd_cap, fd_capcap;
    +	cap_rights_t erights;
    +	int fd_cap, fd_capcap, dfd_cap;
     	ssize_t ssize, ssize2;
     	off_t off;
     	void *p;
     	char ch;
     	int ret, is_nfs;
     	struct pollfd pollfd;
    -	int success = PASSED;
    +	int success = -1;
     
    -	REQUIRE(fstatfs(fd, &sf));
    -	is_nfs = (strncmp("nfs", sf.f_fstypename, sizeof(sf.f_fstypename))
    -	    == 0);
    +	REQUIRE(fstatfs(filefd, &sf));
    +	is_nfs = (strcmp("nfs", sf.f_fstypename) == 0);
     
    -	REQUIRE(fd_cap = cap_new(fd, rights));
    +	REQUIRE(fd_cap = cap_new(filefd, rights));
    +	CHECK(cap_getrights(fd_cap, &erights) == 0);
    +	CHECK(rights == erights);
     	REQUIRE(fd_capcap = cap_new(fd_cap, rights));
    +	CHECK(cap_getrights(fd_capcap, &erights) == 0);
    +	CHECK(rights == erights);
     	CHECK(fd_capcap != fd_cap);
    -
    -	pollfd.fd = fd_cap;
    -	pollfd.events = POLLIN | POLLERR | POLLHUP;
    -	pollfd.revents = 0;
    +	REQUIRE(dfd_cap = cap_new(dirfd, rights));
    +	CHECK(cap_getrights(dfd_cap, &erights) == 0);
    +	CHECK(rights == erights);
     
     	ssize = read(fd_cap, &ch, sizeof(ch));
    -	CHECK_RESULT(read, CAP_READ | CAP_SEEK, ssize >= 0);
    -
    -	ssize = pread(fd_cap, &ch, sizeof(ch), 0);
    -	ssize2 = pread(fd_cap, &ch, sizeof(ch), 0);
    -	CHECK_RESULT(pread, CAP_READ, ssize >= 0);
    -	CHECK(ssize == ssize2);
    +	CHECK_RESULT(read, CAP_READ, ssize >= 0);
     
     	ssize = write(fd_cap, &ch, sizeof(ch));
    -	CHECK_RESULT(write, CAP_WRITE | CAP_SEEK, ssize >= 0);
    -
    -	ssize = pwrite(fd_cap, &ch, sizeof(ch), 0);
    -	CHECK_RESULT(pwrite, CAP_WRITE, ssize >= 0);
    +	CHECK_RESULT(write, CAP_WRITE, ssize >= 0);
     
     	off = lseek(fd_cap, 0, SEEK_SET);
     	CHECK_RESULT(lseek, CAP_SEEK, off >= 0);
     
    -	/*
    -	 * Note: this is not expected to work over NFS.
    -	 */
    -	ret = fchflags(fd_cap, UF_NODUMP);
    -	CHECK_RESULT(fchflags, CAP_FCHFLAGS,
    -	    (ret == 0) || (is_nfs && (errno == EOPNOTSUPP)));
    +	ssize = pread(fd_cap, &ch, sizeof(ch), 0);
    +	ssize2 = pread(fd_cap, &ch, sizeof(ch), 0);
    +	CHECK_RESULT(pread, CAP_PREAD, ssize >= 0);
    +	CHECK(ssize == ssize2);
     
    -	ret = fstat(fd_cap, &sb);
    -	CHECK_RESULT(fstat, CAP_FSTAT, ret == 0);
    +	ssize = pwrite(fd_cap, &ch, sizeof(ch), 0);
    +	CHECK_RESULT(pwrite, CAP_PWRITE, ssize >= 0);
    +
    +	p = mmap(NULL, getpagesize(), PROT_NONE, MAP_SHARED, fd_cap, 0);
    +	CHECK_MMAP_RESULT(CAP_MMAP);
     
     	p = mmap(NULL, getpagesize(), PROT_READ, MAP_SHARED, fd_cap, 0);
    -	CHECK_MMAP_RESULT(CAP_MMAP | CAP_READ);
    +	CHECK_MMAP_RESULT(CAP_MMAP_R);
     
     	p = mmap(NULL, getpagesize(), PROT_WRITE, MAP_SHARED, fd_cap, 0);
    -	CHECK_MMAP_RESULT(CAP_MMAP | CAP_WRITE);
    +	CHECK_MMAP_RESULT(CAP_MMAP_W);
     
     	p = mmap(NULL, getpagesize(), PROT_EXEC, MAP_SHARED, fd_cap, 0);
    -	CHECK_MMAP_RESULT(CAP_MMAP | CAP_MAPEXEC);
    +	CHECK_MMAP_RESULT(CAP_MMAP_X);
     
     	p = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED,
     	    fd_cap, 0);
    -	CHECK_MMAP_RESULT(CAP_MMAP | CAP_READ | CAP_WRITE);
    +	CHECK_MMAP_RESULT(CAP_MMAP_RW);
     
     	p = mmap(NULL, getpagesize(), PROT_READ | PROT_EXEC, MAP_SHARED,
     	    fd_cap, 0);
    -	CHECK_MMAP_RESULT(CAP_MMAP | CAP_READ | CAP_MAPEXEC);
    +	CHECK_MMAP_RESULT(CAP_MMAP_RX);
     
     	p = mmap(NULL, getpagesize(), PROT_EXEC | PROT_WRITE, MAP_SHARED,
     	    fd_cap, 0);
    -	CHECK_MMAP_RESULT(CAP_MMAP | CAP_MAPEXEC | CAP_WRITE);
    +	CHECK_MMAP_RESULT(CAP_MMAP_WX);
     
     	p = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE | PROT_EXEC,
     	    MAP_SHARED, fd_cap, 0);
    -	CHECK_MMAP_RESULT(CAP_MMAP | CAP_READ | CAP_WRITE | CAP_MAPEXEC);
    +	CHECK_MMAP_RESULT(CAP_MMAP_RWX);
    +
    +	/* TODO: openat(O_APPEND) */
    +	ret = openat(dfd_cap, "cap_create", O_CREAT | O_RDONLY, 0600);
    +	CHECK_RESULT(openat(O_CREATE | O_RDONLY),
    +	    CAP_CREATE | CAP_READ | CAP_LOOKUP, ret >= 0);
    +	CHECK(ret == -1 || close(ret) == 0);
    +	CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0);
    +	ret = openat(dfd_cap, "cap_create", O_CREAT | O_WRONLY, 0600);
    +	CHECK_RESULT(openat(O_CREATE | O_WRONLY),
    +	    CAP_CREATE | CAP_WRITE | CAP_LOOKUP, ret >= 0);
    +	CHECK(ret == -1 || close(ret) == 0);
    +	CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0);
    +	ret = openat(dfd_cap, "cap_create", O_CREAT | O_RDWR, 0600);
    +	CHECK_RESULT(openat(O_CREATE | O_RDWR),
    +	    CAP_CREATE | CAP_READ | CAP_WRITE | CAP_LOOKUP, ret >= 0);
    +	CHECK(ret == -1 || close(ret) == 0);
    +	CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0);
     
     	ret = fsync(fd_cap);
     	CHECK_RESULT(fsync, CAP_FSYNC, ret == 0);
     
    +	ret = openat(dirfd, "cap_fsync", O_CREAT, 0600);
    +	CHECK(ret >= 0);
    +	CHECK(close(ret) == 0);
    +	ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDONLY, 0600);
    +	CHECK_RESULT(openat(O_FSYNC | O_RDONLY),
    +	    CAP_FSYNC | CAP_READ | CAP_LOOKUP, ret >= 0);
    +	CHECK(ret == -1 || close(ret) == 0);
    +	ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_WRONLY, 0600);
    +	CHECK_RESULT(openat(O_FSYNC | O_WRONLY),
    +	    CAP_FSYNC | CAP_WRITE | CAP_LOOKUP, ret >= 0);
    +	CHECK(ret == -1 || close(ret) == 0);
    +	ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDWR, 0600);
    +	CHECK_RESULT(openat(O_FSYNC | O_RDWR),
    +	    CAP_FSYNC | CAP_READ | CAP_WRITE | CAP_LOOKUP, ret >= 0);
    +	CHECK(ret == -1 || close(ret) == 0);
    +	ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDONLY, 0600);
    +	CHECK_RESULT(openat(O_SYNC | O_RDONLY),
    +	    CAP_FSYNC | CAP_READ | CAP_LOOKUP, ret >= 0);
    +	CHECK(ret == -1 || close(ret) == 0);
    +	ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_WRONLY, 0600);
    +	CHECK_RESULT(openat(O_SYNC | O_WRONLY),
    +	    CAP_FSYNC | CAP_WRITE | CAP_LOOKUP, ret >= 0);
    +	CHECK(ret == -1 || close(ret) == 0);
    +	ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDWR, 0600);
    +	CHECK_RESULT(openat(O_SYNC | O_RDWR),
    +	    CAP_FSYNC | CAP_READ | CAP_WRITE | CAP_LOOKUP, ret >= 0);
    +	CHECK(ret == -1 || close(ret) == 0);
    +	CHECK(unlinkat(dirfd, "cap_fsync", 0) == 0);
    +
    +	ret = ftruncate(fd_cap, 0);
    +	CHECK_RESULT(ftruncate, CAP_FTRUNCATE, ret == 0);
    +
    +	ret = openat(dirfd, "cap_ftruncate", O_CREAT, 0600);
    +	CHECK(ret >= 0);
    +	CHECK(close(ret) == 0);
    +	ret = openat(dfd_cap, "cap_ftruncate", O_TRUNC | O_RDONLY);
    +	CHECK_RESULT(openat(O_TRUNC | O_RDONLY),
    +	    CAP_FTRUNCATE | CAP_READ | CAP_LOOKUP, ret >= 0);
    +	CHECK(ret == -1 || close(ret) == 0);
    +	ret = openat(dfd_cap, "cap_ftruncate", O_TRUNC | O_WRONLY);
    +	CHECK_RESULT(openat(O_TRUNC | O_WRONLY),
    +	    CAP_FTRUNCATE | CAP_WRITE | CAP_LOOKUP, ret >= 0);
    +	CHECK(ret == -1 || close(ret) == 0);
    +	ret = openat(dfd_cap, "cap_ftruncate", O_TRUNC | O_RDWR);
    +	CHECK_RESULT(openat(O_TRUNC | O_RDWR),
    +	    CAP_FTRUNCATE | CAP_READ | CAP_WRITE | CAP_LOOKUP, ret >= 0);
    +	CHECK(ret == -1 || close(ret) == 0);
    +	CHECK(unlinkat(dirfd, "cap_ftruncate", 0) == 0);
    +
    +	/*
    +	 * Note: this is not expected to work over NFS.
    +	 */
    +	ret = fchflags(fd_cap, UF_NODUMP);
    +	CHECK_RESULT(fchflags, CAP_FCHFLAGS,
    +	    ret == 0 || (is_nfs && errno == EOPNOTSUPP));
    +
    +#ifdef TODO	/* No such syscalls yet. */
    +	ret = openat(dirfd, "cap_fchflagsat", O_CREAT, 0600);
    +	CHECK(ret >= 0);
    +	CHECK(close(ret) == 0);
    +	ret = fchflagsat(dfd_cap, "cap_fchflagsat", UF_NODUMP, 0);
    +	CHECK_RESULT(fchflagsat, CAP_FCHFLAGSAT | CAP_LOOKUP, ret == 0);
    +	CHECK(unlinkat(dirfd, "cap_fchflagsat", 0) == 0);
    +#endif
    +
     	ret = fchown(fd_cap, -1, -1);
     	CHECK_RESULT(fchown, CAP_FCHOWN, ret == 0);
     
    +	ret = openat(dirfd, "cap_fchownat", O_CREAT, 0600);
    +	CHECK(ret >= 0);
    +	CHECK(close(ret) == 0);
    +	ret = fchownat(dfd_cap, "cap_fchownat", -1, -1, 0);
    +	CHECK_RESULT(fchownat, CAP_FCHOWN | CAP_LOOKUP, ret == 0);
    +	CHECK(unlinkat(dirfd, "cap_fchownat", 0) == 0);
    +
     	ret = fchmod(fd_cap, 0644);
     	CHECK_RESULT(fchmod, CAP_FCHMOD, ret == 0);
     
    +	ret = openat(dirfd, "cap_fchmodat", O_CREAT, 0600);
    +	CHECK(ret >= 0);
    +	CHECK(close(ret) == 0);
    +	ret = fchmodat(dfd_cap, "cap_fchmodat", 0600, 0);
    +	CHECK_RESULT(fchmodat, CAP_FCHMOD | CAP_LOOKUP, ret == 0);
    +	CHECK(unlinkat(dirfd, "cap_fchmodat", 0) == 0);
    +
    +	ret = fcntl(fd_cap, F_GETFL);
    +	CHECK_RESULT(fcntl(F_GETFL), CAP_FCNTL, ret >= 0);
    +	ret = fcntl(fd_cap, F_SETFL, ret);
    +	CHECK_RESULT(fcntl(F_SETFL), CAP_FCNTL, ret == 0);
    +
     	/* XXX flock */
     
    -	ret = ftruncate(fd_cap, 0);
    -	CHECK_RESULT(ftruncate, CAP_FTRUNCATE, ret == 0);
    +	ret = fstat(fd_cap, &sb);
    +	CHECK_RESULT(fstat, CAP_FSTAT, ret == 0);
    +
    +	ret = openat(dirfd, "cap_fstatat", O_CREAT, 0600);
    +	CHECK(ret >= 0);
    +	CHECK(close(ret) == 0);
    +	ret = fstatat(dfd_cap, "cap_fstatat", &sb, 0);
    +	CHECK_RESULT(fstatat, CAP_FSTAT | CAP_LOOKUP, ret == 0);
    +	CHECK(unlinkat(dirfd, "cap_fstatat", 0) == 0);
     
     	ret = fstatfs(fd_cap, &sf);
     	CHECK_RESULT(fstatfs, CAP_FSTATFS, ret == 0);
    @@ -197,6 +315,55 @@ try_file_ops(int fd, cap_rights_t rights
     	ret = futimes(fd_cap, NULL);
     	CHECK_RESULT(futimes, CAP_FUTIMES, ret == 0);
     
    +	ret = openat(dirfd, "cap_futimesat", O_CREAT, 0600);
    +	CHECK(ret >= 0);
    +	CHECK(close(ret) == 0);
    +	ret = futimesat(dfd_cap, "cap_futimesat", NULL);
    +	CHECK_RESULT(futimesat, CAP_FUTIMES | CAP_LOOKUP, ret == 0);
    +	CHECK(unlinkat(dirfd, "cap_futimesat", 0) == 0);
    +
    +	ret = openat(dirfd, "cap_linkat_src", O_CREAT, 0600);
    +	CHECK(ret >= 0);
    +	CHECK(close(ret) == 0);
    +	ret = linkat(dirfd, "cap_linkat_src", dfd_cap, "cap_linkat_dst", 0);
    +	CHECK_RESULT(linkat, CAP_LINKAT | CAP_LOOKUP, ret == 0);
    +	CHECK(unlinkat(dirfd, "cap_linkat_src", 0) == 0);
    +	CHECK(ret == -1 || unlinkat(dirfd, "cap_linkat_dst", 0) == 0);
    +
    +	ret = mkdirat(dfd_cap, "cap_mkdirat", 0700);
    +	CHECK_RESULT(mkdirat, CAP_MKDIRAT | CAP_LOOKUP, ret == 0);
    +	CHECK(ret == -1 || unlinkat(dirfd, "cap_mkdirat", AT_REMOVEDIR) == 0);
    +
    +	ret = mkfifoat(dfd_cap, "cap_mkfifoat", 0600);
    +	CHECK_RESULT(mkfifoat, CAP_MKFIFOAT | CAP_LOOKUP, ret == 0);
    +	CHECK(ret == -1 || unlinkat(dirfd, "cap_mkfifoat", 0) == 0);
    +
    +	ret = mknodat(dfd_cap, "cap_mknodat", S_IFCHR | 0600, 0);
    +	CHECK_RESULT(mknodat, CAP_MKNODAT | CAP_LOOKUP, ret == 0);
    +	CHECK(ret == -1 || unlinkat(dirfd, "cap_mknodat", 0) == 0);
    +
    +	/* TODO: renameat(2) */
    +
    +	ret = symlinkat("test", dfd_cap, "cap_symlinkat");
    +	CHECK_RESULT(symlinkat, CAP_SYMLINKAT | CAP_LOOKUP, ret == 0);
    +	CHECK(ret == -1 || unlinkat(dirfd, "cap_symlinkat", 0) == 0);
    +
    +	ret = openat(dirfd, "cap_unlinkat", O_CREAT, 0600);
    +	CHECK(ret >= 0);
    +	CHECK(close(ret) == 0);
    +	ret = unlinkat(dfd_cap, "cap_unlinkat", 0);
    +	CHECK_RESULT(unlinkat, CAP_UNLINKAT | CAP_LOOKUP, ret == 0);
    +	CHECK(ret == 0 || unlinkat(dirfd, "cap_unlinkat", 0) == 0);
    +	ret = mkdirat(dirfd, "cap_unlinkat", 0700);
    +	CHECK(ret == 0);
    +	ret = unlinkat(dfd_cap, "cap_unlinkat", AT_REMOVEDIR);
    +	CHECK_RESULT(unlinkat, CAP_UNLINKAT | CAP_LOOKUP, ret == 0);
    +	CHECK(ret == 0 || unlinkat(dirfd, "cap_unlinkat", AT_REMOVEDIR) == 0);
    +
    +	pollfd.fd = fd_cap;
    +	pollfd.events = POLLIN | POLLERR | POLLHUP;
    +	pollfd.revents = 0;
    +
     	ret = poll(&pollfd, 1, 0);
     	if (rights & CAP_POLL_EVENT)
     		CHECK((pollfd.revents & POLLNVAL) == 0);
    @@ -205,79 +372,159 @@ try_file_ops(int fd, cap_rights_t rights
     
     	/* XXX: select, kqueue */
     
    -	close (fd_cap);
    +	close(fd_cap);
    +	close(fd_capcap);
    +
    +	if (success == -1) {
    +		fprintf(stderr, "No tests for rights 0x%jx.\n",
    +		    (uintmax_t)rights);
    +		success = FAILED;
    +	}
     	return (success);
     }
     
    -#define TRY(fd, rights) \
    +#define TRY(rights) \
     do { \
     	if (success == PASSED) \
    -		success = try_file_ops(fd, rights); \
    +		success = try_file_ops(filefd, dirfd, (rights)); \
     	else \
     		/* We've already failed, but try the test anyway. */ \
    -		try_file_ops(fd, rights); \
    +		try_file_ops(filefd, dirfd, (rights)); \
     } while (0)
     
    +#define	KEEP_ERRNO(...)	do {						\
    +	int _saved_errno = errno;					\
    +	__VA_ARGS__;							\
    +	errno = _saved_errno;						\
    +} while (0);
    +
     int
     test_capabilities(void)
     {
    -	int fd;
    +	int filefd, dirfd, tmpfd;
     	int success = PASSED;
    +	char file[] = "/tmp/cap_test.XXXXXXXXXX";
    +	char dir[] = "/tmp/cap_test.XXXXXXXXXX";
     
    -	fd = open("/tmp/cap_test_capabilities", O_RDWR | O_CREAT, 0644);
    -	if (fd < 0)
    +	filefd = mkstemp(file);
    +	if (filefd < 0)
    +		err(-1, "mkstemp");
    +	if (mkdtemp(dir) == NULL) {
    +		KEEP_ERRNO(unlink(file));
    +		err(-1, "mkdtemp");
    +	}
    +	dirfd = open(dir, O_RDONLY | O_DIRECTORY);
    +	if (dirfd == -1) {
    +		KEEP_ERRNO(unlink(file));
    +		KEEP_ERRNO(rmdir(dir));
     		err(-1, "open");
    +	}
    +	tmpfd = open("/tmp", O_RDONLY | O_DIRECTORY);
    +	if (tmpfd == -1) {
    +		KEEP_ERRNO(unlink(file));
    +		KEEP_ERRNO(rmdir(dir));
    +		err(-1, "open");
    +	}
     
    -	if (cap_enter() < 0)
    +	if (cap_enter() == -1) {
    +		KEEP_ERRNO(unlink(file));
    +		KEEP_ERRNO(rmdir(dir));
     		err(-1, "cap_enter");
    +	}
     
    -	/* XXX: Really want to try all combinations. */
    -	TRY(fd, CAP_READ);
    -	TRY(fd, CAP_READ | CAP_SEEK);
    -	TRY(fd, CAP_WRITE);
    -	TRY(fd, CAP_WRITE | CAP_SEEK);
    -	TRY(fd, CAP_READ | CAP_WRITE);
    -	TRY(fd, CAP_READ | CAP_WRITE | CAP_SEEK);
    -	TRY(fd, CAP_SEEK);
    -	TRY(fd, CAP_FCHFLAGS);
    -	TRY(fd, CAP_IOCTL);
    -	TRY(fd, CAP_FSTAT);
    -	TRY(fd, CAP_MMAP);
    -	TRY(fd, CAP_MMAP | CAP_READ);
    -	TRY(fd, CAP_MMAP | CAP_WRITE);
    -	TRY(fd, CAP_MMAP | CAP_MAPEXEC);
    -	TRY(fd, CAP_MMAP | CAP_READ | CAP_WRITE);
    -	TRY(fd, CAP_MMAP | CAP_READ | CAP_MAPEXEC);
    -	TRY(fd, CAP_MMAP | CAP_MAPEXEC | CAP_WRITE);
    -	TRY(fd, CAP_MMAP | CAP_READ | CAP_WRITE | CAP_MAPEXEC);
    -	TRY(fd, CAP_FCNTL);
    -	TRY(fd, CAP_POST_EVENT);
    -	TRY(fd, CAP_POLL_EVENT);
    -	TRY(fd, CAP_FSYNC);
    -	TRY(fd, CAP_FCHOWN);
    -	TRY(fd, CAP_FCHMOD);
    -	TRY(fd, CAP_FTRUNCATE);
    -	TRY(fd, CAP_FLOCK);
    -	TRY(fd, CAP_FSTATFS);
    -	TRY(fd, CAP_FPATHCONF);
    -	TRY(fd, CAP_FUTIMES);
    -	TRY(fd, CAP_ACL_GET);
    -	TRY(fd, CAP_ACL_SET);
    -	TRY(fd, CAP_ACL_DELETE);
    -	TRY(fd, CAP_ACL_CHECK);
    -	TRY(fd, CAP_EXTATTR_GET);
    -	TRY(fd, CAP_EXTATTR_SET);
    -	TRY(fd, CAP_EXTATTR_DELETE);
    -	TRY(fd, CAP_EXTATTR_LIST);
    -	TRY(fd, CAP_MAC_GET);
    -	TRY(fd, CAP_MAC_SET);
    +	TRY(CAP_READ);
    +	TRY(CAP_WRITE);
    +	TRY(CAP_SEEK);
    +	TRY(CAP_PREAD);
    +	TRY(CAP_PWRITE);
    +	TRY(CAP_READ | CAP_WRITE);
    +	TRY(CAP_PREAD | CAP_PWRITE);
    +	TRY(CAP_MMAP);
    +	TRY(CAP_MMAP_R);
    +	TRY(CAP_MMAP_W);
    +	TRY(CAP_MMAP_X);
    +	TRY(CAP_MMAP_RW);
    +	TRY(CAP_MMAP_RX);
    +	TRY(CAP_MMAP_WX);
    +	TRY(CAP_MMAP_RWX);
    +	TRY(CAP_CREATE | CAP_READ | CAP_LOOKUP);
    +	TRY(CAP_CREATE | CAP_WRITE | CAP_LOOKUP);
    +	TRY(CAP_CREATE | CAP_READ | CAP_WRITE | CAP_LOOKUP);
    +#ifdef TODO
    +	TRY(CAP_FEXECVE);
    +#endif
    +	TRY(CAP_FSYNC);
    +	TRY(CAP_FSYNC | CAP_READ | CAP_LOOKUP);
    +	TRY(CAP_FSYNC | CAP_WRITE | CAP_LOOKUP);
    +	TRY(CAP_FSYNC | CAP_READ | CAP_WRITE | CAP_LOOKUP);
    +	TRY(CAP_FTRUNCATE);
    +	TRY(CAP_FTRUNCATE | CAP_READ | CAP_LOOKUP);
    +	TRY(CAP_FTRUNCATE | CAP_WRITE | CAP_LOOKUP);
    +	TRY(CAP_FTRUNCATE | CAP_READ | CAP_WRITE | CAP_LOOKUP);
    +#ifdef TODO
    +	TRY(CAP_FCHDIR);
    +#endif
    +	TRY(CAP_FCHFLAGS);
    +	TRY(CAP_FCHOWN);
    +	TRY(CAP_FCHOWN | CAP_LOOKUP);
    +	TRY(CAP_FCHMOD | CAP_LOOKUP);
    +	TRY(CAP_FCNTL);
    +#ifdef TODO
    +	TRY(CAP_FLOCK);
    +#endif
    +	TRY(CAP_FPATHCONF);
    +#ifdef TODO
    +	TRY(CAP_FSCK);
    +#endif
    +	TRY(CAP_FSTAT | CAP_LOOKUP);
    +	TRY(CAP_FSTATFS);
    +	TRY(CAP_FUTIMES | CAP_LOOKUP);
    +	TRY(CAP_LINKAT | CAP_LOOKUP);
    +	TRY(CAP_MKDIRAT | CAP_LOOKUP);
    +	TRY(CAP_MKFIFOAT | CAP_LOOKUP);
    +	TRY(CAP_MKNODAT | CAP_LOOKUP);
    +	TRY(CAP_SYMLINKAT | CAP_LOOKUP);
    +	TRY(CAP_UNLINKAT | CAP_LOOKUP);
    +	/* Rename needs CAP_RENAMEAT on source directory and CAP_LINKAT on destination directory. */
    +	TRY(CAP_RENAMEAT | CAP_UNLINKAT | CAP_LOOKUP);
    +#ifdef TODO
    +	TRY(CAP_LOOKUP);
    +	TRY(CAP_EXTATTR_DELETE);
    +	TRY(CAP_EXTATTR_GET);
    +	TRY(CAP_EXTATTR_LIST);
    +	TRY(CAP_EXTATTR_SET);
    +	TRY(CAP_ACL_CHECK);
    +	TRY(CAP_ACL_DELETE);
    +	TRY(CAP_ACL_GET);
    +	TRY(CAP_ACL_SET);
    +	TRY(CAP_ACCEPT);
    +	TRY(CAP_BIND);
    +	TRY(CAP_CONNECT);
    +	TRY(CAP_GETPEERNAME);
    +	TRY(CAP_GETSOCKNAME);
    +	TRY(CAP_GETSOCKOPT);
    +	TRY(CAP_LISTEN);
    +	TRY(CAP_PEELOFF);
    +	TRY(CAP_RECV);
    +	TRY(CAP_SEND);
    +	TRY(CAP_SETSOCKOPT);
    +	TRY(CAP_SHUTDOWN);
    +	TRY(CAP_MAC_GET);
    +	TRY(CAP_MAC_SET);
    +	TRY(CAP_SEM_GETVALUE);
    +	TRY(CAP_SEM_POST);
    +	TRY(CAP_SEM_WAIT);
    +	TRY(CAP_POST_EVENT);
    +	TRY(CAP_POLL_EVENT);
    +	TRY(CAP_IOCTL);
    +	TRY(CAP_TTYHOOK);
    +	TRY(CAP_PDGETPID);
    +	TRY(CAP_PDWAIT);
    +	TRY(CAP_PDKILL);
    +#endif
     
    -	/*
    -	 * Socket-specific.
    -	 */
    -	TRY(fd, CAP_GETPEERNAME);
    -	TRY(fd, CAP_GETSOCKNAME);
    -	TRY(fd, CAP_ACCEPT);
    +	(void)unlinkat(tmpfd, file + strlen("/tmp/"), 0);
    +	(void)unlinkat(tmpfd, dir + strlen("/tmp/"), AT_REMOVEDIR);
     
     	return (success);
     }
    
    Modified: head/tools/regression/security/cap_test/cap_test_relative.c
    ==============================================================================
    --- head/tools/regression/security/cap_test/cap_test_relative.c	Sat Mar  2 00:55:09 2013	(r247604)
    +++ head/tools/regression/security/cap_test/cap_test_relative.c	Sat Mar  2 00:56:53 2013	(r247605)
    @@ -61,7 +61,8 @@ test_relative(void)
     	cap_rights_t rights;
     
     	REQUIRE(etc = open("/etc/", O_RDONLY));
    -	CHECK_SYSCALL_FAILS(EINVAL, cap_getrights, etc, &rights);
    +	CHECK_SYSCALL_SUCCEEDS(cap_getrights, etc, &rights);
    +	CHECK_RIGHTS(rights, CAP_ALL);
     
     	MAKE_CAPABILITY(etc_cap, etc, CAP_READ);
     	MAKE_CAPABILITY(etc_cap_ro, etc, CAP_READ | CAP_LOOKUP);
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 01:00:27 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id C76BB889;
     Sat,  2 Mar 2013 01:00:27 +0000 (UTC) (envelope-from pjd@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 B8B1E1FA8;
     Sat,  2 Mar 2013 01:00:27 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2210RIk064836;
     Sat, 2 Mar 2013 01:00:27 GMT (envelope-from pjd@svn.freebsd.org)
    Received: (from pjd@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2210RLG064831;
     Sat, 2 Mar 2013 01:00:27 GMT (envelope-from pjd@svn.freebsd.org)
    Message-Id: <201303020100.r2210RLG064831@svn.freebsd.org>
    From: Pawel Jakub Dawidek 
    Date: Sat, 2 Mar 2013 01:00:27 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247606 - in head/tools/regression/capsicum: . syscalls
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 01:00:27 -0000
    
    Author: pjd
    Date: Sat Mar  2 01:00:26 2013
    New Revision: 247606
    URL: http://svnweb.freebsd.org/changeset/base/247606
    
    Log:
      Add regression tests for the new Capsicum system calls.
      
      Sponsored by:	The FreeBSD Foundation
    
    Added:
      head/tools/regression/capsicum/
      head/tools/regression/capsicum/syscalls/
      head/tools/regression/capsicum/syscalls/Makefile   (contents, props changed)
      head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c   (contents, props changed)
      head/tools/regression/capsicum/syscalls/cap_getmode.c   (contents, props changed)
      head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c   (contents, props changed)
      head/tools/regression/capsicum/syscalls/misc.c   (contents, props changed)
      head/tools/regression/capsicum/syscalls/misc.h   (contents, props changed)
    
    Added: head/tools/regression/capsicum/syscalls/Makefile
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/tools/regression/capsicum/syscalls/Makefile	Sat Mar  2 01:00:26 2013	(r247606)
    @@ -0,0 +1,28 @@
    +# $FreeBSD$
    +
    +SYSCALLS=	cap_fcntls_limit cap_getmode cap_ioctls_limit
    +
    +CFLAGS=		-O2 -pipe -std=gnu99 -fstack-protector
    +CFLAGS+=	-Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter
    +CFLAGS+=	-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type
    +CFLAGS+=	-Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter
    +CFLAGS+=	-Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls
    +CFLAGS+=	-Wold-style-definition -Wno-pointer-sign
    +
    +all:	${SYSCALLS} ${SYSCALLS:=.t}
    +
    +.for SYSCALL in ${SYSCALLS}
    +
    +${SYSCALL}:	${SYSCALL}.c misc.c
    +	${CC} ${CFLAGS} ${@}.c misc.c -o $@
    +
    +${SYSCALL}.t:	${SYSCALL}
    +	@printf "#!/bin/sh\n\n%s/%s\n" ${.CURDIR} ${@:.t=} > $@
    +
    +.endfor
    +
    +test:	all
    +	@prove -r ${.CURDIR}
    +
    +clean:
    +	rm -f ${SYSCALLS} ${SYSCALLS:=.t}
    
    Added: head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c	Sat Mar  2 01:00:26 2013	(r247606)
    @@ -0,0 +1,540 @@
    +/*-
    + * Copyright (c) 2012 The FreeBSD Foundation
    + * All rights reserved.
    + *
    + * This software was developed by Pawel Jakub Dawidek under sponsorship from
    + * the FreeBSD Foundation.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in the
    + *    documentation and/or other materials provided with the distribution.
    + *
    + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
    + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
    + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + */
    +
    +#include 
    +__FBSDID("$FreeBSD$");
    +
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +#include "misc.h"
    +
    +static void
    +fcntl_tests_0(int fd)
    +{
    +	uint32_t fcntlrights;
    +
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == CAP_FCNTL_ALL);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(fcntl(fd, F_SETFD, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +
    +	CHECK(fcntl(fd, F_GETFL) == O_RDWR);
    +	CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == 0);
    +	CHECK(fcntl(fd, F_GETFL) == (O_RDWR | O_NONBLOCK));
    +	CHECK(fcntl(fd, F_SETFL, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFL) == O_RDWR);
    +
    +	errno = 0;
    +	CHECK(cap_fcntls_limit(fd, ~CAP_FCNTL_ALL) == -1);
    +	CHECK(errno == EINVAL);
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == 0);
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == (CAP_FCNTL_GETFL | CAP_FCNTL_SETFL));
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == 0);
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == (CAP_FCNTL_GETFL | CAP_FCNTL_SETFL));
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(fcntl(fd, F_SETFD, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +
    +	CHECK(fcntl(fd, F_GETFL) == O_RDWR);
    +	CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == 0);
    +	CHECK(fcntl(fd, F_GETFL) == (O_RDWR | O_NONBLOCK));
    +	CHECK(fcntl(fd, F_SETFL, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFL) == O_RDWR);
    +
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == 0);
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == CAP_FCNTL_GETFL);
    +	errno = 0;
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == CAP_FCNTL_GETFL);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(fcntl(fd, F_SETFD, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +
    +	CHECK(fcntl(fd, F_GETFL) == O_RDWR);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(fcntl(fd, F_GETFL) == O_RDWR);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_SETFL, 0) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(fcntl(fd, F_GETFL) == O_RDWR);
    +
    +	CHECK(cap_fcntls_limit(fd, 0) == 0);
    +	fcntlrights = CAP_FCNTL_ALL;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == 0);
    +	errno = 0;
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	fcntlrights = CAP_FCNTL_ALL;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == 0);
    +	errno = 0;
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	fcntlrights = CAP_FCNTL_ALL;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == 0);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(fcntl(fd, F_SETFD, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +
    +	errno = 0;
    +	CHECK(fcntl(fd, F_GETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_SETFL, 0) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_GETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +}
    +
    +static void
    +fcntl_tests_1(int fd)
    +{
    +	uint32_t fcntlrights;
    +
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == 0);
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == CAP_FCNTL_GETFL);
    +
    +	CHECK(cap_rights_limit(fd, CAP_ALL & ~CAP_FCNTL) == 0);
    +
    +	fcntlrights = CAP_FCNTL_ALL;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == 0);
    +
    +	errno = 0;
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	fcntlrights = CAP_FCNTL_ALL;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == 0);
    +	errno = 0;
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	fcntlrights = CAP_FCNTL_ALL;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == 0);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(fcntl(fd, F_SETFD, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +
    +	errno = 0;
    +	CHECK(fcntl(fd, F_GETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_SETFL, 0) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_GETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +}
    +
    +static void
    +fcntl_tests_2(int fd)
    +{
    +	uint32_t fcntlrights;
    +
    +	CHECK(cap_rights_limit(fd, CAP_ALL & ~CAP_FCNTL) == 0);
    +
    +	fcntlrights = CAP_FCNTL_ALL;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == 0);
    +
    +	errno = 0;
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	fcntlrights = CAP_FCNTL_ALL;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == 0);
    +	errno = 0;
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	fcntlrights = CAP_FCNTL_ALL;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == 0);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(fcntl(fd, F_SETFD, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +
    +	errno = 0;
    +	CHECK(fcntl(fd, F_GETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_SETFL, 0) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_GETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +}
    +
    +static void
    +fcntl_tests_send_0(int sock)
    +{
    +	int fd;
    +
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	CHECK(descriptor_send(sock, fd) == 0);
    +	CHECK(close(fd) == 0);
    +
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == 0);
    +	CHECK(descriptor_send(sock, fd) == 0);
    +	CHECK(close(fd) == 0);
    +
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == 0);
    +	CHECK(descriptor_send(sock, fd) == 0);
    +	CHECK(close(fd) == 0);
    +
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	CHECK(cap_fcntls_limit(fd, 0) == 0);
    +	CHECK(descriptor_send(sock, fd) == 0);
    +	CHECK(close(fd) == 0);
    +}
    +
    +static void
    +fcntl_tests_recv_0(int sock)
    +{
    +	uint32_t fcntlrights;
    +	int fd;
    +
    +	CHECK(descriptor_recv(sock, &fd) == 0);
    +
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == CAP_FCNTL_ALL);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(fcntl(fd, F_SETFD, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +
    +	CHECK(fcntl(fd, F_GETFL) == O_RDWR);
    +	CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == 0);
    +	CHECK(fcntl(fd, F_GETFL) == (O_RDWR | O_NONBLOCK));
    +	CHECK(fcntl(fd, F_SETFL, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFL) == O_RDWR);
    +
    +	CHECK(close(fd) == 0);
    +
    +	CHECK(descriptor_recv(sock, &fd) == 0);
    +
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == (CAP_FCNTL_GETFL | CAP_FCNTL_SETFL));
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == 0);
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == (CAP_FCNTL_GETFL | CAP_FCNTL_SETFL));
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(fcntl(fd, F_SETFD, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +
    +	CHECK(fcntl(fd, F_GETFL) == O_RDWR);
    +	CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == 0);
    +	CHECK(fcntl(fd, F_GETFL) == (O_RDWR | O_NONBLOCK));
    +	CHECK(fcntl(fd, F_SETFL, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFL) == O_RDWR);
    +
    +	CHECK(close(fd) == 0);
    +
    +	CHECK(descriptor_recv(sock, &fd) == 0);
    +
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == CAP_FCNTL_GETFL);
    +	errno = 0;
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == CAP_FCNTL_GETFL);
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == 0);
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == CAP_FCNTL_GETFL);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(fcntl(fd, F_SETFD, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +
    +	CHECK(fcntl(fd, F_GETFL) == O_RDWR);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(fcntl(fd, F_GETFL) == O_RDWR);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_SETFL, 0) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(fcntl(fd, F_GETFL) == O_RDWR);
    +
    +	CHECK(close(fd) == 0);
    +
    +	CHECK(descriptor_recv(sock, &fd) == 0);
    +
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == 0);
    +	errno = 0;
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == 0);
    +	errno = 0;
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == 0);
    +	errno = 0;
    +	CHECK(cap_fcntls_limit(fd, CAP_FCNTL_SETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	fcntlrights = 0;
    +	CHECK(cap_fcntls_get(fd, &fcntlrights) == 0);
    +	CHECK(fcntlrights == 0);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(fcntl(fd, F_SETFD, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +
    +	errno = 0;
    +	CHECK(fcntl(fd, F_GETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_SETFL, O_NONBLOCK) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_SETFL, 0) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	errno = 0;
    +	CHECK(fcntl(fd, F_GETFL) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +
    +	CHECK(close(fd) == 0);
    +}
    +
    +int
    +main(void)
    +{
    +	int fd, pfd, sp[2];
    +	pid_t pid;
    +
    +	printf("1..870\n");
    +
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	fcntl_tests_0(fd);
    +	CHECK(close(fd) == 0);
    +
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	fcntl_tests_1(fd);
    +	CHECK(close(fd) == 0);
    +
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	fcntl_tests_2(fd);
    +	CHECK(close(fd) == 0);
    +
    +	/* Child inherits descriptor and operates on it first. */
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	CHECK((pid = fork()) >= 0);
    +	if (pid == 0) {
    +		fcntl_tests_0(fd);
    +		CHECK(close(fd) == 0);
    +		exit(0);
    +	} else {
    +		CHECK(waitpid(pid, NULL, 0) == pid);
    +		fcntl_tests_0(fd);
    +	}
    +	CHECK(close(fd) == 0);
    +
    +	/* Child inherits descriptor, but operates on it after parent. */
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	CHECK((pid = fork()) >= 0);
    +	if (pid == 0) {
    +		sleep(1);
    +		fcntl_tests_0(fd);
    +		CHECK(close(fd) == 0);
    +		exit(0);
    +	} else {
    +		fcntl_tests_0(fd);
    +		CHECK(waitpid(pid, NULL, 0) == pid);
    +	}
    +	CHECK(close(fd) == 0);
    +
    +	/* Child inherits descriptor and operates on it first. */
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	CHECK((pid = pdfork(&pfd, 0)) >= 0);
    +	if (pid == 0) {
    +		fcntl_tests_1(fd);
    +		exit(0);
    +	} else {
    +		CHECK(pdwait(pfd) == 0);
    +/*
    +		It fails with EBADF, which I believe is a bug.
    +		CHECK(close(pfd) == 0);
    +*/
    +		fcntl_tests_1(fd);
    +	}
    +	CHECK(close(fd) == 0);
    +
    +	/* Child inherits descriptor, but operates on it after parent. */
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	CHECK((pid = pdfork(&pfd, 0)) >= 0);
    +	if (pid == 0) {
    +		sleep(1);
    +		fcntl_tests_1(fd);
    +		exit(0);
    +	} else {
    +		fcntl_tests_1(fd);
    +		CHECK(pdwait(pfd) == 0);
    +/*
    +		It fails with EBADF, which I believe is a bug.
    +		CHECK(close(pfd) == 0);
    +*/
    +	}
    +	CHECK(close(fd) == 0);
    +
    +	/* Child inherits descriptor and operates on it first. */
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	CHECK((pid = fork()) >= 0);
    +	if (pid == 0) {
    +		fcntl_tests_2(fd);
    +		exit(0);
    +	} else {
    +		CHECK(waitpid(pid, NULL, 0) == pid);
    +		fcntl_tests_2(fd);
    +	}
    +	CHECK(close(fd) == 0);
    +
    +	/* Child inherits descriptor, but operates on it after parent. */
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	CHECK((pid = fork()) >= 0);
    +	if (pid == 0) {
    +		sleep(1);
    +		fcntl_tests_2(fd);
    +		exit(0);
    +	} else {
    +		fcntl_tests_2(fd);
    +		CHECK(waitpid(pid, NULL, 0) == pid);
    +	}
    +	CHECK(close(fd) == 0);
    +
    +	/* Send descriptors from parent to child. */
    +	CHECK(socketpair(AF_UNIX, SOCK_STREAM, 0, sp) == 0);
    +	CHECK((pid = fork()) >= 0);
    +	if (pid == 0) {
    +		CHECK(close(sp[0]) == 0);
    +		fcntl_tests_recv_0(sp[1]);
    +		CHECK(close(sp[1]) == 0);
    +		exit(0);
    +	} else {
    +		CHECK(close(sp[1]) == 0);
    +		fcntl_tests_send_0(sp[0]);
    +		CHECK(waitpid(pid, NULL, 0) == pid);
    +		CHECK(close(sp[0]) == 0);
    +	}
    +
    +	/* Send descriptors from child to parent. */
    +	CHECK(socketpair(AF_UNIX, SOCK_STREAM, 0, sp) == 0);
    +	CHECK((pid = fork()) >= 0);
    +	if (pid == 0) {
    +		CHECK(close(sp[0]) == 0);
    +		fcntl_tests_send_0(sp[1]);
    +		CHECK(close(sp[1]) == 0);
    +		exit(0);
    +	} else {
    +		CHECK(close(sp[1]) == 0);
    +		fcntl_tests_recv_0(sp[0]);
    +		CHECK(waitpid(pid, NULL, 0) == pid);
    +		CHECK(close(sp[0]) == 0);
    +	}
    +
    +	exit(0);
    +}
    
    Added: head/tools/regression/capsicum/syscalls/cap_getmode.c
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/tools/regression/capsicum/syscalls/cap_getmode.c	Sat Mar  2 01:00:26 2013	(r247606)
    @@ -0,0 +1,167 @@
    +/*-
    + * Copyright (c) 2012 The FreeBSD Foundation
    + * All rights reserved.
    + *
    + * This software was developed by Pawel Jakub Dawidek under sponsorship from
    + * the FreeBSD Foundation.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in the
    + *    documentation and/or other materials provided with the distribution.
    + *
    + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
    + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
    + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + */
    +
    +#include 
    +__FBSDID("$FreeBSD$");
    +
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +#include "misc.h"
    +
    +int
    +main(void)
    +{
    +	unsigned int mode;
    +	pid_t pid;
    +	int pfd;
    +
    +	printf("1..27\n");
    +
    +	mode = 666;
    +	CHECK(cap_getmode(&mode) == 0);
    +	/* If cap_getmode() succeeded mode should be modified. */
    +	CHECK(mode != 666);
    +	/* We are not in capability mode. */
    +	CHECK(mode == 0);
    +
    +	/* Expect EFAULT. */
    +	errno = 0;
    +	CHECK(cap_getmode(NULL) == -1);
    +	CHECK(errno == EFAULT);
    +	errno = 0;
    +	CHECK(cap_getmode((void *)(uintptr_t)0xdeadc0de) == -1);
    +	CHECK(errno == EFAULT);
    +
    +	/* If parent is not in capability mode, child after fork() also won't be. */
    +	pid = fork();
    +	switch (pid) {
    +	case -1:
    +		err(1, "fork() failed");
    +	case 0:
    +		mode = 666;
    +		CHECK(cap_getmode(&mode) == 0);
    +		/* If cap_getmode() succeeded mode should be modified. */
    +		CHECK(mode != 666);
    +		/* We are not in capability mode. */
    +		CHECK(mode == 0);
    +		exit(0);
    +	default:
    +		if (waitpid(pid, NULL, 0) == -1)
    +			err(1, "waitpid() failed");
    +	}
    +
    +	/* If parent is not in capability mode, child after pdfork() also won't be. */
    +	pid = pdfork(&pfd, 0);
    +	switch (pid) {
    +	case -1:
    +		err(1, "pdfork() failed");
    +	case 0:
    +		mode = 666;
    +		CHECK(cap_getmode(&mode) == 0);
    +		/* If cap_getmode() succeeded mode should be modified. */
    +		CHECK(mode != 666);
    +		/* We are not in capability mode. */
    +		CHECK(mode == 0);
    +		exit(0);
    +	default:
    +		if (pdwait(pfd) == -1)
    +			err(1, "pdwait() failed");
    +		close(pfd);
    +	}
    +
    +	/* In capability mode... */
    +
    +	CHECK(cap_enter() == 0);
    +
    +	mode = 666;
    +	CHECK(cap_getmode(&mode) == 0);
    +	/* If cap_getmode() succeeded mode should be modified. */
    +	CHECK(mode != 666);
    +	/* We are in capability mode. */
    +	CHECK(mode == 1);
    +
    +	/* Expect EFAULT. */
    +	errno = 0;
    +	CHECK(cap_getmode(NULL) == -1);
    +	CHECK(errno == EFAULT);
    +	errno = 0;
    +	CHECK(cap_getmode((void *)(uintptr_t)0xdeadc0de) == -1);
    +	CHECK(errno == EFAULT);
    +
    +	/* If parent is in capability mode, child after fork() also will be. */
    +	pid = fork();
    +	switch (pid) {
    +	case -1:
    +		err(1, "fork() failed");
    +	case 0:
    +		mode = 666;
    +		CHECK(cap_getmode(&mode) == 0);
    +		/* If cap_getmode() succeeded mode should be modified. */
    +		CHECK(mode != 666);
    +		/* We are in capability mode. */
    +		CHECK(mode == 1);
    +		exit(0);
    +	default:
    +		/*
    +		 * wait(2) and friends are not permitted in the capability mode,
    +		 * so we can only just wait for a while.
    +		 */
    +		sleep(1);
    +	}
    +
    +	/* If parent is in capability mode, child after pdfork() also will be. */
    +	pid = pdfork(&pfd, 0);
    +	switch (pid) {
    +	case -1:
    +		err(1, "pdfork() failed");
    +	case 0:
    +		mode = 666;
    +		CHECK(cap_getmode(&mode) == 0);
    +		/* If cap_getmode() succeeded mode should be modified. */
    +		CHECK(mode != 666);
    +		/* We are in capability mode. */
    +		CHECK(mode == 1);
    +		exit(0);
    +	default:
    +		if (pdwait(pfd) == -1)
    +			err(1, "pdwait() failed");
    +		close(pfd);
    +	}
    +
    +	exit(0);
    +}
    
    Added: head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c	Sat Mar  2 01:00:26 2013	(r247606)
    @@ -0,0 +1,462 @@
    +/*-
    + * Copyright (c) 2012 The FreeBSD Foundation
    + * All rights reserved.
    + *
    + * This software was developed by Pawel Jakub Dawidek under sponsorship from
    + * the FreeBSD Foundation.
    + *
    + * Redistribution and use in source and binary forms, with or without
    + * modification, are permitted provided that the following conditions
    + * are met:
    + * 1. Redistributions of source code must retain the above copyright
    + *    notice, this list of conditions and the following disclaimer.
    + * 2. Redistributions in binary form must reproduce the above copyright
    + *    notice, this list of conditions and the following disclaimer in the
    + *    documentation and/or other materials provided with the distribution.
    + *
    + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
    + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
    + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    + * SUCH DAMAGE.
    + */
    +
    +#include 
    +__FBSDID("$FreeBSD$");
    +
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +#include "misc.h"
    +
    +static void
    +ioctl_tests_0(int fd)
    +{
    +	unsigned long cmds[2];
    +
    +	CHECK(cap_ioctls_get(fd, NULL, 0) == INT_MAX);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(ioctl(fd, FIOCLEX) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(ioctl(fd, FIONCLEX) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +
    +	cmds[0] = FIOCLEX;
    +	cmds[1] = FIONCLEX;
    +	CHECK(cap_ioctls_limit(fd, cmds, nitems(cmds)) == 0);
    +	cmds[0] = cmds[1] = 0;
    +	CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == nitems(cmds));
    +	CHECK((cmds[0] == FIOCLEX && cmds[1] == FIONCLEX) ||
    +	    (cmds[0] == FIONCLEX && cmds[1] == FIOCLEX));
    +	cmds[0] = FIOCLEX;
    +	cmds[1] = FIONCLEX;
    +	CHECK(cap_ioctls_limit(fd, cmds, nitems(cmds)) == 0);
    +	cmds[0] = cmds[1] = 0;
    +	CHECK(cap_ioctls_get(fd, cmds, 1) == nitems(cmds));
    +	CHECK(cmds[0] == FIOCLEX || cmds[0] == FIONCLEX);
    +	CHECK(cmds[1] == 0);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(ioctl(fd, FIOCLEX) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(ioctl(fd, FIONCLEX) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +
    +	cmds[0] = FIOCLEX;
    +	CHECK(cap_ioctls_limit(fd, cmds, 1) == 0);
    +	cmds[0] = cmds[1] = 0;
    +	CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 1);
    +	CHECK(cmds[0] == FIOCLEX);
    +	cmds[0] = FIOCLEX;
    +	cmds[1] = FIONCLEX;
    +	errno = 0;
    +	CHECK(cap_ioctls_limit(fd, cmds, nitems(cmds)) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	cmds[0] = cmds[1] = 0;
    +	CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 1);
    +	CHECK(cmds[0] == FIOCLEX);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(ioctl(fd, FIOCLEX) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	errno = 0;
    +	CHECK(ioctl(fd, FIONCLEX) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(fcntl(fd, F_SETFD, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +
    +	CHECK(cap_ioctls_limit(fd, NULL, 0) == 0);
    +	CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
    +	cmds[0] = FIOCLEX;
    +	errno = 0;
    +	CHECK(cap_ioctls_limit(fd, cmds, 1) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	errno = 0;
    +	CHECK(ioctl(fd, FIOCLEX) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	errno = 0;
    +	CHECK(ioctl(fd, FIONCLEX) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(fcntl(fd, F_SETFD, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +}
    +
    +static void
    +ioctl_tests_1(int fd)
    +{
    +	unsigned long cmds[2];
    +
    +	cmds[0] = FIOCLEX;
    +	CHECK(cap_ioctls_limit(fd, cmds, 1) == 0);
    +	cmds[0] = cmds[1] = 0;
    +	CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 1);
    +	CHECK(cmds[0] == FIOCLEX);
    +	CHECK(cmds[1] == 0);
    +
    +	CHECK(cap_rights_limit(fd, CAP_ALL & ~CAP_IOCTL) == 0);
    +	CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
    +
    +	cmds[0] = FIOCLEX;
    +	cmds[1] = FIONCLEX;
    +	errno = 0;
    +	CHECK(cap_ioctls_limit(fd, cmds, nitems(cmds)) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
    +	cmds[0] = FIOCLEX;
    +	errno = 0;
    +	CHECK(cap_ioctls_limit(fd, cmds, 1) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	errno = 0;
    +	CHECK(ioctl(fd, FIOCLEX) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	errno = 0;
    +	CHECK(ioctl(fd, FIONCLEX) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(fcntl(fd, F_SETFD, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +}
    +
    +static void
    +ioctl_tests_2(int fd)
    +{
    +	unsigned long cmds[2];
    +
    +	CHECK(cap_rights_limit(fd, CAP_ALL & ~CAP_IOCTL) == 0);
    +	CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
    +
    +	cmds[0] = FIOCLEX;
    +	cmds[1] = FIONCLEX;
    +	errno = 0;
    +	CHECK(cap_ioctls_limit(fd, cmds, nitems(cmds)) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
    +	cmds[0] = FIOCLEX;
    +	errno = 0;
    +	CHECK(cap_ioctls_limit(fd, cmds, 1) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	errno = 0;
    +	CHECK(ioctl(fd, FIOCLEX) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(fcntl(fd, F_SETFD, FD_CLOEXEC) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	errno = 0;
    +	CHECK(ioctl(fd, FIONCLEX) == -1);
    +	CHECK(errno == ENOTCAPABLE);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(fcntl(fd, F_SETFD, 0) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +}
    +
    +static void
    +ioctl_tests_send_0(int sock)
    +{
    +	unsigned long cmds[2];
    +	int fd;
    +
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	CHECK(descriptor_send(sock, fd) == 0);
    +	CHECK(close(fd) == 0);
    +
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	cmds[0] = FIOCLEX;
    +	cmds[1] = FIONCLEX;
    +	CHECK(cap_ioctls_limit(fd, cmds, nitems(cmds)) == 0);
    +	CHECK(descriptor_send(sock, fd) == 0);
    +	CHECK(close(fd) == 0);
    +
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	cmds[0] = FIOCLEX;
    +	CHECK(cap_ioctls_limit(fd, cmds, 1) == 0);
    +	CHECK(descriptor_send(sock, fd) == 0);
    +	CHECK(close(fd) == 0);
    +
    +	CHECK((fd = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0);
    +	CHECK(cap_ioctls_limit(fd, NULL, 0) == 0);
    +	CHECK(descriptor_send(sock, fd) == 0);
    +	CHECK(close(fd) == 0);
    +}
    +
    +static void
    +ioctl_tests_recv_0(int sock)
    +{
    +	unsigned long cmds[2];
    +	int fd;
    +
    +	CHECK(descriptor_recv(sock, &fd) == 0);
    +
    +	CHECK(cap_ioctls_get(fd, NULL, 0) == INT_MAX);
    +
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +	CHECK(ioctl(fd, FIOCLEX) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == FD_CLOEXEC);
    +	CHECK(ioctl(fd, FIONCLEX) == 0);
    +	CHECK(fcntl(fd, F_GETFD) == 0);
    +
    +	CHECK(close(fd) == 0);
    +
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 01:04:03 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 958C4A30;
     Sat,  2 Mar 2013 01:04:03 +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 71BB11FC7;
     Sat,  2 Mar 2013 01:04:03 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22143xd067087;
     Sat, 2 Mar 2013 01:04:03 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22143Dm067086;
     Sat, 2 Mar 2013 01:04:03 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201303020104.r22143Dm067086@svn.freebsd.org>
    From: Xin LI 
    Date: Sat, 2 Mar 2013 01:04: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: r247607 - in stable: 8 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-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 01:04:03 -0000
    
    Author: delphij
    Date: Sat Mar  2 01:04:02 2013
    New Revision: 247607
    URL: http://svnweb.freebsd.org/changeset/base/247607
    
    Log:
      MFC r247422:
      
      Add a reminder that the user should update boot block if they are upgrading
      their existing system and use LZ4 compression for ZFS.
      
      Suggested by:	mm
    
    Modified:
      stable/9/UPDATING   (contents, props changed)
    
    Changes in other areas also in this revision:
    Modified:
      stable/8/UPDATING   (contents, props changed)
    
    Modified: stable/9/UPDATING
    ==============================================================================
    --- stable/9/UPDATING	Sat Mar  2 01:00:26 2013	(r247606)
    +++ stable/9/UPDATING	Sat Mar  2 01:04:02 2013	(r247607)
    @@ -11,6 +11,13 @@ handbook:
     Items affecting the ports and packages system can be found in
     /usr/ports/UPDATING.  Please read that file before running portupgrade.
     
    +20130225:
    +	A new compression method (lz4) has been merged to.  Please refer to
    +	zpool-features(7) for more information.
    +
    +	Please refer to the "ZFS notes" section of this file for information
    +	on upgrading boot ZFS pools.
    +
     20121224:
     	The VFS KBI was changed with the merge of several nullfs
     	optimizations and fixes.  All filesystem modules must be
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 01:04:03 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id D3DE0A31;
     Sat,  2 Mar 2013 01:04:03 +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 C634D1FC8;
     Sat,  2 Mar 2013 01:04:03 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r221433a067093;
     Sat, 2 Mar 2013 01:04:03 GMT (envelope-from delphij@svn.freebsd.org)
    Received: (from delphij@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22143jI067092;
     Sat, 2 Mar 2013 01:04:03 GMT (envelope-from delphij@svn.freebsd.org)
    Message-Id: <201303020104.r22143jI067092@svn.freebsd.org>
    From: Xin LI 
    Date: Sat, 2 Mar 2013 01:04:03 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247607 - in stable: 8 9
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 01:04:03 -0000
    
    Author: delphij
    Date: Sat Mar  2 01:04:02 2013
    New Revision: 247607
    URL: http://svnweb.freebsd.org/changeset/base/247607
    
    Log:
      MFC r247422:
      
      Add a reminder that the user should update boot block if they are upgrading
      their existing system and use LZ4 compression for ZFS.
      
      Suggested by:	mm
    
    Modified:
      stable/8/UPDATING   (contents, props changed)
    
    Changes in other areas also in this revision:
    Modified:
      stable/9/UPDATING   (contents, props changed)
    
    Modified: stable/8/UPDATING
    ==============================================================================
    --- stable/8/UPDATING	Sat Mar  2 01:00:26 2013	(r247606)
    +++ stable/8/UPDATING	Sat Mar  2 01:04:02 2013	(r247607)
    @@ -15,6 +15,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
     	debugging tools present in HEAD were left in place because
     	sun4v support still needs work to become production ready.
     
    +20130225:
    +	A new compression method (lz4) has been merged.  Please refer to
    +	zpool-features(7) for more information.
    +
    +	Please refer to the "ZFS notes" section of this file for information
    +	on upgrading boot ZFS pools.
    +
     20121130:
     	A new version of ZFS (pool version 5000) has been merged to 8-STABLE.
     	Starting with this version the old system of ZFS pool versioning
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 02:19:05 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 125E8C66;
     Sat,  2 Mar 2013 02:19:05 +0000 (UTC)
     (envelope-from andrew@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 EF2D3286;
     Sat,  2 Mar 2013 02:19:04 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r222J4Ni090048;
     Sat, 2 Mar 2013 02:19:04 GMT (envelope-from andrew@svn.freebsd.org)
    Received: (from andrew@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r222J4hZ090047;
     Sat, 2 Mar 2013 02:19:04 GMT (envelope-from andrew@svn.freebsd.org)
    Message-Id: <201303020219.r222J4hZ090047@svn.freebsd.org>
    From: Andrew Turner 
    Date: Sat, 2 Mar 2013 02:19:04 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247608 - head/sys/arm/arm
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 02:19:05 -0000
    
    Author: andrew
    Date: Sat Mar  2 02:19:04 2013
    New Revision: 247608
    URL: http://svnweb.freebsd.org/changeset/base/247608
    
    Log:
      Ensure the stack is correctly aligned before calling the first C function.
    
    Modified:
      head/sys/arm/arm/locore.S
    
    Modified: head/sys/arm/arm/locore.S
    ==============================================================================
    --- head/sys/arm/arm/locore.S	Sat Mar  2 01:04:02 2013	(r247607)
    +++ head/sys/arm/arm/locore.S	Sat Mar  2 02:19:04 2013	(r247608)
    @@ -204,6 +204,7 @@ mmu_done:
     virt_done:
     	mov	r1, #20			/* loader info size is 20 bytes also second arg */
     	subs	sp, sp, r1		/* allocate arm_boot_params struct on stack */
    +	bic	sp, sp, #7		/* align stack to 8 bytes */
     	mov	r0, sp			/* loader info pointer is first arg */
     	str	r1, [r0]		/* Store length of loader info */
     	str	r9, [r0, #4]		/* Store r0 from boot loader */
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 03:23:15 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 71A36627;
     Sat,  2 Mar 2013 03:23:15 +0000 (UTC)
     (envelope-from andrew@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 63152709;
     Sat,  2 Mar 2013 03:23:15 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r223NFiT011937;
     Sat, 2 Mar 2013 03:23:15 GMT (envelope-from andrew@svn.freebsd.org)
    Received: (from andrew@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r223NFPS011936;
     Sat, 2 Mar 2013 03:23:15 GMT (envelope-from andrew@svn.freebsd.org)
    Message-Id: <201303020323.r223NFPS011936@svn.freebsd.org>
    From: Andrew Turner 
    Date: Sat, 2 Mar 2013 03:23:15 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247609 - head/sys/arm/conf
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 03:23:15 -0000
    
    Author: andrew
    Date: Sat Mar  2 03:23:14 2013
    New Revision: 247609
    URL: http://svnweb.freebsd.org/changeset/base/247609
    
    Log:
      Build the Raspberry Pi dtb file when building the kernel so we can copy it
      to the boot partition for U-Boot.
    
    Modified:
      head/sys/arm/conf/RPI-B
    
    Modified: head/sys/arm/conf/RPI-B
    ==============================================================================
    --- head/sys/arm/conf/RPI-B	Sat Mar  2 02:19:04 2013	(r247608)
    +++ head/sys/arm/conf/RPI-B	Sat Mar  2 03:23:14 2013	(r247609)
    @@ -117,4 +117,4 @@ options         FDT
     # Note:  DTB is normally loaded and modified by RPi boot loader, then
     # handed to kernel via U-Boot and ubldr.
     #options         FDT_DTB_STATIC
    -#makeoptions     FDT_DTS_FILE=bcm2835-rpi-b.dts
    +makeoptions     FDT_DTS_FILE=bcm2835-rpi-b.dts
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 03:32:20 2013
    Return-Path: 
    Delivered-To: svn-src-all@FreeBSD.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 6DCD592D;
     Sat,  2 Mar 2013 03:32:20 +0000 (UTC)
     (envelope-from tim@kientzle.com)
    Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net
     [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 4117F769;
     Sat,  2 Mar 2013 03:32:19 +0000 (UTC)
    Received: (from root@localhost)
     by monday.kientzle.com (8.14.4/8.14.4) id r223WI13056116;
     Sat, 2 Mar 2013 03:32:19 GMT (envelope-from tim@kientzle.com)
    Received: from [192.168.2.143] (CiscoE3000 [192.168.1.65])
     by kientzle.com with SMTP id qky5wd6t62wwvrgfhwbeysnmea;
     Sat, 02 Mar 2013 03:32:18 +0000 (UTC)
     (envelope-from tim@kientzle.com)
    Subject: Re: svn commit: r247609 - head/sys/arm/conf
    Mime-Version: 1.0 (Apple Message framework v1283)
    Content-Type: text/plain; charset=us-ascii
    From: Tim Kientzle 
    In-Reply-To: <201303020323.r223NFPS011936@svn.freebsd.org>
    Date: Fri, 1 Mar 2013 19:32:17 -0800
    Content-Transfer-Encoding: quoted-printable
    Message-Id: 
    References: <201303020323.r223NFPS011936@svn.freebsd.org>
    To: Andrew Turner 
    X-Mailer: Apple Mail (2.1283)
    Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
     src-committers@FreeBSD.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 03:32:20 -0000
    
    
    On Mar 1, 2013, at 7:23 PM, Andrew Turner wrote:
    
    > Author: andrew
    > Date: Sat Mar  2 03:23:14 2013
    > New Revision: 247609
    > URL: http://svnweb.freebsd.org/changeset/base/247609
    >=20
    > Log:
    >  Build the Raspberry Pi dtb file when building the kernel so we can =
    copy it
    >  to the boot partition for U-Boot.
    >=20
    > Modified:
    >  head/sys/arm/conf/RPI-B
    >=20
    > Modified: head/sys/arm/conf/RPI-B
    > =
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D
    > --- head/sys/arm/conf/RPI-B	Sat Mar  2 02:19:04 2013	=
    (r247608)
    > +++ head/sys/arm/conf/RPI-B	Sat Mar  2 03:23:14 2013	=
    (r247609)
    > @@ -117,4 +117,4 @@ options         FDT
    > # Note:  DTB is normally loaded and modified by RPi boot loader, then
    > # handed to kernel via U-Boot and ubldr.
    > #options         FDT_DTB_STATIC
    > -#makeoptions     FDT_DTS_FILE=3Dbcm2835-rpi-b.dts
    > +makeoptions     FDT_DTS_FILE=3Dbcm2835-rpi-b.dts
    
    FWIW, I personally find it easier to just run dtc to
    compile the DTS file as required.
    
    Tim
    
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 05:02:30 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 0484168D;
     Sat,  2 Mar 2013 05:02:30 +0000 (UTC)
     (envelope-from andrew@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 BAF4A9EA;
     Sat,  2 Mar 2013 05:02:29 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2252T3o042939;
     Sat, 2 Mar 2013 05:02:29 GMT (envelope-from andrew@svn.freebsd.org)
    Received: (from andrew@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2252TAl042938;
     Sat, 2 Mar 2013 05:02:29 GMT (envelope-from andrew@svn.freebsd.org)
    Message-Id: <201303020502.r2252TAl042938@svn.freebsd.org>
    From: Andrew Turner 
    Date: Sat, 2 Mar 2013 05:02:29 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247610 - head/sys/arm/include
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 05:02:30 -0000
    
    Author: andrew
    Date: Sat Mar  2 05:02:29 2013
    New Revision: 247610
    URL: http://svnweb.freebsd.org/changeset/base/247610
    
    Log:
      Move some virtual memory constants to the top of the file where they are on
      other architectures [1].
      
      While here:
       - Remove an unused and commented out include.
       - Add a comment describing the file that other copies have.
       - Fix the style of the defines and add a comment on what each one is.
      
      Suggested by:	[1] alc
    
    Modified:
      head/sys/arm/include/vmparam.h
    
    Modified: head/sys/arm/include/vmparam.h
    ==============================================================================
    --- head/sys/arm/include/vmparam.h	Sat Mar  2 03:23:14 2013	(r247609)
    +++ head/sys/arm/include/vmparam.h	Sat Mar  2 05:02:29 2013	(r247610)
    @@ -34,9 +34,32 @@
     #ifndef	_MACHINE_VMPARAM_H_
     #define	_MACHINE_VMPARAM_H_
     
    +/*
    + * Machine dependent constants for ARM.
    + */
    +
    +/*
    + * Virtual memory related constants, all in bytes
    + */
    +#ifndef	MAXTSIZ
    +#define	MAXTSIZ		(64UL*1024*1024)	/* max text size */
    +#endif
    +#ifndef	DFLDSIZ
    +#define	DFLDSIZ		(128UL*1024*1024)	/* initial data size limit */
    +#endif
    +#ifndef	MAXDSIZ
    +#define	MAXDSIZ		(512UL*1024*1024)	/* max data size */
    +#endif
    +#ifndef	DFLSSIZ
    +#define	DFLSSIZ		(2UL*1024*1024)		/* initial stack size limit */
    +#endif
    +#ifndef	MAXSSIZ
    +#define	MAXSSIZ		(8UL*1024*1024)		/* max stack size */
    +#endif
    +#ifndef	SGROWSIZ
    +#define	SGROWSIZ	(128UL*1024)		/* amount to grow stack */
    +#endif
     
    -/*#include 
    -*/
     /*
      * Address space constants
      */
    @@ -153,25 +176,6 @@
         VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
     #endif
     
    -#ifndef MAXTSIZ
    -#define MAXTSIZ 	(64*1024*1024)
    -#endif
    -#ifndef DFLDSIZ
    -#define DFLDSIZ         (128*1024*1024)
    -#endif
    -#ifndef MAXDSIZ
    -#define MAXDSIZ         (512*1024*1024)
    -#endif
    -#ifndef DFLSSIZ
    -#define DFLSSIZ         (2*1024*1024)
    -#endif
    -#ifndef MAXSSIZ
    -#define MAXSSIZ         (8*1024*1024)
    -#endif
    -#ifndef SGROWSIZ
    -#define SGROWSIZ        (128*1024)
    -#endif
    -
     #ifdef ARM_USE_SMALL_ALLOC
     #define UMA_MD_SMALL_ALLOC
     #endif /* ARM_USE_SMALL_ALLOC */
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 05:03:36 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id DE770804;
     Sat,  2 Mar 2013 05:03:36 +0000 (UTC)
     (envelope-from marcel@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 CF90A9F4;
     Sat,  2 Mar 2013 05:03:36 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2253aN0043159;
     Sat, 2 Mar 2013 05:03:36 GMT (envelope-from marcel@svn.freebsd.org)
    Received: (from marcel@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2253anY043158;
     Sat, 2 Mar 2013 05:03:36 GMT (envelope-from marcel@svn.freebsd.org)
    Message-Id: <201303020503.r2253anY043158@svn.freebsd.org>
    From: Marcel Moolenaar 
    Date: Sat, 2 Mar 2013 05:03:36 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247611 - head/lib/libstand
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 05:03:36 -0000
    
    Author: marcel
    Date: Sat Mar  2 05:03:36 2013
    New Revision: 247611
    URL: http://svnweb.freebsd.org/changeset/base/247611
    
    Log:
      Fix nandfs support by providing the same crc32 function as is used
      in newfs_nandfs. In libstand we get crc32 from libz. The polynomial
      is not the same as used for nandfs, which is the crc32 used in the
      kernel.
    
    Modified:
      head/lib/libstand/nandfs.c
    
    Modified: head/lib/libstand/nandfs.c
    ==============================================================================
    --- head/lib/libstand/nandfs.c	Sat Mar  2 05:02:29 2013	(r247610)
    +++ head/lib/libstand/nandfs.c	Sat Mar  2 05:03:36 2013	(r247611)
    @@ -125,6 +125,27 @@ struct fs_ops nandfs_fsops = {
     
     #define	NINDIR(fs)	((fs)->nf_blocksize / sizeof(nandfs_daddr_t))
     
    +/* from NetBSD's src/sys/net/if_ethersubr.c */
    +static uint32_t
    +nandfs_crc32(uint32_t crc, const uint8_t *buf, size_t len)
    +{
    +	static const uint32_t crctab[] = {
    +		0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac,
    +		0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c,
    +		0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c,
    +		0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c
    +	};
    +	size_t i;
    +
    +	crc = crc ^ ~0U;
    +	for (i = 0; i < len; i++) {
    +		crc ^= buf[i];
    +		crc = (crc >> 4) ^ crctab[crc & 0xf];
    +		crc = (crc >> 4) ^ crctab[crc & 0xf];
    +	}
    +	return (crc ^ ~0U);
    +}
    +
     static int
     nandfs_check_fsdata_crc(struct nandfs_fsdata *fsdata)
     {
    @@ -138,7 +159,7 @@ nandfs_check_fsdata_crc(struct nandfs_fs
     
     	/* Calculate */
     	fsdata->f_sum = (0);
    -	comp_crc = crc32(0, (uint8_t *)fsdata, fsdata->f_bytes);
    +	comp_crc = nandfs_crc32(0, (uint8_t *)fsdata, fsdata->f_bytes);
     
     	/* Restore */
     	fsdata->f_sum = fsdata_crc;
    @@ -162,7 +183,7 @@ nandfs_check_superblock_crc(struct nandf
     
     	/* Calculate */
     	super->s_sum = (0);
    -	comp_crc = crc32(0, (uint8_t *)super, fsdata->f_sbbytes);
    +	comp_crc = nandfs_crc32(0, (uint8_t *)super, fsdata->f_sbbytes);
     
     	/* Restore */
     	super->s_sum = super_crc;
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 05:07:52 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 78C8A9E5;
     Sat,  2 Mar 2013 05:07:52 +0000 (UTC)
     (envelope-from marcel@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 584FCA1C;
     Sat,  2 Mar 2013 05:07:52 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2257q4n043904;
     Sat, 2 Mar 2013 05:07:52 GMT (envelope-from marcel@svn.freebsd.org)
    Received: (from marcel@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2257qMQ043903;
     Sat, 2 Mar 2013 05:07:52 GMT (envelope-from marcel@svn.freebsd.org)
    Message-Id: <201303020507.r2257qMQ043903@svn.freebsd.org>
    From: Marcel Moolenaar 
    Date: Sat, 2 Mar 2013 05:07:52 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247612 - head/lib/libstand
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 05:07:52 -0000
    
    Author: marcel
    Date: Sat Mar  2 05:07:51 2013
    New Revision: 247612
    URL: http://svnweb.freebsd.org/changeset/base/247612
    
    Log:
      Fix warnings (control reaches end of non-void function).
    
    Modified:
      head/lib/libstand/nandfs.c
    
    Modified: head/lib/libstand/nandfs.c
    ==============================================================================
    --- head/lib/libstand/nandfs.c	Sat Mar  2 05:03:36 2013	(r247611)
    +++ head/lib/libstand/nandfs.c	Sat Mar  2 05:07:51 2013	(r247612)
    @@ -418,7 +418,7 @@ nandfs_open(const char *path, struct ope
     	return (0);
     }
     
    -static int
    +static void
     nandfs_free_node(struct nandfs_node *node)
     {
     	struct bmap_buf *bmap, *tmp;
    @@ -445,6 +445,7 @@ nandfs_close(struct open_file *f)
     	nandfs_free_node(fs->nf_opened_node);
     	free(fs->nf_sb);
     	free(fs);
    +	return (0);
     }
     
     static int
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 05:11:28 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id EE096B7F;
     Sat,  2 Mar 2013 05:11:28 +0000 (UTC)
     (envelope-from andrew@fubar.geek.nz)
    Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64])
     by mx1.freebsd.org (Postfix) with ESMTP id BD50AA34;
     Sat,  2 Mar 2013 05:11:28 +0000 (UTC)
    Received: from mxin2-orange.clear.net.nz
     (lb2-srcnat.clear.net.nz [203.97.32.237])
     by smtp3.clear.net.nz (CLEAR Net Mail)
     with ESMTP id <0MJ000NNZP2V0T30@smtp3.clear.net.nz>; Sat,
     02 Mar 2013 18:11:20 +1300 (NZDT)
    Received: from 202-0-48-19.paradise.net.nz (HELO bender) ([202.0.48.19])
     by smtpin2.paradise.net.nz with ESMTP; Sat, 02 Mar 2013 18:11:20 +1300
    Date: Sat, 02 Mar 2013 18:11:22 +1300
    From: Andrew Turner 
    Subject: Re: svn commit: r247609 - head/sys/arm/conf
    In-reply-to: 
    To: Tim Kientzle 
    Message-id: <20130302181122.0e5fe477@bender>
    MIME-version: 1.0
    Content-type: text/plain; charset=US-ASCII
    Content-transfer-encoding: 7bit
    References: <201303020323.r223NFPS011936@svn.freebsd.org>
     
    Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
     src-committers@FreeBSD.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 05:11:29 -0000
    
    On Fri, 1 Mar 2013 19:32:17 -0800
    Tim Kientzle  wrote:
    
    > 
    > On Mar 1, 2013, at 7:23 PM, Andrew Turner wrote:
    > 
    > > Author: andrew
    > > Date: Sat Mar  2 03:23:14 2013
    > > New Revision: 247609
    > > URL: http://svnweb.freebsd.org/changeset/base/247609
    > > 
    > > Log:
    > >  Build the Raspberry Pi dtb file when building the kernel so we can
    > > copy it to the boot partition for U-Boot.
    > > 
    > > Modified:
    > >  head/sys/arm/conf/RPI-B
    > > 
    > > Modified: head/sys/arm/conf/RPI-B
    > > ==============================================================================
    > > --- head/sys/arm/conf/RPI-B	Sat Mar  2 02:19:04 2013
    > > (r247608) +++ head/sys/arm/conf/RPI-B	Sat Mar  2 03:23:14
    > > 2013	(r247609) @@ -117,4 +117,4 @@ options         FDT
    > > # Note:  DTB is normally loaded and modified by RPi boot loader,
    > > then # handed to kernel via U-Boot and ubldr.
    > > #options         FDT_DTB_STATIC
    > > -#makeoptions     FDT_DTS_FILE=bcm2835-rpi-b.dts
    > > +makeoptions     FDT_DTS_FILE=bcm2835-rpi-b.dts
    > 
    > FWIW, I personally find it easier to just run dtc to
    > compile the DTS file as required.
    
    I know at least one user has been caught out by this, and I was as an
    old version of the dtb was where I was expecting the new one to be.
    
    When we move to a GENERIC kernel for armv6 I would not expect
    FDT_DTS_FILE to be set, but for a single board kernel config it can
    help as the user doesn't have to search around for dtc in the case it's
    not installed on the build host.
    
    Andrew
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 05:28:55 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id BBC0FF11;
     Sat,  2 Mar 2013 05:28:55 +0000 (UTC)
     (envelope-from marcel@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 AECDFA9D;
     Sat,  2 Mar 2013 05:28:55 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r225StOd050056;
     Sat, 2 Mar 2013 05:28:55 GMT (envelope-from marcel@svn.freebsd.org)
    Received: (from marcel@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r225StAp050055;
     Sat, 2 Mar 2013 05:28:55 GMT (envelope-from marcel@svn.freebsd.org)
    Message-Id: <201303020528.r225StAp050055@svn.freebsd.org>
    From: Marcel Moolenaar 
    Date: Sat, 2 Mar 2013 05:28:55 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247613 - head/lib/libstand
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 05:28:55 -0000
    
    Author: marcel
    Date: Sat Mar  2 05:28:55 2013
    New Revision: 247613
    URL: http://svnweb.freebsd.org/changeset/base/247613
    
    Log:
      Make this WARNS=9 clean on i386 w/ clang.
    
    Modified:
      head/lib/libstand/nandfs.c
    
    Modified: head/lib/libstand/nandfs.c
    ==============================================================================
    --- head/lib/libstand/nandfs.c	Sat Mar  2 05:07:51 2013	(r247612)
    +++ head/lib/libstand/nandfs.c	Sat Mar  2 05:28:55 2013	(r247613)
    @@ -95,8 +95,7 @@ static off_t nandfs_seek(struct open_fil
     static int nandfs_stat(struct open_file *, struct stat *);
     static int nandfs_readdir(struct open_file *, struct dirent *);
     
    -static int nandfs_buf_read(struct nandfs *, char **, size_t *);
    -static struct nandfs_node *nandfs_lookup_inode(struct nandfs *, nandfs_daddr_t);
    +static int nandfs_buf_read(struct nandfs *, void **, size_t *);
     static struct nandfs_node *nandfs_lookup_path(struct nandfs *, const char *);
     static int nandfs_read_inode(struct nandfs *, struct nandfs_node *,
         nandfs_lbn_t, u_int, void *, int);
    @@ -453,7 +452,7 @@ nandfs_read(struct open_file *f, void *a
     {
     	struct nandfs *fs = (struct nandfs *)f->f_fsdata;
     	size_t csize, buf_size;
    -	uint8_t *buf;
    +	void *buf;
     	int error = 0;
     
     	NANDFS_DEBUG("nandfs_read(file=%p, addr=%p, size=%d)\n", f, addr, size);
    @@ -462,7 +461,7 @@ nandfs_read(struct open_file *f, void *a
     		if (fs->nf_offset >= fs->nf_opened_node->inode->i_size)
     			break;
     
    -		error = nandfs_buf_read(fs, (void *)&buf, &buf_size);
    +		error = nandfs_buf_read(fs, &buf, &buf_size);
     		if (error)
     			break;
     
    @@ -539,7 +538,7 @@ nandfs_readdir(struct open_file *f, stru
     {
     	struct nandfs *fs = f->f_fsdata;
     	struct nandfs_dir_entry *dirent;
    -	uint8_t *buf;
    +	void *buf;
     	size_t buf_size;
     
     	NANDFS_DEBUG("nandfs_readdir(file=%p, dirent=%p)\n", f, d);
    @@ -550,7 +549,7 @@ nandfs_readdir(struct open_file *f, stru
     		return (ENOENT);
     	}
     
    -	if (nandfs_buf_read(fs, (void *)&buf, &buf_size)) {
    +	if (nandfs_buf_read(fs, &buf, &buf_size)) {
     		NANDFS_DEBUG("nandfs_readdir(file=%p, dirent=%p)"
     		    "buf_read failed\n", f, d);
     		return (EIO);
    @@ -568,7 +567,7 @@ nandfs_readdir(struct open_file *f, stru
     }
     
     static int
    -nandfs_buf_read(struct nandfs *fs, char **buf_p, size_t *size_p)
    +nandfs_buf_read(struct nandfs *fs, void **buf_p, size_t *size_p)
     {
     	nandfs_daddr_t blknr, blkoff;
     
    @@ -634,8 +633,8 @@ nandfs_lookup_path(struct nandfs *fs, co
     	struct nandfs_node *node;
     	struct nandfs_dir_entry *dirent;
     	char *namebuf;
    -	uint64_t i, j, done, counter, pinode, inode;
    -	int nlinks = 0, len, link_len, nameidx;
    +	uint64_t i, done, pinode, inode;
    +	int nlinks = 0, counter, len, link_len, nameidx;
     	uint8_t *buffer, *orig;
     	char *strp, *lpath;
     
    @@ -672,7 +671,8 @@ nandfs_lookup_path(struct nandfs *fs, co
     			buffer = orig;
     			done = counter = 0;
     			while (1) {
    -				dirent = (struct nandfs_dir_entry *)buffer;
    +				dirent = 
    +				    (struct nandfs_dir_entry *)(void *)buffer;
     				NANDFS_DEBUG("%s: dirent.name = %s\n",
     				    __func__, dirent->name);
     				NANDFS_DEBUG("%s: dirent.rec_len = %d\n",
    @@ -768,9 +768,9 @@ static int
     nandfs_read_inode(struct nandfs *fs, struct nandfs_node *node,
         nandfs_daddr_t blknr, u_int nblks, void *buf, int raw)
     {
    -	int i;
     	uint64_t *pblks;
     	uint64_t *vblks;
    +	u_int i;
     	int error;
     
     	pblks = malloc(nblks * sizeof(uint64_t));
    @@ -799,7 +799,7 @@ nandfs_read_inode(struct nandfs *fs, str
     			return (EIO);
     		}
     
    -		buf += fs->nf_blocksize;
    +		buf = (void *)((uintptr_t)buf + fs->nf_blocksize);
     	}
     
     	free(pblks);
    @@ -881,8 +881,7 @@ nandfs_bmap_lookup(struct nandfs *fs, st
     {
     	struct nandfs_inode *ino;
     	nandfs_daddr_t ind_block_num;
    -	uint64_t *map, *indir;
    -	uint64_t idx0, idx1, vblk, tmp;
    +	uint64_t *map;
     	int idx;
     	int level;
     
    @@ -1028,7 +1027,7 @@ ioread(struct open_file *f, off_t pos, v
     	err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, pos,
     	    nsec * bsize, buffer, NULL);
     
    -	memcpy(buf, buffer + off, length);
    +	memcpy(buf, (void *)((uintptr_t)buffer + off), length);
     	free(buffer);
     
     	return (err);
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 06:34:50 2013
    Return-Path: 
    Delivered-To: svn-src-all@FreeBSD.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id F1EBDC39;
     Sat,  2 Mar 2013 06:34:49 +0000 (UTC)
     (envelope-from brde@optusnet.com.au)
    Received: from fallbackmx08.syd.optusnet.com.au
     (fallbackmx08.syd.optusnet.com.au [211.29.132.10])
     by mx1.freebsd.org (Postfix) with ESMTP id 90578D44;
     Sat,  2 Mar 2013 06:34:48 +0000 (UTC)
    Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au
     [211.29.132.190])
     by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
     r226Yes6030356; Sat, 2 Mar 2013 17:34:40 +1100
    Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au
     (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106])
     by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r226YRvk006040
     (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
     Sat, 2 Mar 2013 17:34:31 +1100
    Date: Sat, 2 Mar 2013 17:34:27 +1100 (EST)
    From: Bruce Evans 
    X-X-Sender: bde@besplex.bde.org
    To: Marius Strobl 
    Subject: Re: svn commit: r247600 - in head/sys: conf sparc64/pci
    In-Reply-To: <201303020037.r220bWJg057328@svn.freebsd.org>
    Message-ID: <20130302153017.O1121@besplex.bde.org>
    References: <201303020037.r220bWJg057328@svn.freebsd.org>
    MIME-Version: 1.0
    Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
    X-Optus-CM-Score: 0
    X-Optus-CM-Analysis: v=2.0 cv=DdhPMYRW c=1 sm=1 a=OATcr5XPpMsA:10
     a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=s5sLUIhH2asA:10
     a=nh50T69upB6EW8B8ixgA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117
    Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
     src-committers@FreeBSD.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 06:34:50 -0000
    
    On Sat, 2 Mar 2013, Marius Strobl wrote:
    
    > Log:
    >  - While Netra X1 generally show no ill effects when registering a power
    >    fail interrupt handler, there seems to be either a broken batch of them
    >    or a tendency to develop a defect which causes this interrupt to fire
    >    inadvertedly. Given that apart from this problem these machines work
    >    just fine, add a tunable allowing the setup of the power fail interrupt
    >    to be disabled.
    >    While at it, remove the DEBUGGER_ON_POWERFAIL compile time option and
    >    make that behavior also selectable via the newly added tunable.
    >  - Apparently, it's no longer a problem to call shutdown_nice(9) from within
    >    an interrupt filter (some other drivers in the tree do the same). So
    >    change the power fail interrupt from an handler in order to simplify the
    >    code and get rid of a !INTR_MPSAFE handler.
    
    Gak!  It it is any error to call any() from within a fast interrupt
    handler.  Even with fast interrupt handlers broken to be interrupt
    filters, it is an error to call almost any().  shutdown_nice() is an
    especially invalid any().  It sends a signal to init, and uses many
    sleep locks for this.  So you have the interrupt filter which is locked
    by critical_enter() and probably also by hard-disabling interrupts on
    the current CPU, calling up to code locked by sleep mutexes.  This
    asks for deadlock, and gets it when the interrupt preempts code holding
    one of the sleep locks that is wandered into.
    
    The other broken drivers that do this seem to be mainly serial console
    drivers.  Their debugger entry was subverted into calling panic() or
    shutdown_nice() according to an escape sequence.  Even the debugger
    entry part of this was broken by changing it from a hard breakpoint
    to a kdb_enter() call which does invalid things (it accesses global
    state without locking, and calls printf() before entering debugger
    context).  shutdown_nice() is also called from acpi and from syscons.
    I think the latter still uses an ordinary (Giant locked) interrupt
    handler.  Calling shutdown_nice() from there has a chance of never
    deadlocking.  It would just have to wait if the interrupt interrupted
    something holding shutdown_nice()'s locks.
    
    The dangerous calls in syscons are actually from scgetc().  I think
    they are reachable in debugger mode too.  Then they are invalid.  So
    are ddb's commands for rebooting and panicing.  You can't call any()
    from ddb either, but these commands do.  A non-broken version of these
    commands (or "call any()) would exit from ddb context after arranging
    to make the call using a trampoline.  The call might fail, but then
    it is not the fault of ddb's context.  The trampoline is needed to
    regain control if the call can return.  The reboot and panic commands
    are safer than most of the unsafe ones since they are supposed to give
    an unclean shutdown and if they don't work then nothing much worse than
    a recursive unclean shutdown can happen.
    
    Bruce
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 06:55:56 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id A033C3FF;
     Sat,  2 Mar 2013 06:55:56 +0000 (UTC)
     (envelope-from joel@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 7C999DF0;
     Sat,  2 Mar 2013 06:55:56 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r226tugP078647;
     Sat, 2 Mar 2013 06:55:56 GMT (envelope-from joel@svn.freebsd.org)
    Received: (from joel@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r226ttYc078644;
     Sat, 2 Mar 2013 06:55:55 GMT (envelope-from joel@svn.freebsd.org)
    Message-Id: <201303020655.r226ttYc078644@svn.freebsd.org>
    From: Joel Dahl 
    Date: Sat, 2 Mar 2013 06:55:55 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247614 - head/lib/libc/sys
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 06:55:56 -0000
    
    Author: joel (doc committer)
    Date: Sat Mar  2 06:55:55 2013
    New Revision: 247614
    URL: http://svnweb.freebsd.org/changeset/base/247614
    
    Log:
      mdoc: remove superfluous paragraph macro.
    
    Modified:
      head/lib/libc/sys/cap_fcntls_limit.2
      head/lib/libc/sys/cap_ioctls_limit.2
      head/lib/libc/sys/cap_rights_limit.2
    
    Modified: head/lib/libc/sys/cap_fcntls_limit.2
    ==============================================================================
    --- head/lib/libc/sys/cap_fcntls_limit.2	Sat Mar  2 05:28:55 2013	(r247613)
    +++ head/lib/libc/sys/cap_fcntls_limit.2	Sat Mar  2 06:55:55 2013	(r247614)
    @@ -120,7 +120,6 @@ argument points at an invalid address.
     Support for capabilities and capabilities mode was developed as part of the
     .Tn TrustedBSD
     Project.
    -.Pp
     .Sh AUTHORS
     This function was created by
     .An Pawel Jakub Dawidek Aq pawel@dawidek.net
    
    Modified: head/lib/libc/sys/cap_ioctls_limit.2
    ==============================================================================
    --- head/lib/libc/sys/cap_ioctls_limit.2	Sat Mar  2 05:28:55 2013	(r247613)
    +++ head/lib/libc/sys/cap_ioctls_limit.2	Sat Mar  2 06:55:55 2013	(r247614)
    @@ -151,7 +151,6 @@ argument points at invalid address.
     Support for capabilities and capabilities mode was developed as part of the
     .Tn TrustedBSD
     Project.
    -.Pp
     .Sh AUTHORS
     This function was created by
     .An Pawel Jakub Dawidek Aq pawel@dawidek.net
    
    Modified: head/lib/libc/sys/cap_rights_limit.2
    ==============================================================================
    --- head/lib/libc/sys/cap_rights_limit.2	Sat Mar  2 05:28:55 2013	(r247613)
    +++ head/lib/libc/sys/cap_rights_limit.2	Sat Mar  2 06:55:55 2013	(r247614)
    @@ -590,7 +590,6 @@ argument points at an invalid address.
     Support for capabilities and capabilities mode was developed as part of the
     .Tn TrustedBSD
     Project.
    -.Pp
     .Sh AUTHORS
     This function was created by
     .An Pawel Jakub Dawidek Aq pawel@dawidek.net
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 07:51:04 2013
    Return-Path: 
    Delivered-To: svn-src-all@FreeBSD.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 6E6C9AAB;
     Sat,  2 Mar 2013 07:51:04 +0000 (UTC)
     (envelope-from brde@optusnet.com.au)
    Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au
     [211.29.132.190])
     by mx1.freebsd.org (Postfix) with ESMTP id F39DFF3D;
     Sat,  2 Mar 2013 07:51:03 +0000 (UTC)
    Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au
     (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106])
     by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r227oxEJ023049
     (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
     Sat, 2 Mar 2013 18:51:01 +1100
    Date: Sat, 2 Mar 2013 18:50:59 +1100 (EST)
    From: Bruce Evans 
    X-X-Sender: bde@besplex.bde.org
    To: Marius Strobl 
    Subject: Re: svn commit: r247601 - head/sys/sparc64/sbus
    In-Reply-To: <201303020041.r220fq5N059799@svn.freebsd.org>
    Message-ID: <20130302182026.Y1572@besplex.bde.org>
    References: <201303020041.r220fq5N059799@svn.freebsd.org>
    MIME-Version: 1.0
    Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
    X-Optus-CM-Score: 0
    X-Optus-CM-Analysis: v=2.0 cv=D4sfsYtj c=1 sm=1 a=VnOwEx96OuMA:10
     a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=av8Homa3Ie4A:10
     a=AVZOoVRqcIQJYAXkCC4A:9 a=CjuIK1q_8ugA:10 a=53MiY31mBRR9oVUS:21
     a=J_TLFwbwM9nZ-CZZ:21 a=TEtd8y5WR3g2ypngnwZWYw==:117
    Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
     src-committers@FreeBSD.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 07:51:04 -0000
    
    On Sat, 2 Mar 2013, Marius Strobl wrote:
    
    > Log:
    >  - Apparently, it's no longer a problem to call shutdown_nice(9) from within
    >    an interrupt filter (some other drivers in the tree do the same). So
    >    change the overtemperature and power fail interrupts from handlers in order
    >    to code and get rid of a !INTR_MPSAFE handlers.
    
    Sigh.
    
    Maybe the only thing that "works" better with a filter is that LOR detection
    for it is broken since filters don't use normal mutexes?
    
    > Modified: head/sys/sparc64/sbus/sbus.c
    > ==============================================================================
    > --- head/sys/sparc64/sbus/sbus.c	Sat Mar  2 00:37:31 2013	(r247600)
    > +++ head/sys/sparc64/sbus/sbus.c	Sat Mar  2 00:41:51 2013	(r247601)
    > @@ -199,7 +199,7 @@ static driver_t sbus_driver = {
    >
    > static devclass_t sbus_devclass;
    >
    > -EARLY_DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, 0, 0,
    > +EARLY_DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, NULL, NULL,
    >     BUS_PASS_BUS);
    > MODULE_DEPEND(sbus, nexus, 1, 1, 1);
    > MODULE_VERSION(sbus, 1);
    > @@ -410,7 +410,7 @@ sbus_attach(device_t dev)
    > 	    INTVEC(SYSIO_READ8(sc, SBR_THERM_INT_MAP)) != vec ||
    > 	    intr_vectors[vec].iv_ic != &sbus_ic ||
    > 	    bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC | INTR_BRIDGE,
    > -	    NULL, sbus_overtemp, sc, &sc->sc_ot_ihand) != 0)
    > +	    sbus_overtemp, NULL, sc, &sc->sc_ot_ihand) != 0)
    > 		panic("%s: failed to set up temperature interrupt", __func__);
    > 	i = 3;
    > 	sc->sc_pf_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i,
    
    It still doesn't claim INTR_MPSAFE.  Maybe that is meaningless for filters.
    But some filters claim it.
    
    > @@ -897,31 +897,33 @@ sbus_get_devinfo(device_t bus, device_t
    >  * This handles the interrupt and powers off the machine.
    >  * The same needs to be done to PCI controller drivers.
    >  */
    > -static void
    > -sbus_overtemp(void *arg)
    > +static int
    > +sbus_overtemp(void *arg __unused)
    > {
    > 	static int shutdown;
    >
    > 	/* As the interrupt is cleared we may be called multiple times. */
    > 	if (shutdown != 0)
    > -		return;
    > +		return (FILTER_HANDLED);
    > 	shutdown++;
    > 	printf("DANGER: OVER TEMPERATURE detected\nShutting down NOW.\n");
    
    Calling the any() function printf() is also invalid in fast interrupt
    handlers.  It is especially unsafe in practice in versions that serialize
    the output -- this printf() may be long delayed.
    
    > 	shutdown_nice(RB_POWEROFF);
    > +	return (FILTER_HANDLED);
    > }
    >
    > /* Try to shut down in time in case of power failure. */
    > -static void
    > -sbus_pwrfail(void *arg)
    > +static int
    > +sbus_pwrfail(void *arg __unused)
    > {
    > 	static int shutdown;
    >
    > 	/* As the interrupt is cleared we may be called multiple times. */
    > 	if (shutdown != 0)
    > -		return;
    > +		return (FILTER_HANDLED);
    > 	shutdown++;
    > 	printf("Power failure detected\nShutting down NOW.\n");
    > -	shutdown_nice(0);
    > +	shutdown_nice(FILTER_HANDLED);
    
    FILTER_HANDLED is a garbage arg for shutdown_nice().  It happens to be
    2, which happens to be RB_SINGLE, which is a boot flag and not a reboot
    flag, and is also not really used, so this bug has little effect.
    
    > +	return (FILTER_HANDLED);
    > }
    >
    > static int
    >
    
    I don't see anything to make these more MPSAFE than before.  They seem
    to be basically correct and MPSAFE as ordinary interrupt handlers, but
    basically incorrect and MPSAFE as filters.  The shutdown_nice() call
    is MPSAFE if calling it is safe at all.  You just need to ensure that
    the handlers are not connected to multiple interrupt sources (including
    ones for other devies), so that rest of the global state accessed by
    the handlers doesn't need locking.  This state is just the `shutdown'
    variable in each, so it could easily be protected by an atomic op.
    The locking is just as missing for the filter version as for the normal
    version if there can be multiple interrupt sources.  However, the worst
    that can happen if the counter gets messed up seems to be multiple
    printf()s and multiple SIGINTs sent to init.  Both are probably
    harmless.
    
    Bruce
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 08:12:43 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 2DFD4D22;
     Sat,  2 Mar 2013 08:12:43 +0000 (UTC)
     (envelope-from adrian@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 E577AFC0;
     Sat,  2 Mar 2013 08:12:42 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r228Cg3O002880;
     Sat, 2 Mar 2013 08:12:42 GMT (envelope-from adrian@svn.freebsd.org)
    Received: (from adrian@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r228Cflx002877;
     Sat, 2 Mar 2013 08:12:41 GMT (envelope-from adrian@svn.freebsd.org)
    Message-Id: <201303020812.r228Cflx002877@svn.freebsd.org>
    From: Adrian Chadd 
    Date: Sat, 2 Mar 2013 08:12:41 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247615 - in head: . sys/amd64/conf sys/i386/conf
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 08:12:43 -0000
    
    Author: adrian
    Date: Sat Mar  2 08:12:41 2013
    New Revision: 247615
    URL: http://svnweb.freebsd.org/changeset/base/247615
    
    Log:
      Disable the ctl driver in GENERIC.
      
      It unfortunately steals a fair chunk of RAM at startup even if it's not
      actively used, which prevents FreeBSD VMs of 128MB from successfully
      booting and running.
    
    Modified:
      head/UPDATING
      head/sys/amd64/conf/GENERIC
      head/sys/i386/conf/GENERIC
    
    Modified: head/UPDATING
    ==============================================================================
    --- head/UPDATING	Sat Mar  2 06:55:55 2013	(r247614)
    +++ head/UPDATING	Sat Mar  2 08:12:41 2013	(r247615)
    @@ -26,6 +26,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
     	disable the most expensive debugging functionality run
     	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
     
    +20130301:
    +	The ctl device has been disabled in GENERIC for i386 and amd64.
    +	This was done due to the extra memory being allocated at system
    +	initialisation time by the ctl driver which was only used if
    +	a CAM target device was created.  This makes a FreeBSD system
    +	unusable on 128MB or less of RAM.
    +
     20130208:
     	A new compression method (lz4) has been merged to -HEAD.  Please
     	refer to zpool-features(7) for more information.
    
    Modified: head/sys/amd64/conf/GENERIC
    ==============================================================================
    --- head/sys/amd64/conf/GENERIC	Sat Mar  2 06:55:55 2013	(r247614)
    +++ head/sys/amd64/conf/GENERIC	Sat Mar  2 08:12:41 2013	(r247615)
    @@ -138,7 +138,7 @@ device		sa		# Sequential Access (tape et
     device		cd		# CD
     device		pass		# Passthrough device (direct ATA/SCSI access)
     device		ses		# Enclosure Services (SES and SAF-TE)
    -device		ctl		# CAM Target Layer
    +#device		ctl		# CAM Target Layer
     
     # RAID controllers interfaced to the SCSI subsystem
     device		amr		# AMI MegaRAID
    
    Modified: head/sys/i386/conf/GENERIC
    ==============================================================================
    --- head/sys/i386/conf/GENERIC	Sat Mar  2 06:55:55 2013	(r247614)
    +++ head/sys/i386/conf/GENERIC	Sat Mar  2 08:12:41 2013	(r247615)
    @@ -146,7 +146,7 @@ device		sa		# Sequential Access (tape et
     device		cd		# CD
     device		pass		# Passthrough device (direct ATA/SCSI access)
     device		ses		# Enclosure Services (SES and SAF-TE)
    -device		ctl		# CAM Target Layer
    +#device		ctl		# CAM Target Layer
     
     # RAID controllers interfaced to the SCSI subsystem
     device		amr		# AMI MegaRAID
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 09:58:49 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 15D2EFAA;
     Sat,  2 Mar 2013 09:58:49 +0000 (UTC) (envelope-from pjd@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 F21652E4;
     Sat,  2 Mar 2013 09:58:48 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r229wm4j033190;
     Sat, 2 Mar 2013 09:58:48 GMT (envelope-from pjd@svn.freebsd.org)
    Received: (from pjd@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r229wm1M033189;
     Sat, 2 Mar 2013 09:58:48 GMT (envelope-from pjd@svn.freebsd.org)
    Message-Id: <201303020958.r229wm1M033189@svn.freebsd.org>
    From: Pawel Jakub Dawidek 
    Date: Sat, 2 Mar 2013 09:58:48 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247617 - head/sys/kern
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 09:58:49 -0000
    
    Author: pjd
    Date: Sat Mar  2 09:58:47 2013
    New Revision: 247617
    URL: http://svnweb.freebsd.org/changeset/base/247617
    
    Log:
      If the target file already exists, check for the CAP_UNLINKAT capabiity right
      on the target directory descriptor, but only if this is renameat(2) and real
      target directory descriptor is given (not AT_FDCWD). Without this fix regular
      rename(2) fails if the target file already exists.
      
      Reported by:	Michael Butler 
      Reported by:	Larry Rosenman 
      Sponsored by:	The FreeBSD Foundation
    
    Modified:
      head/sys/kern/vfs_syscalls.c
    
    Modified: head/sys/kern/vfs_syscalls.c
    ==============================================================================
    --- head/sys/kern/vfs_syscalls.c	Sat Mar  2 09:26:59 2013	(r247616)
    +++ head/sys/kern/vfs_syscalls.c	Sat Mar  2 09:58:47 2013	(r247617)
    @@ -3556,13 +3556,16 @@ kern_renameat(struct thread *td, int old
     			goto out;
     		}
     #ifdef CAPABILITIES
    -		/*
    -		 * If the target already exists we require CAP_UNLINKAT
    -		 * from 'newfd'.
    -		 */
    -		error = cap_check(tond.ni_filecaps.fc_rights, CAP_UNLINKAT);
    -		if (error != 0)
    -			goto out;
    +		if (newfd != AT_FDCWD) {
    +			/*
    +			 * If the target already exists we require CAP_UNLINKAT
    +			 * from 'newfd'.
    +			 */
    +			error = cap_check(tond.ni_filecaps.fc_rights,
    +			    CAP_UNLINKAT);
    +			if (error != 0)
    +				goto out;
    +		}
     #endif
     	}
     	if (fvp == tdvp) {
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 12:42:24 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 25D718EC;
     Sat,  2 Mar 2013 12:42:24 +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 010CF90F;
     Sat,  2 Mar 2013 12:42:24 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22CgNbG083436;
     Sat, 2 Mar 2013 12:42:23 GMT (envelope-from jilles@svn.freebsd.org)
    Received: (from jilles@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22CgNQ6083435;
     Sat, 2 Mar 2013 12:42:23 GMT (envelope-from jilles@svn.freebsd.org)
    Message-Id: <201303021242.r22CgNQ6083435@svn.freebsd.org>
    From: Jilles Tjoelker 
    Date: Sat, 2 Mar 2013 12:42:23 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247619 - head/sys/fs/nullfs
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 12:42:24 -0000
    
    Author: jilles
    Date: Sat Mar  2 12:42:23 2013
    New Revision: 247619
    URL: http://svnweb.freebsd.org/changeset/base/247619
    
    Log:
      nullfs: Improve f_flags in statfs().
      
      Include some flags of the nullfs mount itself:
      MNT_RDONLY, MNT_NOEXEC, MNT_NOSUID, MNT_UNION, MNT_NOSYMFOLLOW.
      
      This allows userland code calling statfs() or fstatfs() to see these flags.
      In particular, this allows opendir() to detect that a -t nullfs -o union
      mount needs deduplication (otherwise at least . and .. are returned twice)
      and allows rtld to detect a -t nullfs -o noexec mount as noexec.
      
      Turn off the MNT_ROOTFS flag from the underlying filesystem because the
      nullfs mount is definitely not the root filesystem.
      
      Reviewed by:	kib
      MFC after:	1 week
    
    Modified:
      head/sys/fs/nullfs/null_vfsops.c
    
    Modified: head/sys/fs/nullfs/null_vfsops.c
    ==============================================================================
    --- head/sys/fs/nullfs/null_vfsops.c	Sat Mar  2 11:33:21 2013	(r247618)
    +++ head/sys/fs/nullfs/null_vfsops.c	Sat Mar  2 12:42:23 2013	(r247619)
    @@ -313,7 +313,8 @@ nullfs_statfs(mp, sbp)
     
     	/* now copy across the "interesting" information and fake the rest */
     	sbp->f_type = mstat.f_type;
    -	sbp->f_flags = mstat.f_flags;
    +	sbp->f_flags = (sbp->f_flags & (MNT_RDONLY | MNT_NOEXEC | MNT_NOSUID |
    +	    MNT_UNION | MNT_NOSYMFOLLOW)) | (mstat.f_flags & ~MNT_ROOTFS);
     	sbp->f_bsize = mstat.f_bsize;
     	sbp->f_iosize = mstat.f_iosize;
     	sbp->f_blocks = mstat.f_blocks;
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 13:04:59 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 5D105D79;
     Sat,  2 Mar 2013 13:04:59 +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 4AB1C997;
     Sat,  2 Mar 2013 13:04:59 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22D4xFs089887;
     Sat, 2 Mar 2013 13:04:59 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22D4xoI089886;
     Sat, 2 Mar 2013 13:04:59 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021304.r22D4xoI089886@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 13:04:59 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247620 - head/sys/sparc64/pci
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 13:04:59 -0000
    
    Author: marius
    Date: Sat Mar  2 13:04:58 2013
    New Revision: 247620
    URL: http://svnweb.freebsd.org/changeset/base/247620
    
    Log:
      Revert the part of r247600 which turned the overtemperature and power fail
      interrupt shutdown handlers into filters. Shutdown_nice(9) acquires a sleep
      lock, which filters shouldn't do. It also seems that kern_reboot(9) still
      may require Giant to be hold.
      
      Submitted by:	bde
    
    Modified:
      head/sys/sparc64/pci/psycho.c
    
    Modified: head/sys/sparc64/pci/psycho.c
    ==============================================================================
    --- head/sys/sparc64/pci/psycho.c	Sat Mar  2 12:42:23 2013	(r247619)
    +++ head/sys/sparc64/pci/psycho.c	Sat Mar  2 13:04:58 2013	(r247620)
    @@ -81,7 +81,7 @@ static const struct psycho_desc *psycho_
         const char *);
     static const struct psycho_desc *psycho_get_desc(device_t);
     static void psycho_set_intr(struct psycho_softc *, u_int, bus_addr_t,
    -    driver_filter_t);
    +    driver_filter_t, driver_intr_t);
     static int psycho_find_intrmap(struct psycho_softc *, u_int, bus_addr_t *,
         bus_addr_t *, u_long *);
     static void sabre_dmamap_sync(bus_dma_tag_t dt, bus_dmamap_t map,
    @@ -96,8 +96,8 @@ static driver_filter_t psycho_ue;
     static driver_filter_t psycho_ce;
     static driver_filter_t psycho_pci_bus;
     static driver_filter_t psycho_powerdebug;
    -static driver_filter_t psycho_powerdown;
    -static driver_filter_t psycho_overtemp;
    +static driver_intr_t psycho_powerdown;
    +static driver_intr_t psycho_overtemp;
     #ifdef PSYCHO_MAP_WAKEUP
     static driver_filter_t psycho_wakeup;
     #endif
    @@ -619,17 +619,17 @@ psycho_attach(device_t dev)
     		 * XXX Not all controllers have these, but installing them
     		 * is better than trying to sort through this mess.
     		 */
    -		psycho_set_intr(sc, 1, PSR_UE_INT_MAP, psycho_ue);
    -		psycho_set_intr(sc, 2, PSR_CE_INT_MAP, psycho_ce);
    +		psycho_set_intr(sc, 1, PSR_UE_INT_MAP, psycho_ue, NULL);
    +		psycho_set_intr(sc, 2, PSR_CE_INT_MAP, psycho_ce, NULL);
     		switch (psycho_powerfail) {
     		case 0:
     			break;
     		case 2:
     			psycho_set_intr(sc, 3, PSR_POWER_INT_MAP,
    -			    psycho_powerdebug);
    +			    psycho_powerdebug, NULL);
     			break;
     		default:
    -			psycho_set_intr(sc, 3, PSR_POWER_INT_MAP,
    +			psycho_set_intr(sc, 3, PSR_POWER_INT_MAP, NULL,
     			    psycho_powerdown);
     			break;
     		}
    @@ -643,7 +643,7 @@ psycho_attach(device_t dev)
     			 * The spare hardware interrupt is used for the
     			 * over-temperature interrupt.
     			 */
    -			psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP,
    +			psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP, NULL,
     			    psycho_overtemp);
     #ifdef PSYCHO_MAP_WAKEUP
     			/*
    @@ -651,7 +651,7 @@ psycho_attach(device_t dev)
     			 * now.
     			 */
     			psycho_set_intr(sc, 5, PSR_PWRMGT_INT_MAP,
    -			    psycho_wakeup);
    +			    psycho_wakeup, NULL);
     #endif /* PSYCHO_MAP_WAKEUP */
     		}
     	}
    @@ -661,7 +661,7 @@ psycho_attach(device_t dev)
     	 * interrupt but they are also only used for PCI bus A.
     	 */
     	psycho_set_intr(sc, 0, sc->sc_half == 0 ? PSR_PCIAERR_INT_MAP :
    -	    PSR_PCIBERR_INT_MAP, psycho_pci_bus);
    +	    PSR_PCIBERR_INT_MAP, psycho_pci_bus, NULL);
     
     	/*
     	 * Set the latency timer register as this isn't always done by the
    @@ -701,7 +701,7 @@ psycho_attach(device_t dev)
     
     static void
     psycho_set_intr(struct psycho_softc *sc, u_int index, bus_addr_t intrmap,
    -    driver_filter_t handler)
    +    driver_filter_t filt, driver_intr_t intr)
     {
     	u_long vec;
     	int rid;
    @@ -722,7 +722,7 @@ psycho_set_intr(struct psycho_softc *sc,
     	    INTVEC(PSYCHO_READ8(sc, intrmap)) != vec ||
     	    intr_vectors[vec].iv_ic != &psycho_ic ||
     	    bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index],
    -	    INTR_TYPE_MISC | INTR_BRIDGE, handler, NULL, sc,
    +	    INTR_TYPE_MISC | INTR_BRIDGE, filt, intr, sc,
     	    &sc->sc_ihand[index]) != 0)
     		panic("%s: failed to set up interrupt %d", __func__, index);
     }
    @@ -858,32 +858,30 @@ psycho_powerdebug(void *arg __unused)
     	return (FILTER_HANDLED);
     }
     
    -static int
    +static void
     psycho_powerdown(void *arg __unused)
     {
     	static int shutdown;
     
     	/* As the interrupt is cleared we may be called multiple times. */
     	if (shutdown != 0)
    -		return (FILTER_HANDLED);
    +		return;
     	shutdown++;
     	printf("Power Failure Detected: Shutting down NOW.\n");
     	shutdown_nice(RB_POWEROFF);
    -	return (FILTER_HANDLED);
     }
     
    -static int
    +static void
     psycho_overtemp(void *arg __unused)
     {
     	static int shutdown;
     
     	/* As the interrupt is cleared we may be called multiple times. */
     	if (shutdown != 0)
    -		return (FILTER_HANDLED);
    +		return;
     	shutdown++;
     	printf("DANGER: OVER TEMPERATURE detected.\nShutting down NOW.\n");
     	shutdown_nice(RB_POWEROFF);
    -	return (FILTER_HANDLED);
     }
     
     #ifdef PSYCHO_MAP_WAKEUP
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 13:08:14 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 92720F24;
     Sat,  2 Mar 2013 13:08: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 766FA9BB;
     Sat,  2 Mar 2013 13:08:14 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22D8Efi090460;
     Sat, 2 Mar 2013 13:08:14 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22D8E0C090459;
     Sat, 2 Mar 2013 13:08:14 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021308.r22D8E0C090459@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 13:08:14 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247621 - head/sys/sparc64/sbus
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 13:08:14 -0000
    
    Author: marius
    Date: Sat Mar  2 13:08:13 2013
    New Revision: 247621
    URL: http://svnweb.freebsd.org/changeset/base/247621
    
    Log:
      - Revert the part of r247601 which turned the overtemperature and power fail
        interrupt shutdown handlers into filters. Shutdown_nice(9) acquires a sleep
        lock, which filters shouldn't do. It also seems that kern_reboot(9) still
        may require Giant to be hold.
      - Correct an incorrect argument to shutdown_nice(9).
      
      Submitted by:	bde
    
    Modified:
      head/sys/sparc64/sbus/sbus.c
    
    Modified: head/sys/sparc64/sbus/sbus.c
    ==============================================================================
    --- head/sys/sparc64/sbus/sbus.c	Sat Mar  2 13:04:58 2013	(r247620)
    +++ head/sys/sparc64/sbus/sbus.c	Sat Mar  2 13:08:13 2013	(r247621)
    @@ -152,8 +152,8 @@ static void sbus_intr_assign(void *);
     static void sbus_intr_clear(void *);
     static int sbus_find_intrmap(struct sbus_softc *, u_int, bus_addr_t *,
         bus_addr_t *);
    -static driver_filter_t sbus_overtemp;
    -static driver_filter_t sbus_pwrfail;
    +static driver_intr_t sbus_overtemp;
    +static driver_intr_t sbus_pwrfail;
     static int sbus_print_res(struct sbus_devinfo *);
     
     static device_method_t sbus_methods[] = {
    @@ -410,7 +410,7 @@ sbus_attach(device_t dev)
     	    INTVEC(SYSIO_READ8(sc, SBR_THERM_INT_MAP)) != vec ||
     	    intr_vectors[vec].iv_ic != &sbus_ic ||
     	    bus_setup_intr(dev, sc->sc_ot_ires, INTR_TYPE_MISC | INTR_BRIDGE,
    -	    sbus_overtemp, NULL, sc, &sc->sc_ot_ihand) != 0)
    +	    NULL, sbus_overtemp, sc, &sc->sc_ot_ihand) != 0)
     		panic("%s: failed to set up temperature interrupt", __func__);
     	i = 3;
     	sc->sc_pf_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i,
    @@ -420,7 +420,7 @@ sbus_attach(device_t dev)
     	    INTVEC(SYSIO_READ8(sc, SBR_POWER_INT_MAP)) != vec ||
     	    intr_vectors[vec].iv_ic != &sbus_ic ||
     	    bus_setup_intr(dev, sc->sc_pf_ires, INTR_TYPE_MISC | INTR_BRIDGE,
    -	    sbus_pwrfail, NULL, sc, &sc->sc_pf_ihand) != 0)
    +	    NULL, sbus_pwrfail, sc, &sc->sc_pf_ihand) != 0)
     		panic("%s: failed to set up power fail interrupt", __func__);
     
     	/* Initialize the counter-timer. */
    @@ -897,33 +897,31 @@ sbus_get_devinfo(device_t bus, device_t 
      * This handles the interrupt and powers off the machine.
      * The same needs to be done to PCI controller drivers.
      */
    -static int
    +static void
     sbus_overtemp(void *arg __unused)
     {
     	static int shutdown;
     
     	/* As the interrupt is cleared we may be called multiple times. */
     	if (shutdown != 0)
    -		return (FILTER_HANDLED);
    +		return;
     	shutdown++;
     	printf("DANGER: OVER TEMPERATURE detected\nShutting down NOW.\n");
     	shutdown_nice(RB_POWEROFF);
    -	return (FILTER_HANDLED);
     }
     
     /* Try to shut down in time in case of power failure. */
    -static int
    +static void
     sbus_pwrfail(void *arg __unused)
     {
     	static int shutdown;
     
     	/* As the interrupt is cleared we may be called multiple times. */
     	if (shutdown != 0)
    -		return (FILTER_HANDLED);
    +		return;
     	shutdown++;
     	printf("Power failure detected\nShutting down NOW.\n");
    -	shutdown_nice(FILTER_HANDLED);
    -	return (FILTER_HANDLED);
    +	shutdown_nice(RB_POWEROFF);
     }
     
     static int
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 14:19:08 2013
    Return-Path: 
    Delivered-To: svn-src-all@FreeBSD.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 32A6385F;
     Sat,  2 Mar 2013 14:19:08 +0000 (UTC)
     (envelope-from brde@optusnet.com.au)
    Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au
     [211.29.132.190])
     by mx1.freebsd.org (Postfix) with ESMTP id A78DCD7A;
     Sat,  2 Mar 2013 14:19:07 +0000 (UTC)
    Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au
     (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106])
     by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r22EJ2tV020291
     (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
     Sun, 3 Mar 2013 01:19:05 +1100
    Date: Sun, 3 Mar 2013 01:19:02 +1100 (EST)
    From: Bruce Evans 
    X-X-Sender: bde@besplex.bde.org
    To: Marius Strobl 
    Subject: Re: svn commit: r247620 - head/sys/sparc64/pci
    In-Reply-To: <201303021304.r22D4xoI089886@svn.freebsd.org>
    Message-ID: <20130303005613.A3532@besplex.bde.org>
    References: <201303021304.r22D4xoI089886@svn.freebsd.org>
    MIME-Version: 1.0
    Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
    X-Optus-CM-Score: 0
    X-Optus-CM-Analysis: v=2.0 cv=DdhPMYRW c=1 sm=1 a=qBJJwPPf2HcA:10
     a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=shoyfQpYrMMA:10
     a=1nWYaaUoRXj36-mlhGAA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117
    Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
     src-committers@FreeBSD.org
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 14:19:08 -0000
    
    On Sat, 2 Mar 2013, Marius Strobl wrote:
    
    > Log:
    >  Revert the part of r247600 which turned the overtemperature and power fail
    >  interrupt shutdown handlers into filters. Shutdown_nice(9) acquires a sleep
    >  lock, which filters shouldn't do. It also seems that kern_reboot(9) still
    >  may require Giant to be hold.
    >
    >  Submitted by:	bde
    
    Thanks.
    
    Ithreads shouldn't normally use sleep locks either, but I think that is
    OK here since the sleeping mainly prevents new interrupts on the same
    interrupt source being handledm but when this interrupt should shut down
    that doesn't matter (even if the the interrupt is multiplexed so that the
    new interrupts may be for another device).
    
    Maybe interrupt handlers for urgent events should increase their priority
    as much as possible.  They should start with highest interrupt priority.
    This is not very high but is hard to change.  Then if the interrupt handler
    can be reached, it is easy for it to raise its priority so that it doesn't
    get preempted.
    
    > Modified: head/sys/sparc64/pci/psycho.c
    > ...
    > @@ -643,7 +643,7 @@ psycho_attach(device_t dev)
    > 			 * The spare hardware interrupt is used for the
    > 			 * over-temperature interrupt.
    > 			 */
    > -			psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP,
    > +			psycho_set_intr(sc, 4, PSR_SPARE_INT_MAP, NULL,
    > 			    psycho_overtemp);
    > #ifdef PSYCHO_MAP_WAKEUP
    > 			/*
    
    I hope this asks for a high hardware interrupt priority.
    
    > @@ -722,7 +722,7 @@ psycho_set_intr(struct psycho_softc *sc,
    > 	    INTVEC(PSYCHO_READ8(sc, intrmap)) != vec ||
    > 	    intr_vectors[vec].iv_ic != &psycho_ic ||
    > 	    bus_setup_intr(sc->sc_dev, sc->sc_irq_res[index],
    > -	    INTR_TYPE_MISC | INTR_BRIDGE, handler, NULL, sc,
    > +	    INTR_TYPE_MISC | INTR_BRIDGE, filt, intr, sc,
    > 	    &sc->sc_ihand[index]) != 0)
    > 		panic("%s: failed to set up interrupt %d", __func__, index);
    > }
    
    INTR_TYPE_MISC is not very high.  In fact, it is mapped to PI_DULL =
    don't care = lowest hardware interrupt priority.
    
    > @@ -858,32 +858,30 @@ psycho_powerdebug(void *arg __unused)
    > 	return (FILTER_HANDLED);
    > }
    >
    > -static int
    > +static void
    > psycho_powerdown(void *arg __unused)
    > {
    > 	static int shutdown;
    >
    > 	/* As the interrupt is cleared we may be called multiple times. */
    > 	if (shutdown != 0)
    > -		return (FILTER_HANDLED);
    > +		return;
    > 	shutdown++;
    > 	printf("Power Failure Detected: Shutting down NOW.\n");
    > 	shutdown_nice(RB_POWEROFF);
    > -	return (FILTER_HANDLED);
    > }
    
    Since shutdown_nice() just signals init, raising the priority here
    wouldn't help run most of the shutdown at high priority or quickly.
    There are even intentional long delays in normal shutdowns, to let the
    operator read the messages.  So these events need to be not very urgent
    and allow a few seconds or even minutes to shut down.
    
    Bruce
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 14:19:09 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id E24FE861;
     Sat,  2 Mar 2013 14:19:09 +0000 (UTC)
     (envelope-from attilio@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 C6466D7B;
     Sat,  2 Mar 2013 14:19:09 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22EJ9BR012008;
     Sat, 2 Mar 2013 14:19:09 GMT (envelope-from attilio@svn.freebsd.org)
    Received: (from attilio@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22EJ9hE012002;
     Sat, 2 Mar 2013 14:19:09 GMT (envelope-from attilio@svn.freebsd.org)
    Message-Id: <201303021419.r22EJ9hE012002@svn.freebsd.org>
    From: Attilio Rao 
    Date: Sat, 2 Mar 2013 14:19:09 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247622 - in head/sys: amd64/amd64 amd64/include
     i386/i386 i386/include
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 14:19:10 -0000
    
    Author: attilio
    Date: Sat Mar  2 14:19:08 2013
    New Revision: 247622
    URL: http://svnweb.freebsd.org/changeset/base/247622
    
    Log:
      Merge from vmc-playground branch:
      Rename the pv_entry_t iterator from pv_list to pv_next.
      Besides being more correct technically (as the name seems to suggest
      this is a list while it is an iterator), it will also be needed by
      vm_radix work to avoid a nameclash on macro expansions.
      
      Sponsored by:	EMC / Isilon storage division
      Reviewed by:	alc, jeff
      Tested by:	flo, pho, jhb, davide
    
    Modified:
      head/sys/amd64/amd64/pmap.c
      head/sys/amd64/include/pmap.h
      head/sys/i386/i386/pmap.c
      head/sys/i386/include/pmap.h
    
    Modified: head/sys/amd64/amd64/pmap.c
    ==============================================================================
    --- head/sys/amd64/amd64/pmap.c	Sat Mar  2 13:08:13 2013	(r247621)
    +++ head/sys/amd64/amd64/pmap.c	Sat Mar  2 14:19:08 2013	(r247622)
    @@ -2222,7 +2222,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, str
     				if ((tpte & PG_A) != 0)
     					vm_page_aflag_set(m, PGA_REFERENCED);
     				CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m);
    -				TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
    +				TAILQ_REMOVE(&m->md.pv_list, pv, pv_next);
     				if (TAILQ_EMPTY(&m->md.pv_list) &&
     				    (m->flags & PG_FICTITIOUS) == 0) {
     					pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
    @@ -2506,9 +2506,9 @@ pmap_pvh_remove(struct md_page *pvh, pma
     	pv_entry_t pv;
     
     	rw_assert(&pvh_global_lock, RA_LOCKED);
    -	TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) {
     		if (pmap == PV_PMAP(pv) && va == pv->pv_va) {
    -			TAILQ_REMOVE(&pvh->pv_list, pv, pv_list);
    +			TAILQ_REMOVE(&pvh->pv_list, pv, pv_next);
     			break;
     		}
     	}
    @@ -2547,7 +2547,7 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse
     	pv = pmap_pvh_remove(pvh, pmap, va);
     	KASSERT(pv != NULL, ("pmap_pv_demote_pde: pv not found"));
     	m = PHYS_TO_VM_PAGE(pa);
    -	TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
    +	TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next);
     	/* Instantiate the remaining NPTEPG - 1 pv entries. */
     	PV_STAT(atomic_add_long(&pv_entry_allocs, NPTEPG - 1));
     	va_last = va + NBPDR - PAGE_SIZE;
    @@ -2565,7 +2565,7 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse
     				m++;
     				KASSERT((m->oflags & VPO_UNMANAGED) == 0,
     			    ("pmap_pv_demote_pde: page %p is not managed", m));
    -				TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
    +				TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next);
     				if (va == va_last)
     					goto out;
     			}
    @@ -2613,7 +2613,7 @@ pmap_pv_promote_pde(pmap_t pmap, vm_offs
     	pv = pmap_pvh_remove(&m->md, pmap, va);
     	KASSERT(pv != NULL, ("pmap_pv_promote_pde: pv not found"));
     	pvh = pa_to_pvh(pa);
    -	TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_list);
    +	TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next);
     	/* Free the remaining NPTEPG - 1 pv entries. */
     	va_last = va + NBPDR - PAGE_SIZE;
     	do {
    @@ -2654,7 +2654,7 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm
     	if ((pv = get_pv_entry(pmap, NULL)) != NULL) {
     		pv->pv_va = va;
     		CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m);
    -		TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
    +		TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next);
     		return (TRUE);
     	} else
     		return (FALSE);
    @@ -2678,7 +2678,7 @@ pmap_pv_insert_pde(pmap_t pmap, vm_offse
     		pv->pv_va = va;
     		CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa);
     		pvh = pa_to_pvh(pa);
    -		TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_list);
    +		TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next);
     		return (TRUE);
     	} else
     		return (FALSE);
    @@ -3157,7 +3157,7 @@ small_mappings:
     			vm_page_dirty(m);
     		pmap_unuse_pt(pmap, pv->pv_va, *pde, &free);
     		pmap_invalidate_page(pmap, pv->pv_va);
    -		TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
    +		TAILQ_REMOVE(&m->md.pv_list, pv, pv_next);
     		free_pv_entry(pmap, pv);
     		PMAP_UNLOCK(pmap);
     	}
    @@ -3602,7 +3602,7 @@ retry:
     		pv = get_pv_entry(pmap, &lock);
     		pv->pv_va = va;
     		CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, pa);
    -		TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
    +		TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next);
     		if ((newpte & PG_RW) != 0)
     			vm_page_aflag_set(m, PGA_WRITEABLE);
     	}
    @@ -4295,7 +4295,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p
     	rw_rlock(&pvh_global_lock);
     	lock = VM_PAGE_TO_PV_LIST_LOCK(m);
     	rw_rlock(lock);
    -	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) {
     		if (PV_PMAP(pv) == pmap) {
     			rv = TRUE;
     			break;
    @@ -4306,7 +4306,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p
     	}
     	if (!rv && loops < 16 && (m->flags & PG_FICTITIOUS) == 0) {
     		pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
    -		TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) {
    +		TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) {
     			if (PV_PMAP(pv) == pmap) {
     				rv = TRUE;
     				break;
    @@ -4358,7 +4358,7 @@ pmap_pvh_wired_mappings(struct md_page *
     	pv_entry_t pv;
     
     	rw_assert(&pvh_global_lock, RA_WLOCKED);
    -	TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		pte = pmap_pte(pmap, pv->pv_va);
    @@ -4489,7 +4489,7 @@ pmap_remove_pages(pmap_t pmap)
     				if ((tpte & PG_PS) != 0) {
     					pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE);
     					pvh = pa_to_pvh(tpte & PG_PS_FRAME);
    -					TAILQ_REMOVE(&pvh->pv_list, pv, pv_list);
    +					TAILQ_REMOVE(&pvh->pv_list, pv, pv_next);
     					if (TAILQ_EMPTY(&pvh->pv_list)) {
     						for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++)
     							if ((mt->aflags & PGA_WRITEABLE) != 0 &&
    @@ -4508,7 +4508,7 @@ pmap_remove_pages(pmap_t pmap)
     					}
     				} else {
     					pmap_resident_count_dec(pmap, 1);
    -					TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
    +					TAILQ_REMOVE(&m->md.pv_list, pv, pv_next);
     					if ((m->aflags & PGA_WRITEABLE) != 0 &&
     					    TAILQ_EMPTY(&m->md.pv_list) &&
     					    (m->flags & PG_FICTITIOUS) == 0) {
    @@ -4583,7 +4583,7 @@ pmap_is_modified_pvh(struct md_page *pvh
     
     	rw_assert(&pvh_global_lock, RA_WLOCKED);
     	rv = FALSE;
    -	TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		pte = pmap_pte(pmap, pv->pv_va);
    @@ -4654,7 +4654,7 @@ pmap_is_referenced_pvh(struct md_page *p
     
     	rw_assert(&pvh_global_lock, RA_WLOCKED);
     	rv = FALSE;
    -	TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		pte = pmap_pte(pmap, pv->pv_va);
    @@ -4695,7 +4695,7 @@ pmap_remove_write(vm_page_t m)
     	if ((m->flags & PG_FICTITIOUS) != 0)
     		goto small_mappings;
     	pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
    -	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) {
    +	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		va = pv->pv_va;
    @@ -4705,7 +4705,7 @@ pmap_remove_write(vm_page_t m)
     		PMAP_UNLOCK(pmap);
     	}
     small_mappings:
    -	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		pde = pmap_pde(pmap, pv->pv_va);
    @@ -4758,7 +4758,7 @@ pmap_ts_referenced(vm_page_t m)
     	if ((m->flags & PG_FICTITIOUS) != 0)
     		goto small_mappings;
     	pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
    -	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, pvn) {
    +	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, pvn) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		va = pv->pv_va;
    @@ -4792,9 +4792,9 @@ small_mappings:
     	if ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) {
     		pvf = pv;
     		do {
    -			pvn = TAILQ_NEXT(pv, pv_list);
    -			TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
    -			TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
    +			pvn = TAILQ_NEXT(pv, pv_next);
    +			TAILQ_REMOVE(&m->md.pv_list, pv, pv_next);
    +			TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next);
     			pmap = PV_PMAP(pv);
     			PMAP_LOCK(pmap);
     			pde = pmap_pde(pmap, pv->pv_va);
    @@ -4846,7 +4846,7 @@ pmap_clear_modify(vm_page_t m)
     	if ((m->flags & PG_FICTITIOUS) != 0)
     		goto small_mappings;
     	pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
    -	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) {
    +	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		va = pv->pv_va;
    @@ -4878,7 +4878,7 @@ pmap_clear_modify(vm_page_t m)
     		PMAP_UNLOCK(pmap);
     	}
     small_mappings:
    -	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		pde = pmap_pde(pmap, pv->pv_va);
    @@ -4915,7 +4915,7 @@ pmap_clear_reference(vm_page_t m)
     	if ((m->flags & PG_FICTITIOUS) != 0)
     		goto small_mappings;
     	pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
    -	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) {
    +	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		va = pv->pv_va;
    @@ -4938,7 +4938,7 @@ pmap_clear_reference(vm_page_t m)
     		PMAP_UNLOCK(pmap);
     	}
     small_mappings:
    -	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		pde = pmap_pde(pmap, pv->pv_va);
    
    Modified: head/sys/amd64/include/pmap.h
    ==============================================================================
    --- head/sys/amd64/include/pmap.h	Sat Mar  2 13:08:13 2013	(r247621)
    +++ head/sys/amd64/include/pmap.h	Sat Mar  2 14:19:08 2013	(r247622)
    @@ -277,7 +277,7 @@ extern struct pmap	kernel_pmap_store;
      */
     typedef struct pv_entry {
     	vm_offset_t	pv_va;		/* virtual address for mapping */
    -	TAILQ_ENTRY(pv_entry)	pv_list;
    +	TAILQ_ENTRY(pv_entry)	pv_next;
     } *pv_entry_t;
     
     /*
    
    Modified: head/sys/i386/i386/pmap.c
    ==============================================================================
    --- head/sys/i386/i386/pmap.c	Sat Mar  2 13:08:13 2013	(r247621)
    +++ head/sys/i386/i386/pmap.c	Sat Mar  2 14:19:08 2013	(r247622)
    @@ -2286,7 +2286,7 @@ pmap_pv_reclaim(pmap_t locked_pmap)
     					vm_page_dirty(m);
     				if ((tpte & PG_A) != 0)
     					vm_page_aflag_set(m, PGA_REFERENCED);
    -				TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
    +				TAILQ_REMOVE(&m->md.pv_list, pv, pv_next);
     				if (TAILQ_EMPTY(&m->md.pv_list) &&
     				    (m->flags & PG_FICTITIOUS) == 0) {
     					pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
    @@ -2491,9 +2491,9 @@ pmap_pvh_remove(struct md_page *pvh, pma
     	pv_entry_t pv;
     
     	rw_assert(&pvh_global_lock, RA_WLOCKED);
    -	TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) {
     		if (pmap == PV_PMAP(pv) && va == pv->pv_va) {
    -			TAILQ_REMOVE(&pvh->pv_list, pv, pv_list);
    +			TAILQ_REMOVE(&pvh->pv_list, pv, pv_next);
     			break;
     		}
     	}
    @@ -2521,7 +2521,7 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse
     	pv = pmap_pvh_remove(pvh, pmap, va);
     	KASSERT(pv != NULL, ("pmap_pv_demote_pde: pv not found"));
     	m = PHYS_TO_VM_PAGE(pa);
    -	TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
    +	TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next);
     	/* Instantiate the remaining NPTEPG - 1 pv entries. */
     	va_last = va + NBPDR - PAGE_SIZE;
     	do {
    @@ -2557,7 +2557,7 @@ pmap_pv_promote_pde(pmap_t pmap, vm_offs
     	pv = pmap_pvh_remove(&m->md, pmap, va);
     	KASSERT(pv != NULL, ("pmap_pv_promote_pde: pv not found"));
     	pvh = pa_to_pvh(pa);
    -	TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_list);
    +	TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next);
     	/* Free the remaining NPTEPG - 1 pv entries. */
     	va_last = va + NBPDR - PAGE_SIZE;
     	do {
    @@ -2604,7 +2604,7 @@ pmap_insert_entry(pmap_t pmap, vm_offset
     	PMAP_LOCK_ASSERT(pmap, MA_OWNED);
     	pv = get_pv_entry(pmap, FALSE);
     	pv->pv_va = va;
    -	TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
    +	TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next);
     }
     
     /*
    @@ -2620,7 +2620,7 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm
     	if (pv_entry_count < pv_entry_high_water && 
     	    (pv = get_pv_entry(pmap, TRUE)) != NULL) {
     		pv->pv_va = va;
    -		TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
    +		TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next);
     		return (TRUE);
     	} else
     		return (FALSE);
    @@ -2640,7 +2640,7 @@ pmap_pv_insert_pde(pmap_t pmap, vm_offse
     	    (pv = get_pv_entry(pmap, TRUE)) != NULL) {
     		pv->pv_va = va;
     		pvh = pa_to_pvh(pa);
    -		TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_list);
    +		TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next);
     		return (TRUE);
     	} else
     		return (FALSE);
    @@ -3095,7 +3095,7 @@ small_mappings:
     			vm_page_dirty(m);
     		pmap_unuse_pt(pmap, pv->pv_va, &free);
     		pmap_invalidate_page(pmap, pv->pv_va);
    -		TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
    +		TAILQ_REMOVE(&m->md.pv_list, pv, pv_next);
     		free_pv_entry(pmap, pv);
     		PMAP_UNLOCK(pmap);
     	}
    @@ -3550,7 +3550,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, 
     		if (pv == NULL)
     			pv = get_pv_entry(pmap, FALSE);
     		pv->pv_va = va;
    -		TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
    +		TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next);
     		pa |= PG_MANAGED;
     	} else if (pv != NULL)
     		free_pv_entry(pmap, pv);
    @@ -4258,7 +4258,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p
     	    ("pmap_page_exists_quick: page %p is not managed", m));
     	rv = FALSE;
     	rw_wlock(&pvh_global_lock);
    -	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) {
     		if (PV_PMAP(pv) == pmap) {
     			rv = TRUE;
     			break;
    @@ -4269,7 +4269,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p
     	}
     	if (!rv && loops < 16 && (m->flags & PG_FICTITIOUS) == 0) {
     		pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
    -		TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) {
    +		TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) {
     			if (PV_PMAP(pv) == pmap) {
     				rv = TRUE;
     				break;
    @@ -4321,7 +4321,7 @@ pmap_pvh_wired_mappings(struct md_page *
     
     	rw_assert(&pvh_global_lock, RA_WLOCKED);
     	sched_pin();
    -	TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		pte = pmap_pte_quick(pmap, pv->pv_va);
    @@ -4448,7 +4448,7 @@ pmap_remove_pages(pmap_t pmap)
     				if ((tpte & PG_PS) != 0) {
     					pmap->pm_stats.resident_count -= NBPDR / PAGE_SIZE;
     					pvh = pa_to_pvh(tpte & PG_PS_FRAME);
    -					TAILQ_REMOVE(&pvh->pv_list, pv, pv_list);
    +					TAILQ_REMOVE(&pvh->pv_list, pv, pv_next);
     					if (TAILQ_EMPTY(&pvh->pv_list)) {
     						for (mt = m; mt < &m[NBPDR / PAGE_SIZE]; mt++)
     							if (TAILQ_EMPTY(&mt->md.pv_list))
    @@ -4466,7 +4466,7 @@ pmap_remove_pages(pmap_t pmap)
     					}
     				} else {
     					pmap->pm_stats.resident_count--;
    -					TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
    +					TAILQ_REMOVE(&m->md.pv_list, pv, pv_next);
     					if (TAILQ_EMPTY(&m->md.pv_list) &&
     					    (m->flags & PG_FICTITIOUS) == 0) {
     						pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
    @@ -4536,7 +4536,7 @@ pmap_is_modified_pvh(struct md_page *pvh
     	rw_assert(&pvh_global_lock, RA_WLOCKED);
     	rv = FALSE;
     	sched_pin();
    -	TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		pte = pmap_pte_quick(pmap, pv->pv_va);
    @@ -4609,7 +4609,7 @@ pmap_is_referenced_pvh(struct md_page *p
     	rw_assert(&pvh_global_lock, RA_WLOCKED);
     	rv = FALSE;
     	sched_pin();
    -	TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		pte = pmap_pte_quick(pmap, pv->pv_va);
    @@ -4652,7 +4652,7 @@ pmap_remove_write(vm_page_t m)
     	if ((m->flags & PG_FICTITIOUS) != 0)
     		goto small_mappings;
     	pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
    -	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) {
    +	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) {
     		va = pv->pv_va;
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
    @@ -4662,7 +4662,7 @@ pmap_remove_write(vm_page_t m)
     		PMAP_UNLOCK(pmap);
     	}
     small_mappings:
    -	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		pde = pmap_pde(pmap, pv->pv_va);
    @@ -4721,7 +4721,7 @@ pmap_ts_referenced(vm_page_t m)
     	sched_pin();
     	if ((m->flags & PG_FICTITIOUS) != 0)
     		goto small_mappings;
    -	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, pvn) {
    +	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, pvn) {
     		va = pv->pv_va;
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
    @@ -4755,9 +4755,9 @@ small_mappings:
     	if ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) {
     		pvf = pv;
     		do {
    -			pvn = TAILQ_NEXT(pv, pv_list);
    -			TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
    -			TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
    +			pvn = TAILQ_NEXT(pv, pv_next);
    +			TAILQ_REMOVE(&m->md.pv_list, pv, pv_next);
    +			TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next);
     			pmap = PV_PMAP(pv);
     			PMAP_LOCK(pmap);
     			pde = pmap_pde(pmap, pv->pv_va);
    @@ -4811,7 +4811,7 @@ pmap_clear_modify(vm_page_t m)
     	if ((m->flags & PG_FICTITIOUS) != 0)
     		goto small_mappings;
     	pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
    -	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) {
    +	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) {
     		va = pv->pv_va;
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
    @@ -4848,7 +4848,7 @@ pmap_clear_modify(vm_page_t m)
     		PMAP_UNLOCK(pmap);
     	}
     small_mappings:
    -	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		pde = pmap_pde(pmap, pv->pv_va);
    @@ -4892,7 +4892,7 @@ pmap_clear_reference(vm_page_t m)
     	if ((m->flags & PG_FICTITIOUS) != 0)
     		goto small_mappings;
     	pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
    -	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) {
    +	TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) {
     		va = pv->pv_va;
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
    @@ -4915,7 +4915,7 @@ pmap_clear_reference(vm_page_t m)
     		PMAP_UNLOCK(pmap);
     	}
     small_mappings:
    -	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) {
     		pmap = PV_PMAP(pv);
     		PMAP_LOCK(pmap);
     		pde = pmap_pde(pmap, pv->pv_va);
    @@ -5426,7 +5426,7 @@ pmap_pvdump(vm_paddr_t pa)
     
     	printf("pa %x", pa);
     	m = PHYS_TO_VM_PAGE(pa);
    -	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
    +	TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) {
     		pmap = PV_PMAP(pv);
     		printf(" -> pmap %p, va %x", (void *)pmap, pv->pv_va);
     		pads(pmap);
    
    Modified: head/sys/i386/include/pmap.h
    ==============================================================================
    --- head/sys/i386/include/pmap.h	Sat Mar  2 13:08:13 2013	(r247621)
    +++ head/sys/i386/include/pmap.h	Sat Mar  2 14:19:08 2013	(r247622)
    @@ -468,7 +468,7 @@ extern struct pmap	kernel_pmap_store;
      */
     typedef struct pv_entry {
     	vm_offset_t	pv_va;		/* virtual address for mapping */
    -	TAILQ_ENTRY(pv_entry)	pv_list;
    +	TAILQ_ENTRY(pv_entry)	pv_next;
     } *pv_entry_t;
     
     /*
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 14:39:48 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id EEBDD777;
     Sat,  2 Mar 2013 14:39:48 +0000 (UTC) (envelope-from dim@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 B9854E9A;
     Sat,  2 Mar 2013 14:39:48 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22Edmjd018587;
     Sat, 2 Mar 2013 14:39:48 GMT (envelope-from dim@svn.freebsd.org)
    Received: (from dim@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22EdmeH018586;
     Sat, 2 Mar 2013 14:39:48 GMT (envelope-from dim@svn.freebsd.org)
    Message-Id: <201303021439.r22EdmeH018586@svn.freebsd.org>
    From: Dimitry Andric 
    Date: Sat, 2 Mar 2013 14:39: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: r247625 - stable/9/contrib/llvm/lib/Target/X86
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 14:39:49 -0000
    
    Author: dim
    Date: Sat Mar  2 14:39:48 2013
    New Revision: 247625
    URL: http://svnweb.freebsd.org/changeset/base/247625
    
    Log:
      MFC r247205:
      
      Pull in r175962 from upstream llvm trunk:
      
        X86: Disable cmov-memory patterns on subtargets without cmov.
      
        Fixes PR15115.
      
      For the i386 arch, this should enable cmov instructions only on
      -march=pentiumpro and higher.  Since our default CPU is i486, cmov
      instructions will now be disabled by default.
    
    Modified:
      stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td
    Directory Properties:
      stable/9/contrib/llvm/   (props changed)
    
    Modified: stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td
    ==============================================================================
    --- stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td	Sat Mar  2 14:35:15 2013	(r247624)
    +++ stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td	Sat Mar  2 14:39:48 2013	(r247625)
    @@ -1076,12 +1076,14 @@ def : Pat<(X86cmp GR64:$src1, 0),
     // inverted.
     multiclass CMOVmr {
    -  def : Pat<(X86cmov (loadi16 addr:$src1), GR16:$src2, InvertedCond, EFLAGS),
    -            (Inst16 GR16:$src2, addr:$src1)>;
    -  def : Pat<(X86cmov (loadi32 addr:$src1), GR32:$src2, InvertedCond, EFLAGS),
    -            (Inst32 GR32:$src2, addr:$src1)>;
    -  def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, InvertedCond, EFLAGS),
    -            (Inst64 GR64:$src2, addr:$src1)>;
    +  let Predicates = [HasCMov] in {
    +    def : Pat<(X86cmov (loadi16 addr:$src1), GR16:$src2, InvertedCond, EFLAGS),
    +              (Inst16 GR16:$src2, addr:$src1)>;
    +    def : Pat<(X86cmov (loadi32 addr:$src1), GR32:$src2, InvertedCond, EFLAGS),
    +              (Inst32 GR32:$src2, addr:$src1)>;
    +    def : Pat<(X86cmov (loadi64 addr:$src1), GR64:$src2, InvertedCond, EFLAGS),
    +              (Inst64 GR64:$src2, addr:$src1)>;
    +  }
     }
     
     defm : CMOVmr;
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 14:47:11 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 1AD851A9;
     Sat,  2 Mar 2013 14:47:11 +0000 (UTC)
     (envelope-from melifaro@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 0D581EF8;
     Sat,  2 Mar 2013 14:47:11 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22ElA14022010;
     Sat, 2 Mar 2013 14:47:10 GMT (envelope-from melifaro@svn.freebsd.org)
    Received: (from melifaro@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22ElAxh022009;
     Sat, 2 Mar 2013 14:47:10 GMT (envelope-from melifaro@svn.freebsd.org)
    Message-Id: <201303021447.r22ElAxh022009@svn.freebsd.org>
    From: "Alexander V. Chernikov" 
    Date: Sat, 2 Mar 2013 14:47:10 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247626 - head/sys/netpfil/ipfw
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 14:47:11 -0000
    
    Author: melifaro
    Date: Sat Mar  2 14:47:10 2013
    New Revision: 247626
    URL: http://svnweb.freebsd.org/changeset/base/247626
    
    Log:
      Fix callout expiring dynamic rules.
      
      PR:		kern/175530
      Submitted by:	Vladimir Spiridenkov 
      MFC after:	2 weeks
    
    Modified:
      head/sys/netpfil/ipfw/ip_fw_dynamic.c
    
    Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c
    ==============================================================================
    --- head/sys/netpfil/ipfw/ip_fw_dynamic.c	Sat Mar  2 14:39:48 2013	(r247625)
    +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c	Sat Mar  2 14:47:10 2013	(r247626)
    @@ -980,8 +980,8 @@ ipfw_dyn_tick(void * vnetx) 
     
     	chain = &V_layer3_chain;
     
    -	/* Run keepalive checks every keepalive_interval iff ka is enabled */
    -	if ((V_dyn_keepalive_last + V_dyn_keepalive_interval >= time_uptime) &&
    +	/* Run keepalive checks every keepalive_period iff ka is enabled */
    +	if ((V_dyn_keepalive_last + V_dyn_keepalive_period <= time_uptime) &&
     	    (V_dyn_keepalive != 0)) {
     		V_dyn_keepalive_last = time_uptime;
     		check_ka = 1;
    @@ -1320,7 +1320,7 @@ ipfw_dyn_init(struct ip_fw_chain *chain)
             V_dyn_keepalive_interval = 20;
             V_dyn_keepalive_period = 5;
             V_dyn_keepalive = 1;    /* do send keepalives */
    -	V_dyn_keepalive = time_uptime;
    +	V_dyn_keepalive_last = time_uptime;
             
             V_dyn_max = 4096;       /* max # of dynamic rules */
     
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 14:54:34 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 730BABAE;
     Sat,  2 Mar 2013 14:54:34 +0000 (UTC)
     (envelope-from attilio@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 4D861F5A;
     Sat,  2 Mar 2013 14:54:34 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22EsYVp025186;
     Sat, 2 Mar 2013 14:54:34 GMT (envelope-from attilio@svn.freebsd.org)
    Received: (from attilio@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22EsYIs025185;
     Sat, 2 Mar 2013 14:54:34 GMT (envelope-from attilio@svn.freebsd.org)
    Message-Id: <201303021454.r22EsYIs025185@svn.freebsd.org>
    From: Attilio Rao 
    Date: Sat, 2 Mar 2013 14:54:34 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247628 - in head: sbin/mount_hpfs sys/fs/hpfs
     sys/modules/hpfs
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 14:54:34 -0000
    
    Author: attilio
    Date: Sat Mar  2 14:54:33 2013
    New Revision: 247628
    URL: http://svnweb.freebsd.org/changeset/base/247628
    
    Log:
      Garbage collect HPFS bits which are now already completely disconnected
      from the tree since few months (please note that the userland bits
      were already disconnected since a long time, thus there is no need
      to update the OLD* entries).
      
      This is not targeted for MFC.
    
    Deleted:
      head/sbin/mount_hpfs/
      head/sys/fs/hpfs/
      head/sys/modules/hpfs/
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 15:11:21 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 9DC3E9BD;
     Sat,  2 Mar 2013 15:11:21 +0000 (UTC)
     (envelope-from melifaro@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 755B9DC;
     Sat,  2 Mar 2013 15:11:21 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22FBLp1031843;
     Sat, 2 Mar 2013 15:11:21 GMT (envelope-from melifaro@svn.freebsd.org)
    Received: (from melifaro@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22FBLod031840;
     Sat, 2 Mar 2013 15:11:21 GMT (envelope-from melifaro@svn.freebsd.org)
    Message-Id: <201303021511.r22FBLod031840@svn.freebsd.org>
    From: "Alexander V. Chernikov" 
    Date: Sat, 2 Mar 2013 15:11: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: r247629 - in stable/9/sys: kern net security/mac
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 15:11:21 -0000
    
    Author: melifaro
    Date: Sat Mar  2 15:11:20 2013
    New Revision: 247629
    URL: http://svnweb.freebsd.org/changeset/base/247629
    
    Log:
      Merge
      * r233937 - Improve BPF locking model
      * r233938 - Improve performace for writer-only BPF users
      * r233946 - Fix build
      * r235744 - Fix (new) panic on attaching to non-existent interface
      * r235745 - Fix old panic when BPF consumer attaches to destroying interface
      * r235746 - Call bpf_jitter() before acquiring BPF global lock
      * r235747 - Make most BPF ioctls() SMP-safe.
      * r236231 - Fix BPF_JITTER code broken by r235746.
      * r236251 - Fix shim for BIOCSETF to drop all packets buffered on the descriptor.
      * r236261 - Save the previous filter right before we set new one.
      * r236262 - Fix style(9) nits, reduce unnecessary type castings.
      * r236559 - Fix panic introduced by r235745
      * r236806 - Fix typo introduced in r236559.
      
      r233937
        - Improve BPF locking model.
      
        Interface locks and descriptor locks are converted from mutex(9) to rwlock(9).
        This greately improves performance: in most common case we need to acquire 1
        reader lock instead of 2 mutexes.
      
        - Remove filter(descriptor) (reader) lock in bpf_mtap[2]
        This was suggested by glebius@. We protect filter by requesting interface
        writer lock on filter change.
      
        - Cover struct bpf_if under BPF_INTERNAL define. This permits including bpf.h
        without including rwlock stuff. However, this is is temporary solution,
        struct bpf_if should be made opaque for any external caller.
      
      r233938
        - Improve performace for writer-only BPF users.
      
        Linux and Solaris (at least OpenSolaris) has PF_PACKET socket families to send
        raw ethernet frames. The only FreeBSD interface that can be used to send raw
        frames is BPF. As a result, many programs like cdpd, lldpd, various dhcp stuff
        uses BPF only to send data. This leads us to the situation when software like
        cdpd, being run on high-traffic-volume interface significantly reduces overall
        performance since we have to acquire additional locks for every packet.
      
        Here we add sysctl that changes BPF behavior in the following way:
        If program came and opens BPF socket without explicitly specifyin read filter
        we assume it to be write-only and add it to special writer-only per-interface
        list. This makes bpf_peers_present() return 0, so no additional overhead is
        introduced. After filter is supplied, descriptor is added to original
        per-interface list permitting packets to be captured.
      
        Unfortunately, pcap_open_live() sets catch-all filter itself for the purpose
        of setting snap length.
      
        Fortunately, most programs explicitly sets (event catch-all) filter after
        that. tcpdump(1) is a good example.
      
        So a bit hackis approach is taken: we upgrade description only after second
        BIOCSETF is received.
      
        Sysctl is named net.bpf.optimize_writers and is turned off by default.
      
        - While here, document all sysctl variables in bpf.4
      
      r233946
        Fix build broken by r233938.
      
      r235744
        Fix panic on attaching to non-existent interface
      	(introduced by r233937, pointed by hrs@)
        Fix panic on tcpdump being attached to interface being removed
      	(introduced by r233937, pointed by hrs@ and adrian@)
        Protect most of bpf_setf() by BPF global lock
      
        Add several forgotten assertions (thanks to adrian@)
      
        Document current locking model inside bpf.c
        Document EVENTHANDLER(9) usage inside BPF.
      
      r235745
        Fix old panic when BPF consumer attaches to destroying interface.
        'flags' field is added to the end of bpf_if structure. Currently the only
        flag is BPFIF_FLAG_DYING which is set on bpf detach and checked by bpf_attachd()
        Problem can be easily triggered on SMP stable/[89] by the following command
        (sort of):
        'while true; do ifconfig vlan222 create vlan 222 vlandev em0 up ; \
          tcpdump -pi vlan222 & ; ifconfig vlan222 destroy ; done'
      
        Fix possible use-after-free when BPF detaches itself from interface, freeing
        bpf_bif memory, while interface is still UP and there can be routes via this
        interface. Freeing is now delayed till ifnet_departure_event is received via
        eventhandler(9) api.
      
        Convert bpfd rwlock back to mutex due lack of performance gain
        (currently checking if packet matches filter is done without holding bpfd
         lock and we have to acquire write lock if packet matches)
      
      r235746
        Call bpf_jitter() before acquiring BPF global lock due to malloc() being
        used inside bpf_jitter.
      
        Eliminate bpf_buffer_alloc() and allocate BPF buffers on descriptor creation
         and BIOCSBLEN ioctl. This permits us not to allocate buffers inside
         bpf_attachd() which is protected by global lock.
      
      r235747
        Make most BPF ioctls() SMP-safe.
      
      r236559
        Fix panic introduced by r235745. Panic occurs after first packet traverse
        renamed interface.
        Add several comments on locking
      
      r236231
        Fix BPF_JITTER code broken by r235746.
      
      r236251
        Fix 32-bit shim for BIOCSETF to drop all packets buffered on the descriptor
        and reset statistics as it should.
      
      r236261
        - Save the previous filter right before we set new one.
        - Reduce duplicate code and make it little easier to read.
      
      r236262
        Fix style(9) nits, reduce unnecessary type castings, etc., for bpf_setf().
      
      r236806
        Fix typo introduced in r236559.
    
    Modified:
      stable/9/sys/kern/subr_witness.c
      stable/9/sys/net/bpf.c
      stable/9/sys/net/bpf.h
      stable/9/sys/net/bpf_buffer.c
      stable/9/sys/net/bpf_buffer.h
      stable/9/sys/net/bpfdesc.h
      stable/9/sys/security/mac/mac_net.c
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/kern/subr_witness.c
    ==============================================================================
    --- stable/9/sys/kern/subr_witness.c	Sat Mar  2 14:54:33 2013	(r247628)
    +++ stable/9/sys/kern/subr_witness.c	Sat Mar  2 15:11:20 2013	(r247629)
    @@ -562,7 +562,7 @@ static struct witness_order_list_entry o
     	 * BPF
     	 */
     	{ "bpf global lock", &lock_class_mtx_sleep },
    -	{ "bpf interface lock", &lock_class_mtx_sleep },
    +	{ "bpf interface lock", &lock_class_rw },
     	{ "bpf cdev lock", &lock_class_mtx_sleep },
     	{ NULL, NULL },
     	/*
    
    Modified: stable/9/sys/net/bpf.c
    ==============================================================================
    --- stable/9/sys/net/bpf.c	Sat Mar  2 14:54:33 2013	(r247628)
    +++ stable/9/sys/net/bpf.c	Sat Mar  2 15:11:20 2013	(r247629)
    @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$");
     
     #include 
     #include 
    +#include 
    +#include 
     #include 
     #include 
     #include 
    @@ -66,6 +68,7 @@ __FBSDID("$FreeBSD$");
     #include 
     
     #include 
    +#define	BPF_INTERNAL
     #include 
     #include 
     #ifdef BPF_JITTER
    @@ -144,6 +147,7 @@ static int		bpf_bpfd_cnt;
     
     static void	bpf_attachd(struct bpf_d *, struct bpf_if *);
     static void	bpf_detachd(struct bpf_d *);
    +static void	bpf_detachd_locked(struct bpf_d *);
     static void	bpf_freed(struct bpf_d *);
     static int	bpf_movein(struct uio *, int, struct ifnet *, struct mbuf **,
     		    struct sockaddr *, int *, struct bpf_insn *);
    @@ -155,7 +159,7 @@ static void	catchpacket(struct bpf_d *, 
     		    void (*)(struct bpf_d *, caddr_t, u_int, void *, u_int),
     		    struct bintime *);
     static void	reset_d(struct bpf_d *);
    -static int	 bpf_setf(struct bpf_d *, struct bpf_program *, u_long cmd);
    +static int	bpf_setf(struct bpf_d *, struct bpf_program *, u_long cmd);
     static int	bpf_getdltlist(struct bpf_d *, struct bpf_dltlist *);
     static int	bpf_setdlt(struct bpf_d *, u_int);
     static void	filt_bpfdetach(struct knote *);
    @@ -173,6 +177,12 @@ SYSCTL_INT(_net_bpf, OID_AUTO, zerocopy_
     SYSCTL_NODE(_net_bpf, OID_AUTO, stats, CTLFLAG_MPSAFE | CTLFLAG_RW,
         bpf_stats_sysctl, "bpf statistics portal");
     
    +static VNET_DEFINE(int, bpf_optimize_writers) = 0;
    +#define	V_bpf_optimize_writers VNET(bpf_optimize_writers)
    +SYSCTL_VNET_INT(_net_bpf, OID_AUTO, optimize_writers,
    +    CTLFLAG_RW, &VNET_NAME(bpf_optimize_writers), 0,
    +    "Do not send packets until BPF program is set");
    +
     static	d_open_t	bpfopen;
     static	d_read_t	bpfread;
     static	d_write_t	bpfwrite;
    @@ -197,6 +207,37 @@ static struct filterops bpfread_filtops 
     	.f_event = filt_bpfread,
     };
     
    +eventhandler_tag	bpf_ifdetach_cookie = NULL;
    +
    +/*
    + * LOCKING MODEL USED BY BPF:
    + * Locks:
    + * 1) global lock (BPF_LOCK). Mutex, used to protect interface addition/removal,
    + * some global counters and every bpf_if reference.
    + * 2) Interface lock. Rwlock, used to protect list of BPF descriptors and their filters.
    + * 3) Descriptor lock. Mutex, used to protect BPF buffers and various structure fields
    + *   used by bpf_mtap code.
    + *
    + * Lock order:
    + *
    + * Global lock, interface lock, descriptor lock
    + *
    + * We have to acquire interface lock before descriptor main lock due to BPF_MTAP[2]
    + * working model. In many places (like bpf_detachd) we start with BPF descriptor
    + * (and we need to at least rlock it to get reliable interface pointer). This
    + * gives us potential LOR. As a result, we use global lock to protect from bpf_if
    + * change in every such place.
    + *
    + * Changing d->bd_bif is protected by 1) global lock, 2) interface lock and
    + * 3) descriptor main wlock.
    + * Reading bd_bif can be protected by any of these locks, typically global lock.
    + *
    + * Changing read/write BPF filter is protected by the same three locks,
    + * the same applies for reading.
    + *
    + * Sleeping in global lock is not allowed due to bpfdetach() using it.
    + */
    +
     /*
      * Wrapper functions for various buffering methods.  If the set of buffer
      * modes expands, we will probably want to introduce a switch data structure
    @@ -290,7 +331,6 @@ bpf_canfreebuf(struct bpf_d *d)
     static int
     bpf_canwritebuf(struct bpf_d *d)
     {
    -
     	BPFD_LOCK_ASSERT(d);
     
     	switch (d->bd_bufmode) {
    @@ -569,17 +609,92 @@ bad:
     static void
     bpf_attachd(struct bpf_d *d, struct bpf_if *bp)
     {
    +	int op_w;
    +
    +	BPF_LOCK_ASSERT();
    +
    +	/*
    +	 * Save sysctl value to protect from sysctl change
    +	 * between reads
    +	 */
    +	op_w = V_bpf_optimize_writers;
    +
    +	if (d->bd_bif != NULL)
    +		bpf_detachd_locked(d);
     	/*
    -	 * Point d at bp, and add d to the interface's list of listeners.
    -	 * Finally, point the driver's bpf cookie at the interface so
    -	 * it will divert packets to bpf.
    +	 * Point d at bp, and add d to the interface's list.
    +	 * Since there are many applicaiotns using BPF for
    +	 * sending raw packets only (dhcpd, cdpd are good examples)
    +	 * we can delay adding d to the list of active listeners until
    +	 * some filter is configured.
     	 */
    -	BPFIF_LOCK(bp);
    +
    +	BPFIF_WLOCK(bp);
    +	BPFD_LOCK(d);
    +
     	d->bd_bif = bp;
    -	LIST_INSERT_HEAD(&bp->bif_dlist, d, bd_next);
    +
    +	if (op_w != 0) {
    +		/* Add to writers-only list */
    +		LIST_INSERT_HEAD(&bp->bif_wlist, d, bd_next);
    +		/*
    +		 * We decrement bd_writer on every filter set operation.
    +		 * First BIOCSETF is done by pcap_open_live() to set up
    +		 * snap length. After that appliation usually sets its own filter
    +		 */
    +		d->bd_writer = 2;
    +	} else
    +		LIST_INSERT_HEAD(&bp->bif_dlist, d, bd_next);
    +
    +	BPFD_UNLOCK(d);
    +	BPFIF_WUNLOCK(bp);
     
     	bpf_bpfd_cnt++;
    -	BPFIF_UNLOCK(bp);
    +
    +	CTR3(KTR_NET, "%s: bpf_attach called by pid %d, adding to %s list",
    +	    __func__, d->bd_pid, d->bd_writer ? "writer" : "active");
    +
    +	if (op_w == 0)
    +		EVENTHANDLER_INVOKE(bpf_track, bp->bif_ifp, bp->bif_dlt, 1);
    +}
    +
    +/*
    + * Add d to the list of active bp filters.
    + * Reuqires bpf_attachd() to be called before
    + */
    +static void
    +bpf_upgraded(struct bpf_d *d)
    +{
    +	struct bpf_if *bp;
    +
    +	BPF_LOCK_ASSERT();
    +
    +	bp = d->bd_bif;
    +
    +	/*
    +	 * Filter can be set several times without specifying interface.
    +	 * Mark d as reader and exit.
    +	 */
    +	if (bp == NULL) {
    +		BPFD_LOCK(d);
    +		d->bd_writer = 0;
    +		BPFD_UNLOCK(d);
    +		return;
    +	}
    +
    +	BPFIF_WLOCK(bp);
    +	BPFD_LOCK(d);
    +
    +	/* Remove from writers-only list */
    +	LIST_REMOVE(d, bd_next);
    +	LIST_INSERT_HEAD(&bp->bif_dlist, d, bd_next);
    +	/* Mark d as reader */
    +	d->bd_writer = 0;
    +
    +	BPFD_UNLOCK(d);
    +	BPFIF_WUNLOCK(bp);
    +
    +	CTR2(KTR_NET, "%s: upgrade required by pid %d", __func__, d->bd_pid);
     
     	EVENTHANDLER_INVOKE(bpf_track, bp->bif_ifp, bp->bif_dlt, 1);
     }
    @@ -590,26 +705,47 @@ bpf_attachd(struct bpf_d *d, struct bpf_
     static void
     bpf_detachd(struct bpf_d *d)
     {
    +	BPF_LOCK();
    +	bpf_detachd_locked(d);
    +	BPF_UNLOCK();
    +}
    +
    +static void
    +bpf_detachd_locked(struct bpf_d *d)
    +{
     	int error;
     	struct bpf_if *bp;
     	struct ifnet *ifp;
     
    -	bp = d->bd_bif;
    -	BPFIF_LOCK(bp);
    +	CTR2(KTR_NET, "%s: detach required by pid %d", __func__, d->bd_pid);
    +
    +	BPF_LOCK_ASSERT();
    +
    +	/* Check if descriptor is attached */
    +	if ((bp = d->bd_bif) == NULL)
    +		return;
    +
    +	BPFIF_WLOCK(bp);
     	BPFD_LOCK(d);
    -	ifp = d->bd_bif->bif_ifp;
    +
    +	/* Save bd_writer value */
    +	error = d->bd_writer;
     
     	/*
     	 * Remove d from the interface's descriptor list.
     	 */
     	LIST_REMOVE(d, bd_next);
     
    -	bpf_bpfd_cnt--;
    +	ifp = bp->bif_ifp;
     	d->bd_bif = NULL;
     	BPFD_UNLOCK(d);
    -	BPFIF_UNLOCK(bp);
    +	BPFIF_WUNLOCK(bp);
    +
    +	bpf_bpfd_cnt--;
     
    -	EVENTHANDLER_INVOKE(bpf_track, ifp, bp->bif_dlt, 0);
    +	/* Call event handler iff d is attached */
    +	if (error == 0)
    +		EVENTHANDLER_INVOKE(bpf_track, ifp, bp->bif_dlt, 0);
     
     	/*
     	 * Check if this descriptor had requested promiscuous mode.
    @@ -648,10 +784,7 @@ bpf_dtor(void *data)
     	d->bd_state = BPF_IDLE;
     	BPFD_UNLOCK(d);
     	funsetown(&d->bd_sigio);
    -	mtx_lock(&bpf_mtx);
    -	if (d->bd_bif)
    -		bpf_detachd(d);
    -	mtx_unlock(&bpf_mtx);
    +	bpf_detachd(d);
     #ifdef MAC
     	mac_bpfdesc_destroy(d);
     #endif /* MAC */
    @@ -671,7 +804,7 @@ static	int
     bpfopen(struct cdev *dev, int flags, int fmt, struct thread *td)
     {
     	struct bpf_d *d;
    -	int error;
    +	int error, size;
     
     	d = malloc(sizeof(*d), M_BPF, M_WAITOK | M_ZERO);
     	error = devfs_set_cdevpriv(d, bpf_dtor);
    @@ -689,14 +822,18 @@ bpfopen(struct cdev *dev, int flags, int
     	d->bd_bufmode = BPF_BUFMODE_BUFFER;
     	d->bd_sig = SIGIO;
     	d->bd_direction = BPF_D_INOUT;
    -	d->bd_pid = td->td_proc->p_pid;
    +	BPF_PID_REFRESH(d, td);
     #ifdef MAC
     	mac_bpfdesc_init(d);
     	mac_bpfdesc_create(td->td_ucred, d);
     #endif
    -	mtx_init(&d->bd_mtx, devtoname(dev), "bpf cdev lock", MTX_DEF);
    -	callout_init_mtx(&d->bd_callout, &d->bd_mtx, 0);
    -	knlist_init_mtx(&d->bd_sel.si_note, &d->bd_mtx);
    +	mtx_init(&d->bd_lock, devtoname(dev), "bpf cdev lock", MTX_DEF);
    +	callout_init_mtx(&d->bd_callout, &d->bd_lock, 0);
    +	knlist_init_mtx(&d->bd_sel.si_note, &d->bd_lock);
    +
    +	/* Allocate default buffers */
    +	size = d->bd_bufsize;
    +	bpf_buffer_ioctl_sblen(d, &size);
     
     	return (0);
     }
    @@ -726,7 +863,7 @@ bpfread(struct cdev *dev, struct uio *ui
     	non_block = ((ioflag & O_NONBLOCK) != 0);
     
     	BPFD_LOCK(d);
    -	d->bd_pid = curthread->td_proc->p_pid;
    +	BPF_PID_REFRESH_CUR(d);
     	if (d->bd_bufmode != BPF_BUFMODE_BUFFER) {
     		BPFD_UNLOCK(d);
     		return (EOPNOTSUPP);
    @@ -772,7 +909,7 @@ bpfread(struct cdev *dev, struct uio *ui
     			BPFD_UNLOCK(d);
     			return (EWOULDBLOCK);
     		}
    -		error = msleep(d, &d->bd_mtx, PRINET|PCATCH,
    +		error = msleep(d, &d->bd_lock, PRINET|PCATCH,
     		     "bpf", d->bd_rtout);
     		if (error == EINTR || error == ERESTART) {
     			BPFD_UNLOCK(d);
    @@ -889,8 +1026,9 @@ bpfwrite(struct cdev *dev, struct uio *u
     	if (error != 0)
     		return (error);
     
    -	d->bd_pid = curthread->td_proc->p_pid;
    +	BPF_PID_REFRESH_CUR(d);
     	d->bd_wcount++;
    +	/* XXX: locking required */
     	if (d->bd_bif == NULL) {
     		d->bd_wdcount++;
     		return (ENXIO);
    @@ -911,6 +1049,7 @@ bpfwrite(struct cdev *dev, struct uio *u
     	bzero(&dst, sizeof(dst));
     	m = NULL;
     	hlen = 0;
    +	/* XXX: bpf_movein() can sleep */
     	error = bpf_movein(uio, (int)d->bd_bif->bif_dlt, ifp,
     	    &m, &dst, &hlen, d->bd_wfilter);
     	if (error) {
    @@ -970,7 +1109,7 @@ static void
     reset_d(struct bpf_d *d)
     {
     
    -	mtx_assert(&d->bd_mtx, MA_OWNED);
    +	BPFD_LOCK_ASSERT(d);
     
     	if ((d->bd_hbuf != NULL) &&
     	    (d->bd_bufmode != BPF_BUFMODE_ZBUF || bpf_canfreebuf(d))) {
    @@ -1038,7 +1177,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c
     	 * Refresh PID associated with this descriptor.
     	 */
     	BPFD_LOCK(d);
    -	d->bd_pid = td->td_proc->p_pid;
    +	BPF_PID_REFRESH(d, td);
     	if (d->bd_state == BPF_WAITING)
     		callout_stop(&d->bd_callout);
     	d->bd_state = BPF_IDLE;
    @@ -1090,7 +1229,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c
     	case BIOCGDLTLIST32:
     	case BIOCGRTIMEOUT32:
     	case BIOCSRTIMEOUT32:
    +		BPFD_LOCK(d);
     		d->bd_compat32 = 1;
    +		BPFD_UNLOCK(d);
     	}
     #endif
     
    @@ -1135,7 +1276,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c
     	 * Get buffer len [for read()].
     	 */
     	case BIOCGBLEN:
    +		BPFD_LOCK(d);
     		*(u_int *)addr = d->bd_bufsize;
    +		BPFD_UNLOCK(d);
     		break;
     
     	/*
    @@ -1190,10 +1333,12 @@ bpfioctl(struct cdev *dev, u_long cmd, c
     	 * Get current data link type.
     	 */
     	case BIOCGDLT:
    +		BPF_LOCK();
     		if (d->bd_bif == NULL)
     			error = EINVAL;
     		else
     			*(u_int *)addr = d->bd_bif->bif_dlt;
    +		BPF_UNLOCK();
     		break;
     
     	/*
    @@ -1208,6 +1353,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c
     			list32 = (struct bpf_dltlist32 *)addr;
     			dltlist.bfl_len = list32->bfl_len;
     			dltlist.bfl_list = PTRIN(list32->bfl_list);
    +			BPF_LOCK();
     			if (d->bd_bif == NULL)
     				error = EINVAL;
     			else {
    @@ -1215,31 +1361,37 @@ bpfioctl(struct cdev *dev, u_long cmd, c
     				if (error == 0)
     					list32->bfl_len = dltlist.bfl_len;
     			}
    +			BPF_UNLOCK();
     			break;
     		}
     #endif
     
     	case BIOCGDLTLIST:
    +		BPF_LOCK();
     		if (d->bd_bif == NULL)
     			error = EINVAL;
     		else
     			error = bpf_getdltlist(d, (struct bpf_dltlist *)addr);
    +		BPF_UNLOCK();
     		break;
     
     	/*
     	 * Set data link type.
     	 */
     	case BIOCSDLT:
    +		BPF_LOCK();
     		if (d->bd_bif == NULL)
     			error = EINVAL;
     		else
     			error = bpf_setdlt(d, *(u_int *)addr);
    +		BPF_UNLOCK();
     		break;
     
     	/*
     	 * Get interface name.
     	 */
     	case BIOCGETIF:
    +		BPF_LOCK();
     		if (d->bd_bif == NULL)
     			error = EINVAL;
     		else {
    @@ -1249,13 +1401,16 @@ bpfioctl(struct cdev *dev, u_long cmd, c
     			strlcpy(ifr->ifr_name, ifp->if_xname,
     			    sizeof(ifr->ifr_name));
     		}
    +		BPF_UNLOCK();
     		break;
     
     	/*
     	 * Set interface.
     	 */
     	case BIOCSETIF:
    +		BPF_LOCK();
     		error = bpf_setif(d, (struct ifreq *)addr);
    +		BPF_UNLOCK();
     		break;
     
     	/*
    @@ -1338,7 +1493,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c
     	 * Set immediate mode.
     	 */
     	case BIOCIMMEDIATE:
    +		BPFD_LOCK(d);
     		d->bd_immediate = *(u_int *)addr;
    +		BPFD_UNLOCK(d);
     		break;
     
     	case BIOCVERSION:
    @@ -1354,21 +1511,27 @@ bpfioctl(struct cdev *dev, u_long cmd, c
     	 * Get "header already complete" flag
     	 */
     	case BIOCGHDRCMPLT:
    +		BPFD_LOCK(d);
     		*(u_int *)addr = d->bd_hdrcmplt;
    +		BPFD_UNLOCK(d);
     		break;
     
     	/*
     	 * Set "header already complete" flag
     	 */
     	case BIOCSHDRCMPLT:
    +		BPFD_LOCK(d);
     		d->bd_hdrcmplt = *(u_int *)addr ? 1 : 0;
    +		BPFD_UNLOCK(d);
     		break;
     
     	/*
     	 * Get packet direction flag
     	 */
     	case BIOCGDIRECTION:
    +		BPFD_LOCK(d);
     		*(u_int *)addr = d->bd_direction;
    +		BPFD_UNLOCK(d);
     		break;
     
     	/*
    @@ -1383,7 +1546,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c
     			case BPF_D_IN:
     			case BPF_D_INOUT:
     			case BPF_D_OUT:
    +				BPFD_LOCK(d);
     				d->bd_direction = direction;
    +				BPFD_UNLOCK(d);
     				break;
     			default:
     				error = EINVAL;
    @@ -1395,7 +1560,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c
     	 * Get packet timestamp format and resolution.
     	 */
     	case BIOCGTSTAMP:
    +		BPFD_LOCK(d);
     		*(u_int *)addr = d->bd_tstamp;
    +		BPFD_UNLOCK(d);
     		break;
     
     	/*
    @@ -1414,26 +1581,38 @@ bpfioctl(struct cdev *dev, u_long cmd, c
     		break;
     
     	case BIOCFEEDBACK:
    +		BPFD_LOCK(d);
     		d->bd_feedback = *(u_int *)addr;
    +		BPFD_UNLOCK(d);
     		break;
     
     	case BIOCLOCK:
    +		BPFD_LOCK(d);
     		d->bd_locked = 1;
    +		BPFD_UNLOCK(d);
     		break;
     
     	case FIONBIO:		/* Non-blocking I/O */
     		break;
     
     	case FIOASYNC:		/* Send signal on receive packets */
    +		BPFD_LOCK(d);
     		d->bd_async = *(int *)addr;
    +		BPFD_UNLOCK(d);
     		break;
     
     	case FIOSETOWN:
    +		/*
    +		 * XXX: Add some sort of locking here?
    +		 * fsetown() can sleep.
    +		 */
     		error = fsetown(*(int *)addr, &d->bd_sigio);
     		break;
     
     	case FIOGETOWN:
    +		BPFD_LOCK(d);
     		*(int *)addr = fgetown(&d->bd_sigio);
    +		BPFD_UNLOCK(d);
     		break;
     
     	/* This is deprecated, FIOSETOWN should be used instead. */
    @@ -1454,16 +1633,23 @@ bpfioctl(struct cdev *dev, u_long cmd, c
     
     			if (sig >= NSIG)
     				error = EINVAL;
    -			else
    +			else {
    +				BPFD_LOCK(d);
     				d->bd_sig = sig;
    +				BPFD_UNLOCK(d);
    +			}
     			break;
     		}
     	case BIOCGRSIG:
    +		BPFD_LOCK(d);
     		*(u_int *)addr = d->bd_sig;
    +		BPFD_UNLOCK(d);
     		break;
     
     	case BIOCGETBUFMODE:
    +		BPFD_LOCK(d);
     		*(u_int *)addr = d->bd_bufmode;
    +		BPFD_UNLOCK(d);
     		break;
     
     	case BIOCSETBUFMODE:
    @@ -1518,19 +1704,31 @@ bpfioctl(struct cdev *dev, u_long cmd, c
     /*
      * Set d's packet filter program to fp.  If this file already has a filter,
      * free it and replace it.  Returns EINVAL for bogus requests.
    + *
    + * Note we need global lock here to serialize bpf_setf() and bpf_setif() calls
    + * since reading d->bd_bif can't be protected by d or interface lock due to
    + * lock order.
    + *
    + * Additionally, we have to acquire interface write lock due to bpf_mtap() uses
    + * interface read lock to read all filers.
    + *
      */
     static int
     bpf_setf(struct bpf_d *d, struct bpf_program *fp, u_long cmd)
     {
    +#ifdef COMPAT_FREEBSD32
    +	struct bpf_program fp_swab;
    +	struct bpf_program32 *fp32;
    +#endif
     	struct bpf_insn *fcode, *old;
    -	u_int wfilter, flen, size;
     #ifdef BPF_JITTER
    -	bpf_jit_filter *ofunc;
    +	bpf_jit_filter *jfunc, *ofunc;
     #endif
    -#ifdef COMPAT_FREEBSD32
    -	struct bpf_program32 *fp32;
    -	struct bpf_program fp_swab;
    +	size_t size;
    +	u_int flen;
    +	int need_upgrade;
     
    +#ifdef COMPAT_FREEBSD32
     	switch (cmd) {
     	case BIOCSETF32:
     	case BIOCSETWF32:
    @@ -1550,73 +1748,86 @@ bpf_setf(struct bpf_d *d, struct bpf_pro
     		break;
     	}
     #endif
    -	if (cmd == BIOCSETWF) {
    -		old = d->bd_wfilter;
    -		wfilter = 1;
    -#ifdef BPF_JITTER
    -		ofunc = NULL;
    -#endif
    -	} else {
    -		wfilter = 0;
    -		old = d->bd_rfilter;
    +
    +	fcode = NULL;
     #ifdef BPF_JITTER
    -		ofunc = d->bd_bfilter;
    +	jfunc = ofunc = NULL;
     #endif
    -	}
    -	if (fp->bf_insns == NULL) {
    -		if (fp->bf_len != 0)
    +	need_upgrade = 0;
    +
    +	/*
    +	 * Check new filter validness before acquiring any locks.
    +	 * Allocate memory for new filter, if needed.
    +	 */
    +	flen = fp->bf_len;
    +	if (flen > bpf_maxinsns || (fp->bf_insns == NULL && flen != 0))
    +		return (EINVAL);
    +	size = flen * sizeof(*fp->bf_insns);
    +	if (size > 0) {
    +		/* We're setting up new filter.  Copy and check actual data. */
    +		fcode = malloc(size, M_BPF, M_WAITOK);
    +		if (copyin(fp->bf_insns, fcode, size) != 0 ||
    +		    !bpf_validate(fcode, flen)) {
    +			free(fcode, M_BPF);
     			return (EINVAL);
    -		BPFD_LOCK(d);
    -		if (wfilter)
    -			d->bd_wfilter = NULL;
    -		else {
    -			d->bd_rfilter = NULL;
    -#ifdef BPF_JITTER
    -			d->bd_bfilter = NULL;
    -#endif
    -			if (cmd == BIOCSETF)
    -				reset_d(d);
     		}
    -		BPFD_UNLOCK(d);
    -		if (old != NULL)
    -			free((caddr_t)old, M_BPF);
     #ifdef BPF_JITTER
    -		if (ofunc != NULL)
    -			bpf_destroy_jit_filter(ofunc);
    +		/* Filter is copied inside fcode and is perfectly valid. */
    +		jfunc = bpf_jitter(fcode, flen);
     #endif
    -		return (0);
     	}
    -	flen = fp->bf_len;
    -	if (flen > bpf_maxinsns)
    -		return (EINVAL);
     
    -	size = flen * sizeof(*fp->bf_insns);
    -	fcode = (struct bpf_insn *)malloc(size, M_BPF, M_WAITOK);
    -	if (copyin((caddr_t)fp->bf_insns, (caddr_t)fcode, size) == 0 &&
    -	    bpf_validate(fcode, (int)flen)) {
    -		BPFD_LOCK(d);
    -		if (wfilter)
    -			d->bd_wfilter = fcode;
    -		else {
    -			d->bd_rfilter = fcode;
    +	BPF_LOCK();
    +
    +	/*
    +	 * Set up new filter.
    +	 * Protect filter change by interface lock.
    +	 * Additionally, we are protected by global lock here.
    +	 */
    +	if (d->bd_bif != NULL)
    +		BPFIF_WLOCK(d->bd_bif);
    +	BPFD_LOCK(d);
    +	if (cmd == BIOCSETWF) {
    +		old = d->bd_wfilter;
    +		d->bd_wfilter = fcode;
    +	} else {
    +		old = d->bd_rfilter;
    +		d->bd_rfilter = fcode;
     #ifdef BPF_JITTER
    -			d->bd_bfilter = bpf_jitter(fcode, flen);
    +		ofunc = d->bd_bfilter;
    +		d->bd_bfilter = jfunc;
     #endif
    -			if (cmd == BIOCSETF)
    -				reset_d(d);
    +		if (cmd == BIOCSETF)
    +			reset_d(d);
    +
    +		if (fcode != NULL) {
    +			/*
    +			 * Do not require upgrade by first BIOCSETF
    +			 * (used to set snaplen) by pcap_open_live().
    +			 */
    +			if (d->bd_writer != 0 && --d->bd_writer == 0)
    +				need_upgrade = 1;
    +			CTR4(KTR_NET, "%s: filter function set by pid %d, "
    +			    "bd_writer counter %d, need_upgrade %d",
    +			    __func__, d->bd_pid, d->bd_writer, need_upgrade);
     		}
    -		BPFD_UNLOCK(d);
    -		if (old != NULL)
    -			free((caddr_t)old, M_BPF);
    +	}
    +	BPFD_UNLOCK(d);
    +	if (d->bd_bif != NULL)
    +		BPFIF_WUNLOCK(d->bd_bif);
    +	if (old != NULL)
    +		free(old, M_BPF);
     #ifdef BPF_JITTER
    -		if (ofunc != NULL)
    -			bpf_destroy_jit_filter(ofunc);
    +	if (ofunc != NULL)
    +		bpf_destroy_jit_filter(ofunc);
     #endif
     
    -		return (0);
    -	}
    -	free((caddr_t)fcode, M_BPF);
    -	return (EINVAL);
    +	/* Move d to active readers list. */
    +	if (need_upgrade)
    +		bpf_upgraded(d);
    +
    +	BPF_UNLOCK();
    +	return (0);
     }
     
     /*
    @@ -1630,28 +1841,30 @@ bpf_setif(struct bpf_d *d, struct ifreq 
     	struct bpf_if *bp;
     	struct ifnet *theywant;
     
    +	BPF_LOCK_ASSERT();
    +
     	theywant = ifunit(ifr->ifr_name);
     	if (theywant == NULL || theywant->if_bpf == NULL)
     		return (ENXIO);
     
     	bp = theywant->if_bpf;
     
    +	/* Check if interface is not being detached from BPF */
    +	BPFIF_RLOCK(bp);
    +	if (bp->flags & BPFIF_FLAG_DYING) {
    +		BPFIF_RUNLOCK(bp);
    +		return (ENXIO);
    +	}
    +	BPFIF_RUNLOCK(bp);
    +
     	/*
     	 * Behavior here depends on the buffering model.  If we're using
     	 * kernel memory buffers, then we can allocate them here.  If we're
     	 * using zero-copy, then the user process must have registered
     	 * buffers by the time we get here.  If not, return an error.
    -	 *
    -	 * XXXRW: There are locking issues here with multi-threaded use: what
    -	 * if two threads try to set the interface at once?
     	 */
     	switch (d->bd_bufmode) {
     	case BPF_BUFMODE_BUFFER:
    -		if (d->bd_sbuf == NULL)
    -			bpf_buffer_alloc(d);
    -		KASSERT(d->bd_sbuf != NULL, ("bpf_setif: bd_sbuf NULL"));
    -		break;
    -
     	case BPF_BUFMODE_ZBUF:
     		if (d->bd_sbuf == NULL)
     			return (EINVAL);
    @@ -1660,15 +1873,8 @@ bpf_setif(struct bpf_d *d, struct ifreq 
     	default:
     		panic("bpf_setif: bufmode %d", d->bd_bufmode);
     	}
    -	if (bp != d->bd_bif) {
    -		if (d->bd_bif)
    -			/*
    -			 * Detach if attached to something else.
    -			 */
    -			bpf_detachd(d);
    -
    +	if (bp != d->bd_bif)
     		bpf_attachd(d, bp);
    -	}
     	BPFD_LOCK(d);
     	reset_d(d);
     	BPFD_UNLOCK(d);
    @@ -1696,7 +1902,7 @@ bpfpoll(struct cdev *dev, int events, st
     	 */
     	revents = events & (POLLOUT | POLLWRNORM);
     	BPFD_LOCK(d);
    -	d->bd_pid = td->td_proc->p_pid;
    +	BPF_PID_REFRESH(d, td);
     	if (events & (POLLIN | POLLRDNORM)) {
     		if (bpf_ready(d))
     			revents |= events & (POLLIN | POLLRDNORM);
    @@ -1731,7 +1937,7 @@ bpfkqfilter(struct cdev *dev, struct kno
     	 * Refresh PID associated with this descriptor.
     	 */
     	BPFD_LOCK(d);
    -	d->bd_pid = curthread->td_proc->p_pid;
    +	BPF_PID_REFRESH_CUR(d);
     	kn->kn_fop = &bpfread_filtops;
     	kn->kn_hook = d;
     	knlist_add(&d->bd_sel.si_note, kn, 1);
    @@ -1829,9 +2035,19 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, 
     	int gottime;
     
     	gottime = BPF_TSTAMP_NONE;
    -	BPFIF_LOCK(bp);
    +
    +	BPFIF_RLOCK(bp);
    +
     	LIST_FOREACH(d, &bp->bif_dlist, bd_next) {
    -		BPFD_LOCK(d);
    +		/*
    +		 * We are not using any locks for d here because:
    +		 * 1) any filter change is protected by interface
    +		 * write lock
    +		 * 2) destroying/detaching d is protected by interface
    +		 * write lock, too
    +		 */
    +
    +		/* XXX: Do not protect counter for the sake of performance. */
     		++d->bd_rcount;
     		/*
     		 * NB: We dont call BPF_CHECK_DIRECTION() here since there is no
    @@ -1847,6 +2063,11 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, 
     #endif
     		slen = bpf_filter(d->bd_rfilter, pkt, pktlen, pktlen);
     		if (slen != 0) {
    +			/*
    +			 * Filter matches. Let's to acquire write lock.
    +			 */
    +			BPFD_LOCK(d);
    +
     			d->bd_fcount++;
     			if (gottime < bpf_ts_quality(d->bd_tstamp))
     				gottime = bpf_gettime(&bt, d->bd_tstamp, NULL);
    @@ -1855,10 +2076,10 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, 
     #endif
     				catchpacket(d, pkt, pktlen, slen,
     				    bpf_append_bytes, &bt);
    +			BPFD_UNLOCK(d);
     		}
    -		BPFD_UNLOCK(d);
     	}
    -	BPFIF_UNLOCK(bp);
    +	BPFIF_RUNLOCK(bp);
     }
     
     #define	BPF_CHECK_DIRECTION(d, r, i)				\
    @@ -1867,6 +2088,7 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, 
     
     /*
      * Incoming linkage from device drivers, when packet is in an mbuf chain.
    + * Locking model is explained in bpf_tap().
      */
     void
     bpf_mtap(struct bpf_if *bp, struct mbuf *m)
    @@ -1886,13 +2108,13 @@ bpf_mtap(struct bpf_if *bp, struct mbuf 
     	}
     
     	pktlen = m_length(m, NULL);
    -
     	gottime = BPF_TSTAMP_NONE;
    -	BPFIF_LOCK(bp);
    +
    +	BPFIF_RLOCK(bp);
    +
     	LIST_FOREACH(d, &bp->bif_dlist, bd_next) {
     		if (BPF_CHECK_DIRECTION(d, m->m_pkthdr.rcvif, bp->bif_ifp))
     			continue;
    -		BPFD_LOCK(d);
     		++d->bd_rcount;
     #ifdef BPF_JITTER
     		bf = bpf_jitter_enable != 0 ? d->bd_bfilter : NULL;
    @@ -1903,6 +2125,8 @@ bpf_mtap(struct bpf_if *bp, struct mbuf 
     #endif
     		slen = bpf_filter(d->bd_rfilter, (u_char *)m, pktlen, 0);
     		if (slen != 0) {
    +			BPFD_LOCK(d);
    +
     			d->bd_fcount++;
     			if (gottime < bpf_ts_quality(d->bd_tstamp))
     				gottime = bpf_gettime(&bt, d->bd_tstamp, m);
    @@ -1911,10 +2135,10 @@ bpf_mtap(struct bpf_if *bp, struct mbuf 
     #endif
     				catchpacket(d, (u_char *)m, pktlen, slen,
     				    bpf_append_mbuf, &bt);
    +			BPFD_UNLOCK(d);
     		}
    -		BPFD_UNLOCK(d);
     	}
    -	BPFIF_UNLOCK(bp);
    +	BPFIF_RUNLOCK(bp);
     }
     
     /*
    @@ -1948,14 +2172,17 @@ bpf_mtap2(struct bpf_if *bp, void *data,
     	pktlen += dlen;
     
     	gottime = BPF_TSTAMP_NONE;
    -	BPFIF_LOCK(bp);
    +
    +	BPFIF_RLOCK(bp);
    +
     	LIST_FOREACH(d, &bp->bif_dlist, bd_next) {
     		if (BPF_CHECK_DIRECTION(d, m->m_pkthdr.rcvif, bp->bif_ifp))
     			continue;
    -		BPFD_LOCK(d);
     		++d->bd_rcount;
     		slen = bpf_filter(d->bd_rfilter, (u_char *)&mb, pktlen, 0);
     		if (slen != 0) {
    +			BPFD_LOCK(d);
    +
     			d->bd_fcount++;
     			if (gottime < bpf_ts_quality(d->bd_tstamp))
     				gottime = bpf_gettime(&bt, d->bd_tstamp, m);
    @@ -1964,10 +2191,10 @@ bpf_mtap2(struct bpf_if *bp, void *data,
     #endif
     				catchpacket(d, (u_char *)&mb, pktlen, slen,
     				    bpf_append_mbuf, &bt);
    +			BPFD_UNLOCK(d);
     		}
    -		BPFD_UNLOCK(d);
     	}
    -	BPFIF_UNLOCK(bp);
    +	BPFIF_RUNLOCK(bp);
     }
     
     #undef	BPF_CHECK_DIRECTION
    @@ -2206,7 +2433,7 @@ bpf_freed(struct bpf_d *d)
     	}
     	if (d->bd_wfilter != NULL)
     		free((caddr_t)d->bd_wfilter, M_BPF);
    -	mtx_destroy(&d->bd_mtx);
    +	mtx_destroy(&d->bd_lock);
     }
     
     /*
    @@ -2236,15 +2463,16 @@ bpfattach2(struct ifnet *ifp, u_int dlt,
     		panic("bpfattach");
     
     	LIST_INIT(&bp->bif_dlist);
    +	LIST_INIT(&bp->bif_wlist);
     	bp->bif_ifp = ifp;
     	bp->bif_dlt = dlt;
    -	mtx_init(&bp->bif_mtx, "bpf interface lock", NULL, MTX_DEF);
    +	rw_init(&bp->bif_lock, "bpf interface lock");
     	KASSERT(*driverp == NULL, ("bpfattach2: driverp already initialized"));
     	*driverp = bp;
     
    -	mtx_lock(&bpf_mtx);
    +	BPF_LOCK();
     	LIST_INSERT_HEAD(&bpf_iflist, bp, bif_next);
    -	mtx_unlock(&bpf_mtx);
    +	BPF_UNLOCK();
     
     	bp->bif_hdrlen = hdrlen;
     
    @@ -2253,10 +2481,9 @@ bpfattach2(struct ifnet *ifp, u_int dlt,
     }
     
     /*
    - * Detach bpf from an interface.  This involves detaching each descriptor
    - * associated with the interface, and leaving bd_bif NULL.  Notify each
    - * descriptor as it's detached so that any sleepers wake up and get
    - * ENXIO.
    + * Detach bpf from an interface. This involves detaching each descriptor
    + * associated with the interface. Notify each descriptor as it's detached
    + * so that any sleepers wake up and get ENXIO.
      */
     void
     bpfdetach(struct ifnet *ifp)
    @@ -2269,31 +2496,45 @@ bpfdetach(struct ifnet *ifp)
     	ndetached = 0;
     #endif
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 15:33:54 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id CD3DF244;
     Sat,  2 Mar 2013 15:33:54 +0000 (UTC)
     (envelope-from attilio@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 A67141C3;
     Sat,  2 Mar 2013 15:33:54 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22FXst6038238;
     Sat, 2 Mar 2013 15:33:54 GMT (envelope-from attilio@svn.freebsd.org)
    Received: (from attilio@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22FXsqR038237;
     Sat, 2 Mar 2013 15:33:54 GMT (envelope-from attilio@svn.freebsd.org)
    Message-Id: <201303021533.r22FXsqR038237@svn.freebsd.org>
    From: Attilio Rao 
    Date: Sat, 2 Mar 2013 15:33:54 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247631 - in head: . share/man/man5 sys/gnu/fs/xfs
     sys/modules/xfs
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 15:33:54 -0000
    
    Author: attilio
    Date: Sat Mar  2 15:33:54 2013
    New Revision: 247631
    URL: http://svnweb.freebsd.org/changeset/base/247631
    
    Log:
      Garbage collect XFS bits which are now already completely disconnected
      from the tree since few months.
      
      This is not targeted for MFC.
    
    Deleted:
      head/share/man/man5/xfs.5
      head/sys/gnu/fs/xfs/
      head/sys/modules/xfs/
    Modified:
      head/ObsoleteFiles.inc
    
    Modified: head/ObsoleteFiles.inc
    ==============================================================================
    --- head/ObsoleteFiles.inc	Sat Mar  2 15:33:06 2013	(r247630)
    +++ head/ObsoleteFiles.inc	Sat Mar  2 15:33:54 2013	(r247631)
    @@ -38,6 +38,8 @@
     #   xargs -n1 | sort | uniq -d;
     # done
     
    +# 20130302: XFS support removed
    +OLD_FILES+=usr/share/man/man5/xfs.5.gz
     # 20130116: removed long unused directories for .1aout section manpages
     OLD_FILES+=usr/share/man/en.ISO8859-1/man1aout
     OLD_FILES+=usr/share/man/en.UTF-8/man1aout
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 15:54:03 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 54803955;
     Sat,  2 Mar 2013 15:54: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 01F5329C;
     Sat,  2 Mar 2013 15:54:03 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22Fs2Zv044157;
     Sat, 2 Mar 2013 15:54:02 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22Fs2Lj044156;
     Sat, 2 Mar 2013 15:54:02 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021554.r22Fs2Lj044156@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 15:54:02 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247632 - head/sys/dev/pci
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 15:54:03 -0000
    
    Author: marius
    Date: Sat Mar  2 15:54:02 2013
    New Revision: 247632
    URL: http://svnweb.freebsd.org/changeset/base/247632
    
    Log:
      - Complete r231621 by also blacklisting the bridge used by VMware for PCIe
        devices. While at it, update the comment now that we know that MSI-X
        doesn't work with ESXi 5.1 for Intel 82576 either and the underlying issue
        is a bug in the MSI-X allocation code of the hypervisor.
        Reported by: Harald Schmalzbauer
      - Make the nomatch table const.
      
      MFC after:	1 week
    
    Modified:
      head/sys/dev/pci/pci.c
    
    Modified: head/sys/dev/pci/pci.c
    ==============================================================================
    --- head/sys/dev/pci/pci.c	Sat Mar  2 15:33:54 2013	(r247631)
    +++ head/sys/dev/pci/pci.c	Sat Mar  2 15:54:02 2013	(r247632)
    @@ -234,10 +234,11 @@ static const struct pci_quirk pci_quirks
     	{ 0x74501022, PCI_QUIRK_DISABLE_MSI,	0,	0 },
     
     	/*
    -	 * MSI-X doesn't work with at least LSI SAS1068E passed through by
    -	 * VMware.
    +	 * MSI-X allocation doesn't work properly for devices passed through
    +	 * by VMware up to at least ESXi 5.1.
     	 */
    -	{ 0x079015ad, PCI_QUIRK_DISABLE_MSI,	0,	0 },
    +	{ 0x079015ad, PCI_QUIRK_DISABLE_MSI,	0,	0 }, /* PCI/PCI-X */
    +	{ 0x07a015ad, PCI_QUIRK_DISABLE_MSI,	0,	0 }, /* PCIe */
     
     	/*
     	 * Some virtualization environments emulate an older chipset
    @@ -3643,11 +3644,11 @@ pci_print_child(device_t dev, device_t c
     	return (retval);
     }
     
    -static struct
    +static const struct
     {
    -	int	class;
    -	int	subclass;
    -	char	*desc;
    +	int		class;
    +	int		subclass;
    +	const char	*desc;
     } pci_nomatch_tab[] = {
     	{PCIC_OLD,		-1,			"old"},
     	{PCIC_OLD,		PCIS_OLD_NONVGA,	"non-VGA display device"},
    @@ -3739,8 +3740,9 @@ static struct
     void
     pci_probe_nomatch(device_t dev, device_t child)
     {
    -	int	i;
    -	char	*cp, *scp, *device;
    +	int i;
    +	const char *cp, *scp;
    +	char *device;
     
     	/*
     	 * Look for a listing for this device in a loaded device database.
    @@ -3773,7 +3775,6 @@ pci_probe_nomatch(device_t dev, device_t
     	printf(" at device %d.%d (no driver attached)\n",
     	    pci_get_slot(child), pci_get_function(child));
     	pci_cfg_save(child, device_get_ivars(child), 1);
    -	return;
     }
     
     /*
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 16:18:41 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 06263619;
     Sat,  2 Mar 2013 16:18:41 +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 E1959607;
     Sat,  2 Mar 2013 16:18:40 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22GIet5051489;
     Sat, 2 Mar 2013 16:18:40 GMT (envelope-from dteske@svn.freebsd.org)
    Received: (from dteske@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22GIeYv051488;
     Sat, 2 Mar 2013 16:18:40 GMT (envelope-from dteske@svn.freebsd.org)
    Message-Id: <201303021618.r22GIeYv051488@svn.freebsd.org>
    From: Devin Teske 
    Date: Sat, 2 Mar 2013 16:18: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: r247634 - 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-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 16:18:41 -0000
    
    Author: dteske
    Date: Sat Mar  2 16:18:40 2013
    New Revision: 247634
    URL: http://svnweb.freebsd.org/changeset/base/247634
    
    Log:
      Update FTP directories to include new layout. Previously discussed with
      kensmith and others as this alleviates the need for the symbolic link upkeep
      which is currently manually maintained.
    
    Modified:
      stable/9/usr.sbin/sysinstall/ftp.c
    
    Modified: stable/9/usr.sbin/sysinstall/ftp.c
    ==============================================================================
    --- stable/9/usr.sbin/sysinstall/ftp.c	Sat Mar  2 16:07:55 2013	(r247633)
    +++ stable/9/usr.sbin/sysinstall/ftp.c	Sat Mar  2 16:18:40 2013	(r247634)
    @@ -50,8 +50,12 @@ int FtpPort;
     
     /* List of sub directories to look for under a given FTP server. */
     const char *ftp_dirs[] = { ".", "releases/"MACHINE, "snapshots/"MACHINE,
    +    "releases/"MACHINE"/"MACHINE_ARCH, "snapshots/"MACHINE"/"MACHINE_ARCH,
         "pub/FreeBSD", "pub/FreeBSD/releases/"MACHINE,
    -    "pub/FreeBSD/snapshots/"MACHINE, NULL };
    +    "pub/FreeBSD/snapshots/"MACHINE,
    +    "pub/FreeBSD/releases/"MACHINE"/"MACHINE_ARCH,
    +    "pub/FreeBSD/snapshots/"MACHINE"/"MACHINE_ARCH,
    +    NULL };
     
     /* Brings up attached network device, if any - takes FTP device as arg */
     static Boolean
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 16:30:19 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 79157C85;
     Sat,  2 Mar 2013 16:30:19 +0000 (UTC)
     (envelope-from attilio@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 6A17769B;
     Sat,  2 Mar 2013 16:30:19 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22GUJH0054936;
     Sat, 2 Mar 2013 16:30:19 GMT (envelope-from attilio@svn.freebsd.org)
    Received: (from attilio@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22GUJCv054935;
     Sat, 2 Mar 2013 16:30:19 GMT (envelope-from attilio@svn.freebsd.org)
    Message-Id: <201303021630.r22GUJCv054935@svn.freebsd.org>
    From: Attilio Rao 
    Date: Sat, 2 Mar 2013 16:30:19 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247635 - in head: . share/man/man4 sys/fs/coda
     sys/modules/coda sys/modules/coda5
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 16:30:19 -0000
    
    Author: attilio
    Date: Sat Mar  2 16:30:18 2013
    New Revision: 247635
    URL: http://svnweb.freebsd.org/changeset/base/247635
    
    Log:
      Garbage collect CODAFS bits which are now completely disconnected from
      the tree since few months.
      
      This patch is not targeted for MFC.
    
    Deleted:
      head/share/man/man4/coda.4
      head/sys/fs/coda/
      head/sys/modules/coda/
      head/sys/modules/coda5/
    Modified:
      head/ObsoleteFiles.inc
    
    Modified: head/ObsoleteFiles.inc
    ==============================================================================
    --- head/ObsoleteFiles.inc	Sat Mar  2 16:18:40 2013	(r247634)
    +++ head/ObsoleteFiles.inc	Sat Mar  2 16:30:18 2013	(r247635)
    @@ -38,6 +38,8 @@
     #   xargs -n1 | sort | uniq -d;
     # done
     
    +# 20130302: CODAFS support removed
    +OLD_FILES+=usr/share/man/man4/coda.4.gz
     # 20130302: XFS support removed
     OLD_FILES+=usr/share/man/man5/xfs.5.gz
     # 20130116: removed long unused directories for .1aout section manpages
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 16:33:40 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id A7371E23;
     Sat,  2 Mar 2013 16:33:40 +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 813EF6B3;
     Sat,  2 Mar 2013 16:33:40 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22GXemp057027;
     Sat, 2 Mar 2013 16:33:40 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22GXeDk057025;
     Sat, 2 Mar 2013 16:33:40 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021633.r22GXeDk057025@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 16:33:40 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247636 - stable/8/libexec/tftpd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 16:33:40 -0000
    
    Author: marius
    Date: Sat Mar  2 16:33:39 2013
    New Revision: 247636
    URL: http://svnweb.freebsd.org/changeset/base/247636
    
    Log:
      MFC: r235643
      
      Properly use LDADD & DPADD to link against libwrap.
    
    Modified:
      stable/8/libexec/tftpd/Makefile
    Directory Properties:
      stable/8/libexec/tftpd/   (props changed)
    
    Modified: stable/8/libexec/tftpd/Makefile
    ==============================================================================
    --- stable/8/libexec/tftpd/Makefile	Sat Mar  2 16:30:18 2013	(r247635)
    +++ stable/8/libexec/tftpd/Makefile	Sat Mar  2 16:33:39 2013	(r247636)
    @@ -7,6 +7,8 @@ SRCS=	tftp-file.c tftp-io.c tftp-options
     SRCS+=	tftpd.c
     WARNS=	6
     WFORMAT=0
    -LDFLAGS= -lwrap
    +
    +DPADD=	${LIBWRAP}
    +LDADD=	-lwrap
     
     .include 
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 16:33:44 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 3C318E25;
     Sat,  2 Mar 2013 16:33:44 +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 2C6766B5;
     Sat,  2 Mar 2013 16:33:44 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22GXiKL057066;
     Sat, 2 Mar 2013 16:33:44 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22GXivR057065;
     Sat, 2 Mar 2013 16:33:44 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021633.r22GXivR057065@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 16:33: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: r247637 - stable/9/libexec/tftpd
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 16:33:44 -0000
    
    Author: marius
    Date: Sat Mar  2 16:33:43 2013
    New Revision: 247637
    URL: http://svnweb.freebsd.org/changeset/base/247637
    
    Log:
      MFC: r235643
      
      Properly use LDADD & DPADD to link against libwrap.
    
    Modified:
      stable/9/libexec/tftpd/Makefile
    Directory Properties:
      stable/9/libexec/tftpd/   (props changed)
    
    Modified: stable/9/libexec/tftpd/Makefile
    ==============================================================================
    --- stable/9/libexec/tftpd/Makefile	Sat Mar  2 16:33:39 2013	(r247636)
    +++ stable/9/libexec/tftpd/Makefile	Sat Mar  2 16:33:43 2013	(r247637)
    @@ -6,6 +6,8 @@ MAN=	tftpd.8
     SRCS=	tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c tftp-utils.c
     SRCS+=	tftpd.c
     WFORMAT=0
    -LDFLAGS= -lwrap
    +
    +DPADD=	${LIBWRAP}
    +LDADD=	-lwrap
     
     .include 
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 16:38:59 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id A7FA5452;
     Sat,  2 Mar 2013 16:38:59 +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 8005E6EA;
     Sat,  2 Mar 2013 16:38:59 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22Gcxba058042;
     Sat, 2 Mar 2013 16:38:59 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22GcxVI058039;
     Sat, 2 Mar 2013 16:38:59 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021638.r22GcxVI058039@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 16:38: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: r247638 - stable/9/libexec/tftpd
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 16:38:59 -0000
    
    Author: marius
    Date: Sat Mar  2 16:38:58 2013
    New Revision: 247638
    URL: http://svnweb.freebsd.org/changeset/base/247638
    
    Log:
      MFC: r241720 (partial)
      
      Fix warnings found by -Wmising-variable-declarations.
    
    Modified:
      stable/9/libexec/tftpd/tftp-io.c
      stable/9/libexec/tftpd/tftp-utils.c
      stable/9/libexec/tftpd/tftpd.c
    Directory Properties:
      stable/9/libexec/tftpd/   (props changed)
    
    Modified: stable/9/libexec/tftpd/tftp-io.c
    ==============================================================================
    --- stable/9/libexec/tftpd/tftp-io.c	Sat Mar  2 16:33:43 2013	(r247637)
    +++ stable/9/libexec/tftpd/tftp-io.c	Sat Mar  2 16:38:58 2013	(r247638)
    @@ -53,7 +53,7 @@ struct sockaddr_storage me_sock;
     
     static int send_packet(int peer, uint16_t block, char *pkt, int size);
     
    -struct errmsg {
    +static struct errmsg {
     	int	e_code;
     	const char	*e_msg;
     } errmsgs[] = {
    @@ -374,7 +374,7 @@ send_data(int peer, uint16_t block, char
     /*
      * Receive a packet
      */
    -jmp_buf	timeoutbuf;
    +static jmp_buf timeoutbuf;
     
     static void
     timeout(int sig __unused)
    
    Modified: stable/9/libexec/tftpd/tftp-utils.c
    ==============================================================================
    --- stable/9/libexec/tftpd/tftp-utils.c	Sat Mar  2 16:33:43 2013	(r247637)
    +++ stable/9/libexec/tftpd/tftp-utils.c	Sat Mar  2 16:38:58 2013	(r247638)
    @@ -121,7 +121,7 @@ get_field(int peer, char *buffer, ssize_
     /*
      * Logging functions
      */
    -int	_tftp_logtostdout = 1;
    +static int _tftp_logtostdout = 1;
     
     void
     tftp_openlog(const char *ident, int logopt, int facility)
    
    Modified: stable/9/libexec/tftpd/tftpd.c
    ==============================================================================
    --- stable/9/libexec/tftpd/tftpd.c	Sat Mar  2 16:33:43 2013	(r247637)
    +++ stable/9/libexec/tftpd/tftpd.c	Sat Mar  2 16:38:58 2013	(r247638)
    @@ -107,9 +107,9 @@ static void	tftp_xmitfile(int peer, cons
     static int	validate_access(int peer, char **, int);
     static char	peername[NI_MAXHOST];
     
    -FILE *file;
    +static FILE *file;
     
    -struct formats {
    +static struct formats {
     	const char	*f_mode;
     	int	f_convert;
     } formats[] = {
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 16:39:01 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 64FE6453;
     Sat,  2 Mar 2013 16:39:01 +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 3A28B6EB;
     Sat,  2 Mar 2013 16:39:01 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22Gd12H058086;
     Sat, 2 Mar 2013 16:39:01 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22Gd0Ko058081;
     Sat, 2 Mar 2013 16:39:00 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021639.r22Gd0Ko058081@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 16:39:00 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247639 - stable/8/libexec/tftpd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 16:39:01 -0000
    
    Author: marius
    Date: Sat Mar  2 16:39:00 2013
    New Revision: 247639
    URL: http://svnweb.freebsd.org/changeset/base/247639
    
    Log:
      MFC: r241720 (partial)
      
      Fix warnings found by -Wmising-variable-declarations.
    
    Modified:
      stable/8/libexec/tftpd/tftp-io.c
      stable/8/libexec/tftpd/tftp-utils.c
      stable/8/libexec/tftpd/tftpd.c
    Directory Properties:
      stable/8/libexec/tftpd/   (props changed)
    
    Modified: stable/8/libexec/tftpd/tftp-io.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 16:38:58 2013	(r247638)
    +++ stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 16:39:00 2013	(r247639)
    @@ -53,7 +53,7 @@ struct sockaddr_storage me_sock;
     
     static int send_packet(int peer, uint16_t block, char *pkt, int size);
     
    -struct errmsg {
    +static struct errmsg {
     	int	e_code;
     	const char	*e_msg;
     } errmsgs[] = {
    @@ -375,7 +375,7 @@ send_data(int peer, uint16_t block, char
     /*
      * Receive a packet
      */
    -jmp_buf	timeoutbuf;
    +static jmp_buf timeoutbuf;
     
     static void
     timeout(int sig __unused)
    
    Modified: stable/8/libexec/tftpd/tftp-utils.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftp-utils.c	Sat Mar  2 16:38:58 2013	(r247638)
    +++ stable/8/libexec/tftpd/tftp-utils.c	Sat Mar  2 16:39:00 2013	(r247639)
    @@ -121,7 +121,7 @@ get_field(int peer, char *buffer, ssize_
     /*
      * Logging functions
      */
    -int	_tftp_logtostdout = 1;
    +static int _tftp_logtostdout = 1;
     
     void
     tftp_openlog(const char *ident, int logopt, int facility)
    
    Modified: stable/8/libexec/tftpd/tftpd.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftpd.c	Sat Mar  2 16:38:58 2013	(r247638)
    +++ stable/8/libexec/tftpd/tftpd.c	Sat Mar  2 16:39:00 2013	(r247639)
    @@ -107,9 +107,9 @@ static void	tftp_xmitfile(int peer, cons
     static int	validate_access(int peer, char **, int);
     static char	peername[NI_MAXHOST];
     
    -FILE *file;
    +static FILE *file;
     
    -struct formats {
    +static struct formats {
     	const char	*f_mode;
     	int	f_convert;
     } formats[] = {
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 16:43:28 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id EF78C92C;
     Sat,  2 Mar 2013 16:43:28 +0000 (UTC)
     (envelope-from attilio@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 E158F725;
     Sat,  2 Mar 2013 16:43:28 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22GhSir060395;
     Sat, 2 Mar 2013 16:43:28 GMT (envelope-from attilio@svn.freebsd.org)
    Received: (from attilio@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22GhStG060394;
     Sat, 2 Mar 2013 16:43:28 GMT (envelope-from attilio@svn.freebsd.org)
    Message-Id: <201303021643.r22GhStG060394@svn.freebsd.org>
    From: Attilio Rao 
    Date: Sat, 2 Mar 2013 16:43:28 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247640 - in head: . share/examples/portal
     sys/fs/portalfs sys/modules/portalfs usr.sbin/mount_portalfs
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 16:43:29 -0000
    
    Author: attilio
    Date: Sat Mar  2 16:43:28 2013
    New Revision: 247640
    URL: http://svnweb.freebsd.org/changeset/base/247640
    
    Log:
      Garbage collect PORTALFS bits which are now completely disconnected from
      the tree since few months.
      
      This patch is not targeted for MFC.
    
    Deleted:
      head/share/examples/portal/
      head/sys/fs/portalfs/
      head/sys/modules/portalfs/
      head/usr.sbin/mount_portalfs/
    Modified:
      head/ObsoleteFiles.inc
    
    Modified: head/ObsoleteFiles.inc
    ==============================================================================
    --- head/ObsoleteFiles.inc	Sat Mar  2 16:39:00 2013	(r247639)
    +++ head/ObsoleteFiles.inc	Sat Mar  2 16:43:28 2013	(r247640)
    @@ -38,6 +38,13 @@
     #   xargs -n1 | sort | uniq -d;
     # done
     
    +# 20130302: PORTALFS support removed
    +OLD_FILES+=usr/include/fs/portalfs/portal.h
    +OLD_DIRS+=usr/include/fs/portalfs
    +OLD_FILES+=usr/share/examples/portal/README
    +OLD_FILES+=usr/share/examples/portal/portal.conf
    +OLD_DIRS+=usr/share/examples/portal
    +OLD_FILES+=usr/share/man/man8/mount_portalfs.8.gz
     # 20130302: CODAFS support removed
     OLD_FILES+=usr/share/man/man4/coda.4.gz
     # 20130302: XFS support removed
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 16:45:59 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id DDC79B98;
     Sat,  2 Mar 2013 16:45:59 +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 9FFE4742;
     Sat,  2 Mar 2013 16:45:59 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22GjwVH060975;
     Sat, 2 Mar 2013 16:45:59 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22GjwnY060964;
     Sat, 2 Mar 2013 16:45:58 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021645.r22GjwnY060964@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 16:45: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: r247641 - stable/9/libexec/tftpd
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 16:46:00 -0000
    
    Author: marius
    Date: Sat Mar  2 16:45:58 2013
    New Revision: 247641
    URL: http://svnweb.freebsd.org/changeset/base/247641
    
    Log:
      MFC: r229780 (partial)
      
      Spelling fixes for libexec/
    
    Modified:
      stable/9/libexec/tftpd/tftp-io.c
      stable/9/libexec/tftpd/tftp-utils.h
    Directory Properties:
      stable/9/libexec/tftpd/   (props changed)
    
    Modified: stable/9/libexec/tftpd/tftp-io.c
    ==============================================================================
    --- stable/9/libexec/tftpd/tftp-io.c	Sat Mar  2 16:43:28 2013	(r247640)
    +++ stable/9/libexec/tftpd/tftp-io.c	Sat Mar  2 16:45:58 2013	(r247641)
    @@ -72,13 +72,13 @@ static struct errmsg {
     #define DROPPACKET(s)							\
     	if (packetdroppercentage != 0 &&				\
     	    random()%100 < packetdroppercentage) {			\
    -		tftp_log(LOG_DEBUG, "Artifical packet drop in %s", s);	\
    +		tftp_log(LOG_DEBUG, "Artificial packet drop in %s", s);	\
     		return;							\
     	}
     #define DROPPACKETn(s,n)						\
     	if (packetdroppercentage != 0 &&				\
     	    random()%100 < packetdroppercentage) {			\
    -		tftp_log(LOG_DEBUG, "Artifical packet drop in %s", s);	\
    +		tftp_log(LOG_DEBUG, "Artificial packet drop in %s", s);	\
     		return (n);						\
     	}
     
    
    Modified: stable/9/libexec/tftpd/tftp-utils.h
    ==============================================================================
    --- stable/9/libexec/tftpd/tftp-utils.h	Sat Mar  2 16:43:28 2013	(r247640)
    +++ stable/9/libexec/tftpd/tftp-utils.h	Sat Mar  2 16:45:58 2013	(r247641)
    @@ -36,11 +36,11 @@ __FBSDID("$FreeBSD$");
     #define	MAXPKTSIZE	(MAXSEGSIZE + 4) /* Maximum size of the packet */
     
     /* For the blksize option */
    -#define BLKSIZE_MIN	8		/* Minumum size of the data segment */
    +#define BLKSIZE_MIN	8		/* Minimum size of the data segment */
     #define BLKSIZE_MAX	MAXSEGSIZE	/* Maximum size of the data segment */
     
     /* For the timeout option */
    -#define TIMEOUT_MIN	0		/* Minumum timeout value */
    +#define TIMEOUT_MIN	0		/* Minimum timeout value */
     #define TIMEOUT_MAX	255		/* Maximum timeout value */
     #define MIN_TIMEOUTS	3
     
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 17:14:53 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 2570CC7D;
     Sat,  2 Mar 2013 17:14: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 F1FFA86C;
     Sat,  2 Mar 2013 17:14:52 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HEqOO070863;
     Sat, 2 Mar 2013 17:14:52 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HEqAJ070855;
     Sat, 2 Mar 2013 17:14:52 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021714.r22HEqAJ070855@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:14:52 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
    Subject: svn commit: r247644 - stable/9/libexec/tftpd
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:14:53 -0000
    
    Author: marius
    Date: Sat Mar  2 17:14:51 2013
    New Revision: 247644
    URL: http://svnweb.freebsd.org/changeset/base/247644
    
    Log:
      MFC: r246106, r246139
      
      Mark tftp_log() as __printflike() and deal with the fallout.
    
    Modified:
      stable/9/libexec/tftpd/tftp-io.c
      stable/9/libexec/tftpd/tftp-options.c
      stable/9/libexec/tftpd/tftp-utils.h
      stable/9/libexec/tftpd/tftpd.c
    Directory Properties:
      stable/9/libexec/tftpd/   (props changed)
    
    Modified: stable/9/libexec/tftpd/tftp-io.c
    ==============================================================================
    --- stable/9/libexec/tftpd/tftp-io.c	Sat Mar  2 17:08:14 2013	(r247643)
    +++ stable/9/libexec/tftpd/tftp-io.c	Sat Mar  2 17:14:51 2013	(r247644)
    @@ -106,13 +106,13 @@ send_packet(int peer, uint16_t block, ch
     	for (i = 0; i < 12 ; i++) {
     		DROPPACKETn("send_packet", 0);
     
    -		if (sendto(peer, pkt, size, 0,
    -			(struct sockaddr *)&peer_sock, peer_sock.ss_len)
    -			== size) {
    +		if (sendto(peer, pkt, size, 0, (struct sockaddr *)&peer_sock,
    +		    peer_sock.ss_len) == size) {
     			if (i)
     				tftp_log(LOG_ERR,
     				    "%s block %d, attempt %d successful",
    -				    block, i);
    +		    		    packettype(ntohs(((struct tftphdr *)
    +				    (pkt))->th_opcode)), block, i);
     			return (0);
     		}
     		tftp_log(LOG_ERR,
    @@ -142,7 +142,7 @@ send_error(int peer, int error)
     	char buf[MAXPKTSIZE];
     
     	if (debug&DEBUG_PACKETS)
    -		tftp_log(LOG_DEBUG, "Sending ERROR %d: %s", error);
    +		tftp_log(LOG_DEBUG, "Sending ERROR %d", error);
     
     	DROPPACKET("send_error");
     
    
    Modified: stable/9/libexec/tftpd/tftp-options.c
    ==============================================================================
    --- stable/9/libexec/tftpd/tftp-options.c	Sat Mar  2 17:08:14 2013	(r247643)
    +++ stable/9/libexec/tftpd/tftp-options.c	Sat Mar  2 17:14:51 2013	(r247644)
    @@ -99,16 +99,17 @@ option_tsize(int peer __unused, struct t
     int
     option_timeout(int peer)
     {
    +	int to;
     
     	if (options[OPT_TIMEOUT].o_request == NULL)
     		return (0);
     
    -	int to = atoi(options[OPT_TIMEOUT].o_request);
    +	to = atoi(options[OPT_TIMEOUT].o_request);
     	if (to < TIMEOUT_MIN || to > TIMEOUT_MAX) {
     		tftp_log(acting_as_client ? LOG_ERR : LOG_WARNING,
     		    "Received bad value for timeout. "
    -		    "Should be between %d and %d, received %s",
    -		    TIMEOUT_MIN, TIMEOUT_MAX);
    +		    "Should be between %d and %d, received %d",
    +		    TIMEOUT_MIN, TIMEOUT_MAX, to);
     		send_error(peer, EBADOP);
     		if (acting_as_client)
     			return (1);
    @@ -195,14 +196,14 @@ option_blksize(int peer)
     			tftp_log(LOG_ERR,
     			    "Invalid blocksize (%d bytes), "
     			    "net.inet.udp.maxdgram sysctl limits it to "
    -			    "%d bytes.\n", size, maxdgram);
    +			    "%ld bytes.\n", size, maxdgram);
     			send_error(peer, EBADOP);
     			return (1);
     		} else {
     			tftp_log(LOG_WARNING,
     			    "Invalid blocksize (%d bytes), "
     			    "net.inet.udp.maxdgram sysctl limits it to "
    -			    "%d bytes.\n", size, maxdgram);
    +			    "%ld bytes.\n", size, maxdgram);
     			size = maxdgram;
     			/* No reason to return */
     		}
    @@ -257,7 +258,7 @@ option_blksize2(int peer __unused)
     		}
     		tftp_log(LOG_INFO,
     		    "Invalid blocksize2 (%d bytes), net.inet.udp.maxdgram "
    -		    "sysctl limits it to %d bytes.\n", size, maxdgram);
    +		    "sysctl limits it to %ld bytes.\n", size, maxdgram);
     		size = sizes[i];
     		/* No need to return */
     	}
    
    Modified: stable/9/libexec/tftpd/tftp-utils.h
    ==============================================================================
    --- stable/9/libexec/tftpd/tftp-utils.h	Sat Mar  2 17:08:14 2013	(r247643)
    +++ stable/9/libexec/tftpd/tftp-utils.h	Sat Mar  2 17:14:51 2013	(r247644)
    @@ -106,7 +106,7 @@ const char *debug_show(int d);
     extern int tftp_logtostdout;
     void	tftp_openlog(const char *ident, int logopt, int facility);
     void	tftp_closelog(void);
    -void	tftp_log(int priority, const char *message, ...);
    +void	tftp_log(int priority, const char *message, ...) __printflike(2, 3);
     
     /*
      * Performance figures
    
    Modified: stable/9/libexec/tftpd/tftpd.c
    ==============================================================================
    --- stable/9/libexec/tftpd/tftpd.c	Sat Mar  2 17:08:14 2013	(r247643)
    +++ stable/9/libexec/tftpd/tftpd.c	Sat Mar  2 17:14:51 2013	(r247644)
    @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    +#include 
     #include 
     #include 
     #include 
    @@ -799,8 +800,8 @@ tftp_xmitfile(int peer, const char *mode
     	tftp_send(peer, &block, &ts);
     	read_close();
     	if (debug&DEBUG_SIMPLE)
    -		tftp_log(LOG_INFO, "Sent %d bytes in %d seconds",
    -		    ts.amount, time(NULL) - now);
    +		tftp_log(LOG_INFO, "Sent %jd bytes in %jd seconds",
    +		    (intmax_t)ts.amount, (intmax_t)time(NULL) - now);
     }
     
     static void
    @@ -832,8 +833,8 @@ tftp_recvfile(int peer, const char *mode
     		f = now2.tv_sec - now1.tv_sec +
     		    (now2.tv_usec - now1.tv_usec) / 100000.0;
     		tftp_log(LOG_INFO,
    -		    "Download of %d bytes in %d blocks completed after %0.1f seconds\n",
    -		    ts.amount, block, f);
    +		    "Download of %jd bytes in %d blocks completed after %0.1f seconds\n",
    +		    (intmax_t)ts.amount, block, f);
     	}
     
     	return;
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 17:14:55 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 3DB64C7E;
     Sat,  2 Mar 2013 17:14:55 +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 16A3B86D;
     Sat,  2 Mar 2013 17:14:55 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HEs7p070910;
     Sat, 2 Mar 2013 17:14:54 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HEsZf070906;
     Sat, 2 Mar 2013 17:14:54 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021714.r22HEsZf070906@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:14:54 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247645 - stable/8/libexec/tftpd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:14:55 -0000
    
    Author: marius
    Date: Sat Mar  2 17:14:53 2013
    New Revision: 247645
    URL: http://svnweb.freebsd.org/changeset/base/247645
    
    Log:
      MFC: r246106, r246139
      
      Mark tftp_log() as __printflike() and deal with the fallout.
    
    Modified:
      stable/8/libexec/tftpd/tftp-io.c
      stable/8/libexec/tftpd/tftp-options.c
      stable/8/libexec/tftpd/tftp-utils.h
      stable/8/libexec/tftpd/tftpd.c
    Directory Properties:
      stable/8/libexec/tftpd/   (props changed)
    
    Modified: stable/8/libexec/tftpd/tftp-io.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 17:14:51 2013	(r247644)
    +++ stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 17:14:53 2013	(r247645)
    @@ -107,13 +107,13 @@ send_packet(int peer, uint16_t block, ch
     	for (i = 0; i < 12 ; i++) {
     		DROPPACKETn("send_packet", 0);
     
    -		if (sendto(peer, pkt, size, 0,
    -			(struct sockaddr *)&peer_sock, peer_sock.ss_len)
    -			== size) {
    +		if (sendto(peer, pkt, size, 0, (struct sockaddr *)&peer_sock,
    +		    peer_sock.ss_len) == size) {
     			if (i)
     				tftp_log(LOG_ERR,
     				    "%s block %d, attempt %d successful",
    -				    block, i);
    +		    		    packettype(ntohs(((struct tftphdr *)
    +				    (pkt))->th_opcode)), block, i);
     			return (0);
     		}
     		tftp_log(LOG_ERR,
    @@ -143,7 +143,7 @@ send_error(int peer, int error)
     	char buf[MAXPKTSIZE];
     
     	if (debug&DEBUG_PACKETS)
    -		tftp_log(LOG_DEBUG, "Sending ERROR %d: %s", error);
    +		tftp_log(LOG_DEBUG, "Sending ERROR %d", error);
     
     	DROPPACKET("send_error");
     
    
    Modified: stable/8/libexec/tftpd/tftp-options.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftp-options.c	Sat Mar  2 17:14:51 2013	(r247644)
    +++ stable/8/libexec/tftpd/tftp-options.c	Sat Mar  2 17:14:53 2013	(r247645)
    @@ -99,16 +99,17 @@ option_tsize(int peer __unused, struct t
     int
     option_timeout(int peer)
     {
    +	int to;
     
     	if (options[OPT_TIMEOUT].o_request == NULL)
     		return (0);
     
    -	int to = atoi(options[OPT_TIMEOUT].o_request);
    +	to = atoi(options[OPT_TIMEOUT].o_request);
     	if (to < TIMEOUT_MIN || to > TIMEOUT_MAX) {
     		tftp_log(acting_as_client ? LOG_ERR : LOG_WARNING,
     		    "Received bad value for timeout. "
    -		    "Should be between %d and %d, received %s",
    -		    TIMEOUT_MIN, TIMEOUT_MAX);
    +		    "Should be between %d and %d, received %d",
    +		    TIMEOUT_MIN, TIMEOUT_MAX, to);
     		send_error(peer, EBADOP);
     		if (acting_as_client)
     			return (1);
    @@ -195,14 +196,14 @@ option_blksize(int peer)
     			tftp_log(LOG_ERR,
     			    "Invalid blocksize (%d bytes), "
     			    "net.inet.udp.maxdgram sysctl limits it to "
    -			    "%d bytes.\n", size, maxdgram);
    +			    "%ld bytes.\n", size, maxdgram);
     			send_error(peer, EBADOP);
     			return (1);
     		} else {
     			tftp_log(LOG_WARNING,
     			    "Invalid blocksize (%d bytes), "
     			    "net.inet.udp.maxdgram sysctl limits it to "
    -			    "%d bytes.\n", size, maxdgram);
    +			    "%ld bytes.\n", size, maxdgram);
     			size = maxdgram;
     			/* No reason to return */
     		}
    @@ -257,7 +258,7 @@ option_blksize2(int peer __unused)
     		}
     		tftp_log(LOG_INFO,
     		    "Invalid blocksize2 (%d bytes), net.inet.udp.maxdgram "
    -		    "sysctl limits it to %d bytes.\n", size, maxdgram);
    +		    "sysctl limits it to %ld bytes.\n", size, maxdgram);
     		size = sizes[i];
     		/* No need to return */
     	}
    
    Modified: stable/8/libexec/tftpd/tftp-utils.h
    ==============================================================================
    --- stable/8/libexec/tftpd/tftp-utils.h	Sat Mar  2 17:14:51 2013	(r247644)
    +++ stable/8/libexec/tftpd/tftp-utils.h	Sat Mar  2 17:14:53 2013	(r247645)
    @@ -106,7 +106,7 @@ const char *debug_show(int d);
     extern int tftp_logtostdout;
     void	tftp_openlog(const char *ident, int logopt, int facility);
     void	tftp_closelog(void);
    -void	tftp_log(int priority, const char *message, ...);
    +void	tftp_log(int priority, const char *message, ...) __printflike(2, 3);
     
     /*
      * Performance figures
    
    Modified: stable/8/libexec/tftpd/tftpd.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftpd.c	Sat Mar  2 17:14:51 2013	(r247644)
    +++ stable/8/libexec/tftpd/tftpd.c	Sat Mar  2 17:14:53 2013	(r247645)
    @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     #include 
    +#include 
     #include 
     #include 
     #include 
    @@ -799,8 +800,8 @@ tftp_xmitfile(int peer, const char *mode
     	tftp_send(peer, &block, &ts);
     	read_close();
     	if (debug&DEBUG_SIMPLE)
    -		tftp_log(LOG_INFO, "Sent %d bytes in %d seconds",
    -		    ts.amount, time(NULL) - now);
    +		tftp_log(LOG_INFO, "Sent %jd bytes in %jd seconds",
    +		    (intmax_t)ts.amount, (intmax_t)time(NULL) - now);
     }
     
     static void
    @@ -832,8 +833,8 @@ tftp_recvfile(int peer, const char *mode
     		f = now2.tv_sec - now1.tv_sec +
     		    (now2.tv_usec - now1.tv_usec) / 100000.0;
     		tftp_log(LOG_INFO,
    -		    "Download of %d bytes in %d blocks completed after %0.1f seconds\n",
    -		    ts.amount, block, f);
    +		    "Download of %jd bytes in %d blocks completed after %0.1f seconds\n",
    +		    (intmax_t)ts.amount, block, f);
     	}
     
     	return;
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 17:18:39 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 56AD0FAE;
     Sat,  2 Mar 2013 17:18:39 +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 3155E894;
     Sat,  2 Mar 2013 17:18:39 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HIdJ7071505;
     Sat, 2 Mar 2013 17:18:39 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HId7Q071503;
     Sat, 2 Mar 2013 17:18:39 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021718.r22HId7Q071503@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:18:39 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247646 - stable/8/libexec/tftpd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:18:39 -0000
    
    Author: marius
    Date: Sat Mar  2 17:18:38 2013
    New Revision: 247646
    URL: http://svnweb.freebsd.org/changeset/base/247646
    
    Log:
      MFC: r244686
      
      Use correct size in snprintf.
      Remove unused buffer.
      
      PR:		174631
      Submitted by:	Henning Petersen
    
    Modified:
      stable/8/libexec/tftpd/tftp-io.c
    Directory Properties:
      stable/8/libexec/tftpd/   (props changed)
    
    Modified: stable/8/libexec/tftpd/tftp-io.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 17:14:53 2013	(r247645)
    +++ stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 17:18:38 2013	(r247646)
    @@ -87,14 +87,13 @@ errtomsg(int error)
     {
     	static char ebuf[40];
     	struct errmsg *pe;
    -	char buf[MAXPKTSIZE];
     
     	if (error == 0)
     		return ("success");
     	for (pe = errmsgs; pe->e_code >= 0; pe++)
     		if (pe->e_code == error)
     			return (pe->e_msg);
    -	snprintf(ebuf, sizeof(buf), "error %d", error);
    +	snprintf(ebuf, sizeof(ebuf), "error %d", error);
     	return (ebuf);
     }
     
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 17:21:45 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 3FD8631D;
     Sat,  2 Mar 2013 17:21:45 +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 323EC8D1;
     Sat,  2 Mar 2013 17:21:45 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HLjO6073532;
     Sat, 2 Mar 2013 17:21:45 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HLjIp073531;
     Sat, 2 Mar 2013 17:21:45 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021721.r22HLjIp073531@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:21:45 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247647 - stable/8/libexec/tftpd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:21:45 -0000
    
    Author: marius
    Date: Sat Mar  2 17:21:44 2013
    New Revision: 247647
    URL: http://svnweb.freebsd.org/changeset/base/247647
    
    Log:
      MFC: r231973
      
      Avoid error log for transfer stop w/o error code.
    
    Modified:
      stable/8/libexec/tftpd/tftp-io.c
    Directory Properties:
      stable/8/libexec/tftpd/   (props changed)
    
    Modified: stable/8/libexec/tftpd/tftp-io.c
    ==============================================================================
    --- stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 17:18:38 2013	(r247646)
    +++ stable/8/libexec/tftpd/tftp-io.c	Sat Mar  2 17:21:44 2013	(r247647)
    @@ -462,7 +462,8 @@ receive_packet(int peer, char *data, int
     	}
     
     	if (pkt->th_opcode == ERROR) {
    -		tftp_log(LOG_ERR, "Got ERROR packet: %s", pkt->th_msg);
    +		tftp_log(pkt->th_code == EUNDEF ? LOG_DEBUG : LOG_ERR,
    +		    "Got ERROR packet: %s", pkt->th_msg);
     		return (RP_ERROR);
     	}
     
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 17:24:29 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id ED109614;
     Sat,  2 Mar 2013 17:24: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 C83CF8EC;
     Sat,  2 Mar 2013 17:24:29 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HOTpn074093;
     Sat, 2 Mar 2013 17:24:29 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HOT9Z074092;
     Sat, 2 Mar 2013 17:24:29 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021724.r22HOT9Z074092@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:24:29 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247649 - stable/8/libexec/tftpd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:24:30 -0000
    
    Author: marius
    Date: Sat Mar  2 17:24:29 2013
    New Revision: 247649
    URL: http://svnweb.freebsd.org/changeset/base/247649
    
    Log:
      MFC: r233648 (partial)
      
      Remove trailing whitespace per mdoc lint warning.
    
    Modified:
      stable/8/libexec/tftpd/tftpd.8
    Directory Properties:
      stable/8/libexec/tftpd/   (props changed)
    
    Modified: stable/8/libexec/tftpd/tftpd.8
    ==============================================================================
    --- stable/8/libexec/tftpd/tftpd.8	Sat Mar  2 17:23:47 2013	(r247648)
    +++ stable/8/libexec/tftpd/tftpd.8	Sat Mar  2 17:24:29 2013	(r247649)
    @@ -161,9 +161,9 @@ which is specified.
     .Pp
     If
     .Ar value
    -is specified, then the debug level is set to 
    +is specified, then the debug level is set to
     .Ar value .
    -The debug level is a bitmask implemented in 
    +The debug level is a bitmask implemented in
     .Pa src/libexec/tftpd/tftp-utils.h .
     Valid values are 0 (DEBUG_NONE), 1 (DEBUG_PACKETS), 2, (DEBUG_SIMPLE),
     4 (DEBUG_OPTIONS), and 8 (DEBUG_ACCESS).  Multiple debug values can be combined
    @@ -262,7 +262,7 @@ TFTP options are mentioned here:
     .Rs
     .%T Extending TFTP
     .%U http://www.compuphase.com/tftp.htm
    -.Re 
    +.Re
     .Sh HISTORY
     The
     .Nm
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 17:25:41 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id DFBA1782;
     Sat,  2 Mar 2013 17:25:41 +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 D24AD8F6;
     Sat,  2 Mar 2013 17:25:41 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HPfdd074304;
     Sat, 2 Mar 2013 17:25:41 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HPfrv074303;
     Sat, 2 Mar 2013 17:25:41 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021725.r22HPfrv074303@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:25:41 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
    Subject: svn commit: r247650 - stable/9/libexec/tftpd
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:25:42 -0000
    
    Author: marius
    Date: Sat Mar  2 17:25:41 2013
    New Revision: 247650
    URL: http://svnweb.freebsd.org/changeset/base/247650
    
    Log:
      MFC: r235857
      
      mdoc: Only use macros inside a reference block.
    
    Modified:
      stable/9/libexec/tftpd/tftpd.8
    Directory Properties:
      stable/9/libexec/tftpd/   (props changed)
    
    Modified: stable/9/libexec/tftpd/tftpd.8
    ==============================================================================
    --- stable/9/libexec/tftpd/tftpd.8	Sat Mar  2 17:24:29 2013	(r247649)
    +++ stable/9/libexec/tftpd/tftpd.8	Sat Mar  2 17:25:41 2013	(r247650)
    @@ -238,20 +238,16 @@ option.
     .Pp
     The following RFC's are supported:
     .Rs
    -RFC 1350
    -.%T The TFTP Protocol (Revision 2)
    +.%T RFC 1350: The TFTP Protocol (Revision 2)
     .Re
     .Rs
    -RFC 2347
    -.%T TFTP Option Extension
    +.%T RFC 2347: TFTP Option Extension
     .Re
     .Rs
    -RFC 2348
    -.%T TFTP Blocksize Option
    +.%T RFC 2348: TFTP Blocksize Option
     .Re
     .Rs
    -RFC 2349
    -.%T TFTP Timeout Interval and Transfer Size Options
    +.%T RFC 2349: TFTP Timeout Interval and Transfer Size Options
     .Re
     .Pp
     The non-standard
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 17:25:45 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id BA1D7787;
     Sat,  2 Mar 2013 17:25:45 +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 AC5218FA;
     Sat,  2 Mar 2013 17:25:45 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HPjg5074347;
     Sat, 2 Mar 2013 17:25:45 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HPjUF074346;
     Sat, 2 Mar 2013 17:25:45 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021725.r22HPjUF074346@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:25:45 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247651 - stable/8/libexec/tftpd
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:25:45 -0000
    
    Author: marius
    Date: Sat Mar  2 17:25:45 2013
    New Revision: 247651
    URL: http://svnweb.freebsd.org/changeset/base/247651
    
    Log:
      MFC: r235857
      
      mdoc: Only use macros inside a reference block.
    
    Modified:
      stable/8/libexec/tftpd/tftpd.8
    Directory Properties:
      stable/8/libexec/tftpd/   (props changed)
    
    Modified: stable/8/libexec/tftpd/tftpd.8
    ==============================================================================
    --- stable/8/libexec/tftpd/tftpd.8	Sat Mar  2 17:25:41 2013	(r247650)
    +++ stable/8/libexec/tftpd/tftpd.8	Sat Mar  2 17:25:45 2013	(r247651)
    @@ -238,20 +238,16 @@ option.
     .Pp
     The following RFC's are supported:
     .Rs
    -RFC 1350
    -.%T The TFTP Protocol (Revision 2)
    +.%T RFC 1350: The TFTP Protocol (Revision 2)
     .Re
     .Rs
    -RFC 2347
    -.%T TFTP Option Extension
    +.%T RFC 2347: TFTP Option Extension
     .Re
     .Rs
    -RFC 2348
    -.%T TFTP Blocksize Option
    +.%T RFC 2348: TFTP Blocksize Option
     .Re
     .Rs
    -RFC 2349
    -.%T TFTP Timeout Interval and Transfer Size Options
    +.%T RFC 2349: TFTP Timeout Interval and Transfer Size Options
     .Re
     .Pp
     The non-standard
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 17:32:16 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 009F6B99;
     Sat,  2 Mar 2013 17:32:15 +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 D6E1D936;
     Sat,  2 Mar 2013 17:32:15 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HWF8n076858;
     Sat, 2 Mar 2013 17:32:15 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HWF5u076855;
     Sat, 2 Mar 2013 17:32:15 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021732.r22HWF5u076855@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:32: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: r247652 - 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-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:32:16 -0000
    
    Author: marius
    Date: Sat Mar  2 17:32:15 2013
    New Revision: 247652
    URL: http://svnweb.freebsd.org/changeset/base/247652
    
    Log:
      MFC: r246257
      
      Improve r238673 (MFC'ed to stable/9 in r239494) to additionally allow
      for odd-aligned buffers as passed in by smartd of smartmontools.
      While at it, hint the compiler that 32-bit PIO is the most likely
      case (idea from Linux) and use bus_{read,write}_stream_2(9) instead
      of bus_{read,write}_multi_stream_2(9) for single count reads/writes.
    
    Modified:
      stable/9/sys/dev/ata/ata-all.h
      stable/9/sys/dev/ata/ata-lowlevel.c
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
    
    Modified: stable/9/sys/dev/ata/ata-all.h
    ==============================================================================
    --- stable/9/sys/dev/ata/ata-all.h	Sat Mar  2 17:25:45 2013	(r247651)
    +++ stable/9/sys/dev/ata/ata-all.h	Sat Mar  2 17:32:15 2013	(r247652)
    @@ -698,6 +698,8 @@ MALLOC_DECLARE(M_ATA);
     
     #define ATA_INW(res, offset) \
     	bus_read_2((res), (offset))
    +#define ATA_INW_STRM(res, offset) \
    +	bus_read_stream_2((res), (offset))
     #define ATA_INL(res, offset) \
     	bus_read_4((res), (offset))
     #define ATA_INSW(res, offset, addr, count) \
    @@ -712,6 +714,8 @@ MALLOC_DECLARE(M_ATA);
     	bus_write_1((res), (offset), (value))
     #define ATA_OUTW(res, offset, value) \
     	bus_write_2((res), (offset), (value))
    +#define ATA_OUTW_STRM(res, offset, value) \
    +	bus_write_stream_2((res), (offset), (value))
     #define ATA_OUTL(res, offset, value) \
     	bus_write_4((res), (offset), (value))
     #define ATA_OUTSW(res, offset, addr, count) \
    @@ -729,6 +733,9 @@ MALLOC_DECLARE(M_ATA);
     #define ATA_IDX_INW(ch, idx) \
     	ATA_INW(ch->r_io[idx].res, ch->r_io[idx].offset)
     
    +#define ATA_IDX_INW_STRM(ch, idx) \
    +	ATA_INW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset)
    +
     #define ATA_IDX_INL(ch, idx) \
     	ATA_INL(ch->r_io[idx].res, ch->r_io[idx].offset)
     
    @@ -750,6 +757,9 @@ MALLOC_DECLARE(M_ATA);
     #define ATA_IDX_OUTW(ch, idx, value) \
     	ATA_OUTW(ch->r_io[idx].res, ch->r_io[idx].offset, value)
     
    +#define ATA_IDX_OUTW_STRM(ch, idx, value) \
    +	ATA_OUTW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, value)
    +
     #define ATA_IDX_OUTL(ch, idx, value) \
     	ATA_OUTL(ch->r_io[idx].res, ch->r_io[idx].offset, value)
     
    
    Modified: stable/9/sys/dev/ata/ata-lowlevel.c
    ==============================================================================
    --- stable/9/sys/dev/ata/ata-lowlevel.c	Sat Mar  2 17:25:45 2013	(r247651)
    +++ stable/9/sys/dev/ata/ata-lowlevel.c	Sat Mar  2 17:32:15 2013	(r247652)
    @@ -847,14 +847,28 @@ ata_pio_read(struct ata_request *request
         uint8_t *addr;
         int size = min(request->transfersize, length);
         int resid;
    -    uint8_t buf[2];
    +    uint8_t buf[2] __aligned(sizeof(int16_t));
    +#ifndef __NO_STRICT_ALIGNMENT
    +    int i;
    +#endif
     
         addr = (uint8_t *)request->data + request->donecount;
    -    if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) ||
    -	((uintptr_t)addr % sizeof(int32_t))) {
    -	ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t));
    +    if (__predict_false(ch->flags & ATA_USE_16BIT ||
    +      (size % sizeof(int32_t)) || ((uintptr_t)addr % sizeof(int32_t)))) {
    +#ifndef __NO_STRICT_ALIGNMENT
    +	if (__predict_false((uintptr_t)addr % sizeof(int16_t))) {
    +	    for (i = 0, resid = size & ~1; resid > 0; resid -=
    +	      sizeof(int16_t)) {
    +		*(uint16_t *)&buf = ATA_IDX_INW_STRM(ch, ATA_DATA);
    +	        addr[i++] = buf[0];
    +	        addr[i++] = buf[1];
    +	    }
    +	} else
    +#endif
    +	    ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, size /
    +	      sizeof(int16_t));
     	if (size & 1) {
    -	    ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)buf, 1);
    +	    *(uint16_t *)&buf = ATA_IDX_INW_STRM(ch, ATA_DATA);
     	    (addr + (size & ~1))[0] = buf[0];
     	}
         } else
    @@ -876,15 +890,30 @@ ata_pio_write(struct ata_request *reques
         uint8_t *addr;
         int size = min(request->transfersize, length);
         int resid;
    -    uint8_t buf[2];
    +    uint8_t buf[2] __aligned(sizeof(int16_t));
    +#ifndef __NO_STRICT_ALIGNMENT
    +    int i;
    +#endif
     
    +    size = min(request->transfersize, length);
         addr = (uint8_t *)request->data + request->donecount;
    -    if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) ||
    -	((uintptr_t)addr % sizeof(int32_t))) {
    -	ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t));
    +    if (__predict_false(ch->flags & ATA_USE_16BIT ||
    +      (size % sizeof(int32_t)) || ((uintptr_t)addr % sizeof(int32_t)))) {
    +#ifndef __NO_STRICT_ALIGNMENT
    +	if (__predict_false((uintptr_t)addr % sizeof(int16_t))) {
    +	    for (i = 0, resid = size & ~1; resid > 0; resid -=
    +	      sizeof(int16_t)) {
    +	        buf[0] = addr[i++];
    +	        buf[1] = addr[i++];
    +		ATA_IDX_OUTW_STRM(ch, ATA_DATA, *(uint16_t *)&buf);
    +	    }
    +	} else
    +#endif
    +	    ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, size /
    +	      sizeof(int16_t));
     	if (size & 1) {
     	    buf[0] = (addr + (size & ~1))[0];
    -	    ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)buf, 1);
    +	    ATA_IDX_OUTW_STRM(ch, ATA_DATA, *(uint16_t *)&buf);
     	}
         } else
     	ATA_IDX_OUTSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t));
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 17:32:21 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 32594B9A;
     Sat,  2 Mar 2013 17:32:21 +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 15ED2937;
     Sat,  2 Mar 2013 17:32:21 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HWKSU076905;
     Sat, 2 Mar 2013 17:32:20 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HWKa6076903;
     Sat, 2 Mar 2013 17:32:20 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021732.r22HWKa6076903@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:32:20 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247653 - stable/8/sys/dev/ata
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:32:21 -0000
    
    Author: marius
    Date: Sat Mar  2 17:32:20 2013
    New Revision: 247653
    URL: http://svnweb.freebsd.org/changeset/base/247653
    
    Log:
      MFC: r246257
      
      Improve r238673 (MFC'ed to stable/8 in r239495) to additionally allow
      for odd-aligned buffers as passed in by smartd of smartmontools.
      While at it, hint the compiler that 32-bit PIO is the most likely
      case (idea from Linux) and use bus_{read,write}_stream_2(9) instead
      of bus_{read,write}_multi_stream_2(9) for single count reads/writes.
    
    Modified:
      stable/8/sys/dev/ata/ata-all.h
      stable/8/sys/dev/ata/ata-lowlevel.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/ata/   (props changed)
    
    Modified: stable/8/sys/dev/ata/ata-all.h
    ==============================================================================
    --- stable/8/sys/dev/ata/ata-all.h	Sat Mar  2 17:32:15 2013	(r247652)
    +++ stable/8/sys/dev/ata/ata-all.h	Sat Mar  2 17:32:20 2013	(r247653)
    @@ -698,6 +698,8 @@ MALLOC_DECLARE(M_ATA);
     
     #define ATA_INW(res, offset) \
     	bus_read_2((res), (offset))
    +#define ATA_INW_STRM(res, offset) \
    +	bus_read_stream_2((res), (offset))
     #define ATA_INL(res, offset) \
     	bus_read_4((res), (offset))
     #define ATA_INSW(res, offset, addr, count) \
    @@ -712,6 +714,8 @@ MALLOC_DECLARE(M_ATA);
     	bus_write_1((res), (offset), (value))
     #define ATA_OUTW(res, offset, value) \
     	bus_write_2((res), (offset), (value))
    +#define ATA_OUTW_STRM(res, offset, value) \
    +	bus_write_stream_2((res), (offset), (value))
     #define ATA_OUTL(res, offset, value) \
     	bus_write_4((res), (offset), (value))
     #define ATA_OUTSW(res, offset, addr, count) \
    @@ -729,6 +733,9 @@ MALLOC_DECLARE(M_ATA);
     #define ATA_IDX_INW(ch, idx) \
     	ATA_INW(ch->r_io[idx].res, ch->r_io[idx].offset)
     
    +#define ATA_IDX_INW_STRM(ch, idx) \
    +	ATA_INW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset)
    +
     #define ATA_IDX_INL(ch, idx) \
     	ATA_INL(ch->r_io[idx].res, ch->r_io[idx].offset)
     
    @@ -750,6 +757,9 @@ MALLOC_DECLARE(M_ATA);
     #define ATA_IDX_OUTW(ch, idx, value) \
     	ATA_OUTW(ch->r_io[idx].res, ch->r_io[idx].offset, value)
     
    +#define ATA_IDX_OUTW_STRM(ch, idx, value) \
    +	ATA_OUTW_STRM(ch->r_io[idx].res, ch->r_io[idx].offset, value)
    +
     #define ATA_IDX_OUTL(ch, idx, value) \
     	ATA_OUTL(ch->r_io[idx].res, ch->r_io[idx].offset, value)
     
    
    Modified: stable/8/sys/dev/ata/ata-lowlevel.c
    ==============================================================================
    --- stable/8/sys/dev/ata/ata-lowlevel.c	Sat Mar  2 17:32:15 2013	(r247652)
    +++ stable/8/sys/dev/ata/ata-lowlevel.c	Sat Mar  2 17:32:20 2013	(r247653)
    @@ -847,14 +847,28 @@ ata_pio_read(struct ata_request *request
         uint8_t *addr;
         int size = min(request->transfersize, length);
         int resid;
    -    uint8_t buf[2];
    +    uint8_t buf[2] __aligned(sizeof(int16_t));
    +#ifndef __NO_STRICT_ALIGNMENT
    +    int i;
    +#endif
     
         addr = (uint8_t *)request->data + request->donecount;
    -    if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) ||
    -	((uintptr_t)addr % sizeof(int32_t))) {
    -	ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t));
    +    if (__predict_false(ch->flags & ATA_USE_16BIT ||
    +      (size % sizeof(int32_t)) || ((uintptr_t)addr % sizeof(int32_t)))) {
    +#ifndef __NO_STRICT_ALIGNMENT
    +	if (__predict_false((uintptr_t)addr % sizeof(int16_t))) {
    +	    for (i = 0, resid = size & ~1; resid > 0; resid -=
    +	      sizeof(int16_t)) {
    +		*(uint16_t *)&buf = ATA_IDX_INW_STRM(ch, ATA_DATA);
    +	        addr[i++] = buf[0];
    +	        addr[i++] = buf[1];
    +	    }
    +	} else
    +#endif
    +	    ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)addr, size /
    +	      sizeof(int16_t));
     	if (size & 1) {
    -	    ATA_IDX_INSW_STRM(ch, ATA_DATA, (void*)buf, 1);
    +	    *(uint16_t *)&buf = ATA_IDX_INW_STRM(ch, ATA_DATA);
     	    (addr + (size & ~1))[0] = buf[0];
     	}
         } else
    @@ -876,15 +890,30 @@ ata_pio_write(struct ata_request *reques
         uint8_t *addr;
         int size = min(request->transfersize, length);
         int resid;
    -    uint8_t buf[2];
    +    uint8_t buf[2] __aligned(sizeof(int16_t));
    +#ifndef __NO_STRICT_ALIGNMENT
    +    int i;
    +#endif
     
    +    size = min(request->transfersize, length);
         addr = (uint8_t *)request->data + request->donecount;
    -    if (ch->flags & ATA_USE_16BIT || (size % sizeof(int32_t)) ||
    -	((uintptr_t)addr % sizeof(int32_t))) {
    -	ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int16_t));
    +    if (__predict_false(ch->flags & ATA_USE_16BIT ||
    +      (size % sizeof(int32_t)) || ((uintptr_t)addr % sizeof(int32_t)))) {
    +#ifndef __NO_STRICT_ALIGNMENT
    +	if (__predict_false((uintptr_t)addr % sizeof(int16_t))) {
    +	    for (i = 0, resid = size & ~1; resid > 0; resid -=
    +	      sizeof(int16_t)) {
    +	        buf[0] = addr[i++];
    +	        buf[1] = addr[i++];
    +		ATA_IDX_OUTW_STRM(ch, ATA_DATA, *(uint16_t *)&buf);
    +	    }
    +	} else
    +#endif
    +	    ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)addr, size /
    +	      sizeof(int16_t));
     	if (size & 1) {
     	    buf[0] = (addr + (size & ~1))[0];
    -	    ATA_IDX_OUTSW_STRM(ch, ATA_DATA, (void*)buf, 1);
    +	    ATA_IDX_OUTW_STRM(ch, ATA_DATA, *(uint16_t *)&buf);
     	}
         } else
     	ATA_IDX_OUTSL_STRM(ch, ATA_DATA, (void*)addr, size / sizeof(int32_t));
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 17:36:30 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id A4047F59;
     Sat,  2 Mar 2013 17:36:30 +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 96701957;
     Sat,  2 Mar 2013 17:36:30 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HaUmJ077562;
     Sat, 2 Mar 2013 17:36:30 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HaUae077561;
     Sat, 2 Mar 2013 17:36:30 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021736.r22HaUae077561@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:36: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: r247654 - stable/9/sys/dev/uart
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:36:30 -0000
    
    Author: marius
    Date: Sat Mar  2 17:36:29 2013
    New Revision: 247654
    URL: http://svnweb.freebsd.org/changeset/base/247654
    
    Log:
      MFC: r246300
      
      - Make pci_ns8250_ids[] const.
      - Use DEVMETHOD_END.
      - Use NULL instead of 0 for pointers.
    
    Modified:
      stable/9/sys/dev/uart/uart_bus_pci.c
    Directory Properties:
      stable/9/sys/   (props changed)
      stable/9/sys/dev/   (props changed)
    
    Modified: stable/9/sys/dev/uart/uart_bus_pci.c
    ==============================================================================
    --- stable/9/sys/dev/uart/uart_bus_pci.c	Sat Mar  2 17:32:20 2013	(r247653)
    +++ stable/9/sys/dev/uart/uart_bus_pci.c	Sat Mar  2 17:36:29 2013	(r247654)
    @@ -51,7 +51,7 @@ static device_method_t uart_pci_methods[
     	DEVMETHOD(device_probe,		uart_pci_probe),
     	DEVMETHOD(device_attach,	uart_bus_attach),
     	DEVMETHOD(device_detach,	uart_bus_detach),
    -	{ 0, 0 }
    +	DEVMETHOD_END
     };
     
     static driver_t uart_pci_driver = {
    @@ -70,7 +70,7 @@ struct pci_id {
     	int		rclk;
     };
     
    -static struct pci_id pci_ns8250_ids[] = {
    +static const struct pci_id pci_ns8250_ids[] = {
     { 0x1028, 0x0008, 0xffff, 0, "Dell Remote Access Card III", 0x14,
     	128 * DEFAULT_RCLK },
     { 0x1028, 0x0012, 0xffff, 0, "Dell RAC 4 Daughter Card Virtual UART", 0x14,
    @@ -133,8 +133,8 @@ static struct pci_id pci_ns8250_ids[] = 
     { 0xffff, 0, 0xffff, 0, NULL, 0, 0}
     };
     
    -static struct pci_id *
    -uart_pci_match(device_t dev, struct pci_id *id)
    +const static struct pci_id *
    +uart_pci_match(device_t dev, const struct pci_id *id)
     {
     	uint16_t device, subdev, subven, vendor;
     
    @@ -159,7 +159,7 @@ static int
     uart_pci_probe(device_t dev)
     {
     	struct uart_softc *sc;
    -	struct pci_id *id;
    +	const struct pci_id *id;
     
     	sc = device_get_softc(dev);
     
    @@ -177,4 +177,4 @@ uart_pci_probe(device_t dev)
     	return (uart_bus_probe(dev, 0, id->rclk, id->rid, 0));
     }
     
    -DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, 0, 0);
    +DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, NULL, NULL);
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 17:36:32 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 790D3F5A;
     Sat,  2 Mar 2013 17:36:32 +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 5334A959;
     Sat,  2 Mar 2013 17:36:32 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HaW8B077598;
     Sat, 2 Mar 2013 17:36:32 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HaWns077597;
     Sat, 2 Mar 2013 17:36:32 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021736.r22HaWns077597@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:36:32 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247655 - stable/8/sys/dev/uart
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:36:32 -0000
    
    Author: marius
    Date: Sat Mar  2 17:36:31 2013
    New Revision: 247655
    URL: http://svnweb.freebsd.org/changeset/base/247655
    
    Log:
      MFC: r246300
      
      - Make pci_ns8250_ids[] const.
      - Use DEVMETHOD_END.
      - Use NULL instead of 0 for pointers.
    
    Modified:
      stable/8/sys/dev/uart/uart_bus_pci.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/uart/   (props changed)
    
    Modified: stable/8/sys/dev/uart/uart_bus_pci.c
    ==============================================================================
    --- stable/8/sys/dev/uart/uart_bus_pci.c	Sat Mar  2 17:36:29 2013	(r247654)
    +++ stable/8/sys/dev/uart/uart_bus_pci.c	Sat Mar  2 17:36:31 2013	(r247655)
    @@ -51,7 +51,7 @@ static device_method_t uart_pci_methods[
     	DEVMETHOD(device_probe,		uart_pci_probe),
     	DEVMETHOD(device_attach,	uart_bus_attach),
     	DEVMETHOD(device_detach,	uart_bus_detach),
    -	{ 0, 0 }
    +	DEVMETHOD_END
     };
     
     static driver_t uart_pci_driver = {
    @@ -70,7 +70,7 @@ struct pci_id {
     	int		rclk;
     };
     
    -static struct pci_id pci_ns8250_ids[] = {
    +static const struct pci_id pci_ns8250_ids[] = {
     { 0x1028, 0x0008, 0xffff, 0, "Dell Remote Access Card III", 0x14,
     	128 * DEFAULT_RCLK },
     { 0x1028, 0x0012, 0xffff, 0, "Dell RAC 4 Daughter Card Virtual UART", 0x14,
    @@ -129,8 +129,8 @@ static struct pci_id pci_ns8250_ids[] = 
     { 0xffff, 0, 0xffff, 0, NULL, 0, 0}
     };
     
    -static struct pci_id *
    -uart_pci_match(device_t dev, struct pci_id *id)
    +const static struct pci_id *
    +uart_pci_match(device_t dev, const struct pci_id *id)
     {
     	uint16_t device, subdev, subven, vendor;
     
    @@ -155,7 +155,7 @@ static int
     uart_pci_probe(device_t dev)
     {
     	struct uart_softc *sc;
    -	struct pci_id *id;
    +	const struct pci_id *id;
     
     	sc = device_get_softc(dev);
     
    @@ -173,4 +173,4 @@ uart_pci_probe(device_t dev)
     	return (uart_bus_probe(dev, 0, id->rclk, id->rid, 0));
     }
     
    -DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, 0, 0);
    +DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, NULL, NULL);
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 17:39:12 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 6D7042E1;
     Sat,  2 Mar 2013 17:39:12 +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 2F828983;
     Sat,  2 Mar 2013 17:39:12 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HdCwv078025;
     Sat, 2 Mar 2013 17:39:12 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HdC5w078024;
     Sat, 2 Mar 2013 17:39:12 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021739.r22HdC5w078024@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:39:12 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
    Subject: svn commit: r247656 - stable/9/sys/kern
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:39:12 -0000
    
    Author: marius
    Date: Sat Mar  2 17:39:11 2013
    New Revision: 247656
    URL: http://svnweb.freebsd.org/changeset/base/247656
    
    Log:
      MFC: r246689, r246696
      
      Make SYSCTL_{LONG,QUAD,ULONG,UQUAD}(9) work as advertised and also handle
      constant values.
      
      Reviewed by:	kib
    
    Modified:
      stable/9/sys/kern/kern_sysctl.c
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/kern/kern_sysctl.c
    ==============================================================================
    --- stable/9/sys/kern/kern_sysctl.c	Sat Mar  2 17:36:31 2013	(r247655)
    +++ stable/9/sys/kern/kern_sysctl.c	Sat Mar  2 17:39:11 2013	(r247656)
    @@ -1036,7 +1036,10 @@ sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS
     
     
     /*
    - * Handle a long, signed or unsigned.  arg1 points to it.
    + * Handle a long, signed or unsigned.
    + * Two cases:
    + *     a variable:  point arg1 at it.
    + *     a constant:  pass it in arg2.
      */
     
     int
    @@ -1051,9 +1054,10 @@ sysctl_handle_long(SYSCTL_HANDLER_ARGS)
     	/*
     	 * Attempt to get a coherent snapshot by making a copy of the data.
     	 */
    -	if (!arg1)
    -		return (EINVAL);
    -	tmplong = *(long *)arg1;
    +	if (arg1)
    +		tmplong = *(long *)arg1;
    +	else
    +		tmplong = arg2;
     #ifdef SCTL_MASK32
     	if (req->flags & SCTL_MASK32) {
     		tmpint = tmplong;
    @@ -1065,18 +1069,24 @@ sysctl_handle_long(SYSCTL_HANDLER_ARGS)
     	if (error || !req->newptr)
     		return (error);
     
    +	if (!arg1)
    +		error = EPERM;
     #ifdef SCTL_MASK32
    -	if (req->flags & SCTL_MASK32) {
    +	else if (req->flags & SCTL_MASK32) {
     		error = SYSCTL_IN(req, &tmpint, sizeof(int));
     		*(long *)arg1 = (long)tmpint;
    -	} else
    +	}
     #endif
    +	else
     		error = SYSCTL_IN(req, arg1, sizeof(long));
     	return (error);
     }
     
     /*
    - * Handle a 64 bit int, signed or unsigned.  arg1 points to it.
    + * Handle a 64 bit int, signed or unsigned.
    + * Two cases:
    + *     a variable:  point arg1 at it.
    + *     a constant:  pass it in arg2.
      */
     int
     sysctl_handle_64(SYSCTL_HANDLER_ARGS)
    @@ -1087,15 +1097,19 @@ sysctl_handle_64(SYSCTL_HANDLER_ARGS)
     	/*
     	 * Attempt to get a coherent snapshot by making a copy of the data.
     	 */
    -	if (!arg1)
    -		return (EINVAL);
    -	tmpout = *(uint64_t *)arg1;
    +	if (arg1)
    +		tmpout = *(uint64_t *)arg1;
    +	else
    +		tmpout = arg2;
     	error = SYSCTL_OUT(req, &tmpout, sizeof(uint64_t));
     
     	if (error || !req->newptr)
     		return (error);
     
    -	error = SYSCTL_IN(req, arg1, sizeof(uint64_t));
    +	if (!arg1)
    +		error = EPERM;
    +	else
    +		error = SYSCTL_IN(req, arg1, sizeof(uint64_t));
     	return (error);
     }
     
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 17:39:21 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 0E32C432;
     Sat,  2 Mar 2013 17:39:21 +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 DC514984;
     Sat,  2 Mar 2013 17:39:20 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HdKml078088;
     Sat, 2 Mar 2013 17:39:20 GMT (envelope-from marius@svn.freebsd.org)
    Received: (from marius@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HdKKV078087;
     Sat, 2 Mar 2013 17:39:20 GMT (envelope-from marius@svn.freebsd.org)
    Message-Id: <201303021739.r22HdKKV078087@svn.freebsd.org>
    From: Marius Strobl 
    Date: Sat, 2 Mar 2013 17:39:20 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247657 - stable/8/sys/kern
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:39:21 -0000
    
    Author: marius
    Date: Sat Mar  2 17:39:20 2013
    New Revision: 247657
    URL: http://svnweb.freebsd.org/changeset/base/247657
    
    Log:
      MFC: r246689, r246696
      
      Make SYSCTL_{LONG,QUAD,ULONG,UQUAD}(9) work as advertised and also handle
      constant values.
      
      Reviewed by:	kib
    
    Modified:
      stable/8/sys/kern/kern_sysctl.c
    Directory Properties:
      stable/8/sys/   (props changed)
      stable/8/sys/kern/   (props changed)
    
    Modified: stable/8/sys/kern/kern_sysctl.c
    ==============================================================================
    --- stable/8/sys/kern/kern_sysctl.c	Sat Mar  2 17:39:11 2013	(r247656)
    +++ stable/8/sys/kern/kern_sysctl.c	Sat Mar  2 17:39:20 2013	(r247657)
    @@ -992,7 +992,10 @@ sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS
     
     
     /*
    - * Handle a long, signed or unsigned.  arg1 points to it.
    + * Handle a long, signed or unsigned.
    + * Two cases:
    + *     a variable:  point arg1 at it.
    + *     a constant:  pass it in arg2.
      */
     
     int
    @@ -1007,9 +1010,10 @@ sysctl_handle_long(SYSCTL_HANDLER_ARGS)
     	/*
     	 * Attempt to get a coherent snapshot by making a copy of the data.
     	 */
    -	if (!arg1)
    -		return (EINVAL);
    -	tmplong = *(long *)arg1;
    +	if (arg1)
    +		tmplong = *(long *)arg1;
    +	else
    +		tmplong = arg2;
     #ifdef SCTL_MASK32
     	if (req->flags & SCTL_MASK32) {
     		tmpint = tmplong;
    @@ -1021,18 +1025,24 @@ sysctl_handle_long(SYSCTL_HANDLER_ARGS)
     	if (error || !req->newptr)
     		return (error);
     
    +	if (!arg1)
    +		error = EPERM;
     #ifdef SCTL_MASK32
    -	if (req->flags & SCTL_MASK32) {
    +	else if (req->flags & SCTL_MASK32) {
     		error = SYSCTL_IN(req, &tmpint, sizeof(int));
     		*(long *)arg1 = (long)tmpint;
    -	} else
    +	}
     #endif
    +	else
     		error = SYSCTL_IN(req, arg1, sizeof(long));
     	return (error);
     }
     
     /*
    - * Handle a 64 bit int, signed or unsigned.  arg1 points to it.
    + * Handle a 64 bit int, signed or unsigned.
    + * Two cases:
    + *     a variable:  point arg1 at it.
    + *     a constant:  pass it in arg2.
      */
     
     int
    @@ -1044,15 +1054,19 @@ sysctl_handle_quad(SYSCTL_HANDLER_ARGS)
     	/*
     	 * Attempt to get a coherent snapshot by making a copy of the data.
     	 */
    -	if (!arg1)
    -		return (EINVAL);
    -	tmpout = *(uint64_t *)arg1;
    +	if (arg1)
    +		tmpout = *(uint64_t *)arg1;
    +	else
    +		tmpout = arg2;
     	error = SYSCTL_OUT(req, &tmpout, sizeof(uint64_t));
     
     	if (error || !req->newptr)
     		return (error);
     
    -	error = SYSCTL_IN(req, arg1, sizeof(uint64_t));
    +	if (!arg1)
    +		error = EPERM;
    +	else
    +		error = SYSCTL_IN(req, arg1, sizeof(uint64_t));
     	return (error);
     }
     
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 17:51:23 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 5E23F841;
     Sat,  2 Mar 2013 17:51:23 +0000 (UTC) (envelope-from flo@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 383499F1;
     Sat,  2 Mar 2013 17:51:23 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22HpNVd082877;
     Sat, 2 Mar 2013 17:51:23 GMT (envelope-from flo@svn.freebsd.org)
    Received: (from flo@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22HpNgB082876;
     Sat, 2 Mar 2013 17:51:23 GMT (envelope-from flo@svn.freebsd.org)
    Message-Id: <201303021751.r22HpNgB082876@svn.freebsd.org>
    From: Florian Smeets 
    Date: Sat, 2 Mar 2013 17:51: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: r247658 - stable/9/sys/netinet
    X-SVN-Group: stable-9
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 17:51:23 -0000
    
    Author: flo (ports committer)
    Date: Sat Mar  2 17:51:22 2013
    New Revision: 247658
    URL: http://svnweb.freebsd.org/changeset/base/247658
    
    Log:
      MFC: r242854 (by rdivacky)
      
      Initialize hdrlen to 0 to avoid clang warning in NOINET case.
      
      This fixes the kernel build for INET6 only kernels.
      
      Approved by:	cognet
    
    Modified:
      stable/9/sys/netinet/tcp_timewait.c
    Directory Properties:
      stable/9/sys/   (props changed)
    
    Modified: stable/9/sys/netinet/tcp_timewait.c
    ==============================================================================
    --- stable/9/sys/netinet/tcp_timewait.c	Sat Mar  2 17:39:20 2013	(r247657)
    +++ stable/9/sys/netinet/tcp_timewait.c	Sat Mar  2 17:51:22 2013	(r247658)
    @@ -519,6 +519,7 @@ tcp_twrespond(struct tcptw *tw, int flag
     	struct ip6_hdr *ip6 = NULL;
     	int isipv6 = inp->inp_inc.inc_flags & INC_ISIPV6;
     #endif
    +	hdrlen = 0;                     /* Keep compiler happy */
     
     	INP_WLOCK_ASSERT(inp);
     
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 18:07:30 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 39F54E94;
     Sat,  2 Mar 2013 18:07:30 +0000 (UTC) (envelope-from alc@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 21ACAA95;
     Sat,  2 Mar 2013 18:07:30 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22I7UsE087067;
     Sat, 2 Mar 2013 18:07:30 GMT (envelope-from alc@svn.freebsd.org)
    Received: (from alc@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22I7UKl087066;
     Sat, 2 Mar 2013 18:07:30 GMT (envelope-from alc@svn.freebsd.org)
    Message-Id: <201303021807.r22I7UKl087066@svn.freebsd.org>
    From: Alan Cox 
    Date: Sat, 2 Mar 2013 18:07:29 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247659 - head/sys/vm
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 18:07:30 -0000
    
    Author: alc
    Date: Sat Mar  2 18:07:29 2013
    New Revision: 247659
    URL: http://svnweb.freebsd.org/changeset/base/247659
    
    Log:
      The value held by the vm object's field pg_color is only considered
      valid if the flag OBJ_COLORED is set.  Since _vm_object_allocate()
      doesn't set this flag, it needn't initialize pg_color.
      
      Sponsored by:	EMC / Isilon Storage Division
    
    Modified:
      head/sys/vm/vm_object.c
    
    Modified: head/sys/vm/vm_object.c
    ==============================================================================
    --- head/sys/vm/vm_object.c	Sat Mar  2 17:51:22 2013	(r247658)
    +++ head/sys/vm/vm_object.c	Sat Mar  2 18:07:29 2013	(r247659)
    @@ -241,7 +241,6 @@ _vm_object_allocate(objtype_t type, vm_p
     	object->memattr = VM_MEMATTR_DEFAULT;
     	object->cred = NULL;
     	object->charge = 0;
    -	object->pg_color = 0;
     	object->handle = NULL;
     	object->backing_object = NULL;
     	object->backing_object_offset = (vm_ooffset_t) 0;
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 18:08:04 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 041021A3;
     Sat,  2 Mar 2013 18:08:04 +0000 (UTC)
     (envelope-from schweikh@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 E0E75A9E;
     Sat,  2 Mar 2013 18:08:03 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22I83GX087253;
     Sat, 2 Mar 2013 18:08:03 GMT (envelope-from schweikh@svn.freebsd.org)
    Received: (from schweikh@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22I831R087252;
     Sat, 2 Mar 2013 18:08:03 GMT (envelope-from schweikh@svn.freebsd.org)
    Message-Id: <201303021808.r22I831R087252@svn.freebsd.org>
    From: Jens Schweikhardt 
    Date: Sat, 2 Mar 2013 18:08:03 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247660 - head/etc
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 18:08:04 -0000
    
    Author: schweikh
    Date: Sat Mar  2 18:08:03 2013
    New Revision: 247660
    URL: http://svnweb.freebsd.org/changeset/base/247660
    
    Log:
      Comment cosmetics: capitalize SCSI
      Fix some hard tabs in the wrong place.
      
      MFC after:	2 weeks
    
    Modified:
      head/etc/devd.conf
    
    Modified: head/etc/devd.conf
    ==============================================================================
    --- head/etc/devd.conf	Sat Mar  2 18:07:29 2013	(r247659)
    +++ head/etc/devd.conf	Sat Mar  2 18:08:03 2013	(r247660)
    @@ -34,7 +34,7 @@ options {
     # NB: DETACH events are ignored; the kernel should handle all cleanup
     #     (routes, arp cache).  Beware of races against immediate create
     #     of a device with the same name; e.g.
    -#	ifconfig bridge0 destroy; ifconfig bridge0 create
    +#     ifconfig bridge0 destroy; ifconfig bridge0 create
     #
     notify 0 {
     	match "system"		"IFNET";
    @@ -165,7 +165,7 @@ notify 100 {
     };
     
     #
    -# Rescan scsi device-names on attach, but not detach.  However, it is
    +# Rescan SCSI device-names on attach, but not detach.  However, it is
     # disabled by default due to reports of problems.
     #
     attach 0 {
    @@ -305,13 +305,13 @@ detach 10 {
     # events.  See the ACPI specification for more information about
     # notifies.  Here is the information returned for each subsystem:
     #
    -# ACAD:		AC line state (0 is offline, 1 is online)
    -# Button:	Button pressed (0 for power, 1 for sleep)
    -# CMBAT:	ACPI battery events
    -# Lid:		Lid state (0 is closed, 1 is open)
    -# RCTL:		Resource limits
    +# ACAD:            AC line state (0 is offline, 1 is online)
    +# Button:          Button pressed (0 for power, 1 for sleep)
    +# CMBAT:           ACPI battery events
    +# Lid:             Lid state (0 is closed, 1 is open)
    +# RCTL:            Resource limits
     # Suspend, Resume: Suspend and resume notification
    -# Thermal:	ACPI thermal zone events
    +# Thermal:         ACPI thermal zone events
     #
     # This example calls a script when the AC state changes, passing the
     # notify value as the first argument.  If the state is 0x00, it might
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 18:24:00 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 6449079B;
     Sat,  2 Mar 2013 18:24:00 +0000 (UTC)
     (envelope-from attilio@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 55C35B56;
     Sat,  2 Mar 2013 18:24:00 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22IO0BO092741;
     Sat, 2 Mar 2013 18:24:00 GMT (envelope-from attilio@svn.freebsd.org)
    Received: (from attilio@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22IO07F092740;
     Sat, 2 Mar 2013 18:24:00 GMT (envelope-from attilio@svn.freebsd.org)
    Message-Id: <201303021824.r22IO07F092740@svn.freebsd.org>
    From: Attilio Rao 
    Date: Sat, 2 Mar 2013 18:24:00 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247662 - head/sys/geom/label
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 18:24:00 -0000
    
    Author: attilio
    Date: Sat Mar  2 18:23:59 2013
    New Revision: 247662
    URL: http://svnweb.freebsd.org/changeset/base/247662
    
    Log:
      Remove ntfs headers dependency for g_label_ntfs.c by redefining the
      used structs and values.
      
      This patch is not targeted for MFC.
    
    Modified:
      head/sys/geom/label/g_label_ntfs.c
    
    Modified: head/sys/geom/label/g_label_ntfs.c
    ==============================================================================
    --- head/sys/geom/label/g_label_ntfs.c	Sat Mar  2 18:18:30 2013	(r247661)
    +++ head/sys/geom/label/g_label_ntfs.c	Sat Mar  2 18:23:59 2013	(r247662)
    @@ -32,21 +32,72 @@ __FBSDID("$FreeBSD$");
     #include 
     #include 
     
    -#include 
    -
     #include 
     #include 
     
    +#define	NTFS_A_VOLUMENAME	0x60
    +#define	NTFS_FILEMAGIC		((uint32_t)(0x454C4946))
    +#define	NTFS_VOLUMEINO		3
    +
     #define G_LABEL_NTFS_DIR	"ntfs"
     
    +struct ntfs_attr {
    +	uint32_t	a_type;
    +	uint32_t	reclen;
    +	uint8_t		a_flag;
    +	uint8_t		a_namelen;
    +	uint8_t		a_nameoff;
    +	uint8_t		reserved1;
    +	uint8_t		a_compression;
    +	uint8_t		reserved2;
    +	uint16_t	a_index;
    +	uint16_t	a_datalen;
    +	uint16_t	reserved3;
    +	uint16_t	a_dataoff;
    +	uint16_t	a_indexed;
    +};
    +
    +struct ntfs_filerec {
    +	uint32_t	fr_hdrmagic;
    +	uint16_t	fr_hdrfoff;
    +	uint16_t	fr_hdrfnum;
    +	uint8_t		reserved[8];
    +	uint16_t	fr_seqnum;
    +	uint16_t	fr_nlink;
    +	uint16_t	fr_attroff;
    +	uint16_t	fr_flags;
    +	uint32_t	fr_size;
    +	uint32_t	fr_allocated;
    +	uint64_t	fr_mainrec;
    +	uint16_t	fr_attrnum;
    +};
    +
    +struct ntfs_bootfile {
    +	uint8_t		reserved1[3];
    +	uint8_t		bf_sysid[8];
    +	uint16_t	bf_bps;
    +	uint8_t		bf_spc;
    +	uint8_t		reserved2[7];
    +	uint8_t		bf_media;
    +	uint8_t		reserved3[2];
    +	uint16_t	bf_spt;
    +	uint16_t	bf_heads;
    +	uint8_t		reserver4[12];
    +	uint64_t	bf_spv;
    +	uint64_t	bf_mftcn;
    +	uint64_t	bf_mftmirrcn;
    +	uint8_t		bf_mftrecsz;
    +	uint32_t	bf_ibsz;
    +	uint32_t	bf_volsn;
    +};
     
     static void
     g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size)
     {
     	struct g_provider *pp;
    -	struct bootfile *bf;
    -	struct filerec *fr;
    -	struct attr *atr;
    +	struct ntfs_bootfile *bf;
    +	struct ntfs_filerec *fr;
    +	struct ntfs_attr *atr;
     	off_t voloff;
     	char *filerecp, *ap;
     	char mftrecsz, vnchar;
    @@ -58,7 +109,7 @@ g_label_ntfs_taste(struct g_consumer *cp
     	pp = cp->provider;
     	filerecp = NULL;
     
    -	bf = (struct bootfile *)g_read_data(cp, 0, pp->sectorsize, NULL);
    +	bf = (struct ntfs_bootfile *)g_read_data(cp, 0, pp->sectorsize, NULL);
     	if (bf == NULL || strncmp(bf->bf_sysid, "NTFS    ", 8) != 0)
     		goto done;
     
    @@ -75,16 +126,16 @@ g_label_ntfs_taste(struct g_consumer *cp
     	filerecp = g_read_data(cp, voloff, recsize, NULL);
     	if (filerecp == NULL)
     		goto done;
    -	fr = (struct filerec *)filerecp;
    +	fr = (struct ntfs_filerec *)filerecp;
     
    -	if (fr->fr_fixup.fh_magic != NTFS_FILEMAGIC)
    +	if (fr->fr_hdrmagic != NTFS_FILEMAGIC)
     		goto done;
     
     	for (ap = filerecp + fr->fr_attroff;
    -	    atr = (struct attr *)ap, atr->a_hdr.a_type != -1;
    -	    ap += atr->a_hdr.reclen) {
    -		if (atr->a_hdr.a_type == NTFS_A_VOLUMENAME) {
    -			if(atr->a_r.a_datalen >= size *2){
    +	    atr = (struct ntfs_attr *)ap, atr->a_type != -1;
    +	    ap += atr->reclen) {
    +		if (atr->a_type == NTFS_A_VOLUMENAME) {
    +			if(atr->a_datalen >= size *2){
     				label[0] = 0;
     				goto done;
     			}
    @@ -92,8 +143,8 @@ g_label_ntfs_taste(struct g_consumer *cp
     			 *UNICODE to ASCII.
     			 * Should we need to use iconv(9)?
     			 */
    -			for (j = 0; j < atr->a_r.a_datalen; j++) {
    -				vnchar = *(ap + atr->a_r.a_dataoff + j);
    +			for (j = 0; j < atr->a_datalen; j++) {
    +				vnchar = *(ap + atr->a_dataoff + j);
     				if (j & 1) {
     					if (vnchar) {
     						label[0] = 0;
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 18:40:04 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id A97752CA;
     Sat,  2 Mar 2013 18:40:04 +0000 (UTC)
     (envelope-from attilio@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 9B39CD12;
     Sat,  2 Mar 2013 18:40:04 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22Ie4c5096795;
     Sat, 2 Mar 2013 18:40:04 GMT (envelope-from attilio@svn.freebsd.org)
    Received: (from attilio@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22Ie4ro096794;
     Sat, 2 Mar 2013 18:40:04 GMT (envelope-from attilio@svn.freebsd.org)
    Message-Id: <201303021840.r22Ie4ro096794@svn.freebsd.org>
    From: Attilio Rao 
    Date: Sat, 2 Mar 2013 18:40:04 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247665 - in head: . lib/libprocstat sbin/mount_ntfs
     sys/fs/ntfs sys/modules/ntfs sys/modules/ntfs_iconv
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 18:40:04 -0000
    
    Author: attilio
    Date: Sat Mar  2 18:40:04 2013
    New Revision: 247665
    URL: http://svnweb.freebsd.org/changeset/base/247665
    
    Log:
      Garbage collect NTFS bits which are now completely disconnected from
      the tree since few months.
      
      This patch is not targeted for MFC.
    
    Deleted:
      head/lib/libprocstat/ntfs.c
      head/sbin/mount_ntfs/
      head/sys/fs/ntfs/
      head/sys/modules/ntfs/
      head/sys/modules/ntfs_iconv/
    Modified:
      head/ObsoleteFiles.inc
    
    Modified: head/ObsoleteFiles.inc
    ==============================================================================
    --- head/ObsoleteFiles.inc	Sat Mar  2 18:38:29 2013	(r247664)
    +++ head/ObsoleteFiles.inc	Sat Mar  2 18:40:04 2013	(r247665)
    @@ -38,6 +38,16 @@
     #   xargs -n1 | sort | uniq -d;
     # done
     
    +# 20130302: NTFS support removed
    +OLD_FILES+=usr/include/fs/ntfs/ntfs.h
    +OLD_FILES+=usr/include/fs/ntfs/ntfs_compr.h
    +OLD_FILES+=usr/include/fs/ntfs/ntfs_ihash.h
    +OLD_FILES+=usr/include/fs/ntfs/ntfs_inode.h
    +OLD_FILES+=usr/include/fs/ntfs/ntfs_subr.h
    +OLD_FILES+=usr/include/fs/ntfs/ntfs_vfsops.h
    +OLD_FILES+=usr/include/fs/ntfs/ntfsmount.h
    +OLD_DIRS+=usr/include/fs/ntfs
    +OLD_FILES+=usr/share/man/man8/mount_ntfs.8.gz
     # 20130302: PORTALFS support removed
     OLD_FILES+=usr/include/fs/portalfs/portal.h
     OLD_DIRS+=usr/include/fs/portalfs
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 18:51:27 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 1FDAA987;
     Sat,  2 Mar 2013 18:51:27 +0000 (UTC)
     (envelope-from melifaro@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 0307DDB6;
     Sat,  2 Mar 2013 18:51:27 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22IpQgs001548;
     Sat, 2 Mar 2013 18:51:26 GMT (envelope-from melifaro@svn.freebsd.org)
    Received: (from melifaro@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22IpQK4001547;
     Sat, 2 Mar 2013 18:51:26 GMT (envelope-from melifaro@svn.freebsd.org)
    Message-Id: <201303021851.r22IpQK4001547@svn.freebsd.org>
    From: "Alexander V. Chernikov" 
    Date: Sat, 2 Mar 2013 18:51:26 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247666 - head/sbin/ipfw
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 18:51:27 -0000
    
    Author: melifaro
    Date: Sat Mar  2 18:51:26 2013
    New Revision: 247666
    URL: http://svnweb.freebsd.org/changeset/base/247666
    
    Log:
      Fix ipfw table argument parsing/printing.
      Fix style.
      
      PR:		kern/175909
      Submitted by:	Daniel Hagerty 
      MFC after:	2 weeks
    
    Modified:
      head/sbin/ipfw/ipfw2.c
    
    Modified: head/sbin/ipfw/ipfw2.c
    ==============================================================================
    --- head/sbin/ipfw/ipfw2.c	Sat Mar  2 18:40:04 2013	(r247665)
    +++ head/sbin/ipfw/ipfw2.c	Sat Mar  2 18:51:26 2013	(r247666)
    @@ -3912,6 +3912,7 @@ ipfw_flush(int force)
     
     
     static void table_list(uint16_t num, int need_header);
    +static void table_fill_xentry(char *arg, ipfw_table_xentry *xent);
     
     /*
      * This one handles all table-related commands
    @@ -3927,8 +3928,7 @@ ipfw_table_handler(int ac, char *av[])
     	int do_add;
     	int is_all;
     	size_t len;
    -	char *p;
    -	uint32_t a, type, mask, addrlen;
    +	uint32_t a, mask;
     	uint32_t tables_max;
     
     	mask = 0;	// XXX uninitialized ?
    @@ -3965,57 +3965,8 @@ ipfw_table_handler(int ac, char *av[])
     		ac--; av++;
     		if (!ac)
     			errx(EX_USAGE, "address required");
    -		/* 
    -		 * Let's try to guess type by agrument.
    -		 * Possible types: 
    -		 * 1) IPv4[/mask]
    -		 * 2) IPv6[/mask]
    -		 * 3) interface name
    -		 * 4) port ?
    -		 */
    -		type = 0;
    -		if (ishexnumber(*av[0])) {
    -			/* Remove / if exists */
    -			if ((p = strchr(*av, '/')) != NULL) {
    -				*p = '\0';
    -				mask = atoi(p + 1);
    -			}
    -
    -			if (inet_pton(AF_INET, *av, &xent.k.addr6) == 1) {
    -				type = IPFW_TABLE_CIDR;
    -				if ((p != NULL) && (mask > 32))
    -					errx(EX_DATAERR, "bad IPv4 mask width: %s", p + 1);
    -				xent.masklen = p ? mask : 32;
    -				addrlen = sizeof(struct in_addr);
    -			} else if (inet_pton(AF_INET6, *av, &xent.k.addr6) == 1) {
    -				type = IPFW_TABLE_CIDR;
    -				if ((p != NULL) && (mask > 128))
    -					errx(EX_DATAERR, "bad IPv6 mask width: %s", p + 1);
    -				xent.masklen = p ? mask : 128;
    -				addrlen = sizeof(struct in6_addr);
    -			}
    -		}
    -
    -		if ((type == 0) && (strchr(*av, '.') == NULL)) {
    -			/* Assume interface name. Copy significant data only */
    -			mask = MIN(strlen(*av), IF_NAMESIZE - 1);
    -			memcpy(xent.k.iface, *av, mask);
    -			/* Set mask to exact match */
    -			xent.masklen = 8 * IF_NAMESIZE;
    -			type = IPFW_TABLE_INTERFACE;
    -			addrlen = IF_NAMESIZE;
    -		}
     
    -		if (type == 0) {
    -			if (lookup_host(*av, (struct in_addr *)&xent.k.addr6) != 0)
    -				errx(EX_NOHOST, "hostname ``%s'' unknown", *av);
    -			xent.masklen = 32;
    -			type = IPFW_TABLE_CIDR;
    -			addrlen = sizeof(struct in_addr);
    -		}
    -
    -		xent.type = type;
    -		xent.len = offsetof(ipfw_table_xentry, k) + addrlen;
    +		table_fill_xentry(*av, &xent);
     
     		ac--; av++;
     		if (do_add && ac) {
    @@ -4065,6 +4016,93 @@ ipfw_table_handler(int ac, char *av[])
     }
     
     static void
    +table_fill_xentry(char *arg, ipfw_table_xentry *xent)
    +{
    +	int addrlen, mask, masklen, type;
    +	struct in6_addr *paddr;
    +	uint32_t *pkey;
    +	char *p;
    +	uint32_t key;
    +
    +	mask = 0;
    +	type = 0;
    +	addrlen = 0;
    +	masklen = 0;
    +
    +	/* 
    +	 * Let's try to guess type by agrument.
    +	 * Possible types: 
    +	 * 1) IPv4[/mask]
    +	 * 2) IPv6[/mask]
    +	 * 3) interface name
    +	 * 4) port, uid/gid or other u32 key (base 10 format)
    +	 * 5) hostname
    +	 */
    +	paddr = &xent->k.addr6;
    +	if (ishexnumber(*arg) != 0 || *arg == ':') {
    +		/* Remove / if exists */
    +		if ((p = strchr(arg, '/')) != NULL) {
    +			*p = '\0';
    +			mask = atoi(p + 1);
    +		}
    +
    +		if (inet_pton(AF_INET, arg, paddr) == 1) {
    +			if (p != NULL && mask > 32)
    +				errx(EX_DATAERR, "bad IPv4 mask width: %s",
    +				    p + 1);
    +
    +			type = IPFW_TABLE_CIDR;
    +			masklen = p ? mask : 32;
    +			addrlen = sizeof(struct in_addr);
    +		} else if (inet_pton(AF_INET6, arg, paddr) == 1) {
    +			if (IN6_IS_ADDR_V4COMPAT(paddr))
    +				errx(EX_DATAERR,
    +				    "Use IPv4 instead of v4-compatible");
    +			if (p != NULL && mask > 128)
    +				errx(EX_DATAERR, "bad IPv6 mask width: %s",
    +				    p + 1);
    +
    +			type = IPFW_TABLE_CIDR;
    +			masklen = p ? mask : 128;
    +			addrlen = sizeof(struct in6_addr);
    +		} else {
    +			/* Port or any other key */
    +			key = strtol(arg, &p, 10);
    +			/* Skip non-base 10 entries like 'fa1' */
    +			if (p != arg) {
    +				pkey = (uint32_t *)paddr;
    +				*pkey = htonl(key);
    +				type = IPFW_TABLE_CIDR;
    +				addrlen = sizeof(uint32_t);
    +			}
    +		}
    +	}
    +
    +	if (type == 0 && strchr(arg, '.') == NULL) {
    +		/* Assume interface name. Copy significant data only */
    +		mask = MIN(strlen(arg), IF_NAMESIZE - 1);
    +		memcpy(xent->k.iface, arg, mask);
    +		/* Set mask to exact match */
    +		masklen = 8 * IF_NAMESIZE;
    +		type = IPFW_TABLE_INTERFACE;
    +		addrlen = IF_NAMESIZE;
    +	}
    +
    +	if (type == 0) {
    +		if (lookup_host(arg, (struct in_addr *)paddr) != 0)
    +			errx(EX_NOHOST, "hostname ``%s'' unknown", arg);
    +
    +		masklen = 32;
    +		type = IPFW_TABLE_CIDR;
    +		addrlen = sizeof(struct in_addr);
    +	}
    +
    +	xent->type = type;
    +	xent->masklen = masklen;
    +	xent->len = offsetof(ipfw_table_xentry, k) + addrlen;
    +}
    +
    +static void
     table_list(uint16_t num, int need_header)
     {
     	ipfw_xtable *tbl;
    @@ -4107,8 +4145,8 @@ table_list(uint16_t num, int need_header
     			tval = xent->value;
     			addr6 = &xent->k.addr6;
     
    -			if ((addr6->s6_addr32[0] == 0) && (addr6->s6_addr32[1] == 0) && 
    -			    (addr6->s6_addr32[2] == 0)) {
    +
    +			if (IN6_IS_ADDR_V4COMPAT(addr6)) {
     				/* IPv4 address */
     				inet_ntop(AF_INET, &addr6->s6_addr32[3], tbuf, sizeof(tbuf));
     			} else {
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 21:11:35 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 9A72B8BF;
     Sat,  2 Mar 2013 21:11:35 +0000 (UTC) (envelope-from pjd@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 6DCE1273;
     Sat,  2 Mar 2013 21:11:35 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22LBZix045616;
     Sat, 2 Mar 2013 21:11:35 GMT (envelope-from pjd@svn.freebsd.org)
    Received: (from pjd@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22LBVEd045583;
     Sat, 2 Mar 2013 21:11:31 GMT (envelope-from pjd@svn.freebsd.org)
    Message-Id: <201303022111.r22LBVEd045583@svn.freebsd.org>
    From: Pawel Jakub Dawidek 
    Date: Sat, 2 Mar 2013 21:11:31 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247667 - in head: contrib/openbsm/etc lib/libc/sys
     sys/bsm sys/compat/freebsd32 sys/kern sys/security/audit sys/sys
     usr.bin/procstat
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 21:11:35 -0000
    
    Author: pjd
    Date: Sat Mar  2 21:11:30 2013
    New Revision: 247667
    URL: http://svnweb.freebsd.org/changeset/base/247667
    
    Log:
      - Implement two new system calls:
      
      	int bindat(int fd, int s, const struct sockaddr *addr, socklen_t addrlen);
      	int connectat(int fd, int s, const struct sockaddr *name, socklen_t namelen);
      
        which allow to bind and connect respectively to a UNIX domain socket with a
        path relative to the directory associated with the given file descriptor 'fd'.
      
      - Add manual pages for the new syscalls.
      
      - Make the new syscalls available for processes in capability mode sandbox.
      
      - Add capability rights CAP_BINDAT and CAP_CONNECTAT that has to be present on
        the directory descriptor for the syscalls to work.
      
      - Update audit(4) to support those two new syscalls and to handle path
        in sockaddr_un structure relative to the given directory descriptor.
      
      - Update procstat(1) to recognize the new capability rights.
      
      - Document the new capability rights in cap_rights_limit(2).
      
      Sponsored by:	The FreeBSD Foundation
      Discussed with:	rwatson, jilles, kib, des
    
    Added:
      head/lib/libc/sys/bindat.2   (contents, props changed)
      head/lib/libc/sys/connectat.2   (contents, props changed)
    Modified:
      head/contrib/openbsm/etc/audit_event
      head/lib/libc/sys/Makefile.inc
      head/lib/libc/sys/Symbol.map
      head/lib/libc/sys/cap_rights_limit.2
      head/sys/bsm/audit_kevents.h
      head/sys/compat/freebsd32/syscalls.master
      head/sys/kern/capabilities.conf
      head/sys/kern/syscalls.master
      head/sys/kern/uipc_domain.c
      head/sys/kern/uipc_socket.c
      head/sys/kern/uipc_syscalls.c
      head/sys/kern/uipc_usrreq.c
      head/sys/security/audit/audit.h
      head/sys/security/audit/audit_arg.c
      head/sys/security/audit/audit_bsm.c
      head/sys/sys/capability.h
      head/sys/sys/protosw.h
      head/sys/sys/socket.h
      head/sys/sys/socketvar.h
      head/usr.bin/procstat/procstat_files.c
    
    Modified: head/contrib/openbsm/etc/audit_event
    ==============================================================================
    --- head/contrib/openbsm/etc/audit_event	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/contrib/openbsm/etc/audit_event	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -568,6 +568,8 @@
     43204:AUE_CAP_IOCTLS_GET:cap_ioctls_get(2):fm
     43205:AUE_CAP_FCNTLS_LIMIT:cap_fcntls_limit(2):fm
     43206:AUE_CAP_FCNTLS_GET:cap_fcntls_get(2):fm
    +43207:AUE_BINDAT:bindat(2):nt
    +43208:AUE_CONNECTAT:connectat(2):nt
     #
     # Solaris userspace events.
     #
    
    Modified: head/lib/libc/sys/Makefile.inc
    ==============================================================================
    --- head/lib/libc/sys/Makefile.inc	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/lib/libc/sys/Makefile.inc	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -91,6 +91,7 @@ MAN+=	abort2.2 \
     	aio_waitcomplete.2 \
     	aio_write.2 \
     	bind.2 \
    +	bindat.2 \
     	brk.2 \
     	cap_enter.2 \
     	cap_fcntls_limit.2 \
    @@ -105,6 +106,7 @@ MAN+=	abort2.2 \
     	close.2 \
     	closefrom.2 \
     	connect.2 \
    +	connectat.2 \
     	cpuset.2 \
     	cpuset_getaffinity.2 \
     	dup.2 \
    
    Modified: head/lib/libc/sys/Symbol.map
    ==============================================================================
    --- head/lib/libc/sys/Symbol.map	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/lib/libc/sys/Symbol.map	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -378,6 +378,7 @@ FBSD_1.2 {
     };
     
     FBSD_1.3 {
    +	bindat;
     	cap_fcntls_get;
     	cap_fcntls_limit;
     	cap_ioctls_get;
    @@ -386,6 +387,7 @@ FBSD_1.3 {
     	cap_rights_limit;
     	cap_sandboxed;
     	clock_getcpuclockid2;
    +	connectat;
     	ffclock_getcounter;
     	ffclock_getestimate;
     	ffclock_setestimate;
    
    Added: head/lib/libc/sys/bindat.2
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/lib/libc/sys/bindat.2	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -0,0 +1,109 @@
    +.\" Copyright (c) 2013 The FreeBSD Foundation
    +.\" All rights reserved.
    +.\"
    +.\" This documentation was written by Pawel Jakub Dawidek under sponsorship from
    +.\" the FreeBSD Foundation.
    +.\"
    +.\" Redistribution and use in source and binary forms, with or without
    +.\" modification, are permitted provided that the following conditions
    +.\" are met:
    +.\" 1. Redistributions of source code must retain the above copyright
    +.\"    notice, this list of conditions and the following disclaimer.
    +.\" 2. Redistributions in binary form must reproduce the above copyright
    +.\"    notice, this list of conditions and the following disclaimer in the
    +.\"    documentation and/or other materials provided with the distribution.
    +.\"
    +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
    +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    +.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
    +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    +.\" SUCH DAMAGE.
    +.\"
    +.\" $FreeBSD$
    +.\"
    +.Dd February 13, 2013
    +.Dt BINDAT 2
    +.Os
    +.Sh NAME
    +.Nm bindat
    +.Nd assign a local protocol address to a socket
    +.Sh LIBRARY
    +.Lb libc
    +.Sh SYNOPSIS
    +.In sys/types.h
    +.In sys/socket.h
    +.Pp
    +.In fcntl.h
    +.Ft int
    +.Fn bindat "int fd" "int s" "const struct sockaddr *addr" "socklen_t addrlen"
    +.Sh DESCRIPTION
    +The
    +.Fn bindat
    +system call assigns the local protocol address to a socket.
    +It works just like the
    +.Xr bind 2
    +system call with two exceptions:
    +.Pp
    +.Bl -enum -offset indent -compact
    +.It
    +It is limited to sockets in the PF_LOCAL domain.
    +.Pp
    +.It
    +If the file path stored in the
    +.Fa sun_path
    +field of the sockaddr_un structure is a relative path, it is located relative
    +to the directory associated with the file descriptor
    +.Fa fd .
    +If
    +.Fn bindat
    +is passed the special value
    +.Dv AT_FDCWD
    +in the
    +.Fa fd
    +parameter, the current working directory is used and the behavior is identical
    +to a call to
    +.Xr bind 2 .
    +.El
    +.Sh RETURN VALUES
    +.Rv -std bindat
    +.Sh ERRORS
    +The
    +.Fn bindat
    +system call may fail with the same errors as the
    +.Xr bind 2
    +system call for a UNIX domain socket or with the following errors:
    +.Bl -tag -width Er
    +.It Bq Er EBADF
    +The
    +.Fa sun_path
    +field does not specify an absolute path and the
    +.Fa fd
    +argument is neither
    +.Dv AT_FDCWD
    +nor a valid file descriptor.
    +.It Bq Er ENOTDIR
    +The
    +.Fa sun_path
    +field is not an absolute path and
    +.Fa fd
    +is neither
    +.Dv AT_FDCWD
    +nor a file descriptor associated with a directory.
    +.El
    +.Sh SEE ALSO
    +.Xr bind 2 ,
    +.Xr connectat 2 ,
    +.Xr socket 2 ,
    +.Xr unix 4
    +.Sh AUTHORS
    +The
    +.Nm
    +was developed by
    +.An Pawel Jakub Dawidek Aq pawel@dawidek.net
    +under sponsorship from the FreeBSD Foundation.
    
    Modified: head/lib/libc/sys/cap_rights_limit.2
    ==============================================================================
    --- head/lib/libc/sys/cap_rights_limit.2	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/lib/libc/sys/cap_rights_limit.2	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -104,12 +104,20 @@ or
     and that socket options set with
     .Xr setsockopt 2
     may also affect binding behavior.
    +.It Dv CAP_BINDAT
    +Permit
    +.Xr bindat 2 .
    +This right has to be present on the directory descriptor.
     .It Dv CAP_CONNECT
     Permit
     .Xr connect 2 ;
     also required for
     .Xr sendto 2
     with a non-NULL destination address.
    +.It Dv CAP_CONNECTAT
    +Permit
    +.Xr connectat 2 .
    +This right has to be present on the directory descriptor.
     .It Dv CAP_CREATE
     Permit
     .Xr openat 2
    @@ -511,11 +519,13 @@ argument points at an invalid address.
     .Xr aio_read 2 ,
     .Xr aio_write 2 ,
     .Xr bind 2 ,
    +.Xr bindat 2 ,
     .Xr cap_enter 2 ,
     .Xr cap_fcntls_limit 2 ,
     .Xr cap_ioctls_limit 2 ,
     .Xr cap_rights_limit 2 ,
     .Xr connect 2 ,
    +.Xr connectat 2 ,
     .Xr dup 2 ,
     .Xr dup2 2 ,
     .Xr extattr_delete_fd 2 ,
    
    Added: head/lib/libc/sys/connectat.2
    ==============================================================================
    --- /dev/null	00:00:00 1970	(empty, because file is newly added)
    +++ head/lib/libc/sys/connectat.2	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -0,0 +1,109 @@
    +.\" Copyright (c) 2013 The FreeBSD Foundation
    +.\" All rights reserved.
    +.\"
    +.\" This documentation was written by Pawel Jakub Dawidek under sponsorship from
    +.\" the FreeBSD Foundation.
    +.\"
    +.\" Redistribution and use in source and binary forms, with or without
    +.\" modification, are permitted provided that the following conditions
    +.\" are met:
    +.\" 1. Redistributions of source code must retain the above copyright
    +.\"    notice, this list of conditions and the following disclaimer.
    +.\" 2. Redistributions in binary form must reproduce the above copyright
    +.\"    notice, this list of conditions and the following disclaimer in the
    +.\"    documentation and/or other materials provided with the distribution.
    +.\"
    +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
    +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    +.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
    +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    +.\" SUCH DAMAGE.
    +.\"
    +.\" $FreeBSD$
    +.\"
    +.Dd February 13, 2013
    +.Dt CONNECTAT 2
    +.Os
    +.Sh NAME
    +.Nm connectat
    +.Nd initiate a connection on a socket
    +.Sh LIBRARY
    +.Lb libc
    +.Sh SYNOPSIS
    +.In sys/types.h
    +.In sys/socket.h
    +.Pp
    +.In fcntl.h
    +.Ft int
    +.Fn connectat "int fd" "int s" "const struct sockaddr *name" "socklen_t namelen"
    +.Sh DESCRIPTION
    +The
    +.Fn connectat
    +system call initiates a connection on a socket.
    +It works just like the
    +.Xr connect 2
    +system call with two exceptions:
    +.Pp
    +.Bl -enum -offset indent -compact
    +.It
    +It is limited to sockets in the PF_LOCAL domain.
    +.Pp
    +.It
    +If the file path stored in the
    +.Fa sun_path
    +field of the sockaddr_un structure is a relative path, it is located relative
    +to the directory associated with the file descriptor
    +.Fa fd .
    +If
    +.Fn connectat
    +is passed the special value
    +.Dv AT_FDCWD
    +in the
    +.Fa fd
    +parameter, the current working directory is used and the behavior is identical
    +to a call to
    +.Xr connect 2 .
    +.El
    +.Sh RETURN VALUES
    +.Rv -std connectat
    +.Sh ERRORS
    +The
    +.Fn connectat
    +system call may fail with the same errors as the
    +.Xr connect 2
    +system call for a UNIX domain socket or with the following errors:
    +.Bl -tag -width Er
    +.It Bq Er EBADF
    +The
    +.Fa sun_path
    +field does not specify an absolute path and the
    +.Fa fd
    +argument is neither
    +.Dv AT_FDCWD
    +nor a valid file descriptor.
    +.It Bq Er ENOTDIR
    +The
    +.Fa sun_path
    +field is not an absolute path and
    +.Fa fd
    +is neither
    +.Dv AT_FDCWD
    +nor a file descriptor associated with a directory.
    +.El
    +.Sh SEE ALSO
    +.Xr bindat 2 ,
    +.Xr connect 2 ,
    +.Xr socket 2 ,
    +.Xr unix 4
    +.Sh AUTHORS
    +The
    +.Nm
    +was developed by
    +.An Pawel Jakub Dawidek Aq pawel@dawidek.net
    +under sponsorship from the FreeBSD Foundation.
    
    Modified: head/sys/bsm/audit_kevents.h
    ==============================================================================
    --- head/sys/bsm/audit_kevents.h	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/bsm/audit_kevents.h	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -608,6 +608,8 @@
     #define	AUE_CAP_IOCTLS_GET	43204	/* TrustedBSD. */
     #define	AUE_CAP_FCNTLS_LIMIT	43205	/* TrustedBSD. */
     #define	AUE_CAP_FCNTLS_GET	43206	/* TrustedBSD. */
    +#define	AUE_BINDAT		43207	/* TrustedBSD. */
    +#define	AUE_CONNECTAT		43208	/* TrustedBSD. */
     
     /*
      * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the
    
    Modified: head/sys/compat/freebsd32/syscalls.master
    ==============================================================================
    --- head/sys/compat/freebsd32/syscalls.master	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/compat/freebsd32/syscalls.master	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -1015,3 +1015,7 @@
     				    uint32_t fcntlrights); }
     537	AUE_CAP_FCNTLS_GET	NOPROTO	{ int cap_fcntls_get(int fd, \
     				    uint32_t *fcntlrightsp); }
    +538	AUE_BINDAT	NOPROTO	{ int bindat(int fd, int s, caddr_t name, \
    +				    int namelen); }
    +539	AUE_CONNECTAT	NOPROTO	{ int connectat(int fd, int s, caddr_t name, \
    +				    int namelen); }
    
    Modified: head/sys/kern/capabilities.conf
    ==============================================================================
    --- head/sys/kern/capabilities.conf	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/kern/capabilities.conf	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -100,11 +100,9 @@ aio_write
     #audit
     
     ##
    -## Disllow bind(2) for now, even though we support CAP_BIND.
    +## Allow bindat(2).
     ##
    -## XXXRW: Revisit this.
    -##
    -#bind
    +bindat
     
     ##
     ## Allow capability mode and capability system calls.
    @@ -132,11 +130,9 @@ close
     closefrom
     
     ##
    -## Disallow connect(2) for now, despite CAP_CONNECT.
    -##
    -## XXXRW: Revisit this.
    +## Allow connectat(2).
     ##
    -#connect
    +connectat
     
     ##
     ## cpuset(2) and related calls require scoping by process, but should
    
    Modified: head/sys/kern/syscalls.master
    ==============================================================================
    --- head/sys/kern/syscalls.master	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/kern/syscalls.master	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -965,5 +965,9 @@
     					    uint32_t fcntlrights); }
     537	AUE_CAP_FCNTLS_GET	STD	{ int cap_fcntls_get(int fd, \
     					    uint32_t *fcntlrightsp); }
    +538	AUE_BINDAT	STD	{ int bindat(int fd, int s, caddr_t name, \
    +				    int namelen); }
    +539	AUE_CONNECTAT	STD	{ int connectat(int fd, int s, caddr_t name, \
    +				    int namelen); }
     ; Please copy any additions and changes to the following compatability tables:
     ; sys/compat/freebsd32/syscalls.master
    
    Modified: head/sys/kern/uipc_domain.c
    ==============================================================================
    --- head/sys/kern/uipc_domain.c	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/kern/uipc_domain.c	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -136,8 +136,10 @@ protosw_init(struct protosw *pr)
     #define DEFAULT(foo, bar)	if ((foo) == NULL)  (foo) = (bar)
     	DEFAULT(pu->pru_accept, pru_accept_notsupp);
     	DEFAULT(pu->pru_bind, pru_bind_notsupp);
    +	DEFAULT(pu->pru_bindat, pru_bindat_notsupp);
     	DEFAULT(pu->pru_connect, pru_connect_notsupp);
     	DEFAULT(pu->pru_connect2, pru_connect2_notsupp);
    +	DEFAULT(pu->pru_connectat, pru_connectat_notsupp);
     	DEFAULT(pu->pru_control, pru_control_notsupp);
     	DEFAULT(pu->pru_disconnect, pru_disconnect_notsupp);
     	DEFAULT(pu->pru_listen, pru_listen_notsupp);
    
    Modified: head/sys/kern/uipc_socket.c
    ==============================================================================
    --- head/sys/kern/uipc_socket.c	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/kern/uipc_socket.c	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -615,7 +615,18 @@ sobind(struct socket *so, struct sockadd
     	CURVNET_SET(so->so_vnet);
     	error = (*so->so_proto->pr_usrreqs->pru_bind)(so, nam, td);
     	CURVNET_RESTORE();
    -	return error;
    +	return (error);
    +}
    +
    +int
    +sobindat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td)
    +{
    +	int error;
    +
    +	CURVNET_SET(so->so_vnet);
    +	error = (*so->so_proto->pr_usrreqs->pru_bindat)(fd, so, nam, td);
    +	CURVNET_RESTORE();
    +	return (error);
     }
     
     /*
    @@ -638,7 +649,7 @@ solisten(struct socket *so, int backlog,
     	CURVNET_SET(so->so_vnet);
     	error = (*so->so_proto->pr_usrreqs->pru_listen)(so, backlog, td);
     	CURVNET_RESTORE();
    -	return error;
    +	return (error);
     }
     
     int
    @@ -896,6 +907,13 @@ soaccept(struct socket *so, struct socka
     int
     soconnect(struct socket *so, struct sockaddr *nam, struct thread *td)
     {
    +
    +	return (soconnectat(AT_FDCWD, so, nam, td));
    +}
    +
    +int
    +soconnectat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td)
    +{
     	int error;
     
     	if (so->so_options & SO_ACCEPTCONN)
    @@ -917,7 +935,13 @@ soconnect(struct socket *so, struct sock
     		 * biting us.
     		 */
     		so->so_error = 0;
    -		error = (*so->so_proto->pr_usrreqs->pru_connect)(so, nam, td);
    +		if (fd == AT_FDCWD) {
    +			error = (*so->so_proto->pr_usrreqs->pru_connect)(so,
    +			    nam, td);
    +		} else {
    +			error = (*so->so_proto->pr_usrreqs->pru_connectat)(fd,
    +			    so, nam, td);
    +		}
     	}
     	CURVNET_RESTORE();
     
    @@ -3141,6 +3165,14 @@ pru_bind_notsupp(struct socket *so, stru
     }
     
     int
    +pru_bindat_notsupp(int fd, struct socket *so, struct sockaddr *nam,
    +    struct thread *td)
    +{
    +
    +	return EOPNOTSUPP;
    +}
    +
    +int
     pru_connect_notsupp(struct socket *so, struct sockaddr *nam, struct thread *td)
     {
     
    @@ -3148,6 +3180,14 @@ pru_connect_notsupp(struct socket *so, s
     }
     
     int
    +pru_connectat_notsupp(int fd, struct socket *so, struct sockaddr *nam,
    +    struct thread *td)
    +{
    +
    +	return EOPNOTSUPP;
    +}
    +
    +int
     pru_connect2_notsupp(struct socket *so1, struct socket *so2)
     {
     
    
    Modified: head/sys/kern/uipc_syscalls.c
    ==============================================================================
    --- head/sys/kern/uipc_syscalls.c	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/kern/uipc_syscalls.c	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -201,26 +201,23 @@ sys_bind(td, uap)
     	struct sockaddr *sa;
     	int error;
     
    -	if ((error = getsockaddr(&sa, uap->name, uap->namelen)) != 0)
    -		return (error);
    -
    -	error = kern_bind(td, uap->s, sa);
    -	free(sa, M_SONAME);
    +	error = getsockaddr(&sa, uap->name, uap->namelen);
    +	if (error == 0) {
    +		error = kern_bind(td, uap->s, sa);
    +		free(sa, M_SONAME);
    +	}
     	return (error);
     }
     
    -int
    -kern_bind(td, fd, sa)
    -	struct thread *td;
    -	int fd;
    -	struct sockaddr *sa;
    +static int
    +kern_bindat(struct thread *td, int dirfd, int fd, struct sockaddr *sa)
     {
     	struct socket *so;
     	struct file *fp;
     	int error;
     
     	AUDIT_ARG_FD(fd);
    -	AUDIT_ARG_SOCKADDR(td, sa);
    +	AUDIT_ARG_SOCKADDR(td, dirfd, sa);
     	error = getsock_cap(td->td_proc->p_fd, fd, CAP_BIND, &fp, NULL);
     	if (error)
     		return (error);
    @@ -231,13 +228,48 @@ kern_bind(td, fd, sa)
     #endif
     #ifdef MAC
     	error = mac_socket_check_bind(td->td_ucred, so, sa);
    -	if (error == 0)
    +	if (error == 0) {
    +#endif
    +		if (dirfd == AT_FDCWD)
    +			error = sobind(so, sa, td);
    +		else
    +			error = sobindat(dirfd, so, sa, td);
    +#ifdef MAC
    +	}
     #endif
    -		error = sobind(so, sa, td);
     	fdrop(fp, td);
     	return (error);
     }
     
    +int
    +kern_bind(struct thread *td, int fd, struct sockaddr *sa)
    +{
    +
    +	return (kern_bindat(td, AT_FDCWD, fd, sa));
    +}
    +
    +/* ARGSUSED */
    +int
    +sys_bindat(td, uap)
    +	struct thread *td;
    +	struct bindat_args /* {
    +		int	fd;
    +		int	s;
    +		caddr_t	name;
    +		int	namelen;
    +	} */ *uap;
    +{
    +	struct sockaddr *sa;
    +	int error;
    +
    +	error = getsockaddr(&sa, uap->name, uap->namelen);
    +	if (error == 0) {
    +		error = kern_bindat(td, uap->fd, uap->s, sa);
    +		free(sa, M_SONAME);
    +	}
    +	return (error);
    +}
    +
     /* ARGSUSED */
     int
     sys_listen(td, uap)
    @@ -435,7 +467,7 @@ kern_accept(struct thread *td, int s, st
     			*namelen = 0;
     		goto done;
     	}
    -	AUDIT_ARG_SOCKADDR(td, sa);
    +	AUDIT_ARG_SOCKADDR(td, AT_FDCWD, sa);
     	if (name) {
     		/* check sa_len before it is destroyed */
     		if (*namelen > sa->sa_len)
    @@ -510,20 +542,15 @@ sys_connect(td, uap)
     	int error;
     
     	error = getsockaddr(&sa, uap->name, uap->namelen);
    -	if (error)
    -		return (error);
    -
    -	error = kern_connect(td, uap->s, sa);
    -	free(sa, M_SONAME);
    +	if (error == 0) {
    +		error = kern_connect(td, uap->s, sa);
    +		free(sa, M_SONAME);
    +	}
     	return (error);
     }
     
    -
    -int
    -kern_connect(td, fd, sa)
    -	struct thread *td;
    -	int fd;
    -	struct sockaddr *sa;
    +static int
    +kern_connectat(struct thread *td, int dirfd, int fd, struct sockaddr *sa)
     {
     	struct socket *so;
     	struct file *fp;
    @@ -531,7 +558,7 @@ kern_connect(td, fd, sa)
     	int interrupted = 0;
     
     	AUDIT_ARG_FD(fd);
    -	AUDIT_ARG_SOCKADDR(td, sa);
    +	AUDIT_ARG_SOCKADDR(td, dirfd, sa);
     	error = getsock_cap(td->td_proc->p_fd, fd, CAP_CONNECT, &fp, NULL);
     	if (error)
     		return (error);
    @@ -549,7 +576,10 @@ kern_connect(td, fd, sa)
     	if (error)
     		goto bad;
     #endif
    -	error = soconnect(so, sa, td);
    +	if (dirfd == AT_FDCWD)
    +		error = soconnect(so, sa, td);
    +	else
    +		error = soconnectat(dirfd, so, sa, td);
     	if (error)
     		goto bad;
     	if ((so->so_state & SS_NBIO) && (so->so_state & SS_ISCONNECTING)) {
    @@ -582,6 +612,35 @@ done1:
     }
     
     int
    +kern_connect(struct thread *td, int fd, struct sockaddr *sa)
    +{
    +
    +	return (kern_connectat(td, AT_FDCWD, fd, sa));
    +}
    +
    +/* ARGSUSED */
    +int
    +sys_connectat(td, uap)
    +	struct thread *td;
    +	struct connectat_args /* {
    +		int	fd;
    +		int	s;
    +		caddr_t	name;
    +		int	namelen;
    +	} */ *uap;
    +{
    +	struct sockaddr *sa;
    +	int error;
    +
    +	error = getsockaddr(&sa, uap->name, uap->namelen);
    +	if (error == 0) {
    +		error = kern_connectat(td, uap->fd, uap->s, sa);
    +		free(sa, M_SONAME);
    +	}
    +	return (error);
    +}
    +
    +int
     kern_socketpair(struct thread *td, int domain, int type, int protocol,
         int *rsv)
     {
    @@ -749,7 +808,7 @@ kern_sendit(td, s, mp, flags, control, s
     	AUDIT_ARG_FD(s);
     	rights = CAP_SEND;
     	if (mp->msg_name != NULL) {
    -		AUDIT_ARG_SOCKADDR(td, mp->msg_name);
    +		AUDIT_ARG_SOCKADDR(td, AT_FDCWD, mp->msg_name);
     		rights |= CAP_CONNECT;
     	}
     	error = getsock_cap(td->td_proc->p_fd, s, rights, &fp, NULL);
    @@ -997,7 +1056,7 @@ kern_recvit(td, s, mp, fromseg, controlp
     			error = 0;
     	}
     	if (fromsa != NULL)
    -		AUDIT_ARG_SOCKADDR(td, fromsa);
    +		AUDIT_ARG_SOCKADDR(td, AT_FDCWD, fromsa);
     #ifdef KTRACE
     	if (ktruio != NULL) {
     		ktruio->uio_resid = len - auio.uio_resid;
    
    Modified: head/sys/kern/uipc_usrreq.c
    ==============================================================================
    --- head/sys/kern/uipc_usrreq.c	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/kern/uipc_usrreq.c	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$");
     #include "opt_ddb.h"
     
     #include 
    +#include 
     #include 
     #include 
     #include 		/* XXX must be before  */
    @@ -271,6 +272,8 @@ static int	uipc_connect2(struct socket *
     static int	uipc_ctloutput(struct socket *, struct sockopt *);
     static int	unp_connect(struct socket *, struct sockaddr *,
     		    struct thread *);
    +static int	unp_connectat(int, struct socket *, struct sockaddr *,
    +		    struct thread *);
     static int	unp_connect2(struct socket *so, struct socket *so2, int);
     static void	unp_disconnect(struct unpcb *unp, struct unpcb *unp2);
     static void	unp_dispose(struct mbuf *);
    @@ -450,7 +453,7 @@ uipc_attach(struct socket *so, int proto
     }
     
     static int
    -uipc_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
    +uipc_bindat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td)
     {
     	struct sockaddr_un *soun = (struct sockaddr_un *)nam;
     	struct vattr vattr;
    @@ -496,8 +499,8 @@ uipc_bind(struct socket *so, struct sock
     	buf[namelen] = 0;
     
     restart:
    -	NDINIT(&nd, CREATE, NOFOLLOW | LOCKPARENT | SAVENAME,
    -	    UIO_SYSSPACE, buf, td);
    +	NDINIT_ATRIGHTS(&nd, CREATE, NOFOLLOW | LOCKPARENT | SAVENAME,
    +	    UIO_SYSSPACE, buf, fd, CAP_BINDAT, td);
     /* SHOULD BE ABLE TO ADOPT EXISTING AND wakeup() ALA FIFO's */
     	error = namei(&nd);
     	if (error)
    @@ -560,6 +563,13 @@ error:
     }
     
     static int
    +uipc_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
    +{
    +
    +	return (uipc_bindat(AT_FDCWD, so, nam, td));
    +}
    +
    +static int
     uipc_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
     {
     	int error;
    @@ -571,6 +581,19 @@ uipc_connect(struct socket *so, struct s
     	return (error);
     }
     
    +static int
    +uipc_connectat(int fd, struct socket *so, struct sockaddr *nam,
    +    struct thread *td)
    +{
    +	int error;
    +
    +	KASSERT(td == curthread, ("uipc_connectat: td != curthread"));
    +	UNP_LINK_WLOCK();
    +	error = unp_connectat(fd, so, nam, td);
    +	UNP_LINK_WUNLOCK();
    +	return (error);
    +}
    +
     static void
     uipc_close(struct socket *so)
     {
    @@ -1081,7 +1104,9 @@ static struct pr_usrreqs uipc_usrreqs_dg
     	.pru_accept =		uipc_accept,
     	.pru_attach =		uipc_attach,
     	.pru_bind =		uipc_bind,
    +	.pru_bindat =		uipc_bindat,
     	.pru_connect =		uipc_connect,
    +	.pru_connectat =	uipc_connectat,
     	.pru_connect2 =		uipc_connect2,
     	.pru_detach =		uipc_detach,
     	.pru_disconnect =	uipc_disconnect,
    @@ -1101,7 +1126,9 @@ static struct pr_usrreqs uipc_usrreqs_se
     	.pru_accept =		uipc_accept,
     	.pru_attach =		uipc_attach,
     	.pru_bind =		uipc_bind,
    +	.pru_bindat =		uipc_bindat,
     	.pru_connect =		uipc_connect,
    +	.pru_connectat =	uipc_connectat,
     	.pru_connect2 =		uipc_connect2,
     	.pru_detach =		uipc_detach,
     	.pru_disconnect =	uipc_disconnect,
    @@ -1121,7 +1148,9 @@ static struct pr_usrreqs uipc_usrreqs_st
     	.pru_accept =		uipc_accept,
     	.pru_attach =		uipc_attach,
     	.pru_bind =		uipc_bind,
    +	.pru_bindat =		uipc_bindat,
     	.pru_connect =		uipc_connect,
    +	.pru_connectat =	uipc_connectat,
     	.pru_connect2 =		uipc_connect2,
     	.pru_detach =		uipc_detach,
     	.pru_disconnect =	uipc_disconnect,
    @@ -1233,6 +1262,14 @@ uipc_ctloutput(struct socket *so, struct
     static int
     unp_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
     {
    +
    +	return (unp_connectat(AT_FDCWD, so, nam, td));
    +}
    +
    +static int
    +unp_connectat(int fd, struct socket *so, struct sockaddr *nam,
    +    struct thread *td)
    +{
     	struct sockaddr_un *soun = (struct sockaddr_un *)nam;
     	struct vnode *vp;
     	struct socket *so2, *so3;
    @@ -1265,8 +1302,8 @@ unp_connect(struct socket *so, struct so
     	UNP_PCB_UNLOCK(unp);
     
     	sa = malloc(sizeof(struct sockaddr_un), M_SONAME, M_WAITOK);
    -	NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF,
    -	    UIO_SYSSPACE, buf, td);
    +	NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF,
    +	    UIO_SYSSPACE, buf, fd, CAP_CONNECTAT, td);
     	error = namei(&nd);
     	if (error)
     		vp = NULL;
    
    Modified: head/sys/security/audit/audit.h
    ==============================================================================
    --- head/sys/security/audit/audit.h	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/security/audit/audit.h	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -95,7 +95,7 @@ void	 audit_arg_pid(pid_t pid);
     void	 audit_arg_process(struct proc *p);
     void	 audit_arg_signum(u_int signum);
     void	 audit_arg_socket(int sodomain, int sotype, int soprotocol);
    -void	 audit_arg_sockaddr(struct thread *td, struct sockaddr *sa);
    +void	 audit_arg_sockaddr(struct thread *td, int dirfd, struct sockaddr *sa);
     void	 audit_arg_auid(uid_t auid);
     void	 audit_arg_auditinfo(struct auditinfo *au_info);
     void	 audit_arg_auditinfo_addr(struct auditinfo_addr *au_info);
    @@ -267,9 +267,9 @@ void	 audit_thread_free(struct thread *t
     		audit_arg_socket((sodomain), (sotype), (soprotocol));	\
     } while (0)
     
    -#define	AUDIT_ARG_SOCKADDR(td, sa) do {					\
    +#define	AUDIT_ARG_SOCKADDR(td, dirfd, sa) do {				\
     	if (AUDITING_TD(curthread))					\
    -		audit_arg_sockaddr((td), (sa));				\
    +		audit_arg_sockaddr((td), (dirfd), (sa));		\
     } while (0)
     
     #define	AUDIT_ARG_SUID(suid) do {					\
    @@ -365,7 +365,7 @@ void	 audit_thread_free(struct thread *t
     #define	AUDIT_ARG_SIGNUM(signum)
     #define	AUDIT_ARG_SGID(sgid)
     #define	AUDIT_ARG_SOCKET(sodomain, sotype, soprotocol)
    -#define	AUDIT_ARG_SOCKADDR(td, sa)
    +#define	AUDIT_ARG_SOCKADDR(td, dirfd, sa)
     #define	AUDIT_ARG_SUID(suid)
     #define	AUDIT_ARG_TEXT(text)
     #define	AUDIT_ARG_UID(uid)
    
    Modified: head/sys/security/audit/audit_arg.c
    ==============================================================================
    --- head/sys/security/audit/audit_arg.c	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/security/audit/audit_arg.c	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -441,7 +441,7 @@ audit_arg_socket(int sodomain, int sotyp
     }
     
     void
    -audit_arg_sockaddr(struct thread *td, struct sockaddr *sa)
    +audit_arg_sockaddr(struct thread *td, int dirfd, struct sockaddr *sa)
     {
     	struct kaudit_record *ar;
     
    @@ -463,7 +463,9 @@ audit_arg_sockaddr(struct thread *td, st
     		break;
     
     	case AF_UNIX:
    -		audit_arg_upath1(td, AT_FDCWD,
    +		if (dirfd != AT_FDCWD)
    +			audit_arg_atfd1(dirfd);
    +		audit_arg_upath1(td, dirfd,
     		    ((struct sockaddr_un *)sa)->sun_path);
     		ARG_SET_VALID(ar, ARG_SADDRUNIX);
     		break;
    
    Modified: head/sys/security/audit/audit_bsm.c
    ==============================================================================
    --- head/sys/security/audit/audit_bsm.c	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/security/audit/audit_bsm.c	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -554,6 +554,21 @@ kaudit_to_bsm(struct kaudit_record *kar,
     		/* XXX Need to handle ARG_SADDRINET6 */
     		break;
     
    +	case AUE_BINDAT:
    +	case AUE_CONNECTAT:
    +		ATFD1_TOKENS(1);
    +		if (ARG_IS_VALID(kar, ARG_FD)) {
    +			tok = au_to_arg32(2, "fd", ar->ar_arg_fd);
    +			kau_write(rec, tok);
    +		}
    +		if (ARG_IS_VALID(kar, ARG_SADDRUNIX)) {
    +			tok = au_to_sock_unix((struct sockaddr_un *)
    +			    &ar->ar_arg_sockaddr);
    +			kau_write(rec, tok);
    +			UPATH1_TOKENS;
    +		}
    +		break;
    +
     	case AUE_SOCKET:
     	case AUE_SOCKETPAIR:
     		if (ARG_IS_VALID(kar, ARG_SOCKINFO)) {
    
    Modified: head/sys/sys/capability.h
    ==============================================================================
    --- head/sys/sys/capability.h	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/sys/capability.h	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -182,13 +182,18 @@
     #define	CAP_PDWAIT		0x0020000000000000ULL
     #define	CAP_PDKILL		0x0040000000000000ULL
     
    +/*
    + * Rights that allow to use bindat(2) and connectat(2) syscalls on a
    + * directory descriptor.
    + */
    +#define	CAP_BINDAT		0x0400000000000000ULL
    +#define	CAP_CONNECTAT		0x0800000000000000ULL
    +
     /* The mask of all valid method rights. */
    -#define	CAP_MASK_VALID		0x03ffffffffffffffULL
    +#define	CAP_MASK_VALID		0x0fffffffffffffffULL
     #define	CAP_ALL			CAP_MASK_VALID
     
     /* Available bits. */
    -#define	CAP_UNUSED5		0x0400000000000000ULL
    -#define	CAP_UNUSED4		0x0800000000000000ULL
     #define	CAP_UNUSED3		0x1000000000000000ULL
     #define	CAP_UNUSED2		0x2000000000000000ULL
     #define	CAP_UNUSED1		0x4000000000000000ULL
    
    Modified: head/sys/sys/protosw.h
    ==============================================================================
    --- head/sys/sys/protosw.h	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/sys/protosw.h	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -223,6 +223,10 @@ struct pr_usrreqs {
     		    struct ucred *cred, struct thread *td);
     	void	(*pru_sosetlabel)(struct socket *so);
     	void	(*pru_close)(struct socket *so);
    +	int	(*pru_bindat)(int fd, struct socket *so, struct sockaddr *nam,
    +		    struct thread *td);
    +	int	(*pru_connectat)(int fd, struct socket *so,
    +		    struct sockaddr *nam, struct thread *td);
     };
     
     /*
    @@ -232,8 +236,12 @@ int	pru_accept_notsupp(struct socket *so
     int	pru_attach_notsupp(struct socket *so, int proto, struct thread *td);
     int	pru_bind_notsupp(struct socket *so, struct sockaddr *nam,
     	    struct thread *td);
    +int	pru_bindat_notsupp(int fd, struct socket *so, struct sockaddr *nam,
    +	    struct thread *td);
     int	pru_connect_notsupp(struct socket *so, struct sockaddr *nam,
     	    struct thread *td);
    +int	pru_connectat_notsupp(int fd, struct socket *so, struct sockaddr *nam,
    +	    struct thread *td);
     int	pru_connect2_notsupp(struct socket *so1, struct socket *so2);
     int	pru_control_notsupp(struct socket *so, u_long cmd, caddr_t data,
     	    struct ifnet *ifp, struct thread *td);
    
    Modified: head/sys/sys/socket.h
    ==============================================================================
    --- head/sys/sys/socket.h	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/sys/socket.h	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -620,7 +620,9 @@ struct sf_hdtr {
     __BEGIN_DECLS
     int	accept(int, struct sockaddr * __restrict, socklen_t * __restrict);
     int	bind(int, const struct sockaddr *, socklen_t);
    +int	bindat(int, int, const struct sockaddr *, socklen_t);
     int	connect(int, const struct sockaddr *, socklen_t);
    +int	connectat(int, int, const struct sockaddr *, socklen_t);
     int	getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict);
     int	getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict);
     int	getsockopt(int, int, int, void * __restrict, socklen_t * __restrict);
    
    Modified: head/sys/sys/socketvar.h
    ==============================================================================
    --- head/sys/sys/socketvar.h	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/sys/sys/socketvar.h	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -318,8 +318,12 @@ void	soabort(struct socket *so);
     int	soaccept(struct socket *so, struct sockaddr **nam);
     int	socheckuid(struct socket *so, uid_t uid);
     int	sobind(struct socket *so, struct sockaddr *nam, struct thread *td);
    +int	sobindat(int fd, struct socket *so, struct sockaddr *nam,
    +	    struct thread *td);
     int	soclose(struct socket *so);
     int	soconnect(struct socket *so, struct sockaddr *nam, struct thread *td);
    +int	soconnectat(int fd, struct socket *so, struct sockaddr *nam,
    +	    struct thread *td);
     int	soconnect2(struct socket *so1, struct socket *so2);
     int	socow_setup(struct mbuf *m0, struct uio *uio);
     int	socreate(int dom, struct socket **aso, int type, int proto,
    
    Modified: head/usr.bin/procstat/procstat_files.c
    ==============================================================================
    --- head/usr.bin/procstat/procstat_files.c	Sat Mar  2 18:51:26 2013	(r247666)
    +++ head/usr.bin/procstat/procstat_files.c	Sat Mar  2 21:11:30 2013	(r247667)
    @@ -215,6 +215,13 @@ static struct cap_desc {
     	{ CAP_PDWAIT,		"pw" },
     	{ CAP_PDKILL,		"pk" },
     
    +	/*
    +	 * Rights that allow to use bindat(2) and connectat(2) syscalls on a
    +	 * directory descriptor.
    +	 */
    +	{ CAP_BINDAT,		"ba" },
    +	{ CAP_CONNECTAT,	"ca" },
    +
     	/* Aliases and defines that combine multiple rights. */
     	{ CAP_PREAD,		"prd" },
     	{ CAP_PWRITE,		"pwr" },
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 21:12:57 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 8210BA43;
     Sat,  2 Mar 2013 21:12:57 +0000 (UTC) (envelope-from pjd@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 6E2D7282;
     Sat,  2 Mar 2013 21:12:57 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22LCvWY045901;
     Sat, 2 Mar 2013 21:12:57 GMT (envelope-from pjd@svn.freebsd.org)
    Received: (from pjd@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22LCtCZ045885;
     Sat, 2 Mar 2013 21:12:55 GMT (envelope-from pjd@svn.freebsd.org)
    Message-Id: <201303022112.r22LCtCZ045885@svn.freebsd.org>
    From: Pawel Jakub Dawidek 
    Date: Sat, 2 Mar 2013 21:12:55 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247668 - in head/sys: compat/freebsd32 kern sys
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 21:12:57 -0000
    
    Author: pjd
    Date: Sat Mar  2 21:12:54 2013
    New Revision: 247668
    URL: http://svnweb.freebsd.org/changeset/base/247668
    
    Log:
      Regen after r247667.
    
    Modified:
      head/sys/compat/freebsd32/freebsd32_proto.h
      head/sys/compat/freebsd32/freebsd32_syscall.h
      head/sys/compat/freebsd32/freebsd32_syscalls.c
      head/sys/compat/freebsd32/freebsd32_sysent.c
      head/sys/compat/freebsd32/freebsd32_systrace_args.c
      head/sys/kern/init_sysent.c
      head/sys/kern/syscalls.c
      head/sys/kern/systrace_args.c
      head/sys/sys/syscall.h
      head/sys/sys/syscall.mk
      head/sys/sys/sysproto.h
    
    Modified: head/sys/compat/freebsd32/freebsd32_proto.h
    ==============================================================================
    --- head/sys/compat/freebsd32/freebsd32_proto.h	Sat Mar  2 21:11:30 2013	(r247667)
    +++ head/sys/compat/freebsd32/freebsd32_proto.h	Sat Mar  2 21:12:54 2013	(r247668)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
    + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247667 2013-03-02 21:11:30Z pjd 
      */
     
     #ifndef _FREEBSD32_SYSPROTO_H_
    
    Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
    ==============================================================================
    --- head/sys/compat/freebsd32/freebsd32_syscall.h	Sat Mar  2 21:11:30 2013	(r247667)
    +++ head/sys/compat/freebsd32/freebsd32_syscall.h	Sat Mar  2 21:12:54 2013	(r247668)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
    + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247667 2013-03-02 21:11:30Z pjd 
      */
     
     #define	FREEBSD32_SYS_syscall	0
    @@ -435,4 +435,6 @@
     #define	FREEBSD32_SYS_cap_ioctls_get	535
     #define	FREEBSD32_SYS_cap_fcntls_limit	536
     #define	FREEBSD32_SYS_cap_fcntls_get	537
    -#define	FREEBSD32_SYS_MAXSYSCALL	538
    +#define	FREEBSD32_SYS_bindat	538
    +#define	FREEBSD32_SYS_connectat	539
    +#define	FREEBSD32_SYS_MAXSYSCALL	540
    
    Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
    ==============================================================================
    --- head/sys/compat/freebsd32/freebsd32_syscalls.c	Sat Mar  2 21:11:30 2013	(r247667)
    +++ head/sys/compat/freebsd32/freebsd32_syscalls.c	Sat Mar  2 21:12:54 2013	(r247668)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
    + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247667 2013-03-02 21:11:30Z pjd 
      */
     
     const char *freebsd32_syscallnames[] = {
    @@ -561,4 +561,6 @@ const char *freebsd32_syscallnames[] = {
     	"cap_ioctls_get",			/* 535 = cap_ioctls_get */
     	"cap_fcntls_limit",			/* 536 = cap_fcntls_limit */
     	"cap_fcntls_get",			/* 537 = cap_fcntls_get */
    +	"bindat",			/* 538 = bindat */
    +	"connectat",			/* 539 = connectat */
     };
    
    Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
    ==============================================================================
    --- head/sys/compat/freebsd32/freebsd32_sysent.c	Sat Mar  2 21:11:30 2013	(r247667)
    +++ head/sys/compat/freebsd32/freebsd32_sysent.c	Sat Mar  2 21:12:54 2013	(r247668)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
    + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247667 2013-03-02 21:11:30Z pjd 
      */
     
     #include "opt_compat.h"
    @@ -598,4 +598,6 @@ struct sysent freebsd32_sysent[] = {
     	{ AS(cap_ioctls_get_args), (sy_call_t *)sys_cap_ioctls_get, AUE_CAP_IOCTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC },	/* 535 = cap_ioctls_get */
     	{ AS(cap_fcntls_limit_args), (sy_call_t *)sys_cap_fcntls_limit, AUE_CAP_FCNTLS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 536 = cap_fcntls_limit */
     	{ AS(cap_fcntls_get_args), (sy_call_t *)sys_cap_fcntls_get, AUE_CAP_FCNTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC },	/* 537 = cap_fcntls_get */
    +	{ AS(bindat_args), (sy_call_t *)sys_bindat, AUE_BINDAT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 538 = bindat */
    +	{ AS(connectat_args), (sy_call_t *)sys_connectat, AUE_CONNECTAT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 539 = connectat */
     };
    
    Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c
    ==============================================================================
    --- head/sys/compat/freebsd32/freebsd32_systrace_args.c	Sat Mar  2 21:11:30 2013	(r247667)
    +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c	Sat Mar  2 21:12:54 2013	(r247668)
    @@ -3130,6 +3130,26 @@ systrace_args(int sysnum, void *params, 
     		*n_args = 2;
     		break;
     	}
    +	/* bindat */
    +	case 538: {
    +		struct bindat_args *p = params;
    +		iarg[0] = p->fd; /* int */
    +		iarg[1] = p->s; /* int */
    +		uarg[2] = (intptr_t) p->name; /* caddr_t */
    +		iarg[3] = p->namelen; /* int */
    +		*n_args = 4;
    +		break;
    +	}
    +	/* connectat */
    +	case 539: {
    +		struct connectat_args *p = params;
    +		iarg[0] = p->fd; /* int */
    +		iarg[1] = p->s; /* int */
    +		uarg[2] = (intptr_t) p->name; /* caddr_t */
    +		iarg[3] = p->namelen; /* int */
    +		*n_args = 4;
    +		break;
    +	}
     	default:
     		*n_args = 0;
     		break;
    @@ -8356,6 +8376,44 @@ systrace_entry_setargdesc(int sysnum, in
     			break;
     		};
     		break;
    +	/* bindat */
    +	case 538:
    +		switch(ndx) {
    +		case 0:
    +			p = "int";
    +			break;
    +		case 1:
    +			p = "int";
    +			break;
    +		case 2:
    +			p = "caddr_t";
    +			break;
    +		case 3:
    +			p = "int";
    +			break;
    +		default:
    +			break;
    +		};
    +		break;
    +	/* connectat */
    +	case 539:
    +		switch(ndx) {
    +		case 0:
    +			p = "int";
    +			break;
    +		case 1:
    +			p = "int";
    +			break;
    +		case 2:
    +			p = "caddr_t";
    +			break;
    +		case 3:
    +			p = "int";
    +			break;
    +		default:
    +			break;
    +		};
    +		break;
     	default:
     		break;
     	};
    @@ -10143,6 +10201,16 @@ systrace_return_setargdesc(int sysnum, i
     		if (ndx == 0 || ndx == 1)
     			p = "int";
     		break;
    +	/* bindat */
    +	case 538:
    +		if (ndx == 0 || ndx == 1)
    +			p = "int";
    +		break;
    +	/* connectat */
    +	case 539:
    +		if (ndx == 0 || ndx == 1)
    +			p = "int";
    +		break;
     	default:
     		break;
     	};
    
    Modified: head/sys/kern/init_sysent.c
    ==============================================================================
    --- head/sys/kern/init_sysent.c	Sat Mar  2 21:11:30 2013	(r247667)
    +++ head/sys/kern/init_sysent.c	Sat Mar  2 21:12:54 2013	(r247668)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/kern/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
    + * created from FreeBSD: head/sys/kern/syscalls.master 247667 2013-03-02 21:11:30Z pjd 
      */
     
     #include "opt_compat.h"
    @@ -572,4 +572,6 @@ struct sysent sysent[] = {
     	{ AS(cap_ioctls_get_args), (sy_call_t *)sys_cap_ioctls_get, AUE_CAP_IOCTLS_GET, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 535 = cap_ioctls_get */
     	{ AS(cap_fcntls_limit_args), (sy_call_t *)sys_cap_fcntls_limit, AUE_CAP_FCNTLS_LIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 536 = cap_fcntls_limit */
     	{ AS(cap_fcntls_get_args), (sy_call_t *)sys_cap_fcntls_get, AUE_CAP_FCNTLS_GET, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 537 = cap_fcntls_get */
    +	{ AS(bindat_args), (sy_call_t *)sys_bindat, AUE_BINDAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 538 = bindat */
    +	{ AS(connectat_args), (sy_call_t *)sys_connectat, AUE_CONNECTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 539 = connectat */
     };
    
    Modified: head/sys/kern/syscalls.c
    ==============================================================================
    --- head/sys/kern/syscalls.c	Sat Mar  2 21:11:30 2013	(r247667)
    +++ head/sys/kern/syscalls.c	Sat Mar  2 21:12:54 2013	(r247668)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/kern/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
    + * created from FreeBSD: head/sys/kern/syscalls.master 247667 2013-03-02 21:11:30Z pjd 
      */
     
     const char *syscallnames[] = {
    @@ -545,4 +545,6 @@ const char *syscallnames[] = {
     	"cap_ioctls_get",			/* 535 = cap_ioctls_get */
     	"cap_fcntls_limit",			/* 536 = cap_fcntls_limit */
     	"cap_fcntls_get",			/* 537 = cap_fcntls_get */
    +	"bindat",			/* 538 = bindat */
    +	"connectat",			/* 539 = connectat */
     };
    
    Modified: head/sys/kern/systrace_args.c
    ==============================================================================
    --- head/sys/kern/systrace_args.c	Sat Mar  2 21:11:30 2013	(r247667)
    +++ head/sys/kern/systrace_args.c	Sat Mar  2 21:12:54 2013	(r247668)
    @@ -3328,6 +3328,26 @@ systrace_args(int sysnum, void *params, 
     		*n_args = 2;
     		break;
     	}
    +	/* bindat */
    +	case 538: {
    +		struct bindat_args *p = params;
    +		iarg[0] = p->fd; /* int */
    +		iarg[1] = p->s; /* int */
    +		uarg[2] = (intptr_t) p->name; /* caddr_t */
    +		iarg[3] = p->namelen; /* int */
    +		*n_args = 4;
    +		break;
    +	}
    +	/* connectat */
    +	case 539: {
    +		struct connectat_args *p = params;
    +		iarg[0] = p->fd; /* int */
    +		iarg[1] = p->s; /* int */
    +		uarg[2] = (intptr_t) p->name; /* caddr_t */
    +		iarg[3] = p->namelen; /* int */
    +		*n_args = 4;
    +		break;
    +	}
     	default:
     		*n_args = 0;
     		break;
    @@ -8858,6 +8878,44 @@ systrace_entry_setargdesc(int sysnum, in
     			break;
     		};
     		break;
    +	/* bindat */
    +	case 538:
    +		switch(ndx) {
    +		case 0:
    +			p = "int";
    +			break;
    +		case 1:
    +			p = "int";
    +			break;
    +		case 2:
    +			p = "caddr_t";
    +			break;
    +		case 3:
    +			p = "int";
    +			break;
    +		default:
    +			break;
    +		};
    +		break;
    +	/* connectat */
    +	case 539:
    +		switch(ndx) {
    +		case 0:
    +			p = "int";
    +			break;
    +		case 1:
    +			p = "int";
    +			break;
    +		case 2:
    +			p = "caddr_t";
    +			break;
    +		case 3:
    +			p = "int";
    +			break;
    +		default:
    +			break;
    +		};
    +		break;
     	default:
     		break;
     	};
    @@ -10776,6 +10834,16 @@ systrace_return_setargdesc(int sysnum, i
     		if (ndx == 0 || ndx == 1)
     			p = "int";
     		break;
    +	/* bindat */
    +	case 538:
    +		if (ndx == 0 || ndx == 1)
    +			p = "int";
    +		break;
    +	/* connectat */
    +	case 539:
    +		if (ndx == 0 || ndx == 1)
    +			p = "int";
    +		break;
     	default:
     		break;
     	};
    
    Modified: head/sys/sys/syscall.h
    ==============================================================================
    --- head/sys/sys/syscall.h	Sat Mar  2 21:11:30 2013	(r247667)
    +++ head/sys/sys/syscall.h	Sat Mar  2 21:12:54 2013	(r247668)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/kern/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
    + * created from FreeBSD: head/sys/kern/syscalls.master 247667 2013-03-02 21:11:30Z pjd 
      */
     
     #define	SYS_syscall	0
    @@ -457,4 +457,6 @@
     #define	SYS_cap_ioctls_get	535
     #define	SYS_cap_fcntls_limit	536
     #define	SYS_cap_fcntls_get	537
    -#define	SYS_MAXSYSCALL	538
    +#define	SYS_bindat	538
    +#define	SYS_connectat	539
    +#define	SYS_MAXSYSCALL	540
    
    Modified: head/sys/sys/syscall.mk
    ==============================================================================
    --- head/sys/sys/syscall.mk	Sat Mar  2 21:11:30 2013	(r247667)
    +++ head/sys/sys/syscall.mk	Sat Mar  2 21:12:54 2013	(r247668)
    @@ -1,7 +1,7 @@
     # FreeBSD system call names.
     # DO NOT EDIT-- this file is automatically generated.
     # $FreeBSD$
    -# created from FreeBSD: head/sys/kern/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
    +# created from FreeBSD: head/sys/kern/syscalls.master 247667 2013-03-02 21:11:30Z pjd 
     MIASM =  \
     	syscall.o \
     	exit.o \
    @@ -405,4 +405,6 @@ MIASM =  \
     	cap_ioctls_limit.o \
     	cap_ioctls_get.o \
     	cap_fcntls_limit.o \
    -	cap_fcntls_get.o
    +	cap_fcntls_get.o \
    +	bindat.o \
    +	connectat.o
    
    Modified: head/sys/sys/sysproto.h
    ==============================================================================
    --- head/sys/sys/sysproto.h	Sat Mar  2 21:11:30 2013	(r247667)
    +++ head/sys/sys/sysproto.h	Sat Mar  2 21:12:54 2013	(r247668)
    @@ -3,7 +3,7 @@
      *
      * DO NOT EDIT-- this file is automatically generated.
      * $FreeBSD$
    - * created from FreeBSD: head/sys/kern/syscalls.master 247602 2013-03-02 00:53:12Z pjd 
    + * created from FreeBSD: head/sys/kern/syscalls.master 247667 2013-03-02 21:11:30Z pjd 
      */
     
     #ifndef _SYS_SYSPROTO_H_
    @@ -1784,6 +1784,18 @@ struct cap_fcntls_get_args {
     	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
     	char fcntlrightsp_l_[PADL_(uint32_t *)]; uint32_t * fcntlrightsp; char fcntlrightsp_r_[PADR_(uint32_t *)];
     };
    +struct bindat_args {
    +	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
    +	char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
    +	char name_l_[PADL_(caddr_t)]; caddr_t name; char name_r_[PADR_(caddr_t)];
    +	char namelen_l_[PADL_(int)]; int namelen; char namelen_r_[PADR_(int)];
    +};
    +struct connectat_args {
    +	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
    +	char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
    +	char name_l_[PADL_(caddr_t)]; caddr_t name; char name_r_[PADR_(caddr_t)];
    +	char namelen_l_[PADL_(int)]; int namelen; char namelen_r_[PADR_(int)];
    +};
     int	nosys(struct thread *, struct nosys_args *);
     void	sys_sys_exit(struct thread *, struct sys_exit_args *);
     int	sys_fork(struct thread *, struct fork_args *);
    @@ -2171,6 +2183,8 @@ int	sys_cap_ioctls_limit(struct thread *
     int	sys_cap_ioctls_get(struct thread *, struct cap_ioctls_get_args *);
     int	sys_cap_fcntls_limit(struct thread *, struct cap_fcntls_limit_args *);
     int	sys_cap_fcntls_get(struct thread *, struct cap_fcntls_get_args *);
    +int	sys_bindat(struct thread *, struct bindat_args *);
    +int	sys_connectat(struct thread *, struct connectat_args *);
     
     #ifdef COMPAT_43
     
    @@ -2872,6 +2886,8 @@ int	freebsd7_shmctl(struct thread *, str
     #define	SYS_AUE_cap_ioctls_get	AUE_CAP_IOCTLS_GET
     #define	SYS_AUE_cap_fcntls_limit	AUE_CAP_FCNTLS_LIMIT
     #define	SYS_AUE_cap_fcntls_get	AUE_CAP_FCNTLS_GET
    +#define	SYS_AUE_bindat	AUE_BINDAT
    +#define	SYS_AUE_connectat	AUE_CONNECTAT
     
     #undef PAD_
     #undef PADL_
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 21:16:41 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 87A90C30;
     Sat,  2 Mar 2013 21:16:41 +0000 (UTC) (envelope-from pjd@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 630A72AC;
     Sat,  2 Mar 2013 21:16:41 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22LGfnF046516;
     Sat, 2 Mar 2013 21:16:41 GMT (envelope-from pjd@svn.freebsd.org)
    Received: (from pjd@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22LGfP8046514;
     Sat, 2 Mar 2013 21:16:41 GMT (envelope-from pjd@svn.freebsd.org)
    Message-Id: <201303022116.r22LGfP8046514@svn.freebsd.org>
    From: Pawel Jakub Dawidek 
    Date: Sat, 2 Mar 2013 21:16:41 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247669 - head/tools/regression/pjdfstest
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 21:16:41 -0000
    
    Author: pjd
    Date: Sat Mar  2 21:16:40 2013
    New Revision: 247669
    URL: http://svnweb.freebsd.org/changeset/base/247669
    
    Log:
      Add support for bindat(2) and connectat(2).
      
      Sponsored by:	The FreeBSD Foundation
    
    Modified:
      head/tools/regression/pjdfstest/Makefile
      head/tools/regression/pjdfstest/pjdfstest.c
    
    Modified: head/tools/regression/pjdfstest/Makefile
    ==============================================================================
    --- head/tools/regression/pjdfstest/Makefile	Sat Mar  2 21:12:54 2013	(r247668)
    +++ head/tools/regression/pjdfstest/Makefile	Sat Mar  2 21:16:40 2013	(r247669)
    @@ -6,7 +6,7 @@ ${PROG}:	${PROG}.c
     	@OSTYPE=`uname`; \
     	CFLAGS=-D__OS_$${OSTYPE}__; \
     	if [ $$OSTYPE = "FreeBSD" ]; then \
    -		CFLAGS="$$CFLAGS -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_FCHFLAGS -DHAS_LCHFLAGS -DHAS_FREEBSD_ACL"; \
    +		CFLAGS="$$CFLAGS -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_FCHFLAGS -DHAS_LCHFLAGS -DHAS_FREEBSD_ACL -DHAS_BINDAT -DHAS_CONNECTAT"; \
     	elif [ $$OSTYPE = "SunOS" ]; then \
     		CFLAGS="$$CFLAGS -DHAS_TRUNCATE64 -DHAS_STAT64"; \
     		CFLAGS="$$CFLAGS -lsocket"; \
    
    Modified: head/tools/regression/pjdfstest/pjdfstest.c
    ==============================================================================
    --- head/tools/regression/pjdfstest/pjdfstest.c	Sat Mar  2 21:12:54 2013	(r247668)
    +++ head/tools/regression/pjdfstest/pjdfstest.c	Sat Mar  2 21:16:40 2013	(r247669)
    @@ -82,7 +82,13 @@ enum action {
     	ACTION_MKNOD,
     	ACTION_MKNODAT,
     	ACTION_BIND,
    +#ifdef HAS_BINDAT
    +	ACTION_BINDAT,
    +#endif
     	ACTION_CONNECT,
    +#ifdef HAS_CONNECTAT
    +	ACTION_CONNECTAT,
    +#endif
     	ACTION_CHMOD,
     	ACTION_FCHMOD,
     #ifdef HAS_LCHMOD
    @@ -154,7 +160,13 @@ static struct syscall_desc syscalls[] = 
     	{ "mknod", ACTION_MKNOD, { TYPE_STRING, TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE} },
     	{ "mknodat", ACTION_MKNODAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE} },
     	{ "bind", ACTION_BIND, { TYPE_STRING, TYPE_NONE } },
    +#ifdef HAS_BINDAT
    +	{ "bindat", ACTION_BINDAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
    +#endif
     	{ "connect", ACTION_CONNECT, { TYPE_STRING, TYPE_NONE } },
    +#ifdef HAS_CONNECTAT
    +	{ "connectat", ACTION_CONNECTAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } },
    +#endif
     	{ "chmod", ACTION_CHMOD, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } },
     	{ "fchmod", ACTION_FCHMOD, { TYPE_DESCRIPTOR, TYPE_NUMBER, TYPE_NONE } },
     #ifdef HAS_LCHMOD
    @@ -732,6 +744,22 @@ call_syscall(struct syscall_desc *scall,
     		rval = bind(rval, (struct sockaddr *)&sunx, sizeof(sunx));
     		break;
     	    }
    +#ifdef HAS_BINDAT
    +	case ACTION_BINDAT:
    +	    {
    +		struct sockaddr_un sunx;
    +
    +		sunx.sun_family = AF_UNIX;
    +		strncpy(sunx.sun_path, STR(1), sizeof(sunx.sun_path) - 1);
    +		sunx.sun_path[sizeof(sunx.sun_path) - 1] = '\0';
    +		rval = socket(AF_UNIX, SOCK_STREAM, 0);
    +		if (rval < 0)
    +			break;
    +		rval = bindat(NUM(0), rval, (struct sockaddr *)&sunx,
    +		    sizeof(sunx));
    +		break;
    +	    }
    +#endif
     	case ACTION_CONNECT:
     	    {
     		struct sockaddr_un sunx;
    @@ -745,6 +773,22 @@ call_syscall(struct syscall_desc *scall,
     		rval = connect(rval, (struct sockaddr *)&sunx, sizeof(sunx));
     		break;
     	    }
    +#ifdef HAS_CONNECTAT
    +	case ACTION_CONNECTAT:
    +	    {
    +		struct sockaddr_un sunx;
    +
    +		sunx.sun_family = AF_UNIX;
    +		strncpy(sunx.sun_path, STR(1), sizeof(sunx.sun_path) - 1);
    +		sunx.sun_path[sizeof(sunx.sun_path) - 1] = '\0';
    +		rval = socket(AF_UNIX, SOCK_STREAM, 0);
    +		if (rval < 0)
    +			break;
    +		rval = connectat(NUM(0), rval, (struct sockaddr *)&sunx,
    +		    sizeof(sunx));
    +		break;
    +	    }
    +#endif
     	case ACTION_CHMOD:
     		rval = chmod(STR(0), (mode_t)NUM(1));
     		break;
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 21:59:09 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 24705308;
     Sat,  2 Mar 2013 21:59:09 +0000 (UTC) (envelope-from np@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 081243DC;
     Sat,  2 Mar 2013 21:59:09 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22Lx9Dq058603;
     Sat, 2 Mar 2013 21:59:09 GMT (envelope-from np@svn.freebsd.org)
    Received: (from np@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22Lx7QD058594;
     Sat, 2 Mar 2013 21:59:07 GMT (envelope-from np@svn.freebsd.org)
    Message-Id: <201303022159.r22Lx7QD058594@svn.freebsd.org>
    From: Navdeep Parhar 
    Date: Sat, 2 Mar 2013 21:59:07 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
    Subject: svn commit: r247670 - in stable/8: share/man/man4 sys/conf
     sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/firmware
     sys/modules/cxgbe/firmware sys/modules/cxgbe/if_cxgbe tools/tools/cxgbetool
    X-SVN-Group: stable-8
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 21:59:09 -0000
    
    Author: np
    Date: Sat Mar  2 21:59:07 2013
    New Revision: 247670
    URL: http://svnweb.freebsd.org/changeset/base/247670
    
    Log:
      MFC r234831, r234833, r237263**, r237436*, r237439, r237463, r237512,
      r237587, r237799, r237819, r237831, r238028, r238054, r238313, r239102,
      r239258, r239259, r239264*, r239266, r239336, r239338*, r239339,
      r239341, r239344, r240443, r240451, r240452*, r240453, r241397, r241398,
      r241399, r241401, r241409, r241416, r241493, r244551, r244580, r245243,
      r245274*, r245276*, r245434*, r245517, r245518, r245520, r245567,
      r245933, r245935, r245936, r246093, r246385, r246575, r247062, r247122,
      r247289, r247291, r247347, r247355.
      
      This brings stable/8's cxgbe(4) up to date with what's in head right
      now.  One major difference is the missing t4_tom (TCP Offload Module);
      there are no plans to backport it to 8.
      
      Build tested with make universe (with -DMAKE_JUST_KERNELS)
      
      *  partial
      ** partial manual backport, not really an MFC
    
    Added:
      stable/8/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu
         - copied unchanged from r247289, head/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu
    Deleted:
      stable/8/sys/dev/cxgbe/common/jhash.h
    Modified:
      stable/8/share/man/man4/cxgbe.4
      stable/8/sys/conf/files
      stable/8/sys/conf/kern.pre.mk
      stable/8/sys/dev/cxgbe/adapter.h
      stable/8/sys/dev/cxgbe/common/common.h
      stable/8/sys/dev/cxgbe/common/t4_hw.c
      stable/8/sys/dev/cxgbe/common/t4_hw.h
      stable/8/sys/dev/cxgbe/common/t4_msg.h
      stable/8/sys/dev/cxgbe/firmware/t4fw_cfg.txt
      stable/8/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt
      stable/8/sys/dev/cxgbe/firmware/t4fw_interface.h
      stable/8/sys/dev/cxgbe/offload.h
      stable/8/sys/dev/cxgbe/osdep.h
      stable/8/sys/dev/cxgbe/t4_ioctl.h
      stable/8/sys/dev/cxgbe/t4_l2t.c
      stable/8/sys/dev/cxgbe/t4_l2t.h
      stable/8/sys/dev/cxgbe/t4_main.c
      stable/8/sys/dev/cxgbe/t4_sge.c
      stable/8/sys/modules/cxgbe/firmware/Makefile
      stable/8/sys/modules/cxgbe/if_cxgbe/Makefile
      stable/8/tools/tools/cxgbetool/cxgbetool.c
    Directory Properties:
      stable/8/share/man/man4/   (props changed)
      stable/8/sys/   (props changed)
      stable/8/sys/conf/   (props changed)
      stable/8/sys/dev/   (props changed)
      stable/8/sys/dev/cxgbe/   (props changed)
      stable/8/sys/modules/   (props changed)
      stable/8/tools/tools/cxgbetool/   (props changed)
    
    Modified: stable/8/share/man/man4/cxgbe.4
    ==============================================================================
    --- stable/8/share/man/man4/cxgbe.4	Sat Mar  2 21:16:40 2013	(r247669)
    +++ stable/8/share/man/man4/cxgbe.4	Sat Mar  2 21:59:07 2013	(r247670)
    @@ -1,4 +1,4 @@
    -.\" Copyright (c) 2011, Chelsio Inc
    +.\" Copyright (c) 2011-2012, Chelsio Inc
     .\" All rights reserved.
     .\"
     .\" Redistribution and use in source and binary forms, with or without
    @@ -145,10 +145,9 @@ dev.cxgbe.X.holdoff_tmr_idx sysctl.
     The packet-count index value to use to delay interrupts.
     The packet-count list has the values 1, 8, 16, and 32 by default
     and the index selects a value from this list.
    -The default value is 2 for both 10Gb and 1Gb ports, which means 16
    -packets (or the holdoff timer going off) before an interrupt is
    -generated.
    --1 disables packet counting.
    +The default value is -1 for both 10Gb and 1Gb ports, which means packet
    +counting is disabled and interrupts are generated based solely on the
    +holdoff timer value.
     Different cxgbe interfaces can be assigned different values via the
     dev.cxgbe.X.holdoff_pktc_idx sysctl.
     This sysctl works only when the interface has never been marked up (as done by
    @@ -179,6 +178,15 @@ Bit 0 represents INTx (line interrupts),
     The default is 7 (all allowed).
     The driver will select the best possible type out of the allowed types by
     itself.
    +.It Va hw.cxgbe.fw_install
    +0 prohibits the driver from installing a firmware on the card.
    +1 allows the driver to install a new firmware if internal driver
    +heuristics indicate that the new firmware is preferable to the one
    +already on the card.
    +2 instructs the driver to always install the new firmware on the card as
    +long as it is compatible with the driver and is a different version than
    +the one already on the card.
    +The default is 1.
     .It Va hw.cxgbe.config_file
     Select a pre-packaged device configuration file.
     A configuration file contains a recipe for partitioning and configuring the
    
    Modified: stable/8/sys/conf/files
    ==============================================================================
    --- stable/8/sys/conf/files	Sat Mar  2 21:16:40 2013	(r247669)
    +++ stable/8/sys/conf/files	Sat Mar  2 21:59:07 2013	(r247670)
    @@ -815,6 +815,40 @@ dev/cxgbe/t4_l2t.c		optional cxgbe pci \
     	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
     dev/cxgbe/common/t4_hw.c	optional cxgbe pci \
     	compile-with "${NORMAL_C} -I$S/dev/cxgbe"
    +t4fw_cfg.c		optional cxgbe					\
    +	compile-with	"${AWK} -f $S/tools/fw_stub.awk t4fw_cfg.fw:t4fw_cfg t4fw_cfg_uwire.fw:t4fw_cfg_uwire t4fw.fw:t4fw -mt4fw_cfg -c${.TARGET}" \
    +	no-implicit-rule before-depend local				\
    +	clean		"t4fw_cfg.c"
    +t4fw_cfg.fwo		optional cxgbe					\
    +	dependency	"t4fw_cfg.fw"					\
    +	compile-with	"${NORMAL_FWO}"					\
    +	no-implicit-rule						\
    +	clean		"t4fw_cfg.fwo"
    +t4fw_cfg.fw		optional cxgbe					\
    +	dependency	"$S/dev/cxgbe/firmware/t4fw_cfg.txt"		\
    +	compile-with	"${CP} ${.ALLSRC} ${.TARGET}"			\
    +	no-obj no-implicit-rule						\
    +	clean		"t4fw_cfg.fw"
    +t4fw_cfg_uwire.fwo	optional cxgbe					\
    +	dependency	"t4fw_cfg_uwire.fw"				\
    +	compile-with	"${NORMAL_FWO}"					\
    +	no-implicit-rule						\
    +	clean		"t4fw_cfg_uwire.fwo"
    +t4fw_cfg_uwire.fw	optional cxgbe					\
    +	dependency	"$S/dev/cxgbe/firmware/t4fw_cfg_uwire.txt"	\
    +	compile-with	"${CP} ${.ALLSRC} ${.TARGET}"			\
    +	no-obj no-implicit-rule						\
    +	clean		"t4fw_cfg_uwire.fw"
    +t4fw.fwo		optional cxgbe					\
    +	dependency	"t4fw.fw"					\
    +	compile-with	"${NORMAL_FWO}"					\
    +	no-implicit-rule						\
    +	clean		"t4fw.fwo"
    +t4fw.fw			optional cxgbe					\
    +	dependency	"$S/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu"	\
    +	compile-with	"${NORMAL_FW}"					\
    +	no-obj no-implicit-rule						\
    +	clean		"t4fw.fw"
     dev/cy/cy.c			optional cy
     dev/cy/cy_isa.c			optional cy isa
     dev/cy/cy_pci.c			optional cy pci
    
    Modified: stable/8/sys/conf/kern.pre.mk
    ==============================================================================
    --- stable/8/sys/conf/kern.pre.mk	Sat Mar  2 21:16:40 2013	(r247669)
    +++ stable/8/sys/conf/kern.pre.mk	Sat Mar  2 21:59:07 2013	(r247670)
    @@ -15,6 +15,7 @@ LDSCRIPT?=	$S/conf/${LDSCRIPT_NAME}
     M=	${MACHINE_ARCH}
     
     AWK?=		awk
    +CP?=		cp
     LINT?=		lint
     NM?=		nm
     OBJCOPY?=	objcopy
    
    Modified: stable/8/sys/dev/cxgbe/adapter.h
    ==============================================================================
    --- stable/8/sys/dev/cxgbe/adapter.h	Sat Mar  2 21:16:40 2013	(r247669)
    +++ stable/8/sys/dev/cxgbe/adapter.h	Sat Mar  2 21:59:07 2013	(r247670)
    @@ -44,6 +44,7 @@
     #include 
     #include 
     #include 
    +#include 
     #include 
     
     #include "offload.h"
    @@ -77,6 +78,15 @@ prefetch(void *x)
     #define SBUF_DRAIN 1
     #endif
     
    +#if (__FreeBSD_version < 900000)
    +#define IFCAP_RXCSUM_IPV6 0
    +#define IFCAP_TXCSUM_IPV6 0
    +#define CSUM_DATA_VALID_IPV6 0
    +#define IFCAP_HWCSUM_IPV6 0
    +#define CSUM_UDP_IPV6 0
    +#define CSUM_TCP_IPV6 0
    +#endif
    +
     #ifdef __amd64__
     /* XXX: need systemwide bus_space_read_8/bus_space_write_8 */
     static __inline uint64_t
    @@ -134,6 +144,7 @@ enum {
     #else
     	FL_BUF_SIZES = 3,	/* cluster, jumbo9k, jumbo16k */
     #endif
    +	OFLD_BUF_SIZE = MJUM16BYTES,	/* size of fl buffer for TOE rxq */
     
     	CTRL_EQ_QSIZE = 128,
     
    @@ -142,6 +153,12 @@ enum {
     	TX_WR_FLITS = SGE_MAX_WR_LEN / 8
     };
     
    +#ifdef T4_PKT_TIMESTAMP
    +#define RX_COPY_THRESHOLD (MINCLSIZE - 8)
    +#else
    +#define RX_COPY_THRESHOLD MINCLSIZE
    +#endif
    +
     enum {
     	/* adapter intr_type */
     	INTR_INTX	= (1 << 0),
    @@ -150,12 +167,23 @@ enum {
     };
     
     enum {
    +	/* flags understood by begin_synchronized_op */
    +	HOLD_LOCK	= (1 << 0),
    +	SLEEP_OK	= (1 << 1),
    +	INTR_OK		= (1 << 2),
    +
    +	/* flags understood by end_synchronized_op */
    +	LOCK_HELD	= HOLD_LOCK,
    +};
    +
    +enum {
     	/* adapter flags */
     	FULL_INIT_DONE	= (1 << 0),
     	FW_OK		= (1 << 1),
     	INTR_DIRECT	= (1 << 2),	/* direct interrupts for everything */
     	MASTER_PF	= (1 << 3),
     	ADAP_SYSCTL_CTX	= (1 << 4),
    +	TOM_INIT_DONE	= (1 << 5),
     
     	CXGBE_BUSY	= (1 << 9),
     
    @@ -165,11 +193,11 @@ enum {
     	PORT_SYSCTL_CTX	= (1 << 2),
     };
     
    -#define IS_DOOMED(pi)	(pi->flags & DOOMED)
    -#define SET_DOOMED(pi)	do {pi->flags |= DOOMED;} while (0)
    -#define IS_BUSY(sc)	(sc->flags & CXGBE_BUSY)
    -#define SET_BUSY(sc)	do {sc->flags |= CXGBE_BUSY;} while (0)
    -#define CLR_BUSY(sc)	do {sc->flags &= ~CXGBE_BUSY;} while (0)
    +#define IS_DOOMED(pi)	((pi)->flags & DOOMED)
    +#define SET_DOOMED(pi)	do {(pi)->flags |= DOOMED;} while (0)
    +#define IS_BUSY(sc)	((sc)->flags & CXGBE_BUSY)
    +#define SET_BUSY(sc)	do {(sc)->flags |= CXGBE_BUSY;} while (0)
    +#define CLR_BUSY(sc)	do {(sc)->flags &= ~CXGBE_BUSY;} while (0)
     
     struct port_info {
     	device_t dev;
    @@ -198,7 +226,7 @@ struct port_info {
     	int first_txq;	/* index of first tx queue */
     	int nrxq;	/* # of rx queues */
     	int first_rxq;	/* index of first rx queue */
    -#ifndef TCP_OFFLOAD_DISABLE
    +#ifdef TCP_OFFLOAD
     	int nofldtxq;		/* # of offload tx queues */
     	int first_ofld_txq;	/* index of first offload tx queue */
     	int nofldrxq;		/* # of offload rx queues */
    @@ -271,7 +299,6 @@ struct sge_iq {
     	bus_dma_tag_t desc_tag;
     	bus_dmamap_t desc_map;
     	bus_addr_t ba;		/* bus address of descriptor ring */
    -	char lockname[16];
     	uint32_t flags;
     	uint16_t abs_id;	/* absolute SGE id for the iq */
     	int8_t   intr_pktc_idx;	/* packet count threshold index */
    @@ -295,7 +322,7 @@ struct sge_iq {
     enum {
     	EQ_CTRL		= 1,
     	EQ_ETH		= 2,
    -#ifndef TCP_OFFLOAD_DISABLE
    +#ifdef TCP_OFFLOAD
     	EQ_OFLD		= 3,
     #endif
     
    @@ -388,7 +415,7 @@ struct sge_txq {
     	/* stats for common events first */
     
     	uint64_t txcsum;	/* # of times hardware assisted with checksum */
    -	uint64_t tso_wrs;	/* # of IPv4 TSO work requests */
    +	uint64_t tso_wrs;	/* # of TSO work requests */
     	uint64_t vlan_insertion;/* # of times VLAN tag was inserted */
     	uint64_t imm_wrs;	/* # of work requests with immediate data */
     	uint64_t sgl_wrs;	/* # of work requests with direct SGL */
    @@ -408,7 +435,7 @@ struct sge_rxq {
     	struct sge_fl fl;	/* MUST follow iq */
     
     	struct ifnet *ifp;	/* the interface this rxq belongs to */
    -#ifdef INET
    +#if defined(INET) || defined(INET6)
     	struct lro_ctrl lro;	/* LRO state */
     #endif
     
    @@ -421,14 +448,36 @@ struct sge_rxq {
     
     } __aligned(CACHE_LINE_SIZE);
     
    -#ifndef TCP_OFFLOAD_DISABLE
    +static inline struct sge_rxq *
    +iq_to_rxq(struct sge_iq *iq)
    +{
    +
    +	return (member2struct(sge_rxq, iq, iq));
    +}
    +
    +
    +#ifdef TCP_OFFLOAD
     /* ofld_rxq: SGE ingress queue + SGE free list + miscellaneous items */
     struct sge_ofld_rxq {
     	struct sge_iq iq;	/* MUST be first */
     	struct sge_fl fl;	/* MUST follow iq */
     } __aligned(CACHE_LINE_SIZE);
    +
    +static inline struct sge_ofld_rxq *
    +iq_to_ofld_rxq(struct sge_iq *iq)
    +{
    +
    +	return (member2struct(sge_ofld_rxq, iq, iq));
    +}
     #endif
     
    +struct wrqe {
    +	STAILQ_ENTRY(wrqe) link;
    +	struct sge_wrq *wrq;
    +	int wr_len;
    +	uint64_t wr[] __aligned(16);
    +};
    +
     /*
      * wrq: SGE egress queue that is given prebuilt work requests.  Both the control
      * and offload tx queues are of this type.
    @@ -437,8 +486,9 @@ struct sge_wrq {
     	struct sge_eq eq;	/* MUST be first */
     
     	struct adapter *adapter;
    -	struct mbuf *head;	/* held up due to lack of descriptors */
    -	struct mbuf *tail;	/* valid only if head is valid */
    +
    +	/* List of WRs held up due to lack of tx descriptors */
    +	STAILQ_HEAD(, wrqe) wr_list;
     
     	/* stats for common events first */
     
    @@ -456,7 +506,7 @@ struct sge {
     
     	int nrxq;	/* total # of Ethernet rx queues */
     	int ntxq;	/* total # of Ethernet tx tx queues */
    -#ifndef TCP_OFFLOAD_DISABLE
    +#ifdef TCP_OFFLOAD
     	int nofldrxq;	/* total # of TOE rx queues */
     	int nofldtxq;	/* total # of TOE tx queues */
     #endif
    @@ -468,7 +518,7 @@ struct sge {
     	struct sge_wrq *ctrlq;	/* Control queues */
     	struct sge_txq *txq;	/* NIC tx queues */
     	struct sge_rxq *rxq;	/* NIC rx queues */
    -#ifndef TCP_OFFLOAD_DISABLE
    +#ifdef TCP_OFFLOAD
     	struct sge_wrq *ofld_txq;	/* TOE tx queues */
     	struct sge_ofld_rxq *ofld_rxq;	/* TOE rx queues */
     #endif
    @@ -482,6 +532,8 @@ struct sge {
     struct rss_header;
     typedef int (*cpl_handler_t)(struct sge_iq *, const struct rss_header *,
         struct mbuf *);
    +typedef int (*an_handler_t)(struct sge_iq *, const struct rsp_ctrl *);
    +typedef int (*fw_msg_handler_t)(struct adapter *, const __be64 *);
     
     struct adapter {
     	SLIST_ENTRY(adapter) link;
    @@ -518,21 +570,22 @@ struct adapter {
     	uint8_t chan_map[NCHAN];
     	uint32_t filter_mode;
     
    -#ifndef TCP_OFFLOAD_DISABLE
    -	struct uld_softc tom;
    +#ifdef TCP_OFFLOAD
    +	void *tom_softc;	/* (struct tom_data *) */
     	struct tom_tunables tt;
     #endif
     	struct l2t_data *l2t;	/* L2 table */
     	struct tid_info tids;
     
     	int open_device_map;
    -#ifndef TCP_OFFLOAD_DISABLE
    +#ifdef TCP_OFFLOAD
     	int offload_map;
     #endif
     	int flags;
     
     	char fw_version[32];
    -	unsigned int cfcsum;
    +	char cfg_file[32];
    +	u_int cfcsum;
     	struct adapter_params params;
     	struct t4_virt_res vres;
     
    @@ -553,7 +606,14 @@ struct adapter {
     	TAILQ_HEAD(, sge_fl) sfl;
     	struct callout sfl_callout;
     
    -	cpl_handler_t cpl_handler[256] __aligned(CACHE_LINE_SIZE);
    +	an_handler_t an_handler __aligned(CACHE_LINE_SIZE);
    +	fw_msg_handler_t fw_msg_handler[5];	/* NUM_FW6_TYPES */
    +	cpl_handler_t cpl_handler[0xef];	/* NUM_CPL_CMDS */
    +
    +#ifdef INVARIANTS
    +	const char *last_op;
    +	const void *last_op_thr;
    +#endif
     };
     
     #define ADAPTER_LOCK(sc)		mtx_lock(&(sc)->sc_lock)
    @@ -561,6 +621,12 @@ struct adapter {
     #define ADAPTER_LOCK_ASSERT_OWNED(sc)	mtx_assert(&(sc)->sc_lock, MA_OWNED)
     #define ADAPTER_LOCK_ASSERT_NOTOWNED(sc) mtx_assert(&(sc)->sc_lock, MA_NOTOWNED)
     
    +/* XXX: not bulletproof, but much better than nothing */
    +#define ASSERT_SYNCHRONIZED_OP(sc)	\
    +    KASSERT(IS_BUSY(sc) && \
    +	(mtx_owned(&(sc)->sc_lock) || sc->last_op_thr == curthread), \
    +	("%s: operation not synchronized.", __func__))
    +
     #define PORT_LOCK(pi)			mtx_lock(&(pi)->pi_lock)
     #define PORT_UNLOCK(pi)			mtx_unlock(&(pi)->pi_lock)
     #define PORT_LOCK_ASSERT_OWNED(pi)	mtx_assert(&(pi)->pi_lock, MA_OWNED)
    @@ -589,18 +655,18 @@ struct adapter {
     #define TXQ_LOCK_ASSERT_OWNED(txq)	EQ_LOCK_ASSERT_OWNED(&(txq)->eq)
     #define TXQ_LOCK_ASSERT_NOTOWNED(txq)	EQ_LOCK_ASSERT_NOTOWNED(&(txq)->eq)
     
    -#define for_each_txq(pi, iter, txq) \
    -	txq = &pi->adapter->sge.txq[pi->first_txq]; \
    -	for (iter = 0; iter < pi->ntxq; ++iter, ++txq)
    -#define for_each_rxq(pi, iter, rxq) \
    -	rxq = &pi->adapter->sge.rxq[pi->first_rxq]; \
    -	for (iter = 0; iter < pi->nrxq; ++iter, ++rxq)
    -#define for_each_ofld_txq(pi, iter, ofld_txq) \
    -	ofld_txq = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq]; \
    -	for (iter = 0; iter < pi->nofldtxq; ++iter, ++ofld_txq)
    -#define for_each_ofld_rxq(pi, iter, ofld_rxq) \
    -	ofld_rxq = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq]; \
    -	for (iter = 0; iter < pi->nofldrxq; ++iter, ++ofld_rxq)
    +#define for_each_txq(pi, iter, q) \
    +	for (q = &pi->adapter->sge.txq[pi->first_txq], iter = 0; \
    +	    iter < pi->ntxq; ++iter, ++q)
    +#define for_each_rxq(pi, iter, q) \
    +	for (q = &pi->adapter->sge.rxq[pi->first_rxq], iter = 0; \
    +	    iter < pi->nrxq; ++iter, ++q)
    +#define for_each_ofld_txq(pi, iter, q) \
    +	for (q = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq], iter = 0; \
    +	    iter < pi->nofldtxq; ++iter, ++q)
    +#define for_each_ofld_rxq(pi, iter, q) \
    +	for (q = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq], iter = 0; \
    +	    iter < pi->nofldrxq; ++iter, ++q)
     
     /* One for errors, one for firmware events */
     #define T4_EXTRA_INTR 2
    @@ -608,82 +674,96 @@ struct adapter {
     static inline uint32_t
     t4_read_reg(struct adapter *sc, uint32_t reg)
     {
    +
     	return bus_space_read_4(sc->bt, sc->bh, reg);
     }
     
     static inline void
     t4_write_reg(struct adapter *sc, uint32_t reg, uint32_t val)
     {
    +
     	bus_space_write_4(sc->bt, sc->bh, reg, val);
     }
     
     static inline uint64_t
     t4_read_reg64(struct adapter *sc, uint32_t reg)
     {
    +
     	return t4_bus_space_read_8(sc->bt, sc->bh, reg);
     }
     
     static inline void
     t4_write_reg64(struct adapter *sc, uint32_t reg, uint64_t val)
     {
    +
     	t4_bus_space_write_8(sc->bt, sc->bh, reg, val);
     }
     
     static inline void
     t4_os_pci_read_cfg1(struct adapter *sc, int reg, uint8_t *val)
     {
    +
     	*val = pci_read_config(sc->dev, reg, 1);
     }
     
     static inline void
     t4_os_pci_write_cfg1(struct adapter *sc, int reg, uint8_t val)
     {
    +
     	pci_write_config(sc->dev, reg, val, 1);
     }
     
     static inline void
     t4_os_pci_read_cfg2(struct adapter *sc, int reg, uint16_t *val)
     {
    +
     	*val = pci_read_config(sc->dev, reg, 2);
     }
     
     static inline void
     t4_os_pci_write_cfg2(struct adapter *sc, int reg, uint16_t val)
     {
    +
     	pci_write_config(sc->dev, reg, val, 2);
     }
     
     static inline void
     t4_os_pci_read_cfg4(struct adapter *sc, int reg, uint32_t *val)
     {
    +
     	*val = pci_read_config(sc->dev, reg, 4);
     }
     
     static inline void
     t4_os_pci_write_cfg4(struct adapter *sc, int reg, uint32_t val)
     {
    +
     	pci_write_config(sc->dev, reg, val, 4);
     }
     
     static inline struct port_info *
     adap2pinfo(struct adapter *sc, int idx)
     {
    +
     	return (sc->port[idx]);
     }
     
     static inline void
     t4_os_set_hw_addr(struct adapter *sc, int idx, uint8_t hw_addr[])
     {
    +
     	bcopy(hw_addr, sc->port[idx]->hw_addr, ETHER_ADDR_LEN);
     }
     
     static inline bool is_10G_port(const struct port_info *pi)
     {
    +
     	return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0);
     }
     
     static inline int tx_resume_threshold(struct sge_eq *eq)
     {
    +
     	return (eq->qsize / 4);
     }
     
    @@ -697,6 +777,11 @@ void t4_os_portmod_changed(const struct 
     void t4_os_link_changed(struct adapter *, int, int);
     void t4_iterate(void (*)(struct adapter *, void *), void *);
     int t4_register_cpl_handler(struct adapter *, int, cpl_handler_t);
    +int t4_register_an_handler(struct adapter *, an_handler_t);
    +int t4_register_fw_msg_handler(struct adapter *, int, fw_msg_handler_t);
    +int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *);
    +int begin_synchronized_op(struct adapter *, struct port_info *, int, char *);
    +void end_synchronized_op(struct adapter *, int);
     
     /* t4_sge.c */
     void t4_sge_modload(void);
    @@ -713,21 +798,45 @@ void t4_intr_all(void *);
     void t4_intr(void *);
     void t4_intr_err(void *);
     void t4_intr_evt(void *);
    -int t4_mgmt_tx(struct adapter *, struct mbuf *);
    -int t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct mbuf *);
    +void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *);
     int t4_eth_tx(struct ifnet *, struct sge_txq *, struct mbuf *);
     void t4_update_fl_bufsize(struct ifnet *);
     int can_resume_tx(struct sge_eq *);
     
    -static inline int t4_wrq_tx(struct adapter *sc, struct sge_wrq *wrq, struct mbuf *m)
    +static inline struct wrqe *
    +alloc_wrqe(int wr_len, struct sge_wrq *wrq)
     {
    -	int rc;
    +	int len = offsetof(struct wrqe, wr) + wr_len;
    +	struct wrqe *wr;
    +
    +	wr = malloc(len, M_CXGBE, M_NOWAIT);
    +	if (__predict_false(wr == NULL))
    +		return (NULL);
    +	wr->wr_len = wr_len;
    +	wr->wrq = wrq;
    +	return (wr);
    +}
    +
    +static inline void *
    +wrtod(struct wrqe *wr)
    +{
    +	return (&wr->wr[0]);
    +}
    +
    +static inline void
    +free_wrqe(struct wrqe *wr)
    +{
    +	free(wr, M_CXGBE);
    +}
    +
    +static inline void
    +t4_wrq_tx(struct adapter *sc, struct wrqe *wr)
    +{
    +	struct sge_wrq *wrq = wr->wrq;
     
     	TXQ_LOCK(wrq);
    -	rc = t4_wrq_tx_locked(sc, wrq, m);
    +	t4_wrq_tx_locked(sc, wrq, wr);
     	TXQ_UNLOCK(wrq);
    -	return (rc);
     }
     
    -
     #endif
    
    Modified: stable/8/sys/dev/cxgbe/common/common.h
    ==============================================================================
    --- stable/8/sys/dev/cxgbe/common/common.h	Sat Mar  2 21:16:40 2013	(r247669)
    +++ stable/8/sys/dev/cxgbe/common/common.h	Sat Mar  2 21:59:07 2013	(r247670)
    @@ -38,6 +38,8 @@ enum {
     	SERNUM_LEN     = 24,    /* Serial # length */
     	EC_LEN         = 16,    /* E/C length */
     	ID_LEN         = 16,    /* ID length */
    +	PN_LEN         = 16,    /* Part Number length */
    +	MACADDR_LEN    = 12,    /* MAC Address length */
     };
     
     enum { MEM_EDC0, MEM_EDC1, MEM_MC };
    @@ -62,8 +64,14 @@ enum {
     };
     
     #define FW_VERSION_MAJOR 1
    -#define FW_VERSION_MINOR 4
    -#define FW_VERSION_MICRO 16
    +#define FW_VERSION_MINOR 8
    +#define FW_VERSION_MICRO 4
    +#define FW_VERSION_BUILD 0
    +
    +#define FW_VERSION (V_FW_HDR_FW_VER_MAJOR(FW_VERSION_MAJOR) | \
    +    V_FW_HDR_FW_VER_MINOR(FW_VERSION_MINOR) | \
    +    V_FW_HDR_FW_VER_MICRO(FW_VERSION_MICRO) | \
    +    V_FW_HDR_FW_VER_BUILD(FW_VERSION_BUILD))
     
     struct port_stats {
     	u64 tx_octets;            /* total # of octets in good frames */
    @@ -219,6 +227,8 @@ struct vpd_params {
     	u8 ec[EC_LEN + 1];
     	u8 sn[SERNUM_LEN + 1];
     	u8 id[ID_LEN + 1];
    +	u8 pn[PN_LEN + 1];
    +	u8 na[MACADDR_LEN + 1];
     };
     
     struct pci_params {
    @@ -356,6 +366,8 @@ void t4_write_indirect(struct adapter *a
     		       unsigned int data_reg, const u32 *vals,
     		       unsigned int nregs, unsigned int start_idx);
     
    +u32 t4_hw_pci_read_cfg4(adapter_t *adapter, int reg);
    +
     struct fw_filter_wr;
     
     void t4_intr_enable(struct adapter *adapter);
    @@ -374,7 +386,7 @@ int t4_seeprom_wp(struct adapter *adapte
     int t4_read_flash(struct adapter *adapter, unsigned int addr, unsigned int nwords,
     		  u32 *data, int byte_oriented);
     int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size);
    -int t4_load_boot(struct adapter *adap, const u8 *boot_data,
    +int t4_load_boot(struct adapter *adap, u8 *boot_data,
                      unsigned int boot_addr, unsigned int size);
     unsigned int t4_flash_cfg_addr(struct adapter *adapter);
     int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size);
    @@ -431,6 +443,9 @@ int t4_mem_read(struct adapter *adap, in
     		__be32 *data);
     
     void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p);
    +void t4_get_port_stats_offset(struct adapter *adap, int idx,
    +		struct port_stats *stats,
    +		struct port_stats *offset);
     void t4_get_lb_stats(struct adapter *adap, int idx, struct lb_port_stats *p);
     void t4_clr_port_stats(struct adapter *adap, int idx);
     
    @@ -472,6 +487,10 @@ int t4_fw_hello(struct adapter *adap, un
     		enum dev_master master, enum dev_state *state);
     int t4_fw_bye(struct adapter *adap, unsigned int mbox);
     int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset);
    +int t4_fw_halt(struct adapter *adap, unsigned int mbox, int force);
    +int t4_fw_restart(struct adapter *adap, unsigned int mbox, int reset);
    +int t4_fw_upgrade(struct adapter *adap, unsigned int mbox,
    +		  const u8 *fw_data, unsigned int size, int force);
     int t4_fw_initialize(struct adapter *adap, unsigned int mbox);
     int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf,
     		    unsigned int vf, unsigned int nparams, const u32 *params,
    @@ -484,6 +503,10 @@ int t4_cfg_pfvf(struct adapter *adap, un
     		unsigned int rxqi, unsigned int rxq, unsigned int tc,
     		unsigned int vi, unsigned int cmask, unsigned int pmask,
     		unsigned int exactf, unsigned int rcaps, unsigned int wxcaps);
    +int t4_alloc_vi_func(struct adapter *adap, unsigned int mbox,
    +		     unsigned int port, unsigned int pf, unsigned int vf,
    +		     unsigned int nmac, u8 *mac, unsigned int *rss_size,
    +		     unsigned int portfunc, unsigned int idstype);
     int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port,
     		unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac,
     		unsigned int *rss_size);
    @@ -504,6 +527,8 @@ int t4_enable_vi(struct adapter *adap, u
     		 bool rx_en, bool tx_en);
     int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid,
     		     unsigned int nblinks);
    +int t4_i2c_rd(struct adapter *adap, unsigned int mbox, unsigned int port_id,
    +	      u8 dev_addr, u8 offset, u8 *valp);
     int t4_mdio_rd(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
     	       unsigned int mmd, unsigned int reg, unsigned int *valp);
     int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
    @@ -524,5 +549,7 @@ int t4_sge_ctxt_rd(struct adapter *adap,
     		   enum ctxt_type ctype, u32 *data);
     int t4_sge_ctxt_rd_bd(struct adapter *adap, unsigned int cid, enum ctxt_type ctype,
     		      u32 *data);
    +int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox);
     int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl);
    +int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, u32 addr, u32 val);
     #endif /* __CHELSIO_COMMON_H */
    
    Modified: stable/8/sys/dev/cxgbe/common/t4_hw.c
    ==============================================================================
    --- stable/8/sys/dev/cxgbe/common/t4_hw.c	Sat Mar  2 21:16:40 2013	(r247669)
    +++ stable/8/sys/dev/cxgbe/common/t4_hw.c	Sat Mar  2 21:59:07 2013	(r247670)
    @@ -1,5 +1,5 @@
     /*-
    - * Copyright (c) 2011 Chelsio Communications, Inc.
    + * Copyright (c) 2012 Chelsio Communications, Inc.
      * All rights reserved.
      *
      * Redistribution and use in source and binary forms, with or without
    @@ -27,13 +27,20 @@
     #include 
     __FBSDID("$FreeBSD$");
     
    +#include "opt_inet.h"
    +
     #include "common.h"
     #include "t4_regs.h"
     #include "t4_regs_values.h"
     #include "firmware/t4fw_interface.h"
     
     #undef msleep
    -#define msleep(x) pause("t4hw", (x) * hz / 1000)
    +#define msleep(x) do { \
    +	if (cold) \
    +		DELAY((x) * 1000); \
    +	else \
    +		pause("t4hw", (x) * hz / 1000); \
    +} while (0)
     
     /**
      *	t4_wait_op_done_val - wait until an operation is completed
    @@ -133,6 +140,50 @@ void t4_write_indirect(struct adapter *a
     }
     
     /*
    + * Read a 32-bit PCI Configuration Space register via the PCI-E backdoor
    + * mechanism.  This guarantees that we get the real value even if we're
    + * operating within a Virtual Machine and the Hypervisor is trapping our
    + * Configuration Space accesses.
    + */
    +u32 t4_hw_pci_read_cfg4(adapter_t *adap, int reg)
    +{
    +	t4_write_reg(adap, A_PCIE_CFG_SPACE_REQ,
    +		     F_ENABLE | F_LOCALCFG | V_FUNCTION(adap->pf) |
    +		     V_REGISTER(reg));
    +	return t4_read_reg(adap, A_PCIE_CFG_SPACE_DATA);
    +}
    +
    +/*
    + *	t4_report_fw_error - report firmware error
    + *	@adap: the adapter
    + *
    + *	The adapter firmware can indicate error conditions to the host.
    + *	This routine prints out the reason for the firmware error (as
    + *	reported by the firmware).
    + */
    +static void t4_report_fw_error(struct adapter *adap)
    +{
    +	static const char *reason[] = {
    +		"Crash",			/* PCIE_FW_EVAL_CRASH */
    +		"During Device Preparation",	/* PCIE_FW_EVAL_PREP */
    +		"During Device Configuration",	/* PCIE_FW_EVAL_CONF */
    +		"During Device Initialization",	/* PCIE_FW_EVAL_INIT */
    +		"Unexpected Event",		/* PCIE_FW_EVAL_UNEXPECTEDEVENT */
    +		"Insufficient Airflow",		/* PCIE_FW_EVAL_OVERHEAT */
    +		"Device Shutdown",		/* PCIE_FW_EVAL_DEVICESHUTDOWN */
    +		"Reserved",			/* reserved */
    +	};
    +	u32 pcie_fw;
    +
    +	pcie_fw = t4_read_reg(adap, A_PCIE_FW);
    +	if (!(pcie_fw & F_PCIE_FW_ERR))
    +		CH_ERR(adap, "Firmware error report called with no error\n");
    +	else
    +		CH_ERR(adap, "Firmware reports adapter error: %s\n",
    +		       reason[G_PCIE_FW_EVAL(pcie_fw)]);
    +}
    +
    +/*
      * Get the reply to a mailbox command and store it in @rpl in big-endian order.
      */
     static void get_mbox_rpl(struct adapter *adap, __be64 *rpl, int nflit,
    @@ -194,7 +245,6 @@ int t4_wr_mbox_meat(struct adapter *adap
     	u64 res;
     	int i, ms, delay_idx;
     	const __be64 *p = cmd;
    -
     	u32 data_reg = PF_REG(mbox, A_CIM_PF_MAILBOX_DATA);
     	u32 ctl_reg = PF_REG(mbox, A_CIM_PF_MAILBOX_CTRL);
     
    @@ -247,8 +297,15 @@ int t4_wr_mbox_meat(struct adapter *adap
     		}
     	}
     
    +	/*
    +	 * We timed out waiting for a reply to our mailbox command.  Report
    +	 * the error and also check to see if the firmware reported any
    +	 * errors ...
    +	 */
     	CH_ERR(adap, "command %#x in mailbox %d timed out\n",
     	       *(const u8 *)cmd, mbox);
    +	if (t4_read_reg(adap, A_PCIE_FW) & F_PCIE_FW_ERR)
    +		t4_report_fw_error(adap);
     	return -ETIMEDOUT;
     }
     
    @@ -281,7 +338,7 @@ int t4_mc_read(struct adapter *adap, u32
     #define MC_DATA(i) MC_BIST_STATUS_REG(A_MC_BIST_STATUS_RDATA, i)
     
     	for (i = 15; i >= 0; i--)
    -		*data++ = htonl(t4_read_reg(adap, MC_DATA(i)));
    +		*data++ = ntohl(t4_read_reg(adap, MC_DATA(i)));
     	if (ecc)
     		*ecc = t4_read_reg64(adap, MC_DATA(16));
     #undef MC_DATA
    @@ -319,7 +376,7 @@ int t4_edc_read(struct adapter *adap, in
     #define EDC_DATA(i) (EDC_BIST_STATUS_REG(A_EDC_BIST_STATUS_RDATA, i) + idx)
     
     	for (i = 15; i >= 0; i--)
    -		*data++ = htonl(t4_read_reg(adap, EDC_DATA(i)));
    +		*data++ = ntohl(t4_read_reg(adap, EDC_DATA(i)));
     	if (ecc)
     		*ecc = t4_read_reg64(adap, EDC_DATA(16));
     #undef EDC_DATA
    @@ -564,7 +621,7 @@ static int get_vpd_keyword_val(const str
     static int get_vpd_params(struct adapter *adapter, struct vpd_params *p)
     {
     	int i, ret, addr;
    -	int ec, sn;
    +	int ec, sn, pn, na;
     	u8 vpd[VPD_LEN], csum;
     	const struct t4_vpd_hdr *v;
     
    @@ -600,6 +657,8 @@ static int get_vpd_params(struct adapter
     	}
     	FIND_VPD_KW(ec, "EC");
     	FIND_VPD_KW(sn, "SN");
    +	FIND_VPD_KW(pn, "PN");
    +	FIND_VPD_KW(na, "NA");
     #undef FIND_VPD_KW
     
     	memcpy(p->id, v->id_data, ID_LEN);
    @@ -609,6 +668,10 @@ static int get_vpd_params(struct adapter
     	i = vpd[sn - VPD_INFO_FLD_HDR_SIZE + 2];
     	memcpy(p->sn, vpd + sn, min(i, SERNUM_LEN));
     	strstrip(p->sn);
    +	memcpy(p->pn, vpd + pn, min(i, PN_LEN));
    +	strstrip((char *)p->pn);
    +	memcpy(p->na, vpd + na, min(i, MACADDR_LEN));
    +	strstrip((char *)p->na);
     
     	return 0;
     }
    @@ -952,7 +1015,7 @@ int t4_load_cfg(struct adapter *adap, co
     	if (ret || size == 0)
     		goto out;
     
    -        /* this will write to the flash up to SF_PAGE_SIZE at a time */
    +	/* this will write to the flash up to SF_PAGE_SIZE at a time */
     	for (i = 0; i< size; i+= SF_PAGE_SIZE) {
     		if ( (size - i) <  SF_PAGE_SIZE) 
     			n = size - i;
    @@ -1054,42 +1117,209 @@ out:
     	return ret;
     }
     
    -/* BIOS boot header */
    -typedef struct boot_header_s {
    -	u8	signature[2];	/* signature */
    -	u8	length;		/* image length (include header) */
    -	u8	offset[4];	/* initialization vector */
    -	u8	reserved[19];	/* reserved */
    -	u8	exheader[2];	/* offset to expansion header */
    -} boot_header_t;
    +/* BIOS boot headers */
    +typedef struct pci_expansion_rom_header {
    +	u8	signature[2]; /* ROM Signature. Should be 0xaa55 */
    +	u8	reserved[22]; /* Reserved per processor Architecture data */
    +	u8	pcir_offset[2]; /* Offset to PCI Data Structure */
    +} pci_exp_rom_header_t; /* PCI_EXPANSION_ROM_HEADER */
    +
    +/* Legacy PCI Expansion ROM Header */
    +typedef struct legacy_pci_expansion_rom_header {
    +	u8	signature[2]; /* ROM Signature. Should be 0xaa55 */
    +	u8	size512; /* Current Image Size in units of 512 bytes */
    +	u8	initentry_point[4];
    +	u8	cksum; /* Checksum computed on the entire Image */
    +	u8	reserved[16]; /* Reserved */
    +	u8	pcir_offset[2]; /* Offset to PCI Data Struture */
    +} legacy_pci_exp_rom_header_t; /* LEGACY_PCI_EXPANSION_ROM_HEADER */
    +
    +/* EFI PCI Expansion ROM Header */
    +typedef struct efi_pci_expansion_rom_header {
    +	u8	signature[2]; // ROM signature. The value 0xaa55
    +	u8	initialization_size[2]; /* Units 512. Includes this header */
    +	u8	efi_signature[4]; /* Signature from EFI image header. 0x0EF1 */
    +	u8	efi_subsystem[2]; /* Subsystem value for EFI image header */
    +	u8	efi_machine_type[2]; /* Machine type from EFI image header */
    +	u8	compression_type[2]; /* Compression type. */
    +		/* 
    +		 * Compression type definition
    +		 * 0x0: uncompressed
    +		 * 0x1: Compressed
    +		 * 0x2-0xFFFF: Reserved
    +		 */
    +	u8	reserved[8]; /* Reserved */
    +	u8	efi_image_header_offset[2]; /* Offset to EFI Image */
    +	u8	pcir_offset[2]; /* Offset to PCI Data Structure */
    +} efi_pci_exp_rom_header_t; /* EFI PCI Expansion ROM Header */
    +
    +/* PCI Data Structure Format */
    +typedef struct pcir_data_structure { /* PCI Data Structure */
    +	u8	signature[4]; /* Signature. The string "PCIR" */
    +	u8	vendor_id[2]; /* Vendor Identification */
    +	u8	device_id[2]; /* Device Identification */
    +	u8	vital_product[2]; /* Pointer to Vital Product Data */
    +	u8	length[2]; /* PCIR Data Structure Length */
    +	u8	revision; /* PCIR Data Structure Revision */
    +	u8	class_code[3]; /* Class Code */
    +	u8	image_length[2]; /* Image Length. Multiple of 512B */
    +	u8	code_revision[2]; /* Revision Level of Code/Data */
    +	u8	code_type; /* Code Type. */
    +		/*
    +		 * PCI Expansion ROM Code Types
    +		 * 0x00: Intel IA-32, PC-AT compatible. Legacy
    +		 * 0x01: Open Firmware standard for PCI. FCODE
    +		 * 0x02: Hewlett-Packard PA RISC. HP reserved
    +		 * 0x03: EFI Image. EFI
    +		 * 0x04-0xFF: Reserved.
    +		 */
    +	u8	indicator; /* Indicator. Identifies the last image in the ROM */
    +	u8	reserved[2]; /* Reserved */
    +} pcir_data_t; /* PCI__DATA_STRUCTURE */
     
    +/* BOOT constants */
     enum {
     	BOOT_FLASH_BOOT_ADDR = 0x0,/* start address of boot image in flash */
     	BOOT_SIGNATURE = 0xaa55,   /* signature of BIOS boot ROM */
     	BOOT_SIZE_INC = 512,       /* image size measured in 512B chunks */
    -	BOOT_MIN_SIZE = sizeof(boot_header_t), /* at least basic header */
    -	BOOT_MAX_SIZE = 1024*BOOT_SIZE_INC /* 1 byte * length increment  */
    +	BOOT_MIN_SIZE = sizeof(pci_exp_rom_header_t), /* basic header */
    +	BOOT_MAX_SIZE = 1024*BOOT_SIZE_INC, /* 1 byte * length increment  */
    +	VENDOR_ID = 0x1425, /* Vendor ID */
    +	PCIR_SIGNATURE = 0x52494350 /* PCIR signature */
     };
     
     /*
    + *	modify_device_id - Modifies the device ID of the Boot BIOS image 
    + *	@adatper: the device ID to write.
    + *	@boot_data: the boot image to modify.
    + *
    + *	Write the supplied device ID to the boot BIOS image.
    + */
    +static void modify_device_id(int device_id, u8 *boot_data)
    +{
    +	legacy_pci_exp_rom_header_t *header;
    +	pcir_data_t *pcir_header;
    +	u32 cur_header = 0;
    +
    +	/*
    +	 * Loop through all chained images and change the device ID's
    +	 */
    +	while (1) {
    +		header = (legacy_pci_exp_rom_header_t *) &boot_data[cur_header];
    +		pcir_header = (pcir_data_t *) &boot_data[cur_header +
    +		    le16_to_cpu(*(u16*)header->pcir_offset)];
    +
    +		/*
    +		 * Only modify the Device ID if code type is Legacy or HP.
    +		 * 0x00: Okay to modify
    +		 * 0x01: FCODE. Do not be modify
    +		 * 0x03: Okay to modify
    +		 * 0x04-0xFF: Do not modify
    +		 */
    +		if (pcir_header->code_type == 0x00) {
    +			u8 csum = 0;
    +			int i;
    +
    +			/*
    +			 * Modify Device ID to match current adatper
    +			 */
    +			*(u16*) pcir_header->device_id = device_id;
    +
    +			/*
    +			 * Set checksum temporarily to 0.
    +			 * We will recalculate it later.
    +			 */
    +			header->cksum = 0x0;
    +
    +			/*
    +			 * Calculate and update checksum
    +			 */
    +			for (i = 0; i < (header->size512 * 512); i++)
    +				csum += (u8)boot_data[cur_header + i];
    +
    +			/*
    +			 * Invert summed value to create the checksum
    +			 * Writing new checksum value directly to the boot data
    +			 */
    +			boot_data[cur_header + 7] = -csum;
    +
    +		} else if (pcir_header->code_type == 0x03) {
    +
    +			/*
    +			 * Modify Device ID to match current adatper
    +			 */
    +			*(u16*) pcir_header->device_id = device_id;
    +
    +		}
    +
    +
    +		/*
    +		 * Check indicator element to identify if this is the last
    +		 * image in the ROM.
    +		 */
    +		if (pcir_header->indicator & 0x80)
    +			break;
    +
    +		/*
    +		 * Move header pointer up to the next image in the ROM.
    +		 */
    +		cur_header += header->size512 * 512;
    +	}
    +}
    +
    +/*
      *	t4_load_boot - download boot flash
      *	@adapter: the adapter
      *	@boot_data: the boot image to write
    + *	@boot_addr: offset in flash to write boot_data
      *	@size: image size
      *
      *	Write the supplied boot image to the card's serial flash.
      *	The boot image has the following sections: a 28-byte header and the
      *	boot image.
      */
    -int t4_load_boot(struct adapter *adap, const u8 *boot_data, 
    +int t4_load_boot(struct adapter *adap, u8 *boot_data, 
     		 unsigned int boot_addr, unsigned int size)
     {
    +	pci_exp_rom_header_t *header;
    +	int pcir_offset ;
    +	pcir_data_t *pcir_header;
     	int ret, addr;
    +	uint16_t device_id;
     	unsigned int i;
    
    *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 22:19:18 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
     by hub.freebsd.org (Postfix) with ESMTP id 06A8699B;
     Sat,  2 Mar 2013 22:19:18 +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 D66666CF;
     Sat,  2 Mar 2013 22:19:17 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22MJH6c065174;
     Sat, 2 Mar 2013 22:19:17 GMT (envelope-from mav@svn.freebsd.org)
    Received: (from mav@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22MJHKh065172;
     Sat, 2 Mar 2013 22:19:17 GMT (envelope-from mav@svn.freebsd.org)
    Message-Id: <201303022219.r22MJHKh065172@svn.freebsd.org>
    From: Alexander Motin 
    Date: Sat, 2 Mar 2013 22:19:17 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247671 - head/sys/ofed/include/linux
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 22:19:18 -0000
    
    Author: mav
    Date: Sat Mar  2 22:19:17 2013
    New Revision: 247671
    URL: http://svnweb.freebsd.org/changeset/base/247671
    
    Log:
      MFcalloutng:
      Give OFED Linux wrapper own "expires" field instead of abusing callout's
      c_time, which will change its type and units with calloutng commit.
    
    Modified:
      head/sys/ofed/include/linux/timer.h
    
    Modified: head/sys/ofed/include/linux/timer.h
    ==============================================================================
    --- head/sys/ofed/include/linux/timer.h	Sat Mar  2 21:59:07 2013	(r247670)
    +++ head/sys/ofed/include/linux/timer.h	Sat Mar  2 22:19:17 2013	(r247671)
    @@ -37,11 +37,10 @@
     struct timer_list {
     	struct callout	timer_callout;
     	void		(*function)(unsigned long);
    -        unsigned long	data;
    +	unsigned long	data;
    +	unsigned long	expires;
     };
     
    -#define	expires	timer_callout.c_time
    -
     static inline void
     _timer_fn(void *context)
     {
    @@ -65,13 +64,16 @@ do {									\
     	callout_init(&(timer)->timer_callout, CALLOUT_MPSAFE);		\
     } while (0)
     
    -#define	mod_timer(timer, expire)					\
    -	callout_reset(&(timer)->timer_callout, (expire) - jiffies,	\
    -	    _timer_fn, (timer))
    +#define	mod_timer(timer, exp)						\
    +do {									\
    +	(timer)->expires = exp;						\
    +	callout_reset(&(timer)->timer_callout, (exp) - jiffies,		\
    +	    _timer_fn, (timer));					\
    +} while (0)
     
     #define	add_timer(timer)						\
     	callout_reset(&(timer)->timer_callout,				\
    -	    (timer)->timer_callout.c_time - jiffies, _timer_fn, (timer))
    +	    (timer)->expires - jiffies, _timer_fn, (timer))
     
     #define	del_timer(timer)	callout_stop(&(timer)->timer_callout)
     #define	del_timer_sync(timer)	callout_drain(&(timer)->timer_callout)
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 22:28:21 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 187E8D73;
     Sat,  2 Mar 2013 22:28:21 +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 0B7E271D;
     Sat,  2 Mar 2013 22:28:21 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22MSKla068111;
     Sat, 2 Mar 2013 22:28:20 GMT (envelope-from mav@svn.freebsd.org)
    Received: (from mav@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22MSKUV068110;
     Sat, 2 Mar 2013 22:28:20 GMT (envelope-from mav@svn.freebsd.org)
    Message-Id: <201303022228.r22MSKUV068110@svn.freebsd.org>
    From: Alexander Motin 
    Date: Sat, 2 Mar 2013 22:28:20 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247673 - head/sys/sys
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 22:28:21 -0000
    
    Author: mav
    Date: Sat Mar  2 22:28:20 2013
    New Revision: 247673
    URL: http://svnweb.freebsd.org/changeset/base/247673
    
    Log:
      Polish few spaces/tabs.
    
    Modified:
      head/sys/sys/time.h
    
    Modified: head/sys/sys/time.h
    ==============================================================================
    --- head/sys/sys/time.h	Sat Mar  2 22:24:43 2013	(r247672)
    +++ head/sys/sys/time.h	Sat Mar  2 22:28:20 2013	(r247673)
    @@ -113,7 +113,7 @@ bintime_mul(struct bintime *bt, u_int x)
     #define	SBT_1M	(SBT_1S * 60)
     #define	SBT_1MS	(SBT_1S / 1000)
     #define	SBT_1US	(SBT_1S / 1000000)
    -#define	SBT_1NS (SBT_1S / 1000000000)  
    +#define	SBT_1NS	(SBT_1S / 1000000000)
     
     static __inline int
     sbintime_getsec(sbintime_t sbt)
    @@ -133,7 +133,7 @@ static __inline struct bintime
     sbttobt(sbintime_t sbt)
     {
     	struct bintime bt;
    -	
    +
     	bt.sec = sbt >> 32;
     	bt.frac = sbt << 32;
     	return (bt);
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 22:41:06 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id AC98426F;
     Sat,  2 Mar 2013 22:41:06 +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 9F2E077B;
     Sat,  2 Mar 2013 22:41:06 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22Mf6Pr073478;
     Sat, 2 Mar 2013 22:41:06 GMT (envelope-from mav@svn.freebsd.org)
    Received: (from mav@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22Mf66f073477;
     Sat, 2 Mar 2013 22:41:06 GMT (envelope-from mav@svn.freebsd.org)
    Message-Id: <201303022241.r22Mf66f073477@svn.freebsd.org>
    From: Alexander Motin 
    Date: Sat, 2 Mar 2013 22:41:06 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247675 - head/sys/ofed/include/linux
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 22:41:06 -0000
    
    Author: mav
    Date: Sat Mar  2 22:41:06 2013
    New Revision: 247675
    URL: http://svnweb.freebsd.org/changeset/base/247675
    
    Log:
      Add protective parentheses for macro argument, missed in r247671.
    
    Modified:
      head/sys/ofed/include/linux/timer.h
    
    Modified: head/sys/ofed/include/linux/timer.h
    ==============================================================================
    --- head/sys/ofed/include/linux/timer.h	Sat Mar  2 22:34:33 2013	(r247674)
    +++ head/sys/ofed/include/linux/timer.h	Sat Mar  2 22:41:06 2013	(r247675)
    @@ -66,7 +66,7 @@ do {									\
     
     #define	mod_timer(timer, exp)						\
     do {									\
    -	(timer)->expires = exp;						\
    +	(timer)->expires = (exp);					\
     	callout_reset(&(timer)->timer_callout, (exp) - jiffies,		\
     	    _timer_fn, (timer));					\
     } while (0)
    
    From owner-svn-src-all@FreeBSD.ORG  Sat Mar  2 23:40:43 2013
    Return-Path: 
    Delivered-To: svn-src-all@freebsd.org
    Received: from mx1.freebsd.org (mx1.freebsd.org
     [IPv6:2001:1900:2254:206a::19:1])
     by hub.freebsd.org (Postfix) with ESMTP id 4CE0320B;
     Sat,  2 Mar 2013 23:40:43 +0000 (UTC) (envelope-from pjd@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 2723898F;
     Sat,  2 Mar 2013 23:40:43 +0000 (UTC)
    Received: from svn.freebsd.org ([127.0.1.70])
     by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r22Nehdd090163;
     Sat, 2 Mar 2013 23:40:43 GMT (envelope-from pjd@svn.freebsd.org)
    Received: (from pjd@localhost)
     by svn.freebsd.org (8.14.5/8.14.5/Submit) id r22NehE2090162;
     Sat, 2 Mar 2013 23:40:43 GMT (envelope-from pjd@svn.freebsd.org)
    Message-Id: <201303022340.r22NehE2090162@svn.freebsd.org>
    From: Pawel Jakub Dawidek 
    Date: Sat, 2 Mar 2013 23:40:42 +0000 (UTC)
    To: src-committers@freebsd.org, svn-src-all@freebsd.org,
     svn-src-head@freebsd.org
    Subject: svn commit: r247676 - head/tools/regression/capsicum/syscalls
    X-SVN-Group: head
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    X-BeenThere: svn-src-all@freebsd.org
    X-Mailman-Version: 2.1.14
    Precedence: list
    List-Id: "SVN commit messages for the entire src tree \(except for "
     user" and " projects" \)" 
    List-Unsubscribe: ,
     
    List-Archive: 
    List-Post: 
    List-Help: 
    List-Subscribe: ,
     
    X-List-Received-Date: Sat, 02 Mar 2013 23:40:43 -0000
    
    Author: pjd
    Date: Sat Mar  2 23:40:42 2013
    New Revision: 247676
    URL: http://svnweb.freebsd.org/changeset/base/247676
    
    Log:
      If all ioctls are allowed, cap_ioctls_get(2) will return CAP_IOCTLS_ALL.
      Update regression tests.
    
    Modified:
      head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c
    
    Modified: head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c
    ==============================================================================
    --- head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c	Sat Mar  2 22:41:06 2013	(r247675)
    +++ head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c	Sat Mar  2 23:40:42 2013	(r247676)
    @@ -51,7 +51,7 @@ ioctl_tests_0(int fd)
     {
     	unsigned long cmds[2];
     
    -	CHECK(cap_ioctls_get(fd, NULL, 0) == INT_MAX);
    +	CHECK(cap_ioctls_get(fd, NULL, 0) == CAP_IOCTLS_ALL);
     
     	CHECK(fcntl(fd, F_GETFD) == 0);
     	CHECK(ioctl(fd, FIOCLEX) == 0);
    @@ -241,7 +241,7 @@ ioctl_tests_recv_0(int sock)
     
     	CHECK(descriptor_recv(sock, &fd) == 0);
     
    -	CHECK(cap_ioctls_get(fd, NULL, 0) == INT_MAX);
    +	CHECK(cap_ioctls_get(fd, NULL, 0) == CAP_IOCTLS_ALL);
     
     	CHECK(fcntl(fd, F_GETFD) == 0);
     	CHECK(ioctl(fd, FIOCLEX) == 0);