From owner-svn-src-all@FreeBSD.ORG Sun Oct 6 05:50:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3DE10E69; Sun, 6 Oct 2013 05:50:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0973F2873; Sun, 6 Oct 2013 05:50:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r965otif019891; Sun, 6 Oct 2013 05:50:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r965otU2019890; Sun, 6 Oct 2013 05:50:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310060550.r965otU2019890@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 6 Oct 2013 05:50: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: r256074 - 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: Sun, 06 Oct 2013 05:50:56 -0000 Author: kib Date: Sun Oct 6 05:50:55 2013 New Revision: 256074 URL: http://svnweb.freebsd.org/changeset/base/256074 Log: MFC r255798: Pre-acquire the filedesc sx when a possibility exists that the later code could need to remove a kqueue from the filedesc list. Modified: stable/9/sys/kern/kern_event.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_event.c ============================================================================== --- stable/9/sys/kern/kern_event.c Sat Oct 5 23:11:01 2013 (r256073) +++ stable/9/sys/kern/kern_event.c Sun Oct 6 05:50:55 2013 (r256074) @@ -965,12 +965,13 @@ kqueue_register(struct kqueue *kq, struc struct file *fp; struct knote *kn, *tkn; int error, filt, event; - int haskqglobal; + int haskqglobal, filedesc_unlock; fp = NULL; kn = NULL; error = 0; haskqglobal = 0; + filedesc_unlock = 0; filt = kev->filter; fops = kqueue_fo_find(filt); @@ -1010,6 +1011,13 @@ findkn: goto done; } + /* + * Pre-lock the filedesc before the global + * lock mutex, see the comment in + * kqueue_close(). + */ + FILEDESC_XLOCK(td->td_proc->p_fd); + filedesc_unlock = 1; KQ_GLOBAL_LOCK(&kq_global, haskqglobal); } @@ -1039,6 +1047,10 @@ findkn: /* knote is in the process of changing, wait for it to stablize. */ if (kn != NULL && (kn->kn_status & KN_INFLUX) == KN_INFLUX) { KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal); + if (filedesc_unlock) { + FILEDESC_XUNLOCK(td->td_proc->p_fd); + filedesc_unlock = 0; + } kq->kq_state |= KQ_FLUXWAIT; msleep(kq, &kq->kq_lock, PSOCK | PDROP, "kqflxwt", 0); if (fp != NULL) { @@ -1155,6 +1167,8 @@ done_ev_add: done: KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal); + if (filedesc_unlock) + FILEDESC_XUNLOCK(td->td_proc->p_fd); if (fp != NULL) fdrop(fp, td); if (tkn != NULL) @@ -1642,10 +1656,12 @@ kqueue_close(struct file *fp, struct thr struct knote *kn; int i; int error; + int filedesc_unlock; if ((error = kqueue_acquire(fp, &kq))) return error; + filedesc_unlock = 0; KQ_LOCK(kq); KASSERT((kq->kq_state & KQ_CLOSING) != KQ_CLOSING, @@ -1707,9 +1723,20 @@ kqueue_close(struct file *fp, struct thr KQ_UNLOCK(kq); - FILEDESC_XLOCK(fdp); + /* + * We could be called due to the knote_drop() doing fdrop(), + * called from kqueue_register(). In this case the global + * lock is owned, and filedesc sx is locked before, to not + * take the sleepable lock after non-sleepable. + */ + if (!sx_xlocked(FILEDESC_LOCK(fdp))) { + FILEDESC_XLOCK(fdp); + filedesc_unlock = 1; + } else + filedesc_unlock = 0; TAILQ_REMOVE(&fdp->fd_kqlist, kq, kq_list); - FILEDESC_XUNLOCK(fdp); + if (filedesc_unlock) + FILEDESC_XUNLOCK(fdp); seldrain(&kq->kq_sel); knlist_destroy(&kq->kq_sel.si_note); From owner-svn-src-all@FreeBSD.ORG Sun Oct 6 05:53:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 032CB110; Sun, 6 Oct 2013 05:53:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DCC242883; Sun, 6 Oct 2013 05:53:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r965rTfY020964; Sun, 6 Oct 2013 05:53:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r965rTIK020963; Sun, 6 Oct 2013 05:53:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310060553.r965rTIK020963@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 6 Oct 2013 05:53: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: r256075 - stable/9/sys/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: Sun, 06 Oct 2013 05:53:30 -0000 Author: kib Date: Sun Oct 6 05:53:29 2013 New Revision: 256075 URL: http://svnweb.freebsd.org/changeset/base/256075 Log: MFC r255945: Make the mac_policy_rm lock recursable, which allows reentrance into the mac framework. Modified: stable/9/sys/security/mac/mac_framework.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/security/mac/mac_framework.c ============================================================================== --- stable/9/sys/security/mac/mac_framework.c Sun Oct 6 05:50:55 2013 (r256074) +++ stable/9/sys/security/mac/mac_framework.c Sun Oct 6 05:53:29 2013 (r256075) @@ -292,7 +292,8 @@ mac_init(void) mac_labelzone_init(); #ifndef MAC_STATIC - rm_init_flags(&mac_policy_rm, "mac_policy_rm", RM_NOWITNESS); + rm_init_flags(&mac_policy_rm, "mac_policy_rm", RM_NOWITNESS | + RM_RECURSE); sx_init_flags(&mac_policy_sx, "mac_policy_sx", SX_NOWITNESS); #endif } From owner-svn-src-all@FreeBSD.ORG Sun Oct 6 06:05:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ABFB83D6; Sun, 6 Oct 2013 06:05:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D65728F7; Sun, 6 Oct 2013 06:05:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9665CKW026972; Sun, 6 Oct 2013 06:05:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9665C29026970; Sun, 6 Oct 2013 06:05:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310060605.r9665C29026970@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 6 Oct 2013 06:05: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: r256076 - in stable/9/sys: kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 06 Oct 2013 06:05:12 -0000 Author: kib Date: Sun Oct 6 06:05:11 2013 New Revision: 256076 URL: http://svnweb.freebsd.org/changeset/base/256076 Log: MFC r255940: Add LK_TRYUPGRADE operation for lockmgr(9). Modified: stable/9/sys/kern/kern_lock.c stable/9/sys/sys/lockmgr.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/kern/kern_lock.c ============================================================================== --- stable/9/sys/kern/kern_lock.c Sun Oct 6 05:53:29 2013 (r256075) +++ stable/9/sys/kern/kern_lock.c Sun Oct 6 06:05:11 2013 (r256076) @@ -490,6 +490,7 @@ __lockmgr_args(struct lock *lk, u_int fl op = LK_EXCLUSIVE; break; case LK_UPGRADE: + case LK_TRYUPGRADE: case LK_DOWNGRADE: _lockmgr_assert(lk, KA_XLOCKED | KA_NOTRECURSED, file, line); @@ -687,6 +688,7 @@ __lockmgr_args(struct lock *lk, u_int fl } break; case LK_UPGRADE: + case LK_TRYUPGRADE: _lockmgr_assert(lk, KA_SLOCKED, file, line); v = lk->lk_lock; x = v & LK_ALL_WAITERS; @@ -707,6 +709,17 @@ __lockmgr_args(struct lock *lk, u_int fl } /* + * In LK_TRYUPGRADE mode, do not drop the lock, + * returning EBUSY instead. + */ + if (op == LK_TRYUPGRADE) { + LOCK_LOG2(lk, "%s: %p failed the nowait upgrade", + __func__, lk); + error = EBUSY; + break; + } + + /* * We have been unable to succeed in upgrading, so just * give up the shared lock. */ Modified: stable/9/sys/sys/lockmgr.h ============================================================================== --- stable/9/sys/sys/lockmgr.h Sun Oct 6 05:53:29 2013 (r256075) +++ stable/9/sys/sys/lockmgr.h Sun Oct 6 06:05:11 2013 (r256076) @@ -168,6 +168,7 @@ _lockmgr_args_rw(struct lock *lk, u_int #define LK_RELEASE 0x100000 #define LK_SHARED 0x200000 #define LK_UPGRADE 0x400000 +#define LK_TRYUPGRADE 0x800000 #define LK_TOTAL_MASK (LK_INIT_MASK | LK_EATTR_MASK | LK_TYPE_MASK) From owner-svn-src-all@FreeBSD.ORG Sun Oct 6 06:09:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BF04C538; Sun, 6 Oct 2013 06:09:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AAB822915; Sun, 6 Oct 2013 06:09:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9669hNw028287; Sun, 6 Oct 2013 06:09:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9669hQM028286; Sun, 6 Oct 2013 06:09:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310060609.r9669hQM028286@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 6 Oct 2013 06:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256077 - 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: Sun, 06 Oct 2013 06:09:43 -0000 Author: kib Date: Sun Oct 6 06:09:43 2013 New Revision: 256077 URL: http://svnweb.freebsd.org/changeset/base/256077 Log: MFC r255941: Increase the chance of the buffer write from the bufdaemon helper context to succeed. If the locked vnode which owns the buffer to be written is shared locked, try the non-blocking upgrade of the lock to exclusive. Modified: stable/9/sys/kern/vfs_bio.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_bio.c ============================================================================== --- stable/9/sys/kern/vfs_bio.c Sun Oct 6 06:05:11 2013 (r256076) +++ stable/9/sys/kern/vfs_bio.c Sun Oct 6 06:09:43 2013 (r256077) @@ -2671,6 +2671,8 @@ flushbufqueues(struct vnode *lvp, int qu int hasdeps; int flushed; int target; + int error; + bool unlock; if (lvp == NULL) { target = numdirtybuffers - lodirtybuffers; @@ -2751,7 +2753,16 @@ flushbufqueues(struct vnode *lvp, int qu BUF_UNLOCK(bp); continue; } - if (vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_CANRECURSE) == 0) { + if (lvp == NULL) { + unlock = true; + error = vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT); + } else { + ASSERT_VOP_LOCKED(vp, "getbuf"); + unlock = false; + error = VOP_ISLOCKED(vp) == LK_EXCLUSIVE ? 0 : + vn_lock(vp, LK_TRYUPGRADE); + } + if (error == 0) { mtx_unlock(&bqlock); CTR3(KTR_BUF, "flushbufqueue(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); @@ -2763,7 +2774,8 @@ flushbufqueues(struct vnode *lvp, int qu notbufdflashes++; } vn_finished_write(mp); - VOP_UNLOCK(vp, 0); + if (unlock) + VOP_UNLOCK(vp, 0); flushwithdeps += hasdeps; flushed++; From owner-svn-src-all@FreeBSD.ORG Sun Oct 6 06:14:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5EDAF694; Sun, 6 Oct 2013 06:14:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A05B294F; Sun, 6 Oct 2013 06:14:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r966EU4i032257; Sun, 6 Oct 2013 06:14:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r966EU5x032256; Sun, 6 Oct 2013 06:14:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310060614.r966EU5x032256@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 6 Oct 2013 06:14: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: r256078 - 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: Sun, 06 Oct 2013 06:14:30 -0000 Author: kib Date: Sun Oct 6 06:14:29 2013 New Revision: 256078 URL: http://svnweb.freebsd.org/changeset/base/256078 Log: MFC r255942: For vunref(), try to upgrade the vnode lock if the function was called with the vnode shared-locked. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Sun Oct 6 06:09:43 2013 (r256077) +++ stable/9/sys/kern/vfs_subr.c Sun Oct 6 06:14:29 2013 (r256078) @@ -2343,8 +2343,10 @@ vputx(struct vnode *vp, int func) } break; case VPUTX_VUNREF: - if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) - error = EBUSY; + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + error = VOP_LOCK(vp, LK_TRYUPGRADE | LK_INTERLOCK); + VI_LOCK(vp); + } break; } if (vp->v_usecount > 0) From owner-svn-src-all@FreeBSD.ORG Sun Oct 6 06:57:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 505CDC96; Sun, 6 Oct 2013 06:57:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3AEBB2AAE; Sun, 6 Oct 2013 06:57:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r966vTSM053950; Sun, 6 Oct 2013 06:57:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r966vT11053949; Sun, 6 Oct 2013 06:57:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310060657.r966vT11053949@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 6 Oct 2013 06:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256079 - in head/sys: conf 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: Sun, 06 Oct 2013 06:57:29 -0000 Author: kib Date: Sun Oct 6 06:57:28 2013 New Revision: 256079 URL: http://svnweb.freebsd.org/changeset/base/256079 Log: Remove the uipc_cow.c file, which is not used since the zero copy sockets removal. Noted by: alc Sponsored by: The FreeBSD Foundation Approved by: re (delphij) Deleted: head/sys/kern/uipc_cow.c Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Oct 6 06:14:29 2013 (r256078) +++ head/sys/conf/files Sun Oct 6 06:57:28 2013 (r256079) @@ -2919,7 +2919,6 @@ kern/tty_pts.c standard kern/tty_tty.c standard kern/tty_ttydisc.c standard kern/uipc_accf.c optional inet -kern/uipc_cow.c optional socket_send_cow kern/uipc_debug.c optional ddb kern/uipc_domain.c standard kern/uipc_mbuf.c standard From owner-svn-src-all@FreeBSD.ORG Sun Oct 6 10:12:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0E79B492; Sun, 6 Oct 2013 10:12:12 +0000 (UTC) (envelope-from decke@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F11D92257; Sun, 6 Oct 2013 10:12:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r96ACBWO057242; Sun, 6 Oct 2013 10:12:11 GMT (envelope-from decke@svn.freebsd.org) Received: (from decke@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r96ACBH9057241; Sun, 6 Oct 2013 10:12:11 GMT (envelope-from decke@svn.freebsd.org) Message-Id: <201310061012.r96ACBH9057241@svn.freebsd.org> From: Bernhard Froehlich Date: Sun, 6 Oct 2013 10:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256082 - head/contrib/libc++/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: Sun, 06 Oct 2013 10:12:12 -0000 Author: decke (ports committer) Date: Sun Oct 6 10:12:11 2013 New Revision: 256082 URL: http://svnweb.freebsd.org/changeset/base/256082 Log: ename internal function test() to avoid name clashes with common macros. This fixes ports like mysql 5.6 which has an internal macro called test. Approved by: re (gjb) Discussed with: theraven Modified: head/contrib/libc++/include/memory Modified: head/contrib/libc++/include/memory ============================================================================== --- head/contrib/libc++/include/memory Sun Oct 6 09:55:28 2013 (r256081) +++ head/contrib/libc++/include/memory Sun Oct 6 10:12:11 2013 (r256082) @@ -965,13 +965,13 @@ public: namespace __has_pointer_type_imp { - template static __two test(...); - template static char test(typename _Up::pointer* = 0); + template static __two __test(...); + template static char __test(typename _Up::pointer* = 0); } template struct __has_pointer_type - : public integral_constant(0)) == 1> + : public integral_constant(0)) == 1> { }; From owner-svn-src-all@FreeBSD.ORG Sun Oct 6 12:23:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DA1609C0; Sun, 6 Oct 2013 12:23:58 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pa0-x22d.google.com (mail-pa0-x22d.google.com [IPv6:2607:f8b0:400e:c03::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9FC512797; Sun, 6 Oct 2013 12:23:58 +0000 (UTC) Received: by mail-pa0-f45.google.com with SMTP id rd3so6119904pab.4 for ; Sun, 06 Oct 2013 05:23:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=aYp2SDMPjlfRNSdsL0kRZg3USlXSy6kTYv35uT6HEH0=; b=dTHz0rj/M2QHWQbKJjJrnWMO7Ofh69ecBgtmndy8Y+PFna3Ig92SV4AF2gASXpCaSm +n85lIg2nbcO4jmmM28TxUzSdHQ1iTsb1QEvecgv7RA69zlubLqe0HcautrkPjo2Gcly 8DG80ByJTpOfU7leY1BBGUDHvwvAls7J6EbWQp+/psbdAbiOUR9Cw4NnYpBZxokoJJff gPGKTW3iWFEoTbqbyhPMmb3HTHJ4zH5PrAeZRX4PhrNMJRa/BvK5DYWNwtmo7ychbvs3 uQcVn4iKwTU51Vr9TCuN1ynMFnNLKpszqACRNeqBy74RKpGU1xBz+quc1AlR7jdtuUDd fZGA== X-Received: by 10.66.121.201 with SMTP id lm9mr26195886pab.80.1381062238171; Sun, 06 Oct 2013 05:23:58 -0700 (PDT) Received: from [192.168.1.7] (ppp59-167-128-11.static.internode.on.net. [59.167.128.11]) by mx.google.com with ESMTPSA id ab4sm26681528pbc.43.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 06 Oct 2013 05:23:57 -0700 (PDT) Message-ID: <52515651.6050809@FreeBSD.org> Date: Sun, 06 Oct 2013 23:23:45 +1100 From: Kubilay Kocak User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Bryan Venteicher , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r256066 - head/sys/dev/virtio/network References: <201310051807.r95I7P0M048589@svn.freebsd.org> In-Reply-To: <201310051807.r95I7P0M048589@svn.freebsd.org> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: koobs@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: Sun, 06 Oct 2013 12:23:58 -0000 On 6/10/2013 5:07 AM, Bryan Venteicher wrote: > Author: bryanv > Date: Sat Oct 5 18:07:24 2013 > New Revision: 256066 > URL: http://svnweb.freebsd.org/changeset/base/256066 > > Log: > Do not hold the vtnet Rx queue lock when calling up into the stack > > This matches other similar drivers and avoids various LOR warnings. > > Approved by: re (marius) > > Modified: > head/sys/dev/virtio/network/if_vtnet.c > > Modified: head/sys/dev/virtio/network/if_vtnet.c > ============================================================================== > --- head/sys/dev/virtio/network/if_vtnet.c Sat Oct 5 16:22:33 2013 (r256065) > +++ head/sys/dev/virtio/network/if_vtnet.c Sat Oct 5 18:07:24 2013 (r256066) > @@ -1700,9 +1700,9 @@ vtnet_rxq_input(struct vtnet_rxq *rxq, s > rxq->vtnrx_stats.vrxs_ipackets++; > rxq->vtnrx_stats.vrxs_ibytes += m->m_pkthdr.len; > > - /* VTNET_RXQ_UNLOCK(rxq); */ > + VTNET_RXQ_UNLOCK(rxq); > (*ifp->if_input)(ifp, m); > - /* VTNET_RXQ_LOCK(rxq); */ > + VTNET_RXQ_LOCK(rxq); > } > > static int > @@ -1782,6 +1782,10 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) > m_adj(m, adjsz); > > vtnet_rxq_input(rxq, m, hdr); > + > + /* Must recheck after dropping the Rx lock. */ > + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) > + break; > } > > if (deq > 0) > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > Thanks Bryan, confirming no more LOR apparent after this commit :) Is this a good MFC candidate? From owner-svn-src-all@FreeBSD.ORG Sun Oct 6 12:39:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 213A31DA; Sun, 6 Oct 2013 12:39:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0E210280F; Sun, 6 Oct 2013 12:39:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r96CdCf7032951; Sun, 6 Oct 2013 12:39:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r96CdCBH032949; Sun, 6 Oct 2013 12:39:12 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310061239.r96CdCBH032949@svn.freebsd.org> From: Dimitry Andric Date: Sun, 6 Oct 2013 12: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: r256085 - stable/9/contrib/llvm/lib/CodeGen/SelectionDAG 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, 06 Oct 2013 12:39:13 -0000 Author: dim Date: Sun Oct 6 12:39:12 2013 New Revision: 256085 URL: http://svnweb.freebsd.org/changeset/base/256085 Log: MFC r256024: Pull in r186338 from upstream llvm trunk: Remove invalid assert in DAGTypeLegalizer::RemapValue There is a comment at the top of DAGTypeLegalizer::PerformExpensiveChecks which, in part, says: // Note that these invariants may not hold momentarily when processing a node: // the node being processed may be put in a map before being marked Processed. Unfortunately, this assert would be valid only if the above-mentioned invariant held unconditionally. This was causing llc to assert when, in fact, everything was fine. Thanks to Richard Sandiford for investigating this issue! Fixes PR16562. This fixes assertions which could occur in the multimedia/ffmpeg1 and multimedia/ffmpeg2 ports. Reported by: Matthias Apitz Modified: stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp ============================================================================== --- stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Sun Oct 6 12:35:29 2013 (r256084) +++ stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Sun Oct 6 12:39:12 2013 (r256085) @@ -615,7 +615,10 @@ void DAGTypeLegalizer::RemapValue(SDValu // replaced with other values. RemapValue(I->second); N = I->second; - assert(N.getNode()->getNodeId() != NewNode && "Mapped to new node!"); + + // Note that it is possible to have N.getNode()->getNodeId() == NewNode at + // this point because it is possible for a node to be put in the map before + // being processed. } } From owner-svn-src-all@FreeBSD.ORG Sun Oct 6 15:15:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A87EB59E; Sun, 6 Oct 2013 15:15:55 +0000 (UTC) (envelope-from mr.kodiak@gmail.com) Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [IPv6:2607:f8b0:4001:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4FE702F6B; Sun, 6 Oct 2013 15:15:55 +0000 (UTC) Received: by mail-ie0-f172.google.com with SMTP id x13so13495189ief.31 for ; Sun, 06 Oct 2013 08:15:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=a8YmKFFnIccU2PR/jep+jKDv42ZOQXYzghURZYysDMo=; b=pFMezmpu5k6VN2E7fCE+yPsBEyQw2SPH87qYPCtr/eoD5V1pxok9LVkoaDb7t8fj8G gveVi6deAla5VNC+hFec4jyQvtreia2fqxVMUxsjkT4mak5T9HNeawmAHksc7EknoxPt AcEnbszTRTY9XWqUN5k3sOOwGEeOHDJtCLIRwYT8OTptt/0NCJDz/dphce/1Wjhk6t4T LeBPfqGkcfnVWY4Wt0V1kVIPYrP1Efd/J/4CLx4x3Ijp7wRS2s8q+uNwz3K2s+vTR5sM HJZc6VpcYoHCOpdlWOz36tS7HDxaakLP4rfPj+f0upiMEhP7UdGAOnU5kDvJpZkQFKbX 39GA== X-Received: by 10.42.92.84 with SMTP id s20mr21326icm.63.1381072554700; Sun, 06 Oct 2013 08:15:54 -0700 (PDT) MIME-Version: 1.0 Sender: mr.kodiak@gmail.com Received: by 10.64.6.134 with HTTP; Sun, 6 Oct 2013 08:15:24 -0700 (PDT) In-Reply-To: <525080A6.6020505@FreeBSD.org> References: <201310051807.r95I7P0M048589@svn.freebsd.org> <525080A6.6020505@FreeBSD.org> From: Bryan Venteicher Date: Sun, 6 Oct 2013 10:15:24 -0500 X-Google-Sender-Auth: FSYQdzc1aW_ujHezm8C-5hsKdvw Message-ID: Subject: Re: svn commit: r256066 - head/sys/dev/virtio/network To: "Alexander V. Chernikov" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, Bryan Venteicher , 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, 06 Oct 2013 15:15:55 -0000 On Sat, Oct 5, 2013 at 4:12 PM, Alexander V. Chernikov wrote: > On 05.10.2013 22:07, Bryan Venteicher wrote: > > Author: bryanv > > Date: Sat Oct 5 18:07:24 2013 > > New Revision: 256066 > > URL: http://svnweb.freebsd.org/changeset/base/256066 > > > > Log: > > Do not hold the vtnet Rx queue lock when calling up into the stack > Do you measure performance penalty for this? > > I wasn't able to measure anything, but I don't have the most update hardware either. There should hardly ever be any contention and it should be in its own cacheline, so it is about as cheap as a mutex acquire can get. > > This matches other similar drivers and avoids various LOR warnings. > We're currently trying to eliminate such things in other drivers like > ixgbe, maybe there can be some other way to eliminate possible LORs? > > > Agreed - I'd prefer not to do this and that's why I originally had it commented out. I don't think witness was just reporting a false positives either. vtnet's locking scheme is very similar to ixgbe, so fixes ixgbe should translate to vtnet. > > Approved by: re (marius) > > > > Modified: > > head/sys/dev/virtio/network/if_vtnet.c > > > > Modified: head/sys/dev/virtio/network/if_vtnet.c > > > ============================================================================== > > --- head/sys/dev/virtio/network/if_vtnet.c Sat Oct 5 16:22:33 2013 > (r256065) > > +++ head/sys/dev/virtio/network/if_vtnet.c Sat Oct 5 18:07:24 2013 > (r256066) > > @@ -1700,9 +1700,9 @@ vtnet_rxq_input(struct vtnet_rxq *rxq, s > > rxq->vtnrx_stats.vrxs_ipackets++; > > rxq->vtnrx_stats.vrxs_ibytes += m->m_pkthdr.len; > > > > - /* VTNET_RXQ_UNLOCK(rxq); */ > > + VTNET_RXQ_UNLOCK(rxq); > > (*ifp->if_input)(ifp, m); > > - /* VTNET_RXQ_LOCK(rxq); */ > > + VTNET_RXQ_LOCK(rxq); > > } > > > > static int > > @@ -1782,6 +1782,10 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) > > m_adj(m, adjsz); > > > > vtnet_rxq_input(rxq, m, hdr); > > + > > + /* Must recheck after dropping the Rx lock. */ > > + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) > > + break; > > } > > > > if (deq > 0) > > > > > From owner-svn-src-all@FreeBSD.ORG Sun Oct 6 15:16:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D6DD96D2; Sun, 6 Oct 2013 15:16:10 +0000 (UTC) (envelope-from mr.kodiak@gmail.com) Received: from mail-ie0-x22a.google.com (mail-ie0-x22a.google.com [IPv6:2607:f8b0:4001:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E0F62F6D; Sun, 6 Oct 2013 15:16:10 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id x13so13661409ief.1 for ; Sun, 06 Oct 2013 08:16:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=DyodcM8vIVxsZX+82fWaLPrgDke5LRkBzLQlWkxjUkU=; b=YjkyXTqF8GVh2qLvKM1hBIkOVv+T2o4xPGxuE5bnUz/4qrugJjS7BnE1voT7QToc8W y5Q3DCRXH18QV2AGYGOVI2E7wnHeQOBA35ocVZRug9/IhBsQR4HjyrFwMBaRRuPIsOMF 5WeaA2p/BGHe0jwbFfZahMhPLZ0gxL068GPyg1tdy3fGi6o0gLd5Xqve1H+3//hHVHRS rjURZLeqGiDxPaIi5Nv9ed9g04JGodzkODu3DII85FMDpjyJ4j880O9cdOD5dqP/Z8T6 5AdvWHJK7NreaHvcMDLtdJj/wuBpdyEZw6zabYLtAoEt+rvNzLncPJVPdmUZZOgJuF1X laZA== X-Received: by 10.50.62.211 with SMTP id a19mr13793424igs.18.1381072569926; Sun, 06 Oct 2013 08:16:09 -0700 (PDT) MIME-Version: 1.0 Sender: mr.kodiak@gmail.com Received: by 10.64.6.134 with HTTP; Sun, 6 Oct 2013 08:15:39 -0700 (PDT) In-Reply-To: <52515651.6050809@FreeBSD.org> References: <201310051807.r95I7P0M048589@svn.freebsd.org> <52515651.6050809@FreeBSD.org> From: Bryan Venteicher Date: Sun, 6 Oct 2013 10:15:39 -0500 X-Google-Sender-Auth: 5Oq-hQD3Uz5um_N3SsihmtZ7CIM Message-ID: Subject: Re: svn commit: r256066 - head/sys/dev/virtio/network To: koobs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, Bryan Venteicher , 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, 06 Oct 2013 15:16:11 -0000 On Sun, Oct 6, 2013 at 7:23 AM, Kubilay Kocak wrote: > On 6/10/2013 5:07 AM, Bryan Venteicher wrote: > > Author: bryanv > > Date: Sat Oct 5 18:07:24 2013 > > New Revision: 256066 > > URL: http://svnweb.freebsd.org/changeset/base/256066 > > > > Log: > > Do not hold the vtnet Rx queue lock when calling up into the stack > > > > This matches other similar drivers and avoids various LOR warnings. > > > > Approved by: re (marius) > > > > Modified: > > head/sys/dev/virtio/network/if_vtnet.c > > > > Modified: head/sys/dev/virtio/network/if_vtnet.c > > > ============================================================================== > > --- head/sys/dev/virtio/network/if_vtnet.c Sat Oct 5 16:22:33 2013 > (r256065) > > +++ head/sys/dev/virtio/network/if_vtnet.c Sat Oct 5 18:07:24 2013 > (r256066) > > @@ -1700,9 +1700,9 @@ vtnet_rxq_input(struct vtnet_rxq *rxq, s > > rxq->vtnrx_stats.vrxs_ipackets++; > > rxq->vtnrx_stats.vrxs_ibytes += m->m_pkthdr.len; > > > > - /* VTNET_RXQ_UNLOCK(rxq); */ > > + VTNET_RXQ_UNLOCK(rxq); > > (*ifp->if_input)(ifp, m); > > - /* VTNET_RXQ_LOCK(rxq); */ > > + VTNET_RXQ_LOCK(rxq); > > } > > > > static int > > @@ -1782,6 +1782,10 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) > > m_adj(m, adjsz); > > > > vtnet_rxq_input(rxq, m, hdr); > > + > > + /* Must recheck after dropping the Rx lock. */ > > + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) > > + break; > > } > > > > if (deq > 0) > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > > > Thanks Bryan, confirming no more LOR apparent after this commit :) > > Is this a good MFC candidate? The driver in -CURRENT is very different than what is in -STABLE. I'll bundle this change (and any applicable subsequent ones) when I MFC in a month or so. > > From owner-svn-src-all@FreeBSD.ORG Sun Oct 6 15:59:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 226068E4; Sun, 6 Oct 2013 15:59:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0E7052154; Sun, 6 Oct 2013 15:59:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r96Fx6K7039798; Sun, 6 Oct 2013 15:59:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r96Fx6jD039797; Sun, 6 Oct 2013 15:59:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310061559.r96Fx6jD039797@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 6 Oct 2013 15:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256089 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 06 Oct 2013 15:59:07 -0000 Author: kib Date: Sun Oct 6 15:59:06 2013 New Revision: 256089 URL: http://svnweb.freebsd.org/changeset/base/256089 Log: Document LK_TRYUPGRADE. Sponsored by: The FreeBSD Foundation MFC after: 3 days Approved by: re (marius) Modified: head/share/man/man9/lock.9 Modified: head/share/man/man9/lock.9 ============================================================================== --- head/share/man/man9/lock.9 Sun Oct 6 13:01:42 2013 (r256088) +++ head/share/man/man9/lock.9 Sun Oct 6 15:59:06 2013 (r256089) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 16, 2011 +.Dd October 6, 2013 .Dt LOCK 9 .Os .Sh NAME @@ -164,11 +164,17 @@ If an exclusive lock has been recursed, .Xr panic 9 . .It Dv LK_UPGRADE Upgrade a shared lock to an exclusive lock. -If this call fails, the shared lock is lost. +If this call fails, the shared lock is lost, even if the +.Dv LK_NOWAIT +flag is specified. During the upgrade, the shared lock could be temporarily dropped. Attempts to upgrade an exclusive lock will cause a .Xr panic 9 . +.It Dv LK_TRYUPGRADE +Try to upgrade a shared lock to an exclusive lock. +The failure to upgrade does not result in the dropping +of the shared lock ownership. .It Dv LK_RELEASE Release the lock. Releasing a lock that is not held can cause a @@ -333,7 +339,9 @@ fail if: was requested and another thread had already requested a lock upgrade. .It Bq Er EBUSY .Dv LK_NOWAIT -was set, and a sleep would have been required. +was set, and a sleep would have been required, or +.Dv LK_TRYUPGRADE +operation was not able to upgrade the lock. .It Bq Er ENOLCK .Dv LK_SLEEPFAIL was set and From owner-svn-src-all@FreeBSD.ORG Sun Oct 6 16:12:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CE622D06; Sun, 6 Oct 2013 16:12:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BC02C2217; Sun, 6 Oct 2013 16:12:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r96GCjf5048277; Sun, 6 Oct 2013 16:12:45 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r96GCjVr048276; Sun, 6 Oct 2013 16:12:45 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310061612.r96GCjVr048276@svn.freebsd.org> From: Dimitry Andric Date: Sun, 6 Oct 2013 16:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256090 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 06 Oct 2013 16:12:45 -0000 Author: dim Date: Sun Oct 6 16:12:45 2013 New Revision: 256090 URL: http://svnweb.freebsd.org/changeset/base/256090 Log: Pull in r192064 from upstream llvm trunk: X86: Don't fold spills into SSE operations if the stack is unaligned. Regalloc can emit unaligned spills nowadays, but we can't fold the spills into SSE ops if we can't guarantee alignment. PR12250. This fixes unaligned SSE accesses (leading to a SIGBUS) which could occur in the ffmpeg ports. Approved by: re (kib) Reported by: tijl MFC after: 3 days Modified: head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp Modified: head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp Sun Oct 6 15:59:06 2013 (r256089) +++ head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp Sun Oct 6 16:12:45 2013 (r256090) @@ -3881,6 +3881,10 @@ MachineInstr* X86InstrInfo::foldMemoryOp const MachineFrameInfo *MFI = MF.getFrameInfo(); unsigned Size = MFI->getObjectSize(FrameIndex); unsigned Alignment = MFI->getObjectAlignment(FrameIndex); + // If the function stack isn't realigned we don't want to fold instructions + // that need increased alignment. + if (!RI.needsStackRealignment(MF)) + Alignment = std::min(Alignment, TM.getFrameLowering()->getStackAlignment()); if (Ops.size() == 2 && Ops[0] == 0 && Ops[1] == 1) { unsigned NewOpc = 0; unsigned RCSize = 0; From owner-svn-src-all@FreeBSD.ORG Sun Oct 6 19:47:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 18A3B25F; Sun, 6 Oct 2013 19:47:07 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E08012C4C; Sun, 6 Oct 2013 19:47:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r96Jl6VL062234; Sun, 6 Oct 2013 19:47:06 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r96Jl6N2062233; Sun, 6 Oct 2013 19:47:06 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310061947.r96Jl6N2062233@svn.freebsd.org> From: Glen Barber Date: Sun, 6 Oct 2013 19:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256092 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 06 Oct 2013 19:47:07 -0000 Author: gjb Date: Sun Oct 6 19:47:06 2013 New Revision: 256092 URL: http://svnweb.freebsd.org/changeset/base/256092 Log: Update head/ to 10.0-ALPHA5. Approved by: re (implicit) Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Sun Oct 6 18:56:13 2013 (r256091) +++ head/sys/conf/newvers.sh Sun Oct 6 19:47:06 2013 (r256092) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.0" -BRANCH="ALPHA4" +BRANCH="ALPHA5" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 02:23:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 751E0925; Mon, 7 Oct 2013 02:23:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F97A2D2C; Mon, 7 Oct 2013 02:23:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r972N2Yx071308; Mon, 7 Oct 2013 02:23:02 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r972N1R6071301; Mon, 7 Oct 2013 02:23:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201310070223.r972N1R6071301@svn.freebsd.org> From: Eitan Adler Date: Mon, 7 Oct 2013 02:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256095 - in head: . gnu/usr.bin gnu/usr.bin/rcs share/doc/psd share/doc/psd/13.rcs share/mk tools/build/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 02:23:02 -0000 Author: eadler Date: Mon Oct 7 02:23:00 2013 New Revision: 256095 URL: http://svnweb.freebsd.org/changeset/base/256095 Log: Good bye RCS. You will be missed. (devel/rcs and devel/rcs57 are available as alternatives) Approved by: core Approved by: re (hrs) Deleted: head/gnu/usr.bin/rcs/ head/share/doc/psd/13.rcs/ head/tools/build/options/WITHOUT_RCS Modified: head/ObsoleteFiles.inc head/gnu/usr.bin/Makefile head/share/doc/psd/Makefile head/share/mk/bsd.own.mk head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Oct 6 22:45:02 2013 (r256094) +++ head/ObsoleteFiles.inc Mon Oct 7 02:23:00 2013 (r256095) @@ -38,6 +38,29 @@ # xargs -n1 | sort | uniq -d; # done +# 20131015: removal of RCS from base +OLD_FILES+=usr/bin/ci +OLD_FILES+=usr/bin/co +OLD_FILES+=usr/bin/ident +OLD_FILES+=usr/bin/merge +OLD_FILES+=usr/bin/rcs +OLD_FILES+=usr/bin/rcsclean +OLD_FILES+=usr/bin/rcsdiff +OLD_FILES+=usr/bin/rcsfreeze +OLD_FILES+=usr/bin/rcsmerge +OLD_FILES+=usr/bin/rlog +OLD_FILES+=usr/share/man/man1/ci.1.gz +OLD_FILES+=usr/share/man/man1/co.1.gz +OLD_FILES+=usr/share/man/man1/ident.1.gz +OLD_FILES+=usr/share/man/man1/merge.1.gz +OLD_FILES+=usr/share/man/man1/rcs.1.gz +OLD_FILES+=usr/share/man/man1/rcsclean.1.gz +OLD_FILES+=usr/share/man/man1/rcsdiff.1.gz +OLD_FILES+=usr/share/man/man1/rcsfreeze.1.gz +OLD_FILES+=usr/share/man/man1/rcsintro.1.gz +OLD_FILES+=usr/share/man/man1/rcsmerge.1.gz +OLD_FILES+=usr/share/man/man1/rlog.1.gz +OLD_FILES+=usr/share/man/man5/rcsfile.5.gz # 20131001: ar and ranlib from binutils not used OLD_FILES+=usr/bin/gnu-ar OLD_FILES+=usr/bin/gnu-ranlib Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Sun Oct 6 22:45:02 2013 (r256094) +++ head/gnu/usr.bin/Makefile Mon Oct 7 02:23:00 2013 (r256095) @@ -12,7 +12,6 @@ SUBDIR= ${_binutils} \ ${_gperf} \ grep \ ${_groff} \ - ${_rcs} \ sdiff \ send-pr \ ${_texinfo} @@ -32,10 +31,6 @@ _dtc= dtc _texinfo= texinfo .endif -.if ${MK_RCS} != "no" -_rcs= rcs -.endif - .if ${MK_BINUTILS} != "no" _binutils= binutils .endif Modified: head/share/doc/psd/Makefile ============================================================================== --- head/share/doc/psd/Makefile Sun Oct 6 22:45:02 2013 (r256094) +++ head/share/doc/psd/Makefile Mon Oct 7 02:23:00 2013 (r256095) @@ -20,7 +20,6 @@ SUBDIR= title \ 05.sysman \ 06.Clang \ 12.make \ - 13.rcs \ 15.yacc \ 16.lex \ 17.m4 \ Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sun Oct 6 22:45:02 2013 (r256094) +++ head/share/mk/bsd.own.mk Mon Oct 7 02:23:00 2013 (r256095) @@ -334,7 +334,6 @@ __DEFAULT_YES_OPTIONS = \ PROFILE \ QUOTAS \ RCMDS \ - RCS \ RESCUE \ ROUTED \ SENDMAIL \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Oct 6 22:45:02 2013 (r256094) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Oct 7 02:23:00 2013 (r256095) @@ -3859,31 +3859,6 @@ OLD_FILES+=usr/share/man/man8/rshd.8.gz OLD_FILES+=usr/share/man/man8/rwhod.8.gz .endif -.if ${MK_RCS} == no -OLD_FILES+=usr/bin/ci -OLD_FILES+=usr/bin/co -OLD_FILES+=usr/bin/ident -OLD_FILES+=usr/bin/merge -OLD_FILES+=usr/bin/rcs -OLD_FILES+=usr/bin/rcsclean -OLD_FILES+=usr/bin/rcsdiff -OLD_FILES+=usr/bin/rcsfreeze -OLD_FILES+=usr/bin/rcsmerge -OLD_FILES+=usr/bin/rlog -OLD_FILES+=usr/share/man/man1/ci.1.gz -OLD_FILES+=usr/share/man/man1/co.1.gz -OLD_FILES+=usr/share/man/man1/ident.1.gz -OLD_FILES+=usr/share/man/man1/merge.1.gz -OLD_FILES+=usr/share/man/man1/rcs.1.gz -OLD_FILES+=usr/share/man/man1/rcsclean.1.gz -OLD_FILES+=usr/share/man/man1/rcsdiff.1.gz -OLD_FILES+=usr/share/man/man1/rcsfreeze.1.gz -OLD_FILES+=usr/share/man/man1/rcsintro.1.gz -OLD_FILES+=usr/share/man/man1/rcsmerge.1.gz -OLD_FILES+=usr/share/man/man1/rlog.1.gz -OLD_FILES+=usr/share/man/man5/rcsfile.5.gz -.endif - #.if ${MK_RESCUE} == no # to be filled in or replaced with a special target #.endif From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 06:50:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4F97AD1B; Mon, 7 Oct 2013 06:50:01 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3CFAD281E; Mon, 7 Oct 2013 06:50:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r976o17m009424; Mon, 7 Oct 2013 06:50:01 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r976o1ka009423; Mon, 7 Oct 2013 06:50:01 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201310070650.r976o1ka009423@svn.freebsd.org> From: Hiren Panchasara Date: Mon, 7 Oct 2013 06:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256096 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 06:50:01 -0000 Author: hiren Date: Mon Oct 7 06:50:00 2013 New Revision: 256096 URL: http://svnweb.freebsd.org/changeset/base/256096 Log: With r253139, firmware for urtwn(4) is in base system. Correct the man page to reflect that. Approved by: re (blackend) Modified: head/share/man/man4/urtwn.4 Modified: head/share/man/man4/urtwn.4 ============================================================================== --- head/share/man/man4/urtwn.4 Mon Oct 7 02:23:00 2013 (r256095) +++ head/share/man/man4/urtwn.4 Mon Oct 7 06:50:00 2013 (r256096) @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd July 7, 2013 +.Dd October 6, 2013 .Dt URTWN 4 .Os .Sh NAME @@ -57,18 +57,6 @@ The RTL8192CU is a highly integrated mul 802.11n adapter that combines a MAC, a 2T2R capable baseband and an RF in a single chip. It operates in the 2GHz spectrum only. -.Pp -The driver needs at least version 1.1p0 of the following firmware files, -which are loaded when an interface is attached: -.Pp -.Bl -tag -width Ds -offset indent -compact -.It urtwn-rtl8192cfwT -.It urtwn-rtl8192cfwU -.It urtwn-rtl8723fw -.El -.Pp -The firmware is available as part of the FreeBSD Ports collection in -net/urtwn-firmware-kmod. .Sh HARDWARE The following adapters should work: .Pp From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 07:32:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E5B55684; Mon, 7 Oct 2013 07:32:16 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D3BDA2A36; Mon, 7 Oct 2013 07:32:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r977WGan033186; Mon, 7 Oct 2013 07:32:16 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r977WGh3033185; Mon, 7 Oct 2013 07:32:16 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310070732.r977WGh3033185@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 7 Oct 2013 07:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256097 - 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: Mon, 07 Oct 2013 07:32:17 -0000 Author: des Date: Mon Oct 7 07:32:16 2013 New Revision: 256097 URL: http://svnweb.freebsd.org/changeset/base/256097 Log: Add _atf and unbound and move smmsp and mailnull to where they belong. Approved by: re (kib) Modified: head/etc/ftpusers Modified: head/etc/ftpusers ============================================================================== --- head/etc/ftpusers Mon Oct 7 06:50:00 2013 (r256096) +++ head/etc/ftpusers Mon Oct 7 07:32:16 2013 (r256097) @@ -13,7 +13,11 @@ games news man sshd +smmsp +mailnull +_atf bind +unbound proxy _pflogd _dhcp @@ -23,5 +27,3 @@ auditdistd www hast nobody -mailnull -smmsp From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 08:09:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E6494E89; Mon, 7 Oct 2013 08:09:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6AB3C2C17; Mon, 7 Oct 2013 08:09:57 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r9789tqu013260; Mon, 7 Oct 2013 12:09:55 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r9789tEF013259; Mon, 7 Oct 2013 12:09:55 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 7 Oct 2013 12:09:55 +0400 From: Gleb Smirnoff To: "Alexander V. Chernikov" Subject: Re: svn commit: r256066 - head/sys/dev/virtio/network Message-ID: <20131007080955.GI8860@FreeBSD.org> References: <201310051807.r95I7P0M048589@svn.freebsd.org> <525080A6.6020505@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <525080A6.6020505@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, Bryan Venteicher , 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, 07 Oct 2013 08:09:58 -0000 On Sun, Oct 06, 2013 at 01:12:06AM +0400, Alexander V. Chernikov wrote: A> On 05.10.2013 22:07, Bryan Venteicher wrote: A> > Author: bryanv A> > Date: Sat Oct 5 18:07:24 2013 A> > New Revision: 256066 A> > URL: http://svnweb.freebsd.org/changeset/base/256066 A> > A> > Log: A> > Do not hold the vtnet Rx queue lock when calling up into the stack A> Do you measure performance penalty for this? A> > A> > This matches other similar drivers and avoids various LOR warnings. A> We're currently trying to eliminate such things in other drivers like A> ixgbe, maybe there can be some other way to eliminate possible LORs? True, but we don't have time to do that before 10.0-RELEASE. So, from upcoming release perspective, Bryan change is correct fix. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 08:14:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0EF886F; Mon, 7 Oct 2013 08:14:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D55152C69; Mon, 7 Oct 2013 08:14:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r978EfQH055075; Mon, 7 Oct 2013 08:14:41 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r978EfXs055074; Mon, 7 Oct 2013 08:14:41 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310070814.r978EfXs055074@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 7 Oct 2013 08:14: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: r256099 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 08:14:42 -0000 Author: des Date: Mon Oct 7 08:14:41 2013 New Revision: 256099 URL: http://svnweb.freebsd.org/changeset/base/256099 Log: Forgotten mergeinfo Modified: Directory Properties: stable/9/etc/ (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 08:14:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A9C031C1; Mon, 7 Oct 2013 08:14:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 982F62C6C; Mon, 7 Oct 2013 08:14:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r978Ewcw055177; Mon, 7 Oct 2013 08:14:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r978Ew7U055176; Mon, 7 Oct 2013 08:14:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310070814.r978Ew7U055176@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 7 Oct 2013 08:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256100 - 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: Mon, 07 Oct 2013 08:14:58 -0000 Author: kib Date: Mon Oct 7 08:14:58 2013 New Revision: 256100 URL: http://svnweb.freebsd.org/changeset/base/256100 Log: Add the definition of DF_1_INTERPOSE flag. Reviewed by: kan Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (glebius) Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Mon Oct 7 08:14:41 2013 (r256099) +++ head/sys/sys/elf_common.h Mon Oct 7 08:14:58 2013 (r256100) @@ -487,6 +487,7 @@ typedef struct { #define DF_1_LOADFLTR 0x00000010 /* Immediate loading of filtees */ #define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ #define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ +#define DF_1_INTERPOSE 0x00000400 /* Interpose all objects but main */ #define DF_1_NODEFLIB 0x00000800 /* Do not search default paths */ /* Values for n_type. Used in core files. */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 08:19:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E5C7432E; Mon, 7 Oct 2013 08:19:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D3B822C8E; Mon, 7 Oct 2013 08:19:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r978JU2d057161; Mon, 7 Oct 2013 08:19:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r978JUb3057158; Mon, 7 Oct 2013 08:19:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310070819.r978JUb3057158@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 7 Oct 2013 08:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256101 - 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: Mon, 07 Oct 2013 08:19:31 -0000 Author: kib Date: Mon Oct 7 08:19:30 2013 New Revision: 256101 URL: http://svnweb.freebsd.org/changeset/base/256101 Log: Implement support for the interpose dso flag. Requested by: bf Reviewed by: kan Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (glebius) Modified: head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Oct 7 08:14:58 2013 (r256100) +++ head/libexec/rtld-elf/rtld.c Mon Oct 7 08:19:30 2013 (r256101) @@ -116,6 +116,7 @@ static Objlist_Entry *objlist_find(Objli static void objlist_init(Objlist *); static void objlist_push_head(Objlist *, Obj_Entry *); static void objlist_push_tail(Objlist *, Obj_Entry *); +static void objlist_put_after(Objlist *, Obj_Entry *, Obj_Entry *); static void objlist_remove(Objlist *, Obj_Entry *); static void *path_enumerate(const char *, path_enum_proc, void *); static int relocate_object_dag(Obj_Entry *root, bool bind_now, @@ -323,6 +324,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ Objlist_Entry *entry; Obj_Entry *obj; Obj_Entry **preload_tail; + Obj_Entry *last_interposer; Objlist initlist; RtldLockState lockstate; char *library_path_rpath; @@ -537,8 +539,14 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ die(); /* Make a list of all objects loaded at startup. */ + last_interposer = obj_main; for (obj = obj_list; obj != NULL; obj = obj->next) { - objlist_push_tail(&list_main, obj); + if (obj->z_interpose && obj != obj_main) { + objlist_put_after(&list_main, last_interposer, obj); + last_interposer = obj; + } else { + objlist_push_tail(&list_main, obj); + } obj->refcount++; } @@ -1128,6 +1136,8 @@ digest_dynamic1(Obj_Entry *obj, int earl obj->z_nodelete = true; if (dynp->d_un.d_val & DF_1_LOADFLTR) obj->z_loadfltr = true; + if (dynp->d_un.d_val & DF_1_INTERPOSE) + obj->z_interpose = true; if (dynp->d_un.d_val & DF_1_NODEFLIB) obj->z_nodeflib = true; break; @@ -1976,6 +1986,7 @@ static int load_preload_objects(void) { char *p = ld_preload; + Obj_Entry *obj; static const char delim[] = " \t:;"; if (p == NULL) @@ -1988,8 +1999,10 @@ load_preload_objects(void) savech = p[len]; p[len] = '\0'; - if (load_object(p, -1, NULL, 0) == NULL) + obj = load_object(p, -1, NULL, 0); + if (obj == NULL) return -1; /* XXX - cleanup */ + obj->z_interpose = true; p[len] = savech; p += len; p += strspn(p, delim); @@ -2378,6 +2391,23 @@ objlist_push_tail(Objlist *list, Obj_Ent } static void +objlist_put_after(Objlist *list, Obj_Entry *listobj, Obj_Entry *obj) +{ + Objlist_Entry *elm, *listelm; + + STAILQ_FOREACH(listelm, list, link) { + if (listelm->obj == listobj) + break; + } + elm = NEW(Objlist_Entry); + elm->obj = obj; + if (listelm != NULL) + STAILQ_INSERT_AFTER(list, listelm, elm, link); + else + STAILQ_INSERT_TAIL(list, elm, link); +} + +static void objlist_remove(Objlist *list, Obj_Entry *obj) { Objlist_Entry *elm; Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Mon Oct 7 08:14:58 2013 (r256100) +++ head/libexec/rtld-elf/rtld.h Mon Oct 7 08:19:30 2013 (r256101) @@ -259,6 +259,7 @@ typedef struct Struct_Obj_Entry { bool z_nodelete : 1; /* Do not unload the object and dependencies */ bool z_noopen : 1; /* Do not load on dlopen */ bool z_loadfltr : 1; /* Immediately load filtees */ + bool z_interpose : 1; /* Interpose all objects but main */ bool z_nodeflib : 1; /* Don't search default library path */ bool ref_nodel : 1; /* Refcount increased to prevent dlclose */ bool init_scanned: 1; /* Object is already on init list. */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 08:19:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C46F2461; Mon, 7 Oct 2013 08:19:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B274B2C90; Mon, 7 Oct 2013 08:19:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r978JgcY057243; Mon, 7 Oct 2013 08:19:42 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r978Jg5J057235; Mon, 7 Oct 2013 08:19:42 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310070819.r978Jg5J057235@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 7 Oct 2013 08:19: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: r256102 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 08:19:42 -0000 Author: des Date: Mon Oct 7 08:19:41 2013 New Revision: 256102 URL: http://svnweb.freebsd.org/changeset/base/256102 Log: MFH (r255597): add unbound user to facilitate cross-building MFH (r256097): add missing entries to ftpusers and reorder Modified: stable/9/etc/ftpusers stable/9/etc/group stable/9/etc/master.passwd Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/ftpusers ============================================================================== --- stable/9/etc/ftpusers Mon Oct 7 08:19:30 2013 (r256101) +++ stable/9/etc/ftpusers Mon Oct 7 08:19:41 2013 (r256102) @@ -13,7 +13,10 @@ games news man sshd +smmsp +mailnull bind +unbound proxy _pflogd _dhcp @@ -23,5 +26,3 @@ auditdistd www hast nobody -mailnull -smmsp Modified: stable/9/etc/group ============================================================================== --- stable/9/etc/group Mon Oct 7 08:19:30 2013 (r256101) +++ stable/9/etc/group Mon Oct 7 08:19:41 2013 (r256102) @@ -18,6 +18,7 @@ smmsp:*:25: mailnull:*:26: guest:*:31: bind:*:53: +unbound:*:59: proxy:*:62: authpf:*:63: _pflogd:*:64: Modified: stable/9/etc/master.passwd ============================================================================== --- stable/9/etc/master.passwd Mon Oct 7 08:19:30 2013 (r256101) +++ stable/9/etc/master.passwd Mon Oct 7 08:19:41 2013 (r256102) @@ -14,6 +14,7 @@ sshd:*:22:22::0:0:Secure Shell Daemon:/v smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin +unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin _pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin _dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 08:20:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3310C59C; Mon, 7 Oct 2013 08:20:58 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06B402CC3; Mon, 7 Oct 2013 08:20:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r978KvMM060000; Mon, 7 Oct 2013 08:20:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r978Kv9g059993; Mon, 7 Oct 2013 08:20:57 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310070820.r978Kv9g059993@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 7 Oct 2013 08:20: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: r256103 - in stable/8/etc: . mtree 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, 07 Oct 2013 08:20:58 -0000 Author: des Date: Mon Oct 7 08:20:56 2013 New Revision: 256103 URL: http://svnweb.freebsd.org/changeset/base/256103 Log: MFH (r255243): create /var/authpf with correct ownership and permissions MFH (r255597): add unbound user to facilitate cross-building MFH (r256097): add missing entries to ftpusers and reorder Modified: stable/8/etc/ftpusers stable/8/etc/group stable/8/etc/master.passwd stable/8/etc/mtree/BSD.var.dist Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/ftpusers ============================================================================== --- stable/8/etc/ftpusers Mon Oct 7 08:19:41 2013 (r256102) +++ stable/8/etc/ftpusers Mon Oct 7 08:20:56 2013 (r256103) @@ -13,7 +13,10 @@ games news man sshd +smmsp +mailnull bind +unbound proxy _pflogd _dhcp @@ -23,5 +26,3 @@ auditdistd www hast nobody -mailnull -smmsp Modified: stable/8/etc/group ============================================================================== --- stable/8/etc/group Mon Oct 7 08:19:41 2013 (r256102) +++ stable/8/etc/group Mon Oct 7 08:20:56 2013 (r256103) @@ -18,6 +18,7 @@ smmsp:*:25: mailnull:*:26: guest:*:31: bind:*:53: +unbound:*:59: proxy:*:62: authpf:*:63: _pflogd:*:64: Modified: stable/8/etc/master.passwd ============================================================================== --- stable/8/etc/master.passwd Mon Oct 7 08:19:41 2013 (r256102) +++ stable/8/etc/master.passwd Mon Oct 7 08:20:56 2013 (r256103) @@ -14,6 +14,7 @@ sshd:*:22:22::0:0:Secure Shell Daemon:/v smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin +unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin _pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin _dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin Modified: stable/8/etc/mtree/BSD.var.dist ============================================================================== --- stable/8/etc/mtree/BSD.var.dist Mon Oct 7 08:19:41 2013 (r256102) +++ stable/8/etc/mtree/BSD.var.dist Mon Oct 7 08:20:56 2013 (r256103) @@ -19,6 +19,8 @@ /set gname=audit audit .. + authpf uname=root gname=authpf mode=0770 + .. /set gname=wheel backups .. From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 10:01:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 595F5734; Mon, 7 Oct 2013 10:01:24 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46F62238D; Mon, 7 Oct 2013 10:01:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97A1OGC012391; Mon, 7 Oct 2013 10:01:24 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97A1O1N012390; Mon, 7 Oct 2013 10:01:24 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201310071001.r97A1O1N012390@svn.freebsd.org> From: Poul-Henning Kamp Date: Mon, 7 Oct 2013 10:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256105 - head/sys/x86/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, 07 Oct 2013 10:01:24 -0000 Author: phk Date: Mon Oct 7 10:01:23 2013 New Revision: 256105 URL: http://svnweb.freebsd.org/changeset/base/256105 Log: Add a va_copy() to our fall-back stdarg implementation for use with lint(1) Approved by: re@ (glebius@) Modified: head/sys/x86/include/stdarg.h Modified: head/sys/x86/include/stdarg.h ============================================================================== --- head/sys/x86/include/stdarg.h Mon Oct 7 08:39:54 2013 (r256104) +++ head/sys/x86/include/stdarg.h Mon Oct 7 10:01:23 2013 (r256105) @@ -64,6 +64,8 @@ typedef __va_list va_list; (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) #define va_start(ap, last) \ ((ap) = (va_list)&(last) + __va_size(last)) +#define va_copy(dst, src) \ + ((dst) = (src)) #define va_arg(ap, type) \ (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) #define va_end(ap) From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 10:26:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 40AF7EFE; Mon, 7 Oct 2013 10:26:39 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2DAAA24E9; Mon, 7 Oct 2013 10:26:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97AQco8025154; Mon, 7 Oct 2013 10:26:38 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97AQccf025150; Mon, 7 Oct 2013 10:26:38 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310071026.r97AQccf025150@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 7 Oct 2013 10:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256106 - in head/libexec: . freebsd-version X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 10:26:39 -0000 Author: des Date: Mon Oct 7 10:26:38 2013 New Revision: 256106 URL: http://svnweb.freebsd.org/changeset/base/256106 Log: Introduce the /libexec/freebsd-version script, which is intended to be used by auditing tools to determine the userland patch level when it differs from what `uname -r` reports. This can happen when the system is kept up-to-date using freebsd-update and the last SA did not touch the kernel, or when a new kernel has been installed but the system has not yet rebooted. Approved by: re (glebius) Added: head/libexec/freebsd-version/ head/libexec/freebsd-version/Makefile (contents, props changed) head/libexec/freebsd-version/freebsd-version.1 (contents, props changed) head/libexec/freebsd-version/freebsd-version.sh.in (contents, props changed) Modified: head/libexec/Makefile Modified: head/libexec/Makefile ============================================================================== --- head/libexec/Makefile Mon Oct 7 10:01:23 2013 (r256105) +++ head/libexec/Makefile Mon Oct 7 10:26:38 2013 (r256106) @@ -8,6 +8,7 @@ SUBDIR= ${_atf} \ bootpd \ ${_comsat} \ fingerd \ + freebsd-version \ ftpd \ getty \ ${_mail.local} \ Added: head/libexec/freebsd-version/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/freebsd-version/Makefile Mon Oct 7 10:26:38 2013 (r256106) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +SCRIPTS = freebsd-version +MAN = freebsd-version.1 +BINDIR = /libexec +CLEANFILES = freebsd-version.sh +NEWVERS = ${.CURDIR}/../../sys/conf/newvers.sh + +freebsd-version.sh.in: ${NEWVERS} +freebsd-version.sh: freebsd-version.sh.in + eval $$(egrep '^(TYPE|REVISION|BRANCH)=' ${NEWVERS}) ; \ + if ! sed -e "\ + s/@@TYPE@@/$${TYPE}/g; \ + s/@@REVISION@@/$${REVISION}/g; \ + s/@@BRANCH@@/$${BRANCH}/g; \ + " ${.ALLSRC} >${.TARGET} ; then \ + rm -f ${.TARGET} ; \ + exit 1 ; \ + fi + +.include Added: head/libexec/freebsd-version/freebsd-version.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/freebsd-version/freebsd-version.1 Mon Oct 7 10:26:38 2013 (r256106) @@ -0,0 +1,124 @@ +.\"- +.\" Copyright (c) 2013 Dag-Erling Smørgrav +.\" 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 October 5, 2013 +.Dt FREEBSD-VERSION 1 +.Os +.Sh NAME +.Nm freebsd-version +.Nd print the version and patch level of the installed system +.Sh SYNOPSIS +.Nm +.Op Fl ku +.Sh DESCRIPTION +The +.Nm +utility makes a best effort to determine the version and patch level +of the installed kernel and / or userland. +.Pp +The following options are available: +.Bl -tag -width Fl +.It Fl k +Print the version and patch level of the installed kernel. +Unlike +.Xr uname 1 , +if a new kernel has been installed but the system has not yet +rebooted, +.Nm +will print the version and patch level of the new kernel. +.It Fl u +Print the version and patch level of the installed userland. +These are hardcoded into +.Nm +during the build. +.El +.Pp +If both +.Fl k +and +.Fl u +are specified, +.Nm +will print the kernel version first, then the userland version, on +separate lines. +If neither is specified, it will print the userland version only. +.Sh IMPLEMENTATION NOTES +The +.Nm +utility should provide the correct answer in the vast majority of +cases, including on systems kept up-to-date using +.Xr freebsd-update 8 , +which does not update the kernel version unless the kernel itself was +affected by the latest patch. +.Pp +To determine the name (and hence the location) of a custom kernel, the +.Nm +utility will attempt to parse +.Pa /boot/defaults/loader.conf +and +.Pa /boot/loader.conf , +looking for definitions of the +.Va kernel +and +.Va bootfile +variables, both with a default value of +.Dq kernel . +It may however fail to locate the correct kernel if either or both of +these variables are defined in a non-standard location, such as in +.Pa /boot/loader.rc . +.Sh ENVIRONMENT +.Bl -tag -width ROOT +.It Ev ROOT +Path to the root of the filesystem in which to look for +.Pa loader.conf +and the kernel. +.El +.Sh EXAMPLES +To determine the version of the currently running userland: +.Bd -literal -offset indent +/libexec/freebsd-version -u +.Ed +.Pp +To inspect a system being repaired using a live CD: +.Bd -literal -offset indent +mount -rt ufs /dev/ada0p2 /mnt +env ROOT=/mnt /mnt/libexec/freebsd-version -ku +.Ed +.Sh SEE ALSO +.Xr uname 1 , +.Xr loader.conf 5 , +.Xr freebsd-version 8 +.Sh HISTORY +The +.Nm +command appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +utility and this manual page were written by +.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org . Added: head/libexec/freebsd-version/freebsd-version.sh.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/freebsd-version/freebsd-version.sh.in Mon Oct 7 10:26:38 2013 (r256106) @@ -0,0 +1,126 @@ +#!/bin/sh +#- +# Copyright (c) 2013 Dag-Erling Smørgrav +# 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$ +# + +set -e + +USERLAND_VERSION="@@REVISION@@-@@BRANCH@@" + +: ${ROOT:=} +: ${LOADER_DIR:=$ROOT/boot} +: ${LOADER_CONF_FILES:=$LOADER_DIR/defaults/loader.conf $LOADER_DIR/loader.conf $LOADER_DIR/loader.conf.local} +LOADER_RE1='^\([A-Z_a-z][0-9A-Z_a-z]*=[-./0-9A-Z_a-z]\{1,\}\).*$' +LOADER_RE2='^\([A-Z_a-z][0-9A-Z_a-z]*="[-./0-9A-Z_a-z]\{1,\}"\).*$' +KERNEL_RE='^@(#)@@TYPE@@ \([-.0-9A-Za-z]\{1,\}\) .*$' + +progname=$(basename $0) + +# +# Print an error message and exit. +# +error() { + echo "$progname: $*" >&2 + exit 1 +} + +# +# Try to get the name of the installed kernel from loader.conf and +# return the full path. If loader.conf does not exist or we could not +# read it, return the path to the default kernel. +# +kernel_file() { + eval $(sed -n "s/$LOADER_RE1/\\1;/p; s/$LOADER_RE2/\\1;/p" \ + $LOADER_CONF_FILES 2>/dev/null) + echo "$LOADER_DIR/${kernel:-kernel}/${bootfile:-kernel}" +} + +# +# Extract the kernel version from the installed kernel. +# +kernel_version() { + kernfile=$(kernel_file) + if [ ! -f "$kernfile" -o ! -r "$kernfile" ] ; then + error "unable to locate kernel" + fi + strings "$kernfile" | sed -n "s/$KERNEL_RE/\\1/p" +} + +# +# Print the hardcoded userland version. +# +userland_version() { + echo $USERLAND_VERSION +} + +# +# Print a usage string and exit. +# +usage() { + echo "usage: $progname [-ku]\n" >&2 + exit 1 +} + +# +# Main program. +# +main() { + # parse command-line arguments + while getopts "ku" option ; do + case $option in + k) + opt_k=1 + ;; + u) + opt_u=1 + ;; + *) + usage + ;; + esac + done + if [ $OPTIND -le $# ] ; then + usage + fi + + # default is -u + if [ $((opt_k + opt_u)) -eq 0 ] ; then + opt_u=1 + fi + + # print kernel version + if [ $opt_k ] ; then + kernel_version + fi + + # print userland version + if [ $opt_u ] ; then + userland_version + fi +} + +main "$@" From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 11:23:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D8E4D73E; Mon, 7 Oct 2013 11:23:01 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C63362B15; Mon, 7 Oct 2013 11:23:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97BN1jf056069; Mon, 7 Oct 2013 11:23:01 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97BN1CS056068; Mon, 7 Oct 2013 11:23:01 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310071123.r97BN1CS056068@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 7 Oct 2013 11:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256107 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 11:23:01 -0000 Author: des Date: Mon Oct 7 11:23:01 2013 New Revision: 256107 URL: http://svnweb.freebsd.org/changeset/base/256107 Log: When displaying a struct stat, if the -r option was not specified, display the numeric rather than symbolic representation of st_mode. Approved by: re (glebius) MFC after: 1 week Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Mon Oct 7 10:26:38 2013 (r256106) +++ head/usr.bin/kdump/kdump.c Mon Oct 7 11:23:01 2013 (r256107) @@ -1655,10 +1655,15 @@ ktrstat(struct stat *statp) * buffer exactly sizeof(struct stat) bytes long. */ printf("struct stat {"); - strmode(statp->st_mode, mode); - printf("dev=%ju, ino=%ju, mode=%s, nlink=%ju, ", - (uintmax_t)statp->st_dev, (uintmax_t)statp->st_ino, mode, - (uintmax_t)statp->st_nlink); + printf("dev=%ju, ino=%ju, ", + (uintmax_t)statp->st_dev, (uintmax_t)statp->st_ino); + if (resolv == 0) + printf("mode=0%jo, ", (uintmax_t)statp->st_mode); + else { + strmode(statp->st_mode, mode); + printf("mode=%s, ", mode); + } + printf("nlink=%ju, ", (uintmax_t)statp->st_nlink); if (resolv == 0 || (pwd = getpwuid(statp->st_uid)) == NULL) printf("uid=%ju, ", (uintmax_t)statp->st_uid); else From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 12:07:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6D623A3E; Mon, 7 Oct 2013 12:07:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4D52E86; Mon, 7 Oct 2013 12:07:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97C7fIG078971; Mon, 7 Oct 2013 12:07:41 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97C7fvj078970; Mon, 7 Oct 2013 12:07:41 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310071207.r97C7fvj078970@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 7 Oct 2013 12:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256108 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 12:07:41 -0000 Author: glebius Date: Mon Oct 7 12:07:40 2013 New Revision: 256108 URL: http://svnweb.freebsd.org/changeset/base/256108 Log: Fix mbuf leak. Submitted by: Loganaden Velvindron Obtained from: NetBSD Approved by: re (kib) Modified: head/sys/netinet6/ip6_mroute.c Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Mon Oct 7 11:23:01 2013 (r256107) +++ head/sys/netinet6/ip6_mroute.c Mon Oct 7 12:07:40 2013 (r256108) @@ -616,7 +616,7 @@ X_ip6_mrouter_done(void) for (rte = rt->mf6c_stall; rte != NULL; ) { struct rtdetq *n = rte->next; - m_free(rte->m); + m_freem(rte->m); free(rte, M_MRTABLE6); rte = n; } From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 12:57:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 832BA814; Mon, 7 Oct 2013 12:57:28 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 56EFC216E; Mon, 7 Oct 2013 12:57:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97CvSTW004669; Mon, 7 Oct 2013 12:57:28 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97CvRS1004666; Mon, 7 Oct 2013 12:57:27 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201310071257.r97CvRS1004666@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 7 Oct 2013 12:57: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: r256109 - in stable/9/sys/modules: dtrace/sdt rdma/krping toecore 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, 07 Oct 2013 12:57:28 -0000 Author: pluknet Date: Mon Oct 7 12:57:27 2013 New Revision: 256109 URL: http://svnweb.freebsd.org/changeset/base/256109 Log: MFC r237560,254319 (by uqs): Fix 'make depend'. PR: misc/180918 Submitted by: Eugene Grosbein Modified: stable/9/sys/modules/dtrace/sdt/Makefile stable/9/sys/modules/rdma/krping/Makefile stable/9/sys/modules/toecore/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/modules/dtrace/sdt/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/sdt/Makefile Mon Oct 7 12:07:40 2013 (r256108) +++ stable/9/sys/modules/dtrace/sdt/Makefile Mon Oct 7 12:57:27 2013 (r256109) @@ -4,7 +4,7 @@ KMOD= sdt SRCS= sdt.c -SRCS+= vnode_if.h +SRCS+= vnode_if.h opt_kdtrace.h CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ Modified: stable/9/sys/modules/rdma/krping/Makefile ============================================================================== --- stable/9/sys/modules/rdma/krping/Makefile Mon Oct 7 12:07:40 2013 (r256108) +++ stable/9/sys/modules/rdma/krping/Makefile Mon Oct 7 12:57:27 2013 (r256109) @@ -5,8 +5,8 @@ RDMA= ${.CURDIR}/../../../contrib/rdma/k KMOD= krping SRCS= krping.c krping_dev.c getopt.c -SRCS+= bus_if.h device_if.h opt_sched.h pci_if.h pcib_if.h -SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../../ofed/include +SRCS+= bus_if.h device_if.h pci_if.h pcib_if.h vnode_if.h +SRCS+= opt_sched.h opt_inet.h opt_inet6.h +CFLAGS+= -I${.CURDIR}/../../../ofed/include .include Modified: stable/9/sys/modules/toecore/Makefile ============================================================================== --- stable/9/sys/modules/toecore/Makefile Mon Oct 7 12:07:40 2013 (r256108) +++ stable/9/sys/modules/toecore/Makefile Mon Oct 7 12:57:27 2013 (r256109) @@ -4,6 +4,6 @@ KMOD= toecore SRCS= toecore.c -SRCS+= opt_ofed.h +SRCS+= opt_ofed.h opt_inet.h opt_inet6.h .include From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 14:22:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4DFFB7CA; Mon, 7 Oct 2013 14:22:20 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A8332734; Mon, 7 Oct 2013 14:22:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97EMKVv050753; Mon, 7 Oct 2013 14:22:20 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97EMKIR050752; Mon, 7 Oct 2013 14:22:20 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201310071422.r97EMKIR050752@svn.freebsd.org> From: Robert Millan Date: Mon, 7 Oct 2013 14:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256110 - head/cddl/contrib/opensolaris/cmd/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: Mon, 07 Oct 2013 14:22:20 -0000 Author: rmh Date: Mon Oct 7 14:22:19 2013 New Revision: 256110 URL: http://svnweb.freebsd.org/changeset/base/256110 Log: Fix implicit declaration of jail_getid() Approved by: re Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Oct 7 12:57:27 2013 (r256109) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Oct 7 14:22:19 2013 (r256110) @@ -58,6 +58,7 @@ #include #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 16:33:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A8FB03ED; Mon, 7 Oct 2013 16:33:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 868342FBF; Mon, 7 Oct 2013 16:33:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97GXHMd017962; Mon, 7 Oct 2013 16:33:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97GXG85017958; Mon, 7 Oct 2013 16:33:16 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310071633.r97GXG85017958@svn.freebsd.org> From: Dimitry Andric Date: Mon, 7 Oct 2013 16:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256112 - head/contrib/binutils/opcodes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 16:33:17 -0000 Author: dim Date: Mon Oct 7 16:33:16 2013 New Revision: 256112 URL: http://svnweb.freebsd.org/changeset/base/256112 Log: Add support for assembling and disassembling Intel Random Number Generator extensions (e.g. the 'rdrand' mnemonic) to our copy of binutils. Approved by: re (kib) Obtained from: OpenBSD, via pfg MFC after: 1 week Modified: head/contrib/binutils/opcodes/i386-dis.c head/contrib/binutils/opcodes/i386-opc.h head/contrib/binutils/opcodes/i386-opc.tbl head/contrib/binutils/opcodes/i386-tbl.h Modified: head/contrib/binutils/opcodes/i386-dis.c ============================================================================== --- head/contrib/binutils/opcodes/i386-dis.c Mon Oct 7 15:28:08 2013 (r256111) +++ head/contrib/binutils/opcodes/i386-dis.c Mon Oct 7 16:33:16 2013 (r256112) @@ -6438,14 +6438,22 @@ VMX_Fixup (int extrachar ATTRIBUTE_UNUSE static void OP_VMX (int bytemode, int sizeflag) { - used_prefixes |= (prefixes & (PREFIX_DATA | PREFIX_REPZ)); - if (prefixes & PREFIX_DATA) - strcpy (obuf, "vmclear"); - else if (prefixes & PREFIX_REPZ) - strcpy (obuf, "vmxon"); + if (modrm.mod == 3) + { + strcpy (obuf, "rdrand"); + OP_E (v_mode, sizeflag); + } else - strcpy (obuf, "vmptrld"); - OP_E (bytemode, sizeflag); + { + used_prefixes |= (prefixes & (PREFIX_DATA | PREFIX_REPZ)); + if (prefixes & PREFIX_DATA) + strcpy (obuf, "vmclear"); + else if (prefixes & PREFIX_REPZ) + strcpy (obuf, "vmxon"); + else + strcpy (obuf, "vmptrld"); + OP_E (bytemode, sizeflag); + } } static void Modified: head/contrib/binutils/opcodes/i386-opc.h ============================================================================== --- head/contrib/binutils/opcodes/i386-opc.h Mon Oct 7 15:28:08 2013 (r256111) +++ head/contrib/binutils/opcodes/i386-opc.h Mon Oct 7 16:33:16 2013 (r256112) @@ -79,6 +79,7 @@ typedef struct template #define CpuNo64 0x8000000 /* Not supported in the 64bit mode */ #define CpuPCLMUL 0x10000000 /* Carry-less Multiplication extensions */ +#define CpuRdRnd 0x20000000 /* Intel Random Number Generator extensions */ /* SSE4.1/4.2 Instructions required */ #define CpuSSE4 (CpuSSE4_1|CpuSSE4_2) @@ -87,7 +88,7 @@ typedef struct template #define CpuUnknownFlags (Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 \ |CpuP4|CpuSledgehammer|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuVMX \ |Cpu3dnow|Cpu3dnowA|CpuK6|CpuPadLock|CpuSVME|CpuSSSE3|CpuSSE4_1 \ - |CpuSSE4_2|CpuABM|CpuSSE4a|CpuXSAVE|CpuAES|CpuPCLMUL) + |CpuSSE4_2|CpuABM|CpuSSE4a|CpuXSAVE|CpuAES|CpuPCLMUL|CpuRdRnd) /* the bits in opcode_modifier are used to generate the final opcode from the base_opcode. These bits also are used to detect alternate forms of Modified: head/contrib/binutils/opcodes/i386-opc.tbl ============================================================================== --- head/contrib/binutils/opcodes/i386-opc.tbl Mon Oct 7 15:28:08 2013 (r256111) +++ head/contrib/binutils/opcodes/i386-opc.tbl Mon Oct 7 16:33:16 2013 (r256112) @@ -1502,3 +1502,21 @@ xrstor, 1, 0xfae, 0x5, CpuXSAVE, Modrm|N // INVPCID invpcid, 2, 0x660f3882, None, CpuNo64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg32 } invpcid, 2, 0x660f3882, None, Cpu64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg64 } + +// Intel AES extensions +aesdec, 2, 0x660f38de, None, CpuAES, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { RegXMM|LLongMem, RegXMM } +aesdeclast, 2, 0x660f38df, None, CpuAES, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { RegXMM|LLongMem, RegXMM } +aesenc, 2, 0x660f38dc, None, CpuAES, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { RegXMM|LLongMem, RegXMM } +aesenclast, 2, 0x660f38dd, None, CpuAES, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { RegXMM|LLongMem, RegXMM } +aesimc, 2, 0x660f38db, None, CpuAES, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { RegXMM|LLongMem, RegXMM } +aeskeygenassist, 3, 0x660f3adf, None, CpuAES, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { Imm8, RegXMM|LLongMem, RegXMM } + +// Intel Carry-less Multiplication extensions +pclmulqdq, 3, 0x660f3a44, None, CpuPCLMUL, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { Imm8, RegXMM|LLongMem, RegXMM } +pclmullqlqdq, 2, 0x660f3a44, 0x0, CpuPCLMUL, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { RegXMM|LLongMem, RegXMM } +pclmulhqlqdq, 2, 0x660f3a44, 0x1, CpuPCLMUL, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { RegXMM|LLongMem, RegXMM } +pclmullqhqdq, 2, 0x660f3a44, 0x10, CpuPCLMUL, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { RegXMM|LLongMem, RegXMM } +pclmulhqhqdq, 2, 0x660f3a44, 0x11, CpuPCLMUL, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { RegXMM|LLongMem, RegXMM } + +// Intel Random Number Generator extensions +rdrand, 1, 0x0fc7, 0x6, CpuRdRnd, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { Reg16|Reg32|Reg64 } Modified: head/contrib/binutils/opcodes/i386-tbl.h ============================================================================== --- head/contrib/binutils/opcodes/i386-tbl.h Mon Oct 7 15:28:08 2013 (r256111) +++ head/contrib/binutils/opcodes/i386-tbl.h Mon Oct 7 16:33:16 2013 (r256112) @@ -4374,6 +4374,11 @@ const template i386_optab[] = Modrm|IgnoreSize|NoSuf|ImmExt, { RegXMM|LLongMem, RegXMM } }, + + /* Intel Random Number Generator extensions */ + {"rdrand", 1, 0x0fc7, 0x6, CpuRdRnd, + Modrm|NoSuf, + { Reg16|Reg32|Reg64 } }, { NULL, 0, 0, 0, 0, 0, { 0 } } }; From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 16:45:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A56ACB77; Mon, 7 Oct 2013 16:45:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 92A5E20D6; Mon, 7 Oct 2013 16:45:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97GjHq1023943; Mon, 7 Oct 2013 16:45:17 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97GjH1l023942; Mon, 7 Oct 2013 16:45:17 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201310071645.r97GjH1l023942@svn.freebsd.org> From: Ed Maste Date: Mon, 7 Oct 2013 16:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256113 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 16:45:17 -0000 Author: emaste Date: Mon Oct 7 16:45:16 2013 New Revision: 256113 URL: http://svnweb.freebsd.org/changeset/base/256113 Log: Fix resource leaks Found by: Coverity Scan, CID 1016673, 1007118 Approved by: re Modified: head/sbin/camcontrol/fwdownload.c Modified: head/sbin/camcontrol/fwdownload.c ============================================================================== --- head/sbin/camcontrol/fwdownload.c Mon Oct 7 16:33:16 2013 (r256112) +++ head/sbin/camcontrol/fwdownload.c Mon Oct 7 16:45:16 2013 (r256113) @@ -224,6 +224,7 @@ fw_read_img(const char *fw_img_path, con goto bailout; } *num_bytes = img_size; + close(fd); return (buf); bailout: free(buf); @@ -286,6 +287,7 @@ fw_download_img(struct cam_device *cam_d ata_28bit_cmd(&ccb->ataio, ATA_ATA_IDENTIFY, 0, 0, 0); } else { warnx("weird disk type '%s'", type); + cam_freeccb(ccb); return 1; } /* Disable freezing the device queue. */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 16:49:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F4141DD8; Mon, 7 Oct 2013 16:49:54 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E03E72111; Mon, 7 Oct 2013 16:49:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97GnssC025170; Mon, 7 Oct 2013 16:49:54 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97GnrRi025150; Mon, 7 Oct 2013 16:49:53 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201310071649.r97GnrRi025150@svn.freebsd.org> From: John-Mark Gurney Date: Mon, 7 Oct 2013 16:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256114 - in head/share/man: man4 man8 man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 16:49:55 -0000 Author: jmg Date: Mon Oct 7 16:49:53 2013 New Revision: 256114 URL: http://svnweb.freebsd.org/changeset/base/256114 Log: add missing sections, de-Xr non-existent page, properly space punctuation.. Approved by: re (joel) MFC after: 3 days Modified: head/share/man/man4/altera_avgen.4 head/share/man/man4/rsu.4 head/share/man/man8/picobsd.8 head/share/man/man9/firmware.9 head/share/man/man9/vm_page_grab.9 Modified: head/share/man/man4/altera_avgen.4 ============================================================================== --- head/share/man/man4/altera_avgen.4 Mon Oct 7 16:45:16 2013 (r256113) +++ head/share/man/man4/altera_avgen.4 Mon Oct 7 16:49:53 2013 (r256114) @@ -56,11 +56,11 @@ entries configure the address, size, I/O .Pa /dev device node name that will be used. The -.Xr open , -.Xr read , -.Xr write , +.Xr open 2 , +.Xr read 2 , +.Xr write 2 , and -.Xr mmap +.Xr mmap 2 system calls (and variations) may be used on .Nm device nodes, subject to constraints imposed using Modified: head/share/man/man4/rsu.4 ============================================================================== --- head/share/man/man4/rsu.4 Mon Oct 7 16:45:16 2013 (r256113) +++ head/share/man/man4/rsu.4 Mon Oct 7 16:49:53 2013 (r256114) @@ -35,9 +35,9 @@ place the following lines in your kernel .Pp Alternatively, to load the driver as a module at boot time, place the following line in -.Xr loader.conf 5: +.Xr loader.conf 5 : .Bd -literal -offset indent -.Xr if_rsu_load="YES" +if_rsu_load="YES" .Ed .Pp After you have read the license in /usr/share/doc/legal/realtek Modified: head/share/man/man8/picobsd.8 ============================================================================== --- head/share/man/man8/picobsd.8 Mon Oct 7 16:45:16 2013 (r256113) +++ head/share/man/man8/picobsd.8 Mon Oct 7 16:49:53 2013 (r256114) @@ -20,7 +20,7 @@ utility is a script which produces a min which typically fits on a small media such as a floppy disk, or can be downloaded as a single image file from some media such as CDROM, flash memory, or through -.Xr etherboot . +etherboot. .Pp The .Nm @@ -64,7 +64,7 @@ kernel. This is the default behaviour, and is extremely useful as the kernel itself can be loaded, using -.Xr etherboot +etherboot or .Xr pxeboot 8 , .\" @@ -378,9 +378,7 @@ If the build is successful, the director .Pa build_dir-bridge/ will contain a .Pa kernel -that can be downloaded with -.Xr etherboot , -a floppy image called +that can be downloaded with etherboot, a floppy image called .Pa picobsd.bin , plus the products of the compilation in other directories. If you want to modify the source tree in @@ -480,9 +478,7 @@ Booting from a floppy is normally rather minutes), things are much faster if you store your image on a hard disk, Compact Flash, or CDROM. .Pp -You can also use -.Xr etherboot -to load the preloaded, uncompressed kernel image +You can also use etherboot to load the preloaded, uncompressed kernel image which is a byproduct of the .Nm build. Modified: head/share/man/man9/firmware.9 ============================================================================== --- head/share/man/man9/firmware.9 Mon Oct 7 16:45:16 2013 (r256113) +++ head/share/man/man9/firmware.9 Mon Oct 7 16:49:53 2013 (r256114) @@ -254,8 +254,8 @@ IxNpeMicrocode.dat .Pp Note that generating the firmware modules in this way requires the availability of the following tools: -.Xr awk , -.Xr make , +.Xr awk 1 , +.Xr make 1 , the compiler and the linker. .Sh SEE ALSO .Xr kld 4 , Modified: head/share/man/man9/vm_page_grab.9 ============================================================================== --- head/share/man/man9/vm_page_grab.9 Mon Oct 7 16:45:16 2013 (r256113) +++ head/share/man/man9/vm_page_grab.9 Mon Oct 7 16:49:53 2013 (r256114) @@ -64,7 +64,7 @@ function sleeps for any reason, the obje The .Fn vm_page_grab supports all of the flags supported by -.Xr vm_page_alloc . +.Xr vm_page_alloc 9 . In addition, .Fn vm_page_grab supports the following flags: From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 16:53:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8615522E; Mon, 7 Oct 2013 16:53:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F0D5217C; Mon, 7 Oct 2013 16:53:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97GrQ7I028184; Mon, 7 Oct 2013 16:53:26 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97GrQWM028183; Mon, 7 Oct 2013 16:53:26 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310071653.r97GrQWM028183@svn.freebsd.org> From: Dimitry Andric Date: Mon, 7 Oct 2013 16:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256115 - head/sys/i386/include/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 16:53:27 -0000 Author: dim Date: Mon Oct 7 16:53:26 2013 New Revision: 256115 URL: http://svnweb.freebsd.org/changeset/base/256115 Log: Remove redundant declaration of force_evtchn_callback() in the i386-specific xen-os.h, to silence a gcc warning. Approved by: re (gjb) MFC after: 3 days Modified: head/sys/i386/include/xen/xen-os.h Modified: head/sys/i386/include/xen/xen-os.h ============================================================================== --- head/sys/i386/include/xen/xen-os.h Mon Oct 7 16:49:53 2013 (r256114) +++ head/sys/i386/include/xen/xen-os.h Mon Oct 7 16:53:26 2013 (r256115) @@ -37,9 +37,6 @@ /* Everything below this point is not included by assembler (.S) files. */ #ifndef __ASSEMBLY__ -/* Force a proper event-channel callback from Xen. */ -void force_evtchn_callback(void); - /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ static inline void rep_nop(void) { From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 16:54:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1972347C; Mon, 7 Oct 2013 16:54:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06F1E2196; Mon, 7 Oct 2013 16:54:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97GsTua028610; Mon, 7 Oct 2013 16:54:29 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97GsThH028608; Mon, 7 Oct 2013 16:54:29 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310071654.r97GsThH028608@svn.freebsd.org> From: Dimitry Andric Date: Mon, 7 Oct 2013 16:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256116 - head/sys/ofed/include/rdma X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 16:54:30 -0000 Author: dim Date: Mon Oct 7 16:54:29 2013 New Revision: 256116 URL: http://svnweb.freebsd.org/changeset/base/256116 Log: Give an unnamed union in sys/ofed/include/rdma/ib_verbs.h a name, to silence a gcc warning. Approved by: re (gjb) MFC after: 3 days Modified: head/sys/ofed/include/rdma/ib_verbs.h Modified: head/sys/ofed/include/rdma/ib_verbs.h ============================================================================== --- head/sys/ofed/include/rdma/ib_verbs.h Mon Oct 7 16:53:26 2013 (r256115) +++ head/sys/ofed/include/rdma/ib_verbs.h Mon Oct 7 16:54:29 2013 (r256116) @@ -660,7 +660,7 @@ struct ib_qp_init_attr { union { struct ib_qp *qpg_parent; /* see qpg_type */ struct ib_qpg_init_attrib parent_attrib; - }; + } pp; enum ib_sig_type sq_sig_type; enum ib_qp_type qp_type; enum ib_qp_create_flags create_flags; From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 16:55:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CA24C5E1; Mon, 7 Oct 2013 16:55:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B631921A6; Mon, 7 Oct 2013 16:55:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97GtYPY029032; Mon, 7 Oct 2013 16:55:34 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97GtY9t029031; Mon, 7 Oct 2013 16:55:34 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310071655.r97GtY9t029031@svn.freebsd.org> From: Dimitry Andric Date: Mon, 7 Oct 2013 16:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256117 - head/sys/dev/xen/control X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 16:55:34 -0000 Author: dim Date: Mon Oct 7 16:55:34 2013 New Revision: 256117 URL: http://svnweb.freebsd.org/changeset/base/256117 Log: Initialize a variable in sys/dev/xen/control/control.c, to silence a gcc warning. Approved by: re (gjb) MFC after: 3 days Modified: head/sys/dev/xen/control/control.c Modified: head/sys/dev/xen/control/control.c ============================================================================== --- head/sys/dev/xen/control/control.c Mon Oct 7 16:54:29 2013 (r256116) +++ head/sys/dev/xen/control/control.c Mon Oct 7 16:55:34 2013 (r256117) @@ -371,6 +371,7 @@ xctrl_suspend() mtx_unlock(&Giant); #ifdef SMP + CPU_ZERO(&cpu_suspend_map); /* silence gcc */ if (smp_started) { /* * Suspend other CPUs. This prevents IPIs while we From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 16:56:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A18AB7BD; Mon, 7 Oct 2013 16:56:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D39221B4; Mon, 7 Oct 2013 16:56:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97Guu8m029643; Mon, 7 Oct 2013 16:56:56 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97GuurH029642; Mon, 7 Oct 2013 16:56:56 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310071656.r97GuurH029642@svn.freebsd.org> From: Dimitry Andric Date: Mon, 7 Oct 2013 16:56:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256118 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 16:56:56 -0000 Author: dim Date: Mon Oct 7 16:56:56 2013 New Revision: 256118 URL: http://svnweb.freebsd.org/changeset/base/256118 Log: Remove redundant declaration of cpu_clflush_line_size in sys/dev/cxgbe/t4_sge.c, to silence a gcc warning. Approved by: re (gjb) MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Oct 7 16:55:34 2013 (r256117) +++ head/sys/dev/cxgbe/t4_sge.c Mon Oct 7 16:56:56 2013 (r256118) @@ -215,10 +215,6 @@ static int handle_fw_msg(struct sge_iq * static int sysctl_uint16(SYSCTL_HANDLER_ARGS); -#if defined(__i386__) || defined(__amd64__) -extern u_int cpu_clflush_line_size; -#endif - /* * Called on MOD_LOAD. Validates and calculates the SGE tunables. */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 16:57:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4537390E; Mon, 7 Oct 2013 16:57:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 32B7021C7; Mon, 7 Oct 2013 16:57:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97Gvn14030159; Mon, 7 Oct 2013 16:57:49 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97Gvn6d030158; Mon, 7 Oct 2013 16:57:49 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310071657.r97Gvn6d030158@svn.freebsd.org> From: Dimitry Andric Date: Mon, 7 Oct 2013 16:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256119 - head/sys/i386/ibcs2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 16:57:49 -0000 Author: dim Date: Mon Oct 7 16:57:48 2013 New Revision: 256119 URL: http://svnweb.freebsd.org/changeset/base/256119 Log: Remove redundant declarations of szsigcode and sigcode in sys/i386/ibcs2/ibcs2_sysvec.c, to silence two gcc warnings. Approved by: re (gjb) MFC after: 3 days Modified: head/sys/i386/ibcs2/ibcs2_sysvec.c Modified: head/sys/i386/ibcs2/ibcs2_sysvec.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_sysvec.c Mon Oct 7 16:56:56 2013 (r256118) +++ head/sys/i386/ibcs2/ibcs2_sysvec.c Mon Oct 7 16:57:48 2013 (r256119) @@ -54,8 +54,6 @@ MODULE_VERSION(ibcs2, 1); extern int bsd_to_ibcs2_errno[]; extern struct sysent ibcs2_sysent[IBCS2_SYS_MAXSYSCALL]; -extern int szsigcode; -extern char sigcode[]; static int ibcs2_fixup(register_t **, struct image_params *); struct sysentvec ibcs2_svr3_sysvec = { From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 19:22:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C9D35499; Mon, 7 Oct 2013 19:22:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B63862BAC; Mon, 7 Oct 2013 19:22:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97JMrvo007208; Mon, 7 Oct 2013 19:22:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97JMrKQ007207; Mon, 7 Oct 2013 19:22:53 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201310071922.r97JMrKQ007207@svn.freebsd.org> From: Eitan Adler Date: Mon, 7 Oct 2013 19:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256120 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 19:22:53 -0000 Author: eadler Date: Mon Oct 7 19:22:53 2013 New Revision: 256120 URL: http://svnweb.freebsd.org/changeset/base/256120 Log: This regenerates src.conf.5 for both the RCS removal as well as r255784. Approved by: re (glebius) Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Mon Oct 7 16:57:48 2013 (r256119) +++ head/share/man/man5/src.conf.5 Mon Oct 7 19:22:53 2013 (r256120) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: head/tools/build/options/makeman 253304 2013-07-12 23:08:44Z bapt +.\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd September 30, 2013 +.Dd October 6, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -200,7 +200,7 @@ When set, it also enforces the following Set to not build the Clang C/C++ compiler. .Pp It is a default setting on -arm/armeb, arm/armv6eb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. +arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. When set, it also enforces the following options: .Pp .Bl -item -compact @@ -228,7 +228,7 @@ Set to avoid building the ARCMigrate, Re the Clang C/C++ compiler. .Pp It is a default setting on -arm/arm, arm/armeb, arm/armv6, arm/armv6eb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. .It Va WITH_CLANG_FULL .\" from FreeBSD: head/tools/build/options/WITH_CLANG_FULL 246259 2013-02-02 22:28:29Z dim Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the @@ -245,7 +245,7 @@ and .Pa /usr/bin/cpp . .Pp It is a default setting on -arm/armeb, arm/armv6eb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. When set, it also enforces the following options: .Pp .Bl -item -compact @@ -369,7 +369,7 @@ Set to build Flattened Device Tree suppo This includes the device tree compiler (dtc) and libfdt support library. .Pp It is a default setting on -arm/arm, arm/armeb, arm/armv6, arm/armv6eb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and powerpc/powerpc64. +arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_FLOPPY .\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru Set to not build or install programs @@ -406,7 +406,7 @@ amd64/amd64, arm/arm, arm/armv6 and i386 Set to build and install gcc and g++. .Pp It is a default setting on -arm/armeb, arm/armv6eb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_GCOV .\" from FreeBSD: head/tools/build/options/WITHOUT_GCOV 156932 2006-03-21 07:50:50Z ru Set to not build the @@ -443,7 +443,7 @@ Build the GNU C++ stack (g++, libstdc++) This is the default on platforms where gcc is the system compiler. .Pp It is a default setting on -arm/armeb, arm/armv6eb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_GNU_SUPPORT .\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without optional GNU support. @@ -909,11 +909,6 @@ This includes .Xr rlogin 1 , .Xr rsh 1 , etc. -.It Va WITHOUT_RCS -.\" from FreeBSD: head/tools/build/options/WITHOUT_RCS 156932 2006-03-21 07:50:50Z ru -Set to not build -.Xr rcs 1 -and related utilities. .It Va WITHOUT_RESCUE .\" from FreeBSD: head/tools/build/options/WITHOUT_RESCUE 156932 2006-03-21 07:50:50Z ru Set to not build From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 19:23:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A37D06B7; Mon, 7 Oct 2013 19:23:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9106C2BB8; Mon, 7 Oct 2013 19:23:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97JNhoY007760; Mon, 7 Oct 2013 19:23:43 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97JNha5007759; Mon, 7 Oct 2013 19:23:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201310071923.r97JNha5007759@svn.freebsd.org> From: Eitan Adler Date: Mon, 7 Oct 2013 19:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256121 - 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, 07 Oct 2013 19:23:43 -0000 Author: eadler Date: Mon Oct 7 19:23:43 2013 New Revision: 256121 URL: http://svnweb.freebsd.org/changeset/base/256121 Log: Add an UPDATING entry for the RCS removal. Requested by: kargl Approved by: re (glebius) Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Oct 7 19:22:53 2013 (r256120) +++ head/UPDATING Mon Oct 7 19:23:43 2013 (r256121) @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20131006: + RCS has been removed from the base system. If you need RCS + install either devel/rcs or devel/rcs57. + 20130930: BIND has been removed from the base system. If all you need is a local resolver, simply enable and start the local_unbound From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 19:27:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8B8DD980; Mon, 7 Oct 2013 19:27:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68D1F2BE9; Mon, 7 Oct 2013 19:27:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97JRt3K009480; Mon, 7 Oct 2013 19:27:55 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97JRtkp009479; Mon, 7 Oct 2013 19:27:55 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201310071927.r97JRtkp009479@svn.freebsd.org> From: Eitan Adler Date: Mon, 7 Oct 2013 19:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256122 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 19:27:55 -0000 Author: eadler Date: Mon Oct 7 19:27:54 2013 New Revision: 256122 URL: http://svnweb.freebsd.org/changeset/base/256122 Log: Add the latest NetBSD and FreeBSD releases. Approved by: re (glebius) Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Mon Oct 7 19:23:43 2013 (r256121) +++ head/share/misc/bsd-family-tree Mon Oct 7 19:27:54 2013 (r256122) @@ -270,17 +270,23 @@ FreeBSD 5.2 | | | | | | | | \ | | | | | | | | NetBSD | | | | | | | | 6.0.1 | | + | | | | | | | | | + | | | | | | NetBSD | | + | | | | | | 6.0.2 | | | | | | | | | OpenBSD 5.3 DragonFly 3.4.1 | | | | | | NetBSD | | | | | | | | 6.0.2 | | | | | | | | | | - | | | | | `-NetBSD 6.1 | | - | | FreeBSD | | | | - | | 8.4 | | | | - | | | | | | - | FreeBSD | | | | + | | | | | |`-NetBSD 6.1 | | + | | FreeBSD | | | | | + | | 8.4 | | NetBSD 6.1.1 | | + | | | | | | | + | FreeBSD | | NetBSD 6.1.2 | | | 9.2 | | | | | | | | | + | | | | | + | | | | | + | | | | | FreeBSD 10 -current | NetBSD -current OpenBSD -current | | | | | | v v v v v @@ -588,9 +594,12 @@ OpenBSD 5.3 2013-05-01 [OBD] NetBSD 6.0.2 2013-05-18 [NBD] (security/critical release) NetBSD 6.1 2013-05-18 [NBD] FreeBSD 8.4 2013-06-07 [FBD] +NetBSD 6.1.1 2013-08-22 [NBD] NetBSD 5.1.3 2013-09-29 [NBD] NetBSD 5.2.1 2013-09-29 [NBD] FreeBSD 9.2 2013-09-30 [FBD] +NetBSD 6.0.3 2013-09-30 [NBD] +NetBSD 6.1.2 2013-09-30 [NBD] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 19:48:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B00BCF66; Mon, 7 Oct 2013 19:48:09 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D480A2D27; Mon, 7 Oct 2013 19:48:08 +0000 (UTC) Received: by mail-wi0-f179.google.com with SMTP id hm2so5450052wib.6 for ; Mon, 07 Oct 2013 12:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=T2g+INJQ/nhdg8+0tAe41oroN6me/Ghl7kIroegf+Ok=; b=nZyZg6pKDHMyM0ZfWxT0u4QGYa/8koYfw+p8FgXlZqvKLnsCgUF3tE9SRETKFL+/Rb /6C5bxRSC8JA/alhi5iTTkheZHC3a0+UiaX1mU42Xm+Z+y30o8uBaOMhvQR6bv6E7Cpy 2oQuSj/+RYLKyepr7XM9AknO2PhldIhKgkbK/uNSGia5yO4fDVnpQQXtB2Ad4U+sj+Jx cWYJSVfhARpi2QZDQOFbqHcwTiMpDz8RcUM4RMuDR+Tc0171uGSLz6z+FJMaZa5zxhkm fgGw8RQM4omUq/fs0XjO+IgBux7e+zL3EJ9AX1vxzMfPMTS79LWMckrtpxd9SqIG1Zbr l0Ig== MIME-Version: 1.0 X-Received: by 10.180.37.227 with SMTP id b3mr20797024wik.24.1381175287367; Mon, 07 Oct 2013 12:48:07 -0700 (PDT) Received: by 10.216.62.69 with HTTP; Mon, 7 Oct 2013 12:48:07 -0700 (PDT) In-Reply-To: <201310071927.r97JRtkp009479@svn.freebsd.org> References: <201310071927.r97JRtkp009479@svn.freebsd.org> Date: Mon, 7 Oct 2013 23:48:07 +0400 Message-ID: Subject: Re: svn commit: r256122 - head/share/misc From: Sergey Kandaurov To: Eitan Adler 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: Mon, 07 Oct 2013 19:48:09 -0000 On 7 October 2013 23:27, Eitan Adler wrote: > Author: eadler > Date: Mon Oct 7 19:27:54 2013 > New Revision: 256122 > URL: http://svnweb.freebsd.org/changeset/base/256122 > > Log: > Add the latest NetBSD and FreeBSD releases. > > Approved by: re (glebius) > > Modified: > head/share/misc/bsd-family-tree > > Modified: head/share/misc/bsd-family-tree > ============================================================================== > --- head/share/misc/bsd-family-tree Mon Oct 7 19:23:43 2013 (r256121) > +++ head/share/misc/bsd-family-tree Mon Oct 7 19:27:54 2013 (r256122) > @@ -270,17 +270,23 @@ FreeBSD 5.2 | | > | | | | | | \ | | > | | | | | | NetBSD | | > | | | | | | 6.0.1 | | > + | | | | | | | | | > + | | | | | | NetBSD | | > + | | | | | | 6.0.2 | | > | | | | | | | OpenBSD 5.3 DragonFly 3.4.1 > | | | | | | NetBSD | | > | | | | | | 6.0.2 | | 6.0.3, may be? :) > | | | | | | | | > - | | | | | `-NetBSD 6.1 | | > - | | FreeBSD | | | | > - | | 8.4 | | | | > - | | | | | | > - | FreeBSD | | | | > + | | | | | |`-NetBSD 6.1 | | > + | | FreeBSD | | | | | > + | | 8.4 | | NetBSD 6.1.1 | | > + | | | | | | | > + | FreeBSD | | NetBSD 6.1.2 | | > | 9.2 | | | | > | | | | | > + | | | | | > + | | | | | > + | | | | | > FreeBSD 10 -current | NetBSD -current OpenBSD -current | > | | | | | > v v v v v > @@ -588,9 +594,12 @@ OpenBSD 5.3 2013-05-01 [OBD] > NetBSD 6.0.2 2013-05-18 [NBD] (security/critical release) > NetBSD 6.1 2013-05-18 [NBD] > FreeBSD 8.4 2013-06-07 [FBD] > +NetBSD 6.1.1 2013-08-22 [NBD] > NetBSD 5.1.3 2013-09-29 [NBD] > NetBSD 5.2.1 2013-09-29 [NBD] > FreeBSD 9.2 2013-09-30 [FBD] > +NetBSD 6.0.3 2013-09-30 [NBD] > +NetBSD 6.1.2 2013-09-30 [NBD] > > Bibliography > ------------------------ -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 20:29:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4854966F; Mon, 7 Oct 2013 20:29:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3495520B1; Mon, 7 Oct 2013 20:29:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97KTWuR042460; Mon, 7 Oct 2013 20:29:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97KTW7l042459; Mon, 7 Oct 2013 20:29:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310072029.r97KTW7l042459@svn.freebsd.org> From: John Baldwin Date: Mon, 7 Oct 2013 20:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256123 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 20:29:32 -0000 Author: jhb Date: Mon Oct 7 20:29:31 2013 New Revision: 256123 URL: http://svnweb.freebsd.org/changeset/base/256123 Log: Remove a stale comment. Approved by: re (gjb) Modified: head/share/man/man9/VOP_FSYNC.9 Modified: head/share/man/man9/VOP_FSYNC.9 ============================================================================== --- head/share/man/man9/VOP_FSYNC.9 Mon Oct 7 19:27:54 2013 (r256122) +++ head/share/man/man9/VOP_FSYNC.9 Mon Oct 7 20:29:31 2013 (r256123) @@ -65,15 +65,6 @@ Push data not written by file system syn .It Fa td The calling thread. .El -.Pp -The argument -.Fa waitfor -is either -.Dv MNT_WAIT -or -.Dv MNT_NOWAIT -and specifies whether or not the function should wait for the writes -to finish before returning. .Sh LOCKS The file should be locked on entry. .Sh RETURN VALUES From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 20:30:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 65ABA7B8; Mon, 7 Oct 2013 20:30:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4608820C3; Mon, 7 Oct 2013 20:30:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97KU6wo042911; Mon, 7 Oct 2013 20:30:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97KU55v042905; Mon, 7 Oct 2013 20:30:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310072030.r97KU55v042905@svn.freebsd.org> From: John Baldwin Date: Mon, 7 Oct 2013 20:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256124 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 20:30:06 -0000 Author: jhb Date: Mon Oct 7 20:30:05 2013 New Revision: 256124 URL: http://svnweb.freebsd.org/changeset/base/256124 Log: Add manpages for VOP_ADVISE() and VOP_ALLOCATE(). Approved by: re (gjb) Added: head/share/man/man9/VOP_ADVISE.9 (contents, props changed) head/share/man/man9/VOP_ALLOCATE.9 (contents, props changed) Modified: head/share/man/man9/Makefile head/share/man/man9/vnode.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Oct 7 20:29:31 2013 (r256123) +++ head/share/man/man9/Makefile Mon Oct 7 20:30:05 2013 (r256124) @@ -343,7 +343,9 @@ MAN= accept_filter.9 \ vnode.9 \ VOP_ACCESS.9 \ VOP_ACLCHECK.9 \ + VOP_ADVISE.9 \ VOP_ADVLOCK.9 \ + VOP_ALLOCATE.9 \ VOP_ATTRIB.9 \ VOP_BWRITE.9 \ VOP_CREATE.9 \ Added: head/share/man/man9/VOP_ADVISE.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/VOP_ADVISE.9 Mon Oct 7 20:30:05 2013 (r256124) @@ -0,0 +1,88 @@ +.\" -*- nroff -*- +.\" +.\" 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 October 3, 2013 +.Dt VOP_ADVISE 9 +.Os +.Sh NAME +.Nm VOP_ADVISE +.Nd apply advice about use of file data +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.Ft int +.Fn VOP_ADVISE "struct vnode *vp" "off_t start" "off_t end" "int advice" +.Sh DESCRIPTION +This call applies advice for a range of a file's data. +It is used to implement the +.Xr posix_fadvise +system call. +.Pp +Its arguments are: +.Bl -tag -width offset +.It Fa vp +The vnode of the file. +.It Fa start +The start of the range of file data. +.It Fa end +The end of the range of file data. +.It Fa advice +The type of operation to apply to the file data. +Possible values are: +.Bl -tag -width POSIX_FADV_WILLNEED +.It Dv POSIX_FADV_WILLNEED +Initiate an asynchronous read of the file data if it is not already resident. +.It Dv POSIX_FADV_DONTNEED +Decrease the in-memory priority of clean file data or discard clean file data. +.El +.El +.Pp +If the +.Fa start +and +.Fa end +offsets are both zero, +then the operation should be applied to the entire file. +Note that this call is advisory only and may perform the requested +operation on a subset of the requested range +.Pq including not performing it at all +and still return success. +.Sh LOCKS +The file should be unlocked on entry. +.Sh RETURN VALUES +Zero is returned if the call is successful, otherwise an appropriate +error code is returned. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +An invalid value was given for +.Fa advice . +.El +.Sh SEE ALSO +.Xr vnode 9 Added: head/share/man/man9/VOP_ALLOCATE.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/VOP_ALLOCATE.9 Mon Oct 7 20:30:05 2013 (r256124) @@ -0,0 +1,84 @@ +.\" -*- nroff -*- +.\" +.\" 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 October 3, 2013 +.Dt VOP_ALLOCATE 9 +.Os +.Sh NAME +.Nm VOP_ALLOCATE +.Nd allocate storage for a file +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.Ft int +.Fn VOP_ALLOCATE "struct vnode *vp" "off_t *offset" "off_t *len" +.Sh DESCRIPTION +This call allocates storage for a range of offsets in a file. +It is used to implement the +.Xr posix_fallocate +system call. +.Pp +Its arguments are: +.Bl -tag -width offset +.It Fa vp +The vnode of the file. +.It Fa offset +The start of the range to allocate storage for in the file. +.It Fa len +The length of the range to allocate storage for in the file. +.El +.Pp +The +.Fa offset +and +.Fa len +arguments are updated to reflect the portion of the range that +still needs to be allocated on return. +A partial allocation is considered a successful operation. +The file's contents are not changed. +.Sh LOCKS +The file should be exclusively locked on entry and will still be locked on exit. +.Sh RETURN VALUES +Zero is returned if the call is successful, otherwise an appropriate +error code is returned. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EFBIG +An attempt was made to write a file that exceeds the process's file size +limit or the maximum file size. +.It Bq Er ENOSPC +The file system is full. +.It Bq Er EPERM +An append-only flag is set on the file, but the caller is attempting to +write before the current end of file. +.El +.Sh SEE ALSO +.Xr vnode 9 , +.Xr VOP_READ 9 , +.Xr VOP_WRITE 9 Modified: head/share/man/man9/vnode.9 ============================================================================== --- head/share/man/man9/vnode.9 Mon Oct 7 20:29:31 2013 (r256123) +++ head/share/man/man9/vnode.9 Mon Oct 7 20:30:05 2013 (r256124) @@ -163,7 +163,9 @@ intertwining of VM Objects and Vnodes. .Xr malloc 9 , .Xr VOP_ACCESS 9 , .Xr VOP_ACLCHECK 9 , +.Xr VOP_ADVISE 9 , .Xr VOP_ADVLOCK 9 , +.Xr VOP_ALLOCATE 9 , .Xr VOP_ATTRIB 9 , .Xr VOP_BWRITE 9 , .Xr VOP_CREATE 9 , From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 20:48:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 08185300; Mon, 7 Oct 2013 20:48:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA0F92213; Mon, 7 Oct 2013 20:48:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97KmOwm051941; Mon, 7 Oct 2013 20:48:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97KmO5c051940; Mon, 7 Oct 2013 20:48:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310072048.r97KmO5c051940@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 7 Oct 2013 20:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256125 - head/sys/dev/isci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 20:48:25 -0000 Author: kib Date: Mon Oct 7 20:48:24 2013 New Revision: 256125 URL: http://svnweb.freebsd.org/changeset/base/256125 Log: Make isci(4) loadable. Reviewed by: jimharris Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (gjb) Modified: head/sys/dev/isci/isci.c Modified: head/sys/dev/isci/isci.c ============================================================================== --- head/sys/dev/isci/isci.c Mon Oct 7 20:30:05 2013 (r256124) +++ head/sys/dev/isci/isci.c Mon Oct 7 20:48:24 2013 (r256125) @@ -84,6 +84,7 @@ static driver_t isci_pci_driver = { }; DRIVER_MODULE(isci, pci, isci_pci_driver, isci_devclass, 0, 0); +MODULE_DEPEND(isci, cam, 1, 1, 1); static struct _pcsid { From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 21:39:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E4FDE574; Mon, 7 Oct 2013 21:39:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D26C22621; Mon, 7 Oct 2013 21:39:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97LdgZf078544; Mon, 7 Oct 2013 21:39:42 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97Ldggr078543; Mon, 7 Oct 2013 21:39:42 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310072139.r97Ldggr078543@svn.freebsd.org> From: Xin LI Date: Mon, 7 Oct 2013 21:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256126 - 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, 07 Oct 2013 21:39:43 -0000 Author: delphij Date: Mon Oct 7 21:39:42 2013 New Revision: 256126 URL: http://svnweb.freebsd.org/changeset/base/256126 Log: Reduce priority of host key exists message in sshd startup script to info. Approved by: re (gjb) Modified: head/etc/rc.d/sshd Modified: head/etc/rc.d/sshd ============================================================================== --- head/etc/rc.d/sshd Mon Oct 7 20:48:24 2013 (r256125) +++ head/etc/rc.d/sshd Mon Oct 7 21:39:42 2013 (r256126) @@ -53,7 +53,7 @@ sshd_keygen_alg() fi if [ -f "${keyfile}" ] ; then - echo "$ALG host key exists." + info "$ALG host key exists." else echo "Generating $ALG host key." /usr/bin/ssh-keygen -q -t $alg -f "$keyfile" -N "" From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 21:54:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1C56E7E; Mon, 7 Oct 2013 21:54:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 062362742; Mon, 7 Oct 2013 21:54:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97LsUbf087936; Mon, 7 Oct 2013 21:54:30 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97LsUQD087935; Mon, 7 Oct 2013 21:54:30 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310072154.r97LsUQD087935@svn.freebsd.org> From: Xin LI Date: Mon, 7 Oct 2013 21:54: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: r256127 - stable/9/etc/mtree 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, 07 Oct 2013 21:54:31 -0000 Author: delphij Date: Mon Oct 7 21:54:30 2013 New Revision: 256127 URL: http://svnweb.freebsd.org/changeset/base/256127 Log: MFC r255035: Add a few missing language directories for /usr. Modified: stable/9/etc/mtree/BSD.usr.dist Directory Properties: stable/9/etc/mtree/ (props changed) Modified: stable/9/etc/mtree/BSD.usr.dist ============================================================================== --- stable/9/etc/mtree/BSD.usr.dist Mon Oct 7 21:39:42 2013 (r256126) +++ stable/9/etc/mtree/BSD.usr.dist Mon Oct 7 21:54:30 2013 (r256127) @@ -59,6 +59,8 @@ .. share calendar + de_AT.ISO_8859-15 + .. de_DE.ISO8859-1 .. fr_FR.ISO8859-1 @@ -67,8 +69,14 @@ .. hu_HU.ISO8859-2 .. + pt_BR.ISO8859-1 + .. + pt_BR.UTF-8 + .. ru_RU.KOI8-R .. + ru_RU.UTF-8 + .. uk_UA.KOI8-U .. .. From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 21:59:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 26EFA306; Mon, 7 Oct 2013 21:59:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 13C122771; Mon, 7 Oct 2013 21:59:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97LxI3l089392; Mon, 7 Oct 2013 21:59:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97LxIHv089390; Mon, 7 Oct 2013 21:59:18 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310072159.r97LxIHv089390@svn.freebsd.org> From: Xin LI Date: Mon, 7 Oct 2013 21:59: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: r256128 - stable/9/etc/mtree 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, 07 Oct 2013 21:59:19 -0000 Author: delphij Date: Mon Oct 7 21:59:18 2013 New Revision: 256128 URL: http://svnweb.freebsd.org/changeset/base/256128 Log: MFC r248979 (emaste): Format per etc/mtree/README - Spaces instead of tabs - Sort some i18n entries Modified: stable/9/etc/mtree/BSD.usr.dist Directory Properties: stable/9/etc/mtree/ (props changed) Modified: stable/9/etc/mtree/BSD.usr.dist ============================================================================== --- stable/9/etc/mtree/BSD.usr.dist Mon Oct 7 21:54:30 2013 (r256127) +++ stable/9/etc/mtree/BSD.usr.dist Mon Oct 7 21:59:18 2013 (r256128) @@ -22,14 +22,14 @@ .. engines .. - i18n - .. + i18n + .. .. lib32 - dtrace - .. - i18n - .. + dtrace + .. + i18n + .. .. libdata gcc @@ -40,8 +40,8 @@ .. .. libexec - bsdinstall - .. + bsdinstall + .. lpr ru .. @@ -211,7 +211,7 @@ dtrace toolkit .. - .. + .. examples BSD_daemon .. @@ -336,79 +336,79 @@ fortune .. .. + i18n + csmapper + APPLE + .. + AST + .. + BIG5 + .. + CNS + .. + CP + .. + EBCDIC + .. + GB + .. + GEORGIAN + .. + ISO-8859 + .. + ISO646 + .. + JIS + .. + KAZAKH + .. + KOI + .. + KS + .. + MISC + .. + TCVN + .. + .. + esdb + APPLE + .. + AST + .. + BIG5 + .. + CP + .. + DEC + .. + EBCDIC + .. + EUC + .. + GB + .. + GEORGIAN + .. + ISO-2022 + .. + ISO-8859 + .. + ISO646 + .. + KAZAKH + .. + KOI + .. + MISC + .. + TCVN + .. + UTF + .. + .. + .. info - .. - i18n - csmapper - APPLE - .. - AST - .. - BIG5 - .. - CNS - .. - CP - .. - EBCDIC - .. - GB - .. - GEORGIAN - .. - ISO-8859 - .. - ISO646 - .. - JIS - .. - KAZAKH - .. - KOI - .. - KS - .. - MISC - .. - TCVN - .. - .. - esdb - APPLE - .. - AST - .. - BIG5 - .. - CP - .. - DEC - .. - EBCDIC - .. - EUC - .. - GB - .. - GEORGIAN - .. - ISO-2022 - .. - ISO-8859 - .. - ISO646 - .. - KAZAKH - .. - KOI - .. - MISC - .. - TCVN - .. - UTF - .. - .. .. locale UTF-8 @@ -435,26 +435,26 @@ .. ca_AD.ISO8859-1 .. - ca_ES.ISO8859-1 - .. - ca_FR.ISO8859-1 + ca_AD.ISO8859-15 .. - ca_IT.ISO8859-1 + ca_AD.UTF-8 .. - ca_AD.ISO8859-15 + ca_ES.ISO8859-1 .. ca_ES.ISO8859-15 .. - ca_FR.ISO8859-15 - .. - ca_IT.ISO8859-15 + ca_ES.UTF-8 .. - ca_AD.UTF-8 + ca_FR.ISO8859-1 .. - ca_ES.UTF-8 + ca_FR.ISO8859-15 .. ca_FR.UTF-8 .. + ca_IT.ISO8859-1 + .. + ca_IT.ISO8859-15 + .. ca_IT.UTF-8 .. cs_CZ.ISO8859-2 From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 22:03:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CE09C5BC; Mon, 7 Oct 2013 22:03:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A1D2427CB; Mon, 7 Oct 2013 22:03:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97M3elu094166; Mon, 7 Oct 2013 22:03:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97M3ejD094165; Mon, 7 Oct 2013 22:03:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310072203.r97M3ejD094165@svn.freebsd.org> From: Xin LI Date: Mon, 7 Oct 2013 22:03: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: r256129 - stable/9/etc/mtree 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, 07 Oct 2013 22:03:40 -0000 Author: delphij Date: Mon Oct 7 22:03:40 2013 New Revision: 256129 URL: http://svnweb.freebsd.org/changeset/base/256129 Log: MFC r255036: Add directories that is installed as part of bsdconfig. These are included unconditionally for now because bsdconfig is currently installed unconditionally. This fixes 'make -j 17 installworld' caused by a race condition. Modified: stable/9/etc/mtree/BSD.usr.dist Directory Properties: stable/9/etc/mtree/ (props changed) Modified: stable/9/etc/mtree/BSD.usr.dist ============================================================================== --- stable/9/etc/mtree/BSD.usr.dist Mon Oct 7 21:59:18 2013 (r256128) +++ stable/9/etc/mtree/BSD.usr.dist Mon Oct 7 22:03:40 2013 (r256129) @@ -40,6 +40,62 @@ .. .. libexec + bsdconfig + 020.docsinstall + include + .. + .. + 030.packages + include + .. + .. + 040.password + include + .. + .. + 050.diskmgmt + include + .. + .. + 070.usermgmt + include + .. + .. + 080.console + include + .. + .. + 090.timezone + include + .. + .. + 110.mouse + include + .. + .. + 120.networking + include + .. + .. + 130.security + include + .. + .. + 140.startup + include + .. + .. + 150.ttys + include + .. + .. + dot + include + .. + .. + include + .. + .. bsdinstall .. lpr @@ -58,6 +114,22 @@ sbin .. share + bsdconfig + media + .. + networking + .. + packages + .. + password + .. + startup + .. + timezone + .. + usermgmt + .. + .. calendar de_AT.ISO_8859-15 .. @@ -221,6 +293,8 @@ .. bootforth .. + bsdconfig + .. csh .. cvs From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 22:22:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5BFF41A9; Mon, 7 Oct 2013 22:22:58 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 483C42920; Mon, 7 Oct 2013 22:22:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97MMw9K009312; Mon, 7 Oct 2013 22:22:58 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97MMvAN009304; Mon, 7 Oct 2013 22:22:57 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201310072222.r97MMvAN009304@svn.freebsd.org> From: John-Mark Gurney Date: Mon, 7 Oct 2013 22:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256130 - in head: lib/libutil tools/regression/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: Mon, 07 Oct 2013 22:22:58 -0000 Author: jmg Date: Mon Oct 7 22:22:57 2013 New Revision: 256130 URL: http://svnweb.freebsd.org/changeset/base/256130 Log: don't assert on bad args, instead return an error.. Since so many programs don't check return value, always NUL terminate the buf... fix rounding when using base 1024 (the bug that started it all)... add a set of test cases so we can make sure that things don't break in the future... Thanks to Clifton Royston for testing and the test program... Approved by: re (hrs, glebius) MFC after: 1 week Added: head/tools/regression/lib/libutil/test-humanize_number.c (contents, props changed) head/tools/regression/lib/libutil/test-humanize_number.t (contents, props changed) Modified: head/lib/libutil/humanize_number.3 head/lib/libutil/humanize_number.c head/tools/regression/lib/libutil/Makefile Modified: head/lib/libutil/humanize_number.3 ============================================================================== --- head/lib/libutil/humanize_number.3 Mon Oct 7 22:03:40 2013 (r256129) +++ head/lib/libutil/humanize_number.3 Mon Oct 7 22:22:57 2013 (r256130) @@ -28,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd Apr 12, 2011 +.Dd October 7, 2013 .Dt HUMANIZE_NUMBER 3 .Os .Sh NAME @@ -140,7 +140,7 @@ The following flags may be passed in .Fa flags : .Bl -tag -width ".Dv HN_DIVISOR_1000" -offset indent .It Dv HN_DECIMAL -If the final result is less than 10, display it using one digit. +If the final result is less than 10, display it using one decimal place. .It Dv HN_NOSPACE Do not put a space between .Fa number @@ -160,13 +160,18 @@ This flag has no effect when is also specified. .El .Sh RETURN VALUES -The -.Fn humanize_number -function returns the number of characters stored in +Upon success, the +.Nm +function returns the number of characters that would have been stored in .Fa buf (excluding the terminating .Dv NUL ) -upon success, or \-1 upon failure. +if +.Fa buf +was large enough, or \-1 upon failure. +Even upon failure, the contents of +.Fa buf +may be modified. If .Dv HN_GETSCALE is specified, the prefix index number will be returned instead. Modified: head/lib/libutil/humanize_number.c ============================================================================== --- head/lib/libutil/humanize_number.c Mon Oct 7 22:03:40 2013 (r256129) +++ head/lib/libutil/humanize_number.c Mon Oct 7 22:22:57 2013 (r256130) @@ -2,6 +2,7 @@ /* * Copyright (c) 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc. + * Copyright 2013 John-Mark Gurney * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -50,15 +51,26 @@ humanize_number(char *buf, size_t len, i { const char *prefixes, *sep; int i, r, remainder, s1, s2, sign; + int divisordeccut; int64_t divisor, max; size_t baselen; - assert(buf != NULL); - assert(suffix != NULL); - assert(scale >= 0); - assert(scale < maxscale || (((scale & (HN_AUTOSCALE | HN_GETSCALE)) != 0))); - assert(!((flags & HN_DIVISOR_1000) && (flags & HN_IEC_PREFIXES))); + /* Since so many callers don't check -1, NUL terminate the buffer */ + if (len > 0) + buf[0] = '\0'; + /* validate args */ + if (buf == NULL || suffix == NULL) + return (-1); + if (scale < 0) + return (-1); + else if (scale >= maxscale && + ((scale & ~(HN_AUTOSCALE|HN_GETSCALE)) != 0)) + return (-1); + if ((flags & HN_DIVISOR_1000) && (flags & HN_IEC_PREFIXES)) + return (-1); + + /* setup parameters */ remainder = 0; if (flags & HN_IEC_PREFIXES) { @@ -73,34 +85,32 @@ humanize_number(char *buf, size_t len, i * an assertion earlier). */ divisor = 1024; + divisordeccut = 973; /* ceil(.95 * 1024) */ if (flags & HN_B) prefixes = "B\0\0Ki\0Mi\0Gi\0Ti\0Pi\0Ei"; else prefixes = "\0\0\0Ki\0Mi\0Gi\0Ti\0Pi\0Ei"; } else { baselen = 1; - if (flags & HN_DIVISOR_1000) + if (flags & HN_DIVISOR_1000) { divisor = 1000; - else + divisordeccut = 950; + if (flags & HN_B) + prefixes = "B\0\0k\0\0M\0\0G\0\0T\0\0P\0\0E"; + else + prefixes = "\0\0\0k\0\0M\0\0G\0\0T\0\0P\0\0E"; + } else { divisor = 1024; - - if (flags & HN_B) - prefixes = "B\0\0k\0\0M\0\0G\0\0T\0\0P\0\0E"; - else - prefixes = "\0\0\0k\0\0M\0\0G\0\0T\0\0P\0\0E"; + divisordeccut = 973; /* ceil(.95 * 1024) */ + if (flags & HN_B) + prefixes = "B\0\0K\0\0M\0\0G\0\0T\0\0P\0\0E"; + else + prefixes = "\0\0\0K\0\0M\0\0G\0\0T\0\0P\0\0E"; + } } #define SCALE2PREFIX(scale) (&prefixes[(scale) * 3]) - if (scale < 0 || (scale >= maxscale && - (scale & (HN_AUTOSCALE | HN_GETSCALE)) == 0)) - return (-1); - - if (buf == NULL || suffix == NULL) - return (-1); - - if (len > 0) - buf[0] = '\0'; if (quotient < 0) { sign = -1; quotient = -quotient; @@ -132,8 +142,8 @@ humanize_number(char *buf, size_t len, i * divide once more. */ for (i = 0; - (quotient >= max || (quotient == max - 1 && remainder >= 950)) && - i < maxscale; i++) { + (quotient >= max || (quotient == max - 1 && + remainder >= divisordeccut)) && i < maxscale; i++) { remainder = quotient % divisor; quotient /= divisor; } @@ -148,20 +158,22 @@ humanize_number(char *buf, size_t len, i } /* If a value <= 9.9 after rounding and ... */ - if (quotient <= 9 && remainder < 950 && i > 0 && flags & HN_DECIMAL) { - /* baselen + \0 + .N */ - if (len < baselen + 1 + 2) - return (-1); - s1 = (int)quotient + ((remainder + 50) / 1000); - s2 = ((remainder + 50) / 100) % 10; + /* + * XXX - should we make sure there is enough space for the decimal + * place and if not, don't do HN_DECIMAL? + */ + if (((quotient == 9 && remainder < divisordeccut) || quotient < 9) && + i > 0 && flags & HN_DECIMAL) { + s1 = (int)quotient + ((remainder * 10 + divisor / 2) / + divisor / 10); + s2 = ((remainder * 10 + divisor / 2) / divisor) % 10; r = snprintf(buf, len, "%d%s%d%s%s%s", sign * s1, localeconv()->decimal_point, s2, sep, SCALE2PREFIX(i), suffix); } else r = snprintf(buf, len, "%" PRId64 "%s%s%s", - sign * (quotient + (remainder + 50) / 1000), + sign * (quotient + (remainder + divisor / 2) / divisor), sep, SCALE2PREFIX(i), suffix); return (r); } - Modified: head/tools/regression/lib/libutil/Makefile ============================================================================== --- head/tools/regression/lib/libutil/Makefile Mon Oct 7 22:03:40 2013 (r256129) +++ head/tools/regression/lib/libutil/Makefile Mon Oct 7 22:22:57 2013 (r256130) @@ -1,6 +1,7 @@ # $FreeBSD$ -TESTS= test-trimdomain test-trimdomain-nodomain test-flopen test-grp test-pidfile +TESTS= test-trimdomain test-trimdomain-nodomain test-flopen test-grp \ + test-pidfile test-humanize_number CFLAGS+= -g -Wall -Wextra -Werror -lutil .PHONY: tests Added: head/tools/regression/lib/libutil/test-humanize_number.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libutil/test-humanize_number.c Mon Oct 7 22:22:57 2013 (r256130) @@ -0,0 +1,592 @@ +/*- + * Copyright 2012 Clifton Royston + * Copyright 2013 John-Mark Gurney + * 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$ + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern char * optarg; + +#define MAX_STR_FLAGS_RESULT 80 +#define MAX_INT_STR_DIGITS 12 + +static const int64_t halfExabyte = (int64_t)500*1000*1000*1000*1000*1000L; + +static struct { + int retval; + const char *res; + int64_t num; + int flags; + int scale; +} test_args[] = { + /* tests 0-13 test 1000 suffixes */ + { 2, "0 ", (int64_t)0L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "1 k", (int64_t)500L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "1 G", (int64_t)500*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "1 T", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "1 P", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "1 E", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 2, "1 ", (int64_t)1L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "2 k", (int64_t)1500L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "2 M", (int64_t)1500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "2 G", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "2 T", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "2 P", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "2 E", (int64_t)1500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + + /* tests 14-27 test 1024 suffixes */ + { 2, "0 ", (int64_t)0L, 0, HN_AUTOSCALE }, + { 3, "1 K", (int64_t)512L, 0, HN_AUTOSCALE }, + { 3, "1 M", (int64_t)512*1024L, 0, HN_AUTOSCALE }, + { 3, "1 G", (int64_t)512*1024*1024L, 0, HN_AUTOSCALE }, + { 3, "1 T", (int64_t)512*1024*1024*1024L, 0, HN_AUTOSCALE }, + { 3, "1 P", (int64_t)512*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, + { 3, "1 E", (int64_t)512*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, + { 2, "1 ", (int64_t)1L, 0, HN_AUTOSCALE }, + { 3, "2 K", (int64_t)1536L, 0, HN_AUTOSCALE }, + { 3, "2 M", (int64_t)1536*1024L, 0, HN_AUTOSCALE }, + { 3, "2 G", (int64_t)1536*1024*1024L, 0, HN_AUTOSCALE }, + { 3, "2 T", (int64_t)1536*1024*1024*1024L, 0, HN_AUTOSCALE }, + { 3, "2 P", (int64_t)1536*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, + { 3, "2 E", (int64_t)1536*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, + + /* tests 28-37 test rounding */ + { 3, "0 M", (int64_t)500*1000L-1, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "1 M", (int64_t)1000*1000L + 500*1000L-1, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "2 M", (int64_t)1000*1000L + 500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 3, "0 K", (int64_t)512L-1, 0, HN_AUTOSCALE }, + { 3, "1 K", (int64_t)512L, 0, HN_AUTOSCALE }, + { 3, "0 M", (int64_t)512*1024L-1, 0, HN_AUTOSCALE }, + { 3, "1 M", (int64_t)512*1024L, 0, HN_AUTOSCALE }, + { 3, "1 M", (int64_t)1024*1024L + 512*1024L-1, 0, HN_AUTOSCALE }, + { 3, "2 M", (int64_t)1024*1024L + 512*1024L, 0, HN_AUTOSCALE }, + + /* tests 38-61 test specific scale factors with 1000 divisor */ + { 3, "0 k", (int64_t)0L, HN_DIVISOR_1000, 1 }, + { 3, "1 k", (int64_t)500L, HN_DIVISOR_1000, 1 }, + { 3, "0 M", (int64_t)500L, HN_DIVISOR_1000, 2 }, + { 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, 2 }, + { 3, "0 G", (int64_t)500*1000L, HN_DIVISOR_1000, 3 }, + { 3, "1 G", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 3 }, + { 3, "0 T", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 4 }, + { 3, "1 T", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, 4 }, + { 3, "0 P", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, 5 }, + { 3, "1 P", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, 5 }, + { 3, "0 E", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 }, + { 3, "1 E", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 }, + { 3, "0 k", (int64_t)1L, HN_DIVISOR_1000, 1 }, + { 3, "2 k", (int64_t)1500L, HN_DIVISOR_1000, 1 }, + { 3, "0 M", (int64_t)1500L, HN_DIVISOR_1000, 2 }, + { 3, "2 M", (int64_t)1500*1000L, HN_DIVISOR_1000, 2 }, + { 3, "0 G", (int64_t)1500*1000L, HN_DIVISOR_1000, 3 }, + { 3, "2 G", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 3 }, + { 3, "0 T", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 4 }, + { 3, "2 T", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, 4 }, + { 3, "0 P", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, 5 }, + { 3, "2 P", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, 5 }, + { 3, "0 E", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 }, + { 3, "2 E", (int64_t)1500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 }, + + /* tests 62-85 test specific scale factors with 1024 divisor */ + { 3, "0 K", (int64_t)0L, 0, 1 }, + { 3, "1 K", (int64_t)512L, 0, 1 }, + { 3, "0 M", (int64_t)512L, 0, 2 }, + { 3, "1 M", (int64_t)512*1024L, 0, 2 }, + { 3, "0 G", (int64_t)512*1024L, 0, 3 }, + { 3, "1 G", (int64_t)512*1024*1024L, 0, 3 }, + { 3, "0 T", (int64_t)512*1024*1024L, 0, 4 }, + { 3, "1 T", (int64_t)512*1024*1024*1024L, 0, 4 }, + { 3, "0 P", (int64_t)512*1024*1024*1024L, 0, 5 }, + { 3, "1 P", (int64_t)512*1024*1024*1024*1024L, 0, 5 }, + { 3, "0 E", (int64_t)512*1024*1024*1024*1024L, 0, 6 }, + { 3, "1 E", (int64_t)512*1024*1024*1024*1024*1024L, 0, 6 }, + { 3, "0 K", (int64_t)1L, 0, 1 }, + { 3, "2 K", (int64_t)1536L, 0, 1 }, + { 3, "0 M", (int64_t)1536L, 0, 2 }, + { 3, "2 M", (int64_t)1536*1024L, 0, 2 }, + { 3, "0 G", (int64_t)1536*1024L, 0, 3 }, + { 3, "2 G", (int64_t)1536*1024*1024L, 0, 3 }, + { 3, "0 T", (int64_t)1536*1024*1024L, 0, 4 }, + { 3, "2 T", (int64_t)1536*1024*1024*1024L, 0, 4 }, + { 3, "0 P", (int64_t)1536*1024*1024*1024L, 0, 5 }, + { 3, "2 P", (int64_t)1536*1024*1024*1024*1024L, 0, 5 }, + { 3, "0 E", (int64_t)1536*1024*1024*1024*1024L, 0, 6 }, + { 3, "2 E", (int64_t)1536*1024*1024*1024*1024*1024L, 0, 6 }, + + /* tests 86-99 test invalid specific scale values of < 0 or >= 7 with + and without HN_DIVISOR_1000 set */ + /* all should return errors with new code; with old, the latter 3 + are instead processed as if having AUTOSCALE and/or GETSCALE set */ + { -1, "", (int64_t)1L, 0, 7 }, + { -1, "", (int64_t)1L, HN_DIVISOR_1000, 7 }, + { -1, "", (int64_t)1L, 0, 1000 }, + { -1, "", (int64_t)1L, HN_DIVISOR_1000, 1000 }, + { -1, "", (int64_t)0L, 0, 1000*1000 }, + { -1, "", (int64_t)0L, HN_DIVISOR_1000, 1000*1000 }, + { -1, "", (int64_t)0L, 0, INT_MAX }, + { -1, "", (int64_t)0L, HN_DIVISOR_1000, INT_MAX }, + + /* Negative scale values are not handled well + by the existing library routine - should report as error */ + /* all should return errors with new code, fail assertion with old */ + + { -1, "", (int64_t)1L, 0, -1 }, + { -1, "", (int64_t)1L, HN_DIVISOR_1000, -1 }, + { -1, "", (int64_t)1L, 0, -1000 }, + { -1, "", (int64_t)1L, HN_DIVISOR_1000, -1000 }, + + /* __INT_MIN doesn't print properly, skipped. */ + + { -1, "", (int64_t)1L, 0, -__INT_MAX }, + { -1, "", (int64_t)1L, HN_DIVISOR_1000, -__INT_MAX }, + + + /* tests for scale == 0, without autoscale */ + /* tests 100-114 test scale 0 with 1000 divisor - print first N digits */ + { 2, "0 ", (int64_t)0L, HN_DIVISOR_1000, 0 }, + { 2, "1 ", (int64_t)1L, HN_DIVISOR_1000, 0 }, + { 3, "10 ", (int64_t)10L, HN_DIVISOR_1000, 0 }, + { 3, "0 M", (int64_t)150L, HN_DIVISOR_1000, HN_NOSPACE }, + { 3, "0 M", (int64_t)500L, HN_DIVISOR_1000, HN_NOSPACE }, + { 3, "0 M", (int64_t)999L, HN_DIVISOR_1000, HN_NOSPACE }, + { 4, "150", (int64_t)150L, HN_DIVISOR_1000, 0 }, + { 4, "500", (int64_t)500L, HN_DIVISOR_1000, 0 }, + { 4, "999", (int64_t)999L, HN_DIVISOR_1000, 0 }, + { 5, "100", (int64_t)1000L, HN_DIVISOR_1000, 0 }, + { 5, "150", (int64_t)1500L, HN_DIVISOR_1000, 0 }, + { 7, "500", (int64_t)500*1000L, HN_DIVISOR_1000, 0 }, + { 8, "150", (int64_t)1500*1000L, HN_DIVISOR_1000, 0 }, + { 10, "500", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 0 }, + { 11, "150", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 0 }, + + /* tests 115-126 test scale 0 with 1024 divisor - print first N digits */ + { 2, "0 ", (int64_t)0L, 0, 0 }, + { 2, "1 ", (int64_t)1L, 0, 0 }, + { 3, "10 ", (int64_t)10L, 0, 0 }, + { 4, "150", (int64_t)150L, 0, 0 }, + { 4, "500", (int64_t)500L, 0, 0 }, + { 4, "999", (int64_t)999L, 0, 0 }, + { 5, "100", (int64_t)1000L, 0, 0 }, + { 5, "150", (int64_t)1500L, 0, 0 }, + { 7, "500", (int64_t)500*1000L, 0, 0 }, + { 8, "150", (int64_t)1500*1000L, 0, 0 }, + { 10, "500", (int64_t)500*1000*1000L, 0, 0 }, + { 11, "150", (int64_t)1500*1000*1000L, 0, 0 }, + + /* Test boundary cases for very large positive/negative number formatting */ + /* Explicit scale, divisor 1024 */ + + /* XXX = requires length 5 (buflen 6) for some cases*/ + /* KLUDGE - test loop below will bump length 5 up to 5 */ + { 3, "8 E", INT64_MAX, 0, 6 }, + { 4, "-8 E", -INT64_MAX, 0, 6 }, + { 3, "0 E", (int64_t)92*1024*1024*1024*1024*1024L, 0, 6 }, + { 3, "0 E", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 6 }, + { 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, 0, 6 }, + { 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 6 }, + { 3, "0 E", (int64_t)81*1024*1024*1024*1024*1024L, 0, 6 }, + { 3, "0 E", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 6 }, + { 4, "92 P", (int64_t)92*1024*1024*1024*1024*1024L, 0, 5 }, + { 5, "-92 P", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 5 }, + { 4, "82 P", (int64_t)82*1024*1024*1024*1024*1024L, 0, 5 }, + { 5, "-82 P", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 5 }, + { 4, "81 P", (int64_t)81*1024*1024*1024*1024*1024L, 0, 5 }, + { 5, "-81 P", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 5 }, + + /* Explicit scale, divisor 1000 */ + { 3, "9 E", INT64_MAX, HN_DIVISOR_1000, 6 }, + { 4, "-9 E", -INT64_MAX, HN_DIVISOR_1000, 6 }, + { 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 6 }, + { 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 6 }, + { 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 6 }, + { 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 6 }, + { 4, "92 P", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 5 }, + { 5, "-92 P", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 5 }, + { 4, "91 P", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 5 }, + { 5, "-91 P", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 5 }, + + /* Autoscale, divisor 1024 */ + { 3, "8 E", INT64_MAX, 0, HN_AUTOSCALE }, + { 4, "-8 E", -INT64_MAX, 0, HN_AUTOSCALE }, + { 4, "92 P", (int64_t)92*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, + { 5, "-92 P", -(int64_t)92*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, + { 4, "82 P", (int64_t)82*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, + { 5, "-82 P", -(int64_t)82*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, + { 4, "81 P", (int64_t)81*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, + { 5, "-81 P", -(int64_t)81*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE }, + /* Autoscale, divisor 1000 */ + { 3, "9 E", INT64_MAX, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 4, "-9 E", -INT64_MAX, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 4, "92 P", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "-92 P", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 4, "91 P", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "-91 P", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE }, + + /* 0 scale, divisor 1024 */ + { 12, "skdj", INT64_MAX, 0, 0 }, + { 21, "-9223", -INT64_MAX, 0, 0 }, + { 19, "10358", (int64_t)92*1024*1024*1024*1024*1024L, 0, 0 }, + { 20, "-1035", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 0 }, + { 18, "92323", (int64_t)82*1024*1024*1024*1024*1024L, 0, 0 }, + { 19, "-9232", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 0 }, + { 18, "91197", (int64_t)81*1024*1024*1024*1024*1024L, 0, 0 }, + { 19, "-9119", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 0 }, + + /* 0 scale, divisor 1000 */ + /* XXX - why does this fail? */ + { -1, "", INT64_MAX, HN_DIVISOR_1000, 0 }, + { 21, "-9223", -INT64_MAX, HN_DIVISOR_1000, 0 }, + { 19, "10358", (int64_t)92*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0 }, + { 20, "-1035", -(int64_t)92*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0 }, + { 18, "92323", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0 }, + { 19, "-9232", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0 }, + /* Expected to pass */ + { 18, "91197", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0 }, + { 19, "-9119", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, 0 }, + + + + /* Need to implement tests for GETSCALE */ +/* { ?, "", (int64_t)0L, HN_DIVISOR_1000, HN_GETSCALE }, + ... +*/ + /* Tests for HN_DECIMAL */ + /* Positive, Autoscale */ + { 5, "500 k", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "994 k", (int64_t)994*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "995 k", (int64_t)995*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "999 k", (int64_t)999*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "1.0 M", (int64_t)1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "1.5 M", (int64_t)1500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "1.9 M", (int64_t)1949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "2.0 M", (int64_t)1950*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "9.9 M", (int64_t)9949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 4, "10 M", (int64_t)9950*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "500 M", (int64_t)500*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "994 M", (int64_t)994*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "995 M", (int64_t)995*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "999 M", (int64_t)999*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + + { 5, "500 K", (int64_t)500*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "994 K", (int64_t)994*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "995 K", (int64_t)995*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "999 K", (int64_t)999*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "1.0 M", (int64_t)1000*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "1.0 M", (int64_t)1018*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "1.0 M", (int64_t)1019*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "1.5 M", (int64_t)1536*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "1.9 M", (int64_t)1996*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "2.0 M", (int64_t)1997*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "2.0 M", (int64_t)2047*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "2.0 M", (int64_t)2048*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "2.0 M", (int64_t)2099*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "2.1 M", (int64_t)2100*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "9.9 M", (int64_t)10188*1024L, HN_DECIMAL, HN_AUTOSCALE }, + /* XXX - shouldn't the following two be "10. M"? */ + { 4, "10 M", (int64_t)10189*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 4, "10 M", (int64_t)10240*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "500 M", (int64_t)500*1024*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "994 M", (int64_t)994*1024*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "995 M", (int64_t)995*1024*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "999 M", (int64_t)999*1024*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "1.0 G", (int64_t)1000*1024*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "1.0 G", (int64_t)1023*1024*1024L, HN_DECIMAL, HN_AUTOSCALE }, + + /* Negative, Autoscale - should pass */ + { 6, "-1.5 ", -(int64_t)1500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 6, "-1.9 ", -(int64_t)1949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 6, "-9.9 ", -(int64_t)9949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + + { 6, "-1.5 ", -(int64_t)1536*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 6, "-1.9 ", -(int64_t)1949*1024L, HN_DECIMAL, HN_AUTOSCALE }, + { 6, "-9.7 ", -(int64_t)9949*1024L, HN_DECIMAL, HN_AUTOSCALE }, + + /* Positive/negative, at maximum scale */ + { 5, "500 P", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "1.9 E", (int64_t)1949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "8.9 E", (int64_t)8949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE }, + { 5, "9.2 E", INT64_MAX, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + /* Negatives work with latest rev only: */ + { 6, "-9.2 ", -INT64_MAX, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + { 6, "-8.9 ", -(int64_t)8949*1000*1000*1000*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE }, + + { 5, "8.0 E", INT64_MAX, HN_DECIMAL, HN_AUTOSCALE }, + { 5, "7.9 E", INT64_MAX-(int64_t)100*1024*1024*1024*1024*1024LL, HN_DECIMAL, HN_AUTOSCALE }, + { 6, "-8.0 ", -INT64_MAX, HN_DECIMAL, HN_AUTOSCALE }, + { 6, "-7.9 ", -INT64_MAX+(int64_t)100*1024*1024*1024*1024*1024LL, HN_DECIMAL, HN_AUTOSCALE }, + + /* Positive, Fixed scales */ + { 5, "500 k", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1 }, + { 5, "0.5 M", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, + { 5, "949 k", (int64_t)949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1 }, + { 5, "0.9 M", (int64_t)949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, + { 5, "950 k", (int64_t)950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1 }, + { 5, "1.0 M", (int64_t)950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, + { 5, "999 k", (int64_t)999*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1 }, + { 5, "1.0 M", (int64_t)999*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, + { 5, "1.5 M", (int64_t)1500*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, + { 5, "1.9 M", (int64_t)1949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, + { 5, "2.0 M", (int64_t)1950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, + { 5, "9.9 M", (int64_t)9949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, + { 4, "10 M", (int64_t)9950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, + { 5, "500 M", (int64_t)500*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, + { 5, "0.5 G", (int64_t)500*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 3 }, + { 5, "999 M", (int64_t)999*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 }, + { 5, "1.0 G", (int64_t)999*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 3 }, + /* Positive/negative, at maximum scale */ + { 5, "500 P", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 5 }, + { 5, "1.0 E", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 }, + { 5, "1.9 E", (int64_t)1949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 }, + { 5, "8.9 E", (int64_t)8949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 }, + { 5, "9.2 E", INT64_MAX, HN_DECIMAL|HN_DIVISOR_1000, 6 }, + + /* HN_DECIMAL + binary + fixed scale cases not completed */ + { 5, "512 K", (int64_t)512*1024L, HN_DECIMAL, 1 }, + { 5, "0.5 M", (int64_t)512*1024L, HN_DECIMAL, 2 }, + + /* Negative, Fixed scales */ + /* Not yet added, but should work with latest rev */ + +}; + + +/* Command line options usage */ +static void +usage(char * progname) { + printf("%s: tests libutil humanize_number function\n", progname); + printf("Usage: %s [-nE] [-l num] [-v]\n\n", progname); + printf("Options:\n"); + printf("\t-l num\tSet max length for result; buflen = num + 1\n"); + printf("\t\t (NOTE: does not change expected result strings.)\n"); + printf("\t-n\tInclude negative scale tests, which cause older libutil\n"); + printf("\t\t version of function to coredump with assertion failure\n"); + printf("\t-E\tInclude numbers > 1/2 Exa[byte] which currently fail\n"); + printf("\t-v\tVerbose - always print summary results\n"); + printf("\t-h, -?\tShow options\n"); +} + +/* Parse command line options */ +static void +read_options(int argc, char * const argv[], size_t *bufLength, + int *includeNegativeScale, int *includeExabytes, int *verbose) { + int ch; + size_t temp; + + while ((ch = getopt(argc, argv, "nEh?vl:")) != -1) { + switch (ch) { + default: + usage(argv[0]); + exit(1); + break; /* UNREACHABLE */ + case 'h' : + case '?' : + usage(argv[0]); + exit(0); + break; /* UNREACHABLE */ + case 'l' : + sscanf(optarg, "%zu", &temp); + *bufLength = temp + 1; + break; + case 'n' : + *includeNegativeScale = 1; + break; + case 'E' : + *includeExabytes = 1; + break; + case 'v' : + *verbose = 1; + break; + } + } +} + +static struct { + int value; + const char *name; + } flags[] = { + { HN_AUTOSCALE, "HN_AUTOSCALE" }, + { HN_GETSCALE, "HN_GETSCALE" }, + { HN_DIVISOR_1000, "HN_DIVISOR_1000"}, + { HN_B, "HN_B"}, + { HN_DECIMAL, "HN_DECIMAL"}, +}; + +static const char *separator = "|"; + +/* Format flags parameter for meaningful display */ +static char * +str_flags(int hn_flags, char *noFlags) { + size_t i; + char * result; + + result = malloc(MAX_STR_FLAGS_RESULT); + result[0] = '\0'; + + for (i = 0; i < sizeof flags / sizeof *flags; i++) { + if (hn_flags & flags[i].value) { + if (*result != 0) + strlcat(result, separator, + MAX_STR_FLAGS_RESULT); + strlcat(result, flags[i].name, MAX_STR_FLAGS_RESULT); + } + } + + if (strlen(result) == 0) + strlcat(result, noFlags, MAX_STR_FLAGS_RESULT); + return result; +} + + +/* Format scale parameter for meaningful display */ +static char * +str_scale(int scale) { + char *result; + + if (scale == HN_AUTOSCALE || scale == HN_GETSCALE) + return str_flags(scale, ""); + + result = malloc(MAX_INT_STR_DIGITS); + result[0] = '\0'; + snprintf(result, MAX_INT_STR_DIGITS, "%d", scale); + return result; +} + +static void +testskipped(size_t i) +{ + + printf("ok %lu # skip - not turned on\n", i); +} + +int +main(int argc, char * const argv[]) +{ + char *buf; + char *flag_str, *scale_str; + size_t i; + size_t errcnt, tested, skipped; + int r; + size_t buflen; + int includeNegScale; + int includeExabyteTests; + int verbose; + + buflen = 4; + includeNegScale = 0; + includeExabyteTests = 0; + verbose = 0; + + read_options(argc, argv, &buflen, &includeNegScale, + &includeExabyteTests, &verbose); + + buf = malloc(buflen); + errcnt = 0; + tested = 0; + skipped = 0; + + if (buflen != 4) + printf("Warning: buffer size %zu != 4, expect some results to differ.\n", buflen); + + printf("1..%lu\n", sizeof test_args / sizeof *test_args); + for (i = 0; i < sizeof test_args / sizeof *test_args; i++) { + /* KLUDGE */ + if (test_args[i].num == INT64_MAX && buflen == 4) { + /* Start final tests which require buffer of 6 */ + free(buf); + buflen = 6; + buf = malloc(buflen); + if (verbose) + printf("Buffer length increased to %zu\n", + buflen); + } + + if (test_args[i].scale < 0 && ! includeNegScale) { + skipped++; + testskipped(i); + continue; + } + if (test_args[i].num >= halfExabyte && ! includeExabyteTests) { + skipped++; + testskipped(i); + continue; + } + + r = humanize_number(buf, buflen, test_args[i].num, "", + test_args[i].scale, test_args[i].flags); + flag_str = str_flags(test_args[i].flags, "[no flags]"); + scale_str = str_scale(test_args[i].scale); + + if (r != test_args[i].retval) { + if (verbose) + printf("wrong return value on index %lu, buflen: %zu, got: %d + \"%s\", expected %d + \"%s\"; num = %" PRId64 ", scale = %s, flags= %s.\n", + i, buflen, r, buf, test_args[i].retval, + test_args[i].res, test_args[i].num, + scale_str, flag_str); + else + printf("not ok %lu # return %d != %d\n", i, r, + test_args[i].retval); + errcnt++; + } else if (strcmp(buf, test_args[i].res) != 0) { + if (verbose) + printf("result mismatch on index %lu, got: \"%s\", expected \"%s\"; num = %" PRId64 ", scale = %s, flags= %s.\n", + i, buf, test_args[i].res, test_args[i].num, + scale_str, flag_str); + else + printf("not ok %lu # buf \"%s\" != \"%s\"\n", i, + buf, test_args[i].res); + errcnt++; + } else { + if (verbose) + printf("successful result on index %lu, returned %d, got: \"%s\"; num = %" PRId64 ", scale = %s, flags= %s.\n", + i, r, buf, test_args[i].num, scale_str, + flag_str); + else + printf("ok %lu\n", i); + } + tested++; + } + + if (verbose) + printf("total errors: %lu/%lu tests, %lu skipped\n", errcnt, + tested, skipped); + + if (errcnt) + return 1; + + return 0; +} Added: head/tools/regression/lib/libutil/test-humanize_number.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libutil/test-humanize_number.t Mon Oct 7 22:22:57 2013 (r256130) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable && echo humanize_numbers ok From owner-svn-src-all@FreeBSD.ORG Mon Oct 7 22:30:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E85CA6F5; Mon, 7 Oct 2013 22:30:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D6AEE29A0; Mon, 7 Oct 2013 22:30:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r97MU35x012759; Mon, 7 Oct 2013 22:30:03 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r97MU3IG012758; Mon, 7 Oct 2013 22:30:03 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310072230.r97MU3IG012758@svn.freebsd.org> From: Dimitry Andric Date: Mon, 7 Oct 2013 22:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256131 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2013 22:30:04 -0000 Author: dim Date: Mon Oct 7 22:30:03 2013 New Revision: 256131 URL: http://svnweb.freebsd.org/changeset/base/256131 Log: Fix kernel build on amd64 after r256118, since the machine/md_var.h header is not implicitly included there. So include it explicitly. Approved by: re (delphij) Pointy hat to: dim MFC after: 3 days X-MFC-With: r256118 Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Oct 7 22:22:57 2013 (r256130) +++ head/sys/dev/cxgbe/t4_sge.c Mon Oct 7 22:30:03 2013 (r256131) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "common/common.h" #include "common/t4_regs.h" From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 01:38:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 89224D0A; Tue, 8 Oct 2013 01:38:25 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 76B4F259E; Tue, 8 Oct 2013 01:38:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r981cPeg048198; Tue, 8 Oct 2013 01:38:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r981cPcT048197; Tue, 8 Oct 2013 01:38:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310080138.r981cPcT048197@svn.freebsd.org> From: Xin LI Date: Tue, 8 Oct 2013 01:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256132 - 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, 08 Oct 2013 01:38:25 -0000 Author: delphij Date: Tue Oct 8 01:38:24 2013 New Revision: 256132 URL: http://svnweb.freebsd.org/changeset/base/256132 Log: Improve lzjb decompress performance by reorganizing the code to tighten the copy loop. Submitted by: Denis Ahrens MFC after: 2 weeks Approved by: re (gjb) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c Mon Oct 7 22:30:03 2013 (r256131) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c Tue Oct 8 01:38:24 2013 (r256132) @@ -117,7 +117,9 @@ lzjb_decompress(void *s_start, void *d_s src += 2; if ((cpy = dst - offset) < (uchar_t *)d_start) return (-1); - while (--mlen >= 0 && dst < d_end) + if (mlen > (d_end - dst)) + mlen = d_end - dst; + while (--mlen >= 0) *dst++ = *cpy++; } else { *dst++ = *src++; From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 04:16:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 59F1BCF9; Tue, 8 Oct 2013 04:16:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 473EC20B2; Tue, 8 Oct 2013 04:16:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r984GNpr036090; Tue, 8 Oct 2013 04:16:23 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r984GNHw036089; Tue, 8 Oct 2013 04:16:23 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310080416.r984GNHw036089@svn.freebsd.org> From: Mark Johnston Date: Tue, 8 Oct 2013 04:16:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256133 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 08 Oct 2013 04:16:23 -0000 Author: markj Date: Tue Oct 8 04:16:22 2013 New Revision: 256133 URL: http://svnweb.freebsd.org/changeset/base/256133 Log: Fix an inverted check for the master user in "camcontrol security -U". PR: bin/182703 Submitted by: Scott Burns Approved by: re (gjb) MFC after: 3 days Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Tue Oct 8 01:38:24 2013 (r256132) +++ head/sbin/camcontrol/camcontrol.c Tue Oct 8 04:16:22 2013 (r256133) @@ -2748,7 +2748,7 @@ atasecurity(struct cam_device *device, i if (strcasecmp(optarg, "user") == 0) { pwd.ctrl |= ATA_SECURITY_PASSWORD_USER; pwd.ctrl &= ~ATA_SECURITY_PASSWORD_MASTER; - } else if (strcasecmp(optarg, "master") != 0) { + } else if (strcasecmp(optarg, "master") == 0) { pwd.ctrl |= ATA_SECURITY_PASSWORD_MASTER; pwd.ctrl &= ~ATA_SECURITY_PASSWORD_USER; } else { From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 04:52:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CB52256A; Tue, 8 Oct 2013 04:52:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AFA05224B; Tue, 8 Oct 2013 04:52:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r984qedE055055; Tue, 8 Oct 2013 04:52:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r984qeKZ055054; Tue, 8 Oct 2013 04:52:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310080452.r984qeKZ055054@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 8 Oct 2013 04:52: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: r256134 - 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, 08 Oct 2013 04:52:40 -0000 Author: kib Date: Tue Oct 8 04:52:40 2013 New Revision: 256134 URL: http://svnweb.freebsd.org/changeset/base/256134 Log: MFC r255979: When printing the vnode information from ddb, print the lengths of the dirty and clean buffer queues. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Tue Oct 8 04:16:22 2013 (r256133) +++ stable/9/sys/kern/vfs_subr.c Tue Oct 8 04:52:40 2013 (r256134) @@ -3015,9 +3015,12 @@ vn_printf(struct vnode *vp, const char * if (mtx_owned(VI_MTX(vp))) printf(" VI_LOCKed"); if (vp->v_object != NULL) - printf(" v_object %p ref %d pages %d\n", + printf(" v_object %p ref %d pages %d " + "cleanbuf %d dirtybuf %d\n", vp->v_object, vp->v_object->ref_count, - vp->v_object->resident_page_count); + vp->v_object->resident_page_count, + vp->v_bufobj.bo_dirty.bv_cnt, + vp->v_bufobj.bo_clean.bv_cnt); printf(" "); lockmgr_printinfo(vp->v_vnlock); if (vp->v_data != NULL) From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 08:16:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 55792F2E; Tue, 8 Oct 2013 08:16:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 433442D64; Tue, 8 Oct 2013 08:16:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r988GISE061513; Tue, 8 Oct 2013 08:16:18 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r988GIxn061511; Tue, 8 Oct 2013 08:16:18 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310080816.r988GIxn061511@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 8 Oct 2013 08:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256137 - head/sbin/route X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 08 Oct 2013 08:16:18 -0000 Author: glebius Date: Tue Oct 8 08:16:17 2013 New Revision: 256137 URL: http://svnweb.freebsd.org/changeset/base/256137 Log: When destination parameter is missing, exit with a clear synopsis, instead of writing to kernel and printing EINVAL description. PR: bin/181532 Submitted by: Kurt Jaeger Approved by: re (hrs) Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Tue Oct 8 07:02:23 2013 (r256136) +++ head/sbin/route/route.c Tue Oct 8 08:16:17 2013 (r256137) @@ -928,6 +928,11 @@ newroute(int argc, char **argv) } } + if (so[RTAX_DST].ss_len == 0) { + warnx("destination parameter required"); + usage(NULL); + } + if (nrflags & F_FORCEHOST) { nrflags |= F_ISHOST; #ifdef INET6 From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 11:29:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EDB4F72D; Tue, 8 Oct 2013 11:29:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB4A72A64; Tue, 8 Oct 2013 11:29:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98BT0p0061274; Tue, 8 Oct 2013 11:29:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98BT0Fj061263; Tue, 8 Oct 2013 11:29:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310081129.r98BT0Fj061263@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Oct 2013 11:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256139 - head/sys/dev/ath/ath_hal/ar5212 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 08 Oct 2013 11:29:01 -0000 Author: adrian Date: Tue Oct 8 11:28:59 2013 New Revision: 256139 URL: http://svnweb.freebsd.org/changeset/base/256139 Log: Add channel survey support to the AR5212 HAL. The AR5212 series of MACs implement the same channel counters as the later 11n chips - except, of course, the 11n specific counter (extension channel busy.) This allows users of these NICs to use 'athsurvey' to see how busy their current channel is. Tested: * AR5212, AR2413 NICs, STA mode Approved by: re@ (gleb) Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Tue Oct 8 11:05:26 2013 (r256138) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Tue Oct 8 11:28:59 2013 (r256139) @@ -335,6 +335,16 @@ struct ath_hal_5212 { uint8_t ah_txTrigLev; /* current Tx trigger level */ uint8_t ah_maxTxTrigLev; /* max tx trigger level */ + + /* + * Channel Tx, Rx, Rx Clear State + */ + uint32_t ah_cycleCount; + uint32_t ah_ctlBusy; + uint32_t ah_rxBusy; + uint32_t ah_txBusy; + uint32_t ah_rx_chainmask; + uint32_t ah_tx_chainmask; }; #define AH5212(_ah) ((struct ath_hal_5212 *)(_ah)) Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Tue Oct 8 11:05:26 2013 (r256138) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Tue Oct 8 11:28:59 2013 (r256139) @@ -865,16 +865,40 @@ static int32_t ar5212AniGetListenTime(struct ath_hal *ah) { struct ath_hal_5212 *ahp = AH5212(ah); - struct ar5212AniState *aniState; - uint32_t txFrameCount, rxFrameCount, cycleCount; - int32_t listenTime; + struct ar5212AniState *aniState = NULL; + int32_t listenTime = 0; + int good; + HAL_SURVEY_SAMPLE hs; + HAL_CHANNEL_SURVEY *cs = AH_NULL; + + /* + * We shouldn't see ah_curchan be NULL, but just in case.. + */ + if (AH_PRIVATE(ah)->ah_curchan == AH_NULL) { + ath_hal_printf(ah, "%s: ah_curchan = NULL?\n", __func__); + return (0); + } - txFrameCount = OS_REG_READ(ah, AR_TFCNT); - rxFrameCount = OS_REG_READ(ah, AR_RFCNT); - cycleCount = OS_REG_READ(ah, AR_CCCNT); + cs = &ahp->ah_chansurvey; + + /* + * Fetch the current statistics, squirrel away the current + * sample, bump the sequence/sample counter. + */ + OS_MEMZERO(&hs, sizeof(hs)); + good = ar5212GetMibCycleCounts(ah, &hs); + if (cs != AH_NULL) { + OS_MEMCPY(&cs->samples[cs->cur_sample], &hs, sizeof(hs)); + cs->samples[cs->cur_sample].seq_num = cs->cur_seq; + cs->cur_sample = + (cs->cur_sample + 1) % CHANNEL_SURVEY_SAMPLE_COUNT; + cs->cur_seq++; + } - aniState = ahp->ah_curani; - if (aniState->cycleCount == 0 || aniState->cycleCount > cycleCount) { + if (ANI_ENA(ah)) + aniState = ahp->ah_curani; + + if (good == AH_FALSE) { /* * Cycle counter wrap (or initial call); it's not possible * to accurately calculate a value because the registers @@ -882,15 +906,29 @@ ar5212AniGetListenTime(struct ath_hal *a */ listenTime = 0; ahp->ah_stats.ast_ani_lzero++; - } else { - int32_t ccdelta = cycleCount - aniState->cycleCount; - int32_t rfdelta = rxFrameCount - aniState->rxFrameCount; - int32_t tfdelta = txFrameCount - aniState->txFrameCount; + } else if (ANI_ENA(ah)) { + /* + * Only calculate and update the cycle count if we have + * an ANI state. + */ + int32_t ccdelta = + AH5212(ah)->ah_cycleCount - aniState->cycleCount; + int32_t rfdelta = + AH5212(ah)->ah_rxBusy - aniState->rxFrameCount; + int32_t tfdelta = + AH5212(ah)->ah_txBusy - aniState->txFrameCount; listenTime = (ccdelta - rfdelta - tfdelta) / CLOCK_RATE; } - aniState->cycleCount = cycleCount; - aniState->txFrameCount = txFrameCount; - aniState->rxFrameCount = rxFrameCount; + + /* + * Again, only update ANI state if we have it. + */ + if (ANI_ENA(ah)) { + aniState->cycleCount = AH5212(ah)->ah_cycleCount; + aniState->rxFrameCount = AH5212(ah)->ah_rxBusy; + aniState->txFrameCount = AH5212(ah)->ah_txBusy; + } + return listenTime; } @@ -956,13 +994,15 @@ ar5212AniPoll(struct ath_hal *ah, const const struct ar5212AniParams *params; int32_t listenTime; + /* Always update from the MIB, for statistics gathering */ + listenTime = ar5212AniGetListenTime(ah); + /* XXX can aniState be null? */ if (aniState == AH_NULL) return; if (!ANI_ENA(ah)) return; - listenTime = ar5212AniGetListenTime(ah); if (listenTime < 0) { ahp->ah_stats.ast_ani_lneg++; /* restart ANI period if listenTime is invalid */ Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Tue Oct 8 11:05:26 2013 (r256138) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Tue Oct 8 11:28:59 2013 (r256139) @@ -1405,13 +1405,47 @@ ar5212Get11nExtBusy(struct ath_hal *ah) } /* - * There's no channel survey support for the AR5212. + * Channel survey support. */ HAL_BOOL ar5212GetMibCycleCounts(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hsample) { + struct ath_hal_5212 *ahp = AH5212(ah); + u_int32_t good = AH_TRUE; - return (AH_FALSE); + /* XXX freeze/unfreeze mib counters */ + uint32_t rc = OS_REG_READ(ah, AR_RCCNT); + uint32_t rf = OS_REG_READ(ah, AR_RFCNT); + uint32_t tf = OS_REG_READ(ah, AR_TFCNT); + uint32_t cc = OS_REG_READ(ah, AR_CCCNT); /* read cycles last */ + + if (ahp->ah_cycleCount == 0 || ahp->ah_cycleCount > cc) { + /* + * Cycle counter wrap (or initial call); it's not possible + * to accurately calculate a value because the registers + * right shift rather than wrap--so punt and return 0. + */ + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: cycle counter wrap. ExtBusy = 0\n", __func__); + good = AH_FALSE; + } else { + hsample->cycle_count = cc - ahp->ah_cycleCount; + hsample->chan_busy = rc - ahp->ah_ctlBusy; + hsample->ext_chan_busy = 0; + hsample->rx_busy = rf - ahp->ah_rxBusy; + hsample->tx_busy = tf - ahp->ah_txBusy; + } + + /* + * Keep a copy of the MIB results so the next sample has something + * to work from. + */ + ahp->ah_cycleCount = cc; + ahp->ah_rxBusy = rf; + ahp->ah_ctlBusy = rc; + ahp->ah_txBusy = tf; + + return (good); } void From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 12:56:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B458E3A9; Tue, 8 Oct 2013 12:56:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 87F62214A; Tue, 8 Oct 2013 12:56:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98CulWX008110; Tue, 8 Oct 2013 12:56:47 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98CukaV008107; Tue, 8 Oct 2013 12:56:46 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310081256.r98CukaV008107@svn.freebsd.org> From: Mark Johnston Date: Tue, 8 Oct 2013 12:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256148 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 08 Oct 2013 12:56:47 -0000 Author: markj Date: Tue Oct 8 12:56:46 2013 New Revision: 256148 URL: http://svnweb.freebsd.org/changeset/base/256148 Log: Initialize and free the DTrace taskqueue in the dtrace module load/unload handlers rather than in the dtrace device open/close methods. The current approach can cause a panic if the device is closed which the taskqueue thread is active, or if a kernel module containing a provider is unloaded while retained enablings are present and the dtrace device isn't opened. Submitted by: gibbs (original version) Reviewed by: gibbs Approved by: re (glebius) MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/dev/dtrace/dtrace_load.c head/sys/cddl/dev/dtrace/dtrace_unload.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Oct 8 12:42:52 2013 (r256147) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Oct 8 12:56:46 2013 (r256148) @@ -15751,10 +15751,6 @@ dtrace_open(struct cdev *dev, int oflags #else devfs_set_cdevpriv(state, dtrace_dtr); #endif - /* This code actually belongs in dtrace_attach() */ - if (dtrace_opens == 1) - dtrace_taskq = taskq_create("dtrace_taskq", 1, maxclsyspri, - 1, INT_MAX, 0); #endif mutex_exit(&cpu_lock); @@ -15842,11 +15838,6 @@ dtrace_dtr(void *data) (void) kdi_dtrace_set(KDI_DTSET_DTRACE_DEACTIVATE); #else --dtrace_opens; - /* This code actually belongs in dtrace_detach() */ - if ((dtrace_opens == 0) && (dtrace_taskq != NULL)) { - taskq_destroy(dtrace_taskq); - dtrace_taskq = NULL; - } #endif mutex_exit(&dtrace_lock); Modified: head/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_load.c Tue Oct 8 12:42:52 2013 (r256147) +++ head/sys/cddl/dev/dtrace/dtrace_load.c Tue Oct 8 12:56:46 2013 (r256148) @@ -56,6 +56,8 @@ dtrace_load(void *dummy) /* Hang our hook for exceptions. */ dtrace_invop_init(); + dtrace_taskq = taskq_create("dtrace_taskq", 1, maxclsyspri, 0, 0, 0); + /* Register callbacks for linker file load and unload events. */ dtrace_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, dtrace_kld_load, NULL, EVENTHANDLER_PRI_ANY); Modified: head/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_unload.c Tue Oct 8 12:42:52 2013 (r256147) +++ head/sys/cddl/dev/dtrace/dtrace_unload.c Tue Oct 8 12:56:46 2013 (r256148) @@ -127,6 +127,8 @@ dtrace_unload() mutex_destroy(&dtrace_errlock); #endif + taskq_destroy(dtrace_taskq); + /* Reset our hook for exceptions. */ dtrace_invop_uninit(); From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 15:44:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5FE18934; Tue, 8 Oct 2013 15:44:05 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D02C2BD8; Tue, 8 Oct 2013 15:44:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98Fi5n8096548; Tue, 8 Oct 2013 15:44:05 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98Fi4R8096543; Tue, 8 Oct 2013 15:44:04 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201310081544.r98Fi4R8096543@svn.freebsd.org> From: Jim Harris Date: Tue, 8 Oct 2013 15:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256151 - in head/sys/dev: nvd nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 08 Oct 2013 15:44:05 -0000 Author: jimharris Date: Tue Oct 8 15:44:04 2013 New Revision: 256151 URL: http://svnweb.freebsd.org/changeset/base/256151 Log: Add driver-assisted striping for upcoming Intel NVMe controllers that can benefit from it. Sponsored by: Intel Reviewed by: kib (earlier version), carl Approved by: re (hrs) MFC after: 1 week Modified: head/sys/dev/nvd/nvd.c head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_ns.c head/sys/dev/nvme/nvme_private.h Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Tue Oct 8 14:10:32 2013 (r256150) +++ head/sys/dev/nvd/nvd.c Tue Oct 8 15:44:04 2013 (r256151) @@ -187,17 +187,6 @@ nvd_done(void *arg, const struct nvme_co atomic_add_int(&ndisk->cur_depth, -1); - /* - * TODO: add more extensive translation of NVMe status codes - * to different bio error codes (i.e. EIO, EINVAL, etc.) - */ - if (nvme_completion_is_error(cpl)) { - bp->bio_error = EIO; - bp->bio_flags |= BIO_ERROR; - bp->bio_resid = bp->bio_bcount; - } else - bp->bio_resid = 0; - biodone(bp); } Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Tue Oct 8 14:10:32 2013 (r256150) +++ head/sys/dev/nvme/nvme.h Tue Oct 8 15:44:04 2013 (r256151) @@ -535,7 +535,7 @@ struct nvme_controller_data { uint8_t reserved6[1024]; /* bytes 3072-4095: vendor specific */ - uint8_t reserved7[1024]; + uint8_t vs[1024]; } __packed __aligned(4); struct nvme_namespace_data { Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Tue Oct 8 14:10:32 2013 (r256150) +++ head/sys/dev/nvme/nvme_ns.c Tue Oct 8 15:44:04 2013 (r256151) @@ -34,13 +34,31 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include + #include "nvme_private.h" +static void nvme_bio_child_inbed(struct bio *parent, int bio_error); +static void nvme_bio_child_done(void *arg, + const struct nvme_completion *cpl); +static uint32_t nvme_get_num_segments(uint64_t addr, uint64_t size, + uint32_t alignment); +static void nvme_free_child_bios(int num_bios, + struct bio **child_bios); +static struct bio ** nvme_allocate_child_bios(int num_bios); +static struct bio ** nvme_construct_child_bios(struct bio *bp, + uint32_t alignment, + int *num_bios); +static int nvme_ns_split_bio(struct nvme_namespace *ns, + struct bio *bp, + uint32_t alignment); + static int nvme_ns_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int flag, struct thread *td) @@ -202,18 +220,218 @@ nvme_ns_bio_done(void *arg, const struct if (bp->bio_driver2) free(bp->bio_driver2, M_NVME); + if (nvme_completion_is_error(status)) { + bp->bio_flags |= BIO_ERROR; + if (bp->bio_error == 0) + bp->bio_error = EIO; + } + + if ((bp->bio_flags & BIO_ERROR) == 0) + bp->bio_resid = 0; + else + bp->bio_resid = bp->bio_bcount; + bp_cb_fn(bp, status); } +static void +nvme_bio_child_inbed(struct bio *parent, int bio_error) +{ + struct nvme_completion parent_cpl; + int inbed; + + if (bio_error != 0) { + parent->bio_flags |= BIO_ERROR; + parent->bio_error = bio_error; + } + + /* + * atomic_fetchadd will return value before adding 1, so we still + * must add 1 to get the updated inbed number. + */ + inbed = atomic_fetchadd_int(&parent->bio_inbed, 1) + 1; + if (inbed == parent->bio_children) { + bzero(&parent_cpl, sizeof(parent_cpl)); + if (parent->bio_flags & BIO_ERROR) + parent_cpl.status.sc = NVME_SC_DATA_TRANSFER_ERROR; + nvme_ns_bio_done(parent, &parent_cpl); + } +} + +static void +nvme_bio_child_done(void *arg, const struct nvme_completion *cpl) +{ + struct bio *child = arg; + struct bio *parent; + int bio_error; + + parent = child->bio_parent; + g_destroy_bio(child); + bio_error = nvme_completion_is_error(cpl) ? EIO : 0; + nvme_bio_child_inbed(parent, bio_error); +} + +static uint32_t +nvme_get_num_segments(uint64_t addr, uint64_t size, uint32_t align) +{ + uint32_t num_segs, offset, remainder; + + if (align == 0) + return (1); + + KASSERT((align & (align - 1)) == 0, ("alignment not power of 2\n")); + + num_segs = size / align; + remainder = size & (align - 1); + offset = addr & (align - 1); + if (remainder > 0 || offset > 0) + num_segs += 1 + (remainder + offset - 1) / align; + return (num_segs); +} + +static void +nvme_free_child_bios(int num_bios, struct bio **child_bios) +{ + int i; + + for (i = 0; i < num_bios; i++) { + if (child_bios[i] != NULL) + g_destroy_bio(child_bios[i]); + } + + free(child_bios, M_NVME); +} + +static struct bio ** +nvme_allocate_child_bios(int num_bios) +{ + struct bio **child_bios; + int err = 0, i; + + child_bios = malloc(num_bios * sizeof(struct bio *), M_NVME, M_NOWAIT); + if (child_bios == NULL) + return (NULL); + + for (i = 0; i < num_bios; i++) { + child_bios[i] = g_new_bio(); + if (child_bios[i] == NULL) + err = ENOMEM; + } + + if (err == ENOMEM) { + nvme_free_child_bios(num_bios, child_bios); + return (NULL); + } + + return (child_bios); +} + +static struct bio ** +nvme_construct_child_bios(struct bio *bp, uint32_t alignment, int *num_bios) +{ + struct bio **child_bios; + struct bio *child; + uint64_t cur_offset; + caddr_t data; + uint32_t rem_bcount; + int i; +#ifdef NVME_UNMAPPED_BIO_SUPPORT + struct vm_page **ma; + uint32_t ma_offset; +#endif + + *num_bios = nvme_get_num_segments(bp->bio_offset, bp->bio_bcount, + alignment); + child_bios = nvme_allocate_child_bios(*num_bios); + if (child_bios == NULL) + return (NULL); + + bp->bio_children = *num_bios; + bp->bio_inbed = 0; + cur_offset = bp->bio_offset; + rem_bcount = bp->bio_bcount; + data = bp->bio_data; +#ifdef NVME_UNMAPPED_BIO_SUPPORT + ma_offset = bp->bio_ma_offset; + ma = bp->bio_ma; +#endif + + for (i = 0; i < *num_bios; i++) { + child = child_bios[i]; + child->bio_parent = bp; + child->bio_cmd = bp->bio_cmd; + child->bio_offset = cur_offset; + child->bio_bcount = min(rem_bcount, + alignment - (cur_offset & (alignment - 1))); + child->bio_flags = bp->bio_flags; +#ifdef NVME_UNMAPPED_BIO_SUPPORT + if (bp->bio_flags & BIO_UNMAPPED) { + child->bio_ma_offset = ma_offset; + child->bio_ma = ma; + child->bio_ma_n = + nvme_get_num_segments(child->bio_ma_offset, + child->bio_bcount, PAGE_SIZE); + ma_offset = (ma_offset + child->bio_bcount) & + PAGE_MASK; + ma += child->bio_ma_n; + if (ma_offset != 0) + ma -= 1; + } else +#endif + { + child->bio_data = data; + data += child->bio_bcount; + } + cur_offset += child->bio_bcount; + rem_bcount -= child->bio_bcount; + } + + return (child_bios); +} + +static int +nvme_ns_split_bio(struct nvme_namespace *ns, struct bio *bp, + uint32_t alignment) +{ + struct bio *child; + struct bio **child_bios; + int err, i, num_bios; + + child_bios = nvme_construct_child_bios(bp, alignment, &num_bios); + if (child_bios == NULL) + return (ENOMEM); + + for (i = 0; i < num_bios; i++) { + child = child_bios[i]; + err = nvme_ns_bio_process(ns, child, nvme_bio_child_done); + if (err != 0) { + nvme_bio_child_inbed(bp, err); + g_destroy_bio(child); + } + } + + free(child_bios, M_NVME); + return (0); +} + int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp, nvme_cb_fn_t cb_fn) { struct nvme_dsm_range *dsm_range; + uint32_t num_bios; int err; bp->bio_driver1 = cb_fn; + if (ns->stripesize > 0 && + (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE)) { + num_bios = nvme_get_num_segments(bp->bio_offset, + bp->bio_bcount, ns->stripesize); + if (num_bios > 1) + return (nvme_ns_split_bio(ns, bp, ns->stripesize)); + } + switch (bp->bio_cmd) { case BIO_READ: err = nvme_ns_cmd_read_bio(ns, bp, nvme_ns_bio_done, bp); @@ -276,6 +494,11 @@ nvme_ns_construct(struct nvme_namespace ns->ctrlr = ctrlr; ns->id = id; + ns->stripesize = 0; + + if (pci_get_devid(ctrlr->dev) == 0x09538086 && ctrlr->cdata.vs[3] != 0) + ns->stripesize = + (1 << ctrlr->cdata.vs[3]) * ctrlr->min_page_size; /* * Namespaces are reconstructed after a controller reset, so check Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Tue Oct 8 14:10:32 2013 (r256150) +++ head/sys/dev/nvme/nvme_private.h Tue Oct 8 15:44:04 2013 (r256151) @@ -238,6 +238,7 @@ struct nvme_namespace { uint16_t flags; struct cdev *cdev; void *cons_cookie[NVME_MAX_CONSUMERS]; + uint32_t stripesize; struct mtx lock; }; From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 15:47:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1DDF4AB7; Tue, 8 Oct 2013 15:47:23 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0AB772C02; Tue, 8 Oct 2013 15:47:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98FlMU0097881; Tue, 8 Oct 2013 15:47:22 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98FlMx9097877; Tue, 8 Oct 2013 15:47:22 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201310081547.r98FlMx9097877@svn.freebsd.org> From: Jim Harris Date: Tue, 8 Oct 2013 15:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256152 - in head: sbin/nvmecontrol sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 08 Oct 2013 15:47:23 -0000 Author: jimharris Date: Tue Oct 8 15:47:22 2013 New Revision: 256152 URL: http://svnweb.freebsd.org/changeset/base/256152 Log: Extend some 32-bit fields and variables to 64-bit to prevent overflow when calculating stats in nvmecontrol perftest. Sponsored by: Intel Reported by: Joe Golio Reviewed by: carl Approved by: re (hrs) MFC after: 1 week Modified: head/sbin/nvmecontrol/perftest.c head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_test.c Modified: head/sbin/nvmecontrol/perftest.c ============================================================================== --- head/sbin/nvmecontrol/perftest.c Tue Oct 8 15:44:04 2013 (r256151) +++ head/sbin/nvmecontrol/perftest.c Tue Oct 8 15:47:22 2013 (r256152) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -45,7 +46,8 @@ __FBSDID("$FreeBSD$"); static void print_perftest(struct nvme_io_test *io_test, bool perthread) { - uint32_t i, io_completed = 0, iops, mbps; + uint64_t io_completed = 0, iops, mbps; + uint32_t i; for (i = 0; i < io_test->num_threads; i++) io_completed += io_test->io_completed[i]; @@ -53,15 +55,15 @@ print_perftest(struct nvme_io_test *io_t iops = io_completed/io_test->time; mbps = iops * io_test->size / (1024*1024); - printf("Threads: %2d Size: %6d %5s Time: %3d IO/s: %7d MB/s: %4d\n", + printf("Threads: %2d Size: %6d %5s Time: %3d IO/s: %7ju MB/s: %4ju\n", io_test->num_threads, io_test->size, io_test->opc == NVME_OPC_READ ? "READ" : "WRITE", - io_test->time, iops, mbps); + io_test->time, (uintmax_t)iops, (uintmax_t)mbps); if (perthread) for (i = 0; i < io_test->num_threads; i++) - printf("\t%3d: %8d IO/s\n", i, - io_test->io_completed[i]/io_test->time); + printf("\t%3d: %8ju IO/s\n", i, + (uintmax_t)io_test->io_completed[i]/io_test->time); exit(1); } Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Tue Oct 8 15:44:04 2013 (r256151) +++ head/sys/dev/nvme/nvme.h Tue Oct 8 15:47:22 2013 (r256152) @@ -720,7 +720,7 @@ struct nvme_io_test { uint32_t time; /* in seconds */ uint32_t num_threads; uint32_t flags; - uint32_t io_completed[NVME_TEST_MAX_THREADS]; + uint64_t io_completed[NVME_TEST_MAX_THREADS]; }; enum nvme_io_test_flags { Modified: head/sys/dev/nvme/nvme_test.c ============================================================================== --- head/sys/dev/nvme/nvme_test.c Tue Oct 8 15:44:04 2013 (r256151) +++ head/sys/dev/nvme/nvme_test.c Tue Oct 8 15:47:22 2013 (r256152) @@ -53,7 +53,7 @@ struct nvme_io_test_thread { void *buf; uint32_t size; uint32_t time; - uint32_t io_completed; + uint64_t io_completed; }; struct nvme_io_test_internal { @@ -66,7 +66,7 @@ struct nvme_io_test_internal { uint32_t td_active; uint32_t td_idx; uint32_t flags; - uint32_t io_completed[NVME_TEST_MAX_THREADS]; + uint64_t io_completed[NVME_TEST_MAX_THREADS]; }; static void @@ -90,8 +90,8 @@ nvme_ns_bio_test(void *arg) struct cdev *dev; void *buf; struct timeval t; - uint64_t offset; - uint32_t idx, io_completed = 0; + uint64_t io_completed = 0, offset; + uint32_t idx; #if __FreeBSD_version >= 900017 int ref; #endif From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 15:49:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 89142D13; Tue, 8 Oct 2013 15:49:15 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 767412C1F; Tue, 8 Oct 2013 15:49:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98FnFYY098301; Tue, 8 Oct 2013 15:49:15 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98FnFkg098300; Tue, 8 Oct 2013 15:49:15 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201310081549.r98FnFkg098300@svn.freebsd.org> From: Jim Harris Date: Tue, 8 Oct 2013 15:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256153 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 08 Oct 2013 15:49:15 -0000 Author: jimharris Date: Tue Oct 8 15:49:14 2013 New Revision: 256153 URL: http://svnweb.freebsd.org/changeset/base/256153 Log: Do not enable temperature threshold as an asynchronous event notification on NVMe controllers that do not support it. Sponsored by: Intel Reviewed by: carl Approved by: re (hrs) MFC after: 1 week Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Tue Oct 8 15:47:22 2013 (r256152) +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Oct 8 15:49:14 2013 (r256153) @@ -708,12 +708,26 @@ nvme_ctrlr_construct_and_submit_aer(stru static void nvme_ctrlr_configure_aer(struct nvme_controller *ctrlr) { + struct nvme_completion_poll_status status; union nvme_critical_warning_state state; struct nvme_async_event_request *aer; uint32_t i; state.raw = 0xFF; state.bits.reserved = 0; + + status.done = FALSE; + nvme_ctrlr_cmd_get_feature(ctrlr, NVME_FEAT_TEMPERATURE_THRESHOLD, + 0, NULL, 0, nvme_completion_poll_cb, &status); + while (status.done == FALSE) + pause("nvme", 1); + if (nvme_completion_is_error(&status.cpl) || + (status.cpl.cdw0 & 0xFFFF) == 0xFFFF || + (status.cpl.cdw0 & 0xFFFF) == 0x0000) { + nvme_printf(ctrlr, "temperature threshold not supported\n"); + state.bits.temperature = 0; + } + nvme_ctrlr_cmd_set_async_event_config(ctrlr, state, NULL, NULL); /* aerl is a zero-based value, so we need to add 1 here. */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 16:00:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F3E6E6A7; Tue, 8 Oct 2013 16:00:12 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D32292CF6; Tue, 8 Oct 2013 16:00:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98G0CkC003603; Tue, 8 Oct 2013 16:00:12 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98G0CRl003594; Tue, 8 Oct 2013 16:00:12 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201310081600.r98G0CRl003594@svn.freebsd.org> From: Jim Harris Date: Tue, 8 Oct 2013 16:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256154 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 08 Oct 2013 16:00:13 -0000 Author: jimharris Date: Tue Oct 8 16:00:12 2013 New Revision: 256154 URL: http://svnweb.freebsd.org/changeset/base/256154 Log: Log and then disable asynchronous notification of persistent events after they occur. This prevents repeated notifications of the same event. Status of these events may be viewed at any time by viewing the SMART/Health Info Page using nvmecontrol, whether or not asynchronous events notifications for those events are enabled. This log page can be viewed using: nvmecontrol logpage -p 2 Future enhancements may re-enable these notifications on a periodic basis so that if the notified condition persists, it will continue to be logged. Sponsored by: Intel Reviewed by: carl Approved by: re (hrs) MFC after: 1 week Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Tue Oct 8 15:49:14 2013 (r256153) +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Oct 8 16:00:12 2013 (r256154) @@ -617,9 +617,35 @@ nvme_ctrlr_get_log_page_size(struct nvme } static void +nvme_ctrlr_log_critical_warnings(struct nvme_controller *ctrlr, + union nvme_critical_warning_state state) +{ + + if (state.bits.available_spare == 1) + nvme_printf(ctrlr, "available spare space below threshold\n"); + + if (state.bits.temperature == 1) + nvme_printf(ctrlr, "temperature above threshold\n"); + + if (state.bits.device_reliability == 1) + nvme_printf(ctrlr, "device reliability degraded\n"); + + if (state.bits.read_only == 1) + nvme_printf(ctrlr, "media placed in read only mode\n"); + + if (state.bits.volatile_memory_backup == 1) + nvme_printf(ctrlr, "volatile memory backup device failed\n"); + + if (state.bits.reserved != 0) + nvme_printf(ctrlr, + "unknown critical warning(s): state = 0x%02x\n", state.raw); +} + +static void nvme_ctrlr_async_event_log_page_cb(void *arg, const struct nvme_completion *cpl) { - struct nvme_async_event_request *aer = arg; + struct nvme_async_event_request *aer = arg; + struct nvme_health_information_page *health_info; /* * If the log page fetch for some reason completed with an error, @@ -629,13 +655,33 @@ nvme_ctrlr_async_event_log_page_cb(void if (nvme_completion_is_error(cpl)) nvme_notify_async_consumers(aer->ctrlr, &aer->cpl, aer->log_page_id, NULL, 0); - else + else { + if (aer->log_page_id == NVME_LOG_HEALTH_INFORMATION) { + health_info = (struct nvme_health_information_page *) + aer->log_page_buffer; + nvme_ctrlr_log_critical_warnings(aer->ctrlr, + health_info->critical_warning); + /* + * Critical warnings reported through the + * SMART/health log page are persistent, so + * clear the associated bits in the async event + * config so that we do not receive repeated + * notifications for the same event. + */ + aer->ctrlr->async_event_config.raw &= + ~health_info->critical_warning.raw; + nvme_ctrlr_cmd_set_async_event_config(aer->ctrlr, + aer->ctrlr->async_event_config, NULL, NULL); + } + + /* * Pass the cpl data from the original async event completion, * not the log page fetch. */ nvme_notify_async_consumers(aer->ctrlr, &aer->cpl, aer->log_page_id, aer->log_page_buffer, aer->log_page_size); + } /* * Repost another asynchronous event request to replace the one @@ -709,12 +755,11 @@ static void nvme_ctrlr_configure_aer(struct nvme_controller *ctrlr) { struct nvme_completion_poll_status status; - union nvme_critical_warning_state state; struct nvme_async_event_request *aer; uint32_t i; - state.raw = 0xFF; - state.bits.reserved = 0; + ctrlr->async_event_config.raw = 0xFF; + ctrlr->async_event_config.bits.reserved = 0; status.done = FALSE; nvme_ctrlr_cmd_get_feature(ctrlr, NVME_FEAT_TEMPERATURE_THRESHOLD, @@ -725,10 +770,11 @@ nvme_ctrlr_configure_aer(struct nvme_con (status.cpl.cdw0 & 0xFFFF) == 0xFFFF || (status.cpl.cdw0 & 0xFFFF) == 0x0000) { nvme_printf(ctrlr, "temperature threshold not supported\n"); - state.bits.temperature = 0; + ctrlr->async_event_config.bits.temperature = 0; } - nvme_ctrlr_cmd_set_async_event_config(ctrlr, state, NULL, NULL); + nvme_ctrlr_cmd_set_async_event_config(ctrlr, + ctrlr->async_event_config, NULL, NULL); /* aerl is a zero-based value, so we need to add 1 here. */ ctrlr->num_aers = min(NVME_MAX_ASYNC_EVENTS, (ctrlr->cdata.aerl+1)); Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Tue Oct 8 15:49:14 2013 (r256153) +++ head/sys/dev/nvme/nvme_private.h Tue Oct 8 16:00:12 2013 (r256154) @@ -322,6 +322,9 @@ struct nvme_controller { struct cdev *cdev; + /** bit mask of warning types currently enabled for async events */ + union nvme_critical_warning_state async_event_config; + uint32_t num_aers; struct nvme_async_event_request aer[NVME_MAX_ASYNC_EVENTS]; From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 16:01:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0E25F8DB; Tue, 8 Oct 2013 16:01:44 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EFD532D2F; Tue, 8 Oct 2013 16:01:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98G1h3L006229; Tue, 8 Oct 2013 16:01:43 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98G1hp2006228; Tue, 8 Oct 2013 16:01:43 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201310081601.r98G1hp2006228@svn.freebsd.org> From: Jim Harris Date: Tue, 8 Oct 2013 16:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256155 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 08 Oct 2013 16:01:44 -0000 Author: jimharris Date: Tue Oct 8 16:01:43 2013 New Revision: 256155 URL: http://svnweb.freebsd.org/changeset/base/256155 Log: Do not leak resources during attach if nvme_ctrlr_construct() or the initial controller resets fail. Sponsored by: Intel Reviewed by: carl Approved by: re (hrs) MFC after: 1 week Modified: head/sys/dev/nvme/nvme.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Tue Oct 8 16:00:12 2013 (r256154) +++ head/sys/dev/nvme/nvme.c Tue Oct 8 16:01:43 2013 (r256155) @@ -221,8 +221,10 @@ nvme_attach(device_t dev) status = nvme_ctrlr_construct(ctrlr, dev); - if (status != 0) + if (status != 0) { + nvme_ctrlr_destruct(ctrlr, dev); return (status); + } /* * Reset controller twice to ensure we do a transition from cc.en==1 @@ -230,12 +232,16 @@ nvme_attach(device_t dev) * the controller was left in when boot handed off to OS. */ status = nvme_ctrlr_hw_reset(ctrlr); - if (status != 0) + if (status != 0) { + nvme_ctrlr_destruct(ctrlr, dev); return (status); + } status = nvme_ctrlr_hw_reset(ctrlr); - if (status != 0) + if (status != 0) { + nvme_ctrlr_destruct(ctrlr, dev); return (status); + } nvme_sysctl_initialize_ctrlr(ctrlr); From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 16:36:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 644FBBEF; Tue, 8 Oct 2013 16:36:18 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 380D42F8A; Tue, 8 Oct 2013 16:36:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98GaIip024055; Tue, 8 Oct 2013 16:36:18 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98GaHxs024053; Tue, 8 Oct 2013 16:36:17 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201310081636.r98GaHxs024053@svn.freebsd.org> From: Neel Natu Date: Tue, 8 Oct 2013 16:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256156 - 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, 08 Oct 2013 16:36:18 -0000 Author: neel Date: Tue Oct 8 16:36:17 2013 New Revision: 256156 URL: http://svnweb.freebsd.org/changeset/base/256156 Log: Change the behavior of bhyve such that the gdb listening port is opt-in rather than opt-out. Prior to this change if the "-g" option was not specified then a listening socket for tunneling gdb packets would be opened at port 6466. If a second virtual machine is fired up, also without the "-g" option, then that would fail because there is already a listener on port 6466. After this change if a gdb tunnel port needs to be created it needs to be explicitly specified with a "-g " command line option. Reviewed by: grehan@ Approved by: re@ (blanket) Modified: head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/dbgport.h Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Tue Oct 8 16:01:43 2013 (r256155) +++ head/usr.sbin/bhyve/bhyverun.c Tue Oct 8 16:36:17 2013 (r256156) @@ -123,7 +123,7 @@ usage(int code) " \n" " -a: local apic is in XAPIC mode (default is X2APIC)\n" " -A: create an ACPI table\n" - " -g: gdb port (default is %d and 0 means don't open)\n" + " -g: gdb port\n" " -c: # cpus (default 1)\n" " -p: pin vcpu 'n' to host cpu 'pincpu + n'\n" " -H: vmexit from the guest on hlt\n" @@ -134,7 +134,7 @@ usage(int code) " -s: PCI slot config\n" " -S: legacy PCI slot config\n" " -m: memory size in MB\n", - progname, DEFAULT_GDB_PORT); + progname); exit(code); } @@ -504,7 +504,7 @@ main(int argc, char *argv[]) bvmcons = 0; progname = basename(argv[0]); - gdb_port = DEFAULT_GDB_PORT; + gdb_port = 0; guest_ncpus = 1; ioapic = 0; memsize = 256 * MB; Modified: head/usr.sbin/bhyve/dbgport.h ============================================================================== --- head/usr.sbin/bhyve/dbgport.h Tue Oct 8 16:01:43 2013 (r256155) +++ head/usr.sbin/bhyve/dbgport.h Tue Oct 8 16:36:17 2013 (r256156) @@ -29,8 +29,6 @@ #ifndef _DBGPORT_H_ #define _DBGPORT_H_ -#define DEFAULT_GDB_PORT 6466 - void init_dbgport(int port); #endif From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 17:26:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ABB80C1F; Tue, 8 Oct 2013 17:26:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99D0D22E5; Tue, 8 Oct 2013 17:26:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98HQSn4050384; Tue, 8 Oct 2013 17:26:28 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98HQSpU050382; Tue, 8 Oct 2013 17:26:28 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310081726.r98HQSpU050382@svn.freebsd.org> From: Dimitry Andric Date: Tue, 8 Oct 2013 17:26:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256157 - 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, 08 Oct 2013 17:26:28 -0000 Author: dim Date: Tue Oct 8 17:26:28 2013 New Revision: 256157 URL: http://svnweb.freebsd.org/changeset/base/256157 Log: Now our binutils's assembler supports the Intel Random Number Generator extensions, we can change the .byte directives in sys/dev/random/ivy.c to plain 'rdrand' mnemonics. This already worked for clang users, but now it will also work for gcc users. Approved by: re (kib) Approved by: so (des) MFC after: 1 week Modified: head/sys/dev/random/ivy.c Modified: head/sys/dev/random/ivy.c ============================================================================== --- head/sys/dev/random/ivy.c Tue Oct 8 16:36:17 2013 (r256156) +++ head/sys/dev/random/ivy.c Tue Oct 8 17:26:28 2013 (r256157) @@ -68,12 +68,12 @@ ivy_rng_store(long *tmp) __asm __volatile( #ifdef __amd64__ - ".byte\t0x48,0x0f,0xc7,0xf0\n\t" /* rdrand %rax */ + "rdrand\t%%rax\n\t" "jnc\t1f\n\t" "movq\t%%rax,%1\n\t" "movl\t$8,%%eax\n" #else /* i386 */ - ".byte\t0x0f,0xc7,0xf0\n\t" /* rdrand %eax */ + "rdrand\t%%eax\n\t" "jnc\t1f\n\t" "movl\t%%eax,%1\n\t" "movl\t$4,%%eax\n" From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 18:09:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9DFE5910; Tue, 8 Oct 2013 18:09:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A912254D; Tue, 8 Oct 2013 18:09:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98I90hb072138; Tue, 8 Oct 2013 18:09:00 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98I90Dk072137; Tue, 8 Oct 2013 18:09:00 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310081809.r98I90Dk072137@svn.freebsd.org> From: Dimitry Andric Date: Tue, 8 Oct 2013 18:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256158 - 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, 08 Oct 2013 18:09:00 -0000 Author: dim Date: Tue Oct 8 18:09:00 2013 New Revision: 256158 URL: http://svnweb.freebsd.org/changeset/base/256158 Log: After r256062, the static function fbsdrun_get_next_cpu() in usr.sbin/bhyve/bhyverun.c is no longer used, so remove it to silence a gcc warning. Approved by: re (glebius) Modified: head/usr.sbin/bhyve/bhyverun.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Tue Oct 8 17:26:28 2013 (r256157) +++ head/usr.sbin/bhyve/bhyverun.c Tue Oct 8 18:09:00 2013 (r256158) @@ -217,17 +217,6 @@ fbsdrun_addcpu(struct vmctx *ctx, int vc } static int -fbsdrun_get_next_cpu(int curcpu) -{ - - /* - * Get the next available CPU. Assumes they arrive - * in ascending order with no gaps. - */ - return ((curcpu + 1) % foundcpus); -} - -static int vmexit_catch_reset(void) { stats.io_reset++; From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 19:18:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0ECA4C79; Tue, 8 Oct 2013 19:18:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D531B2A50; Tue, 8 Oct 2013 19:18:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98JI2nX009760; Tue, 8 Oct 2013 19:18:02 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98JI2tn009759; Tue, 8 Oct 2013 19:18:02 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310081918.r98JI2tn009759@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 8 Oct 2013 19:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256163 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 08 Oct 2013 19:18:03 -0000 Author: trasz Date: Tue Oct 8 19:18:02 2013 New Revision: 256163 URL: http://svnweb.freebsd.org/changeset/base/256163 Log: Properly fix out of memory handling in the iSCSI target. Approved by: re (glebius) Sponsored by: FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Oct 8 19:07:48 2013 (r256162) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Oct 8 19:18:02 2013 (r256163) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2301,7 +2302,8 @@ cfiscsi_datamove_in(union ctl_io *io) if (response == NULL) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); - icl_pdu_free(request); + ctl_set_busy(&io->scsiio); + io->scsiio.be_move_done(io); cfiscsi_session_terminate(cs); return; } @@ -2330,8 +2332,9 @@ cfiscsi_datamove_in(union ctl_io *io) if (error != 0) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); - icl_pdu_free(request); icl_pdu_free(response); + ctl_set_busy(&io->scsiio); + io->scsiio.be_move_done(io); cfiscsi_session_terminate(cs); return; } @@ -2428,8 +2431,10 @@ cfiscsi_datamove_out(union ctl_io *io) if (cdw == NULL) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); - icl_pdu_free(request); + ctl_set_busy(&io->scsiio); + io->scsiio.be_move_done(io); cfiscsi_session_terminate(cs); + return; } cdw->cdw_ctl_io = io; cdw->cdw_target_transfer_tag = htonl(target_transfer_tag); @@ -2462,8 +2467,10 @@ cfiscsi_datamove_out(union ctl_io *io) if (response == NULL) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); - icl_pdu_free(request); + ctl_set_busy(&io->scsiio); + io->scsiio.be_move_done(io); cfiscsi_session_terminate(cs); + return; } bhsr2t = (struct iscsi_bhs_r2t *)response->ip_bhs; bhsr2t->bhsr2t_opcode = ISCSI_BHS_OPCODE_R2T; From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 19: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7FE913E3; Tue, 8 Oct 2013 19:39:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C9CB2B89; Tue, 8 Oct 2013 19:39:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98JdMI3020739; Tue, 8 Oct 2013 19:39:22 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98JdM0Z020738; Tue, 8 Oct 2013 19:39:22 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310081939.r98JdM0Z020738@svn.freebsd.org> From: Dimitry Andric Date: Tue, 8 Oct 2013 19:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256164 - 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, 08 Oct 2013 19:39:22 -0000 Author: dim Date: Tue Oct 8 19:39:21 2013 New Revision: 256164 URL: http://svnweb.freebsd.org/changeset/base/256164 Log: In usr.sbin/bhyve/pci_ahci.c, fix several gcc warnings of the form "assignment makes pointer from integer without a cast", by changing the cmd_lst and rbis members of struct ahci_port from integers to pointers. Also surround a pow-of-2 test expression with parentheses to clarify it, and avoid another gcc warning. Approved by: re (glebius) Reviewed by: grehan, mav Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Tue Oct 8 19:18:02 2013 (r256163) +++ head/usr.sbin/bhyve/pci_ahci.c Tue Oct 8 19:39:21 2013 (r256164) @@ -119,8 +119,8 @@ struct ahci_ioreq { struct ahci_port { struct blockif_ctxt *bctx; struct pci_ahci_softc *pr_sc; - uint64_t cmd_lst; - uint64_t rfis; + uint8_t *cmd_lst; + uint8_t *rfis; int atapi; int reset; int mult_sectors; @@ -222,7 +222,7 @@ ahci_write_fis(struct ahci_port *p, enum { int offset, len, irq; - if (p->rfis == 0 || !(p->cmd & AHCI_P_CMD_FRE)) + if (p->rfis == NULL || !(p->cmd & AHCI_P_CMD_FRE)) return; switch (ft) { @@ -396,7 +396,7 @@ ahci_handle_dma(struct ahci_port *p, int sc = p->pr_sc; prdt = (struct ahci_prdt_entry *)(cfis + 0x80); - hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); ncq = 0; readop = 1; @@ -508,7 +508,7 @@ write_prdt(struct ahci_port *p, int slot void *from; int i, len; - hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); len = size; from = buf; prdt = (struct ahci_prdt_entry *)(cfis + 0x80); @@ -528,7 +528,7 @@ handle_identify(struct ahci_port *p, int { struct ahci_cmd_hdr *hdr; - hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); if (p->atapi || hdr->prdtl == 0) { p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; p->is |= AHCI_P_IX_TFE; @@ -869,7 +869,7 @@ atapi_read(struct ahci_port *p, int slot sc = p->pr_sc; acmd = cfis + 0x40; - hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); prdt = (struct ahci_prdt_entry *)(cfis + 0x80); prdt += seek; @@ -1178,7 +1178,7 @@ ahci_handle_cmd(struct ahci_port *p, int } case ATA_SET_MULTI: if (cfis[12] != 0 && - (cfis[12] > 128 || (cfis[12] & cfis[12] - 1))) { + (cfis[12] > 128 || (cfis[12] & (cfis[12] - 1)))) { p->tfd = ATA_S_ERROR | ATA_S_READY; p->tfd |= (ATA_ERROR_ABORT << 8); } else { @@ -1241,7 +1241,7 @@ ahci_handle_slot(struct ahci_port *p, in int cfl; sc = p->pr_sc; - hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); cfl = (hdr->flags & 0x1f) * 4; cfis = paddr_guest2host(ahci_ctx(sc), hdr->ctba, 0x80 + hdr->prdtl * sizeof(struct ahci_prdt_entry)); @@ -1318,7 +1318,7 @@ ata_ioreq_cb(struct blockif_req *br, int slot = aior->slot; pending = aior->prdtl; sc = p->pr_sc; - hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); if (cfis[2] == ATA_WRITE_FPDMA_QUEUED || cfis[2] == ATA_READ_FPDMA_QUEUED) @@ -1380,7 +1380,7 @@ atapi_ioreq_cb(struct blockif_req *br, i slot = aior->slot; pending = aior->prdtl; sc = p->pr_sc; - hdr = p->cmd_lst + aior->slot * AHCI_CL_SIZE; + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + aior->slot * AHCI_CL_SIZE); pthread_mutex_lock(&sc->mtx); From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 20:04:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1B676BF8; Tue, 8 Oct 2013 20:04:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 083A72D05; Tue, 8 Oct 2013 20:04:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98K4ZPg034590; Tue, 8 Oct 2013 20:04:35 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98K4ZBo034589; Tue, 8 Oct 2013 20:04:35 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310082004.r98K4ZBo034589@svn.freebsd.org> From: Dimitry Andric Date: Tue, 8 Oct 2013 20:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256166 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 08 Oct 2013 20:04:36 -0000 Author: dim Date: Tue Oct 8 20:04:35 2013 New Revision: 256166 URL: http://svnweb.freebsd.org/changeset/base/256166 Log: In sys/amd64/amd64/pmap.c, fix several gcc warnings about uninitialized variables in reclaim_pv_chunk(). Approved by: re (marius) Reviewed by: neel, kib X-MFC-With: r256072 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Oct 8 19:50:25 2013 (r256165) +++ head/sys/amd64/amd64/pmap.c Tue Oct 8 20:04:35 2013 (r256166) @@ -2705,6 +2705,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, str KASSERT(lockp != NULL, ("reclaim_pv_chunk: lockp is NULL")); pmap = NULL; m_pc = NULL; + PG_G = PG_A = PG_M = PG_RW = 0; SLIST_INIT(&free); TAILQ_INIT(&new_tail); mtx_lock(&pv_chunks_mutex); From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 20:39:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B1E50ECE; Tue, 8 Oct 2013 20:39:38 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9EC212F4B; Tue, 8 Oct 2013 20:39:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98Kdcml052113; Tue, 8 Oct 2013 20:39:38 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98Kdcid052112; Tue, 8 Oct 2013 20:39:38 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310082039.r98Kdcid052112@svn.freebsd.org> From: Devin Teske Date: Tue, 8 Oct 2013 20:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256167 - 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: Tue, 08 Oct 2013 20:39:38 -0000 Author: dteske Date: Tue Oct 8 20:39:38 2013 New Revision: 256167 URL: http://svnweb.freebsd.org/changeset/base/256167 Log: Remove mention of [fixed] known issue not-specific to updating. Vendor update to [c]dialog-1.2-20130925 has fixed known problems. Vendor update SVN revisions: 255917-255917, 255852, and 255958. Reviewed by: gjb Approved by: re (gjb) Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Oct 8 20:04:35 2013 (r256166) +++ head/UPDATING Tue Oct 8 20:39:38 2013 (r256167) @@ -77,19 +77,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 has been updated to use this support. A new gcc is required to build the aesni module on both i386 and amd64. -20130827: - Thomas Dickey (vendor author thereof) reports that dialog(1) since - 2011/10/18 has a bug in handling --hline. Testers and I noticed the - --hline is not ignored but displayed as a NULL string, regardless of - value. This will cause confusion in some bsdconfig dialogs where the - --hline is used to inform users which keybindings to use. This will - likewise affect any other persons relying on --hline. It also looks - rather strange seeing "[]" at the bottom of dialog(1) widgets when - passing --hline "anything". Thomas said he will have a look in a few - weeks. NOTE: The "[]" brackets appear with the left-edge where it - would normally appear given the width of text to display, but the - displayed text is not there (part of the bug). - 20130821: The PADLOCK_RNG and RDRAND_RNG kernel options are now devices. Thus "device padlock_rng" and "device rdrand_rng" should be From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 29E52E9; Tue, 8 Oct 2013 20:41:27 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E6AFD2F86; Tue, 8 Oct 2013 20:41:26 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa07.fnfis.com (8.14.5/8.14.5) with ESMTP id r98KfPhH014644 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 8 Oct 2013 15:41:25 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.103]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.02.0309.002; Tue, 8 Oct 2013 15:41:24 -0500 From: "Teske, Devin" To: Devin Teske Subject: Re: svn commit: r256167 - head Thread-Topic: svn commit: r256167 - head Thread-Index: AQHOxGbAaQiYBRtsKkClPwj4XBHdyg== Date: Tue, 8 Oct 2013 20:41:23 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D720FC46191@LTCFISWMSGMB21.FNFIS.com> References: <201310082039.r98Kdcid052112@svn.freebsd.org> In-Reply-To: <201310082039.r98Kdcid052112@svn.freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="us-ascii" Content-ID: <8EEBF37A9FA027428125F28EF4EC6605@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-10-08_08:2013-10-08,2013-10-08,1970-01-01 signatures=0 Cc: "" , "" , "" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 08 Oct 2013 20:41:27 -0000 On Oct 8, 2013, at 1:39 PM, Devin Teske wrote: > Author: dteske > Date: Tue Oct 8 20:39:38 2013 > New Revision: 256167 > URL: http://svnweb.freebsd.org/changeset/base/256167 >=20 > Log: > Remove mention of [fixed] known issue not-specific to updating. > Vendor update to [c]dialog-1.2-20130925 has fixed known problems. > Vendor update SVN revisions: 255917-255917, 255852, and 255958. >=20 That's 255917-25591*8* Finger slipped. --=20 Devin > Reviewed by: gjb > Approved by: re (gjb) >=20 > Modified: > head/UPDATING >=20 > Modified: head/UPDATING > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/UPDATING Tue Oct 8 20:04:35 2013 (r256166) > +++ head/UPDATING Tue Oct 8 20:39:38 2013 (r256167) > @@ -77,19 +77,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 > has been updated to use this support. A new gcc is required to build > the aesni module on both i386 and amd64. >=20 > -20130827: > - Thomas Dickey (vendor author thereof) reports that dialog(1) sin= ce > - 2011/10/18 has a bug in handling --hline. Testers and I noticed = the > - --hline is not ignored but displayed as a NULL string, regardles= s of > - value. This will cause confusion in some bsdconfig dialogs where= the > - --hline is used to inform users which keybindings to use. This w= ill > - likewise affect any other persons relying on --hline. It also lo= oks > - rather strange seeing "[]" at the bottom of dialog(1) widgets wh= en > - passing --hline "anything". Thomas said he will have a look in a= few > - weeks. NOTE: The "[]" brackets appear with the left-edge where it > - would normally appear given the width of text to display, but the > - displayed text is not there (part of the bug). > - > 20130821: > The PADLOCK_RNG and RDRAND_RNG kernel options are now devices. > Thus "device padlock_rng" and "device rdrand_rng" should be _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 23:12:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 351DA420; Tue, 8 Oct 2013 23:12:51 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E200D29C9; Tue, 8 Oct 2013 23:12:50 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 67688885D; Tue, 8 Oct 2013 23:12:49 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 67688885D Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Tue, 8 Oct 2013 19:12:47 -0400 From: Glen Barber To: Jim Harris Subject: Re: svn commit: r256151 - in head/sys/dev: nvd nvme Message-ID: <20131008231247.GA5745@glenbarber.us> References: <201310081544.r98Fi4R8096543@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BXVAT5kNtrzKuDFl" Content-Disposition: inline In-Reply-To: <201310081544.r98Fi4R8096543@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-ALPHA4 amd64 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, 08 Oct 2013 23:12:51 -0000 --BXVAT5kNtrzKuDFl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 08, 2013 at 03:44:04PM +0000, Jim Harris wrote: > Author: jimharris > Date: Tue Oct 8 15:44:04 2013 > New Revision: 256151 > URL: http://svnweb.freebsd.org/changeset/base/256151 >=20 > Log: > Add driver-assisted striping for upcoming Intel NVMe controllers that c= an > benefit from it. > =20 > Modified: head/sys/dev/nvme/nvme_ns.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/nvme/nvme_ns.c Tue Oct 8 14:10:32 2013 (r256150) > +++ head/sys/dev/nvme/nvme_ns.c Tue Oct 8 15:44:04 2013 (r256151) > @@ -34,13 +34,31 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > =20 > #include > =20 > +#include > + > #include "nvme_private.h" > =20 I think an include is missing. This breaks the LINT build. cc -c -O2 -pipe -fno-strict-aliasing -std=3Dc99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -I/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -DGPROF -DGPROF4 -DGUPROF -fno-builtin -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=3Dkernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror -pg /src/sys/dev/nvme/nvme_ns.c In file included from /src/sys/dev/nvme/nvme_ns.c:43: /src/sys/geom/geom.h:356:3: error: implicit declaration of function 'KASSERT' is invalid in C99 [-Werror,-Wimplicit-function-declaration] KASSERT(g_valid_obj(ptr) =3D=3D 0, ^ /src/sys/geom/geom.h:357:8: error: expression result unused [-Werror,-Wunused-value] ("g_free(%p) of live object, type %d", ptr, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /src/sys/geom/geom.h:357:46: error: expression result unused [-Werror,-Wunused-value] ("g_free(%p) of live object, type %d", ptr, ^~~ 3 errors generated. *** Error code 1 http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-amd64-amd64.full Glen --BXVAT5kNtrzKuDFl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJSVJFvAAoJELls3eqvi17QEOsP/2pJ4EYdBapH9eBoKHf89MBC 5mehp2woHgD8dCcuFVKpMne53qylTtY1NGlQBoDB9nu46DKJSyN2k09G09aEXuIY +gHMuLvDG/f6+cZNRz5Gd5muvQkkrJPiTYl8i378JZ3aseM014p0bSpgWQOxDkc/ KVN9T0Wp2HnELwvbHKBR5haMokyBh+SO4+ReJsjJ0CKv6I7jlopAoEyu1FnSXp8g 29Hgnq9VDj4TTO3eK9Lgju/9mJtu7J/r1Fhpgvp9lpF7a+NCJN4QaI5H/0cleyqx 2XWpPiYlxKNlnNsaSBbiUw2rhmxPAZMLbi4aoh0MP6WqD6s7x/1K/Hdg+R4XCs/C KBK3d11gcPH0P9YQb8P8Ph9/kt0xeLy1bEfRTkiOOPL5TQEqIhbtfqHAZCI6wFwf nIaA60Ooafu8tIZ27KgYXnc8Re2jrHpD1miipbzIBoUh21+N6qHKn3aM+alvCqJH dlaq/Qbb8fPyRZczsr9FQSLbYfAxKSkMOgXBMK1kv32K2+Bwx+tpab94vLJ175a0 6Wlbj/X6ciH1KXvftBbJrKyqJ1cKB+EA5Kbd6IiKceVg58HFGENO3O9i69BuIB+K SXT2oE5nv7YMQJUziG7YkPWzn6WdOG6K1Rnnm5jMyGd8ecm1ZmcckvBaJ10Mgx/8 iStlITzbt8kR600ARGAj =lpGw -----END PGP SIGNATURE----- --BXVAT5kNtrzKuDFl-- From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 23:23:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 060F172E; Tue, 8 Oct 2013 23:23:05 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E7CC82A4A; Tue, 8 Oct 2013 23:23:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98NN4Xr038653; Tue, 8 Oct 2013 23:23:04 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98NN4cS038652; Tue, 8 Oct 2013 23:23:04 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201310082323.r98NN4cS038652@svn.freebsd.org> From: Jim Harris Date: Tue, 8 Oct 2013 23:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256169 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 08 Oct 2013 23:23:05 -0000 Author: jimharris Date: Tue Oct 8 23:23:04 2013 New Revision: 256169 URL: http://svnweb.freebsd.org/changeset/base/256169 Log: Fix the LINT build. Approved by: re (implicit) MFC after: 1 week Modified: head/sys/dev/nvme/nvme_ns.c Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Tue Oct 8 22:14:07 2013 (r256168) +++ head/sys/dev/nvme/nvme_ns.c Tue Oct 8 23:23:04 2013 (r256169) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include From owner-svn-src-all@FreeBSD.ORG Tue Oct 8 23:28:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0E293BFB; Tue, 8 Oct 2013 23:28:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D09A92A85; Tue, 8 Oct 2013 23:28:07 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 0F91F89BD; Tue, 8 Oct 2013 23:28:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 0F91F89BD Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Tue, 8 Oct 2013 19:27:59 -0400 From: Glen Barber To: Jim Harris Subject: Re: svn commit: r256169 - head/sys/dev/nvme Message-ID: <20131008232759.GB5745@glenbarber.us> References: <201310082323.r98NN4cS038652@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WYTEVAkct0FjGQmd" Content-Disposition: inline In-Reply-To: <201310082323.r98NN4cS038652@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-ALPHA4 amd64 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, 08 Oct 2013 23:28:08 -0000 --WYTEVAkct0FjGQmd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 08, 2013 at 11:23:04PM +0000, Jim Harris wrote: > Author: jimharris > Date: Tue Oct 8 23:23:04 2013 > New Revision: 256169 > URL: http://svnweb.freebsd.org/changeset/base/256169 >=20 > Log: > Fix the LINT build. > =20 Thanks! Glen --WYTEVAkct0FjGQmd Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJSVJT/AAoJELls3eqvi17QXTYQALVTHrNeHk9UCjFKOMHDFBZd B7R029m6tIrYwLZBXkfX7+Ifx18QS3wz0g7Jj6lK+tL8MABe+Px0Dw9Rx6C8VX0b fQPoZ19Icy6q8KV/Q571Z9Tg30r1mcBEr3sHxuXTIrePsZlOFTzj91MSiELv+EKL +qZd2wdO6YlbofdYE6GHvu6HZqp7cRvKh4et4feinsH3S3oAhAYcwxcx2AVmTOxz R+S9CUidGDHqZv4Z2rnaPcGOUm2kJXBg3tbM+wLnjfA5wvyH1G9FSYFu+sUbbnGQ pl6xDntC1z5dRyWTlhtAQSWfXJrBWo6SIP4QIBbuaJFS2Ymg1QuMyAt7ANZ97Ckh wToqnTaV0EACoTscKGL+uRILVWU02f7ptAN+BEbRY8KiDHFlsMj2+neeZ+FWnbDH +POUo8KEIz9k56M7lW8CYAIamOdxR3OHudZUXjcga7f5MdmpE1ku437e6cN/OSR4 R1tydLB2p0UNJQkEVmYdfcUmi+nvAxPKFBBQl9q9Zlah7Dzg5jRJ9RCx4+tpDXvQ hTHgGtAcoROzrjotw8iHigK3llpkp2a6OnCJqJPbqQKda4MWUPGDO3fPQDpkpUrs CKshwDgL0/02RJfn3CznsQpR4NFKOE+LhvyO7Rz4aunC2XXNk0tXBftUYAoAAgKI My62RYpCgtz0GEgJurbs =8ahz -----END PGP SIGNATURE----- --WYTEVAkct0FjGQmd-- From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 00:21:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D96764A6; Wed, 9 Oct 2013 00:21:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C6DB52CF9; Wed, 9 Oct 2013 00:21:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r990LLcg070019; Wed, 9 Oct 2013 00:21:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r990LLs2070018; Wed, 9 Oct 2013 00:21:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310090021.r990LLs2070018@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Oct 2013 00:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256170 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 00:21:21 -0000 Author: adrian Date: Wed Oct 9 00:21:21 2013 New Revision: 256170 URL: http://svnweb.freebsd.org/changeset/base/256170 Log: Add two new MIPS CPU families - mips24k and mips74k. They're both different cores: * mips24k is an 8-stage pipeline, mips32r1 ABI, non-superscalar core. * mips74k is a dual-issue 15-stage superscalar design, mips32r2 ABI. They have different sets of quirks and bugs; these #define entries will be used to work around these. Now, strictly speaking, we should have CPU ABI families (mips32r1, mips32r2, etc) and CPU core types (mips4k, mips24k, mips74k, etc.) But this is the starting point of that particular tidy-up. Reviewed by: imp@ Approved by: re@ (gjb) Modified: head/sys/conf/options.mips Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Tue Oct 8 23:23:04 2013 (r256169) +++ head/sys/conf/options.mips Wed Oct 9 00:21:21 2013 (r256170) @@ -29,6 +29,8 @@ # $FreeBSD$ CPU_MIPS4KC opt_global.h +CPU_MIPS24KC opt_global.h +CPU_MIPS74KC opt_global.h CPU_MIPS32 opt_global.h CPU_MIPS64 opt_global.h CPU_SENTRY5 opt_global.h From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 00:22:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 936825E9; Wed, 9 Oct 2013 00:22:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 810452D06; Wed, 9 Oct 2013 00:22:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r990ML4j070319; Wed, 9 Oct 2013 00:22:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r990MLvh070318; Wed, 9 Oct 2013 00:22:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310090022.r990MLvh070318@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Oct 2013 00:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256171 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 00:22:21 -0000 Author: adrian Date: Wed Oct 9 00:22:21 2013 New Revision: 256171 URL: http://svnweb.freebsd.org/changeset/base/256171 Log: Shuffle the includes around so they occur after opt_global.h is included; this way the CPU ABI / core #define items are there. Reviewed by: imp@ Approved by: re@ (gjb) Modified: head/sys/mips/mips/elf_trampoline.c Modified: head/sys/mips/mips/elf_trampoline.c ============================================================================== --- head/sys/mips/mips/elf_trampoline.c Wed Oct 9 00:21:21 2013 (r256170) +++ head/sys/mips/mips/elf_trampoline.c Wed Oct 9 00:22:21 2013 (r256171) @@ -32,10 +32,6 @@ __FBSDID("$FreeBSD$"); #else #include #endif -#include -#include -#include -#include /* * Since we are compiled outside of the normal kernel build process, we @@ -43,6 +39,11 @@ __FBSDID("$FreeBSD$"); */ #include "opt_global.h" +#include +#include +#include +#include + #ifndef KERNNAME #error Kernel name not provided #endif From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 00:27:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EB132758; Wed, 9 Oct 2013 00:27:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BE72C2D22; Wed, 9 Oct 2013 00:27:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r990RCEo071553; Wed, 9 Oct 2013 00:27:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r990RCsv071545; Wed, 9 Oct 2013 00:27:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310090027.r990RCsv071545@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Oct 2013 00:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256172 - head/sys/mips/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: Wed, 09 Oct 2013 00:27:13 -0000 Author: adrian Date: Wed Oct 9 00:27:12 2013 New Revision: 256172 URL: http://svnweb.freebsd.org/changeset/base/256172 Log: Add "better" MIPS24k and MIPS74k barriers. * the mips74k cores only need EHB (which is 'sll $0, $0, 3') here; NOPs don't actually work. * add EHB as the last NOP for the default barriers/hazards; that is "better" behaviour and should work on a wider variety of processors. This allows the existing (icky) TLB code to work, allowing the AR9344 SoC (mips74k) to actually get through kernel startup. Tested: * AR9344 SoC - (mips74k) * AR9331 SoC - (mips24k) TODO: * test on mips4k CPUs, just to be sure. * document that sll $0, $0, 3 is actually "EHB" and that it falls back to being a NOP for pre-mips32r1. * mips24k has an errata that we currently don't correctly explicitly state - ie, that after DERET/ERET, the only valid instruction is a NOP. Reviewed by: imp@ Approved by: re@ (gjb) Modified: head/sys/mips/include/asm.h head/sys/mips/include/cpuregs.h Modified: head/sys/mips/include/asm.h ============================================================================== --- head/sys/mips/include/asm.h Wed Oct 9 00:22:21 2013 (r256171) +++ head/sys/mips/include/asm.h Wed Oct 9 00:27:12 2013 (r256172) @@ -725,9 +725,12 @@ _C_LABEL(x): #elif defined(CPU_RMI) #define HAZARD_DELAY #define ITLBNOPFIX +#elif defined(CPU_MIPS74KC) +#define HAZARD_DELAY sll $0,$0,3 +#define ITLBNOPFIX sll $0,$0,3 #else -#define ITLBNOPFIX nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; -#define HAZARD_DELAY nop;nop;nop;nop;nop; +#define ITLBNOPFIX nop;nop;nop;nop;nop;nop;nop;nop;nop;sll $0,$0,3; +#define HAZARD_DELAY nop;nop;nop;nop;sll $0,$0,3; #endif #endif /* !_MACHINE_ASM_H_ */ Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Wed Oct 9 00:22:21 2013 (r256171) +++ head/sys/mips/include/cpuregs.h Wed Oct 9 00:27:12 2013 (r256172) @@ -149,6 +149,11 @@ #define MIPS_CCA_CC 0x05 /* Cacheable Coherent. */ #endif +#if defined(CPU_MIPS74KC) +#define MIPS_CCA_UNCACHED 0x02 +#define MIPS_CCA_CACHED 0x00 +#endif + #ifndef MIPS_CCA_UNCACHED #define MIPS_CCA_UNCACHED MIPS_CCA_UC #endif @@ -204,12 +209,14 @@ #define COP0_SYNC .word 0xc0 /* ehb */ #elif defined(CPU_SB1) #define COP0_SYNC ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop +#elif defined(CPU_MIPS74KC) +#define COP0_SYNC .word 0xc0 /* ehb */ #else /* * Pick a reasonable default based on the "typical" spacing described in the * "CP0 Hazards" chapter of MIPS Architecture Book Vol III. */ -#define COP0_SYNC ssnop; ssnop; ssnop; ssnop; ssnop +#define COP0_SYNC ssnop; ssnop; ssnop; ssnop; .word 0xc0; #endif #define COP0_HAZARD_FPUENABLE nop; nop; nop; nop; From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 00:27:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 46D7888C; Wed, 9 Oct 2013 00:27:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 347402D26; Wed, 9 Oct 2013 00:27:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r990RYEG071732; Wed, 9 Oct 2013 00:27:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r990RY0f071731; Wed, 9 Oct 2013 00:27:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310090027.r990RY0f071731@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Oct 2013 00:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256173 - head/sys/mips/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: Wed, 09 Oct 2013 00:27:34 -0000 Author: adrian Date: Wed Oct 9 00:27:33 2013 New Revision: 256173 URL: http://svnweb.freebsd.org/changeset/base/256173 Log: Mark AR934x based boards to be mips74k. Reviewed by: imp@ Approved by: re@ (gjb) Modified: head/sys/mips/conf/AR934X_BASE Modified: head/sys/mips/conf/AR934X_BASE ============================================================================== --- head/sys/mips/conf/AR934X_BASE Wed Oct 9 00:27:12 2013 (r256172) +++ head/sys/mips/conf/AR934X_BASE Wed Oct 9 00:27:33 2013 (r256173) @@ -12,7 +12,7 @@ machine mips mips ident AR934X_BASE -cpu CPU_MIPS4KC +cpu CPU_MIPS74KC makeoptions KERNLOADADDR=0x80050000 options HZ=1000 From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 02:01:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 860409C8; Wed, 9 Oct 2013 02:01:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 73E172162; Wed, 9 Oct 2013 02:01:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9921LGH025730; Wed, 9 Oct 2013 02:01:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9921LXY025729; Wed, 9 Oct 2013 02:01:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310090201.r9921LXY025729@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Oct 2013 02:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256174 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 02:01:21 -0000 Author: adrian Date: Wed Oct 9 02:01:20 2013 New Revision: 256174 URL: http://svnweb.freebsd.org/changeset/base/256174 Log: Fix interrupt handling from the APB periperals (ie, UART) - it also requires an explicit acknowledgement. Tested: * AR9344 (DB120) SoC Approved by: re@ (gjb) Modified: head/sys/mips/atheros/apb.c Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Wed Oct 9 00:27:33 2013 (r256173) +++ head/sys/mips/atheros/apb.c Wed Oct 9 02:01:20 2013 (r256174) @@ -359,6 +359,9 @@ apb_filter(void *arg) case AR71XX_SOC_AR7242: case AR71XX_SOC_AR9330: case AR71XX_SOC_AR9331: + case AR71XX_SOC_AR9341: + case AR71XX_SOC_AR9342: + case AR71XX_SOC_AR9344: /* Ack/clear the irq on status register for AR724x */ ATH_WRITE_REG(AR71XX_MISC_INTR_STATUS, reg & ~(1 << irq)); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 03:19:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 607459C6; Wed, 9 Oct 2013 03:19:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DD64252A; Wed, 9 Oct 2013 03:19:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r993J6rj066842; Wed, 9 Oct 2013 03:19:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r993J533066832; Wed, 9 Oct 2013 03:19:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310090319.r993J533066832@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Oct 2013 03:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256175 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 03:19:06 -0000 Author: adrian Date: Wed Oct 9 03:19:05 2013 New Revision: 256175 URL: http://svnweb.freebsd.org/changeset/base/256175 Log: Add some missing AR934x register definitions. These are needed for ethernet bootstrap. Approved by: re@ (gjb) Modified: head/sys/mips/atheros/ar71xxreg.h head/sys/mips/atheros/ar934xreg.h Modified: head/sys/mips/atheros/ar71xxreg.h ============================================================================== --- head/sys/mips/atheros/ar71xxreg.h Wed Oct 9 02:01:20 2013 (r256174) +++ head/sys/mips/atheros/ar71xxreg.h Wed Oct 9 03:19:05 2013 (r256175) @@ -336,6 +336,7 @@ typedef enum { #define MAC_MII_CFG_SCAN_AUTO_INC (1 << 5) #define MAC_MII_CFG_PREAMBLE_SUP (1 << 4) #define MAC_MII_CFG_CLOCK_SELECT_MASK 0x7 +#define MAC_MII_CFG_CLOCK_SELECT_MASK_AR933X 0xf #define MAC_MII_CFG_CLOCK_DIV_4 0 #define MAC_MII_CFG_CLOCK_DIV_6 2 #define MAC_MII_CFG_CLOCK_DIV_8 3 @@ -343,6 +344,17 @@ typedef enum { #define MAC_MII_CFG_CLOCK_DIV_14 5 #define MAC_MII_CFG_CLOCK_DIV_20 6 #define MAC_MII_CFG_CLOCK_DIV_28 7 + +/* .. and the AR933x/AR934x extensions */ +#define MAC_MII_CFG_CLOCK_DIV_34 8 +#define MAC_MII_CFG_CLOCK_DIV_42 9 +#define MAC_MII_CFG_CLOCK_DIV_50 10 +#define MAC_MII_CFG_CLOCK_DIV_58 11 +#define MAC_MII_CFG_CLOCK_DIV_66 12 +#define MAC_MII_CFG_CLOCK_DIV_74 13 +#define MAC_MII_CFG_CLOCK_DIV_82 14 +#define MAC_MII_CFG_CLOCK_DIV_98 15 + #define AR71XX_MAC_MII_CMD 0x24 #define MAC_MII_CMD_SCAN_CYCLE (1 << 1) #define MAC_MII_CMD_READ 1 Modified: head/sys/mips/atheros/ar934xreg.h ============================================================================== --- head/sys/mips/atheros/ar934xreg.h Wed Oct 9 02:01:20 2013 (r256174) +++ head/sys/mips/atheros/ar934xreg.h Wed Oct 9 03:19:05 2013 (r256175) @@ -29,6 +29,8 @@ #ifndef __AR934X_REG_H__ #define __AR934X_REG_H__ +#define AR934X_GMAC_BASE (AR71XX_APB_BASE + 0x00070000) +#define AR934X_GMAC_SIZE 0x14 #define AR934X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) #define AR934X_WMAC_SIZE 0x20000 #define AR934X_EHCI_BASE 0x1b000000 @@ -36,6 +38,23 @@ #define AR934X_SRIF_BASE (AR71XX_APB_BASE + 0x00116000) #define AR934X_SRIF_SIZE 0x1000 +/* AR934x GMAC configuration */ +#define AR934X_GMAC_REG_ETH_CFG (AR934X_GMAC_BASE + 0x00) + +#define AR934X_ETH_CFG_RGMII_GMAC0 (1 << 0) +#define AR934X_ETH_CFG_MII_GMAC0 (1 << 1) +#define AR934X_ETH_CFG_GMII_GMAC0 (1 << 2) +#define AR934X_ETH_CFG_MII_GMAC0_MASTER (1 << 3) +#define AR934X_ETH_CFG_MII_GMAC0_SLAVE (1 << 4) +#define AR934X_ETH_CFG_MII_GMAC0_ERR_EN (1 << 5) +#define AR934X_ETH_CFG_SW_ONLY_MODE (1 << 6) +#define AR934X_ETH_CFG_SW_PHY_SWAP (1 << 7) +#define AR934X_ETH_CFG_SW_APB_ACCESS (1 << 9) +#define AR934X_ETH_CFG_RMII_GMAC0 (1 << 10) +#define AR933X_ETH_CFG_MII_CNTL_SPEED (1 << 11) +#define AR934X_ETH_CFG_RMII_GMAC0_MASTER (1 << 12) +#define AR934X_ETH_CFG_SW_ACC_MSB_FIRST (1 << 13) + #define AR934X_DDR_REG_FLUSH_GE0 (AR71XX_APB_BASE + 0x9c) #define AR934X_DDR_REG_FLUSH_GE1 (AR71XX_APB_BASE + 0xa0) #define AR934X_DDR_REG_FLUSH_USB (AR71XX_APB_BASE + 0xa4) @@ -45,6 +64,9 @@ #define AR934X_PLL_CPU_CONFIG_REG (AR71XX_PLL_CPU_BASE + 0x00) #define AR934X_PLL_DDR_CONFIG_REG (AR71XX_PLL_CPU_BASE + 0x04) #define AR934X_PLL_CPU_DDR_CLK_CTRL_REG (AR71XX_PLL_CPU_BASE + 0x08) +#define AR934X_PLL_SWITCH_CLOCK_CONTROL_REG (AR71XX_PLL_CPU_BASE + 0x24) +#define AR934X_PLL_SWITCH_CLOCK_CONTROL_MDIO_CLK_SEL (1 << 6) +#define AR934X_PLL_ETH_XMII_CONTROL_REG (AR71XX_PLL_CPU_BASE + 0x2c) #define AR934X_PLL_CPU_CONFIG_NFRAC_SHIFT 0 #define AR934X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f @@ -81,7 +103,13 @@ #define AR934X_RESET_REG_BOOTSTRAP (AR71XX_RST_BLOCK_BASE + 0xb0) #define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS (AR71XX_RST_BLOCK_BASE + 0xac) +#define AR934X_RESET_GE1_MDIO (1 << 23) +#define AR934X_RESET_GE0_MDIO (1 << 22) +#define AR934X_RESET_GE1_MAC (1 << 13) +#define AR934X_RESET_ETH_SWITCH_ANALOG (1 << 12) #define AR934X_RESET_USB_PHY_ANALOG (1 << 11) +#define AR934X_RESET_GE0_MAC (1 << 9) +#define AR934X_RESET_ETH_SWITCH (1 << 8) #define AR934X_RESET_USB_HOST (1 << 5) #define AR934X_RESET_USB_PHY (1 << 4) #define AR934X_RESET_USBSUS_OVERRIDE (1 << 3) @@ -153,4 +181,9 @@ #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13 #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7 +/* XXX verify! */ +#define AR934X_PLL_VAL_1000 0x16000000 +#define AR934X_PLL_VAL_100 0x00000101 +#define AR934X_PLL_VAL_10 0x00001616 + #endif /* __AR934X_REG_H__ */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 03: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4B55752A; Wed, 9 Oct 2013 03:56:10 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2877F2715; Wed, 9 Oct 2013 03:56:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r993uAlM085685; Wed, 9 Oct 2013 03:56:10 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r993u8bM085667; Wed, 9 Oct 2013 03:56:08 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201310090356.r993u8bM085667@svn.freebsd.org> From: Neel Natu Date: Wed, 9 Oct 2013 03:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256176 - in head: lib/libvmmapi share/examples/bhyve usr.sbin/bhyve usr.sbin/bhyvectl usr.sbin/bhyveload X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 03:56:10 -0000 Author: neel Date: Wed Oct 9 03:56:07 2013 New Revision: 256176 URL: http://svnweb.freebsd.org/changeset/base/256176 Log: Parse the memory size parameter using expand_number() to allow specifying the memory size more intuitively (e.g. 512M, 4G etc). Submitted by: rodrigc Reviewed by: grehan Approved by: re (blanket) Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/share/examples/bhyve/vmrun.sh head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyvectl/Makefile head/usr.sbin/bhyveload/Makefile head/usr.sbin/bhyveload/bhyveload.8 head/usr.sbin/bhyveload/bhyveload.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Wed Oct 9 03:19:05 2013 (r256175) +++ head/lib/libvmmapi/vmmapi.c Wed Oct 9 03:56:07 2013 (r256176) @@ -43,11 +43,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include "vmmapi.h" +#define MB (1024 * 1024UL) #define GB (1024 * 1024 * 1024UL) struct vmctx { @@ -124,6 +127,30 @@ vm_destroy(struct vmctx *vm) } int +vm_parse_memsize(const char *optarg, size_t *ret_memsize) +{ + char *endptr; + size_t optval; + int error; + + optval = strtoul(optarg, &endptr, 0); + if (*optarg != '\0' && *endptr == '\0') { + /* + * For the sake of backward compatibility if the memory size + * specified on the command line is less than a megabyte then + * it is interpreted as being in units of MB. + */ + if (optval < MB) + optval *= MB; + *ret_memsize = optval; + error = 0; + } else + error = expand_number(optarg, ret_memsize); + + return (error); +} + +int vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len, int *wired) { Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Wed Oct 9 03:19:05 2013 (r256175) +++ head/lib/libvmmapi/vmmapi.h Wed Oct 9 03:56:07 2013 (r256176) @@ -45,6 +45,7 @@ enum vm_mmap_style { int vm_create(const char *name); struct vmctx *vm_open(const char *name); void vm_destroy(struct vmctx *ctx); +int vm_parse_memsize(const char *optarg, size_t *memsize); int vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len, int *wired); int vm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s); Modified: head/share/examples/bhyve/vmrun.sh ============================================================================== --- head/share/examples/bhyve/vmrun.sh Wed Oct 9 03:19:05 2013 (r256175) +++ head/share/examples/bhyve/vmrun.sh Wed Oct 9 03:56:07 2013 (r256176) @@ -31,7 +31,7 @@ LOADER=/usr/sbin/bhyveload BHYVECTL=/usr/sbin/bhyvectl FBSDRUN=/usr/sbin/bhyve -DEFAULT_MEMSIZE=512 +DEFAULT_MEMSIZE=512M DEFAULT_CPUS=2 DEFAULT_TAPDEV=tap0 @@ -47,7 +47,7 @@ usage() { echo " -g: listen for connection from kgdb at " echo " -i: force boot of the Installation CDROM image" echo " -I: Installation CDROM image location (default is ${DEFAULT_ISOFILE})" - echo " -m: memory size in MB (default is ${DEFAULT_MEMSIZE}MB)" + echo " -m: memory size (default is ${DEFAULT_MEMSIZE})" echo " -t: tap device for virtio-net (default is $DEFAULT_TAPDEV)" echo "" echo " This script needs to be executed with superuser privileges" Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Wed Oct 9 03:19:05 2013 (r256175) +++ head/usr.sbin/bhyve/Makefile Wed Oct 9 03:56:07 2013 (r256176) @@ -17,8 +17,8 @@ SRCS+= vmm_instruction_emul.c NO_MAN= -DPADD= ${LIBVMMAPI} ${LIBMD} ${LIBPTHREAD} -LDADD= -lvmmapi -lmd -lpthread +DPADD= ${LIBVMMAPI} ${LIBMD} ${LIBUTIL} ${LIBPTHREAD} +LDADD= -lvmmapi -lmd -lutil -lpthread WARNS?= 2 Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Wed Oct 9 03:19:05 2013 (r256175) +++ head/usr.sbin/bhyve/bhyverun.c Wed Oct 9 03:56:07 2013 (r256176) @@ -37,12 +37,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include #include +#include #include #include @@ -529,7 +531,9 @@ main(int argc, char *argv[]) else break; case 'm': - memsize = strtoul(optarg, NULL, 0) * MB; + error = vm_parse_memsize(optarg, &memsize); + if (error) + errx(EX_USAGE, "invalid memsize '%s'", optarg); break; case 'H': guest_vmexit_on_hlt = 1; Modified: head/usr.sbin/bhyvectl/Makefile ============================================================================== --- head/usr.sbin/bhyvectl/Makefile Wed Oct 9 03:19:05 2013 (r256175) +++ head/usr.sbin/bhyvectl/Makefile Wed Oct 9 03:56:07 2013 (r256176) @@ -7,8 +7,8 @@ SRCS= bhyvectl.c NO_MAN= -DPADD= ${LIBVMMAPI} -LDADD= -lvmmapi +DPADD= ${LIBVMMAPI} ${LIBUTIL} +LDADD= -lvmmapi -lutil WARNS?= 3 Modified: head/usr.sbin/bhyveload/Makefile ============================================================================== --- head/usr.sbin/bhyveload/Makefile Wed Oct 9 03:19:05 2013 (r256175) +++ head/usr.sbin/bhyveload/Makefile Wed Oct 9 03:56:07 2013 (r256176) @@ -4,8 +4,8 @@ PROG= bhyveload SRCS= bhyveload.c MAN= bhyveload.8 -DPADD+= ${LIBVMMAPI} -LDADD+= -lvmmapi +DPADD+= ${LIBVMMAPI} ${LIBUTIL} +LDADD+= -lvmmapi -lutil WARNS?= 3 Modified: head/usr.sbin/bhyveload/bhyveload.8 ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.8 Wed Oct 9 03:19:05 2013 (r256175) +++ head/usr.sbin/bhyveload/bhyveload.8 Wed Oct 9 03:56:07 2013 (r256176) @@ -1,4 +1,4 @@ -.\" +\" .\" Copyright (c) 2012 NetApp Inc .\" All rights reserved. .\" @@ -60,13 +60,29 @@ and will be created if it does not alrea .Sh OPTIONS The following options are available: .Bl -tag -width indent -.It Fl m Ar mem-size +.It Fl m Ar mem-size Xo +.Sm off +.Op Cm K | k | M | m | G | g | T | t +.Xc +.Sm on +.Ar mem-size +is the amount of memory allocated to the guest. +.Pp +The .Ar mem-size -is the amount of memory allocated to the guest in units of megabytes. +argument may be suffixed with one of +.Cm K , +.Cm M , +.Cm G +or +.Cm T +(either upper or lower case) to indicate a multiple of +Kilobytes, Megabytes, Gigabytes or Terabytes +respectively. .Pp The default value of .Ar mem-size -is 256. +is 256M. .It Fl d Ar disk-path The .Ar disk-path @@ -83,7 +99,7 @@ that boots off the ISO image .Pa /freebsd/release.iso and has 1GB memory allocated to it: .Pp -.Dl "bhyveload -m 1024 -d /freebsd/release.iso freebsd-vm" +.Dl "bhyveload -m 1G -d /freebsd/release.iso freebsd-vm" .Sh SEE ALSO .Xr bhyve 4 , .Xr bhyve 8 , Modified: head/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.c Wed Oct 9 03:19:05 2013 (r256175) +++ head/usr.sbin/bhyveload/bhyveload.c Wed Oct 9 03:56:07 2013 (r256176) @@ -67,12 +67,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include #include +#include #include #include @@ -581,9 +583,10 @@ main(int argc, char** argv) break; case 'm': - mem_size = strtoul(optarg, NULL, 0) * MB; + error = vm_parse_memsize(optarg, &mem_size); + if (error != 0) + errx(EX_USAGE, "Invalid memsize '%s'", optarg); break; - case '?': usage(); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 05:27:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 727A1E1; Wed, 9 Oct 2013 05:27:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E7652B07; Wed, 9 Oct 2013 05:27:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r995RMbM032468; Wed, 9 Oct 2013 05:27:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r995RMJ5032467; Wed, 9 Oct 2013 05:27:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310090527.r995RMJ5032467@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 9 Oct 2013 05:27: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: r256177 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 05:27:22 -0000 Author: kib Date: Wed Oct 9 05:27:21 2013 New Revision: 256177 URL: http://svnweb.freebsd.org/changeset/base/256177 Log: MFC r256089: Document LK_TRYUPGRADE. Modified: stable/9/share/man/man9/lock.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/lock.9 ============================================================================== --- stable/9/share/man/man9/lock.9 Wed Oct 9 03:56:07 2013 (r256176) +++ stable/9/share/man/man9/lock.9 Wed Oct 9 05:27:21 2013 (r256177) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2009 +.Dd October 6, 2013 .Dt LOCK 9 .Os .Sh NAME @@ -164,11 +164,17 @@ If an exclusive lock has been recursed, .Xr panic 9 . .It Dv LK_UPGRADE Upgrade a shared lock to an exclusive lock. -If this call fails, the shared lock is lost. +If this call fails, the shared lock is lost, even if the +.Dv LK_NOWAIT +flag is specified. During the upgrade, the shared lock could be temporarily dropped. Attempts to upgrade an exclusive lock will cause a .Xr panic 9 . +.It Dv LK_TRYUPGRADE +Try to upgrade a shared lock to an exclusive lock. +The failure to upgrade does not result in the dropping +of the shared lock ownership. .It Dv LK_RELEASE Release the lock. Releasing a lock that is not held can cause a @@ -334,7 +340,9 @@ fail if: was requested and another thread had already requested a lock upgrade. .It Bq Er EBUSY .Dv LK_NOWAIT -was set, and a sleep would have been required. +was set, and a sleep would have been required, or +.Dv LK_TRYUPGRADE +operation was not able to upgrade the lock. .It Bq Er ENOLCK .Dv LK_SLEEPFAIL was set and From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 06:19:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6F173BA4; Wed, 9 Oct 2013 06:19:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5CC092D73; Wed, 9 Oct 2013 06:19:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r996J2UH059770; Wed, 9 Oct 2013 06:19:02 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r996J2hY059769; Wed, 9 Oct 2013 06:19:02 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310090619.r996J2hY059769@svn.freebsd.org> From: Dimitry Andric Date: Wed, 9 Oct 2013 06:19: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: r256178 - 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: Wed, 09 Oct 2013 06:19:02 -0000 Author: dim Date: Wed Oct 9 06:19:01 2013 New Revision: 256178 URL: http://svnweb.freebsd.org/changeset/base/256178 Log: MFC r256090: Pull in r192064 from upstream llvm trunk: X86: Don't fold spills into SSE operations if the stack is unaligned. Regalloc can emit unaligned spills nowadays, but we can't fold the spills into SSE ops if we can't guarantee alignment. PR12250. This fixes unaligned SSE accesses (leading to a SIGBUS) which could occur in the ffmpeg ports. Reported by: tijl Modified: stable/9/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp Wed Oct 9 05:27:21 2013 (r256177) +++ stable/9/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp Wed Oct 9 06:19:01 2013 (r256178) @@ -3881,6 +3881,10 @@ MachineInstr* X86InstrInfo::foldMemoryOp const MachineFrameInfo *MFI = MF.getFrameInfo(); unsigned Size = MFI->getObjectSize(FrameIndex); unsigned Alignment = MFI->getObjectAlignment(FrameIndex); + // If the function stack isn't realigned we don't want to fold instructions + // that need increased alignment. + if (!RI.needsStackRealignment(MF)) + Alignment = std::min(Alignment, TM.getFrameLowering()->getStackAlignment()); if (Ops.size() == 2 && Ops[0] == 0 && Ops[1] == 1) { unsigned NewOpc = 0; unsigned RCSize = 0; From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 07:02:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B9DE79A8; Wed, 9 Oct 2013 07:02:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A80B82F99; Wed, 9 Oct 2013 07:02:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99723Tl083672; Wed, 9 Oct 2013 07:02:03 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99723XR083671; Wed, 9 Oct 2013 07:02:03 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310090702.r99723XR083671@svn.freebsd.org> From: Dimitry Andric Date: Wed, 9 Oct 2013 07:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256179 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 07:02:03 -0000 Author: dim Date: Wed Oct 9 07:02:03 2013 New Revision: 256179 URL: http://svnweb.freebsd.org/changeset/base/256179 Log: Remove redundant declaration of cmclass in sys/ofed/drivers/infiniband/core/ucm.c, to silence a gcc warning. Approved by: re (kib) X-MFC-With: r255932 Modified: head/sys/ofed/drivers/infiniband/core/ucm.c Modified: head/sys/ofed/drivers/infiniband/core/ucm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ucm.c Wed Oct 9 06:19:01 2013 (r256178) +++ head/sys/ofed/drivers/infiniband/core/ucm.c Wed Oct 9 07:02:03 2013 (r256179) @@ -104,9 +104,6 @@ enum { IB_UCM_MAX_DEVICES = 32 }; -/* ib_cm and ib_user_cm modules share /sys/class/infiniband_cm */ -extern struct class cm_class; - #define IB_UCM_BASE_DEV MKDEV(IB_UCM_MAJOR, IB_UCM_BASE_MINOR) static void ib_ucm_add_one(struct ib_device *device); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 08:12:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2F280C9C; Wed, 9 Oct 2013 08:12:34 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A2ED23BF; Wed, 9 Oct 2013 08:12:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r998CYBl019904; Wed, 9 Oct 2013 08:12:34 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r998CQgI019836; Wed, 9 Oct 2013 08:12:26 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310090812.r998CQgI019836@svn.freebsd.org> From: Devin Teske Date: Wed, 9 Oct 2013 08:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256181 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share password/share security share share/media share/packages startup startup/share timezone usermgmt usermg... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 08:12:34 -0000 Author: dteske Date: Wed Oct 9 08:12:26 2013 New Revision: 256181 URL: http://svnweb.freebsd.org/changeset/base/256181 Log: Introduce centralized [X]dialog(1) exit codes to `dialog.subr' and make-use throughout the bsdconfig(8) code. While we're here, add an explicit argument to lvalue-seeking invocations of "return" that previously had no argument. Also, consolidate a single instance of double-newline and remove some comments that are no longer required (given increased readability with new exit codes). Approved by: re (glebius) Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/mouse/enable head/usr.sbin/bsdconfig/networking/devices 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/media.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/password/share/password.subr head/usr.sbin/bsdconfig/security/kern_securelevel head/usr.sbin/bsdconfig/security/security head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/device.subr head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/media/any.subr head/usr.sbin/bsdconfig/share/media/cdrom.subr head/usr.sbin/bsdconfig/share/media/common.subr head/usr.sbin/bsdconfig/share/media/dos.subr head/usr.sbin/bsdconfig/share/media/floppy.subr head/usr.sbin/bsdconfig/share/media/ftp.subr head/usr.sbin/bsdconfig/share/media/http.subr head/usr.sbin/bsdconfig/share/media/nfs.subr head/usr.sbin/bsdconfig/share/media/options.subr head/usr.sbin/bsdconfig/share/media/tcpip.subr head/usr.sbin/bsdconfig/share/media/ufs.subr head/usr.sbin/bsdconfig/share/media/usb.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/share/packages/packages.subr head/usr.sbin/bsdconfig/startup/misc head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/startup/share/rcedit.subr head/usr.sbin/bsdconfig/timezone/timezone head/usr.sbin/bsdconfig/usermgmt/groupdel head/usr.sbin/bsdconfig/usermgmt/groupedit head/usr.sbin/bsdconfig/usermgmt/groupinput head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr head/usr.sbin/bsdconfig/usermgmt/userdel head/usr.sbin/bsdconfig/usermgmt/useredit head/usr.sbin/bsdconfig/usermgmt/userinput head/usr.sbin/bsdconfig/usermgmt/usermgmt Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/bsdconfig Wed Oct 9 08:12:26 2013 (r256181) @@ -300,7 +300,7 @@ dialog_menu_main() f_dialog_menutag_store "$menu_choice" # Only update default-item on success - [ $retval -eq 0 ] && f_dialog_default_store "$menu_choice" + [ $retval -eq $DIALOG_OK ] && f_dialog_default_store "$menu_choice" return $retval } @@ -396,11 +396,10 @@ while :; do f_dialog_menutag_fetch mtag f_dprintf "retval=%u mtag=[%s]" $retval "$mtag" - if [ $retval -eq 2 ]; then - # The Help button was pressed + if [ $retval -eq $DIALOG_HELP ]; then f_show_help "$BSDCONFIG_HELPFILE" continue - elif [ $retval -ne 0 ]; then + elif [ $retval -ne $DIALOG_OK ]; then f_die fi Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/console/ttys Wed Oct 9 08:12:26 2013 (r256181) @@ -92,7 +92,7 @@ dialog_menu_main() local retval=$? f_dialog_menutag_store -s "$menu_choice" - if [ $retval -eq $SUCCESS ]; then + if [ $retval -eq $DIALOG_OK ]; then local item item=$( eval f_dialog_menutag2item \ \"\$menu_choice\" $menu_list ) Modified: head/usr.sbin/bsdconfig/mouse/enable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/enable Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/mouse/enable Wed Oct 9 08:12:26 2013 (r256181) @@ -102,7 +102,7 @@ f_dialog_title_restore # Stop the mouse daemon # f_quietly vidcontrol -m off -if [ $retval -eq $SUCCESS ]; then +if [ $retval -eq $DIALOG_OK ]; then f_sysrc_set moused_enable "YES" || f_die ln -fs /dev/sysmouse /dev/mouse || f_die # backwards compat else Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/networking/devices Wed Oct 9 08:12:26 2013 (r256181) @@ -148,7 +148,7 @@ while :; do "$interface" "$_ipaddr" "$_netmask" "$_options" $dhcp # Return to root menu if above returns success - [ $? -eq $SUCCESS ] && break + [ $? -eq $DIALOG_OK ] && break done exit $SUCCESS Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -125,7 +125,7 @@ f_dialog_menu_netdev() ) if [ ! "$interfaces" ]; then f_show_msg "$msg_no_network_interfaces" - return $FAILURE + return $DIALOG_CANCEL fi # @@ -242,12 +242,10 @@ f_dialog_menu_netdev_edit() local retval=$? f_dialog_data_sanitize tag - if [ $retval -eq 2 ]; then - # The Help button was pressed + if [ $retval -eq $DIALOG_HELP ]; then f_show_help "$TCP_HELPFILE" continue - elif [ $retval -ne $SUCCESS ]; then - # "Cancel" was chosen (-1) or ESC was pressed (255) + elif [ $retval -ne $DIALOG_OK ]; then return $retval else # Only update default-item on success @@ -298,7 +296,7 @@ f_dialog_menu_netdev_edit() ) retval=$? trap 'interrupt' SIGINT - if [ $retval -eq $SUCCESS ]; then + if [ $retval -eq $DIALOG_OK ]; then dhcp=1 ipaddr=$( f_ifconfig_inet $interface ) netmask=$( f_ifconfig_netmask $interface ) @@ -312,11 +310,11 @@ f_dialog_menu_netdev_edit() fi ;; 3\ *) f_dialog_input_ipaddr "$interface" "$ipaddr" - [ $? -eq $SUCCESS ] && dhcp= ;; + [ $? -eq $DIALOG_OK ] && dhcp= ;; 4\ *) f_dialog_input_netmask "$interface" "$netmask" - [ $? -eq $SUCCESS -a "$_netmask" ] && dhcp= ;; + [ $? -eq $DIALOG_OK -a "$_netmask" ] && dhcp= ;; 5\ *) f_dialog_menu_media_options "$interface" "$options" - [ $? -eq $SUCCESS ] && dhcp= ;; + [ $? -eq $DIALOG_OK ] && dhcp= ;; esac done @@ -383,7 +381,7 @@ f_dialog_menu_netdev_edit() fi fi - return $SUCCESS + return $DIALOG_OK } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/networking/share/hostname.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/hostname.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/networking/share/hostname.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -110,7 +110,7 @@ f_dialog_input_hostname() # while :; do f_dialog_input hostname "$msg" "$hostname" \ - "$hline_alnum_punc_tab_enter" || return + "$hline_alnum_punc_tab_enter" || return $? # Taint-check the user's input f_dialog_validate_hostname "$hostname" && break done @@ -150,7 +150,7 @@ f_dialog_input_hostname() fi fi - return $SUCCESS + return $DIALOG_OK } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -147,7 +147,7 @@ f_dialog_input_ipaddr() local setting="$( printf "$msg_current_ipaddr" \ "$interface" "$_ipaddr" )" f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" || - return $FAILURE + return $DIALOG_CANCEL fi local msg="$( printf "$msg_please_enter_new_ip_addr" "$interface" )" @@ -163,11 +163,11 @@ f_dialog_input_ipaddr() # - User has not made any changes to the given value # f_dialog_input _input "$msg" "$_ipaddr" \ - "$hline_num_punc_tab_enter" || return - [ "$_ipaddr" = "$_input" ] && return $FAILURE + "$hline_num_punc_tab_enter" || return $? + [ "$_ipaddr" = "$_input" ] && return $DIALOG_CANCEL # Return success if NULL value was entered - [ "$_input" ] || return $SUCCESS + [ "$_input" ] || return $DIALOG_OK # Take only the first "word" of the user's input _ipaddr="$_input" @@ -208,7 +208,7 @@ f_dialog_input_ipaddr() ipaddr="$_ipaddr" [ "$_netmask" ] && netmask="$_netmask" - return $SUCCESS + return $DIALOG_OK } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -118,7 +118,7 @@ f_dialog_input_options() local setting="$( printf "$msg_current_options" \ "$interface" "$options" )" f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" || - return $FAILURE + return $DIALOG_CANCEL fi local msg="$( printf "$msg_please_enter_mediaopts" "$interface" )" @@ -138,7 +138,7 @@ f_dialog_input_options() local retval=$? f_dialog_line_sanitize _options - [ $retval -eq $SUCCESS ] && options="$_options" + [ $retval -eq $DIALOG_OK ] && options="$_options" return $retval } @@ -165,7 +165,7 @@ f_dialog_menu_media_options() local setting="$( printf "$msg_current_options" \ "$interface" "$_options" )" f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" || - return $FAILURE + return $DIALOG_CANCEL fi # @@ -219,7 +219,7 @@ f_dialog_menu_media_options() local retval=$? f_dialog_data_sanitize tag - if [ $retval -eq $SUCCESS ]; then + if [ $retval -eq $DIALOG_OK ]; then options=$( eval f_dialog_menutag2item \"\$tag\" \ $supported_media ) case "$options" in Modified: head/usr.sbin/bsdconfig/networking/share/netmask.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/netmask.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/networking/share/netmask.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -97,7 +97,7 @@ f_dialog_input_netmask() local setting="$( printf "$msg_current_subnet" \ "$interface" "$_netmask" )" f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" || - return $FAILURE + return $DIALOG_CANCEL fi # @@ -111,11 +111,11 @@ f_dialog_input_netmask() # - User has not made any changes to the given value # f_dialog_input _input "$msg" "$_netmask" \ - "$hline_num_punc_tab_enter" || return - [ "$_netmask" = "$_input" ] && return $FAILURE + "$hline_num_punc_tab_enter" || return $? + [ "$_netmask" = "$_input" ] && return $DIALOG_CANCEL # Return success if NULL value was entered - [ "$_input" ] || return $SUCCESS + [ "$_input" ] || return $DIALOG_OK # Take only the first "word" of the user's input _netmask="$_input" Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -195,7 +195,7 @@ f_dialog_resolv_conf_update() # update with our new `domain' and `search' directives. # local tmpfile="$( mktemp -t "$pgm" )" - [ "$tmpfile" ] || return $FAILURE + [ "$tmpfile" ] || return $DIALOG_CANCEL # # Fixup permissions and ownership (mktemp(1) creates the @@ -235,7 +235,8 @@ f_dialog_resolv_conf_update() # Write the temporary file contents and move the temporary # file into place. # - echo "$new_contents" | tail -r > "$tmpfile" || return $FAILURE + echo "$new_contents" | tail -r > "$tmpfile" || + return $DIALOG_CANCEL f_quietly mv "$tmpfile" "$RESOLV_CONF" fi @@ -293,8 +294,8 @@ f_dialog_input_nameserver() # # Perform sanity checks # - f_isinteger "$index" || return $FAILURE - [ $index -ge 0 ] || return $FAILURE + f_isinteger "$index" || return $DIALOG_CANCEL + [ $index -ge 0 ] || return $DIALOG_CANCEL local msg if [ $index -gt 0 ]; then @@ -312,7 +313,7 @@ f_dialog_input_nameserver() # while :; do f_dialog_input new_ns "$msg" "$ns" \ - "$hline_num_punc_tab_enter" || return + "$hline_num_punc_tab_enter" || return $? # Take only the first "word" of the user's input new_ns="${new_ns%%[$IFS]*}" @@ -331,7 +332,7 @@ f_dialog_input_nameserver() if [ $index -eq "0" -a "$new_ns" ]; then f_dialog_info "$msg_saving_nameserver" printf "nameserver\t%s\n" "$new_ns" >> "$RESOLV_CONF" - return $SUCCESS + return $DIALOG_OK elif [ $index -gt 0 -a "$old_ns" != "$new_ns" ]; then if [ "$new_ns" ]; then msg="$msg_saving_nameserver_existing" @@ -344,7 +345,7 @@ f_dialog_input_nameserver() # Create a new temporary file to write our new resolv.conf(5) # local tmpfile="$( mktemp -t "$pgm" )" - [ "$tmpfile" ] || return $FAILURE + [ "$tmpfile" ] || return $DIALOG_CANCEL # # Quietly fixup permissions and ownership @@ -381,7 +382,7 @@ f_dialog_input_nameserver() # Write the temporary file contents and move the temporary # file into place. # - echo "$new_contents" > "$tmpfile" || return $FAILURE + echo "$new_contents" > "$tmpfile" || return $DIALOG_CANCEL f_quietly mv "$tmpfile" "$RESOLV_CONF" fi } @@ -452,7 +453,7 @@ f_dialog_menu_nameservers() f_dialog_data_sanitize tag # Return if "Cancel" was chosen (-1) or ESC was pressed (255) - if [ $retval -ne $SUCCESS ]; then + if [ $retval -ne $DIALOG_OK ]; then return $retval else # Only update default-item on success Modified: head/usr.sbin/bsdconfig/networking/share/routing.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/routing.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -75,7 +75,7 @@ f_dialog_input_defaultrouter() local setting="$( printf "$msg_current_default_router" \ "$defaultrouter" )" f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" || - return $FAILURE + return $DIALOG_CANCEL fi # @@ -87,8 +87,8 @@ f_dialog_input_defaultrouter() "$msg_please_enter_default_router" \ "$defaultrouter" "$hline_num_punc_tab_enter" retval=$? - [ "$defaultrouter" ] || return $SUCCESS - [ $retval -eq $SUCCESS ] || return $retval + [ "$defaultrouter" ] || return $DIALOG_OK + [ $retval -eq $DIALOG_OK ] || return $retval # Taint-check the user's input f_dialog_validate_ipaddr "$defaultrouter" && break @@ -112,7 +112,7 @@ f_dialog_input_defaultrouter() f_dialog_clear f_yesno "$msg_activate_default_router" \ "$( f_route_get_default )" "$defaultrouter" - if [ $? -eq $SUCCESS ]; then + if [ $? -eq $DIALOG_OK ]; then local err # Apply the default router/gateway @@ -120,7 +120,7 @@ f_dialog_input_defaultrouter() err=$( route add default "$defaultrouter" 2>&1 ) if [ $? -ne $SUCCESS ]; then f_dialog_msgbox "$err" - return $FAILURE + return $DIALOG_CANCEL fi fi fi Modified: head/usr.sbin/bsdconfig/password/share/password.subr ============================================================================== --- head/usr.sbin/bsdconfig/password/share/password.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/password/share/password.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -114,7 +114,7 @@ f_dialog_input_password() break done - return $SUCCESS + return $DIALOG_OK } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Wed Oct 9 08:12:26 2013 (r256181) @@ -131,11 +131,10 @@ while :; do retval=$? f_dialog_menutag_fetch mtag - if [ $retval -eq 2 ]; then - # The Help button was pressed + if [ $retval -eq $DIALOG_HELP ]; then f_show_help "$SECURELEVEL_HELPFILE" continue - elif [ $retval -ne 0 ]; then + elif [ $retval -ne $DIALOG_OK ]; then f_die fi Modified: head/usr.sbin/bsdconfig/security/security ============================================================================== --- head/usr.sbin/bsdconfig/security/security Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/security/security Wed Oct 9 08:12:26 2013 (r256181) @@ -123,7 +123,7 @@ dialog_menu_main() f_dialog_menutag_store "$menu_choice" # Only update default-item on success - [ $retval -eq 0 ] && f_dialog_default_store "$menu_choice" + [ $retval -eq $DIALOG_OK ] && f_dialog_default_store "$menu_choice" return $retval } Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/common.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -560,18 +560,19 @@ f_index_file() if [ "$lang" ]; then awk -v keyword="$keyword" "$f_index_file_awk" \ - $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX.$lang && return + $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX.$lang && + return $SUCCESS # No match, fall-thru to non-i18n sources fi awk -v keyword="$keyword" "$f_index_file_awk" \ - $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX && return + $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX && return $SUCCESS # No match? Fall-thru to `local' libexec sources (add-on modules) [ "$BSDCFG_LOCAL_LIBE" ] || return $FAILURE if [ "$lang" ]; then awk -v keyword="$keyword" "$f_index_file_awk" \ - $BSDCFG_LOCAL_LIBE/*/INDEX.$lang && return + $BSDCFG_LOCAL_LIBE/*/INDEX.$lang && return $SUCCESS # No match, fall-thru to non-i18n sources fi awk -v keyword="$keyword" "$f_index_file_awk" \ Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/device.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -552,7 +552,7 @@ f_device_find() f_device_init() { local name="$1" init_func - device_$name get init init_func || return + device_$name get init init_func || return $? ${init_func:-:} $name } @@ -564,7 +564,7 @@ f_device_init() f_device_get() { local name="$1" file="$2" probe="$3" get_func - device_$name get get get_func || return + device_$name get get get_func || return $? ${get_func:-:} $name "$file" ${3+"$probe"} } @@ -575,7 +575,7 @@ f_device_get() f_device_shutdown() { local name="$1" shutdown_func - device_$name get shutdown shutdown_func || return + device_$name get shutdown shutdown_func || return $? ${shutdown_func:-:} $name } @@ -597,7 +597,7 @@ f_device_menu() [ "$devtype" = "$type" ] || continue devs="$devs $dev" done - [ "$devs" ] || return $FAILURE + [ "$devs" ] || return $DIALOG_CANCEL local desc menu_list= for dev in $devs; do @@ -637,7 +637,7 @@ f_device_menu() ) local retval=$? - [ $retval -ne 2 ] && break + [ $retval -ne $DIALOG_HELP ] && break # Otherwise, the Help button was pressed f_show_help "$helpfile" # ...then loop back to menu @@ -646,7 +646,7 @@ f_device_menu() [ "$errexit" ] && set -e - if [ $retval -eq 0 ]; then + if [ $retval -eq $DIALOG_OK ]; then # Clean up the output of [X]dialog(1) and return it f_dialog_data_sanitize mtag echo "$mtag" >&2 Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/dialog.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -74,6 +74,18 @@ unset XDIALOG_FORCE_AUTOSIZE unset XDIALOG_INFOBOX_TIMEOUT # +# Exit codes for [X]dialog(1) +# +DIALOG_OK=${SUCCESS:-0} +DIALOG_CANCEL=${FAILURE:-1} +DIALOG_HELP=2 +DIALOG_ITEM_HELP=2 +DIALOG_EXTRA=3 +DIALOG_ITEM_HELP=4 +export DIALOG_ERROR=254 # sh(1) can't handle the default of `-1' +DIALOG_ESC=255 + +# # Default behavior is to call f_dialog_init() automatically when loaded. # : ${DIALOG_SELF_INITIALIZE=1} Modified: head/usr.sbin/bsdconfig/share/media/any.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/any.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/media/any.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -113,11 +113,10 @@ f_media_get_type() f_dialog_data_sanitize mtag f_dprintf "retval=%s mtag=[%s]" $retval "$mtag" - if [ $retval -eq 2 ]; then - # The Help button was pressed + if [ $retval -eq $DIALOG_HELP ]; then f_show_help "$MEDIA_HELPFILE" continue - elif [ $retval -ne 0 ]; then + elif [ $retval -ne $DIALOG_OK ]; then return $FAILURE fi Modified: head/usr.sbin/bsdconfig/share/media/cdrom.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/cdrom.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/media/cdrom.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -170,7 +170,7 @@ f_media_shutdown_cdrom() { local dev="$1" err - [ "$CDROM_MOUNTED" ] || return + [ "$CDROM_MOUNTED" ] || return $FAILURE if [ "$CDROM_PREVIOUSLY_MOUNTED" ]; then CDROM_MOUNTED= Modified: head/usr.sbin/bsdconfig/share/media/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/common.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/media/common.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -127,7 +127,7 @@ f_media_generic_get() fi [ "$probe_type" ] && return $SUCCESS cat "$path" - return + return $? fi done Modified: head/usr.sbin/bsdconfig/share/media/dos.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/dos.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/media/dos.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -148,7 +148,7 @@ f_media_shutdown_dos() { local dev="$1" err - [ "$DOS_MOUNTED" ] || return + [ "$DOS_MOUNTED" ] || return $FAILURE if ! err=$( umount -f "$MOUNTPOINT" 2>&1 ); then err="${err#umount: }"; err="${err#*: }" Modified: head/usr.sbin/bsdconfig/share/media/floppy.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/floppy.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/media/floppy.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -205,7 +205,7 @@ f_media_shutdown_floppy() { local dev="$1" err mp - [ "$FLOPPY_MOUNTED" ] || return + [ "$FLOPPY_MOUNTED" ] || return $FAILURE device_$dev get private mp if ! err=$( umount -f "${mp:=$MOUNTPOINT}" 2>&1 ); then Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ftp.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/media/ftp.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -213,7 +213,7 @@ f_dialog_menu_media_ftp() $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD - ) || return $FAILURE + ) || return $DIALOG_CANCEL f_dialog_data_sanitize mtag case "$mtag" in @@ -224,7 +224,7 @@ f_dialog_menu_media_ftp() setvar $VAR_FTP_PATH "ftp://$value" esac - return $SUCCESS + return $DIALOG_OK } # f_media_set_ftp @@ -740,7 +740,7 @@ f_media_init_ftp() else f_yesno "$msg_cant_find_distribution" \ "$rel" "$ftp_host" - if [ $? -eq $SUCCESS ]; then + if [ $? -eq $DIALOG_OK ]; then unset $VAR_FTP_PATH f_media_set_ftp && continue fi Modified: head/usr.sbin/bsdconfig/share/media/http.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/http.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/media/http.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -101,7 +101,7 @@ f_dialog_menu_media_http() $height $width $rows \ $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD - ) || return $FAILURE + ) || return $DIALOG_CANCEL f_dialog_data_sanitize mtag case "$mtag" in @@ -112,7 +112,7 @@ f_dialog_menu_media_http() setvar $VAR_HTTP_PATH "http://$value" esac - return $SUCCESS + return $DIALOG_OK } # f_media_set_http Modified: head/usr.sbin/bsdconfig/share/media/nfs.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/nfs.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/media/nfs.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -233,7 +233,7 @@ f_media_shutdown_nfs() { local dev="$1" err - [ "$NFS_MOUNTED" ] || return + [ "$NFS_MOUNTED" ] || return $FAILURE f_dprintf "Unmounting NFS partition on %s" "$MOUNTPOINT" if ! err=$( umount -f "$MOUNTPOINT" 2>&1 ); then Modified: head/usr.sbin/bsdconfig/share/media/options.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/options.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/media/options.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -224,11 +224,10 @@ f_media_options_menu() defaultitem="$mtag" f_dprintf "retval=%s mtag=[%s]" $retval "$mtag" - if [ $retval -eq 2 ]; then - # The Help button was pressed + if [ $retval -eq $DIALOG_HELP ]; then f_show_help "$OPTIONS_HELPFILE" continue - elif [ $retval -ne 0 ]; then + elif [ $retval -ne $DIALOG_OK ]; then break # to success fi Modified: head/usr.sbin/bsdconfig/share/media/tcpip.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/tcpip.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/media/tcpip.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -471,10 +471,10 @@ f_dialog_validate_tcpip() ! f_validate_gateway "$gateway" "$ipaddr" "$netmask"; then f_show_msg "$msg_invalid_gateway_ipv4_address_specified" else - return $SUCCESS + return $DIALOG_OK fi - return $FAILURE + return $DIALOG_CANCEL } # f_ifconfig_inet $interface [$var_to_set] @@ -1102,7 +1102,7 @@ f_device_dialog_tcp() local use_dhcp="" use_rtsol="" local _ipaddr _netmask _extras - [ "$dev" ] || return $FAILURE + [ "$dev" ] || return $DIALOG_CANCEL # Initialize vars from previous device values local private @@ -1125,7 +1125,6 @@ f_device_dialog_tcp() unset $VAR_NONINTERACTIVE fi - # # Try a RTSOL scan if such behavior is desired. # If the variable was configured and is YES, do it. @@ -1321,7 +1320,7 @@ f_device_dialog_tcp() if [ ! "$cp" ]; then # User either chose "Cancel", pressed # ESC, or blanked every form field - return $FAILURE + return $DIALOG_CANCEL else n=$( echo "$cp" | f_number_of_lines ) [ $n -eq 1 ] && case "$cp" in HELP*) @@ -1404,14 +1403,12 @@ f_device_dialog_tcp() f_dialog_data_sanitize cp f_dprintf "retval=%u mtag=[%s]" $retval "$cp" - if [ $retval -eq 2 ]; then - # The Help button was pressed + if [ $retval -eq $DIALOG_HELP ]; then f_show_help "$TCP_HELPFILE" continue - elif [ $retval -ne 0 ]; then - # User chose "Cancel" or pressed ESC + elif [ $retval -ne $DIALOG_OK ]; then f_dialog_title_restore - return $FAILURE + return $DIALOG_CANCEL fi case "$cp" in @@ -1490,7 +1487,7 @@ f_device_dialog_tcp() [ "$use_dhcp" ] || f_config_resolv # XXX this will do it on the MFS copy - return $SUCCESS + return $DIALOG_OK } # f_device_scan_tcp [$var_to_set] @@ -1586,15 +1583,15 @@ f_device_select_tcp() if [ ${cnt:=0} -gt 0 ]; then dev="${devs%%[$IFS]*}" f_device_dialog_tcp $dev - if [ $? -eq $SUCCESS ]; then + if [ $? -eq $DIALOG_OK ]; then setvar $VAR_NETWORK_DEVICE $dev - return $SUCCESS + return $DIALOG_OK fi fi done f_interactive && f_show_msg "$msg_no_network_devices" - return $FAILURE + return $DIALOG_CANCEL fi # $network_dev @@ -1610,18 +1607,18 @@ f_device_select_tcp() if f_dialog_yesno "$msg_assume_network_is_already_configured" then setvar $VAR_NETWORK_DEVICE $dev - return $SUCCESS + return $DIALOG_OK fi fi local retval=$SUCCESS if [ ${cnt:=0} -eq 0 ]; then f_show_msg "$msg_no_network_devices" - retval=$FAILURE + retval=$DIALOG_CANCEL elif [ $cnt -eq 1 ]; then f_device_dialog_tcp $dev retval=$? - [ $retval -eq $SUCCESS ] && setvar $VAR_NETWORK_DEVICE $dev + [ $retval -eq $DIALOG_OK ] && setvar $VAR_NETWORK_DEVICE $dev else local title="$msg_network_interface_information_required" local prompt="$msg_please_select_ethernet_device_to_configure" @@ -1632,15 +1629,15 @@ f_device_select_tcp() "$NETWORK_DEVICE_HELPFILE" \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) retval=$? - [ "$dev" ] || return $FAILURE + [ "$dev" ] || return $DIALOG_CANCEL f_device_find "$dev" $DEVICE_TYPE_NETWORK devs - [ "$devs" ] || return $FAILURE + [ "$devs" ] || return $DIALOG_CANCEL dev="${devs%%[$IFS]*}" f_device_dialog_tcp $dev retval=$? - if [ $retval -eq $SUCCESS ]; then + if [ $retval -eq $DIALOG_OK ]; then f_struct_copy device_$dev device_network setvar $VAR_NETWORK_DEVICE network else @@ -1675,7 +1672,7 @@ f_dialog_menu_select_tcp() "$name" fi fi - return $SUCCESS + return $DIALOG_OK } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/share/media/ufs.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ufs.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/media/ufs.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -177,7 +177,7 @@ f_media_shutdown_ufs() { local dev="$1" err - [ "$UFS_MOUNTED" ] || return + [ "$UFS_MOUNTED" ] || return $FAILURE if ! err=$( umount -f "$MOUNTPOINT" 2>&1 ); then err="${err#umount: }"; err="${err#*: }" Modified: head/usr.sbin/bsdconfig/share/media/usb.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/usb.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/media/usb.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -158,7 +158,7 @@ f_media_shutdown_usb() { local dev="$1" err - [ "$USB_MOUNTED" ] || return + [ "$USB_MOUNTED" ] || return $FAILURE if ! err=$( umount -f "$MOUNTPOINT" 2>&1 ); then err="${err#umount: }"; err="${err#*: }" Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -176,9 +176,9 @@ f_become_root_via_sudo() retval=$? # Catch X11-related errors - if [ $retval -eq 255 ]; then + if [ $retval -eq $DIALOG_ESC ]; then f_die $retval "$password" - elif [ $retval -ne 0 ]; then + elif [ $retval -ne $DIALOG_OK ]; then # User cancelled exit $retval fi @@ -316,10 +316,10 @@ f_authenticate_some_user() retval=$? # Catch X11-related errors - [ $retval -eq 255 ] && f_die $retval "$user_pass" + [ $retval -eq $DIALOG_ESC ] && f_die $retval "$user_pass" # Exit if the user cancelled. - [ $retval -eq $SUCCESS ] || exit $retval + [ $retval -eq $DIALOG_OK ] || exit $retval # # Make sure the user exists and is non-root Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -132,7 +132,7 @@ f_package_select() package="$1" shift 1 # package for pkgsel in $SELECTED_PACKAGES; do - [ "$package" = "$pkgsel" ] && return + [ "$package" = "$pkgsel" ] && return $SUCCESS done SELECTED_PACKAGES="$SELECTED_PACKAGES $package" f_dprintf "Added %s to selection list" "$package" @@ -312,7 +312,7 @@ f_package_menu_categories() # creates _{varcat}_ninstalled and _{varcat}_nselected local category_list - debug= f_getvar "$var_to_get" category_list || return $FAILURE + debug= f_getvar "$var_to_get" category_list || return $DIALOG_CANCEL # Accent the category menu list with ninstalled/nselected eval f_package_accent_category_menu category_list $category_list @@ -395,7 +395,7 @@ f_package_menu_select() local defaultitem="$3" local hline="$hline_arrows_tab_punc_enter" - f_isinteger "$page" || return $FAILURE + f_isinteger "$page" || return $DIALOG_CANCEL local varcat f_str2varname "$category" varcat @@ -518,7 +518,7 @@ f_package_menu_select() f_dialog_data_sanitize menu_choice f_dialog_menutag_store "$menu_choice" - if [ $retval -eq $SUCCESS ]; then + if [ $retval -eq $DIALOG_OK ]; then local item item=$( eval f_dialog_menutag2item${SHOW_DESC:+_with_help} \ \"\$menu_choice\" $menu_list ) @@ -603,7 +603,7 @@ f_package_review() done if [ ! "$menu_list" ]; then f_show_msg "$msg_no_packages_were_selected_for_extraction" - return $FAILURE # They might have selected this by accident + return $DIALOG_CANCEL # Might have selected this by accident fi menu_list=$( echo "$menu_list" | sort ) @@ -660,7 +660,7 @@ f_package_review() f_package_deselect "$package" done - return $SUCCESS + return $DIALOG_OK } # f_package_config @@ -693,7 +693,7 @@ f_package_config() f_dprintf "retval=%u mtag=[%s]" $retval "$category" category_defaultitem="$category" - [ $retval -eq $SUCCESS ] || break + [ $retval -eq $DIALOG_OK ] || break # Maybe the user chose an action (like `Review') case "$category" in @@ -729,14 +729,14 @@ f_package_config() # the Cancel button because stdout will be NULL. # Alternatively, Xdialog(1) will terminate with 1 # if/when Cancel is chosen on any widget. - if [ $retval -eq 255 -o ! "$menu_choice" ]; then - # User pressed ESC or chose Cancel + if [ $retval -eq $DIALOG_ESC -o ! "$menu_choice" ] + then break - elif [ $retval -eq 1 ]; then + elif [ $retval -eq $DIALOG_CANCEL ]; then # Using X11, Xdialog(1) returned 1 for Cancel f_show_msg "%s" "$menu_choice" break - elif [ $retval -ne $SUCCESS ]; then + elif [ $retval -ne $DIALOG_OK ]; then # X11-related error occurred using Xdialog(1) f_show_msg "%s" "$menu_choice" break Modified: head/usr.sbin/bsdconfig/startup/misc ============================================================================== --- head/usr.sbin/bsdconfig/startup/misc Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/startup/misc Wed Oct 9 08:12:26 2013 (r256181) @@ -309,10 +309,10 @@ dialog_input_value() f_dialog_title_restore # Return if user has either pressed ESC or chosen Cancel/No - [ $retval -eq $SUCCESS ] || return $retval + [ $retval -eq $DIALOG_OK ] || return $retval value="$_input" - return $SUCCESS + return $DIALOG_OK } ############################################################ MAIN @@ -429,7 +429,7 @@ while :; do ;; esac - [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" + [ $? -eq $DIALOG_OK ] || f_dialog_msgbox "$err\n" done exit $SUCCESS Modified: head/usr.sbin/bsdconfig/startup/rcconf ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcconf Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/startup/rcconf Wed Oct 9 08:12:26 2013 (r256181) @@ -195,7 +195,7 @@ dialog_menu_main() f_dialog_menutag_store "$menu_choice" # Only update default-item on success - [ $retval -eq 0 ] && f_dialog_default_store "$menu_choice" + [ $retval -eq $DIALOG_OK ] && f_dialog_default_store "$menu_choice" return $retval } @@ -236,13 +236,13 @@ while :; do f_dialog_input_view_details continue esac - elif [ $retval -eq 2 ]; then + elif [ $retval -eq $DIALOG_HELP ]; then # The ``Help'' button (labeled "Details") was pressed f_dialog_input_view_details continue fi - [ $retval -eq 0 ] || f_die + [ $retval -eq $DIALOG_OK ] || f_die case "$mtag" in "X $msg_exit") break ;; Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/startup/rcdelete Wed Oct 9 08:12:26 2013 (r256181) @@ -232,7 +232,7 @@ dialog_menu_main() f_dialog_menutag_store "$menu_choice" # Only update default-item on success - [ $retval -eq 0 ] && f_dialog_default_store "$menu_choice" + [ $retval -eq $DIALOG_OK ] && f_dialog_default_store "$menu_choice" return $retval } @@ -249,7 +249,7 @@ dialog_menu_confirm_delete() local menu_list # Calculated below local hline="$hline_arrows_tab_enter" - [ $# -ge 1 ] || return $FAILURE + [ $# -ge 1 ] || return $DIALOG_CANCEL # If asked to delete only one variable, simply ask and return if [ $# -eq 1 ]; then @@ -351,13 +351,13 @@ while :; do f_dialog_input_view_details && dialog_create_main continue esac - elif [ $retval -eq 2 ]; then + elif [ $retval -eq $DIALOG_HELP ]; then # The ``Help'' button (labeled "Details") was pressed f_dialog_input_view_details && dialog_create_main continue fi - [ $retval -eq 0 ] || f_die + [ $retval -eq $DIALOG_OK ] || f_die case "$mtag" in "X $msg_exit_cancel") break ;; Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/startup/rcvar Wed Oct 9 08:12:26 2013 (r256181) @@ -158,7 +158,7 @@ dialog_menu_main() f_dialog_menutag_store "$menu_choice" f_dialog_default_store "$menu_choice" - if [ $retval -eq $SUCCESS ]; then + if [ $retval -eq $DIALOG_OK ]; then local item item=$( eval f_dialog_menutag2item${SHOW_DESC:+_with_help} \ \"\$menu_choice\" $menu_list ) Modified: head/usr.sbin/bsdconfig/startup/share/rcconf.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcconf.subr Wed Oct 9 07:55:21 2013 (r256180) +++ head/usr.sbin/bsdconfig/startup/share/rcconf.subr Wed Oct 9 08:12:26 2013 (r256181) @@ -336,7 +336,7 @@ f_dialog_input_view_details() *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 11:57:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3A1B5713; Wed, 9 Oct 2013 11:57:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 264FB20A4; Wed, 9 Oct 2013 11:57:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99Bvsw4036947; Wed, 9 Oct 2013 11:57:54 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99BvrSp036941; Wed, 9 Oct 2013 11:57:53 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310091157.r99BvrSp036941@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 9 Oct 2013 11:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256185 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 11:57:54 -0000 Author: glebius Date: Wed Oct 9 11:57:53 2013 New Revision: 256185 URL: http://svnweb.freebsd.org/changeset/base/256185 Log: - Substitute sbdrop_internal() with sbcut_internal(). The latter doesn't free mbufs, but return chain of free mbufs to a caller. Caller can either reuse them or return to allocator in a batch manner. - Implement sbdrop()/sbdrop_locked() as a wrapper around sbcut_internal(). - Expose sbcut_locked() for outside usage. Sponsored by: Netflix Sponsored by: Nginx, Inc. Approved by: re (marius) Modified: head/sys/kern/uipc_sockbuf.c head/sys/sys/sockbuf.h Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Wed Oct 9 09:13:12 2013 (r256184) +++ head/sys/kern/uipc_sockbuf.c Wed Oct 9 11:57:53 2013 (r256185) @@ -65,7 +65,7 @@ u_long sb_max_adj = static u_long sb_efficiency = 8; /* parameter for sbreserve() */ -static void sbdrop_internal(struct sockbuf *sb, int len); +static struct mbuf *sbcut_internal(struct sockbuf *sb, int len); static void sbflush_internal(struct sockbuf *sb); /* @@ -818,7 +818,7 @@ sbflush_internal(struct sockbuf *sb) */ if (!sb->sb_cc && (sb->sb_mb == NULL || sb->sb_mb->m_len)) break; - sbdrop_internal(sb, (int)sb->sb_cc); + m_freem(sbcut_internal(sb, (int)sb->sb_cc)); } if (sb->sb_cc || sb->sb_mb || sb->sb_mbcnt) panic("sbflush_internal: cc %u || mb %p || mbcnt %u", @@ -843,15 +843,16 @@ sbflush(struct sockbuf *sb) } /* - * Drop data from (the front of) a sockbuf. + * Cut data from (the front of) a sockbuf. */ -static void -sbdrop_internal(struct sockbuf *sb, int len) +static struct mbuf * +sbcut_internal(struct sockbuf *sb, int len) { - struct mbuf *m; - struct mbuf *next; + struct mbuf *m, *n, *next, *mfree; next = (m = sb->sb_mb) ? m->m_nextpkt : 0; + mfree = NULL; + while (len > 0) { if (m == 0) { if (next == 0) @@ -872,11 +873,17 @@ sbdrop_internal(struct sockbuf *sb, int } len -= m->m_len; sbfree(sb, m); - m = m_free(m); + n = m->m_next; + m->m_next = mfree; + mfree = m; + m = n; } while (m && m->m_len == 0) { sbfree(sb, m); - m = m_free(m); + n = m->m_next; + m->m_next = mfree; + mfree = m; + m = n; } if (m) { sb->sb_mb = m; @@ -894,6 +901,8 @@ sbdrop_internal(struct sockbuf *sb, int } else if (m->m_nextpkt == NULL) { sb->sb_lastrecord = m; } + + return (mfree); } /* @@ -904,17 +913,31 @@ sbdrop_locked(struct sockbuf *sb, int le { SOCKBUF_LOCK_ASSERT(sb); + m_freem(sbcut_internal(sb, len)); +} - sbdrop_internal(sb, len); +/* + * Drop data from (the front of) a sockbuf, + * and return it to caller. + */ +struct mbuf * +sbcut_locked(struct sockbuf *sb, int len) +{ + + SOCKBUF_LOCK_ASSERT(sb); + return (sbcut_internal(sb, len)); } void sbdrop(struct sockbuf *sb, int len) { + struct mbuf *mfree; SOCKBUF_LOCK(sb); - sbdrop_locked(sb, len); + mfree = sbcut_internal(sb, len); SOCKBUF_UNLOCK(sb); + + m_freem(mfree); } /* Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Wed Oct 9 09:13:12 2013 (r256184) +++ head/sys/sys/sockbuf.h Wed Oct 9 11:57:53 2013 (r256185) @@ -140,6 +140,8 @@ struct mbuf * void sbdestroy(struct sockbuf *sb, struct socket *so); void sbdrop(struct sockbuf *sb, int len); void sbdrop_locked(struct sockbuf *sb, int len); +struct mbuf * + sbcut_locked(struct sockbuf *sb, int len); void sbdroprecord(struct sockbuf *sb); void sbdroprecord_locked(struct sockbuf *sb); void sbflush(struct sockbuf *sb); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 12:00:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E9027B00; Wed, 9 Oct 2013 12:00:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D6F8E2110; Wed, 9 Oct 2013 12:00:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99C0cGW039542; Wed, 9 Oct 2013 12:00:38 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99C0cLR039540; Wed, 9 Oct 2013 12:00:38 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310091200.r99C0cLR039540@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 9 Oct 2013 12:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256186 - 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, 09 Oct 2013 12:00:39 -0000 Author: glebius Date: Wed Oct 9 12:00:38 2013 New Revision: 256186 URL: http://svnweb.freebsd.org/changeset/base/256186 Log: When processing ACK in tcp_do_segment, use sbcut_locked() instead of sbdrop_locked() to cut acked mbufs from the socket buffer. Free this chain a batch manner after the socket buffer lock is dropped. This measurably reduces contention on socket buffer. Sponsored by: Netflix Sponsored by: Nginx, Inc. Approved by: re (marius) Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Oct 9 11:57:53 2013 (r256185) +++ head/sys/netinet/tcp_input.c Wed Oct 9 12:00:38 2013 (r256186) @@ -1461,6 +1461,7 @@ tcp_do_segment(struct mbuf *m, struct tc u_long tiwin; char *s; struct in_conninfo *inc; + struct mbuf *mfree; struct tcpopt to; #ifdef TCPDEBUG @@ -2718,15 +2719,17 @@ process_ACK: SOCKBUF_LOCK(&so->so_snd); if (acked > so->so_snd.sb_cc) { tp->snd_wnd -= so->so_snd.sb_cc; - sbdrop_locked(&so->so_snd, (int)so->so_snd.sb_cc); + mfree = sbcut_locked(&so->so_snd, + (int)so->so_snd.sb_cc); ourfinisacked = 1; } else { - sbdrop_locked(&so->so_snd, acked); + mfree = sbcut_locked(&so->so_snd, acked); tp->snd_wnd -= acked; ourfinisacked = 0; } /* NB: sowwakeup_locked() does an implicit unlock. */ sowwakeup_locked(so); + m_freem(mfree); /* Detect una wraparound. */ if (!IN_RECOVERY(tp->t_flags) && SEQ_GT(tp->snd_una, tp->snd_recover) && From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 12:03:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 24F7CC90; Wed, 9 Oct 2013 12:03:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 02DB9212D; Wed, 9 Oct 2013 12:03:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99C34xV040848; Wed, 9 Oct 2013 12:03:04 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99C34a1040846; Wed, 9 Oct 2013 12:03:04 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310091203.r99C34a1040846@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 9 Oct 2013 12:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256187 - in head/sys: cam/ctl dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 12:03:05 -0000 Author: trasz Date: Wed Oct 9 12:03:04 2013 New Revision: 256187 URL: http://svnweb.freebsd.org/changeset/base/256187 Log: Fix NOP-In/NOP-Out payload handling. Previous way didn't work at all; fortunately nothing seems to actually use this feature, but it's required by standard. Approved by: re (glebius) Sponsored by: FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/dev/iscsi/iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Oct 9 12:00:38 2013 (r256186) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Oct 9 12:03:04 2013 (r256187) @@ -455,6 +455,9 @@ cfiscsi_pdu_handle_nop_out(struct icl_pd struct iscsi_bhs_nop_out *bhsno; struct iscsi_bhs_nop_in *bhsni; struct icl_pdu *response; + void *data = NULL; + size_t datasize; + int error; cs = PDU_SESSION(request); bhsno = (struct iscsi_bhs_nop_out *)request->ip_bhs; @@ -468,9 +471,26 @@ cfiscsi_pdu_handle_nop_out(struct icl_pd return; } + datasize = icl_pdu_data_segment_length(request); + if (datasize > 0) { + data = malloc(datasize, M_CFISCSI, M_NOWAIT | M_ZERO); + if (data == NULL) { + CFISCSI_SESSION_WARN(cs, "failed to allocate memory; " + "dropping connection"); + icl_pdu_free(request); + cfiscsi_session_terminate(cs); + return; + } + icl_pdu_get_data(request, 0, data, datasize); + } + response = cfiscsi_pdu_new_response(request, M_NOWAIT); if (response == NULL) { + CFISCSI_SESSION_WARN(cs, "failed to allocate memory; " + "droppping connection"); + free(data, M_CFISCSI); icl_pdu_free(request); + cfiscsi_session_terminate(cs); return; } bhsni = (struct iscsi_bhs_nop_in *)response->ip_bhs; @@ -478,14 +498,19 @@ cfiscsi_pdu_handle_nop_out(struct icl_pd bhsni->bhsni_flags = 0x80; bhsni->bhsni_initiator_task_tag = bhsno->bhsno_initiator_task_tag; bhsni->bhsni_target_transfer_tag = 0xffffffff; - -#if 0 - /* XXX */ - response->ip_data_len = request->ip_data_len; - response->ip_data_mbuf = request->ip_data_mbuf; - request->ip_data_len = 0; - request->ip_data_mbuf = NULL; -#endif + if (datasize > 0) { + error = icl_pdu_append_data(response, data, datasize, M_NOWAIT); + if (error != 0) { + CFISCSI_SESSION_WARN(cs, "failed to allocate memory; " + "dropping connection"); + free(data, M_CFISCSI); + icl_pdu_free(request); + icl_pdu_free(response); + cfiscsi_session_terminate(cs); + return; + } + free(data, M_CFISCSI); + } icl_pdu_free(request); cfiscsi_pdu_queue(response); Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Wed Oct 9 12:00:38 2013 (r256186) +++ head/sys/dev/iscsi/iscsi.c Wed Oct 9 12:03:04 2013 (r256187) @@ -726,10 +726,15 @@ iscsi_error_callback(struct icl_conn *ic static void iscsi_pdu_handle_nop_in(struct icl_pdu *response) { + struct iscsi_session *is; struct iscsi_bhs_nop_out *bhsno; struct iscsi_bhs_nop_in *bhsni; struct icl_pdu *request; + void *data = NULL; + size_t datasize; + int error; + is = PDU_SESSION(response); bhsni = (struct iscsi_bhs_nop_in *)response->ip_bhs; if (bhsni->bhsni_target_transfer_tag == 0xffffffff) { @@ -741,22 +746,47 @@ iscsi_pdu_handle_nop_in(struct icl_pdu * return; } + datasize = icl_pdu_data_segment_length(response); + if (datasize > 0) { + data = malloc(datasize, M_ISCSI, M_NOWAIT | M_ZERO); + if (data == NULL) { + ISCSI_SESSION_WARN(is, "failed to allocate memory; " + "reconnecting"); + icl_pdu_free(response); + iscsi_session_reconnect(is); + return; + } + icl_pdu_get_data(response, 0, data, datasize); + } + request = icl_pdu_new_bhs(response->ip_conn, M_NOWAIT); if (request == NULL) { + ISCSI_SESSION_WARN(is, "failed to allocate memory; " + "reconnecting"); + free(data, M_ISCSI); icl_pdu_free(response); + iscsi_session_reconnect(is); return; } bhsno = (struct iscsi_bhs_nop_out *)request->ip_bhs; bhsno->bhsno_opcode = ISCSI_BHS_OPCODE_NOP_OUT | ISCSI_BHS_OPCODE_IMMEDIATE; bhsno->bhsno_flags = 0x80; - bhsno->bhsno_initiator_task_tag = 0xffffffff; /* XXX */ + bhsno->bhsno_initiator_task_tag = 0xffffffff; bhsno->bhsno_target_transfer_tag = bhsni->bhsni_target_transfer_tag; - - request->ip_data_len = response->ip_data_len; - request->ip_data_mbuf = response->ip_data_mbuf; - response->ip_data_len = 0; - response->ip_data_mbuf = NULL; + if (datasize > 0) { + error = icl_pdu_append_data(request, data, datasize, M_NOWAIT); + if (error != 0) { + ISCSI_SESSION_WARN(is, "failed to allocate memory; " + "reconnecting"); + free(data, M_ISCSI); + icl_pdu_free(request); + icl_pdu_free(response); + iscsi_session_reconnect(is); + return; + } + free(data, M_ISCSI); + } icl_pdu_free(response); iscsi_pdu_queue_locked(request); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 12:09:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1B58E146; Wed, 9 Oct 2013 12:09:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E2F2521A3; Wed, 9 Oct 2013 12:09:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99C912v043011; Wed, 9 Oct 2013 12:09:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99C91tj043010; Wed, 9 Oct 2013 12:09:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091209.r99C91tj043010@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 12:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256188 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 12:09:02 -0000 Author: mav Date: Wed Oct 9 12:09:01 2013 New Revision: 256188 URL: http://svnweb.freebsd.org/changeset/base/256188 Log: Close the race on path ID allocation in xpt_bus_register() if two buses are registered simultaneously. Due to topology unlock between the ID allocation and the bus registration there is a chance that two buses may get the same IDs. That is supposed reason of lock assertion panic in CAM during initial bus scanning after new iscsid initiates two sessions same time. Reported by: trasz Approved by: re (glebus, marius) MFC after: 2 weeks Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Wed Oct 9 12:03:04 2013 (r256187) +++ head/sys/cam/cam_xpt.c Wed Oct 9 12:09:01 2013 (r256188) @@ -2415,7 +2415,7 @@ xptsetasyncbusfunc(struct cam_eb *bus, v struct ccb_setasync *csa = (struct ccb_setasync *)arg; xpt_compile_path(&path, /*periph*/NULL, - bus->sim->path_id, + bus->path_id, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); xpt_setup_ccb(&cpi.ccb_h, &path, CAM_PRIORITY_NORMAL); @@ -3840,13 +3840,8 @@ xpt_bus_register(struct cam_sim *sim, de /* Couldn't satisfy request */ return (CAM_RESRC_UNAVAIL); } - if (strcmp(sim->sim_name, "xpt") != 0) { - sim->path_id = - xptpathid(sim->sim_name, sim->unit_number, sim->bus_id); - } TAILQ_INIT(&new_bus->et_entries); - new_bus->path_id = sim->path_id; cam_sim_hold(sim); new_bus->sim = sim; timevalclear(&new_bus->last_reset); @@ -3855,6 +3850,8 @@ xpt_bus_register(struct cam_sim *sim, de new_bus->generation = 0; xpt_lock_buses(); + sim->path_id = new_bus->path_id = + xptpathid(sim->sim_name, sim->unit_number, sim->bus_id); old_bus = TAILQ_FIRST(&xsoftc.xpt_busses); while (old_bus != NULL && old_bus->path_id < new_bus->path_id) @@ -3958,8 +3955,8 @@ xptnextfreepathid(void) path_id_t pathid; const char *strval; + mtx_assert(&xsoftc.xpt_topo_lock, MA_OWNED); pathid = 0; - xpt_lock_buses(); bus = TAILQ_FIRST(&xsoftc.xpt_busses); retry: /* Find an unoccupied pathid */ @@ -3968,7 +3965,6 @@ retry: pathid++; bus = TAILQ_NEXT(bus, links); } - xpt_unlock_buses(); /* * Ensure that this pathid is not reserved for @@ -3977,7 +3973,6 @@ retry: if (resource_string_value("scbus", pathid, "at", &strval) == 0) { ++pathid; /* Start the search over */ - xpt_lock_buses(); goto retry; } return (pathid); @@ -3993,6 +3988,8 @@ xptpathid(const char *sim_name, int sim_ pathid = CAM_XPT_PATH_ID; snprintf(buf, sizeof(buf), "%s%d", sim_name, sim_unit); + if (strcmp(buf, "xpt0") == 0 && sim_bus == 0) + return (pathid); i = 0; while ((resource_find_match(&i, &dname, &dunit, "at", buf)) == 0) { if (strcmp(dname, "scbus")) { From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 12:17:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6706C5A1; Wed, 9 Oct 2013 12:17:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 53DD5222D; Wed, 9 Oct 2013 12:17:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99CHfC4048941; Wed, 9 Oct 2013 12:17:41 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99CHfRQ048940; Wed, 9 Oct 2013 12:17:41 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310091217.r99CHfRQ048940@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 9 Oct 2013 12:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256189 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 12:17:41 -0000 Author: trasz Date: Wed Oct 9 12:17:40 2013 New Revision: 256189 URL: http://svnweb.freebsd.org/changeset/base/256189 Log: Fix off-by-one. Coverity CID: 1011375 Approved by: re (glebius) Sponsored by: FreeBSD Foundation Modified: head/usr.sbin/ctld/kernel.c Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Wed Oct 9 12:09:01 2013 (r256188) +++ head/usr.sbin/ctld/kernel.c Wed Oct 9 12:17:40 2013 (r256189) @@ -135,7 +135,7 @@ cctl_start_element(void *user_data, cons devlist = (struct cctl_devlist_data *)user_data; cur_lun = devlist->cur_lun; devlist->level++; - if ((u_int)devlist->level > (sizeof(devlist->cur_sb) / + if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]))) log_errx(1, "%s: too many nesting levels, %zd max", __func__, sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0])); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 12:19:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B2E3F719; Wed, 9 Oct 2013 12:19:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9FE982245; Wed, 9 Oct 2013 12:19:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99CJms2049290; Wed, 9 Oct 2013 12:19:48 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99CJmDx049289; Wed, 9 Oct 2013 12:19:48 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310091219.r99CJmDx049289@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 9 Oct 2013 12:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256190 - head/usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 12:19:48 -0000 Author: trasz Date: Wed Oct 9 12:19:48 2013 New Revision: 256190 URL: http://svnweb.freebsd.org/changeset/base/256190 Log: Fix incorrect use of sizeof(). Coverity CID: 1011303 Approved by: re (glebius) Sponsored by: FreeBSD Foundation Modified: head/usr.sbin/ctladm/ctladm.c Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Wed Oct 9 12:17:40 2013 (r256189) +++ head/usr.sbin/ctladm/ctladm.c Wed Oct 9 12:19:48 2013 (r256190) @@ -700,7 +700,7 @@ cctl_port(int fd, int argc, char **argv, } else if ((targ_port == -1) && (port_type == CTL_PORT_NONE)) port_type = CTL_PORT_ALL; - bzero(&entry, sizeof(&entry)); + bzero(&entry, sizeof(entry)); /* * These are needed for all but list/dump mode. From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 12:30:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3410FB99; Wed, 9 Oct 2013 12:30:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 212612324; Wed, 9 Oct 2013 12:30:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99CUq9f056469; Wed, 9 Oct 2013 12:30:53 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99CUqfL056468; Wed, 9 Oct 2013 12:30:52 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310091230.r99CUqfL056468@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 9 Oct 2013 12:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256191 - head/usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 12:30:53 -0000 Author: trasz Date: Wed Oct 9 12:30:52 2013 New Revision: 256191 URL: http://svnweb.freebsd.org/changeset/base/256191 Log: Fix two off-by-ones. Coverity CID: 1087999, 1011375 Approved by: re (glebius) Sponsored by: FreeBSD Foundation Modified: head/usr.sbin/ctladm/ctladm.c Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Wed Oct 9 12:19:48 2013 (r256190) +++ head/usr.sbin/ctladm/ctladm.c Wed Oct 9 12:30:52 2013 (r256191) @@ -3442,7 +3442,7 @@ cctl_islist_start_element(void *user_dat islist = (struct cctl_islist_data *)user_data; cur_conn = islist->cur_conn; islist->level++; - if ((u_int)islist->level > (sizeof(islist->cur_sb) / + if ((u_int)islist->level >= (sizeof(islist->cur_sb) / sizeof(islist->cur_sb[0]))) errx(1, "%s: too many nesting levels, %zd max", __func__, sizeof(islist->cur_sb) / sizeof(islist->cur_sb[0])); @@ -3848,7 +3848,7 @@ cctl_start_element(void *user_data, cons devlist = (struct cctl_devlist_data *)user_data; cur_lun = devlist->cur_lun; devlist->level++; - if ((u_int)devlist->level > (sizeof(devlist->cur_sb) / + if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]))) errx(1, "%s: too many nesting levels, %zd max", __func__, sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0])); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 13:28:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BFF2820B; Wed, 9 Oct 2013 13:28:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD1862677; Wed, 9 Oct 2013 13:28:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99DSjGf086220; Wed, 9 Oct 2013 13:28:45 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99DSjtS086219; Wed, 9 Oct 2013 13:28:45 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310091328.r99DSjtS086219@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 9 Oct 2013 13:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256192 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 13:28:45 -0000 Author: trasz Date: Wed Oct 9 13:28:45 2013 New Revision: 256192 URL: http://svnweb.freebsd.org/changeset/base/256192 Log: Plug memory leaks. Coverity CID: 1087993, 1087992 Approved by: re (marius) Sponsored by: FreeBSD Foundation Modified: head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Wed Oct 9 12:30:52 2013 (r256191) +++ head/usr.sbin/ctld/login.c Wed Oct 9 13:28:45 2013 (r256192) @@ -419,8 +419,9 @@ login_send_chap_c(struct pdu *request, c keys_add(response_keys, "CHAP_C", chap_c); free(chap_c); keys_save(response_keys, response); - keys_delete(response_keys); pdu_send(response); + pdu_delete(response); + keys_delete(response_keys); } static struct pdu * @@ -558,6 +559,7 @@ login_send_chap_success(struct pdu *requ keys_delete(request_keys); pdu_send(response); + pdu_delete(response); } static void From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 13:45:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 38151A0B; Wed, 9 Oct 2013 13:45:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1F24327AD; Wed, 9 Oct 2013 13:45:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99Dj7RM095704; Wed, 9 Oct 2013 13:45:07 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99Dj7Mj095703; Wed, 9 Oct 2013 13:45:07 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310091345.r99Dj7Mj095703@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 9 Oct 2013 13:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256193 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 13:45:08 -0000 Author: trasz Date: Wed Oct 9 13:45:07 2013 New Revision: 256193 URL: http://svnweb.freebsd.org/changeset/base/256193 Log: Fix memory overrun. Coverity CID: 1092478 Approved by: re (gjb) Sponsored by: FreeBSD Foundation Modified: head/usr.sbin/iscsid/discovery.c Modified: head/usr.sbin/iscsid/discovery.c ============================================================================== --- head/usr.sbin/iscsid/discovery.c Wed Oct 9 13:28:45 2013 (r256192) +++ head/usr.sbin/iscsid/discovery.c Wed Oct 9 13:45:07 2013 (r256193) @@ -146,7 +146,7 @@ kernel_add(const struct connection *conn int error; memset(&isa, 0, sizeof(isa)); - memcpy(&isa.isa_conf, &conn->conn_conf, sizeof(isa)); + memcpy(&isa.isa_conf, &conn->conn_conf, sizeof(isa.isa_conf)); strlcpy(isa.isa_conf.isc_target, target, sizeof(isa.isa_conf.isc_target)); isa.isa_conf.isc_discovery = 0; From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 13: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AAB87D3D; Wed, 9 Oct 2013 13:48:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 927CF27D7; Wed, 9 Oct 2013 13:48:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99Dm8pg096518; Wed, 9 Oct 2013 13:48:08 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99Dm8KA096517; Wed, 9 Oct 2013 13:48:08 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310091348.r99Dm8KA096517@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 9 Oct 2013 13:48:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256194 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 13:48:08 -0000 Author: trasz Date: Wed Oct 9 13:48:08 2013 New Revision: 256194 URL: http://svnweb.freebsd.org/changeset/base/256194 Log: Plug memory leak. Coverity CID: 1087991 Approved by: re (gjb) Sponsored by: FreeBSD Foundation Modified: head/usr.sbin/iscsid/discovery.c Modified: head/usr.sbin/iscsid/discovery.c ============================================================================== --- head/usr.sbin/iscsid/discovery.c Wed Oct 9 13:45:07 2013 (r256193) +++ head/usr.sbin/iscsid/discovery.c Wed Oct 9 13:48:08 2013 (r256194) @@ -212,6 +212,7 @@ discovery(struct connection *conn) log_debugx("discovery done; logging out"); request = logout_new_request(conn); pdu_send(request); + pdu_delete(request); request = NULL; log_debugx("waiting for Logout Response"); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 16:55:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ECF9A9F5; Wed, 9 Oct 2013 16:55:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB5A72551; Wed, 9 Oct 2013 16:55:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99Gtqou095663; Wed, 9 Oct 2013 16:55:52 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99GtqGs095662; Wed, 9 Oct 2013 16:55:52 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310091655.r99GtqGs095662@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 9 Oct 2013 16:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256195 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 16:55:53 -0000 Author: trasz Date: Wed Oct 9 16:55:52 2013 New Revision: 256195 URL: http://svnweb.freebsd.org/changeset/base/256195 Log: Tidy up, cache return value of a function, and add an assertion; shouldn't make any functional difference. Approved by: re (gjb) Sponsored by: FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Oct 9 13:48:08 2013 (r256194) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Oct 9 16:55:52 2013 (r256195) @@ -674,7 +674,7 @@ cfiscsi_handle_data_segment(struct icl_p struct iscsi_bhs_data_out *bhsdo; struct cfiscsi_session *cs; struct ctl_sg_entry ctl_sg_entry, *ctl_sglist; - size_t copy_len, off, buffer_offset; + size_t copy_len, len, off, buffer_offset; int ctl_sg_count; union ctl_io *io; @@ -732,7 +732,20 @@ cfiscsi_handle_data_segment(struct icl_p return (true); } + /* + * This is the offset within the PDU data segment, as opposed + * to buffer_offset, which is the offset within the task (SCSI + * command). + */ off = 0; + len = icl_pdu_data_segment_length(request); + + /* + * Iterate over the scatter/gather segments, filling them with data + * from the PDU data segment. Note that this can get called multiple + * times for one SCSI command; the cdw structure holds state for the + * scatter/gather list. + */ for (;;) { KASSERT(cdw->cdw_sg_index < ctl_sg_count, ("cdw->cdw_sg_index >= ctl_sg_count")); @@ -740,7 +753,8 @@ cfiscsi_handle_data_segment(struct icl_p cdw->cdw_sg_addr = ctl_sglist[cdw->cdw_sg_index].addr; cdw->cdw_sg_len = ctl_sglist[cdw->cdw_sg_index].len; } - copy_len = icl_pdu_data_segment_length(request) - off; + KASSERT(off <= len, ("len > off")); + copy_len = len - off; if (copy_len > cdw->cdw_sg_len) copy_len = cdw->cdw_sg_len; @@ -751,15 +765,27 @@ cfiscsi_handle_data_segment(struct icl_p io->scsiio.ext_data_filled += copy_len; if (cdw->cdw_sg_len == 0) { - if (cdw->cdw_sg_index == ctl_sg_count - 1) + /* + * End of current segment. + */ + if (cdw->cdw_sg_index == ctl_sg_count - 1) { + /* + * Last segment in scatter/gather list. + */ break; + } cdw->cdw_sg_index++; } - if (off == icl_pdu_data_segment_length(request)) + + if (off == len) { + /* + * End of PDU payload. + */ break; + } } - if (off < icl_pdu_data_segment_length(request)) { + if (len > off) { CFISCSI_SESSION_WARN(cs, "received too much data: got %zd bytes, " "expected %zd", icl_pdu_data_segment_length(request), off); cfiscsi_session_terminate(cs); @@ -2386,7 +2412,7 @@ cfiscsi_datamove_in(union ctl_io *io) /* * Can't stuff more data into the current PDU; * queue it. Note that's not enough to check - * for kern_data_resid == 0 instead; there + * for kern_data_resid == 0 instead; there * may be several Data-In PDUs for the final * call to cfiscsi_datamove(), and we want * to set the F flag only on the last of them. From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 17:05:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A76CCD34; Wed, 9 Oct 2013 17:05:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9507125CF; Wed, 9 Oct 2013 17:05:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99H53c6000462; Wed, 9 Oct 2013 17:05:03 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99H53KN000460; Wed, 9 Oct 2013 17:05:03 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310091705.r99H53KN000460@svn.freebsd.org> From: Dimitry Andric Date: Wed, 9 Oct 2013 17:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256196 - head/sys/arm/s3c2xx0 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 17:05:03 -0000 Author: dim Date: Wed Oct 9 17:05:02 2013 New Revision: 256196 URL: http://svnweb.freebsd.org/changeset/base/256196 Log: Remove redundant redeclarations of uart_s3c2410_class in sys/arm/s3c2xx0/uart_bus_s3c2410.c and uart_cpu_s3c2410.c, to silence two gcc warnings. Approved by: re (gjb) X-MFC-With: r252394 Modified: head/sys/arm/s3c2xx0/uart_bus_s3c2410.c head/sys/arm/s3c2xx0/uart_cpu_s3c2410.c Modified: head/sys/arm/s3c2xx0/uart_bus_s3c2410.c ============================================================================== --- head/sys/arm/s3c2xx0/uart_bus_s3c2410.c Wed Oct 9 16:55:52 2013 (r256195) +++ head/sys/arm/s3c2xx0/uart_bus_s3c2410.c Wed Oct 9 17:05:02 2013 (r256196) @@ -35,7 +35,6 @@ static driver_t uart_s3c2410_driver = { sizeof(struct uart_softc), }; -extern struct uart_class uart_s3c2410_class; extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; static int uart_s3c2410_probe(device_t dev) Modified: head/sys/arm/s3c2xx0/uart_cpu_s3c2410.c ============================================================================== --- head/sys/arm/s3c2xx0/uart_cpu_s3c2410.c Wed Oct 9 16:55:52 2013 (r256195) +++ head/sys/arm/s3c2xx0/uart_cpu_s3c2410.c Wed Oct 9 17:05:02 2013 (r256196) @@ -47,8 +47,6 @@ extern struct uart_ops uart_s3c2410_ops; vm_offset_t s3c2410_uart_vaddr; unsigned int s3c2410_pclk; -extern struct uart_class uart_s3c2410_class; - int uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) { From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 17: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 023FA1B1; Wed, 9 Oct 2013 17:06:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 69C7725FE; Wed, 9 Oct 2013 17:06:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99H648k000812; Wed, 9 Oct 2013 17:06:04 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99H64dw000811; Wed, 9 Oct 2013 17:06:04 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310091706.r99H64dw000811@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 9 Oct 2013 17:06:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256197 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 17:06:05 -0000 Author: trasz Date: Wed Oct 9 17:06:03 2013 New Revision: 256197 URL: http://svnweb.freebsd.org/changeset/base/256197 Log: Make the error handling more consistant. Shouldn't make any functional difference. Approved by: re (gjb) Sponsored by: FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Oct 9 17:05:02 2013 (r256196) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Oct 9 17:06:03 2013 (r256197) @@ -288,8 +288,8 @@ cfiscsi_pdu_handle(struct icl_pdu *reque CFISCSI_SESSION_WARN(cs, "received PDU with unsupported " "opcode 0x%x; dropping connection", request->ip_bhs->bhs_opcode); - cfiscsi_session_terminate(cs); icl_pdu_free(request); + cfiscsi_session_terminate(cs); } } @@ -532,14 +532,16 @@ cfiscsi_pdu_handle_scsi_command(struct i if (request->ip_data_len > 0 && cs->cs_immediate_data == false) { CFISCSI_SESSION_WARN(cs, "unsolicited data with " "ImmediateData=No; dropping connection"); - cfiscsi_session_terminate(cs); icl_pdu_free(request); + cfiscsi_session_terminate(cs); return; } io = ctl_alloc_io(cs->cs_target->ct_softc->fe.ctl_pool_ref); if (io == NULL) { - CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io"); + CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io; " + "dropping connection"); icl_pdu_free(request); + cfiscsi_session_terminate(cs); return; } ctl_zero_io(io); @@ -579,10 +581,12 @@ cfiscsi_pdu_handle_scsi_command(struct i refcount_acquire(&cs->cs_outstanding_ctl_pdus); error = ctl_queue(io); if (error != CTL_RETVAL_COMPLETE) { - CFISCSI_SESSION_WARN(cs, "ctl_queue() failed; error %d", error); + CFISCSI_SESSION_WARN(cs, "ctl_queue() failed; error %d; " + "dropping connection", error); ctl_free_io(io); refcount_release(&cs->cs_outstanding_ctl_pdus); icl_pdu_free(request); + cfiscsi_session_terminate(cs); } } @@ -600,8 +604,10 @@ cfiscsi_pdu_handle_task_request(struct i bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs; io = ctl_alloc_io(cs->cs_target->ct_softc->fe.ctl_pool_ref); if (io == NULL) { - CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io"); + CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io;" + "dropping connection"); icl_pdu_free(request); + cfiscsi_session_terminate(cs); return; } ctl_zero_io(io); @@ -642,7 +648,10 @@ cfiscsi_pdu_handle_task_request(struct i response = cfiscsi_pdu_new_response(request, M_NOWAIT); if (response == NULL) { + CFISCSI_SESSION_WARN(cs, "failed to allocate memory; " + "dropping connection"); icl_pdu_free(request); + cfiscsi_session_terminate(cs); return; } bhstmr2 = (struct iscsi_bhs_task_management_response *) @@ -661,10 +670,12 @@ cfiscsi_pdu_handle_task_request(struct i refcount_acquire(&cs->cs_outstanding_ctl_pdus); error = ctl_queue(io); if (error != CTL_RETVAL_COMPLETE) { - CFISCSI_SESSION_WARN(cs, "ctl_queue() failed; error %d", error); + CFISCSI_SESSION_WARN(cs, "ctl_queue() failed; error %d; " + "dropping connection", error); ctl_free_io(io); refcount_release(&cs->cs_outstanding_ctl_pdus); icl_pdu_free(request); + cfiscsi_session_terminate(cs); } } @@ -859,8 +870,8 @@ cfiscsi_pdu_handle_data_out(struct icl_p CFISCSI_SESSION_UNLOCK(cs); if (cdw == NULL) { CFISCSI_SESSION_WARN(cs, "data transfer tag 0x%x, initiator task tag " - "0x%x, not found", bhsdo->bhsdo_target_transfer_tag, - bhsdo->bhsdo_initiator_task_tag); + "0x%x, not found; dropping connection", + bhsdo->bhsdo_target_transfer_tag, bhsdo->bhsdo_initiator_task_tag); icl_pdu_free(request); cfiscsi_session_terminate(cs); return; @@ -897,6 +908,7 @@ cfiscsi_pdu_handle_logout_request(struct case BHSLR_REASON_CLOSE_CONNECTION: response = cfiscsi_pdu_new_response(request, M_NOWAIT); if (response == NULL) { + CFISCSI_SESSION_DEBUG(cs, "failed to allocate memory"); icl_pdu_free(request); cfiscsi_session_terminate(cs); return; @@ -914,6 +926,8 @@ cfiscsi_pdu_handle_logout_request(struct case BHSLR_REASON_REMOVE_FOR_RECOVERY: response = cfiscsi_pdu_new_response(request, M_NOWAIT); if (response == NULL) { + CFISCSI_SESSION_WARN(cs, + "failed to allocate memory; dropping connection"); icl_pdu_free(request); cfiscsi_session_terminate(cs); return; @@ -985,7 +999,7 @@ cfiscsi_callout(void *context) cp = icl_pdu_new_bhs(cs->cs_conn, M_NOWAIT); if (cp == NULL) { - CFISCSI_SESSION_WARN(cs, "failed to allocate PDU"); + CFISCSI_SESSION_WARN(cs, "failed to allocate memory"); return; } bhsni = (struct iscsi_bhs_nop_in *)cp->ip_bhs; From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 17:07:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BA684318; Wed, 9 Oct 2013 17:07:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A66C4261A; Wed, 9 Oct 2013 17:07:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99H7MDL001225; Wed, 9 Oct 2013 17:07:22 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99H7KMM001215; Wed, 9 Oct 2013 17:07:20 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310091707.r99H7KMM001215@svn.freebsd.org> From: Glen Barber Date: Wed, 9 Oct 2013 17:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256198 - in head: . gnu/usr.bin gnu/usr.bin/rcs share/doc/psd share/doc/psd/13.rcs share/man/man5 share/mk tools/build/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 17:07:22 -0000 Author: gjb Date: Wed Oct 9 17:07:20 2013 New Revision: 256198 URL: http://svnweb.freebsd.org/changeset/base/256198 Log: Revert r256095, r256120 (partial), r256121: r256095: - Add gnu/usr.bin/rcs back to the base system. r256120: - Add WITHOUT_RCS back to src.conf.5. r256121: - Remove UPDATING entry regarding gnu/usr.bin/rcs removal. Requested by: many Approved by: re (marius) Discussed with: core Added: head/gnu/usr.bin/rcs/ - copied from r256094, head/gnu/usr.bin/rcs/ head/share/doc/psd/13.rcs/ - copied from r256094, head/share/doc/psd/13.rcs/ head/tools/build/options/WITHOUT_RCS - copied unchanged from r256094, head/tools/build/options/WITHOUT_RCS Modified: head/ObsoleteFiles.inc head/UPDATING head/gnu/usr.bin/Makefile head/share/doc/psd/Makefile head/share/man/man5/src.conf.5 head/share/mk/bsd.own.mk head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Oct 9 17:06:03 2013 (r256197) +++ head/ObsoleteFiles.inc Wed Oct 9 17:07:20 2013 (r256198) @@ -38,29 +38,6 @@ # xargs -n1 | sort | uniq -d; # done -# 20131015: removal of RCS from base -OLD_FILES+=usr/bin/ci -OLD_FILES+=usr/bin/co -OLD_FILES+=usr/bin/ident -OLD_FILES+=usr/bin/merge -OLD_FILES+=usr/bin/rcs -OLD_FILES+=usr/bin/rcsclean -OLD_FILES+=usr/bin/rcsdiff -OLD_FILES+=usr/bin/rcsfreeze -OLD_FILES+=usr/bin/rcsmerge -OLD_FILES+=usr/bin/rlog -OLD_FILES+=usr/share/man/man1/ci.1.gz -OLD_FILES+=usr/share/man/man1/co.1.gz -OLD_FILES+=usr/share/man/man1/ident.1.gz -OLD_FILES+=usr/share/man/man1/merge.1.gz -OLD_FILES+=usr/share/man/man1/rcs.1.gz -OLD_FILES+=usr/share/man/man1/rcsclean.1.gz -OLD_FILES+=usr/share/man/man1/rcsdiff.1.gz -OLD_FILES+=usr/share/man/man1/rcsfreeze.1.gz -OLD_FILES+=usr/share/man/man1/rcsintro.1.gz -OLD_FILES+=usr/share/man/man1/rcsmerge.1.gz -OLD_FILES+=usr/share/man/man1/rlog.1.gz -OLD_FILES+=usr/share/man/man5/rcsfile.5.gz # 20131001: ar and ranlib from binutils not used OLD_FILES+=usr/bin/gnu-ar OLD_FILES+=usr/bin/gnu-ranlib Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Oct 9 17:06:03 2013 (r256197) +++ head/UPDATING Wed Oct 9 17:07:20 2013 (r256198) @@ -31,10 +31,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) -20131006: - RCS has been removed from the base system. If you need RCS - install either devel/rcs or devel/rcs57. - 20130930: BIND has been removed from the base system. If all you need is a local resolver, simply enable and start the local_unbound Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Wed Oct 9 17:06:03 2013 (r256197) +++ head/gnu/usr.bin/Makefile Wed Oct 9 17:07:20 2013 (r256198) @@ -12,6 +12,7 @@ SUBDIR= ${_binutils} \ ${_gperf} \ grep \ ${_groff} \ + ${_rcs} \ sdiff \ send-pr \ ${_texinfo} @@ -31,6 +32,10 @@ _dtc= dtc _texinfo= texinfo .endif +.if ${MK_RCS} != "no" +_rcs= rcs +.endif + .if ${MK_BINUTILS} != "no" _binutils= binutils .endif Modified: head/share/doc/psd/Makefile ============================================================================== --- head/share/doc/psd/Makefile Wed Oct 9 17:06:03 2013 (r256197) +++ head/share/doc/psd/Makefile Wed Oct 9 17:07:20 2013 (r256198) @@ -20,6 +20,7 @@ SUBDIR= title \ 05.sysman \ 06.Clang \ 12.make \ + 13.rcs \ 15.yacc \ 16.lex \ 17.m4 \ Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Oct 9 17:06:03 2013 (r256197) +++ head/share/man/man5/src.conf.5 Wed Oct 9 17:07:20 2013 (r256198) @@ -909,6 +909,11 @@ This includes .Xr rlogin 1 , .Xr rsh 1 , etc. +.It Va WITHOUT_RCS +.\" from FreeBSD: head/tools/build/options/WITHOUT_RCS 156932 2006-03-21 07:50:50Z ru +Set to not build +.Xr rcs 1 +and related utilities. .It Va WITHOUT_RESCUE .\" from FreeBSD: head/tools/build/options/WITHOUT_RESCUE 156932 2006-03-21 07:50:50Z ru Set to not build Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Wed Oct 9 17:06:03 2013 (r256197) +++ head/share/mk/bsd.own.mk Wed Oct 9 17:07:20 2013 (r256198) @@ -334,6 +334,7 @@ __DEFAULT_YES_OPTIONS = \ PROFILE \ QUOTAS \ RCMDS \ + RCS \ RESCUE \ ROUTED \ SENDMAIL \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 9 17:06:03 2013 (r256197) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 9 17:07:20 2013 (r256198) @@ -3859,6 +3859,31 @@ OLD_FILES+=usr/share/man/man8/rshd.8.gz OLD_FILES+=usr/share/man/man8/rwhod.8.gz .endif +.if ${MK_RCS} == no +OLD_FILES+=usr/bin/ci +OLD_FILES+=usr/bin/co +OLD_FILES+=usr/bin/ident +OLD_FILES+=usr/bin/merge +OLD_FILES+=usr/bin/rcs +OLD_FILES+=usr/bin/rcsclean +OLD_FILES+=usr/bin/rcsdiff +OLD_FILES+=usr/bin/rcsfreeze +OLD_FILES+=usr/bin/rcsmerge +OLD_FILES+=usr/bin/rlog +OLD_FILES+=usr/share/man/man1/ci.1.gz +OLD_FILES+=usr/share/man/man1/co.1.gz +OLD_FILES+=usr/share/man/man1/ident.1.gz +OLD_FILES+=usr/share/man/man1/merge.1.gz +OLD_FILES+=usr/share/man/man1/rcs.1.gz +OLD_FILES+=usr/share/man/man1/rcsclean.1.gz +OLD_FILES+=usr/share/man/man1/rcsdiff.1.gz +OLD_FILES+=usr/share/man/man1/rcsfreeze.1.gz +OLD_FILES+=usr/share/man/man1/rcsintro.1.gz +OLD_FILES+=usr/share/man/man1/rcsmerge.1.gz +OLD_FILES+=usr/share/man/man1/rlog.1.gz +OLD_FILES+=usr/share/man/man5/rcsfile.5.gz +.endif + #.if ${MK_RESCUE} == no # to be filled in or replaced with a special target #.endif Copied: head/tools/build/options/WITHOUT_RCS (from r256094, head/tools/build/options/WITHOUT_RCS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_RCS Wed Oct 9 17:07:20 2013 (r256198, copy of r256094, head/tools/build/options/WITHOUT_RCS) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr rcs 1 +and related utilities. From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 17:07:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 48AC5471; Wed, 9 Oct 2013 17:07:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3673F2627; Wed, 9 Oct 2013 17:07:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99H7po6001423; Wed, 9 Oct 2013 17:07:51 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99H7pSu001422; Wed, 9 Oct 2013 17:07:51 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310091707.r99H7pSu001422@svn.freebsd.org> From: Dimitry Andric Date: Wed, 9 Oct 2013 17:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256199 - head/sys/contrib/ipfilter/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, 09 Oct 2013 17:07:51 -0000 Author: dim Date: Wed Oct 9 17:07:50 2013 New Revision: 256199 URL: http://svnweb.freebsd.org/changeset/base/256199 Log: Initialize a variable in sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c, to silence a gcc warning. Approved by: re (gjb) X-MFC-With: r255332 Modified: head/sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c Modified: head/sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c Wed Oct 9 17:07:20 2013 (r256198) +++ head/sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c Wed Oct 9 17:07:50 2013 (r256199) @@ -159,7 +159,7 @@ ipf_p_rcmd_portmsg(fin, aps, nat) ip6_t *ip6; #endif int tcpsz; - int slen; + int slen = 0; /* silence gcc */ ip_t *ip; mb_t *m; From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 17:32:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C5E1FDCE; Wed, 9 Oct 2013 17:32:52 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B27A827F6; Wed, 9 Oct 2013 17:32:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99HWqwx015713; Wed, 9 Oct 2013 17:32:52 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99HWq48015704; Wed, 9 Oct 2013 17:32:52 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201310091732.r99HWq48015704@svn.freebsd.org> From: Jack F Vogel Date: Wed, 9 Oct 2013 17:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256200 - in head/sys/dev: e1000 netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 17:32:52 -0000 Author: jfv Date: Wed Oct 9 17:32:52 2013 New Revision: 256200 URL: http://svnweb.freebsd.org/changeset/base/256200 Log: Update the Intel igb driver to version 2.4.0 - This version has support for the new Intel Avoton systems, including 2.5Gb support, further it now has IPv6/TSO6 support as well. Shared code has been updated where necessary as well. Thanks to my new assistant Eric Joyner for doing the transmit path changes to bring in the IPv6/TSO6 support. Thanks to Gleb for catching the one bug and change needed in NETMAP. Approved by: re Modified: head/sys/dev/e1000/e1000_80003es2lan.c head/sys/dev/e1000/e1000_80003es2lan.h head/sys/dev/e1000/e1000_82571.c head/sys/dev/e1000/e1000_82575.c head/sys/dev/e1000/e1000_82575.h head/sys/dev/e1000/e1000_api.c head/sys/dev/e1000/e1000_defines.h head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/e1000_i210.c head/sys/dev/e1000/e1000_i210.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_ich8lan.h head/sys/dev/e1000/e1000_mac.c head/sys/dev/e1000/e1000_osdep.h head/sys/dev/e1000/e1000_phy.c head/sys/dev/e1000/e1000_phy.h head/sys/dev/e1000/e1000_regs.h head/sys/dev/e1000/e1000_vf.h head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h head/sys/dev/netmap/if_igb_netmap.h Modified: head/sys/dev/e1000/e1000_80003es2lan.c ============================================================================== --- head/sys/dev/e1000/e1000_80003es2lan.c Wed Oct 9 17:07:50 2013 (r256199) +++ head/sys/dev/e1000/e1000_80003es2lan.c Wed Oct 9 17:32:52 2013 (r256200) @@ -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,16 +32,12 @@ ******************************************************************************/ /*$FreeBSD$*/ -/* - * 80003ES2LAN Gigabit Ethernet Controller (Copper) +/* 80003ES2LAN Gigabit Ethernet Controller (Copper) * 80003ES2LAN Gigabit Ethernet Controller (Serdes) */ #include "e1000_api.h" -static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw); -static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw); -static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw); static s32 e1000_acquire_phy_80003es2lan(struct e1000_hw *hw); static void e1000_release_phy_80003es2lan(struct e1000_hw *hw); static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw); @@ -71,14 +67,12 @@ static s32 e1000_read_kmrn_reg_80003es2 u16 *data); static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, u16 data); -static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw); static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw); static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask); static s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw); static void e1000_power_down_phy_copper_80003es2lan(struct e1000_hw *hw); -/* - * A table for the GG82563 cable length where the range is defined +/* A table for the GG82563 cable length where the range is defined * with a lower bound at "index" and the upper bound at * "index + 5". */ @@ -95,13 +89,13 @@ static const u16 e1000_gg82563_cable_len static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("e1000_init_phy_params_80003es2lan"); if (hw->phy.media_type != e1000_media_type_copper) { phy->type = e1000_phy_none; - goto out; + return E1000_SUCCESS; } else { phy->ops.power_up = e1000_power_up_phy_copper; phy->ops.power_down = e1000_power_down_phy_copper_80003es2lan; @@ -133,12 +127,9 @@ static s32 e1000_init_phy_params_80003es ret_val = e1000_get_phy_id(hw); /* Verify phy id */ - if (phy->id != GG82563_E_PHY_ID) { - ret_val = -E1000_ERR_PHY; - goto out; - } + if (phy->id != GG82563_E_PHY_ID) + return -E1000_ERR_PHY; -out: return ret_val; } @@ -176,8 +167,7 @@ static s32 e1000_init_nvm_params_80003es 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; @@ -234,8 +224,8 @@ static s32 e1000_init_mac_params_80003es /* FWSM register */ mac->has_fwsm = TRUE; /* 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); /* Adaptive IFS not supported */ mac->adaptive_ifs = FALSE; @@ -377,14 +367,13 @@ static s32 e1000_acquire_nvm_80003es2lan ret_val = e1000_acquire_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM); if (ret_val) - goto out; + return ret_val; ret_val = e1000_acquire_nvm_generic(hw); if (ret_val) e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM); -out: return ret_val; } @@ -415,23 +404,20 @@ static s32 e1000_acquire_swfw_sync_80003 u32 swfw_sync; u32 swmask = mask; u32 fwmask = mask << 16; - s32 ret_val = E1000_SUCCESS; - s32 i = 0, timeout = 50; + s32 i = 0; + s32 timeout = 50; DEBUGFUNC("e1000_acquire_swfw_sync_80003es2lan"); while (i < timeout) { - if (e1000_get_hw_semaphore_generic(hw)) { - ret_val = -E1000_ERR_SWFW_SYNC; - goto out; - } + if (e1000_get_hw_semaphore_generic(hw)) + return -E1000_ERR_SWFW_SYNC; swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC); if (!(swfw_sync & (fwmask | swmask))) break; - /* - * Firmware currently using resource (fwmask) + /* Firmware currently using resource (fwmask) * or other software thread using resource (swmask) */ e1000_put_hw_semaphore_generic(hw); @@ -441,8 +427,7 @@ static s32 e1000_acquire_swfw_sync_80003 if (i == timeout) { DEBUGOUT("Driver can't access resource, SW_FW_SYNC timeout.\n"); - ret_val = -E1000_ERR_SWFW_SYNC; - goto out; + return -E1000_ERR_SWFW_SYNC; } swfw_sync |= swmask; @@ -450,8 +435,7 @@ static s32 e1000_acquire_swfw_sync_80003 e1000_put_hw_semaphore_generic(hw); -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -497,14 +481,13 @@ static s32 e1000_read_phy_reg_gg82563_80 ret_val = e1000_acquire_phy_80003es2lan(hw); if (ret_val) - goto out; + return ret_val; /* Select Configuration Page */ if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) { page_select = GG82563_PHY_PAGE_SELECT; } else { - /* - * Use Alternative Page Select register to access + /* Use Alternative Page Select register to access * registers 30 and 31 */ page_select = GG82563_PHY_PAGE_SELECT_ALT; @@ -514,12 +497,11 @@ static s32 e1000_read_phy_reg_gg82563_80 ret_val = e1000_write_phy_reg_mdic(hw, page_select, temp); if (ret_val) { e1000_release_phy_80003es2lan(hw); - goto out; + return ret_val; } - if (hw->dev_spec._80003es2lan.mdic_wa_enable == TRUE) { - /* - * The "ready" bit in the MDIC register may be incorrectly set + if (hw->dev_spec._80003es2lan.mdic_wa_enable) { + /* The "ready" bit in the MDIC register may be incorrectly set * before the device has completed the "Page Select" MDI * transaction. So we wait 200us after each MDI command... */ @@ -529,9 +511,8 @@ static s32 e1000_read_phy_reg_gg82563_80 ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp); if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) { - ret_val = -E1000_ERR_PHY; e1000_release_phy_80003es2lan(hw); - goto out; + return -E1000_ERR_PHY; } usec_delay(200); @@ -549,7 +530,6 @@ static s32 e1000_read_phy_reg_gg82563_80 e1000_release_phy_80003es2lan(hw); -out: return ret_val; } @@ -572,14 +552,13 @@ static s32 e1000_write_phy_reg_gg82563_8 ret_val = e1000_acquire_phy_80003es2lan(hw); if (ret_val) - goto out; + return ret_val; /* Select Configuration Page */ if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) { page_select = GG82563_PHY_PAGE_SELECT; } else { - /* - * Use Alternative Page Select register to access + /* Use Alternative Page Select register to access * registers 30 and 31 */ page_select = GG82563_PHY_PAGE_SELECT_ALT; @@ -589,12 +568,11 @@ static s32 e1000_write_phy_reg_gg82563_8 ret_val = e1000_write_phy_reg_mdic(hw, page_select, temp); if (ret_val) { e1000_release_phy_80003es2lan(hw); - goto out; + return ret_val; } - if (hw->dev_spec._80003es2lan.mdic_wa_enable == TRUE) { - /* - * The "ready" bit in the MDIC register may be incorrectly set + if (hw->dev_spec._80003es2lan.mdic_wa_enable) { + /* The "ready" bit in the MDIC register may be incorrectly set * before the device has completed the "Page Select" MDI * transaction. So we wait 200us after each MDI command... */ @@ -604,9 +582,8 @@ static s32 e1000_write_phy_reg_gg82563_8 ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp); if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) { - ret_val = -E1000_ERR_PHY; e1000_release_phy_80003es2lan(hw); - goto out; + return -E1000_ERR_PHY; } usec_delay(200); @@ -624,7 +601,6 @@ static s32 e1000_write_phy_reg_gg82563_8 e1000_release_phy_80003es2lan(hw); -out: return ret_val; } @@ -655,7 +631,6 @@ static s32 e1000_write_nvm_80003es2lan(s static s32 e1000_get_cfg_done_80003es2lan(struct e1000_hw *hw) { s32 timeout = PHY_CFG_TIMEOUT; - s32 ret_val = E1000_SUCCESS; u32 mask = E1000_NVM_CFG_DONE_PORT_0; DEBUGFUNC("e1000_get_cfg_done_80003es2lan"); @@ -671,12 +646,10 @@ static s32 e1000_get_cfg_done_80003es2la } 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; } /** @@ -688,33 +661,32 @@ out: **/ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 phy_data; bool link; DEBUGFUNC("e1000_phy_force_speed_duplex_80003es2lan"); if (!(hw->phy.ops.read_reg)) - goto out; + return E1000_SUCCESS; - /* - * Clear Auto-Crossover to force MDI manually. M88E1000 requires MDI + /* Clear Auto-Crossover to force MDI manually. M88E1000 requires MDI * forced whenever speed and duplex are forced. */ ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); if (ret_val) - goto out; + return ret_val; phy_data &= ~GG82563_PSCR_CROSSOVER_MODE_AUTO; ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_SPEC_CTRL, phy_data); if (ret_val) - goto out; + return ret_val; DEBUGOUT1("GG82563 PSCR: %X\n", phy_data); ret_val = hw->phy.ops.read_reg(hw, PHY_CONTROL, &phy_data); if (ret_val) - goto out; + return ret_val; e1000_phy_force_speed_duplex_setup(hw, &phy_data); @@ -723,7 +695,7 @@ static s32 e1000_phy_force_speed_duplex_ ret_val = hw->phy.ops.write_reg(hw, PHY_CONTROL, phy_data); if (ret_val) - goto out; + return ret_val; usec_delay(1); @@ -733,32 +705,30 @@ static s32 e1000_phy_force_speed_duplex_ ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT, 100000, &link); if (ret_val) - goto out; + return ret_val; if (!link) { - /* - * We didn't get link. + /* We didn't get link. * Reset the DSP and cross our fingers. */ ret_val = e1000_phy_reset_dsp_generic(hw); if (ret_val) - goto out; + return ret_val; } /* Try once more */ ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT, 100000, &link); if (ret_val) - goto out; + return ret_val; } ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, &phy_data); if (ret_val) - goto out; + return ret_val; - /* - * Resetting the phy means we need to verify the TX_CLK corresponds + /* Resetting the phy means we need to verify the TX_CLK corresponds * to the link speed. 10Mbps -> 2.5MHz, else 25MHz. */ phy_data &= ~GG82563_MSCR_TX_CLK_MASK; @@ -767,15 +737,13 @@ static s32 e1000_phy_force_speed_duplex_ else phy_data |= GG82563_MSCR_TX_CLK_100MBPS_25; - /* - * In addition, we must re-enable CRS on Tx for both half and full + /* In addition, we must re-enable CRS on Tx for both half and full * duplex. */ phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX; ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, phy_data); -out: return ret_val; } @@ -789,32 +757,29 @@ out: static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 phy_data, index; DEBUGFUNC("e1000_get_cable_length_80003es2lan"); if (!(hw->phy.ops.read_reg)) - goto out; + return E1000_SUCCESS; ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_DSP_DISTANCE, &phy_data); if (ret_val) - goto out; + return ret_val; index = phy_data & GG82563_DSPD_CABLE_LENGTH; - if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE - 5) { - ret_val = -E1000_ERR_PHY; - goto out; - } + if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE - 5) + return -E1000_ERR_PHY; phy->min_cable_length = e1000_gg82563_cable_length_table[index]; phy->max_cable_length = e1000_gg82563_cable_length_table[index + 5]; phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2; -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -855,11 +820,11 @@ static s32 e1000_reset_hw_80003es2lan(st { u32 ctrl; s32 ret_val; + u16 kum_reg_data; DEBUGFUNC("e1000_reset_hw_80003es2lan"); - /* - * 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); @@ -878,23 +843,30 @@ static s32 e1000_reset_hw_80003es2lan(st ctrl = E1000_READ_REG(hw, E1000_CTRL); ret_val = e1000_acquire_phy_80003es2lan(hw); + if (ret_val) + return ret_val; + DEBUGOUT("Issuing a global reset to MAC\n"); E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_RST); e1000_release_phy_80003es2lan(hw); + /* Disable IBIST slave mode (far-end loopback) */ + e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, + &kum_reg_data); + kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; + e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, + kum_reg_data); + 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; /* Clear any pending interrupt events. */ E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); E1000_READ_REG(hw, E1000_ICR); - ret_val = e1000_check_alt_mac_addr_generic(hw); - -out: - return ret_val; + return e1000_check_alt_mac_addr_generic(hw); } /** @@ -917,9 +889,9 @@ static s32 e1000_init_hw_80003es2lan(str /* 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"); @@ -935,6 +907,8 @@ static s32 e1000_init_hw_80003es2lan(str /* Setup link and flow control */ ret_val = mac->ops.setup_link(hw); + if (ret_val) + return ret_val; /* Disable IBIST slave mode (far-end loopback) */ e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, @@ -945,14 +919,14 @@ static s32 e1000_init_hw_80003es2lan(str /* Set the transmit descriptor write-back policy */ reg_data = E1000_READ_REG(hw, E1000_TXDCTL(0)); - reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) | - E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC; + reg_data = ((reg_data & ~E1000_TXDCTL_WTHRESH) | + E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC); E1000_WRITE_REG(hw, E1000_TXDCTL(0), reg_data); /* ...for both queues. */ reg_data = E1000_READ_REG(hw, E1000_TXDCTL(1)); - reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) | - E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC; + reg_data = ((reg_data & ~E1000_TXDCTL_WTHRESH) | + E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC); E1000_WRITE_REG(hw, E1000_TXDCTL(1), reg_data); /* Enable retransmit on late collisions */ @@ -979,18 +953,16 @@ static s32 e1000_init_hw_80003es2lan(str /* default to TRUE to enable the MDIC W/A */ hw->dev_spec._80003es2lan.mdic_wa_enable = TRUE; - ret_val = e1000_read_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET >> - E1000_KMRNCTRLSTA_OFFSET_SHIFT, - &i); + ret_val = + e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_OFFSET >> + E1000_KMRNCTRLSTA_OFFSET_SHIFT, &i); if (!ret_val) { if ((i & E1000_KMRNCTRLSTA_OPMODE_MASK) == E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO) hw->dev_spec._80003es2lan.mdic_wa_enable = FALSE; } - /* - * 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. @@ -1037,6 +1009,13 @@ static void e1000_initialize_hw_bits_800 reg |= (1 << 28); E1000_WRITE_REG(hw, E1000_TARC(1), reg); + /* Disable IPv6 extension header parsing because some malformed + * IPv6 headers can hang the Rx. + */ + 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); + return; } @@ -1050,14 +1029,14 @@ static s32 e1000_copper_link_setup_gg825 { struct e1000_phy_info *phy = &hw->phy; s32 ret_val; - u32 ctrl_ext; + u32 reg; u16 data; DEBUGFUNC("e1000_copper_link_setup_gg82563_80003es2lan"); ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, &data); if (ret_val) - goto out; + return ret_val; data |= GG82563_MSCR_ASSERT_CRS_ON_TX; /* Use 25MHz for both link down and 1000Base-T for Tx clock. */ @@ -1065,10 +1044,9 @@ static s32 e1000_copper_link_setup_gg825 ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, data); if (ret_val) - goto out; + return ret_val; - /* - * Options: + /* Options: * MDI/MDI-X = 0 (default) * 0 - Auto for all speeds * 1 - MDI mode @@ -1077,7 +1055,7 @@ static s32 e1000_copper_link_setup_gg825 */ ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_SPEC_CTRL, &data); if (ret_val) - goto out; + return ret_val; data &= ~GG82563_PSCR_CROSSOVER_MODE_MASK; @@ -1094,8 +1072,7 @@ static s32 e1000_copper_link_setup_gg825 break; } - /* - * Options: + /* Options: * disable_polarity_correction = 0 (default) * Automatic Correction for Reversed Cable Polarity * 0 - Disabled @@ -1107,90 +1084,86 @@ static s32 e1000_copper_link_setup_gg825 ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_SPEC_CTRL, data); if (ret_val) - goto out; + return ret_val; /* SW Reset the PHY so all changes take effect */ ret_val = hw->phy.ops.commit(hw); if (ret_val) { DEBUGOUT("Error Resetting the PHY\n"); - goto out; + return ret_val; } /* Bypass Rx and Tx FIFO's */ - ret_val = e1000_write_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL, - E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS | - E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS); + reg = E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL; + data = (E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS | + E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS); + ret_val = e1000_write_kmrn_reg_80003es2lan(hw, reg, data); if (ret_val) - goto out; + return ret_val; - ret_val = e1000_read_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE, &data); + reg = E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE; + ret_val = e1000_read_kmrn_reg_80003es2lan(hw, reg, &data); if (ret_val) - goto out; + return ret_val; data |= E1000_KMRNCTRLSTA_OPMODE_E_IDLE; - ret_val = e1000_write_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE, data); + ret_val = e1000_write_kmrn_reg_80003es2lan(hw, reg, data); if (ret_val) - goto out; + return ret_val; ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_SPEC_CTRL_2, &data); if (ret_val) - goto out; + return ret_val; data &= ~GG82563_PSCR2_REVERSE_AUTO_NEG; ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_SPEC_CTRL_2, data); if (ret_val) - goto out; + return ret_val; - ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); - ctrl_ext &= ~(E1000_CTRL_EXT_LINK_MODE_MASK); - E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); + reg = E1000_READ_REG(hw, E1000_CTRL_EXT); + reg &= ~E1000_CTRL_EXT_LINK_MODE_MASK; + E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg); ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_PWR_MGMT_CTRL, &data); if (ret_val) - goto out; + return ret_val; - /* - * Do not init these registers when the HW is in IAMT mode, since the + /* Do not init these registers when the HW is in IAMT mode, since the * firmware will have already initialized them. We only initialize * them if the HW is not in IAMT mode. */ - if (!(hw->mac.ops.check_mng_mode(hw))) { + if (!hw->mac.ops.check_mng_mode(hw)) { /* Enable Electrical Idle on the PHY */ data |= GG82563_PMCR_ENABLE_ELECTRICAL_IDLE; ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_PWR_MGMT_CTRL, data); if (ret_val) - goto out; + return ret_val; ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, &data); if (ret_val) - goto out; + return ret_val; data &= ~GG82563_KMCR_PASS_FALSE_CARRIER; ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, data); if (ret_val) - goto out; + return ret_val; } - /* - * Workaround: Disable padding in Kumeran interface in the MAC + /* Workaround: Disable padding in Kumeran interface in the MAC * and in the PHY to avoid CRC errors. */ ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_INBAND_CTRL, &data); if (ret_val) - goto out; + return ret_val; data |= GG82563_ICR_DIS_PADDING; ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_INBAND_CTRL, data); if (ret_val) - goto out; + return ret_val; -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -1213,42 +1186,42 @@ static s32 e1000_setup_copper_link_80003 ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); E1000_WRITE_REG(hw, E1000_CTRL, ctrl); - /* - * Set the mac to wait the maximum time between each + /* Set the mac to wait the maximum time between each * iteration and increase the max iterations when * polling the phy; this fixes erroneous timeouts at 10Mbps. */ ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 4), 0xFFFF); if (ret_val) - goto out; + return ret_val; ret_val = e1000_read_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9), ®_data); if (ret_val) - goto out; + return ret_val; reg_data |= 0x3F; ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9), reg_data); if (ret_val) - goto out; - ret_val = e1000_read_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET_INB_CTRL, ®_data); + return ret_val; + ret_val = + e1000_read_kmrn_reg_80003es2lan(hw, + E1000_KMRNCTRLSTA_OFFSET_INB_CTRL, + ®_data); if (ret_val) - goto out; + return ret_val; reg_data |= E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING; - ret_val = e1000_write_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET_INB_CTRL, reg_data); + ret_val = + e1000_write_kmrn_reg_80003es2lan(hw, + E1000_KMRNCTRLSTA_OFFSET_INB_CTRL, + reg_data); if (ret_val) - goto out; + return ret_val; ret_val = e1000_copper_link_setup_gg82563_80003es2lan(hw); 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); } /** @@ -1271,7 +1244,7 @@ static s32 e1000_cfg_on_link_up_80003es2 ret_val = e1000_get_speed_and_duplex_copper_generic(hw, &speed, &duplex); if (ret_val) - goto out; + return ret_val; if (speed == SPEED_1000) ret_val = e1000_cfg_kmrn_1000_80003es2lan(hw); @@ -1279,7 +1252,6 @@ static s32 e1000_cfg_on_link_up_80003es2 ret_val = e1000_cfg_kmrn_10_100_80003es2lan(hw, duplex); } -out: return ret_val; } @@ -1293,7 +1265,7 @@ out: **/ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u32 tipg; u32 i = 0; u16 reg_data, reg_data2; @@ -1301,11 +1273,12 @@ static s32 e1000_cfg_kmrn_10_100_80003es DEBUGFUNC("e1000_configure_kmrn_for_10_100"); reg_data = E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT; - ret_val = e1000_write_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET_HD_CTRL, - reg_data); + ret_val = + e1000_write_kmrn_reg_80003es2lan(hw, + E1000_KMRNCTRLSTA_OFFSET_HD_CTRL, + reg_data); if (ret_val) - goto out; + return ret_val; /* Configure Transmit Inter-Packet Gap */ tipg = E1000_READ_REG(hw, E1000_TIPG); @@ -1317,12 +1290,12 @@ static s32 e1000_cfg_kmrn_10_100_80003es ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, ®_data); if (ret_val) - goto out; + return ret_val; ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, ®_data2); if (ret_val) - goto out; + return ret_val; i++; } while ((reg_data != reg_data2) && (i < GG82563_MAX_KMRN_RETRY)); @@ -1331,11 +1304,7 @@ static s32 e1000_cfg_kmrn_10_100_80003es else reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER; - ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, - reg_data); - -out: - return ret_val; + return hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data); } /** @@ -1347,7 +1316,7 @@ out: **/ static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 reg_data, reg_data2; u32 tipg; u32 i = 0; @@ -1355,10 +1324,12 @@ static s32 e1000_cfg_kmrn_1000_80003es2l DEBUGFUNC("e1000_configure_kmrn_for_1000"); reg_data = E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT; - ret_val = e1000_write_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET_HD_CTRL, reg_data); + ret_val = + e1000_write_kmrn_reg_80003es2lan(hw, + E1000_KMRNCTRLSTA_OFFSET_HD_CTRL, + reg_data); if (ret_val) - goto out; + return ret_val; /* Configure Transmit Inter-Packet Gap */ tipg = E1000_READ_REG(hw, E1000_TIPG); @@ -1370,21 +1341,18 @@ static s32 e1000_cfg_kmrn_1000_80003es2l ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, ®_data); if (ret_val) - goto out; + return ret_val; ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, ®_data2); if (ret_val) - goto out; + return ret_val; i++; } while ((reg_data != reg_data2) && (i < GG82563_MAX_KMRN_RETRY)); reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER; - ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, - reg_data); -out: - return ret_val; + return hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data); } /** @@ -1401,13 +1369,13 @@ static s32 e1000_read_kmrn_reg_80003es2l u16 *data) { u32 kmrnctrlsta; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("e1000_read_kmrn_reg_80003es2lan"); ret_val = e1000_acquire_mac_csr_80003es2lan(hw); if (ret_val) - goto out; + return ret_val; kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) & E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN; @@ -1421,7 +1389,6 @@ static s32 e1000_read_kmrn_reg_80003es2l e1000_release_mac_csr_80003es2lan(hw); -out: return ret_val; } @@ -1439,13 +1406,13 @@ static s32 e1000_write_kmrn_reg_80003es2 u16 data) { u32 kmrnctrlsta; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("e1000_write_kmrn_reg_80003es2lan"); ret_val = e1000_acquire_mac_csr_80003es2lan(hw); if (ret_val) - goto out; + return ret_val; kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) & E1000_KMRNCTRLSTA_OFFSET) | data; @@ -1456,7 +1423,6 @@ static s32 e1000_write_kmrn_reg_80003es2 e1000_release_mac_csr_80003es2lan(hw); -out: return ret_val; } @@ -1466,23 +1432,19 @@ out: **/ static s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("e1000_read_mac_addr_80003es2lan"); - /* - * If there's an alternate MAC address place it in RAR0 + /* If there's an alternate MAC address place it in RAR0 * so that it will override the Si installed default perm * address. */ ret_val = e1000_check_alt_mac_addr_generic(hw); if (ret_val) - goto out; - - ret_val = e1000_read_mac_addr_generic(hw); + return ret_val; -out: - return ret_val; + return e1000_read_mac_addr_generic(hw); } /** Modified: head/sys/dev/e1000/e1000_80003es2lan.h ============================================================================== --- head/sys/dev/e1000/e1000_80003es2lan.h Wed Oct 9 17:07:50 2013 (r256199) +++ head/sys/dev/e1000/e1000_80003es2lan.h Wed Oct 9 17:32:52 2013 (r256200) @@ -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 @@ -51,34 +51,32 @@ #define E1000_KMRNCTRLSTA_OPMODE_MASK 0x000C #define E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO 0x0004 -#define E1000_TCTL_EXT_GCEX_MASK 0x000FFC00 /* Gigabit Carry Extend Padding */ +#define E1000_TCTL_EXT_GCEX_MASK 0x000FFC00 /* Gig Carry Extend Padding */ #define DEFAULT_TCTL_EXT_GCEX_80003ES2LAN 0x00010000 #define DEFAULT_TIPG_IPGT_1000_80003ES2LAN 0x8 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 17:34:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7BE93F9A; Wed, 9 Oct 2013 17:34:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 513D72835; Wed, 9 Oct 2013 17:34:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99HYknE016560; Wed, 9 Oct 2013 17:34:46 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99HYkML016559; Wed, 9 Oct 2013 17:34:46 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310091734.r99HYkML016559@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 9 Oct 2013 17:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256201 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 17:34:46 -0000 Author: trasz Date: Wed Oct 9 17:34:45 2013 New Revision: 256201 URL: http://svnweb.freebsd.org/changeset/base/256201 Log: Remove no longer useful debugging output and a stale comment. Approved by: re (gjb) Sponsored by: FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Oct 9 17:32:52 2013 (r256200) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Oct 9 17:34:45 2013 (r256201) @@ -229,8 +229,6 @@ cfiscsi_pdu_update_cmdsn(const struct ic /* * The target MUST silently ignore any non-immediate command outside * of this range. - * - * XXX: ... or non-immediate duplicates within the range. */ if (cmdsn < cs->cs_cmdsn || cmdsn > cs->cs_cmdsn + maxcmdsn_delta) { CFISCSI_SESSION_UNLOCK(cs); @@ -720,10 +718,6 @@ cfiscsi_handle_data_segment(struct icl_p ctl_sglist->len = io->scsiio.kern_data_len; ctl_sg_count = 1; } -#if 0 - if (ctl_sg_count > 1) - CFISCSI_SESSION_DEBUG(cs, "ctl_sg_count = %d", ctl_sg_count); -#endif if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) == ISCSI_BHS_OPCODE_SCSI_DATA_OUT) @@ -2340,11 +2334,6 @@ cfiscsi_datamove_in(union ctl_io *io) */ PDU_TOTAL_TRANSFER_LEN(request) = io->scsiio.kern_total_len; -#if 0 - if (ctl_sg_count > 1) - CFISCSI_SESSION_DEBUG(cs, "ctl_sg_count = %d", ctl_sg_count); -#endif - /* * This is the offset within the current SCSI command; * i.e. for the first call of datamove(), it will be 0, @@ -2352,8 +2341,6 @@ cfiscsi_datamove_in(union ctl_io *io) * of previous ones. */ off = htonl(io->scsiio.kern_rel_offset); - if (off > 1) - CFISCSI_SESSION_DEBUG(cs, "off = %zd", off); i = 0; addr = NULL; @@ -2445,10 +2432,12 @@ cfiscsi_datamove_in(union ctl_io *io) if (response != NULL) { if (off == io->scsiio.kern_total_len) { bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; +#if 0 } else { CFISCSI_SESSION_DEBUG(cs, "not setting the F flag; " "have %zd, need %zd", off, (size_t)io->scsiio.kern_total_len); +#endif } KASSERT(response->ip_data_len > 0, ("sending empty Data-In")); cfiscsi_pdu_queue(response); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 18:14:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3515FF65; Wed, 9 Oct 2013 18:14:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 080812ADC; Wed, 9 Oct 2013 18:14:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99IETES037692; Wed, 9 Oct 2013 18:14:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99IETSl037669; Wed, 9 Oct 2013 18:14:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091814.r99IETSl037669@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 18:14: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: r256206 - stable/9/sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 18:14:30 -0000 Author: mav Date: Wed Oct 9 18:14:28 2013 New Revision: 256206 URL: http://svnweb.freebsd.org/changeset/base/256206 Log: MFC r250395 (by attilio / jeff): Generalize the bitset operations, present in cpuset and offer a KPI to redefine such operations for different consumers. This will be used when NUMA support will be finished and numaset will need to be used. Added: stable/9/sys/sys/_bitset.h - copied unchanged from r250395, head/sys/sys/_bitset.h stable/9/sys/sys/bitset.h - copied unchanged from r250395, head/sys/sys/bitset.h Modified: stable/9/sys/sys/_cpuset.h stable/9/sys/sys/cpuset.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Copied: stable/9/sys/sys/_bitset.h (from r250395, head/sys/sys/_bitset.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/sys/_bitset.h Wed Oct 9 18:14:28 2013 (r256206, copy of r250395, head/sys/sys/_bitset.h) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2008, Jeffrey Roberson + * All rights reserved. + * + * Copyright (c) 2008 Nokia Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS__BITSET_H_ +#define _SYS__BITSET_H_ + +/* + * Macros addressing word and bit within it, tuned to make compiler + * optimize cases when SETSIZE fits into single machine word. + */ +#define _BITSET_BITS (sizeof(long) * NBBY) + +#define __bitset_words(_s) (howmany(_s, _BITSET_BITS)) + +#define __bitset_mask(_s, n) \ + (1L << ((__bitset_words((_s)) == 1) ? \ + (__size_t)(n) : ((n) % _BITSET_BITS))) + +#define __bitset_word(_s, n) \ + ((__bitset_words((_s)) == 1) ? 0 : ((n) / _BITSET_BITS)) + +#define BITSET_DEFINE(t, _s) \ +struct t { \ + long __bits[__bitset_words((_s))]; \ +}; + +#define BITSET_T_INITIALIZER(x) \ + { .__bits = { x } } + +#define BITSET_FSET(n) \ + [ 0 ... ((n) - 1) ] = (-1L) + +#endif /* !_SYS__BITSET_H_ */ Modified: stable/9/sys/sys/_cpuset.h ============================================================================== --- stable/9/sys/sys/_cpuset.h Wed Oct 9 18:11:15 2013 (r256205) +++ stable/9/sys/sys/_cpuset.h Wed Oct 9 18:14:28 2013 (r256206) @@ -32,6 +32,8 @@ #ifndef _SYS__CPUSET_H_ #define _SYS__CPUSET_H_ +#include + #ifdef _KERNEL #define CPU_SETSIZE MAXCPU #endif @@ -42,11 +44,13 @@ #define CPU_SETSIZE CPU_MAXSIZE #endif -#define _NCPUBITS (sizeof(long) * NBBY) /* bits per mask */ -#define _NCPUWORDS howmany(CPU_SETSIZE, _NCPUBITS) +#define _NCPUBITS _BITSET_BITS +#define _NCPUWORDS __bitset_words(CPU_SETSIZE) + +BITSET_DEFINE(_cpuset, CPU_SETSIZE); +typedef struct _cpuset cpuset_t; -typedef struct _cpuset { - long __bits[howmany(CPU_SETSIZE, _NCPUBITS)]; -} cpuset_t; +#define CPUSET_FSET BITSET_FSET(_NCPUWORDS) +#define CPUSET_T_INITIALIZER BITSET_T_INITIALIZER #endif /* !_SYS__CPUSET_H_ */ Copied: stable/9/sys/sys/bitset.h (from r250395, head/sys/sys/bitset.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/sys/bitset.h Wed Oct 9 18:14:28 2013 (r256206, copy of r250395, head/sys/sys/bitset.h) @@ -0,0 +1,153 @@ +/*- + * Copyright (c) 2008, Jeffrey Roberson + * All rights reserved. + * + * Copyright (c) 2008 Nokia Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_BITSET_H_ +#define _SYS_BITSET_H_ + +#define BIT_CLR(_s, n, p) \ + ((p)->__bits[__bitset_word(_s, n)] &= ~__bitset_mask((_s), (n))) + +#define BIT_COPY(_s, f, t) (void)(*(t) = *(f)) + +#define BIT_ISSET(_s, n, p) \ + ((((p)->__bits[__bitset_word(_s, n)] & __bitset_mask((_s), (n))) != 0)) + +#define BIT_SET(_s, n, p) \ + ((p)->__bits[__bitset_word(_s, n)] |= __bitset_mask((_s), (n))) + +#define BIT_ZERO(_s, p) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + (p)->__bits[__i] = 0L; \ +} while (0) + +#define BIT_FILL(_s, p) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + (p)->__bits[__i] = -1L; \ +} while (0) + +#define BIT_SETOF(_s, n, p) do { \ + BIT_ZERO(_s, p); \ + (p)->__bits[__bitset_word(_s, n)] = __bitset_mask((_s), (n)); \ +} while (0) + +/* Is p empty. */ +#define BIT_EMPTY(_s, p) __extension__ ({ \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + if ((p)->__bits[__i]) \ + break; \ + __i == __bitset_words((_s)); \ +}) + +/* Is p full set. */ +#define BIT_ISFULLSET(_s, p) __extension__ ({ \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + if ((p)->__bits[__i] != (long)-1) \ + break; \ + __i == __bitset_words((_s)); \ +}) + +/* Is c a subset of p. */ +#define BIT_SUBSET(_s, p, c) __extension__ ({ \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + if (((c)->__bits[__i] & \ + (p)->__bits[__i]) != \ + (c)->__bits[__i]) \ + break; \ + __i == __bitset_words((_s)); \ +}) + +/* Are there any common bits between b & c? */ +#define BIT_OVERLAP(_s, p, c) __extension__ ({ \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + if (((c)->__bits[__i] & \ + (p)->__bits[__i]) != 0) \ + break; \ + __i != __bitset_words((_s)); \ +}) + +/* Compare two sets, returns 0 if equal 1 otherwise. */ +#define BIT_CMP(_s, p, c) __extension__ ({ \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + if (((c)->__bits[__i] != \ + (p)->__bits[__i])) \ + break; \ + __i != __bitset_words((_s)); \ +}) + +#define BIT_OR(_s, d, s) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + (d)->__bits[__i] |= (s)->__bits[__i]; \ +} while (0) + +#define BIT_AND(_s, d, s) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + (d)->__bits[__i] &= (s)->__bits[__i]; \ +} while (0) + +#define BIT_NAND(_s, d, s) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + (d)->__bits[__i] &= ~(s)->__bits[__i]; \ +} while (0) + +#define BIT_CLR_ATOMIC(_s, n, p) \ + atomic_clear_long(&(p)->__bits[__bitset_word(_s, n)], \ + __bitset_mask((_s), n)) + +#define BIT_SET_ATOMIC(_s, n, p) \ + atomic_set_long(&(p)->__bits[__bitset_word(_s, n)], \ + __bitset_mask((_s), n)) + +/* Convenience functions catering special cases. */ +#define BIT_OR_ATOMIC(_s, d, s) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + atomic_set_long(&(d)->__bits[__i], \ + (s)->__bits[__i]); \ +} while (0) + +#define BIT_COPY_STORE_REL(_s, f, t) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + atomic_store_rel_long(&(t)->__bits[__i], \ + (f)->__bits[__i]); \ +} while (0) + +#endif /* !_SYS_BITSET_H_ */ Modified: stable/9/sys/sys/cpuset.h ============================================================================== --- stable/9/sys/sys/cpuset.h Wed Oct 9 18:11:15 2013 (r256205) +++ stable/9/sys/sys/cpuset.h Wed Oct 9 18:14:28 2013 (r256206) @@ -34,124 +34,29 @@ #include +#include + #define CPUSETBUFSIZ ((2 + sizeof(long) * 2) * _NCPUWORDS) -/* - * Macros addressing word and bit within it, tuned to make compiler - * optimize cases when CPU_SETSIZE fits into single machine word. - */ -#define __cpuset_mask(n) \ - ((long)1 << ((_NCPUWORDS == 1) ? (__size_t)(n) : ((n) % _NCPUBITS))) -#define __cpuset_word(n) ((_NCPUWORDS == 1) ? 0 : ((n) / _NCPUBITS)) - -#define CPU_CLR(n, p) ((p)->__bits[__cpuset_word(n)] &= ~__cpuset_mask(n)) -#define CPU_COPY(f, t) (void)(*(t) = *(f)) -#define CPU_ISSET(n, p) (((p)->__bits[__cpuset_word(n)] & __cpuset_mask(n)) != 0) -#define CPU_SET(n, p) ((p)->__bits[__cpuset_word(n)] |= __cpuset_mask(n)) -#define CPU_ZERO(p) do { \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - (p)->__bits[__i] = 0; \ -} while (0) - -#define CPU_FILL(p) do { \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - (p)->__bits[__i] = -1; \ -} while (0) - -#define CPU_SETOF(n, p) do { \ - CPU_ZERO(p); \ - ((p)->__bits[__cpuset_word(n)] = __cpuset_mask(n)); \ -} while (0) - -/* Is p empty. */ -#define CPU_EMPTY(p) __extension__ ({ \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - if ((p)->__bits[__i]) \ - break; \ - __i == _NCPUWORDS; \ -}) - -/* Is p full set. */ -#define CPU_ISFULLSET(p) __extension__ ({ \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - if ((p)->__bits[__i] != (long)-1) \ - break; \ - __i == _NCPUWORDS; \ -}) - -/* Is c a subset of p. */ -#define CPU_SUBSET(p, c) __extension__ ({ \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - if (((c)->__bits[__i] & \ - (p)->__bits[__i]) != \ - (c)->__bits[__i]) \ - break; \ - __i == _NCPUWORDS; \ -}) - -/* Are there any common bits between b & c? */ -#define CPU_OVERLAP(p, c) __extension__ ({ \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - if (((c)->__bits[__i] & \ - (p)->__bits[__i]) != 0) \ - break; \ - __i != _NCPUWORDS; \ -}) - -/* Compare two sets, returns 0 if equal 1 otherwise. */ -#define CPU_CMP(p, c) __extension__ ({ \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - if (((c)->__bits[__i] != \ - (p)->__bits[__i])) \ - break; \ - __i != _NCPUWORDS; \ -}) - -#define CPU_OR(d, s) do { \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - (d)->__bits[__i] |= (s)->__bits[__i]; \ -} while (0) - -#define CPU_AND(d, s) do { \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - (d)->__bits[__i] &= (s)->__bits[__i]; \ -} while (0) - -#define CPU_NAND(d, s) do { \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - (d)->__bits[__i] &= ~(s)->__bits[__i]; \ -} while (0) - -#define CPU_CLR_ATOMIC(n, p) \ - atomic_clear_long(&(p)->__bits[__cpuset_word(n)], __cpuset_mask(n)) - -#define CPU_SET_ATOMIC(n, p) \ - atomic_set_long(&(p)->__bits[__cpuset_word(n)], __cpuset_mask(n)) - -/* Convenience functions catering special cases. */ -#define CPU_OR_ATOMIC(d, s) do { \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - atomic_set_long(&(d)->__bits[__i], \ - (s)->__bits[__i]); \ -} while (0) - -#define CPU_COPY_STORE_REL(f, t) do { \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - atomic_store_rel_long(&(t)->__bits[__i], \ - (f)->__bits[__i]); \ -} while (0) +#define CPU_CLR(n, p) BIT_CLR(CPU_SETSIZE, n, p) +#define CPU_COPY(f, t) BIT_COPY(CPU_SETSIZE, f, t) +#define CPU_ISSET(n, p) BIT_ISSET(CPU_SETSIZE, n, p) +#define CPU_SET(n, p) BIT_SET(CPU_SETSIZE, n, p) +#define CPU_ZERO(p) BIT_ZERO(CPU_SETSIZE, p) +#define CPU_FILL(p) BIT_FILL(CPU_SETSIZE, p) +#define CPU_SETOF(n, p) BIT_SETOF(CPU_SETSIZE, n, p) +#define CPU_EMPTY(p) BIT_EMPTY(CPU_SETSIZE, p) +#define CPU_ISFULLSET(p) BIT_ISFULLSET(CPU_SETSIZE, p) +#define CPU_SUBSET(p, c) BIT_SUBSET(CPU_SETSIZE, p, c) +#define CPU_OVERLAP(p, c) BIT_OVERLAP(CPU_SETSIZE, p, c) +#define CPU_CMP(p, c) BIT_CMP(CPU_SETSIZE, p, c) +#define CPU_OR(d, s) BIT_OR(CPU_SETSIZE, d, s) +#define CPU_AND(d, s) BIT_AND(CPU_SETSIZE, d, s) +#define CPU_NAND(d, s) BIT_NAND(CPU_SETSIZE, d, s) +#define CPU_CLR_ATOMIC(n, p) BIT_CLR_ATOMIC(CPU_SETSIZE, n, p) +#define CPU_SET_ATOMIC(n, p) BIT_SET_ATOMIC(CPU_SETSIZE, n, p) +#define CPU_OR_ATOMIC(d, s) BIT_OR_ATOMIC(CPU_SETSIZE, d, s) +#define CPU_COPY_STORE_REL(f, t) BIT_COPY_STORE_REL(CPU_SETSIZE, f, t) /* * Valid cpulevel_t values. From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 18:23:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 54D8E3B3; Wed, 9 Oct 2013 18:23:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 403522B5B; Wed, 9 Oct 2013 18:23:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99INWaS043032; Wed, 9 Oct 2013 18:23:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99INUMG043021; Wed, 9 Oct 2013 18:23:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091823.r99INUMG043021@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 18:23: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: r256207 - in stable/9/sys: amd64/amd64 i386/i386 i386/xen mips/mips sparc64/sparc64 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: Wed, 09 Oct 2013 18:23:32 -0000 Author: mav Date: Wed Oct 9 18:23:30 2013 New Revision: 256207 URL: http://svnweb.freebsd.org/changeset/base/256207 Log: MFC r251703 (by attilio): - Add a BIT_FFS() macro and use it to replace cpusetffs_obj() Modified: stable/9/sys/amd64/amd64/mp_machdep.c stable/9/sys/i386/i386/mp_machdep.c stable/9/sys/i386/i386/pmap.c stable/9/sys/i386/xen/mp_machdep.c stable/9/sys/i386/xen/pmap.c stable/9/sys/mips/mips/mp_machdep.c stable/9/sys/sparc64/sparc64/mp_machdep.c stable/9/sys/sys/bitset.h stable/9/sys/sys/cpuset.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/mp_machdep.c Wed Oct 9 18:14:28 2013 (r256206) +++ stable/9/sys/amd64/amd64/mp_machdep.c Wed Oct 9 18:23:30 2013 (r256207) @@ -1151,7 +1151,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask ipi_all_but_self(vector); } else { ncpu = 0; - while ((cpu = cpusetobj_ffs(&mask)) != 0) { + while ((cpu = CPU_FFS(&mask)) != 0) { cpu--; CPU_CLR(cpu, &mask); CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, @@ -1300,7 +1300,7 @@ ipi_selected(cpuset_t cpus, u_int ipi) if (ipi == IPI_STOP_HARD) CPU_OR_ATOMIC(&ipi_nmi_pending, &cpus); - while ((cpu = cpusetobj_ffs(&cpus)) != 0) { + while ((cpu = CPU_FFS(&cpus)) != 0) { cpu--; CPU_CLR(cpu, &cpus); CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi); Modified: stable/9/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/9/sys/i386/i386/mp_machdep.c Wed Oct 9 18:14:28 2013 (r256206) +++ stable/9/sys/i386/i386/mp_machdep.c Wed Oct 9 18:23:30 2013 (r256207) @@ -1256,7 +1256,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask ipi_all_but_self(vector); } else { ncpu = 0; - while ((cpu = cpusetobj_ffs(&mask)) != 0) { + while ((cpu = CPU_FFS(&mask)) != 0) { cpu--; CPU_CLR(cpu, &mask); CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, @@ -1405,7 +1405,7 @@ ipi_selected(cpuset_t cpus, u_int ipi) if (ipi == IPI_STOP_HARD) CPU_OR_ATOMIC(&ipi_nmi_pending, &cpus); - while ((cpu = cpusetobj_ffs(&cpus)) != 0) { + while ((cpu = CPU_FFS(&cpus)) != 0) { cpu--; CPU_CLR(cpu, &cpus); CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi); Modified: stable/9/sys/i386/i386/pmap.c ============================================================================== --- stable/9/sys/i386/i386/pmap.c Wed Oct 9 18:14:28 2013 (r256206) +++ stable/9/sys/i386/i386/pmap.c Wed Oct 9 18:23:30 2013 (r256207) @@ -2007,7 +2007,7 @@ pmap_lazyfix(pmap_t pmap) spins = 50000000; /* Find least significant set bit. */ - lsb = cpusetobj_ffs(&mask); + lsb = CPU_FFS(&mask); MPASS(lsb != 0); lsb--; CPU_SETOF(lsb, &mask); Modified: stable/9/sys/i386/xen/mp_machdep.c ============================================================================== --- stable/9/sys/i386/xen/mp_machdep.c Wed Oct 9 18:14:28 2013 (r256206) +++ stable/9/sys/i386/xen/mp_machdep.c Wed Oct 9 18:23:30 2013 (r256207) @@ -1038,7 +1038,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask ipi_all_but_self(vector); } else { ncpu = 0; - while ((cpu = cpusetobj_ffs(&mask)) != 0) { + while ((cpu = CPU_FFS(&mask)) != 0) { cpu--; CPU_CLR(cpu, &mask); CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, @@ -1131,7 +1131,7 @@ ipi_selected(cpuset_t cpus, u_int ipi) if (ipi == IPI_STOP_HARD) CPU_OR_ATOMIC(&ipi_nmi_pending, &cpus); - while ((cpu = cpusetobj_ffs(&cpus)) != 0) { + while ((cpu = CPU_FFS(&cpus)) != 0) { cpu--; CPU_CLR(cpu, &cpus); CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi); Modified: stable/9/sys/i386/xen/pmap.c ============================================================================== --- stable/9/sys/i386/xen/pmap.c Wed Oct 9 18:14:28 2013 (r256206) +++ stable/9/sys/i386/xen/pmap.c Wed Oct 9 18:23:30 2013 (r256207) @@ -1702,7 +1702,7 @@ pmap_lazyfix(pmap_t pmap) spins = 50000000; /* Find least significant set bit. */ - lsb = cpusetobj_ffs(&mask); + lsb = CPU_FFS(&mask); MPASS(lsb != 0); lsb--; CPU_SETOF(lsb, &mask); Modified: stable/9/sys/mips/mips/mp_machdep.c ============================================================================== --- stable/9/sys/mips/mips/mp_machdep.c Wed Oct 9 18:14:28 2013 (r256206) +++ stable/9/sys/mips/mips/mp_machdep.c Wed Oct 9 18:23:30 2013 (r256207) @@ -208,7 +208,7 @@ cpu_mp_setmaxid(void) platform_cpu_mask(&cpumask); mp_ncpus = 0; last = 1; - while ((cpu = cpusetobj_ffs(&cpumask)) != 0) { + while ((cpu = CPU_FFS(&cpumask)) != 0) { last = cpu; cpu--; CPU_CLR(cpu, &cpumask); @@ -251,7 +251,7 @@ cpu_mp_start(void) platform_cpu_mask(&cpumask); while (!CPU_EMPTY(&cpumask)) { - cpuid = cpusetobj_ffs(&cpumask) - 1; + cpuid = CPU_FFS(&cpumask) - 1; CPU_CLR(cpuid, &cpumask); if (cpuid >= MAXCPU) { Modified: stable/9/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/9/sys/sparc64/sparc64/mp_machdep.c Wed Oct 9 18:14:28 2013 (r256206) +++ stable/9/sys/sparc64/sparc64/mp_machdep.c Wed Oct 9 18:23:30 2013 (r256207) @@ -557,7 +557,7 @@ spitfire_ipi_selected(cpuset_t cpus, u_l { u_int cpu; - while ((cpu = cpusetobj_ffs(&cpus)) != 0) { + while ((cpu = CPU_FFS(&cpus)) != 0) { cpu--; CPU_CLR(cpu, &cpus); spitfire_ipi_single(cpu, d0, d1, d2); Modified: stable/9/sys/sys/bitset.h ============================================================================== --- stable/9/sys/sys/bitset.h Wed Oct 9 18:14:28 2013 (r256206) +++ stable/9/sys/sys/bitset.h Wed Oct 9 18:23:30 2013 (r256207) @@ -150,4 +150,19 @@ (f)->__bits[__i]); \ } while (0) +#define BIT_FFS(_s, p) __extension__ ({ \ + __size_t __i; \ + int __bit; \ + \ + __bit = 0; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) { \ + if ((p)->__bits[__i] != 0) { \ + __bit = ffsl((p)->__bits[__i]); \ + __bit += __i * _BITSET_BITS; \ + break; \ + } \ + } \ + __bit; \ +}) + #endif /* !_SYS_BITSET_H_ */ Modified: stable/9/sys/sys/cpuset.h ============================================================================== --- stable/9/sys/sys/cpuset.h Wed Oct 9 18:14:28 2013 (r256206) +++ stable/9/sys/sys/cpuset.h Wed Oct 9 18:23:30 2013 (r256207) @@ -57,6 +57,7 @@ #define CPU_SET_ATOMIC(n, p) BIT_SET_ATOMIC(CPU_SETSIZE, n, p) #define CPU_OR_ATOMIC(d, s) BIT_OR_ATOMIC(CPU_SETSIZE, d, s) #define CPU_COPY_STORE_REL(f, t) BIT_COPY_STORE_REL(CPU_SETSIZE, f, t) +#define CPU_FFS(p) BIT_FFS(CPU_SETSIZE, p) /* * Valid cpulevel_t values. From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 18:29:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1D6A267A; Wed, 9 Oct 2013 18:29:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A6362B9E; Wed, 9 Oct 2013 18:29:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99IT6ip044611; Wed, 9 Oct 2013 18:29:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99IT6Q6044609; Wed, 9 Oct 2013 18:29:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091829.r99IT6Q6044609@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 18:29: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: r256208 - 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, 09 Oct 2013 18:29:07 -0000 Author: mav Date: Wed Oct 9 18:29:06 2013 New Revision: 256208 URL: http://svnweb.freebsd.org/changeset/base/256208 Log: MFC r255363: Micro-optimize cpu_search(), allowing compiler to use more efficient inline ffsl() implementation, when it is available, instead of homegrown iteration. On dual-E5645 amd64 system (2x6x2 cores) under heavy I/O load that reduces time spent inside cpu_search() from 19% to 13%, while IOPS increased by 5%. Modified: stable/9/sys/kern/sched_ule.c Modified: stable/9/sys/kern/sched_ule.c ============================================================================== --- stable/9/sys/kern/sched_ule.c Wed Oct 9 18:23:30 2013 (r256207) +++ stable/9/sys/kern/sched_ule.c Wed Oct 9 18:29:06 2013 (r256208) @@ -632,10 +632,14 @@ cpu_search(const struct cpu_group *cg, s } /* Iterate through the child CPU groups and then remaining CPUs. */ - for (i = cg->cg_children, cpu = mp_maxid; i >= 0; ) { + for (i = cg->cg_children, cpu = mp_maxid; ; ) { if (i == 0) { +#ifdef HAVE_INLINE_FFSL + cpu = CPU_FFS(&cpumask) - 1; +#else while (cpu >= 0 && !CPU_ISSET(cpu, &cpumask)) cpu--; +#endif if (cpu < 0) break; child = NULL; @@ -660,6 +664,7 @@ cpu_search(const struct cpu_group *cg, s break; } } else { /* Handle child CPU. */ + CPU_CLR(cpu, &cpumask); tdq = TDQ_CPU(cpu); load = tdq->tdq_load * 256; rndptr = DPCPU_PTR(randomval); @@ -707,8 +712,11 @@ cpu_search(const struct cpu_group *cg, s i--; if (i == 0 && CPU_EMPTY(&cpumask)) break; - } else + } +#ifndef HAVE_INLINE_FFSL + else cpu--; +#endif } return (total); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 18:39:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 33250A2B; Wed, 9 Oct 2013 18:39:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 067322C36; Wed, 9 Oct 2013 18:39:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99IdiI2050121; Wed, 9 Oct 2013 18:39:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99IdiVF050120; Wed, 9 Oct 2013 18:39:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310091839.r99IdiVF050120@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 9 Oct 2013 18:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256209 - 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, 09 Oct 2013 18:39:45 -0000 Author: kib Date: Wed Oct 9 18:39:44 2013 New Revision: 256209 URL: http://svnweb.freebsd.org/changeset/base/256209 Log: Reduce code duplication, introduce the getmaxfd() helper to calculate the max filedescriptor index. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (marius) Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Oct 9 18:29:06 2013 (r256208) +++ head/sys/kern/kern_descrip.c Wed Oct 9 18:39:44 2013 (r256209) @@ -129,6 +129,7 @@ static int fill_sem_info(struct file *fp static int fill_shm_info(struct file *fp, struct kinfo_file *kif); static int fill_socket_info(struct socket *so, struct kinfo_file *kif); static int fill_vnode_info(struct vnode *vp, struct kinfo_file *kif); +static int getmaxfd(struct proc *p); /* * Each process has: @@ -771,6 +772,18 @@ kern_fcntl(struct thread *td, int fd, in return (error); } +static int +getmaxfd(struct proc *p) +{ + int maxfd; + + PROC_LOCK(p); + maxfd = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc); + PROC_UNLOCK(p); + + return (maxfd); +} + /* * Common code for dup, dup2, fcntl(F_DUPFD) and fcntl(F_DUP2FD). */ @@ -797,9 +810,7 @@ do_dup(struct thread *td, int flags, int return (EBADF); if (new < 0) return (flags & DUP_FCNTL ? EINVAL : EBADF); - PROC_LOCK(p); - maxfd = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc); - PROC_UNLOCK(p); + maxfd = getmaxfd(p); if (new >= maxfd) return (flags & DUP_FCNTL ? EINVAL : EBADF); @@ -1563,9 +1574,7 @@ fdalloc(struct thread *td, int minfd, in if (fdp->fd_freefile > minfd) minfd = fdp->fd_freefile; - PROC_LOCK(p); - maxfd = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc); - PROC_UNLOCK(p); + maxfd = getmaxfd(p); /* * Search the bitmap for a free descriptor starting at minfd. @@ -1652,9 +1661,7 @@ fdavail(struct thread *td, int n) * call racct_add() from there instead of dealing with containers * here. */ - PROC_LOCK(p); - lim = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc); - PROC_UNLOCK(p); + lim = getmaxfd(p); if ((i = lim - fdp->fd_nfiles) > 0 && (n -= i) <= 0) return (1); last = min(fdp->fd_nfiles, lim); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 18:41:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A98F5B84; Wed, 9 Oct 2013 18:41:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D1042C70; Wed, 9 Oct 2013 18:41:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99IfZgS053167; Wed, 9 Oct 2013 18:41:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99IfZrn053166; Wed, 9 Oct 2013 18:41:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310091841.r99IfZrn053166@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 9 Oct 2013 18:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256210 - 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, 09 Oct 2013 18:41:35 -0000 Author: kib Date: Wed Oct 9 18:41:35 2013 New Revision: 256210 URL: http://svnweb.freebsd.org/changeset/base/256210 Log: When growing the file descriptor table, new larger memory chunk is allocated, but the old table is kept around to handle the case of threads still performing unlocked accesses to it. Grow the table exponentially instead of increasing its size by sizeof(long) * 8 chunks when overflowing. This mode significantly reduces the total memory use for the processes consuming large numbers of the file descriptors which open them one by one. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (marius) Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Oct 9 18:39:44 2013 (r256209) +++ head/sys/kern/kern_descrip.c Wed Oct 9 18:41:35 2013 (r256210) @@ -119,6 +119,7 @@ static int closefp(struct filedesc *fdp, static int fd_first_free(struct filedesc *fdp, int low, int size); static int fd_last_used(struct filedesc *fdp, int size); static void fdgrowtable(struct filedesc *fdp, int nfd); +static void fdgrowtable_exp(struct filedesc *fdp, int nfd); static void fdunused(struct filedesc *fdp, int fd); static void fdused(struct filedesc *fdp, int fd); static int fill_pipe_info(struct pipe *pi, struct kinfo_file *kif); @@ -855,7 +856,7 @@ do_dup(struct thread *td, int flags, int return (EMFILE); } #endif - fdgrowtable(fdp, new + 1); + fdgrowtable_exp(fdp, new + 1); oldfde = &fdp->fd_ofiles[old]; } newfde = &fdp->fd_ofiles[new]; @@ -1478,6 +1479,24 @@ filecaps_validate(const struct filecaps ("%s: ioctls without CAP_IOCTL", func)); } +static void +fdgrowtable_exp(struct filedesc *fdp, int nfd) +{ + int nfd1, maxfd; + + FILEDESC_XLOCK_ASSERT(fdp); + + nfd1 = fdp->fd_nfiles * 2; + if (nfd1 < nfd) + nfd1 = nfd; + maxfd = getmaxfd(curproc); + if (maxfd < nfd1) + nfd1 = maxfd; + KASSERT(nfd <= nfd1, + ("too low nfd1 %d %d %d %d", nfd, fdp->fd_nfiles, maxfd, nfd1)); + fdgrowtable(fdp, nfd1); +} + /* * Grow the file table to accomodate (at least) nfd descriptors. */ @@ -1596,7 +1615,7 @@ fdalloc(struct thread *td, int minfd, in * fd is already equal to first free descriptor >= minfd, so * we only need to grow the table and we are done. */ - fdgrowtable(fdp, allocfd); + fdgrowtable_exp(fdp, allocfd); } /* From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 18:43:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 79892CD5; Wed, 9 Oct 2013 18:43:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 669C02C81; Wed, 9 Oct 2013 18:43:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99IhUIb053739; Wed, 9 Oct 2013 18:43:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99IhUx9053738; Wed, 9 Oct 2013 18:43:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310091843.r99IhUx9053738@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 9 Oct 2013 18:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256211 - 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, 09 Oct 2013 18:43:30 -0000 Author: kib Date: Wed Oct 9 18:43:29 2013 New Revision: 256211 URL: http://svnweb.freebsd.org/changeset/base/256211 Log: Do not flush buffers when the v_object of the passed vnode does not really belong to it. Such vnodes, with the pointers to other vnodes v_objects, are typically instantiated by the bypass filesystems. Invalidating mappings of other vnode pages and the pages is wrong, since reclamation of the upper vnode does not imply that lower vnode is reclaimed too. One of the consequences of the improper reclamation was destruction of the wired mappings of the lower vnode pages, triggering miscellaneous assertions in the VM system. Reported by: John Marshall Tested by: John Marshall , pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (gjb) Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Oct 9 18:41:35 2013 (r256210) +++ head/sys/kern/vfs_subr.c Wed Oct 9 18:43:29 2013 (r256211) @@ -1315,6 +1315,8 @@ vinvalbuf(struct vnode *vp, int flags, i CTR3(KTR_VFS, "%s: vp %p with flags %d", __func__, vp, flags); ASSERT_VOP_LOCKED(vp, "vinvalbuf"); + if (vp->v_object != NULL && vp->v_object->handle != vp) + return (0); return (bufobj_invalbuf(&vp->v_bufobj, flags, slpflag, slptimeo)); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 18:44:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C134BE31; Wed, 9 Oct 2013 18:44:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE36B2C8E; Wed, 9 Oct 2013 18:44:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99Ii57l053926; Wed, 9 Oct 2013 18:44:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99Ii5Pu053925; Wed, 9 Oct 2013 18:44:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091844.r99Ii5Pu053925@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 18:44: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: r256212 - stable/9/sys/cam/ctl 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, 09 Oct 2013 18:44:05 -0000 Author: mav Date: Wed Oct 9 18:44:05 2013 New Revision: 256212 URL: http://svnweb.freebsd.org/changeset/base/256212 Log: MFC r249102 (by trasz): Since the CTL version in FreeBSD does not support High Availability, ctl_is_single should always be set to 1. Make it so. Previously it was always 0, because ctl_isc_start() never got to run. Modified: stable/9/sys/cam/ctl/ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Wed Oct 9 18:43:29 2013 (r256211) +++ stable/9/sys/cam/ctl/ctl.c Wed Oct 9 18:44:05 2013 (r256212) @@ -316,7 +316,7 @@ static struct scsi_control_page control_ static int rcv_sync_msg; static int persis_offset; static uint8_t ctl_pause_rtr; -static int ctl_is_single; +static int ctl_is_single = 1; static int index_to_aps_page; int ctl_disable = 0; From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 18:45:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8EB18F76; Wed, 9 Oct 2013 18:45:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A89D2C9D; Wed, 9 Oct 2013 18:45:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99Ij2QU054154; Wed, 9 Oct 2013 18:45:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99Ij2mu054153; Wed, 9 Oct 2013 18:45:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310091845.r99Ij2mu054153@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 9 Oct 2013 18:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256213 - 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, 09 Oct 2013 18:45:02 -0000 Author: kib Date: Wed Oct 9 18:45:01 2013 New Revision: 256213 URL: http://svnweb.freebsd.org/changeset/base/256213 Log: The device vnodes are often unlocked when bread() or bwrite() is called. This probably should be fixed eventually, but for now it is not needed to try to flush such vnodes from the buffer allocation context. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (gjb) Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Oct 9 18:44:05 2013 (r256212) +++ head/sys/kern/vfs_bio.c Wed Oct 9 18:45:01 2013 (r256213) @@ -2076,7 +2076,8 @@ getnewbuf_bufd_help(struct vnode *vp, in wait = MNT_NOWAIT; mtx_lock(&nblock); while (needsbuffer & flags) { - if (vp != NULL && (td->td_pflags & TDP_BUFNEED) == 0) { + if (vp != NULL && vp->v_type != VCHR && + (td->td_pflags & TDP_BUFNEED) == 0) { mtx_unlock(&nblock); /* From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 18:45:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 28066155; Wed, 9 Oct 2013 18:45:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 14C712CA8; Wed, 9 Oct 2013 18:45:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99Ijg87054302; Wed, 9 Oct 2013 18:45:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99IjgAM054300; Wed, 9 Oct 2013 18:45:42 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091845.r99IjgAM054300@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 18:45: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: r256214 - stable/9/sys/cam/ctl 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, 09 Oct 2013 18:45:43 -0000 Author: mav Date: Wed Oct 9 18:45:42 2013 New Revision: 256214 URL: http://svnweb.freebsd.org/changeset/base/256214 Log: MFC r249256 (by ken): Fix a memory leak that showed up when we delete LUNs. The memory used for the LUN was never freed. ctl.c: Adjust ctl_alloc_lun() to make sure we don't clear the CTL_LUN_MALLOCED flag. Modified: stable/9/sys/cam/ctl/ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Wed Oct 9 18:45:01 2013 (r256213) +++ stable/9/sys/cam/ctl/ctl.c Wed Oct 9 18:45:42 2013 (r256214) @@ -4217,7 +4217,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft { struct ctl_lun *nlun, *lun; struct ctl_frontend *fe; - int lun_number, i; + int lun_number, i, lun_malloced; if (be_lun == NULL) return (EINVAL); @@ -4239,11 +4239,15 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft } if (ctl_lun == NULL) { lun = malloc(sizeof(*lun), M_CTL, M_WAITOK); - lun->flags = CTL_LUN_MALLOCED; - } else + lun_malloced = 1; + } else { + lun_malloced = 0; lun = ctl_lun; + } memset(lun, 0, sizeof(*lun)); + if (lun_malloced) + lun->flags = CTL_LUN_MALLOCED; mtx_lock(&ctl_softc->ctl_lock); /* @@ -4295,7 +4299,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft * The processor LUN is always enabled. Disk LUNs come on line * disabled, and must be enabled by the backend. */ - lun->flags = CTL_LUN_DISABLED; + lun->flags |= CTL_LUN_DISABLED; lun->backend = be_lun->be; be_lun->ctl_lun = lun; be_lun->lun_id = lun_number; From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 18:48:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9B8122A9; Wed, 9 Oct 2013 18:48:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 888642CBE; Wed, 9 Oct 2013 18:48:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99ImAcv055013; Wed, 9 Oct 2013 18:48:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99ImAPH055012; Wed, 9 Oct 2013 18:48:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091848.r99ImAPH055012@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 18:48: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: r256215 - stable/9/sys/cam/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 18:48:10 -0000 Author: mav Date: Wed Oct 9 18:48:10 2013 New Revision: 256215 URL: http://svnweb.freebsd.org/changeset/base/256215 Log: MFC r249438: Use full freeze while PMP does hard reset. This is only cosmetical change. Modified: stable/9/sys/cam/ata/ata_pmp.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/9/sys/cam/ata/ata_pmp.c Wed Oct 9 18:45:42 2013 (r256214) +++ stable/9/sys/cam/ata/ata_pmp.c Wed Oct 9 18:48:10 2013 (r256215) @@ -193,8 +193,7 @@ pmpfreeze(struct cam_periph *periph, int i, 0) == CAM_REQ_CMP) { softc->frozen |= (1 << i); xpt_acquire_device(dpath->device); - cam_freeze_devq_arg(dpath, - RELSIM_RELEASE_RUNLEVEL, CAM_RL_BUS + 1); + cam_freeze_devq(dpath); xpt_free_path(dpath); } } @@ -215,8 +214,7 @@ pmprelease(struct cam_periph *periph, in xpt_path_path_id(periph->path), i, 0) == CAM_REQ_CMP) { softc->frozen &= ~(1 << i); - cam_release_devq(dpath, - RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_BUS + 1, FALSE); + cam_release_devq(dpath, 0, 0, 0, FALSE); xpt_release_device(dpath->device); xpt_free_path(dpath); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 18:58:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BE6996F5; Wed, 9 Oct 2013 18:58:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA1EF2D56; Wed, 9 Oct 2013 18:58:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99IwUOI059877; Wed, 9 Oct 2013 18:58:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99IwSF8059867; Wed, 9 Oct 2013 18:58:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091858.r99IwSF8059867@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 18:58: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: r256216 - in stable/9/sys/cam: . ata ctl 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: Wed, 09 Oct 2013 18:58:30 -0000 Author: mav Date: Wed Oct 9 18:58:28 2013 New Revision: 256216 URL: http://svnweb.freebsd.org/changeset/base/256216 Log: MFC r249466, r249481, r250025: Remove multilevel freezing mechanism, implemented to handle specifics of the ATA/SATA error recovery, when post-reset recovery commands should be allocated when queues are already full of payload requests. Instead of removing frozen CCBs with specified range of priorities from the queue to provide free openings, use simple hack, allowing explicit CCBs over- allocation for requests with priority higher (numerically lower) then CAM_PRIORITY_OOB threshold. Simplify CCB allocation logic by removing SIM-level allocation queue. After that SIM-level queue manages only CCBs execution, while allocation logic is localized within each single device. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/cam.h stable/9/sys/cam/cam_ccb.h stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_periph.h stable/9/sys/cam/cam_queue.c stable/9/sys/cam/cam_queue.h stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/cam_xpt_internal.h stable/9/sys/cam/cam_xpt_sim.h stable/9/sys/cam/ctl/scsi_ctl.c stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_pass.c stable/9/sys/cam/scsi/scsi_xpt.c Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Wed Oct 9 18:48:10 2013 (r256215) +++ stable/9/sys/cam/ata/ata_da.c Wed Oct 9 18:58:28 2013 (r256216) @@ -1022,8 +1022,6 @@ adaasync(void *callback_arg, u_int32_t c else break; cam_periph_acquire(periph); - cam_freeze_devq_arg(periph->path, - RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); xpt_schedule(periph, CAM_PRIORITY_DEV); } default: @@ -1359,15 +1357,11 @@ adaregister(struct cam_periph *periph, v cgd->ident_data.support.command1 & ATA_SUPPORT_LOOKAHEAD) { softc->state = ADA_STATE_RAHEAD; cam_periph_acquire(periph); - cam_freeze_devq_arg(periph->path, - RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); xpt_schedule(periph, CAM_PRIORITY_DEV); } else if (ADA_WC >= 0 && cgd->ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) { softc->state = ADA_STATE_WCACHE; cam_periph_acquire(periph); - cam_freeze_devq_arg(periph->path, - RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); xpt_schedule(periph, CAM_PRIORITY_DEV); } else softc->state = ADA_STATE_NORMAL; @@ -1659,8 +1653,6 @@ out: if ((periph->flags & CAM_PERIPH_INVALID) != 0) { softc->state = ADA_STATE_NORMAL; xpt_release_ccb(start_ccb); - cam_release_devq(periph->path, - RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); adaschedule(periph); cam_periph_release_locked(periph); return; @@ -1684,6 +1676,7 @@ out: ATA_SF_ENAB_WCACHE : ATA_SF_DIS_WCACHE, 0, 0); start_ccb->ccb_h.ccb_state = ADA_CCB_WCACHE; } + start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; xpt_action(start_ccb); break; } @@ -1696,12 +1689,14 @@ adadone(struct cam_periph *periph, union struct ada_softc *softc; struct ccb_ataio *ataio; struct ccb_getdev *cgd; + struct cam_path *path; int state; softc = (struct ada_softc *)periph->softc; ataio = &done_ccb->ataio; + path = done_ccb->ccb_h.path; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adadone\n")); + CAM_DEBUG(path, CAM_DEBUG_TRACE, ("adadone\n")); state = ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK; switch (state) { @@ -1718,7 +1713,7 @@ adadone(struct cam_periph *periph, union return; } if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(done_ccb->ccb_h.path, + cam_release_devq(path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, @@ -1771,9 +1766,12 @@ adadone(struct cam_periph *periph, union { if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { if (adaerror(done_ccb, 0, 0) == ERESTART) { +out: + /* Drop freeze taken due to CAM_DEV_QFREEZE */ + cam_release_devq(path, 0, 0, 0, FALSE); return; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(done_ccb->ccb_h.path, + cam_release_devq(path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, @@ -1790,7 +1788,7 @@ adadone(struct cam_periph *periph, union * operation. */ cgd = (struct ccb_getdev *)done_ccb; - xpt_setup_ccb(&cgd->ccb_h, periph->path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cgd->ccb_h, path, CAM_PRIORITY_NORMAL); cgd->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)cgd); if (ADA_WC >= 0 && @@ -1798,12 +1796,12 @@ adadone(struct cam_periph *periph, union softc->state = ADA_STATE_WCACHE; xpt_release_ccb(done_ccb); xpt_schedule(periph, CAM_PRIORITY_DEV); - return; + goto out; } softc->state = ADA_STATE_NORMAL; xpt_release_ccb(done_ccb); - cam_release_devq(periph->path, - RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); + /* Drop freeze taken due to CAM_DEV_QFREEZE */ + cam_release_devq(path, 0, 0, 0, FALSE); adaschedule(periph); cam_periph_release_locked(periph); return; @@ -1812,9 +1810,9 @@ adadone(struct cam_periph *periph, union { if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { if (adaerror(done_ccb, 0, 0) == ERESTART) { - return; + goto out; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(done_ccb->ccb_h.path, + cam_release_devq(path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, @@ -1832,8 +1830,8 @@ adadone(struct cam_periph *periph, union * operation. */ xpt_release_ccb(done_ccb); - cam_release_devq(periph->path, - RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); + /* Drop freeze taken due to CAM_DEV_QFREEZE */ + cam_release_devq(path, 0, 0, 0, FALSE); adaschedule(periph); cam_periph_release_locked(periph); return; Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Wed Oct 9 18:48:10 2013 (r256215) +++ stable/9/sys/cam/ata/ata_xpt.c Wed Oct 9 18:58:28 2013 (r256216) @@ -249,12 +249,6 @@ proberegister(struct cam_periph *periph, return (status); } CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); - - /* - * Ensure nobody slip in until probe finish. - */ - cam_freeze_devq_arg(periph->path, - RELSIM_RELEASE_RUNLEVEL, CAM_RL_XPT + 1); probeschedule(periph); return(CAM_REQ_CMP); } @@ -661,6 +655,7 @@ negotiate: default: panic("probestart: invalid action state 0x%x\n", softc->action); } + start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; xpt_action(start_ccb); } @@ -708,12 +703,15 @@ probedone(struct cam_periph *periph, uni if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { if (cam_periph_error(done_ccb, 0, softc->restart ? (SF_NO_RECOVERY | SF_NO_RETRY) : 0, - NULL) == ERESTART) + NULL) == ERESTART) { +out: + /* Drop freeze taken due to CAM_DEV_QFREEZE flag set. */ + cam_release_devq(path, 0, 0, 0, FALSE); return; + } if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ - xpt_release_devq(done_ccb->ccb_h.path, /*count*/1, - /*run_queue*/TRUE); + xpt_release_devq(path, /*count*/1, /*run_queue*/TRUE); } status = done_ccb->ccb_h.status & CAM_STATUS_MASK; if (softc->restart) { @@ -768,7 +766,7 @@ probedone(struct cam_periph *periph, uni PROBE_SET_ACTION(softc, PROBE_IDENTIFY_SAFTE); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* @@ -830,7 +828,7 @@ noerror: } xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } case PROBE_IDENTIFY: { @@ -864,7 +862,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SPINUP); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } ident_buf = &path->device->ident_data; if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { @@ -955,7 +953,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETMODE); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } case PROBE_SPINUP: if (bootverbose) @@ -964,7 +962,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_IDENTIFY); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; case PROBE_SETMODE: /* Set supported bits. */ bzero(&cts, sizeof(cts)); @@ -1035,7 +1033,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETPM); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* FALLTHROUGH */ case PROBE_SETPM: @@ -1046,7 +1044,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETAPST); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* FALLTHROUGH */ case PROBE_SETAPST: @@ -1056,7 +1054,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETDMAAA); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* FALLTHROUGH */ case PROBE_SETDMAAA: @@ -1066,7 +1064,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETAN); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* FALLTHROUGH */ case PROBE_SETAN: @@ -1078,15 +1076,14 @@ notsata: } xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; case PROBE_SET_MULTI: if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; xpt_acquire_device(path->device); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, - done_ccb); + xpt_async(AC_FOUND_DEVICE, path, done_ccb); } PROBE_SET_ACTION(softc, PROBE_DONE); break; @@ -1119,7 +1116,7 @@ notsata: PROBE_SET_ACTION(softc, PROBE_FULL_INQUIRY); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } ata_device_transport(path); @@ -1128,7 +1125,7 @@ notsata: xpt_acquire_device(path->device); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); + xpt_async(AC_FOUND_DEVICE, path, done_ccb); } PROBE_SET_ACTION(softc, PROBE_DONE); break; @@ -1146,7 +1143,7 @@ notsata: PROBE_SET_ACTION(softc, PROBE_PM_PRV); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; case PROBE_PM_PRV: softc->pm_prv = (done_ccb->ataio.res.lba_high << 24) + (done_ccb->ataio.res.lba_mid << 16) + @@ -1201,12 +1198,11 @@ notsata: xpt_acquire_device(path->device); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, - done_ccb); + xpt_async(AC_FOUND_DEVICE, path, done_ccb); } else { done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_SCSI_AEN, done_ccb->ccb_h.path, done_ccb); + xpt_async(AC_SCSI_AEN, path, done_ccb); } PROBE_SET_ACTION(softc, PROBE_DONE); break; @@ -1251,8 +1247,7 @@ notsata: xpt_acquire_device(path->device); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, - done_ccb); + xpt_async(AC_FOUND_DEVICE, path, done_ccb); } PROBE_SET_ACTION(softc, PROBE_DONE); break; @@ -1264,7 +1259,7 @@ done: softc->restart = 0; xpt_release_ccb(done_ccb); probeschedule(periph); - return; + goto out; } xpt_release_ccb(done_ccb); CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe completed\n")); @@ -1274,9 +1269,9 @@ done: done_ccb->ccb_h.status = found ? CAM_REQ_CMP : CAM_REQ_CMP_ERR; xpt_done(done_ccb); } + /* Drop freeze taken due to CAM_DEV_QFREEZE flag set. */ + cam_release_devq(path, 0, 0, 0, FALSE); cam_periph_invalidate(periph); - cam_release_devq(periph->path, - RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_XPT + 1, FALSE); cam_periph_release_locked(periph); } Modified: stable/9/sys/cam/cam.h ============================================================================== --- stable/9/sys/cam/cam.h Wed Oct 9 18:48:10 2013 (r256215) +++ stable/9/sys/cam/cam.h Wed Oct 9 18:58:28 2013 (r256216) @@ -80,10 +80,9 @@ typedef struct { #define CAM_PRIORITY_BUS ((CAM_RL_BUS << 8) + 0x80) #define CAM_PRIORITY_XPT ((CAM_RL_XPT << 8) + 0x80) #define CAM_PRIORITY_DEV ((CAM_RL_DEV << 8) + 0x80) +#define CAM_PRIORITY_OOB (CAM_RL_DEV << 8) #define CAM_PRIORITY_NORMAL ((CAM_RL_NORMAL << 8) + 0x80) #define CAM_PRIORITY_NONE (u_int32_t)-1 -#define CAM_PRIORITY_TO_RL(x) ((x) >> 8) -#define CAM_RL_TO_PRIORITY(x) ((x) << 8) u_int32_t generation; int index; #define CAM_UNQUEUED_INDEX -1 Modified: stable/9/sys/cam/cam_ccb.h ============================================================================== --- stable/9/sys/cam/cam_ccb.h Wed Oct 9 18:48:10 2013 (r256215) +++ stable/9/sys/cam/cam_ccb.h Wed Oct 9 18:58:28 2013 (r256216) @@ -150,8 +150,6 @@ typedef enum { /* Path statistics (error counts, etc.) */ XPT_GDEV_STATS = 0x0c, /* Device statistics (error counts, etc.) */ - XPT_FREEZE_QUEUE = 0x0d, - /* Freeze device queue */ XPT_DEV_ADVINFO = 0x0e, /* Get/Set Device advanced information */ /* SCSI Control Functions: 0x10->0x1F */ @@ -755,7 +753,6 @@ struct ccb_relsim { #define RELSIM_RELEASE_AFTER_TIMEOUT 0x02 #define RELSIM_RELEASE_AFTER_CMDCMPLT 0x04 #define RELSIM_RELEASE_AFTER_QEMPTY 0x08 -#define RELSIM_RELEASE_RUNLEVEL 0x10 u_int32_t openings; u_int32_t release_timeout; /* Abstract argument. */ u_int32_t qfrozen_cnt; Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Wed Oct 9 18:48:10 2013 (r256215) +++ stable/9/sys/cam/cam_periph.c Wed Oct 9 18:58:28 2013 (r256216) @@ -1113,21 +1113,12 @@ cam_periph_runccb(union ccb *ccb, void cam_freeze_devq(struct cam_path *path) { + struct ccb_hdr ccb_h; - cam_freeze_devq_arg(path, 0, 0); -} - -void -cam_freeze_devq_arg(struct cam_path *path, uint32_t flags, uint32_t arg) -{ - struct ccb_relsim crs; - - xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NONE); - crs.ccb_h.func_code = XPT_FREEZE_QUEUE; - crs.release_flags = flags; - crs.openings = arg; - crs.release_timeout = arg; - xpt_action((union ccb *)&crs); + xpt_setup_ccb(&ccb_h, path, /*priority*/1); + ccb_h.func_code = XPT_NOOP; + ccb_h.flags = CAM_DEV_QFREEZE; + xpt_action((union ccb *)&ccb_h); } u_int32_t Modified: stable/9/sys/cam/cam_periph.h ============================================================================== --- stable/9/sys/cam/cam_periph.h Wed Oct 9 18:48:10 2013 (r256215) +++ stable/9/sys/cam/cam_periph.h Wed Oct 9 18:58:28 2013 (r256216) @@ -171,8 +171,6 @@ int cam_periph_ioctl(struct cam_periph cam_flags camflags, u_int32_t sense_flags)); void cam_freeze_devq(struct cam_path *path); -void cam_freeze_devq_arg(struct cam_path *path, u_int32_t flags, - uint32_t arg); u_int32_t cam_release_devq(struct cam_path *path, u_int32_t relsim_flags, u_int32_t opening_reduction, u_int32_t arg, int getcount_only); Modified: stable/9/sys/cam/cam_queue.c ============================================================================== --- stable/9/sys/cam/cam_queue.c Wed Oct 9 18:48:10 2013 (r256215) +++ stable/9/sys/cam/cam_queue.c Wed Oct 9 18:58:28 2013 (r256216) @@ -230,15 +230,8 @@ int cam_devq_init(struct cam_devq *devq, int devices, int openings) { bzero(devq, sizeof(*devq)); - if (camq_init(&devq->alloc_queue, devices) != 0) { + if (camq_init(&devq->send_queue, devices) != 0) return (1); - } - if (camq_init(&devq->send_queue, devices) != 0) { - camq_fini(&devq->alloc_queue); - return (1); - } - devq->alloc_openings = openings; - devq->alloc_active = 0; devq->send_openings = openings; devq->send_active = 0; return (0); @@ -247,7 +240,6 @@ cam_devq_init(struct cam_devq *devq, int void cam_devq_free(struct cam_devq *devq) { - camq_fini(&devq->alloc_queue); camq_fini(&devq->send_queue); free(devq, M_CAMDEVQ); } @@ -257,11 +249,7 @@ cam_devq_resize(struct cam_devq *camq, i { u_int32_t retval; - retval = camq_resize(&camq->alloc_queue, devices); - - if (retval == CAM_REQ_CMP) - retval = camq_resize(&camq->send_queue, devices); - + retval = camq_resize(&camq->send_queue, devices); return (retval); } @@ -328,11 +316,10 @@ int cam_ccbq_init(struct cam_ccbq *ccbq, int openings) { bzero(ccbq, sizeof(*ccbq)); - if (camq_init(&ccbq->queue, openings + (CAM_RL_VALUES - 1)) != 0) { + if (camq_init(&ccbq->queue, openings + (CAM_RL_VALUES - 1)) != 0) return (1); - } ccbq->devq_openings = openings; - ccbq->dev_openings = openings; + ccbq->dev_openings = openings; return (0); } Modified: stable/9/sys/cam/cam_queue.h ============================================================================== --- stable/9/sys/cam/cam_queue.h Wed Oct 9 18:48:10 2013 (r256215) +++ stable/9/sys/cam/cam_queue.h Wed Oct 9 18:58:28 2013 (r256216) @@ -48,7 +48,7 @@ struct camq { int array_size; int entries; u_int32_t generation; - u_int32_t qfrozen_cnt[CAM_RL_VALUES]; + u_int32_t qfrozen_cnt; }; TAILQ_HEAD(ccb_hdr_tailq, ccb_hdr); @@ -58,7 +58,8 @@ SLIST_HEAD(ccb_hdr_slist, ccb_hdr); struct cam_ccbq { struct camq queue; int devq_openings; - int dev_openings; + int devq_allocating; + int dev_openings; int dev_active; int held; }; @@ -66,11 +67,7 @@ struct cam_ccbq { struct cam_ed; struct cam_devq { - struct camq alloc_queue; struct camq send_queue; - struct cam_ed *active_dev; - int alloc_openings; - int alloc_active; int send_openings; int send_active; }; @@ -158,10 +155,10 @@ cam_ccbq_pending_ccb_count(struct cam_cc static __inline void cam_ccbq_take_opening(struct cam_ccbq *ccbq); -static __inline int +static __inline void cam_ccbq_insert_ccb(struct cam_ccbq *ccbq, union ccb *new_ccb); -static __inline int +static __inline void cam_ccbq_remove_ccb(struct cam_ccbq *ccbq, union ccb *ccb); static __inline union ccb * @@ -190,31 +187,17 @@ cam_ccbq_take_opening(struct cam_ccbq *c ccbq->held++; } -static __inline int +static __inline void cam_ccbq_insert_ccb(struct cam_ccbq *ccbq, union ccb *new_ccb) { ccbq->held--; camq_insert(&ccbq->queue, &new_ccb->ccb_h.pinfo); - if (ccbq->queue.qfrozen_cnt[CAM_PRIORITY_TO_RL( - new_ccb->ccb_h.pinfo.priority)] > 0) { - ccbq->devq_openings++; - ccbq->held++; - return (1); - } else - return (0); } -static __inline int +static __inline void cam_ccbq_remove_ccb(struct cam_ccbq *ccbq, union ccb *ccb) { camq_remove(&ccbq->queue, ccb->ccb_h.pinfo.index); - if (ccbq->queue.qfrozen_cnt[CAM_PRIORITY_TO_RL( - ccb->ccb_h.pinfo.priority)] > 0) { - ccbq->devq_openings--; - ccbq->held--; - return (1); - } else - return (0); } static __inline union ccb * @@ -248,81 +231,5 @@ cam_ccbq_release_opening(struct cam_ccbq ccbq->devq_openings++; } -static __inline int -cam_ccbq_freeze(struct cam_ccbq *ccbq, cam_rl rl, u_int32_t cnt) -{ - int i, frozen = 0; - cam_rl p, n; - - /* Find pevious run level. */ - for (p = 0; p < CAM_RL_VALUES && ccbq->queue.qfrozen_cnt[p] == 0; p++); - /* Find new run level. */ - n = min(rl, p); - /* Apply new run level. */ - for (i = rl; i < CAM_RL_VALUES; i++) - ccbq->queue.qfrozen_cnt[i] += cnt; - /* Update ccbq statistics. */ - if (n == p) - return (0); - for (i = CAMQ_HEAD; i <= ccbq->queue.entries; i++) { - cam_rl rrl = - CAM_PRIORITY_TO_RL(ccbq->queue.queue_array[i]->priority); - if (rrl < n) - continue; - if (rrl >= p) - break; - ccbq->devq_openings++; - ccbq->held++; - frozen++; - } - return (frozen); -} - -static __inline int -cam_ccbq_release(struct cam_ccbq *ccbq, cam_rl rl, u_int32_t cnt) -{ - int i, released = 0; - cam_rl p, n; - - /* Apply new run level. */ - for (i = rl; i < CAM_RL_VALUES; i++) - ccbq->queue.qfrozen_cnt[i] -= cnt; - /* Find new run level. */ - for (n = 0; n < CAM_RL_VALUES && ccbq->queue.qfrozen_cnt[n] == 0; n++); - /* Find previous run level. */ - p = min(rl, n); - /* Update ccbq statistics. */ - if (n == p) - return (0); - for (i = CAMQ_HEAD; i <= ccbq->queue.entries; i++) { - cam_rl rrl = - CAM_PRIORITY_TO_RL(ccbq->queue.queue_array[i]->priority); - if (rrl < p) - continue; - if (rrl >= n) - break; - ccbq->devq_openings--; - ccbq->held--; - released++; - } - return (released); -} - -static __inline u_int32_t -cam_ccbq_frozen(struct cam_ccbq *ccbq, cam_rl rl) -{ - - return (ccbq->queue.qfrozen_cnt[rl]); -} - -static __inline u_int32_t -cam_ccbq_frozen_top(struct cam_ccbq *ccbq) -{ - cam_rl rl; - - rl = CAM_PRIORITY_TO_RL(CAMQ_GET_PRIO(&ccbq->queue)); - return (ccbq->queue.qfrozen_cnt[rl]); -} - #endif /* _KERNEL */ #endif /* _CAM_CAM_QUEUE_H */ Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Oct 9 18:48:10 2013 (r256215) +++ stable/9/sys/cam/cam_xpt.c Wed Oct 9 18:58:28 2013 (r256216) @@ -225,13 +225,13 @@ static void xpt_async_bcast(struct asyn static path_id_t xptnextfreepathid(void); static path_id_t xptpathid(const char *sim_name, int sim_unit, int sim_bus); static union ccb *xpt_get_ccb(struct cam_ed *device); -static void xpt_run_dev_allocq(struct cam_eb *bus); -static void xpt_run_dev_sendq(struct cam_eb *bus); +static void xpt_run_dev_allocq(struct cam_ed *device); +static void xpt_run_devq(struct cam_devq *devq); static timeout_t xpt_release_devq_timeout; static void xpt_release_simq_timeout(void *arg) __unused; static void xpt_release_bus(struct cam_eb *bus); -static void xpt_release_devq_device(struct cam_ed *dev, cam_rl rl, - u_int count, int run_queue); +static void xpt_release_devq_device(struct cam_ed *dev, u_int count, + int run_queue); static struct cam_et* xpt_alloc_target(struct cam_eb *bus, target_id_t target_id); static void xpt_release_target(struct cam_et *target); @@ -298,49 +298,24 @@ static xpt_busfunc_t xptsetasyncbusfunc; static cam_status xptregister(struct cam_periph *periph, void *arg); static __inline int periph_is_queued(struct cam_periph *periph); -static __inline int device_is_alloc_queued(struct cam_ed *device); -static __inline int device_is_send_queued(struct cam_ed *device); +static __inline int device_is_queued(struct cam_ed *device); static __inline int -xpt_schedule_dev_allocq(struct cam_eb *bus, struct cam_ed *dev) -{ - int retval; - - if ((dev->drvq.entries > 0) && - (dev->ccbq.devq_openings > 0) && - (cam_ccbq_frozen(&dev->ccbq, CAM_PRIORITY_TO_RL( - CAMQ_GET_PRIO(&dev->drvq))) == 0)) { - /* - * The priority of a device waiting for CCB resources - * is that of the highest priority peripheral driver - * enqueued. - */ - retval = xpt_schedule_dev(&bus->sim->devq->alloc_queue, - &dev->alloc_ccb_entry.pinfo, - CAMQ_GET_PRIO(&dev->drvq)); - } else { - retval = 0; - } - - return (retval); -} - -static __inline int -xpt_schedule_dev_sendq(struct cam_eb *bus, struct cam_ed *dev) +xpt_schedule_devq(struct cam_devq *devq, struct cam_ed *dev) { int retval; if ((dev->ccbq.queue.entries > 0) && (dev->ccbq.dev_openings > 0) && - (cam_ccbq_frozen_top(&dev->ccbq) == 0)) { + (dev->ccbq.queue.qfrozen_cnt == 0)) { /* * The priority of a device waiting for controller * resources is that of the highest priority CCB * enqueued. */ retval = - xpt_schedule_dev(&bus->sim->devq->send_queue, - &dev->send_ccb_entry.pinfo, + xpt_schedule_dev(&devq->send_queue, + &dev->devq_entry.pinfo, CAMQ_GET_PRIO(&dev->ccbq.queue)); } else { retval = 0; @@ -355,15 +330,9 @@ periph_is_queued(struct cam_periph *peri } static __inline int -device_is_alloc_queued(struct cam_ed *device) -{ - return (device->alloc_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX); -} - -static __inline int -device_is_send_queued(struct cam_ed *device) +device_is_queued(struct cam_ed *device) { - return (device->send_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX); + return (device->devq_entry.pinfo.index != CAM_UNQUEUED_INDEX); } static void @@ -2592,17 +2561,10 @@ xpt_action_default(union ccb *start_ccb) case XPT_RESET_DEV: case XPT_ENG_EXEC: case XPT_SMP_IO: - { - int frozen; - - frozen = cam_ccbq_insert_ccb(&path->device->ccbq, start_ccb); - path->device->sim->devq->alloc_openings += frozen; - if (frozen > 0) - xpt_run_dev_allocq(path->bus); - if (xpt_schedule_dev_sendq(path->bus, path->device)) - xpt_run_dev_sendq(path->bus); + cam_ccbq_insert_ccb(&path->device->ccbq, start_ccb); + if (xpt_schedule_devq(path->bus->sim->devq, path->device)) + xpt_run_devq(path->bus->sim->devq); break; - } case XPT_CALC_GEOMETRY: { struct cam_sim *sim; @@ -2651,8 +2613,7 @@ xpt_action_default(union ccb *start_ccb) device = abort_ccb->ccb_h.path->device; ccbq = &device->ccbq; - device->sim->devq->alloc_openings -= - cam_ccbq_remove_ccb(ccbq, abort_ccb); + cam_ccbq_remove_ccb(ccbq, abort_ccb); abort_ccb->ccb_h.status = CAM_REQ_ABORTED|CAM_DEV_QFRZN; xpt_freeze_devq(abort_ccb->ccb_h.path, 1); @@ -3033,13 +2994,9 @@ xpt_action_default(union ccb *start_ccb) } } - if ((start_ccb->ccb_h.flags & CAM_DEV_QFREEZE) == 0) { - xpt_release_devq_rl(path, /*runlevel*/ - (crs->release_flags & RELSIM_RELEASE_RUNLEVEL) ? - crs->release_timeout : 0, - /*count*/1, /*run_queue*/TRUE); - } - start_ccb->crs.qfrozen_cnt = dev->ccbq.queue.qfrozen_cnt[0]; + if ((start_ccb->ccb_h.flags & CAM_DEV_QFREEZE) == 0) + xpt_release_devq(path, /*count*/1, /*run_queue*/TRUE); + start_ccb->crs.qfrozen_cnt = dev->ccbq.queue.qfrozen_cnt; start_ccb->ccb_h.status = CAM_REQ_CMP; break; } @@ -3082,16 +3039,6 @@ xpt_action_default(union ccb *start_ccb) start_ccb->ccb_h.status = CAM_REQ_CMP; break; } - case XPT_FREEZE_QUEUE: - { - struct ccb_relsim *crs = &start_ccb->crs; - - xpt_freeze_devq_rl(path, /*runlevel*/ - (crs->release_flags & RELSIM_RELEASE_RUNLEVEL) ? - crs->release_timeout : 0, /*count*/1); - start_ccb->ccb_h.status = CAM_REQ_CMP; - break; - } case XPT_NOOP: if ((start_ccb->ccb_h.flags & CAM_DEV_QFREEZE) != 0) xpt_freeze_devq(path, 1); @@ -3197,7 +3144,7 @@ xpt_schedule(struct cam_periph *perph, u camq_change_priority(&device->drvq, perph->pinfo.index, new_priority); - runq = xpt_schedule_dev_allocq(perph->path->bus, device); + runq = 1; } } else { /* New entry on the queue */ @@ -3206,12 +3153,12 @@ xpt_schedule(struct cam_periph *perph, u perph->pinfo.priority = new_priority; perph->pinfo.generation = ++device->drvq.generation; camq_insert(&device->drvq, &perph->pinfo); - runq = xpt_schedule_dev_allocq(perph->path->bus, device); + runq = 1; } if (runq != 0) { CAM_DEBUG(perph->path, CAM_DEBUG_SUBTRACE, - (" calling xpt_run_devq\n")); - xpt_run_dev_allocq(perph->path->bus); + (" calling xpt_run_dev_allocq\n")); + xpt_run_dev_allocq(device); } } @@ -3264,43 +3211,25 @@ xpt_schedule_dev(struct camq *queue, cam } static void -xpt_run_dev_allocq(struct cam_eb *bus) +xpt_run_dev_allocq(struct cam_ed *device) { - struct cam_devq *devq; - - CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_allocq\n")); - devq = bus->sim->devq; + struct camq *drvq; - CAM_DEBUG_PRINT(CAM_DEBUG_XPT, - (" qfrozen_cnt == 0x%x, entries == %d, " - "openings == %d, active == %d\n", - devq->alloc_queue.qfrozen_cnt[0], - devq->alloc_queue.entries, - devq->alloc_openings, - devq->alloc_active)); - - devq->alloc_queue.qfrozen_cnt[0]++; - while ((devq->alloc_queue.entries > 0) - && (devq->alloc_openings > 0) - && (devq->alloc_queue.qfrozen_cnt[0] <= 1)) { - struct cam_ed_qinfo *qinfo; - struct cam_ed *device; + if (device->ccbq.devq_allocating) + return; + device->ccbq.devq_allocating = 1; + CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_allocq(%p)\n", device)); + drvq = &device->drvq; + while ((drvq->entries > 0) && + (device->ccbq.devq_openings > 0 || + CAMQ_GET_PRIO(drvq) <= CAM_PRIORITY_OOB) && + (device->ccbq.queue.qfrozen_cnt == 0)) { union ccb *work_ccb; struct cam_periph *drv; - struct camq *drvq; - qinfo = (struct cam_ed_qinfo *)camq_remove(&devq->alloc_queue, - CAMQ_HEAD); - device = qinfo->device; - CAM_DEBUG_PRINT(CAM_DEBUG_XPT, - ("running device %p\n", device)); - - drvq = &device->drvq; KASSERT(drvq->entries > 0, ("xpt_run_dev_allocq: " "Device on queue without any work to do")); if ((work_ccb = xpt_get_ccb(device)) != NULL) { - devq->alloc_openings--; - devq->alloc_active++; drv = (struct cam_periph*)camq_remove(drvq, CAMQ_HEAD); xpt_setup_ccb(&work_ccb->ccb_h, drv->path, drv->pinfo.priority); @@ -3319,27 +3248,21 @@ xpt_run_dev_allocq(struct cam_eb *bus) */ break; } - - /* We may have more work. Attempt to reschedule. */ - xpt_schedule_dev_allocq(bus, device); } - devq->alloc_queue.qfrozen_cnt[0]--; + device->ccbq.devq_allocating = 0; } static void -xpt_run_dev_sendq(struct cam_eb *bus) +xpt_run_devq(struct cam_devq *devq) { - struct cam_devq *devq; char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; - CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_sendq\n")); - - devq = bus->sim->devq; + CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_devq\n")); - devq->send_queue.qfrozen_cnt[0]++; + devq->send_queue.qfrozen_cnt++; while ((devq->send_queue.entries > 0) && (devq->send_openings > 0) - && (devq->send_queue.qfrozen_cnt[0] <= 1)) { + && (devq->send_queue.qfrozen_cnt <= 1)) { struct cam_ed_qinfo *qinfo; struct cam_ed *device; union ccb *work_ccb; @@ -3389,9 +3312,9 @@ xpt_run_dev_sendq(struct cam_eb *bus) devq->send_openings--; devq->send_active++; - xpt_schedule_dev_sendq(bus, device); + xpt_schedule_devq(devq, device); - if (work_ccb && (work_ccb->ccb_h.flags & CAM_DEV_QFREEZE) != 0){ + if ((work_ccb->ccb_h.flags & CAM_DEV_QFREEZE) != 0) { /* * The client wants to freeze the queue * after this CCB is sent. @@ -3441,7 +3364,7 @@ xpt_run_dev_sendq(struct cam_eb *bus) sim = work_ccb->ccb_h.path->bus->sim; (*(sim->sim_action))(sim, work_ccb); } - devq->send_queue.qfrozen_cnt[0]--; + devq->send_queue.qfrozen_cnt--; } /* @@ -3904,14 +3827,7 @@ xpt_release_ccb(union ccb *free_ccb) SLIST_INSERT_HEAD(&sim->ccb_freeq, &free_ccb->ccb_h, xpt_links.sle); } - if (sim->devq == NULL) { - return; - } - sim->devq->alloc_openings++; - sim->devq->alloc_active--; - if (device_is_alloc_queued(device) == 0) - xpt_schedule_dev_allocq(bus, device); - xpt_run_dev_allocq(bus); + xpt_run_dev_allocq(device); } /* Functions accessed by SIM drivers */ @@ -4266,34 +4182,18 @@ xpt_dev_async_default(u_int32_t async_co } u_int32_t -xpt_freeze_devq_rl(struct cam_path *path, cam_rl rl, u_int count) +xpt_freeze_devq(struct cam_path *path, u_int count) { struct cam_ed *dev = path->device; mtx_assert(path->bus->sim->mtx, MA_OWNED); - dev->sim->devq->alloc_openings += - cam_ccbq_freeze(&dev->ccbq, rl, count); - /* Remove frozen device from allocq. */ - if (device_is_alloc_queued(dev) && - cam_ccbq_frozen(&dev->ccbq, CAM_PRIORITY_TO_RL( - CAMQ_GET_PRIO(&dev->drvq)))) { - camq_remove(&dev->sim->devq->alloc_queue, - dev->alloc_ccb_entry.pinfo.index); - } + dev->ccbq.queue.qfrozen_cnt += count; /* Remove frozen device from sendq. */ - if (device_is_send_queued(dev) && - cam_ccbq_frozen_top(&dev->ccbq)) { + if (device_is_queued(dev)) { camq_remove(&dev->sim->devq->send_queue, - dev->send_ccb_entry.pinfo.index); + dev->devq_entry.pinfo.index); } - return (dev->ccbq.queue.qfrozen_cnt[rl]); -} - -u_int32_t -xpt_freeze_devq(struct cam_path *path, u_int count) -{ - - return (xpt_freeze_devq_rl(path, 0, count)); + return (dev->ccbq.queue.qfrozen_cnt); } u_int32_t @@ -4301,8 +4201,8 @@ xpt_freeze_simq(struct cam_sim *sim, u_i { mtx_assert(sim->mtx, MA_OWNED); - sim->devq->send_queue.qfrozen_cnt[0] += count; - return (sim->devq->send_queue.qfrozen_cnt[0]); + sim->devq->send_queue.qfrozen_cnt += count; + return (sim->devq->send_queue.qfrozen_cnt); } static void @@ -4311,45 +4211,30 @@ xpt_release_devq_timeout(void *arg) struct cam_ed *device; device = (struct cam_ed *)arg; - - xpt_release_devq_device(device, /*rl*/0, /*count*/1, /*run_queue*/TRUE); + xpt_release_devq_device(device, /*count*/1, /*run_queue*/TRUE); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:03:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B102D980; Wed, 9 Oct 2013 19:03:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 847322DBD; Wed, 9 Oct 2013 19:03:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99J303q064030; Wed, 9 Oct 2013 19:03:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99J2xc7064008; Wed, 9 Oct 2013 19:02:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091902.r99J2xc7064008@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 19:02: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: r256217 - in stable/9/sys: cam/ctl net netpfil/ipfw 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, 09 Oct 2013 19:03:00 -0000 Author: mav Date: Wed Oct 9 19:02:59 2013 New Revision: 256217 URL: http://svnweb.freebsd.org/changeset/base/256217 Log: MFC r250131 (by eadler): Correct a few sizeof()s Modified: stable/9/sys/cam/ctl/ctl_frontend_internal.c stable/9/sys/net/if_spppsubr.c stable/9/sys/netpfil/ipfw/ip_dummynet.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_frontend_internal.c Wed Oct 9 18:58:28 2013 (r256216) +++ stable/9/sys/cam/ctl/ctl_frontend_internal.c Wed Oct 9 19:02:59 2013 (r256217) @@ -253,7 +253,7 @@ cfi_init(void) sizeof(struct cfi_lun_io), CTL_PORT_PRIV_SIZE); } - memset(softc, 0, sizeof(softc)); + memset(softc, 0, sizeof(*softc)); mtx_init(&softc->lock, "CTL frontend mutex", NULL, MTX_DEF); softc->flags |= CTL_FLAG_MASTER_SHELF; Modified: stable/9/sys/net/if_spppsubr.c ============================================================================== --- stable/9/sys/net/if_spppsubr.c Wed Oct 9 18:58:28 2013 (r256216) +++ stable/9/sys/net/if_spppsubr.c Wed Oct 9 19:02:59 2013 (r256217) @@ -3619,7 +3619,7 @@ sppp_ipv6cp_RCR(struct sppp *sp, struct continue; } - bzero(&suggestaddr, sizeof(&suggestaddr)); + bzero(&suggestaddr, sizeof(suggestaddr)); if (collision && nohisaddr) { /* collision, hisaddr unknown - Conf-Rej */ type = CONF_REJ; Modified: stable/9/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_dummynet.c Wed Oct 9 18:58:28 2013 (r256216) +++ stable/9/sys/netpfil/ipfw/ip_dummynet.c Wed Oct 9 19:02:59 2013 (r256217) @@ -617,7 +617,7 @@ fsk_detach(struct dn_fsk *fs, int flags) fs->sched->fp->free_fsk(fs); fs->sched = NULL; if (flags & DN_DELETE_FS) { - bzero(fs, sizeof(fs)); /* safety */ + bzero(fs, sizeof(*fs)); /* safety */ free(fs, M_DUMMYNET); dn_cfg.fsk_count--; } else { From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:04:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 27F35BD0; Wed, 9 Oct 2013 19:04:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 14DBC2DD6; Wed, 9 Oct 2013 19:04:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99J4fX4065009; Wed, 9 Oct 2013 19:04:41 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99J4fi2065004; Wed, 9 Oct 2013 19:04:41 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310091904.r99J4fi2065004@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 9 Oct 2013 19:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256218 - in head/sys: dev/cxgbe dev/ixgbe net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:04:42 -0000 Author: glebius Date: Wed Oct 9 19:04:40 2013 New Revision: 256218 URL: http://svnweb.freebsd.org/changeset/base/256218 Log: There are some high performance NICs that count statistics in hardware, and there are ifnets, that do that via counter(9). Provide a flag that would skip cache line trashing '+=' operation in ether_input(). Sponsored by: Netflix Sponsored by: Nginx, Inc. Reviewed by: melifaro, adrian Approved by: re (marius) Modified: head/sys/dev/cxgbe/t4_main.c head/sys/dev/ixgbe/ixgbe.c head/sys/net/if.h head/sys/net/if_ethersubr.c head/sys/net/if_lagg.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Oct 9 19:02:59 2013 (r256217) +++ head/sys/dev/cxgbe/t4_main.c Wed Oct 9 19:04:40 2013 (r256218) @@ -950,7 +950,7 @@ cxgbe_probe(device_t dev) #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ - IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6) + IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6 | IFCAP_HWSTATS) #define T4_CAP_ENABLE (T4_CAP) static int Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Wed Oct 9 19:02:59 2013 (r256217) +++ head/sys/dev/ixgbe/ixgbe.c Wed Oct 9 19:04:40 2013 (r256218) @@ -2662,7 +2662,8 @@ ixgbe_setup_interface(device_t dev, stru ifp->if_capabilities |= IFCAP_LRO; ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO - | IFCAP_VLAN_MTU; + | IFCAP_VLAN_MTU + | IFCAP_HWSTATS; ifp->if_capenable = ifp->if_capabilities; /* Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Wed Oct 9 19:02:59 2013 (r256217) +++ head/sys/net/if.h Wed Oct 9 19:04:40 2013 (r256218) @@ -231,6 +231,7 @@ struct if_data { #define IFCAP_NETMAP 0x100000 /* netmap mode supported/enabled */ #define IFCAP_RXCSUM_IPV6 0x200000 /* can offload checksum on IPv6 RX */ #define IFCAP_TXCSUM_IPV6 0x400000 /* can offload checksum on IPv6 TX */ +#define IFCAP_HWSTATS 0x800000 /* manages counters internally */ #define IFCAP_HWCSUM_IPV6 (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6) Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Wed Oct 9 19:02:59 2013 (r256217) +++ head/sys/net/if_ethersubr.c Wed Oct 9 19:04:40 2013 (r256218) @@ -528,7 +528,8 @@ ether_input_internal(struct ifnet *ifp, m->m_flags &= ~M_HASFCS; } - ifp->if_ibytes += m->m_pkthdr.len; + if (!(ifp->if_capenable & IFCAP_HWSTATS)) + ifp->if_ibytes += m->m_pkthdr.len; /* Allow monitor mode to claim this frame, after stats are updated. */ if (ifp->if_flags & IFF_MONITOR) { Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Wed Oct 9 19:02:59 2013 (r256217) +++ head/sys/net/if_lagg.c Wed Oct 9 19:04:40 2013 (r256218) @@ -347,6 +347,7 @@ lagg_clone_create(struct if_clone *ifc, ifp->if_init = lagg_init; ifp->if_ioctl = lagg_ioctl; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; + ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; /* * Attach as an ordinary ethernet device, children will be attached From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:04:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7F6CBD05; Wed, 9 Oct 2013 19:04:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E5D92DDC; Wed, 9 Oct 2013 19:04:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99J4q35065119; Wed, 9 Oct 2013 19:04:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99J4muT065081; Wed, 9 Oct 2013 19:04:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091904.r99J4muT065081@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 19:04: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: r256219 - in stable/9/sys: cam/ctl cam/scsi dev/aic7xxx dev/cp dev/ctau dev/cx dev/hptmv dev/isci/scil dev/nsp dev/sfxge/common dev/sn dev/stg kern netgraph/bluetooth/l2cap ofed/drivers... 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, 09 Oct 2013 19:04:52 -0000 Author: mav Date: Wed Oct 9 19:04:48 2013 New Revision: 256219 URL: http://svnweb.freebsd.org/changeset/base/256219 Log: MFC r250460 (by eadler): Fix a bunch of typos. Modified: stable/9/sys/cam/ctl/scsi_ctl.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/cam/scsi/scsi_pt.c stable/9/sys/dev/aic7xxx/aic7xxx.h stable/9/sys/dev/cp/if_cp.c stable/9/sys/dev/ctau/if_ct.c stable/9/sys/dev/cx/csigma.c stable/9/sys/dev/cx/if_cx.c stable/9/sys/dev/hptmv/entry.c stable/9/sys/dev/isci/scil/scif_sas_domain.c stable/9/sys/dev/nsp/nsp.c stable/9/sys/dev/sfxge/common/efx_mcdi.c stable/9/sys/dev/sn/if_sn.c stable/9/sys/dev/stg/tmc18c30.c stable/9/sys/kern/uipc_usrreq.c stable/9/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c stable/9/sys/ofed/drivers/net/mlx4/eq.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/cam/ctl/scsi_ctl.c Wed Oct 9 19:04:48 2013 (r256219) @@ -2142,7 +2142,7 @@ ctlfe_dump_queue(struct ctlfe_lun_softc xpt_print(periph->path, "%d requests total waiting for CCBs\n", num_items); - xpt_print(periph->path, "%ju CCBs oustanding (%ju allocated, %ju " + xpt_print(periph->path, "%ju CCBs outstanding (%ju allocated, %ju " "freed)\n", (uintmax_t)(softc->ccbs_alloced - softc->ccbs_freed), (uintmax_t)softc->ccbs_alloced, (uintmax_t)softc->ccbs_freed); Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/cam/scsi/scsi_da.c Wed Oct 9 19:04:48 2013 (r256219) @@ -2299,7 +2299,7 @@ skipstate: out: /* - * Block out any asyncronous callbacks + * Block out any asynchronous callbacks * while we touch the pending ccb list. */ LIST_INSERT_HEAD(&softc->pending_ccbs, @@ -2961,7 +2961,7 @@ dadone(struct cam_periph *periph, union } /* - * Block out any asyncronous callbacks + * Block out any asynchronous callbacks * while we touch the pending ccb list. */ LIST_REMOVE(&done_ccb->ccb_h, periph_links.le); Modified: stable/9/sys/cam/scsi/scsi_pt.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pt.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/cam/scsi/scsi_pt.c Wed Oct 9 19:04:48 2013 (r256219) @@ -455,7 +455,7 @@ ptstart(struct cam_periph *periph, union start_ccb->ccb_h.ccb_state = PT_CCB_BUFFER_IO_UA; /* - * Block out any asyncronous callbacks + * Block out any asynchronous callbacks * while we touch the pending ccb list. */ LIST_INSERT_HEAD(&softc->pending_ccbs, &start_ccb->ccb_h, @@ -549,7 +549,7 @@ ptdone(struct cam_periph *periph, union } /* - * Block out any asyncronous callbacks + * Block out any asynchronous callbacks * while we touch the pending ccb list. */ LIST_REMOVE(&done_ccb->ccb_h, periph_links.le); Modified: stable/9/sys/dev/aic7xxx/aic7xxx.h ============================================================================== --- stable/9/sys/dev/aic7xxx/aic7xxx.h Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/dev/aic7xxx/aic7xxx.h Wed Oct 9 19:04:48 2013 (r256219) @@ -768,7 +768,7 @@ struct ahc_syncrate { #define AHC_ULTRA2_XFER_PERIOD 0x0a /* - * Indexes into our table of syncronous transfer rates. + * Indexes into our table of synchronous transfer rates. */ #define AHC_SYNCRATE_DT 0 #define AHC_SYNCRATE_ULTRA2 1 Modified: stable/9/sys/dev/cp/if_cp.c ============================================================================== --- stable/9/sys/dev/cp/if_cp.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/dev/cp/if_cp.c Wed Oct 9 19:04:48 2013 (r256219) @@ -1,7 +1,7 @@ /*- * Cronyx-Tau-PCI adapter driver for FreeBSD. * Supports PPP/HDLC, Cisco/HDLC and FrameRelay protocol in synchronous mode, - * and asyncronous channels with full modem control. + * and asynchronous channels with full modem control. * Keepalive protocol implemented in both Cisco and PPP modes. * * Copyright (C) 1999-2004 Cronyx Engineering. Modified: stable/9/sys/dev/ctau/if_ct.c ============================================================================== --- stable/9/sys/dev/ctau/if_ct.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/dev/ctau/if_ct.c Wed Oct 9 19:04:48 2013 (r256219) @@ -1,7 +1,7 @@ /*- * Cronyx-Tau adapter driver for FreeBSD. * Supports PPP/HDLC and Cisco/HDLC protocol in synchronous mode, - * and asyncronous channels with full modem control. + * and asynchronous channels with full modem control. * Keepalive protocol implemented in both Cisco and PPP modes. * * Copyright (C) 1994-2002 Cronyx Engineering. Modified: stable/9/sys/dev/cx/csigma.c ============================================================================== --- stable/9/sys/dev/cx/csigma.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/dev/cx/csigma.c Wed Oct 9 19:04:48 2013 (r256219) @@ -1168,7 +1168,7 @@ void cx_set_dtr (cx_chan_t *c, int on) switch (c->num) { default: - /* Channels 4..7 and 12..15 in syncronous mode + /* Channels 4..7 and 12..15 in synchronous mode * have no DTR signal. */ break; Modified: stable/9/sys/dev/cx/if_cx.c ============================================================================== --- stable/9/sys/dev/cx/if_cx.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/dev/cx/if_cx.c Wed Oct 9 19:04:48 2013 (r256219) @@ -1,7 +1,7 @@ /*- * Cronyx-Sigma adapter driver for FreeBSD. * Supports PPP/HDLC and Cisco/HDLC protocol in synchronous mode, - * and asyncronous channels with full modem control. + * and asynchronous channels with full modem control. * Keepalive protocol implemented in both Cisco and PPP modes. * * Copyright (C) 1994-2002 Cronyx Engineering. Modified: stable/9/sys/dev/hptmv/entry.c ============================================================================== --- stable/9/sys/dev/hptmv/entry.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/dev/hptmv/entry.c Wed Oct 9 19:04:48 2013 (r256219) @@ -914,8 +914,8 @@ hptmv_event_notify(MV_SATA_ADAPTER *pMvS else { - MV_ERROR("RR18xx: illigal value for param1(%d) at " - "connect/disconect event, host=%d\n", param1, + MV_ERROR("RR18xx: illegal value for param1(%d) at " + "connect/disconnect event, host=%d\n", param1, pMvSataAdapter->adapterId ); } @@ -983,7 +983,7 @@ hptmv_allocate_edma_queues(IAL_ADAPTER_T if ((pAdapter->responsesArrayBaseDmaAlignedAddr - pAdapter->responsesArrayBaseDmaAddr) != (pAdapter->responsesArrayBaseAlignedAddr - pAdapter->responsesArrayBaseAddr)) { - MV_ERROR("RR18xx[%d]: Error in Response Quueues Alignment\n", + MV_ERROR("RR18xx[%d]: Error in Response Queues Alignment\n", pAdapter->mvSataAdapter.adapterId); contigfree(pAdapter->requestsArrayBaseAddr, REQUESTS_ARRAY_SIZE, M_DEVBUF); contigfree(pAdapter->responsesArrayBaseAddr, RESPONSES_ARRAY_SIZE, M_DEVBUF); Modified: stable/9/sys/dev/isci/scil/scif_sas_domain.c ============================================================================== --- stable/9/sys/dev/isci/scil/scif_sas_domain.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/dev/isci/scil/scif_sas_domain.c Wed Oct 9 19:04:48 2013 (r256219) @@ -637,7 +637,7 @@ void scif_sas_domain_terminate_requests( SCIF_SAS_REQUEST_T * request = NULL; // Cycle through the fast list of IO requests. Terminate each - // oustanding requests that matches the criteria supplied by the + // outstanding requests that matches the criteria supplied by the // caller. while (element != NULL) { @@ -1275,7 +1275,7 @@ U8 scif_sas_domain_get_smp_request_count SCIC_TRANSPORT_PROTOCOL protocol; // Cycle through the fast list of IO requests. Terminate each - // oustanding requests that matches the criteria supplied by the + // outstanding requests that matches the criteria supplied by the // caller. while (element != NULL) { Modified: stable/9/sys/dev/nsp/nsp.c ============================================================================== --- stable/9/sys/dev/nsp/nsp.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/dev/nsp/nsp.c Wed Oct 9 19:04:48 2013 (r256219) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); ***************************************************/ /* DEVICE CONFIGURATION FLAGS (MINOR) * - * 0x01 DISCONECT OFF + * 0x01 DISCONNECT OFF * 0x02 PARITY LINE OFF * 0x04 IDENTIFY MSG OFF ( = single lun) * 0x08 SYNC TRANSFER OFF Modified: stable/9/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/9/sys/dev/sfxge/common/efx_mcdi.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/dev/sfxge/common/efx_mcdi.c Wed Oct 9 19:04:48 2013 (r256219) @@ -86,7 +86,7 @@ efx_mcdi_request_start( /* * efx_mcdi_request_start() is naturally serialised against both * efx_mcdi_request_poll() and efx_mcdi_ev_cpl()/efx_mcdi_ev_death(), - * by virtue of there only being one oustanding MCDI request. + * by virtue of there only being one outstanding MCDI request. * Unfortunately, upper layers may also call efx_mcdi_request_abort() * at any time, to timeout a pending mcdi request, That request may * then subsequently complete, meaning efx_mcdi_ev_cpl() or @@ -439,7 +439,7 @@ efx_mcdi_ev_death( * The MCDI request (if there is one) has been terminated, either * by a BADASSERT or REBOOT event. * - * If there is an oustanding event-completed MCDI operation, then we + * If there is an outstanding event-completed MCDI operation, then we * will never receive the completion event (because both MCDI * completions and BADASSERT events are sent to the same evq). So * complete this MCDI op. Modified: stable/9/sys/dev/sn/if_sn.c ============================================================================== --- stable/9/sys/dev/sn/if_sn.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/dev/sn/if_sn.c Wed Oct 9 19:04:48 2013 (r256219) @@ -444,7 +444,7 @@ startagain: /* * Wait a short amount of time to see if the allocation request * completes. Otherwise, I enable the interrupt and wait for - * completion asyncronously. + * completion asynchronously. */ time_out = MEMORY_WAIT_TIME; Modified: stable/9/sys/dev/stg/tmc18c30.c ============================================================================== --- stable/9/sys/dev/stg/tmc18c30.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/dev/stg/tmc18c30.c Wed Oct 9 19:04:48 2013 (r256219) @@ -87,7 +87,7 @@ __FBSDID("$FreeBSD$"); ***************************************************/ /* DEVICE CONFIGURATION FLAGS (MINOR) * - * 0x01 DISCONECT OFF + * 0x01 DISCONNECT OFF * 0x02 PARITY LINE OFF * 0x04 IDENTIFY MSG OFF ( = single lun) * 0x08 SYNC TRANSFER OFF Modified: stable/9/sys/kern/uipc_usrreq.c ============================================================================== --- stable/9/sys/kern/uipc_usrreq.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/kern/uipc_usrreq.c Wed Oct 9 19:04:48 2013 (r256219) @@ -1342,7 +1342,7 @@ unp_connect(struct socket *so, struct so } /* - * The connecter's (client's) credentials are copied from its + * The connector's (client's) credentials are copied from its * process structure at the time of connect() (which is now). */ cru2x(td->td_ucred, &unp3->unp_peercred); Modified: stable/9/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c ============================================================================== --- stable/9/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c Wed Oct 9 19:04:48 2013 (r256219) @@ -306,7 +306,7 @@ ng_l2cap_con_fail(ng_l2cap_con_p con, u_ /* * There still might be channels (in OPEN state?) that - * did not submit any commands, so diconnect them + * did not submit any commands, so disconnect them */ LIST_FOREACH(ch, &l2cap->chan_list, next) Modified: stable/9/sys/ofed/drivers/net/mlx4/eq.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/eq.c Wed Oct 9 19:04:40 2013 (r256218) +++ stable/9/sys/ofed/drivers/net/mlx4/eq.c Wed Oct 9 19:04:48 2013 (r256219) @@ -705,7 +705,7 @@ int mlx4_test_interrupts(struct mlx4_dev /* Temporary use polling for command completions */ mlx4_cmd_use_polling(dev); - /* Map the new eq to handle all asyncronous events */ + /* Map the new eq to handle all asynchronous events */ err = mlx4_MAP_EQ(dev, MLX4_ASYNC_EVENT_MASK, 0, priv->eq_table.eq[i].eqn); if (err) { From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:16:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 99AC4117; Wed, 9 Oct 2013 19:16:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 863002E96; Wed, 9 Oct 2013 19:16:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99JGtAs070835; Wed, 9 Oct 2013 19:16:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JGs7r070816; Wed, 9 Oct 2013 19:16:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091916.r99JGs7r070816@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 19:16: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: r256220 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:16:55 -0000 Author: mav Date: Wed Oct 9 19:16:54 2013 New Revision: 256220 URL: http://svnweb.freebsd.org/changeset/base/256220 Log: MFC r253958: Change CCB queue resize logic to be able safely handle overallocations: - (re)allocate queue space in power of 2 chunks with 64 elements minimum and never shrink it; with only 4/8 bytes per element size is insignificant. - automatically reallocate the queue to double size if it is overflowed. - if queue reallocation failed, store extra CCBs in unsorted TAILQ, fetching them back as soon as some queue element is freed. To free space in CCB for TAILQ linking, change highpowerq from keeping high-power CCBs to keeping devices frozen due to high-power CCBs. This encloses all pieces of queue resize logic inside of cam_queue.[ch], removing some not obvious duties from xpt_release_ccb(). Modified: stable/9/sys/cam/cam.h stable/9/sys/cam/cam_queue.c stable/9/sys/cam/cam_queue.h stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/cam_xpt_internal.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam.h ============================================================================== --- stable/9/sys/cam/cam.h Wed Oct 9 19:04:48 2013 (r256219) +++ stable/9/sys/cam/cam.h Wed Oct 9 19:16:54 2013 (r256220) @@ -88,6 +88,7 @@ typedef struct { #define CAM_UNQUEUED_INDEX -1 #define CAM_ACTIVE_INDEX -2 #define CAM_DONEQ_INDEX -3 +#define CAM_EXTRAQ_INDEX INT_MAX } cam_pinfo; /* Modified: stable/9/sys/cam/cam_queue.c ============================================================================== --- stable/9/sys/cam/cam_queue.c Wed Oct 9 19:04:48 2013 (r256219) +++ stable/9/sys/cam/cam_queue.c Wed Oct 9 19:16:54 2013 (r256220) @@ -284,39 +284,24 @@ u_int32_t cam_ccbq_resize(struct cam_ccbq *ccbq, int new_size) { int delta; - int space_left; delta = new_size - (ccbq->dev_active + ccbq->dev_openings); - space_left = new_size - - ccbq->queue.entries - - ccbq->held - - ccbq->dev_active; - - /* - * Only attempt to change the underlying queue size if we are - * shrinking it and there is space for all outstanding entries - * in the new array or we have been requested to grow the array. - * We don't fail in the case where we can't reduce the array size, - * but clients that care that the queue be "garbage collected" - * should detect this condition and call us again with the - * same size once the outstanding entries have been processed. - */ - if (space_left < 0 - || camq_resize(&ccbq->queue, new_size + (CAM_RL_VALUES - 1)) == - CAM_REQ_CMP) { - ccbq->devq_openings += delta; - ccbq->dev_openings += delta; + ccbq->devq_openings += delta; + ccbq->dev_openings += delta; + + new_size = imax(64, 1 << fls(new_size + new_size / 2)); + if (new_size > ccbq->queue.array_size) + return (camq_resize(&ccbq->queue, new_size)); + else return (CAM_REQ_CMP); - } else { - return (CAM_RESRC_UNAVAIL); - } } int cam_ccbq_init(struct cam_ccbq *ccbq, int openings) { bzero(ccbq, sizeof(*ccbq)); - if (camq_init(&ccbq->queue, openings + (CAM_RL_VALUES - 1)) != 0) + if (camq_init(&ccbq->queue, + imax(64, 1 << fls(openings + openings / 2))) != 0) return (1); ccbq->devq_openings = openings; ccbq->dev_openings = openings; Modified: stable/9/sys/cam/cam_queue.h ============================================================================== --- stable/9/sys/cam/cam_queue.h Wed Oct 9 19:04:48 2013 (r256219) +++ stable/9/sys/cam/cam_queue.h Wed Oct 9 19:16:54 2013 (r256220) @@ -57,6 +57,8 @@ SLIST_HEAD(ccb_hdr_slist, ccb_hdr); struct cam_ccbq { struct camq queue; + struct ccb_hdr_tailq queue_extra_head; + int queue_extra_entries; int devq_openings; int devq_allocating; int dev_openings; @@ -177,7 +179,7 @@ cam_ccbq_release_opening(struct cam_ccbq static __inline int cam_ccbq_pending_ccb_count(struct cam_ccbq *ccbq) { - return (ccbq->queue.entries); + return (ccbq->queue.entries + ccbq->queue_extra_entries); } static __inline void @@ -190,14 +192,61 @@ cam_ccbq_take_opening(struct cam_ccbq *c static __inline void cam_ccbq_insert_ccb(struct cam_ccbq *ccbq, union ccb *new_ccb) { + struct ccb_hdr *old_ccb; + struct camq *queue = &ccbq->queue; + ccbq->held--; - camq_insert(&ccbq->queue, &new_ccb->ccb_h.pinfo); + + /* + * If queue is already full, try to resize. + * If resize fail, push CCB with lowest priority out to the TAILQ. + */ + if (queue->entries == queue->array_size && + camq_resize(&ccbq->queue, queue->array_size * 2) != CAM_REQ_CMP) { + old_ccb = (struct ccb_hdr *)camq_remove(queue, queue->entries); + TAILQ_INSERT_HEAD(&ccbq->queue_extra_head, old_ccb, + xpt_links.tqe); + old_ccb->pinfo.index = CAM_EXTRAQ_INDEX; + ccbq->queue_extra_entries++; + } + + camq_insert(queue, &new_ccb->ccb_h.pinfo); } static __inline void cam_ccbq_remove_ccb(struct cam_ccbq *ccbq, union ccb *ccb) { - camq_remove(&ccbq->queue, ccb->ccb_h.pinfo.index); + struct ccb_hdr *cccb, *bccb; + struct camq *queue = &ccbq->queue; + + /* If the CCB is on the TAILQ, remove it from there. */ + if (ccb->ccb_h.pinfo.index == CAM_EXTRAQ_INDEX) { + TAILQ_REMOVE(&ccbq->queue_extra_head, &ccb->ccb_h, + xpt_links.tqe); + ccb->ccb_h.pinfo.index = CAM_UNQUEUED_INDEX; + ccbq->queue_extra_entries--; + return; + } + + camq_remove(queue, ccb->ccb_h.pinfo.index); + + /* + * If there are some CCBs on TAILQ, find the best one and move it + * to the emptied space in the queue. + */ + bccb = TAILQ_FIRST(&ccbq->queue_extra_head); + if (bccb == NULL) + return; + TAILQ_FOREACH(cccb, &ccbq->queue_extra_head, xpt_links.tqe) { + if (bccb->pinfo.priority > cccb->pinfo.priority || + (bccb->pinfo.priority == cccb->pinfo.priority && + GENERATIONCMP(bccb->pinfo.generation, >, + cccb->pinfo.generation))) + bccb = cccb; + } + TAILQ_REMOVE(&ccbq->queue_extra_head, bccb, xpt_links.tqe); + ccbq->queue_extra_entries--; + camq_insert(queue, &bccb->pinfo); } static __inline union ccb * Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Oct 9 19:04:48 2013 (r256219) +++ stable/9/sys/cam/cam_xpt.c Wed Oct 9 19:16:54 2013 (r256220) @@ -99,7 +99,7 @@ struct xpt_softc { u_int32_t xpt_generation; /* number of high powered commands that can go through right now */ - STAILQ_HEAD(highpowerlist, ccb_hdr) highpowerq; + STAILQ_HEAD(highpowerlist, cam_ed) highpowerq; int num_highpower; /* queue for handling async rescan requests. */ @@ -2721,7 +2721,7 @@ xpt_action_default(union ccb *start_ccb) cgds->dev_openings = dev->ccbq.dev_openings; cgds->dev_active = dev->ccbq.dev_active; cgds->devq_openings = dev->ccbq.devq_openings; - cgds->devq_queued = dev->ccbq.queue.entries; + cgds->devq_queued = cam_ccbq_pending_ccb_count(&dev->ccbq); cgds->held = dev->ccbq.held; cgds->last_reset = tar->last_reset; cgds->maxtags = dev->maxtags; @@ -3292,8 +3292,8 @@ xpt_run_devq(struct cam_devq *devq) */ xpt_freeze_devq(work_ccb->ccb_h.path, 1); STAILQ_INSERT_TAIL(&xsoftc.highpowerq, - &work_ccb->ccb_h, - xpt_links.stqe); + work_ccb->ccb_h.path->device, + highpowerq_entry); mtx_unlock(&xsoftc.xpt_lock); continue; @@ -3815,11 +3815,6 @@ xpt_release_ccb(union ccb *free_ccb) mtx_assert(sim->mtx, MA_OWNED); cam_ccbq_release_opening(&device->ccbq); - if (device->flags & CAM_DEV_RESIZE_QUEUE_NEEDED) { - device->flags &= ~CAM_DEV_RESIZE_QUEUE_NEEDED; - cam_ccbq_resize(&device->ccbq, - device->ccbq.dev_openings + device->ccbq.dev_active); - } if (sim->ccb_count > sim->max_ccbs) { xpt_free_ccb(free_ccb); sim->ccb_count--; @@ -4619,9 +4614,6 @@ xpt_dev_ccbq_resize(struct cam_path *pat diff = newopenings - (dev->ccbq.dev_active + dev->ccbq.dev_openings); result = cam_ccbq_resize(&dev->ccbq, newopenings); - if (result == CAM_REQ_CMP && (diff < 0)) { - dev->flags |= CAM_DEV_RESIZE_QUEUE_NEEDED; - } if ((dev->flags & CAM_DEV_TAG_AFTER_COUNT) != 0 || (dev->inq_flags & SID_CmdQue) != 0) dev->tag_saved_openings = newopenings; @@ -5003,12 +4995,12 @@ camisr_runqueue(void *V_queue) if (ccb_h->flags & CAM_HIGH_POWER) { struct highpowerlist *hphead; - union ccb *send_ccb; + struct cam_ed *device; mtx_lock(&xsoftc.xpt_lock); hphead = &xsoftc.highpowerq; - send_ccb = (union ccb *)STAILQ_FIRST(hphead); + device = STAILQ_FIRST(hphead); /* * Increment the count since this command is done. @@ -5018,12 +5010,12 @@ camisr_runqueue(void *V_queue) /* * Any high powered commands queued up? */ - if (send_ccb != NULL) { + if (device != NULL) { - STAILQ_REMOVE_HEAD(hphead, xpt_links.stqe); + STAILQ_REMOVE_HEAD(hphead, highpowerq_entry); mtx_unlock(&xsoftc.xpt_lock); - xpt_release_devq(send_ccb->ccb_h.path, + xpt_release_devq_device(device, /*count*/1, /*runqueue*/TRUE); } else mtx_unlock(&xsoftc.xpt_lock); Modified: stable/9/sys/cam/cam_xpt_internal.h ============================================================================== --- stable/9/sys/cam/cam_xpt_internal.h Wed Oct 9 19:04:48 2013 (r256219) +++ stable/9/sys/cam/cam_xpt_internal.h Wed Oct 9 19:16:54 2013 (r256220) @@ -115,7 +115,6 @@ struct cam_ed { #define CAM_DEV_REL_TIMEOUT_PENDING 0x02 #define CAM_DEV_REL_ON_COMPLETE 0x04 #define CAM_DEV_REL_ON_QUEUE_EMPTY 0x08 -#define CAM_DEV_RESIZE_QUEUE_NEEDED 0x10 #define CAM_DEV_TAG_AFTER_COUNT 0x20 #define CAM_DEV_INQUIRY_DATA_VALID 0x40 #define CAM_DEV_IN_DV 0x80 @@ -126,6 +125,7 @@ struct cam_ed { u_int32_t tag_saved_openings; u_int32_t refcount; struct callout callout; + STAILQ_ENTRY(cam_ed) highpowerq_entry; }; /* From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:18:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B3C3526C; Wed, 9 Oct 2013 19:18:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A07CF2EA1; Wed, 9 Oct 2013 19:18:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99JIZYh071323; Wed, 9 Oct 2013 19:18:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JIZCd071322; Wed, 9 Oct 2013 19:18:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091918.r99JIZCd071322@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 19:18: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: r256221 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:18:35 -0000 Author: mav Date: Wed Oct 9 19:18:35 2013 New Revision: 256221 URL: http://svnweb.freebsd.org/changeset/base/256221 Log: MFC r253960: Pass SIM pointer as an argument to camisr_runqueue() instead of doneq pointer. Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Oct 9 19:16:54 2013 (r256220) +++ stable/9/sys/cam/cam_xpt.c Wed Oct 9 19:18:35 2013 (r256221) @@ -246,7 +246,7 @@ static xpt_devicefunc_t xptpassannouncef static void xptaction(struct cam_sim *sim, union ccb *work_ccb); static void xptpoll(struct cam_sim *sim); static void camisr(void *); -static void camisr_runqueue(void *); +static void camisr_runqueue(struct cam_sim *); static dev_match_ret xptbusmatch(struct dev_match_pattern *patterns, u_int num_patterns, struct cam_eb *bus); static dev_match_ret xptdevicematch(struct dev_match_pattern *patterns, @@ -3089,7 +3089,7 @@ xpt_polled_action(union ccb *start_ccb) dev->ccbq.dev_openings < 0) && (--timeout > 0)) { DELAY(100); (*(sim->sim_poll))(sim); - camisr_runqueue(&sim->sim_doneq); + camisr_runqueue(sim); } dev->ccbq.devq_openings++; @@ -3099,7 +3099,7 @@ xpt_polled_action(union ccb *start_ccb) xpt_action(start_ccb); while(--timeout > 0) { (*(sim->sim_poll))(sim); - camisr_runqueue(&sim->sim_doneq); + camisr_runqueue(sim); if ((start_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG) break; @@ -4346,7 +4346,7 @@ xpt_batch_done(struct cam_sim *sim) sim->flags &= ~CAM_SIM_BATCH; if (!TAILQ_EMPTY(&sim->sim_doneq) && (sim->flags & CAM_SIM_ON_DONEQ) == 0) - camisr_runqueue(&sim->sim_doneq); + camisr_runqueue(sim); } union ccb * @@ -4967,7 +4967,7 @@ camisr(void *dummy) while ((sim = TAILQ_FIRST(&queue)) != NULL) { TAILQ_REMOVE(&queue, sim, links); CAM_SIM_LOCK(sim); - camisr_runqueue(&sim->sim_doneq); + camisr_runqueue(sim); sim->flags &= ~CAM_SIM_ON_DONEQ; CAM_SIM_UNLOCK(sim); } @@ -4977,15 +4977,14 @@ camisr(void *dummy) } static void -camisr_runqueue(void *V_queue) +camisr_runqueue(struct cam_sim *sim) { - cam_isrq_t *queue = V_queue; struct ccb_hdr *ccb_h; - while ((ccb_h = TAILQ_FIRST(queue)) != NULL) { + while ((ccb_h = TAILQ_FIRST(&sim->sim_doneq)) != NULL) { int runq; - TAILQ_REMOVE(queue, ccb_h, sim_links.tqe); + TAILQ_REMOVE(&sim->sim_doneq, ccb_h, sim_links.tqe); ccb_h->pinfo.index = CAM_UNQUEUED_INDEX; CAM_DEBUG(ccb_h->path, CAM_DEBUG_TRACE, @@ -5027,8 +5026,8 @@ camisr_runqueue(void *V_queue) dev = ccb_h->path->device; cam_ccbq_ccb_done(&dev->ccbq, (union ccb *)ccb_h); - ccb_h->path->bus->sim->devq->send_active--; - ccb_h->path->bus->sim->devq->send_openings++; + sim->devq->send_active--; + sim->devq->send_openings++; runq = TRUE; if (((dev->flags & CAM_DEV_REL_ON_QUEUE_EMPTY) != 0 @@ -5049,14 +5048,12 @@ camisr_runqueue(void *V_queue) && (--dev->tag_delay_count == 0)) xpt_start_tags(ccb_h->path); if (!device_is_queued(dev)) { - (void)xpt_schedule_devq( - ccb_h->path->bus->sim->devq, dev); + (void)xpt_schedule_devq(sim->devq, dev); } } if (ccb_h->status & CAM_RELEASE_SIMQ) { - xpt_release_simq(ccb_h->path->bus->sim, - /*run_queue*/TRUE); + xpt_release_simq(sim, /*run_queue*/TRUE); ccb_h->status &= ~CAM_RELEASE_SIMQ; runq = FALSE; } @@ -5067,7 +5064,7 @@ camisr_runqueue(void *V_queue) /*run_queue*/TRUE); ccb_h->status &= ~CAM_DEV_QFRZN; } else if (runq) { - xpt_run_devq(ccb_h->path->bus->sim->devq); + xpt_run_devq(sim->devq); } /* Call the peripheral driver's callback */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:19:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C302C459; Wed, 9 Oct 2013 19:19:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B077D2EB4; Wed, 9 Oct 2013 19:19:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99JJsRP071782; Wed, 9 Oct 2013 19:19:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JJspE071780; Wed, 9 Oct 2013 19:19:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091919.r99JJspE071780@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 19:19: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: r256222 - stable/9/sys/cam/ctl 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, 09 Oct 2013 19:19:54 -0000 Author: mav Date: Wed Oct 9 19:19:53 2013 New Revision: 256222 URL: http://svnweb.freebsd.org/changeset/base/256222 Log: MFC r253987 (by trasz): Remove dead code. Modified: stable/9/sys/cam/ctl/ctl.c stable/9/sys/cam/ctl/ctl_frontend_internal.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Wed Oct 9 19:18:35 2013 (r256221) +++ stable/9/sys/cam/ctl/ctl.c Wed Oct 9 19:19:53 2013 (r256222) @@ -8950,17 +8950,7 @@ ctl_inquiry_evpd_supported(struct ctl_sc sup_page_size = sizeof(struct scsi_vpd_supported_pages) + SCSI_EVPD_NUM_SUPPORTED_PAGES; - /* - * XXX KDM GFP_??? We probably don't want to wait here, - * unless we end up having a process/thread context. - */ ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK | M_ZERO); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } pages = (struct scsi_vpd_supported_pages *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -9015,14 +9005,7 @@ ctl_inquiry_evpd_serial(struct ctl_scsii lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - /* XXX KDM which malloc flags here?? */ ctsio->kern_data_ptr = malloc(sizeof(*sn_ptr), M_CTL, M_WAITOK | M_ZERO); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } sn_ptr = (struct scsi_vpd_unit_serial_number *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -9107,14 +9090,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio sizeof(struct scsi_vpd_id_descriptor) + sizeof(struct scsi_vpd_id_trgt_port_grp_id); - /* XXX KDM which malloc flags here ?? */ ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK | M_ZERO); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } devid_ptr = (struct scsi_vpd_device_id *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -9337,14 +9313,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio * in. If the user only asks for less, we'll give him * that much. */ - /* XXX KDM what malloc flags should we use here?? */ ctsio->kern_data_ptr = malloc(sizeof(*inq_ptr), M_CTL, M_WAITOK | M_ZERO); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } inq_ptr = (struct scsi_inquiry_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; ctsio->kern_data_resid = 0; Modified: stable/9/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_frontend_internal.c Wed Oct 9 19:18:35 2013 (r256221) +++ stable/9/sys/cam/ctl/ctl_frontend_internal.c Wed Oct 9 19:19:53 2013 (r256222) @@ -495,9 +495,6 @@ cfi_lun_disable(void *arg, struct ctl_id return (0); } -/* - * XXX KDM run this inside a thread, or inside the caller's context? - */ static void cfi_datamove(union ctl_io *io) { @@ -537,18 +534,8 @@ cfi_datamove(union ctl_io *io) ext_sglen = ctsio->ext_sg_entries * sizeof(*ext_sglist); - /* - * XXX KDM GFP_KERNEL, don't know what the caller's context - * is. Need to figure that out. - */ ext_sglist = (struct ctl_sg_entry *)malloc(ext_sglen, M_CTL_CFI, M_WAITOK); - if (ext_sglist == NULL) { - ctl_set_internal_failure(ctsio, - /*sks_valid*/ 0, - /*retry_count*/ 0); - return; - } ext_sglist_malloced = 1; if (memcpy(ext_sglist, ctsio->ext_data_ptr, ext_sglen) != 0) { ctl_set_internal_failure(ctsio, From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:22:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 660D2651; Wed, 9 Oct 2013 19:22:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 535922EF9; Wed, 9 Oct 2013 19:22:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99JM25P074628; Wed, 9 Oct 2013 19:22:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JM1i3074624; Wed, 9 Oct 2013 19:22:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091922.r99JM1i3074624@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 19:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256223 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:22:02 -0000 Author: mav Date: Wed Oct 9 19:22:01 2013 New Revision: 256223 URL: http://svnweb.freebsd.org/changeset/base/256223 Log: MFC r254058: Remove droping topology mutex after iterating 100 periphs in CAMGETPASSTHRU. That is not so slow and so often operation to handle unneeded otherwise xsoftc.xpt_generation and respective locking complications. Modified: stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/cam_xpt_periph.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Wed Oct 9 19:19:53 2013 (r256222) +++ stable/9/sys/cam/cam_periph.c Wed Oct 9 19:22:01 2013 (r256223) @@ -258,7 +258,7 @@ failure: break; case 3: CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); - xpt_remove_periph(periph, /*topology_lock_held*/ 0); + xpt_remove_periph(periph); /* FALLTHROUGH */ case 2: xpt_lock_buses(); @@ -645,7 +645,7 @@ camperiphfree(struct cam_periph *periph) TAILQ_REMOVE(&(*p_drv)->units, periph, unit_links); (*p_drv)->generation++; - xpt_remove_periph(periph, /*topology_lock_held*/ 1); + xpt_remove_periph(periph); xpt_unlock_buses(); CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Oct 9 19:19:53 2013 (r256222) +++ stable/9/sys/cam/cam_xpt.c Wed Oct 9 19:22:01 2013 (r256223) @@ -96,7 +96,6 @@ typedef enum { struct xpt_softc { xpt_flags flags; - u_int32_t xpt_generation; /* number of high powered commands that can go through right now */ STAILQ_HEAD(highpowerlist, cam_ed) highpowerq; @@ -608,24 +607,11 @@ xptdoioctl(struct cdev *dev, u_long cmd, struct periph_driver **p_drv; char *name; u_int unit; - u_int cur_generation; int base_periph_found; - int splbreaknum; ccb = (union ccb *)addr; unit = ccb->cgdl.unit_number; name = ccb->cgdl.periph_name; - /* - * Every 100 devices, we want to drop our lock protection to - * give the software interrupt handler a chance to run. - * Most systems won't run into this check, but this should - * avoid starvation in the software interrupt handler in - * large systems. - */ - splbreaknum = 100; - - ccb = (union ccb *)addr; - base_periph_found = 0; /* @@ -639,8 +625,6 @@ xptdoioctl(struct cdev *dev, u_long cmd, /* Keep the list from changing while we traverse it */ xpt_lock_buses(); -ptstartover: - cur_generation = xsoftc.xpt_generation; /* first find our driver in the list of drivers */ for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) @@ -667,15 +651,8 @@ ptstartover: for (periph = TAILQ_FIRST(&(*p_drv)->units); periph != NULL; periph = TAILQ_NEXT(periph, unit_links)) { - if (periph->unit_number == unit) { + if (periph->unit_number == unit) break; - } else if (--splbreaknum == 0) { - xpt_unlock_buses(); - xpt_lock_buses(); - splbreaknum = 100; - if (cur_generation != xsoftc.xpt_generation) - goto ptstartover; - } } /* * If we found the peripheral driver that the user passed @@ -1015,15 +992,11 @@ xpt_add_periph(struct cam_periph *periph SLIST_INSERT_HEAD(periph_head, periph, periph_links); } - xpt_lock_buses(); - xsoftc.xpt_generation++; - xpt_unlock_buses(); - return (status); } void -xpt_remove_periph(struct cam_periph *periph, int topology_lock_held) +xpt_remove_periph(struct cam_periph *periph) { struct cam_ed *device; @@ -1043,14 +1016,6 @@ xpt_remove_periph(struct cam_periph *per SLIST_REMOVE(periph_head, periph, cam_periph, periph_links); } - - if (topology_lock_held == 0) - xpt_lock_buses(); - - xsoftc.xpt_generation++; - - if (topology_lock_held == 0) - xpt_unlock_buses(); } Modified: stable/9/sys/cam/cam_xpt_periph.h ============================================================================== --- stable/9/sys/cam/cam_xpt_periph.h Wed Oct 9 19:19:53 2013 (r256222) +++ stable/9/sys/cam/cam_xpt_periph.h Wed Oct 9 19:22:01 2013 (r256223) @@ -42,8 +42,7 @@ void xpt_polled_action(union ccb *ccb); void xpt_release_ccb(union ccb *released_ccb); void xpt_schedule(struct cam_periph *perph, u_int32_t new_priority); int32_t xpt_add_periph(struct cam_periph *periph); -void xpt_remove_periph(struct cam_periph *periph, - int topology_lock_held); +void xpt_remove_periph(struct cam_periph *periph); void xpt_announce_periph(struct cam_periph *periph, char *announce_string); void xpt_announce_quirks(struct cam_periph *periph, From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:23:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A75AB797; Wed, 9 Oct 2013 19:23:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A6E92F08; Wed, 9 Oct 2013 19:23:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99JNDJY075049; Wed, 9 Oct 2013 19:23:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JNDZ9075046; Wed, 9 Oct 2013 19:23:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091923.r99JNDZ9075046@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 19:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256224 - in stable/9/sys/cam: ata 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: Wed, 09 Oct 2013 19:23:13 -0000 Author: mav Date: Wed Oct 9 19:23:12 2013 New Revision: 256224 URL: http://svnweb.freebsd.org/changeset/base/256224 Log: MFC r254329 (by smh): Added 4K quirks for:- * OCZ Agility 2 SSDs * Marvell SSDs * Intel X25-M Series SSDs Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Wed Oct 9 19:22:01 2013 (r256223) +++ stable/9/sys/cam/ata/ata_da.c Wed Oct 9 19:23:12 2013 (r256224) @@ -350,6 +350,14 @@ static struct ada_quirk_entry ada_quirk_ }, { /* + * Intel X25-M Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSA2M*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* * Kingston E100 Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ @@ -366,6 +374,22 @@ static struct ada_quirk_entry ada_quirk_ }, { /* + * Marvell SSDs (entry taken from OpenSolaris) + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "MARVELL SD88SA02*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * OCZ Agility 2 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-AGILITY2*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* * OCZ Agility 3 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Wed Oct 9 19:22:01 2013 (r256223) +++ stable/9/sys/cam/scsi/scsi_da.c Wed Oct 9 19:23:12 2013 (r256224) @@ -1008,6 +1008,14 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * Intel X25-M Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSA2M*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* * Kingston E100 Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ @@ -1024,6 +1032,22 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * Marvell SSDs (entry taken from OpenSolaris) + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "MARVELL SD88SA02*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * OCZ Agility 2 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-AGILITY2*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* * OCZ Agility 3 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:25:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D3DE09AB; Wed, 9 Oct 2013 19:25:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B20722F2C; Wed, 9 Oct 2013 19:25:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99JPNGd076057; Wed, 9 Oct 2013 19:25:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JPM5e076034; Wed, 9 Oct 2013 19:25:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091925.r99JPM5e076034@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 19:25: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: r256225 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:25:24 -0000 Author: mav Date: Wed Oct 9 19:25:22 2013 New Revision: 256225 URL: http://svnweb.freebsd.org/changeset/base/256225 Log: MFC r255126: Add debug trace points for freeze/release device queue. Modified: stable/9/sys/cam/cam_debug.h stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/cam_xpt.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_debug.h ============================================================================== --- stable/9/sys/cam/cam_debug.h Wed Oct 9 19:23:12 2013 (r256224) +++ stable/9/sys/cam/cam_debug.h Wed Oct 9 19:25:22 2013 (r256225) @@ -99,6 +99,17 @@ extern u_int32_t cam_debug_delay; DELAY(cam_debug_delay); \ } +#define CAM_DEBUG_DEV(dev, flag, printfargs) \ + if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags) \ + && (cam_dpath != NULL) \ + && (xpt_path_comp_dev(cam_dpath, dev) >= 0) \ + && (xpt_path_comp_dev(cam_dpath, dev) < 2)) { \ + xpt_print_device(dev); \ + printf printfargs; \ + if (cam_debug_delay != 0) \ + DELAY(cam_debug_delay); \ + } + #define CAM_DEBUG_PRINT(flag, printfargs) \ if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags)) { \ printf("cam_debug: "); \ Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Wed Oct 9 19:23:12 2013 (r256224) +++ stable/9/sys/cam/cam_periph.c Wed Oct 9 19:25:22 2013 (r256225) @@ -1115,6 +1115,7 @@ cam_freeze_devq(struct cam_path *path) { struct ccb_hdr ccb_h; + CAM_DEBUG(path, CAM_DEBUG_TRACE, ("cam_freeze_devq\n")); xpt_setup_ccb(&ccb_h, path, /*priority*/1); ccb_h.func_code = XPT_NOOP; ccb_h.flags = CAM_DEV_QFREEZE; @@ -1128,6 +1129,8 @@ cam_release_devq(struct cam_path *path, { struct ccb_relsim crs; + CAM_DEBUG(path, CAM_DEBUG_TRACE, ("cam_release_devq(%u, %u, %u, %d)\n", + relsim_flags, openings, arg, getcount_only)); xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); crs.ccb_h.func_code = XPT_REL_SIMQ; crs.ccb_h.flags = getcount_only ? CAM_DEV_QFREEZE : 0; Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Oct 9 19:23:12 2013 (r256224) +++ stable/9/sys/cam/cam_xpt.c Wed Oct 9 19:25:22 2013 (r256225) @@ -3594,6 +3594,40 @@ xpt_path_comp(struct cam_path *path1, st return (retval); } +int +xpt_path_comp_dev(struct cam_path *path, struct cam_ed *dev) +{ + int retval = 0; + + if (path->bus != dev->target->bus) { + if (path->bus->path_id == CAM_BUS_WILDCARD) + retval = 1; + else if (dev->target->bus->path_id == CAM_BUS_WILDCARD) + retval = 2; + else + return (-1); + } + if (path->target != dev->target) { + if (path->target->target_id == CAM_TARGET_WILDCARD) { + if (retval == 0) + retval = 1; + } else if (dev->target->target_id == CAM_TARGET_WILDCARD) + retval = 2; + else + return (-1); + } + if (path->device != dev) { + if (path->device->lun_id == CAM_LUN_WILDCARD) { + if (retval == 0) + retval = 1; + } else if (dev->lun_id == CAM_LUN_WILDCARD) + retval = 2; + else + return (-1); + } + return (retval); +} + void xpt_print_path(struct cam_path *path) { @@ -3627,6 +3661,21 @@ xpt_print_path(struct cam_path *path) } void +xpt_print_device(struct cam_ed *device) +{ + + if (device == NULL) + printf("(nopath): "); + else { + printf("(noperiph:%s%d:%d:%d:%d): ", device->sim->sim_name, + device->sim->unit_number, + device->sim->bus_id, + device->target->target_id, + device->lun_id); + } +} + +void xpt_print(struct cam_path *path, const char *fmt, ...) { va_list ap; @@ -4147,6 +4196,8 @@ xpt_freeze_devq(struct cam_path *path, u struct cam_ed *dev = path->device; mtx_assert(path->bus->sim->mtx, MA_OWNED); + CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_freeze_devq() %u->%u\n", + dev->ccbq.queue.qfrozen_cnt, dev->ccbq.queue.qfrozen_cnt + count)); dev->ccbq.queue.qfrozen_cnt += count; /* Remove frozen device from sendq. */ if (device_is_queued(dev)) { @@ -4171,6 +4222,7 @@ xpt_release_devq_timeout(void *arg) struct cam_ed *device; device = (struct cam_ed *)arg; + CAM_DEBUG_DEV(device, CAM_DEBUG_TRACE, ("xpt_release_devq_timeout\n")); xpt_release_devq_device(device, /*count*/1, /*run_queue*/TRUE); } @@ -4179,6 +4231,8 @@ xpt_release_devq(struct cam_path *path, { mtx_assert(path->bus->sim->mtx, MA_OWNED); + CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_release_devq(%d, %d)\n", + count, run_queue)); xpt_release_devq_device(path->device, count, run_queue); } @@ -4186,6 +4240,9 @@ void xpt_release_devq_device(struct cam_ed *dev, u_int count, int run_queue) { + CAM_DEBUG_DEV(dev, CAM_DEBUG_TRACE, + ("xpt_release_devq_device(%d, %d) %u->%u\n", count, run_queue, + dev->ccbq.queue.qfrozen_cnt, dev->ccbq.queue.qfrozen_cnt - count)); if (count > dev->ccbq.queue.qfrozen_cnt) { #ifdef INVARIANTS printf("xpt_release_devq(): requested %u > present %u\n", Modified: stable/9/sys/cam/cam_xpt.h ============================================================================== --- stable/9/sys/cam/cam_xpt.h Wed Oct 9 19:23:12 2013 (r256224) +++ stable/9/sys/cam/cam_xpt.h Wed Oct 9 19:25:22 2013 (r256225) @@ -35,6 +35,7 @@ /* Forward Declarations */ union ccb; struct cam_periph; +struct cam_ed; struct cam_sim; /* @@ -89,7 +90,10 @@ void xpt_path_counts(struct cam_path * uint32_t *device_ref); int xpt_path_comp(struct cam_path *path1, struct cam_path *path2); +int xpt_path_comp_dev(struct cam_path *path, + struct cam_ed *dev); void xpt_print_path(struct cam_path *path); +void xpt_print_device(struct cam_ed *device); void xpt_print(struct cam_path *path, const char *fmt, ...); int xpt_path_string(struct cam_path *path, char *str, size_t str_len); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:26:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DCBD7B5D; Wed, 9 Oct 2013 19:26:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF95D2F3D; Wed, 9 Oct 2013 19:26:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99JQZrb076713; Wed, 9 Oct 2013 19:26:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JQZSl076712; Wed, 9 Oct 2013 19:26:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091926.r99JQZSl076712@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 19:26: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: r256226 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:26:36 -0000 Author: mav Date: Wed Oct 9 19:26:35 2013 New Revision: 256226 URL: http://svnweb.freebsd.org/changeset/base/256226 Log: MFC r255304: Fix kernel panic if cache->nelms is zero. Modified: stable/9/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_enc_ses.c Wed Oct 9 19:25:22 2013 (r256225) +++ stable/9/sys/cam/scsi/scsi_enc_ses.c Wed Oct 9 19:26:35 2013 (r256226) @@ -567,8 +567,8 @@ ses_cache_free_elm_addlstatus(enc_softc_ return; for (cur_elm = cache->elm_map, - last_elm = &cache->elm_map[cache->nelms - 1]; - cur_elm <= last_elm; cur_elm++) { + last_elm = &cache->elm_map[cache->nelms]; + cur_elm != last_elm; cur_elm++) { ses_element_t *elmpriv; elmpriv = cur_elm->elm_private; @@ -598,8 +598,8 @@ ses_cache_free_elm_descs(enc_softc_t *en return; for (cur_elm = cache->elm_map, - last_elm = &cache->elm_map[cache->nelms - 1]; - cur_elm <= last_elm; cur_elm++) { + last_elm = &cache->elm_map[cache->nelms]; + cur_elm != last_elm; cur_elm++) { ses_element_t *elmpriv; elmpriv = cur_elm->elm_private; @@ -644,8 +644,8 @@ ses_cache_free_elm_map(enc_softc_t *enc, ses_cache_free_elm_descs(enc, cache); ses_cache_free_elm_addlstatus(enc, cache); for (cur_elm = cache->elm_map, - last_elm = &cache->elm_map[cache->nelms - 1]; - cur_elm <= last_elm; cur_elm++) { + last_elm = &cache->elm_map[cache->nelms]; + cur_elm != last_elm; cur_elm++) { ENC_FREE_AND_NULL(cur_elm->elm_private); } @@ -717,8 +717,8 @@ ses_cache_clone(enc_softc_t *enc, enc_ca dst->elm_map = ENC_MALLOCZ(dst->nelms * sizeof(enc_element_t)); memcpy(dst->elm_map, src->elm_map, dst->nelms * sizeof(enc_element_t)); for (dst_elm = dst->elm_map, src_elm = src->elm_map, - last_elm = &src->elm_map[src->nelms - 1]; - src_elm <= last_elm; src_elm++, dst_elm++) { + last_elm = &src->elm_map[src->nelms]; + src_elm != last_elm; src_elm++, dst_elm++) { dst_elm->elm_private = ENC_MALLOCZ(sizeof(ses_element_t)); memcpy(dst_elm->elm_private, src_elm->elm_private, From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:28:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AE628CFC; Wed, 9 Oct 2013 19:28:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B1BB2F64; Wed, 9 Oct 2013 19:28:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99JS7tq077291; Wed, 9 Oct 2013 19:28:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JS7um077290; Wed, 9 Oct 2013 19:28:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091928.r99JS7um077290@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 19:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256227 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:28:07 -0000 Author: mav Date: Wed Oct 9 19:28:07 2013 New Revision: 256227 URL: http://svnweb.freebsd.org/changeset/base/256227 Log: MFC r255309: Make SES driver adequately react on simple enclosure devices -- read Short Enclosure status to enclosure status field, clear previous state and exit. Modified: stable/9/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_enc_ses.c Wed Oct 9 19:26:35 2013 (r256226) +++ stable/9/sys/cam/scsi/scsi_enc_ses.c Wed Oct 9 19:28:07 2013 (r256227) @@ -1555,6 +1555,18 @@ ses_process_status(enc_softc_t *enc, str ENC_VLOG(enc, "Enclosure Status Page Too Long\n"); goto out; } + + /* Check for simple enclosure reporting short enclosure status. */ + if (length >= 4 && page->hdr.page_code == SesShortStatus) { + ENC_DLOG(enc, "Got Short Enclosure Status page\n"); + ses->ses_flags &= ~(SES_FLAG_ADDLSTATUS | SES_FLAG_DESC); + ses_cache_free(enc, enc_cache); + enc_cache->enc_status = page->hdr.page_specific_flags; + enc_update_request(enc, SES_PUBLISH_CACHE); + err = 0; + goto out; + } + /* Make sure the length contains at least one header and status */ if (length < (sizeof(*page) + sizeof(*page->elements))) { ENC_VLOG(enc, "Enclosure Status Page Too Short\n"); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:28:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D8198E36; Wed, 9 Oct 2013 19:28:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C57F72F6C; Wed, 9 Oct 2013 19:28:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99JSu6v077471; Wed, 9 Oct 2013 19:28:56 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JSugi077470; Wed, 9 Oct 2013 19:28:56 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310091928.r99JSugi077470@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 9 Oct 2013 19:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256228 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:28:56 -0000 Author: trasz Date: Wed Oct 9 19:28:56 2013 New Revision: 256228 URL: http://svnweb.freebsd.org/changeset/base/256228 Log: Fail connection upon receiving too large data segment. Approved by: re (glebius) Sponsored by: FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Wed Oct 9 19:28:07 2013 (r256227) +++ head/sys/dev/iscsi/icl.c Wed Oct 9 19:28:56 2013 (r256228) @@ -564,6 +564,7 @@ icl_conn_receive_pdu(struct icl_conn *ic "MaxDataSegmentLength %zd; " "dropping connection", len, ic->ic_max_data_segment_length); + error = EINVAL; break; } From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:30:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0CF25F92; Wed, 9 Oct 2013 19:30:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DFA612F7B; Wed, 9 Oct 2013 19:30:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99JUDgL077819; Wed, 9 Oct 2013 19:30:13 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JUDvR077818; Wed, 9 Oct 2013 19:30:13 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310091930.r99JUDvR077818@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 9 Oct 2013 19:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256229 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:30:14 -0000 Author: trasz Date: Wed Oct 9 19:30:13 2013 New Revision: 256229 URL: http://svnweb.freebsd.org/changeset/base/256229 Log: Be extra paranoid with values obtained from the target. Approved by: re (glebius) Sponsored by: FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Wed Oct 9 19:28:56 2013 (r256228) +++ head/sys/dev/iscsi/iscsi.c Wed Oct 9 19:30:13 2013 (r256229) @@ -950,18 +950,16 @@ iscsi_pdu_handle_data_in(struct icl_pdu csio = &io->io_ccb->csio; - if (ntohl(bhsdi->bhsdi_buffer_offset) + data_segment_len > - csio->dxfer_len) { + if (io->io_received + data_segment_len > csio->dxfer_len) { ISCSI_SESSION_WARN(is, "oversize data segment (%zd bytes " - "at offset %d, buffer is %d)", - data_segment_len, ntohl(bhsdi->bhsdi_buffer_offset), - csio->dxfer_len); + "at offset %zd, buffer is %d)", + data_segment_len, io->io_received, csio->dxfer_len); icl_pdu_free(response); iscsi_session_reconnect(is); return; } - icl_pdu_get_data(response, 0, csio->data_ptr + ntohl(bhsdi->bhsdi_buffer_offset), data_segment_len); + icl_pdu_get_data(response, 0, csio->data_ptr + io->io_received, data_segment_len); io->io_received += data_segment_len; /* @@ -1033,8 +1031,24 @@ iscsi_pdu_handle_r2t(struct icl_pdu *res */ io->io_datasn = 0; + off = ntohl(bhsr2t->bhsr2t_buffer_offset); + if (off > csio->dxfer_len) { + ISCSI_SESSION_WARN(is, "target requested invalid offset " + "%zd, buffer is is %d; reconnecting", off, csio->dxfer_len); + icl_pdu_free(response); + iscsi_session_reconnect(is); + return; + } + total_len = ntohl(bhsr2t->bhsr2t_desired_data_transfer_length); + if (total_len == 0 || total_len > csio->dxfer_len) { + ISCSI_SESSION_WARN(is, "target requested invalid length " + "%zd, buffer is %d; reconnecting", total_len, csio->dxfer_len); + icl_pdu_free(response); + iscsi_session_reconnect(is); + return; + } //ISCSI_SESSION_DEBUG(is, "r2t; off %zd, len %zd", off, total_len); @@ -1045,7 +1059,8 @@ iscsi_pdu_handle_r2t(struct icl_pdu *res len = is->is_max_data_segment_length; if (off + len > csio->dxfer_len) { - ISCSI_SESSION_WARN(is, "bad off %zd, len %d", + ISCSI_SESSION_WARN(is, "target requested invalid " + "length/offset %zd, buffer is %d; reconnecting", off + len, csio->dxfer_len); icl_pdu_free(response); iscsi_session_reconnect(is); @@ -1068,8 +1083,11 @@ iscsi_pdu_handle_r2t(struct icl_pdu *res bhsr2t->bhsr2t_target_transfer_tag; bhsdo->bhsdo_datasn = htonl(io->io_datasn++); bhsdo->bhsdo_buffer_offset = htonl(off); - error = icl_pdu_append_data(request, csio->data_ptr + off, len, M_NOWAIT); + error = icl_pdu_append_data(request, csio->data_ptr + off, len, + M_NOWAIT); if (error != 0) { + ISCSI_SESSION_WARN(is, "failed to allocate memory; " + "reconnecting"); icl_pdu_free(request); icl_pdu_free(response); iscsi_session_reconnect(is); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:34:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 784CA2CD; Wed, 9 Oct 2013 19:34:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 651BE2FDD; Wed, 9 Oct 2013 19:34:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99JYCPR080897; Wed, 9 Oct 2013 19:34:12 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JYC7q080896; Wed, 9 Oct 2013 19:34:12 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310091934.r99JYC7q080896@svn.freebsd.org> From: Glen Barber Date: Wed, 9 Oct 2013 19:34: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: r256230 - 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: Wed, 09 Oct 2013 19:34:12 -0000 Author: gjb Date: Wed Oct 9 19:34:11 2013 New Revision: 256230 URL: http://svnweb.freebsd.org/changeset/base/256230 Log: MFC r228541, r256022: r228541 (by pjd): - Put one file into one line. This makes keeping local changes and merging with FreeBSD easier for vendors. - For optional files use variables starting with underscore r256022: - Do not install bluetooth rc(8) scripts if MK_BLUETOOTH = no. Modified: stable/9/etc/rc.d/Makefile Directory Properties: stable/9/etc/rc.d/ (props changed) Modified: stable/9/etc/rc.d/Makefile ============================================================================== --- stable/9/etc/rc.d/Makefile Wed Oct 9 19:30:13 2013 (r256229) +++ stable/9/etc/rc.d/Makefile Wed Oct 9 19:34:11 2013 (r256230) @@ -2,64 +2,182 @@ .include -FILES= DAEMON FILESYSTEMS LOGIN NETWORKING SERVERS \ - abi accounting addswap adjkerntz amd \ - apm apmd archdep atm1 atm2 atm3 auditd auditdistd \ - bgfsck bluetooth bootparams bridge bsnmpd bthidd \ - ccd cleanvar cleartmp cron \ - ddb defaultroute devd devfs dhclient \ - dmesg dumpon \ +FILES= DAEMON \ + FILESYSTEMS \ + LOGIN \ + NETWORKING \ + SERVERS \ + abi \ + accounting \ + addswap \ + adjkerntz \ + amd \ + apm \ + apmd \ + archdep \ + atm1 \ + atm2 \ + atm3 \ + auditd \ + bgfsck \ + ${_bluetooth} \ + bootparams \ + bridge \ + bsnmpd \ + ${_bthidd} \ + ccd \ + cleanvar \ + cleartmp \ + cron \ + ddb \ + defaultroute \ + devd \ + devfs \ + dhclient \ + dmesg \ + dumpon \ encswap \ - faith fsck ftp-proxy ftpd \ - gbde geli geli2 gptboot gssd \ - hastd hcsecd \ - hostapd hostid hostid_save hostname \ - inetd initrandom \ - ip6addrctl ipfilter ipfs ipfw ipmon \ - ipnat ipsec \ + faith \ + fsck \ + ftp-proxy \ + ftpd \ + gbde \ + geli \ + geli2 \ + gptboot \ + gssd \ + hastd \ + ${_hcsecd} \ + hostapd \ + hostid \ + hostid_save \ + hostname \ + inetd \ + initrandom \ + ip6addrctl \ + ipfilter \ + ipfs \ + ipfw \ + ipmon \ + ipnat \ + ipsec \ + ${_ipxrouted} \ jail \ - kadmind kerberos keyserv kld kldxref kpasswdd \ - ldconfig local localpkg lockd lpd \ - mixer motd mountcritlocal mountcritremote mountlate \ - mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \ - named natd netif netoptions netwait \ - newsyslog nfsclient nfscbd nfsd \ - nfsuserd nisdomain nsswitch ntpd ntpdate \ + kadmind \ + kerberos \ + keyserv \ + kld \ + kldxref \ + kpasswdd \ + ldconfig \ + local \ + localpkg \ + lockd \ + lpd \ + mixer \ + motd \ + mountcritlocal \ + mountcritremote \ + mountlate \ + mdconfig \ + mdconfig2 \ + mountd \ + moused \ + mroute6d \ + mrouted \ + msgs \ + named \ + natd \ + netif \ + netoptions \ + netwait \ + newsyslog \ + nfsclient \ + nfscbd \ + nfsd \ + nfsuserd \ + nisdomain \ + ${_nscd} \ + nsswitch \ + ntpd \ + ntpdate \ + ${_opensm} \ othermta \ - pf pflog pfsync \ - powerd power_profile ppp pppoed pwcheck \ + pf \ + pflog \ + pfsync \ + powerd \ + power_profile \ + ppp \ + pppoed \ + pwcheck \ quota \ - random rarpd rctl resolv rfcomm_pppd_server root \ - route6d routed routing rpcbind rtadvd rtsold rwho \ - savecore sdpd securelevel sendmail \ - serial sppp statd static_arp static_ndp stf swap1 \ - syscons sysctl syslogd \ - timed tmp \ + random \ + rarpd \ + rctl \ + resolv \ + rfcomm_pppd_server \ + root \ + route6d \ + routed \ + routing \ + rpcbind \ + rtadvd \ + rtsold \ + rwho \ + savecore \ + sdpd \ + securelevel \ + sendmail \ + serial \ + sppp \ + ${_sshd} \ + statd \ + static_arp \ + static_ndp \ + stf \ + swap1 \ + syscons \ + sysctl \ + syslogd \ + timed \ + tmp \ + ${_ubthidhci} \ ugidfw \ - var virecover \ - watchdogd wpa_supplicant \ - ypbind yppasswdd ypserv \ - ypset ypupdated ypxfrd \ - zfs zvol + var \ + virecover \ + watchdogd \ + wpa_supplicant \ + ypbind \ + yppasswdd \ + ypserv \ + ypset \ + ypupdated \ + ypxfrd \ + zfs \ + zvol .if ${MK_IPX} != "no" -FILES+= ipxrouted +_ipxrouted= ipxrouted .endif .if ${MK_OFED} != "no" -FILES+= opensm +_opensm= opensm .endif .if ${MK_OPENSSH} != "no" -FILES+= sshd +_sshd= sshd .endif .if ${MK_NS_CACHING} != "no" -FILES+= nscd +_nscd= nscd .endif .if ${MK_BLUETOOTH} != "no" -FILES+= ubthidhci +_bluetooth= bluetooth +_bthidd= bthidd +_hcsecd= hcsecd +_ubthidhci= ubthidhci .endif FILESDIR= /etc/rc.d From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:37:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BD07358A; Wed, 9 Oct 2013 19:37:42 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A9DDF2029; Wed, 9 Oct 2013 19:37:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99Jbg7H081886; Wed, 9 Oct 2013 19:37:42 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JbgxT081883; Wed, 9 Oct 2013 19:37:42 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201310091937.r99JbgxT081883@svn.freebsd.org> From: Jim Harris Date: Wed, 9 Oct 2013 19:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256231 - head/sys/dev/isci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:37:42 -0000 Author: jimharris Date: Wed Oct 9 19:37:41 2013 New Revision: 256231 URL: http://svnweb.freebsd.org/changeset/base/256231 Log: Improve logging around some of the isci(4) reset and recovery paths. Sponsored by: Intel Discussed with: scottl Approved by: re (marius) MFC after: 1 week Modified: head/sys/dev/isci/isci_io_request.c head/sys/dev/isci/isci_sysctl.c head/sys/dev/isci/isci_task_request.c Modified: head/sys/dev/isci/isci_io_request.c ============================================================================== --- head/sys/dev/isci/isci_io_request.c Wed Oct 9 19:34:11 2013 (r256230) +++ head/sys/dev/isci/isci_io_request.c Wed Oct 9 19:37:41 2013 (r256231) @@ -153,11 +153,16 @@ isci_io_request_complete(SCI_CONTROLLER_ case SCI_IO_FAILURE_REMOTE_DEVICE_RESET_REQUIRED: isci_remote_device_reset(isci_remote_device, NULL); + ccb->ccb_h.status |= CAM_REQ_TERMIO; + isci_log_message(0, "ISCI", + "isci: bus=%x target=%x lun=%x cdb[0]=%x remote device reset required\n", + ccb->ccb_h.path_id, ccb->ccb_h.target_id, + ccb->ccb_h.target_lun, ccb->csio.cdb_io.cdb_bytes[0]); + break; - /* drop through */ case SCI_IO_FAILURE_TERMINATED: ccb->ccb_h.status |= CAM_REQ_TERMIO; - isci_log_message(1, "ISCI", + isci_log_message(0, "ISCI", "isci: bus=%x target=%x lun=%x cdb[0]=%x terminated\n", ccb->ccb_h.path_id, ccb->ccb_h.target_id, ccb->ccb_h.target_lun, ccb->csio.cdb_io.cdb_bytes[0]); Modified: head/sys/dev/isci/isci_sysctl.c ============================================================================== --- head/sys/dev/isci/isci_sysctl.c Wed Oct 9 19:34:11 2013 (r256230) +++ head/sys/dev/isci/isci_sysctl.c Wed Oct 9 19:37:41 2013 (r256231) @@ -193,6 +193,35 @@ isci_sysctl_start_phy(SYSCTL_HANDLER_ARG return 0; } +static int +isci_sysctl_log_frozen_lun_masks(SYSCTL_HANDLER_ARGS) +{ + struct isci_softc *isci = (struct isci_softc *)arg1; + struct ISCI_REMOTE_DEVICE *device; + int32_t log_frozen_devices = 0; + int error, i, j; + + error = sysctl_handle_int(oidp, &log_frozen_devices, 0, req); + + if (error || log_frozen_devices == 0) + return (error); + + for (i = 0; i < isci->controller_count; i++) { + for (j = 0; j < SCI_MAX_REMOTE_DEVICES; j++) { + device = isci->controllers[i].remote_device[j]; + + if (device == NULL) + continue; + + device_printf(isci->device, + "controller %d device %3d frozen_lun_mask 0x%02x\n", + i, j, device->frozen_lun_mask); + } + } + + return (0); +} + void isci_sysctl_initialize(struct isci_softc *isci) { struct sysctl_ctx_list *sysctl_ctx = device_get_sysctl_ctx(isci->device); @@ -225,5 +254,10 @@ void isci_sysctl_initialize(struct isci_ SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "start_phy", CTLTYPE_UINT| CTLFLAG_RW, isci, 0, isci_sysctl_start_phy, "IU", "Start PHY on a controller"); + + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "log_frozen_lun_masks", CTLTYPE_UINT| CTLFLAG_RW, isci, 0, + isci_sysctl_log_frozen_lun_masks, "IU", + "Log frozen lun masks to kernel log"); } Modified: head/sys/dev/isci/isci_task_request.c ============================================================================== --- head/sys/dev/isci/isci_task_request.c Wed Oct 9 19:34:11 2013 (r256230) +++ head/sys/dev/isci/isci_task_request.c Wed Oct 9 19:37:41 2013 (r256231) @@ -194,11 +194,20 @@ isci_task_request_complete(SCI_CONTROLLE break; case SCI_TASK_FAILURE_INVALID_STATE: + retry_task = TRUE; + isci_log_message(0, "ISCI", + "task failure (invalid state) - retrying\n"); + break; + case SCI_TASK_FAILURE_INSUFFICIENT_RESOURCES: - case SCI_FAILURE_TIMEOUT: retry_task = TRUE; isci_log_message(0, "ISCI", - "unhandled task completion code 0x%x\n", completion_status); + "task failure (insufficient resources) - retrying\n"); + break; + + case SCI_FAILURE_TIMEOUT: + retry_task = TRUE; + isci_log_message(0, "ISCI", "task timeout - retrying\n"); break; case SCI_TASK_FAILURE: From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:37:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F41A76B5; Wed, 9 Oct 2013 19:37:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E1F88202A; Wed, 9 Oct 2013 19:37:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99Jbpvw081952; Wed, 9 Oct 2013 19:37:51 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JbpKn081951; Wed, 9 Oct 2013 19:37:51 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310091937.r99JbpKn081951@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 9 Oct 2013 19:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256232 - head/libexec/freebsd-version X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:37:52 -0000 Author: des Date: Wed Oct 9 19:37:51 2013 New Revision: 256232 URL: http://svnweb.freebsd.org/changeset/base/256232 Log: Explicitly pass the full path to the input file to sed. This unbreaks the WITHOUT_BMAKE build. Approved by: re (gjb) Modified: head/libexec/freebsd-version/Makefile Modified: head/libexec/freebsd-version/Makefile ============================================================================== --- head/libexec/freebsd-version/Makefile Wed Oct 9 19:37:41 2013 (r256231) +++ head/libexec/freebsd-version/Makefile Wed Oct 9 19:37:51 2013 (r256232) @@ -7,7 +7,7 @@ CLEANFILES = freebsd-version.sh NEWVERS = ${.CURDIR}/../../sys/conf/newvers.sh freebsd-version.sh.in: ${NEWVERS} -freebsd-version.sh: freebsd-version.sh.in +freebsd-version.sh: ${.CURDIR}/freebsd-version.sh.in eval $$(egrep '^(TYPE|REVISION|BRANCH)=' ${NEWVERS}) ; \ if ! sed -e "\ s/@@TYPE@@/$${TYPE}/g; \ From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:53:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 24B29CB3; Wed, 9 Oct 2013 19:53:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 10E75215A; Wed, 9 Oct 2013 19:53:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99Jrgq9091093; Wed, 9 Oct 2013 19:53:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JrgYZ091092; Wed, 9 Oct 2013 19:53:42 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091953.r99JrgYZ091092@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 19:53: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: r256233 - stable/9/sys/dev/mps X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:53:43 -0000 Author: mav Date: Wed Oct 9 19:53:42 2013 New Revision: 256233 URL: http://svnweb.freebsd.org/changeset/base/256233 Log: MFC r241145 (by ken): Add casts to unbreak the i386 PAE build for the mps(4) driver. Modified: stable/9/sys/dev/mps/mps_sas.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mps/mps_sas.c ============================================================================== --- stable/9/sys/dev/mps/mps_sas.c Wed Oct 9 19:37:51 2013 (r256232) +++ stable/9/sys/dev/mps/mps_sas.c Wed Oct 9 19:53:42 2013 (r256233) @@ -2803,7 +2803,7 @@ mpssas_send_smpcmd(struct mpssas_softc * bus_dma_segment_t *req_sg; req_sg = (bus_dma_segment_t *)ccb->smpio.smp_request; - request = (uint8_t *)req_sg[0].ds_addr; + request = (uint8_t *)(uintptr_t)req_sg[0].ds_addr; } else request = ccb->smpio.smp_request; @@ -2811,7 +2811,7 @@ mpssas_send_smpcmd(struct mpssas_softc * bus_dma_segment_t *rsp_sg; rsp_sg = (bus_dma_segment_t *)ccb->smpio.smp_response; - response = (uint8_t *)rsp_sg[0].ds_addr; + response = (uint8_t *)(uintptr_t)rsp_sg[0].ds_addr; } else response = ccb->smpio.smp_response; break; From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:55:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E1509E29; Wed, 9 Oct 2013 19:55:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CE2B2217E; Wed, 9 Oct 2013 19:55:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99Jttk7091650; Wed, 9 Oct 2013 19:55:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99Jtt9H091649; Wed, 9 Oct 2013 19:55:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091955.r99Jtt9H091649@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 19:55: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: r256234 - stable/9/sys/dev/mps X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:55:56 -0000 Author: mav Date: Wed Oct 9 19:55:55 2013 New Revision: 256234 URL: http://svnweb.freebsd.org/changeset/base/256234 Log: MFC r241759 (by jwd): Don't lose the 255'th disk behind the initiator. Modified: stable/9/sys/dev/mps/mps_sas.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mps/mps_sas.c ============================================================================== --- stable/9/sys/dev/mps/mps_sas.c Wed Oct 9 19:53:42 2013 (r256233) +++ stable/9/sys/dev/mps/mps_sas.c Wed Oct 9 19:55:55 2013 (r256234) @@ -961,7 +961,7 @@ mpssas_action(struct cam_sim *sim, union cpi->hba_eng_cnt = 0; cpi->max_target = sassc->sc->facts->MaxTargets - 1; cpi->max_lun = 255; - cpi->initiator_id = 255; + cpi->initiator_id = sassc->sc->facts->MaxTargets - 1; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "LSILogic", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:57:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B79C9DC; Wed, 9 Oct 2013 19:57:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A42C02191; Wed, 9 Oct 2013 19:57:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99JvRKT092235; Wed, 9 Oct 2013 19:57:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JvRTq092234; Wed, 9 Oct 2013 19:57:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091957.r99JvRTq092234@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 19:57: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: r256235 - stable/9/sys/dev/mps X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:57:27 -0000 Author: mav Date: Wed Oct 9 19:57:27 2013 New Revision: 256235 URL: http://svnweb.freebsd.org/changeset/base/256235 Log: MFC r253809: Fix a printf typo. Modified: stable/9/sys/dev/mps/mps_sas.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mps/mps_sas.c ============================================================================== --- stable/9/sys/dev/mps/mps_sas.c Wed Oct 9 19:55:55 2013 (r256234) +++ stable/9/sys/dev/mps/mps_sas.c Wed Oct 9 19:57:27 2013 (r256235) @@ -3073,7 +3073,7 @@ mpssas_action_resetdev(struct mpssas_sof tm = mps_alloc_command(sc); if (tm == NULL) { mps_dprint(sc, MPS_ERROR, - "comand alloc failure in mpssas_action_resetdev\n"); + "command alloc failure in mpssas_action_resetdev\n"); ccb->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_done(ccb); return; From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 19:59:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 76959237; Wed, 9 Oct 2013 19:59:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6211B21A4; Wed, 9 Oct 2013 19:59:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99JxQob092833; Wed, 9 Oct 2013 19:59:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99JxQK5092832; Wed, 9 Oct 2013 19:59:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310091959.r99JxQK5092832@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Oct 2013 19:59: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: r256236 - stable/9/sys/dev/mps X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 19:59:26 -0000 Author: mav Date: Wed Oct 9 19:59:25 2013 New Revision: 256236 URL: http://svnweb.freebsd.org/changeset/base/256236 Log: MFC r254253, r254257: r253460 accidentally some moderately expensive debugging code, even when debugging isn't enabled. Work around this. Modified: stable/9/sys/dev/mps/mps_sas.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mps/mps_sas.c ============================================================================== --- stable/9/sys/dev/mps/mps_sas.c Wed Oct 9 19:57:27 2013 (r256235) +++ stable/9/sys/dev/mps/mps_sas.c Wed Oct 9 19:59:25 2013 (r256236) @@ -308,6 +308,10 @@ mpssas_log_command(struct mps_command *c if (cm == NULL) return; + /* No need to be in here if debugging isn't enabled */ + if ((cm->cm_sc->mps_debug & level) == 0) + return; + sbuf_new(&sb, str, sizeof(str), 0); va_start(ap, fmt); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 20:00:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6490D367; Wed, 9 Oct 2013 20:00:05 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 39DBC21AB; Wed, 9 Oct 2013 20:00:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99K05jK093282; Wed, 9 Oct 2013 20:00:05 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99K05r9093281; Wed, 9 Oct 2013 20:00:05 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201310092000.r99K05r9093281@svn.freebsd.org> From: Joel Dahl Date: Wed, 9 Oct 2013 20:00:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256237 - head/usr.sbin/bhyveload X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 20:00:05 -0000 Author: joel (doc committer) Date: Wed Oct 9 20:00:04 2013 New Revision: 256237 URL: http://svnweb.freebsd.org/changeset/base/256237 Log: Fix missing . Approved by: re (blanket) Modified: head/usr.sbin/bhyveload/bhyveload.8 Modified: head/usr.sbin/bhyveload/bhyveload.8 ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.8 Wed Oct 9 19:59:25 2013 (r256236) +++ head/usr.sbin/bhyveload/bhyveload.8 Wed Oct 9 20:00:04 2013 (r256237) @@ -1,4 +1,4 @@ -\" +.\" .\" Copyright (c) 2012 NetApp Inc .\" All rights reserved. .\" From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 20:09:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 80C54679; Wed, 9 Oct 2013 20:09:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 52A732246; Wed, 9 Oct 2013 20:09:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99K9xl0098303; Wed, 9 Oct 2013 20:09:59 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99K9xdJ098302; Wed, 9 Oct 2013 20:09:59 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310092009.r99K9xdJ098302@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 9 Oct 2013 20:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256238 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 20:09:59 -0000 Author: trasz Date: Wed Oct 9 20:09:58 2013 New Revision: 256238 URL: http://svnweb.freebsd.org/changeset/base/256238 Log: Properly handle residual count in Data-In PDUs with S bit set. Approved by: re (gjb) Sponsored by: FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Wed Oct 9 20:00:04 2013 (r256237) +++ head/sys/dev/iscsi/iscsi.c Wed Oct 9 20:09:58 2013 (r256238) @@ -966,22 +966,43 @@ iscsi_pdu_handle_data_in(struct icl_pdu * XXX: Check DataSN. * XXX: Check F. */ - if (bhsdi->bhsdi_flags & BHSDI_FLAGS_S) { - //ISCSI_SESSION_DEBUG(is, "got S flag; status 0x%x", bhsdi->bhsdi_status); - if (bhsdi->bhsdi_status == 0) { - io->io_ccb->ccb_h.status = CAM_REQ_CMP; - } else { - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); - ISCSI_SESSION_DEBUG(is, "freezing devq"); + if ((bhsdi->bhsdi_flags & BHSDI_FLAGS_S) == 0) { + /* + * Nothing more to do. + */ + icl_pdu_free(response); + return; + } + + //ISCSI_SESSION_DEBUG(is, "got S flag; status 0x%x", bhsdi->bhsdi_status); + if (bhsdi->bhsdi_status == 0) { + io->io_ccb->ccb_h.status = CAM_REQ_CMP; + } else { + if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + ISCSI_SESSION_DEBUG(is, "freezing devq"); + } + io->io_ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_DEV_QFRZN; + csio->scsi_status = bhsdi->bhsdi_status; + } + + if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { + KASSERT(io->io_received <= csio->dxfer_len, + ("io->io_received > csio->dxfer_len")); + if (io->io_received < csio->dxfer_len) { + csio->resid = ntohl(bhsdi->bhsdi_residual_count); + if (csio->resid != csio->dxfer_len - io->io_received) { + ISCSI_SESSION_WARN(is, "underflow mismatch: " + "target indicates %d, we calculated %zd", + csio->resid, + csio->dxfer_len - io->io_received); } - io->io_ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_DEV_QFRZN; - csio->scsi_status = bhsdi->bhsdi_status; + csio->resid = csio->dxfer_len - io->io_received; } - xpt_done(io->io_ccb); - iscsi_outstanding_remove(is, io); } + xpt_done(io->io_ccb); + iscsi_outstanding_remove(is, io); icl_pdu_free(response); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 20:47:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E1749B02; Wed, 9 Oct 2013 20:47:21 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B3A4124A9; Wed, 9 Oct 2013 20:47:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99KlLYx018832; Wed, 9 Oct 2013 20:47:21 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99KlK4o018827; Wed, 9 Oct 2013 20:47:20 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310092047.r99KlK4o018827@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 9 Oct 2013 20:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256241 - in head: . bin bin/freebsd-version libexec libexec/freebsd-version X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 20:47:22 -0000 Author: des Date: Wed Oct 9 20:47:20 2013 New Revision: 256241 URL: http://svnweb.freebsd.org/changeset/base/256241 Log: By popular demand, move freebsd-version(1) from /libexec to /bin. Approved by: re (gjb) Added: head/bin/freebsd-version/ - copied from r256237, head/libexec/freebsd-version/ Deleted: head/libexec/freebsd-version/ Modified: head/ObsoleteFiles.inc head/bin/Makefile head/bin/freebsd-version/Makefile head/bin/freebsd-version/freebsd-version.1 head/libexec/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Oct 9 20:14:16 2013 (r256240) +++ head/ObsoleteFiles.inc Wed Oct 9 20:47:20 2013 (r256241) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20131009: freebsd-version moved from /libexec to /bin +OLD_FILES+=/libexec/freebsd-version # 20131001: ar and ranlib from binutils not used OLD_FILES+=usr/bin/gnu-ar OLD_FILES+=usr/bin/gnu-ranlib Modified: head/bin/Makefile ============================================================================== --- head/bin/Makefile Wed Oct 9 20:14:16 2013 (r256240) +++ head/bin/Makefile Wed Oct 9 20:47:20 2013 (r256241) @@ -15,6 +15,7 @@ SUBDIR= cat \ echo \ ed \ expr \ + freebsd-version \ getfacl \ hostname \ kenv \ Modified: head/bin/freebsd-version/Makefile ============================================================================== --- head/libexec/freebsd-version/Makefile Wed Oct 9 20:00:04 2013 (r256237) +++ head/bin/freebsd-version/Makefile Wed Oct 9 20:47:20 2013 (r256241) @@ -2,7 +2,6 @@ SCRIPTS = freebsd-version MAN = freebsd-version.1 -BINDIR = /libexec CLEANFILES = freebsd-version.sh NEWVERS = ${.CURDIR}/../../sys/conf/newvers.sh Modified: head/bin/freebsd-version/freebsd-version.1 ============================================================================== --- head/libexec/freebsd-version/freebsd-version.1 Wed Oct 9 20:00:04 2013 (r256237) +++ head/bin/freebsd-version/freebsd-version.1 Wed Oct 9 20:47:20 2013 (r256241) @@ -100,13 +100,13 @@ and the kernel. .Sh EXAMPLES To determine the version of the currently running userland: .Bd -literal -offset indent -/libexec/freebsd-version -u +/bin/freebsd-version -u .Ed .Pp To inspect a system being repaired using a live CD: .Bd -literal -offset indent mount -rt ufs /dev/ada0p2 /mnt -env ROOT=/mnt /mnt/libexec/freebsd-version -ku +env ROOT=/mnt /mnt/bin/freebsd-version -ku .Ed .Sh SEE ALSO .Xr uname 1 , Modified: head/libexec/Makefile ============================================================================== --- head/libexec/Makefile Wed Oct 9 20:14:16 2013 (r256240) +++ head/libexec/Makefile Wed Oct 9 20:47:20 2013 (r256241) @@ -8,7 +8,6 @@ SUBDIR= ${_atf} \ bootpd \ ${_comsat} \ fingerd \ - freebsd-version \ ftpd \ getty \ ${_mail.local} \ From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 20:58:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 80950F1E; Wed, 9 Oct 2013 20:58:51 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6DC40253E; Wed, 9 Oct 2013 20:58:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99Kwpbg024303; Wed, 9 Oct 2013 20:58:51 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99KwpmP024302; Wed, 9 Oct 2013 20:58:51 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201310092058.r99KwpmP024302@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 9 Oct 2013 20:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256242 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 20:58:51 -0000 Author: pjd Date: Wed Oct 9 20:58:50 2013 New Revision: 256242 URL: http://svnweb.freebsd.org/changeset/base/256242 Log: Handle the cases where NULL is passed as cap_rightsp to the filestat_new_entry() function. Reported by: Alex Kozlov Approved by: re (gjb) Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Wed Oct 9 20:47:20 2013 (r256241) +++ head/lib/libprocstat/libprocstat.c Wed Oct 9 20:58:50 2013 (r256242) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define _KERNEL #include #include @@ -395,7 +396,10 @@ filestat_new_entry(void *typedep, int ty entry->fs_ref_count = refcount; entry->fs_offset = offset; entry->fs_path = path; - entry->fs_cap_rights = *cap_rightsp; + if (cap_rightsp != NULL) + entry->fs_cap_rights = *cap_rightsp; + else + cap_rights_init(&entry->fs_cap_rights); return (entry); } @@ -478,21 +482,21 @@ procstat_getfiles_kvm(struct procstat *p /* root directory vnode, if one. */ if (filed.fd_rdir) { entry = filestat_new_entry(filed.fd_rdir, PS_FST_TYPE_VNODE, -1, - PS_FST_FFLAG_READ, PS_FST_UFLAG_RDIR, 0, 0, NULL, 0); + PS_FST_FFLAG_READ, PS_FST_UFLAG_RDIR, 0, 0, NULL, NULL); if (entry != NULL) STAILQ_INSERT_TAIL(head, entry, next); } /* current working directory vnode. */ if (filed.fd_cdir) { entry = filestat_new_entry(filed.fd_cdir, PS_FST_TYPE_VNODE, -1, - PS_FST_FFLAG_READ, PS_FST_UFLAG_CDIR, 0, 0, NULL, 0); + PS_FST_FFLAG_READ, PS_FST_UFLAG_CDIR, 0, 0, NULL, NULL); if (entry != NULL) STAILQ_INSERT_TAIL(head, entry, next); } /* jail root, if any. */ if (filed.fd_jdir) { entry = filestat_new_entry(filed.fd_jdir, PS_FST_TYPE_VNODE, -1, - PS_FST_FFLAG_READ, PS_FST_UFLAG_JAIL, 0, 0, NULL, 0); + PS_FST_FFLAG_READ, PS_FST_UFLAG_JAIL, 0, 0, NULL, NULL); if (entry != NULL) STAILQ_INSERT_TAIL(head, entry, next); } @@ -500,14 +504,14 @@ procstat_getfiles_kvm(struct procstat *p if (kp->ki_tracep) { entry = filestat_new_entry(kp->ki_tracep, PS_FST_TYPE_VNODE, -1, PS_FST_FFLAG_READ | PS_FST_FFLAG_WRITE, - PS_FST_UFLAG_TRACE, 0, 0, NULL, 0); + PS_FST_UFLAG_TRACE, 0, 0, NULL, NULL); if (entry != NULL) STAILQ_INSERT_TAIL(head, entry, next); } /* text vnode, if one */ if (kp->ki_textvp) { entry = filestat_new_entry(kp->ki_textvp, PS_FST_TYPE_VNODE, -1, - PS_FST_FFLAG_READ, PS_FST_UFLAG_TEXT, 0, 0, NULL, 0); + PS_FST_FFLAG_READ, PS_FST_UFLAG_TEXT, 0, 0, NULL, NULL); if (entry != NULL) STAILQ_INSERT_TAIL(head, entry, next); } @@ -515,7 +519,7 @@ procstat_getfiles_kvm(struct procstat *p if ((vp = getctty(kd, kp)) != NULL) { entry = filestat_new_entry(vp, PS_FST_TYPE_VNODE, -1, PS_FST_FFLAG_READ | PS_FST_FFLAG_WRITE, - PS_FST_UFLAG_CTTY, 0, 0, NULL, 0); + PS_FST_UFLAG_CTTY, 0, 0, NULL, NULL); if (entry != NULL) STAILQ_INSERT_TAIL(head, entry, next); } @@ -578,7 +582,7 @@ procstat_getfiles_kvm(struct procstat *p } /* XXXRW: No capability rights support for kvm yet. */ entry = filestat_new_entry(data, type, i, - to_filestat_flags(file.f_flag), 0, 0, 0, NULL, 0); + to_filestat_flags(file.f_flag), 0, 0, 0, NULL, NULL); if (entry != NULL) STAILQ_INSERT_TAIL(head, entry, next); } @@ -637,7 +641,7 @@ do_mmapped: */ entry = filestat_new_entry(object.handle, PS_FST_TYPE_VNODE, -1, fflags, - PS_FST_UFLAG_MMAP, 0, 0, NULL, 0); + PS_FST_UFLAG_MMAP, 0, 0, NULL, NULL); if (entry != NULL) STAILQ_INSERT_TAIL(head, entry, next); } @@ -878,7 +882,7 @@ procstat_getfiles_sysctl(struct procstat path = NULL; entry = filestat_new_entry(kve, PS_FST_TYPE_VNODE, -1, fflags, PS_FST_UFLAG_MMAP, refcount, offset, path, - 0); + NULL); if (entry != NULL) STAILQ_INSERT_TAIL(head, entry, next); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 21:33:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EC505C7B; Wed, 9 Oct 2013 21:33:19 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9FFE27C6; Wed, 9 Oct 2013 21:33:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99LXJ4u043583; Wed, 9 Oct 2013 21:33:19 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99LXJVK043582; Wed, 9 Oct 2013 21:33:19 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201310092133.r99LXJVK043582@svn.freebsd.org> From: Alexander Kabaev Date: Wed, 9 Oct 2013 21:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256244 - 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: Wed, 09 Oct 2013 21:33:20 -0000 Author: kan Date: Wed Oct 9 21:33:19 2013 New Revision: 256244 URL: http://svnweb.freebsd.org/changeset/base/256244 Log: Unbreak zfsloader with LOADER_TFTP_SUPPORT on Only accept 'net' and 'pxe' devices as underlying transport in tftp.c on x86. Prior to this change tftp code would attempt to send packets over any boot device, including zfs one with predictably sad results. Approved by: re (gjb) MFC After: 1 month Modified: head/lib/libstand/tftp.c Modified: head/lib/libstand/tftp.c ============================================================================== --- head/lib/libstand/tftp.c Wed Oct 9 21:03:34 2013 (r256243) +++ head/lib/libstand/tftp.c Wed Oct 9 21:33:19 2013 (r256244) @@ -400,10 +400,14 @@ tftp_open(const char *path, struct open_ struct iodesc *io; int res; -#ifndef __i386__ - if (strcmp(f->f_dev->dv_name, "net") != 0) + if (strcmp(f->f_dev->dv_name, "net") != 0) { +#ifdef __i386__ + if (strcmp(f->f_dev->dv_name, "pxe") != 0) + return (EINVAL); +#else return (EINVAL); #endif + } if (is_open) return (EBUSY); From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 21:46:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B37ED1C8; Wed, 9 Oct 2013 21:46:32 +0000 (UTC) (envelope-from davidch@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9F55728BD; Wed, 9 Oct 2013 21:46:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99LkWak049420; Wed, 9 Oct 2013 21:46:32 GMT (envelope-from davidch@svn.freebsd.org) Received: (from davidch@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99LkWit049418; Wed, 9 Oct 2013 21:46:32 GMT (envelope-from davidch@svn.freebsd.org) Message-Id: <201310092146.r99LkWit049418@svn.freebsd.org> From: David Christensen Date: Wed, 9 Oct 2013 21:46:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r256245 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 21:46:32 -0000 Author: davidch Date: Wed Oct 9 21:46:31 2013 New Revision: 256245 URL: http://svnweb.freebsd.org/changeset/base/256245 Log: Welcome new Broadcom committer Eric Davis (edavis@). Eric will be working on the Broadcom 10Gb wired Ethernet driver bxe(4). I will be his mentor during this time period. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Wed Oct 9 21:33:19 2013 (r256244) +++ svnadmin/conf/access Wed Oct 9 21:46:31 2013 (r256245) @@ -70,6 +70,7 @@ dumbbell dwmalone dwmalone=freebsd-committers@maths.tcd.ie eadler ed +edavis edwin emaste emax Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed Oct 9 21:33:19 2013 (r256244) +++ svnadmin/conf/mentors Wed Oct 9 21:46:31 2013 (r256245) @@ -16,6 +16,7 @@ benl philip Co-mentor: simon br cognet carl jimharris cy andre Co-mentor: glebius +edavis davidch eri mlaier Co-mentor: thompsa erwin delphij jceel wkoszek Co-mentor: cognet From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 22:00:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BD79B9B3; Wed, 9 Oct 2013 22:00:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB3212995; Wed, 9 Oct 2013 22:00:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99M03ET055854; Wed, 9 Oct 2013 22:00:03 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99M03GK055853; Wed, 9 Oct 2013 22:00:03 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310092200.r99M03GK055853@svn.freebsd.org> From: Glen Barber Date: Wed, 9 Oct 2013 22:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256246 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 22:00:03 -0000 Author: gjb Date: Wed Oct 9 22:00:03 2013 New Revision: 256246 URL: http://svnweb.freebsd.org/changeset/base/256246 Log: Remove hash generation from release.sh, as it is run as part of the 'install' target in the release/Makefile. MFC after: 3 days Submitted by: jhb Approved by: re (hrs) Sponsored by: The FreeBSD Foundation Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Wed Oct 9 21:46:31 2013 (r256245) +++ head/release/release.sh Wed Oct 9 22:00:03 2013 (r256246) @@ -202,8 +202,3 @@ eval chroot ${CHROOTDIR} make -C /usr/sr release RELSTRING=${RELSTRING} eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ install DESTDIR=/R RELSTRING=${RELSTRING} - -cd ${CHROOTDIR}/R - -sha256 FreeBSD-* > CHECKSUM.SHA256 -md5 FreeBSD-* > CHECKSUM.MD5 From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 22:10:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A8E64E74; Wed, 9 Oct 2013 22:10:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 969492A50; Wed, 9 Oct 2013 22:10:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99MA34x060722; Wed, 9 Oct 2013 22:10:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99MA3RH060721; Wed, 9 Oct 2013 22:10:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310092210.r99MA3RH060721@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Oct 2013 22:10:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256247 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2013 22:10:03 -0000 Author: adrian Date: Wed Oct 9 22:10:03 2013 New Revision: 256247 URL: http://svnweb.freebsd.org/changeset/base/256247 Log: Add read/write bus barriers for MIPS. Tested: * AR9344 - mips74k SoC Approved by: re@ (delphij) Modified: head/sys/mips/mips/bus_space_generic.c Modified: head/sys/mips/mips/bus_space_generic.c ============================================================================== --- head/sys/mips/mips/bus_space_generic.c Wed Oct 9 22:00:03 2013 (r256246) +++ head/sys/mips/mips/bus_space_generic.c Wed Oct 9 22:10:03 2013 (r256247) @@ -749,4 +749,8 @@ generic_bs_barrier(void *t __unused, if (flags & BUS_SPACE_BARRIER_WRITE) mips_dcache_wbinv_all(); #endif + if (flags & BUS_SPACE_BARRIER_READ) + rmb(); + if (flags & BUS_SPACE_BARRIER_WRITE) + wmb(); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 9 23:53:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7228D848; Wed, 9 Oct 2013 23:53:22 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D90B2F6A; Wed, 9 Oct 2013 23:53:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r99NrMIo015063; Wed, 9 Oct 2013 23:53:22 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r99NrMWa015062; Wed, 9 Oct 2013 23:53:22 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310092353.r99NrMWa015062@svn.freebsd.org> From: Peter Grehan Date: Wed, 9 Oct 2013 23:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256248 - 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: Wed, 09 Oct 2013 23:53:22 -0000 Author: grehan Date: Wed Oct 9 23:53:21 2013 New Revision: 256248 URL: http://svnweb.freebsd.org/changeset/base/256248 Log: Allow a 4-byte write to PCI config space to overlap the 2 read-only bytes at the start of a PCI capability. This is the sequence that OpenBSD uses when enabling MSI interrupts, and works fine on real h/w. In bhyve, convert the 4 byte write to a 2-byte write to the r/w area past the first 2 r/o bytes of a capability. Reviewed by: neel Approved by: re@ (blanket) Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Wed Oct 9 22:10:03 2013 (r256247) +++ head/usr.sbin/bhyve/pci_emul.c Wed Oct 9 23:53:21 2013 (r256248) @@ -941,10 +941,19 @@ pci_emul_capwrite(struct pci_devinst *pi assert(offset >= capoff); /* - * Capability ID and Next Capability Pointer are readonly + * Capability ID and Next Capability Pointer are readonly. + * However, some o/s's do 4-byte writes that include these. + * For this case, trim the write back to 2 bytes and adjust + * the data. */ - if (offset == capoff || offset == capoff + 1) - return; + if (offset == capoff || offset == capoff + 1) { + if (offset == capoff && bytes == 4) { + bytes = 2; + offset += 2; + val >>= 16; + } else + return; + } switch (capid) { case PCIY_MSI: From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 01:20:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6BCF9E8E; Thu, 10 Oct 2013 01:20:19 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3EB0423AC; Thu, 10 Oct 2013 01:20:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9A1KJkp059725; Thu, 10 Oct 2013 01:20:19 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9A1KIY1059722; Thu, 10 Oct 2013 01:20:18 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201310100120.r9A1KIY1059722@svn.freebsd.org> From: John-Mark Gurney Date: Thu, 10 Oct 2013 01:20: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: r256249 - in stable/9/share/man: man8 man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 01:20:19 -0000 Author: jmg Date: Thu Oct 10 01:20:18 2013 New Revision: 256249 URL: http://svnweb.freebsd.org/changeset/base/256249 Log: partial MFC of r256114: add missing sections, de-Xr non-existent page Modified: stable/9/share/man/man8/picobsd.8 stable/9/share/man/man9/firmware.9 Directory Properties: stable/9/share/man/man8/ (props changed) stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man8/picobsd.8 ============================================================================== --- stable/9/share/man/man8/picobsd.8 Wed Oct 9 23:53:21 2013 (r256248) +++ stable/9/share/man/man8/picobsd.8 Thu Oct 10 01:20:18 2013 (r256249) @@ -20,7 +20,7 @@ utility is a script which produces a min which typically fits on a small media such as a floppy disk, or can be downloaded as a single image file from some media such as CDROM, flash memory, or through -.Xr etherboot . +etherboot. .Pp The .Nm @@ -64,7 +64,7 @@ kernel. This is the default behaviour, and is extremely useful as the kernel itself can be loaded, using -.Xr etherboot +etherboot or .Xr pxeboot 8 , .\" @@ -378,9 +378,7 @@ If the build is successful, the director .Pa build_dir-bridge/ will contain a .Pa kernel -that can be downloaded with -.Xr etherboot , -a floppy image called +that can be downloaded with etherboot, a floppy image called .Pa picobsd.bin , plus the products of the compilation in other directories. If you want to modify the source tree in @@ -480,9 +478,7 @@ Booting from a floppy is normally rather minutes), things are much faster if you store your image on a hard disk, Compact Flash, or CDROM. .Pp -You can also use -.Xr etherboot -to load the preloaded, uncompressed kernel image +You can also use etherboot to load the preloaded, uncompressed kernel image which is a byproduct of the .Nm build. Modified: stable/9/share/man/man9/firmware.9 ============================================================================== --- stable/9/share/man/man9/firmware.9 Wed Oct 9 23:53:21 2013 (r256248) +++ stable/9/share/man/man9/firmware.9 Thu Oct 10 01:20:18 2013 (r256249) @@ -254,8 +254,8 @@ IxNpeMicrocode.dat .Pp Note that generating the firmware modules in this way requires the availability of the following tools: -.Xr awk , -.Xr make , +.Xr awk 1 , +.Xr make 1 , the compiler and the linker. .Sh SEE ALSO .Xr kld 4 , From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 03:35:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DE34CFAB; Thu, 10 Oct 2013 03:35:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AFB1D2A3F; Thu, 10 Oct 2013 03:35:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9A3ZVPC030861; Thu, 10 Oct 2013 03:35:31 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9A3ZVoj030860; Thu, 10 Oct 2013 03:35:31 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201310100335.r9A3ZVoj030860@svn.freebsd.org> From: Justin Hibbits Date: Thu, 10 Oct 2013 03:35: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: r256250 - stable/9/sys/powerpc/ofw 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, 10 Oct 2013 03:35:32 -0000 Author: jhibbits Date: Thu Oct 10 03:35:30 2013 New Revision: 256250 URL: http://svnweb.freebsd.org/changeset/base/256250 Log: MFC r252115,255378 Cache the Open Firmware CPU properties at attach time, so we don't always enter it at runtime to get static data. Modified: stable/9/sys/powerpc/ofw/ofw_cpu.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/ofw/ofw_cpu.c ============================================================================== --- stable/9/sys/powerpc/ofw/ofw_cpu.c Thu Oct 10 01:20:18 2013 (r256249) +++ stable/9/sys/powerpc/ofw/ofw_cpu.c Thu Oct 10 03:35:30 2013 (r256250) @@ -133,6 +133,11 @@ static int ofw_cpu_attach(device_t); static int ofw_cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result); +struct ofw_cpu_softc { + struct pcpu *sc_cpu_pcpu; + uint32_t sc_nominal_mhz; +}; + static device_method_t ofw_cpu_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ofw_cpu_probe), @@ -153,7 +158,7 @@ static device_method_t ofw_cpu_methods[] static driver_t ofw_cpu_driver = { "cpu", ofw_cpu_methods, - 0 + sizeof(struct ofw_cpu_softc) }; static devclass_t ofw_cpu_devclass; @@ -175,6 +180,15 @@ ofw_cpu_probe(device_t dev) static int ofw_cpu_attach(device_t dev) { + struct ofw_cpu_softc *sc; + uint32_t cell; + + sc = device_get_softc(dev); + OF_getprop(ofw_bus_get_node(dev), "reg", &cell, sizeof(cell)); + sc->sc_cpu_pcpu = pcpu_find(cell); + OF_getprop(ofw_bus_get_node(dev), "clock-frequency", &cell, sizeof(cell)); + sc->sc_nominal_mhz = cell / 1000000; /* convert to MHz */ + bus_generic_probe(dev); return (bus_generic_attach(dev)); } @@ -182,19 +196,16 @@ ofw_cpu_attach(device_t dev) static int ofw_cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) { - uint32_t cell; + struct ofw_cpu_softc *sc; + + sc = device_get_softc(dev); switch (index) { case CPU_IVAR_PCPU: - OF_getprop(ofw_bus_get_node(dev), "reg", &cell, sizeof(cell)); - *result = (uintptr_t)(pcpu_find(cell)); + *result = (uintptr_t)sc->sc_cpu_pcpu; return (0); case CPU_IVAR_NOMINAL_MHZ: - cell = 0; - OF_getprop(ofw_bus_get_node(dev), "clock-frequency", - &cell, sizeof(cell)); - cell /= 1000000; /* convert to MHz */ - *result = (uintptr_t)(cell); + *result = (uintptr_t)sc->sc_nominal_mhz; return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 03:50:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1DE97325; Thu, 10 Oct 2013 03:50:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 081E22AD8; Thu, 10 Oct 2013 03:50:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9A3oNwD038199; Thu, 10 Oct 2013 03:50:24 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9A3oNhU038198; Thu, 10 Oct 2013 03:50:23 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310100350.r9A3oNhU038198@svn.freebsd.org> From: Mark Johnston Date: Thu, 10 Oct 2013 03:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256251 - head/cddl/contrib/opensolaris/cmd/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 03:50:24 -0000 Author: markj Date: Thu Oct 10 03:50:23 2013 New Revision: 256251 URL: http://svnweb.freebsd.org/changeset/base/256251 Log: Convert the dtrace(1) man page to mdoc and fix up some aspects of it that don't make sense on FreeBSD. In particular, - remove the ATTRIBUTES section, - remove references to the Solaris Dynamic Tracing Guide, except in the SEE ALSO section, - update the description of the -A option for FreeBSD's implementation, - remove references to Solaris-specific programs and configuration files, and replace them with FreeBSD equivalents where possible. The content has not changed aside from this. Approved by: re (joel) MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Thu Oct 10 03:35:30 2013 (r256250) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Thu Oct 10 03:50:23 2013 (r256251) @@ -2,7 +2,7 @@ .\" CDDL HEADER START .\" .\" The contents of this file are subject to the terms of the -.\" Common Development and Distribution License (the "License"). +.\" Common Development and Distribution License (the "License"). .\" You may not use this file except in compliance with the License. .\" .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE @@ -18,653 +18,660 @@ .\" .\" CDDL HEADER END .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved. -.TH dtrace 1M "5 Sep 2006" "SunOS 5.11" "System Administration Commands" -.SH NAME -dtrace \- DTrace dynamic tracing compiler and tracing utility -.SH SYNOPSIS -.LP -.nf -\fBdtrace\fR [\fB-32\fR | \fB-64\fR] [\fB-aACeFGHhlqSvVwZ\fR] [\fB-b\fR \fIbufsz\fR] [\fB-c\fR \fIcmd\fR] - [\fB-D\fR \fIname\fR [\fI=value\fR]] [\fB-I\fR \fIpath\fR] [\fB-L\fR \fIpath\fR] [\fB-o\fR \fIoutput\fR] - [\fB-s\fR \fIscript\fR] [\fB-U\fR \fIname\fR] [\fB-x\fR \fIarg\fR [\fI=val\fR]] - [\fB-X\fR a | c | s | t] [\fB-p\fR \fIpid\fR] - [\fB-P\fR \fIprovider\fR [[\fIpredicate\fR] \fIaction\fR]] - [\fB-m\fR [\fIprovider:\fR] \fImodule\fR [[\fIpredicate\fR] \fIaction\fR]] - [\fB-f\fR [[\fIprovider:\fR] \fImodule:\fR] \fIfunction\fR [[\fIpredicate\fR] \fIaction\fR]] - [\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]] - [\fB-i\fR \fIprobe-id\fR [[\fIpredicate\fR] \fIaction\fR]] -.fi - -.SH DESCRIPTION -.sp -.LP -DTrace is a comprehensive dynamic tracing framework for the Solaris Operating System. DTrace provides a powerful infrastructure that permits administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs. -.sp -.LP -The \fISolaris Dynamic Tracing Guide\fR describes how to use DTrace to observe, debug, and tune system behavior. Refer to this book for a detailed description of DTrace features, including the bundled DTrace observability -tools, instrumentation providers, and the D programming language. -.sp -.LP -The \fBdtrace\fR command provides a generic interface to the essential services provided by the DTrace facility, including: -.RS +4 -.TP -.ie t \(bu -.el o +.\" +.\" $FreeBSD$ +.\" +.Dd October 5, 2013 +.Dt DTRACE 1 +.Os +.Sh NAME +.Nm dtrace +.Nd dynamic tracing compiler and tracing utility +.Sh SYNOPSIS +.Nm +.Op Fl 32 | Fl 64 +.Op Fl aACeFGhHlqSvVwZ +.Op Fl b Ar bufsz +.Op Fl c Ar cmd +.Op Fl D Ar name Op Ns = Ns value +.Op Fl I Ar path +.Op Fl L Ar path +.Op Fl o Ar output +.Op Fl s Ar script +.Op Fl U Ar name +.Op Fl x Ar arg Op Ns = Ns value +.Op Fl X Cm a | c | s | t +.Op Fl p Ar pid +.Op Fl P Ar provider Oo Oo Ar predicate Oc Ar action Oc +.Op Fl m Oo Ar provider : Oc Ar module Oo Oo Ar predicate Oc Ar action Oc +.Op Fl f Oo Oo Ar provider : Oc Ar module : Oc Ar function Oo Oo Ar predicate \ + Oc Ar action Oc +.Op Fl n Oo Oo Oo Ar provider : Oc Ar module : Oc Ar function : Oc Ar name \ + Oo Oo Ar predicate Oc Ar action Oc +.Op Fl i Ar probe-id Oo Oo Ar predicate Oc Ar action Oc +.Sh DESCRIPTION +DTrace is a comprehensive dynamic tracing framework ported from Solaris. +DTrace provides a powerful infrastructure that permits administrators, +developers, and service personnel to concisely answer arbitrary questions about +the behavior of the operating system and user programs. +.Pp +The +.Nm +command provides a generic interface to the essential services provided by the +DTrace facility, including: +.Bl -bullet -offset indent +.It Options that list the set of probes and providers currently published by DTrace -.RE -.RS +4 -.TP -.ie t \(bu -.el o -Options that enable probes directly using any of the probe description specifiers (provider, module, function, name) -.RE -.RS +4 -.TP -.ie t \(bu -.el o -Options that run the D compiler and compile one or more D program files or programs written directly on the command line -.RE -.RS +4 -.TP -.ie t \(bu -.el o +.It +Options that enable probes directly using any of the probe description +specifiers (provider, module, function, name) +.It +Options that run the D compiler and compile one or more D program files or +programs written directly on the command line +.It Options that generate anonymous tracing programs -.RE -.RS +4 -.TP -.ie t \(bu -.el o +.It Options that generate program stability reports -.RE -.RS +4 -.TP -.ie t \(bu -.el o -Options that modify DTrace tracing and buffering behavior and enable additional D compiler features -.RE -.sp -.LP -You can use \fBdtrace\fR to create D scripts by using it in a \fB#!\fR declaration to create an interpreter file. You can also use \fBdtrace\fR to attempt to compile D programs and determine their properties without actually enabling tracing using the \fB-e\fR option. See \fBOPTIONS\fR. See the \fISolaris Dynamic Tracing Guide\fR for detailed examples of how to use the \fBdtrace\fR utility to perform these tasks. -.SH OPTIONS -.sp -.LP -The arguments accepted by the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, and \fB-i\fR options can include an optional D language \fIpredicate\fR enclosed in slashes \fB//\fR and optional D language \fIaction\fR statement list enclosed in braces \fB{}\fR. D program code specified on the command line must be appropriately quoted to avoid intepretation of meta-characters by the shell. -.sp -.LP +.It +Options that modify DTrace tracing and buffering behavior and enable +additional D compiler features +.El +.Pp +You can use +.Nm +to create D scripts by using it in a shebang declaration to create an +interpreter file. +You can also use +.Nm +to attempt to compile D programs and determine their properties without +actually enabling traces using the +.Fl e +option. +.Sh OPTIONS +The arguments accepted by the +.Fl P , +.Fl m , +.Fl f , +.Fl n , +and +.Fl i +options can include an optional D language +.Ar predicate +enclosed in slashes and an optional D language +.Ar action +statement list enclosed in braces. +D program code specified on the command line must be appropriately quoted to +avoid interpretation of meta-characters by the shell. +.Pp The following options are supported: -.sp -.ne 2 -.mk -.na -\fB\fB-32\fR | \fB-64\fR\fR -.ad -.sp .6 -.RS 4n -The D compiler produces programs using the native data model of the operating system kernel. You can use the \fBisainfo\fR \fB-b\fR command to determine the current operating system data model. If the \fB-32\fR option is specified, \fBdtrace\fR forces -the D compiler to compile a D program using the 32-bit data model. If the \fB-64\fR option is specified, \fBdtrace\fR forces the D compiler to compile a D program using the 64-bit data model. These options are typically not required as \fBdtrace\fR selects the -native data model as the default. The data model affects the sizes of integer types and other language properties. D programs compiled for either data model can be executed on both 32-bit and 64-bit kernels. The \fB-32\fR and \fB-64\fR options also determine the ELF file format -(ELF32 or ELF64) produced by the \fB-G\fR option. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-a\fR\fR -.ad -.sp .6 -.RS 4n -Claim anonymous tracing state and display the traced data. You can combine the \fB-a\fR option with the \fB-e\fR option to force \fBdtrace\fR to exit immediately after consuming the anonymous tracing state rather than continuing to wait for new -data. See the \fISolaris Dynamic Tracing Guide\fR for more information about anonymous tracing. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-A\fR\fR -.ad -.sp .6 -.RS 4n -Generate \fBdriver.conf\fR(4) directives for anonymous tracing. This option constructs a set of \fBdtrace\fR(7D) configuration file directives to enable the specified probes for anonymous tracing and then exits. By default, \fBdtrace\fR attempts to store the directives to the file \fB/kernel/drv/dtrace.conf\fR. You can modify this behavior if you use the \fB-o\fR option to specify an alternate output file. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-b\fR \fIbufsz\fR\fR -.ad -.sp .6 -.RS 4n -Set principal trace buffer size (\fIbufsz\fR). The trace buffer size can include any of the size suffixes \fBk\fR, \fBm\fR, \fBg\fR, or \fBt\fR. If the buffer space cannot be allocated, \fBdtrace\fR attempts -to reduce the buffer size or exit depending on the setting of the \fBbufresize\fR property. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-c\fR \fIcmd\fR\fR -.ad -.sp .6 -.RS 4n -Run the specified command \fIcmd\fR and exit upon its completion. If more than one \fB-c\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each child process as it -terminates. The process-ID of the first command is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information -on macro variables. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-C\fR\fR -.ad -.sp .6 -.RS 4n -Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You can pass options to the C preprocessor using the \fB-D\fR, \fB-U\fR, \fB-I\fR, and \fB-H\fR options. You can select the degree of C standard conformance if you use the \fB-X\fR option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see \fB-X\fR. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-D\fR \fIname\fR \fB[=\fR\fIvalue\fR\fB]\fR\fR -.ad -.sp .6 -.RS 4n -Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). If you specify the equals sign (\fB=\fR) -and additional \fIvalue\fR, the name is assigned the corresponding value. This option passes the \fB-D\fR option to each \fBcpp\fR invocation. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-e\fR\fR -.ad -.sp .6 -.RS 4n -Exit after compiling any requests and consuming anonymous tracing state (\fB-a\fR option) but prior to enabling any probes. You can combine this option with the \fB-a\fR option to print anonymous tracing data and exit. You can also combine this option with D -compiler options. This combination verifies that the programs compile without actually executing them and enabling the corresponding instrumentation. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-f\fR\fB[[\fR\fIprovider\fR\fB:]\fR\fImodule\fR\fB:]\fR\fIfunction\fR\fB[[\fR\fIpredicate\fR\fB]\fR\fIaction\fR\fB]]\fR\fR -.ad -.sp .6 -.RS 4n -Specify function name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR. -Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIfunction\fR are specified in the description, all probes with the corresponding \fIfunction\fR are matched. -The \fB-f\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB-f\fR option on the command line at a time. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-F\fR\fR -.ad -.sp .6 -.RS 4n -Coalesce trace output by identifying function entry and return. Function entry probe reports are indented and their output is prefixed with \fB->\fR. Function return probe reports are unindented and their output is prefixed with \fB<-\fR\&. System call -entry probe reports are indented and their output is prefixed with \fB=>\fR. System call return probe reports are unindented and their output is prefixed with \fB<=\fR\&. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-G\fR\fR -.ad -.sp .6 -.RS 4n -Generate an ELF file containing an embedded DTrace program. The DTrace probes specified in the program are saved inside of a relocatable ELF object which can be linked into another program. If the \fB-o\fR option is present, the ELF file is saved using the pathname specified -as the argument for this operand. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name \fB\fIfilename\fR.o\fR. -Otherwise the ELF file is saved using the name \fBd.out\fR. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-H\fR\fR -.ad -.sp .6 -.RS 4n -Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-H\fR option -to each \fBcpp\fR invocation, causing it to display the list of pathnames, one for each line, to \fBstderr\fR. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-h\fR\fR -.ad -.sp .6 -.RS 4n -Generate a header file containing macros that correspond to probes in the specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the \fB-G\fR option. If the \fB-o\fR option -is present, the header file is saved using the pathname specified as the argument for that option. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fIfilename\fR\fB\&.d\fR, then the header file is saved -using the name \fIfilename\fR\fB\&.h\fR. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-i\fR \fIprobe-id\fR\fB[[\fR\fIpredicate\fR] \fIaction\fR\fB]\fR\fR -.ad -.sp .6 -.RS 4n -Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB-l\fR option). You can specify probe IDs using decimal integers as shown by \fBdtrace\fR \fB-l\fR. The \fB-i\fR argument can be suffixed with an optional -D probe clause. You can specify more than one \fB-i\fR option at a time. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-I\fR \fIpath\fR\fR -.ad -.sp .6 -.RS 4n -Add the specified directory \fIpath\fR to the search path for \fB#include\fR files when invoking \fBcpp\fR(1) (enabled -using the \fB-C\fR option). This option passes the \fB-I\fR option to each \fBcpp\fR invocation. The specified \fIpath\fR is inserted into the search path ahead of the default directory list. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-L\fR \fIpath\fR\fR -.ad -.sp .6 -.RS 4n -Add the specified directory \fIpath\fR to the search path for DTrace libraries. DTrace libraries are used to contain common definitions that can be used when writing D programs. The specified \fIpath\fR is added after the default library -search path. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-l\fR\fR -.ad -.sp .6 -.RS 4n -List probes instead of enabling them. If the \fB-l\fR option is specified, \fBdtrace\fR produces a report of the probes matching the descriptions given using the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, \fB-i\fR, -and \fB-s\fR options. If none of these options are specified, this option lists all probes. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-m\fR [[\fIprovider:\fR] \fImodule:\fR [[\fIpredicate\fR] \fIaction\fR]]\fR -.ad -.sp .6 -.RS 4n -Specify module name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module\fR or \fImodule\fR. Unspecified probe description fields are left blank and match -any probes regardless of the values in those fields. If no qualifiers other than \fImodule\fR are specified in the description, all probes with a corresponding \fImodule\fR are matched. The \fB-m\fR argument can be suffixed with an optional D -probe clause. More than one \fB-m\fR option can be specified on the command line at a time. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]\fR -.ad -.sp .6 -.RS 4n -Specify probe name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function:name\fR, \fImodule:function:name\fR, \fIfunction:name\fR, -or \fIname\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIname\fR are specified in the description, all probes with a corresponding \fIname\fR are -matched. The \fB-n\fR argument can be suffixed with an optional D probe clause. More than one \fB-n\fR option can be specified on the command line at a time. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-o\fR \fIoutput\fR\fR -.ad -.sp .6 -.RS 4n -Specify the \fIoutput\fR file for the \fB-A\fR , \fB-G\fR, and \fB-l\fR options, or for the traced data itself. If the \fB-A\fR option is present and \fB-o\fR is not present, the default output file is \fB/kernel/drv/dtrace.conf\fR. If the \fB-G\fR option is present and the \fB-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB-o\fR is not present, the default output file is \fB\fIfilename\fR.o\fR. -Otherwise the default output file is \fBd.out\fR. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-p\fR \fIpid\fR\fR -.ad -.sp .6 -.RS 4n -Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon its completion. If more than one \fB-p\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status -for each process as it terminates. The first process-ID is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for -more information on macro variables. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-P\fR \fIprovider\fR \fB[[\fR\fIpredicate\fR\fB]\fR \fIaction\fR]\fR -.ad -.sp .6 -.RS 4n -Specify provider name to trace or list (\fB-l\fR option). The remaining probe description fields module, function, and name are left blank and match any probes regardless of the values in those fields. The \fB-P\fR argument can be suffixed with an optional D -probe clause. You can specify more than one \fB-P\fR option on the command line at a time. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-q\fR\fR -.ad -.sp .6 -.RS 4n -Set quiet mode. \fBdtrace\fR suppresses messages such as the number of probes matched by the specified options and D programs and does not print column headers, the CPU ID, the probe ID, or insert newlines into the output. Only data traced and formatted by D program -statements such as \fBtrace()\fR and \fBprintf()\fR is displayed to \fBstdout\fR. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-s\fR\fR -.ad -.sp .6 -.RS 4n -Compile the specified D program source file. If the \fB-e\fR option is present, the program is compiled but instrumentation is not enabled. If the \fB-l\fR option is present, the program is compiled and the set of probes matched by it is listed, but instrumentation -is not enabled. If none of \fB-e\fR, \fB-l\fR, \fB-G\fR, or \fB-A\fR are present, the instrumentation specified by the D program is enabled and tracing begins. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-S\fR\fR -.ad -.sp .6 -.RS 4n -Show D compiler intermediate code. The D compiler produces a report of the intermediate code generated for each D program to \fBstderr\fR. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-U\fR \fIname\fR\fR -.ad -.sp .6 -.RS 4n -Undefine the specified \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-U\fR option to each \fBcpp\fR invocation. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-v\fR\fR -.ad -.sp .6 -.RS 4n -Set verbose mode. If the \fB-v\fR option is specified, \fBdtrace\fR produces a program stability report showing the minimum interface stability and dependency level for the specified D programs. DTrace stability levels are explained in further detail in the \fISolaris Dynamic Tracing Guide\fR. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-V\fR\fR -.ad -.sp .6 -.RS 4n -Report the highest D programming interface version supported by \fBdtrace\fR. The version information is printed to \fBstdout\fR and the \fBdtrace\fR command exits. Refer to the \fISolaris Dynamic Tracing Guide\fR for -more information about DTrace versioning features. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-w\fR\fR -.ad -.sp .6 -.RS 4n -Permit destructive actions in D programs specified using the \fB-s\fR, \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options. If the \fB-w\fR option is not specified, \fBdtrace\fR does not -permit the compilation or enabling of a D program that contains destructive actions. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-x\fR \fIarg\fR [\fI=val\fR]\fR -.ad -.sp .6 -.RS 4n -Enable or modify a DTrace runtime option or D compiler option. The list of options is found in the \fISolaris Dynamic Tracing Guide\fR. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and -value with an equals sign (\fB=\fR). -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-X\fR \fBa | c | s | t\fR\fR -.ad -.sp .6 -.RS 4n -Specify the degree of conformance to the ISO C standard that should be selected when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). -The \fB-X\fR option argument affects the value and presence of the \fB__STDC__\fR macro depending upon the value of the argument letter. -.sp -The \fB-X\fR option supports the following arguments: -.sp -.ne 2 -.mk -.na -\fB\fBa\fR\fR -.ad -.RS 5n -.rt -Default. ISO C plus K&R compatibility extensions, with semantic changes required by ISO C. This is the default mode if \fB-X\fR is not specified. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction -with the \fB-Xa\fR option. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fBc\fR\fR -.ad -.RS 5n -.rt -Conformance. Strictly conformant ISO C, without K&R C compatibility extensions. The predefined macro \fB__STDC__\fR has a value of 1 when \fBcpp\fR is invoked in conjunction with the \fB-Xc\fR option. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fBs\fR\fR -.ad -.RS 5n -.rt -K&R C only. The macro \fB__STDC__\fR is not defined when \fBcpp\fR is invoked in conjunction with the \fB-Xs\fR option. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fBt\fR\fR -.ad -.RS 5n -.rt -Transition. ISO C plus K&R C compatibility extensions, without semantic changes required by ISO C. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction with the \fB-Xt\fR option. -.RE - -As the \fB-X\fR option only affects how the D compiler invokes the C preprocessor, the \fB-Xa\fR and \fB-Xt\fR options are equivalent from the perspective of D and both are provided only to ease re-use of settings from a C build environment. -.sp -Regardless of the \fB-X\fR mode, the following additional C preprocessor definitions are always specified and valid in all modes: -.RS +4 -.TP -.ie t \(bu -.el o -\fB__sun\fR -.RE -.RS +4 -.TP -.ie t \(bu -.el o -\fB__unix\fR -.RE -.RS +4 -.TP -.ie t \(bu -.el o -\fB__SVR4\fR -.RE -.RS +4 -.TP -.ie t \(bu -.el o -\fB__sparc\fR (on SPARC systems only) -.RE -.RS +4 -.TP -.ie t \(bu -.el o -\fB__sparcv9\fR (on SPARC systems only when 64-bit programs are compiled) -.RE -.RS +4 -.TP -.ie t \(bu -.el o -\fB__i386\fR (on x86 systems only when 32-bit programs are compiled) -.RE -.RS +4 -.TP -.ie t \(bu -.el o -\fB__amd64\fR (on x86 systems only when 64-bit programs are compiled) -.RE -.RS +4 -.TP -.ie t \(bu -.el o -\fB__\fI`uname -s`\fR_\fI`uname -r`\fR\fR (for example, \fB__SunOS_5_10\fR) -.RE -.RS +4 -.TP -.ie t \(bu -.el o -\fB__SUNW_D=1\fR -.RE -.RS +4 -.TP -.ie t \(bu -.el o -\fB__SUNW_D_VERSION=0x\fIMMmmmuuu\fR\fR -.sp -Where \fIMM\fR is the major release value in hexadecimal, \fImmm\fR is the minor release value in hexadecimal, and \fIuuu\fR is the -micro release value in hexadecimal. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information about DTrace versioning. -.RE -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-Z\fR\fR -.ad -.sp .6 -.RS 4n -Permit probe descriptions that match zero probes. If the \fB-Z\fR option is not specified, \fBdtrace\fR reports an error and exits if any probe descriptions specified in D program files (\fB-s\fR option) or on the command line (\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options) contain descriptions that do not match any known probes. -.RE - -.SH OPERANDS -.sp -.LP -You can specify zero or more additional arguments on the \fBdtrace\fR command line to define a set of macro variables (\fB$1\fR, \fB$2\fR, and so forth). The additional arguments can be used in D programs specified using the \fB-s\fR option -or on the command line. The use of macro variables is described further in the \fISolaris Dynamic Tracing Guide\fR. -.SH EXIT STATUS -.sp -.LP -The following exit values are returned: -.sp -.ne 2 -.mk -.na -\fB0\fR -.ad -.RS 5n -.rt -Successful completion. -.sp -For D program requests, an exit status of \fB0\fR indicates that programs were successfully compiled, probes were successfully enabled, or anonymous state was successfully retrieved. \fBdtrace\fR returns \fB0\fR even if the specified tracing requests -encountered errors or drops. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB1\fR\fR -.ad -.RS 5n -.rt +.Bl -tag -width indent +.It Fl 32 | Fl 64 +The D compiler produces programs using the native data model of the operating +system kernel. +If the +.Fl 32 +option is specified, +.Nm +forces the D compiler to compile a D program using the 32-bit data model. +If the +.Fl 64 +option is specified, +.Nm +forces the D compiler to compile a D program using the 64-bit data model. +These options are typically not required as +.Nm +selects the native data model as the default. +The data model affects the sizes of integer types and other language properties. +D programs compiled for either data model can be executed on both 32-bit and +64-bit kernels. +The +.Fl 32 +and +.Fl 64 +options also determine the +.Xr elf 5 +file format (ELF32 or ELF64) produced by the +.Fl G +option. +.It Fl a +Claim anonymous tracing state and display the traced data. +You can combine the +.Fl a +option with the +.Fl e +option to force +.Nm +to exit immediately after consuming the anonymous tracing state rather than +continuing to wait for new data. +.It Fl A +Generate directives for anonymous tracing and write them to +.Pa /boot/dtrace.dof . +This option constructs a set of dtrace configuration file directives to enable +the specified probes for anonymous tracing and then exits. +By default, +.Nm +attempts to store the directives to the file +.Pa /boot/dtrace.dof . +This behavior can be modified using the +.Fl o +option to specify an alternate output file. +.It Fl b Ar bufsz +Set the principal trace buffer size to +.Ar bufsz . +The trace buffer size can include any of the size suffixes k, m, g, or t. +If the buffer space cannot be allocated, +.Nm dtrace +attempts to reduce the buffer size or exit depending on the setting of the +bufresize property. +.It Fl c Ar cmd +Run the specified command +.Ar cmd +and exit upon its completion. +If more than one +.Fl c +option is present on the command line, +.Nm dtrace +exits when all commands have exited, reporting the exit status for each child +process as it terminates. +The process ID of the first command is made available to any D programs +specified on the command line or using the +.Fl s +option through the +.Li $target +macro variable. +.It Fl C +Run the C preprocessor +.Xr cpp 1 +over D programs before compiling them. +You can pass options to the C preprocessor using the +.Fl D , +.Fl U , +.Fl I , +and +.Fl H +options. +You can select the degree of C standard conformance if you use the +.Fl X +option. +For a description of the set of tokens defined by the D compiler when invoking +the C preprocessor, see +.Fl X . +.It Fl D Ar name Op Ns = Ns value +Define +.Ar name +when invoking +.Xr cpp 1 +(enabled using the +.Fl C +option). +If you specify an additional +.Ar value , +the name is assigned the corresponding value. +This option passes the +.Fl D +option to each +.Xr cpp 1 +invocation. +.It Fl e +Exit after compiling any requests and consuming anonymous tracing state +.Fl ( a +option) but prior to enabling any probes. +You can combine this option with the +.Fl a +option to print anonymous tracing data and exit. +You can also combine this option with D compiler options. +This combination verifies that the programs compile without actually executing +them and enabling the corresponding instrumentation. +.It Fl f Oo Oo Ar provider : Oc Ar module : Oc Ar function Oo Oo Ar predicate \ + Oc Ar action Oc +Specify function name to trace or list +.Fl ( l +option). +The corresponding argument can include any of the probe description forms +.Ar provider:module:function , +.Ar module:function , +or +.Ar function . +Unspecified probe description fields are left blank and match any probes +regardless of the values in those fields. +If no qualifiers other than +.Ar function +are specified in the description, all probes with the corresponding +.Ar function +are matched. +The +.Fl f +argument can be suffixed with an optional D probe clause. +You can specify more than one +.Fl f +option on the command line at a time. +.It Fl F +Coalesce trace output by identifying function entry and return. +Function entry probe reports are indented and their output is prefixed with +.Ql -> . +Function return probe reports are unindented and their output is prefixed with +.Ql <- . +System call entry probe reports are indented and their output is prefixed with +.Ql => . +System call return probe reports are unindented and their output is prefixed +with +.Ql <= . +.It Fl G +Generate an ELF file containing an embedded DTrace program. +The DTrace probes specified in the program are saved inside of a relocatable ELF +object which can be linked into another program. +If the +.Fl o +option is present, the ELF file is saved using the pathname specified as the +argument for this operand. +If the +.Fl o +option is not present and the DTrace program is contained with a file whose name +is +.Ar filename.d , +then the ELF file is saved using the name +.Ar filename.o . +Otherwise the ELF file is saved using the name d.out. +.It Fl h +Generate a header file containing macros that correspond to probes in the +specified provider definitions. +This option should be used to generate a header file that is included by other +source files for later use with the +.It Fl H +Print the pathnames of included files when invoking +.Xr cpp 1 +(enabled using the +.Fl C +option). +This option passes the +.Fl H +option to each +.Xr cpp 1 +invocation, causing it to display the list of pathnames, one for each line, to +standard error. +.Fl G +option. +If the +.Fl o +option +is present, the header file is saved using the pathname specified as the +argument for that option. +If the +.Fl o +option is not present and the DTrace program is contained with a file whose +name is +.Ar filename.d , +then the header file is saved using the name +.Ar filename.h . +.It Fl i Ar probe-id Op Oo Ar predicate Oc Ar action +Specify probe identifier +.Ar ( probe-id ) +to trace or list +.Ar ( l +option). +You can specify probe IDs using decimal integers as shown by `dtrace -l`. +The +.Fl i +argument can be suffixed with an optional D probe clause. +You can specify more than one +.Fl i +option at a time. +.It Fl I Ar path +Add the specified directory +.Ar path +to the search path for #include files when invoking +.Xr cpp 1 +(enabled using the +.Fl C +option). +This option passes the +.Fl I +option to each +.Xr cpp 1 +invocation. +The specified +.Ar path +is inserted into the search path ahead of the default directory list. +.It Fl l +List probes instead of enabling them. +If the +.Fl l +option is specified, +.Nm +produces a report of the probes matching the descriptions given using the +.Fl P , m , f , n , i , +and +.Fl s +options. +If none of these options are specified, this option lists all probes. +.It Fl L Ar path +Add the specified directory +.Ar path +to the search path for DTrace libraries. +DTrace libraries are used to contain common definitions that can be used when +writing D programs. +The specified +.Ar path +is added after the default library search path. +.It Fl m Oo Ar provider : Oc Ar module Oo Oo Ar predicate Oc Ar action Oc +Specify module name to trace or list +.Fl ( l +option). +The corresponding argument can include any of the probe description forms +.Ar provider:module +or +.Ar module . +Unspecified probe description fields are left blank and match any probes +regardless of the values in those fields. +If no qualifiers other than +.Ar module +are specified in the description, all probes with a corresponding +.Ar module +are matched. +The +.Fl m +argument can be suffixed with an optional D probe clause. +More than one +.Fl m +option can be specified on the command line at a time. +.It Fl n Oo Oo Oo Ar provider : Oc Ar module : Oc Ar function : Oc Ar name \ + Oo Oo Ar predicate Oc Ar action Oc +Specify probe name to trace or list +.Fl ( l +option). +The corresponding argument can include any of the probe description forms +.Ar provider:module:function:name , module:function:name , function:name , +or +.Ar name . +Unspecified probe description fields are left blank and match any probes +regardless of the values in those fields. +If no qualifiers other than +.Ar name +are specified in the description, all probes with a corresponding +.Ar name +are matched. +The +.Fl n +argument can be suffixed with an optional D probe clause. +More than one +.Fl n +option can be specified on the command line at a time. +.It Fl o Ar output +Specify the +.Ar output +file for the +.Fl A , G , +and *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 03:57:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 93C244D3; Thu, 10 Oct 2013 03:57:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F7FE2B03; Thu, 10 Oct 2013 03:57:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9A3vlVL041486; Thu, 10 Oct 2013 03:57:47 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9A3vlSL041485; Thu, 10 Oct 2013 03:57:47 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201310100357.r9A3vlSL041485@svn.freebsd.org> From: Justin Hibbits Date: Thu, 10 Oct 2013 03:57: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: r256252 - stable/9/sys/dev/adb 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, 10 Oct 2013 03:57:47 -0000 Author: jhibbits Date: Thu Oct 10 03:57:47 2013 New Revision: 256252 URL: http://svnweb.freebsd.org/changeset/base/256252 Log: MFC r255921 Fix powerpc/161045. ams_poll() needs to return that any data is available, not just a new packet. PR: powerpc/161045 Modified: stable/9/sys/dev/adb/adb_mouse.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/adb/adb_mouse.c ============================================================================== --- stable/9/sys/dev/adb/adb_mouse.c Thu Oct 10 03:50:23 2013 (r256251) +++ stable/9/sys/dev/adb/adb_mouse.c Thu Oct 10 03:57:47 2013 (r256252) @@ -471,7 +471,8 @@ ams_poll(struct cdev *dev, int events, s mtx_lock(&sc->sc_mtx); if (sc->xdelta == 0 && sc->ydelta == 0 && - sc->buttons == sc->last_buttons) { + sc->buttons == sc->last_buttons && + sc->packet_read_len == 0) { selrecord(p, &sc->rsel); events = 0; } else { From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 07:23:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C3C89175; Thu, 10 Oct 2013 07:23:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B19EC25AA; Thu, 10 Oct 2013 07:23:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9A7NBlT047175; Thu, 10 Oct 2013 07:23:11 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9A7NBOf047173; Thu, 10 Oct 2013 07:23:11 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310100723.r9A7NBOf047173@svn.freebsd.org> From: Dimitry Andric Date: Thu, 10 Oct 2013 07:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256253 - head/sys/contrib/ipfilter/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: Thu, 10 Oct 2013 07:23:11 -0000 Author: dim Date: Thu Oct 10 07:23:11 2013 New Revision: 256253 URL: http://svnweb.freebsd.org/changeset/base/256253 Log: Initialize a variable in sys/contrib/ipfilter/netinet/ip_tftp_pxy.c, to silence a gcc warning. Approved by: re (rodrigc) X-MFC-With: r255332 Modified: head/sys/contrib/ipfilter/netinet/ip_tftp_pxy.c Modified: head/sys/contrib/ipfilter/netinet/ip_tftp_pxy.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_tftp_pxy.c Thu Oct 10 03:57:47 2013 (r256252) +++ head/sys/contrib/ipfilter/netinet/ip_tftp_pxy.c Thu Oct 10 07:23:11 2013 (r256253) @@ -297,7 +297,7 @@ ipf_p_tftp_backchannel(fin, aps, nat) tftpinfo_t *ti; udphdr_t udp; fr_info_t fi; - u_short slen; + u_short slen = 0; /* silence gcc */ nat_t *nat2; int nflags; ip_t *ip; From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 07:41:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1F2F67BA; Thu, 10 Oct 2013 07:41:12 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0CC4026BF; Thu, 10 Oct 2013 07:41:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9A7fBx3056326; Thu, 10 Oct 2013 07:41:11 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9A7fBUt056324; Thu, 10 Oct 2013 07:41:11 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201310100741.r9A7fBUt056324@svn.freebsd.org> From: Hiroki Sato Date: Thu, 10 Oct 2013 07:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256255 - in 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: Thu, 10 Oct 2013 07:41:12 -0000 Author: hrs Date: Thu Oct 10 07:41:11 2013 New Revision: 256255 URL: http://svnweb.freebsd.org/changeset/base/256255 Log: Add support for "vnet jname" argument in ifconfig_IF. The vnet keyword is ignored except for "rc.d/netif vnet{up,down} ifn" because a jail is usually created after interface initialization on boot time. "rc.d/netif vnetup ifn" moves ifn into the specified jail. It is designed to be used in other scripts like rc.d/jail, not automatically invoked during the interface initialization. Approved by: re (kib) Modified: head/etc/network.subr head/etc/rc.d/netif Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Thu Oct 10 07:39:19 2013 (r256254) +++ head/etc/network.subr Thu Oct 10 07:41:11 2013 (r256255) @@ -82,6 +82,41 @@ ifn_stop() return $cfg } +# ifn_vnetup ifn +# Move ifn to the specified vnet jail. +# +ifn_vnetup() +{ + + ifn_vnet0 $1 vnet +} + +# ifn_vnetdown ifn +# Reclaim ifn from the specified vnet jail. +# +ifn_vnetdown() +{ + + ifn_vnet0 $1 -vnet +} + +# ifn_vnet0 ifn action +# Helper function for ifn_vnetup and ifn_vnetdown. +# +ifn_vnet0() +{ + local _ifn _cfg _action _vnet + _ifn="$1" + _action="$2" + _cfg=1 + + if _vnet=$(vnetif $_ifn); then + ${IFCONFIG_CMD} $_ifn $_action $_vnet && _cfg=0 + fi + + return $_cfg +} + # ifconfig_up if # Evaluate ifconfig(8) arguments for interface $if and # run ifconfig(8) with those arguments. It returns 0 if @@ -284,24 +319,27 @@ _ifconfig_getargs() # args such as DHCP and WPA. ifconfig_getargs() { - local _tmpargs _arg _args + local _tmpargs _arg _args _vnet _tmpargs=`_ifconfig_getargs $1 $2` if [ $? -eq 1 ]; then return 1 fi _args= + _vnet=0 for _arg in $_tmpargs; do - case $_arg in - [Dd][Hh][Cc][Pp]) ;; - [Nn][Oo][Aa][Uu][Tt][Oo]) ;; - [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;; - [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;; - [Ww][Pp][Aa]) ;; - [Hh][Oo][Ss][Tt][Aa][Pp]) ;; - *) + case $_arg:$_vnet in + [Dd][Hh][Cc][Pp]:0) ;; + [Nn][Oo][Aa][Uu][Tt][Oo]:0) ;; + [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]:0) ;; + [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]:0) ;; + [Ww][Pp][Aa]:0) ;; + [Hh][Oo][Ss][Tt][Aa][Pp]:0) ;; + vnet:0) _vnet=1 ;; + *:1) _vnet=0 ;; + *:0) _args="$_args $_arg" - ;; + ;; esac done @@ -426,6 +464,25 @@ hostapif() return 1 } +# vnetif if +# Returns 0 and echo jail if "vnet" keyword is specified on the +# interface, and 1 otherwise. +vnetif() +{ + local _tmpargs _arg _vnet + _tmpargs=`_ifconfig_getargs $1` + + _vnet=0 + for _arg in $_tmpargs; do + case $_arg:$_vnet in + vnet:0) _vnet=1 ;; + *:1) echo $_arg; return 0 ;; + esac + done + + return 1 +} + # afexists af # Returns 0 if the address family is enabled in the kernel # 1 otherwise. Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Thu Oct 10 07:39:19 2013 (r256254) +++ head/etc/rc.d/netif Thu Oct 10 07:41:11 2013 (r256255) @@ -39,7 +39,9 @@ stop_cmd="network_stop" cloneup_cmd="clone_up" clonedown_cmd="clone_down" clear_cmd="doclear" -extra_commands="cloneup clonedown clear" +vnetup_cmd="vnet_up" +vnetdown_cmd="vnet_down" +extra_commands="cloneup clonedown clear vnetup vnetdown" cmdifn= set_rcvar_obsolete ipv6_enable ipv6_activate_all_interfaces @@ -123,6 +125,20 @@ network_stop0() fi } +vnet_up() +{ + cmdifn=$* + + network_common ifn_vnetup $cmdifn +} + +vnet_down() +{ + cmdifn=$* + + network_common ifn_vnetdown $cmdifn +} + # network_common routine # Common configuration subroutine for network interfaces. This # routine takes all the preparatory steps needed for configuriing @@ -198,7 +214,7 @@ network_common() # inet6 address configuration needs sleep for DAD. case ${_func}:${_dadwait} in - ifn_start:1) + ifn_start:1|ifn_vnetup:1|ifn_vnetdown:1) sleep `${SYSCTL_N} net.inet6.ip6.dad_count` sleep 1 ;; @@ -209,12 +225,25 @@ network_common() case ${_func} in ifn_start) _str='Starting' - ;; + ;; ifn_stop) _str='Stopping' - ;; + ;; + ifn_vnetup) + _str='Moving' + ;; + ifn_vnetdown) + _str='Reclaiming' + ;; esac echo "${_str} Network:${_ok}." + case ${_func} in + ifn_vnetup) + # Clear _ok not to do "ifconfig $ifn" + # because $ifn is no longer in the current vnet. + _ok= + ;; + esac if check_startmsgs; then for ifn in ${_ok}; do /sbin/ifconfig ${ifn} From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 09:32:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E505A480; Thu, 10 Oct 2013 09:32:28 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C1C002CB3; Thu, 10 Oct 2013 09:32:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9A9WSlV013651; Thu, 10 Oct 2013 09:32:28 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9A9WS0H013645; Thu, 10 Oct 2013 09:32:28 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201310100932.r9A9WS0H013645@svn.freebsd.org> From: Hiroki Sato Date: Thu, 10 Oct 2013 09:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256256 - in head: . etc etc/defaults etc/rc.d share/man/man5 usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 09:32:29 -0000 Author: hrs Date: Thu Oct 10 09:32:27 2013 New Revision: 256256 URL: http://svnweb.freebsd.org/changeset/base/256256 Log: - Update rc.d/jail to use a jail(8) configuration file instead of command line options. The "jail__*" rc.conf(5) variables for per-jail configuration are automatically converted to /var/run/jail..conf before the jail(8) utility is invoked. This is transparently backward compatible. - Fix a minor bug in jail(8) which prevented it from returning false when jail -r failed. Approved by: re (glebius) Modified: head/UPDATING head/etc/defaults/rc.conf head/etc/rc.d/jail head/etc/rc.subr head/share/man/man5/rc.conf.5 head/usr.sbin/jail/jail.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Oct 10 07:41:11 2013 (r256255) +++ head/UPDATING Thu Oct 10 09:32:27 2013 (r256256) @@ -31,6 +31,25 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20131010: + The rc.d/jail script has been updated to support jail(8) + configuration file. The "jail__*" rc.conf(5) variables + for per-jail configuration are automatically converted to + /var/run/jail..conf before the jail(8) utility is invoked. + This is transparently backward compatible. See below about some + incompatibilities and rc.conf(5) manual page for more details. + + These variables are now deprecated in favor of jail(8) configuration + file. One can use "rc.d/jail config " command to generate + a jail(8) configuration file in /var/run/jail..conf without + running the jail(8) utility. The default pathname of the + configuration file is /etc/jail.conf and can be specified by + using $jail_conf or $jail__conf variables. + + Please note that jail_devfs_ruleset accepts an integer at + this moment. Please consider to rewrite the ruleset name + with an integer. + 20130930: BIND has been removed from the base system. If all you need is a local resolver, simply enable and start the local_unbound Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Oct 10 07:41:11 2013 (r256255) +++ head/etc/defaults/rc.conf Thu Oct 10 09:32:27 2013 (r256256) @@ -674,44 +674,11 @@ mixer_enable="YES" # Run the sound mixer opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off ############################################################## -### Jail Configuration ####################################### +### Jail Configuration (see rc.conf(5) manual page) ########## ############################################################## jail_enable="NO" # Set to NO to disable starting of any jails jail_parallel_start="NO" # Start jails in the background jail_list="" # Space separated list of names of jails -jail_set_hostname_allow="YES" # Allow root user in a jail to change its hostname -jail_socket_unixiproute_only="YES" # Route only TCP/IP within a jail -jail_sysvipc_allow="NO" # Allow SystemV IPC use from within a jail - -# -# To use rc's built-in jail infrastructure create entries for -# each jail, specified in jail_list, with the following variables. -# NOTES: -# - replace 'example' with the jail's name. -# - except rootdir, hostname, ip and the _multi addresses, -# all of the following variables may be made global jail variables -# if you don't specify a jail name (ie. jail_interface, jail_devfs_ruleset). -# -#jail_example_rootdir="/usr/jail/default" # Jail's root directory -#jail_example_hostname="default.domain.com" # Jail's hostname -#jail_example_interface="" # Jail's interface variable to create IP aliases on -#jail_example_fib="0" # Routing table for setfib(1) -#jail_example_ip="192.0.2.10,2001:db8::17" # Jail's primary IPv4 and IPv6 address -#jail_example_ip_multi0="2001:db8::10" # and another IPv6 address -#jail_example_exec_start="/bin/sh /etc/rc" # command to execute in jail for starting -#jail_example_exec_afterstart0="/bin/sh command" # command to execute after the one for - # starting the jail. More than one can be - # specified using a trailing number -#jail_example_exec_stop="/bin/sh /etc/rc.shutdown" # command to execute in jail for stopping -#jail_example_devfs_enable="NO" # mount devfs in the jail -#jail_example_devfs_ruleset="ruleset_name" # devfs ruleset to apply to jail - - # usually you want "devfsrules_jail". -#jail_example_fdescfs_enable="NO" # mount fdescfs in the jail -#jail_example_procfs_enable="NO" # mount procfs in jail -#jail_example_mount_enable="NO" # mount/umount jail's fs -#jail_example_fstab="" # fstab(5) for mount/umount -#jail_example_flags="-l -U root" # flags for jail(8) -#jail_example_parameters="allow.raw_sockets=1" # extra parameters for this jail ############################################################## ### Define source_rc_confs, the mechanism used by /etc/rc.* ## Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Thu Oct 10 07:41:11 2013 (r256255) +++ head/etc/rc.d/jail Thu Oct 10 09:32:27 2013 (r256256) @@ -8,81 +8,138 @@ # BEFORE: securelevel # KEYWORD: nojail shutdown -# WARNING: This script deals with untrusted data (the data and -# processes inside the jails) and care must be taken when changing the -# code related to this! If you have any doubt whether a change is -# correct and have security impact, please get the patch reviewed by -# the FreeBSD Security Team prior to commit. - . /etc/rc.subr name="jail" rcvar="jail_enable" -start_precmd="jail_prestart" start_cmd="jail_start" +start_postcmd="jail_warn" stop_cmd="jail_stop" +config_cmd="jail_config" +console_cmd="jail_console" +status_cmd="jail_status" +extra_commands="config console status" +: ${jail_conf:=/etc/jail.conf} +: ${jail_program:=/usr/sbin/jail} +: ${jail_consolecmd:=/bin/sh} +: ${jail_jexec:=/usr/sbin/jexec} +: ${jail_jls:=/usr/sbin/jls} + +need_dad_wait= + +# extact_var jail name param num defval +# Extract value from ${jail_$jail_$name} or ${jail_$name} and +# set it to $param. If not defined, $defval is used. +# When $num is [0-9]*, ${jail_$jail_$name$num} are looked up and +# $param is set by using +=. +# When $num is YN or NY, the value is interpret as boolean. +extract_var() +{ + local i _j _name _param _num _def _name1 _name2 + _j=$1 + _name=$2 + _param=$3 + _num=$4 + _def=$5 + + case $_num in + YN) + _name1=jail_${_j}_${_name} + _name2=jail_${_name} + eval $_name1=\"\${$_name1:-\${$_name2:-$_def}}\" + if checkyesno $_name1; then + echo " $_param = 1;" + else + echo " $_param = 0;" + fi + ;; + NY) + _name1=jail_${_j}_${_name} + _name2=jail_${_name} + eval $_name1=\"\${$_name1:-\${$_name2:-$_def}}\" + if checkyesno $_name1; then + echo " $_param = 0;" + else + echo " $_param = 1;" + fi + ;; + [0-9]*) + i=$_num + while : ; do + _name1=jail_${_j}_${_name}${i} + _name2=jail_${_name}${i} + eval _tmpargs=\"\${$_name1:-\${$_name2:-$_def}}\" + if [ -n "$_tmpargs" ]; then + echo " $_param += \"$_tmpargs\";" + else + break; + fi + i=$(($i + 1)) + done + ;; + *) + _name1=jail_${_j}_${_name} + _name2=jail_${_name} + eval _tmpargs=\"\${$_name1:-\${$_name2:-$_def}}\" + if [ -n "$_tmpargs" ]; then + echo " $_param = \"$_tmpargs\";" + fi + ;; + esac +} -# init_variables _j -# Initialize the various jail variables for jail _j. +# parse_options _j +# Parse options and create a temporary configuration file if necessary. # -init_variables() +parse_options() { - _j="$1" + local _j + _j=$1 + _confwarn=0 if [ -z "$_j" ]; then - warn "init_variables: you must specify a jail" + warn "parse_options: you must specify a jail" return fi - + eval _jconf=\"\${jail_${_j}_conf:-/etc/jail.${_j}.conf}\" eval _rootdir=\"\$jail_${_j}_rootdir\" - _devdir="${_rootdir}/dev" - _fdescdir="${_devdir}/fd" - _procdir="${_rootdir}/proc" eval _hostname=\"\$jail_${_j}_hostname\" + if [ -z "$_rootdir" -o \ + -z "$_hostname" ]; then + if [ -r "$_jconf" ]; then + _conf="$_jconf" + return 0 + elif [ -r "$jail_conf" ]; then + _conf="$jail_conf" + return 0 + else + warn "Invalid configuration for $_j " \ + "(no jail.conf, no hostname, or no path). " \ + "Jail $_j was ignored." + fi + return 1 + fi eval _ip=\"\$jail_${_j}_ip\" - eval _interface=\"\${jail_${_j}_interface:-${jail_interface}}\" - eval _exec=\"\$jail_${_j}_exec\" - - i=0 - while : ; do - eval _exec_prestart${i}=\"\${jail_${_j}_exec_prestart${i}:-\${jail_exec_prestart${i}}}\" - [ -z "$(eval echo \"\$_exec_prestart${i}\")" ] && break - i=$((i + 1)) - done - - eval _exec_start=\"\${jail_${_j}_exec_start:-${jail_exec_start}}\" - - i=1 - while : ; do - eval _exec_afterstart${i}=\"\${jail_${_j}_exec_afterstart${i}:-\${jail_exec_afterstart${i}}}\" - [ -z "$(eval echo \"\$_exec_afterstart${i}\")" ] && break - i=$((i + 1)) - done - - i=0 - while : ; do - eval _exec_poststart${i}=\"\${jail_${_j}_exec_poststart${i}:-\${jail_exec_poststart${i}}}\" - [ -z "$(eval echo \"\$_exec_poststart${i}\")" ] && break - i=$((i + 1)) - done - - i=0 - while : ; do - eval _exec_prestop${i}=\"\${jail_${_j}_exec_prestop${i}:-\${jail_exec_prestop${i}}}\" - [ -z "$(eval echo \"\$_exec_prestop${i}\")" ] && break - i=$((i + 1)) - done - - eval _exec_stop=\"\${jail_${_j}_exec_stop:-${jail_exec_stop}}\" - - i=0 - while : ; do - eval _exec_poststop${i}=\"\${jail_${_j}_exec_poststop${i}:-\${jail_exec_poststop${i}}}\" - [ -z "$(eval echo \"\$_exec_poststop${i}\")" ] && break - i=$((i + 1)) - done + if [ -z "$_ip" ] && ! check_kern_features vimage; then + warn "no ipaddress specified and no vimage support. " \ + "Jail $_j was ignored." + return 1 + fi + _conf=/var/run/jail.${_j}.conf + # + # To relieve confusion, show a warning message. + # + _confwarn=1 + if [ -r "$jail_conf" -o -r "$_jconf" ]; then + warn "$_conf is created and used for jail $_j." + fi + /usr/bin/install -m 0644 -o root -g wheel /dev/null $_conf || return 1 + eval : \${jail_${_j}_flags:=${jail_flags}} + eval _exec=\"\$jail_${_j}_exec\" + eval _exec_start=\"\$jail_${_j}_exec_start\" + eval _exec_stop=\"\$jail_${_j}_exec_stop\" if [ -n "${_exec}" ]; then # simple/backward-compatible execution _exec_start="${_exec}" @@ -96,285 +153,104 @@ init_variables() fi fi fi - - # The default jail ruleset will be used by rc.subr if none is specified. - eval _ruleset=\"\${jail_${_j}_devfs_ruleset:-${jail_devfs_ruleset}}\" - eval _devfs=\"\${jail_${_j}_devfs_enable:-${jail_devfs_enable}}\" - [ -z "${_devfs}" ] && _devfs="NO" - eval _fdescfs=\"\${jail_${_j}_fdescfs_enable:-${jail_fdescfs_enable}}\" - [ -z "${_fdescfs}" ] && _fdescfs="NO" - eval _procfs=\"\${jail_${_j}_procfs_enable:-${jail_procfs_enable}}\" - [ -z "${_procfs}" ] && _procfs="NO" - - eval _mount=\"\${jail_${_j}_mount_enable:-${jail_mount_enable}}\" - [ -z "${_mount}" ] && _mount="NO" - # "/etc/fstab.${_j}" will be used for {,u}mount(8) if none is specified. - eval _fstab=\"\${jail_${_j}_fstab:-${jail_fstab}}\" - [ -z "${_fstab}" ] && _fstab="/etc/fstab.${_j}" - eval _flags=\"\${jail_${_j}_flags:-${jail_flags}}\" - [ -z "${_flags}" ] && _flags="-l -U root" - eval _consolelog=\"\${jail_${_j}_consolelog:-${jail_consolelog}}\" - [ -z "${_consolelog}" ] && _consolelog="/var/log/jail_${_j}_console.log" + eval _interface=\"\${jail_${_j}_interface:-${jail_interface}}\" eval _parameters=\"\${jail_${_j}_parameters:-${jail_parameters}}\" - [ -z "${_parameters}" ] && _parameters="" - eval _fib=\"\${jail_${_j}_fib:-${jail_fib}}\" - - # Debugging aid - # - debug "$_j devfs enable: $_devfs" - debug "$_j fdescfs enable: $_fdescfs" - debug "$_j procfs enable: $_procfs" - debug "$_j mount enable: $_mount" - debug "$_j hostname: $_hostname" - debug "$_j ip: $_ip" - jail_show_addresses ${_j} - debug "$_j interface: $_interface" - debug "$_j fib: $_fib" - debug "$_j root: $_rootdir" - debug "$_j devdir: $_devdir" - debug "$_j fdescdir: $_fdescdir" - debug "$_j procdir: $_procdir" - debug "$_j ruleset: $_ruleset" - debug "$_j fstab: $_fstab" - - i=0 - while : ; do - eval out=\"\${_exec_prestart${i}:-''}\" - if [ -z "$out" ]; then - break - fi - debug "$_j exec pre-start #${i}: ${out}" - i=$((i + 1)) - done - - debug "$_j exec start: $_exec_start" - - i=1 - while : ; do - eval out=\"\${_exec_afterstart${i}:-''}\" - - if [ -z "$out" ]; then - break; - fi - - debug "$_j exec after start #${i}: ${out}" - i=$((i + 1)) - done - - i=0 - while : ; do - eval out=\"\${_exec_poststart${i}:-''}\" - if [ -z "$out" ]; then - break - fi - debug "$_j exec post-start #${i}: ${out}" - i=$((i + 1)) - done - - i=0 - while : ; do - eval out=\"\${_exec_prestop${i}:-''}\" - if [ -z "$out" ]; then - break - fi - debug "$_j exec pre-stop #${i}: ${out}" - i=$((i + 1)) - done - - debug "$_j exec stop: $_exec_stop" + eval _fstab=\"\${jail_${_j}_fstab:-${jail_fstab:-/etc/fstab.$_j}}\" + ( + date +"# Generated by rc.d/jail at %Y-%m-%d %H:%M:%S" + echo "$_j {" + extract_var $_j hostname host.hostname - "" + extract_var $_j rootdir path - "" + if [ -n "$_ip" ]; then + extract_var $_j interface interface - "" + jail_handle_ips_option $_ip $_interface + alias=0 + while : ; do + eval _x=\"\$jail_${_jail}_ip_multi${alias}\" + [ -z "$_x" ] && break - i=0 - while : ; do - eval out=\"\${_exec_poststop${i}:-''}\" - if [ -z "$out" ]; then - break + jail_handle_ips_option $_x $_interface + alias=$(($alias + 1)) + done + case $need_dad_wait in + 1) + # Sleep to let DAD complete before + # starting services. + echo " exec.start += \"sleep " \ + $(($(${SYSCTL_N} net.inet6.ip6.dad_count) + 1)) \ + "\";" + ;; + esac + # These are applicable only to non-vimage jails. + extract_var $_j fib exec.fib - "" + extract_var $_j socket_unixiproute_only \ + allow.raw_sockets NY YES + else + echo " vnet;" + extract_var $_j vnet_interface vnet.interface - "" fi - debug "$_j exec post-stop #${i}: ${out}" - i=$((i + 1)) - done - - debug "$_j flags: $_flags" - debug "$_j consolelog: $_consolelog" - debug "$_j parameters: $_parameters" - if [ -z "${_hostname}" ]; then - err 3 "$name: No hostname has been defined for ${_j}" - fi - if [ -z "${_rootdir}" ]; then - err 3 "$name: No root directory has been defined for ${_j}" - fi -} - -# set_sysctl rc_knob mib msg -# If the mib sysctl is set according to what rc_knob -# specifies, this function does nothing. However if -# rc_knob is set differently than mib, then the mib -# is set accordingly and msg is displayed followed by -# an '=" sign and the word 'YES' or 'NO'. -# -set_sysctl() -{ - _knob="$1" - _mib="$2" - _msg="$3" - - _current=`${SYSCTL} -n $_mib 2>/dev/null` - if checkyesno $_knob ; then - if [ "$_current" -ne 1 ]; then - echo -n " ${_msg}=YES" - ${SYSCTL} 1>/dev/null ${_mib}=1 - fi - else - if [ "$_current" -ne 0 ]; then - echo -n " ${_msg}=NO" - ${SYSCTL} 1>/dev/null ${_mib}=0 + echo " exec.clean;" + echo " exec.system_user = \"root\";" + echo " exec.jail_user = \"root\";" + extract_var $_j exec_prestart exec.prestart 0 "" + extract_var $_j exec_poststart exec.poststart 0 "" + extract_var $_j exec_prestop exec.prestop 0 "" + extract_var $_j exec_poststop exec.poststop 0 "" + + echo " exec.start += \"$_exec_start\";" + extract_var $_j exec_afterstart exec.start 1 "" + echo " exec.stop = \"$_exec_stop\";" + + extract_var $_j consolelog exec.consolelog - \ + /var/log/jail_${_j}_console.log + + eval : \${jail_${_j}_devfs_enable:=${jail_devfs_enable:-NO}} + if checkyesno jail_${_j}_devfs_enable; then + echo " mount.devfs;" + case $_ruleset in + "") ;; + [0-9]*) echo " devfs_ruleset = \"$_ruleset\";" ;; + devfsrules_jail) + # XXX: This is the default value, + # Let jail(8) to use the default because + # mount(8) only accepts an integer. + # This should accept a ruleset name. + ;; + *) warn "devfs_ruleset must be integer." ;; + esac + if [ -r $_fstab ]; then + echo " mount.fstab = \"$_fstab\";" + fi fi - fi -} - -# is_current_mountpoint() -# Is the directory mount point for a currently mounted file -# system? -# -is_current_mountpoint() -{ - local _dir _dir2 - - _dir=$1 - - _dir=`echo $_dir | sed -Ee 's#//+#/#g' -e 's#/$##'` - [ ! -d "${_dir}" ] && return 1 - _dir2=`df ${_dir} | tail +2 | awk '{ print $6 }'` - [ "${_dir}" = "${_dir2}" ] - return $? -} - -# is_symlinked_mountpoint() -# Is a mount point, or any of its parent directories, a symlink? -# -is_symlinked_mountpoint() -{ - local _dir - - _dir=$1 - - [ -L "$_dir" ] && return 0 - [ "$_dir" = "/" ] && return 1 - is_symlinked_mountpoint `dirname $_dir` - return $? -} - -# secure_umount -# Try to unmount a mount point without being vulnerable to -# symlink attacks. -# -secure_umount() -{ - local _dir - - _dir=$1 - - if is_current_mountpoint ${_dir}; then - umount -f ${_dir} >/dev/null 2>&1 - else - debug "Nothing mounted on ${_dir} - not unmounting" - fi -} - - -# jail_umount_fs -# This function unmounts certain special filesystems in the -# currently selected jail. The caller must call the init_variables() -# routine before calling this one. -# -jail_umount_fs() -{ - local _device _mountpt _rest - if checkyesno _fdescfs; then - if [ -d "${_fdescdir}" ] ; then - secure_umount ${_fdescdir} - fi - fi - if checkyesno _devfs; then - if [ -d "${_devdir}" ] ; then - secure_umount ${_devdir} + eval : \${jail_${_j}_fdescfs_enable:=${jail_fdescfs_enable:-NO}} + if checkyesno jail_${_j}_fdescfs_enable; then + echo " mount += " \ + "\"fdescfs ${_rootdir%/}/dev/fd fdescfs rw 0 0\";" fi - fi - if checkyesno _procfs; then - if [ -d "${_procdir}" ] ; then - secure_umount ${_procdir} + eval : \${jail_${_j}_procfs_enable:=${jail_procfs_enable:-NO}} + if checkyesno jail_${_j}_procfs_enable; then + echo " mount += " \ + "\"procfs ${_rootdir%/}/proc procfs rw 0 0\";" fi - fi - if checkyesno _mount; then - [ -f "${_fstab}" ] || warn "${_fstab} does not exist" - tail -r ${_fstab} | while read _device _mountpt _rest; do - case ":${_device}" in - :#* | :) - continue - ;; - esac - secure_umount ${_mountpt} - done - fi -} -# jail_mount_fstab() -# Mount file systems from a per jail fstab while trying to -# secure against symlink attacks at the mount points. -# -# If we are certain we cannot secure against symlink attacks we -# do not mount all of the file systems (since we cannot just not -# mount the file system with the problematic mount point). -# -# The caller must call the init_variables() routine before -# calling this one. -# -jail_mount_fstab() -{ - local _device _mountpt _rest + echo " ${_parameters};" - while read _device _mountpt _rest; do - case ":${_device}" in - :#* | :) - continue - ;; - esac - if is_symlinked_mountpoint ${_mountpt}; then - warn "${_mountpt} has symlink as parent - not mounting from ${_fstab}" - return + eval : \${jail_${_j}_mount_enable:=${jail_mount_enable:-NO}} + if checkyesno jail_${_j}_mount_enable; then + echo " allow.mount;" >> $_conf fi - done <${_fstab} - mount -a -F "${_fstab}" -} - -# jail_show_addresses jail -# Debug print the input for the given _multi aliases -# for a jail for init_variables(). -# -jail_show_addresses() -{ - local _j _type alias - _j="$1" - alias=0 - if [ -z "${_j}" ]; then - warn "jail_show_addresses: you must specify a jail" - return - fi + extract_var $_j set_hostname_allow allow.set_hostname YN NO + extract_var $_j sysvipc_allow allow.sysvipc YN NO + echo "}" + ) >> $_conf - while : ; do - eval _addr=\"\$jail_${_j}_ip_multi${alias}\" - if [ -n "${_addr}" ]; then - debug "${_j} ip_multi${alias}: $_addr" - alias=$((${alias} + 1)) - else - break - fi - done + return 0 } -# jail_extract_address argument +# jail_extract_address argument iface # The second argument is the string from one of the _ip # or the _multi variables. In case of a comma separated list # only one argument must be passed in at a time. @@ -382,8 +258,9 @@ jail_show_addresses() # jail_extract_address() { - local _i + local _i _interface _i=$1 + _interface=$2 if [ -z "${_i}" ]; then warn "jail_extract_address: called without input" @@ -439,21 +316,21 @@ jail_extract_address() _mask=${_mask:-/32} elif [ "${_type}" = "inet6" ]; then - # In case _maske is not set for IPv6, use /128. - _mask=${_mask:-/128} + # In case _maske is not set for IPv6, use /64. + _mask=${_mask:-/64} fi } -# jail_handle_ips_option {add,del} input +# jail_handle_ips_option input iface # Handle a single argument imput which can be a comma separated # list of addresses (theoretically with an option interface and # prefix/netmask/prefixlen). # jail_handle_ips_option() { - local _x _action _type _i - _action=$1 - _x=$2 + local _x _type _i _iface + _x=$1 + _iface=$2 if [ -z "${_x}" ]; then # No IP given. This can happen for the primary address @@ -468,294 +345,146 @@ jail_handle_ips_option() *,*) # Extract the first argument and strip it off the list. _i=`expr "${_x}" : '^\([^,]*\)'` _x=`expr "${_x}" : "^[^,]*,\(.*\)"` - ;; + ;; *) _i=${_x} _x="" - ;; + ;; esac _type="" - _iface="" _addr="" _mask="" - jail_extract_address "${_i}" + jail_extract_address $_i $_iface # make sure we got an address. - case "${_addr}" in + case $_addr in "") continue ;; *) ;; esac # Append address to list of addresses for the jail command. - case "${_type}" in + case $_type in inet) - case "${_addrl}" in - "") _addrl="${_addr}" ;; - *) _addrl="${_addrl},${_addr}" ;; - esac - ;; + echo " ip4.addr += \"${_addr}${_mask}\";" + ;; inet6) - case "${_addr6l}" in - "") _addr6l="${_addr}" ;; - *) _addr6l="${_addr6l},${_addr}" ;; - esac - ;; - esac - - # Configure interface alias if requested by a given interface - # and if we could correctly parse everything. - case "${_iface}" in - "") continue ;; - esac - case "${_type}" in - inet) ;; - inet6) ipv6_address_count=$((ipv6_address_count + 1)) ;; - *) warn "Could not determine address family. Not going" \ - "to ${_action} address '${_addr}' for ${_jail}." - continue - ;; - esac - case "${_action}" in - add) ifconfig ${_iface} ${_type} ${_addr}${_mask} alias - ;; - del) # When removing the IP, ignore the _mask. - ifconfig ${_iface} ${_type} ${_addr} -alias - ;; + echo " ip6.addr += \"${_addr}${_mask}\";" + need_dad_wait=1 + ;; esac done } -# jail_ips {add,del} -# Extract the comma separated list of addresses and return them -# for the jail command. -# Handle more than one address via the _multi option as well. -# If an interface is given also add/remove an alias for the -# address with an optional netmask. -# -jail_ips() +jail_config() { - local _action - _action=$1 - - case "${_action}" in - add) ;; - del) ;; - *) warn "jail_ips: invalid action '${_action}'" - return - ;; + case $1 in + _ALL) return ;; esac - - # Handle addresses. - ipv6_address_count=0 - jail_handle_ips_option ${_action} "${_ip}" - # Handle jail_xxx_ip_multi - alias=0 - while : ; do - eval _x=\"\$jail_${_jail}_ip_multi${alias}\" - case "${_x}" in - "") break ;; - *) jail_handle_ips_option ${_action} "${_x}" - alias=$((${alias} + 1)) - ;; - esac + for _jail in $@; do + if parse_options $_jail; then + echo "$_jail: parameters are in $_conf." + fi done - case ${ipv6_address_count} in - 0) ;; - *) # Sleep 1 second to let DAD complete before starting services. - sleep 1 - ;; +} + +jail_console() +{ + # One argument that is not _ALL. + case $#:$1 in + 1:_ALL) err 3 "Specify a jail name." ;; + 1:*) ;; + *) err 3 "Specify a jail name." ;; esac + eval _cmd=\${jail_$1_consolecmd:-$jail_consolecmd} + $jail_jexec $1 $_cmd } -jail_prestart() +jail_status() { - if checkyesno jail_parallel_start; then - command_args='&' - fi + + $jail_jls -N } jail_start() { - echo -n 'Configuring jails:' - set_sysctl jail_set_hostname_allow security.jail.set_hostname_allowed \ - set_hostname_allow - set_sysctl jail_socket_unixiproute_only \ - security.jail.socket_unixiproute_only unixiproute_only - set_sysctl jail_sysvipc_allow security.jail.sysvipc_allowed \ - sysvipc_allow - echo '.' - + if [ $# = 0 ]; then + return + fi echo -n 'Starting jails:' - _tmp_dir=`mktemp -d /tmp/jail.XXXXXXXX` || \ - err 3 "$name: Can't create temp dir, exiting..." - for _jail in ${jail_list} - do - init_variables $_jail - if [ -f /var/run/jail_${_jail}.id ]; then - echo -n " [${_hostname} already running (/var/run/jail_${_jail}.id exists)]" - continue; - fi - _addrl="" - _addr6l="" - jail_ips "add" - if [ -n "${_fib}" ]; then - _setfib="setfib -F '${_fib}'" + case $1 in + _ALL) + echo -n ' ' + command=$jail_program + rc_flags=$jail_flags + command_args="-f $jail_conf -c" + $command $rc_flags $command_args "*" + echo '.' + return + ;; + esac + _tmp=`mktemp -t jail` || exit 3 + for _jail in $@; do + parse_options $_jail || continue + + eval rc_flags=\${jail_${_j}_flags:-$jail_flags} + eval command=\${jail_${_j}_program:-$jail_program} + if checkyesno jail_parallel_start; then + command_args="-i -f $_conf -c $_jail &" else - _setfib="" - fi - if checkyesno _mount; then - info "Mounting fstab for jail ${_jail} (${_fstab})" - if [ ! -f "${_fstab}" ]; then - err 3 "$name: ${_fstab} does not exist" - fi - jail_mount_fstab - fi - if checkyesno _devfs; then - # If devfs is already mounted here, skip it. - df -t devfs "${_devdir}" >/dev/null - if [ $? -ne 0 ]; then - if is_symlinked_mountpoint ${_devdir}; then - warn "${_devdir} has symlink as parent - not starting jail ${_jail}" - continue - fi - info "Mounting devfs on ${_devdir}" - devfs_mount_jail "${_devdir}" ${_ruleset} - # Transitional symlink for old binaries - if [ ! -L "${_devdir}/log" ]; then - ln -sf ../var/run/log "${_devdir}/log" - fi - fi - - # XXX - It seems symlinks don't work when there - # is a devfs(5) device of the same name. - # Jail console output - # __pwd="`pwd`" - # cd "${_devdir}" - # ln -sf ../var/log/console console - # cd "$__pwd" - fi - if checkyesno _fdescfs; then - if is_symlinked_mountpoint ${_fdescdir}; then - warn "${_fdescdir} has symlink as parent, not mounting" - else - info "Mounting fdescfs on ${_fdescdir}" - mount -t fdescfs fdesc "${_fdescdir}" - fi - fi - if checkyesno _procfs; then - if is_symlinked_mountpoint ${_procdir}; then - warn "${_procdir} has symlink as parent, not mounting" - else - info "Mounting procfs onto ${_procdir}" - if [ -d "${_procdir}" ] ; then - mount -t procfs proc "${_procdir}" - fi - fi + command_args="-i -f $_conf -c $_jail" fi - _tmp_jail=${_tmp_dir}/jail.$$ - - i=0 - while : ; do - eval out=\"\${_exec_prestart${i}:-''}\" - [ -z "$out" ] && break - ${out} - i=$((i + 1)) - done - - eval ${_setfib} jail -n ${_jail} ${_flags} -i -c path=${_rootdir} host.hostname=${_hostname} \ - ${_addrl:+ip4.addr=\"${_addrl}\"} ${_addr6l:+ip6.addr=\"${_addr6l}\"} \ - ${_parameters} command=${_exec_start} > ${_tmp_jail} 2>&1 \ - ${_consolelog} - echo ${_jail_id} > /var/run/jail_${_jail}.id - - i=0 - while : ; do - eval out=\"\${_exec_poststart${i}:-''}\" - [ -z "$out" ] && break - ${out} - i=$((i + 1)) - done + if $command $rc_flags $command_args \ + >> $_tmp 2>&1 Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 99FE7871; Thu, 10 Oct 2013 09:42:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 76C4E2D5E; Thu, 10 Oct 2013 09:42:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9A9gg6v018316; Thu, 10 Oct 2013 09:42:42 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9A9gfVa018310; Thu, 10 Oct 2013 09:42:41 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310100942.r9A9gfVa018310@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 10 Oct 2013 09:42: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: r256257 - stable/9/lib/libfetch 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, 10 Oct 2013 09:42:42 -0000 Author: glebius Date: Thu Oct 10 09:42:41 2013 New Revision: 256257 URL: http://svnweb.freebsd.org/changeset/base/256257 Log: Merge from head r253514,r253680,r253805,r254650: --------------------------------------------------------------------- r253514 | des | 2013-07-21 10:59:56 +0400 (вÑ, 21 июл 2013) | 5 lines Use the correct request syntax for proxied (tunneled) HTTPS requests. PR: bin/180666 MFC after: 3 days --------------------------------------------------------------------- r253680 | des | 2013-07-26 19:53:43 +0400 (пт, 26 июл 2013) | 7 lines Implement certificate verification, and many other SSL-related imrovements; complete details in the PR. PR: kern/175514 Submitted by: Michael Gmelin MFC after: 1 week --------------------------------------------------------------------- r253805 | des | 2013-07-30 17:07:55 +0400 (вт, 30 июл 2013) | 5 lines Include an Accept header in requests. PR: kern/180917 MFC after: 1 week --------------------------------------------------------------------- r254650 | des | 2013-08-22 11:43:36 +0400 (чт, 22 авг 2013) | 8 lines Even though it doesn't really make sense in the context of a CONNECT request, RFC 2616 14.23 mandates the presence of the Host: header in all HTTP 1.1 requests. PR: kern/181445 Submitted by: Kimo MFC after: 3 days --------------------------------------------------------------------- Reviewed by: des Modified: stable/9/lib/libfetch/common.c stable/9/lib/libfetch/common.h stable/9/lib/libfetch/fetch.3 stable/9/lib/libfetch/http.c Directory Properties: stable/9/lib/libfetch/ (props changed) Modified: stable/9/lib/libfetch/common.c ============================================================================== --- stable/9/lib/libfetch/common.c Thu Oct 10 09:32:27 2013 (r256256) +++ stable/9/lib/libfetch/common.c Thu Oct 10 09:42:41 2013 (r256257) @@ -1,5 +1,6 @@ /*- * Copyright (c) 1998-2011 Dag-Erling Smørgrav + * Copyright (c) 2013 Michael Gmelin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,6 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef WITH_SSL +#include +#endif + #include "fetch.h" #include "common.h" @@ -317,15 +322,488 @@ fetch_connect(const char *host, int port return (conn); } +#ifdef WITH_SSL +/* + * Convert characters A-Z to lowercase (intentionally avoid any locale + * specific conversions). + */ +static char +fetch_ssl_tolower(char in) +{ + if (in >= 'A' && in <= 'Z') + return (in + 32); + else + return (in); +} + +/* + * isalpha implementation that intentionally avoids any locale specific + * conversions. + */ +static int +fetch_ssl_isalpha(char in) +{ + return ((in >= 'A' && in <= 'Z') || (in >= 'a' && in <= 'z')); +} + +/* + * Check if passed hostnames a and b are equal. + */ +static int +fetch_ssl_hname_equal(const char *a, size_t alen, const char *b, + size_t blen) +{ + size_t i; + + if (alen != blen) + return (0); + for (i = 0; i < alen; ++i) { + if (fetch_ssl_tolower(a[i]) != fetch_ssl_tolower(b[i])) + return (0); + } + return (1); +} + +/* + * Check if domain label is traditional, meaning that only A-Z, a-z, 0-9 + * and '-' (hyphen) are allowed. Hyphens have to be surrounded by alpha- + * numeric characters. Double hyphens (like they're found in IDN a-labels + * 'xn--') are not allowed. Empty labels are invalid. + */ +static int +fetch_ssl_is_trad_domain_label(const char *l, size_t len, int wcok) +{ + size_t i; + + if (!len || l[0] == '-' || l[len-1] == '-') + return (0); + for (i = 0; i < len; ++i) { + if (!isdigit(l[i]) && + !fetch_ssl_isalpha(l[i]) && + !(l[i] == '*' && wcok) && + !(l[i] == '-' && l[i - 1] != '-')) + return (0); + } + return (1); +} + +/* + * Check if host name consists only of numbers. This might indicate an IP + * address, which is not a good idea for CN wildcard comparison. + */ +static int +fetch_ssl_hname_is_only_numbers(const char *hostname, size_t len) +{ + size_t i; + + for (i = 0; i < len; ++i) { + if (!((hostname[i] >= '0' && hostname[i] <= '9') || + hostname[i] == '.')) + return (0); + } + return (1); +} + +/* + * Check if the host name h passed matches the pattern passed in m which + * is usually part of subjectAltName or CN of a certificate presented to + * the client. This includes wildcard matching. The algorithm is based on + * RFC6125, sections 6.4.3 and 7.2, which clarifies RFC2818 and RFC3280. + */ +static int +fetch_ssl_hname_match(const char *h, size_t hlen, const char *m, + size_t mlen) +{ + int delta, hdotidx, mdot1idx, wcidx; + const char *hdot, *mdot1, *mdot2; + const char *wc; /* wildcard */ + + if (!(h && *h && m && *m)) + return (0); + if ((wc = strnstr(m, "*", mlen)) == NULL) + return (fetch_ssl_hname_equal(h, hlen, m, mlen)); + wcidx = wc - m; + /* hostname should not be just dots and numbers */ + if (fetch_ssl_hname_is_only_numbers(h, hlen)) + return (0); + /* only one wildcard allowed in pattern */ + if (strnstr(wc + 1, "*", mlen - wcidx - 1) != NULL) + return (0); + /* + * there must be at least two more domain labels and + * wildcard has to be in the leftmost label (RFC6125) + */ + mdot1 = strnstr(m, ".", mlen); + if (mdot1 == NULL || mdot1 < wc || (mlen - (mdot1 - m)) < 4) + return (0); + mdot1idx = mdot1 - m; + mdot2 = strnstr(mdot1 + 1, ".", mlen - mdot1idx - 1); + if (mdot2 == NULL || (mlen - (mdot2 - m)) < 2) + return (0); + /* hostname must contain a dot and not be the 1st char */ + hdot = strnstr(h, ".", hlen); + if (hdot == NULL || hdot == h) + return (0); + hdotidx = hdot - h; + /* + * host part of hostname must be at least as long as + * pattern it's supposed to match + */ + if (hdotidx < mdot1idx) + return (0); + /* + * don't allow wildcards in non-traditional domain names + * (IDN, A-label, U-label...) + */ + if (!fetch_ssl_is_trad_domain_label(h, hdotidx, 0) || + !fetch_ssl_is_trad_domain_label(m, mdot1idx, 1)) + return (0); + /* match domain part (part after first dot) */ + if (!fetch_ssl_hname_equal(hdot, hlen - hdotidx, mdot1, + mlen - mdot1idx)) + return (0); + /* match part left of wildcard */ + if (!fetch_ssl_hname_equal(h, wcidx, m, wcidx)) + return (0); + /* match part right of wildcard */ + delta = mdot1idx - wcidx - 1; + if (!fetch_ssl_hname_equal(hdot - delta, delta, + mdot1 - delta, delta)) + return (0); + /* all tests succeded, it's a match */ + return (1); +} + +/* + * Get numeric host address info - returns NULL if host was not an IP + * address. The caller is responsible for deallocation using + * freeaddrinfo(3). + */ +static struct addrinfo * +fetch_ssl_get_numeric_addrinfo(const char *hostname, size_t len) +{ + struct addrinfo hints, *res; + char *host; + + host = (char *)malloc(len + 1); + memcpy(host, hostname, len); + host[len] = '\0'; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = 0; + hints.ai_flags = AI_NUMERICHOST; + /* port is not relevant for this purpose */ + getaddrinfo(host, "443", &hints, &res); + free(host); + return res; +} + +/* + * Compare ip address in addrinfo with address passes. + */ +static int +fetch_ssl_ipaddr_match_bin(const struct addrinfo *lhost, const char *rhost, + size_t rhostlen) +{ + const void *left; + + if (lhost->ai_family == AF_INET && rhostlen == 4) { + left = (void *)&((struct sockaddr_in*)(void *) + lhost->ai_addr)->sin_addr.s_addr; +#ifdef INET6 + } else if (lhost->ai_family == AF_INET6 && rhostlen == 16) { + left = (void *)&((struct sockaddr_in6 *)(void *) + lhost->ai_addr)->sin6_addr; +#endif + } else + return (0); + return (!memcmp(left, (const void *)rhost, rhostlen) ? 1 : 0); +} + +/* + * Compare ip address in addrinfo with host passed. If host is not an IP + * address, comparison will fail. + */ +static int +fetch_ssl_ipaddr_match(const struct addrinfo *laddr, const char *r, + size_t rlen) +{ + struct addrinfo *raddr; + int ret; + char *rip; + + ret = 0; + if ((raddr = fetch_ssl_get_numeric_addrinfo(r, rlen)) == NULL) + return 0; /* not a numeric host */ + + if (laddr->ai_family == raddr->ai_family) { + if (laddr->ai_family == AF_INET) { + rip = (char *)&((struct sockaddr_in *)(void *) + raddr->ai_addr)->sin_addr.s_addr; + ret = fetch_ssl_ipaddr_match_bin(laddr, rip, 4); +#ifdef INET6 + } else if (laddr->ai_family == AF_INET6) { + rip = (char *)&((struct sockaddr_in6 *)(void *) + raddr->ai_addr)->sin6_addr; + ret = fetch_ssl_ipaddr_match_bin(laddr, rip, 16); +#endif + } + + } + freeaddrinfo(raddr); + return (ret); +} + +/* + * Verify server certificate by subjectAltName. + */ +static int +fetch_ssl_verify_altname(STACK_OF(GENERAL_NAME) *altnames, + const char *host, struct addrinfo *ip) +{ + const GENERAL_NAME *name; + size_t nslen; + int i; + const char *ns; + + for (i = 0; i < sk_GENERAL_NAME_num(altnames); ++i) { +#if OPENSSL_VERSION_NUMBER < 0x10000000L + /* + * This is a workaround, since the following line causes + * alignment issues in clang: + * name = sk_GENERAL_NAME_value(altnames, i); + * OpenSSL explicitly warns not to use those macros + * directly, but there isn't much choice (and there + * shouldn't be any ill side effects) + */ + name = (GENERAL_NAME *)SKM_sk_value(void, altnames, i); +#else + name = sk_GENERAL_NAME_value(altnames, i); +#endif + ns = (const char *)ASN1_STRING_data(name->d.ia5); + nslen = (size_t)ASN1_STRING_length(name->d.ia5); + + if (name->type == GEN_DNS && ip == NULL && + fetch_ssl_hname_match(host, strlen(host), ns, nslen)) + return (1); + else if (name->type == GEN_IPADD && ip != NULL && + fetch_ssl_ipaddr_match_bin(ip, ns, nslen)) + return (1); + } + return (0); +} + +/* + * Verify server certificate by CN. + */ +static int +fetch_ssl_verify_cn(X509_NAME *subject, const char *host, + struct addrinfo *ip) +{ + ASN1_STRING *namedata; + X509_NAME_ENTRY *nameentry; + int cnlen, lastpos, loc, ret; + unsigned char *cn; + + ret = 0; + lastpos = -1; + loc = -1; + cn = NULL; + /* get most specific CN (last entry in list) and compare */ + while ((lastpos = X509_NAME_get_index_by_NID(subject, + NID_commonName, lastpos)) != -1) + loc = lastpos; + + if (loc > -1) { + nameentry = X509_NAME_get_entry(subject, loc); + namedata = X509_NAME_ENTRY_get_data(nameentry); + cnlen = ASN1_STRING_to_UTF8(&cn, namedata); + if (ip == NULL && + fetch_ssl_hname_match(host, strlen(host), cn, cnlen)) + ret = 1; + else if (ip != NULL && fetch_ssl_ipaddr_match(ip, cn, cnlen)) + ret = 1; + OPENSSL_free(cn); + } + return (ret); +} + +/* + * Verify that server certificate subjectAltName/CN matches + * hostname. First check, if there are alternative subject names. If yes, + * those have to match. Only if those don't exist it falls back to + * checking the subject's CN. + */ +static int +fetch_ssl_verify_hname(X509 *cert, const char *host) +{ + struct addrinfo *ip; + STACK_OF(GENERAL_NAME) *altnames; + X509_NAME *subject; + int ret; + + ret = 0; + ip = fetch_ssl_get_numeric_addrinfo(host, strlen(host)); + altnames = X509_get_ext_d2i(cert, NID_subject_alt_name, + NULL, NULL); + + if (altnames != NULL) { + ret = fetch_ssl_verify_altname(altnames, host, ip); + } else { + subject = X509_get_subject_name(cert); + if (subject != NULL) + ret = fetch_ssl_verify_cn(subject, host, ip); + } + + if (ip != NULL) + freeaddrinfo(ip); + if (altnames != NULL) + GENERAL_NAMES_free(altnames); + return (ret); +} + +/* + * Configure transport security layer based on environment. + */ +static void +fetch_ssl_setup_transport_layer(SSL_CTX *ctx, int verbose) +{ + long ssl_ctx_options; + + ssl_ctx_options = SSL_OP_ALL | SSL_OP_NO_TICKET; + if (getenv("SSL_ALLOW_SSL2") == NULL) + ssl_ctx_options |= SSL_OP_NO_SSLv2; + if (getenv("SSL_NO_SSL3") != NULL) + ssl_ctx_options |= SSL_OP_NO_SSLv3; + if (getenv("SSL_NO_TLS1") != NULL) + ssl_ctx_options |= SSL_OP_NO_TLSv1; + if (verbose) + fetch_info("SSL options: %x", ssl_ctx_options); + SSL_CTX_set_options(ctx, ssl_ctx_options); +} + + +/* + * Configure peer verification based on environment. + */ +static int +fetch_ssl_setup_peer_verification(SSL_CTX *ctx, int verbose) +{ + X509_LOOKUP *crl_lookup; + X509_STORE *crl_store; + const char *ca_cert_file, *ca_cert_path, *crl_file; + + if (getenv("SSL_NO_VERIFY_PEER") == NULL) { + ca_cert_file = getenv("SSL_CA_CERT_FILE") != NULL ? + getenv("SSL_CA_CERT_FILE") : "/etc/ssl/cert.pem"; + ca_cert_path = getenv("SSL_CA_CERT_PATH"); + if (verbose) { + fetch_info("Peer verification enabled"); + if (ca_cert_file != NULL) + fetch_info("Using CA cert file: %s", + ca_cert_file); + if (ca_cert_path != NULL) + fetch_info("Using CA cert path: %s", + ca_cert_path); + } + SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, + fetch_ssl_cb_verify_crt); + SSL_CTX_load_verify_locations(ctx, ca_cert_file, + ca_cert_path); + if ((crl_file = getenv("SSL_CRL_FILE")) != NULL) { + if (verbose) + fetch_info("Using CRL file: %s", crl_file); + crl_store = SSL_CTX_get_cert_store(ctx); + crl_lookup = X509_STORE_add_lookup(crl_store, + X509_LOOKUP_file()); + if (crl_lookup == NULL || + !X509_load_crl_file(crl_lookup, crl_file, + X509_FILETYPE_PEM)) { + fprintf(stderr, + "Could not load CRL file %s\n", + crl_file); + return (0); + } + X509_STORE_set_flags(crl_store, + X509_V_FLAG_CRL_CHECK | + X509_V_FLAG_CRL_CHECK_ALL); + } + } + return (1); +} + +/* + * Configure client certificate based on environment. + */ +static int +fetch_ssl_setup_client_certificate(SSL_CTX *ctx, int verbose) +{ + const char *client_cert_file, *client_key_file; + + if ((client_cert_file = getenv("SSL_CLIENT_CERT_FILE")) != NULL) { + client_key_file = getenv("SSL_CLIENT_KEY_FILE") != NULL ? + getenv("SSL_CLIENT_KEY_FILE") : client_cert_file; + if (verbose) { + fetch_info("Using client cert file: %s", + client_cert_file); + fetch_info("Using client key file: %s", + client_key_file); + } + if (SSL_CTX_use_certificate_chain_file(ctx, + client_cert_file) != 1) { + fprintf(stderr, + "Could not load client certificate %s\n", + client_cert_file); + return (0); + } + if (SSL_CTX_use_PrivateKey_file(ctx, client_key_file, + SSL_FILETYPE_PEM) != 1) { + fprintf(stderr, + "Could not load client key %s\n", + client_key_file); + return (0); + } + } + return (1); +} + +/* + * Callback for SSL certificate verification, this is called on server + * cert verification. It takes no decision, but informs the user in case + * verification failed. + */ +int +fetch_ssl_cb_verify_crt(int verified, X509_STORE_CTX *ctx) +{ + X509 *crt; + X509_NAME *name; + char *str; + + str = NULL; + if (!verified) { + if ((crt = X509_STORE_CTX_get_current_cert(ctx)) != NULL && + (name = X509_get_subject_name(crt)) != NULL) + str = X509_NAME_oneline(name, 0, 0); + fprintf(stderr, "Certificate verification failed for %s\n", + str != NULL ? str : "no relevant certificate"); + OPENSSL_free(str); + } + return (verified); +} + +#endif /* * Enable SSL on a connection. */ int -fetch_ssl(conn_t *conn, int verbose) +fetch_ssl(conn_t *conn, const struct url *URL, int verbose) { #ifdef WITH_SSL int ret, ssl_err; + X509_NAME *name; + char *str; /* Init the SSL library and context */ if (!SSL_library_init()){ @@ -339,8 +817,14 @@ fetch_ssl(conn_t *conn, int verbose) conn->ssl_ctx = SSL_CTX_new(conn->ssl_meth); SSL_CTX_set_mode(conn->ssl_ctx, SSL_MODE_AUTO_RETRY); + fetch_ssl_setup_transport_layer(conn->ssl_ctx, verbose); + if (!fetch_ssl_setup_peer_verification(conn->ssl_ctx, verbose)) + return (-1); + if (!fetch_ssl_setup_client_certificate(conn->ssl_ctx, verbose)) + return (-1); + conn->ssl = SSL_new(conn->ssl_ctx); - if (conn->ssl == NULL){ + if (conn->ssl == NULL) { fprintf(stderr, "SSL context creation failed\n"); return (-1); } @@ -353,22 +837,35 @@ fetch_ssl(conn_t *conn, int verbose) return (-1); } } + conn->ssl_cert = SSL_get_peer_certificate(conn->ssl); - if (verbose) { - X509_NAME *name; - char *str; + if (conn->ssl_cert == NULL) { + fprintf(stderr, "No server SSL certificate\n"); + return (-1); + } - fprintf(stderr, "SSL connection established using %s\n", + if (getenv("SSL_NO_VERIFY_HOSTNAME") == NULL) { + if (verbose) + fetch_info("Verify hostname"); + if (!fetch_ssl_verify_hname(conn->ssl_cert, URL->host)) { + fprintf(stderr, + "SSL certificate subject doesn't match host %s\n", + URL->host); + return (-1); + } + } + + if (verbose) { + fetch_info("SSL connection established using %s", SSL_get_cipher(conn->ssl)); - conn->ssl_cert = SSL_get_peer_certificate(conn->ssl); name = X509_get_subject_name(conn->ssl_cert); str = X509_NAME_oneline(name, 0, 0); - printf("Certificate subject: %s\n", str); - free(str); + fetch_info("Certificate subject: %s", str); + OPENSSL_free(str); name = X509_get_issuer_name(conn->ssl_cert); str = X509_NAME_oneline(name, 0, 0); - printf("Certificate issuer: %s\n", str); - free(str); + fetch_info("Certificate issuer: %s", str); + OPENSSL_free(str); } return (0); @@ -726,6 +1223,22 @@ fetch_close(conn_t *conn) if (--conn->ref > 0) return (0); +#ifdef WITH_SSL + if (conn->ssl) { + SSL_shutdown(conn->ssl); + SSL_set_connect_state(conn->ssl); + SSL_free(conn->ssl); + conn->ssl = NULL; + } + if (conn->ssl_ctx) { + SSL_CTX_free(conn->ssl_ctx); + conn->ssl_ctx = NULL; + } + if (conn->ssl_cert) { + X509_free(conn->ssl_cert); + conn->ssl_cert = NULL; + } +#endif ret = close(conn->sd); free(conn->cache.buf); free(conn->buf); Modified: stable/9/lib/libfetch/common.h ============================================================================== --- stable/9/lib/libfetch/common.h Thu Oct 10 09:32:27 2013 (r256256) +++ stable/9/lib/libfetch/common.h Thu Oct 10 09:42:41 2013 (r256257) @@ -87,7 +87,10 @@ int fetch_bind(int, int, const char *) conn_t *fetch_connect(const char *, int, int, int); conn_t *fetch_reopen(int); conn_t *fetch_ref(conn_t *); -int fetch_ssl(conn_t *, int); +#ifdef WITH_SSL +int fetch_ssl_cb_verify_crt(int, X509_STORE_CTX*); +#endif +int fetch_ssl(conn_t *, const struct url *, int); ssize_t fetch_read(conn_t *, char *, size_t); int fetch_getln(conn_t *); ssize_t fetch_write(conn_t *, const char *, size_t); Modified: stable/9/lib/libfetch/fetch.3 ============================================================================== --- stable/9/lib/libfetch/fetch.3 Thu Oct 10 09:32:27 2013 (r256256) +++ stable/9/lib/libfetch/fetch.3 Thu Oct 10 09:42:41 2013 (r256257) @@ -1,5 +1,6 @@ .\"- -.\" Copyright (c) 1998-2011 Dag-Erling Smørgrav +.\" Copyright (c) 1998-2013 Dag-Erling Smørgrav +.\" Copyright (c) 2013 Michael Gmelin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2011 +.Dd July 30, 2013 .Dt FETCH 3 .Os .Sh NAME @@ -392,6 +393,60 @@ method in a manner consistent with the r library, .Fn fetchPutHTTP is currently unimplemented. +.Sh HTTPS SCHEME +Based on HTTP SCHEME. +By default the peer is verified using the CA bundle located in +.Pa /etc/ssl/cert.pem . +The file may contain multiple CA certificates. +A common source of a current CA bundle is +.Pa \%security/ca_root_nss . +.Pp +The CA bundle used for peer verification can be changed by setting the +environment variables +.Ev SSL_CA_CERT_FILE +to point to a concatenated bundle of trusted certificates and +.Ev SSL_CA_CERT_PATH +to point to a directory containing hashes of trusted CAs (see +.Xr verify 1 ) . +.Pp +A certificate revocation list (CRL) can be used by setting the +environment variable +.Ev SSL_CRL_FILE +(see +.Xr crl 1 ) . +.Pp +Peer verification can be disabled by setting the environment variable +.Ev SSL_NO_VERIFY_PEER . +Note that this also disables CRL checking. +.Pp +By default the service identity is verified according to the rules +detailed in RFC6125 (also known as hostname verification). +This feature can be disabled by setting the environment variable +.Ev SSL_NO_VERIFY_HOSTNAME . +.Pp +Client certificate based authentication is supported. +The environment variable +.Ev SSL_CLIENT_CERT_FILE +should be set to point to a file containing key and client certificate +to be used in PEM format. In case the key is stored in a separate +file, the environment variable +.Ev SSL_CLIENT_KEY_FILE +can be set to point to the key in PEM format. +In case the key uses a password, the user will be prompted on standard +input (see +.Xr PEM 3 ) . +.Pp +By default +.Nm libfetch +allows SSLv3 and TLSv1 when negotiating the connecting with the remote +peer. +You can change this behavior by setting the environment variable +.Ev SSL_ALLOW_SSL2 +to allow SSLv2 (not recommended) and +.Ev SSL_NO_SSL3 +or +.Ev SSL_NO_TLS1 +to disable the respective methods. .Sh AUTHENTICATION Apart from setting the appropriate environment variables and specifying the user name and password in the URL or the @@ -516,6 +571,15 @@ variable is set. Same as .Ev FTP_PROXY , for compatibility. +.It Ev HTTP_ACCEPT +Specifies the value of the +.Va Accept +header for HTTP requests. +If empty, no +.Va Accept +header is sent. +The default is +.Dq */* . .It Ev HTTP_AUTH Specifies HTTP authorization parameters as a colon-separated list of items. @@ -579,6 +643,31 @@ which proxies should not be used. Same as .Ev NO_PROXY , for compatibility. +.It Ev SSL_ALLOW_SSL2 +Allow SSL version 2 when negotiating the connection (not recommended). +.It Ev SSL_CA_CERT_FILE +CA certificate bundle containing trusted CA certificates. +Default value: +.Pa /etc/ssl/cert.pem . +.It Ev SSL_CA_CERT_PATH +Path containing trusted CA hashes. +.It Ev SSL_CLIENT_CERT_FILE +PEM encoded client certificate/key which will be used in +client certificate authentication. +.It Ev SSL_CLIENT_KEY_FILE +PEM encoded client key in case key and client certificate +are stored separately. +.It Ev SSL_CRL_FILE +File containing certificate revocation list. +.It Ev SSL_NO_SSL3 +Don't allow SSL version 3 when negotiating the connection. +.It Ev SSL_NO_TLS1 +Don't allow TLV version 1 when negotiating the connection. +.It Ev SSL_NO_VERIFY_HOSTNAME +If set, do not verify that the hostname matches the subject of the +certificate presented by the server. +.It Ev SSL_NO_VERIFY_PEER +If set, do not verify the peer certificate against trusted CAs. .El .Sh EXAMPLES To access a proxy server on @@ -610,6 +699,19 @@ as follows: .Bd -literal -offset indent NO_PROXY=localhost,127.0.0.1 .Ed +.Pp +Access HTTPS website without any certificate verification whatsoever: +.Bd -literal -offset indent +SSL_NO_VERIFY_PEER=1 +SSL_NO_VERIFY_HOSTNAME=1 +.Ed +.Pp +Access HTTPS website using client certificate based authentication +and a private CA: +.Bd -literal -offset indent +SSL_CLIENT_CERT_FILE=/path/to/client.pem +SSL_CA_CERT_FILE=/path/to/myca.pem +.Ed .Sh SEE ALSO .Xr fetch 1 , .Xr ftpio 3 , @@ -678,7 +780,8 @@ with numerous suggestions and contributi .An Hajimu Umemoto Aq ume@FreeBSD.org , .An Henry Whincup Aq henry@techiebod.com , .An Jukka A. Ukkonen Aq jau@iki.fi , -.An Jean-Fran\(,cois Dockes Aq jf@dockes.org +.An Jean-Fran\(,cois Dockes Aq jf@dockes.org , +.An Michael Gmelin Aq freebsd@grem.de and others. It replaces the older .Nm ftpio @@ -688,7 +791,9 @@ and .An Jordan K. Hubbard Aq jkh@FreeBSD.org . .Pp This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org . +.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org +and +.An Michael Gmelin Aq freebsd@grem.de . .Sh BUGS Some parts of the library are not yet implemented. The most notable @@ -717,6 +822,10 @@ implemented, superfluous at this site" i .Fn fetchStatFTP does not check that the result of an MDTM command is a valid date. .Pp +In case password protected keys are used for client certificate based +authentication the user is prompted for the password on each and every +fetch operation. +.Pp The man page is incomplete, poorly written and produces badly formatted text. .Pp Modified: stable/9/lib/libfetch/http.c ============================================================================== --- stable/9/lib/libfetch/http.c Thu Oct 10 09:32:27 2013 (r256256) +++ stable/9/lib/libfetch/http.c Thu Oct 10 09:42:41 2013 (r256257) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2011 Dag-Erling Smørgrav + * Copyright (c) 2000-2013 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1400,6 +1400,8 @@ http_connect(struct url *URL, struct url if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) { http_cmd(conn, "CONNECT %s:%d HTTP/1.1", URL->host, URL->port); + http_cmd(conn, "Host: %s:%d", + URL->host, URL->port); http_cmd(conn, ""); if (http_get_reply(conn) != HTTP_OK) { fetch_close(conn); @@ -1408,7 +1410,7 @@ http_connect(struct url *URL, struct url http_get_reply(conn); } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && - fetch_ssl(conn, verbose) == -1) { + fetch_ssl(conn, URL, verbose) == -1) { fetch_close(conn); /* grrr */ errno = EAUTH; @@ -1581,7 +1583,7 @@ http_request(struct url *URL, const char if (verbose) fetch_info("requesting %s://%s%s", url->scheme, host, url->doc); - if (purl) { + if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) { http_cmd(conn, "%s %s://%s%s HTTP/1.1", op, url->scheme, host, url->doc); } else { @@ -1664,6 +1666,12 @@ http_request(struct url *URL, const char } /* other headers */ + if ((p = getenv("HTTP_ACCEPT")) != NULL) { + if (*p != '\0') + http_cmd(conn, "Accept: %s", p); + } else { + http_cmd(conn, "Accept: */*"); + } if ((p = getenv("HTTP_REFERER")) != NULL && *p != '\0') { if (strcasecmp(p, "auto") == 0) http_cmd(conn, "Referer: %s://%s%s", From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 09:43:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B99EA9A3; Thu, 10 Oct 2013 09:43:15 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A81742D64; Thu, 10 Oct 2013 09:43:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9A9hFs5018556; Thu, 10 Oct 2013 09:43:15 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9A9hFfM018555; Thu, 10 Oct 2013 09:43:15 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201310100943.r9A9hFfM018555@svn.freebsd.org> From: Hiroki Sato Date: Thu, 10 Oct 2013 09:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256258 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 09:43:15 -0000 Author: hrs Date: Thu Oct 10 09:43:15 2013 New Revision: 256258 URL: http://svnweb.freebsd.org/changeset/base/256258 Log: Do not try to detach if the interface does not support IPv6. Tested by: hselasky PR: usb/182820 Approved by: re (glebius) Modified: head/sys/netinet6/in6_ifattach.c Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Thu Oct 10 09:42:41 2013 (r256257) +++ head/sys/netinet6/in6_ifattach.c Thu Oct 10 09:43:15 2013 (r256258) @@ -809,6 +809,9 @@ in6_ifdetach(struct ifnet *ifp) struct sockaddr_in6 sin6; struct in6_multi_mship *imm; + if (ifp->if_afdata[AF_INET6] == NULL) + return; + /* remove neighbor management table */ nd6_purge(ifp); From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 09:53:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7A09DC10; Thu, 10 Oct 2013 09:53:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4BC892DF4; Thu, 10 Oct 2013 09:53:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9A9rlwl024038; Thu, 10 Oct 2013 09:53:47 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9A9rk51024035; Thu, 10 Oct 2013 09:53:46 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201310100953.r9A9rk51024035@svn.freebsd.org> From: Andriy Gapon Date: Thu, 10 Oct 2013 09:53:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256259 - 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: Thu, 10 Oct 2013 09:53:47 -0000 Author: avg Date: Thu Oct 10 09:53:46 2013 New Revision: 256259 URL: http://svnweb.freebsd.org/changeset/base/256259 Log: MFV r255257: 4082 zfs receive gets EFBIG from dmu_tx_hold_free() illumos change 14172:be36a38bac3d: illumos ZFS issues: 4082 zfs receive gets EFBIG from dmu_tx_hold_free() Please note that this change is slightly different from r255257, because it is merged out of order with other (larger) upstream changes. PR: kern/182570 Reported by: Keith White Tested by: Keith White Approved by: re (glebius) MFC after: 1 week X-MFC after: r254753 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Thu Oct 10 09:43:15 2013 (r256258) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Thu Oct 10 09:53:46 2013 (r256259) @@ -677,6 +677,16 @@ dmu_free_long_range(objset_t *os, uint64 if (err != 0) return (err); err = dmu_free_long_range_impl(os, dn, offset, length); + + /* + * It is important to zero out the maxblkid when freeing the entire + * file, so that (a) subsequent calls to dmu_free_long_range_impl() + * will take the fast path, and (b) dnode_reallocate() can verify + * that the entire file has been freed. + */ + if (offset == 0 && length == DMU_OBJECT_END) + dn->dn_maxblkid = 0; + dnode_rele(dn, FTAG); return (err); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Thu Oct 10 09:43:15 2013 (r256258) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Thu Oct 10 09:53:46 2013 (r256259) @@ -616,7 +616,7 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t */ if (dn->dn_datablkshift == 0) { if (off != 0 || len < dn->dn_datablksz) - dmu_tx_count_write(txh, off, len); + dmu_tx_count_write(txh, 0, dn->dn_datablksz); } else { /* first block will be modified if it is not aligned */ if (!IS_P2ALIGNED(off, 1 << dn->dn_datablkshift)) From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 11: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0DE872AD; Thu, 10 Oct 2013 11:28:21 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E0AF02365; Thu, 10 Oct 2013 11:28:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ABSKD4072716; Thu, 10 Oct 2013 11:28:20 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ABSKXo072713; Thu, 10 Oct 2013 11:28:20 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310101128.r9ABSKXo072713@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 10 Oct 2013 11:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256261 - head/sbin/iscontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 11:28:21 -0000 Author: trasz Date: Thu Oct 10 11:28:20 2013 New Revision: 256261 URL: http://svnweb.freebsd.org/changeset/base/256261 Log: Remove unimplemented options from iscsi.conf(5) manual page, mention that it's being used by both initiators, and change the title to make it more easily searchable. Approved by: re (glebius) Sponsored by: FreeBSD Foundation Modified: head/sbin/iscontrol/iscsi.conf.5 Modified: head/sbin/iscontrol/iscsi.conf.5 ============================================================================== --- head/sbin/iscontrol/iscsi.conf.5 Thu Oct 10 11:02:05 2013 (r256260) +++ head/sbin/iscontrol/iscsi.conf.5 Thu Oct 10 11:28:20 2013 (r256261) @@ -24,18 +24,20 @@ .\" .\" $FreeBSD$ .\" -.Dd June 5, 2007 +.Dd October 10, 2013 .Dt ISCSI.CONF 5 .Os .Sh NAME .Nm iscsi.conf -.Nd key options to be negotiated in an iSCSI session +.Nd iSCSI initiator configuration file .Sh DESCRIPTION The file .Nm , -is read by the +is used by the +.Xr iscsictl 8 +and .Xr iscontrol 8 -program. +utilities. It contains declarations and parameter/key-options. The syntax is very simple, .D1 Li variable = value; @@ -69,9 +71,6 @@ Default is none. .It Cm DataDigest same as for HeaderDigest, but on the data part of the iSCSI PDU. (not yet tested) -.It Cm MaxConnections -is the number of simultaneous connections per session, -currently only 1. .It Cm TargetName is the name by which the target is known, not to be confused with target address, either obtained via the target administrator, or @@ -81,8 +80,6 @@ from a if not specified, defaults to .Sy iqn.2005-01.il.ac.huji.cs: .Aq hostname . -.It Cm TargetAlias / InitiatorAlias -not implemented. .It Cm TargetAddress is of the form .Sy domainname[:port][,portal-group-tag] @@ -93,35 +90,16 @@ dotted-decimal IPv4 address, or a bracke in [RFC2732]. .Ed Note: portal-group-tag is unused at the moment. -.It Cm TargetPortalGroupTag -.Em not implemented yet. -.It Cm InitialR2T -.Em not implemented yet. -.It Cm ImmediateData .Em not implemented yet. .It Cm MaxRecvDataSegmentLength the maximum data segment length in bytes it can receive in an iSCSI PDU, default is 8192. -.It Cm MaxBurstLength -.Em not implemented yet. -.It Cm FirstBurstLength -.Em not implemented yet. -.It Cm DefaultTime2Wait -.Em not implemented yet. -.It Cm DefaultTime2Retain -.Em not implemented yet. .It Cm MaxOutstandingR2T is used to calculate/negotiate the .Em tag opening , can be overridden by the .Sy tag option. -.It Cm DataPDUInOrder -.Em not implemented yet. -.It Cm DataSequenceInOrder -.Em not implemented yet. -.It Cm ErrorRecoveryLevel -Only level 0 is supported. .It Cm SessionType either Discovery or Normal, default is Normal, see the .Fl d @@ -196,9 +174,6 @@ chaptest { tags = 256 } .Ed -.Sh ERRORS -The parsing is very primitive, so do not expect - at the moment - any -error messages. .Sh SEE ALSO .Xr iscsi_initiator 4 , .Xr iscsictl 8 , From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 11:56:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 466D2AFD; Thu, 10 Oct 2013 11:56:44 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3354A250A; Thu, 10 Oct 2013 11:56:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ABuiqd087040; Thu, 10 Oct 2013 11:56:44 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ABuiM4087039; Thu, 10 Oct 2013 11:56:44 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310101156.r9ABuiM4087039@svn.freebsd.org> From: Glen Barber Date: Thu, 10 Oct 2013 11:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256264 - 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, 10 Oct 2013 11:56:44 -0000 Author: gjb Date: Thu Oct 10 11:56:43 2013 New Revision: 256264 URL: http://svnweb.freebsd.org/changeset/base/256264 Log: Fix mismerge introduced in r256230, adding auditdistd back to etc/rc.d/Makefile. Submitted by: Herbert J. Skuhra Pointyhat to: gjb Modified: stable/9/etc/rc.d/Makefile Modified: stable/9/etc/rc.d/Makefile ============================================================================== --- stable/9/etc/rc.d/Makefile Thu Oct 10 11:51:11 2013 (r256263) +++ stable/9/etc/rc.d/Makefile Thu Oct 10 11:56:43 2013 (r256264) @@ -19,6 +19,7 @@ FILES= DAEMON \ atm2 \ atm3 \ auditd \ + auditdistd \ bgfsck \ ${_bluetooth} \ bootparams \ From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 12:46:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EB62063F; Thu, 10 Oct 2013 12:46:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9EE42912; Thu, 10 Oct 2013 12:46:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ACkRQD012785; Thu, 10 Oct 2013 12:46:27 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ACkQOY012780; Thu, 10 Oct 2013 12:46:26 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310101246.r9ACkQOY012780@svn.freebsd.org> From: Bryan Drewery Date: Thu, 10 Oct 2013 12:46: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: r256266 - in stable/9/sys/boot: i386/efi powerpc/boot1.chrp userboot/libstand userboot/test userboot/userboot 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, 10 Oct 2013 12:46:28 -0000 Author: bdrewery (ports committer) Date: Thu Oct 10 12:46:26 2013 New Revision: 256266 URL: http://svnweb.freebsd.org/changeset/base/256266 Log: MFC r255944: Use MK_SSP=no after including bsd.own.mk to disable SSP instead of user-knob WITH[OUT]_SSP to avoid hitting an error if user has WITH_SSP in their make.conf. Ports now use this knob. make[7]: "/usr/src/share/mk/bsd.own.mk" line 466: WITH_SSP and WITHOUT_SSP can't both be set. Approved by: bapt Modified: stable/9/sys/boot/i386/efi/Makefile stable/9/sys/boot/powerpc/boot1.chrp/Makefile stable/9/sys/boot/userboot/libstand/Makefile stable/9/sys/boot/userboot/test/Makefile stable/9/sys/boot/userboot/userboot/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) Modified: stable/9/sys/boot/i386/efi/Makefile ============================================================================== --- stable/9/sys/boot/i386/efi/Makefile Thu Oct 10 12:44:00 2013 (r256265) +++ stable/9/sys/boot/i386/efi/Makefile Thu Oct 10 12:46:26 2013 (r256266) @@ -1,10 +1,10 @@ # $FreeBSD$ NO_MAN= -WITHOUT_SSP= BUILDING_EFI= .include +MK_SSP= no PROG= loader.sym INTERNALPROG= Modified: stable/9/sys/boot/powerpc/boot1.chrp/Makefile ============================================================================== --- stable/9/sys/boot/powerpc/boot1.chrp/Makefile Thu Oct 10 12:44:00 2013 (r256265) +++ stable/9/sys/boot/powerpc/boot1.chrp/Makefile Thu Oct 10 12:46:26 2013 (r256266) @@ -1,6 +1,6 @@ # $FreeBSD$ -WITHOUT_SSP= +SSP_CFLAGS= PROG= boot1.elf NEWVERSWHAT= "Open Firmware boot block" ${MACHINE_ARCH} Modified: stable/9/sys/boot/userboot/libstand/Makefile ============================================================================== --- stable/9/sys/boot/userboot/libstand/Makefile Thu Oct 10 12:44:00 2013 (r256265) +++ stable/9/sys/boot/userboot/libstand/Makefile Thu Oct 10 12:46:26 2013 (r256266) @@ -6,10 +6,10 @@ # quite large. # -WITHOUT_SSP= NO_MAN= .include +MK_SSP= no S= ${.CURDIR}/../../../../lib/libstand Modified: stable/9/sys/boot/userboot/test/Makefile ============================================================================== --- stable/9/sys/boot/userboot/test/Makefile Thu Oct 10 12:44:00 2013 (r256265) +++ stable/9/sys/boot/userboot/test/Makefile Thu Oct 10 12:46:26 2013 (r256266) @@ -2,9 +2,9 @@ NO_MAN= -WITHOUT_SSP= .include +MK_SSP= no PROG= test INTERNALPROG= Modified: stable/9/sys/boot/userboot/userboot/Makefile ============================================================================== --- stable/9/sys/boot/userboot/userboot/Makefile Thu Oct 10 12:44:00 2013 (r256265) +++ stable/9/sys/boot/userboot/userboot/Makefile Thu Oct 10 12:46:26 2013 (r256266) @@ -1,9 +1,9 @@ # $FreeBSD$ NO_MAN= -WITHOUT_SSP= .include +MK_SSP= no SHLIB_NAME= userboot.so NO_CTF= yes From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 12:47:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3F11D935; Thu, 10 Oct 2013 12:47:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2A0D02922; Thu, 10 Oct 2013 12:47:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AClYkU013325; Thu, 10 Oct 2013 12:47:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AClXmB013314; Thu, 10 Oct 2013 12:47:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310101247.r9AClXmB013314@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 10 Oct 2013 12:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256267 - stable/9/usr.bin/fetch 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, 10 Oct 2013 12:47:34 -0000 Author: glebius Date: Thu Oct 10 12:47:33 2013 New Revision: 256267 URL: http://svnweb.freebsd.org/changeset/base/256267 Log: Merge r253680,253805 from head: ---------------------------------------------------------------------- r253680 | des | 2013-07-26 19:53:43 +0400 (Fri, 26 Jul 2013) | 7 lines Implement certificate verification, and many other SSL-related imrovements; complete details in the PR. PR: kern/175514 Submitted by: Michael Gmelin MFC after: 1 week ---------------------------------------------------------------------- r253805 | des | 2013-07-30 17:07:55 +0400 (Tue, 30 Jul 2013) | 5 lines Include an Accept header in requests. PR: kern/180917 MFC after: 1 week Reviewed by: des Modified: stable/9/usr.bin/fetch/fetch.1 stable/9/usr.bin/fetch/fetch.c Directory Properties: stable/9/usr.bin/fetch/ (props changed) Modified: stable/9/usr.bin/fetch/fetch.1 ============================================================================== --- stable/9/usr.bin/fetch/fetch.1 Thu Oct 10 12:46:26 2013 (r256266) +++ stable/9/usr.bin/fetch/fetch.1 Thu Oct 10 12:47:33 2013 (r256267) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2011 +.Dd July 30, 2013 .Dt FETCH 1 .Os .Sh NAME @@ -38,22 +38,51 @@ .Sh SYNOPSIS .Nm .Op Fl 146AadFlMmnPpqRrsUv +.Op Fl -allow-sslv2 .Op Fl B Ar bytes +.Op Fl -bind-address= Ns Ar host +.Op Fl -ca-cert= Ns Ar file +.Op Fl -ca-path= Ns Ar dir +.Op Fl -cert= Ns Ar file +.Op Fl -crl= Ns Ar file .Op Fl i Ar file +.Op Fl -key= Ns Ar file .Op Fl N Ar file +.Op Fl -no-passive +.Op Fl -no-proxy= Ns Ar list +.Op Fl -no-sslv3 +.Op Fl -no-tlsv1 +.Op Fl -no-verify-hostname +.Op Fl -no-verify-peer .Op Fl o Ar file +.Op Fl -referer= Ns Ar URL .Op Fl S Ar bytes .Op Fl T Ar seconds +.Op Fl -user-agent= Ns Ar agent-string .Op Fl w Ar seconds .Ar URL ... .Nm .Op Fl 146AadFlMmnPpqRrsUv .Op Fl B Ar bytes +.Op Fl -bind-address= Ns Ar host +.Op Fl -ca-cert= Ns Ar file +.Op Fl -ca-path= Ns Ar dir +.Op Fl -cert= Ns Ar file +.Op Fl -crl= Ns Ar file .Op Fl i Ar file +.Op Fl -key= Ns Ar file .Op Fl N Ar file +.Op Fl -no-passive +.Op Fl -no-proxy= Ns Ar list +.Op Fl -no-sslv3 +.Op Fl -no-tlsv1 +.Op Fl -no-verify-hostname +.Op Fl -no-verify-peer .Op Fl o Ar file +.Op Fl -referer= Ns Ar URL .Op Fl S Ar bytes .Op Fl T Ar seconds +.Op Fl -user-agent= Ns Ar agent-string .Op Fl w Ar seconds .Fl h Ar host Fl f Ar file Oo Fl c Ar dir Oc .Sh DESCRIPTION @@ -67,23 +96,26 @@ command line. .Pp The following options are available: .Bl -tag -width Fl -.It Fl 1 +.It Fl 1 , -one-file Stop and return exit code 0 at the first successfully retrieved file. -.It Fl 4 +.It Fl 4 , -ipv4-only Forces .Nm to use IPv4 addresses only. -.It Fl 6 +.It Fl 6 , -ipv6-only Forces .Nm to use IPv6 addresses only. -.It Fl A +.It Fl A , -no-redirect Do not automatically follow ``temporary'' (302) redirects. Some broken Web sites will return a redirect instead of a not-found error when the requested object does not exist. -.It Fl a +.It Fl a , -retry Automatically retry the transfer upon soft failures. -.It Fl B Ar bytes +.It Fl -allow-sslv2 +[SSL] +Allow SSL version 2 when negotiating the connection. +.It Fl B Ar bytes , Fl -buffer-size= Ns Ar bytes Specify the read buffer size in bytes. The default is 4096 bytes. Attempts to set a buffer size lower than this will be silently @@ -92,15 +124,43 @@ The number of reads actually performed i two or higher (see the .Fl v flag). +.It Fl -bind-address= Ns Ar host +Specifies a hostname or IP address to which sockets used for outgoing +connections will be bound. .It Fl c Ar dir The file to retrieve is in directory .Ar dir on the remote host. This option is deprecated and is provided for backward compatibility only. -.It Fl d +.It Fl -ca-cert= Ns Ar file +[SSL] +Path to certificate bundle containing trusted CA certificates. +If not specified, +.Pa /etc/ssl/cert.pem +is used. +The file may contain multiple CA certificates. The port +.Pa security/ca_root_nss +is a common source of a current CA bundle. +.It Fl -ca-path= Ns Ar dir +[SSL] +The directory +.Ar dir +contains trusted CA hashes. +.It Fl -cert= Ns Ar file +[SSL] +.Ar file +is a PEM encoded client certificate/key which will be used in +client certificate authentication. +.It Fl -crl= Ns Ar file +[SSL] +Points to certificate revocation list +.Ar file , +which has to be in PEM format and may contain peer certificates that have +been revoked. +.It Fl d , -direct Use a direct connection even if a proxy is configured. -.It Fl F +.It Fl F , -force-restart In combination with the .Fl r flag, forces a restart even if the local and remote files have @@ -118,17 +178,22 @@ The file to retrieve is located on the h .Ar host . This option is deprecated and is provided for backward compatibility only. -.It Fl i Ar file +.It Fl i Ar file , Fl -if-modified-since= Ns Ar file If-Modified-Since mode: the remote file will only be retrieved if it is newer than .Ar file on the local host. (HTTP only) -.It Fl l +.It Fl -key= Ns Ar file +[SSL] +.Ar file +is a PEM encoded client key that will be used in client certificate +authentication in case key and client certificate are stored separately. +.It Fl l , -symlink If the target is a file-scheme URL, make a symbolic link to the target rather than trying to copy it. .It Fl M -.It Fl m +.It Fl m , -mirror Mirror mode: if the file already exists locally and has the same size and modification time as the remote file, it will not be fetched. Note that the @@ -136,7 +201,7 @@ Note that the and .Fl r flags are mutually exclusive. -.It Fl N Ar file +.It Fl N Ar file , Fl -netrc= Ns Ar file Use .Ar file instead of @@ -146,9 +211,28 @@ See .Xr ftp 1 for a description of the file format. This feature is experimental. -.It Fl n +.It Fl n , -no-mtime Do not preserve the modification time of the transferred file. -.It Fl o Ar file +.It Fl -no-passive +Forces the FTP code to use active mode. +.It Fl -no-proxy= Ns Ar list +Either a single asterisk, which disables the use of proxies +altogether, or a comma- or whitespace-separated list of hosts for +which proxies should not be used. +.It Fl -no-sslv3 +[SSL] +Don't allow SSL version 3 when negotiating the connection. +.It Fl -no-tlsv1 +[SSL] +Don't allow TLS version 1 when negotiating the connection. +.It Fl -no-verify-hostname +[SSL] +Do not verify that the hostname matches the subject of the +certificate presented by the server. +.It Fl -no-verify-peer +[SSL] +Do not verify the peer certificate against trusted CAs. +.It Fl o Ar file , Fl output= Ns Ar file Set the output file name to .Ar file . By default, a ``pathname'' is extracted from the specified URI, and @@ -163,36 +247,45 @@ If the argument is a directory, fetched file(s) will be placed within the directory, with name(s) selected as in the default behaviour. .It Fl P -.It Fl p +.It Fl p , -passive Use passive FTP. These flags have no effect, since passive FTP is the default, but are provided for compatibility with earlier versions where active FTP was the default. -To force active mode, set the +To force active mode, use the +.Fl -no-passive +flag or set the .Ev FTP_PASSIVE_MODE environment variable to .Ql NO . -.It Fl q +.It Fl -referer= Ns Ar URL +Specifies the referrer URL to use for HTTP requests. +If +.Ar URL +is set to +.Dq auto , +the document URL will be used as referrer URL. +.It Fl q , -quiet Quiet mode. -.It Fl R +.It Fl R , -keep-output The output files are precious, and should not be deleted under any circumstances, even if the transfer failed or was incomplete. -.It Fl r +.It Fl r , -restart Restart a previously interrupted transfer. Note that the .Fl m and .Fl r flags are mutually exclusive. -.It Fl S Ar bytes +.It Fl S Ar bytes , Fl -require-size= Ns Ar bytes Require the file size reported by the server to match the specified value. If it does not, a message is printed and the file is not fetched. If the server does not support reporting file sizes, this option is ignored and the file is fetched unconditionally. -.It Fl s +.It Fl s , -print-size Print the size in bytes of each requested file, without fetching it. -.It Fl T Ar seconds +.It Fl T Ar seconds , Fl -timeout= Ns Ar seconds Set timeout value to .Ar seconds . Overrides the environment variables @@ -200,15 +293,19 @@ Overrides the environment variables for FTP transfers or .Ev HTTP_TIMEOUT for HTTP transfers if set. -.It Fl U +.It Fl U , -passive-portrange-default When using passive FTP, allocate the port for the data connection from the low (default) port range. See .Xr ip 4 for details on how to specify which port range this corresponds to. -.It Fl v +.It Fl -user-agent= Ns Ar agent-string +Specifies the User-Agent string to use for HTTP requests. +This can be useful when working with HTTP origin or proxy servers that +differentiate between user agents. +.It Fl v , -verbose Increase verbosity level. -.It Fl w Ar seconds +.It Fl w Ar seconds , Fl -retry-delay= Ns Ar seconds When the .Fl a flag is specified, wait this many seconds between successive retries. @@ -242,6 +339,7 @@ for a description of additional environm .Ev FTP_PASSWORD , .Ev FTP_PROXY , .Ev ftp_proxy , +.Ev HTTP_ACCEPT , .Ev HTTP_AUTH , .Ev HTTP_PROXY , .Ev http_proxy , @@ -249,8 +347,19 @@ for a description of additional environm .Ev HTTP_REFERER , .Ev HTTP_USER_AGENT , .Ev NETRC , -.Ev NO_PROXY No and -.Ev no_proxy . +.Ev NO_PROXY , +.Ev no_proxy , +.Ev SSL_ALLOW_SSL2 , +.Ev SSL_CA_CERT_FILE , +.Ev SSL_CA_CERT_PATH , +.Ev SSL_CLIENT_CERT_FILE , +.Ev SSL_CLIENT_KEY_FILE , +.Ev SSL_CRL_FILE , +.Ev SSL_NO_SSL3 , +.Ev SSL_NO_TLS1 , +.Ev SSL_NO_VERIFY_HOSTNAME +and +.Ev SSL_NO_VERIFY_PEER . .Sh EXIT STATUS The .Nm @@ -287,7 +396,9 @@ by and later completely rewritten to use the .Xr fetch 3 library by -.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org . +.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org +and +.An Michael Gmelin Aq freebsd@grem.de . .Sh NOTES The .Fl b Modified: stable/9/usr.bin/fetch/fetch.c ============================================================================== --- stable/9/usr.bin/fetch/fetch.c Thu Oct 10 12:46:26 2013 (r256266) +++ stable/9/usr.bin/fetch/fetch.c Thu Oct 10 12:47:33 2013 (r256267) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2000-2011 Dag-Erling Smørgrav + * Copyright (c) 2013 Michael Gmelin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -93,6 +95,78 @@ long ftp_timeout = TIMEOUT; /* default long http_timeout = TIMEOUT; /* default timeout for HTTP transfers */ char *buf; /* transfer buffer */ +enum options +{ + OPTION_BIND_ADDRESS, + OPTION_NO_FTP_PASSIVE_MODE, + OPTION_HTTP_REFERER, + OPTION_HTTP_USER_AGENT, + OPTION_NO_PROXY, + OPTION_SSL_ALLOW_SSL2, + OPTION_SSL_CA_CERT_FILE, + OPTION_SSL_CA_CERT_PATH, + OPTION_SSL_CLIENT_CERT_FILE, + OPTION_SSL_CLIENT_KEY_FILE, + OPTION_SSL_CRL_FILE, + OPTION_SSL_NO_SSL3, + OPTION_SSL_NO_TLS1, + OPTION_SSL_NO_VERIFY_HOSTNAME, + OPTION_SSL_NO_VERIFY_PEER +}; + + +static struct option longopts[] = +{ + /* mapping to single character argument */ + { "one-file", no_argument, NULL, '1' }, + { "ipv4-only", no_argument, NULL, '4' }, + { "ipv6-only", no_argument, NULL, '6' }, + { "no-redirect", no_argument, NULL, 'A' }, + { "retry", no_argument, NULL, 'a' }, + { "buffer-size", required_argument, NULL, 'B' }, + /* -c not mapped, since it's deprecated */ + { "direct", no_argument, NULL, 'd' }, + { "force-restart", no_argument, NULL, 'F' }, + /* -f not mapped, since it's deprecated */ + /* -h not mapped, since it's deprecated */ + { "if-modified-since", required_argument, NULL, 'i' }, + { "symlink", no_argument, NULL, 'l' }, + /* -M not mapped since it's the same as -m */ + { "mirror", no_argument, NULL, 'm' }, + { "netrc", required_argument, NULL, 'N' }, + { "no-mtime", no_argument, NULL, 'n' }, + { "output", required_argument, NULL, 'o' }, + /* -P not mapped since it's the same as -p */ + { "passive", no_argument, NULL, 'p' }, + { "quiet", no_argument, NULL, 'q' }, + { "keep-output", no_argument, NULL, 'R' }, + { "restart", no_argument, NULL, 'r' }, + { "require-size", required_argument, NULL, 'S' }, + { "print-size", no_argument, NULL, 's' }, + { "timeout", required_argument, NULL, 'T' }, + { "passive-portrange-default", no_argument, NULL, 'T' }, + { "verbose", no_argument, NULL, 'v' }, + { "retry-delay", required_argument, NULL, 'w' }, + + /* options without a single character equivalent */ + { "bind-address", required_argument, NULL, OPTION_BIND_ADDRESS }, + { "no-passive", no_argument, NULL, OPTION_NO_FTP_PASSIVE_MODE }, + { "referer", required_argument, NULL, OPTION_HTTP_REFERER }, + { "user-agent", required_argument, NULL, OPTION_HTTP_USER_AGENT }, + { "no-proxy", required_argument, NULL, OPTION_NO_PROXY }, + { "allow-sslv2", no_argument, NULL, OPTION_SSL_ALLOW_SSL2 }, + { "ca-cert", required_argument, NULL, OPTION_SSL_CA_CERT_FILE }, + { "ca-path", required_argument, NULL, OPTION_SSL_CA_CERT_PATH }, + { "cert", required_argument, NULL, OPTION_SSL_CLIENT_CERT_FILE }, + { "key", required_argument, NULL, OPTION_SSL_CLIENT_KEY_FILE }, + { "crl", required_argument, NULL, OPTION_SSL_CRL_FILE }, + { "no-sslv3", no_argument, NULL, OPTION_SSL_NO_SSL3 }, + { "no-tlsv1", no_argument, NULL, OPTION_SSL_NO_TLS1 }, + { "no-verify-hostname", no_argument, NULL, OPTION_SSL_NO_VERIFY_HOSTNAME }, + { "no-verify-peer", no_argument, NULL, OPTION_SSL_NO_VERIFY_PEER }, + + { NULL, 0, NULL, 0 } +}; /* * Signal handler @@ -769,11 +843,19 @@ fetch(char *URL, const char *path) static void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n%s\n", -"usage: fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [-N file] [-o file] [-S bytes]", -" [-T seconds] [-w seconds] [-i file] URL ...", -" fetch [-146AadFlMmnPpqRrsUv] [-B bytes] [-N file] [-o file] [-S bytes]", -" [-T seconds] [-w seconds] [-i file] -h host -f file [-c dir]"); + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", +"usage: fetch [-146AadFlMmnPpqRrsUv] [--allow-sslv2] [-B bytes]", +" [--bind-address=host] [--ca-cert=file] [--ca-path=dir] [--cert=file]", +" [--crl=file] [-i file] [--key=file] [-N file] [--no-passive]", +" [--no-proxy=list] [--no-sslv3] [--no-tlsv1] [--no-verify-hostname]", +" [--no-verify-peer] [-o file] [--referer=URL] [-S bytes] [-T seconds]", +" [--user-agent=agent-string] [-w seconds] URL ...", +" fetch [-146AadFlMmnPpqRrsUv] [--allow-sslv2] [-B bytes]", +" [--bind-address=host] [--ca-cert=file] [--ca-path=dir] [--cert=file]", +" [--crl=file] [-i file] [--key=file] [-N file] [--no-passive]", +" [--no-proxy=list] [--no-sslv3] [--no-tlsv1] [--no-verify-hostname]", +" [--no-verify-peer] [-o file] [--referer=URL] [-S bytes] [-T seconds]", +" [--user-agent=agent-string] [-w seconds] -h host -f file [-c dir]"); } @@ -789,8 +871,10 @@ main(int argc, char *argv[]) char *end, *q; int c, e, r; - while ((c = getopt(argc, argv, - "146AaB:bc:dFf:Hh:i:lMmN:nPpo:qRrS:sT:tUvw:")) != -1) + + while ((c = getopt_long(argc, argv, + "146AaB:bc:dFf:Hh:i:lMmN:nPpo:qRrS:sT:tUvw:", + longopts, NULL)) != -1) switch (c) { case '1': once_flag = 1; @@ -904,6 +988,51 @@ main(int argc, char *argv[]) if (*optarg == '\0' || *end != '\0') errx(1, "invalid delay (%s)", optarg); break; + case OPTION_BIND_ADDRESS: + setenv("FETCH_BIND_ADDRESS", optarg, 1); + break; + case OPTION_NO_FTP_PASSIVE_MODE: + setenv("FTP_PASSIVE_MODE", "no", 1); + break; + case OPTION_HTTP_REFERER: + setenv("HTTP_REFERER", optarg, 1); + break; + case OPTION_HTTP_USER_AGENT: + setenv("HTTP_USER_AGENT", optarg, 1); + break; + case OPTION_NO_PROXY: + setenv("NO_PROXY", optarg, 1); + break; + case OPTION_SSL_ALLOW_SSL2: + setenv("SSL_ALLOW_SSL2", "", 1); + break; + case OPTION_SSL_CA_CERT_FILE: + setenv("SSL_CA_CERT_FILE", optarg, 1); + break; + case OPTION_SSL_CA_CERT_PATH: + setenv("SSL_CA_CERT_PATH", optarg, 1); + break; + case OPTION_SSL_CLIENT_CERT_FILE: + setenv("SSL_CLIENT_CERT_FILE", optarg, 1); + break; + case OPTION_SSL_CLIENT_KEY_FILE: + setenv("SSL_CLIENT_KEY_FILE", optarg, 1); + break; + case OPTION_SSL_CRL_FILE: + setenv("SSL_CLIENT_CRL_FILE", optarg, 1); + break; + case OPTION_SSL_NO_SSL3: + setenv("SSL_NO_SSL3", "", 1); + break; + case OPTION_SSL_NO_TLS1: + setenv("SSL_NO_TLS1", "", 1); + break; + case OPTION_SSL_NO_VERIFY_HOSTNAME: + setenv("SSL_NO_VERIFY_HOSTNAME", "", 1); + break; + case OPTION_SSL_NO_VERIFY_PEER: + setenv("SSL_NO_VERIFY_PEER", "", 1); + break; default: usage(); exit(1); From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 12:47:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EA42F936; Thu, 10 Oct 2013 12:47:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D71172923; Thu, 10 Oct 2013 12:47:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AClYBT013349; Thu, 10 Oct 2013 12:47:34 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AClYXP013348; Thu, 10 Oct 2013 12:47:34 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310101247.r9AClYXP013348@svn.freebsd.org> From: Bryan Drewery Date: Thu, 10 Oct 2013 12:47: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: r256268 - stable/8/sys/boot/powerpc/boot1.chrp 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, 10 Oct 2013 12:47:35 -0000 Author: bdrewery (ports committer) Date: Thu Oct 10 12:47:34 2013 New Revision: 256268 URL: http://svnweb.freebsd.org/changeset/base/256268 Log: MFC r255944 (partial): Use MK_SSP=no after including bsd.own.mk to disable SSP instead of user-knob WITH[OUT]_SSP to avoid hitting an error if user has WITH_SSP in their make.conf. Ports now use this knob. make[7]: "/usr/src/share/mk/bsd.own.mk" line 466: WITH_SSP and WITHOUT_SSP can't both be set. Approved by: bapt Modified: stable/8/sys/boot/powerpc/boot1.chrp/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/powerpc/boot1.chrp/Makefile ============================================================================== --- stable/8/sys/boot/powerpc/boot1.chrp/Makefile Thu Oct 10 12:47:33 2013 (r256267) +++ stable/8/sys/boot/powerpc/boot1.chrp/Makefile Thu Oct 10 12:47:34 2013 (r256268) @@ -1,6 +1,6 @@ # $FreeBSD$ -WITHOUT_SSP= +SSP_CFLAGS= PROG= boot1.elf NEWVERSWHAT= "Open Firmware boot block" ${MACHINE_ARCH} From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 14:03:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 61FBC68D; Thu, 10 Oct 2013 14:03:04 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 34E3C2E86; Thu, 10 Oct 2013 14:03:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AE34pe053538; Thu, 10 Oct 2013 14:03:04 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AE34AL053537; Thu, 10 Oct 2013 14:03:04 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201310101403.r9AE34AL053537@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 10 Oct 2013 14:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256269 - head/sys/ofed/drivers/infiniband/hw/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 14:03:04 -0000 Author: alfred Date: Thu Oct 10 14:03:03 2013 New Revision: 256269 URL: http://svnweb.freebsd.org/changeset/base/256269 Log: Fix for When more than one NIC is present. The device name was incorrect due to a specific function we ported from the Linux driver that is not FBSD compatible. This resulted with a false sysctl registration and some more problematic issues. The patch basically revokes it all together. Submitted by: Meny Yossefi (menyy mellanox.com) Approved by: re Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Thu Oct 10 12:47:34 2013 (r256268) +++ head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Thu Oct 10 14:03:03 2013 (r256269) @@ -1859,33 +1859,6 @@ err: "is incorrect. The parameter value is discarded!"); } -static int mlx4_ib_dev_idx(struct mlx4_dev *dev) -{ - int /*bus,*/ slot, fn; - int i; - - if (!dev) - return -1; - else if (!dev->pdev) - return -1; - //else if (!dev->pdev->bus) - // return -1; - - //bus = dev->pdev->bus->conf.pc_sel.pc_bus; - slot = PCI_SLOT(dev->pdev->devfn); - fn = PCI_FUNC(dev->pdev->devfn); - - for (i = 0; i < MAX_DR; ++i) { - if (/*dr[i].bus == bus &&*/ - dr[i].dev == slot && - dr[i].func == fn) { - return dr[i].nr; - } - } - - return -1; -} - static void *mlx4_ib_add(struct mlx4_dev *dev) { struct mlx4_ib_dev *ibdev; @@ -1893,7 +1866,6 @@ static void *mlx4_ib_add(struct mlx4_dev int i, j; int err; struct mlx4_ib_iboe *iboe; - int dev_idx; printk(KERN_INFO "%s", mlx4_ib_version); @@ -1928,12 +1900,7 @@ static void *mlx4_ib_add(struct mlx4_dev ibdev->dev = dev; - dev_idx = mlx4_ib_dev_idx(dev); - if (dev_idx >= 0) - sprintf(ibdev->ib_dev.name, "mlx4_%d", dev_idx); - else - strlcpy(ibdev->ib_dev.name, "mlx4_%d", IB_DEVICE_NAME_MAX); - + strlcpy(ibdev->ib_dev.name, "mlx4_%d", IB_DEVICE_NAME_MAX); ibdev->ib_dev.owner = THIS_MODULE; ibdev->ib_dev.node_type = RDMA_NODE_IB_CA; ibdev->ib_dev.local_dma_lkey = dev->caps.reserved_lkey; From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 14:15:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 28AEBCC5; Thu, 10 Oct 2013 14:15:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 165A22F5D; Thu, 10 Oct 2013 14:15:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AEFUj7059408; Thu, 10 Oct 2013 14:15:30 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AEFUb2059406; Thu, 10 Oct 2013 14:15:30 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310101415.r9AEFUb2059406@svn.freebsd.org> From: Glen Barber Date: Thu, 10 Oct 2013 14:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r256270 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 14:15:31 -0000 Author: gjb Date: Thu Oct 10 14:15:30 2013 New Revision: 256270 URL: http://svnweb.freebsd.org/changeset/base/256270 Log: Prepare for stable/10 branch creation: - approvers: - Require re@ approval for commits to stable/10 - Add sys/dev/random and sys/libkern/arc4random.c paths to include stable/10 after the thaw (commented) - paths: - Add stable/10 Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: svnadmin/conf/approvers svnadmin/conf/paths Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Thu Oct 10 14:03:03 2013 (r256269) +++ svnadmin/conf/approvers Thu Oct 10 14:15:30 2013 (r256270) @@ -17,6 +17,7 @@ # $FreeBSD$ # ^head/ re +^stable/10/ re #^stable/9/ re #^stable/8/ re #^stable/7/ re @@ -35,4 +36,6 @@ ^head/sys/dev/random (security-officer|so|secteam|core) ^head/sys/libkern/arc4random.c (security-officer|so|secteam|core) ^stable/[7-9]/sys/dev/random (security-officer|so|secteam|core) +#^stable/([7-9]|10)/sys/dev/random (security-officer|so|secteam|core) ^stable/[7-9]/sys/libkern/arc4random.c (security-officer|so|secteam|core) +#^stable/([7-9]|10)/sys/libkern/arc4random.c (security-officer|so|secteam|core) Modified: svnadmin/conf/paths ============================================================================== --- svnadmin/conf/paths Thu Oct 10 14:03:03 2013 (r256269) +++ svnadmin/conf/paths Thu Oct 10 14:15:30 2013 (r256270) @@ -17,6 +17,7 @@ ^stable/7/ ^stable/8/ ^stable/9/ +^stable/10/ # Feature branches. Not open until we're certain we're not reverting to cvs. ^user/ From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 14:21:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 945B2F98; Thu, 10 Oct 2013 14:21:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 813472FE6; Thu, 10 Oct 2013 14:21:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AELSmA063917; Thu, 10 Oct 2013 14:21:28 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AELSXw063915; Thu, 10 Oct 2013 14:21:28 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310101421.r9AELSXw063915@svn.freebsd.org> From: Glen Barber Date: Thu, 10 Oct 2013 14:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r256271 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 14:21:28 -0000 Author: gjb Date: Thu Oct 10 14:21:27 2013 New Revision: 256271 URL: http://svnweb.freebsd.org/changeset/base/256271 Log: I'm quite sure by this point that we are not reverting to CVS. Noticed by: flo Approved by: re (implicit) Modified: svnadmin/conf/paths Modified: svnadmin/conf/paths ============================================================================== --- svnadmin/conf/paths Thu Oct 10 14:15:30 2013 (r256270) +++ svnadmin/conf/paths Thu Oct 10 14:21:27 2013 (r256271) @@ -19,7 +19,7 @@ ^stable/9/ ^stable/10/ -# Feature branches. Not open until we're certain we're not reverting to cvs. +# Feature branches. ^user/ ^projects/ From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 14:34:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BB60987B; Thu, 10 Oct 2013 14:34:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A6DB820DE; Thu, 10 Oct 2013 14:34:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AEY2eo069290; Thu, 10 Oct 2013 14:34:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AEY1ai069285; Thu, 10 Oct 2013 14:34:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310101434.r9AEY1ai069285@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Oct 2013 14:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256272 - 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: Thu, 10 Oct 2013 14:34:02 -0000 Author: jhb Date: Thu Oct 10 14:34:01 2013 New Revision: 256272 URL: http://svnweb.freebsd.org/changeset/base/256272 Log: MFC 253450: Properly handle I/O windows in bridges with the ISA enable bit set. These beasts still exist unfortunately. More details can be found in other references, but the short version is that bridges with this bit set ignore I/O port ranges that alias to valid ISA I/O port ranges. In the driver this requires not allocating these alias regions from the parent device (so they are free to be acquired by ISA devices), and ensuring no child devices use resources from these alias regions. Modified: stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pci_pci.c stable/9/sys/dev/pci/pci_private.h stable/9/sys/dev/pci/pcib_private.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Thu Oct 10 14:21:27 2013 (r256271) +++ stable/9/sys/dev/pci/pci.c Thu Oct 10 14:34:01 2013 (r256272) @@ -162,7 +162,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_delete_resource, pci_delete_resource), DEVMETHOD(bus_alloc_resource, pci_alloc_resource), DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), - DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), + DEVMETHOD(bus_release_resource, pci_release_resource), DEVMETHOD(bus_activate_resource, pci_activate_resource), DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource), DEVMETHOD(bus_child_pnpinfo_str, pci_child_pnpinfo_str_method), @@ -4172,11 +4172,11 @@ struct resource * pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - struct pci_devinfo *dinfo = device_get_ivars(child); - struct resource_list *rl = &dinfo->resources; + struct pci_devinfo *dinfo; + struct resource_list *rl; struct resource_list_entry *rle; struct resource *res; - pcicfgregs *cfg = &dinfo->cfg; + pcicfgregs *cfg; if (device_get_parent(child) != dev) return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, @@ -4185,6 +4185,9 @@ pci_alloc_resource(device_t dev, device_ /* * Perform lazy resource allocation */ + dinfo = device_get_ivars(child); + rl = &dinfo->resources; + cfg = &dinfo->cfg; switch (type) { case SYS_RES_IRQ: /* @@ -4240,6 +4243,41 @@ pci_alloc_resource(device_t dev, device_ } int +pci_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct pci_devinfo *dinfo; + struct resource_list *rl; + pcicfgregs *cfg; + + if (device_get_parent(child) != dev) + return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, + type, rid, r)); + + dinfo = device_get_ivars(child); + cfg = &dinfo->cfg; +#ifdef NEW_PCIB + /* + * PCI-PCI bridge I/O window resources are not BARs. For + * those allocations just pass the request up the tree. + */ + if (cfg->hdrtype == PCIM_HDRTYPE_BRIDGE && + (type == SYS_RES_IOPORT || type == SYS_RES_MEMORY)) { + switch (rid) { + case PCIR_IOBASEL_1: + case PCIR_MEMBASE_1: + case PCIR_PMBASEL_1: + return (bus_generic_release_resource(dev, child, type, + rid, r)); + } + } +#endif + + rl = &dinfo->resources; + return (resource_list_release(rl, dev, child, type, rid, r)); +} + +int pci_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { Modified: stable/9/sys/dev/pci/pci_pci.c ============================================================================== --- stable/9/sys/dev/pci/pci_pci.c Thu Oct 10 14:21:27 2013 (r256271) +++ stable/9/sys/dev/pci/pci_pci.c Thu Oct 10 14:34:01 2013 (r256272) @@ -103,13 +103,6 @@ DEFINE_CLASS_0(pcib, pcib_driver, pcib_m DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL); #ifdef NEW_PCIB -/* - * XXX Todo: - * - properly handle the ISA enable bit. If it is set, we should change - * the behavior of the I/O window resource and rman to not allocate the - * blocked ranges (upper 768 bytes of each 1K in the first 64k of the - * I/O port address space). - */ /* * Is a resource from a child device sub-allocated from one of our @@ -189,10 +182,183 @@ pcib_write_windows(struct pcib_softc *sc } } +/* + * This is used to reject I/O port allocations that conflict with an + * ISA alias range. + */ +static int +pcib_is_isa_range(struct pcib_softc *sc, u_long start, u_long end, u_long count) +{ + u_long next_alias; + + if (!(sc->bridgectl & PCIB_BCR_ISA_ENABLE)) + return (0); + + /* Only check fixed ranges for overlap. */ + if (start + count - 1 != end) + return (0); + + /* ISA aliases are only in the lower 64KB of I/O space. */ + if (start >= 65536) + return (0); + + /* Check for overlap with 0x000 - 0x0ff as a special case. */ + if (start < 0x100) + goto alias; + + /* + * If the start address is an alias, the range is an alias. + * Otherwise, compute the start of the next alias range and + * check if it is before the end of the candidate range. + */ + if ((start & 0x300) != 0) + goto alias; + next_alias = (start & ~0x3fful) | 0x100; + if (next_alias <= end) + goto alias; + return (0); + +alias: + if (bootverbose) + device_printf(sc->dev, + "I/O range %#lx-%#lx overlaps with an ISA alias\n", start, + end); + return (1); +} + +static void +pcib_add_window_resources(struct pcib_window *w, struct resource **res, + int count) +{ + struct resource **newarray; + int error, i; + + newarray = malloc(sizeof(struct resource *) * (w->count + count), + M_DEVBUF, M_WAITOK); + if (w->res != NULL) + bcopy(w->res, newarray, sizeof(struct resource *) * w->count); + bcopy(res, newarray + w->count, sizeof(struct resource *) * count); + free(w->res, M_DEVBUF); + w->res = newarray; + w->count += count; + + for (i = 0; i < count; i++) { + error = rman_manage_region(&w->rman, rman_get_start(res[i]), + rman_get_end(res[i])); + if (error) + panic("Failed to add resource to rman"); + } +} + +typedef void (nonisa_callback)(u_long start, u_long end, void *arg); + +static void +pcib_walk_nonisa_ranges(u_long start, u_long end, nonisa_callback *cb, + void *arg) +{ + u_long next_end; + + /* + * If start is within an ISA alias range, move up to the start + * of the next non-alias range. As a special case, addresses + * in the range 0x000 - 0x0ff should also be skipped since + * those are used for various system I/O devices in ISA + * systems. + */ + if (start <= 65535) { + if (start < 0x100 || (start & 0x300) != 0) { + start &= ~0x3ff; + start += 0x400; + } + } + + /* ISA aliases are only in the lower 64KB of I/O space. */ + while (start <= MIN(end, 65535)) { + next_end = MIN(start | 0xff, end); + cb(start, next_end, arg); + start += 0x400; + } + + if (start <= end) + cb(start, end, arg); +} + +static void +count_ranges(u_long start, u_long end, void *arg) +{ + int *countp; + + countp = arg; + (*countp)++; +} + +struct alloc_state { + struct resource **res; + struct pcib_softc *sc; + int count, error; +}; + +static void +alloc_ranges(u_long start, u_long end, void *arg) +{ + struct alloc_state *as; + struct pcib_window *w; + int rid; + + as = arg; + if (as->error != 0) + return; + + w = &as->sc->io; + rid = w->reg; + if (bootverbose) + device_printf(as->sc->dev, + "allocating non-ISA range %#lx-%#lx\n", start, end); + as->res[as->count] = bus_alloc_resource(as->sc->dev, SYS_RES_IOPORT, + &rid, start, end, end - start + 1, 0); + if (as->res[as->count] == NULL) + as->error = ENXIO; + else + as->count++; +} + +static int +pcib_alloc_nonisa_ranges(struct pcib_softc *sc, u_long start, u_long end) +{ + struct alloc_state as; + int i, new_count; + + /* First, see how many ranges we need. */ + new_count = 0; + pcib_walk_nonisa_ranges(start, end, count_ranges, &new_count); + + /* Second, allocate the ranges. */ + as.res = malloc(sizeof(struct resource *) * new_count, M_DEVBUF, + M_WAITOK); + as.sc = sc; + as.count = 0; + as.error = 0; + pcib_walk_nonisa_ranges(start, end, alloc_ranges, &as); + if (as.error != 0) { + for (i = 0; i < as.count; i++) + bus_release_resource(sc->dev, SYS_RES_IOPORT, + sc->io.reg, as.res[i]); + free(as.res, M_DEVBUF); + return (as.error); + } + KASSERT(as.count == new_count, ("%s: count mismatch", __func__)); + + /* Third, add the ranges to the window. */ + pcib_add_window_resources(&sc->io, as.res, as.count); + free(as.res, M_DEVBUF); + return (0); +} + static void pcib_alloc_window(struct pcib_softc *sc, struct pcib_window *w, int type, int flags, pci_addr_t max_address) { + struct resource *res; char buf[64]; int error, rid; @@ -217,9 +383,15 @@ pcib_alloc_window(struct pcib_softc *sc, "initial %s window has too many bits, ignoring\n", w->name); return; } - rid = w->reg; - w->res = bus_alloc_resource(sc->dev, type, &rid, w->base, w->limit, - w->limit - w->base + 1, flags); + if (type == SYS_RES_IOPORT && sc->bridgectl & PCIB_BCR_ISA_ENABLE) + (void)pcib_alloc_nonisa_ranges(sc, w->base, w->limit); + else { + rid = w->reg; + res = bus_alloc_resource(sc->dev, type, &rid, w->base, w->limit, + w->limit - w->base + 1, flags); + if (res != NULL) + pcib_add_window_resources(w, &res, 1); + } if (w->res == NULL) { device_printf(sc->dev, "failed to allocate initial %s window: %#jx-%#jx\n", @@ -230,11 +402,6 @@ pcib_alloc_window(struct pcib_softc *sc, return; } pcib_activate_window(sc, type); - - error = rman_manage_region(&w->rman, rman_get_start(w->res), - rman_get_end(w->res)); - if (error) - panic("Failed to initialize rman with resource"); } /* @@ -541,6 +708,7 @@ pcib_attach_common(device_t dev) struct pcib_softc *sc; struct sysctl_ctx_list *sctx; struct sysctl_oid *soid; + int comma; sc = device_get_softc(dev); sc->dev = dev; @@ -667,10 +835,22 @@ pcib_attach_common(device_t dev) device_printf(dev, " prefetched decode 0x%jx-0x%jx\n", (uintmax_t)sc->pmembase, (uintmax_t)sc->pmemlimit); #endif - else - device_printf(dev, " no prefetched decode\n"); - if (sc->flags & PCIB_SUBTRACTIVE) - device_printf(dev, " Subtractively decoded bridge.\n"); + if (sc->bridgectl & (PCIB_BCR_ISA_ENABLE | PCIB_BCR_VGA_ENABLE) || + sc->flags & PCIB_SUBTRACTIVE) { + device_printf(dev, " special decode "); + comma = 0; + if (sc->bridgectl & PCIB_BCR_ISA_ENABLE) { + printf("ISA"); + comma = 1; + } + if (sc->bridgectl & PCIB_BCR_VGA_ENABLE) { + printf("%sVGA", comma ? ", " : ""); + comma = 1; + } + if (sc->flags & PCIB_SUBTRACTIVE) + printf("%ssubtractive", comma ? ", " : ""); + printf("\n"); + } } /* @@ -817,23 +997,197 @@ pcib_suballoc_resource(struct pcib_softc return (res); } +/* Allocate a fresh resource range for an unconfigured window. */ +static int +pcib_alloc_new_window(struct pcib_softc *sc, struct pcib_window *w, int type, + u_long start, u_long end, u_long count, u_int flags) +{ + struct resource *res; + u_long base, limit, wmask; + int rid; + + /* + * If this is an I/O window on a bridge with ISA enable set + * and the start address is below 64k, then try to allocate an + * initial window of 0x1000 bytes long starting at address + * 0xf000 and walking down. Note that if the original request + * was larger than the non-aliased range size of 0x100 our + * caller would have raised the start address up to 64k + * already. + */ + if (type == SYS_RES_IOPORT && sc->bridgectl & PCIB_BCR_ISA_ENABLE && + start < 65536) { + for (base = 0xf000; (long)base >= 0; base -= 0x1000) { + limit = base + 0xfff; + + /* + * Skip ranges that wouldn't work for the + * original request. Note that the actual + * window that overlaps are the non-alias + * ranges within [base, limit], so this isn't + * quite a simple comparison. + */ + if (start + count > limit - 0x400) + continue; + if (base == 0) { + /* + * The first open region for the window at + * 0 is 0x400-0x4ff. + */ + if (end - count + 1 < 0x400) + continue; + } else { + if (end - count + 1 < base) + continue; + } + + if (pcib_alloc_nonisa_ranges(sc, base, limit) == 0) { + w->base = base; + w->limit = limit; + return (0); + } + } + return (ENOSPC); + } + + wmask = (1ul << w->step) - 1; + if (RF_ALIGNMENT(flags) < w->step) { + flags &= ~RF_ALIGNMENT_MASK; + flags |= RF_ALIGNMENT_LOG2(w->step); + } + start &= ~wmask; + end |= wmask; + count = roundup2(count, 1ul << w->step); + rid = w->reg; + res = bus_alloc_resource(sc->dev, type, &rid, start, end, count, + flags & ~RF_ACTIVE); + if (res == NULL) + return (ENOSPC); + pcib_add_window_resources(w, &res, 1); + pcib_activate_window(sc, type); + w->base = rman_get_start(res); + w->limit = rman_get_end(res); + return (0); +} + +/* Try to expand an existing window to the requested base and limit. */ +static int +pcib_expand_window(struct pcib_softc *sc, struct pcib_window *w, int type, + u_long base, u_long limit) +{ + struct resource *res; + int error, i, force_64k_base; + + KASSERT(base <= w->base && limit >= w->limit, + ("attempting to shrink window")); + + /* + * XXX: pcib_grow_window() doesn't try to do this anyway and + * the error handling for all the edge cases would be tedious. + */ + KASSERT(limit == w->limit || base == w->base, + ("attempting to grow both ends of a window")); + + /* + * Yet more special handling for requests to expand an I/O + * window behind an ISA-enabled bridge. Since I/O windows + * have to grow in 0x1000 increments and the end of the 0xffff + * range is an alias, growing a window below 64k will always + * result in allocating new resources and never adjusting an + * existing resource. + */ + if (type == SYS_RES_IOPORT && sc->bridgectl & PCIB_BCR_ISA_ENABLE && + (limit <= 65535 || (base <= 65535 && base != w->base))) { + KASSERT(limit == w->limit || limit <= 65535, + ("attempting to grow both ends across 64k ISA alias")); + + if (base != w->base) + error = pcib_alloc_nonisa_ranges(sc, base, w->base - 1); + else + error = pcib_alloc_nonisa_ranges(sc, w->limit + 1, + limit); + if (error == 0) { + w->base = base; + w->limit = limit; + } + return (error); + } + + /* + * Find the existing resource to adjust. Usually there is only one, + * but for an ISA-enabled bridge we might be growing the I/O window + * above 64k and need to find the existing resource that maps all + * of the area above 64k. + */ + for (i = 0; i < w->count; i++) { + if (rman_get_end(w->res[i]) == w->limit) + break; + } + KASSERT(i != w->count, ("did not find existing resource")); + res = w->res[i]; + + /* + * Usually the resource we found should match the window's + * existing range. The one exception is the ISA-enabled case + * mentioned above in which case the resource should start at + * 64k. + */ + if (type == SYS_RES_IOPORT && sc->bridgectl & PCIB_BCR_ISA_ENABLE && + w->base <= 65535) { + KASSERT(rman_get_start(res) == 65536, + ("existing resource mismatch")); + force_64k_base = 1; + } else { + KASSERT(w->base == rman_get_start(res), + ("existing resource mismatch")); + force_64k_base = 0; + } + + error = bus_adjust_resource(sc->dev, type, res, force_64k_base ? + rman_get_start(res) : base, limit); + if (error) + return (error); + + /* Add the newly allocated region to the resource manager. */ + if (w->base != base) { + error = rman_manage_region(&w->rman, base, w->base - 1); + w->base = base; + } else { + error = rman_manage_region(&w->rman, w->limit + 1, limit); + w->limit = limit; + } + if (error) { + if (bootverbose) + device_printf(sc->dev, + "failed to expand %s resource manager\n", w->name); + (void)bus_adjust_resource(sc->dev, type, res, force_64k_base ? + rman_get_start(res) : w->base, w->limit); + } + return (error); +} + /* * Attempt to grow a window to make room for a given resource request. - * The 'step' parameter is log_2 of the desired I/O window's alignment. */ static int pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type, u_long start, u_long end, u_long count, u_int flags) { u_long align, start_free, end_free, front, back, wmask; - int error, rid; + int error; /* * Clamp the desired resource range to the maximum address * this window supports. Reject impossible requests. + * + * For I/O port requests behind a bridge with the ISA enable + * bit set, force large allocations to start above 64k. */ if (!w->valid) return (EINVAL); + if (sc->bridgectl & PCIB_BCR_ISA_ENABLE && count > 0x100 && + start < 65536) + start = 65536; if (end > w->rman.rm_end) end = w->rman.rm_end; if (start + count - 1 > end || start + count < start) @@ -845,40 +1199,19 @@ pcib_grow_window(struct pcib_softc *sc, * aligned space for this resource. */ if (w->res == NULL) { - if (RF_ALIGNMENT(flags) < w->step) { - flags &= ~RF_ALIGNMENT_MASK; - flags |= RF_ALIGNMENT_LOG2(w->step); - } - start &= ~wmask; - end |= wmask; - count = roundup2(count, 1ul << w->step); - rid = w->reg; - w->res = bus_alloc_resource(sc->dev, type, &rid, start, end, - count, flags & ~RF_ACTIVE); - if (w->res == NULL) { + error = pcib_alloc_new_window(sc, w, type, start, end, count, + flags); + if (error) { if (bootverbose) device_printf(sc->dev, "failed to allocate initial %s window (%#lx-%#lx,%#lx)\n", w->name, start, end, count); - return (ENXIO); + return (error); } if (bootverbose) device_printf(sc->dev, - "allocated initial %s window of %#lx-%#lx\n", - w->name, rman_get_start(w->res), - rman_get_end(w->res)); - error = rman_manage_region(&w->rman, rman_get_start(w->res), - rman_get_end(w->res)); - if (error) { - if (bootverbose) - device_printf(sc->dev, - "failed to add initial %s window to rman\n", - w->name); - bus_release_resource(sc->dev, type, w->reg, w->res); - w->res = NULL; - return (error); - } - pcib_activate_window(sc, type); + "allocated initial %s window of %#jx-%#jx\n", + w->name, (uintmax_t)w->base, (uintmax_t)w->limit); goto updatewin; } @@ -892,6 +1225,11 @@ pcib_grow_window(struct pcib_softc *sc, * edge of the window, grow from the inner edge of the free * region. Otherwise grow from the window boundary. * + * Growing an I/O window below 64k for a bridge with the ISA + * enable bit doesn't require any special magic as the step + * size of an I/O window (1k) always includes multiple + * non-alias ranges when it is grown in either direction. + * * XXX: Special case: if w->res is completely empty and the * request size is larger than w->res, we should find the * optimal aligned buffer containing w->res and allocate that. @@ -901,10 +1239,10 @@ pcib_grow_window(struct pcib_softc *sc, "attempting to grow %s window for (%#lx-%#lx,%#lx)\n", w->name, start, end, count); align = 1ul << RF_ALIGNMENT(flags); - if (start < rman_get_start(w->res)) { + if (start < w->base) { if (rman_first_free_region(&w->rman, &start_free, &end_free) != - 0 || start_free != rman_get_start(w->res)) - end_free = rman_get_start(w->res); + 0 || start_free != w->base) + end_free = w->base; if (end_free > end) end_free = end + 1; @@ -925,15 +1263,15 @@ pcib_grow_window(struct pcib_softc *sc, printf("\tfront candidate range: %#lx-%#lx\n", front, end_free); front &= ~wmask; - front = rman_get_start(w->res) - front; + front = w->base - front; } else front = 0; } else front = 0; - if (end > rman_get_end(w->res)) { + if (end > w->limit) { if (rman_last_free_region(&w->rman, &start_free, &end_free) != - 0 || end_free != rman_get_end(w->res)) - start_free = rman_get_end(w->res) + 1; + 0 || end_free != w->limit) + start_free = w->limit + 1; if (start_free < start) start_free = start; @@ -953,7 +1291,7 @@ pcib_grow_window(struct pcib_softc *sc, printf("\tback candidate range: %#lx-%#lx\n", start_free, back); back |= wmask; - back -= rman_get_end(w->res); + back -= w->limit; } else back = 0; } else @@ -966,16 +1304,14 @@ pcib_grow_window(struct pcib_softc *sc, error = ENOSPC; while (front != 0 || back != 0) { if (front != 0 && (front <= back || back == 0)) { - error = bus_adjust_resource(sc->dev, type, w->res, - rman_get_start(w->res) - front, - rman_get_end(w->res)); + error = pcib_expand_window(sc, w, type, w->base - front, + w->limit); if (error == 0) break; front = 0; } else { - error = bus_adjust_resource(sc->dev, type, w->res, - rman_get_start(w->res), - rman_get_end(w->res) + back); + error = pcib_expand_window(sc, w, type, w->base, + w->limit + back); if (error == 0) break; back = 0; @@ -985,32 +1321,11 @@ pcib_grow_window(struct pcib_softc *sc, if (error) return (error); if (bootverbose) - device_printf(sc->dev, "grew %s window to %#lx-%#lx\n", - w->name, rman_get_start(w->res), rman_get_end(w->res)); - - /* Add the newly allocated region to the resource manager. */ - if (w->base != rman_get_start(w->res)) { - KASSERT(w->limit == rman_get_end(w->res), ("both ends moved")); - error = rman_manage_region(&w->rman, rman_get_start(w->res), - w->base - 1); - } else { - KASSERT(w->limit != rman_get_end(w->res), - ("neither end moved")); - error = rman_manage_region(&w->rman, w->limit + 1, - rman_get_end(w->res)); - } - if (error) { - if (bootverbose) - device_printf(sc->dev, - "failed to expand %s resource manager\n", w->name); - bus_adjust_resource(sc->dev, type, w->res, w->base, w->limit); - return (error); - } + device_printf(sc->dev, "grew %s window to %#jx-%#jx\n", + w->name, (uintmax_t)w->base, (uintmax_t)w->limit); updatewin: - /* Save the new window. */ - w->base = rman_get_start(w->res); - w->limit = rman_get_end(w->res); + /* Write the new window. */ KASSERT((w->base & wmask) == 0, ("start address is not aligned")); KASSERT((w->limit & wmask) == wmask, ("end address is not aligned")); pcib_write_windows(sc, w->mask); @@ -1046,6 +1361,8 @@ pcib_alloc_resource(device_t dev, device switch (type) { case SYS_RES_IOPORT: + if (pcib_is_isa_range(sc, start, end, count)) + return (NULL); r = pcib_suballoc_resource(sc, &sc->io, child, type, rid, start, end, count, flags); if (r != NULL || (sc->flags & PCIB_SUBTRACTIVE) != 0) Modified: stable/9/sys/dev/pci/pci_private.h ============================================================================== --- stable/9/sys/dev/pci/pci_private.h Thu Oct 10 14:21:27 2013 (r256271) +++ stable/9/sys/dev/pci/pci_private.h Thu Oct 10 14:34:01 2013 (r256272) @@ -91,6 +91,8 @@ int pci_msix_count_method(device_t dev, struct resource *pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); +int pci_release_resource(device_t dev, device_t child, int type, + int rid, struct resource *r); int pci_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r); int pci_deactivate_resource(device_t dev, device_t child, int type, Modified: stable/9/sys/dev/pci/pcib_private.h ============================================================================== --- stable/9/sys/dev/pci/pcib_private.h Thu Oct 10 14:21:27 2013 (r256271) +++ stable/9/sys/dev/pci/pcib_private.h Thu Oct 10 14:34:01 2013 (r256272) @@ -73,7 +73,8 @@ struct pcib_window { pci_addr_t base; /* base address */ pci_addr_t limit; /* topmost address */ struct rman rman; - struct resource *res; + struct resource **res; + int count; /* size of 'res' array */ int reg; /* resource id from parent */ int valid; int mask; /* WIN_* bitmask of this window */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 15:44:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E4B0B19E; Thu, 10 Oct 2013 15:44:26 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [IPv6:2a00:1450:400c:c03::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0634525C4; Thu, 10 Oct 2013 15:44:25 +0000 (UTC) Received: by mail-we0-f173.google.com with SMTP id u57so2745585wes.4 for ; Thu, 10 Oct 2013 08:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=z9KUALDrYG98mPMmjNxUu0UH3Y/tkj393OjBQcvGfM0=; b=nz0d6oeN5ocFQ0ioHvut4/0srDcfSZY8c7gYlZMg455g8+S7/68LeHQdTP0cNUkIcD pJMSs0Uk+PaCyoA6bNP4IvCFqoNF+4TX7b2x1768lJGso4wYzoCiJZqemyxKQ67qvsUP bjLojzE2IZshJR9sS00cULscSV2yH+hAk4L1B/ERxvGJ2dC1kdXGxlWy+XY8YWFnbuZi VeSWxTzEfP/Wl5tlO4X2277tKBzINW7xOBeb6jkTvM2TJA985f3JoeFTDrJR8+g4xXik eMRAKNjBYEhjlIjzZfEj1EewQyPeFbFW6q1GZ3Yc7bxqCDiZE0veRD1BpfoXZyO2kTPd JOCw== MIME-Version: 1.0 X-Received: by 10.180.89.225 with SMTP id br1mr8410196wib.50.1381419864515; Thu, 10 Oct 2013 08:44:24 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.216.62.69 with HTTP; Thu, 10 Oct 2013 08:44:24 -0700 (PDT) In-Reply-To: <201202110602.q1B62Hx2015984@svn.freebsd.org> References: <201202110602.q1B62Hx2015984@svn.freebsd.org> Date: Thu, 10 Oct 2013 19:44:24 +0400 X-Google-Sender-Auth: O2J9l1_ItGqvX9YqH7lrzw2o1_w Message-ID: Subject: Re: svn commit: r231505 - in head: lib/libc/gen sys/net sys/sys From: Sergey Kandaurov To: "Bjoern A. Zeeb" 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, 10 Oct 2013 15:44:27 -0000 On 11 February 2012 10:02, Bjoern A. Zeeb wrote: > Author: bz > Date: Sat Feb 11 06:02:16 2012 > New Revision: 231505 > URL: http://svn.freebsd.org/changeset/base/231505 > > Log: > Introduce a new NET_RT_IFLISTL API to query the address list. It works > on extended and extensible structs if_msghdrl and ifa_msghdrl. This > will allow us to extend both the msghdrl structs and eventually if_data > in the future without breaking the ABI. There is some inconsistency between native and compat32 binaries wrt NET_RT_IFLISTL. I didn't investigate how it may affect userland utilities. [My limited debugging said me it does not.] > static int > +sysctl_iflist_ifml(struct ifnet *ifp, struct rt_addrinfo *info, > + struct walkarg *w, int len) > +{ > + struct if_msghdrl *ifm; > + > +#ifdef COMPAT_FREEBSD32 > + if (w->w_req->flags & SCTL_MASK32) { > + struct if_msghdrl32 *ifm32; > + > + ifm32 = (struct if_msghdrl32 *)w->w_tmem; > + ifm32->ifm_addrs = info->rti_addrs; > + ifm32->ifm_flags = ifp->if_flags | ifp->if_drv_flags; > + ifm32->ifm_index = ifp->if_index; > + ifm32->_ifm_spare1 = 0; > + ifm32->ifm_len = sizeof(*ifm32); > + ifm32->ifm_data_off = offsetof(struct if_msghdrl32, ifm_data); > + > + copy_ifdata32(&ifp->if_data, &ifm32->ifm_data); > + /* Fixup if_data carp(4) vhid. */ > + if (carp_get_vhid_p != NULL) > + ifm32->ifm_data.ifi_vhid = > + (*carp_get_vhid_p)(ifp->if_addr); > + > + return (SYSCTL_OUT(w->w_req, (caddr_t)ifm32, len)); > + } > +#endif > + ifm = (struct if_msghdrl *)w->w_tmem; > + ifm->ifm_addrs = info->rti_addrs; > + ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; > + ifm->ifm_index = ifp->if_index; > + ifm->_ifm_spare1 = 0; > + ifm->ifm_len = sizeof(*ifm); > + ifm->ifm_data_off = offsetof(struct if_msghdrl, ifm_data); > + > + ifm->ifm_data = ifp->if_data; > + /* Fixup if_data carp(4) vhid. */ > + if (carp_get_vhid_p != NULL) > + ifm->ifm_data.ifi_vhid = (*carp_get_vhid_p)(ifp->if_addr); > + > + return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); > +} This function consistently uses ifp->if_data to fill ifm_data. But please see below. > + > +static int > +sysctl_iflist_ifm(struct ifnet *ifp, struct rt_addrinfo *info, > + struct walkarg *w, int len) > +{ > + struct if_msghdr *ifm; > + > +#ifdef COMPAT_FREEBSD32 > + if (w->w_req->flags & SCTL_MASK32) { > + struct if_msghdr32 *ifm32; > + > + ifm32 = (struct if_msghdr32 *)w->w_tmem; > + ifm32->ifm_addrs = info->rti_addrs; > + ifm32->ifm_flags = ifp->if_flags | ifp->if_drv_flags; > + ifm32->ifm_index = ifp->if_index; > + > + copy_ifdata32(&ifp->if_data, &ifm32->ifm_data); > + /* Fixup if_data carp(4) vhid. */ > + if (carp_get_vhid_p != NULL) > + ifm32->ifm_data.ifi_vhid = > + (*carp_get_vhid_p)(ifp->if_addr); > + > + return (SYSCTL_OUT(w->w_req, (caddr_t)ifm32, len)); > + } > +#endif > + ifm = (struct if_msghdr *)w->w_tmem; > + ifm->ifm_addrs = info->rti_addrs; > + ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; > + ifm->ifm_index = ifp->if_index; > + > + ifm->ifm_data = ifp->if_data; > + /* Fixup if_data carp(4) vhid. */ > + if (carp_get_vhid_p != NULL) > + ifm->ifm_data.ifi_vhid = (*carp_get_vhid_p)(ifp->if_addr); > + > + return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); > +} Ditto. > + > +static int > +sysctl_iflist_ifaml(struct ifaddr *ifa, struct rt_addrinfo *info, > + struct walkarg *w, int len) > +{ > + struct ifa_msghdrl *ifam; > + > +#ifdef COMPAT_FREEBSD32 > + if (w->w_req->flags & SCTL_MASK32) { > + struct ifa_msghdrl32 *ifam32; > + > + ifam32 = (struct ifa_msghdrl32 *)w->w_tmem; > + ifam32->ifam_addrs = info->rti_addrs; > + ifam32->ifam_flags = ifa->ifa_flags; > + ifam32->ifam_index = ifa->ifa_ifp->if_index; > + ifam32->_ifam_spare1 = 0; > + ifam32->ifam_len = sizeof(*ifam32); > + ifam32->ifam_data_off = > + offsetof(struct ifa_msghdrl32, ifam_data); > + ifam32->ifam_metric = ifa->ifa_metric; > + > + copy_ifdata32(&ifa->ifa_ifp->if_data, &ifam32->ifam_data); > + /* Fixup if_data carp(4) vhid. */ > + if (carp_get_vhid_p != NULL) > + ifam32->ifam_data.ifi_vhid = (*carp_get_vhid_p)(ifa); > + > + return (SYSCTL_OUT(w->w_req, (caddr_t)ifam32, len)); > + } > +#endif > + > + ifam = (struct ifa_msghdrl *)w->w_tmem; > + ifam->ifam_addrs = info->rti_addrs; > + ifam->ifam_flags = ifa->ifa_flags; > + ifam->ifam_index = ifa->ifa_ifp->if_index; > + ifam->_ifam_spare1 = 0; > + ifam->ifam_len = sizeof(*ifam); > + ifam->ifam_data_off = offsetof(struct ifa_msghdrl, ifam_data); > + ifam->ifam_metric = ifa->ifa_metric; > + > + ifam->ifam_data = ifa->if_data; > + /* Fixup if_data carp(4) vhid. */ > + if (carp_get_vhid_p != NULL) > + ifam->ifam_data.ifi_vhid = (*carp_get_vhid_p)(ifa); > + > + return (SYSCTL_OUT(w->w_req, w->w_tmem, len)); > +} This function uses ifa->if_data to fill ifam_data for native binaries, and ifa->ifa_ifp->if_data for compat32. AFAIK they may not match. -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 16:11:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 48D33BA8; Thu, 10 Oct 2013 16:11:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1DA9927DF; Thu, 10 Oct 2013 16:11:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AGBYDu019924; Thu, 10 Oct 2013 16:11:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AGBYi8019923; Thu, 10 Oct 2013 16:11:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310101611.r9AGBYi8019923@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Oct 2013 16:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256274 - 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, 10 Oct 2013 16:11:35 -0000 Author: jhb Date: Thu Oct 10 16:11:34 2013 New Revision: 256274 URL: http://svnweb.freebsd.org/changeset/base/256274 Log: Ignore attempts to set the nmbcluster sysctls to their current value rather than failing with an error. Reviewed by: andre Approved by: re (delphij) MFC after: 2 weeks Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Thu Oct 10 15:39:02 2013 (r256273) +++ head/sys/kern/kern_mbuf.c Thu Oct 10 16:11:34 2013 (r256274) @@ -161,7 +161,7 @@ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) newnmbclusters = nmbclusters; error = sysctl_handle_int(oidp, &newnmbclusters, 0, req); - if (error == 0 && req->newptr) { + if (error == 0 && req->newptr && newnmbclusters != nmbclusters) { if (newnmbclusters > nmbclusters && nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { nmbclusters = newnmbclusters; @@ -183,7 +183,7 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS) newnmbjumbop = nmbjumbop; error = sysctl_handle_int(oidp, &newnmbjumbop, 0, req); - if (error == 0 && req->newptr) { + if (error == 0 && req->newptr && newnmbjumbop != nmbjumbop) { if (newnmbjumbop > nmbjumbop && nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { nmbjumbop = newnmbjumbop; @@ -204,7 +204,7 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) newnmbjumbo9 = nmbjumbo9; error = sysctl_handle_int(oidp, &newnmbjumbo9, 0, req); - if (error == 0 && req->newptr) { + if (error == 0 && req->newptr && newnmbjumbo9 != nmbjumbo9) { if (newnmbjumbo9 > nmbjumbo9 && nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { nmbjumbo9 = newnmbjumbo9; @@ -225,7 +225,7 @@ sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS) newnmbjumbo16 = nmbjumbo16; error = sysctl_handle_int(oidp, &newnmbjumbo16, 0, req); - if (error == 0 && req->newptr) { + if (error == 0 && req->newptr && newnmbjumbo16 != nmbjumbo16) { if (newnmbjumbo16 > nmbjumbo16 && nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { nmbjumbo16 = newnmbjumbo16; @@ -246,7 +246,7 @@ sysctl_nmbufs(SYSCTL_HANDLER_ARGS) newnmbufs = nmbufs; error = sysctl_handle_int(oidp, &newnmbufs, 0, req); - if (error == 0 && req->newptr) { + if (error == 0 && req->newptr && newnmbufs != nmbufs) { if (newnmbufs > nmbufs) { nmbufs = newnmbufs; nmbufs = uma_zone_set_max(zone_mbuf, nmbufs); From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 16:11:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 32023CDA; Thu, 10 Oct 2013 16:11:46 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E92327E3; Thu, 10 Oct 2013 16:11:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AGBjTZ020020; Thu, 10 Oct 2013 16:11:45 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AGBj7s020019; Thu, 10 Oct 2013 16:11:45 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201310101611.r9AGBj7s020019@svn.freebsd.org> From: Alan Cox Date: Thu, 10 Oct 2013 16:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256275 - 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: Thu, 10 Oct 2013 16:11:46 -0000 Author: alc Date: Thu Oct 10 16:11:45 2013 New Revision: 256275 URL: http://svnweb.freebsd.org/changeset/base/256275 Log: Tidy up the output of "sysctl vm.phys_free". Approved by: re (glebius) Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Thu Oct 10 16:11:34 2013 (r256274) +++ head/sys/vm/vm_phys.c Thu Oct 10 16:11:45 2013 (r256275) @@ -161,9 +161,9 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS) return (error); sbuf_new_for_sysctl(&sbuf, NULL, 128 * vm_ndomains, req); for (dom = 0; dom < vm_ndomains; dom++) { - sbuf_printf(&sbuf,"DOMAIN: %d\n", dom); + sbuf_printf(&sbuf,"\nDOMAIN %d:\n", dom); for (flind = 0; flind < vm_nfreelists; flind++) { - sbuf_printf(&sbuf, "FREE LIST %d:\n" + sbuf_printf(&sbuf, "\nFREE LIST %d:\n" "\n ORDER (SIZE) | NUMBER" "\n ", flind); for (pind = 0; pind < VM_NFREEPOOL; pind++) @@ -177,14 +177,12 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS) 1 << (PAGE_SHIFT - 10 + oind)); for (pind = 0; pind < VM_NFREEPOOL; pind++) { fl = vm_phys_free_queues[dom][flind][pind]; - sbuf_printf(&sbuf, " | %6.6d", + sbuf_printf(&sbuf, " | %6d", fl[oind].lcnt); } sbuf_printf(&sbuf, "\n"); } - sbuf_printf(&sbuf, "\n"); } - sbuf_printf(&sbuf, "\n"); } error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 16:25:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 320D63DC; Thu, 10 Oct 2013 16:25:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1DD0928DE; Thu, 10 Oct 2013 16:25:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AGPs8i026767; Thu, 10 Oct 2013 16:25:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AGPruq026761; Thu, 10 Oct 2013 16:25:53 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310101625.r9AGPruq026761@svn.freebsd.org> From: Dimitry Andric Date: Thu, 10 Oct 2013 16:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256276 - in head/sys/dev/hyperv: storvsc vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 16:25:55 -0000 Author: dim Date: Thu Oct 10 16:25:53 2013 New Revision: 256276 URL: http://svnweb.freebsd.org/changeset/base/256276 Log: In sys/dev/hyperv, fix a number of gcc warnings about usage of anonymous union members in strict C99, by giving them names. While here, add some FreeBSD keywords where they were missing. Approved by: re (gjb) Reviewed by: grehan Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/hyperv/storvsc/hv_vstorage.h head/sys/dev/hyperv/vmbus/hv_channel.c head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Oct 10 16:11:45 2013 (r256275) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Oct 10 16:25:53 2013 (r256276) @@ -32,6 +32,8 @@ * converted into VSCSI protocol messages which are delivered to the parent * partition StorVSP driver over the Hyper-V VMBUS. */ +#include +__FBSDID("$FreeBSD$"); #include #include @@ -322,10 +324,10 @@ hv_storvsc_channel_init(struct hv_device vstor_packet->operation = VSTOR_OPERATION_QUERYPROTOCOLVERSION; vstor_packet->flags = REQUEST_COMPLETION_FLAG; - vstor_packet->version.major_minor = VMSTOR_PROTOCOL_VERSION_CURRENT; + vstor_packet->u.version.major_minor = VMSTOR_PROTOCOL_VERSION_CURRENT; /* revision is only significant for Windows guests */ - vstor_packet->version.revision = 0; + vstor_packet->u.version.revision = 0; ret = hv_vmbus_channel_send_packet( dev->channel, @@ -532,11 +534,11 @@ hv_storvsc_io_request(struct hv_device * vstor_packet->flags |= REQUEST_COMPLETION_FLAG; - vstor_packet->vm_srb.length = sizeof(struct vmscsi_req); + vstor_packet->u.vm_srb.length = sizeof(struct vmscsi_req); - vstor_packet->vm_srb.sense_info_len = SENSE_BUFFER_SIZE; + vstor_packet->u.vm_srb.sense_info_len = SENSE_BUFFER_SIZE; - vstor_packet->vm_srb.transfer_len = request->data_buf.length; + vstor_packet->u.vm_srb.transfer_len = request->data_buf.length; vstor_packet->operation = VSTOR_OPERATION_EXECUTESRB; @@ -583,7 +585,7 @@ hv_storvsc_on_iocompletion(struct storvs { struct vmscsi_req *vm_srb; - vm_srb = &vstor_packet->vm_srb; + vm_srb = &vstor_packet->u.vm_srb; request->sense_info_len = 0; if (((vm_srb->scsi_status & 0xFF) == SCSI_STATUS_CHECK_COND) && @@ -594,7 +596,7 @@ hv_storvsc_on_iocompletion(struct storvs ("vm_srb->sense_info_len <= " "request->sense_info_len")); - memcpy(request->sense_data, vm_srb->sense_data, + memcpy(request->sense_data, vm_srb->u.sense_data, vm_srb->sense_info_len); request->sense_info_len = vm_srb->sense_info_len; @@ -1298,35 +1300,35 @@ create_storvsc_request(union ccb *ccb, s uint32_t pfn; /* refer to struct vmscsi_req for meanings of these two fields */ - reqp->vstor_packet.vm_srb.port = + reqp->vstor_packet.u.vm_srb.port = cam_sim_unit(xpt_path_sim(ccb->ccb_h.path)); - reqp->vstor_packet.vm_srb.path_id = + reqp->vstor_packet.u.vm_srb.path_id = cam_sim_bus(xpt_path_sim(ccb->ccb_h.path)); - reqp->vstor_packet.vm_srb.target_id = ccb->ccb_h.target_id; - reqp->vstor_packet.vm_srb.lun = ccb->ccb_h.target_lun; + reqp->vstor_packet.u.vm_srb.target_id = ccb->ccb_h.target_id; + reqp->vstor_packet.u.vm_srb.lun = ccb->ccb_h.target_lun; - reqp->vstor_packet.vm_srb.cdb_len = csio->cdb_len; + reqp->vstor_packet.u.vm_srb.cdb_len = csio->cdb_len; if(ccb->ccb_h.flags & CAM_CDB_POINTER) { - memcpy(&reqp->vstor_packet.vm_srb.cdb, csio->cdb_io.cdb_ptr, + memcpy(&reqp->vstor_packet.u.vm_srb.u.cdb, csio->cdb_io.cdb_ptr, csio->cdb_len); } else { - memcpy(&reqp->vstor_packet.vm_srb.cdb, csio->cdb_io.cdb_bytes, + memcpy(&reqp->vstor_packet.u.vm_srb.u.cdb, csio->cdb_io.cdb_bytes, csio->cdb_len); } switch (ccb->ccb_h.flags & CAM_DIR_MASK) { case CAM_DIR_OUT: - reqp->vstor_packet.vm_srb.data_in = WRITE_TYPE; + reqp->vstor_packet.u.vm_srb.data_in = WRITE_TYPE; break; case CAM_DIR_IN: - reqp->vstor_packet.vm_srb.data_in = READ_TYPE; + reqp->vstor_packet.u.vm_srb.data_in = READ_TYPE; break; case CAM_DIR_NONE: - reqp->vstor_packet.vm_srb.data_in = UNKNOWN_TYPE; + reqp->vstor_packet.u.vm_srb.data_in = UNKNOWN_TYPE; break; default: - reqp->vstor_packet.vm_srb.data_in = UNKNOWN_TYPE; + reqp->vstor_packet.u.vm_srb.data_in = UNKNOWN_TYPE; break; } @@ -1375,7 +1377,7 @@ storvsc_io_done(struct hv_storvsc_reques union ccb *ccb = reqp->ccb; struct ccb_scsiio *csio = &ccb->csio; struct storvsc_softc *sc = reqp->softc; - struct vmscsi_req *vm_srb = &reqp->vstor_packet.vm_srb; + struct vmscsi_req *vm_srb = &reqp->vstor_packet.u.vm_srb; if (reqp->retries > 0) { mtx_lock(&sc->hs_lock); Modified: head/sys/dev/hyperv/storvsc/hv_vstorage.h ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_vstorage.h Thu Oct 10 16:11:45 2013 (r256275) +++ head/sys/dev/hyperv/storvsc/hv_vstorage.h Thu Oct 10 16:25:53 2013 (r256276) @@ -24,6 +24,8 @@ * 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 __HV_VSTORAGE_H__ @@ -107,7 +109,7 @@ struct vmscsi_req { uint8_t sense_data[SENSE_BUFFER_SIZE]; uint8_t reserved_array[MAX_DATA_BUFFER_LENGTH_WITH_PADDING]; - }; + } u; } __packed; @@ -191,7 +193,7 @@ struct vstor_packet { * Used during version negotiations. */ struct vmstor_proto_ver version; - }; + } u; } __packed; Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Thu Oct 10 16:11:45 2013 (r256275) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Thu Oct 10 16:25:53 2013 (r256276) @@ -26,6 +26,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -70,7 +73,7 @@ vmbus_channel_set_event(hv_vmbus_channel synch_set_bit(channel->monitor_bit, (uint32_t *)&monitor_page-> - trigger_group[channel->monitor_group].pending); + trigger_group[channel->monitor_group].u.pending); } else { hv_vmbus_set_event(channel->offer_msg.child_rel_id); } Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Thu Oct 10 16:11:45 2013 (r256275) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Thu Oct 10 16:25:53 2013 (r256276) @@ -240,8 +240,8 @@ hv_vmbus_init(void) if (virt_addr == NULL) goto cleanup; - hypercall_msr.enable = 1; - hypercall_msr.guest_physical_address = + hypercall_msr.u.enable = 1; + hypercall_msr.u.guest_physical_address = (hv_get_phys_addr(virt_addr) >> PAGE_SHIFT); wrmsr(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64_t); @@ -251,7 +251,7 @@ hv_vmbus_init(void) hypercall_msr.as_uint64_t = 0; hypercall_msr.as_uint64_t = rdmsr(HV_X64_MSR_HYPERCALL); - if (!hypercall_msr.enable) + if (!hypercall_msr.u.enable) goto cleanup; hv_vmbus_g_context.hypercall_page = virt_addr; @@ -284,7 +284,7 @@ hv_vmbus_init(void) cleanup: if (virt_addr != NULL) { - if (hypercall_msr.enable) { + if (hypercall_msr.u.enable) { hypercall_msr.as_uint64_t = 0; wrmsr(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64_t); @@ -426,8 +426,8 @@ hv_vmbus_synic_init(void *arg) */ simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP); - simp.simp_enabled = 1; - simp.base_simp_gpa = ((hv_get_phys_addr( + simp.u.simp_enabled = 1; + simp.u.base_simp_gpa = ((hv_get_phys_addr( hv_vmbus_g_context.syn_ic_msg_page[cpu])) >> PAGE_SHIFT); wrmsr(HV_X64_MSR_SIMP, simp.as_uint64_t); @@ -436,23 +436,23 @@ hv_vmbus_synic_init(void *arg) * Setup the Synic's event page */ siefp.as_uint64_t = rdmsr(HV_X64_MSR_SIEFP); - siefp.siefp_enabled = 1; - siefp.base_siefp_gpa = ((hv_get_phys_addr( + siefp.u.siefp_enabled = 1; + siefp.u.base_siefp_gpa = ((hv_get_phys_addr( hv_vmbus_g_context.syn_ic_event_page[cpu])) >> PAGE_SHIFT); wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); /*HV_SHARED_SINT_IDT_VECTOR + 0x20; */ - shared_sint.vector = setup_args->vector; - shared_sint.masked = FALSE; - shared_sint.auto_eoi = FALSE; + shared_sint.u.vector = setup_args->vector; + shared_sint.u.masked = FALSE; + shared_sint.u.auto_eoi = FALSE; wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT, shared_sint.as_uint64_t); /* Enable the global synic bit */ sctrl.as_uint64_t = rdmsr(HV_X64_MSR_SCONTROL); - sctrl.enable = 1; + sctrl.u.enable = 1; wrmsr(HV_X64_MSR_SCONTROL, sctrl.as_uint64_t); @@ -480,7 +480,7 @@ void hv_vmbus_synic_cleanup(void *arg) shared_sint.as_uint64_t = rdmsr( HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT); - shared_sint.masked = 1; + shared_sint.u.masked = 1; /* * Disable the interrupt @@ -490,14 +490,14 @@ void hv_vmbus_synic_cleanup(void *arg) shared_sint.as_uint64_t); simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP); - simp.simp_enabled = 0; - simp.base_simp_gpa = 0; + simp.u.simp_enabled = 0; + simp.u.base_simp_gpa = 0; wrmsr(HV_X64_MSR_SIMP, simp.as_uint64_t); siefp.as_uint64_t = rdmsr(HV_X64_MSR_SIEFP); - siefp.siefp_enabled = 0; - siefp.base_siefp_gpa = 0; + siefp.u.siefp_enabled = 0; + siefp.u.base_siefp_gpa = 0; wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); } Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Oct 10 16:11:45 2013 (r256275) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Oct 10 16:25:53 2013 (r256276) @@ -29,6 +29,8 @@ /* * VM Bus Driver Implementation */ +#include +__FBSDID("$FreeBSD$"); #include #include @@ -113,7 +115,7 @@ vmbus_msg_swintr(void *dummy) */ wmb(); - if (msg->header.message_flags.message_pending) { + if (msg->header.message_flags.u.message_pending) { /* * This will cause message queue rescan to possibly * deliver another msg from the hypervisor Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Oct 10 16:11:45 2013 (r256275) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Oct 10 16:25:53 2013 (r256276) @@ -24,6 +24,8 @@ * 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 __HYPERV_PRIV_H__ @@ -285,7 +287,7 @@ typedef union { struct { uint8_t message_pending:1; uint8_t reserved:7; - }; + } u; } hv_vmbus_msg_flags; typedef uint64_t hv_vmbus_partition_id; @@ -393,7 +395,7 @@ typedef union { */ uint64_t os_id : 8; uint64_t vendor_id : 16; - }; + } u; } hv_vmbus_x64_msr_guest_os_id_contents; /* @@ -407,7 +409,7 @@ typedef union { uint64_t enable :1; uint64_t reserved :11; uint64_t guest_physical_address :52; - }; + } u; } hv_vmbus_x64_msr_hypercall_contents; typedef union { @@ -415,7 +417,7 @@ typedef union { struct { uint32_t group_enable :4; uint32_t rsvd_z :28; - }; + } u; } hv_vmbus_monitor_trigger_state; typedef union { @@ -423,7 +425,7 @@ typedef union { struct { uint32_t pending; uint32_t armed; - }; + } u; } hv_vmbus_monitor_trigger_group; typedef struct { @@ -499,7 +501,7 @@ typedef union { uint64_t simp_enabled : 1; uint64_t preserved : 11; uint64_t base_simp_gpa : 52; - }; + } u; } hv_vmbus_synic_simp; /* @@ -511,7 +513,7 @@ typedef union { uint64_t siefp_enabled : 1; uint64_t preserved : 11; uint64_t base_siefp_gpa : 52; - }; + } u; } hv_vmbus_synic_siefp; /* @@ -525,7 +527,7 @@ typedef union { uint64_t masked : 1; uint64_t auto_eoi : 1; uint64_t reserved2 : 46; - }; + } u; } hv_vmbus_synic_sint; /* @@ -536,7 +538,7 @@ typedef union _hv_vmbus_synic_scontrol { struct { uint64_t enable : 1; uint64_t reserved : 63; - }; + } u; } hv_vmbus_synic_scontrol; /* From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 17:39:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 434E71F3; Thu, 10 Oct 2013 17:39:40 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 30B9F2E3D; Thu, 10 Oct 2013 17:39:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AHde7u063754; Thu, 10 Oct 2013 17:39:40 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AHdeed063753; Thu, 10 Oct 2013 17:39:40 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310101739.r9AHdeed063753@svn.freebsd.org> From: Glen Barber Date: Thu, 10 Oct 2013 17:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256279 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 17:39:40 -0000 Author: gjb Date: Thu Oct 10 17:39:39 2013 New Revision: 256279 URL: http://svnweb.freebsd.org/changeset/base/256279 Log: Update head/ to ALPHA6 in preparation of branching to stable/10. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu Oct 10 16:46:02 2013 (r256278) +++ head/sys/conf/newvers.sh Thu Oct 10 17:39:39 2013 (r256279) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.0" -BRANCH="ALPHA5" +BRANCH="ALPHA6" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 17:41:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E30EE5C1; Thu, 10 Oct 2013 17:41:41 +0000 (UTC) (envelope-from edavis@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF2682E8D; Thu, 10 Oct 2013 17:41:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AHffVJ066550; Thu, 10 Oct 2013 17:41:41 GMT (envelope-from edavis@svn.freebsd.org) Received: (from edavis@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AHff9B066549; Thu, 10 Oct 2013 17:41:41 GMT (envelope-from edavis@svn.freebsd.org) Message-Id: <201310101741.r9AHff9B066549@svn.freebsd.org> From: Eric Davis Date: Thu, 10 Oct 2013 17:41:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256280 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 17:41:42 -0000 Author: edavis Date: Thu Oct 10 17:41:41 2013 New Revision: 256280 URL: http://svnweb.freebsd.org/changeset/base/256280 Log: New committer info. Approved by: re@ (gjb) Approved by: davidch (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Oct 10 17:39:39 2013 (r256279) +++ head/share/misc/committers-src.dot Thu Oct 10 17:41:41 2013 (r256280) @@ -145,6 +145,7 @@ dumbbell [label="Jean-Sebastien Pedron\n dwmalone [label="David Malone\ndwmalone@FreeBSD.org\n2000/07/11"] eadler [label="Eitan Adler\neadler@FreeBSD.org\n2012/01/18"] ed [label="Ed Schouten\ned@FreeBSD.org\n2008/05/22"] +edavis [label="Eric Davis\nedavis@FreeBSD.org\n2013/10/09"] edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2007/06/25"] eivind [label="Eivind Eklund\neivind@FreeBSD.org\n1997/02/02"] emaste [label="Ed Maste\nemaste@FreeBSD.org\n2005/10/04"] From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 17:56:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BD924D3F; Thu, 10 Oct 2013 17:56:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8E5232F70; Thu, 10 Oct 2013 17:56:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AHuUfm072191; Thu, 10 Oct 2013 17:56:30 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AHuUMS072190; Thu, 10 Oct 2013 17:56:30 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310101756.r9AHuUMS072190@svn.freebsd.org> From: Glen Barber Date: Thu, 10 Oct 2013 17:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org Subject: svn commit: r256281 - stable/10 X-SVN-Group: defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 17:56:30 -0000 Author: gjb Date: Thu Oct 10 17:56:30 2013 New Revision: 256281 URL: http://svnweb.freebsd.org/changeset/base/256281 Log: Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Added: stable/10/ - copied from r256279, head/ From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 17:59: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8FA9BFE3; Thu, 10 Oct 2013 17:59:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D96C2F97; Thu, 10 Oct 2013 17:59:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AHxl6l073139; Thu, 10 Oct 2013 17:59:47 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AHxjFW073106; Thu, 10 Oct 2013 17:59:45 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310101759.r9AHxjFW073106@svn.freebsd.org> From: Glen Barber Date: Thu, 10 Oct 2013 17:59:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org Subject: svn commit: r256283 - in stable/10: . contrib/jemalloc/include/jemalloc etc/defaults sys/amd64/conf sys/i386/conf sys/ia64/conf sys/powerpc/conf sys/sparc64/conf sys/sys X-SVN-Group: defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 17:59:47 -0000 Author: gjb Date: Thu Oct 10 17:59:44 2013 New Revision: 256283 URL: http://svnweb.freebsd.org/changeset/base/256283 Log: - Remove debugging from GENERIC* kernel configurations - Enable MALLOC_PRODUCTION - Default dumpdev=NO - Remove UPDATING entry regarding debugging features - Bump __FreeBSD_version to 1000500 Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/UPDATING stable/10/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h stable/10/etc/defaults/rc.conf stable/10/sys/amd64/conf/GENERIC stable/10/sys/i386/conf/GENERIC stable/10/sys/ia64/conf/GENERIC stable/10/sys/powerpc/conf/GENERIC stable/10/sys/powerpc/conf/GENERIC64 stable/10/sys/sparc64/conf/GENERIC stable/10/sys/sys/param.h Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Thu Oct 10 17:58:10 2013 (r256282) +++ stable/10/UPDATING Thu Oct 10 17:59:44 2013 (r256283) @@ -13,24 +13,9 @@ Items affecting the ports and packages s NOTE: FreeBSD has switched from gcc to clang. If you have trouble bootstrapping from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to the tip of -head, and then rebuild without this option. The bootstrap process from +stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. -NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW: - FreeBSD 10.x has many debugging features turned on, in both the kernel - and userland. These features attempt to detect incorrect use of - system primitives, and encourage loud failure through extra sanity - checking and fail stop semantics. They also substantially impact - system performance. If you want to do performance measurement, - benchmarking, and optimization, you'll want to turn them off. This - includes various WITNESS- related kernel options, INVARIANTS, malloc - debugging flags in userland, and various verbose features in the - kernel. Many developers choose to disable these features on build - machines to maximize performance. (To completely disable malloc - debugging, define MALLOC_PRODUCTION in /etc/make.conf, or to merely - disable the most expensive debugging functionality run - "ln -s 'abort:false,junk:false' /etc/malloc.conf".) - 20131010: The rc.d/jail script has been updated to support jail(8) configuration file. The "jail__*" rc.conf(5) variables Modified: stable/10/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- stable/10/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Oct 10 17:58:10 2013 (r256282) +++ stable/10/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Oct 10 17:59:44 2013 (r256283) @@ -4,6 +4,8 @@ #undef JEMALLOC_OVERRIDE_VALLOC +#define MALLOC_PRODUCTION + #ifndef MALLOC_PRODUCTION #define JEMALLOC_DEBUG #endif Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Thu Oct 10 17:58:10 2013 (r256282) +++ stable/10/etc/defaults/rc.conf Thu Oct 10 17:59:44 2013 (r256283) @@ -604,7 +604,7 @@ lpd_flags="" # Flags to lpd (if enabled nscd_enable="NO" # Run the nsswitch caching daemon. chkprintcap_enable="NO" # Run chkprintcap(8) before running lpd. chkprintcap_flags="-d" # Create missing directories by default. -dumpdev="AUTO" # Device to crashdump to (device name, AUTO, or NO). +dumpdev="NO" # Device to crashdump to (device name, AUTO, or NO). dumpdir="/var/crash" # Directory where crash dumps are to be stored savecore_flags="-m 10" # Used if dumpdev is enabled above, and present. # By default, only the 10 most recent kernel dumps Modified: stable/10/sys/amd64/conf/GENERIC ============================================================================== --- stable/10/sys/amd64/conf/GENERIC Thu Oct 10 17:58:10 2013 (r256282) +++ stable/10/sys/amd64/conf/GENERIC Thu Oct 10 17:59:44 2013 (r256283) @@ -77,15 +77,6 @@ options XENHVM # Include Xen support # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB. -options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: stable/10/sys/i386/conf/GENERIC ============================================================================== --- stable/10/sys/i386/conf/GENERIC Thu Oct 10 17:58:10 2013 (r256282) +++ stable/10/sys/i386/conf/GENERIC Thu Oct 10 17:59:44 2013 (r256283) @@ -77,15 +77,6 @@ options XENHVM # Include Xen support # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB. -options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # To make an SMP kernel, the next two lines are needed options SMP # Symmetric MultiProcessor Kernel Modified: stable/10/sys/ia64/conf/GENERIC ============================================================================== --- stable/10/sys/ia64/conf/GENERIC Thu Oct 10 17:58:10 2013 (r256282) +++ stable/10/sys/ia64/conf/GENERIC Thu Oct 10 17:59:44 2013 (r256283) @@ -67,15 +67,6 @@ options _KPOSIX_PRIORITY_SCHEDULING # P # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB -options GDB # Support remote GDB -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # Various "busses" device miibus # MII bus support (Ethernet) Modified: stable/10/sys/powerpc/conf/GENERIC ============================================================================== --- stable/10/sys/powerpc/conf/GENERIC Thu Oct 10 17:58:10 2013 (r256282) +++ stable/10/sys/powerpc/conf/GENERIC Thu Oct 10 17:59:44 2013 (r256283) @@ -79,14 +79,6 @@ options INCLUDE_CONFIG_FILE # Inclu # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB #Support DDB -#options DEADLKRES #Enable the deadlock resolver -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS #Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: stable/10/sys/powerpc/conf/GENERIC64 ============================================================================== --- stable/10/sys/powerpc/conf/GENERIC64 Thu Oct 10 17:58:10 2013 (r256282) +++ stable/10/sys/powerpc/conf/GENERIC64 Thu Oct 10 17:59:44 2013 (r256283) @@ -76,14 +76,6 @@ options INCLUDE_CONFIG_FILE # Inclu # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB #Support DDB -#options DEADLKRES #Enable the deadlock resolver -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS #Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: stable/10/sys/sparc64/conf/GENERIC ============================================================================== --- stable/10/sys/sparc64/conf/GENERIC Thu Oct 10 17:58:10 2013 (r256282) +++ stable/10/sys/sparc64/conf/GENERIC Thu Oct 10 17:59:44 2013 (r256283) @@ -70,15 +70,6 @@ options INCLUDE_CONFIG_FILE # Include t # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB. -options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Thu Oct 10 17:58:10 2013 (r256282) +++ stable/10/sys/sys/param.h Thu Oct 10 17:59:44 2013 (r256283) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000055 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000500 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 18:05: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 476C02BE; Thu, 10 Oct 2013 18:05:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 32ED72003; Thu, 10 Oct 2013 18:05:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AI5F1g077826; Thu, 10 Oct 2013 18:05:15 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AI5Emr077816; Thu, 10 Oct 2013 18:05:14 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310101805.r9AI5Emr077816@svn.freebsd.org> From: Glen Barber Date: Thu, 10 Oct 2013 18:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256284 - in head: . etc/defaults gnu/usr.bin/groff/tmac sys/conf 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, 10 Oct 2013 18:05:15 -0000 Author: gjb Date: Thu Oct 10 18:05:13 2013 New Revision: 256284 URL: http://svnweb.freebsd.org/changeset/base/256284 Log: Turn it all the way up to 11: - Update FreeBSD version in: - UPDATING - sys/conf/newvers.sh - Add 11.0 FreeBSD version for manual pages - Bump __FreeBSD_version to 1100000 Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/UPDATING head/etc/defaults/periodic.conf head/gnu/usr.bin/groff/tmac/mdoc.local head/sys/conf/newvers.sh head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Oct 10 17:59:44 2013 (r256283) +++ head/UPDATING Thu Oct 10 18:05:13 2013 (r256284) @@ -16,8 +16,8 @@ from older versions of FreeBSD, try WITH head, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. -NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW: - FreeBSD 10.x has many debugging features turned on, in both the kernel +NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW: + FreeBSD 11.x has many debugging features turned on, in both the kernel and userland. These features attempt to detect incorrect use of system primitives, and encourage loud failure through extra sanity checking and fail stop semantics. They also substantially impact Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Thu Oct 10 17:59:44 2013 (r256283) +++ head/etc/defaults/periodic.conf Thu Oct 10 18:05:13 2013 (r256284) @@ -190,7 +190,7 @@ weekly_noid_dirs="/" # Look here # 400.status-pkg weekly_status_pkg_enable="NO" # Find out-of-date pkgs pkg_version=pkg_version # Use this program -pkg_version_index=/usr/ports/INDEX-10 # Use this index file +pkg_version_index=/usr/ports/INDEX-11 # Use this index file # 450.status-security weekly_status_security_enable="YES" # Security check Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Thu Oct 10 17:59:44 2013 (r256283) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Thu Oct 10 18:05:13 2013 (r256284) @@ -45,7 +45,7 @@ .ds doc-str-Lb-libstdthreads C11 Threads Library (libstdthreads, \-lstdthreads) . .\" Default .Os value -.ds doc-default-operating-system FreeBSD\~10.0 +.ds doc-default-operating-system FreeBSD\~11.0 . .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-7.4 7.4 @@ -54,6 +54,7 @@ .ds doc-operating-system-FreeBSD-9.1 9.1 .ds doc-operating-system-FreeBSD-9.2 9.2 .ds doc-operating-system-FreeBSD-10.0 10.0 +.ds doc-operating-system-FreeBSD-11.0 11.0 . .\" Definitions not (yet) in doc-syms . Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu Oct 10 17:59:44 2013 (r256283) +++ head/sys/conf/newvers.sh Thu Oct 10 18:05:13 2013 (r256284) @@ -31,8 +31,8 @@ # $FreeBSD$ TYPE="FreeBSD" -REVISION="10.0" -BRANCH="ALPHA6" +REVISION="11.0" +BRANCH="CURRENT" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Oct 10 17:59:44 2013 (r256283) +++ head/sys/sys/param.h Thu Oct 10 18:05:13 2013 (r256284) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000055 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100000 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 19:40:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E0516825; Thu, 10 Oct 2013 19:40:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CE27E271D; Thu, 10 Oct 2013 19:40:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AJe1j8024907; Thu, 10 Oct 2013 19:40:01 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AJe193024906; Thu, 10 Oct 2013 19:40:01 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310101940.r9AJe193024906@svn.freebsd.org> From: Dimitry Andric Date: Thu, 10 Oct 2013 19:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256291 - head/sys/arm/versatile X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 19:40:02 -0000 Author: dim Date: Thu Oct 10 19:40:01 2013 New Revision: 256291 URL: http://svnweb.freebsd.org/changeset/base/256291 Log: In sys/arm/versatile/versatile_pci.c, add a default handler, to fix a gcc warning about uninitialized use of a variable. Approved by: re (gjb) Modified: head/sys/arm/versatile/versatile_pci.c Modified: head/sys/arm/versatile/versatile_pci.c ============================================================================== --- head/sys/arm/versatile/versatile_pci.c Thu Oct 10 19:34:24 2013 (r256290) +++ head/sys/arm/versatile/versatile_pci.c Thu Oct 10 19:40:01 2013 (r256291) @@ -360,6 +360,9 @@ versatile_pci_activate_resource(device_t res = (BUS_ACTIVATE_RESOURCE(device_get_parent(bus), child, type, rid, r)); break; + default: + res = ENXIO; + break; } return (res); From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 19:48:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C788CC84; Thu, 10 Oct 2013 19:48:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B586727B6; Thu, 10 Oct 2013 19:48:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AJmhxm029863; Thu, 10 Oct 2013 19:48:43 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AJmhDn029862; Thu, 10 Oct 2013 19:48:43 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310101948.r9AJmhDn029862@svn.freebsd.org> From: Dimitry Andric Date: Thu, 10 Oct 2013 19:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org Subject: svn commit: r256292 - stable/10/sys/arm/versatile X-SVN-Group: defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 19:48:43 -0000 Author: dim Date: Thu Oct 10 19:48:43 2013 New Revision: 256292 URL: http://svnweb.freebsd.org/changeset/base/256292 Log: MFC r256291: In sys/arm/versatile/versatile_pci.c, add a default handler, to fix a gcc warning about uninitialized use of a variable. Approved by: re (gjb) Modified: stable/10/sys/arm/versatile/versatile_pci.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/arm/versatile/versatile_pci.c ============================================================================== --- stable/10/sys/arm/versatile/versatile_pci.c Thu Oct 10 19:40:01 2013 (r256291) +++ stable/10/sys/arm/versatile/versatile_pci.c Thu Oct 10 19:48:43 2013 (r256292) @@ -360,6 +360,9 @@ versatile_pci_activate_resource(device_t res = (BUS_ACTIVATE_RESOURCE(device_get_parent(bus), child, type, rid, r)); break; + default: + res = ENXIO; + break; } return (res); From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 19:51:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A09D6E26; Thu, 10 Oct 2013 19:51:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C61927FD; Thu, 10 Oct 2013 19:51:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AJpcLH032741; Thu, 10 Oct 2013 19:51:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AJpcYi032739; Thu, 10 Oct 2013 19:51:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310101951.r9AJpcYi032739@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Oct 2013 19:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256293 - head/sys/boot/i386/btx/btx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 19:51:38 -0000 Author: jhb Date: Thu Oct 10 19:51:38 2013 New Revision: 256293 URL: http://svnweb.freebsd.org/changeset/base/256293 Log: Sanitize the %eflags returned by BIOS routines. Some BIOS routines enter protected mode and may leave protected-mode-specific flags like PSL_NT set when they return to real mode. This can cause a fault when BTX re-enters protected mode after the BIOS mode returns. PR: amd64/182740 Reported by: Julian Pidancet Approved by: re (gjb) MFC after: 1 week Modified: head/sys/boot/i386/btx/btx/btx.S Modified: head/sys/boot/i386/btx/btx/btx.S ============================================================================== --- head/sys/boot/i386/btx/btx/btx.S Thu Oct 10 19:48:43 2013 (r256292) +++ head/sys/boot/i386/btx/btx/btx.S Thu Oct 10 19:51:38 2013 (r256293) @@ -41,6 +41,8 @@ .set PSL_RESERVED_DEFAULT,0x00000002 .set PSL_T,0x00000100 # Trap flag .set PSL_I,0x00000200 # Interrupt enable flag + .set PSL_D,0x00000400 # String instruction direction + .set PSL_NT,0x00004000 # Nested task flag .set PSL_VM,0x00020000 # Virtual 8086 mode flag .set PSL_AC,0x00040000 # Alignment check flag /* @@ -611,8 +613,8 @@ rret_tramp: movw $MEM_ESPR-0x08,%sp # R pushl %ds # regs pushl %es pushfl # Save %eflags - cli # Disable interrupts - std # String ops dec + pushl $PSL_RESERVED_DEFAULT|PSL_D # Use clean %eflags with + popfl # string ops dec xorw %ax,%ax # Reset seg movw %ax,%ds # regs movw %ax,%es # (%ss is already 0) @@ -675,6 +677,7 @@ rret_tramp.1: xorl %ecx,%ecx # Zero testl $V86F_FLAGS,%edx # User wants flags? jz rret_tramp.3 # No movl MEM_ESPR-0x3c,%eax # Read real mode flags + andl $~(PSL_T|PSL_NT),%eax # Clear unsafe flags movw %ax,-0x08(%esi) # Update user flags (low 16) /* * Return to the user task From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 19:56:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 58F871D2; Thu, 10 Oct 2013 19:56:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 462232841; Thu, 10 Oct 2013 19:56:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AJuWKv034166; Thu, 10 Oct 2013 19:56:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AJuW6j034165; Thu, 10 Oct 2013 19:56:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310101956.r9AJuW6j034165@svn.freebsd.org> From: Adrian Chadd Date: Thu, 10 Oct 2013 19:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256294 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 19:56:32 -0000 Author: adrian Date: Thu Oct 10 19:56:31 2013 New Revision: 256294 URL: http://svnweb.freebsd.org/changeset/base/256294 Log: Fix the "am I a net80211 vap" check for bpf listeners. I changed it to use if_transmit a while ago but apparently with monitor mode the if_transmit method is overridden. This is (mostly) a workaround until a more permanent solution can be found. Submitted by: Patrick Kelsey Approved by: re@ (gjb) Modified: head/sys/net80211/ieee80211_freebsd.c Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Thu Oct 10 19:51:38 2013 (r256293) +++ head/sys/net80211/ieee80211_freebsd.c Thu Oct 10 19:56:31 2013 (r256294) @@ -808,9 +808,9 @@ static eventhandler_tag wlan_ifllevent; static void bpf_track(void *arg, struct ifnet *ifp, int dlt, int attach) { - /* NB: identify vap's by if_start */ + /* NB: identify vap's by if_init */ if (dlt == DLT_IEEE802_11_RADIO && - ifp->if_transmit == ieee80211_vap_transmit) { + ifp->if_init == ieee80211_init) { struct ieee80211vap *vap = ifp->if_softc; /* * Track bpf radiotap listener state. We mark the vap From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 20:33:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4BB14943; Thu, 10 Oct 2013 20:33:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 396A82AF8; Thu, 10 Oct 2013 20:33:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AKXJmo054305; Thu, 10 Oct 2013 20:33:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AKXJ5h054303; Thu, 10 Oct 2013 20:33:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310102033.r9AKXJ5h054303@svn.freebsd.org> From: Dimitry Andric Date: Thu, 10 Oct 2013 20:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org Subject: svn commit: r256297 - stable/10/lib/clang X-SVN-Group: defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 20:33:19 -0000 Author: dim Date: Thu Oct 10 20:33:18 2013 New Revision: 256297 URL: http://svnweb.freebsd.org/changeset/base/256297 Log: Disable assertions in llvm and clang for the 10.0 release cycle. Approved by: re (gjb) Modified: stable/10/lib/clang/clang.build.mk Modified: stable/10/lib/clang/clang.build.mk ============================================================================== --- stable/10/lib/clang/clang.build.mk Thu Oct 10 20:06:34 2013 (r256296) +++ stable/10/lib/clang/clang.build.mk Thu Oct 10 20:33:18 2013 (r256297) @@ -6,7 +6,7 @@ CFLAGS+= -I${LLVM_SRCS}/include -I${CLAN -I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \ -I${LLVM_SRCS}/../../lib/clang/include \ -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ - -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG + -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG .if !defined(EARLY_BUILD) && defined(MK_CLANG_FULL) && ${MK_CLANG_FULL} != "no" CFLAGS+= -DCLANG_ENABLE_ARCMT \ From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 20:47:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4BD59390; Thu, 10 Oct 2013 20:47:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E93D2C1D; Thu, 10 Oct 2013 20:47:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AKlBWd060278; Thu, 10 Oct 2013 20:47:11 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AKlBYL060266; Thu, 10 Oct 2013 20:47:11 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310102047.r9AKlBYL060266@svn.freebsd.org> From: Dimitry Andric Date: Thu, 10 Oct 2013 20:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256298 - in head: . gnu/usr.bin/cc/cc_tools lib/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 20:47:12 -0000 Author: dim Date: Thu Oct 10 20:47:11 2013 New Revision: 256298 URL: http://svnweb.freebsd.org/changeset/base/256298 Log: Bump OS versions in the toolchain triples to 11.0, and bump the __FreeBSD_cc_version predefined macros in clang and gcc. Approved by: re (gjb) Modified: head/Makefile.inc1 head/gnu/usr.bin/cc/cc_tools/freebsd-native.h head/lib/clang/clang.build.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Oct 10 20:33:18 2013 (r256297) +++ head/Makefile.inc1 Thu Oct 10 20:47:11 2013 (r256298) @@ -329,7 +329,7 @@ TARGET_ABI= gnueabi .else TARGET_ABI= unknown .endif -TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.0 +TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 XFLAGS+= -target ${TARGET_TRIPLE} .endif .endif Modified: head/gnu/usr.bin/cc/cc_tools/freebsd-native.h ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/freebsd-native.h Thu Oct 10 20:33:18 2013 (r256297) +++ head/gnu/usr.bin/cc/cc_tools/freebsd-native.h Thu Oct 10 20:47:11 2013 (r256298) @@ -7,8 +7,8 @@ #define FREEBSD_NATIVE 1 /* Fake out gcc/config/freebsd.h. */ -#define FBSD_MAJOR 10 -#define FBSD_CC_VER 1000001 /* form like __FreeBSD_version */ +#define FBSD_MAJOR 11 +#define FBSD_CC_VER 1100001 /* form like __FreeBSD_version */ #undef SYSTEM_INCLUDE_DIR /* We don't need one for now. */ #undef TOOL_INCLUDE_DIR /* We don't need one for now. */ Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Thu Oct 10 20:33:18 2013 (r256297) +++ head/lib/clang/clang.build.mk Thu Oct 10 20:47:11 2013 (r256298) @@ -27,8 +27,8 @@ TARGET_ABI= gnueabi TARGET_ABI= unknown .endif -TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.0 -BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0 +TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 +BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd11.0 CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \ -DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \ -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 21:10:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C63D1DFA; Thu, 10 Oct 2013 21:10:52 +0000 (UTC) (envelope-from edavis@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B3A342E45; Thu, 10 Oct 2013 21:10:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ALAqaf073671; Thu, 10 Oct 2013 21:10:52 GMT (envelope-from edavis@svn.freebsd.org) Received: (from edavis@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ALAqTQ073668; Thu, 10 Oct 2013 21:10:52 GMT (envelope-from edavis@svn.freebsd.org) Message-Id: <201310102110.r9ALAqTQ073668@svn.freebsd.org> From: Eric Davis Date: Thu, 10 Oct 2013 21:10:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256299 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 21:10:53 -0000 Author: edavis Date: Thu Oct 10 21:10:51 2013 New Revision: 256299 URL: http://svnweb.freebsd.org/changeset/base/256299 Log: Fixed the media type shown via ifconfig. Fixed a panic that occurs when bringing up an interface on 57710/57711 running very old bootcode versions. Fixed how bool is defined for those who have been using this code on older versions of FreeBSD. Approved by: re@ (gjb) Approved by: davidch (mentor) Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/ecore_sp.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Thu Oct 10 20:47:11 2013 (r256298) +++ head/sys/dev/bxe/bxe.c Thu Oct 10 21:10:51 2013 (r256299) @@ -34,7 +34,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.17" +#define BXE_DRIVER_VERSION "1.78.18" #include "bxe.h" #include "ecore_sp.h" @@ -936,8 +936,8 @@ bxe_dma_alloc(struct bxe_softc *sc, int rc; if (dma->size > 0) { - BLOGE(sc, "dma block '%s' already has size %lu\n", msg, - (unsigned long) dma->size); + BLOGE(sc, "dma block '%s' already has size %lu\n", msg, + (unsigned long)dma->size); return (1); } @@ -14201,8 +14201,14 @@ bxe_media_detect(struct bxe_softc *sc) uint32_t phy_idx = bxe_get_cur_phy_idx(sc); switch (sc->link_params.phy[phy_idx].media_type) { case ELINK_ETH_PHY_SFPP_10G_FIBER: - case ELINK_ETH_PHY_SFP_1G_FIBER: case ELINK_ETH_PHY_XFP_FIBER: + BLOGI(sc, "Found 10Gb Fiber media.\n"); + sc->media = IFM_10G_SR; + break; + case ELINK_ETH_PHY_SFP_1G_FIBER: + BLOGI(sc, "Found 1Gb Fiber media.\n"); + sc->media = IFM_1000_SX; + break; case ELINK_ETH_PHY_KR: case ELINK_ETH_PHY_CX4: BLOGI(sc, "Found 10GBase-CX4 media.\n"); @@ -14213,8 +14219,14 @@ bxe_media_detect(struct bxe_softc *sc) sc->media = IFM_10G_TWINAX; break; case ELINK_ETH_PHY_BASE_T: - BLOGI(sc, "Found 10GBase-T media.\n"); - sc->media = IFM_10G_T; + if (sc->link_params.speed_cap_mask[0] & + PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) { + BLOGI(sc, "Found 10GBase-T media.\n"); + sc->media = IFM_10G_T; + } else { + BLOGI(sc, "Found 1000Base-T media.\n"); + sc->media = IFM_1000_T; + } break; case ELINK_ETH_PHY_NOT_PRESENT: BLOGI(sc, "Media not present.\n"); Modified: head/sys/dev/bxe/bxe_stats.c ============================================================================== --- head/sys/dev/bxe/bxe_stats.c Thu Oct 10 20:47:11 2013 (r256298) +++ head/sys/dev/bxe/bxe_stats.c Thu Oct 10 21:10:51 2013 (r256299) @@ -263,6 +263,17 @@ bxe_stats_pmf_update(struct bxe_softc *s int loader_idx = PMF_DMAE_C(sc); uint32_t *stats_comp = BXE_SP(sc, stats_comp); + if (sc->devinfo.bc_ver <= 0x06001400) { + /* + * Bootcode v6.0.21 fixed a GRC timeout that occurs when accessing + * BRB registers while the BRB block is in reset. The DMA transfer + * below triggers this issue resulting in the DMAE to stop + * functioning. Skip this initial stats transfer for old bootcode + * versions <= 6.0.20. + */ + return; + } + /* sanity */ if (!sc->port.pmf || !sc->port.port_stx) { BLOGE(sc, "BUG!\n"); Modified: head/sys/dev/bxe/ecore_sp.h ============================================================================== --- head/sys/dev/bxe/ecore_sp.h Thu Oct 10 20:47:11 2013 (r256298) +++ head/sys/dev/bxe/ecore_sp.h Thu Oct 10 21:10:51 2013 (r256299) @@ -77,9 +77,14 @@ struct bxe_softc; typedef bus_addr_t ecore_dma_addr_t; /* expected to be 64 bit wide */ typedef volatile int ecore_atomic_t; -#if __FreeBSD_version < 1000002 -typedef int bool; +#ifndef __bool_true_false_are_defined +#ifndef __cplusplus +#define bool _Bool +#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER) +typedef _Bool bool; #endif +#endif /* !__cplusplus */ +#endif /* !__bool_true_false_are_defined$ */ #define ETH_ALEN ETHER_ADDR_LEN /* 6 */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 22:38:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 80998611; Thu, 10 Oct 2013 22:38:36 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6E2812435; Thu, 10 Oct 2013 22:38:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AMcauE016515; Thu, 10 Oct 2013 22:38:36 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AMca5d016514; Thu, 10 Oct 2013 22:38:36 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201310102238.r9AMca5d016514@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 10 Oct 2013 22:38:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256302 - head/sys/dev/cxgb/ulp/iw_cxgb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 22:38:36 -0000 Author: np Date: Thu Oct 10 22:38:35 2013 New Revision: 256302 URL: http://svnweb.freebsd.org/changeset/base/256302 Log: Add dependency on ibcore now that it has been modularized. Approved by: re (gjb) Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Thu Oct 10 21:46:43 2013 (r256301) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Thu Oct 10 22:38:35 2013 (r256302) @@ -298,3 +298,4 @@ DECLARE_MODULE(iw_cxgb, iwch_mod_data, S MODULE_DEPEND(t3_tom, cxgbc, 1, 1, 1); MODULE_DEPEND(iw_cxgb, toecore, 1, 1, 1); MODULE_DEPEND(iw_cxgb, t3_tom, 1, 1, 1); +MODULE_DEPEND(iw_cxgb, ibcore, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 22:44:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BED1B960; Thu, 10 Oct 2013 22:44:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ABA19249C; Thu, 10 Oct 2013 22:44:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AMiTc8020168; Thu, 10 Oct 2013 22:44:29 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AMiTiA020166; Thu, 10 Oct 2013 22:44:29 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201310102244.r9AMiTiA020166@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 10 Oct 2013 22:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org Subject: svn commit: r256303 - stable/10/sys/dev/cxgb/ulp/iw_cxgb X-SVN-Group: defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 22:44:30 -0000 Author: np Date: Thu Oct 10 22:44:29 2013 New Revision: 256303 URL: http://svnweb.freebsd.org/changeset/base/256303 Log: MFC r256302: Add dependency on ibcore now that it has been modularized. Approved by: re (gjb) Modified: stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c ============================================================================== --- stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Thu Oct 10 22:38:35 2013 (r256302) +++ stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Thu Oct 10 22:44:29 2013 (r256303) @@ -298,3 +298,4 @@ DECLARE_MODULE(iw_cxgb, iwch_mod_data, S MODULE_DEPEND(t3_tom, cxgbc, 1, 1, 1); MODULE_DEPEND(iw_cxgb, toecore, 1, 1, 1); MODULE_DEPEND(iw_cxgb, t3_tom, 1, 1, 1); +MODULE_DEPEND(iw_cxgb, ibcore, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Thu Oct 10 22:46:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4DC2DB69; Thu, 10 Oct 2013 22:46:50 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3AB1F24C2; Thu, 10 Oct 2013 22:46:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AMkoI7020898; Thu, 10 Oct 2013 22:46:50 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AMknJ5020885; Thu, 10 Oct 2013 22:46:49 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310102246.r9AMknJ5020885@svn.freebsd.org> From: Peter Grehan Date: Thu, 10 Oct 2013 22:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256304 - in head/sys/dev: ata hyperv/stordisengage X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2013 22:46:50 -0000 Author: grehan Date: Thu Oct 10 22:46:49 2013 New Revision: 256304 URL: http://svnweb.freebsd.org/changeset/base/256304 Log: Allow the legacy CDROM device to be accessed in a FreeBSD guest, while still using enlightened drivers for other block devices. Submitted by: Microsoft hyperv dev team, mav@ Approved by: re@ Modified: head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-card.c head/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Thu Oct 10 22:44:29 2013 (r256303) +++ head/sys/dev/ata/ata-all.c Thu Oct 10 22:46:49 2013 (r256304) @@ -92,7 +92,7 @@ FEATURE(ata_cam, "ATA devices are access int ata_probe(device_t dev) { - return 0; + return (BUS_PROBE_DEFAULT); } int Modified: head/sys/dev/ata/ata-card.c ============================================================================== --- head/sys/dev/ata/ata-card.c Thu Oct 10 22:44:29 2013 (r256303) +++ head/sys/dev/ata/ata-card.c Thu Oct 10 22:46:49 2013 (r256304) @@ -140,7 +140,7 @@ ata_pccard_attach(device_t dev) ch-> flags |= ATA_NO_SLAVE; ata_generic_hw(dev); err = ata_probe(dev); - if (err) + if (err > 0) return (err); return (ata_attach(dev)); } Modified: head/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c ============================================================================== --- head/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c Thu Oct 10 22:44:29 2013 (r256303) +++ head/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c Thu Oct 10 22:46:49 2013 (r256304) @@ -92,6 +92,7 @@ static int hv_check_for_hyper_v(void); static int hv_ata_pci_probe(device_t dev) { + device_t parent = device_get_parent(dev); int ata_disk_enable; ata_disk_enable = 0; @@ -102,23 +103,9 @@ hv_ata_pci_probe(device_t dev) if (!hv_check_for_hyper_v()) return (ENXIO); - if (bootverbose) - device_printf(dev, - "hv_ata_pci_probe dev_class/subslcass = %d, %d\n", - pci_get_class(dev), pci_get_subclass(dev)); - - /* is this a storage class device ? */ - if (pci_get_class(dev) != PCIC_STORAGE) + if (device_get_unit(parent) != 0 || device_get_ivars(dev) != 0) return (ENXIO); - /* is this an IDE/ATA type device ? */ - if (pci_get_subclass(dev) != PCIS_STORAGE_IDE) - return (ENXIO); - - if(bootverbose) - device_printf(dev, - "Hyper-V probe for disabling ATA-PCI, emulated driver\n"); - /* * On Hyper-V the default is to use the enlightened driver for * IDE disks. However, if the user wishes to use the native @@ -126,15 +113,14 @@ hv_ata_pci_probe(device_t dev) * hw_ata.disk_enable must be explicitly set to 1. */ if (getenv_int("hw.ata.disk_enable", &ata_disk_enable)) { - if(bootverbose) + if (bootverbose) device_printf(dev, "hw.ata.disk_enable flag is disabling Hyper-V" " ATA driver support\n"); return (ENXIO); } - if (bootverbose) - device_printf(dev, "Hyper-V ATA storage driver enabled.\n"); + device_set_desc(dev, "Hyper-V ATA storage disengage driver"); return (BUS_PROBE_VENDOR); } @@ -193,12 +179,12 @@ static device_method_t hv_ata_pci_method devclass_t hv_ata_pci_devclass; static driver_t hv_ata_pci_disengage_driver = { - "pciata-disable", + "ata", hv_ata_pci_methods, - sizeof(struct ata_pci_controller), + 0, }; -DRIVER_MODULE(atapci_dis, pci, hv_ata_pci_disengage_driver, - hv_ata_pci_devclass, NULL, NULL); +DRIVER_MODULE(atapci_dis, atapci, hv_ata_pci_disengage_driver, + hv_ata_pci_devclass, NULL, NULL); MODULE_VERSION(atapci_dis, 1); MODULE_DEPEND(atapci_dis, ata, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 04:42:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E24C6FD3; Fri, 11 Oct 2013 04:42:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF227257B; Fri, 11 Oct 2013 04:42:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9B4gHvP004685; Fri, 11 Oct 2013 04:42:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9B4gHAA004684; Fri, 11 Oct 2013 04:42:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310110442.r9B4gHAA004684@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 11 Oct 2013 04:42: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: r256305 - stable/9/sys/compat/freebsd32 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, 11 Oct 2013 04:42:18 -0000 Author: kib Date: Fri Oct 11 04:42:17 2013 New Revision: 256305 URL: http://svnweb.freebsd.org/changeset/base/256305 Log: MFC r256061: Add padding to match the compat32 struct stat32 definition to the real struct stat on 32bit architectures. Modified: stable/9/sys/compat/freebsd32/freebsd32.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/freebsd32/freebsd32.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32.h Thu Oct 10 22:46:49 2013 (r256304) +++ stable/9/sys/compat/freebsd32/freebsd32.h Fri Oct 11 04:42:17 2013 (r256305) @@ -166,6 +166,7 @@ struct stat32 { u_int32_t st_blksize; u_int32_t st_flags; u_int32_t st_gen; + int32_t st_lspare; struct timespec32 st_birthtim; unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32)); unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32)); From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 04:50:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 55CFA1E1; Fri, 11 Oct 2013 04:50:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 41E1825C9; Fri, 11 Oct 2013 04:50:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9B4oShb008972; Fri, 11 Oct 2013 04:50:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9B4oSdF008971; Fri, 11 Oct 2013 04:50:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310110450.r9B4oSdF008971@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 11 Oct 2013 04:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r256306 - stable/8/sys/compat/freebsd32 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, 11 Oct 2013 04:50:28 -0000 Author: kib Date: Fri Oct 11 04:50:27 2013 New Revision: 256306 URL: http://svnweb.freebsd.org/changeset/base/256306 Log: MFC r256061: Add padding to match the compat32 struct stat32 definition to the real struct stat on 32bit architectures. Modified: stable/8/sys/compat/freebsd32/freebsd32.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/compat/ (props changed) Modified: stable/8/sys/compat/freebsd32/freebsd32.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32.h Fri Oct 11 04:42:17 2013 (r256305) +++ stable/8/sys/compat/freebsd32/freebsd32.h Fri Oct 11 04:50:27 2013 (r256306) @@ -152,6 +152,7 @@ struct stat32 { u_int32_t st_blksize; u_int32_t st_flags; u_int32_t st_gen; + int32_t st_lspare; struct timespec32 st_birthtimespec; unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32)); unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32)); From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 06:48:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 735B29B7; Fri, 11 Oct 2013 06:48:41 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 60EF82BC0; Fri, 11 Oct 2013 06:48:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9B6mfC7068173; Fri, 11 Oct 2013 06:48:41 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9B6meQ2068171; Fri, 11 Oct 2013 06:48:40 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201310110648.r9B6meQ2068171@svn.freebsd.org> From: Bryan Venteicher Date: Fri, 11 Oct 2013 06:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256308 - head/sys/dev/vmware/vmxnet3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 06:48:41 -0000 Author: bryanv Date: Fri Oct 11 06:48:40 2013 New Revision: 256308 URL: http://svnweb.freebsd.org/changeset/base/256308 Log: Do not provide a hint of the guest's OS version The calculation can overflow if __FreeBSD_version is big enough, and it does not appear to be required. Reported by: grehan Approved by: re (gjb) Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/dev/vmware/vmxnet3/if_vmxvar.h Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Fri Oct 11 05:09:23 2013 (r256307) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Fri Oct 11 06:48:40 2013 (r256308) @@ -1317,7 +1317,7 @@ vmxnet3_init_shared_data(struct vmxnet3_ /* DriverInfo */ ds->version = VMXNET3_DRIVER_VERSION; - ds->guest = VMXNET3_GOS_FREEBSD | VMXNET3_GUEST_OS_VERSION | + ds->guest = VMXNET3_GOS_FREEBSD | #ifdef __LP64__ VMXNET3_GOS_64BIT; #else Modified: head/sys/dev/vmware/vmxnet3/if_vmxvar.h ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmxvar.h Fri Oct 11 05:09:23 2013 (r256307) +++ head/sys/dev/vmware/vmxnet3/if_vmxvar.h Fri Oct 11 06:48:40 2013 (r256308) @@ -248,17 +248,6 @@ struct vmxnet3_softc { #define VMXNET3_DRIVER_VERSION 0x00010000 /* - * Convert the FreeBSD version in to something the hypervisor - * understands. This is apparently what VMware's driver reports - * so mimic it even though it probably is not required. - */ -#define VMXNET3_GUEST_OS_VERSION \ - (((__FreeBSD_version / 100000) << 14) | \ - (((__FreeBSD_version / 1000) % 100) << 6 ) | \ - (((__FreeBSD_version / 100) % 10) << 30) | \ - ((__FreeBSD_version % 100) << 22)) - -/* * Max descriptors per Tx packet. We must limit the size of the * any TSO packets based on the number of segments. */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 06:51:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 02F91B21; Fri, 11 Oct 2013 06:51:57 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E38352C00; Fri, 11 Oct 2013 06:51:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9B6pu9K070865; Fri, 11 Oct 2013 06:51:56 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9B6puCR070863; Fri, 11 Oct 2013 06:51:56 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201310110651.r9B6puCR070863@svn.freebsd.org> From: Bryan Venteicher Date: Fri, 11 Oct 2013 06:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org Subject: svn commit: r256309 - stable/10/sys/dev/vmware/vmxnet3 X-SVN-Group: defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 06:51:57 -0000 Author: bryanv Date: Fri Oct 11 06:51:56 2013 New Revision: 256309 URL: http://svnweb.freebsd.org/changeset/base/256309 Log: MFC r256308: Do not provide a hint of the guest's OS version The calculation can overflow if __FreeBSD_version is big enough, and it does not appear to be required. Approved by: re (gjb) Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Fri Oct 11 06:48:40 2013 (r256308) +++ stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Fri Oct 11 06:51:56 2013 (r256309) @@ -1317,7 +1317,7 @@ vmxnet3_init_shared_data(struct vmxnet3_ /* DriverInfo */ ds->version = VMXNET3_DRIVER_VERSION; - ds->guest = VMXNET3_GOS_FREEBSD | VMXNET3_GUEST_OS_VERSION | + ds->guest = VMXNET3_GOS_FREEBSD | #ifdef __LP64__ VMXNET3_GOS_64BIT; #else Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h ============================================================================== --- stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h Fri Oct 11 06:48:40 2013 (r256308) +++ stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h Fri Oct 11 06:51:56 2013 (r256309) @@ -248,17 +248,6 @@ struct vmxnet3_softc { #define VMXNET3_DRIVER_VERSION 0x00010000 /* - * Convert the FreeBSD version in to something the hypervisor - * understands. This is apparently what VMware's driver reports - * so mimic it even though it probably is not required. - */ -#define VMXNET3_GUEST_OS_VERSION \ - (((__FreeBSD_version / 100000) << 14) | \ - (((__FreeBSD_version / 1000) % 100) << 6 ) | \ - (((__FreeBSD_version / 100) % 10) << 30) | \ - ((__FreeBSD_version % 100) << 22)) - -/* * Max descriptors per Tx packet. We must limit the size of the * any TSO packets based on the number of segments. */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 13:04:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8EECF9B3; Fri, 11 Oct 2013 13:04:17 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from mail.jr-hosting.nl (mail.jr-hosting.nl [IPv6:2a01:4f8:141:5ffd::25]) by mx1.freebsd.org (Postfix) with ESMTP id E36B723C9; Fri, 11 Oct 2013 13:04:16 +0000 (UTC) Received: from [10.0.2.17] (a44084.upc-a.chello.nl [62.163.44.84]) by mail.jr-hosting.nl (Postfix) with ESMTPSA id 9E41738B108A; Fri, 11 Oct 2013 15:04:12 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_EE56DFCD-625B-41F1-9E20-0F47A1A3EE82"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: svn commit: r256256 - in head: . etc etc/defaults etc/rc.d share/man/man5 usr.sbin/jail From: Remko Lodder In-Reply-To: <201310100932.r9A9WS0H013645@svn.freebsd.org> Date: Fri, 11 Oct 2013 15:04:12 +0200 Message-Id: <04E9979E-1D97-4AA2-A7AE-F9D8457B3599@FreeBSD.org> References: <201310100932.r9A9WS0H013645@svn.freebsd.org> To: Hiroki Sato X-Mailer: Apple Mail (2.1510) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 13:04:17 -0000 --Apple-Mail=_EE56DFCD-625B-41F1-9E20-0F47A1A3EE82 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Hiroki, On Oct 10, 2013, at 11:32 AM, Hiroki Sato wrote: > Author: hrs > Date: Thu Oct 10 09:32:27 2013 > New Revision: 256256 > URL: http://svnweb.freebsd.org/changeset/base/256256 >=20 > Log: > - Update rc.d/jail to use a jail(8) configuration file instead of > command line options. The "jail__*" rc.conf(5) variables = for > per-jail configuration are automatically converted to > /var/run/jail..conf before the jail(8) utility is invoked. > This is transparently backward compatible. >=20 > - Fix a minor bug in jail(8) which prevented it from returning false > when jail -r failed. >=20 Thanks for doing such a massive update. However it seems to break the = ezjail utility. My jails didn't restart after I upgraded to the most recent -head = version=20 FreeBSD nakur.elvandar.org 10.0-ALPHA6 FreeBSD 10.0-ALPHA6 #7 r256311: = Fri Oct 11 13:27:54 CEST 2013 = root@nakur.elvandar.org:/usr/obj/usr/src/sys/NAKUR amd64 If I replace this with an older version, the utility starts and = complains about certain things not being done properly. The system does not mount devfs nodes anylonger and thus is basically out of = function. I was not expecting this much fallout from this change, others that will = be upgrading will loose the ability to start their jails until they can resolve this by hand. Thanks Remko > Approved by: re (glebius) >=20 > Modified: > head/UPDATING > head/etc/defaults/rc.conf > head/etc/rc.d/jail > head/etc/rc.subr > head/share/man/man5/rc.conf.5 > head/usr.sbin/jail/jail.c >=20 > Modified: head/UPDATING > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/UPDATING Thu Oct 10 07:41:11 2013 (r256255) > +++ head/UPDATING Thu Oct 10 09:32:27 2013 (r256256) > @@ -31,6 +31,25 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) >=20 > +20131010: > + The rc.d/jail script has been updated to support jail(8) > + configuration file. The "jail__*" rc.conf(5) variables > + for per-jail configuration are automatically converted to > + /var/run/jail..conf before the jail(8) utility is = invoked. > + This is transparently backward compatible. See below about some > + incompatibilities and rc.conf(5) manual page for more details. > + > + These variables are now deprecated in favor of jail(8) = configuration > + file. One can use "rc.d/jail config " command to = generate > + a jail(8) configuration file in /var/run/jail..conf = without > + running the jail(8) utility. The default pathname of the > + configuration file is /etc/jail.conf and can be specified by > + using $jail_conf or $jail__conf variables. > + > + Please note that jail_devfs_ruleset accepts an integer at > + this moment. Please consider to rewrite the ruleset name > + with an integer. > + > 20130930: > BIND has been removed from the base system. If all you need > is a local resolver, simply enable and start the local_unbound >=20 > Modified: head/etc/defaults/rc.conf > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/etc/defaults/rc.conf Thu Oct 10 07:41:11 2013 = (r256255) > +++ head/etc/defaults/rc.conf Thu Oct 10 09:32:27 2013 = (r256256) > @@ -674,44 +674,11 @@ mixer_enable=3D"YES" # Run the sound mixer > opensm_enable=3D"NO" # Opensm(8) for infiniband devices defaults to = off >=20 > ############################################################## > -### Jail Configuration ####################################### > +### Jail Configuration (see rc.conf(5) manual page) ########## > ############################################################## > jail_enable=3D"NO" # Set to NO to disable starting of any jails > jail_parallel_start=3D"NO" # Start jails in the background > jail_list=3D"" # Space separated list of names of jails > -jail_set_hostname_allow=3D"YES" # Allow root user in a jail to change = its hostname > -jail_socket_unixiproute_only=3D"YES" # Route only TCP/IP within a = jail > -jail_sysvipc_allow=3D"NO" # Allow SystemV IPC use from within a = jail > - > -# > -# To use rc's built-in jail infrastructure create entries for > -# each jail, specified in jail_list, with the following variables. > -# NOTES: > -# - replace 'example' with the jail's name. > -# - except rootdir, hostname, ip and the _multi addresses, > -# all of the following variables may be made global jail variables > -# if you don't specify a jail name (ie. jail_interface, = jail_devfs_ruleset). > -# > -#jail_example_rootdir=3D"/usr/jail/default" # Jail's root directory > -#jail_example_hostname=3D"default.domain.com" # Jail's = hostname > -#jail_example_interface=3D"" # Jail's interface = variable to create IP aliases on > -#jail_example_fib=3D"0" # Routing table = for setfib(1) > -#jail_example_ip=3D"192.0.2.10,2001:db8::17" # Jail's primary IPv4 = and IPv6 address > -#jail_example_ip_multi0=3D"2001:db8::10" # and another = IPv6 address > -#jail_example_exec_start=3D"/bin/sh /etc/rc" # command to = execute in jail for starting > -#jail_example_exec_afterstart0=3D"/bin/sh command" # command to = execute after the one for > - # starting the = jail. More than one can be > - # specified = using a trailing number > -#jail_example_exec_stop=3D"/bin/sh /etc/rc.shutdown" # command to = execute in jail for stopping > -#jail_example_devfs_enable=3D"NO" # mount devfs in = the jail > -#jail_example_devfs_ruleset=3D"ruleset_name" # devfs ruleset to apply = to jail - > - # usually you want = "devfsrules_jail". > -#jail_example_fdescfs_enable=3D"NO" # mount fdescfs in the = jail > -#jail_example_procfs_enable=3D"NO" # mount procfs in jail > -#jail_example_mount_enable=3D"NO" # mount/umount = jail's fs > -#jail_example_fstab=3D"" # fstab(5) for = mount/umount > -#jail_example_flags=3D"-l -U root" # flags for jail(8) > -#jail_example_parameters=3D"allow.raw_sockets=3D1" # extra = parameters for this jail >=20 > ############################################################## > ### Define source_rc_confs, the mechanism used by /etc/rc.* ## >=20 > Modified: head/etc/rc.d/jail > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/etc/rc.d/jail Thu Oct 10 07:41:11 2013 = (r256255) > +++ head/etc/rc.d/jail Thu Oct 10 09:32:27 2013 = (r256256) > @@ -8,81 +8,138 @@ > # BEFORE: securelevel > # KEYWORD: nojail shutdown >=20 > -# WARNING: This script deals with untrusted data (the data and > -# processes inside the jails) and care must be taken when changing = the > -# code related to this! If you have any doubt whether a change is > -# correct and have security impact, please get the patch reviewed by > -# the FreeBSD Security Team prior to commit. > - > . /etc/rc.subr >=20 > name=3D"jail" > rcvar=3D"jail_enable" >=20 > -start_precmd=3D"jail_prestart" > start_cmd=3D"jail_start" > +start_postcmd=3D"jail_warn" > stop_cmd=3D"jail_stop" > +config_cmd=3D"jail_config" > +console_cmd=3D"jail_console" > +status_cmd=3D"jail_status" > +extra_commands=3D"config console status" > +: ${jail_conf:=3D/etc/jail.conf} > +: ${jail_program:=3D/usr/sbin/jail} > +: ${jail_consolecmd:=3D/bin/sh} > +: ${jail_jexec:=3D/usr/sbin/jexec} > +: ${jail_jls:=3D/usr/sbin/jls} > + > +need_dad_wait=3D > + > +# extact_var jail name param num defval > +# Extract value from ${jail_$jail_$name} or ${jail_$name} and > +# set it to $param. If not defined, $defval is used. > +# When $num is [0-9]*, ${jail_$jail_$name$num} are looked up and > +# $param is set by using +=3D. > +# When $num is YN or NY, the value is interpret as boolean. > +extract_var() > +{ > + local i _j _name _param _num _def _name1 _name2 > + _j=3D$1 > + _name=3D$2 > + _param=3D$3 > + _num=3D$4 > + _def=3D$5 > + > + case $_num in > + YN) > + _name1=3Djail_${_j}_${_name} > + _name2=3Djail_${_name} > + eval $_name1=3D\"\${$_name1:-\${$_name2:-$_def}}\" > + if checkyesno $_name1; then > + echo " $_param =3D 1;" > + else > + echo " $_param =3D 0;" > + fi > + ;; > + NY) > + _name1=3Djail_${_j}_${_name} > + _name2=3Djail_${_name} > + eval $_name1=3D\"\${$_name1:-\${$_name2:-$_def}}\" > + if checkyesno $_name1; then > + echo " $_param =3D 0;" > + else > + echo " $_param =3D 1;" > + fi > + ;; > + [0-9]*) > + i=3D$_num > + while : ; do > + _name1=3Djail_${_j}_${_name}${i} > + _name2=3Djail_${_name}${i} > + eval = _tmpargs=3D\"\${$_name1:-\${$_name2:-$_def}}\" > + if [ -n "$_tmpargs" ]; then=20 > + echo " $_param +=3D \"$_tmpargs\";" > + else > + break; > + fi > + i=3D$(($i + 1)) > + done > + ;; > + *) > + _name1=3Djail_${_j}_${_name} > + _name2=3Djail_${_name} > + eval _tmpargs=3D\"\${$_name1:-\${$_name2:-$_def}}\" > + if [ -n "$_tmpargs" ]; then > + echo " $_param =3D \"$_tmpargs\";" > + fi > + ;; > + esac > +} >=20 > -# init_variables _j > -# Initialize the various jail variables for jail _j. > +# parse_options _j > +# Parse options and create a temporary configuration file if = necessary. > # > -init_variables() > +parse_options() > { > - _j=3D"$1" > + local _j > + _j=3D$1 >=20 > + _confwarn=3D0 > if [ -z "$_j" ]; then > - warn "init_variables: you must specify a jail" > + warn "parse_options: you must specify a jail" > return > fi > - > + eval _jconf=3D\"\${jail_${_j}_conf:-/etc/jail.${_j}.conf}\" > eval _rootdir=3D\"\$jail_${_j}_rootdir\" > - _devdir=3D"${_rootdir}/dev" > - _fdescdir=3D"${_devdir}/fd" > - _procdir=3D"${_rootdir}/proc" > eval _hostname=3D\"\$jail_${_j}_hostname\" > + if [ -z "$_rootdir" -o \ > + -z "$_hostname" ]; then > + if [ -r "$_jconf" ]; then > + _conf=3D"$_jconf" > + return 0 > + elif [ -r "$jail_conf" ]; then > + _conf=3D"$jail_conf" > + return 0 > + else > + warn "Invalid configuration for $_j " \ > + "(no jail.conf, no hostname, or no path). " = \ > + "Jail $_j was ignored." > + fi > + return 1 > + fi > eval _ip=3D\"\$jail_${_j}_ip\" > - eval _interface=3D\"\${jail_${_j}_interface:-${jail_interface}}\" > - eval _exec=3D\"\$jail_${_j}_exec\" > - > - i=3D0 > - while : ; do > - eval = _exec_prestart${i}=3D\"\${jail_${_j}_exec_prestart${i}:-\${jail_exec_prest= art${i}}}\" > - [ -z "$(eval echo \"\$_exec_prestart${i}\")" ] && break > - i=3D$((i + 1)) > - done > - > - eval = _exec_start=3D\"\${jail_${_j}_exec_start:-${jail_exec_start}}\" > - > - i=3D1 > - while : ; do > - eval = _exec_afterstart${i}=3D\"\${jail_${_j}_exec_afterstart${i}:-\${jail_exec_a= fterstart${i}}}\" > - [ -z "$(eval echo \"\$_exec_afterstart${i}\")" ] && = break > - i=3D$((i + 1)) > - done > - > - i=3D0 > - while : ; do > - eval = _exec_poststart${i}=3D\"\${jail_${_j}_exec_poststart${i}:-\${jail_exec_pos= tstart${i}}}\" > - [ -z "$(eval echo \"\$_exec_poststart${i}\")" ] && break > - i=3D$((i + 1)) > - done > - > - i=3D0 > - while : ; do > - eval = _exec_prestop${i}=3D\"\${jail_${_j}_exec_prestop${i}:-\${jail_exec_prestop= ${i}}}\" > - [ -z "$(eval echo \"\$_exec_prestop${i}\")" ] && break > - i=3D$((i + 1)) > - done > - > - eval _exec_stop=3D\"\${jail_${_j}_exec_stop:-${jail_exec_stop}}\" > - > - i=3D0 > - while : ; do > - eval = _exec_poststop${i}=3D\"\${jail_${_j}_exec_poststop${i}:-\${jail_exec_posts= top${i}}}\" > - [ -z "$(eval echo \"\$_exec_poststop${i}\")" ] && break > - i=3D$((i + 1)) > - done > + if [ -z "$_ip" ] && ! check_kern_features vimage; then > + warn "no ipaddress specified and no vimage support. " \ > + "Jail $_j was ignored." > + return 1 > + fi > + _conf=3D/var/run/jail.${_j}.conf > + # > + # To relieve confusion, show a warning message. > + # > + _confwarn=3D1 > + if [ -r "$jail_conf" -o -r "$_jconf" ]; then > + warn "$_conf is created and used for jail $_j." > + fi > + /usr/bin/install -m 0644 -o root -g wheel /dev/null $_conf || = return 1 >=20 > + eval : \${jail_${_j}_flags:=3D${jail_flags}} > + eval _exec=3D\"\$jail_${_j}_exec\" > + eval _exec_start=3D\"\$jail_${_j}_exec_start\" > + eval _exec_stop=3D\"\$jail_${_j}_exec_stop\" > if [ -n "${_exec}" ]; then > # simple/backward-compatible execution > _exec_start=3D"${_exec}" > @@ -96,285 +153,104 @@ init_variables() > fi > fi > fi > - > - # The default jail ruleset will be used by rc.subr if none is = specified. > - eval = _ruleset=3D\"\${jail_${_j}_devfs_ruleset:-${jail_devfs_ruleset}}\" > - eval = _devfs=3D\"\${jail_${_j}_devfs_enable:-${jail_devfs_enable}}\" > - [ -z "${_devfs}" ] && _devfs=3D"NO" > - eval = _fdescfs=3D\"\${jail_${_j}_fdescfs_enable:-${jail_fdescfs_enable}}\" > - [ -z "${_fdescfs}" ] && _fdescfs=3D"NO" > - eval = _procfs=3D\"\${jail_${_j}_procfs_enable:-${jail_procfs_enable}}\" > - [ -z "${_procfs}" ] && _procfs=3D"NO" > - > - eval = _mount=3D\"\${jail_${_j}_mount_enable:-${jail_mount_enable}}\" > - [ -z "${_mount}" ] && _mount=3D"NO" > - # "/etc/fstab.${_j}" will be used for {,u}mount(8) if none is = specified. > - eval _fstab=3D\"\${jail_${_j}_fstab:-${jail_fstab}}\" > - [ -z "${_fstab}" ] && _fstab=3D"/etc/fstab.${_j}" > - eval _flags=3D\"\${jail_${_j}_flags:-${jail_flags}}\" > - [ -z "${_flags}" ] && _flags=3D"-l -U root" > - eval = _consolelog=3D\"\${jail_${_j}_consolelog:-${jail_consolelog}}\" > - [ -z "${_consolelog}" ] && = _consolelog=3D"/var/log/jail_${_j}_console.log" > + eval _interface=3D\"\${jail_${_j}_interface:-${jail_interface}}\" > eval = _parameters=3D\"\${jail_${_j}_parameters:-${jail_parameters}}\" > - [ -z "${_parameters}" ] && _parameters=3D"" > - eval _fib=3D\"\${jail_${_j}_fib:-${jail_fib}}\" > - > - # Debugging aid > - # > - debug "$_j devfs enable: $_devfs" > - debug "$_j fdescfs enable: $_fdescfs" > - debug "$_j procfs enable: $_procfs" > - debug "$_j mount enable: $_mount" > - debug "$_j hostname: $_hostname" > - debug "$_j ip: $_ip" > - jail_show_addresses ${_j} > - debug "$_j interface: $_interface" > - debug "$_j fib: $_fib" > - debug "$_j root: $_rootdir" > - debug "$_j devdir: $_devdir" > - debug "$_j fdescdir: $_fdescdir" > - debug "$_j procdir: $_procdir" > - debug "$_j ruleset: $_ruleset" > - debug "$_j fstab: $_fstab" > - > - i=3D0 > - while : ; do > - eval out=3D\"\${_exec_prestart${i}:-''}\" > - if [ -z "$out" ]; then > - break > - fi > - debug "$_j exec pre-start #${i}: ${out}" > - i=3D$((i + 1)) > - done > - > - debug "$_j exec start: $_exec_start" > - > - i=3D1 > - while : ; do > - eval out=3D\"\${_exec_afterstart${i}:-''}\" > - > - if [ -z "$out" ]; then > - break; > - fi > - > - debug "$_j exec after start #${i}: ${out}" > - i=3D$((i + 1)) > - done > - > - i=3D0 > - while : ; do > - eval out=3D\"\${_exec_poststart${i}:-''}\" > - if [ -z "$out" ]; then > - break > - fi > - debug "$_j exec post-start #${i}: ${out}" > - i=3D$((i + 1)) > - done > - > - i=3D0 > - while : ; do > - eval out=3D\"\${_exec_prestop${i}:-''}\" > - if [ -z "$out" ]; then > - break > - fi > - debug "$_j exec pre-stop #${i}: ${out}" > - i=3D$((i + 1)) > - done > - > - debug "$_j exec stop: $_exec_stop" > + eval = _fstab=3D\"\${jail_${_j}_fstab:-${jail_fstab:-/etc/fstab.$_j}}\" > + ( > + date +"# Generated by rc.d/jail at %Y-%m-%d %H:%M:%S" > + echo "$_j {" > + extract_var $_j hostname host.hostname - "" > + extract_var $_j rootdir path - "" > + if [ -n "$_ip" ]; then > + extract_var $_j interface interface - "" > + jail_handle_ips_option $_ip $_interface > + alias=3D0 > + while : ; do > + eval = _x=3D\"\$jail_${_jail}_ip_multi${alias}\" > + [ -z "$_x" ] && break >=20 > - i=3D0 > - while : ; do > - eval out=3D\"\${_exec_poststop${i}:-''}\" > - if [ -z "$out" ]; then > - break > + jail_handle_ips_option $_x $_interface > + alias=3D$(($alias + 1)) > + done > + case $need_dad_wait in > + 1) > + # Sleep to let DAD complete before > + # starting services. > + echo " exec.start +=3D \"sleep " \ > + $(($(${SYSCTL_N} = net.inet6.ip6.dad_count) + 1)) \ > + "\";" > + ;; > + esac > + # These are applicable only to non-vimage jails.=20= > + extract_var $_j fib exec.fib - "" > + extract_var $_j socket_unixiproute_only \ > + allow.raw_sockets NY YES > + else > + echo " vnet;" > + extract_var $_j vnet_interface vnet.interface - = "" > fi > - debug "$_j exec post-stop #${i}: ${out}" > - i=3D$((i + 1)) > - done > - > - debug "$_j flags: $_flags" > - debug "$_j consolelog: $_consolelog" > - debug "$_j parameters: $_parameters" >=20 > - if [ -z "${_hostname}" ]; then > - err 3 "$name: No hostname has been defined for ${_j}" > - fi > - if [ -z "${_rootdir}" ]; then > - err 3 "$name: No root directory has been defined for = ${_j}" > - fi > -} > - > -# set_sysctl rc_knob mib msg > -# If the mib sysctl is set according to what rc_knob > -# specifies, this function does nothing. However if > -# rc_knob is set differently than mib, then the mib > -# is set accordingly and msg is displayed followed by > -# an '=3D" sign and the word 'YES' or 'NO'. > -# > -set_sysctl() > -{ > - _knob=3D"$1" > - _mib=3D"$2" > - _msg=3D"$3" > - > - _current=3D`${SYSCTL} -n $_mib 2>/dev/null` > - if checkyesno $_knob ; then > - if [ "$_current" -ne 1 ]; then > - echo -n " ${_msg}=3DYES" > - ${SYSCTL} 1>/dev/null ${_mib}=3D1 > - fi > - else > - if [ "$_current" -ne 0 ]; then > - echo -n " ${_msg}=3DNO" > - ${SYSCTL} 1>/dev/null ${_mib}=3D0 > + echo " exec.clean;" > + echo " exec.system_user =3D \"root\";" > + echo " exec.jail_user =3D \"root\";" > + extract_var $_j exec_prestart exec.prestart 0 "" > + extract_var $_j exec_poststart exec.poststart 0 "" > + extract_var $_j exec_prestop exec.prestop 0 "" > + extract_var $_j exec_poststop exec.poststop 0 "" > + > + echo " exec.start +=3D \"$_exec_start\";" > + extract_var $_j exec_afterstart exec.start 1 "" > + echo " exec.stop =3D \"$_exec_stop\";" > + > + extract_var $_j consolelog exec.consolelog - \ > + /var/log/jail_${_j}_console.log > + > + eval : = \${jail_${_j}_devfs_enable:=3D${jail_devfs_enable:-NO}} > + if checkyesno jail_${_j}_devfs_enable; then > + echo " mount.devfs;" > + case $_ruleset in > + "") ;; > + [0-9]*) echo " devfs_ruleset =3D = \"$_ruleset\";" ;; > + devfsrules_jail) > + # XXX: This is the default value, > + # Let jail(8) to use the default because > + # mount(8) only accepts an integer.=20 > + # This should accept a ruleset name. > + ;; > + *) warn "devfs_ruleset must be integer." ;; > + esac > + if [ -r $_fstab ]; then > + echo " mount.fstab =3D \"$_fstab\";" > + fi > fi > - fi > -} > - > -# is_current_mountpoint() > -# Is the directory mount point for a currently mounted file > -# system? > -# > -is_current_mountpoint() > -{ > - local _dir _dir2 > - > - _dir=3D$1 > - > - _dir=3D`echo $_dir | sed -Ee 's#//+#/#g' -e 's#/$##'` > - [ ! -d "${_dir}" ] && return 1 > - _dir2=3D`df ${_dir} | tail +2 | awk '{ print $6 }'` > - [ "${_dir}" =3D "${_dir2}" ] > - return $? > -} > - > -# is_symlinked_mountpoint() > -# Is a mount point, or any of its parent directories, a symlink? > -# > -is_symlinked_mountpoint() > -{ > - local _dir > - > - _dir=3D$1 > - > - [ -L "$_dir" ] && return 0 > - [ "$_dir" =3D "/" ] && return 1 > - is_symlinked_mountpoint `dirname $_dir` > - return $? > -} > - > -# secure_umount > -# Try to unmount a mount point without being vulnerable to > -# symlink attacks. > -# > -secure_umount() > -{ > - local _dir > - > - _dir=3D$1 > - > - if is_current_mountpoint ${_dir}; then > - umount -f ${_dir} >/dev/null 2>&1 > - else > - debug "Nothing mounted on ${_dir} - not unmounting" > - fi > -} > - > - > -# jail_umount_fs > -# This function unmounts certain special filesystems in the > -# currently selected jail. The caller must call the = init_variables() > -# routine before calling this one. > -# > -jail_umount_fs() > -{ > - local _device _mountpt _rest >=20 > - if checkyesno _fdescfs; then > - if [ -d "${_fdescdir}" ] ; then > - secure_umount ${_fdescdir} > - fi > - fi > - if checkyesno _devfs; then > - if [ -d "${_devdir}" ] ; then > - secure_umount ${_devdir} > + eval : = \${jail_${_j}_fdescfs_enable:=3D${jail_fdescfs_enable:-NO}} > + if checkyesno jail_${_j}_fdescfs_enable; then > + echo " mount +=3D " \ > + "\"fdescfs ${_rootdir%/}/dev/fd fdescfs rw 0 = 0\";" > fi > - fi > - if checkyesno _procfs; then > - if [ -d "${_procdir}" ] ; then > - secure_umount ${_procdir} > + eval : = \${jail_${_j}_procfs_enable:=3D${jail_procfs_enable:-NO}} > + if checkyesno jail_${_j}_procfs_enable; then > + echo " mount +=3D " \ > + "\"procfs ${_rootdir%/}/proc procfs rw 0 = 0\";" > fi > - fi > - if checkyesno _mount; then > - [ -f "${_fstab}" ] || warn "${_fstab} does not exist" > - tail -r ${_fstab} | while read _device _mountpt _rest; = do > - case ":${_device}" in > - :#* | :) > - continue > - ;; > - esac > - secure_umount ${_mountpt} > - done > - fi > -} >=20 > -# jail_mount_fstab() > -# Mount file systems from a per jail fstab while trying to > -# secure against symlink attacks at the mount points. > -# > -# If we are certain we cannot secure against symlink attacks we > -# do not mount all of the file systems (since we cannot just not > -# mount the file system with the problematic mount point). > -# > -# The caller must call the init_variables() routine before > -# calling this one. > -# > -jail_mount_fstab() > -{ > - local _device _mountpt _rest > + echo " ${_parameters};" >=20 > - while read _device _mountpt _rest; do > - case ":${_device}" in > - :#* | :) > - continue > - ;; > - esac > - if is_symlinked_mountpoint ${_mountpt}; then > - warn "${_mountpt} has symlink as parent - not = mounting from ${_fstab}" > - return > + eval : = \${jail_${_j}_mount_enable:=3D${jail_mount_enable:-NO}} > + if checkyesno jail_${_j}_mount_enable; then > + echo " allow.mount;" >> $_conf > fi > - done <${_fstab} > - mount -a -F "${_fstab}" > -} > - > -# jail_show_addresses jail > -# Debug print the input for the given _multi aliases > -# for a jail for init_variables(). > -# > -jail_show_addresses() > -{ > - local _j _type alias > - _j=3D"$1" > - alias=3D0 >=20 > - if [ -z "${_j}" ]; then > - warn "jail_show_addresses: you must specify a jail" > - return > - fi > + extract_var $_j set_hostname_allow allow.set_hostname YN = NO > + extract_var $_j sysvipc_allow allow.sysvipc YN NO > + echo "}" > + ) >> $_conf >=20 > - while : ; do > - eval _addr=3D\"\$jail_${_j}_ip_multi${alias}\" > - if [ -n "${_addr}" ]; then > - debug "${_j} ip_multi${alias}: $_addr" > - alias=3D$((${alias} + 1)) > - else > - break > - fi > - done > + return 0 > } >=20 > -# jail_extract_address argument > +# jail_extract_address argument iface > # The second argument is the string from one of the _ip > # or the _multi variables. In case of a comma separated list > # only one argument must be passed in at a time. > @@ -382,8 +258,9 @@ jail_show_addresses() > # > jail_extract_address() > { > - local _i > + local _i _interface > _i=3D$1 > + _interface=3D$2 >=20 > if [ -z "${_i}" ]; then > warn "jail_extract_address: called without input" > @@ -439,21 +316,21 @@ jail_extract_address() > _mask=3D${_mask:-/32} >=20 > elif [ "${_type}" =3D "inet6" ]; then > - # In case _maske is not set for IPv6, use /128. > - _mask=3D${_mask:-/128} > + # In case _maske is not set for IPv6, use /64. > + _mask=3D${_mask:-/64} > fi > } >=20 > -# jail_handle_ips_option {add,del} input > +# jail_handle_ips_option input iface > # Handle a single argument imput which can be a comma separated > # list of addresses (theoretically with an option interface and > # prefix/netmask/prefixlen). > # > jail_handle_ips_option() > { > - local _x _action _type _i > - _action=3D$1 > - _x=3D$2 > + local _x _type _i _iface > + _x=3D$1 > + _iface=3D$2 >=20 > if [ -z "${_x}" ]; then > # No IP given. This can happen for the primary address > @@ -468,294 +345,146 @@ jail_handle_ips_option() > *,*) # Extract the first argument and strip it off = the list. > _i=3D`expr "${_x}" : '^\([^,]*\)'` > _x=3D`expr "${_x}" : "^[^,]*,\(.*\)"` > - ;; > + ;; > *) _i=3D${_x} > _x=3D"" > - ;; > + ;; > esac >=20 > _type=3D"" > - _iface=3D"" > _addr=3D"" > _mask=3D"" > - jail_extract_address "${_i}" > + jail_extract_address $_i $_iface >=20 > # make sure we got an address. > - case "${_addr}" in > + case $_addr in > "") continue ;; > *) ;; > esac >=20 > # Append address to list of addresses for the jail = command. > - case "${_type}" in > + case $_type in > inet) > - case "${_addrl}" in > - "") _addrl=3D"${_addr}" ;; > - *) _addrl=3D"${_addrl},${_addr}" ;; > - esac > - ;; > + echo " ip4.addr +=3D \"${_addr}${_mask}\";" > + ;; > inet6) > - case "${_addr6l}" in > - "") _addr6l=3D"${_addr}" ;; > - *) _addr6l=3D"${_addr6l},${_addr}" ;; > - esac > - ;; > - esac > - > - # Configure interface alias if requested by a given = interface > - # and if we could correctly parse everything. > - case "${_iface}" in > - "") continue ;; > - esac > - case "${_type}" in > - inet) ;; > - inet6) ipv6_address_count=3D$((ipv6_address_count + 1)) = ;; > - *) warn "Could not determine address family. Not = going" \ > - "to ${_action} address '${_addr}' for = ${_jail}." > - continue > - ;; > - esac > - case "${_action}" in > - add) ifconfig ${_iface} ${_type} ${_addr}${_mask} = alias > - ;; > - del) # When removing the IP, ignore the _mask. > - ifconfig ${_iface} ${_type} ${_addr} -alias > - ;; > + echo " ip6.addr +=3D \"${_addr}${_mask}\";" > + need_dad_wait=3D1 > + ;; > esac > done > } >=20 > -# jail_ips {add,del} > -# Extract the comma separated list of addresses and return them > -# for the jail command. > -# Handle more than one address via the _multi option as well. > -# If an interface is given also add/remove an alias for the > -# address with an optional netmask. > -# > -jail_ips() > +jail_config() > { > - local _action > - _action=3D$1 > - > - case "${_action}" in > - add) ;; > - del) ;; > - *) warn "jail_ips: invalid action '${_action}'" > - return > - ;; > + case $1 in > + _ALL) return ;; > esac > - > - # Handle addresses. > - ipv6_address_count=3D0 > - jail_handle_ips_option ${_action} "${_ip}" > - # Handle jail_xxx_ip_multi > - alias=3D0 > - while : ; do > - eval _x=3D\"\$jail_${_jail}_ip_multi${alias}\" > - case "${_x}" in > - "") break ;; > - *) jail_handle_ips_option ${_action} "${_x}" > - alias=3D$((${alias} + 1)) > - ;; > - esac > + for _jail in $@; do > + if parse_options $_jail; then=20 > + echo "$_jail: parameters are in $_conf." > + fi > done > - case ${ipv6_address_count} in > - 0) ;; > - *) # Sleep 1 second to let DAD complete before starting = services. > - sleep 1 > - ;; > +} > + > +jail_console() > +{ > + # One argument that is not _ALL. > + case $#:$1 in > + 1:_ALL) err 3 "Specify a jail name." ;; > + 1:*) ;; > + *) err 3 "Specify a jail name." ;; > esac > + eval _cmd=3D\${jail_$1_consolecmd:-$jail_consolecmd} > + $jail_jexec $1 $_cmd > } >=20 > -jail_prestart() > +jail_status() > { > - if checkyesno jail_parallel_start; then > - command_args=3D'&' > - fi > + > + $jail_jls -N > } >=20 > jail_start() > { > - echo -n 'Configuring jails:' > - set_sysctl jail_set_hostname_allow = security.jail.set_hostname_allowed \ > - set_hostname_allow > - set_sysctl jail_socket_unixiproute_only \ > - security.jail.socket_unixiproute_only unixiproute_only > - set_sysctl jail_sysvipc_allow security.jail.sysvipc_allowed \ > - sysvipc_allow > - echo '.' > - > + if [ $# =3D 0 ]; then > + return > + fi > echo -n 'Starting jails:' > - _tmp_dir=3D`mktemp -d /tmp/jail.XXXXXXXX` || \ > - err 3 "$name: Can't create temp dir, exiting..." > - for _jail in ${jail_list} > - do > - init_variables $_jail > - if [ -f /var/run/jail_${_jail}.id ]; then > - echo -n " [${_hostname} already running = (/var/run/jail_${_jail}.id exists)]" > - continue; > - fi > - _addrl=3D"" > - _addr6l=3D"" > - jail_ips "add" > - if [ -n "${_fib}" ]; then > - _setfib=3D"setfib -F '${_fib}'" > + case $1 in > + _ALL) > + echo -n ' ' > + command=3D$jail_program > + rc_flags=3D$jail_flags > + command_args=3D"-f $jail_conf -c" > + $command $rc_flags $command_args "*" > + echo '.' > + return > + ;; > + esac > + _tmp=3D`mktemp -t jail` || exit 3 > + for _jail in $@; do > + parse_options $_jail || continue > + > + eval rc_flags=3D\${jail_${_j}_flags:-$jail_flags} > + eval command=3D\${jail_${_j}_program:-$jail_program} > + if checkyesno jail_parallel_start; then > + command_args=3D"-i -f $_conf -c $_jail &" > else > - _setfib=3D"" > - fi > - if checkyesno _mount; then > - info "Mounting fstab for jail ${_jail} = (${_fstab})" > - if [ ! -f "${_fstab}" ]; then > - err 3 "$name: ${_fstab} does not exist" > - fi > - jail_mount_fstab > - fi > - if checkyesno _devfs; then > - # If devfs is already mounted here, skip it. > - df -t devfs "${_devdir}" >/dev/null > - if [ $? -ne 0 ]; then > - if is_symlinked_mountpoint ${_devdir}; = then > - warn "${_devdir} has symlink as = parent - not starting jail ${_jail}" > - continue > - fi > - info "Mounting devfs on ${_devdir}" > - devfs_mount_jail "${_devdir}" = ${_ruleset} > - # Transitional symlink for old binaries > - if [ ! -L "${_devdir}/log" ]; then > - ln -sf ../var/run/log = "${_devdir}/log" > - fi > - fi > - > - # XXX - It seems symlinks don't work when there > - # is a devfs(5) device of the same name. > - # Jail console output > - # __pwd=3D"`pwd`" > - # cd "${_devdir}" > - # ln -sf ../var/log/console console > - # cd "$__pwd" > - fi > - if checkyesno _fdescfs; then > - if is_symlinked_mountpoint ${_fdescdir}; then > - warn "${_fdescdir} has symlink as = parent, not mounting" > - else > - info "Mounting fdescfs on ${_fdescdir}" > - mount -t fdescfs fdesc "${_fdescdir}" > - fi > - fi > - if checkyesno _procfs; then > - if is_symlinked_mountpoint ${_procdir}; then > - warn "${_procdir} has symlink as parent, = not mounting" > - else > - info "Mounting procfs onto ${_procdir}" > - if [ -d "${_procdir}" ] ; then > - mount -t procfs proc = "${_procdir}" > - fi > - fi > + command_args=3D"-i -f $_conf -c $_jail" > fi > - _tmp_jail=3D${_tmp_dir}/jail.$$ > - > - i=3D0 > - while : ; do > - eval out=3D\"\${_exec_prestart${i}:-''}\" > - [ -z "$out" ] && break > - ${out} > - i=3D$((i + 1)) > - done > - > - eval ${_setfib} jail -n ${_jail} ${_flags} -i -c = path=3D${_rootdir} host.hostname=3D${_hostname} \ > - ${_addrl:+ip4.addr=3D\"${_addrl}\"} = ${_addr6l:+ip6.addr=3D\"${_addr6l}\"} \ > - ${_parameters} command=3D${_exec_start} > = ${_tmp_jail} 2>&1 \ > - - > - if [ "$?" -eq 0 ] ; then > - _jail_id=3D$(head -1 ${_tmp_jail}) > - i=3D1 > - while : ; do > - eval = out=3D\"\${_exec_afterstart${i}:-''}\" > - > - if [ -z "$out" ]; then > - break; > - fi > - > - jexec "${_jail_id}" ${out} > - i=3D$((i + 1)) > - done > - > - echo -n " $_hostname" > - tail +2 ${_tmp_jail} >${_consolelog} > - echo ${_jail_id} > /var/run/jail_${_jail}.id > - > - i=3D0 > - while : ; do > - eval out=3D\"\${_exec_poststart${i}:-''}\"= > - [ -z "$out" ] && break > - ${out} > - i=3D$((i + 1)) > - done > + if $command $rc_flags $command_args \ > + >> $_tmp 2>&1 + echo -n " ${_hostname:-${_jail}}" > else > - jail_umount_fs > - jail_ips "del" > - echo " cannot start jail \"${_jail}\": " > - tail +2 ${_tmp_jail} > + echo " cannot start jail = \"${_hostname:-${jail}}\": " > + tail +2 $_tmp > fi > - rm -f ${_tmp_jail} > + rm -f $_tmp > done > - rmdir ${_tmp_dir} > echo '.' > } >=20 > jail_stop() > { > + if [ $# =3D 0 ]; then > + return > + fi > echo -n 'Stopping jails:' > - for _jail in ${jail_list} > - do > - if [ -f "/var/run/jail_${_jail}.id" ]; then > - _jail_id=3D$(cat /var/run/jail_${_jail}.id) > - if [ ! -z "${_jail_id}" ]; then > - init_variables $_jail > - > - i=3D0 > - while : ; do > - eval = out=3D\"\${_exec_prestop${i}:-''}\" > - [ -z "$out" ] && break > - ${out} >=20 > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** --=20 /"\ With kind regards, | remko@elvandar.org \ / Remko Lodder | remko@FreeBSD.org X FreeBSD | = http://www.evilcoder.org / \ The Power to Serve | Quis custodiet ipsos custodes --Apple-Mail=_EE56DFCD-625B-41F1-9E20-0F47A1A3EE82 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQIcBAEBAgAGBQJSV/dMAAoJEKjD27JZ84ywesQP/RXhI39Get8gQsMRWKZ5vx/R T/nPalo0naFQgAyYDgjUTiVmp0WhCvX5OWiBN5VDQdVy6XfhX/GB5Vtq/kpDQUq5 qpjieytPgvSWyw2R084eCE+dUGifG9hyNbUIU6AoiXzHEdOBJxDC7ZiGMwHk1QMj RSd1I/9Su+3xppoYJVLdLRT7R1lLY4VhIbQizNMVaisJbF7C6HvFG0kE8GOy3UJk Dq/eEDO7ae6tGIsbctRBFp+Z4FtL1LdtXemwYv+fkaYw3V124XO0zLN1+8xa0b0i EJAWA7ac+PqCtZasfIb8x1uFHaPzcVWF+4g8QypWfZXPEkL/dxQ63FBdR6LcSpub waRIz5JiBMTi5dHus5aLsrh67LZ0cnZXWkhjZo8/bZt6ObtZFP1SCZ7jIzs1j2ge hri1wVIfKeQhKTbJUyahPP/53Tamh8aI96z9YQnKVhCWWIh1+zXBMvRPXkdElYo5 3/cz4UM2kPiUPMpu9XqiEFUiYmVNr8bTHfLfk2+XmMxXcnDg8Zc60tCWZmSQ8myE r3AeoJWaR5PnrHPsYmpBGMorXYdTYxGpN0HjCFXgC55UH/mVIGCnWTBi04SjjcCf dl8J7ftRUBj3Cr4Og8bwXAO9uln/6pLCL1xGBeH6NKO49t+L/6Y8vbvz3O4Bdn/M rlNrifr3+jUM1i79mxhC =9VQs -----END PGP SIGNATURE----- --Apple-Mail=_EE56DFCD-625B-41F1-9E20-0F47A1A3EE82-- From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 15:06:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DC1E6BE5; Fri, 11 Oct 2013 15:06:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CA31C2B70; Fri, 11 Oct 2013 15:06:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BF6DG4028747; Fri, 11 Oct 2013 15:06:13 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BF6D71028746; Fri, 11 Oct 2013 15:06:13 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310111506.r9BF6D71028746@svn.freebsd.org> From: Glen Barber Date: Fri, 11 Oct 2013 15:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r256316 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 15:06:13 -0000 Author: gjb Date: Fri Oct 11 15:06:13 2013 New Revision: 256316 URL: http://svnweb.freebsd.org/changeset/base/256316 Log: Set up mailer.conf for stable-10 branch. Submitted by: des Approved by: re (implicit) Modified: svnadmin/conf/mailer.conf Modified: svnadmin/conf/mailer.conf ============================================================================== --- svnadmin/conf/mailer.conf Fri Oct 11 14:23:54 2013 (r256315) +++ svnadmin/conf/mailer.conf Fri Oct 11 15:06:13 2013 (r256316) @@ -341,6 +341,10 @@ to_addr = src-committers@freebsd.org svn for_paths = ^head(/[^/]+)*$ to_addr = src-committers@freebsd.org svn-src-all@freebsd.org svn-src-head@freebsd.org +[stable-10] +for_paths = ^stable/10(/[^/]+)*$ +to_addr = src-committers@freebsd.org svn-src-all@freebsd.org svn-src-stable@freebsd.org svn-src-stable-10@freebsd.org + [stable-9] for_paths = ^stable/9(/[^/]+)*$ to_addr = src-committers@freebsd.org svn-src-all@freebsd.org svn-src-stable@freebsd.org svn-src-stable-9@freebsd.org From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 16:57:08 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 32A1BA5C; Fri, 11 Oct 2013 16:57:08 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 313B62362; Fri, 11 Oct 2013 16:57:07 +0000 (UTC) Received: from alph.d.allbsd.org (p4181-ipbf1307funabasi.chiba.ocn.ne.jp [123.225.173.181]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r9BGulrw018245 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 12 Oct 2013 01:56:58 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.7/8.14.5) with ESMTP id r9BGujqa077778; Sat, 12 Oct 2013 01:56:47 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Sat, 12 Oct 2013 01:56:39 +0900 (JST) Message-Id: <20131012.015639.236155929172394900.hrs@allbsd.org> To: remko@FreeBSD.org Subject: Re: svn commit: r256256 - in head: . etc etc/defaults etc/rc.d share/man/man5 usr.sbin/jail From: Hiroki Sato In-Reply-To: <04E9979E-1D97-4AA2-A7AE-F9D8457B3599@FreeBSD.org> References: <201310100932.r9A9WS0H013645@svn.freebsd.org> <04E9979E-1D97-4AA2-A7AE-F9D8457B3599@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Sat_Oct_12_01_56_39_2013_703)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Sat, 12 Oct 2013 01:56:58 +0900 (JST) X-Spam-Status: No, score=-97.0 required=13.0 tests=CONTENT_TYPE_PRESENT, ONLY1HOPDIRECT,SAMEHELOBY2HOP,SPF_SOFTFAIL,USER_IN_WHITELIST,X_CHINESE_RELAY autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.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: Fri, 11 Oct 2013 16:57:08 -0000 ----Security_Multipart(Sat_Oct_12_01_56_39_2013_703)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Remko Lodder wrote in <04E9979E-1D97-4AA2-A7AE-F9D8457B3599@FreeBSD.org>: re> re> Hi Hiroki, re> re> On Oct 10, 2013, at 11:32 AM, Hiroki Sato wrote: re> re> > Author: hrs re> > Date: Thu Oct 10 09:32:27 2013 re> > New Revision: 256256 re> > URL: http://svnweb.freebsd.org/changeset/base/256256 re> > re> > Log: re> > - Update rc.d/jail to use a jail(8) configuration file instead of re> > command line options. The "jail__*" rc.conf(5) variables for re> > per-jail configuration are automatically converted to re> > /var/run/jail..conf before the jail(8) utility is invoked. re> > This is transparently backward compatible. re> > re> > - Fix a minor bug in jail(8) which prevented it from returning false re> > when jail -r failed. re> > re> re> Thanks for doing such a massive update. However it seems to break the re> ezjail utility. re> My jails didn't restart after I upgraded to the most recent -head re> version re> re> FreeBSD nakur.elvandar.org 10.0-ALPHA6 FreeBSD 10.0-ALPHA6 #7 r256311: re> Fri Oct 11 13:27:54 CEST 2013 re> root@nakur.elvandar.org:/usr/obj/usr/src/sys/NAKUR amd64 re> re> If I replace this with an older version, the utility starts and re> complains about certain things not being done properly. The re> system does not mount devfs nodes anylonger and thus is basically out re> of function. re> re> I was not expecting this much fallout from this change, others that re> will be upgrading will loose the ability to start their jails until re> they can re> resolve this by hand. Can you send me your ezjail configuration and differences of the results (error messages, mount handling, etc) between old and new rc.d/jail? -- Hiroki ----Security_Multipart(Sat_Oct_12_01_56_39_2013_703)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlJYLccACgkQTyzT2CeTzy0KPACg2brJO5mmbItzt/ZzjP6I3e7S 6cwAn20KV53DoM8xpqbayTFpY7bhbA63 =sa1T -----END PGP SIGNATURE----- ----Security_Multipart(Sat_Oct_12_01_56_39_2013_703)---- From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 17:00:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 36649CA2; Fri, 11 Oct 2013 17:00:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 21DB32393; Fri, 11 Oct 2013 17:00:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BH092I086611; Fri, 11 Oct 2013 17:00:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BH09IY086609; Fri, 11 Oct 2013 17:00:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310111700.r9BH09IY086609@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Oct 2013 17:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256317 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 17:00:10 -0000 Author: mav Date: Fri Oct 11 17:00:09 2013 New Revision: 256317 URL: http://svnweb.freebsd.org/changeset/base/256317 Log: Fix mode page length calculation to remove last garbage line from the `camcontrol mode daX -l` output. PR Approved by: re (gjb) MFC after: 2 weeks Modified: head/sbin/camcontrol/modeedit.c Modified: head/sbin/camcontrol/modeedit.c ============================================================================== --- head/sbin/camcontrol/modeedit.c Fri Oct 11 15:06:13 2013 (r256316) +++ head/sbin/camcontrol/modeedit.c Fri Oct 11 17:00:09 2013 (r256317) @@ -886,12 +886,12 @@ mode_list(struct cam_device *device, int timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; - len = mh->blk_desc_len; /* Skip block descriptors. */ + len = sizeof(*mh) + mh->blk_desc_len; /* Skip block descriptors. */ /* Iterate through the pages in the reply. */ while (len < mh->data_length) { /* Locate the next mode page header. */ mph = (struct scsi_mode_page_header *) - ((intptr_t)mh + sizeof(*mh) + len); + ((intptr_t)mh + len); mph->page_code &= SMS_PAGE_CODE; nameentry = nameentry_lookup(mph->page_code); From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 17:10:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AD7B9236; Fri, 11 Oct 2013 17:10:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9AD8D2493; Fri, 11 Oct 2013 17:10:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BHASVL091877; Fri, 11 Oct 2013 17:10:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BHASCn091876; Fri, 11 Oct 2013 17:10:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310111710.r9BHASCn091876@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Oct 2013 17:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256318 - stable/10/sbin/camcontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 17:10:28 -0000 Author: mav Date: Fri Oct 11 17:10:28 2013 New Revision: 256318 URL: http://svnweb.freebsd.org/changeset/base/256318 Log: MFC r256317: Fix mode page length calculation to remove last garbage line from the `camcontrol mode daX -l` output. Approved by: re (gjb) Modified: stable/10/sbin/camcontrol/modeedit.c Directory Properties: stable/10/sbin/camcontrol/ (props changed) Modified: stable/10/sbin/camcontrol/modeedit.c ============================================================================== --- stable/10/sbin/camcontrol/modeedit.c Fri Oct 11 17:00:09 2013 (r256317) +++ stable/10/sbin/camcontrol/modeedit.c Fri Oct 11 17:10:28 2013 (r256318) @@ -886,12 +886,12 @@ mode_list(struct cam_device *device, int timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; - len = mh->blk_desc_len; /* Skip block descriptors. */ + len = sizeof(*mh) + mh->blk_desc_len; /* Skip block descriptors. */ /* Iterate through the pages in the reply. */ while (len < mh->data_length) { /* Locate the next mode page header. */ mph = (struct scsi_mode_page_header *) - ((intptr_t)mh + sizeof(*mh) + len); + ((intptr_t)mh + len); mph->page_code &= SMS_PAGE_CODE; nameentry = nameentry_lookup(mph->page_code); From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 17:34:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 16242838; Fri, 11 Oct 2013 17:34:21 +0000 (UTC) (envelope-from edavis@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 02B8D260E; Fri, 11 Oct 2013 17:34:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BHYKe5005205; Fri, 11 Oct 2013 17:34:20 GMT (envelope-from edavis@svn.freebsd.org) Received: (from edavis@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BHYKb7005201; Fri, 11 Oct 2013 17:34:20 GMT (envelope-from edavis@svn.freebsd.org) Message-Id: <201310111734.r9BHYKb7005201@svn.freebsd.org> From: Eric Davis Date: Fri, 11 Oct 2013 17:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256319 - stable/10/sys/dev/bxe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 17:34:21 -0000 Author: edavis Date: Fri Oct 11 17:34:20 2013 New Revision: 256319 URL: http://svnweb.freebsd.org/changeset/base/256319 Log: Merge r256299 from head. Approved by: re@ (gjb) Approved by: davidch (mentor) Modified: stable/10/sys/dev/bxe/bxe.c stable/10/sys/dev/bxe/bxe_stats.c stable/10/sys/dev/bxe/ecore_sp.h Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Fri Oct 11 17:10:28 2013 (r256318) +++ stable/10/sys/dev/bxe/bxe.c Fri Oct 11 17:34:20 2013 (r256319) @@ -34,7 +34,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.17" +#define BXE_DRIVER_VERSION "1.78.18" #include "bxe.h" #include "ecore_sp.h" @@ -936,8 +936,8 @@ bxe_dma_alloc(struct bxe_softc *sc, int rc; if (dma->size > 0) { - BLOGE(sc, "dma block '%s' already has size %lu\n", msg, - (unsigned long) dma->size); + BLOGE(sc, "dma block '%s' already has size %lu\n", msg, + (unsigned long)dma->size); return (1); } @@ -14201,8 +14201,14 @@ bxe_media_detect(struct bxe_softc *sc) uint32_t phy_idx = bxe_get_cur_phy_idx(sc); switch (sc->link_params.phy[phy_idx].media_type) { case ELINK_ETH_PHY_SFPP_10G_FIBER: - case ELINK_ETH_PHY_SFP_1G_FIBER: case ELINK_ETH_PHY_XFP_FIBER: + BLOGI(sc, "Found 10Gb Fiber media.\n"); + sc->media = IFM_10G_SR; + break; + case ELINK_ETH_PHY_SFP_1G_FIBER: + BLOGI(sc, "Found 1Gb Fiber media.\n"); + sc->media = IFM_1000_SX; + break; case ELINK_ETH_PHY_KR: case ELINK_ETH_PHY_CX4: BLOGI(sc, "Found 10GBase-CX4 media.\n"); @@ -14213,8 +14219,14 @@ bxe_media_detect(struct bxe_softc *sc) sc->media = IFM_10G_TWINAX; break; case ELINK_ETH_PHY_BASE_T: - BLOGI(sc, "Found 10GBase-T media.\n"); - sc->media = IFM_10G_T; + if (sc->link_params.speed_cap_mask[0] & + PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) { + BLOGI(sc, "Found 10GBase-T media.\n"); + sc->media = IFM_10G_T; + } else { + BLOGI(sc, "Found 1000Base-T media.\n"); + sc->media = IFM_1000_T; + } break; case ELINK_ETH_PHY_NOT_PRESENT: BLOGI(sc, "Media not present.\n"); Modified: stable/10/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/10/sys/dev/bxe/bxe_stats.c Fri Oct 11 17:10:28 2013 (r256318) +++ stable/10/sys/dev/bxe/bxe_stats.c Fri Oct 11 17:34:20 2013 (r256319) @@ -263,6 +263,17 @@ bxe_stats_pmf_update(struct bxe_softc *s int loader_idx = PMF_DMAE_C(sc); uint32_t *stats_comp = BXE_SP(sc, stats_comp); + if (sc->devinfo.bc_ver <= 0x06001400) { + /* + * Bootcode v6.0.21 fixed a GRC timeout that occurs when accessing + * BRB registers while the BRB block is in reset. The DMA transfer + * below triggers this issue resulting in the DMAE to stop + * functioning. Skip this initial stats transfer for old bootcode + * versions <= 6.0.20. + */ + return; + } + /* sanity */ if (!sc->port.pmf || !sc->port.port_stx) { BLOGE(sc, "BUG!\n"); Modified: stable/10/sys/dev/bxe/ecore_sp.h ============================================================================== --- stable/10/sys/dev/bxe/ecore_sp.h Fri Oct 11 17:10:28 2013 (r256318) +++ stable/10/sys/dev/bxe/ecore_sp.h Fri Oct 11 17:34:20 2013 (r256319) @@ -77,9 +77,14 @@ struct bxe_softc; typedef bus_addr_t ecore_dma_addr_t; /* expected to be 64 bit wide */ typedef volatile int ecore_atomic_t; -#if __FreeBSD_version < 1000002 -typedef int bool; +#ifndef __bool_true_false_are_defined +#ifndef __cplusplus +#define bool _Bool +#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER) +typedef _Bool bool; #endif +#endif /* !__cplusplus */ +#endif /* !__bool_true_false_are_defined$ */ #define ETH_ALEN ETHER_ADDR_LEN /* 6 */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 17:39:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4349A9B3; Fri, 11 Oct 2013 17:39:34 +0000 (UTC) (envelope-from edavis@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2FF9D263C; Fri, 11 Oct 2013 17:39:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BHdX1q006543; Fri, 11 Oct 2013 17:39:33 GMT (envelope-from edavis@svn.freebsd.org) Received: (from edavis@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BHdXH6006542; Fri, 11 Oct 2013 17:39:33 GMT (envelope-from edavis@svn.freebsd.org) Message-Id: <201310111739.r9BHdXH6006542@svn.freebsd.org> From: Eric Davis Date: Fri, 11 Oct 2013 17:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256320 - stable/10/share/misc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 17:39:34 -0000 Author: edavis Date: Fri Oct 11 17:39:33 2013 New Revision: 256320 URL: http://svnweb.freebsd.org/changeset/base/256320 Log: Merge r256280 from head. Approved by: re@ (gjb) Approved by: davidch (mentor) Modified: stable/10/share/misc/committers-src.dot Directory Properties: stable/10/share/misc/ (props changed) Modified: stable/10/share/misc/committers-src.dot ============================================================================== --- stable/10/share/misc/committers-src.dot Fri Oct 11 17:34:20 2013 (r256319) +++ stable/10/share/misc/committers-src.dot Fri Oct 11 17:39:33 2013 (r256320) @@ -145,6 +145,7 @@ dumbbell [label="Jean-Sebastien Pedron\n dwmalone [label="David Malone\ndwmalone@FreeBSD.org\n2000/07/11"] eadler [label="Eitan Adler\neadler@FreeBSD.org\n2012/01/18"] ed [label="Ed Schouten\ned@FreeBSD.org\n2008/05/22"] +edavis [label="Eric Davis\nedavis@FreeBSD.org\n2013/10/09"] edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2007/06/25"] eivind [label="Eivind Eklund\neivind@FreeBSD.org\n1997/02/02"] emaste [label="Ed Maste\nemaste@FreeBSD.org\n2005/10/04"] From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 17:52:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7F4C2F62; Fri, 11 Oct 2013 17:52:44 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5CF6C273D; Fri, 11 Oct 2013 17:52:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BHqi1C015028; Fri, 11 Oct 2013 17:52:44 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BHqikM015027; Fri, 11 Oct 2013 17:52:44 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310111752.r9BHqikM015027@svn.freebsd.org> From: Devin Teske Date: Fri, 11 Oct 2013 17:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256321 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 17:52:44 -0000 Author: dteske Date: Fri Oct 11 17:52:43 2013 New Revision: 256321 URL: http://svnweb.freebsd.org/changeset/base/256321 Log: Add support for obtaining the capacity of disks. Add comment while here. Approved by: re (glebius) Modified: head/usr.sbin/bsdconfig/share/device.subr Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Fri Oct 11 17:39:33 2013 (r256320) +++ head/usr.sbin/bsdconfig/share/device.subr Fri Oct 11 17:52:43 2013 (r256321) @@ -49,6 +49,7 @@ f_struct_define DEVICE \ desc \ devname \ type \ + capacity \ enabled \ init \ get \ @@ -114,7 +115,7 @@ f_device_try() } # f_device_register $name $desc $devname $type $enabled $init_function \ -# $get_function $shutdown_function $private +# $get_function $shutdown_function $private $capacity # # Register a device. A `structure' (see struct.subr) is created with the name # device_$name (so make sure $name contains only alpha-numeric characters or @@ -128,6 +129,7 @@ f_device_register() { local name="$1" desc="$2" devname="$3" type="$4" enabled="$5" local init_func="$6" get_func="$7" shutdown_func="$8" private="$9" + local capacity="${10}" f_struct_new DEVICE "device_$name" || return $FAILURE device_$name set name "$name" @@ -139,6 +141,7 @@ f_device_register() device_$name set get "$get_func" device_$name set shutdown "$shutdown_func" device_$name set private "$private" + device_$name set capacity "$capacity" # Scan our global register to see if it needs ammending local dev found= @@ -196,7 +199,7 @@ f_device_get_all() f_dprintf "Found a network device named %s" "$devname" f_device_register $devname \ "$desc" "$devname" $DEVICE_TYPE_NETWORK 1 \ - f_media_init_network "" f_media_shutdown_network "" + f_media_init_network "" f_media_shutdown_network "" -1 done # Next, try to find all the types of devices one might use @@ -208,6 +211,10 @@ f_device_get_all() n=$(( $n + 1 )) # Get the desc, type, and max (with debugging disabled) # NOTE: Bypassing f_device_name_get() for efficiency + # ASIDE: This would be equivalent to the following: + # debug= f_device_name_get $dev desc + # debug= f_device_name_get $dev type + # debug= f_device_name_get $dev max debug= f_getvar _device_desc$n desc debug= f_getvar _device_type$n type debug= f_getvar _device_max$n max @@ -222,7 +229,8 @@ f_device_get_all() f_device_register "${devname##*/}" "$desc" \ "$devname" $DEVICE_TYPE_CDROM 1 \ f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" + f_media_shutdown_cdrom "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a CDROM device for %s" \ "$devname" ;; @@ -232,7 +240,8 @@ f_device_get_all() "$devname" $DEVICE_TYPE_FLOPPY 1 \ f_media_init_floppy \ f_media_get_floppy \ - f_media_shutdown_floppy "" + f_media_shutdown_floppy "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a floppy device for %s" \ "$devname" ;; @@ -241,7 +250,8 @@ f_device_get_all() f_device_register "${devname##*/}" "$desc" \ "$devname" $DEVICE_TYPE_USB 1 \ f_media_init_usb f_media_get_usb \ - f_media_shutdown_usb "" + f_media_shutdown_usb "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a USB disk for %s" "$devname" ;; esac @@ -254,7 +264,8 @@ f_device_get_all() f_device_register "${devname##*/}" "ISO9660 file system" \ "$devname" $DEVICE_TYPE_CDROM 1 \ f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" + f_media_shutdown_cdrom "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a CDROM device for %s" "$devname" done @@ -281,7 +292,8 @@ f_device_get_all() "md(4) vnode file system" \ "$devname" $DEVICE_TYPE_CDROM 1 \ f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" + f_media_shutdown_cdrom "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a CDROM device for %s" "$devname" ;; esac @@ -327,7 +339,8 @@ f_device_get_all() f_device_register "$slice" "" \ "/dev/$slice" $DEVICE_TYPE_DOS 1 \ f_media_init_dos f_media_get_dos \ - f_media_shutdown_dos "" + f_media_shutdown_dos "" \ + "$( f_device_capacity "/dev/$slice" )" f_dprintf "Found a DOS partition %s" "$slice" ;; 0xa5) # FreeBSD partition @@ -347,7 +360,9 @@ f_device_get_all() $DEVICE_TYPE_UFS 1 \ f_media_init_ufs \ f_media_get_ufs \ - f_media_shutdown_ufs "" + f_media_shutdown_ufs "" \ + "$( f_device_capacity \ + "$/dev/$part" )" f_dprintf "Found a UFS partition %s" \ "$part" done # parts @@ -655,6 +670,25 @@ f_device_menu() return $retval } +# f_device_capacity $device [$var_to_set] +# +# Return the capacity of $device in bytes. +# +f_device_capacity() +{ + local __dev="$1" __var_to_set="$2" + local __bytes + + __bytes=$( diskinfo -v "$__dev" 2> /dev/null | + awk '/# mediasize in bytes/{print $1}' ) || __bytes=-1 + + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" "$__bytes" + else + echo "$__bytes" + fi +} + # # Short-hand # From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 17:54:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BE34F17F; Fri, 11 Oct 2013 17:54:22 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB3A3275A; Fri, 11 Oct 2013 17:54:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BHsMtw015321; Fri, 11 Oct 2013 17:54:22 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BHsMnw015320; Fri, 11 Oct 2013 17:54:22 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310111754.r9BHsMnw015320@svn.freebsd.org> From: Devin Teske Date: Fri, 11 Oct 2013 17:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256322 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 17:54:22 -0000 Author: dteske Date: Fri Oct 11 17:54:22 2013 New Revision: 256322 URL: http://svnweb.freebsd.org/changeset/base/256322 Log: Fix a minor bug; if strings.subr was included by itself it may not have access to f_dprintf from common.subr -- fix this by including common.subr. Approved by: re (glebius) Modified: head/usr.sbin/bsdconfig/share/strings.subr Modified: head/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/strings.subr Fri Oct 11 17:52:43 2013 (r256321) +++ head/usr.sbin/bsdconfig/share/strings.subr Fri Oct 11 17:54:22 2013 (r256322) @@ -26,6 +26,11 @@ if [ ! "$_STRINGS_SUBR" ]; then _STRINGS # # $FreeBSD$ # +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 + ############################################################ GLOBALS # From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 18:14:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8FD9D65A; Fri, 11 Oct 2013 18:14:50 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7BAB8289C; Fri, 11 Oct 2013 18:14:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BIEobx026301; Fri, 11 Oct 2013 18:14:50 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BIEoOd026298; Fri, 11 Oct 2013 18:14:50 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310111814.r9BIEoOd026298@svn.freebsd.org> From: Devin Teske Date: Fri, 11 Oct 2013 18:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256323 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 18:14:50 -0000 Author: dteske Date: Fri Oct 11 18:14:49 2013 New Revision: 256323 URL: http://svnweb.freebsd.org/changeset/base/256323 Log: Add a USE_DIALOG global (analogous to USE_XDIALOG); useful for inserting text into a prompt or command syntax iff dialog(1) is in-use. Approved by: re (glebius) Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Fri Oct 11 17:54:22 2013 (r256322) +++ head/usr.sbin/bsdconfig/share/dialog.subr Fri Oct 11 18:14:49 2013 (r256323) @@ -2044,6 +2044,7 @@ f_dialog_menutag2index_with_help() f_dialog_init() { DIALOG_SELF_INITIALIZE= + USE_DIALOG=1 # # Clone terminal stdout so we can redirect to it from within sub-shells @@ -2087,7 +2088,7 @@ f_dialog_init() # # Process `-X' command-line option # - [ "$USE_XDIALOG" ] && DIALOG=Xdialog + [ "$USE_XDIALOG" ] && DIALOG=Xdialog USE_DIALOG= # # Sanity check, or die gracefully From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 18:19:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 12F5597C; Fri, 11 Oct 2013 18:19:09 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EC0372903; Fri, 11 Oct 2013 18:19:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BIJ8YV027460; Fri, 11 Oct 2013 18:19:08 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BIJ8Ml027458; Fri, 11 Oct 2013 18:19:08 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <201310111819.r9BIJ8Ml027458@svn.freebsd.org> From: Ollivier Robert Date: Fri, 11 Oct 2013 18:19: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: r256324 - in stable/9/usr.sbin/ntp: . libparse 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, 11 Oct 2013 18:19:09 -0000 Author: roberto Date: Fri Oct 11 18:19:08 2013 New Revision: 256324 URL: http://svnweb.freebsd.org/changeset/base/256324 Log: MFC r256009: Meinberg clocks support was inadvertently removed during the last vendor import. Add it back. Modified: stable/9/usr.sbin/ntp/config.h stable/9/usr.sbin/ntp/libparse/Makefile Directory Properties: stable/9/usr.sbin/ntp/ (props changed) Modified: stable/9/usr.sbin/ntp/config.h ============================================================================== --- stable/9/usr.sbin/ntp/config.h Fri Oct 11 18:14:49 2013 (r256323) +++ stable/9/usr.sbin/ntp/config.h Fri Oct 11 18:19:08 2013 (r256324) @@ -84,7 +84,7 @@ #define CLOCK_LOCAL 1 /* Meinberg clocks */ -/* #undef CLOCK_MEINBERG */ +#define CLOCK_MEINBERG 1 /* Magnavox MX4200 GPS receiver */ /* #undef CLOCK_MX4200 */ Modified: stable/9/usr.sbin/ntp/libparse/Makefile ============================================================================== --- stable/9/usr.sbin/ntp/libparse/Makefile Fri Oct 11 18:14:49 2013 (r256323) +++ stable/9/usr.sbin/ntp/libparse/Makefile Fri Oct 11 18:19:08 2013 (r256324) @@ -9,7 +9,7 @@ SRCS= clk_computime.c clk_dcf7000.c clk_ clk_rawdcf.c clk_rcc8000.c clk_schmid.c clk_trimtaip.c \ clk_trimtsip.c clk_varitext.c clk_wharton.c data_mbg.c \ info_trimble.c parse.c parse_conf.c trim_info.c \ - binio.c gpstolfp.c + binio.c gpstolfp.c ieee754io.c mfp_mul.c CFLAGS+= -I${.CURDIR}/../../../contrib/ntp/include -I${.CURDIR}/../ From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 18:21:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EAD90B57; Fri, 11 Oct 2013 18:21:06 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C910A2959; Fri, 11 Oct 2013 18:21:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BIL60b030054; Fri, 11 Oct 2013 18:21:06 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BIL6Wv030049; Fri, 11 Oct 2013 18:21:06 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310111821.r9BIL6Wv030049@svn.freebsd.org> From: Devin Teske Date: Fri, 11 Oct 2013 18:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256325 - in head/usr.sbin/bsdconfig: include share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 18:21:07 -0000 Author: dteske Date: Fri Oct 11 18:21:05 2013 New Revision: 256325 URL: http://svnweb.freebsd.org/changeset/base/256325 Log: Add keymap.subr for presenting custom keymap dialogs (with X11 support). Approved by: re (glebius) Added: head/usr.sbin/bsdconfig/share/keymap.subr (contents, props changed) Modified: head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/Makefile head/usr.sbin/bsdconfig/share/variable.subr Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Fri Oct 11 18:19:08 2013 (r256324) +++ head/usr.sbin/bsdconfig/include/messages.subr Fri Oct 11 18:21:05 2013 (r256325) @@ -201,6 +201,7 @@ msg_lithuania="Lithuania" msg_loading_of_dependent_package_failed="Loading of dependent package %s failed" msg_located_index_now_reading_package_data_from_it="Located INDEX, now reading package data from it..." msg_logging_in_to_user_at_host="Logging in to %s@%s.." +msg_looking_for_keymap_files="Looking for keymap files..." msg_looking_up_host="Looking up host %s" msg_mail_desc="Electronic mail packages and utilities." msg_main_menu="Main Menu" Modified: head/usr.sbin/bsdconfig/share/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/share/Makefile Fri Oct 11 18:19:08 2013 (r256324) +++ head/usr.sbin/bsdconfig/share/Makefile Fri Oct 11 18:21:05 2013 (r256325) @@ -5,8 +5,9 @@ NO_OBJ= SUBDIR= media packages FILESDIR= ${SHAREDIR}/bsdconfig -FILES= common.subr device.subr dialog.subr mustberoot.subr \ - script.subr strings.subr struct.subr sysrc.subr variable.subr +FILES= common.subr device.subr dialog.subr keymap.subr \ + mustberoot.subr script.subr strings.subr struct.subr \ + sysrc.subr variable.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Added: head/usr.sbin/bsdconfig/share/keymap.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/share/keymap.subr Fri Oct 11 18:21:05 2013 (r256325) @@ -0,0 +1,262 @@ +if [ ! "$_KEYMAP_SUBR" ]; then _KEYMAP_SUBR=1 +# +# Copyright (c) 2013 Devin Teske +# 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$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." keymap.subr +f_include $BSDCFG_SHARE/struct.subr + +############################################################ CONFIGURATION + +# +# Defaults taken from usr.sbin/kbdmap/kbdmap.h +# +: ${DEFAULT_LANG:=en} +: ${DEFAULT_KEYMAP_DIR:=/usr/share/syscons/keymaps} + +############################################################ GLOBALS + +KEYMAPS= + +# A "keymap" from kbdmap's point of view +f_struct_define KEYMAP \ + desc \ + keym \ + mark + +# +# Default behavior is to call f_keymap_get_all() automatically when loaded. +# +: ${KEYMAP_SELF_SCAN_ALL=1} + +############################################################ FUNCTIONS + +# f_keymap_register $name $desc $keym $mark +# +# Register a keymap. A `structure' (see struct.subr) is created with the name +# keymap_$name (so make sure $name contains only alpha-numeric characters or +# the underscore, `_'). The remaining arguments after $name correspond to the +# propertise of the `KEYMAP' structure-type (defined above). +# +# If not already registered, the keymap is then appended to the KEYMAPS +# environment variable, a space-separated list of all registered keymaps. +# +f_keymap_register() +{ + local name="$1" desc="$2" keym="$3" mark="$4" + + f_struct_new KEYMAP "keymap_$name" || return $FAILURE + keymap_$name set desc "$desc" + keymap_$name set keym "$keym" + keymap_$name set mark "$mark" + + # Scan our global register to see if needs ammending + local k found= + for k in $KEYMAPS; do + [ "$k" = "$name" ] || continue + found=1 && break + done + [ "$found" ] || KEYMAPS="$KEYMAPS $name" + + return $SUCCESS +} + +# f_keymap_checkfile $keymap +# +# Check that $keymap is a readable kbdmap(5) file. Returns success if $keymap +# is a file, is readable, and exists in $DEFAULT_KEYMAP_DIR; otherwise failure. +# If debugging is enabled, an appropriate debug error message is printed if +# $keymap is not available. +# +f_keymap_checkfile() +{ + local keym="$1" + + # Fixup keymap if it doesn't already contain at least one `/' + [ "${keym#*/}" = "$keym" ] && keym="$DEFAULT_KEYMAP_DIR/$keym" + + # Short-cuts + [ -f "$keym" -a -r "$keym" ] && return $SUCCESS + f_debugging || return $FAILURE + + # Print an appropriate debug error message + if [ ! -e "$keym" ]; then + f_dprintf "%s: No such file or directory" "$keym" + elif [ ! -f "$keym" ]; then + f_dprintf "%s: Not a file!" "$keym" + elif [ ! -r "$keym" ]; then + f_dprintf "%s: Permission denied" "$keym" + fi + + return $FAILURE +} + +# f_keymap_get_all +# +# Get all keymap information for kbdmap(5) entries both in the database and +# loosely existing in $DEFAULT_KEYMAP_DIR. +# +f_keymap_get_all() +{ + local fname=f_keymap_get_all + local lang="${LC_ALL:-${LC_CTYPE:-${LANG:-$DEFAULT_LANG}}}" + [ "$lang" = "C" ] && lang="$DEFAULT_LANG" + + f_dprintf "%s: Looking for keymap files..." $fname + f_dialog_info "$msg_looking_for_keymap_files" + f_dprintf "DEFAULT_LANG=[%s]" "$DEFAULT_LANG" + + eval "$( awk -F: -v lang="$lang" -v lang_default="$DEFAULT_LANG" ' + BEGIN { + # en_US.ISO8859-1 -> en_..\.ISO8859-1 + dialect = lang + if (length(dialect) >= 6 && + substr(dialect, 3, 1) == "_") + dialect = substr(dialect, 1, 3) ".." \ + substr(dialect, 6) + printf "f_dprintf \"dialect=[%%s]\" \"%s\";\n", dialect + + # en_US.ISO8859-1 -> en + lang_abk = lang + if (length(lang_abk) >= 3 && + substr(lang_abk, 3, 1) == "_") + lang_abk = substr(lang_abk, 1, 2) + printf "f_dprintf \"lang_abk=[%%s]\" \"%s\";\n", + lang_abk + } + function find_token(buffer, token) + { + if (split(buffer, tokens, /,/) == 0) return 0 + found = 0 + for (t in tokens) + if (token == tokens[t]) { found = 1; break } + return found + } + function add_keymap(desc,mark,keym) + { + marks[keym] = mark + name = keym + gsub(/[^[:alnum:]_]/, "_", name) + gsub(/'\''/, "'\''\\'\'''\''", desc); + printf "f_keymap_checkfile %s && " \ + "f_keymap_register %s '\'%s\'' %s %u\n", + keym, name, desc, keym, mark + } + !/^[[:space:]]*(#|$)/ { + sub(/^[[:space:]]*/, "", $0) + keym = $1 + if (keym ~ /^(MENU|FONT)$/) next + lg = ($2 == "" ? lang_default : $2) + + # Match the entry and store the type of match we made + # as the mark value (so that if we make a better match + # later on with a higher mark, it overwrites previous) + + mark = marks[keym]; + if (find_token(lg, lang)) + add_keymap($3, 4, keym) # Best match + else if (mark <= 3 && find_token(lg, dialect)) + add_keymap($3, 3, keym) + else if (mark <= 2 && find_token(lg, lang_abk)) + add_keymap($3, 2, keym) + else if (mark <= 1 && find_token(lg, lang_default)) + add_keymap($3, 1, keym) + else if (mark <= 0) + add_keymap($3, 0, keym) + } + ' "$DEFAULT_KEYMAP_DIR/INDEX.${DEFAULT_KEYMAP_DIR##*/}" )" + + + # + # Look for keymaps not in database + # + local direntry keym name + set +f # glob + for direntry in "$DEFAULT_KEYMAP_DIR"/*; do + [ "${direntry##*.}" = ".kbd" ] || continue + keym="${direntry##*/}" + f_str2varname "$keym" name + f_struct keymap_$name && continue + f_keymap_checkfile "$keym" && + f_keymap_register $name "${keym%.*}" "$keym" 0 + f_dprintf "%s: not in kbdmap(5) database" "$keym" + done + + # + # Sort the items by their descriptions + # + f_dprintf "%s: Sorting keymap entries by description..." $fname + KEYMAPS=$( + for k in $KEYMAPS; do + echo -n "$k " + # NOTE: Translate '8x8' to '8x08' before sending to + # sort(1) so that things work out as we might expect. + debug= keymap_$k get desc | sed -e 's/8x8/8x08/g' + done | sort -k2 | awk '{ + printf "%s%s", (started ? " " : ""), $1; started = 1 + }' + ) + + return $SUCCESS +} + +# f_keymap_kbdcontrol $keymap +# +# Install keyboard map file from $keymap. +# +f_keymap_kbdcontrol() +{ + local keymap="$1" + + [ "$keymap" ] || return $SUCCESS + + # Fixup keymap if it doesn't already contain at least one `/' + [ "${keymap#*/}" = "$keymap" ] && keymap="$DEFAULT_KEYMAP_DIR/$keymap" + + [ "$USE_XDIALOG" ] || kbdcontrol -l "$keymap" +} + +############################################################ MAIN + +# +# Scan for keymaps unless requeted otherwise +# +f_dprintf "%s: KEYMAP_SELF_SCAN_ALL=[%s]" keymap.subr "$KEYMAP_SELF_SCAN_ALL" +case "$KEYMAP_SELF_SCAN_ALL" in +""|0|[Nn][Oo]|[Oo][Ff][Ff]|[Ff][Aa][Ll][Ss][Ee]) : do nothing ;; +*) f_keymap_get_all +esac + +f_dprintf "%s: Found %u keymap file(s)." keymap.subr \ + "$( set -- $KEYMAPS; echo $# )" + +f_dprintf "%s: Successfully loaded." keymap.subr + +fi # ! $_KEYMAP_SUBR Modified: head/usr.sbin/bsdconfig/share/variable.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/variable.subr Fri Oct 11 18:19:08 2013 (r256324) +++ head/usr.sbin/bsdconfig/share/variable.subr Fri Oct 11 18:21:05 2013 (r256325) @@ -240,6 +240,7 @@ f_variable_new VAR_IFCONFIG ifconfig_ f_variable_new VAR_IPADDR ipaddr f_variable_new VAR_IPV6ADDR ipv6addr f_variable_new VAR_IPV6_ENABLE ipv6_activate_all_interfaces +f_variable_new VAR_KEYMAP keymap f_variable_new VAR_MEDIA_TIMEOUT MEDIA_TIMEOUT f_variable_new VAR_MEDIA_TYPE mediaType f_variable_new VAR_NAMESERVER nameserver From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 18:27:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EE652D0A; Fri, 11 Oct 2013 18:27:13 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA376299A; Fri, 11 Oct 2013 18:27:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BIRDOS031763; Fri, 11 Oct 2013 18:27:13 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BIRDtL031760; Fri, 11 Oct 2013 18:27:13 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310111827.r9BIRDtL031760@svn.freebsd.org> From: Peter Grehan Date: Fri, 11 Oct 2013 18:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256326 - in stable/10/sys/dev: ata hyperv/stordisengage X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 18:27:14 -0000 Author: grehan Date: Fri Oct 11 18:27:12 2013 New Revision: 256326 URL: http://svnweb.freebsd.org/changeset/base/256326 Log: MFC r256304 Allow the legacy CDROM device to be accessed in a FreeBSD guest, while still using enlightened drivers for other block devices. Approved by: re@ (gjb) Modified: stable/10/sys/dev/ata/ata-all.c stable/10/sys/dev/ata/ata-card.c stable/10/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c Directory Properties: stable/10/sys/ (props changed) stable/10/sys/dev/hyperv/ (props changed) Modified: stable/10/sys/dev/ata/ata-all.c ============================================================================== --- stable/10/sys/dev/ata/ata-all.c Fri Oct 11 18:21:05 2013 (r256325) +++ stable/10/sys/dev/ata/ata-all.c Fri Oct 11 18:27:12 2013 (r256326) @@ -92,7 +92,7 @@ FEATURE(ata_cam, "ATA devices are access int ata_probe(device_t dev) { - return 0; + return (BUS_PROBE_DEFAULT); } int Modified: stable/10/sys/dev/ata/ata-card.c ============================================================================== --- stable/10/sys/dev/ata/ata-card.c Fri Oct 11 18:21:05 2013 (r256325) +++ stable/10/sys/dev/ata/ata-card.c Fri Oct 11 18:27:12 2013 (r256326) @@ -140,7 +140,7 @@ ata_pccard_attach(device_t dev) ch-> flags |= ATA_NO_SLAVE; ata_generic_hw(dev); err = ata_probe(dev); - if (err) + if (err > 0) return (err); return (ata_attach(dev)); } Modified: stable/10/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c ============================================================================== --- stable/10/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c Fri Oct 11 18:21:05 2013 (r256325) +++ stable/10/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c Fri Oct 11 18:27:12 2013 (r256326) @@ -92,6 +92,7 @@ static int hv_check_for_hyper_v(void); static int hv_ata_pci_probe(device_t dev) { + device_t parent = device_get_parent(dev); int ata_disk_enable; ata_disk_enable = 0; @@ -102,23 +103,9 @@ hv_ata_pci_probe(device_t dev) if (!hv_check_for_hyper_v()) return (ENXIO); - if (bootverbose) - device_printf(dev, - "hv_ata_pci_probe dev_class/subslcass = %d, %d\n", - pci_get_class(dev), pci_get_subclass(dev)); - - /* is this a storage class device ? */ - if (pci_get_class(dev) != PCIC_STORAGE) + if (device_get_unit(parent) != 0 || device_get_ivars(dev) != 0) return (ENXIO); - /* is this an IDE/ATA type device ? */ - if (pci_get_subclass(dev) != PCIS_STORAGE_IDE) - return (ENXIO); - - if(bootverbose) - device_printf(dev, - "Hyper-V probe for disabling ATA-PCI, emulated driver\n"); - /* * On Hyper-V the default is to use the enlightened driver for * IDE disks. However, if the user wishes to use the native @@ -126,15 +113,14 @@ hv_ata_pci_probe(device_t dev) * hw_ata.disk_enable must be explicitly set to 1. */ if (getenv_int("hw.ata.disk_enable", &ata_disk_enable)) { - if(bootverbose) + if (bootverbose) device_printf(dev, "hw.ata.disk_enable flag is disabling Hyper-V" " ATA driver support\n"); return (ENXIO); } - if (bootverbose) - device_printf(dev, "Hyper-V ATA storage driver enabled.\n"); + device_set_desc(dev, "Hyper-V ATA storage disengage driver"); return (BUS_PROBE_VENDOR); } @@ -193,12 +179,12 @@ static device_method_t hv_ata_pci_method devclass_t hv_ata_pci_devclass; static driver_t hv_ata_pci_disengage_driver = { - "pciata-disable", + "ata", hv_ata_pci_methods, - sizeof(struct ata_pci_controller), + 0, }; -DRIVER_MODULE(atapci_dis, pci, hv_ata_pci_disengage_driver, - hv_ata_pci_devclass, NULL, NULL); +DRIVER_MODULE(atapci_dis, atapci, hv_ata_pci_disengage_driver, + hv_ata_pci_devclass, NULL, NULL); MODULE_VERSION(atapci_dis, 1); MODULE_DEPEND(atapci_dis, ata, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 18:51:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7CE6E644; Fri, 11 Oct 2013 18:51:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 69D442B34; Fri, 11 Oct 2013 18:51:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BIpcM7045353; Fri, 11 Oct 2013 18:51:38 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BIpchv045352; Fri, 11 Oct 2013 18:51:38 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201310111851.r9BIpchv045352@svn.freebsd.org> From: Eitan Adler Date: Fri, 11 Oct 2013 18:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256327 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 18:51:38 -0000 Author: eadler Date: Fri Oct 11 18:51:37 2013 New Revision: 256327 URL: http://svnweb.freebsd.org/changeset/base/256327 Log: Fix NetBSD release number Submitted by: pluknet Approved by: re (glebius) Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Fri Oct 11 18:27:12 2013 (r256326) +++ head/share/misc/bsd-family-tree Fri Oct 11 18:51:37 2013 (r256327) @@ -275,7 +275,7 @@ FreeBSD 5.2 | | | | | | | | 6.0.2 | | | | | | | | | OpenBSD 5.3 DragonFly 3.4.1 | | | | | | NetBSD | | - | | | | | | 6.0.2 | | + | | | | | | 6.0.3 | | | | | | | | | | | | | | | |`-NetBSD 6.1 | | | | FreeBSD | | | | | From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 19:40:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 78140F8B; Fri, 11 Oct 2013 19:40:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4BA7D2DD7; Fri, 11 Oct 2013 19:40:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BJeTgF070149; Fri, 11 Oct 2013 19:40:29 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BJeSEZ070143; Fri, 11 Oct 2013 19:40:28 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310111940.r9BJeSEZ070143@svn.freebsd.org> From: Glen Barber Date: Fri, 11 Oct 2013 19:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256328 - in head/sys: amd64/conf 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: Fri, 11 Oct 2013 19:40:29 -0000 Author: gjb Date: Fri Oct 11 19:40:28 2013 New Revision: 256328 URL: http://svnweb.freebsd.org/changeset/base/256328 Log: Document XENHVM and xenpci are mutually inclusive. Submitted by: gibbs Approved by: re (delphij) Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri Oct 11 18:51:37 2013 (r256327) +++ head/sys/amd64/conf/GENERIC Fri Oct 11 19:40:28 2013 (r256328) @@ -72,7 +72,6 @@ options KDTRACE_FRAME # Ensure frames options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data options INCLUDE_CONFIG_FILE # Include this file in kernel -options XENHVM # Include Xen support # Debugging support. Always need this: options KDB # Enable kernel debugger support. @@ -345,8 +344,10 @@ device virtio_balloon # VirtIO Memory B # HyperV drivers device hyperv # HyperV drivers -# Xen support -device xenpci # Generic Xen bus +# Xen HVM Guest Optimizations +# NOTE: XENHVM depends on xenpci. They must be added or removed together. +options XENHVM # Xen HVM kernel infrastructure +device xenpci # Xen HVM Hypervisor services driver # VMware support device vmx # VMware VMXNET3 Ethernet Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri Oct 11 18:51:37 2013 (r256327) +++ head/sys/i386/conf/GENERIC Fri Oct 11 19:40:28 2013 (r256328) @@ -72,7 +72,6 @@ options MAC # TrustedBSD MAC Framewor options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data options INCLUDE_CONFIG_FILE # Include this file in kernel -options XENHVM # Include Xen support # Debugging support. Always need this: options KDB # Enable kernel debugger support. @@ -356,8 +355,10 @@ device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device -# Xen support -device xenpci # Generic Xen bus +# Xen HVM Guest Optimizations +# NOTE: XENHVM depends on xenpci. They must be added or removed together. +options XENHVM # Xen HVM kernel infrastructure +device xenpci # Xen HVM Hypervisor services driver # VMware support device vmx # VMware VMXNET3 Ethernet From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 19:43:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DFC9B1D5; Fri, 11 Oct 2013 19:43:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B205D2E34; Fri, 11 Oct 2013 19:43:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BJhbIu071395; Fri, 11 Oct 2013 19:43:37 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BJhbDW071393; Fri, 11 Oct 2013 19:43:37 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310111943.r9BJhbDW071393@svn.freebsd.org> From: Glen Barber Date: Fri, 11 Oct 2013 19:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256329 - in stable/10/sys: amd64/conf i386/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 19:43:38 -0000 Author: gjb Date: Fri Oct 11 19:43:37 2013 New Revision: 256329 URL: http://svnweb.freebsd.org/changeset/base/256329 Log: MFC r256328: Document XENHVM and xenpci are mutually inclusive. Approved by: re (delphij) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/amd64/conf/GENERIC stable/10/sys/i386/conf/GENERIC Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/amd64/conf/GENERIC ============================================================================== --- stable/10/sys/amd64/conf/GENERIC Fri Oct 11 19:40:28 2013 (r256328) +++ stable/10/sys/amd64/conf/GENERIC Fri Oct 11 19:43:37 2013 (r256329) @@ -72,7 +72,6 @@ options KDTRACE_FRAME # Ensure frames options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data options INCLUDE_CONFIG_FILE # Include this file in kernel -options XENHVM # Include Xen support # Debugging support. Always need this: options KDB # Enable kernel debugger support. @@ -336,8 +335,10 @@ device virtio_balloon # VirtIO Memory B # HyperV drivers device hyperv # HyperV drivers -# Xen support -device xenpci # Generic Xen bus +# Xen HVM Guest Optimizations +# NOTE: XENHVM depends on xenpci. They must be added or removed together. +options XENHVM # Xen HVM kernel infrastructure +device xenpci # Xen HVM Hypervisor services driver # VMware support device vmx # VMware VMXNET3 Ethernet Modified: stable/10/sys/i386/conf/GENERIC ============================================================================== --- stable/10/sys/i386/conf/GENERIC Fri Oct 11 19:40:28 2013 (r256328) +++ stable/10/sys/i386/conf/GENERIC Fri Oct 11 19:43:37 2013 (r256329) @@ -72,7 +72,6 @@ options MAC # TrustedBSD MAC Framewor options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data options INCLUDE_CONFIG_FILE # Include this file in kernel -options XENHVM # Include Xen support # Debugging support. Always need this: options KDB # Enable kernel debugger support. @@ -347,8 +346,10 @@ device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device -# Xen support -device xenpci # Generic Xen bus +# Xen HVM Guest Optimizations +# NOTE: XENHVM depends on xenpci. They must be added or removed together. +options XENHVM # Xen HVM kernel infrastructure +device xenpci # Xen HVM Hypervisor services driver # VMware support device vmx # VMware VMXNET3 Ethernet From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:07:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1179D8C0; Fri, 11 Oct 2013 20:07:05 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F2D312FA6; Fri, 11 Oct 2013 20:07:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BK74Jd082843; Fri, 11 Oct 2013 20:07:04 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BK74Pw082842; Fri, 11 Oct 2013 20:07:04 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310112007.r9BK74Pw082842@svn.freebsd.org> From: Devin Teske Date: Fri, 11 Oct 2013 20:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256330 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:07:05 -0000 Author: dteske Date: Fri Oct 11 20:07:04 2013 New Revision: 256330 URL: http://svnweb.freebsd.org/changeset/base/256330 Log: Fix a bug that would occur in application death when debugging was enabled if you ended up in f_dialog_*_constrain() (indirectly, of course) with a purposefully-set NULL height, width, or rows parameter (because you didn't care to have that attribute calculated). Fix typo in a comment while here. Approved by: re (glebius) Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Fri Oct 11 19:43:37 2013 (r256329) +++ head/usr.sbin/bsdconfig/share/dialog.subr Fri Oct 11 20:07:04 2013 (r256330) @@ -415,8 +415,8 @@ f_dialog_size_constrain() if [ "$debug" ]; then # Print final constrained values to debugging - f_quietly f_getvar "$__var_height" - f_quietly f_getvar "$__var_width" + [ "$__var_height" ] && f_quietly f_getvar "$__var_height" + [ "$__var_width" ] && f_quietly f_getvar "$__var_width" fi return $__retval # success if no debug warnings were printed @@ -532,10 +532,10 @@ f_dialog_menu_constrain() fi if [ "$debug" ]; then - # Print final constrained values to debuggin - f_quietly f_getvar "$__var_height" - f_quietly f_getvar "$__var_width" - f_quietly f_getvar "$__var_rows" + # Print final constrained values to debugging + [ "$__var_height" ] && f_quietly f_getvar "$__var_height" + [ "$__var_width" ] && f_quietly f_getvar "$__var_width" + [ "$__var_rows" ] && f_quietly f_getvar "$__var_rows" fi return $__retval # success if no debug warnings were printed From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:08:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2D45FAF3; Fri, 11 Oct 2013 20:08:35 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 18EFF2FB8; Fri, 11 Oct 2013 20:08:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BK8YTM083470; Fri, 11 Oct 2013 20:08:34 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BK8YjT083469; Fri, 11 Oct 2013 20:08:34 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310112008.r9BK8YjT083469@svn.freebsd.org> From: Devin Teske Date: Fri, 11 Oct 2013 20:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256331 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:08:35 -0000 Author: dteske Date: Fri Oct 11 20:08:34 2013 New Revision: 256331 URL: http://svnweb.freebsd.org/changeset/base/256331 Log: Add $VAR_ZFSINTERACTIVE (zfsInteractive) and new f_zfsinteractive() for determining when a script wants to be nonInteractive but selectively wants ZFS operations to be *interactive* (this is analgous to already existing $VAR_NETINTERACTIVE (netInteractive) and f_netinteractive() used for the same purpose (script wants to be nonInteractive but wants network operations to be *interactive*). Approved by: re (glebius) Modified: head/usr.sbin/bsdconfig/share/variable.subr Modified: head/usr.sbin/bsdconfig/share/variable.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/variable.subr Fri Oct 11 20:07:04 2013 (r256330) +++ head/usr.sbin/bsdconfig/share/variable.subr Fri Oct 11 20:08:34 2013 (r256331) @@ -205,6 +205,21 @@ f_netinteractive() f_getvar $VAR_NETINTERACTIVE value && [ "$value" ] } +# f_zfsinteractive() +# +# Has the user specifically requested the ZFS-portion of configuration and +# setup to be performed interactively? Returns success if the user has asked +# for the ZFS configuration to be done interactively even if perhaps overall +# non-interactive mode has been requested (by setting nonInteractive). +# +# Returns success if $zfsInteractive is set and non-NULL. +# +f_zfsinteractive() +{ + local value + f_getvar $VAR_ZFSINTERACTIVE value && [ "$value" ] +} + ############################################################ MAIN # @@ -264,6 +279,7 @@ f_variable_new VAR_SLOW_ETHER slowEther f_variable_new VAR_TRY_DHCP tryDHCP f_variable_new VAR_TRY_RTSOL tryRTSOL f_variable_new VAR_UFS_PATH ufs +f_variable_new VAR_ZFSINTERACTIVE zfsInteractive # # Self-initialize unless requested otherwise From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:10:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B4AB4CBF; Fri, 11 Oct 2013 20:10:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 96DB52FDC; Fri, 11 Oct 2013 20:10:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BKAIGm084442; Fri, 11 Oct 2013 20:10:18 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BKAIbg084441; Fri, 11 Oct 2013 20:10:18 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310112010.r9BKAIbg084441@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 11 Oct 2013 20:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256332 - head/bin/freebsd-version X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:10:18 -0000 Author: des Date: Fri Oct 11 20:10:18 2013 New Revision: 256332 URL: http://svnweb.freebsd.org/changeset/base/256332 Log: Remove extraneous \n. Noticed by: Nikolai Lifanov Approved by: re (gjb) Modified: head/bin/freebsd-version/freebsd-version.sh.in Modified: head/bin/freebsd-version/freebsd-version.sh.in ============================================================================== --- head/bin/freebsd-version/freebsd-version.sh.in Fri Oct 11 20:08:34 2013 (r256331) +++ head/bin/freebsd-version/freebsd-version.sh.in Fri Oct 11 20:10:18 2013 (r256332) @@ -81,7 +81,7 @@ userland_version() { # Print a usage string and exit. # usage() { - echo "usage: $progname [-ku]\n" >&2 + echo "usage: $progname [-ku]" >&2 exit 1 } From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:10:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E0971E03; Fri, 11 Oct 2013 20:10:41 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDC322012; Fri, 11 Oct 2013 20:10:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BKAfgw084586; Fri, 11 Oct 2013 20:10:41 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BKAfQH084585; Fri, 11 Oct 2013 20:10:41 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310112010.r9BKAfQH084585@svn.freebsd.org> From: Devin Teske Date: Fri, 11 Oct 2013 20:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256333 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:10:42 -0000 Author: dteske Date: Fri Oct 11 20:10:41 2013 New Revision: 256333 URL: http://svnweb.freebsd.org/changeset/base/256333 Log: Store descriptions for DEVICE_TYPE_DISK and fix static-defaults mapping. Add a default description for bhyve block disk device while we're here. Approved by: re (glebius) Modified: head/usr.sbin/bsdconfig/share/device.subr Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Fri Oct 11 20:10:18 2013 (r256332) +++ head/usr.sbin/bsdconfig/share/device.subr Fri Oct 11 20:10:41 2013 (r256333) @@ -325,8 +325,13 @@ f_device_get_all() continue fi - f_device_register "$diskname" "" \ - "/dev/$diskname" $DEVICE_TYPE_DISK 0 + # Try and find its description + f_device_desc "$diskname" $DEVICE_TYPE_DISK desc + + f_device_register "$diskname" "$desc" \ + "/dev/$diskname" $DEVICE_TYPE_DISK 0 \ + "" "" "" "" \ + "$( f_device_capacity "$diskname" )" f_dprintf "Found a disk device named %s" "$diskname" # Look for existing partitions to register @@ -394,10 +399,27 @@ f_device_name_get() case "$__prop" in type|desc|max) : good ;; *) return $FAILURE; esac + # + # Attempt to create an alternate-form of $__name that contains the + # first contiguous string of numbers replaced with `%d' for comparison + # against stored pattern names (see MAIN). + # + local __left="${__name%%[0-9]*}" __right="${__name#*[0-9]}" __dname= + if [ "$__left" != "$__name" ]; then + # Chop leading digits from right 'til we hit first non-digit + while :; do + case "$__right" in + [0-9]*) __right="${__right#[0-9]}" ;; + *) break + esac + done + __dname="${__left}%d$__right" + fi + [ "$__type" = "$DEVICE_TYPE_ANY" ] && __type= for __dev in $DEVICE_NAMES; do __n=$(( $__n + 1 )) - [ "$__dev" = "$__name" ] || continue + [ "$__dev" = "$__name" -o "$__dev" = "$__dname" ] || continue f_getvar _device_type$__n __devtype [ "${__type:-$__devtype}" = "$__devtype" ] || continue f_getvar _device_$__prop$__n $__var_to_set @@ -478,6 +500,39 @@ f_device_desc() fi fi + # + # For disks, attempt to return camcontrol(8) descriptions. + # Otherwise fall through to below static list. + # + f_have camcontrol && + [ "${__type:-$DEVICE_TYPE_DISK}" = "$DEVICE_TYPE_DISK" ] && + __cp=$( camcontrol devlist 2> /dev/null | awk -v disk="$__name" ' + $0~"(\\(|,)"disk"(,|\\))" { + if (!match($0, "<[^>]+>")) next + print substr($0, RSTART+1, RLENGTH-2) + found = 1 + exit + } + END { exit ! found } + ' ) && setvar "$__var_to_set" "$__cp" && return $SUCCESS + + # + # Attempt to create an alternate-form of $__name that contains the + # first contiguous string of numbers replaced with `%d' for comparison + # against stored pattern names (see MAIN). + # + local __left="${__name%%[0-9]*}" __right="${__name#*[0-9]}" __dname= + if [ "$__left" != "$__name" ]; then + # Chop leading digits from right 'til we hit first non-digit + while :; do + case "$__right" in + [0-9]*) __right="${__right#[0-9]}" ;; + *) break + esac + done + __dname="${__left}%d$__right" + fi + local __dev __devtype __n=0 for __dev in $DEVICE_NAMES; do __n=$(( $__n + 1 )) @@ -487,11 +542,8 @@ f_device_desc() __devname=$( f_substr "$__name" 0 ${#__dev} ) [ "$__devname" = "$__dev" ] || continue else - __devname="${__name%%[0-9]*}" - __devunit="${__name#$__devname}" - __devunit="${__devunit%%[!0-9]*}" - __devname=$( printf "$__dev" $__devunit ) - [ "$__devname" = "$__name" ] || continue + [ "$__dev" = "$__name" -o "$__dev" = "$__dname" ] || + continue fi debug= f_getvar _device_desc$__n $__var_to_set return $? @@ -714,6 +766,7 @@ f_disk "ipsd%d" "IBM ServeRAID RAID ar f_disk "mfid%d" "LSI MegaRAID SAS array" 4 f_disk "mlxd%d" "Mylex RAID disk" 4 f_disk "twed%d" "3ware ATA RAID array" 4 +f_disk "vtbd%d" "VirtIO Block Device" 16 f_floppy "fd%d" "Floppy Drive unit A" 4 f_serial "cuau%d" "%s on device %s (COM%d)" 16 f_usb "da%da" "USB Mass Storage Device" 16 From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:11:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A9A701FE; Fri, 11 Oct 2013 20:11:24 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 96D94205D; Fri, 11 Oct 2013 20:11:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BKBOQ5086334; Fri, 11 Oct 2013 20:11:24 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BKBOxp086333; Fri, 11 Oct 2013 20:11:24 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310112011.r9BKBOxp086333@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 11 Oct 2013 20:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256334 - 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: Fri, 11 Oct 2013 20:11:24 -0000 Author: des Date: Fri Oct 11 20:11:24 2013 New Revision: 256334 URL: http://svnweb.freebsd.org/changeset/base/256334 Log: Remove extraneous (but harmless) leading /. Noticed by: Herbert J. Skuhra Approved by: re (gjb) Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Oct 11 20:10:41 2013 (r256333) +++ head/ObsoleteFiles.inc Fri Oct 11 20:11:24 2013 (r256334) @@ -39,7 +39,7 @@ # done # 20131009: freebsd-version moved from /libexec to /bin -OLD_FILES+=/libexec/freebsd-version +OLD_FILES+=libexec/freebsd-version # 20131001: ar and ranlib from binutils not used OLD_FILES+=usr/bin/gnu-ar OLD_FILES+=usr/bin/gnu-ranlib From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:12:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BA0E635E; Fri, 11 Oct 2013 20:12:30 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 978C22076; Fri, 11 Oct 2013 20:12:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BKCUbb086669; Fri, 11 Oct 2013 20:12:30 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BKCUuI086668; Fri, 11 Oct 2013 20:12:30 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310112012.r9BKCUuI086668@svn.freebsd.org> From: Devin Teske Date: Fri, 11 Oct 2013 20:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256335 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:12:30 -0000 Author: dteske Date: Fri Oct 11 20:12:30 2013 New Revision: 256335 URL: http://svnweb.freebsd.org/changeset/base/256335 Log: Add new f_expand_number() (shadowing expand_number(3)). Approved by: re (glebius) Modified: head/usr.sbin/bsdconfig/share/strings.subr Modified: head/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/strings.subr Fri Oct 11 20:11:24 2013 (r256334) +++ head/usr.sbin/bsdconfig/share/strings.subr Fri Oct 11 20:12:30 2013 (r256335) @@ -324,6 +324,112 @@ f_shell_unescape() f_replaceall "$__string" "'\\''" "'" "$__var_to_set" } +# f_expand_number $string [$var_to_set] +# +# Unformat $string into a number, optionally to be stored in $var_to_set. This +# function follows the SI power of two convention. +# +# The prefixes are: +# +# Prefix Description Multiplier +# k kilo 1024 +# M mega 1048576 +# G giga 1073741824 +# T tera 1099511627776 +# P peta 1125899906842624 +# E exa 1152921504606846976 +# +# NOTE: Prefixes are case-insensitive. +# +# Upon successful completion, the value 0 is returned (or stored to +# $var_to_set); otherwise -1. Reasons for a -1 return include: +# +# Given $string contains no digits. +# An unrecognized prefix was given. +# Result too large to calculate. +# +f_expand_number() +{ + local __string="$1" __var_to_set="$2" + local __cp __num + + # Remove any leading non-digits + while :; do + __cp="$__string" + __string="${__cp#[!0-9]}" + [ "$__string" = "$__cp" ] && break + done + + # Return `-1' if string didn't contain any digits + if [ ! "$__string" ]; then + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" -1 + else + echo -1 + fi + return $FAILURE + fi + + # Store the numbers + __num="${__string%%[!0-9]*}" + + # Shortcut + if [ $__num -eq 0 ]; then + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" 0 + else + echo 0 + fi + return $SUCCESS + fi + + # Remove all the leading numbers from the string to get at the prefix + while :; do + __cp="$__string" + __string="${__cp#[0-9]}" + [ "$__string" = "$__cp" ] && break + done + + # Test for invalid prefix + case "$__string" in + ""|[KkMmGgTtPpEe]*) : known prefix ;; + *) + # Unknown prefix + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" -1 + else + echo -1 + fi + return $FAILURE + esac + + # Multiply the number out + case "$__string" in + [Kk]) __num=$(( $__num * 1024 )) ;; + [Mm]) __num=$(( $__num * 1048576 )) ;; + [Gg]) __num=$(( $__num * 1073741824 )) ;; + [Tt]) __num=$(( $__num * 1099511627776 )) ;; + [Pp]) __num=$(( $__num * 1125899906842624 )) ;; + [Ee]) __num=$(( $__num * 1152921504606846976 )) ;; + esac + if [ $__num -le 0 ]; then + # Arithmetic overflow + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" -1 + else + echo -1 + fi + return $FAILURE + fi + + # Return the number + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" $__num + else + echo $__num + fi +} + ############################################################ MAIN f_dprintf "%s: Successfully loaded." strings.subr From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:14:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2ACE84E9; Fri, 11 Oct 2013 20:14:22 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 17C422094; Fri, 11 Oct 2013 20:14:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BKELhB087336; Fri, 11 Oct 2013 20:14:21 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BKELg9087335; Fri, 11 Oct 2013 20:14:21 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310112014.r9BKELg9087335@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 11 Oct 2013 20:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256336 - stable/10/bin/freebsd-version X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:14:22 -0000 Author: des Date: Fri Oct 11 20:14:21 2013 New Revision: 256336 URL: http://svnweb.freebsd.org/changeset/base/256336 Log: MFH (r256332): remove extraneous \n Approved by: re (gjb) Modified: stable/10/bin/freebsd-version/freebsd-version.sh.in Directory Properties: stable/10/bin/freebsd-version/ (props changed) Modified: stable/10/bin/freebsd-version/freebsd-version.sh.in ============================================================================== --- stable/10/bin/freebsd-version/freebsd-version.sh.in Fri Oct 11 20:12:30 2013 (r256335) +++ stable/10/bin/freebsd-version/freebsd-version.sh.in Fri Oct 11 20:14:21 2013 (r256336) @@ -81,7 +81,7 @@ userland_version() { # Print a usage string and exit. # usage() { - echo "usage: $progname [-ku]\n" >&2 + echo "usage: $progname [-ku]" >&2 exit 1 } From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:15:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6DECD630; Fri, 11 Oct 2013 20:15:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3CA3220A2; Fri, 11 Oct 2013 20:15:36 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 1AD257EB7; Fri, 11 Oct 2013 20:15:35 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 1AD257EB7 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 11 Oct 2013 16:15:33 -0400 From: Glen Barber To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r256329 - in stable/10/sys: amd64/conf i386/conf Message-ID: <20131011201533.GA44375@glenbarber.us> References: <201310111943.r9BJhbDW071393@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="+BArgJ+dbJ88VxBZ" Content-Disposition: inline In-Reply-To: <201310111943.r9BJhbDW071393@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-ALPHA4 amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:15:39 -0000 --+BArgJ+dbJ88VxBZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 11, 2013 at 07:43:37PM +0000, Glen Barber wrote: > Author: gjb > Date: Fri Oct 11 19:43:37 2013 > New Revision: 256329 > URL: http://svnweb.freebsd.org/changeset/base/256329 >=20 > Log: > MFC r256328: > Document XENHVM and xenpci are mutually inclusive. > =20 s/inclusive/dependent/. Glen --+BArgJ+dbJ88VxBZ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJSWFxlAAoJELls3eqvi17Q6WkP/3MC9D4+tNKh55sApj6BLwFb uKUpjwlZAC0E20/sZCP2UIig4kpUyAsVkjQ9+wsDZXFMI0NZv08OoSCDuFpstYs0 tyIcN3DaKZ5n+azFGLycHF6QTr5UVifl+IKdS0E1OYDaO1PgU9Dj5N66iMkumRq0 +yNtmVDNKJDtxcngd62+Jk0CdcjNFKr/rtsIF0XMGL1lpwCX7naFWW2PLqbNJZkS G3IN9wCJ//0IfKZahzX7KdgMV2OZt8L0wUPGun09ZYoROt0r3Xu82p9V1uN+nx+k o2UftbnTy2Z7W7S5Zar4U6uV0/u5Bz8u/tdTkBXjuOxs4nv/OiS7CTxr56rjG+3G mhPJQzq4c2DCEi0ICBnU9SvxeNwODXn755AZ30Du0SceGANvzzvkRYLyr4FnhlN0 nuiuI7lJmYKQq+h81Rj2ORJ6H0YStburSmZqKvwB8bev+WOshr4vMu14b/riT0OK WI92NsHVhGLtPovrLXTVXaJ2FQ+/gAkfNYuS5mbvhNwSqszUPzsZQD93qMJIaYZU gxphaq69VEC0Tkj8UNM7xz/OI6GV2xxjeBYv+nGkqjMQCsZjgCLRS4PJ8yoWIEla F2TjtfD+MAoNfl5NCsy0PPyRuV9XCBVVs6YbO30spWcohhrPl6XaCzN0ZdzN2/8J /eMg3HciXIUymT31GwBm =Npu8 -----END PGP SIGNATURE----- --+BArgJ+dbJ88VxBZ-- From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:15:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 62B8862F; Fri, 11 Oct 2013 20:15:39 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DF4220A5; Fri, 11 Oct 2013 20:15:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BKFdEF087838; Fri, 11 Oct 2013 20:15:39 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BKFdnB087837; Fri, 11 Oct 2013 20:15:39 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310112015.r9BKFdnB087837@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 11 Oct 2013 20:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256337 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:15:39 -0000 Author: des Date: Fri Oct 11 20:15:38 2013 New Revision: 256337 URL: http://svnweb.freebsd.org/changeset/base/256337 Log: MFH (r256334): remove extraneous but harmless / Approved by: re (gjb) Modified: stable/10/ObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Fri Oct 11 20:14:21 2013 (r256336) +++ stable/10/ObsoleteFiles.inc Fri Oct 11 20:15:38 2013 (r256337) @@ -39,7 +39,7 @@ # done # 20131009: freebsd-version moved from /libexec to /bin -OLD_FILES+=/libexec/freebsd-version +OLD_FILES+=libexec/freebsd-version # 20131001: ar and ranlib from binutils not used OLD_FILES+=usr/bin/gnu-ar OLD_FILES+=usr/bin/gnu-ranlib From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:21:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F1611A02; Fri, 11 Oct 2013 20:21:45 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CFA31211A; Fri, 11 Oct 2013 20:21:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BKLj0P092460; Fri, 11 Oct 2013 20:21:45 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BKLiAo092449; Fri, 11 Oct 2013 20:21:44 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310112021.r9BKLiAo092449@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 11 Oct 2013 20:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256338 - in head/usr.sbin/bsdinstall: . scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:21:46 -0000 Author: des Date: Fri Oct 11 20:21:44 2013 New Revision: 256338 URL: http://svnweb.freebsd.org/changeset/base/256338 Log: After installation, dump 4096 bytes from /dev/random to /entropy in the newly installed system. This should greatly increase the amount of entropy available when SSH host keys are generated during first boot. Reviewed by: markm, nathanw Approved by: re (gjb) Added: head/usr.sbin/bsdinstall/scripts/entropy (contents, props changed) Modified: head/usr.sbin/bsdinstall/bsdinstall.8 head/usr.sbin/bsdinstall/scripts/Makefile head/usr.sbin/bsdinstall/scripts/auto head/usr.sbin/bsdinstall/scripts/jail head/usr.sbin/bsdinstall/scripts/script Modified: head/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- head/usr.sbin/bsdinstall/bsdinstall.8 Fri Oct 11 20:15:38 2013 (r256337) +++ head/usr.sbin/bsdinstall/bsdinstall.8 Fri Oct 11 20:21:44 2013 (r256338) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 21, 2013 +.Dd October 6, 2013 .Dt BSDINSTALL 8 .Os .Sh NAME @@ -60,6 +60,10 @@ targets. .Bl -tag -width ".Cm jail Ar destination" .It Cm auto Run the standard interactive installation, including disk partitioning. +.It Cm entropy +Reads a small amount of data from +.Pa /dev/random +and stores it in a file in the new system's root directory. .It Cm jail Ar destination Sets up a new chroot system at .Pa destination , Modified: head/usr.sbin/bsdinstall/scripts/Makefile ============================================================================== --- head/usr.sbin/bsdinstall/scripts/Makefile Fri Oct 11 20:15:38 2013 (r256337) +++ head/usr.sbin/bsdinstall/scripts/Makefile Fri Oct 11 20:21:44 2013 (r256338) @@ -1,8 +1,8 @@ # $FreeBSD$ -SCRIPTS= auto adduser checksum config docsinstall hostname jail keymap \ - mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 rootpass \ - script services time umount wlanconfig +SCRIPTS= auto adduser checksum config docsinstall entropy hostname jail \ + keymap mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 \ + rootpass script services time umount wlanconfig BINDIR= /usr/libexec/bsdinstall NO_MAN= true Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Fri Oct 11 20:15:38 2013 (r256337) +++ head/usr.sbin/bsdinstall/scripts/auto Fri Oct 11 20:21:44 2013 (r256338) @@ -222,5 +222,8 @@ if [ $? -eq 0 ]; then chroot "$BSDINSTALL_CHROOT" /bin/sh 2>&1 fi +bsdinstall entropy +bsdinstall umount + echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG Added: head/usr.sbin/bsdinstall/scripts/entropy ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdinstall/scripts/entropy Fri Oct 11 20:21:44 2013 (r256338) @@ -0,0 +1,29 @@ +#!/bin/sh +#- +# Copyright (c) 2013 Dag-Erling Smørgrav +# 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 if=/dev/random of=$BSDINSTALL_CHROOT/entropy bs=4096 count=1 Modified: head/usr.sbin/bsdinstall/scripts/jail ============================================================================== --- head/usr.sbin/bsdinstall/scripts/jail Fri Oct 11 20:15:38 2013 (r256337) +++ head/usr.sbin/bsdinstall/scripts/jail Fri Oct 11 20:21:44 2013 (r256338) @@ -110,5 +110,7 @@ bsdinstall config || error cp /etc/resolv.conf $1/etc cp /etc/localtime $1/etc +bsdinstall entropy + echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG Modified: head/usr.sbin/bsdinstall/scripts/script ============================================================================== --- head/usr.sbin/bsdinstall/scripts/script Fri Oct 11 20:15:38 2013 (r256337) +++ head/usr.sbin/bsdinstall/scripts/script Fri Oct 11 20:21:44 2013 (r256338) @@ -83,6 +83,7 @@ if [ -f /tmp/bsdinstall-installscript-ab rm $BSDINSTALL_CHROOT/tmp/installscript fi +bsdinstall entropy bsdinstall umount echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:26:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 733EBBB7; Fri, 11 Oct 2013 20:26:46 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4688D2153; Fri, 11 Oct 2013 20:26:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BKQkkh093532; Fri, 11 Oct 2013 20:26:46 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BKQkho093531; Fri, 11 Oct 2013 20:26:46 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310112026.r9BKQkho093531@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 11 Oct 2013 20:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256339 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:26:46 -0000 Author: des Date: Fri Oct 11 20:26:45 2013 New Revision: 256339 URL: http://svnweb.freebsd.org/changeset/base/256339 Log: Move mergeinfo to the right place. Approved by: re (gjb) Modified: Directory Properties: stable/10/ (props changed) stable/10/ObsoleteFiles.inc (props changed) From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:28:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8D5ECE08; Fri, 11 Oct 2013 20:28:32 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6ADA3216F; Fri, 11 Oct 2013 20:28:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BKSWok094102; Fri, 11 Oct 2013 20:28:32 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BKSV8s094096; Fri, 11 Oct 2013 20:28:31 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310112028.r9BKSV8s094096@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 11 Oct 2013 20:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256340 - in stable/10/usr.sbin/bsdinstall: . scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:28:32 -0000 Author: des Date: Fri Oct 11 20:28:30 2013 New Revision: 256340 URL: http://svnweb.freebsd.org/changeset/base/256340 Log: MFH (r256338): store some entropy after installation Approved by: re (gjb) Added: stable/10/usr.sbin/bsdinstall/scripts/entropy - copied unchanged from r256338, head/usr.sbin/bsdinstall/scripts/entropy Modified: stable/10/usr.sbin/bsdinstall/bsdinstall.8 stable/10/usr.sbin/bsdinstall/scripts/Makefile stable/10/usr.sbin/bsdinstall/scripts/auto stable/10/usr.sbin/bsdinstall/scripts/jail stable/10/usr.sbin/bsdinstall/scripts/script Directory Properties: stable/10/usr.sbin/bsdinstall/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- stable/10/usr.sbin/bsdinstall/bsdinstall.8 Fri Oct 11 20:26:45 2013 (r256339) +++ stable/10/usr.sbin/bsdinstall/bsdinstall.8 Fri Oct 11 20:28:30 2013 (r256340) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 21, 2013 +.Dd October 6, 2013 .Dt BSDINSTALL 8 .Os .Sh NAME @@ -60,6 +60,10 @@ targets. .Bl -tag -width ".Cm jail Ar destination" .It Cm auto Run the standard interactive installation, including disk partitioning. +.It Cm entropy +Reads a small amount of data from +.Pa /dev/random +and stores it in a file in the new system's root directory. .It Cm jail Ar destination Sets up a new chroot system at .Pa destination , Modified: stable/10/usr.sbin/bsdinstall/scripts/Makefile ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/Makefile Fri Oct 11 20:26:45 2013 (r256339) +++ stable/10/usr.sbin/bsdinstall/scripts/Makefile Fri Oct 11 20:28:30 2013 (r256340) @@ -1,8 +1,8 @@ # $FreeBSD$ -SCRIPTS= auto adduser checksum config docsinstall hostname jail keymap \ - mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 rootpass \ - script services time umount wlanconfig +SCRIPTS= auto adduser checksum config docsinstall entropy hostname jail \ + keymap mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 \ + rootpass script services time umount wlanconfig BINDIR= /usr/libexec/bsdinstall NO_MAN= true Modified: stable/10/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/auto Fri Oct 11 20:26:45 2013 (r256339) +++ stable/10/usr.sbin/bsdinstall/scripts/auto Fri Oct 11 20:28:30 2013 (r256340) @@ -222,5 +222,8 @@ if [ $? -eq 0 ]; then chroot "$BSDINSTALL_CHROOT" /bin/sh 2>&1 fi +bsdinstall entropy +bsdinstall umount + echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG Copied: stable/10/usr.sbin/bsdinstall/scripts/entropy (from r256338, head/usr.sbin/bsdinstall/scripts/entropy) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bsdinstall/scripts/entropy Fri Oct 11 20:28:30 2013 (r256340, copy of r256338, head/usr.sbin/bsdinstall/scripts/entropy) @@ -0,0 +1,29 @@ +#!/bin/sh +#- +# Copyright (c) 2013 Dag-Erling Smørgrav +# 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 if=/dev/random of=$BSDINSTALL_CHROOT/entropy bs=4096 count=1 Modified: stable/10/usr.sbin/bsdinstall/scripts/jail ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/jail Fri Oct 11 20:26:45 2013 (r256339) +++ stable/10/usr.sbin/bsdinstall/scripts/jail Fri Oct 11 20:28:30 2013 (r256340) @@ -110,5 +110,7 @@ bsdinstall config || error cp /etc/resolv.conf $1/etc cp /etc/localtime $1/etc +bsdinstall entropy + echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG Modified: stable/10/usr.sbin/bsdinstall/scripts/script ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/script Fri Oct 11 20:26:45 2013 (r256339) +++ stable/10/usr.sbin/bsdinstall/scripts/script Fri Oct 11 20:28:30 2013 (r256340) @@ -83,6 +83,7 @@ if [ -f /tmp/bsdinstall-installscript-ab rm $BSDINSTALL_CHROOT/tmp/installscript fi +bsdinstall entropy bsdinstall umount echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:35:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 86766FF4; Fri, 11 Oct 2013 20:35:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7401D21EA; Fri, 11 Oct 2013 20:35:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BKZDeU098167; Fri, 11 Oct 2013 20:35:13 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BKZD9o098166; Fri, 11 Oct 2013 20:35:13 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310112035.r9BKZD9o098166@svn.freebsd.org> From: Dimitry Andric Date: Fri, 11 Oct 2013 20:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256341 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:35:13 -0000 Author: dim Date: Fri Oct 11 20:35:12 2013 New Revision: 256341 URL: http://svnweb.freebsd.org/changeset/base/256341 Log: In sys/dev/bxe/bxe.c, print bus_addr_t values using %#jx, to fix several gcc warnings for PAE kernels. Approved by: re (glebius) Reviewed by: davidch, edavis Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Fri Oct 11 20:28:30 2013 (r256340) +++ head/sys/dev/bxe/bxe.c Fri Oct 11 20:35:12 2013 (r256341) @@ -2532,9 +2532,9 @@ bxe_sp_post(struct bxe_softc *sc, atomic_subtract_acq_long(&sc->cq_spq_left, 1); } - BLOGD(sc, DBG_SP, "SPQE -> %p\n", (void *)sc->spq_dma.paddr); - BLOGD(sc, DBG_SP, "FUNC_RDATA -> %p / %p\n", - BXE_SP(sc, func_rdata), (void *)BXE_SP_MAPPING(sc, func_rdata)); + BLOGD(sc, DBG_SP, "SPQE -> %#jx\n", (uintmax_t)sc->spq_dma.paddr); + BLOGD(sc, DBG_SP, "FUNC_RDATA -> %p / %#jx\n", + BXE_SP(sc, func_rdata), (uintmax_t)BXE_SP_MAPPING(sc, func_rdata)); BLOGD(sc, DBG_SP, "SPQE[%x] (%x:%x) (cmd, common?) (%d,%d) hw_cid %x data (%x:%x) type(0x%x) left (CQ, EQ) (%lx,%lx)\n", sc->spq_prod_idx, @@ -6923,11 +6923,11 @@ bxe_alloc_fw_stats_mem(struct bxe_softc sc->fw_stats_data_mapping = (sc->fw_stats_dma.paddr + sc->fw_stats_req_size); - BLOGD(sc, DBG_LOAD, "statistics request base address set to %p\n", - (void *)sc->fw_stats_req_mapping); + BLOGD(sc, DBG_LOAD, "statistics request base address set to %#jx\n", + (uintmax_t)sc->fw_stats_req_mapping); - BLOGD(sc, DBG_LOAD, "statistics data base address set to %p\n", - (void *)sc->fw_stats_data_mapping); + BLOGD(sc, DBG_LOAD, "statistics data base address set to %#jx\n", + (uintmax_t)sc->fw_stats_data_mapping); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:38:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A1AC930A; Fri, 11 Oct 2013 20:38:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8E99D2216; Fri, 11 Oct 2013 20:38:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BKc4mZ098787; Fri, 11 Oct 2013 20:38:04 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BKc46H098786; Fri, 11 Oct 2013 20:38:04 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310112038.r9BKc46H098786@svn.freebsd.org> From: Dimitry Andric Date: Fri, 11 Oct 2013 20:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256342 - stable/10/sys/dev/bxe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:38:04 -0000 Author: dim Date: Fri Oct 11 20:38:04 2013 New Revision: 256342 URL: http://svnweb.freebsd.org/changeset/base/256342 Log: In sys/dev/bxe/bxe.c, print bus_addr_t values using %#jx, to fix several gcc warnings for PAE kernels. Approved by: re (glebius) Reviewed by: davidch, edavis Modified: stable/10/sys/dev/bxe/bxe.c Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Fri Oct 11 20:35:12 2013 (r256341) +++ stable/10/sys/dev/bxe/bxe.c Fri Oct 11 20:38:04 2013 (r256342) @@ -2532,9 +2532,9 @@ bxe_sp_post(struct bxe_softc *sc, atomic_subtract_acq_long(&sc->cq_spq_left, 1); } - BLOGD(sc, DBG_SP, "SPQE -> %p\n", (void *)sc->spq_dma.paddr); - BLOGD(sc, DBG_SP, "FUNC_RDATA -> %p / %p\n", - BXE_SP(sc, func_rdata), (void *)BXE_SP_MAPPING(sc, func_rdata)); + BLOGD(sc, DBG_SP, "SPQE -> %#jx\n", (uintmax_t)sc->spq_dma.paddr); + BLOGD(sc, DBG_SP, "FUNC_RDATA -> %p / %#jx\n", + BXE_SP(sc, func_rdata), (uintmax_t)BXE_SP_MAPPING(sc, func_rdata)); BLOGD(sc, DBG_SP, "SPQE[%x] (%x:%x) (cmd, common?) (%d,%d) hw_cid %x data (%x:%x) type(0x%x) left (CQ, EQ) (%lx,%lx)\n", sc->spq_prod_idx, @@ -6923,11 +6923,11 @@ bxe_alloc_fw_stats_mem(struct bxe_softc sc->fw_stats_data_mapping = (sc->fw_stats_dma.paddr + sc->fw_stats_req_size); - BLOGD(sc, DBG_LOAD, "statistics request base address set to %p\n", - (void *)sc->fw_stats_req_mapping); + BLOGD(sc, DBG_LOAD, "statistics request base address set to %#jx\n", + (uintmax_t)sc->fw_stats_req_mapping); - BLOGD(sc, DBG_LOAD, "statistics data base address set to %p\n", - (void *)sc->fw_stats_data_mapping); + BLOGD(sc, DBG_LOAD, "statistics data base address set to %#jx\n", + (uintmax_t)sc->fw_stats_data_mapping); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:41:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D05E3510; Fri, 11 Oct 2013 20:41:36 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BBD152265; Fri, 11 Oct 2013 20:41:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BKfaXI002071; Fri, 11 Oct 2013 20:41:36 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BKfZeT002056; Fri, 11 Oct 2013 20:41:35 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310112041.r9BKfZeT002056@svn.freebsd.org> From: Devin Teske Date: Fri, 11 Oct 2013 20:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256343 - in head/usr.sbin/bsdinstall: . scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:41:36 -0000 Author: dteske Date: Fri Oct 11 20:41:35 2013 New Revision: 256343 URL: http://svnweb.freebsd.org/changeset/base/256343 Log: Add zfsboot module as an option for automatic configuration. Default is to run interactively but it can be scripted too (optinally completely non-interactive). Currently supports GELI and all ZFS vdev types. Also performs validation on selections/settings providing error messages if necessary, explaining (in plain language) what the issue is. Currently the auto partitioning of naked disks only supports GPT and MBR (VTOC8 pending for sparc64), so is only available for i386/amd64 install. Submitted by: Allan Jude , myself Reviewed by: Allan Jude Approved by: re (glebius) Added: head/usr.sbin/bsdinstall/scripts/zfsboot (contents, props changed) Modified: head/usr.sbin/bsdinstall/bsdinstall head/usr.sbin/bsdinstall/scripts/Makefile head/usr.sbin/bsdinstall/scripts/auto head/usr.sbin/bsdinstall/scripts/config Modified: head/usr.sbin/bsdinstall/bsdinstall ============================================================================== --- head/usr.sbin/bsdinstall/bsdinstall Fri Oct 11 20:38:04 2013 (r256342) +++ head/usr.sbin/bsdinstall/bsdinstall Fri Oct 11 20:41:35 2013 (r256343) @@ -28,6 +28,7 @@ : ${BSDINSTALL_LOG="/tmp/bsdinstall_log"}; export BSDINSTALL_LOG : ${BSDINSTALL_TMPETC="/tmp/bsdinstall_etc"}; export BSDINSTALL_TMPETC +: ${BSDINSTALL_TMPBOOT="/tmp/bsdinstall_boot"}; export BSDINSTALL_TMPBOOT : ${PATH_FSTAB="$BSDINSTALL_TMPETC/fstab"}; export PATH_FSTAB : ${BSDINSTALL_DISTDIR="/usr/freebsd-dist"}; export BSDINSTALL_DISTDIR : ${BSDINSTALL_CHROOT="/mnt"}; export BSDINSTALL_CHROOT @@ -35,5 +36,6 @@ VERB=${1:-auto}; shift [ -d "$BSDINSTALL_TMPETC" ] || mkdir -p "$BSDINSTALL_TMPETC" +[ -d "$BSDINSTALL_TMPBOOT" ] || mkdir -p "$BSDINSTALL_TMPBOOT" echo "Running installation step: $VERB $@" >> "$BSDINSTALL_LOG" exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>> "$BSDINSTALL_LOG" Modified: head/usr.sbin/bsdinstall/scripts/Makefile ============================================================================== --- head/usr.sbin/bsdinstall/scripts/Makefile Fri Oct 11 20:38:04 2013 (r256342) +++ head/usr.sbin/bsdinstall/scripts/Makefile Fri Oct 11 20:41:35 2013 (r256343) @@ -2,7 +2,7 @@ SCRIPTS= auto adduser checksum config docsinstall entropy hostname jail \ keymap mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 \ - rootpass script services time umount wlanconfig + rootpass script services time umount wlanconfig zfsboot BINDIR= /usr/libexec/bsdinstall NO_MAN= true Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Fri Oct 11 20:38:04 2013 (r256342) +++ head/usr.sbin/bsdinstall/scripts/auto Fri Oct 11 20:41:35 2013 (r256343) @@ -93,24 +93,46 @@ fi rm $PATH_FSTAB touch $PATH_FSTAB -dialog --backtitle "FreeBSD Installer" --title "Partitioning" --extra-button \ - --extra-label "Manual" --ok-label "Guided" --cancel-label "Shell" \ - --yesno "Would you like to use the guided partitioning tool (recommended for beginners) or to set up partitions manually (experts)? You can also open a shell and set up partitions entirely by hand." 0 0 +PMODES="\ +Guided \"Partitioning Tool (Recommended for Beginners)\" \ +Manual \"Manually Configure Partitions (Expert)\" \ +Shell \"Open a shell and partition by hand\"" + +CURARCH=$( uname -m ) +case $CURARCH in + amd64|i386) # Booting ZFS Supported + PMODES="$PMODES ZFS \"Automatic Root-on-ZFS (Experimental)\"" + ;; + *) # Booting ZFS Unspported + ;; +esac -case $? in -0) # Guided +exec 3>&1 +PARTMODE=`echo $PMODES | xargs dialog --backtitle "FreeBSD Installer" \ + --title "Partitioning" \ + --menu "How would you like to partition your disk?" \ + 0 0 0 2>&1 1>&3` +if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi +exec 3>&- + +case "$PARTMODE" in +"Guided") # Guided bsdinstall autopart || error bsdinstall mount || error ;; -1) # Shell +"Shell") # Shell clear echo "Use this shell to set up partitions for the new system. When finished, mount the system at $BSDINSTALL_CHROOT and place an fstab file for the new system at $PATH_FSTAB. Then type 'exit'. You can also enter the partition editor at any time by entering 'bsdinstall partedit'." sh 2>&1 ;; -3) # Manual +"Manual") # Manual bsdinstall partedit || error bsdinstall mount || error ;; +"ZFS") # ZFS + bsdinstall zfsboot || error + bsdinstall mount || error + ;; *) error ;; Modified: head/usr.sbin/bsdinstall/scripts/config ============================================================================== --- head/usr.sbin/bsdinstall/scripts/config Fri Oct 11 20:38:04 2013 (r256342) +++ head/usr.sbin/bsdinstall/scripts/config Fri Oct 11 20:41:35 2013 (r256343) @@ -31,6 +31,11 @@ rm $BSDINSTALL_TMPETC/rc.conf.* cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc +cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf +rm $BSDINSTALL_TMPBOOT/loader.conf.* + +cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot + # Set up other things from installed config chroot $BSDINSTALL_CHROOT /usr/bin/newaliases Added: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Fri Oct 11 20:41:35 2013 (r256343) @@ -0,0 +1,1043 @@ +#!/bin/sh +#- +# Copyright (c) 2013 Allan Jude +# Copyright (c) 2013 Devin Teske +# 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$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." "$0" +f_include $BSDCFG_SHARE/device.subr +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/password/password.subr +f_include $BSDCFG_SHARE/variable.subr + +############################################################ CONFIGURATION + +# +# Default name of the boot-pool +# +: ${ZFSBOOT_POOL_NAME:=zroot} + +# +# Default name for the boot environment parent dataset +# +: ${ZFSBOOT_BEROOT_NAME:=bootenv} + +# +# Default name for the primany boot environment +# +: ${ZFSBOOT_BOOTFS_NAME:=default} + +# +# Default Virtual Device (vdev) type to create +# +: ${ZFSBOOT_VDEV_TYPE:=stripe} + +# +# Should we use gnop(8) to configure a transparent mapping to 4K sectors? +# +: ${ZFSBOOT_GNOP_4K_FORCE_ALIGN:=1} + +# +# Should we use geli(8) to encrypt the drives? +# +: ${ZFSBOOT_GELI_ENCRYPTION:=} + +# +# Default name the unencrypted pool when using geli(8) to encrypt the drives +# +: ${ZFSBOOT_GELI_POOL_NAME:=bootpool} + +# +# Default size for the unencrypted boot pool when using geli(8) +# +: ${ZFSBOOT_GELI_BOOT_SIZE:=2g} + +# +# Default path to the geli(8) keyfile used in drive encryption +# +: ${ZFSBOOT_GELI_KEY_FILE:=/boot/encryption.key} + +# +# Default disks to use (always empty unless being scripted) +# +: ${ZFSBOOT_DISKS:=} + +# +# Default partitioning scheme to use on disks +# +: ${ZFSBOOT_PARTITION_SCHEME:=GPT} + +# +# How much swap to put on each block device in the boot zpool +# NOTE: Value passed to gpart(8); which supports SI unit suffixes. +# +: ${ZFSBOOT_SWAP_SIZE:=2g} + +# +# Default ZFS layout for root zpool +# +# NOTE: Requires /tmp, /var/tmp, /$ZFSBOOT_BOOTFS_NAME/$ZFSBOOT_BOOTFS_NAME +# NOTE: Anything after pound/hash character [#] is ignored as a comment. +# +f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATASETS=" + # DATASET OPTIONS (comma or space separated; or both) + + # Boot Environment [BE] root and default boot dataset + /$ZFSBOOT_BEROOT_NAME mountpoint=none + /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME mountpoint=/ + + # Compress /tmp, allow exec but not setuid + /tmp mountpoint=/tmp,compression=lz4,exec=on,setuid=off + + # Don't mount /usr so that 'base' files go to the BEROOT + /usr mountpoint=/usr,canmount=off + + /usr/local # local files (i.e. from packages) separate from base system + + # Home directories separated so they are common to all BEs + /usr/home setuid=off + + # Ports tree + /usr/ports compression=lz4,setuid=off + /usr/ports/distfiles compression=off,exec=off,setuid=off + /usr/ports/packages compression=off,exec=off,setuid=off + + # Source tree (compressed) + /usr/src compression=lz4,exec=off,setuid=off + /usr/obj # Object files + + # Create /var and friends + /var mountpoint=/var + /var/crash compression=lz4,exec=off,setuid=off + /var/db exec=off,setuid=off + /var/db/pkg compression=lz4,exec=off,setuid=off + /var/empty exec=off,setuid=off + /var/log compression=lz4,exec=off,setuid=off + /var/mail compression=lz4,exec=off,setuid=off + /var/run exec=off,setuid=off + /var/tmp compression=lz4,exec=on,setuid=off +" # END-QUOTE + +############################################################ GLOBALS + +# +# Strings that should be moved to an i18n file and loaded with f_include_lang() +# +hline_alnum_arrows_punc_tab_enter="Use alnum, arrows, punctuation, TAB or ENTER" +hline_arrows_space_tab_enter="Use arrows, SPACE, TAB or ENTER" +hline_arrows_tab_enter="Press arrows, TAB or ENTER" +msg_back="Back" +msg_cancel="Cancel" +msg_change="Change Selection" +msg_configure_options="Configure Options:" +msg_create="Install" +msg_create_desc="Proceed with Installation" +msg_create_help="Create ZFS boot pool with displayed options" +msg_detailed_disk_info="gpart(8) show %s:\n%s\n\ncamcontrol(8) inquiry %s:\n%s\n\n\ncamcontrol(8) identify %s:\n%s\n" +msg_disk_info="Disk Info" +msg_disk_info_help="Get detailed information on disk device(s)" +msg_disks_to_use="Disks To Use" +msg_disks_to_use_help="Choose which disks to use for the Virtual Device (Required)" +msg_force_4k_sectors="Force 4K Sectors?" +msg_force_4k_sectors_help="Use gnop(8) to configure forced 4K sector alignment" +msg_freebsd_installer="FreeBSD Installer" +msg_geli_encryption="Encrypt Disks?" +msg_geli_encryption_help="Use geli(8) to encrypt all data partitions" +msg_geli_password="Enter a strong passphrase, used to protect your encryption keys. You will be required to enter this passphrase each time the system is booted" +msg_geli_setup="Initializing encryption on the selected disks, this will take several seconds per disk" +msg_invalid_virtual_device_type="Invalid Virtual Device type \`%s'" +msg_invalid_virtual_device_type_help="Select another Virtual Device type or Cancel to\nreturn to the ZFS menu. From there you can select\nmore disks or rescan for additional devices." +msg_last_chance_are_you_sure="Last Chance! Are you sure you want to destroy the current contents of the following disks:\n%s" +msg_last_chance_are_you_sure_color="\\\\ZrLast Chance!\\\\ZR Are you \\\\Z1sure\\\\Zn you want to \\\\Zr\\\\Z1destroy\\\\Zn the current contents of the following disks:\n%s" +msg_mirror_desc="Mirror - n-Way Mirroring" +msg_mirror_help="[2+ Disks] Mirroring provides the best performance, but the least storage" +msg_no="NO" +msg_no_disks_present_to_configure="No disk(s) present to configure" +msg_no_disks_selected="No disks selected." +msg_not_enough_disks_selected="Not enough disks selected. (%u < %u wanted)" +msg_ok="OK" +msg_partition_scheme="Partition Scheme" +msg_partition_scheme_help="Toggle between GPT and MBR partitioning schemes" +msg_please_enter_a_name_for_your_zpool="Please enter a name for your zpool:" +msg_please_enter_amount_of_swap_space="Please enter amount of swap space (SI-Unit suffixes\nrecommended; e.g., \`2g' for 2 Gigabytes):" +msg_please_select_one_or_more_disks="Please select one or more disks to create a zpool:" +msg_pool_name="Pool Name" +msg_pool_name_cannot_be_empty="Pool name cannot be empty." +msg_pool_name_help="Customize the name of the zpool to be created (Required)" +msg_processing_selection="Processing selection..." +msg_raidz1_desc="RAID-Z1 - Single Redundant RAID" +msg_raidz1_help="[3+ Disks] Withstand failure of 1 disk. Recommended for: 3, 5 or 9 disks" +msg_raidz2_desc="RAID-Z2 - Double Redundant RAID" +msg_raidz2_help="[4+ Disks] Withstand failure of 2 disks. Recommended for: 4, 6 or 10 disks" +msg_raidz3_desc="RAID-Z3 - Triple Redundant RAID" +msg_raidz3_help="[5+ Disks] Withstand failure of 3 disks. Recommended for: 5, 7 or 11 disks" +msg_rescan_devices="Rescan Devices" +msg_rescan_devices_help="Scan for device changes" +msg_select="Select" +msg_select_a_disk_device="Select a disk device" +msg_select_virtual_device_type="Select Virtual Device type:" +msg_stripe_desc="Stripe - No Redundancy" +msg_stripe_help="[1+ Disks] Striping provides maximum storage but no redundancy" +msg_swap_size="Swap Size" +msg_swap_size_help="Customize how much swap space is allocated to each selected disk" +msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or GELI (%s) partitions, which would take\n50%% or more (not recommended) of each of the following\nselected disk devices:\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." +msg_yes="YES" +msg_zfs_configuration="ZFS Configuration" +msg_zfs_vdev_type="ZFS VDev Type" +msg_zfs_vdev_type_help="Select type of ZFS Virtual Device to create" + +############################################################ FUNCTIONS + +# dialog_menu_main +# +# Display the dialog(1)-based application main menu. +# +dialog_menu_main() +{ + local title="$DIALOG_TITLE" + local btitle="$DIALOG_BACKTITLE" + local prompt="$msg_configure_options" + local force4k="$msg_no" + local usegeli="$msg_no" + [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ] && force4k="$msg_yes" + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && usegeli="$msg_yes" + local menu_list=" + '>>> $msg_create' '$msg_create_desc' + '$msg_create_help' + '- $msg_rescan_devices' '*' + '$msg_rescan_devices_help' + '- $msg_disk_info' '*' + '$msg_disk_info_help' + '1 $msg_pool_name' '$ZFSBOOT_POOL_NAME' + '$msg_pool_name_help' + '2 $msg_disks_to_use' '$ZFSBOOT_DISKS' + '$msg_disks_to_use_help' + '3 $msg_zfs_vdev_type' '$ZFSBOOT_VDEV_TYPE' + '$msg_zfs_vdev_type_help' + '4 $msg_force_4k_sectors' '$force4k' + '$msg_force_4k_sectors_help' + '5 $msg_geli_encryption' '$usegeli' + '$msg_geli_encryption_help' + '6 $msg_partition_scheme' '$ZFSBOOT_PARTITION_SCHEME' + '$msg_partition_scheme_help' + '7 $msg_swap_size' '$ZFSBOOT_SWAP_SIZE' + '$msg_swap_size_help' + " # END-QUOTE + local defaultitem= # Calculated below + local hline="$hline_alnum_arrows_punc_tab_enter" + + local height width rows + eval f_dialog_menu_with_help_size height width rows \ + \"\$title\" \"\$btitle\" \"\$prompt\" \"\$hline\" $menu_list + + # Obtain default-item from previously stored selection + f_dialog_default_fetch defaultitem + + local menu_choice + menu_choice=$( eval $DIALOG \ + --title \"\$title\" \ + --backtitle \"\$btitle\" \ + --hline \"\$hline\" \ + --item-help \ + --ok-label \"\$msg_select\" \ + --cancel-label \"\$msg_cancel\" \ + --default-item \"\$defaultitem\" \ + --menu \"\$prompt\" \ + $height $width $rows \ + $menu_list \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" + + # Only update default-item on success + [ $retval -eq $DIALOG_OK ] && f_dialog_default_store "$menu_choice" + + return $retval +} + +# dialog_edit_disks +# +# Edit the list of disks to be used by the ZFS boot pool. +# +dialog_edit_disks() +{ + local title="$DIALOG_TITLE" + local btitle="$DIALOG_BACKTITLE" + local prompt="$msg_please_select_one_or_more_disks" + local check_list= # Calculated below + local hline="$hline_arrows_space_tab_enter" + local dev vardev disks= + + # + # Get a [new] list of disk devices + # + f_device_find "" $DEVICE_TYPE_DISK disks + if [ ! "$disks" ]; then + f_show_msg "$msg_no_disks_present_to_configure" + return $FAILURE + fi + + # Lets sort the disks array to be more user friendly + disks=$( echo "$disks" | tr ' ' '\n' | sort | tr '\n' ' ' ) + + # + # Loop through the list of selected disks and create temporary local + # variables mapping their status onto an up-to-date list of disks. + # + for dev in $ZFSBOOT_DISKS; do + f_str2varname "$dev" vardev + local _${vardev}_status=on + done + + # + # Create the checklist menu of discovered disk devices + # + local on_off + for dev in $disks; do + local desc= + device_$dev get desc desc + f_shell_escape "$desc" desc + f_str2varname "$dev" vardev + f_getvar _${vardev}_status:-off on_off + check_list="$check_list '$dev' '$desc' $on_off" + done + + # + # Prompt the user to check some disks + # + local height width rows + eval f_dialog_checklist_size height width rows \ + \"\$title\" \"\$btitle\" \"\$prompt\" \"\$hline\" $check_list + disks=$( eval $DIALOG \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --hline \"\$hline\" \ + --ok-label \"\$msg_ok\" \ + --cancel-label \"\$msg_cancel\" \ + --checklist \"\$prompt\" \ + $height $width $rows \ + $check_list \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) || return $? + # Exit if user either pressed ESC or chose Cancel/No + f_dialog_data_sanitize disks + + ZFSBOOT_DISKS="$disks" + + return $DIALOG_OK +} + +# dialog_menu_vdev +# +# Prompt the user to select a a Virtual Device type. +# +dialog_menu_vdev() +{ + local title="$DIALOG_TITLE" + local btitle="$DIALOG_BACKTITLE" + local prompt="$msg_select_virtual_device_type" + + # Make sure [potentially scripted] selections are real + real_disks= + for disk in $ZFSBOOT_DISKS; do + f_struct device_$disk && real_disks="$real_disks $disk" + done + # Make sure we have at least one real disk selected + ndisks=$( set -- $real_disks; echo $# ) + + local menu_list=" + 'stripe' '$msg_stripe_desc' '$msg_stripe_help' + 'mirror' '$msg_mirror_desc' '$msg_mirror_help' + 'raidz1' '$msg_raidz1_desc' '$msg_raidz1_help' + 'raidz2' '$msg_raidz2_desc' '$msg_raidz2_help' + 'raidz3' '$msg_raidz3_desc' '$msg_raidz3_help' + " # END-QUOTE + + local defaultitem="$ZFSBOOT_VDEV_TYPE" + local hline="$hline_arrows_tab_enter" + local error_msg revalidate_choice + + local mheight mwidth mrows + eval f_dialog_menu_size mheight mwidth mrows \ + \"\$title\" \"\$btitle\" \"\$prompt\" \"\$hline\" $menu_list + local iheight iwidth + f_dialog_infobox_size iheight iwidth \ + "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$msg_processing_selection" + + local menu_choice + menu_choice=$( eval $DIALOG \ + --title \"\$title\" \ + --backtitle \"\$btitle\" \ + --hline \"\$hline\" \ + --ok-label \"\$msg_ok\" \ + --cancel-label \"\$msg_cancel\" \ + --item-help \ + --default-item \"\$defaultitem\" \ + --menu \"\$prompt\" \ + $mheight $mwidth $mrows \ + $menu_list \ + --and-widget \ + ${USE_XDIALOG:+--no-buttons} \ + --infobox \"\$msg_processing_selection\" \ + $iheight $iwidth \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) || return $FAILURE + f_dialog_data_sanitize menu_choice + sleep 0.5 # Give time to read `--and-widget --info-box' + + # Make sure we have enough disks for the desired vdev type + case "$menu_choice" in + stripe) want_disks=1 ;; + mirror) want_disks=2 ;; + raidz1) want_disks=3 ;; + raidz2) want_disks=4 ;; + raidz3) want_disks=5 ;; + *) + f_show_msg "$msg_invalid_virtual_device_type" \ + "$menu_choice" + continue + esac + if [ $ndisks -lt $want_disks ]; then + msg_yes="$msg_change" msg_no="$msg_cancel" f_yesno \ + "%s: $msg_not_enough_disks_selected\n%s" \ + "$menu_choice" $ndisks $want_disks \ + "$msg_invalid_virtual_device_type_help" || + return $FAILURE + dialog_menu_vdev + else + ZFSBOOT_VDEV_TYPE="$menu_choice" + fi +} + +# zfs_create_diskpart $disk $index +# +# For each block device to be used in the zpool, rather than just create the +# zpool with the raw block devices (e.g., da0, da1, etc.) we create partitions +# so we can have some real swap. This also provides wiggle room incase your +# replacement drivers do not have the exact same sector counts. +# +# NOTE: The MBR layout is more complicated (GPT is preferred). +# +zfs_create_diskpart() +{ + local disk="$1" index="$2" + local funcname=zfs_create_diskpart + local disksize partsize + + # Check arguments + [ "$disk" -a "$index" ] || return $FAILURE + + # + # Destroy whatever partition layout is currently on disk. + # NOTE: `-F' required to destroy if partitions still exist. + # NOTE: Failure is ok here, blank disk will have nothing to destroy. + # + f_quietly gpart destroy -F $disk + f_quietly zpool labelclear -f /dev/$disk # Kill it with fire + + # Make doubly-sure backup GPT is destroyed + f_quietly gpart create -s gpt $disk || return $FAILURE + f_quietly gpart destroy -F $disk || return $FAILURE + + # Calculate partition size given desired amount of swap + device_$disk get capacity disksize || return $FAILURE + partsize=$(( $disksize - $swapsize )) + + # + # Lay down the desired type of partition scheme + # + local setsize mbrindex + case "$ZFSBOOT_PARTITION_SCHEME" in + ""|GPT) + # + # 1. Create GPT layout using labels + # + gpart create -s gpt $disk || return $FAILURE + + # + # 2. Add small freebsd-boot partition labeled `boot#' + # + gpart add -l gptboot$index -t freebsd-boot -s 512k $disk || + return $FAILURE + gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 $disk || + return $FAILURE + + # zpool will use the `zfs#' GPT labels + bootpart=p2 targetpart=p2 + + # Change things around if we are using GELI + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + bootpart=p2 targetpart=p3 + partsize=$(( $partsize - $gelisize )) + gpart add -l boot$index -t freebsd-zfs \ + -s ${gelisize}b -a 1m $disk || return $FAILURE + # Pedantically nuke any old labels, stop geli + f_quietly zpool labelclear -f /dev/$disk$bootpart + f_quietly geli detach -f /dev/$disk$targetpart + fi + + # + # 3. Add freebsd-zfs partition labeled `zfs#' for zpool + # NOTE: Using above calculated partsize to leave room for swap. + # + [ $swapsize -gt 0 ] && setsize="-s ${partsize}b" + gpart add -l zfs$index -t freebsd-zfs $setsize -a 1m $disk || + return $FAILURE + f_quietly zpool labelclear -f /dev/$disk$targetpart # Pedantic + + # + # 4. Add freebsd-swap partition labeled `swap#' + # + if [ $swapsize -gt 0 ]; then + gpart add -l swap$index -t freebsd-swap -a 1m $disk || + return $FAILURE + # Update fstab(5) + printf "$fstab_fmt" \ + /dev/gpt/swap$index none swap sw 0 0 \ + >> $BSDINSTALL_TMPETC/fstab || return $FAILURE + fi + ;; + + MBR) + # + # 1. Create MBR layout (no labels) + # + gpart create -s mbr $disk || return $FAILURE + gpart bootcode -b /boot/boot0 $disk || return $FAILURE + + # + # 2. Add freebsd slice with all available space + # + gpart add -t freebsd $disk || return $FAILURE + gpart set -a active -i 1 $disk || return $FAILURE + f_quietly zpool labelclear -f /dev/${disk}s1 # Pedantic + f_quietly gpart destroy -F ${disk}s1 # Pedantic + + # + # 3. Write BSD sceme to the freebsd slice + # + gpart create -s BSD ${disk}s1 || return $FAILURE + + # zpool will use s1a (no labels) + bootpart=s1a targetpart=s1a mbrindex=1 + + # Change things around if we are using GELI + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + bootpart=s1a targetpart=s1d + partsize=$(( $partsize - $gelisize )) + mbrindex=4 # If this is s1a then make the zpool s1d + gpart add -t freebsd-zfs -i 1 -s ${gelisize}b \ + ${disk}s1 || return $FAILURE + # Pedantically nuke any old labels, stop geli + f_quietly zpool labelclear -f /dev/$disk$bootpart + f_quietly geli detach -f /dev/$disk$targetpart + fi + + # + # 4. Partition the BSD slice for ZFS + # NOTE: Using above calculated partsize to leave room for swap. + # + [ $swapsize -gt 0 ] && setsize="-s ${partsize}b" + gpart add -t freebsd-zfs -i $mbrindex $setsize ${disk}s1 || + return $FAILURE + f_quietly zpool labelclear -f /dev/$disk$targetpart # Pedantic + + # + # 5. Add freebsd-swap partition + # + if [ $swapsize -gt 0 ]; then + gpart add -t freebsd-swap -i 2 ${disk}s1 || + return $FAILURE + # Update fstab(5) + printf "$fstab_fmt" /dev/${disk}s1b none swap sw 0 0 \ + >> $BSDINSTALL_TMPETC/fstab || return $FAILURE + fi + ;; + + *) + printf "%s: %s is an unsupported partition scheme" \ + "$funcname" "$ZFSBOOT_PARTITION_SCHEME" >&2 + return $FAILURE + + esac # $ZFSBOOT_PARTITION_SCHEME + + return $SUCCESS +} + +# zfs_create_boot $poolname $vdev_type $real_disks ... +# +# Creates boot pool and dataset layout. Returns error if something goes wrong. +# Errors are printed to stderr for collection and display. +# +zfs_create_boot() +{ + local poolname="$1" vdev_type="$2" + local fstab_fmt="%s\t\t%s\t%s\t%s\t\t%s\t%s\n" + local funcname=zfs_create_boot + local bootpart targetpart + + shift 2 # name vdev_type + + # We may need this later + local realdisks=$* + + # Pedantic checks; should never be seen + if [ ! "$poolname" ]; then + echo "$funcname: NULL poolname" >&2 + return $FAILURE + fi + if [ $# -lt 1 ]; then + echo "$funcname: missing disk arguments" >&2 + return $FAILURE + fi + + # Initialize fstab(5) + printf "$fstab_fmt" \ + "# Device" Mountpoint FStype Options Dump "Pass#" \ + >> $BSDINSTALL_TMPETC/fstab || return $FAILURE + + # Expand SI units in desired sizes + local swapsize gelisize + f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize || return $FAILURE + f_expand_number "$ZFSBOOT_GELI_BOOT_SIZE" gelisize || return $FAILURE + + # Prepare the disks + local n=0 + for disk in $*; do + zfs_create_diskpart $disk $n || return $FAILURE + n=$(( $n + 1 )) + done + + # MBR boot loader hack part 1 + # We have to do this early because geli gets in the way later + if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then + for disk in $realdisks; do + dd if=/boot/zfsboot of=/dev/${disk}s1 count=1 || + return $FAILURE + done + fi + + # Forced 4k alignment support provided by Geom NOP (see gnop(8)) + local unenc_list= + if [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ]; then + local new_list= + for disk in $*; do + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + # We don't gnop the encrypted partition + # because geli will do this for us + # gnop the unencrypted disk + gnop create -S 4096 $disk$bootpart || + return $FAILURE + unenc_list="$unenc_list $disk$bootpart.nop" + else + gnop create -S 4096 $disk$targetpart || + return $FAILURE + new_list="$new_list $disk$targetpart.nop" + fi + done + set -- $new_list + else + local new_list= + for disk in $*; do + new_list="$new_list $disk$targetpart" + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && + unenc_list="$unenc_list $disk$bootpart" + done + set -- $new_list + fi + + # + # If encryption is enabled, we need to create the GEOMs + # + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + local bootvdev= + local geli_pool="$BSDINSTALL_CHROOT/$ZFSBOOT_GELI_POOL_NAME" + local key="$ZFSBOOT_GELI_KEY_FILE" + + # Create the parent directories for our unencrypted pool + f_quietly umount /mnt + mount -t tmpfs none $BSDINSTALL_CHROOT || return $FAILURE + + # Create mirror across the unencrypted partition on all disks + [ $( set -- $unenc_list; echo $# ) -gt 1 ] && bootvdev=mirror + + zpool create -o altroot=$BSDINSTALL_CHROOT \ + -m "/$ZFSBOOT_GELI_POOL_NAME" -f \ + "$ZFSBOOT_GELI_POOL_NAME" $bootvdev $unenc_list || + return $FAILURE + mkdir -p $geli_pool/boot || return $FAILURE + + # Generate an encryption key using random(4) + dd if=/dev/random of="$geli_pool/$key" bs=4096 count=1 || + return $FAILURE + + # Create the geli(8) GEOMS + local geli_list + msg_enter_new_password="$msg_geli_password" \ + f_dialog_input_password || return $FAILURE + f_dialog_info "$msg_geli_setup" \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + for disk in $realdisks; do + echo "$pw_password" | geli init -b -B \ + "$geli_pool/boot/$disk$targetpart.eli" \ + -e AES-XTS -J - -K "$geli_pool/$key" -l 256 \ + -s 4096 $disk$targetpart || return $FAILURE + echo "$pw_password" | geli attach -j - \ + -k "$geli_pool/$key" $disk$targetpart || + return $FAILURE + geli_list="$geli_list $disk$targetpart.eli" + done + set -- $geli_list + zfs unmount "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE + f_quietly umount /mnt # done with tmpfs + fi + + # + # Create the ZFS pool with desired type and disk devices + # + zpool create -o altroot=$BSDINSTALL_CHROOT -m none -f \ + "$poolname" $vdev_type $* || return $FAILURE + + # Customize the zpool a bit... + zfs set checksum=fletcher4 "$poolname" || return $FAILURE + zfs set atime=off "$poolname" || return $FAILURE + + # + # Create ZFS dataset layout within the new boot pool + # + echo "$ZFSBOOT_DATASETS" | while read dataset options; do + # Skip blank lines and comments + case "$dataset" in "#"*|"") continue; esac + # Remove potential inline comments in options + options="${options%%#*}" + # Replace tabs with spaces + f_replaceall "$options" " " " " options + # Reduce contiguous runs of space to one single space + oldoptions= + while [ "$oldoptions" != "$options" ]; do + oldoptions="$options" + f_replaceall "$options" " " " " options + done + # Replace both commas and spaces with ` -o ' + f_replaceall "$options" "[ ,]" " -o " options + # Create the dataset with desired options + zfs create ${options:+-o $options} "$poolname$dataset" || + return $FAILURE + done + + # Touch up permissions on the tmp directories + chmod 1777 $BSDINSTALL_CHROOT/tmp || return $FAILURE + chmod 1777 $BSDINSTALL_CHROOT/var/tmp || return $FAILURE + + # Create symlink(s) + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && + { ln -s $ZFSBOOT_GELI_POOL_NAME/boot $BSDINSTALL_CHROOT/boot || + return $FAILURE; } + + # Set bootfs property + zpool set bootfs="$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME" \ + "$poolname" || return $FAILURE + + # Export the pool(s) + zpool export "$poolname" || return $FAILURE + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && + { zpool export "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE; } + + # Destroy the gnop devices (if enabled) + for disk in ${ZFSBOOT_GNOP_4K_FORCE_ALIGN:+$realdisks}; do + if [ "$ZFSBOOT_GELI_ENCRYPTION" ]; then + f_quietly gnop destroy $disk$bootpart.nop + else + f_quietly gnop destroy $disk$targetpart.nop + fi + done + + # MBR boot loader hack part 2 + if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then + # Stick the ZFS boot loader in the "convienient hole" after + # the ZFS internal metadata + for disk in $realdisks; do + dd if=/boot/zfsboot of=/dev/$disk$bootpart \ + skip=1 seek=1024 || return $FAILURE + done + fi + + # Re-import the ZFS pool(s) + zpool import -o altroot=$BSDINSTALL_CHROOT $poolname || return $FAILURE + [ "$ZFSBOOT_GELI_ENCRYPTION" ] && + { zpool import -o altroot=$BSDINSTALL_CHROOT \ + "$ZFSBOOT_GELI_POOL_NAME" || return $FAILURE; } + + # While this is apparently not needed, it seems to help MBR + mkdir -p $BSDINSTALL_CHROOT/boot/zfs || return $FAILURE + zpool set cachefile=$BSDINSTALL_CHROOT/boot/zfs/zpool.cache \ + "$poolname" || return $FAILURE + + # Last, but not least... add required lines to rc.conf(5) + # NOTE: We later concatenate these into their destination + echo 'zfs_enable="YES"' > $BSDINSTALL_TMPETC/rc.conf.zfs || + return $FAILURE + echo 'zfs_load="YES"' > $BSDINSTALL_TMPBOOT/loader.conf.zfs || + return $FAILURE + + # We're all done unless we should go on to do encryption + [ "$ZFSBOOT_GELI_ENCRYPTION" ] || return $SUCCESS + + # + # Configure geli(8)-based encryption + # + echo 'aesni_load="YES"' \ + > $BSDINSTALL_TMPBOOT/loader.conf.aesni || return $FAILURE + echo 'geom_eli_load="YES"' \ + > $BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE + printf 'vfs.root.mountfrom="zfs:%s/%s/%s"\n' "$poolname" \ + "$ZFSBOOT_BEROOT_NAME" "$ZFSBOOT_BOOTFS_NAME" \ + > $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE + for disk in $realdisks; do + printf 'geli_%s_keyfile0_load="YES"\n' \ + "$disk$targetpart" \ + > $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || + return $FAILURE + printf 'geli_%s_keyfile0_type="%s:geli_keyfile0"\n' \ + "$disk$targetpart" "$disk$targetpart" \ + >> $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || + return $FAILURE + printf 'geli_%s_keyfile0_name="%s"\n' \ + "$disk$targetpart" "$ZFSBOOT_GELI_KEY_FILE" \ + >> $BSDINSTALL_TMPBOOT/loader.conf.$disk$targetpart || + return $FAILURE + done + + return $SUCCESS +} + +# dialog_menu_diskinfo +# +# Prompt the user to select a disk and then provide detailed info on it. +# +dialog_menu_diskinfo() +{ + local disk + + # + # Break from loop when user cancels disk selection + # + while :; do + disk=$( msg_cancel="$msg_back" f_device_menu \ + "$DIALOG_TITLE" "$msg_select_a_disk_device" "" \ + $DEVICE_TYPE_DISK 2>&1 ) || break + + # Show gpart(8) `show' and camcontrol(8) `inquiry' data + f_show_msg "$msg_detailed_disk_info" \ + "$disk" "$( gpart show $disk 2> /dev/null )" \ + "$disk" "$( camcontrol inquiry $disk 2> /dev/null )" \ + "$disk" "$( camcontrol identify $disk 2> /dev/null )" + done + + return $SUCCESS +} + +############################################################ MAIN + +# +# Initialize +# +f_dialog_title "$msg_zfs_configuration" +f_dialog_backtitle "$msg_freebsd_installer" + +# User may have specifically requested ZFS-related operations be interactive +! f_interactive && f_zfsinteractive && unset $VAR_NONINTERACTIVE + +# +# Loop over the main menu until we've accomplished what we came here to do +# +while :; do + if ! f_interactive; then + retval=$DIALOG_OK + mtag=">>> $msg_create" + else + dialog_menu_main + retval=$? + f_dialog_menutag_fetch mtag + fi + + f_dprintf "retval=%u mtag=[%s]" $reval "$mtag" + [ $retval -eq $DIALOG_OK ] || f_die + + case "$mtag" in + ">>> $msg_create") + # + # First, validate the user's selections *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:43:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 343596A2; Fri, 11 Oct 2013 20:43:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06DAB2280; Fri, 11 Oct 2013 20:43:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BKgxvi002709; Fri, 11 Oct 2013 20:42:59 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BKgxab002708; Fri, 11 Oct 2013 20:42:59 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310112042.r9BKgxab002708@svn.freebsd.org> From: Dimitry Andric Date: Fri, 11 Oct 2013 20:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256344 - stable/10/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:43:00 -0000 Author: dim Date: Fri Oct 11 20:42:59 2013 New Revision: 256344 URL: http://svnweb.freebsd.org/changeset/base/256344 Log: Fix up the svn mergeinfo which I forgot in r256342. Approved by: re (glebius) Modified: Directory Properties: stable/10/sys/ (props changed) From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 20:52:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DB34FB44; Fri, 11 Oct 2013 20:52:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B73272346; Fri, 11 Oct 2013 20:52:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BKqgLa007923; Fri, 11 Oct 2013 20:52:42 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BKqgqp007922; Fri, 11 Oct 2013 20:52:42 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310112052.r9BKqgqp007922@svn.freebsd.org> From: Devin Teske Date: Fri, 11 Oct 2013 20:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256345 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 20:52:42 -0000 Author: dteske Date: Fri Oct 11 20:52:42 2013 New Revision: 256345 URL: http://svnweb.freebsd.org/changeset/base/256345 Log: Rewrite the keymap module to display an actual menu of selectable keymaps *and* provide a mechanism for testing the selection. With this commit, bsdinstall is no longer dependent on kbdmap(1). The keymap test menu was originally submitted by Warren Block but was modified). Submitted by: Warren Block Reviewed by: Allan Jude Approved by: re (glebius) Modified: head/usr.sbin/bsdinstall/scripts/keymap Modified: head/usr.sbin/bsdinstall/scripts/keymap ============================================================================== --- head/usr.sbin/bsdinstall/scripts/keymap Fri Oct 11 20:42:59 2013 (r256344) +++ head/usr.sbin/bsdinstall/scripts/keymap Fri Oct 11 20:52:42 2013 (r256345) @@ -1,6 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn +# Copyright (c) 2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,11 +26,212 @@ # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." "$0" +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/keymap.subr +f_include $BSDCFG_SHARE/sysrc.subr + +############################################################ CONFIGURATION + +# +# Default file to store keymap selection in +# +: ${KEYMAPFILE:=$BSDINSTALL_TMPETC/rc.conf.keymap} + +# +# Default path to keymap INDEX containing descriptions +# +: ${MAPDESCFILE:=/usr/share/syscons/keymaps/INDEX.keymaps} + +############################################################ GLOBALS + +# +# Strings that should be moved to an i18n file and loaded with f_include_lang() +# +hline_arrows_tab_enter="Press arrows, TAB or ENTER" +msg_continue_with_keymap="Continue with %s keymap" +msg_default="default" +msg_error="Error" +msg_freebsd_installer="FreeBSD Installer" +msg_keymap_menu_text="The system console driver for FreeBSD defaults to standard \"US\"\nkeyboard map. Other keymaps can be chosen below." +msg_keymap_selection="Keymap Selection" +msg_ok="OK" +msg_select="Select" +msg_test_keymap="Test %s keymap" +msg_test_the_currently_selected_keymap="Test the currently selected keymap" +msg_test_the_keymap_by_typing="Test the keymap by typing letters, numbers, and symbols. Characters\nshould match labels on the keyboard keys. Press Enter to stop testing." + +############################################################ FUNCTIONS + +# dialog_keymap_test $keymap +# +# Activate $keymap and display an input box (without cancel button) for the +# user to test keyboard input and return. Always returns success. +# +dialog_keymap_test() +{ + local keym="$1" + local title= # Calculated below + local btitle= # Calculated below + local prompt="$msg_test_the_keymap_by_typing" + local hline= + + # Attempt to activate the keymap + if [ "$keym" ]; then + local err + err=$( f_keymap_kbdcontrol "$keym" 2>&1 > /dev/null ) + if [ "$err" ]; then + f_dialog_title "$msg_error" + f_dialog_msgbox "$err" + f_dialog_title_restore + return $FAILURE + fi + fi + + f_dialog_title "$( printf "$msg_test_keymap" "${keym:-$msg_default}" )" + title="$DIALOG_TITLE" + btitle="$DIALOG_BACKTITLE" + f_dialog_title_restore + + local height width + f_dialog_inputbox_size height width \ + "$title" "$btitle" "$prompt" "" "$hline" + + $DIALOG \ + --title "$title" \ + --backtitle "$btitle" \ + --hline "$hline" \ + --ok-label "$msg_ok" \ + --no-cancel \ + --inputbox "$prompt" \ + $height $width \ + 2>/dev/null >&$DIALOG_TERMINAL_PASSTHRU_FD -kbdcontrol -d >/dev/null 2>&1 -if [ $? -eq 0 ]; then - dialog --backtitle "FreeBSD Installer" --title "Keymap Selection" \ - --yesno "Would you like to set a non-default key mapping for your keyboard?" 0 0 || exit 0 - exec 3>&1 - kbdmap 2>&1 1>&3 | grep 'keymap=' > $BSDINSTALL_TMPETC/rc.conf.keymap + return $DIALOG_OK +} + +############################################################ MAIN + +# +# Initialize +# +f_dialog_title "$msg_keymap_selection" +f_dialog_backtitle "$msg_freebsd_installer" + +# +# Die immediately if we can't dump the current keyboard map +# +#error=$( kbdcontrol -d 2>&1 > /dev/null ) || f_die $FAILURE "%s" "$error" + +# Capture Ctrl-C for clean-up +trap 'rm -f $KEYMAPFILE; exit $FAILURE' SIGINT + +# Get a value from rc.conf(5) as initial value (if not being scripted) +f_getvar $VAR_KEYMAP keymap +if [ ! "$keymap" ]; then + keymap=$( f_sysrc_get keymap ) + case "$keymap" in [Nn][Oo]) keymap="";; esac fi + +# +# Loop until the user has finalized their selection (by clicking the +# [relabeled] Cancel button). +# +width=67 first_pass=1 back_from_testing= +[ "$USE_XDIALOG" ] && width=70 +prompt="$msg_keymap_menu_text" +hline="$hline_arrows_tab_enter" +while :; do + # + # Re/Build list of keymaps + # + cont_msg=$( printf "$msg_continue_with_keymap" \ + "${keymap:-$msg_default}" ) + test_msg=$( printf "$msg_test_keymap" "${keymap:-$msg_default}" ) + menu_list=" + '>>> $cont_msg' '' '$msg_continue_with_current_keymap' + '->- $test_msg' '' '$msg_test_the_currently_selected_keymap' + " # END-QUOTE + if [ "$first_pass" ]; then + defaultitem= + first_pass= + else + defaultitem="->- $test_msg" + fi + for k in $KEYMAPS; do + keymap_$k get keym keym + keymap_$k get desc desc + radio=" " + if [ "$keym" = "$keymap" ]; then + radio="*" + if [ "$back_from_testing" ]; then + defaultitem="(*) $desc" + back_from_testing= + fi + fi + f_shell_escape "$desc" desc + menu_list="$menu_list + '($radio) $desc' '' '$keym: $desc' + " # END-QUOTE + done + back_from_testing= + + # + # Display keymap configuration menu + # + eval f_dialog_menu_with_help_size height \"\" rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list + menu_choice=$( eval $DIALOG \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --hline \"\$hline\" \ + --keep-tite \ + --item-help \ + --ok-label \"\$msg_select\" \ + --cancel-label \"\$msg_cancel\" \ + --default-item \"\$defaultitem\" \ + --menu \"\$prompt\" \ + $height $width $rows \ + $menu_list \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) || { + f_quietly rm -f "$KEYMAPFILE" + exit $FAILURE # Exit with an error so bsdinstall restarts + } + f_dialog_data_sanitize menu_choice + + case "$menu_choice" in + ">>> "*) # Continue with keymap + break ;; + "->-"*) # Test keymap + dialog_keymap_test "$keymap" + back_from_testing=1 + continue ;; + esac + + # Turn the user's choice into a number + n=$( eval f_dialog_menutag2index_with_help \ + \"\$menu_choice\" $menu_list ) + + # Turn that number ithe name of the keymap struct + k=$( set -- $KEYMAPS; eval echo \"\${$(( $n - 2))}\" ) + + # Get actual keymap setting while we update $keymap and $KEYMAPFILE + keymap_$k get keym keymap + echo "keymap=\"$keymap\"" > "$KEYMAPFILE" +done + +f_quietly f_keymap_kbdcontrol "$keymap" + +################################################################################ +# END +################################################################################ From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 21:12:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D3BFC8F; Fri, 11 Oct 2013 21:12:48 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C0D30247A; Fri, 11 Oct 2013 21:12:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BLCmFj019104; Fri, 11 Oct 2013 21:12:48 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BLCmWH019103; Fri, 11 Oct 2013 21:12:48 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310112112.r9BLCmWH019103@svn.freebsd.org> From: Devin Teske Date: Fri, 11 Oct 2013 21:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256347 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 21:12:48 -0000 Author: dteske Date: Fri Oct 11 21:12:48 2013 New Revision: 256347 URL: http://svnweb.freebsd.org/changeset/base/256347 Log: Incorporate PR bin/161547 to detect when an interface is wireless. Patch from PR modified slightly for whitespace and style. PR: bin/161547 Submitted by: Warren Block Reviewed by: Allan Jude Approved by: re (glebius) Modified: head/usr.sbin/bsdinstall/scripts/netconfig Modified: head/usr.sbin/bsdinstall/scripts/netconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/netconfig Fri Oct 11 20:53:25 2013 (r256346) +++ head/usr.sbin/bsdinstall/scripts/netconfig Fri Oct 11 21:12:48 2013 (r256347) @@ -41,11 +41,19 @@ DIALOG_TAGS="" : ${DIALOG_ITEM_HELP=4} : ${DIALOG_ESC=255} +# Do a dirty check to see if this a wireless interface -- there should be a +# better way +is_wireless_if() { + ifconfig $1 | grep -q 'media: IEEE 802.11 Wireless' +} + for IF in `ifconfig -l`; do test "$IF" = "lo0" && continue (ifconfig -g wlan | egrep -wq $IF) && continue INTERFACES="$INTERFACES $IF" DESC=`sysctl -n dev.$(echo $IF | sed -E 's/([[:alpha:]]*)([[:digit:]]*)/\1.\2/g').%desc` + is_wireless_if $IF && echo $DESC | + grep -iqv wireless && DESC="Wireless $DESC" DIALOG_TAGS="$DIALOG_TAGS $IF \"$DESC\"" done @@ -63,10 +71,8 @@ exec 3>&- : > $BSDINSTALL_TMPETC/._rc.conf.net -# Do a dirty check to see if this a wireless interface -- there should be a -# better way IFCONFIG_PREFIX="" -if ifconfig $INTERFACE | grep -q 'media: IEEE 802.11 Wireless'; then +if is_wireless_if $INTERFACE; then NEXT_WLAN_IFACE=wlan0 # XXX echo wlans_$INTERFACE=\"$NEXT_WLAN_IFACE\" >> $BSDINSTALL_TMPETC/._rc.conf.net IFCONFIG_PREFIX="WPA " From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 21:23:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4D4374A4; Fri, 11 Oct 2013 21:23:45 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 203DC2517; Fri, 11 Oct 2013 21:23:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BLNiG0024010; Fri, 11 Oct 2013 21:23:44 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BLNisc024009; Fri, 11 Oct 2013 21:23:44 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310112123.r9BLNisc024009@svn.freebsd.org> From: Devin Teske Date: Fri, 11 Oct 2013 21:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256348 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 21:23:45 -0000 Author: dteske Date: Fri Oct 11 21:23:44 2013 New Revision: 256348 URL: http://svnweb.freebsd.org/changeset/base/256348 Log: Remove the dumpdev configuration dialog, merge it into the regular services configuration and enable it by default. Committed with slight change to menu text for length and content. Submitted by: Allan Jude Approved by: re (glebius) Modified: head/usr.sbin/bsdinstall/scripts/services Modified: head/usr.sbin/bsdinstall/scripts/services ============================================================================== --- head/usr.sbin/bsdinstall/scripts/services Fri Oct 11 21:12:48 2013 (r256347) +++ head/usr.sbin/bsdinstall/scripts/services Fri Oct 11 21:23:44 2013 (r256348) @@ -46,22 +46,23 @@ DAEMONS=$(dialog --backtitle "FreeBSD In moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ powerd "Adjust CPU frequency dynamically if supported" ${powerd_enable:-off} \ + dumpdev "Enable kernel crash dumps to /var/crash" ${dumpdev:-on} \ 2>&1 1>&3) exec 3>&- +local havedump= for daemon in $DAEMONS; do + if [ "$daemon" == "dumpdev" ]; then + havedump=1 + echo \# Set dumpdev to \"AUTO\" to enable crash dumps, \ + \"NO\" to disable >> \ + $BSDINSTALL_TMPETC/rc.conf.services + echo dumpdev=\"AUTO\" >> $BSDINSTALL_TMPETC/rc.conf.services + continue + fi echo ${daemon}_enable=\"YES\" >> $BSDINSTALL_TMPETC/rc.conf.services done -echo \# Set dumpdev to \"AUTO\" to enable crash dumps, \"NO\" to disable >> \ - $BSDINSTALL_TMPETC/rc.conf.services - -dialog --backtitle "FreeBSD Installer" --title "Dumpdev Configuration" \ - --nocancel --yesno \ - "Would you like to enable crash dumps? If you start having problems with the system it can help the FreeBSD developers debug the problem. But the crash dumps can take up a lot of disk space in /var." 0 0 - -if [ $? -eq $DIALOG_OK ]; then - echo dumpdev=\"AUTO\" >> $BSDINSTALL_TMPETC/rc.conf.services -else +if [ ! "$havedump" ]; then echo dumpdev=\"NO\" >> $BSDINSTALL_TMPETC/rc.conf.services fi From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 21:30:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 62A44879; Fri, 11 Oct 2013 21:30:28 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 35B812569; Fri, 11 Oct 2013 21:30:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BLUSOB027646; Fri, 11 Oct 2013 21:30:28 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BLURGs027643; Fri, 11 Oct 2013 21:30:27 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310112130.r9BLURGs027643@svn.freebsd.org> From: Peter Grehan Date: Fri, 11 Oct 2013 21:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256350 - in head/sys/dev/hyperv: include vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 21:30:28 -0000 Author: grehan Date: Fri Oct 11 21:30:27 2013 New Revision: 256350 URL: http://svnweb.freebsd.org/changeset/base/256350 Log: Fix vmbus channel memory leak where incorrect length parameter was being passed to contigfree(). Submitted by: Microsoft hyperv dev team Approved by: re@ (glebius) Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/vmbus/hv_channel.c Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Fri Oct 11 21:24:33 2013 (r256349) +++ head/sys/dev/hyperv/include/hyperv.h Fri Oct 11 21:30:27 2013 (r256350) @@ -24,6 +24,8 @@ * 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$ */ /** @@ -669,6 +671,7 @@ typedef struct hv_vmbus_channel { * Allocated memory for ring buffer */ void* ring_buffer_pages; + unsigned long ring_buffer_size; uint32_t ring_buffer_page_count; /* * send to parent Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Fri Oct 11 21:24:33 2013 (r256349) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Fri Oct 11 21:30:27 2013 (r256350) @@ -104,17 +104,19 @@ hv_vmbus_channel_open( /* Allocate the ring buffer */ out = contigmalloc((send_ring_buffer_size + recv_ring_buffer_size), - M_DEVBUF, M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); + M_DEVBUF, M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); KASSERT(out != NULL, ("Error VMBUS: contigmalloc failed to allocate Ring Buffer!")); if (out == NULL) - return (ENOMEM); + return (ENOMEM); in = ((uint8_t *) out + send_ring_buffer_size); new_channel->ring_buffer_pages = out; - new_channel->ring_buffer_page_count = (send_ring_buffer_size - + recv_ring_buffer_size) >> PAGE_SHIFT; + new_channel->ring_buffer_page_count = (send_ring_buffer_size + + recv_ring_buffer_size) >> PAGE_SHIFT; + new_channel->ring_buffer_size = send_ring_buffer_size + + recv_ring_buffer_size; hv_vmbus_ring_buffer_init( &new_channel->outbound, @@ -539,10 +541,8 @@ hv_vmbus_channel_close(hv_vmbus_channel hv_ring_buffer_cleanup(&channel->outbound); hv_ring_buffer_cleanup(&channel->inbound); - contigfree( - channel->ring_buffer_pages, - channel->ring_buffer_page_count, - M_DEVBUF); + contigfree(channel->ring_buffer_pages, channel->ring_buffer_size, + M_DEVBUF); free(info, M_DEVBUF); From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 21:47:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 39859D18; Fri, 11 Oct 2013 21:47:18 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0AF5D265B; Fri, 11 Oct 2013 21:47:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BLlH6Q035284; Fri, 11 Oct 2013 21:47:17 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BLlHjW035282; Fri, 11 Oct 2013 21:47:17 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310112147.r9BLlHjW035282@svn.freebsd.org> From: Peter Grehan Date: Fri, 11 Oct 2013 21:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256352 - in stable/10/sys/dev/hyperv: include vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 21:47:18 -0000 Author: grehan Date: Fri Oct 11 21:47:17 2013 New Revision: 256352 URL: http://svnweb.freebsd.org/changeset/base/256352 Log: MFC r256350 Fix vmbus channel memory leak where incorrect length parameter was being passed to contigfree(). Approved by: re@ (glebius) Modified: stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/vmbus/hv_channel.c Directory Properties: stable/10/sys/ (props changed) stable/10/sys/dev/hyperv/ (props changed) Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Fri Oct 11 21:41:07 2013 (r256351) +++ stable/10/sys/dev/hyperv/include/hyperv.h Fri Oct 11 21:47:17 2013 (r256352) @@ -24,6 +24,8 @@ * 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$ */ /** @@ -669,6 +671,7 @@ typedef struct hv_vmbus_channel { * Allocated memory for ring buffer */ void* ring_buffer_pages; + unsigned long ring_buffer_size; uint32_t ring_buffer_page_count; /* * send to parent Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_channel.c Fri Oct 11 21:41:07 2013 (r256351) +++ stable/10/sys/dev/hyperv/vmbus/hv_channel.c Fri Oct 11 21:47:17 2013 (r256352) @@ -104,17 +104,19 @@ hv_vmbus_channel_open( /* Allocate the ring buffer */ out = contigmalloc((send_ring_buffer_size + recv_ring_buffer_size), - M_DEVBUF, M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); + M_DEVBUF, M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); KASSERT(out != NULL, ("Error VMBUS: contigmalloc failed to allocate Ring Buffer!")); if (out == NULL) - return (ENOMEM); + return (ENOMEM); in = ((uint8_t *) out + send_ring_buffer_size); new_channel->ring_buffer_pages = out; - new_channel->ring_buffer_page_count = (send_ring_buffer_size - + recv_ring_buffer_size) >> PAGE_SHIFT; + new_channel->ring_buffer_page_count = (send_ring_buffer_size + + recv_ring_buffer_size) >> PAGE_SHIFT; + new_channel->ring_buffer_size = send_ring_buffer_size + + recv_ring_buffer_size; hv_vmbus_ring_buffer_init( &new_channel->outbound, @@ -539,10 +541,8 @@ hv_vmbus_channel_close(hv_vmbus_channel hv_ring_buffer_cleanup(&channel->outbound); hv_ring_buffer_cleanup(&channel->inbound); - contigfree( - channel->ring_buffer_pages, - channel->ring_buffer_page_count, - M_DEVBUF); + contigfree(channel->ring_buffer_pages, channel->ring_buffer_size, + M_DEVBUF); free(info, M_DEVBUF); From owner-svn-src-all@FreeBSD.ORG Fri Oct 11 23:12:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E3598782; Fri, 11 Oct 2013 23:12:07 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CEE432A64; Fri, 11 Oct 2013 23:12:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9BNC7cu080406; Fri, 11 Oct 2013 23:12:07 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9BNC5ri080353; Fri, 11 Oct 2013 23:12:05 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310112312.r9BNC5ri080353@svn.freebsd.org> From: Devin Teske Date: Fri, 11 Oct 2013 23:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256361 - in stable/10/usr.sbin: bsdconfig/include bsdconfig/share bsdinstall bsdinstall/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 11 Oct 2013 23:12:08 -0000 Author: dteske Date: Fri Oct 11 23:12:05 2013 New Revision: 256361 URL: http://svnweb.freebsd.org/changeset/base/256361 Log: MFC revisions 256321-256323,256331,256333,256335,256343: Bring in a new zfsboot auto script for performing automatic setup of a boot pool (optionally encrypted) with many other options, validations, features. Originally submitted by Allan Jude; modified in collaboration. MFC revisions 256325,256330,256345: Rewrite the keymap selection menu to display keymaps and provide a test mechanism. Test mechanism originally submitted by Warren Block; modified. MFC r256347: Prominently display "Wireless" for each wireless network interface. Part of PR bin/161547; submitted by Warren Block; slightly modified. MFC r256348: Remove the dumpdev configuration dialog, merge it into the regular services configuration and enable it by default. Originally submitted by Allan Jude; slightly modified. PR: bin/161547 Submitted by: Allan Jude, Warren Block In collaboration with: Allan Jude Approved by: re (glebius) Added: stable/10/usr.sbin/bsdconfig/share/keymap.subr - copied unchanged from r256325, head/usr.sbin/bsdconfig/share/keymap.subr stable/10/usr.sbin/bsdinstall/scripts/zfsboot - copied unchanged from r256343, head/usr.sbin/bsdinstall/scripts/zfsboot Modified: stable/10/usr.sbin/bsdconfig/include/messages.subr stable/10/usr.sbin/bsdconfig/share/Makefile stable/10/usr.sbin/bsdconfig/share/device.subr stable/10/usr.sbin/bsdconfig/share/dialog.subr stable/10/usr.sbin/bsdconfig/share/strings.subr stable/10/usr.sbin/bsdconfig/share/variable.subr stable/10/usr.sbin/bsdinstall/bsdinstall stable/10/usr.sbin/bsdinstall/scripts/Makefile stable/10/usr.sbin/bsdinstall/scripts/auto stable/10/usr.sbin/bsdinstall/scripts/config stable/10/usr.sbin/bsdinstall/scripts/keymap stable/10/usr.sbin/bsdinstall/scripts/netconfig stable/10/usr.sbin/bsdinstall/scripts/services Directory Properties: stable/10/usr.sbin/bsdconfig/ (props changed) stable/10/usr.sbin/bsdinstall/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/include/messages.subr Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdconfig/include/messages.subr Fri Oct 11 23:12:05 2013 (r256361) @@ -201,6 +201,7 @@ msg_lithuania="Lithuania" msg_loading_of_dependent_package_failed="Loading of dependent package %s failed" msg_located_index_now_reading_package_data_from_it="Located INDEX, now reading package data from it..." msg_logging_in_to_user_at_host="Logging in to %s@%s.." +msg_looking_for_keymap_files="Looking for keymap files..." msg_looking_up_host="Looking up host %s" msg_mail_desc="Electronic mail packages and utilities." msg_main_menu="Main Menu" Modified: stable/10/usr.sbin/bsdconfig/share/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/Makefile Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdconfig/share/Makefile Fri Oct 11 23:12:05 2013 (r256361) @@ -5,8 +5,9 @@ NO_OBJ= SUBDIR= media packages FILESDIR= ${SHAREDIR}/bsdconfig -FILES= common.subr device.subr dialog.subr mustberoot.subr \ - script.subr strings.subr struct.subr sysrc.subr variable.subr +FILES= common.subr device.subr dialog.subr keymap.subr \ + mustberoot.subr script.subr strings.subr struct.subr \ + sysrc.subr variable.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: stable/10/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/device.subr Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdconfig/share/device.subr Fri Oct 11 23:12:05 2013 (r256361) @@ -49,6 +49,7 @@ f_struct_define DEVICE \ desc \ devname \ type \ + capacity \ enabled \ init \ get \ @@ -114,7 +115,7 @@ f_device_try() } # f_device_register $name $desc $devname $type $enabled $init_function \ -# $get_function $shutdown_function $private +# $get_function $shutdown_function $private $capacity # # Register a device. A `structure' (see struct.subr) is created with the name # device_$name (so make sure $name contains only alpha-numeric characters or @@ -128,6 +129,7 @@ f_device_register() { local name="$1" desc="$2" devname="$3" type="$4" enabled="$5" local init_func="$6" get_func="$7" shutdown_func="$8" private="$9" + local capacity="${10}" f_struct_new DEVICE "device_$name" || return $FAILURE device_$name set name "$name" @@ -139,6 +141,7 @@ f_device_register() device_$name set get "$get_func" device_$name set shutdown "$shutdown_func" device_$name set private "$private" + device_$name set capacity "$capacity" # Scan our global register to see if it needs ammending local dev found= @@ -196,7 +199,7 @@ f_device_get_all() f_dprintf "Found a network device named %s" "$devname" f_device_register $devname \ "$desc" "$devname" $DEVICE_TYPE_NETWORK 1 \ - f_media_init_network "" f_media_shutdown_network "" + f_media_init_network "" f_media_shutdown_network "" -1 done # Next, try to find all the types of devices one might use @@ -208,6 +211,10 @@ f_device_get_all() n=$(( $n + 1 )) # Get the desc, type, and max (with debugging disabled) # NOTE: Bypassing f_device_name_get() for efficiency + # ASIDE: This would be equivalent to the following: + # debug= f_device_name_get $dev desc + # debug= f_device_name_get $dev type + # debug= f_device_name_get $dev max debug= f_getvar _device_desc$n desc debug= f_getvar _device_type$n type debug= f_getvar _device_max$n max @@ -222,7 +229,8 @@ f_device_get_all() f_device_register "${devname##*/}" "$desc" \ "$devname" $DEVICE_TYPE_CDROM 1 \ f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" + f_media_shutdown_cdrom "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a CDROM device for %s" \ "$devname" ;; @@ -232,7 +240,8 @@ f_device_get_all() "$devname" $DEVICE_TYPE_FLOPPY 1 \ f_media_init_floppy \ f_media_get_floppy \ - f_media_shutdown_floppy "" + f_media_shutdown_floppy "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a floppy device for %s" \ "$devname" ;; @@ -241,7 +250,8 @@ f_device_get_all() f_device_register "${devname##*/}" "$desc" \ "$devname" $DEVICE_TYPE_USB 1 \ f_media_init_usb f_media_get_usb \ - f_media_shutdown_usb "" + f_media_shutdown_usb "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a USB disk for %s" "$devname" ;; esac @@ -254,7 +264,8 @@ f_device_get_all() f_device_register "${devname##*/}" "ISO9660 file system" \ "$devname" $DEVICE_TYPE_CDROM 1 \ f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" + f_media_shutdown_cdrom "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a CDROM device for %s" "$devname" done @@ -281,7 +292,8 @@ f_device_get_all() "md(4) vnode file system" \ "$devname" $DEVICE_TYPE_CDROM 1 \ f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" + f_media_shutdown_cdrom "" \ + "$( f_device_capacity "$devname" )" f_dprintf "Found a CDROM device for %s" "$devname" ;; esac @@ -313,8 +325,13 @@ f_device_get_all() continue fi - f_device_register "$diskname" "" \ - "/dev/$diskname" $DEVICE_TYPE_DISK 0 + # Try and find its description + f_device_desc "$diskname" $DEVICE_TYPE_DISK desc + + f_device_register "$diskname" "$desc" \ + "/dev/$diskname" $DEVICE_TYPE_DISK 0 \ + "" "" "" "" \ + "$( f_device_capacity "$diskname" )" f_dprintf "Found a disk device named %s" "$diskname" # Look for existing partitions to register @@ -327,7 +344,8 @@ f_device_get_all() f_device_register "$slice" "" \ "/dev/$slice" $DEVICE_TYPE_DOS 1 \ f_media_init_dos f_media_get_dos \ - f_media_shutdown_dos "" + f_media_shutdown_dos "" \ + "$( f_device_capacity "/dev/$slice" )" f_dprintf "Found a DOS partition %s" "$slice" ;; 0xa5) # FreeBSD partition @@ -347,7 +365,9 @@ f_device_get_all() $DEVICE_TYPE_UFS 1 \ f_media_init_ufs \ f_media_get_ufs \ - f_media_shutdown_ufs "" + f_media_shutdown_ufs "" \ + "$( f_device_capacity \ + "$/dev/$part" )" f_dprintf "Found a UFS partition %s" \ "$part" done # parts @@ -379,10 +399,27 @@ f_device_name_get() case "$__prop" in type|desc|max) : good ;; *) return $FAILURE; esac + # + # Attempt to create an alternate-form of $__name that contains the + # first contiguous string of numbers replaced with `%d' for comparison + # against stored pattern names (see MAIN). + # + local __left="${__name%%[0-9]*}" __right="${__name#*[0-9]}" __dname= + if [ "$__left" != "$__name" ]; then + # Chop leading digits from right 'til we hit first non-digit + while :; do + case "$__right" in + [0-9]*) __right="${__right#[0-9]}" ;; + *) break + esac + done + __dname="${__left}%d$__right" + fi + [ "$__type" = "$DEVICE_TYPE_ANY" ] && __type= for __dev in $DEVICE_NAMES; do __n=$(( $__n + 1 )) - [ "$__dev" = "$__name" ] || continue + [ "$__dev" = "$__name" -o "$__dev" = "$__dname" ] || continue f_getvar _device_type$__n __devtype [ "${__type:-$__devtype}" = "$__devtype" ] || continue f_getvar _device_$__prop$__n $__var_to_set @@ -463,6 +500,39 @@ f_device_desc() fi fi + # + # For disks, attempt to return camcontrol(8) descriptions. + # Otherwise fall through to below static list. + # + f_have camcontrol && + [ "${__type:-$DEVICE_TYPE_DISK}" = "$DEVICE_TYPE_DISK" ] && + __cp=$( camcontrol devlist 2> /dev/null | awk -v disk="$__name" ' + $0~"(\\(|,)"disk"(,|\\))" { + if (!match($0, "<[^>]+>")) next + print substr($0, RSTART+1, RLENGTH-2) + found = 1 + exit + } + END { exit ! found } + ' ) && setvar "$__var_to_set" "$__cp" && return $SUCCESS + + # + # Attempt to create an alternate-form of $__name that contains the + # first contiguous string of numbers replaced with `%d' for comparison + # against stored pattern names (see MAIN). + # + local __left="${__name%%[0-9]*}" __right="${__name#*[0-9]}" __dname= + if [ "$__left" != "$__name" ]; then + # Chop leading digits from right 'til we hit first non-digit + while :; do + case "$__right" in + [0-9]*) __right="${__right#[0-9]}" ;; + *) break + esac + done + __dname="${__left}%d$__right" + fi + local __dev __devtype __n=0 for __dev in $DEVICE_NAMES; do __n=$(( $__n + 1 )) @@ -472,11 +542,8 @@ f_device_desc() __devname=$( f_substr "$__name" 0 ${#__dev} ) [ "$__devname" = "$__dev" ] || continue else - __devname="${__name%%[0-9]*}" - __devunit="${__name#$__devname}" - __devunit="${__devunit%%[!0-9]*}" - __devname=$( printf "$__dev" $__devunit ) - [ "$__devname" = "$__name" ] || continue + [ "$__dev" = "$__name" -o "$__dev" = "$__dname" ] || + continue fi debug= f_getvar _device_desc$__n $__var_to_set return $? @@ -655,6 +722,25 @@ f_device_menu() return $retval } +# f_device_capacity $device [$var_to_set] +# +# Return the capacity of $device in bytes. +# +f_device_capacity() +{ + local __dev="$1" __var_to_set="$2" + local __bytes + + __bytes=$( diskinfo -v "$__dev" 2> /dev/null | + awk '/# mediasize in bytes/{print $1}' ) || __bytes=-1 + + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" "$__bytes" + else + echo "$__bytes" + fi +} + # # Short-hand # @@ -680,6 +766,7 @@ f_disk "ipsd%d" "IBM ServeRAID RAID ar f_disk "mfid%d" "LSI MegaRAID SAS array" 4 f_disk "mlxd%d" "Mylex RAID disk" 4 f_disk "twed%d" "3ware ATA RAID array" 4 +f_disk "vtbd%d" "VirtIO Block Device" 16 f_floppy "fd%d" "Floppy Drive unit A" 4 f_serial "cuau%d" "%s on device %s (COM%d)" 16 f_usb "da%da" "USB Mass Storage Device" 16 Modified: stable/10/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/dialog.subr Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdconfig/share/dialog.subr Fri Oct 11 23:12:05 2013 (r256361) @@ -415,8 +415,8 @@ f_dialog_size_constrain() if [ "$debug" ]; then # Print final constrained values to debugging - f_quietly f_getvar "$__var_height" - f_quietly f_getvar "$__var_width" + [ "$__var_height" ] && f_quietly f_getvar "$__var_height" + [ "$__var_width" ] && f_quietly f_getvar "$__var_width" fi return $__retval # success if no debug warnings were printed @@ -532,10 +532,10 @@ f_dialog_menu_constrain() fi if [ "$debug" ]; then - # Print final constrained values to debuggin - f_quietly f_getvar "$__var_height" - f_quietly f_getvar "$__var_width" - f_quietly f_getvar "$__var_rows" + # Print final constrained values to debugging + [ "$__var_height" ] && f_quietly f_getvar "$__var_height" + [ "$__var_width" ] && f_quietly f_getvar "$__var_width" + [ "$__var_rows" ] && f_quietly f_getvar "$__var_rows" fi return $__retval # success if no debug warnings were printed @@ -2044,6 +2044,7 @@ f_dialog_menutag2index_with_help() f_dialog_init() { DIALOG_SELF_INITIALIZE= + USE_DIALOG=1 # # Clone terminal stdout so we can redirect to it from within sub-shells @@ -2087,7 +2088,7 @@ f_dialog_init() # # Process `-X' command-line option # - [ "$USE_XDIALOG" ] && DIALOG=Xdialog + [ "$USE_XDIALOG" ] && DIALOG=Xdialog USE_DIALOG= # # Sanity check, or die gracefully Copied: stable/10/usr.sbin/bsdconfig/share/keymap.subr (from r256325, head/usr.sbin/bsdconfig/share/keymap.subr) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bsdconfig/share/keymap.subr Fri Oct 11 23:12:05 2013 (r256361, copy of r256325, head/usr.sbin/bsdconfig/share/keymap.subr) @@ -0,0 +1,262 @@ +if [ ! "$_KEYMAP_SUBR" ]; then _KEYMAP_SUBR=1 +# +# Copyright (c) 2013 Devin Teske +# 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$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." keymap.subr +f_include $BSDCFG_SHARE/struct.subr + +############################################################ CONFIGURATION + +# +# Defaults taken from usr.sbin/kbdmap/kbdmap.h +# +: ${DEFAULT_LANG:=en} +: ${DEFAULT_KEYMAP_DIR:=/usr/share/syscons/keymaps} + +############################################################ GLOBALS + +KEYMAPS= + +# A "keymap" from kbdmap's point of view +f_struct_define KEYMAP \ + desc \ + keym \ + mark + +# +# Default behavior is to call f_keymap_get_all() automatically when loaded. +# +: ${KEYMAP_SELF_SCAN_ALL=1} + +############################################################ FUNCTIONS + +# f_keymap_register $name $desc $keym $mark +# +# Register a keymap. A `structure' (see struct.subr) is created with the name +# keymap_$name (so make sure $name contains only alpha-numeric characters or +# the underscore, `_'). The remaining arguments after $name correspond to the +# propertise of the `KEYMAP' structure-type (defined above). +# +# If not already registered, the keymap is then appended to the KEYMAPS +# environment variable, a space-separated list of all registered keymaps. +# +f_keymap_register() +{ + local name="$1" desc="$2" keym="$3" mark="$4" + + f_struct_new KEYMAP "keymap_$name" || return $FAILURE + keymap_$name set desc "$desc" + keymap_$name set keym "$keym" + keymap_$name set mark "$mark" + + # Scan our global register to see if needs ammending + local k found= + for k in $KEYMAPS; do + [ "$k" = "$name" ] || continue + found=1 && break + done + [ "$found" ] || KEYMAPS="$KEYMAPS $name" + + return $SUCCESS +} + +# f_keymap_checkfile $keymap +# +# Check that $keymap is a readable kbdmap(5) file. Returns success if $keymap +# is a file, is readable, and exists in $DEFAULT_KEYMAP_DIR; otherwise failure. +# If debugging is enabled, an appropriate debug error message is printed if +# $keymap is not available. +# +f_keymap_checkfile() +{ + local keym="$1" + + # Fixup keymap if it doesn't already contain at least one `/' + [ "${keym#*/}" = "$keym" ] && keym="$DEFAULT_KEYMAP_DIR/$keym" + + # Short-cuts + [ -f "$keym" -a -r "$keym" ] && return $SUCCESS + f_debugging || return $FAILURE + + # Print an appropriate debug error message + if [ ! -e "$keym" ]; then + f_dprintf "%s: No such file or directory" "$keym" + elif [ ! -f "$keym" ]; then + f_dprintf "%s: Not a file!" "$keym" + elif [ ! -r "$keym" ]; then + f_dprintf "%s: Permission denied" "$keym" + fi + + return $FAILURE +} + +# f_keymap_get_all +# +# Get all keymap information for kbdmap(5) entries both in the database and +# loosely existing in $DEFAULT_KEYMAP_DIR. +# +f_keymap_get_all() +{ + local fname=f_keymap_get_all + local lang="${LC_ALL:-${LC_CTYPE:-${LANG:-$DEFAULT_LANG}}}" + [ "$lang" = "C" ] && lang="$DEFAULT_LANG" + + f_dprintf "%s: Looking for keymap files..." $fname + f_dialog_info "$msg_looking_for_keymap_files" + f_dprintf "DEFAULT_LANG=[%s]" "$DEFAULT_LANG" + + eval "$( awk -F: -v lang="$lang" -v lang_default="$DEFAULT_LANG" ' + BEGIN { + # en_US.ISO8859-1 -> en_..\.ISO8859-1 + dialect = lang + if (length(dialect) >= 6 && + substr(dialect, 3, 1) == "_") + dialect = substr(dialect, 1, 3) ".." \ + substr(dialect, 6) + printf "f_dprintf \"dialect=[%%s]\" \"%s\";\n", dialect + + # en_US.ISO8859-1 -> en + lang_abk = lang + if (length(lang_abk) >= 3 && + substr(lang_abk, 3, 1) == "_") + lang_abk = substr(lang_abk, 1, 2) + printf "f_dprintf \"lang_abk=[%%s]\" \"%s\";\n", + lang_abk + } + function find_token(buffer, token) + { + if (split(buffer, tokens, /,/) == 0) return 0 + found = 0 + for (t in tokens) + if (token == tokens[t]) { found = 1; break } + return found + } + function add_keymap(desc,mark,keym) + { + marks[keym] = mark + name = keym + gsub(/[^[:alnum:]_]/, "_", name) + gsub(/'\''/, "'\''\\'\'''\''", desc); + printf "f_keymap_checkfile %s && " \ + "f_keymap_register %s '\'%s\'' %s %u\n", + keym, name, desc, keym, mark + } + !/^[[:space:]]*(#|$)/ { + sub(/^[[:space:]]*/, "", $0) + keym = $1 + if (keym ~ /^(MENU|FONT)$/) next + lg = ($2 == "" ? lang_default : $2) + + # Match the entry and store the type of match we made + # as the mark value (so that if we make a better match + # later on with a higher mark, it overwrites previous) + + mark = marks[keym]; + if (find_token(lg, lang)) + add_keymap($3, 4, keym) # Best match + else if (mark <= 3 && find_token(lg, dialect)) + add_keymap($3, 3, keym) + else if (mark <= 2 && find_token(lg, lang_abk)) + add_keymap($3, 2, keym) + else if (mark <= 1 && find_token(lg, lang_default)) + add_keymap($3, 1, keym) + else if (mark <= 0) + add_keymap($3, 0, keym) + } + ' "$DEFAULT_KEYMAP_DIR/INDEX.${DEFAULT_KEYMAP_DIR##*/}" )" + + + # + # Look for keymaps not in database + # + local direntry keym name + set +f # glob + for direntry in "$DEFAULT_KEYMAP_DIR"/*; do + [ "${direntry##*.}" = ".kbd" ] || continue + keym="${direntry##*/}" + f_str2varname "$keym" name + f_struct keymap_$name && continue + f_keymap_checkfile "$keym" && + f_keymap_register $name "${keym%.*}" "$keym" 0 + f_dprintf "%s: not in kbdmap(5) database" "$keym" + done + + # + # Sort the items by their descriptions + # + f_dprintf "%s: Sorting keymap entries by description..." $fname + KEYMAPS=$( + for k in $KEYMAPS; do + echo -n "$k " + # NOTE: Translate '8x8' to '8x08' before sending to + # sort(1) so that things work out as we might expect. + debug= keymap_$k get desc | sed -e 's/8x8/8x08/g' + done | sort -k2 | awk '{ + printf "%s%s", (started ? " " : ""), $1; started = 1 + }' + ) + + return $SUCCESS +} + +# f_keymap_kbdcontrol $keymap +# +# Install keyboard map file from $keymap. +# +f_keymap_kbdcontrol() +{ + local keymap="$1" + + [ "$keymap" ] || return $SUCCESS + + # Fixup keymap if it doesn't already contain at least one `/' + [ "${keymap#*/}" = "$keymap" ] && keymap="$DEFAULT_KEYMAP_DIR/$keymap" + + [ "$USE_XDIALOG" ] || kbdcontrol -l "$keymap" +} + +############################################################ MAIN + +# +# Scan for keymaps unless requeted otherwise +# +f_dprintf "%s: KEYMAP_SELF_SCAN_ALL=[%s]" keymap.subr "$KEYMAP_SELF_SCAN_ALL" +case "$KEYMAP_SELF_SCAN_ALL" in +""|0|[Nn][Oo]|[Oo][Ff][Ff]|[Ff][Aa][Ll][Ss][Ee]) : do nothing ;; +*) f_keymap_get_all +esac + +f_dprintf "%s: Found %u keymap file(s)." keymap.subr \ + "$( set -- $KEYMAPS; echo $# )" + +f_dprintf "%s: Successfully loaded." keymap.subr + +fi # ! $_KEYMAP_SUBR Modified: stable/10/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/strings.subr Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdconfig/share/strings.subr Fri Oct 11 23:12:05 2013 (r256361) @@ -26,6 +26,11 @@ if [ ! "$_STRINGS_SUBR" ]; then _STRINGS # # $FreeBSD$ # +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 + ############################################################ GLOBALS # @@ -319,6 +324,112 @@ f_shell_unescape() f_replaceall "$__string" "'\\''" "'" "$__var_to_set" } +# f_expand_number $string [$var_to_set] +# +# Unformat $string into a number, optionally to be stored in $var_to_set. This +# function follows the SI power of two convention. +# +# The prefixes are: +# +# Prefix Description Multiplier +# k kilo 1024 +# M mega 1048576 +# G giga 1073741824 +# T tera 1099511627776 +# P peta 1125899906842624 +# E exa 1152921504606846976 +# +# NOTE: Prefixes are case-insensitive. +# +# Upon successful completion, the value 0 is returned (or stored to +# $var_to_set); otherwise -1. Reasons for a -1 return include: +# +# Given $string contains no digits. +# An unrecognized prefix was given. +# Result too large to calculate. +# +f_expand_number() +{ + local __string="$1" __var_to_set="$2" + local __cp __num + + # Remove any leading non-digits + while :; do + __cp="$__string" + __string="${__cp#[!0-9]}" + [ "$__string" = "$__cp" ] && break + done + + # Return `-1' if string didn't contain any digits + if [ ! "$__string" ]; then + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" -1 + else + echo -1 + fi + return $FAILURE + fi + + # Store the numbers + __num="${__string%%[!0-9]*}" + + # Shortcut + if [ $__num -eq 0 ]; then + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" 0 + else + echo 0 + fi + return $SUCCESS + fi + + # Remove all the leading numbers from the string to get at the prefix + while :; do + __cp="$__string" + __string="${__cp#[0-9]}" + [ "$__string" = "$__cp" ] && break + done + + # Test for invalid prefix + case "$__string" in + ""|[KkMmGgTtPpEe]*) : known prefix ;; + *) + # Unknown prefix + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" -1 + else + echo -1 + fi + return $FAILURE + esac + + # Multiply the number out + case "$__string" in + [Kk]) __num=$(( $__num * 1024 )) ;; + [Mm]) __num=$(( $__num * 1048576 )) ;; + [Gg]) __num=$(( $__num * 1073741824 )) ;; + [Tt]) __num=$(( $__num * 1099511627776 )) ;; + [Pp]) __num=$(( $__num * 1125899906842624 )) ;; + [Ee]) __num=$(( $__num * 1152921504606846976 )) ;; + esac + if [ $__num -le 0 ]; then + # Arithmetic overflow + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" -1 + else + echo -1 + fi + return $FAILURE + fi + + # Return the number + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" $__num + else + echo $__num + fi +} + ############################################################ MAIN f_dprintf "%s: Successfully loaded." strings.subr Modified: stable/10/usr.sbin/bsdconfig/share/variable.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/variable.subr Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdconfig/share/variable.subr Fri Oct 11 23:12:05 2013 (r256361) @@ -205,6 +205,21 @@ f_netinteractive() f_getvar $VAR_NETINTERACTIVE value && [ "$value" ] } +# f_zfsinteractive() +# +# Has the user specifically requested the ZFS-portion of configuration and +# setup to be performed interactively? Returns success if the user has asked +# for the ZFS configuration to be done interactively even if perhaps overall +# non-interactive mode has been requested (by setting nonInteractive). +# +# Returns success if $zfsInteractive is set and non-NULL. +# +f_zfsinteractive() +{ + local value + f_getvar $VAR_ZFSINTERACTIVE value && [ "$value" ] +} + ############################################################ MAIN # @@ -240,6 +255,7 @@ f_variable_new VAR_IFCONFIG ifconfig_ f_variable_new VAR_IPADDR ipaddr f_variable_new VAR_IPV6ADDR ipv6addr f_variable_new VAR_IPV6_ENABLE ipv6_activate_all_interfaces +f_variable_new VAR_KEYMAP keymap f_variable_new VAR_MEDIA_TIMEOUT MEDIA_TIMEOUT f_variable_new VAR_MEDIA_TYPE mediaType f_variable_new VAR_NAMESERVER nameserver @@ -263,6 +279,7 @@ f_variable_new VAR_SLOW_ETHER slowEther f_variable_new VAR_TRY_DHCP tryDHCP f_variable_new VAR_TRY_RTSOL tryRTSOL f_variable_new VAR_UFS_PATH ufs +f_variable_new VAR_ZFSINTERACTIVE zfsInteractive # # Self-initialize unless requested otherwise Modified: stable/10/usr.sbin/bsdinstall/bsdinstall ============================================================================== --- stable/10/usr.sbin/bsdinstall/bsdinstall Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdinstall/bsdinstall Fri Oct 11 23:12:05 2013 (r256361) @@ -28,6 +28,7 @@ : ${BSDINSTALL_LOG="/tmp/bsdinstall_log"}; export BSDINSTALL_LOG : ${BSDINSTALL_TMPETC="/tmp/bsdinstall_etc"}; export BSDINSTALL_TMPETC +: ${BSDINSTALL_TMPBOOT="/tmp/bsdinstall_boot"}; export BSDINSTALL_TMPBOOT : ${PATH_FSTAB="$BSDINSTALL_TMPETC/fstab"}; export PATH_FSTAB : ${BSDINSTALL_DISTDIR="/usr/freebsd-dist"}; export BSDINSTALL_DISTDIR : ${BSDINSTALL_CHROOT="/mnt"}; export BSDINSTALL_CHROOT @@ -35,5 +36,6 @@ VERB=${1:-auto}; shift [ -d "$BSDINSTALL_TMPETC" ] || mkdir -p "$BSDINSTALL_TMPETC" +[ -d "$BSDINSTALL_TMPBOOT" ] || mkdir -p "$BSDINSTALL_TMPBOOT" echo "Running installation step: $VERB $@" >> "$BSDINSTALL_LOG" exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>> "$BSDINSTALL_LOG" Modified: stable/10/usr.sbin/bsdinstall/scripts/Makefile ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/Makefile Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdinstall/scripts/Makefile Fri Oct 11 23:12:05 2013 (r256361) @@ -2,7 +2,7 @@ SCRIPTS= auto adduser checksum config docsinstall entropy hostname jail \ keymap mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 \ - rootpass script services time umount wlanconfig + rootpass script services time umount wlanconfig zfsboot BINDIR= /usr/libexec/bsdinstall NO_MAN= true Modified: stable/10/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/auto Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdinstall/scripts/auto Fri Oct 11 23:12:05 2013 (r256361) @@ -93,24 +93,46 @@ fi rm $PATH_FSTAB touch $PATH_FSTAB -dialog --backtitle "FreeBSD Installer" --title "Partitioning" --extra-button \ - --extra-label "Manual" --ok-label "Guided" --cancel-label "Shell" \ - --yesno "Would you like to use the guided partitioning tool (recommended for beginners) or to set up partitions manually (experts)? You can also open a shell and set up partitions entirely by hand." 0 0 +PMODES="\ +Guided \"Partitioning Tool (Recommended for Beginners)\" \ +Manual \"Manually Configure Partitions (Expert)\" \ +Shell \"Open a shell and partition by hand\"" + +CURARCH=$( uname -m ) +case $CURARCH in + amd64|i386) # Booting ZFS Supported + PMODES="$PMODES ZFS \"Automatic Root-on-ZFS (Experimental)\"" + ;; + *) # Booting ZFS Unspported + ;; +esac -case $? in -0) # Guided +exec 3>&1 +PARTMODE=`echo $PMODES | xargs dialog --backtitle "FreeBSD Installer" \ + --title "Partitioning" \ + --menu "How would you like to partition your disk?" \ + 0 0 0 2>&1 1>&3` +if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi +exec 3>&- + +case "$PARTMODE" in +"Guided") # Guided bsdinstall autopart || error bsdinstall mount || error ;; -1) # Shell +"Shell") # Shell clear echo "Use this shell to set up partitions for the new system. When finished, mount the system at $BSDINSTALL_CHROOT and place an fstab file for the new system at $PATH_FSTAB. Then type 'exit'. You can also enter the partition editor at any time by entering 'bsdinstall partedit'." sh 2>&1 ;; -3) # Manual +"Manual") # Manual bsdinstall partedit || error bsdinstall mount || error ;; +"ZFS") # ZFS + bsdinstall zfsboot || error + bsdinstall mount || error + ;; *) error ;; Modified: stable/10/usr.sbin/bsdinstall/scripts/config ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/config Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdinstall/scripts/config Fri Oct 11 23:12:05 2013 (r256361) @@ -31,6 +31,11 @@ rm $BSDINSTALL_TMPETC/rc.conf.* cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc +cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf +rm $BSDINSTALL_TMPBOOT/loader.conf.* + +cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot + # Set up other things from installed config chroot $BSDINSTALL_CHROOT /usr/bin/newaliases Modified: stable/10/usr.sbin/bsdinstall/scripts/keymap ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/keymap Fri Oct 11 23:11:33 2013 (r256360) +++ stable/10/usr.sbin/bsdinstall/scripts/keymap Fri Oct 11 23:12:05 2013 (r256361) @@ -1,6 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn +# Copyright (c) 2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,11 +26,212 @@ # SUCH DAMAGE. # # $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." "$0" +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/keymap.subr +f_include $BSDCFG_SHARE/sysrc.subr + +############################################################ CONFIGURATION + +# +# Default file to store keymap selection in +# +: ${KEYMAPFILE:=$BSDINSTALL_TMPETC/rc.conf.keymap} + +# +# Default path to keymap INDEX containing descriptions +# +: ${MAPDESCFILE:=/usr/share/syscons/keymaps/INDEX.keymaps} + +############################################################ GLOBALS + +# +# Strings that should be moved to an i18n file and loaded with f_include_lang() +# +hline_arrows_tab_enter="Press arrows, TAB or ENTER" +msg_continue_with_keymap="Continue with %s keymap" +msg_default="default" +msg_error="Error" +msg_freebsd_installer="FreeBSD Installer" +msg_keymap_menu_text="The system console driver for FreeBSD defaults to standard \"US\"\nkeyboard map. Other keymaps can be chosen below." +msg_keymap_selection="Keymap Selection" +msg_ok="OK" +msg_select="Select" +msg_test_keymap="Test %s keymap" +msg_test_the_currently_selected_keymap="Test the currently selected keymap" +msg_test_the_keymap_by_typing="Test the keymap by typing letters, numbers, and symbols. Characters\nshould match labels on the keyboard keys. Press Enter to stop testing." + +############################################################ FUNCTIONS + +# dialog_keymap_test $keymap +# +# Activate $keymap and display an input box (without cancel button) for the +# user to test keyboard input and return. Always returns success. +# +dialog_keymap_test() +{ + local keym="$1" + local title= # Calculated below + local btitle= # Calculated below + local prompt="$msg_test_the_keymap_by_typing" + local hline= + + # Attempt to activate the keymap + if [ "$keym" ]; then + local err + err=$( f_keymap_kbdcontrol "$keym" 2>&1 > /dev/null ) + if [ "$err" ]; then + f_dialog_title "$msg_error" + f_dialog_msgbox "$err" + f_dialog_title_restore + return $FAILURE + fi + fi + + f_dialog_title "$( printf "$msg_test_keymap" "${keym:-$msg_default}" )" + title="$DIALOG_TITLE" + btitle="$DIALOG_BACKTITLE" + f_dialog_title_restore + + local height width + f_dialog_inputbox_size height width \ + "$title" "$btitle" "$prompt" "" "$hline" + + $DIALOG \ + --title "$title" \ + --backtitle "$btitle" \ + --hline "$hline" \ + --ok-label "$msg_ok" \ + --no-cancel \ + --inputbox "$prompt" \ + $height $width \ + 2>/dev/null >&$DIALOG_TERMINAL_PASSTHRU_FD -kbdcontrol -d >/dev/null 2>&1 -if [ $? -eq 0 ]; then - dialog --backtitle "FreeBSD Installer" --title "Keymap Selection" \ - --yesno "Would you like to set a non-default key mapping for your keyboard?" 0 0 || exit 0 - exec 3>&1 - kbdmap 2>&1 1>&3 | grep 'keymap=' > $BSDINSTALL_TMPETC/rc.conf.keymap + return $DIALOG_OK +} + +############################################################ MAIN + +# +# Initialize +# +f_dialog_title "$msg_keymap_selection" +f_dialog_backtitle "$msg_freebsd_installer" + +# +# Die immediately if we can't dump the current keyboard map +# +#error=$( kbdcontrol -d 2>&1 > /dev/null ) || f_die $FAILURE "%s" "$error" + +# Capture Ctrl-C for clean-up +trap 'rm -f $KEYMAPFILE; exit $FAILURE' SIGINT + +# Get a value from rc.conf(5) as initial value (if not being scripted) +f_getvar $VAR_KEYMAP keymap +if [ ! "$keymap" ]; then + keymap=$( f_sysrc_get keymap ) + case "$keymap" in [Nn][Oo]) keymap="";; esac fi + +# +# Loop until the user has finalized their selection (by clicking the +# [relabeled] Cancel button). +# +width=67 first_pass=1 back_from_testing= +[ "$USE_XDIALOG" ] && width=70 +prompt="$msg_keymap_menu_text" +hline="$hline_arrows_tab_enter" +while :; do + # *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 00:32:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9CEEE2DF; Sat, 12 Oct 2013 00:32:35 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89D0A2DDD; Sat, 12 Oct 2013 00:32:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9C0WZM4025060; Sat, 12 Oct 2013 00:32:35 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9C0WZ3Q025057; Sat, 12 Oct 2013 00:32:35 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310120032.r9C0WZ3Q025057@svn.freebsd.org> From: Peter Grehan Date: Sat, 12 Oct 2013 00:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256362 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 00:32:35 -0000 Author: grehan Date: Sat Oct 12 00:32:34 2013 New Revision: 256362 URL: http://svnweb.freebsd.org/changeset/base/256362 Log: Fix a lock-order reversal in the net driver by dropping the lock and holding a reference prior to calling further into the hyperv stack. Added missing FreeBSD idents. Submitted by: Microsoft hyperv dev team Approved by: re@ (gjb) Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Oct 11 23:12:05 2013 (r256361) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Sat Oct 12 00:32:34 2013 (r256362) @@ -24,6 +24,8 @@ * 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$ */ /* @@ -970,6 +972,8 @@ typedef struct hn_softc { int hn_if_flags; struct mtx hn_lock; int hn_initdone; + /* See hv_netvsc_drv_freebsd.c for rules on how to use */ + int temp_unusable; struct hv_device *hn_dev_obj; netvsc_dev *net_dev; } hn_softc_t; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Oct 11 23:12:05 2013 (r256361) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sat Oct 12 00:32:34 2013 (r256362) @@ -52,6 +52,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -702,6 +705,17 @@ netvsc_recv(struct hv_device *device_ctx } /* + * Rules for using sc->temp_unusable: + * 1. sc->temp_unusable can only be read or written while holding NV_LOCK() + * 2. code reading sc->temp_unusable under NV_LOCK(), and finding + * sc->temp_unusable set, must release NV_LOCK() and exit + * 3. to retain exclusive control of the interface, + * sc->temp_unusable must be set by code before releasing NV_LOCK() + * 4. only code setting sc->temp_unusable can clear sc->temp_unusable + * 5. code setting sc->temp_unusable must eventually clear sc->temp_unusable + */ + +/* * Standard ioctl entry point. Called when the user wants to configure * the interface. */ @@ -713,7 +727,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, netvsc_device_info device_info; struct hv_device *hn_dev; int mask, error = 0; - + int retry_cnt = 500; + switch(cmd) { case SIOCSIFADDR: @@ -723,38 +738,80 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, case SIOCSIFMTU: hn_dev = vmbus_get_devctx(sc->hn_dev); - NV_LOCK(sc); + /* Check MTU value change */ + if (ifp->if_mtu == ifr->ifr_mtu) + break; if (ifr->ifr_mtu > NETVSC_MAX_CONFIGURABLE_MTU) { error = EINVAL; - NV_UNLOCK(sc); break; } + /* Obtain and record requested MTU */ ifp->if_mtu = ifr->ifr_mtu; + + do { + NV_LOCK(sc); + if (!sc->temp_unusable) { + sc->temp_unusable = TRUE; + retry_cnt = -1; + } + NV_UNLOCK(sc); + if (retry_cnt > 0) { + retry_cnt--; + DELAY(5 * 1000); + } + } while (retry_cnt > 0); - /* - * We must remove and add back the device to cause the new + if (retry_cnt == 0) { + error = EINVAL; + break; + } + + /* We must remove and add back the device to cause the new * MTU to take effect. This includes tearing down, but not * deleting the channel, then bringing it back up. */ error = hv_rf_on_device_remove(hn_dev, HV_RF_NV_RETAIN_CHANNEL); if (error) { + NV_LOCK(sc); + sc->temp_unusable = FALSE; NV_UNLOCK(sc); break; } error = hv_rf_on_device_add(hn_dev, &device_info); if (error) { + NV_LOCK(sc); + sc->temp_unusable = FALSE; NV_UNLOCK(sc); break; } hn_ifinit_locked(sc); + NV_LOCK(sc); + sc->temp_unusable = FALSE; NV_UNLOCK(sc); break; case SIOCSIFFLAGS: - NV_LOCK(sc); + do { + NV_LOCK(sc); + if (!sc->temp_unusable) { + sc->temp_unusable = TRUE; + retry_cnt = -1; + } + NV_UNLOCK(sc); + if (retry_cnt > 0) { + retry_cnt--; + DELAY(5 * 1000); + } + } while (retry_cnt > 0); + + if (retry_cnt == 0) { + error = EINVAL; + break; + } + if (ifp->if_flags & IFF_UP) { /* * If only the state of the PROMISC flag changed, @@ -766,21 +823,14 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, */ #ifdef notyet /* Fixme: Promiscuous mode? */ - /* No promiscuous mode with Xen */ if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->hn_if_flags & IFF_PROMISC)) { /* do something here for Hyper-V */ - ; -/* XN_SETBIT(sc, XN_RX_MODE, */ -/* XN_RXMODE_RX_PROMISC); */ } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && - !(ifp->if_flags & IFF_PROMISC) && - sc->hn_if_flags & IFF_PROMISC) { + !(ifp->if_flags & IFF_PROMISC) && + sc->hn_if_flags & IFF_PROMISC) { /* do something here for Hyper-V */ - ; -/* XN_CLRBIT(sc, XN_RX_MODE, */ -/* XN_RXMODE_RX_PROMISC); */ } else #endif hn_ifinit_locked(sc); @@ -789,8 +839,10 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, hn_stop(sc); } } - sc->hn_if_flags = ifp->if_flags; + NV_LOCK(sc); + sc->temp_unusable = FALSE; NV_UNLOCK(sc); + sc->hn_if_flags = ifp->if_flags; error = 0; break; case SIOCSIFCAP: @@ -838,7 +890,6 @@ hn_stop(hn_softc_t *sc) int ret; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); - NV_LOCK_ASSERT(sc); ifp = sc->hn_ifp; printf(" Closing Device ...\n"); @@ -859,6 +910,10 @@ hn_start(struct ifnet *ifp) sc = ifp->if_softc; NV_LOCK(sc); + if (sc->temp_unusable) { + NV_UNLOCK(sc); + return; + } hn_start_locked(ifp); NV_UNLOCK(sc); } @@ -873,8 +928,6 @@ hn_ifinit_locked(hn_softc_t *sc) struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); int ret; - NV_LOCK_ASSERT(sc); - ifp = sc->hn_ifp; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { @@ -902,7 +955,17 @@ hn_ifinit(void *xsc) hn_softc_t *sc = xsc; NV_LOCK(sc); + if (sc->temp_unusable) { + NV_UNLOCK(sc); + return; + } + sc->temp_unusable = TRUE; + NV_UNLOCK(sc); + hn_ifinit_locked(sc); + + NV_LOCK(sc); + sc->temp_unusable = FALSE; NV_UNLOCK(sc); } From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 00:42:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A0CBF8F2; Sat, 12 Oct 2013 00:42:42 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8E8312E4D; Sat, 12 Oct 2013 00:42:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9C0ggPd029651; Sat, 12 Oct 2013 00:42:42 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9C0ggGn029649; Sat, 12 Oct 2013 00:42:42 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310120042.r9C0ggGn029649@svn.freebsd.org> From: Peter Grehan Date: Sat, 12 Oct 2013 00:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256363 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 00:42:42 -0000 Author: grehan Date: Sat Oct 12 00:42:41 2013 New Revision: 256363 URL: http://svnweb.freebsd.org/changeset/base/256363 Log: MFC r256362 Fix a lock-order reversal in the net driver by dropping the lock and holding a reference prior to calling further into the hyperv stack. Added missing FreeBSD idents. Approved by: re@ (gjb) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/sys/ (props changed) stable/10/sys/dev/hyperv/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Sat Oct 12 00:32:34 2013 (r256362) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Sat Oct 12 00:42:41 2013 (r256363) @@ -24,6 +24,8 @@ * 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$ */ /* @@ -970,6 +972,8 @@ typedef struct hn_softc { int hn_if_flags; struct mtx hn_lock; int hn_initdone; + /* See hv_netvsc_drv_freebsd.c for rules on how to use */ + int temp_unusable; struct hv_device *hn_dev_obj; netvsc_dev *net_dev; } hn_softc_t; Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sat Oct 12 00:32:34 2013 (r256362) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sat Oct 12 00:42:41 2013 (r256363) @@ -52,6 +52,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -702,6 +705,17 @@ netvsc_recv(struct hv_device *device_ctx } /* + * Rules for using sc->temp_unusable: + * 1. sc->temp_unusable can only be read or written while holding NV_LOCK() + * 2. code reading sc->temp_unusable under NV_LOCK(), and finding + * sc->temp_unusable set, must release NV_LOCK() and exit + * 3. to retain exclusive control of the interface, + * sc->temp_unusable must be set by code before releasing NV_LOCK() + * 4. only code setting sc->temp_unusable can clear sc->temp_unusable + * 5. code setting sc->temp_unusable must eventually clear sc->temp_unusable + */ + +/* * Standard ioctl entry point. Called when the user wants to configure * the interface. */ @@ -713,7 +727,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, netvsc_device_info device_info; struct hv_device *hn_dev; int mask, error = 0; - + int retry_cnt = 500; + switch(cmd) { case SIOCSIFADDR: @@ -723,38 +738,80 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, case SIOCSIFMTU: hn_dev = vmbus_get_devctx(sc->hn_dev); - NV_LOCK(sc); + /* Check MTU value change */ + if (ifp->if_mtu == ifr->ifr_mtu) + break; if (ifr->ifr_mtu > NETVSC_MAX_CONFIGURABLE_MTU) { error = EINVAL; - NV_UNLOCK(sc); break; } + /* Obtain and record requested MTU */ ifp->if_mtu = ifr->ifr_mtu; + + do { + NV_LOCK(sc); + if (!sc->temp_unusable) { + sc->temp_unusable = TRUE; + retry_cnt = -1; + } + NV_UNLOCK(sc); + if (retry_cnt > 0) { + retry_cnt--; + DELAY(5 * 1000); + } + } while (retry_cnt > 0); - /* - * We must remove and add back the device to cause the new + if (retry_cnt == 0) { + error = EINVAL; + break; + } + + /* We must remove and add back the device to cause the new * MTU to take effect. This includes tearing down, but not * deleting the channel, then bringing it back up. */ error = hv_rf_on_device_remove(hn_dev, HV_RF_NV_RETAIN_CHANNEL); if (error) { + NV_LOCK(sc); + sc->temp_unusable = FALSE; NV_UNLOCK(sc); break; } error = hv_rf_on_device_add(hn_dev, &device_info); if (error) { + NV_LOCK(sc); + sc->temp_unusable = FALSE; NV_UNLOCK(sc); break; } hn_ifinit_locked(sc); + NV_LOCK(sc); + sc->temp_unusable = FALSE; NV_UNLOCK(sc); break; case SIOCSIFFLAGS: - NV_LOCK(sc); + do { + NV_LOCK(sc); + if (!sc->temp_unusable) { + sc->temp_unusable = TRUE; + retry_cnt = -1; + } + NV_UNLOCK(sc); + if (retry_cnt > 0) { + retry_cnt--; + DELAY(5 * 1000); + } + } while (retry_cnt > 0); + + if (retry_cnt == 0) { + error = EINVAL; + break; + } + if (ifp->if_flags & IFF_UP) { /* * If only the state of the PROMISC flag changed, @@ -766,21 +823,14 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, */ #ifdef notyet /* Fixme: Promiscuous mode? */ - /* No promiscuous mode with Xen */ if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->hn_if_flags & IFF_PROMISC)) { /* do something here for Hyper-V */ - ; -/* XN_SETBIT(sc, XN_RX_MODE, */ -/* XN_RXMODE_RX_PROMISC); */ } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && - !(ifp->if_flags & IFF_PROMISC) && - sc->hn_if_flags & IFF_PROMISC) { + !(ifp->if_flags & IFF_PROMISC) && + sc->hn_if_flags & IFF_PROMISC) { /* do something here for Hyper-V */ - ; -/* XN_CLRBIT(sc, XN_RX_MODE, */ -/* XN_RXMODE_RX_PROMISC); */ } else #endif hn_ifinit_locked(sc); @@ -789,8 +839,10 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, hn_stop(sc); } } - sc->hn_if_flags = ifp->if_flags; + NV_LOCK(sc); + sc->temp_unusable = FALSE; NV_UNLOCK(sc); + sc->hn_if_flags = ifp->if_flags; error = 0; break; case SIOCSIFCAP: @@ -838,7 +890,6 @@ hn_stop(hn_softc_t *sc) int ret; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); - NV_LOCK_ASSERT(sc); ifp = sc->hn_ifp; printf(" Closing Device ...\n"); @@ -859,6 +910,10 @@ hn_start(struct ifnet *ifp) sc = ifp->if_softc; NV_LOCK(sc); + if (sc->temp_unusable) { + NV_UNLOCK(sc); + return; + } hn_start_locked(ifp); NV_UNLOCK(sc); } @@ -873,8 +928,6 @@ hn_ifinit_locked(hn_softc_t *sc) struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); int ret; - NV_LOCK_ASSERT(sc); - ifp = sc->hn_ifp; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { @@ -902,7 +955,17 @@ hn_ifinit(void *xsc) hn_softc_t *sc = xsc; NV_LOCK(sc); + if (sc->temp_unusable) { + NV_UNLOCK(sc); + return; + } + sc->temp_unusable = TRUE; + NV_UNLOCK(sc); + hn_ifinit_locked(sc); + + NV_LOCK(sc); + sc->temp_unusable = FALSE; NV_UNLOCK(sc); } From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 04:35:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 470661A4; Sat, 12 Oct 2013 04:35:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3470328BE; Sat, 12 Oct 2013 04:35:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9C4Zdpq050183; Sat, 12 Oct 2013 04:35:39 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9C4Zdlq050182; Sat, 12 Oct 2013 04:35:39 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310120435.r9C4Zdlq050182@svn.freebsd.org> From: Glen Barber Date: Sat, 12 Oct 2013 04:35: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: r256364 - stable/9/release 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, 12 Oct 2013 04:35:39 -0000 Author: gjb Date: Sat Oct 12 04:35:38 2013 New Revision: 256364 URL: http://svnweb.freebsd.org/changeset/base/256364 Log: MFC r256246: Remove hash generation from release.sh, as it is run as part of the 'install' target in the release/Makefile. Sponsored by: The FreeBSD Foundation Modified: stable/9/release/release.sh Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/release.sh ============================================================================== --- stable/9/release/release.sh Sat Oct 12 00:42:41 2013 (r256363) +++ stable/9/release/release.sh Sat Oct 12 04:35:38 2013 (r256364) @@ -217,8 +217,3 @@ eval chroot ${CHROOTDIR} make -C /usr/sr release RELSTRING=${RELSTRING} eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ install DESTDIR=/R RELSTRING=${RELSTRING} - -cd ${CHROOTDIR}/R - -sha256 FreeBSD-* > CHECKSUM.SHA256 -md5 FreeBSD-* > CHECKSUM.MD5 From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 06:06:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 901E1A52; Sat, 12 Oct 2013 06:06:57 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 611402BD3; Sat, 12 Oct 2013 06:06:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9C66vUL096714; Sat, 12 Oct 2013 06:06:57 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9C66slB096693; Sat, 12 Oct 2013 06:06:54 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201310120606.r9C66slB096693@svn.freebsd.org> From: Rui Paulo Date: Sat, 12 Oct 2013 06:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256365 - in head: . etc etc/atf etc/mtree lib/libcrypt/tests share share/atf share/examples share/examples/atf share/man/man5 share/man/man7 share/mk share/xml share/xsl tools/build/mk... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 06:06:57 -0000 Author: rpaulo Date: Sat Oct 12 06:06:53 2013 New Revision: 256365 URL: http://svnweb.freebsd.org/changeset/base/256365 Log: Remove most of the ATF tools and the _atf user. This is necessary because ATF is deprecated and it will be replaced by Kyua. Submitted by: jmmv@netbsd.org Reviewed by: Garrett Cooper Approved by: re Deleted: head/etc/atf/ head/share/atf/ head/share/examples/atf/ head/share/xml/ head/share/xsl/ head/usr.bin/atf/atf-config/ head/usr.bin/atf/atf-report/ head/usr.bin/atf/atf-run/ head/usr.bin/atf/atf-version/ Modified: head/ObsoleteFiles.inc head/etc/Makefile head/etc/ftpusers head/etc/group head/etc/master.passwd head/etc/mtree/BSD.root.dist head/etc/mtree/BSD.usr.dist head/lib/libcrypt/tests/crypt_tests.c head/share/Makefile head/share/examples/Makefile head/share/man/man5/Makefile head/share/man/man7/Makefile head/share/mk/atf.test.mk head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/atf/Makefile head/usr.bin/atf/Makefile.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Oct 12 04:35:38 2013 (r256364) +++ head/ObsoleteFiles.inc Sat Oct 12 06:06:53 2013 (r256365) @@ -38,6 +38,25 @@ # xargs -n1 | sort | uniq -d; # done +# 20131013: Removal of the ATF tools +OLD_FILES+=etc/atf/FreeBSD.conf +OLD_FILES+=etc/atf/atf-run.hooks +OLD_FILES+=etc/atf/common.conf +OLD_FILES+=usr/bin/atf-config +OLD_FILES+=usr/bin/atf-report +OLD_FILES+=usr/bin/atf-run +OLD_FILES+=usr/bin/atf-version +OLD_FILES+=usr/share/atf/atf-run.hooks +OLD_FILES+=usr/share/examples/atf/atf-run.hooks +OLD_FILES+=usr/share/examples/atf/tests-results.css +OLD_FILES+=usr/share/man/man1/atf-config.1.gz +OLD_FILES+=usr/share/man/man1/atf-report.1.gz +OLD_FILES+=usr/share/man/man1/atf-run.1.gz +OLD_FILES+=usr/share/man/man1/atf-version.1.gz +OLD_FILES+=usr/share/man/man5/atf-formats.5.gz +OLD_FILES+=usr/share/man/man7/atf.7.gz +OLD_FILES+=usr/share/xml/atf/tests-results.dtd +OLD_FILES+=usr/share/xsl/atf/tests-results.xsl # 20131009: freebsd-version moved from /libexec to /bin OLD_FILES+=libexec/freebsd-version # 20131001: ar and ranlib from binutils not used @@ -6093,6 +6112,13 @@ OLD_LIBS+=usr/lib/libkse.so.1 OLD_LIBS+=usr/lib/liblwres.so.3 OLD_LIBS+=usr/lib/pam_ftp.so.2 +# 20131013: Removal of the ATF tools +OLD_DIRS+=etc/atf +OLD_DIRS+=usr/share/examples/atf +OLD_DIRS+=usr/share/xml/atf +OLD_DIRS+=usr/share/xml +OLD_DIRS+=usr/share/xsl/atf +OLD_DIRS+=usr/share/xsl # 20040925: bind9 import OLD_DIRS+=usr/share/doc/bind/html OLD_DIRS+=usr/share/doc/bind/misc Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Oct 12 04:35:38 2013 (r256364) +++ head/etc/Makefile Sat Oct 12 06:06:53 2013 (r256365) @@ -215,9 +215,6 @@ distribution: echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ ) | ${METALOG.add} .endif -.if ${MK_ATF} != "no" - ${_+_}cd ${.CURDIR}/atf; ${MAKE} install -.endif .if ${MK_BLUETOOTH} != "no" ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install .endif Modified: head/etc/ftpusers ============================================================================== --- head/etc/ftpusers Sat Oct 12 04:35:38 2013 (r256364) +++ head/etc/ftpusers Sat Oct 12 06:06:53 2013 (r256365) @@ -15,7 +15,6 @@ man sshd smmsp mailnull -_atf bind unbound proxy Modified: head/etc/group ============================================================================== --- head/etc/group Sat Oct 12 04:35:38 2013 (r256364) +++ head/etc/group Sat Oct 12 06:06:53 2013 (r256365) @@ -16,7 +16,6 @@ staff:*:20: sshd:*:22: smmsp:*:25: mailnull:*:26: -_atf:*:27: guest:*:31: bind:*:53: unbound:*:59: Modified: head/etc/master.passwd ============================================================================== --- head/etc/master.passwd Sat Oct 12 04:35:38 2013 (r256364) +++ head/etc/master.passwd Sat Oct 12 06:06:53 2013 (r256365) @@ -13,7 +13,6 @@ man:*:9:9::0:0:Mister Man Pages:/usr/sha sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin -_atf:*:27:27::0:0:& pseudo-user:/nonexistent:/usr/sbin/nologin bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin Modified: head/etc/mtree/BSD.root.dist ============================================================================== --- head/etc/mtree/BSD.root.dist Sat Oct 12 04:35:38 2013 (r256364) +++ head/etc/mtree/BSD.root.dist Sat Oct 12 06:06:53 2013 (r256365) @@ -24,8 +24,6 @@ etc X11 .. - atf - .. bluetooth .. defaults Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Sat Oct 12 04:35:38 2013 (r256364) +++ head/etc/mtree/BSD.usr.dist Sat Oct 12 06:06:53 2013 (r256365) @@ -299,8 +299,6 @@ .. IPv6 .. - atf - .. bhyve .. bootforth @@ -1410,14 +1408,6 @@ catalog .. .. - xml - atf - .. - .. - xsl - atf - .. - .. zoneinfo Africa .. Modified: head/lib/libcrypt/tests/crypt_tests.c ============================================================================== --- head/lib/libcrypt/tests/crypt_tests.c Sat Oct 12 04:35:38 2013 (r256364) +++ head/lib/libcrypt/tests/crypt_tests.c Sat Oct 12 06:06:53 2013 (r256365) @@ -43,7 +43,7 @@ ATF_TC_BODY(invalid, tc) /* * This function must not do anything except enumerate - * the test cases, else atf-run is likely to be upset. + * the test cases, per atf-c-api(3). */ ATF_TP_ADD_TCS(tp) { Modified: head/share/Makefile ============================================================================== --- head/share/Makefile Sat Oct 12 04:35:38 2013 (r256364) +++ head/share/Makefile Sat Oct 12 06:06:53 2013 (r256365) @@ -5,8 +5,7 @@ # Do not include `info' in the SUBDIR list, it is handled separately. -SUBDIR= ${_atf} \ - ${_colldef} \ +SUBDIR= ${_colldef} \ ${_dict} \ ${_doc} \ dtrace \ @@ -27,16 +26,10 @@ SUBDIR= ${_atf} \ tabset \ termcap \ ${_timedef} \ - xml \ - xsl \ ${_zoneinfo} # NB: keep these sorted by MK_* knobs -.if ${MK_ATF} != "no" -_atf= atf -.endif - .if ${MK_BSNMP} != "no" _snmp= snmp .endif Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Sat Oct 12 04:35:38 2013 (r256364) +++ head/share/examples/Makefile Sat Oct 12 06:06:53 2013 (r256365) @@ -241,9 +241,6 @@ etc-examples: .if ${SHARED} != "symlinks" SUBDIR= smbfs -.if ${MK_ATF} != "no" -SUBDIR+=atf -.endif .if ${MK_IPFILTER} != "no" SUBDIR+=ipfilter .endif Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Sat Oct 12 04:35:38 2013 (r256364) +++ head/share/man/man5/Makefile Sat Oct 12 06:06:53 2013 (r256365) @@ -6,7 +6,6 @@ #MISSING: dump.5 plot.5 MAN= acct.5 \ ar.5 \ - ${_atf_formats.5} \ a.out.5 \ bluetooth.device.conf.5 \ bluetooth.hosts.5 \ @@ -80,12 +79,6 @@ MLINKS+=quota.user.5 quota.group.5 MLINKS+=rc.conf.5 rc.conf.local.5 MLINKS+=resolver.5 resolv.conf.5 -.if ${MK_ATF} != "no" -ATF= ${.CURDIR}/../../../contrib/atf -.PATH: ${ATF}/doc -_atf_formats.5= atf-formats.5 -.endif - .if ${MK_FREEBSD_UPDATE} != "no" MAN+= freebsd-update.conf.5 .endif Modified: head/share/man/man7/Makefile ============================================================================== --- head/share/man/man7/Makefile Sat Oct 12 04:35:38 2013 (r256364) +++ head/share/man/man7/Makefile Sat Oct 12 06:06:53 2013 (r256365) @@ -36,17 +36,4 @@ MLINKS+= c99.7 c78.7 MLINKS+= c99.7 c89.7 MLINKS+= c99.7 c90.7 -.if ${MK_ATF} != "no" -ATF= ${.CURDIR}/../../../contrib/atf -.PATH: ${ATF}/doc -MAN+= atf.7 - -CLEANFILES+= atf.7 atf.7.tmp -atf.7: atf.7.in - sed -e 's,__DOCDIR__,${DOCDIR}/atf,g' \ - -e 's,__TESTSDIR__,${TESTSBASE},g' \ - < ${.ALLSRC} > ${.TARGET}.tmp - mv ${.TARGET}.tmp ${.TARGET} -.endif - .include Modified: head/share/mk/atf.test.mk ============================================================================== --- head/share/mk/atf.test.mk Sat Oct 12 04:35:38 2013 (r256364) +++ head/share/mk/atf.test.mk Sat Oct 12 06:06:53 2013 (r256365) @@ -51,98 +51,4 @@ ${_T}: ${TESTS_SH_SRC_${_T}} .endfor .endif -ATFFILE?= auto - -.if ${ATFFILE:tl} != "no" -FILES+= Atffile -FILESDIR_Atffile= ${TESTSDIR} - -.if ${ATFFILE:tl} == "auto" -CLEANFILES+= Atffile Atffile.tmp - -Atffile: Makefile - @{ echo 'Content-Type: application/X-atf-atffile; version="1"'; \ - echo; \ - echo '# Automatically generated by atf-test.mk.'; \ - echo; \ - echo 'prop: test-suite = "'`uname -o`'"'; \ - echo; \ - for tp in ${ATF_TESTS}; do \ - echo "tp: $${tp}"; \ - done; } >Atffile.tmp - @mv Atffile.tmp Atffile -.endif -.endif - -# Generate support variables for atf-test. -# -# atf-test can only work for native builds, i.e. a build host of a particular -# OS building a release for the same OS version and architecture. The target -# runs ATF, which is on the build host, and the tests execute code built for -# the target host. -# -# Due to the dependencies of the binaries built by the source tree and how they -# are used by tests, it is highly possible for a execution of "make test" to -# report bogus results unless the new binaries are put in place. - -# XXX (gcooper): Executing ATF from outside the source tree is improper; it -# should be built as part of the OS toolchain build for the host OS and -# executed from there. -ATF_PATH+= ${DESTDIR}/bin ${DESTDIR}/sbin ${DESTDIR}/usr/bin ${DESTDIR}/usr/sbin -TESTS_ENV+= PATH=${ATF_PATH:ts:}:${PATH} - -ATF_BUILD_CC?= ${DESTDIR}/usr/bin/cc -ATF_BUILD_CPP?= ${DESTDIR}/usr/bin/cpp -ATF_BUILD_CXX?= ${DESTDIR}/usr/bin/c++ -ATF_CONFDIR?= ${DESTDIR}/etc -ATF_INCLUDEDIR?= ${DESTDIR}/usr/include -ATF_LIBDIR?= ${DESTDIR}/usr/lib -ATF_LIBEXECDIR?= ${DESTDIR}/usr/libexec -ATF_PKGDATADIR?= ${DESTDIR}/usr/share/atf -ATF_SHELL?= ${DESTDIR}/bin/sh -LD_LIBRARY_PATH?= ${TESTS_LD_LIBRARY_PATH:tW:S/ /:/g} - -ATF_ENV_VARS= \ - ATF_BUILD_CC \ - ATF_BUILD_CPP \ - ATF_BUILD_CXX \ - ATF_CONFDIR \ - ATF_INCLUDEDIR \ - ATF_LIBDIR \ - ATF_LIBEXECDIR \ - ATF_PKGDATADIR \ - ATF_SHELL \ - -.for v in ${ATF_ENV_VARS} -.if !empty($v) -TESTS_ENV+= $v=${$v} -.endif -.endfor - -_TESTS_FIFO= ${.OBJDIR}/atf-run.fifo -_TESTS_LOG= ${.OBJDIR}/atf-run.log -CLEANFILES+= ${_TESTS_FIFO} ${_TESTS_LOG} - -ATF_BIN?= ${DESTDIR}/usr/bin -ATF_REPORT?= ${ATF_BIN}/atf-report -ATF_RUN?= ${ATF_BIN}/atf-run - -.PHONY: realtest -realtest: -.if defined(TESTSDIR) - @set -e; \ - cd ${DESTDIR}${TESTSDIR}; \ - rm -f ${_TESTS_FIFO}; \ - mkfifo ${_TESTS_FIFO}; \ - tee ${_TESTS_LOG} < ${_TESTS_FIFO} | ${TESTS_ENV} ${ATF_REPORT} & \ - set +e; \ - ${TESTS_ENV} ${ATF_RUN} >> ${_TESTS_FIFO}; \ - result=$${?}; \ - wait; \ - rm -f ${_TESTS_FIFO}; \ - echo; \ - echo "*** The verbatim output of atf-run has been saved to ${_TESTS_LOG}"; \ - exit $${result} -.endif - .include Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 12 04:35:38 2013 (r256364) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 12 06:06:53 2013 (r256365) @@ -69,15 +69,7 @@ OLD_FILES+=usr/share/man/man8/atrun.8.gz .endif .if ${MK_ATF} == no -OLD_DIRS+=etc/atf -OLD_FILES+=etc/atf/FreeBSD.conf -OLD_FILES+=etc/atf/atf-run.hooks -OLD_FILES+=etc/atf/common.conf -OLD_FILES+=usr/bin/atf-config -OLD_FILES+=usr/bin/atf-report -OLD_FILES+=usr/bin/atf-run OLD_FILES+=usr/bin/atf-sh -OLD_FILES+=usr/bin/atf-version OLD_DIRS+=usr/include/atf-c OLD_FILES+=usr/include/atf-c/build.h OLD_FILES+=usr/include/atf-c/check.h @@ -110,34 +102,20 @@ OLD_FILES+=usr/lib/libatf-c++.so OLD_FILES+=usr/lib/libatf-c.a OLD_FILES+=usr/libexec/atf-check OLD_DIRS+=usr/share/atf -OLD_FILES+=usr/share/atf/atf-run.hooks OLD_FILES+=usr/share/atf/libatf-sh.subr OLD_DIRS+=usr/share/doc/atf OLD_FILES+=usr/share/doc/atf/AUTHORS OLD_FILES+=usr/share/doc/atf/COPYING OLD_FILES+=usr/share/doc/atf/NEWS OLD_FILES+=usr/share/doc/atf/README -OLD_DIRS+=usr/share/examples/atf -OLD_FILES+=usr/share/examples/atf/atf-run.hooks -OLD_FILES+=usr/share/examples/atf/tests-results.css OLD_FILES+=usr/share/man/man1/atf-check.1.gz -OLD_FILES+=usr/share/man/man1/atf-config.1.gz -OLD_FILES+=usr/share/man/man1/atf-report.1.gz -OLD_FILES+=usr/share/man/man1/atf-run.1.gz OLD_FILES+=usr/share/man/man1/atf-sh.1.gz OLD_FILES+=usr/share/man/man1/atf-test-program.1.gz -OLD_FILES+=usr/share/man/man1/atf-version.1.gz OLD_FILES+=usr/share/man/man3/atf-c-api.3.gz OLD_FILES+=usr/share/man/man3/atf-c++-api.3.gz OLD_FILES+=usr/share/man/man3/atf-sh-api.3.gz OLD_FILES+=usr/share/man/man4/atf-test-case.4.gz -OLD_FILES+=usr/share/man/man5/atf-formats.5.gz -OLD_FILES+=usr/share/man/man7/atf.7.gz OLD_FILES+=usr/share/mk/atf.test.mk -OLD_DIRS+=usr/share/xml/atf -OLD_FILES+=usr/share/xml/atf/tests-results.dtd -OLD_DIRS+=usr/share/xsl/atf -OLD_FILES+=usr/share/xsl/atf/tests-results.xsl .endif .if ${MK_ATM} == no Modified: head/usr.bin/atf/Makefile ============================================================================== --- head/usr.bin/atf/Makefile Sat Oct 12 04:35:38 2013 (r256364) +++ head/usr.bin/atf/Makefile Sat Oct 12 06:06:53 2013 (r256365) @@ -25,10 +25,6 @@ # # $FreeBSD$ -SUBDIR= atf-config \ - atf-report \ - atf-run \ - atf-sh \ - atf-version +SUBDIR= atf-sh .include Modified: head/usr.bin/atf/Makefile.inc ============================================================================== --- head/usr.bin/atf/Makefile.inc Sat Oct 12 04:35:38 2013 (r256364) +++ head/usr.bin/atf/Makefile.inc Sat Oct 12 06:06:53 2013 (r256365) @@ -2,7 +2,5 @@ ATF= ${.CURDIR}/../../../contrib/atf -CFLAGS+= -DGDB=\"gdb\" - BINDIR?= /usr/bin WARNS?= 3 From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 06:08:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E43F3B95; Sat, 12 Oct 2013 06:08:22 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B4CAE2BDD; Sat, 12 Oct 2013 06:08:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9C68MnM097155; Sat, 12 Oct 2013 06:08:22 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9C68Jqr097129; Sat, 12 Oct 2013 06:08:19 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201310120608.r9C68Jqr097129@svn.freebsd.org> From: Rui Paulo Date: Sat, 12 Oct 2013 06:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256366 - in stable/10: . etc etc/atf etc/mtree lib/libcrypt/tests share share/atf share/examples share/examples/atf share/man/man5 share/man/man7 share/mk share/xml share/xsl tools/bui... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 06:08:23 -0000 Author: rpaulo Date: Sat Oct 12 06:08:18 2013 New Revision: 256366 URL: http://svnweb.freebsd.org/changeset/base/256366 Log: MFC 256365 Remove most of the ATF tools and the _atf user. Approved by: re Deleted: stable/10/etc/atf/ stable/10/share/atf/ stable/10/share/examples/atf/ stable/10/share/xml/ stable/10/share/xsl/ stable/10/usr.bin/atf/atf-config/ stable/10/usr.bin/atf/atf-report/ stable/10/usr.bin/atf/atf-run/ stable/10/usr.bin/atf/atf-version/ Modified: stable/10/ObsoleteFiles.inc (contents, props changed) stable/10/etc/Makefile stable/10/etc/ftpusers stable/10/etc/group stable/10/etc/master.passwd stable/10/etc/mtree/BSD.root.dist stable/10/etc/mtree/BSD.usr.dist stable/10/lib/libcrypt/tests/crypt_tests.c stable/10/share/Makefile stable/10/share/examples/Makefile stable/10/share/man/man5/Makefile stable/10/share/man/man7/Makefile stable/10/share/mk/atf.test.mk stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.bin/atf/Makefile stable/10/usr.bin/atf/Makefile.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/ObsoleteFiles.inc Sat Oct 12 06:08:18 2013 (r256366) @@ -38,6 +38,25 @@ # xargs -n1 | sort | uniq -d; # done +# 20131013: Removal of the ATF tools +OLD_FILES+=etc/atf/FreeBSD.conf +OLD_FILES+=etc/atf/atf-run.hooks +OLD_FILES+=etc/atf/common.conf +OLD_FILES+=usr/bin/atf-config +OLD_FILES+=usr/bin/atf-report +OLD_FILES+=usr/bin/atf-run +OLD_FILES+=usr/bin/atf-version +OLD_FILES+=usr/share/atf/atf-run.hooks +OLD_FILES+=usr/share/examples/atf/atf-run.hooks +OLD_FILES+=usr/share/examples/atf/tests-results.css +OLD_FILES+=usr/share/man/man1/atf-config.1.gz +OLD_FILES+=usr/share/man/man1/atf-report.1.gz +OLD_FILES+=usr/share/man/man1/atf-run.1.gz +OLD_FILES+=usr/share/man/man1/atf-version.1.gz +OLD_FILES+=usr/share/man/man5/atf-formats.5.gz +OLD_FILES+=usr/share/man/man7/atf.7.gz +OLD_FILES+=usr/share/xml/atf/tests-results.dtd +OLD_FILES+=usr/share/xsl/atf/tests-results.xsl # 20131009: freebsd-version moved from /libexec to /bin OLD_FILES+=libexec/freebsd-version # 20131001: ar and ranlib from binutils not used @@ -6093,6 +6112,13 @@ OLD_LIBS+=usr/lib/libkse.so.1 OLD_LIBS+=usr/lib/liblwres.so.3 OLD_LIBS+=usr/lib/pam_ftp.so.2 +# 20131013: Removal of the ATF tools +OLD_DIRS+=etc/atf +OLD_DIRS+=usr/share/examples/atf +OLD_DIRS+=usr/share/xml/atf +OLD_DIRS+=usr/share/xml +OLD_DIRS+=usr/share/xsl/atf +OLD_DIRS+=usr/share/xsl # 20040925: bind9 import OLD_DIRS+=usr/share/doc/bind/html OLD_DIRS+=usr/share/doc/bind/misc Modified: stable/10/etc/Makefile ============================================================================== --- stable/10/etc/Makefile Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/etc/Makefile Sat Oct 12 06:08:18 2013 (r256366) @@ -215,9 +215,6 @@ distribution: echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ ) | ${METALOG.add} .endif -.if ${MK_ATF} != "no" - ${_+_}cd ${.CURDIR}/atf; ${MAKE} install -.endif .if ${MK_BLUETOOTH} != "no" ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install .endif Modified: stable/10/etc/ftpusers ============================================================================== --- stable/10/etc/ftpusers Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/etc/ftpusers Sat Oct 12 06:08:18 2013 (r256366) @@ -15,7 +15,6 @@ man sshd smmsp mailnull -_atf bind unbound proxy Modified: stable/10/etc/group ============================================================================== --- stable/10/etc/group Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/etc/group Sat Oct 12 06:08:18 2013 (r256366) @@ -16,7 +16,6 @@ staff:*:20: sshd:*:22: smmsp:*:25: mailnull:*:26: -_atf:*:27: guest:*:31: bind:*:53: unbound:*:59: Modified: stable/10/etc/master.passwd ============================================================================== --- stable/10/etc/master.passwd Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/etc/master.passwd Sat Oct 12 06:08:18 2013 (r256366) @@ -13,7 +13,6 @@ man:*:9:9::0:0:Mister Man Pages:/usr/sha sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin -_atf:*:27:27::0:0:& pseudo-user:/nonexistent:/usr/sbin/nologin bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin Modified: stable/10/etc/mtree/BSD.root.dist ============================================================================== --- stable/10/etc/mtree/BSD.root.dist Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/etc/mtree/BSD.root.dist Sat Oct 12 06:08:18 2013 (r256366) @@ -24,8 +24,6 @@ etc X11 .. - atf - .. bluetooth .. defaults Modified: stable/10/etc/mtree/BSD.usr.dist ============================================================================== --- stable/10/etc/mtree/BSD.usr.dist Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/etc/mtree/BSD.usr.dist Sat Oct 12 06:08:18 2013 (r256366) @@ -299,8 +299,6 @@ .. IPv6 .. - atf - .. bhyve .. bootforth @@ -1410,14 +1408,6 @@ catalog .. .. - xml - atf - .. - .. - xsl - atf - .. - .. zoneinfo Africa .. Modified: stable/10/lib/libcrypt/tests/crypt_tests.c ============================================================================== --- stable/10/lib/libcrypt/tests/crypt_tests.c Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/lib/libcrypt/tests/crypt_tests.c Sat Oct 12 06:08:18 2013 (r256366) @@ -43,7 +43,7 @@ ATF_TC_BODY(invalid, tc) /* * This function must not do anything except enumerate - * the test cases, else atf-run is likely to be upset. + * the test cases, per atf-c-api(3). */ ATF_TP_ADD_TCS(tp) { Modified: stable/10/share/Makefile ============================================================================== --- stable/10/share/Makefile Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/share/Makefile Sat Oct 12 06:08:18 2013 (r256366) @@ -5,8 +5,7 @@ # Do not include `info' in the SUBDIR list, it is handled separately. -SUBDIR= ${_atf} \ - ${_colldef} \ +SUBDIR= ${_colldef} \ ${_dict} \ ${_doc} \ dtrace \ @@ -27,16 +26,10 @@ SUBDIR= ${_atf} \ tabset \ termcap \ ${_timedef} \ - xml \ - xsl \ ${_zoneinfo} # NB: keep these sorted by MK_* knobs -.if ${MK_ATF} != "no" -_atf= atf -.endif - .if ${MK_BSNMP} != "no" _snmp= snmp .endif Modified: stable/10/share/examples/Makefile ============================================================================== --- stable/10/share/examples/Makefile Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/share/examples/Makefile Sat Oct 12 06:08:18 2013 (r256366) @@ -241,9 +241,6 @@ etc-examples: .if ${SHARED} != "symlinks" SUBDIR= smbfs -.if ${MK_ATF} != "no" -SUBDIR+=atf -.endif .if ${MK_IPFILTER} != "no" SUBDIR+=ipfilter .endif Modified: stable/10/share/man/man5/Makefile ============================================================================== --- stable/10/share/man/man5/Makefile Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/share/man/man5/Makefile Sat Oct 12 06:08:18 2013 (r256366) @@ -6,7 +6,6 @@ #MISSING: dump.5 plot.5 MAN= acct.5 \ ar.5 \ - ${_atf_formats.5} \ a.out.5 \ bluetooth.device.conf.5 \ bluetooth.hosts.5 \ @@ -80,12 +79,6 @@ MLINKS+=quota.user.5 quota.group.5 MLINKS+=rc.conf.5 rc.conf.local.5 MLINKS+=resolver.5 resolv.conf.5 -.if ${MK_ATF} != "no" -ATF= ${.CURDIR}/../../../contrib/atf -.PATH: ${ATF}/doc -_atf_formats.5= atf-formats.5 -.endif - .if ${MK_FREEBSD_UPDATE} != "no" MAN+= freebsd-update.conf.5 .endif Modified: stable/10/share/man/man7/Makefile ============================================================================== --- stable/10/share/man/man7/Makefile Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/share/man/man7/Makefile Sat Oct 12 06:08:18 2013 (r256366) @@ -36,17 +36,4 @@ MLINKS+= c99.7 c78.7 MLINKS+= c99.7 c89.7 MLINKS+= c99.7 c90.7 -.if ${MK_ATF} != "no" -ATF= ${.CURDIR}/../../../contrib/atf -.PATH: ${ATF}/doc -MAN+= atf.7 - -CLEANFILES+= atf.7 atf.7.tmp -atf.7: atf.7.in - sed -e 's,__DOCDIR__,${DOCDIR}/atf,g' \ - -e 's,__TESTSDIR__,${TESTSBASE},g' \ - < ${.ALLSRC} > ${.TARGET}.tmp - mv ${.TARGET}.tmp ${.TARGET} -.endif - .include Modified: stable/10/share/mk/atf.test.mk ============================================================================== --- stable/10/share/mk/atf.test.mk Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/share/mk/atf.test.mk Sat Oct 12 06:08:18 2013 (r256366) @@ -51,98 +51,4 @@ ${_T}: ${TESTS_SH_SRC_${_T}} .endfor .endif -ATFFILE?= auto - -.if ${ATFFILE:tl} != "no" -FILES+= Atffile -FILESDIR_Atffile= ${TESTSDIR} - -.if ${ATFFILE:tl} == "auto" -CLEANFILES+= Atffile Atffile.tmp - -Atffile: Makefile - @{ echo 'Content-Type: application/X-atf-atffile; version="1"'; \ - echo; \ - echo '# Automatically generated by atf-test.mk.'; \ - echo; \ - echo 'prop: test-suite = "'`uname -o`'"'; \ - echo; \ - for tp in ${ATF_TESTS}; do \ - echo "tp: $${tp}"; \ - done; } >Atffile.tmp - @mv Atffile.tmp Atffile -.endif -.endif - -# Generate support variables for atf-test. -# -# atf-test can only work for native builds, i.e. a build host of a particular -# OS building a release for the same OS version and architecture. The target -# runs ATF, which is on the build host, and the tests execute code built for -# the target host. -# -# Due to the dependencies of the binaries built by the source tree and how they -# are used by tests, it is highly possible for a execution of "make test" to -# report bogus results unless the new binaries are put in place. - -# XXX (gcooper): Executing ATF from outside the source tree is improper; it -# should be built as part of the OS toolchain build for the host OS and -# executed from there. -ATF_PATH+= ${DESTDIR}/bin ${DESTDIR}/sbin ${DESTDIR}/usr/bin ${DESTDIR}/usr/sbin -TESTS_ENV+= PATH=${ATF_PATH:ts:}:${PATH} - -ATF_BUILD_CC?= ${DESTDIR}/usr/bin/cc -ATF_BUILD_CPP?= ${DESTDIR}/usr/bin/cpp -ATF_BUILD_CXX?= ${DESTDIR}/usr/bin/c++ -ATF_CONFDIR?= ${DESTDIR}/etc -ATF_INCLUDEDIR?= ${DESTDIR}/usr/include -ATF_LIBDIR?= ${DESTDIR}/usr/lib -ATF_LIBEXECDIR?= ${DESTDIR}/usr/libexec -ATF_PKGDATADIR?= ${DESTDIR}/usr/share/atf -ATF_SHELL?= ${DESTDIR}/bin/sh -LD_LIBRARY_PATH?= ${TESTS_LD_LIBRARY_PATH:tW:S/ /:/g} - -ATF_ENV_VARS= \ - ATF_BUILD_CC \ - ATF_BUILD_CPP \ - ATF_BUILD_CXX \ - ATF_CONFDIR \ - ATF_INCLUDEDIR \ - ATF_LIBDIR \ - ATF_LIBEXECDIR \ - ATF_PKGDATADIR \ - ATF_SHELL \ - -.for v in ${ATF_ENV_VARS} -.if !empty($v) -TESTS_ENV+= $v=${$v} -.endif -.endfor - -_TESTS_FIFO= ${.OBJDIR}/atf-run.fifo -_TESTS_LOG= ${.OBJDIR}/atf-run.log -CLEANFILES+= ${_TESTS_FIFO} ${_TESTS_LOG} - -ATF_BIN?= ${DESTDIR}/usr/bin -ATF_REPORT?= ${ATF_BIN}/atf-report -ATF_RUN?= ${ATF_BIN}/atf-run - -.PHONY: realtest -realtest: -.if defined(TESTSDIR) - @set -e; \ - cd ${DESTDIR}${TESTSDIR}; \ - rm -f ${_TESTS_FIFO}; \ - mkfifo ${_TESTS_FIFO}; \ - tee ${_TESTS_LOG} < ${_TESTS_FIFO} | ${TESTS_ENV} ${ATF_REPORT} & \ - set +e; \ - ${TESTS_ENV} ${ATF_RUN} >> ${_TESTS_FIFO}; \ - result=$${?}; \ - wait; \ - rm -f ${_TESTS_FIFO}; \ - echo; \ - echo "*** The verbatim output of atf-run has been saved to ${_TESTS_LOG}"; \ - exit $${result} -.endif - .include Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 12 06:08:18 2013 (r256366) @@ -69,15 +69,7 @@ OLD_FILES+=usr/share/man/man8/atrun.8.gz .endif .if ${MK_ATF} == no -OLD_DIRS+=etc/atf -OLD_FILES+=etc/atf/FreeBSD.conf -OLD_FILES+=etc/atf/atf-run.hooks -OLD_FILES+=etc/atf/common.conf -OLD_FILES+=usr/bin/atf-config -OLD_FILES+=usr/bin/atf-report -OLD_FILES+=usr/bin/atf-run OLD_FILES+=usr/bin/atf-sh -OLD_FILES+=usr/bin/atf-version OLD_DIRS+=usr/include/atf-c OLD_FILES+=usr/include/atf-c/build.h OLD_FILES+=usr/include/atf-c/check.h @@ -110,34 +102,20 @@ OLD_FILES+=usr/lib/libatf-c++.so OLD_FILES+=usr/lib/libatf-c.a OLD_FILES+=usr/libexec/atf-check OLD_DIRS+=usr/share/atf -OLD_FILES+=usr/share/atf/atf-run.hooks OLD_FILES+=usr/share/atf/libatf-sh.subr OLD_DIRS+=usr/share/doc/atf OLD_FILES+=usr/share/doc/atf/AUTHORS OLD_FILES+=usr/share/doc/atf/COPYING OLD_FILES+=usr/share/doc/atf/NEWS OLD_FILES+=usr/share/doc/atf/README -OLD_DIRS+=usr/share/examples/atf -OLD_FILES+=usr/share/examples/atf/atf-run.hooks -OLD_FILES+=usr/share/examples/atf/tests-results.css OLD_FILES+=usr/share/man/man1/atf-check.1.gz -OLD_FILES+=usr/share/man/man1/atf-config.1.gz -OLD_FILES+=usr/share/man/man1/atf-report.1.gz -OLD_FILES+=usr/share/man/man1/atf-run.1.gz OLD_FILES+=usr/share/man/man1/atf-sh.1.gz OLD_FILES+=usr/share/man/man1/atf-test-program.1.gz -OLD_FILES+=usr/share/man/man1/atf-version.1.gz OLD_FILES+=usr/share/man/man3/atf-c-api.3.gz OLD_FILES+=usr/share/man/man3/atf-c++-api.3.gz OLD_FILES+=usr/share/man/man3/atf-sh-api.3.gz OLD_FILES+=usr/share/man/man4/atf-test-case.4.gz -OLD_FILES+=usr/share/man/man5/atf-formats.5.gz -OLD_FILES+=usr/share/man/man7/atf.7.gz OLD_FILES+=usr/share/mk/atf.test.mk -OLD_DIRS+=usr/share/xml/atf -OLD_FILES+=usr/share/xml/atf/tests-results.dtd -OLD_DIRS+=usr/share/xsl/atf -OLD_FILES+=usr/share/xsl/atf/tests-results.xsl .endif .if ${MK_ATM} == no Modified: stable/10/usr.bin/atf/Makefile ============================================================================== --- stable/10/usr.bin/atf/Makefile Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/usr.bin/atf/Makefile Sat Oct 12 06:08:18 2013 (r256366) @@ -25,10 +25,6 @@ # # $FreeBSD$ -SUBDIR= atf-config \ - atf-report \ - atf-run \ - atf-sh \ - atf-version +SUBDIR= atf-sh .include Modified: stable/10/usr.bin/atf/Makefile.inc ============================================================================== --- stable/10/usr.bin/atf/Makefile.inc Sat Oct 12 06:06:53 2013 (r256365) +++ stable/10/usr.bin/atf/Makefile.inc Sat Oct 12 06:08:18 2013 (r256366) @@ -2,7 +2,5 @@ ATF= ${.CURDIR}/../../../contrib/atf -CFLAGS+= -DGDB=\"gdb\" - BINDIR?= /usr/bin WARNS?= 3 From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 07:00:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B5E182BE; Sat, 12 Oct 2013 07:00:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2ADF2DBB; Sat, 12 Oct 2013 07:00:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9C70pdx025219; Sat, 12 Oct 2013 07:00:51 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9C70pPO025218; Sat, 12 Oct 2013 07:00:51 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201310120700.r9C70pPO025218@svn.freebsd.org> From: Eitan Adler Date: Sat, 12 Oct 2013 07:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256367 - head/share/syscons/keymaps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 07:00:51 -0000 Author: eadler Date: Sat Oct 12 07:00:51 2013 New Revision: 256367 URL: http://svnweb.freebsd.org/changeset/base/256367 Log: Fix the formatting for the danish keymap. Reported by: dteske Approved by: re (glebius) Modified: head/share/syscons/keymaps/INDEX.keymaps Modified: head/share/syscons/keymaps/INDEX.keymaps ============================================================================== --- head/share/syscons/keymaps/INDEX.keymaps Sat Oct 12 06:08:18 2013 (r256366) +++ head/share/syscons/keymaps/INDEX.keymaps Sat Oct 12 07:00:51 2013 (r256367) @@ -117,7 +117,7 @@ danish.cp865.kbd:fr:Danois Code page 865 danish.cp865.kbd:pt:Dinamarquês Codepage 865 danish.cp865.kbd:es:Danés Codepage 865 -danish.iso.macbook.kbd:Danish ISO-8859-1 (macbook) +danish.iso.macbook.kbd:da:Danish ISO-8859-1 (macbook) dutch.iso.acc.kbd:en:Dutch ISO keymap (accent keys) From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 07:26:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ECAF25B7; Sat, 12 Oct 2013 07:26:50 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from smtpauth3.wiscmail.wisc.edu (wmauth3.doit.wisc.edu [144.92.197.226]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E66F12E78; Sat, 12 Oct 2013 07:26:49 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MUJ00M00O8GBY00@smtpauth3.wiscmail.wisc.edu>; Sat, 12 Oct 2013 02:26:49 -0500 (CDT) X-Spam-PmxInfo: Server=avs-3, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.10.12.70914, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from wanderer.tachypleus.net (dhcp-138-246-50-110.dynamic.eduroam.mwn.de [138.246.50.110]) by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MUJ009N3OOJ5310@smtpauth3.wiscmail.wisc.edu>; Sat, 12 Oct 2013 02:26:47 -0500 (CDT) Message-id: <5258F9B3.7030101@freebsd.org> Date: Sat, 12 Oct 2013 09:26:43 +0200 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 To: Devin Teske , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r256343 - in head/usr.sbin/bsdinstall: . scripts References: <201310112041.r9BKfZeT002056@svn.freebsd.org> In-reply-to: <201310112041.r9BKfZeT002056@svn.freebsd.org> X-Enigmail-Version: 1.5.2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 07:26:51 -0000 On 10/11/13 22:41, Devin Teske wrote: > Author: dteske > Date: Fri Oct 11 20:41:35 2013 > New Revision: 256343 > URL: http://svnweb.freebsd.org/changeset/base/256343 > > Log: > Add zfsboot module as an option for automatic configuration. Default is > to run interactively but it can be scripted too (optinally completely > non-interactive). Currently supports GELI and all ZFS vdev types. Also > performs validation on selections/settings providing error messages if > necessary, explaining (in plain language) what the issue is. Currently > the auto partitioning of naked disks only supports GPT and MBR (VTOC8 > pending for sparc64), so is only available for i386/amd64 install. > > Submitted by: Allan Jude , myself > Reviewed by: Allan Jude > Approved by: re (glebius) Hi Devin -- As was discussed on the mailing list, this patch still has some issues that need to be resolved, for example the use of camcontrol unconditionally even when the disks may not be CAM and destruction of existing sub-partitioning for MBR disks. There were some others brought up in the discussion as well. I am surprised you committed it, especially to stable/10, before those issues were resolved. I'm also not sure if people can review their own patches. Installer regressions are very easy to introduce and very problematic when created. Real review for installer changes is thus especially important this late in the release cycle. Do you have any plans to fix these issues in the very near future? -Nathan From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 07:39:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C4CD97DB; Sat, 12 Oct 2013 07:39:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B1F6A2ED9; Sat, 12 Oct 2013 07:39:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9C7dOau043890; Sat, 12 Oct 2013 07:39:24 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9C7dOlY043889; Sat, 12 Oct 2013 07:39:24 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201310120739.r9C7dOlY043889@svn.freebsd.org> From: Eitan Adler Date: Sat, 12 Oct 2013 07:39:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256368 - stable/10/share/misc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 07:39:24 -0000 Author: eadler Date: Sat Oct 12 07:39:24 2013 New Revision: 256368 URL: http://svnweb.freebsd.org/changeset/base/256368 Log: MFC r256327: Fix NetBSD release number Approved by: re (glebius) Modified: stable/10/share/misc/bsd-family-tree Directory Properties: stable/10/share/ (props changed) stable/10/share/misc/ (props changed) Modified: stable/10/share/misc/bsd-family-tree ============================================================================== --- stable/10/share/misc/bsd-family-tree Sat Oct 12 07:00:51 2013 (r256367) +++ stable/10/share/misc/bsd-family-tree Sat Oct 12 07:39:24 2013 (r256368) @@ -275,7 +275,7 @@ FreeBSD 5.2 | | | | | | | | 6.0.2 | | | | | | | | | OpenBSD 5.3 DragonFly 3.4.1 | | | | | | NetBSD | | - | | | | | | 6.0.2 | | + | | | | | | 6.0.3 | | | | | | | | | | | | | | | |`-NetBSD 6.1 | | | | FreeBSD | | | | | From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 07:50: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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9A18794D; Sat, 12 Oct 2013 07:50:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 85C392F2E; Sat, 12 Oct 2013 07:50:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9C7oFWZ049235; Sat, 12 Oct 2013 07:50:15 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9C7oFfs049234; Sat, 12 Oct 2013 07:50:15 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201310120750.r9C7oFfs049234@svn.freebsd.org> From: Eitan Adler Date: Sat, 12 Oct 2013 07:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256369 - stable/10/share/syscons/keymaps X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 07:50:15 -0000 Author: eadler Date: Sat Oct 12 07:50:15 2013 New Revision: 256369 URL: http://svnweb.freebsd.org/changeset/base/256369 Log: MFC r256367: Fix the formatting for the danish keymap. Approved by: re (glebius) Modified: stable/10/share/syscons/keymaps/INDEX.keymaps Directory Properties: stable/10/share/syscons/ (props changed) Modified: stable/10/share/syscons/keymaps/INDEX.keymaps ============================================================================== --- stable/10/share/syscons/keymaps/INDEX.keymaps Sat Oct 12 07:39:24 2013 (r256368) +++ stable/10/share/syscons/keymaps/INDEX.keymaps Sat Oct 12 07:50:15 2013 (r256369) @@ -117,7 +117,7 @@ danish.cp865.kbd:fr:Danois Code page 865 danish.cp865.kbd:pt:Dinamarquês Codepage 865 danish.cp865.kbd:es:Danés Codepage 865 -danish.iso.macbook.kbd:Danish ISO-8859-1 (macbook) +danish.iso.macbook.kbd:da:Danish ISO-8859-1 (macbook) dutch.iso.acc.kbd:en:Dutch ISO keymap (accent keys) From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 08:01:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0C27FB19; Sat, 12 Oct 2013 08:01:59 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ea0-x234.google.com (mail-ea0-x234.google.com [IPv6:2a00:1450:4013:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EAEED2FBF; Sat, 12 Oct 2013 08:01:57 +0000 (UTC) Received: by mail-ea0-f180.google.com with SMTP id h10so2307515eaj.39 for ; Sat, 12 Oct 2013 01:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=nKF77buAfVBpyNbljMQ7atEDn4FIo34LDntslhxc6Qk=; b=vobASKxABnO1CEo+jUjLC2+GmTMb/Tb2HKvyS5l0DWkGQHv7JQC8cOZQyo9woB3RsY SQdmceJlhFgrhH12v27K6F5FA4mcMag9OcXWxFaTmVSADHaUoLBNrddxR0Z7LtWE/CxI /nLk02pcrC3OHV917pGAyRsm5oW+pk+EdpTBcdnZfqMLOMNlmTklfy8MJPRDMfKOBADJ 7h76dnynlsfPRaGyX9cgmbWs6SIG4ME38x6u5mzRb1ztgBbZT6WVggh5RT98c6dFem3i e6P6yBhArpB9fIdn+w0Qsbc3OUwbGafQWEaVjOFlrstGlgGCnKbAC/YOkgfMM67i5Vi7 +ZtQ== MIME-Version: 1.0 X-Received: by 10.15.99.72 with SMTP id bk48mr36400974eeb.22.1381564916173; Sat, 12 Oct 2013 01:01:56 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.14.105.137 with HTTP; Sat, 12 Oct 2013 01:01:55 -0700 (PDT) Received: by 10.14.105.137 with HTTP; Sat, 12 Oct 2013 01:01:55 -0700 (PDT) In-Reply-To: <201310120606.r9C66slB096693@svn.freebsd.org> References: <201310120606.r9C66slB096693@svn.freebsd.org> Date: Sat, 12 Oct 2013 01:01:55 -0700 X-Google-Sender-Auth: Zvp8m1oxnjtdz8DrlEZpC9Rtys4 Message-ID: Subject: Re: svn commit: r256365 - in head: . etc etc/atf etc/mtree lib/libcrypt/tests share share/atf share/examples share/examples/atf share/man/man5 share/man/man7 share/mk share/xml share/xsl tools/build/mk... From: hiren panchasara To: Rui Paulo Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head , svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 08:01:59 -0000 On Oct 11, 2013 11:07 PM, "Rui Paulo" wrote: > > Author: rpaulo > Date: Sat Oct 12 06:06:53 2013 > New Revision: 256365 > URL: http://svnweb.freebsd.org/changeset/base/256365 > > Log: > Remove most of the ATF tools and the _atf user. > > This is necessary because ATF is deprecated and it will be replaced by Kyua. When are we planning to bring in Kyua? I may be missing something but why remove ATF before that? Cheers, Hiren > > Submitted by: jmmv@netbsd.org > Reviewed by: Garrett Cooper > Approved by: re > > Deleted: > head/etc/atf/ > head/share/atf/ > head/share/examples/atf/ > head/share/xml/ > head/share/xsl/ > head/usr.bin/atf/atf-config/ > head/usr.bin/atf/atf-report/ > head/usr.bin/atf/atf-run/ > head/usr.bin/atf/atf-version/ > Modified: > head/ObsoleteFiles.inc > head/etc/Makefile > head/etc/ftpusers > head/etc/group > head/etc/master.passwd > head/etc/mtree/BSD.root.dist > head/etc/mtree/BSD.usr.dist > head/lib/libcrypt/tests/crypt_tests.c > head/share/Makefile > head/share/examples/Makefile > head/share/man/man5/Makefile > head/share/man/man7/Makefile > head/share/mk/atf.test.mk > head/tools/build/mk/OptionalObsoleteFiles.inc > head/usr.bin/atf/Makefile > head/usr.bin/atf/Makefile.inc > > Modified: head/ObsoleteFiles.inc > ============================================================================== > --- head/ObsoleteFiles.inc Sat Oct 12 04:35:38 2013 (r256364) > +++ head/ObsoleteFiles.inc Sat Oct 12 06:06:53 2013 (r256365) > @@ -38,6 +38,25 @@ > # xargs -n1 | sort | uniq -d; > # done > > +# 20131013: Removal of the ATF tools > +OLD_FILES+=etc/atf/FreeBSD.conf > +OLD_FILES+=etc/atf/atf-run.hooks > +OLD_FILES+=etc/atf/common.conf > +OLD_FILES+=usr/bin/atf-config > +OLD_FILES+=usr/bin/atf-report > +OLD_FILES+=usr/bin/atf-run > +OLD_FILES+=usr/bin/atf-version > +OLD_FILES+=usr/share/atf/atf-run.hooks > +OLD_FILES+=usr/share/examples/atf/atf-run.hooks > +OLD_FILES+=usr/share/examples/atf/tests-results.css > +OLD_FILES+=usr/share/man/man1/atf-config.1.gz > +OLD_FILES+=usr/share/man/man1/atf-report.1.gz > +OLD_FILES+=usr/share/man/man1/atf-run.1.gz > +OLD_FILES+=usr/share/man/man1/atf-version.1.gz > +OLD_FILES+=usr/share/man/man5/atf-formats.5.gz > +OLD_FILES+=usr/share/man/man7/atf.7.gz > +OLD_FILES+=usr/share/xml/atf/tests-results.dtd > +OLD_FILES+=usr/share/xsl/atf/tests-results.xsl > # 20131009: freebsd-version moved from /libexec to /bin > OLD_FILES+=libexec/freebsd-version > # 20131001: ar and ranlib from binutils not used > @@ -6093,6 +6112,13 @@ OLD_LIBS+=usr/lib/libkse.so.1 > OLD_LIBS+=usr/lib/liblwres.so.3 > OLD_LIBS+=usr/lib/pam_ftp.so.2 > > +# 20131013: Removal of the ATF tools > +OLD_DIRS+=etc/atf > +OLD_DIRS+=usr/share/examples/atf > +OLD_DIRS+=usr/share/xml/atf > +OLD_DIRS+=usr/share/xml > +OLD_DIRS+=usr/share/xsl/atf > +OLD_DIRS+=usr/share/xsl > # 20040925: bind9 import > OLD_DIRS+=usr/share/doc/bind/html > OLD_DIRS+=usr/share/doc/bind/misc > > Modified: head/etc/Makefile > ============================================================================== > --- head/etc/Makefile Sat Oct 12 04:35:38 2013 (r256364) > +++ head/etc/Makefile Sat Oct 12 06:06:53 2013 (r256365) > @@ -215,9 +215,6 @@ distribution: > echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ > ) | ${METALOG.add} > .endif > -.if ${MK_ATF} != "no" > - ${_+_}cd ${.CURDIR}/atf; ${MAKE} install > -.endif > .if ${MK_BLUETOOTH} != "no" > ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install > .endif > > Modified: head/etc/ftpusers > ============================================================================== > --- head/etc/ftpusers Sat Oct 12 04:35:38 2013 (r256364) > +++ head/etc/ftpusers Sat Oct 12 06:06:53 2013 (r256365) > @@ -15,7 +15,6 @@ man > sshd > smmsp > mailnull > -_atf > bind > unbound > proxy > > Modified: head/etc/group > ============================================================================== > --- head/etc/group Sat Oct 12 04:35:38 2013 (r256364) > +++ head/etc/group Sat Oct 12 06:06:53 2013 (r256365) > @@ -16,7 +16,6 @@ staff:*:20: > sshd:*:22: > smmsp:*:25: > mailnull:*:26: > -_atf:*:27: > guest:*:31: > bind:*:53: > unbound:*:59: > > Modified: head/etc/master.passwd > ============================================================================== > --- head/etc/master.passwd Sat Oct 12 04:35:38 2013 (r256364) > +++ head/etc/master.passwd Sat Oct 12 06:06:53 2013 (r256365) > @@ -13,7 +13,6 @@ man:*:9:9::0:0:Mister Man Pages:/usr/sha > sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin > smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin > mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin > -_atf:*:27:27::0:0:& pseudo-user:/nonexistent:/usr/sbin/nologin > bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin > unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin > proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin > > Modified: head/etc/mtree/BSD.root.dist > ============================================================================== > --- head/etc/mtree/BSD.root.dist Sat Oct 12 04:35:38 2013 (r256364) > +++ head/etc/mtree/BSD.root.dist Sat Oct 12 06:06:53 2013 (r256365) > @@ -24,8 +24,6 @@ > etc > X11 > .. > - atf > - .. > bluetooth > .. > defaults > > Modified: head/etc/mtree/BSD.usr.dist > ============================================================================== > --- head/etc/mtree/BSD.usr.dist Sat Oct 12 04:35:38 2013 (r256364) > +++ head/etc/mtree/BSD.usr.dist Sat Oct 12 06:06:53 2013 (r256365) > @@ -299,8 +299,6 @@ > .. > IPv6 > .. > - atf > - .. > bhyve > .. > bootforth > @@ -1410,14 +1408,6 @@ > catalog > .. > .. > - xml > - atf > - .. > - .. > - xsl > - atf > - .. > - .. > zoneinfo > Africa > .. > > Modified: head/lib/libcrypt/tests/crypt_tests.c > ============================================================================== > --- head/lib/libcrypt/tests/crypt_tests.c Sat Oct 12 04:35:38 2013 (r256364) > +++ head/lib/libcrypt/tests/crypt_tests.c Sat Oct 12 06:06:53 2013 (r256365) > @@ -43,7 +43,7 @@ ATF_TC_BODY(invalid, tc) > > /* > * This function must not do anything except enumerate > - * the test cases, else atf-run is likely to be upset. > + * the test cases, per atf-c-api(3). > */ > ATF_TP_ADD_TCS(tp) > { > > Modified: head/share/Makefile > ============================================================================== > --- head/share/Makefile Sat Oct 12 04:35:38 2013 (r256364) > +++ head/share/Makefile Sat Oct 12 06:06:53 2013 (r256365) > @@ -5,8 +5,7 @@ > > # Do not include `info' in the SUBDIR list, it is handled separately. > > -SUBDIR= ${_atf} \ > - ${_colldef} \ > +SUBDIR= ${_colldef} \ > ${_dict} \ > ${_doc} \ > dtrace \ > @@ -27,16 +26,10 @@ SUBDIR= ${_atf} \ > tabset \ > termcap \ > ${_timedef} \ > - xml \ > - xsl \ > ${_zoneinfo} > > # NB: keep these sorted by MK_* knobs > > -.if ${MK_ATF} != "no" > -_atf= atf > -.endif > - > .if ${MK_BSNMP} != "no" > _snmp= snmp > .endif > > Modified: head/share/examples/Makefile > ============================================================================== > --- head/share/examples/Makefile Sat Oct 12 04:35:38 2013 (r256364) > +++ head/share/examples/Makefile Sat Oct 12 06:06:53 2013 (r256365) > @@ -241,9 +241,6 @@ etc-examples: > > .if ${SHARED} != "symlinks" > SUBDIR= smbfs > -.if ${MK_ATF} != "no" > -SUBDIR+=atf > -.endif > .if ${MK_IPFILTER} != "no" > SUBDIR+=ipfilter > .endif > > Modified: head/share/man/man5/Makefile > ============================================================================== > --- head/share/man/man5/Makefile Sat Oct 12 04:35:38 2013 (r256364) > +++ head/share/man/man5/Makefile Sat Oct 12 06:06:53 2013 (r256365) > @@ -6,7 +6,6 @@ > #MISSING: dump.5 plot.5 > MAN= acct.5 \ > ar.5 \ > - ${_atf_formats.5} \ > a.out.5 \ > bluetooth.device.conf.5 \ > bluetooth.hosts.5 \ > @@ -80,12 +79,6 @@ MLINKS+=quota.user.5 quota.group.5 > MLINKS+=rc.conf.5 rc.conf.local.5 > MLINKS+=resolver.5 resolv.conf.5 > > -.if ${MK_ATF} != "no" > -ATF= ${.CURDIR}/../../../contrib/atf > -.PATH: ${ATF}/doc > -_atf_formats.5= atf-formats.5 > -.endif > - > .if ${MK_FREEBSD_UPDATE} != "no" > MAN+= freebsd-update.conf.5 > .endif > > Modified: head/share/man/man7/Makefile > ============================================================================== > --- head/share/man/man7/Makefile Sat Oct 12 04:35:38 2013 (r256364) > +++ head/share/man/man7/Makefile Sat Oct 12 06:06:53 2013 (r256365) > @@ -36,17 +36,4 @@ MLINKS+= c99.7 c78.7 > MLINKS+= c99.7 c89.7 > MLINKS+= c99.7 c90.7 > > -.if ${MK_ATF} != "no" > -ATF= ${.CURDIR}/../../../contrib/atf > -.PATH: ${ATF}/doc > -MAN+= atf.7 > - > -CLEANFILES+= atf.7 atf.7.tmp > -atf.7: atf.7.in > - sed -e 's,__DOCDIR__,${DOCDIR}/atf,g' \ > - -e 's,__TESTSDIR__,${TESTSBASE},g' \ > - < ${.ALLSRC} > ${.TARGET}.tmp > - mv ${.TARGET}.tmp ${.TARGET} > -.endif > - > .include > > Modified: head/share/mk/atf.test.mk > ============================================================================== > --- head/share/mk/atf.test.mk Sat Oct 12 04:35:38 2013 (r256364) > +++ head/share/mk/atf.test.mk Sat Oct 12 06:06:53 2013 (r256365) > @@ -51,98 +51,4 @@ ${_T}: ${TESTS_SH_SRC_${_T}} > .endfor > .endif > > -ATFFILE?= auto > - > -.if ${ATFFILE:tl} != "no" > -FILES+= Atffile > -FILESDIR_Atffile= ${TESTSDIR} > - > -.if ${ATFFILE:tl} == "auto" > -CLEANFILES+= Atffile Atffile.tmp > - > -Atffile: Makefile > - @{ echo 'Content-Type: application/X-atf-atffile; version="1"'; \ > - echo; \ > - echo '# Automatically generated by atf-test.mk.'; \ > - echo; \ > - echo 'prop: test-suite = "'`uname -o`'"'; \ > - echo; \ > - for tp in ${ATF_TESTS}; do \ > - echo "tp: $${tp}"; \ > - done; } >Atffile.tmp > - @mv Atffile.tmp Atffile > -.endif > -.endif > - > -# Generate support variables for atf-test. > -# > -# atf-test can only work for native builds, i.e. a build host of a particular > -# OS building a release for the same OS version and architecture. The target > -# runs ATF, which is on the build host, and the tests execute code built for > -# the target host. > -# > -# Due to the dependencies of the binaries built by the source tree and how they > -# are used by tests, it is highly possible for a execution of "make test" to > -# report bogus results unless the new binaries are put in place. > - > -# XXX (gcooper): Executing ATF from outside the source tree is improper; it > -# should be built as part of the OS toolchain build for the host OS and > -# executed from there. > -ATF_PATH+= ${DESTDIR}/bin ${DESTDIR}/sbin ${DESTDIR}/usr/bin ${DESTDIR}/usr/sbin > -TESTS_ENV+= PATH=${ATF_PATH:ts:}:${PATH} > - > -ATF_BUILD_CC?= ${DESTDIR}/usr/bin/cc > -ATF_BUILD_CPP?= ${DESTDIR}/usr/bin/cpp > -ATF_BUILD_CXX?= ${DESTDIR}/usr/bin/c++ > -ATF_CONFDIR?= ${DESTDIR}/etc > -ATF_INCLUDEDIR?= ${DESTDIR}/usr/include > -ATF_LIBDIR?= ${DESTDIR}/usr/lib > -ATF_LIBEXECDIR?= ${DESTDIR}/usr/libexec > -ATF_PKGDATADIR?= ${DESTDIR}/usr/share/atf > -ATF_SHELL?= ${DESTDIR}/bin/sh > -LD_LIBRARY_PATH?= ${TESTS_LD_LIBRARY_PATH:tW:S/ /:/g} > - > -ATF_ENV_VARS= \ > - ATF_BUILD_CC \ > - ATF_BUILD_CPP \ > - ATF_BUILD_CXX \ > - ATF_CONFDIR \ > - ATF_INCLUDEDIR \ > - ATF_LIBDIR \ > - ATF_LIBEXECDIR \ > - ATF_PKGDATADIR \ > - ATF_SHELL \ > - > -.for v in ${ATF_ENV_VARS} > -.if !empty($v) > -TESTS_ENV+= $v=${$v} > -.endif > -.endfor > - > -_TESTS_FIFO= ${.OBJDIR}/atf-run.fifo > -_TESTS_LOG= ${.OBJDIR}/atf-run.log > -CLEANFILES+= ${_TESTS_FIFO} ${_TESTS_LOG} > - > -ATF_BIN?= ${DESTDIR}/usr/bin > -ATF_REPORT?= ${ATF_BIN}/atf-report > -ATF_RUN?= ${ATF_BIN}/atf-run > - > -.PHONY: realtest > -realtest: > -.if defined(TESTSDIR) > - @set -e; \ > - cd ${DESTDIR}${TESTSDIR}; \ > - rm -f ${_TESTS_FIFO}; \ > - mkfifo ${_TESTS_FIFO}; \ > - tee ${_TESTS_LOG} < ${_TESTS_FIFO} | ${TESTS_ENV} ${ATF_REPORT} & \ > - set +e; \ > - ${TESTS_ENV} ${ATF_RUN} >> ${_TESTS_FIFO}; \ > - result=$${?}; \ > - wait; \ > - rm -f ${_TESTS_FIFO}; \ > - echo; \ > - echo "*** The verbatim output of atf-run has been saved to ${_TESTS_LOG}"; \ > - exit $${result} > -.endif > - > .include > > Modified: head/tools/build/mk/OptionalObsoleteFiles.inc > ============================================================================== > --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 12 04:35:38 2013 (r256364) > +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 12 06:06:53 2013 (r256365) > @@ -69,15 +69,7 @@ OLD_FILES+=usr/share/man/man8/atrun.8.gz > .endif > > .if ${MK_ATF} == no > -OLD_DIRS+=etc/atf > -OLD_FILES+=etc/atf/FreeBSD.conf > -OLD_FILES+=etc/atf/atf-run.hooks > -OLD_FILES+=etc/atf/common.conf > -OLD_FILES+=usr/bin/atf-config > -OLD_FILES+=usr/bin/atf-report > -OLD_FILES+=usr/bin/atf-run > OLD_FILES+=usr/bin/atf-sh > -OLD_FILES+=usr/bin/atf-version > OLD_DIRS+=usr/include/atf-c > OLD_FILES+=usr/include/atf-c/build.h > OLD_FILES+=usr/include/atf-c/check.h > @@ -110,34 +102,20 @@ OLD_FILES+=usr/lib/libatf-c++.so > OLD_FILES+=usr/lib/libatf-c.a > OLD_FILES+=usr/libexec/atf-check > OLD_DIRS+=usr/share/atf > -OLD_FILES+=usr/share/atf/atf-run.hooks > OLD_FILES+=usr/share/atf/libatf-sh.subr > OLD_DIRS+=usr/share/doc/atf > OLD_FILES+=usr/share/doc/atf/AUTHORS > OLD_FILES+=usr/share/doc/atf/COPYING > OLD_FILES+=usr/share/doc/atf/NEWS > OLD_FILES+=usr/share/doc/atf/README > -OLD_DIRS+=usr/share/examples/atf > -OLD_FILES+=usr/share/examples/atf/atf-run.hooks > -OLD_FILES+=usr/share/examples/atf/tests-results.css > OLD_FILES+=usr/share/man/man1/atf-check.1.gz > -OLD_FILES+=usr/share/man/man1/atf-config.1.gz > -OLD_FILES+=usr/share/man/man1/atf-report.1.gz > -OLD_FILES+=usr/share/man/man1/atf-run.1.gz > OLD_FILES+=usr/share/man/man1/atf-sh.1.gz > OLD_FILES+=usr/share/man/man1/atf-test-program.1.gz > -OLD_FILES+=usr/share/man/man1/atf-version.1.gz > OLD_FILES+=usr/share/man/man3/atf-c-api.3.gz > OLD_FILES+=usr/share/man/man3/atf-c++-api.3.gz > OLD_FILES+=usr/share/man/man3/atf-sh-api.3.gz > OLD_FILES+=usr/share/man/man4/atf-test-case.4.gz > -OLD_FILES+=usr/share/man/man5/atf-formats.5.gz > -OLD_FILES+=usr/share/man/man7/atf.7.gz > OLD_FILES+=usr/share/mk/atf.test.mk > -OLD_DIRS+=usr/share/xml/atf > -OLD_FILES+=usr/share/xml/atf/tests-results.dtd > -OLD_DIRS+=usr/share/xsl/atf > -OLD_FILES+=usr/share/xsl/atf/tests-results.xsl > .endif > > .if ${MK_ATM} == no > > Modified: head/usr.bin/atf/Makefile > ============================================================================== > --- head/usr.bin/atf/Makefile Sat Oct 12 04:35:38 2013 (r256364) > +++ head/usr.bin/atf/Makefile Sat Oct 12 06:06:53 2013 (r256365) > @@ -25,10 +25,6 @@ > # > # $FreeBSD$ > > -SUBDIR= atf-config \ > - atf-report \ > - atf-run \ > - atf-sh \ > - atf-version > +SUBDIR= atf-sh > > .include > > Modified: head/usr.bin/atf/Makefile.inc > ============================================================================== > --- head/usr.bin/atf/Makefile.inc Sat Oct 12 04:35:38 2013 (r256364) > +++ head/usr.bin/atf/Makefile.inc Sat Oct 12 06:06:53 2013 (r256365) > @@ -2,7 +2,5 @@ > > ATF= ${.CURDIR}/../../../contrib/atf > > -CFLAGS+= -DGDB=\"gdb\" > - > BINDIR?= /usr/bin > WARNS?= 3 From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 08:03:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 36BDAC60; Sat, 12 Oct 2013 08:03:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0838E2FCC; Sat, 12 Oct 2013 08:03:36 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id E00BAA5C2; Sat, 12 Oct 2013 08:03:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us E00BAA5C2 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Sat, 12 Oct 2013 04:03:33 -0400 From: Glen Barber To: hiren panchasara Subject: Re: svn commit: r256365 - in head: . etc etc/atf etc/mtree lib/libcrypt/tests share share/atf share/examples share/examples/atf share/man/man5 share/man/man7 share/mk share/xml share/xsl tools/build/mk... Message-ID: <20131012080333.GR44375@glenbarber.us> References: <201310120606.r9C66slB096693@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rtB7IEDY8voTVmfF" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 10.0-ALPHA4 amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head , svn-src-all@freebsd.org, src-committers , Rui Paulo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 08:03:37 -0000 --rtB7IEDY8voTVmfF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 12, 2013 at 01:01:55AM -0700, hiren panchasara wrote: > On Oct 11, 2013 11:07 PM, "Rui Paulo" wrote: > > > > Author: rpaulo > > Date: Sat Oct 12 06:06:53 2013 > > New Revision: 256365 > > URL: http://svnweb.freebsd.org/changeset/base/256365 > > > > Log: > > Remove most of the ATF tools and the _atf user. > > > > This is necessary because ATF is deprecated and it will be replaced b= y Kyua. >=20 > When are we planning to bring in Kyua? IMHO, it should exist in ports. > I may be missing something but why remove ATF before that? >=20 It is deprecated upstream. Glen --rtB7IEDY8voTVmfF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJSWQJVAAoJELls3eqvi17QAOcQAMK8nCTIZ30eXTPmXkM2/pZ1 YYVdpEFNdAYPY7K1dZgga/q58yjf/Vf0+ab3CrZrQbrD6PClEPfK/E9wrZfS31Mc s1XK0wH47EjDsmyMgHPMTfrN8dT4OnpUdliSPch9JYmbdfVI7ngDzBj9kByU0HZC ML73WimCcltBikXICX+K8GOP7LnLFDPR2YjM0hZcqewHMV5CNjenpUPJwyCC8vzH DtiXhtJgfNilG26zRPjMxn4WFHJWHQFUrmD91Sht1oV/zh/3OggGxz1NmBmzvoJi TCp+4m7Ranjv0gl/hsKC2ge35851fqAVwEwt2p7YH1/3+48b1LZiEWL0HYUYo5xS zu22vjsWe3VCop4toai67nhLU1IHuAUksZeME4V4IgBzJwlnpQ7WTpWy74wfJv7x vO+KqEsRsOQXvskSJ48nP1AAgzvUnjhRhW+9nfI3nJzaNUzmpVe4PL8Q+kwcJXWh LB/aZF2kvhMbUyOud4fVITvcenbjA3RG8EkNGGk1UnzwdDxgbJyk2pcJzPK15Jbq PXIEcm3Vapb/NZDFPxKoBvFJSjTy5/IPBSgPOdCbk1NTt8JuISfqH0I6uA2gj1Zm Npoq1HgFHKgDwIA5DrFxV8x9g3qbqQXQzBMMaD3DpXDvOsAEzicSdfIQXsSrdWOE P/RJy27scUAxIbqnYHzE =Wb2S -----END PGP SIGNATURE----- --rtB7IEDY8voTVmfF-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 12:58:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D5D7EE5; Sat, 12 Oct 2013 12:58:01 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B8DC62C54; Sat, 12 Oct 2013 12:58:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CCw1d0006590; Sat, 12 Oct 2013 12:58:01 GMT (envelope-from markm@svn.freebsd.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CCvvjO006546; Sat, 12 Oct 2013 12:57:57 GMT (envelope-from markm@svn.freebsd.org) Message-Id: <201310121257.r9CCvvjO006546@svn.freebsd.org> From: Mark Murray Date: Sat, 12 Oct 2013 12:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 12:58:03 -0000 Author: markm Date: Sat Oct 12 12:57:57 2013 New Revision: 256377 URL: http://svnweb.freebsd.org/changeset/base/256377 Log: Merge from project branch. Uninteresting commits are trimmed. Refactor of /dev/random device. Main points include: * Userland seeding is no longer used. This auto-seeds at boot time on PC/Desktop setups; this may need some tweeking and intelligence from those folks setting up embedded boxes, but the work is believed to be minimal. * An entropy cache is written to /entropy (even during installation) and the kernel uses this at next boot. * An entropy file written to /boot/entropy can be loaded by loader(8) * Hardware sources such as rdrand are fed into Yarrow, and are no longer available raw. ------------------------------------------------------------------------ r256240 | des | 2013-10-09 21:14:16 +0100 (Wed, 09 Oct 2013) | 4 lines Add a RANDOM_RWFILE option and hide the entropy cache code behind it. Rename YARROW_RNG and FORTUNA_RNG to RANDOM_YARROW and RANDOM_FORTUNA. Add the RANDOM_* options to LINT. ------------------------------------------------------------------------ r256239 | des | 2013-10-09 21:12:59 +0100 (Wed, 09 Oct 2013) | 2 lines Define RANDOM_PURE_RNDTEST for rndtest(4). ------------------------------------------------------------------------ r256204 | des | 2013-10-09 18:51:38 +0100 (Wed, 09 Oct 2013) | 2 lines staticize struct random_hardware_source ------------------------------------------------------------------------ r256203 | markm | 2013-10-09 18:50:36 +0100 (Wed, 09 Oct 2013) | 2 lines Wrap some policy-rich code in 'if NOTYET' until we can thresh out what it really needs to do. ------------------------------------------------------------------------ r256184 | des | 2013-10-09 10:13:12 +0100 (Wed, 09 Oct 2013) | 2 lines Re-add /dev/urandom for compatibility purposes. ------------------------------------------------------------------------ r256182 | des | 2013-10-09 10:11:14 +0100 (Wed, 09 Oct 2013) | 3 lines Add missing include guards and move the existing ones out of the implementation namespace. ------------------------------------------------------------------------ r256168 | markm | 2013-10-08 23:14:07 +0100 (Tue, 08 Oct 2013) | 10 lines Fix some just-noticed problems: o Allow this to work with "nodevice random" by fixing where the MALLOC pool is defined. o Fix the explicit reseed code. This was correct as submitted, but in the project branch doesn't need to set the "seeded" bit as this is done correctly in the "unblock" function. o Remove some debug ifdeffing. o Adjust comments. ------------------------------------------------------------------------ r256159 | markm | 2013-10-08 19:48:11 +0100 (Tue, 08 Oct 2013) | 6 lines Time to eat crow for me. I replaced the sx_* locks that Arthur used with regular mutexes; this turned out the be the wrong thing to do as the locks need to be sleepable. Revert this folly. # Submitted by: Arthur Mesh (In original diff) ------------------------------------------------------------------------ r256138 | des | 2013-10-08 12:05:26 +0100 (Tue, 08 Oct 2013) | 10 lines Add YARROW_RNG and FORTUNA_RNG to sys/conf/options. Add a SYSINIT that forces a reseed during proc0 setup, which happens fairly late in the boot process. Add a RANDOM_DEBUG option which enables some debugging printf()s. Add a new RANDOM_ATTACH entropy source which harvests entropy from the get_cyclecount() delta across each call to a device attach method. ------------------------------------------------------------------------ r256135 | markm | 2013-10-08 07:54:52 +0100 (Tue, 08 Oct 2013) | 8 lines Debugging. My attempt at EVENTHANDLER(multiuser) was a failure; use EVENTHANDLER(mountroot) instead. This means we can't count on /var being present, so something will need to be done about harvesting /var/db/entropy/... . Some policy now needs to be sorted out, and a pre-sync cache needs to be written, but apart from that we are now ready to go. Over to review. ------------------------------------------------------------------------ r256094 | markm | 2013-10-06 23:45:02 +0100 (Sun, 06 Oct 2013) | 8 lines Snapshot. Looking pretty good; this mostly works now. New code includes: * Read cached entropy at startup, both from files and from loader(8) preloaded entropy. Failures are soft, but announced. Untested. * Use EVENTHANDLER to do above just before we go multiuser. Untested. ------------------------------------------------------------------------ r256088 | markm | 2013-10-06 14:01:42 +0100 (Sun, 06 Oct 2013) | 2 lines Fix up the man page for random(4). This mainly removes no-longer-relevant details about HW RNGs, reseeding explicitly and user-supplied entropy. ------------------------------------------------------------------------ r256087 | markm | 2013-10-06 13:43:42 +0100 (Sun, 06 Oct 2013) | 6 lines As userland writing to /dev/random is no more, remove the "better than nothing" bootstrap mode. Add SWI harvesting to the mix. My box seeds Yarrow by itself in a few seconds! YMMV; more to follow. ------------------------------------------------------------------------ r256086 | markm | 2013-10-06 13:40:32 +0100 (Sun, 06 Oct 2013) | 11 lines Debug run. This now works, except that the "live" sources haven't been tested. With all sources turned on, this unlocks itself in a couple of seconds! That is no my box, and there is no guarantee that this will be the case everywhere. * Cut debug prints. * Use the same locks/mutexes all the way through. * Be a tad more conservative about entropy estimates. ------------------------------------------------------------------------ r256084 | markm | 2013-10-06 13:35:29 +0100 (Sun, 06 Oct 2013) | 5 lines Don't use the "real" assembler mnemonics; older compilers may not understand them (like when building CURRENT on 9.x). # Submitted by: Konstantin Belousov ------------------------------------------------------------------------ r256081 | markm | 2013-10-06 10:55:28 +0100 (Sun, 06 Oct 2013) | 12 lines SNAPSHOT. Simplify the malloc pools; We only need one for this device. Simplify the harvest queue. Marginally improve the entropy pool hashing, making it a bit faster in the process. Connect up the hardware "live" source harvesting. This is simplistic for now, and will need to be made rate-adaptive. All of the above passes a compile test but needs to be debugged. ------------------------------------------------------------------------ r256042 | markm | 2013-10-04 07:55:06 +0100 (Fri, 04 Oct 2013) | 25 lines Snapshot. This passes the build test, but has not yet been finished or debugged. Contains: * Refactor the hardware RNG CPU instruction sources to feed into the software mixer. This is unfinished. The actual harvesting needs to be sorted out. Modified by me (see below). * Remove 'frac' parameter from random_harvest(). This was never used and adds extra code for no good reason. * Remove device write entropy harvesting. This provided a weak attack vector, was not very good at bootstrapping the device. To follow will be a replacement explicit reseed knob. * Separate out all the RANDOM_PURE sources into separate harvest entities. This adds some secuity in the case where more than one is present. * Review all the code and fix anything obviously messy or inconsistent. Address som review concerns while I'm here, like rename the pseudo-rng to 'dummy'. # Submitted by: Arthur Mesh (the first item) ------------------------------------------------------------------------ r255319 | markm | 2013-09-06 18:51:52 +0100 (Fri, 06 Sep 2013) | 4 lines Yarrow wants entropy estimations to be conservative; the usual idea is that if you are certain you have N bits of entropy, you declare N/2. ------------------------------------------------------------------------ r255075 | markm | 2013-08-30 18:47:53 +0100 (Fri, 30 Aug 2013) | 4 lines Remove short-lived idea; thread to harvest (eg) RDRAND enropy into the usual harvest queues. It was a nifty idea, but too heavyweight. # Submitted by: Arthur Mesh ------------------------------------------------------------------------ r255071 | markm | 2013-08-30 12:42:57 +0100 (Fri, 30 Aug 2013) | 4 lines Separate out the Software RNG entropy harvesting queue and thread into its own files. # Submitted by: Arthur Mesh ------------------------------------------------------------------------ r254934 | markm | 2013-08-26 20:07:03 +0100 (Mon, 26 Aug 2013) | 2 lines Remove the short-lived namei experiment. ------------------------------------------------------------------------ r254928 | markm | 2013-08-26 19:35:21 +0100 (Mon, 26 Aug 2013) | 2 lines Snapshot; Do some running repairs on entropy harvesting. More needs to follow. ------------------------------------------------------------------------ r254927 | markm | 2013-08-26 19:29:51 +0100 (Mon, 26 Aug 2013) | 15 lines Snapshot of current work; 1) Clean up namespace; only use "Yarrow" where it is Yarrow-specific or close enough to the Yarrow algorithm. For the rest use a neutral name. 2) Tidy up headers; put private stuff in private places. More could be done here. 3) Streamline the hashing/encryption; no need for a 256-bit counter; 128 bits will last for long enough. There are bits of debug code lying around; these will be removed at a later stage. ------------------------------------------------------------------------ r254784 | markm | 2013-08-24 14:54:56 +0100 (Sat, 24 Aug 2013) | 39 lines 1) example (partially humorous random_adaptor, that I call "EXAMPLE") * It's not meant to be used in a real system, it's there to show how the basics of how to create interfaces for random_adaptors. Perhaps it should belong in a manual page 2) Move probe.c's functionality in to random_adaptors.c * rename random_ident_hardware() to random_adaptor_choose() 3) Introduce a new way to choose (or select) random_adaptors via tunable "rngs_want" It's a list of comma separated names of adaptors, ordered by preferences. I.e.: rngs_want="yarrow,rdrand" Such setting would cause yarrow to be preferred to rdrand. If neither of them are available (or registered), then system will default to something reasonable (currently yarrow). If yarrow is not present, then we fall back to the adaptor that's first on the list of registered adaptors. 4) Introduce a way where RNGs can play a role of entropy source. This is mostly useful for HW rngs. The way I envision this is that every HW RNG will use this functionality by default. Functionality to disable this is also present. I have an example of how to use this in random_adaptor_example.c (see modload event, and init function) 5) fix kern.random.adaptors from kern.random.adaptors: yarrowpanicblock to kern.random.adaptors: yarrow,panic,block 6) add kern.random.active_adaptor to indicate currently selected adaptor: root@freebsd04:~ # sysctl kern.random.active_adaptor kern.random.active_adaptor: yarrow # Submitted by: Arthur Mesh Submitted by: Dag-Erling Smørgrav , Arthur Mesh Reviewed by: des@FreeBSD.org Approved by: re (delphij) Approved by: secteam (des,delphij) Added: head/sys/dev/random/dummy_rng.c - copied unchanged from r256243, projects/random_number_generator/sys/dev/random/dummy_rng.c head/sys/dev/random/live_entropy_sources.c - copied unchanged from r256243, projects/random_number_generator/sys/dev/random/live_entropy_sources.c head/sys/dev/random/live_entropy_sources.h - copied unchanged from r256243, projects/random_number_generator/sys/dev/random/live_entropy_sources.h head/sys/dev/random/rwfile.c - copied unchanged from r256243, projects/random_number_generator/sys/dev/random/rwfile.c head/sys/dev/random/rwfile.h - copied unchanged from r256243, projects/random_number_generator/sys/dev/random/rwfile.h Deleted: head/sys/dev/random/pseudo_rng.c Modified: head/etc/defaults/rc.conf head/etc/rc.d/initrandom head/share/examples/kld/random_adaptor/random_adaptor_example.c (contents, props changed) head/share/man/man4/random.4 head/sys/boot/forth/loader.conf head/sys/conf/NOTES head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/options head/sys/dev/glxsb/glxsb.c head/sys/dev/hifn/hifn7751.c head/sys/dev/random/harvest.c head/sys/dev/random/hash.h head/sys/dev/random/ivy.c head/sys/dev/random/nehemiah.c head/sys/dev/random/random_adaptors.c head/sys/dev/random/random_adaptors.h head/sys/dev/random/random_harvestq.c head/sys/dev/random/random_harvestq.h head/sys/dev/random/randomdev.c head/sys/dev/random/randomdev.h head/sys/dev/random/randomdev_soft.c head/sys/dev/random/randomdev_soft.h head/sys/dev/random/yarrow.c head/sys/dev/random/yarrow.h head/sys/dev/rndtest/rndtest.c head/sys/dev/safe/safe.c head/sys/dev/syscons/scmouse.c head/sys/dev/syscons/syscons.c head/sys/dev/ubsec/ubsec.c head/sys/kern/kern_intr.c head/sys/kern/subr_bus.c head/sys/mips/cavium/octeon_rnd.c head/sys/modules/random/Makefile head/sys/net/if_ethersubr.c head/sys/net/if_tun.c head/sys/netgraph/ng_iface.c head/sys/sys/random.h Directory Properties: head/ (props changed) Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sat Oct 12 12:34:19 2013 (r256376) +++ head/etc/defaults/rc.conf Sat Oct 12 12:57:57 2013 (r256377) @@ -651,6 +651,7 @@ entropy_save_num="8" # Number of entropy harvest_interrupt="YES" # Entropy device harvests interrupt randomness harvest_ethernet="YES" # Entropy device harvests ethernet randomness harvest_p_to_p="YES" # Entropy device harvests point-to-point randomness +harvest_swi="YES" # Entropy device harvests internal SWI randomness dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot watchdogd_enable="NO" # Start the software watchdog daemon watchdogd_flags="" # Flags to watchdogd (if enabled) Modified: head/etc/rc.d/initrandom ============================================================================== --- head/etc/rc.d/initrandom Sat Oct 12 12:34:19 2013 (r256376) +++ head/etc/rc.d/initrandom Sat Oct 12 12:57:57 2013 (r256377) @@ -14,26 +14,6 @@ name="initrandom" start_cmd="initrandom_start" stop_cmd=":" -feed_dev_random() -{ - if [ -f "${1}" -a -r "${1}" -a -s "${1}" ]; then - cat "${1}" | dd of=/dev/random bs=8k 2>/dev/null - fi -} - -better_than_nothing() -{ - # XXX temporary until we can improve the entropy - # harvesting rate. - # Entropy below is not great, but better than nothing. - # This unblocks the generator at startup - # Note: commands are ordered to cause the most variance across reboots. - ( kenv; dmesg; df -ib; ps -fauxww; date; sysctl -a ) \ - | dd of=/dev/random bs=8k 2>/dev/null - /sbin/sha256 -q `sysctl -n kern.bootfile` \ - | dd of=/dev/random bs=8k 2>/dev/null -} - initrandom_start() { soft_random_generator=`sysctl kern.random 2>/dev/null` @@ -63,23 +43,15 @@ initrandom_start() else ${SYSCTL} kern.random.sys.harvest.point_to_point=0 >/dev/null fi - fi - # First pass at reseeding /dev/random. - # - case ${entropy_file} in - [Nn][Oo] | '') - ;; - *) - if [ -w /dev/random ]; then - feed_dev_random "${entropy_file}" + if checkyesno harvest_swi; then + ${SYSCTL} kern.random.sys.harvest.swi=1 >/dev/null + echo -n ' swi' + else + ${SYSCTL} kern.random.sys.harvest.swi=0 >/dev/null fi - ;; - esac - - better_than_nothing + fi - echo -n ' kickstart' fi echo '.' Modified: head/share/examples/kld/random_adaptor/random_adaptor_example.c ============================================================================== --- head/share/examples/kld/random_adaptor/random_adaptor_example.c Sat Oct 12 12:34:19 2013 (r256376) +++ head/share/examples/kld/random_adaptor/random_adaptor_example.c Sat Oct 12 12:57:57 2013 (r256377) @@ -30,32 +30,29 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include -#include +#include #include +#include #include #include -#define RNG_NAME "example" - static int random_example_read(void *, int); struct random_adaptor random_example = { .ident = "Example RNG", - .init = (random_init_func_t *)random_null_func, - .deinit = (random_deinit_func_t *)random_null_func, + .source = RANDOM_PURE_BOGUS, /* Make sure this is in + * sys/random.h and is unique */ .read = random_example_read, - .write = (random_write_func_t *)random_null_func, - .reseed = (random_reseed_func_t *)random_null_func, - .seeded = 1, }; /* * Used under the license provided @ http://xkcd.com/221/ * http://creativecommons.org/licenses/by-nc/2.5/ */ -static u_char +static uint8_t getRandomNumber(void) { return 4; /* chosen by fair dice roll, guaranteed to be random */ @@ -64,14 +61,13 @@ getRandomNumber(void) static int random_example_read(void *buf, int c) { - u_char *b; + uint8_t *b; int count; b = buf; - for (count = 0; count < c; count++) { + for (count = 0; count < c; count++) b[count] = getRandomNumber(); - } printf("returning %d bytes of pure randomness\n", c); return (c); @@ -80,15 +76,26 @@ random_example_read(void *buf, int c) static int random_example_modevent(module_t mod, int type, void *unused) { + int error = 0; switch (type) { case MOD_LOAD: - random_adaptor_register(RNG_NAME, &random_example); - EVENTHANDLER_INVOKE(random_adaptor_attach, &random_example); - return (0); + live_entropy_source_register(&random_example); + break; + + case MOD_UNLOAD: + live_entropy_source_deregister(&random_example); + break; + + case MOD_SHUTDOWN: + break; + + default: + error = EOPNOTSUPP; + break; } - return (EINVAL); + return (error); } -RANDOM_ADAPTOR_MODULE(random_example, random_example_modevent, 1); +LIVE_ENTROPY_SRC_MODULE(live_entropy_source_example, random_example_modevent, 1); Modified: head/share/man/man4/random.4 ============================================================================== --- head/share/man/man4/random.4 Sat Oct 12 12:34:19 2013 (r256376) +++ head/share/man/man4/random.4 Sat Oct 12 12:57:57 2013 (r256377) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2001 Mark R V Murray. All rights reserved. +.\" Copyright (c) 2001-2013 Mark R V Murray. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2013 +.Dd October 12, 2013 .Dt RANDOM 4 .Os .Sh NAME @@ -43,35 +43,48 @@ The device will probe for certain hardware entropy sources, and use these in preference to the fallback, which is a generator implemented in software. -If the kernel environment MIB's -.Va hw.nehemiah_rng_enable -or -.Va hw.ivy_rng_enable -are set to -.Dq Li 0 , -the associated hardware entropy source will be ignored. -.Pp -If the device is using -the software generator, -writing data to -.Nm -would perturb the internal state. -This perturbation of the internal state -is the only userland method of introducing -extra entropy into the device. -If the writer has superuser privilege, -then closing the device after writing -will make the software generator reseed itself. -This can be used for extra security, -as it immediately introduces any/all new entropy -into the PRNG. -The hardware generators will generate -sufficient quantities of entropy, -and will therefore ignore user-supplied input. -The software -.Nm -device may be controlled with -.Xr sysctl 8 . +.Pp +The software generator will start in an +.Em unseeded +state, and will block reads until +it is (re)seeded. +This may cause trouble at system boot +when keys and the like +are generated from +/dev/random +so steps should be taken to ensure a +reseed as soon as possible. +The +.Xr sysctl 8 +controlling the +.Em seeded +status (see below) may be used +if security is not an issue +or for convenience +during setup or development. +.Pp +This initial seeding +of random number generators +is a bootstrapping problem +that needs very careful attention. +In some cases, +it may be difficult +to find enough randomness +to seed a random number generator +until a system is fully operational, +but the system requires random numbers +to become fully operational. +It is (or more accurately should be) +critically important that the +.Nm +device is seeded +before the first time it is used. +In the case where a dummy or "blocking-only" +device is used, +it is the responsibility +of the system architect +to ensure that no blocking reads +hold up critical processes. .Pp To see the current settings of the software .Nm @@ -81,22 +94,20 @@ device, use the command line: .Pp which results in something like: .Bd -literal -offset indent -kern.random.adaptors: yarrow +kern.random.adaptors: yarrow,dummy +kern.random.active_adaptor: yarrow +kern.random.yarrow.gengateinterval: 10 +kern.random.yarrow.bins: 10 +kern.random.yarrow.fastthresh: 96 +kern.random.yarrow.slowthresh: 128 +kern.random.yarrow.slowoverthresh: 2 kern.random.sys.seeded: 1 kern.random.sys.harvest.ethernet: 1 kern.random.sys.harvest.point_to_point: 1 kern.random.sys.harvest.interrupt: 1 -kern.random.sys.harvest.swi: 0 -kern.random.yarrow.gengateinterval: 10 -kern.random.yarrow.bins: 10 -kern.random.yarrow.fastthresh: 192 -kern.random.yarrow.slowthresh: 256 -kern.random.yarrow.slowoverthresh: 2 +kern.random.sys.harvest.swi: 1 .Ed .Pp -(These would not be seen if a -hardware generator is present.) -.Pp Other than .Dl kern.random.adaptors all settings are read/write. @@ -107,9 +118,10 @@ variable indicates whether or not the .Nm device is in an acceptably secure state as a result of reseeding. -If set to 0, the device will block (on read) until the next reseed -(which can be from an explicit write, -or as a result of entropy harvesting). +If set to 0, +the device will block (on read) +until the next reseed +as a result of entropy harvesting. A reseed will set the value to 1 (non-blocking). .Pp The @@ -276,19 +288,6 @@ the generator produce independent sequen However, the guessability or reproducibility of the sequence is unimportant, unlike the previous cases. .Pp -One final consideration for the seeding of random number generators -is a bootstrapping problem. -In some cases, it may be difficult to find enough randomness to -seed a random number generator until a system is fully operational, -but the system requires random numbers to become fully operational. -There is no substitute for careful thought here, -but the -.Fx -.Nm -device, -which is based on the Yarrow system, -should be of some help in this area. -.Pp .Fx does also provide the traditional .Xr rand 3 @@ -325,17 +324,7 @@ and is an implementation of the .Em Yarrow algorithm by Bruce Schneier, .Em et al . -The only hardware implementations -currently are for the -.Tn VIA C3 Nehemiah -(stepping 3 or greater) -CPU -and the -.Tn Intel -.Dq Bull Mountain -.Em RdRand -instruction and underlying random number generator (RNG). -More will be added in the future. +Significant infrastructure work was done by Arthur Mesh. .Pp The author gratefully acknowledges significant assistance from VIA Technologies, Inc. Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Sat Oct 12 12:34:19 2013 (r256376) +++ head/sys/boot/forth/loader.conf Sat Oct 12 12:57:57 2013 (r256377) @@ -39,6 +39,17 @@ bitmap_type="splash_image_data" # and pl ############################################################## +### Random number generator configuration ################### +############################################################## + +entropy_cache_load="NO" # Set this to YES to load entropy at boot time +entropy_cache_name="/boot/entropy" # Set this to the name of the file +entropy_cache_type="/boot/entropy" +#kern.random.sys.seeded="0" # Set this to 1 to start /dev/random + # without waiting for a (re)seed. + + +############################################################## ### Loader settings ######################################## ############################################################## Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Oct 12 12:34:19 2013 (r256376) +++ head/sys/conf/NOTES Sat Oct 12 12:57:57 2013 (r256377) @@ -2962,3 +2962,8 @@ options RCTL options BROOKTREE_ALLOC_PAGES=(217*4+1) options MAXFILES=999 +# Random number generator +options RANDOM_YARROW # Yarrow RNG +##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented +options RANDOM_DEBUG # Debugging messages +options RANDOM_RWFILE # Read and write entropy cache Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Oct 12 12:34:19 2013 (r256376) +++ head/sys/conf/files Sat Oct 12 12:57:57 2013 (r256377) @@ -2043,13 +2043,15 @@ rt2860.fw optional rt2860fw | ralfw \ no-obj no-implicit-rule \ clean "rt2860.fw" dev/random/harvest.c standard -dev/random/hash.c optional random -dev/random/pseudo_rng.c standard +dev/random/dummy_rng.c standard dev/random/random_adaptors.c standard -dev/random/random_harvestq.c standard +dev/random/live_entropy_sources.c optional random +dev/random/random_harvestq.c optional random dev/random/randomdev.c optional random dev/random/randomdev_soft.c optional random dev/random/yarrow.c optional random +dev/random/hash.c optional random +dev/random/rwfile.c optional random dev/rc/rc.c optional rc dev/re/if_re.c optional re dev/rndtest/rndtest.c optional rndtest Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sat Oct 12 12:34:19 2013 (r256376) +++ head/sys/conf/files.amd64 Sat Oct 12 12:57:57 2013 (r256377) @@ -259,8 +259,8 @@ dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa -dev/random/ivy.c optional random rdrand_rng -dev/random/nehemiah.c optional random padlock_rng +dev/random/ivy.c optional rdrand_rng +dev/random/nehemiah.c optional padlock_rng dev/qlxge/qls_dbg.c optional qlxge pci dev/qlxge/qls_dump.c optional qlxge pci dev/qlxge/qls_hw.c optional qlxge pci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sat Oct 12 12:34:19 2013 (r256376) +++ head/sys/conf/files.i386 Sat Oct 12 12:57:57 2013 (r256377) @@ -257,8 +257,8 @@ dev/nvme/nvme_test.c optional nvme dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa dev/pcf/pcf_isa.c optional pcf -dev/random/ivy.c optional random rdrand_rng -dev/random/nehemiah.c optional random padlock_rng +dev/random/ivy.c optional rdrand_rng +dev/random/nehemiah.c optional padlock_rng dev/sbni/if_sbni.c optional sbni dev/sbni/if_sbni_isa.c optional sbni isa dev/sbni/if_sbni_pci.c optional sbni pci Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Oct 12 12:34:19 2013 (r256376) +++ head/sys/conf/options Sat Oct 12 12:57:57 2013 (r256377) @@ -904,3 +904,9 @@ RACCT opt_global.h # Resource Limits RCTL opt_global.h + +# Random number generator(s) +RANDOM_YARROW opt_random.h +RANDOM_FORTUNA opt_random.h +RANDOM_DEBUG opt_random.h +RANDOM_RWFILE opt_random.h Modified: head/sys/dev/glxsb/glxsb.c ============================================================================== --- head/sys/dev/glxsb/glxsb.c Sat Oct 12 12:34:19 2013 (r256376) +++ head/sys/dev/glxsb/glxsb.c Sat Oct 12 12:57:57 2013 (r256377) @@ -476,7 +476,7 @@ glxsb_rnd(void *v) if (status & SB_RNS_TRNG_VALID) { value = bus_read_4(sc->sc_sr, SB_RANDOM_NUM); /* feed with one uint32 */ - random_harvest(&value, 4, 32/2, 0, RANDOM_PURE); + random_harvest(&value, 4, 32/2, RANDOM_PURE_GLXSB); } callout_reset(&sc->sc_rngco, sc->sc_rnghz, glxsb_rnd, sc); Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Sat Oct 12 12:34:19 2013 (r256376) +++ head/sys/dev/hifn/hifn7751.c Sat Oct 12 12:57:57 2013 (r256377) @@ -258,7 +258,7 @@ hifn_partname(struct hifn_softc *sc) static void default_harvest(struct rndtest_state *rsp, void *buf, u_int count) { - random_harvest(buf, count, count*NBBY/2, 0, RANDOM_PURE); + random_harvest(buf, count, count*NBBY/2, RANDOM_PURE_HIFN); } static u_int Copied: head/sys/dev/random/dummy_rng.c (from r256243, projects/random_number_generator/sys/dev/random/dummy_rng.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/dummy_rng.c Sat Oct 12 12:57:57 2013 (r256377, copy of r256243, projects/random_number_generator/sys/dev/random/dummy_rng.c) @@ -0,0 +1,123 @@ +/*- + * Copyright (c) 2013 Arthur Mesh + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +static struct mtx dummy_random_mtx; + +/* Used to fake out unused random calls in random_adaptor */ +static void +random_null_func(void) +{ +} + +static int +dummy_random_poll(int events __unused, struct thread *td __unused) +{ + + return (0); +} + +static int +dummy_random_block(int flag) +{ + int error = 0; + + mtx_lock(&dummy_random_mtx); + + /* Blocking logic */ + while (!error) { + if (flag & O_NONBLOCK) + error = EWOULDBLOCK; + else { + printf("random: dummy device blocking on read.\n"); + error = msleep(&dummy_random_block, + &dummy_random_mtx, + PUSER | PCATCH, "block", 0); + } + } + mtx_unlock(&dummy_random_mtx); + + return (error); +} + +static void +dummy_random_init(void) +{ + + mtx_init(&dummy_random_mtx, "sleep mtx for dummy_random", + NULL, MTX_DEF); +} + +static void +dummy_random_deinit(void) +{ + + mtx_destroy(&dummy_random_mtx); +} + +struct random_adaptor dummy_random = { + .ident = "Dummy entropy device that always blocks", + .init = dummy_random_init, + .deinit = dummy_random_deinit, + .block = dummy_random_block, + .poll = dummy_random_poll, + .read = (random_read_func_t *)random_null_func, + .reseed = (random_reseed_func_t *)random_null_func, + .seeded = 0, /* This device can never be seeded */ +}; + +static int +dummy_random_modevent(module_t mod __unused, int type, void *unused __unused) +{ + + switch (type) { + case MOD_LOAD: + random_adaptor_register("dummy", &dummy_random); + EVENTHANDLER_INVOKE(random_adaptor_attach, + &dummy_random); + + return (0); + } + + return (EINVAL); +} + +RANDOM_ADAPTOR_MODULE(dummy, dummy_random_modevent, 1); Modified: head/sys/dev/random/harvest.c ============================================================================== --- head/sys/dev/random/harvest.c Sat Oct 12 12:34:19 2013 (r256376) +++ head/sys/dev/random/harvest.c Sat Oct 12 12:57:57 2013 (r256377) @@ -48,20 +48,20 @@ __FBSDID("$FreeBSD$"); static int read_random_phony(void *, int); /* Structure holding the desired entropy sources */ -struct harvest_select harvest = { 1, 1, 1, 0 }; +struct harvest_select harvest = { 1, 1, 1, 1 }; static int warned = 0; /* hold the address of the routine which is actually called if * the randomdev is loaded */ -static void (*reap_func)(u_int64_t, const void *, u_int, u_int, u_int, +static void (*reap_func)(u_int64_t, const void *, u_int, u_int, enum esource) = NULL; static int (*read_func)(void *, int) = read_random_phony; /* Initialise the harvester at load time */ void randomdev_init_harvester(void (*reaper)(u_int64_t, const void *, u_int, - u_int, u_int, enum esource), int (*reader)(void *, int)) + u_int, enum esource), int (*reader)(void *, int)) { reap_func = reaper; read_func = reader; @@ -86,12 +86,10 @@ randomdev_deinit_harvester(void) * read which can be quite expensive. */ void -random_harvest(void *entropy, u_int count, u_int bits, u_int frac, - enum esource origin) +random_harvest(void *entropy, u_int count, u_int bits, enum esource origin) { if (reap_func) - (*reap_func)(get_cyclecount(), entropy, count, bits, frac, - origin); + (*reap_func)(get_cyclecount(), entropy, count, bits, origin); } /* Userland-visible version of read_random */ Modified: head/sys/dev/random/hash.h ============================================================================== --- head/sys/dev/random/hash.h Sat Oct 12 12:34:19 2013 (r256376) +++ head/sys/dev/random/hash.h Sat Oct 12 12:57:57 2013 (r256377) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef SYS_DEV_RANDOM_HASH_H_INCLUDED +#define SYS_DEV_RANDOM_HASH_H_INCLUDED + #define KEYSIZE 32 /* (in bytes) == 256 bits */ #define BLOCKSIZE 16 /* (in bytes) == 128 bits */ @@ -43,3 +46,5 @@ void randomdev_hash_iterate(struct rando void randomdev_hash_finish(struct randomdev_hash *, void *); void randomdev_encrypt_init(struct randomdev_key *, void *); void randomdev_encrypt(struct randomdev_key *context, void *, void *, unsigned); + +#endif Modified: head/sys/dev/random/ivy.c ============================================================================== --- head/sys/dev/random/ivy.c Sat Oct 12 12:34:19 2013 (r256376) +++ head/sys/dev/random/ivy.c Sat Oct 12 12:57:57 2013 (r256377) @@ -30,38 +30,35 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include +#include #include -#include +#include #include #include #include #include -#include #include +#include +#include +#include +#include #define RETRY_COUNT 10 -static void random_ivy_init(void); -static void random_ivy_deinit(void); static int random_ivy_read(void *, int); -struct random_adaptor random_ivy = { +static struct random_hardware_source random_ivy = { .ident = "Hardware, Intel IvyBridge+ RNG", - .init = random_ivy_init, - .deinit = random_ivy_deinit, - .read = random_ivy_read, - .write = (random_write_func_t *)random_null_func, - .reseed = (random_reseed_func_t *)random_null_func, - .seeded = 1, + .source = RANDOM_PURE_RDRAND, + .read = random_ivy_read }; static inline int -ivy_rng_store(long *tmp) +ivy_rng_store(uint64_t *tmp) { #ifdef __GNUCLIKE_ASM uint32_t count; @@ -86,34 +83,26 @@ ivy_rng_store(long *tmp) #endif } -static void -random_ivy_init(void) -{ -} - -void -random_ivy_deinit(void) -{ -} - static int random_ivy_read(void *buf, int c) { - char *b; - long tmp; - int count, res, retry; + uint8_t *b; + int count, ret, retry; + uint64_t tmp; - for (count = c, b = buf; count > 0; count -= res, b += res) { + b = buf; + for (count = c; count > 0; count -= ret) { for (retry = 0; retry < RETRY_COUNT; retry++) { - res = ivy_rng_store(&tmp); - if (res != 0) + ret = ivy_rng_store(&tmp); + if (ret != 0) break; } - if (res == 0) + if (ret == 0) break; - if (res > count) - res = count; - memcpy(b, &tmp, res); + if (ret > count) + ret = count; + memcpy(b, &tmp, ret); + b += ret; } return (c - count); } @@ -121,25 +110,35 @@ random_ivy_read(void *buf, int c) static int rdrand_modevent(module_t mod, int type, void *unused) { + int error = 0; switch (type) { case MOD_LOAD: - if (cpu_feature2 & CPUID2_RDRAND) { - random_adaptor_register("rdrand", &random_ivy); - EVENTHANDLER_INVOKE(random_adaptor_attach, &random_ivy); - return (0); - } else { + if (cpu_feature2 & CPUID2_RDRAND) + live_entropy_source_register(&random_ivy); + else #ifndef KLD_MODULE if (bootverbose) #endif - printf( - "%s: RDRAND feature is not present on this CPU\n", + printf("%s: RDRAND is not present\n", random_ivy.ident); - return (0); - } + break; + + case MOD_UNLOAD: + if (cpu_feature2 & CPUID2_RDRAND) + live_entropy_source_deregister(&random_ivy); + break; + + case MOD_SHUTDOWN: + break; + + default: + error = EOPNOTSUPP; + break; + } - return (EINVAL); + return (error); } -RANDOM_ADAPTOR_MODULE(random_rdrand, rdrand_modevent, 1); +LIVE_ENTROPY_SRC_MODULE(random_rdrand, rdrand_modevent, 1); Copied: head/sys/dev/random/live_entropy_sources.c (from r256243, projects/random_number_generator/sys/dev/random/live_entropy_sources.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/live_entropy_sources.c Sat Oct 12 12:57:57 2013 (r256377, copy of r256243, projects/random_number_generator/sys/dev/random/live_entropy_sources.c) @@ -0,0 +1,195 @@ +/*- + * Copyright (c) 2013 Arthur Mesh + * Copyright (c) 2013 Mark R V Murray + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include "live_entropy_sources.h" + +LIST_HEAD(les_head, live_entropy_sources); +static struct les_head sources = LIST_HEAD_INITIALIZER(sources); + +/* + * The live_lock protects the consistency of the "struct les_head sources" + */ +static struct sx les_lock; /* need a sleepable lock */ + +void +live_entropy_source_register(struct random_hardware_source *rsource) +{ + struct live_entropy_sources *les; + + KASSERT(rsource != NULL, ("invalid input to %s", __func__)); + + les = malloc(sizeof(struct live_entropy_sources), M_ENTROPY, M_WAITOK); + les->rsource = rsource; + + sx_xlock(&les_lock); + LIST_INSERT_HEAD(&sources, les, entries); + sx_xunlock(&les_lock); +} + +void +live_entropy_source_deregister(struct random_hardware_source *rsource) +{ + struct live_entropy_sources *les = NULL; + + KASSERT(rsource != NULL, ("invalid input to %s", __func__)); + + sx_xlock(&les_lock); + LIST_FOREACH(les, &sources, entries) + if (les->rsource == rsource) { + LIST_REMOVE(les, entries); + break; + } + sx_xunlock(&les_lock); + if (les != NULL) + free(les, M_ENTROPY); +} + +static int +live_entropy_source_handler(SYSCTL_HANDLER_ARGS) +{ + struct live_entropy_sources *les; + int error, count; + + count = error = 0; + + sx_slock(&les_lock); + + if (LIST_EMPTY(&sources)) + error = SYSCTL_OUT(req, "", 0); + else { + LIST_FOREACH(les, &sources, entries) { + + error = SYSCTL_OUT(req, ",", count++ ? 1 : 0); + if (error) + break; + + error = SYSCTL_OUT(req, les->rsource->ident, strlen(les->rsource->ident)); + if (error) + break; + } + } + + sx_sunlock(&les_lock); + + return (error); +} + +static void +live_entropy_sources_init(void *unused) +{ + + SYSCTL_PROC(_kern_random, OID_AUTO, live_entropy_sources, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, live_entropy_source_handler, "", + "List of Active Live Entropy Sources"); + + sx_init(&les_lock, "live_entropy_sources"); +} + +/* + * Run through all "live" sources reading entropy for the given + * number of rounds, which should be a multiple of the number + * of entropy accumulation pools in use; 2 for Yarrow and 32 + * for Fortuna. + * + * BEWARE!!! + * This function runs inside the RNG thread! Don't do anything silly! + * Remember that we are NOT holding harvest_mtx on entry! + */ +void +live_entropy_sources_feed(int rounds, event_proc_f entropy_processor) +{ + static struct harvest event; + static uint8_t buf[HARVESTSIZE]; + struct live_entropy_sources *les; + int i, n; + + sx_slock(&les_lock); + + /* + * Walk over all of live entropy sources, and feed their output + * to the system-wide RNG. + */ + LIST_FOREACH(les, &sources, entries) { + + for (i = 0; i < rounds; i++) { + /* + * This should be quick, since it's a live entropy + * source. + */ + /* FIXME: Whine loudly if this didn't work. */ + n = les->rsource->read(buf, sizeof(buf)); + n = MIN(n, HARVESTSIZE); + + event.somecounter = get_cyclecount(); + event.size = n; + event.bits = (n*8)/2; + event.source = les->rsource->source; + memcpy(event.entropy, buf, n); + + /* Do the actual entropy insertion */ + entropy_processor(&event); + } + + } + + sx_sunlock(&les_lock); +} + +static void +live_entropy_sources_deinit(void *unused) +{ + + sx_destroy(&les_lock); +} + +SYSINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, + live_entropy_sources_init, NULL); +SYSUNINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, + live_entropy_sources_deinit, NULL); Copied: head/sys/dev/random/live_entropy_sources.h (from r256243, projects/random_number_generator/sys/dev/random/live_entropy_sources.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/live_entropy_sources.h Sat Oct 12 12:57:57 2013 (r256377, copy of r256243, projects/random_number_generator/sys/dev/random/live_entropy_sources.h) @@ -0,0 +1,60 @@ +/*- + * Copyright (c) 2013 Arthur Mesh + * Copyright (c) 2013 Mark R V Murray + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 14:32:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E21462C9; Sat, 12 Oct 2013 14:32:33 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A7B00201B; Sat, 12 Oct 2013 14:32:33 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa01.fnfis.com (8.14.5/8.14.5) with ESMTP id r9CEWWbv024950 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 12 Oct 2013 09:32:32 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.103]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.02.0309.002; Sat, 12 Oct 2013 09:32:31 -0500 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r256343 - in head/usr.sbin/bsdinstall: . scripts Thread-Topic: svn commit: r256343 - in head/usr.sbin/bsdinstall: . scripts Thread-Index: AQHOx1fhW1uGCLtcyE2zUcTOTrV8Ig== Date: Sat, 12 Oct 2013 14:32:30 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D720FC5B547@LTCFISWMSGMB21.FNFIS.com> References: <201310112041.r9BKfZeT002056@svn.freebsd.org> <5258F9B3.7030101@freebsd.org> In-Reply-To: <5258F9B3.7030101@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="us-ascii" Content-ID: <86D4791B6C32274EB129346A2EC7E17C@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-10-12_01:2013-10-11,2013-10-12,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Oct 2013 14:32:34 -0000 On Oct 12, 2013, at 12:26 AM, Nathan Whitehorn wrote: > On 10/11/13 22:41, Devin Teske wrote: >> Author: dteske >> Date: Fri Oct 11 20:41:35 2013 >> New Revision: 256343 >> URL: https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.freebsd.= org/changeset/base/256343&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs6= vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DLDzuPpXPP4D5BzfISZjw%2BXitYn4aKVzfXzcrmM= NFo2U%3D%0A&s=3D3d0963d9c497f7bad0918888032ca62844580612dc48ab3a8a6768fe640= c365b >>=20 >> Log: >> Add zfsboot module as an option for automatic configuration. Default is >> to run interactively but it can be scripted too (optinally completely >> non-interactive). Currently supports GELI and all ZFS vdev types. Also >> performs validation on selections/settings providing error messages if >> necessary, explaining (in plain language) what the issue is. Currently >> the auto partitioning of naked disks only supports GPT and MBR (VTOC8 >> pending for sparc64), so is only available for i386/amd64 install. >>=20 >> Submitted by: Allan Jude , myself >> Reviewed by: Allan Jude >> Approved by: re (glebius) >=20 > Hi Devin -- >=20 > As was discussed on the mailing list, this patch still has some issues > that need to be resolved, for example the use of camcontrol > unconditionally even when the disks may not be CAM and destruction of > existing sub-partitioning for MBR disks. The code to replace the use of camcontrol is a a *very* complex parsing of the geom XML configuration data stashed in sysctl. jmg@ started the ball rolling on that. > There were some others brought > up in the discussion as well. I am surprised you committed it, Calm down. The camcontrol functionality is a value-add and *not* the sole provision for getting descriptions of the disk. jmg@ dumped a beautiful (but needs cleaning up for integration and optimization -- not bad for the fact that he wrote in ... a day!) piece of = code on me that can parse the XML geom data from sysctl. Unfortunately, it needs some heavy integration. So while you bring up this short-coming... _others_ have already kindly chimed in to help. The likelihood that it will be fixed before 10.0-R is extremely high. You can calm down. > especially to stable/10, before those issues were resolved. Uh... I don't know how to respond to that. I'm going to ignore that (completely). > I'm also not > sure if people can review their own patches. >=20 He didn't... it should have been "In collaboration with". Allan submitted something. I completely rewrote it, and he reviewed what *I= * wrote. > Installer regressions are very easy to introduce and very problematic Don't I know (looks at *you*) > when created. Real review for installer changes is thus especially > important this late in the release cycle. Using camcontrol is not the end of the world -- even if the code is read-on= ly to you... you should be able to ... "read it?" > Do you have any plans to fix > these issues in the very near future? Yes. Which has been discussed at-length, you didn't need to put a sandbag o= n my back (publicly no less; thanks for that). --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 14:54:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 17D45549; Sat, 12 Oct 2013 14:54:26 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 049572101; Sat, 12 Oct 2013 14:54:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CEsPe1067352; Sat, 12 Oct 2013 14:54:25 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CEsPuP067350; Sat, 12 Oct 2013 14:54:25 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310121454.r9CEsPuP067350@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 12 Oct 2013 14:54: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: r256380 - stable/8/libexec/fingerd 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, 12 Oct 2013 14:54:26 -0000 Author: des Date: Sat Oct 12 14:54:25 2013 New Revision: 256380 URL: http://svnweb.freebsd.org/changeset/base/256380 Log: MFH (206038,206040): add a -k option which is passed through to finger(1). Almost to the day three and a half years after the original MFC date... Modified: stable/8/libexec/fingerd/fingerd.8 stable/8/libexec/fingerd/fingerd.c Directory Properties: stable/8/libexec/fingerd/ (props changed) Modified: stable/8/libexec/fingerd/fingerd.8 ============================================================================== --- stable/8/libexec/fingerd/fingerd.8 Sat Oct 12 14:23:33 2013 (r256379) +++ stable/8/libexec/fingerd/fingerd.8 Sat Oct 12 14:54:25 2013 (r256380) @@ -32,7 +32,7 @@ .\" @(#)fingerd.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd April 1, 2010 .Dt FINGERD 8 .Os .Sh NAME @@ -40,6 +40,8 @@ .Nd remote user information server .Sh SYNOPSIS .Nm +.Op Fl d +.Op Fl k .Op Fl s .Op Fl l .Op Fl p Ar filename @@ -106,6 +108,25 @@ The following options may be passed to as server program arguments in .Pa /etc/inetd.conf : .Bl -tag -width indent +.It Fl d +Enable debugging mode. +In debugging mode, +.Nm +will not attempt any network-related operations on +.Va stdin , +and it will print the full +.Nm finger +command line +to +.Va stderr +before executing it. +.It Fl k +Suppress login information. +See the description of the +.Fl k +option in +.Xr finger 1 +for details. .It Fl s Enable secure mode. Queries without a user name are rejected and Modified: stable/8/libexec/fingerd/fingerd.c ============================================================================== --- stable/8/libexec/fingerd/fingerd.c Sat Oct 12 14:23:33 2013 (r256379) +++ stable/8/libexec/fingerd/fingerd.c Sat Oct 12 14:54:25 2013 (r256380) @@ -72,17 +72,23 @@ main(int argc, char *argv[]) char *lp; struct sockaddr_storage ss; socklen_t sval; - int p[2], logging, pflag, secure; + int p[2], debug, kflag, logging, pflag, secure; #define ENTRIES 50 char **ap, *av[ENTRIES + 1], **comp, line[1024], *prog; char rhost[MAXHOSTNAMELEN]; prog = _PATH_FINGER; - logging = pflag = secure = 0; + debug = logging = kflag = pflag = secure = 0; openlog("fingerd", LOG_PID | LOG_CONS, LOG_DAEMON); opterr = 0; - while ((ch = getopt(argc, argv, "lp:s")) != -1) + while ((ch = getopt(argc, argv, "dklp:s")) != -1) switch (ch) { + case 'd': + debug = 1; + break; + case 'k': + kflag = 1; + break; case 'l': logging = 1; break; @@ -101,7 +107,7 @@ main(int argc, char *argv[]) /* * Enable server-side Transaction TCP. */ - { + if (!debug) { int one = 1; if (setsockopt(STDOUT_FILENO, IPPROTO_TCP, TCP_NOPUSH, &one, sizeof one) < 0) { @@ -112,7 +118,7 @@ main(int argc, char *argv[]) if (!fgets(line, sizeof(line), stdin)) exit(1); - if (logging || pflag) { + if (!debug && (logging || pflag)) { sval = sizeof(ss); if (getpeername(0, (struct sockaddr *)&ss, &sval) < 0) logerr("getpeername: %s", strerror(errno)); @@ -143,12 +149,14 @@ main(int argc, char *argv[]) syslog(LOG_NOTICE, "query from %s: `%s'", rhost, t); } - comp = &av[1]; - av[2] = "--"; - for (lp = line, ap = &av[3];;) { + comp = &av[2]; + av[3] = "--"; + if (kflag) + *comp-- = "-k"; + for (lp = line, ap = &av[4];;) { *ap = strtok(lp, " \t\r\n"); if (!*ap) { - if (secure && ap == &av[3]) { + if (secure && ap == &av[4]) { puts("must provide username\r\n"); exit(1); } @@ -161,8 +169,7 @@ main(int argc, char *argv[]) /* RFC742: "/[Ww]" == "-l" */ if ((*ap)[0] == '/' && ((*ap)[1] == 'W' || (*ap)[1] == 'w')) { - av[1] = "-l"; - comp = &av[0]; + *comp-- = "-l"; } else if (++ap == av + ENTRIES) { *ap = NULL; @@ -178,6 +185,13 @@ main(int argc, char *argv[]) if (pipe(p) < 0) logerr("pipe: %s", strerror(errno)); + if (debug) { + fprintf(stderr, "%s", prog); + for (ap = comp; *ap != NULL; ++ap) + fprintf(stderr, " %s", *ap); + fprintf(stderr, "\n"); + } + switch(vfork()) { case 0: (void)close(p[0]); From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 15:03:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3CF707D5; Sat, 12 Oct 2013 15:03:48 +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 ED845216E; Sat, 12 Oct 2013 15:03:47 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id F204A6459; Sat, 12 Oct 2013 15:03:46 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 8359451407; Sat, 12 Oct 2013 17:03:42 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Devin Teske Subject: Re: svn commit: r256343 - in head/usr.sbin/bsdinstall: . scripts References: <201310112041.r9BKfZeT002056@svn.freebsd.org> <5258F9B3.7030101@freebsd.org> <13CA24D6AB415D428143D44749F57D720FC5B547@LTCFISWMSGMB21.FNFIS.com> Date: Sat, 12 Oct 2013 17:03:42 +0200 In-Reply-To: <13CA24D6AB415D428143D44749F57D720FC5B547@LTCFISWMSGMB21.FNFIS.com> (Devin Teske's message of "Sat, 12 Oct 2013 14:32:30 +0000") Message-ID: <86txgmr0oh.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Nathan Whitehorn , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 15:03:48 -0000 "Teske, Devin" writes: > The code to replace the use of camcontrol is a a *very* complex parsing > of the geom XML configuration data stashed in sysctl. jmg@ started the > ball rolling on that. You realize there is a text version as well? > Yes. Which has been discussed at-length, you didn't need to put a > sandbag on my back (publicly no less; thanks for that). Umm, I think Nathan was pretty civil. You're the one who's turning this into a catfight. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 15:10:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5C216B05; Sat, 12 Oct 2013 15:10:28 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2439521BE; Sat, 12 Oct 2013 15:10:27 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa04.fnfis.com (8.14.5/8.14.5) with ESMTP id r9CFAQ7R029115 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 12 Oct 2013 10:10:26 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.103]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.02.0309.002; Sat, 12 Oct 2013 10:10:25 -0500 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r256343 - in head/usr.sbin/bsdinstall: . scripts Thread-Topic: svn commit: r256343 - in head/usr.sbin/bsdinstall: . scripts Thread-Index: AQHOx1fhW1uGCLtcyE2zUcTOTrV8Ipnxf3yA Date: Sat, 12 Oct 2013 15:10:25 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D720FC5B7DF@LTCFISWMSGMB21.FNFIS.com> References: <201310112041.r9BKfZeT002056@svn.freebsd.org> <5258F9B3.7030101@freebsd.org> <13CA24D6AB415D428143D44749F57D720FC5B547@LTCFISWMSGMB21.FNFIS.com> In-Reply-To: <13CA24D6AB415D428143D44749F57D720FC5B547@LTCFISWMSGMB21.FNFIS.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="us-ascii" Content-ID: <2FCA3AF8EDFF234993F0E04216825DBE@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-10-12_01:2013-10-11,2013-10-12,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Oct 2013 15:10:28 -0000 [snip] >=20 >> Installer regressions are very easy to introduce and very problematic >=20 > Don't I know (looks at *you*) >=20 >=20 >=20 >> when created. Real review for installer changes is thus especially >> important this late in the release cycle. >=20 > Using camcontrol is not the end of the world -- even if the code is read-= only to you... > you should be able to ... "read it?" >=20 >=20 >> Do you have any plans to fix >> these issues in the very near future? >=20 > Yes. Which has been discussed at-length, you didn't need to put a sandbag= on my back > (publicly no less; thanks for that). I apologize... I should have gone on to explain that... The use of camcontrol is protected by a conditional block making use of the= f_have() function which means if you rip out camcontrol completely (in any way resul= ting in the binary being absent) then the value-add potentially provided by camcontrol = is silently skipped as the utility is not available. So let's say you don't have camcontrol(8) in the media, *or* say that you h= ave a kernel lacking CAM knobs... No problem. I could have completely omitted the camcontrol value-add, ... what we had a= lready was sufficient enough to describe disks. It was only upon Allan's testing that he noticed that the labels could be..= . better ;D So I went scrounging for something that could supersede the description of = a `da0' that would satisfy Allan, and I found it in camcontrol -- his testing confi= rmed. I don't know if he was using a kernel enhanced with CAM through custom conf= iguration or if he was using everything stock... and I could ask him... but it appear= ed to be working *and* I protected it with f_have() so in the event that it doesn't work for every= one... no biggie... the descriptions will be as they were before the value-add (still there, bu= t not as accurate as they could be... enter jmg@ and a parsing of geom later). I think of all people, you should understand that if something doesn't intr= oduce a blocker, but lacks a particular value-add (in this case, geom parsing), then it shou= ld be OK to proceed (I'm not harping on you, but I'm specifically calling out that bsdi= nstall did not implement everything needed by VICOR "out of the box"; so we're still on 8.= x because we rely on much functionality in sysinstall that bsdinstall doesn't impleme= nt). So I'm a bit shocked to see you coming down so hard on this commit. It will be addressed, but I also had to first address jilles@ Integer Overf= low statement (I _on purpose_ committed the code we had because it had to go in, and then= *very* quickly followed it up with a fix to the integer overflow detection). You'r= e next in-line, but the geom parsing may not make it in until BETA2 (I honestly need a brea= k from that last round of commits... it took me a solid week of sleepless nights -- the= wife and I would like some time together, please). In light of that last paragraph... we're all Human... and what we do is vol= unteer. So I can't harp on you legitimately for any short-comings. But I do request a little s= lack considering I didn't break anything and this is *not* that serious in the grand scheme = of things. There are no regressions that I can see which you speak of. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 15:21:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EA35AF3D; Sat, 12 Oct 2013 15:21:07 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AFB62224D; Sat, 12 Oct 2013 15:21:07 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.31]) by ltcfislmsgpa03.fnfis.com (8.14.5/8.14.5) with ESMTP id r9CFL5hl020216 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 12 Oct 2013 10:21:05 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.103]) by LTCFISWMSGHT03.FNFIS.com ([10.132.206.31]) with mapi id 14.02.0309.002; Sat, 12 Oct 2013 10:21:03 -0500 From: "Teske, Devin" To: =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= Subject: Re: svn commit: r256343 - in head/usr.sbin/bsdinstall: . scripts Thread-Topic: svn commit: r256343 - in head/usr.sbin/bsdinstall: . scripts Thread-Index: AQHOx1fhW1uGCLtcyE2zUcTOTrV8Ig== Date: Sat, 12 Oct 2013 15:21:03 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D720FC5B8F1@LTCFISWMSGMB21.FNFIS.com> References: <201310112041.r9BKfZeT002056@svn.freebsd.org> <5258F9B3.7030101@freebsd.org> <13CA24D6AB415D428143D44749F57D720FC5B547@LTCFISWMSGMB21.FNFIS.com> <86txgmr0oh.fsf@nine.des.no> In-Reply-To: <86txgmr0oh.fsf@nine.des.no> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-10-12_01:2013-10-11,2013-10-12,1970-01-01 signatures=0 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "Teske, Devin" , Nathan Whitehorn , "svn-src-head@freebsd.org" , Devin Teske X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Oct 2013 15:21:08 -0000 On Oct 12, 2013, at 8:03 AM, Dag-Erling Sm=F8rgrav wrote: > "Teske, Devin" writes: >> The code to replace the use of camcontrol is a a *very* complex parsing >> of the geom XML configuration data stashed in sysctl. jmg@ started the >> ball rolling on that. >=20 > You realize there is a text version as well? >=20 >> Yes. Which has been discussed at-length, you didn't need to put a >> sandbag on my back (publicly no less; thanks for that). >=20 > Umm, I think Nathan was pretty civil. You're the one who's turning this > into a catfight. >=20 Reflecting upon the thread to see if you're _right_... 1. He stated there were still some issues. [definitely civil] 2. "I am surprised you committed it especially to stable/10, before those issues were resolved." [civil? or inflammatory?] 3. "I'm also not sure if people can review their own patches." [misundersta= nding] 4. "Installer regressions are very easy to introduce and very problematic when created." [statements like that invariably lead people to believe he v= iews the commit as a regression -- I explained in a follow-up that it is not a r= egression] 5. "Real review for installer changes is thus especially important this lat= e in the release cycle." [I read this invariably as he views that the commit did not= go through "Real review", but again... there is no regression and it's purely = value- add] 6. "Do you have any plans to fix these issues in the very near future?" [de= finitely civil] What got me ralled up was #'s 2, 4, and 5. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 15:31:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5AEC0223; Sat, 12 Oct 2013 15:31:40 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 443AD22D9; Sat, 12 Oct 2013 15:31:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CFVeBI088369; Sat, 12 Oct 2013 15:31:40 GMT (envelope-from markm@svn.freebsd.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CFVa86088259; Sat, 12 Oct 2013 15:31:36 GMT (envelope-from markm@svn.freebsd.org) Message-Id: <201310121531.r9CFVa86088259@svn.freebsd.org> From: Mark Murray Date: Sat, 12 Oct 2013 15:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256381 - in stable/10: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 15:31:40 -0000 Author: markm Date: Sat Oct 12 15:31:36 2013 New Revision: 256381 URL: http://svnweb.freebsd.org/changeset/base/256381 Log: Merge from project branch via main. Uninteresting commits are trimmed. Refactor of /dev/random device. Main points include: * Userland seeding is no longer used. This auto-seeds at boot time on PC/Desktop setups; this may need some tweeking and intelligence from those folks setting up embedded boxes, but the work is believed to be minimal. * An entropy cache is written to /entropy (even during installation) and the kernel uses this at next boot. * An entropy file written to /boot/entropy can be loaded by loader(8) * Hardware sources such as rdrand are fed into Yarrow, and are no longer available raw. ------------------------------------------------------------------------ r256240 | des | 2013-10-09 21:14:16 +0100 (Wed, 09 Oct 2013) | 4 lines Add a RANDOM_RWFILE option and hide the entropy cache code behind it. Rename YARROW_RNG and FORTUNA_RNG to RANDOM_YARROW and RANDOM_FORTUNA. Add the RANDOM_* options to LINT. ------------------------------------------------------------------------ r256239 | des | 2013-10-09 21:12:59 +0100 (Wed, 09 Oct 2013) | 2 lines Define RANDOM_PURE_RNDTEST for rndtest(4). ------------------------------------------------------------------------ r256204 | des | 2013-10-09 18:51:38 +0100 (Wed, 09 Oct 2013) | 2 lines staticize struct random_hardware_source ------------------------------------------------------------------------ r256203 | markm | 2013-10-09 18:50:36 +0100 (Wed, 09 Oct 2013) | 2 lines Wrap some policy-rich code in 'if NOTYET' until we can thresh out what it really needs to do. ------------------------------------------------------------------------ r256184 | des | 2013-10-09 10:13:12 +0100 (Wed, 09 Oct 2013) | 2 lines Re-add /dev/urandom for compatibility purposes. ------------------------------------------------------------------------ r256182 | des | 2013-10-09 10:11:14 +0100 (Wed, 09 Oct 2013) | 3 lines Add missing include guards and move the existing ones out of the implementation namespace. ------------------------------------------------------------------------ r256168 | markm | 2013-10-08 23:14:07 +0100 (Tue, 08 Oct 2013) | 10 lines Fix some just-noticed problems: o Allow this to work with "nodevice random" by fixing where the MALLOC pool is defined. o Fix the explicit reseed code. This was correct as submitted, but in the project branch doesn't need to set the "seeded" bit as this is done correctly in the "unblock" function. o Remove some debug ifdeffing. o Adjust comments. ------------------------------------------------------------------------ r256159 | markm | 2013-10-08 19:48:11 +0100 (Tue, 08 Oct 2013) | 6 lines Time to eat crow for me. I replaced the sx_* locks that Arthur used with regular mutexes; this turned out the be the wrong thing to do as the locks need to be sleepable. Revert this folly. # Submitted by: Arthur Mesh (In original diff) ------------------------------------------------------------------------ r256138 | des | 2013-10-08 12:05:26 +0100 (Tue, 08 Oct 2013) | 10 lines Add YARROW_RNG and FORTUNA_RNG to sys/conf/options. Add a SYSINIT that forces a reseed during proc0 setup, which happens fairly late in the boot process. Add a RANDOM_DEBUG option which enables some debugging printf()s. Add a new RANDOM_ATTACH entropy source which harvests entropy from the get_cyclecount() delta across each call to a device attach method. ------------------------------------------------------------------------ r256135 | markm | 2013-10-08 07:54:52 +0100 (Tue, 08 Oct 2013) | 8 lines Debugging. My attempt at EVENTHANDLER(multiuser) was a failure; use EVENTHANDLER(mountroot) instead. This means we can't count on /var being present, so something will need to be done about harvesting /var/db/entropy/... . Some policy now needs to be sorted out, and a pre-sync cache needs to be written, but apart from that we are now ready to go. Over to review. ------------------------------------------------------------------------ r256094 | markm | 2013-10-06 23:45:02 +0100 (Sun, 06 Oct 2013) | 8 lines Snapshot. Looking pretty good; this mostly works now. New code includes: * Read cached entropy at startup, both from files and from loader(8) preloaded entropy. Failures are soft, but announced. Untested. * Use EVENTHANDLER to do above just before we go multiuser. Untested. ------------------------------------------------------------------------ r256088 | markm | 2013-10-06 14:01:42 +0100 (Sun, 06 Oct 2013) | 2 lines Fix up the man page for random(4). This mainly removes no-longer-relevant details about HW RNGs, reseeding explicitly and user-supplied entropy. ------------------------------------------------------------------------ r256087 | markm | 2013-10-06 13:43:42 +0100 (Sun, 06 Oct 2013) | 6 lines As userland writing to /dev/random is no more, remove the "better than nothing" bootstrap mode. Add SWI harvesting to the mix. My box seeds Yarrow by itself in a few seconds! YMMV; more to follow. ------------------------------------------------------------------------ r256086 | markm | 2013-10-06 13:40:32 +0100 (Sun, 06 Oct 2013) | 11 lines Debug run. This now works, except that the "live" sources haven't been tested. With all sources turned on, this unlocks itself in a couple of seconds! That is no my box, and there is no guarantee that this will be the case everywhere. * Cut debug prints. * Use the same locks/mutexes all the way through. * Be a tad more conservative about entropy estimates. ------------------------------------------------------------------------ r256084 | markm | 2013-10-06 13:35:29 +0100 (Sun, 06 Oct 2013) | 5 lines Don't use the "real" assembler mnemonics; older compilers may not understand them (like when building CURRENT on 9.x). # Submitted by: Konstantin Belousov ------------------------------------------------------------------------ r256081 | markm | 2013-10-06 10:55:28 +0100 (Sun, 06 Oct 2013) | 12 lines SNAPSHOT. Simplify the malloc pools; We only need one for this device. Simplify the harvest queue. Marginally improve the entropy pool hashing, making it a bit faster in the process. Connect up the hardware "live" source harvesting. This is simplistic for now, and will need to be made rate-adaptive. All of the above passes a compile test but needs to be debugged. ------------------------------------------------------------------------ r256042 | markm | 2013-10-04 07:55:06 +0100 (Fri, 04 Oct 2013) | 25 lines Snapshot. This passes the build test, but has not yet been finished or debugged. Contains: * Refactor the hardware RNG CPU instruction sources to feed into the software mixer. This is unfinished. The actual harvesting needs to be sorted out. Modified by me (see below). * Remove 'frac' parameter from random_harvest(). This was never used and adds extra code for no good reason. * Remove device write entropy harvesting. This provided a weak attack vector, was not very good at bootstrapping the device. To follow will be a replacement explicit reseed knob. * Separate out all the RANDOM_PURE sources into separate harvest entities. This adds some secuity in the case where more than one is present. * Review all the code and fix anything obviously messy or inconsistent. Address som review concerns while I'm here, like rename the pseudo-rng to 'dummy'. # Submitted by: Arthur Mesh (the first item) ------------------------------------------------------------------------ r255319 | markm | 2013-09-06 18:51:52 +0100 (Fri, 06 Sep 2013) | 4 lines Yarrow wants entropy estimations to be conservative; the usual idea is that if you are certain you have N bits of entropy, you declare N/2. ------------------------------------------------------------------------ r255075 | markm | 2013-08-30 18:47:53 +0100 (Fri, 30 Aug 2013) | 4 lines Remove short-lived idea; thread to harvest (eg) RDRAND enropy into the usual harvest queues. It was a nifty idea, but too heavyweight. # Submitted by: Arthur Mesh ------------------------------------------------------------------------ r255071 | markm | 2013-08-30 12:42:57 +0100 (Fri, 30 Aug 2013) | 4 lines Separate out the Software RNG entropy harvesting queue and thread into its own files. # Submitted by: Arthur Mesh ------------------------------------------------------------------------ r254934 | markm | 2013-08-26 20:07:03 +0100 (Mon, 26 Aug 2013) | 2 lines Remove the short-lived namei experiment. ------------------------------------------------------------------------ r254928 | markm | 2013-08-26 19:35:21 +0100 (Mon, 26 Aug 2013) | 2 lines Snapshot; Do some running repairs on entropy harvesting. More needs to follow. ------------------------------------------------------------------------ r254927 | markm | 2013-08-26 19:29:51 +0100 (Mon, 26 Aug 2013) | 15 lines Snapshot of current work; 1) Clean up namespace; only use "Yarrow" where it is Yarrow-specific or close enough to the Yarrow algorithm. For the rest use a neutral name. 2) Tidy up headers; put private stuff in private places. More could be done here. 3) Streamline the hashing/encryption; no need for a 256-bit counter; 128 bits will last for long enough. There are bits of debug code lying around; these will be removed at a later stage. ------------------------------------------------------------------------ r254784 | markm | 2013-08-24 14:54:56 +0100 (Sat, 24 Aug 2013) | 39 lines 1) example (partially humorous random_adaptor, that I call "EXAMPLE") * It's not meant to be used in a real system, it's there to show how the basics of how to create interfaces for random_adaptors. Perhaps it should belong in a manual page 2) Move probe.c's functionality in to random_adaptors.c * rename random_ident_hardware() to random_adaptor_choose() 3) Introduce a new way to choose (or select) random_adaptors via tunable "rngs_want" It's a list of comma separated names of adaptors, ordered by preferences. I.e.: rngs_want="yarrow,rdrand" Such setting would cause yarrow to be preferred to rdrand. If neither of them are available (or registered), then system will default to something reasonable (currently yarrow). If yarrow is not present, then we fall back to the adaptor that's first on the list of registered adaptors. 4) Introduce a way where RNGs can play a role of entropy source. This is mostly useful for HW rngs. The way I envision this is that every HW RNG will use this functionality by default. Functionality to disable this is also present. I have an example of how to use this in random_adaptor_example.c (see modload event, and init function) 5) fix kern.random.adaptors from kern.random.adaptors: yarrowpanicblock to kern.random.adaptors: yarrow,panic,block 6) add kern.random.active_adaptor to indicate currently selected adaptor: root@freebsd04:~ # sysctl kern.random.active_adaptor kern.random.active_adaptor: yarrow # Submitted by: Arthur Mesh Submitted by: Dag-Erling Smørgrav , Arthur Mesh Reviewed by: des@FreeBSD.org Approved by: re (delphij) Approved by: secteam (des,delphij) Added: stable/10/sys/dev/random/dummy_rng.c (contents, props changed) stable/10/sys/dev/random/live_entropy_sources.c (contents, props changed) stable/10/sys/dev/random/live_entropy_sources.h (contents, props changed) stable/10/sys/dev/random/rwfile.c (contents, props changed) stable/10/sys/dev/random/rwfile.h (contents, props changed) Deleted: stable/10/sys/dev/random/pseudo_rng.c Modified: stable/10/etc/defaults/rc.conf stable/10/etc/rc.d/initrandom stable/10/share/examples/kld/random_adaptor/random_adaptor_example.c stable/10/share/man/man4/random.4 stable/10/sys/boot/forth/loader.conf stable/10/sys/conf/NOTES stable/10/sys/conf/files stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/conf/options stable/10/sys/dev/glxsb/glxsb.c stable/10/sys/dev/hifn/hifn7751.c stable/10/sys/dev/random/harvest.c stable/10/sys/dev/random/hash.h stable/10/sys/dev/random/ivy.c stable/10/sys/dev/random/nehemiah.c stable/10/sys/dev/random/random_adaptors.c stable/10/sys/dev/random/random_adaptors.h stable/10/sys/dev/random/random_harvestq.c stable/10/sys/dev/random/random_harvestq.h stable/10/sys/dev/random/randomdev.c stable/10/sys/dev/random/randomdev.h stable/10/sys/dev/random/randomdev_soft.c stable/10/sys/dev/random/randomdev_soft.h stable/10/sys/dev/random/yarrow.c stable/10/sys/dev/random/yarrow.h stable/10/sys/dev/rndtest/rndtest.c stable/10/sys/dev/safe/safe.c stable/10/sys/dev/syscons/scmouse.c stable/10/sys/dev/syscons/syscons.c stable/10/sys/dev/ubsec/ubsec.c stable/10/sys/kern/kern_intr.c stable/10/sys/kern/subr_bus.c stable/10/sys/mips/cavium/octeon_rnd.c stable/10/sys/modules/random/Makefile stable/10/sys/net/if_ethersubr.c stable/10/sys/net/if_tun.c stable/10/sys/netgraph/ng_iface.c stable/10/sys/sys/random.h Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/etc/defaults/rc.conf Sat Oct 12 15:31:36 2013 (r256381) @@ -651,6 +651,7 @@ entropy_save_num="8" # Number of entropy harvest_interrupt="YES" # Entropy device harvests interrupt randomness harvest_ethernet="YES" # Entropy device harvests ethernet randomness harvest_p_to_p="YES" # Entropy device harvests point-to-point randomness +harvest_swi="YES" # Entropy device harvests internal SWI randomness dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot watchdogd_enable="NO" # Start the software watchdog daemon watchdogd_flags="" # Flags to watchdogd (if enabled) Modified: stable/10/etc/rc.d/initrandom ============================================================================== --- stable/10/etc/rc.d/initrandom Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/etc/rc.d/initrandom Sat Oct 12 15:31:36 2013 (r256381) @@ -14,26 +14,6 @@ name="initrandom" start_cmd="initrandom_start" stop_cmd=":" -feed_dev_random() -{ - if [ -f "${1}" -a -r "${1}" -a -s "${1}" ]; then - cat "${1}" | dd of=/dev/random bs=8k 2>/dev/null - fi -} - -better_than_nothing() -{ - # XXX temporary until we can improve the entropy - # harvesting rate. - # Entropy below is not great, but better than nothing. - # This unblocks the generator at startup - # Note: commands are ordered to cause the most variance across reboots. - ( kenv; dmesg; df -ib; ps -fauxww; date; sysctl -a ) \ - | dd of=/dev/random bs=8k 2>/dev/null - /sbin/sha256 -q `sysctl -n kern.bootfile` \ - | dd of=/dev/random bs=8k 2>/dev/null -} - initrandom_start() { soft_random_generator=`sysctl kern.random 2>/dev/null` @@ -63,23 +43,15 @@ initrandom_start() else ${SYSCTL} kern.random.sys.harvest.point_to_point=0 >/dev/null fi - fi - # First pass at reseeding /dev/random. - # - case ${entropy_file} in - [Nn][Oo] | '') - ;; - *) - if [ -w /dev/random ]; then - feed_dev_random "${entropy_file}" + if checkyesno harvest_swi; then + ${SYSCTL} kern.random.sys.harvest.swi=1 >/dev/null + echo -n ' swi' + else + ${SYSCTL} kern.random.sys.harvest.swi=0 >/dev/null fi - ;; - esac - - better_than_nothing + fi - echo -n ' kickstart' fi echo '.' Modified: stable/10/share/examples/kld/random_adaptor/random_adaptor_example.c ============================================================================== --- stable/10/share/examples/kld/random_adaptor/random_adaptor_example.c Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/share/examples/kld/random_adaptor/random_adaptor_example.c Sat Oct 12 15:31:36 2013 (r256381) @@ -30,32 +30,29 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include -#include +#include #include +#include #include #include -#define RNG_NAME "example" - static int random_example_read(void *, int); struct random_adaptor random_example = { .ident = "Example RNG", - .init = (random_init_func_t *)random_null_func, - .deinit = (random_deinit_func_t *)random_null_func, + .source = RANDOM_PURE_BOGUS, /* Make sure this is in + * sys/random.h and is unique */ .read = random_example_read, - .write = (random_write_func_t *)random_null_func, - .reseed = (random_reseed_func_t *)random_null_func, - .seeded = 1, }; /* * Used under the license provided @ http://xkcd.com/221/ * http://creativecommons.org/licenses/by-nc/2.5/ */ -static u_char +static uint8_t getRandomNumber(void) { return 4; /* chosen by fair dice roll, guaranteed to be random */ @@ -64,14 +61,13 @@ getRandomNumber(void) static int random_example_read(void *buf, int c) { - u_char *b; + uint8_t *b; int count; b = buf; - for (count = 0; count < c; count++) { + for (count = 0; count < c; count++) b[count] = getRandomNumber(); - } printf("returning %d bytes of pure randomness\n", c); return (c); @@ -80,15 +76,26 @@ random_example_read(void *buf, int c) static int random_example_modevent(module_t mod, int type, void *unused) { + int error = 0; switch (type) { case MOD_LOAD: - random_adaptor_register(RNG_NAME, &random_example); - EVENTHANDLER_INVOKE(random_adaptor_attach, &random_example); - return (0); + live_entropy_source_register(&random_example); + break; + + case MOD_UNLOAD: + live_entropy_source_deregister(&random_example); + break; + + case MOD_SHUTDOWN: + break; + + default: + error = EOPNOTSUPP; + break; } - return (EINVAL); + return (error); } -RANDOM_ADAPTOR_MODULE(random_example, random_example_modevent, 1); +LIVE_ENTROPY_SRC_MODULE(live_entropy_source_example, random_example_modevent, 1); Modified: stable/10/share/man/man4/random.4 ============================================================================== --- stable/10/share/man/man4/random.4 Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/share/man/man4/random.4 Sat Oct 12 15:31:36 2013 (r256381) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2001 Mark R V Murray. All rights reserved. +.\" Copyright (c) 2001-2013 Mark R V Murray. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2013 +.Dd October 12, 2013 .Dt RANDOM 4 .Os .Sh NAME @@ -43,35 +43,48 @@ The device will probe for certain hardware entropy sources, and use these in preference to the fallback, which is a generator implemented in software. -If the kernel environment MIB's -.Va hw.nehemiah_rng_enable -or -.Va hw.ivy_rng_enable -are set to -.Dq Li 0 , -the associated hardware entropy source will be ignored. -.Pp -If the device is using -the software generator, -writing data to -.Nm -would perturb the internal state. -This perturbation of the internal state -is the only userland method of introducing -extra entropy into the device. -If the writer has superuser privilege, -then closing the device after writing -will make the software generator reseed itself. -This can be used for extra security, -as it immediately introduces any/all new entropy -into the PRNG. -The hardware generators will generate -sufficient quantities of entropy, -and will therefore ignore user-supplied input. -The software -.Nm -device may be controlled with -.Xr sysctl 8 . +.Pp +The software generator will start in an +.Em unseeded +state, and will block reads until +it is (re)seeded. +This may cause trouble at system boot +when keys and the like +are generated from +/dev/random +so steps should be taken to ensure a +reseed as soon as possible. +The +.Xr sysctl 8 +controlling the +.Em seeded +status (see below) may be used +if security is not an issue +or for convenience +during setup or development. +.Pp +This initial seeding +of random number generators +is a bootstrapping problem +that needs very careful attention. +In some cases, +it may be difficult +to find enough randomness +to seed a random number generator +until a system is fully operational, +but the system requires random numbers +to become fully operational. +It is (or more accurately should be) +critically important that the +.Nm +device is seeded +before the first time it is used. +In the case where a dummy or "blocking-only" +device is used, +it is the responsibility +of the system architect +to ensure that no blocking reads +hold up critical processes. .Pp To see the current settings of the software .Nm @@ -81,22 +94,20 @@ device, use the command line: .Pp which results in something like: .Bd -literal -offset indent -kern.random.adaptors: yarrow +kern.random.adaptors: yarrow,dummy +kern.random.active_adaptor: yarrow +kern.random.yarrow.gengateinterval: 10 +kern.random.yarrow.bins: 10 +kern.random.yarrow.fastthresh: 96 +kern.random.yarrow.slowthresh: 128 +kern.random.yarrow.slowoverthresh: 2 kern.random.sys.seeded: 1 kern.random.sys.harvest.ethernet: 1 kern.random.sys.harvest.point_to_point: 1 kern.random.sys.harvest.interrupt: 1 -kern.random.sys.harvest.swi: 0 -kern.random.yarrow.gengateinterval: 10 -kern.random.yarrow.bins: 10 -kern.random.yarrow.fastthresh: 192 -kern.random.yarrow.slowthresh: 256 -kern.random.yarrow.slowoverthresh: 2 +kern.random.sys.harvest.swi: 1 .Ed .Pp -(These would not be seen if a -hardware generator is present.) -.Pp Other than .Dl kern.random.adaptors all settings are read/write. @@ -107,9 +118,10 @@ variable indicates whether or not the .Nm device is in an acceptably secure state as a result of reseeding. -If set to 0, the device will block (on read) until the next reseed -(which can be from an explicit write, -or as a result of entropy harvesting). +If set to 0, +the device will block (on read) +until the next reseed +as a result of entropy harvesting. A reseed will set the value to 1 (non-blocking). .Pp The @@ -276,19 +288,6 @@ the generator produce independent sequen However, the guessability or reproducibility of the sequence is unimportant, unlike the previous cases. .Pp -One final consideration for the seeding of random number generators -is a bootstrapping problem. -In some cases, it may be difficult to find enough randomness to -seed a random number generator until a system is fully operational, -but the system requires random numbers to become fully operational. -There is no substitute for careful thought here, -but the -.Fx -.Nm -device, -which is based on the Yarrow system, -should be of some help in this area. -.Pp .Fx does also provide the traditional .Xr rand 3 @@ -325,17 +324,7 @@ and is an implementation of the .Em Yarrow algorithm by Bruce Schneier, .Em et al . -The only hardware implementations -currently are for the -.Tn VIA C3 Nehemiah -(stepping 3 or greater) -CPU -and the -.Tn Intel -.Dq Bull Mountain -.Em RdRand -instruction and underlying random number generator (RNG). -More will be added in the future. +Significant infrastructure work was done by Arthur Mesh. .Pp The author gratefully acknowledges significant assistance from VIA Technologies, Inc. Modified: stable/10/sys/boot/forth/loader.conf ============================================================================== --- stable/10/sys/boot/forth/loader.conf Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/sys/boot/forth/loader.conf Sat Oct 12 15:31:36 2013 (r256381) @@ -39,6 +39,17 @@ bitmap_type="splash_image_data" # and pl ############################################################## +### Random number generator configuration ################### +############################################################## + +entropy_cache_load="NO" # Set this to YES to load entropy at boot time +entropy_cache_name="/boot/entropy" # Set this to the name of the file +entropy_cache_type="/boot/entropy" +#kern.random.sys.seeded="0" # Set this to 1 to start /dev/random + # without waiting for a (re)seed. + + +############################################################## ### Loader settings ######################################## ############################################################## Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/sys/conf/NOTES Sat Oct 12 15:31:36 2013 (r256381) @@ -2962,3 +2962,8 @@ options RCTL options BROOKTREE_ALLOC_PAGES=(217*4+1) options MAXFILES=999 +# Random number generator +options RANDOM_YARROW # Yarrow RNG +##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented +options RANDOM_DEBUG # Debugging messages +options RANDOM_RWFILE # Read and write entropy cache Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/sys/conf/files Sat Oct 12 15:31:36 2013 (r256381) @@ -2043,13 +2043,15 @@ rt2860.fw optional rt2860fw | ralfw \ no-obj no-implicit-rule \ clean "rt2860.fw" dev/random/harvest.c standard -dev/random/hash.c optional random -dev/random/pseudo_rng.c standard +dev/random/dummy_rng.c standard dev/random/random_adaptors.c standard -dev/random/random_harvestq.c standard +dev/random/live_entropy_sources.c optional random +dev/random/random_harvestq.c optional random dev/random/randomdev.c optional random dev/random/randomdev_soft.c optional random dev/random/yarrow.c optional random +dev/random/hash.c optional random +dev/random/rwfile.c optional random dev/rc/rc.c optional rc dev/re/if_re.c optional re dev/rndtest/rndtest.c optional rndtest Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/sys/conf/files.amd64 Sat Oct 12 15:31:36 2013 (r256381) @@ -259,8 +259,8 @@ dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa -dev/random/ivy.c optional random rdrand_rng -dev/random/nehemiah.c optional random padlock_rng +dev/random/ivy.c optional rdrand_rng +dev/random/nehemiah.c optional padlock_rng dev/qlxge/qls_dbg.c optional qlxge pci dev/qlxge/qls_dump.c optional qlxge pci dev/qlxge/qls_hw.c optional qlxge pci Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/sys/conf/files.i386 Sat Oct 12 15:31:36 2013 (r256381) @@ -257,8 +257,8 @@ dev/nvme/nvme_test.c optional nvme dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa dev/pcf/pcf_isa.c optional pcf -dev/random/ivy.c optional random rdrand_rng -dev/random/nehemiah.c optional random padlock_rng +dev/random/ivy.c optional rdrand_rng +dev/random/nehemiah.c optional padlock_rng dev/sbni/if_sbni.c optional sbni dev/sbni/if_sbni_isa.c optional sbni isa dev/sbni/if_sbni_pci.c optional sbni pci Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/sys/conf/options Sat Oct 12 15:31:36 2013 (r256381) @@ -904,3 +904,9 @@ RACCT opt_global.h # Resource Limits RCTL opt_global.h + +# Random number generator(s) +RANDOM_YARROW opt_random.h +RANDOM_FORTUNA opt_random.h +RANDOM_DEBUG opt_random.h +RANDOM_RWFILE opt_random.h Modified: stable/10/sys/dev/glxsb/glxsb.c ============================================================================== --- stable/10/sys/dev/glxsb/glxsb.c Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/sys/dev/glxsb/glxsb.c Sat Oct 12 15:31:36 2013 (r256381) @@ -476,7 +476,7 @@ glxsb_rnd(void *v) if (status & SB_RNS_TRNG_VALID) { value = bus_read_4(sc->sc_sr, SB_RANDOM_NUM); /* feed with one uint32 */ - random_harvest(&value, 4, 32/2, 0, RANDOM_PURE); + random_harvest(&value, 4, 32/2, RANDOM_PURE_GLXSB); } callout_reset(&sc->sc_rngco, sc->sc_rnghz, glxsb_rnd, sc); Modified: stable/10/sys/dev/hifn/hifn7751.c ============================================================================== --- stable/10/sys/dev/hifn/hifn7751.c Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/sys/dev/hifn/hifn7751.c Sat Oct 12 15:31:36 2013 (r256381) @@ -258,7 +258,7 @@ hifn_partname(struct hifn_softc *sc) static void default_harvest(struct rndtest_state *rsp, void *buf, u_int count) { - random_harvest(buf, count, count*NBBY/2, 0, RANDOM_PURE); + random_harvest(buf, count, count*NBBY/2, RANDOM_PURE_HIFN); } static u_int Added: stable/10/sys/dev/random/dummy_rng.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/random/dummy_rng.c Sat Oct 12 15:31:36 2013 (r256381) @@ -0,0 +1,123 @@ +/*- + * Copyright (c) 2013 Arthur Mesh + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +static struct mtx dummy_random_mtx; + +/* Used to fake out unused random calls in random_adaptor */ +static void +random_null_func(void) +{ +} + +static int +dummy_random_poll(int events __unused, struct thread *td __unused) +{ + + return (0); +} + +static int +dummy_random_block(int flag) +{ + int error = 0; + + mtx_lock(&dummy_random_mtx); + + /* Blocking logic */ + while (!error) { + if (flag & O_NONBLOCK) + error = EWOULDBLOCK; + else { + printf("random: dummy device blocking on read.\n"); + error = msleep(&dummy_random_block, + &dummy_random_mtx, + PUSER | PCATCH, "block", 0); + } + } + mtx_unlock(&dummy_random_mtx); + + return (error); +} + +static void +dummy_random_init(void) +{ + + mtx_init(&dummy_random_mtx, "sleep mtx for dummy_random", + NULL, MTX_DEF); +} + +static void +dummy_random_deinit(void) +{ + + mtx_destroy(&dummy_random_mtx); +} + +struct random_adaptor dummy_random = { + .ident = "Dummy entropy device that always blocks", + .init = dummy_random_init, + .deinit = dummy_random_deinit, + .block = dummy_random_block, + .poll = dummy_random_poll, + .read = (random_read_func_t *)random_null_func, + .reseed = (random_reseed_func_t *)random_null_func, + .seeded = 0, /* This device can never be seeded */ +}; + +static int +dummy_random_modevent(module_t mod __unused, int type, void *unused __unused) +{ + + switch (type) { + case MOD_LOAD: + random_adaptor_register("dummy", &dummy_random); + EVENTHANDLER_INVOKE(random_adaptor_attach, + &dummy_random); + + return (0); + } + + return (EINVAL); +} + +RANDOM_ADAPTOR_MODULE(dummy, dummy_random_modevent, 1); Modified: stable/10/sys/dev/random/harvest.c ============================================================================== --- stable/10/sys/dev/random/harvest.c Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/sys/dev/random/harvest.c Sat Oct 12 15:31:36 2013 (r256381) @@ -48,20 +48,20 @@ __FBSDID("$FreeBSD$"); static int read_random_phony(void *, int); /* Structure holding the desired entropy sources */ -struct harvest_select harvest = { 1, 1, 1, 0 }; +struct harvest_select harvest = { 1, 1, 1, 1 }; static int warned = 0; /* hold the address of the routine which is actually called if * the randomdev is loaded */ -static void (*reap_func)(u_int64_t, const void *, u_int, u_int, u_int, +static void (*reap_func)(u_int64_t, const void *, u_int, u_int, enum esource) = NULL; static int (*read_func)(void *, int) = read_random_phony; /* Initialise the harvester at load time */ void randomdev_init_harvester(void (*reaper)(u_int64_t, const void *, u_int, - u_int, u_int, enum esource), int (*reader)(void *, int)) + u_int, enum esource), int (*reader)(void *, int)) { reap_func = reaper; read_func = reader; @@ -86,12 +86,10 @@ randomdev_deinit_harvester(void) * read which can be quite expensive. */ void -random_harvest(void *entropy, u_int count, u_int bits, u_int frac, - enum esource origin) +random_harvest(void *entropy, u_int count, u_int bits, enum esource origin) { if (reap_func) - (*reap_func)(get_cyclecount(), entropy, count, bits, frac, - origin); + (*reap_func)(get_cyclecount(), entropy, count, bits, origin); } /* Userland-visible version of read_random */ Modified: stable/10/sys/dev/random/hash.h ============================================================================== --- stable/10/sys/dev/random/hash.h Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/sys/dev/random/hash.h Sat Oct 12 15:31:36 2013 (r256381) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#ifndef SYS_DEV_RANDOM_HASH_H_INCLUDED +#define SYS_DEV_RANDOM_HASH_H_INCLUDED + #define KEYSIZE 32 /* (in bytes) == 256 bits */ #define BLOCKSIZE 16 /* (in bytes) == 128 bits */ @@ -43,3 +46,5 @@ void randomdev_hash_iterate(struct rando void randomdev_hash_finish(struct randomdev_hash *, void *); void randomdev_encrypt_init(struct randomdev_key *, void *); void randomdev_encrypt(struct randomdev_key *context, void *, void *, unsigned); + +#endif Modified: stable/10/sys/dev/random/ivy.c ============================================================================== --- stable/10/sys/dev/random/ivy.c Sat Oct 12 14:54:25 2013 (r256380) +++ stable/10/sys/dev/random/ivy.c Sat Oct 12 15:31:36 2013 (r256381) @@ -30,38 +30,35 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include +#include #include -#include +#include #include #include #include #include -#include #include +#include +#include +#include +#include #define RETRY_COUNT 10 -static void random_ivy_init(void); -static void random_ivy_deinit(void); static int random_ivy_read(void *, int); -struct random_adaptor random_ivy = { +static struct random_hardware_source random_ivy = { .ident = "Hardware, Intel IvyBridge+ RNG", - .init = random_ivy_init, - .deinit = random_ivy_deinit, - .read = random_ivy_read, - .write = (random_write_func_t *)random_null_func, - .reseed = (random_reseed_func_t *)random_null_func, - .seeded = 1, + .source = RANDOM_PURE_RDRAND, + .read = random_ivy_read }; static inline int -ivy_rng_store(long *tmp) +ivy_rng_store(uint64_t *tmp) { #ifdef __GNUCLIKE_ASM uint32_t count; @@ -86,34 +83,26 @@ ivy_rng_store(long *tmp) #endif } -static void -random_ivy_init(void) -{ -} - -void -random_ivy_deinit(void) -{ -} - static int random_ivy_read(void *buf, int c) { - char *b; - long tmp; - int count, res, retry; + uint8_t *b; + int count, ret, retry; + uint64_t tmp; - for (count = c, b = buf; count > 0; count -= res, b += res) { + b = buf; + for (count = c; count > 0; count -= ret) { for (retry = 0; retry < RETRY_COUNT; retry++) { - res = ivy_rng_store(&tmp); - if (res != 0) + ret = ivy_rng_store(&tmp); + if (ret != 0) break; } - if (res == 0) + if (ret == 0) break; - if (res > count) - res = count; - memcpy(b, &tmp, res); + if (ret > count) + ret = count; + memcpy(b, &tmp, ret); + b += ret; } return (c - count); } @@ -121,25 +110,35 @@ random_ivy_read(void *buf, int c) static int rdrand_modevent(module_t mod, int type, void *unused) { + int error = 0; switch (type) { case MOD_LOAD: - if (cpu_feature2 & CPUID2_RDRAND) { - random_adaptor_register("rdrand", &random_ivy); - EVENTHANDLER_INVOKE(random_adaptor_attach, &random_ivy); - return (0); - } else { + if (cpu_feature2 & CPUID2_RDRAND) + live_entropy_source_register(&random_ivy); + else #ifndef KLD_MODULE if (bootverbose) #endif - printf( - "%s: RDRAND feature is not present on this CPU\n", + printf("%s: RDRAND is not present\n", random_ivy.ident); - return (0); - } + break; + + case MOD_UNLOAD: + if (cpu_feature2 & CPUID2_RDRAND) + live_entropy_source_deregister(&random_ivy); + break; + + case MOD_SHUTDOWN: + break; + + default: + error = EOPNOTSUPP; + break; + } - return (EINVAL); + return (error); } -RANDOM_ADAPTOR_MODULE(random_rdrand, rdrand_modevent, 1); +LIVE_ENTROPY_SRC_MODULE(random_rdrand, rdrand_modevent, 1); Added: stable/10/sys/dev/random/live_entropy_sources.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/random/live_entropy_sources.c Sat Oct 12 15:31:36 2013 (r256381) @@ -0,0 +1,195 @@ +/*- + * Copyright (c) 2013 Arthur Mesh + * Copyright (c) 2013 Mark R V Murray + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include "live_entropy_sources.h" + +LIST_HEAD(les_head, live_entropy_sources); +static struct les_head sources = LIST_HEAD_INITIALIZER(sources); + +/* + * The live_lock protects the consistency of the "struct les_head sources" + */ +static struct sx les_lock; /* need a sleepable lock */ + +void +live_entropy_source_register(struct random_hardware_source *rsource) +{ + struct live_entropy_sources *les; + + KASSERT(rsource != NULL, ("invalid input to %s", __func__)); + + les = malloc(sizeof(struct live_entropy_sources), M_ENTROPY, M_WAITOK); + les->rsource = rsource; + + sx_xlock(&les_lock); + LIST_INSERT_HEAD(&sources, les, entries); + sx_xunlock(&les_lock); +} + +void +live_entropy_source_deregister(struct random_hardware_source *rsource) +{ + struct live_entropy_sources *les = NULL; + + KASSERT(rsource != NULL, ("invalid input to %s", __func__)); + + sx_xlock(&les_lock); + LIST_FOREACH(les, &sources, entries) + if (les->rsource == rsource) { + LIST_REMOVE(les, entries); + break; + } + sx_xunlock(&les_lock); + if (les != NULL) + free(les, M_ENTROPY); +} + +static int +live_entropy_source_handler(SYSCTL_HANDLER_ARGS) +{ + struct live_entropy_sources *les; + int error, count; + + count = error = 0; + + sx_slock(&les_lock); + + if (LIST_EMPTY(&sources)) + error = SYSCTL_OUT(req, "", 0); + else { + LIST_FOREACH(les, &sources, entries) { + + error = SYSCTL_OUT(req, ",", count++ ? 1 : 0); + if (error) + break; + + error = SYSCTL_OUT(req, les->rsource->ident, strlen(les->rsource->ident)); + if (error) + break; + } + } + + sx_sunlock(&les_lock); + + return (error); +} + +static void +live_entropy_sources_init(void *unused) +{ + + SYSCTL_PROC(_kern_random, OID_AUTO, live_entropy_sources, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, live_entropy_source_handler, "", + "List of Active Live Entropy Sources"); + + sx_init(&les_lock, "live_entropy_sources"); +} + +/* + * Run through all "live" sources reading entropy for the given + * number of rounds, which should be a multiple of the number + * of entropy accumulation pools in use; 2 for Yarrow and 32 + * for Fortuna. + * + * BEWARE!!! + * This function runs inside the RNG thread! Don't do anything silly! + * Remember that we are NOT holding harvest_mtx on entry! + */ +void +live_entropy_sources_feed(int rounds, event_proc_f entropy_processor) +{ + static struct harvest event; + static uint8_t buf[HARVESTSIZE]; + struct live_entropy_sources *les; + int i, n; + + sx_slock(&les_lock); + + /* + * Walk over all of live entropy sources, and feed their output + * to the system-wide RNG. + */ + LIST_FOREACH(les, &sources, entries) { + + for (i = 0; i < rounds; i++) { + /* + * This should be quick, since it's a live entropy + * source. + */ + /* FIXME: Whine loudly if this didn't work. */ + n = les->rsource->read(buf, sizeof(buf)); + n = MIN(n, HARVESTSIZE); + + event.somecounter = get_cyclecount(); + event.size = n; + event.bits = (n*8)/2; + event.source = les->rsource->source; + memcpy(event.entropy, buf, n); + + /* Do the actual entropy insertion */ + entropy_processor(&event); + } + + } + + sx_sunlock(&les_lock); +} + +static void +live_entropy_sources_deinit(void *unused) +{ + + sx_destroy(&les_lock); +} + +SYSINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, + live_entropy_sources_init, NULL); +SYSUNINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, + live_entropy_sources_deinit, NULL); Added: stable/10/sys/dev/random/live_entropy_sources.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/random/live_entropy_sources.h Sat Oct 12 15:31:36 2013 (r256381) @@ -0,0 +1,60 @@ +/*- + * Copyright (c) 2013 Arthur Mesh + * Copyright (c) 2013 Mark R V Murray + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 15:41:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 356ED417; Sat, 12 Oct 2013 15:41:18 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EFB5E2346; Sat, 12 Oct 2013 15:41:17 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.31]) by ltcfislmsgpa02.fnfis.com (8.14.5/8.14.5) with ESMTP id r9CFfGXJ005697 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 12 Oct 2013 10:41:16 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.103]) by LTCFISWMSGHT03.FNFIS.com ([10.132.206.31]) with mapi id 14.02.0309.002; Sat, 12 Oct 2013 10:41:15 -0500 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r256343 - in head/usr.sbin/bsdinstall: . scripts Thread-Topic: svn commit: r256343 - in head/usr.sbin/bsdinstall: . scripts Thread-Index: AQHOx1fhW1uGCLtcyE2zUcTOTrV8Ipnxf3yAgAAInQA= Date: Sat, 12 Oct 2013 15:41:14 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D720FC5BA7F@LTCFISWMSGMB21.FNFIS.com> References: <201310112041.r9BKfZeT002056@svn.freebsd.org> <5258F9B3.7030101@freebsd.org> <13CA24D6AB415D428143D44749F57D720FC5B547@LTCFISWMSGMB21.FNFIS.com> <13CA24D6AB415D428143D44749F57D720FC5B7DF@LTCFISWMSGMB21.FNFIS.com> In-Reply-To: <13CA24D6AB415D428143D44749F57D720FC5B7DF@LTCFISWMSGMB21.FNFIS.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="us-ascii" Content-ID: <1C071711A3551E4E95C59EA6DEBE6025@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-10-12_01:2013-10-11,2013-10-12,1970-01-01 signatures=0 Cc: Devin Teske , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Oct 2013 15:41:18 -0000 On Oct 12, 2013, at 8:10 AM, Teske, Devin wrote: > [snip] >=20 > So let's say you don't have camcontrol(8) in the media, *or* say that you= have a kernel > lacking CAM knobs... >=20 > No problem. >=20 > I could have completely omitted the camcontrol value-add, ... what we had= already > was sufficient enough to describe disks. >=20 > It was only upon Allan's testing that he noticed that the labels could be= ... better ;D >=20 > So I went scrounging for something that could supersede the description o= f a `da0' > that would satisfy Allan, and I found it in camcontrol -- his testing con= firmed. >=20 > I don't know if he was using a kernel enhanced with CAM through custom co= nfiguration > or if he was using everything stock... and I could ask him... but it appe= ared to be working >=20 I asked Allan about that, and this was his response... AJ> Stock 9 and 10 use CAM by default. In 8.x camcontrol is there, but the AJ> regular SATA disks do not show up if you do camcontrol devlist, because AJ> they are the old style (ad4) instead of the new cam style (ada0) etc. AJ>=20 AJ> So worst case, you get a blank output from camcontrol devlist --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 15:56:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 05153883; Sat, 12 Oct 2013 15:56:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E23D423E1; Sat, 12 Oct 2013 15:56:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CFuHlO099738; Sat, 12 Oct 2013 15:56:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CFuDdx099675; Sat, 12 Oct 2013 15:56:13 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310121556.r9CFuDdx099675@svn.freebsd.org> From: Dimitry Andric Date: Sat, 12 Oct 2013 15:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256382 - in stable/9/contrib/llvm: include/llvm/IR lib/AsmParser lib/IR lib/Target/X86 tools/clang/include/clang-c tools/clang/include/clang/AST tools/clang/include/clang/Basic tools/c... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 15:56:18 -0000 Author: dim Date: Sat Oct 12 15:56:13 2013 New Revision: 256382 URL: http://svnweb.freebsd.org/changeset/base/256382 Log: MFC r256030: Pull in r189644 from upstream llvm trunk: Add ms_abi and sysv_abi attribute handling. Based on a patch by Benno Rice! This will help to develop EFI support. Verified by: benno Modified: stable/9/contrib/llvm/include/llvm/IR/CallingConv.h stable/9/contrib/llvm/lib/AsmParser/LLLexer.cpp stable/9/contrib/llvm/lib/AsmParser/LLParser.cpp stable/9/contrib/llvm/lib/AsmParser/LLToken.h stable/9/contrib/llvm/lib/IR/AsmWriter.cpp stable/9/contrib/llvm/lib/Target/X86/X86CallingConv.td stable/9/contrib/llvm/lib/Target/X86/X86FastISel.cpp stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp stable/9/contrib/llvm/lib/Target/X86/X86Subtarget.h stable/9/contrib/llvm/tools/clang/include/clang-c/Index.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Type.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Attr.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h stable/9/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp stable/9/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp stable/9/contrib/llvm/tools/clang/lib/AST/Type.cpp stable/9/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/9/contrib/llvm/include/llvm/IR/CallingConv.h ============================================================================== --- stable/9/contrib/llvm/include/llvm/IR/CallingConv.h Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/include/llvm/IR/CallingConv.h Sat Oct 12 15:56:13 2013 (r256382) @@ -119,8 +119,17 @@ namespace CallingConv { SPIR_KERNEL = 76, /// Intel_OCL_BI - Calling conventions for Intel OpenCL built-ins - Intel_OCL_BI = 77 + Intel_OCL_BI = 77, + /// \brief The C convention as specified in the x86-64 supplement to the + /// System V ABI, used on most non-Windows systems. + X86_64_SysV = 78, + + /// \brief The C convention as implemented on Windows/x86-64. This + /// convention differs from the more common \c X86_64_SysV convention + /// in a number of ways, most notably in that XMM registers used to pass + /// arguments are shadowed by GPRs, and vice versa. + X86_64_Win64 = 79 }; } // End CallingConv namespace Modified: stable/9/contrib/llvm/lib/AsmParser/LLLexer.cpp ============================================================================== --- stable/9/contrib/llvm/lib/AsmParser/LLLexer.cpp Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/lib/AsmParser/LLLexer.cpp Sat Oct 12 15:56:13 2013 (r256382) @@ -556,6 +556,8 @@ lltok::Kind LLLexer::LexIdentifier() { KEYWORD(spir_kernel); KEYWORD(spir_func); KEYWORD(intel_ocl_bicc); + KEYWORD(x86_64_sysvcc); + KEYWORD(x86_64_win64cc); KEYWORD(cc); KEYWORD(c); Modified: stable/9/contrib/llvm/lib/AsmParser/LLParser.cpp ============================================================================== --- stable/9/contrib/llvm/lib/AsmParser/LLParser.cpp Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/lib/AsmParser/LLParser.cpp Sat Oct 12 15:56:13 2013 (r256382) @@ -1337,6 +1337,8 @@ bool LLParser::ParseOptionalVisibility(u /// ::= 'ptx_device' /// ::= 'spir_func' /// ::= 'spir_kernel' +/// ::= 'x86_64_sysvcc' +/// ::= 'x86_64_win64cc' /// ::= 'cc' UINT /// bool LLParser::ParseOptionalCallingConv(CallingConv::ID &CC) { @@ -1357,6 +1359,8 @@ bool LLParser::ParseOptionalCallingConv( case lltok::kw_spir_kernel: CC = CallingConv::SPIR_KERNEL; break; case lltok::kw_spir_func: CC = CallingConv::SPIR_FUNC; break; case lltok::kw_intel_ocl_bicc: CC = CallingConv::Intel_OCL_BI; break; + case lltok::kw_x86_64_sysvcc: CC = CallingConv::X86_64_SysV; break; + case lltok::kw_x86_64_win64cc: CC = CallingConv::X86_64_Win64; break; case lltok::kw_cc: { unsigned ArbitraryCC; Lex.Lex(); Modified: stable/9/contrib/llvm/lib/AsmParser/LLToken.h ============================================================================== --- stable/9/contrib/llvm/lib/AsmParser/LLToken.h Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/lib/AsmParser/LLToken.h Sat Oct 12 15:56:13 2013 (r256382) @@ -84,12 +84,13 @@ namespace lltok { kw_c, kw_cc, kw_ccc, kw_fastcc, kw_coldcc, - kw_intel_ocl_bicc, + kw_intel_ocl_bicc, kw_x86_stdcallcc, kw_x86_fastcallcc, kw_x86_thiscallcc, kw_arm_apcscc, kw_arm_aapcscc, kw_arm_aapcs_vfpcc, kw_msp430_intrcc, kw_ptx_kernel, kw_ptx_device, kw_spir_kernel, kw_spir_func, + kw_x86_64_sysvcc, kw_x86_64_win64cc, // Attributes: kw_attributes, Modified: stable/9/contrib/llvm/lib/IR/AsmWriter.cpp ============================================================================== --- stable/9/contrib/llvm/lib/IR/AsmWriter.cpp Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/lib/IR/AsmWriter.cpp Sat Oct 12 15:56:13 2013 (r256382) @@ -81,6 +81,8 @@ static void PrintCallingConv(unsigned cc case CallingConv::MSP430_INTR: Out << "msp430_intrcc"; break; case CallingConv::PTX_Kernel: Out << "ptx_kernel"; break; case CallingConv::PTX_Device: Out << "ptx_device"; break; + case CallingConv::X86_64_SysV: Out << "x86_64_sysvcc"; break; + case CallingConv::X86_64_Win64: Out << "x86_64_win64cc"; break; } } Modified: stable/9/contrib/llvm/lib/Target/X86/X86CallingConv.td ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86CallingConv.td Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/lib/Target/X86/X86CallingConv.td Sat Oct 12 15:56:13 2013 (r256382) @@ -156,6 +156,11 @@ def RetCC_X86_32 : CallingConv<[ def RetCC_X86_64 : CallingConv<[ // HiPE uses RetCC_X86_64_HiPE CCIfCC<"CallingConv::HiPE", CCDelegateTo>, + + // Handle explicit CC selection + CCIfCC<"CallingConv::X86_64_Win64", CCDelegateTo>, + CCIfCC<"CallingConv::X86_64_SysV", CCDelegateTo>, + // Mingw64 and native Win64 use Win64 CC CCIfSubtarget<"isTargetWin64()", CCDelegateTo>, @@ -489,6 +494,8 @@ def CC_X86_32 : CallingConv<[ def CC_X86_64 : CallingConv<[ CCIfCC<"CallingConv::GHC", CCDelegateTo>, CCIfCC<"CallingConv::HiPE", CCDelegateTo>, + CCIfCC<"CallingConv::X86_64_Win64", CCDelegateTo>, + CCIfCC<"CallingConv::X86_64_SysV", CCDelegateTo>, // Mingw64 and native Win64 use Win64 CC CCIfSubtarget<"isTargetWin64()", CCDelegateTo>, Modified: stable/9/contrib/llvm/lib/Target/X86/X86FastISel.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86FastISel.cpp Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/lib/Target/X86/X86FastISel.cpp Sat Oct 12 15:56:13 2013 (r256382) @@ -717,10 +717,11 @@ bool X86FastISel::X86SelectRet(const Ins CallingConv::ID CC = F.getCallingConv(); if (CC != CallingConv::C && CC != CallingConv::Fast && - CC != CallingConv::X86_FastCall) + CC != CallingConv::X86_FastCall && + CC != CallingConv::X86_64_SysV) return false; - if (Subtarget->isTargetWin64()) + if (Subtarget->isCallingConvWin64(CC)) return false; // Don't handle popping bytes on return for now. @@ -1643,9 +1644,6 @@ bool X86FastISel::FastLowerArguments() { if (!FuncInfo.CanLowerReturn) return false; - if (Subtarget->isTargetWin64()) - return false; - const Function *F = FuncInfo.Fn; if (F->isVarArg()) return false; @@ -1653,7 +1651,10 @@ bool X86FastISel::FastLowerArguments() { CallingConv::ID CC = F->getCallingConv(); if (CC != CallingConv::C) return false; - + + if (Subtarget->isCallingConvWin64(CC)) + return false; + if (!Subtarget->is64Bit()) return false; @@ -1757,8 +1758,10 @@ bool X86FastISel::DoSelectCall(const Ins // Handle only C and fastcc calling conventions for now. ImmutableCallSite CS(CI); CallingConv::ID CC = CS.getCallingConv(); + bool isWin64 = Subtarget->isCallingConvWin64(CC); if (CC != CallingConv::C && CC != CallingConv::Fast && - CC != CallingConv::X86_FastCall) + CC != CallingConv::X86_FastCall && CC != CallingConv::X86_64_Win64 && + CC != CallingConv::X86_64_SysV) return false; // fastcc with -tailcallopt is intended to provide a guaranteed @@ -1772,7 +1775,7 @@ bool X86FastISel::DoSelectCall(const Ins // Don't know how to handle Win64 varargs yet. Nothing special needed for // x86-32. Special handling for x86-64 is implemented. - if (isVarArg && Subtarget->isTargetWin64()) + if (isVarArg && isWin64) return false; // Fast-isel doesn't know about callee-pop yet. @@ -1902,7 +1905,7 @@ bool X86FastISel::DoSelectCall(const Ins I->getParent()->getContext()); // Allocate shadow area for Win64 - if (Subtarget->isTargetWin64()) + if (isWin64) CCInfo.AllocateStack(32, 8); CCInfo.AnalyzeCallOperands(ArgVTs, ArgFlags, CC_X86); @@ -2016,7 +2019,7 @@ bool X86FastISel::DoSelectCall(const Ins X86::EBX).addReg(Base); } - if (Subtarget->is64Bit() && isVarArg && !Subtarget->isTargetWin64()) { + if (Subtarget->is64Bit() && isVarArg && !isWin64) { // Count the number of XMM registers allocated. static const uint16_t XMMArgRegs[] = { X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3, @@ -2085,7 +2088,7 @@ bool X86FastISel::DoSelectCall(const Ins if (Subtarget->isPICStyleGOT()) MIB.addReg(X86::EBX, RegState::Implicit); - if (Subtarget->is64Bit() && isVarArg && !Subtarget->isTargetWin64()) + if (Subtarget->is64Bit() && isVarArg && !isWin64) MIB.addReg(X86::AL, RegState::Implicit); // Add implicit physical register uses to the call. Modified: stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sat Oct 12 15:56:13 2013 (r256382) @@ -1883,13 +1883,19 @@ static bool IsTailCallConvention(Calling CC == CallingConv::HiPE); } +/// \brief Return true if the calling convention is a C calling convention. +static bool IsCCallConvention(CallingConv::ID CC) { + return (CC == CallingConv::C || CC == CallingConv::X86_64_Win64 || + CC == CallingConv::X86_64_SysV); +} + bool X86TargetLowering::mayBeEmittedAsTailCall(CallInst *CI) const { if (!CI->isTailCall() || getTargetMachine().Options.DisableTailCalls) return false; CallSite CS(CI); CallingConv::ID CalleeCC = CS.getCallingConv(); - if (!IsTailCallConvention(CalleeCC) && CalleeCC != CallingConv::C) + if (!IsTailCallConvention(CalleeCC) && !IsCCallConvention(CalleeCC)) return false; return true; @@ -1964,7 +1970,7 @@ X86TargetLowering::LowerFormalArguments( MachineFrameInfo *MFI = MF.getFrameInfo(); bool Is64Bit = Subtarget->is64Bit(); bool IsWindows = Subtarget->isTargetWindows(); - bool IsWin64 = Subtarget->isTargetWin64(); + bool IsWin64 = Subtarget->isCallingConvWin64(CallConv); assert(!(isVarArg && IsTailCallConvention(CallConv)) && "Var args not supported with calling convention fastcc, ghc or hipe"); @@ -1975,9 +1981,8 @@ X86TargetLowering::LowerFormalArguments( ArgLocs, *DAG.getContext()); // Allocate shadow area for Win64 - if (IsWin64) { + if (IsWin64) CCInfo.AllocateStack(32, 8); - } CCInfo.AnalyzeFormalArguments(Ins, CC_X86); @@ -2290,7 +2295,7 @@ X86TargetLowering::LowerCall(TargetLower MachineFunction &MF = DAG.getMachineFunction(); bool Is64Bit = Subtarget->is64Bit(); - bool IsWin64 = Subtarget->isTargetWin64(); + bool IsWin64 = Subtarget->isCallingConvWin64(CallConv); bool IsWindows = Subtarget->isTargetWindows(); StructReturnType SR = callIsStructReturn(Outs); bool IsSibcall = false; @@ -2323,9 +2328,8 @@ X86TargetLowering::LowerCall(TargetLower ArgLocs, *DAG.getContext()); // Allocate shadow area for Win64 - if (IsWin64) { + if (IsWin64) CCInfo.AllocateStack(32, 8); - } CCInfo.AnalyzeCallOperands(Outs, CC_X86); @@ -2831,13 +2835,12 @@ X86TargetLowering::IsEligibleForTailCall const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, SelectionDAG &DAG) const { - if (!IsTailCallConvention(CalleeCC) && - CalleeCC != CallingConv::C) + if (!IsTailCallConvention(CalleeCC) && !IsCCallConvention(CalleeCC)) return false; // If -tailcallopt is specified, make fastcc functions tail-callable. const MachineFunction &MF = DAG.getMachineFunction(); - const Function *CallerF = DAG.getMachineFunction().getFunction(); + const Function *CallerF = MF.getFunction(); // If the function return type is x86_fp80 and the callee return type is not, // then the FP_EXTEND of the call result is not a nop. It's not safe to @@ -2847,6 +2850,8 @@ X86TargetLowering::IsEligibleForTailCall CallingConv::ID CallerCC = CallerF->getCallingConv(); bool CCMatch = CallerCC == CalleeCC; + bool IsCalleeWin64 = Subtarget->isCallingConvWin64(CalleeCC); + bool IsCallerWin64 = Subtarget->isCallingConvWin64(CallerCC); if (getTargetMachine().Options.GuaranteedTailCallOpt) { if (IsTailCallConvention(CalleeCC) && CCMatch) @@ -2878,7 +2883,7 @@ X86TargetLowering::IsEligibleForTailCall // Optimizing for varargs on Win64 is unlikely to be safe without // additional testing. - if (Subtarget->isTargetWin64()) + if (IsCalleeWin64 || IsCallerWin64) return false; SmallVector ArgLocs; @@ -2953,9 +2958,8 @@ X86TargetLowering::IsEligibleForTailCall getTargetMachine(), ArgLocs, *DAG.getContext()); // Allocate shadow area for Win64 - if (Subtarget->isTargetWin64()) { + if (IsCalleeWin64) CCInfo.AllocateStack(32, 8); - } CCInfo.AnalyzeCallOperands(Outs, CC_X86); if (CCInfo.getNextStackOffset()) { Modified: stable/9/contrib/llvm/lib/Target/X86/X86Subtarget.h ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86Subtarget.h Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/lib/Target/X86/X86Subtarget.h Sat Oct 12 15:56:13 2013 (r256382) @@ -338,7 +338,13 @@ public: } bool isPICStyleStubAny() const { return PICStyle == PICStyles::StubDynamicNoPIC || - PICStyle == PICStyles::StubPIC; } + PICStyle == PICStyles::StubPIC; + } + + bool isCallingConvWin64(CallingConv::ID CC) const { + return (isTargetWin64() && CC != CallingConv::X86_64_SysV) || + CC == CallingConv::X86_64_Win64; + } /// ClassifyGlobalReference - Classify a global variable reference for the /// current subtarget according to how we should reference it in a non-pcrel Modified: stable/9/contrib/llvm/tools/clang/include/clang-c/Index.h ============================================================================== --- stable/9/contrib/llvm/tools/clang/include/clang-c/Index.h Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/tools/clang/include/clang-c/Index.h Sat Oct 12 15:56:13 2013 (r256382) @@ -2683,6 +2683,8 @@ enum CXCallingConv { CXCallingConv_AAPCS_VFP = 7, CXCallingConv_PnaclCall = 8, CXCallingConv_IntelOclBicc = 9, + CXCallingConv_X86_64Win64 = 10, + CXCallingConv_X86_64SysV = 11, CXCallingConv_Invalid = 100, CXCallingConv_Unexposed = 200 Modified: stable/9/contrib/llvm/tools/clang/include/clang/AST/Type.h ============================================================================== --- stable/9/contrib/llvm/tools/clang/include/clang/AST/Type.h Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/tools/clang/include/clang/AST/Type.h Sat Oct 12 15:56:13 2013 (r256382) @@ -3335,7 +3335,9 @@ public: attr_thiscall, attr_pascal, attr_pnaclcall, - attr_inteloclbicc + attr_inteloclbicc, + attr_ms_abi, + attr_sysv_abi }; private: Modified: stable/9/contrib/llvm/tools/clang/include/clang/Basic/Attr.td ============================================================================== --- stable/9/contrib/llvm/tools/clang/include/clang/Basic/Attr.td Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/tools/clang/include/clang/Basic/Attr.td Sat Oct 12 15:56:13 2013 (r256382) @@ -417,6 +417,10 @@ def MayAlias : InheritableAttr { let Spellings = [GNU<"may_alias">, CXX11<"gnu", "may_alias">]; } +def MSABI : InheritableAttr { + let Spellings = [GNU<"ms_abi">, CXX11<"gnu", "ms_abi">]; +} + def MSP430Interrupt : InheritableAttr { let Spellings = []; let Args = [UnsignedArgument<"Number">]; @@ -664,6 +668,10 @@ def StdCall : InheritableAttr { Keyword<"__stdcall">, Keyword<"_stdcall">]; } +def SysVABI : InheritableAttr { + let Spellings = [GNU<"sysv_abi">, CXX11<"gnu", "sysv_abi">]; +} + def ThisCall : InheritableAttr { let Spellings = [GNU<"thiscall">, CXX11<"gnu", "thiscall">, Keyword<"__thiscall">, Keyword<"_thiscall">]; Modified: stable/9/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h ============================================================================== --- stable/9/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h Sat Oct 12 15:56:13 2013 (r256382) @@ -206,6 +206,8 @@ namespace clang { CC_X86FastCall, // __attribute__((fastcall)) CC_X86ThisCall, // __attribute__((thiscall)) CC_X86Pascal, // __attribute__((pascal)) + CC_X86_64Win64, // __attribute__((ms_abi)) + CC_X86_64SysV, // __attribute__((sysv_abi)) CC_AAPCS, // __attribute__((pcs("aapcs"))) CC_AAPCS_VFP, // __attribute__((pcs("aapcs-vfp"))) CC_PnaclCall, // __attribute__((pnaclcall)) Modified: stable/9/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp Sat Oct 12 15:56:13 2013 (r256382) @@ -921,6 +921,8 @@ struct XMLDumper : public XMLDeclVisitor case CC_X86StdCall: return set("cc", "x86_stdcall"); case CC_X86ThisCall: return set("cc", "x86_thiscall"); case CC_X86Pascal: return set("cc", "x86_pascal"); + case CC_X86_64Win64: return set("cc", "x86_64_win64"); + case CC_X86_64SysV: return set("cc", "x86_64_sysv"); case CC_AAPCS: return set("cc", "aapcs"); case CC_AAPCS_VFP: return set("cc", "aapcs_vfp"); case CC_PnaclCall: return set("cc", "pnaclcall"); Modified: stable/9/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp Sat Oct 12 15:56:13 2013 (r256382) @@ -1311,6 +1311,8 @@ void MicrosoftCXXNameMangler::mangleCall switch (CC) { default: llvm_unreachable("Unsupported CC for mangling"); + case CC_X86_64Win64: + case CC_X86_64SysV: case CC_Default: case CC_C: Out << 'A'; break; case CC_X86Pascal: Out << 'C'; break; Modified: stable/9/contrib/llvm/tools/clang/lib/AST/Type.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/AST/Type.cpp Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/tools/clang/lib/AST/Type.cpp Sat Oct 12 15:56:13 2013 (r256382) @@ -1574,6 +1574,8 @@ StringRef FunctionType::getNameForCallCo case CC_X86FastCall: return "fastcall"; case CC_X86ThisCall: return "thiscall"; case CC_X86Pascal: return "pascal"; + case CC_X86_64Win64: return "ms_abi"; + case CC_X86_64SysV: return "sysv_abi"; case CC_AAPCS: return "aapcs"; case CC_AAPCS_VFP: return "aapcs-vfp"; case CC_PnaclCall: return "pnaclcall"; Modified: stable/9/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp Sat Oct 12 15:56:13 2013 (r256382) @@ -650,6 +650,12 @@ void TypePrinter::printFunctionProtoAfte case CC_IntelOclBicc: OS << " __attribute__((intel_ocl_bicc))"; break; + case CC_X86_64Win64: + OS << " __attribute__((ms_abi))"; + break; + case CC_X86_64SysV: + OS << " __attribute__((sysv_abi))"; + break; } if (Info.getNoReturn()) OS << " __attribute__((noreturn))"; @@ -1160,6 +1166,8 @@ void TypePrinter::printAttributedAfter(c case AttributedType::attr_stdcall: OS << "stdcall"; break; case AttributedType::attr_thiscall: OS << "thiscall"; break; case AttributedType::attr_pascal: OS << "pascal"; break; + case AttributedType::attr_ms_abi: OS << "ms_abi"; break; + case AttributedType::attr_sysv_abi: OS << "sysv_abi"; break; case AttributedType::attr_pcs: { OS << "pcs("; QualType t = T->getEquivalentType(); Modified: stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Sat Oct 12 15:56:13 2013 (r256382) @@ -3182,8 +3182,9 @@ public: virtual CallingConvCheckResult checkCallingConvention(CallingConv CC) const { return (CC == CC_Default || - CC == CC_C || - CC == CC_IntelOclBicc) ? CCCR_OK : CCCR_Warning; + CC == CC_C || + CC == CC_IntelOclBicc || + CC == CC_X86_64Win64) ? CCCR_OK : CCCR_Warning; } virtual CallingConv getDefaultCallingConv(CallingConvMethodType MT) const { @@ -3219,6 +3220,11 @@ public: virtual BuiltinVaListKind getBuiltinVaListKind() const { return TargetInfo::CharPtrBuiltinVaList; } + virtual CallingConvCheckResult checkCallingConvention(CallingConv CC) const { + return (CC == CC_C || + CC == CC_IntelOclBicc || + CC == CC_X86_64SysV) ? CCCR_OK : CCCR_Warning; + } }; } // end anonymous namespace Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp Sat Oct 12 15:56:13 2013 (r256382) @@ -41,6 +41,8 @@ static unsigned ClangCallConvToLLVMCallC case CC_X86StdCall: return llvm::CallingConv::X86_StdCall; case CC_X86FastCall: return llvm::CallingConv::X86_FastCall; case CC_X86ThisCall: return llvm::CallingConv::X86_ThisCall; + case CC_X86_64Win64: return llvm::CallingConv::X86_64_Win64; + case CC_X86_64SysV: return llvm::CallingConv::X86_64_SysV; case CC_AAPCS: return llvm::CallingConv::ARM_AAPCS; case CC_AAPCS_VFP: return llvm::CallingConv::ARM_AAPCS_VFP; case CC_IntelOclBicc: return llvm::CallingConv::Intel_OCL_BI; Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp Sat Oct 12 15:56:13 2013 (r256382) @@ -3961,6 +3961,16 @@ static void handleCallConvAttr(Sema &S, PascalAttr(Attr.getRange(), S.Context, Attr.getAttributeSpellingListIndex())); return; + case AttributeList::AT_MSABI: + D->addAttr(::new (S.Context) + MSABIAttr(Attr.getRange(), S.Context, + Attr.getAttributeSpellingListIndex())); + return; + case AttributeList::AT_SysVABI: + D->addAttr(::new (S.Context) + SysVABIAttr(Attr.getRange(), S.Context, + Attr.getAttributeSpellingListIndex())); + return; case AttributeList::AT_Pcs: { PcsAttr::PCSType PCS; switch (CC) { @@ -4036,6 +4046,14 @@ bool Sema::CheckCallingConvAttr(const At case AttributeList::AT_StdCall: CC = CC_X86StdCall; break; case AttributeList::AT_ThisCall: CC = CC_X86ThisCall; break; case AttributeList::AT_Pascal: CC = CC_X86Pascal; break; + case AttributeList::AT_MSABI: + CC = Context.getTargetInfo().getTriple().isOSWindows() ? CC_C : + CC_X86_64Win64; + break; + case AttributeList::AT_SysVABI: + CC = Context.getTargetInfo().getTriple().isOSWindows() ? CC_X86_64SysV : + CC_C; + break; case AttributeList::AT_Pcs: { Expr *Arg = attr.getArg(0); StringLiteral *Str = dyn_cast(Arg); @@ -4876,6 +4894,8 @@ static void ProcessInheritableDeclAttr(S case AttributeList::AT_FastCall: case AttributeList::AT_ThisCall: case AttributeList::AT_Pascal: + case AttributeList::AT_MSABI: + case AttributeList::AT_SysVABI: case AttributeList::AT_Pcs: case AttributeList::AT_PnaclCall: case AttributeList::AT_IntelOclBicc: Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp Sat Oct 12 15:31:36 2013 (r256381) +++ stable/9/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp Sat Oct 12 15:56:13 2013 (r256382) @@ -105,6 +105,8 @@ static void diagnoseBadTypeAttribute(Sem case AttributeList::AT_StdCall: \ case AttributeList::AT_ThisCall: \ case AttributeList::AT_Pascal: \ + case AttributeList::AT_MSABI: \ + case AttributeList::AT_SysVABI: \ case AttributeList::AT_Regparm: \ case AttributeList::AT_Pcs: \ case AttributeList::AT_PnaclCall: \ @@ -3296,6 +3298,10 @@ static AttributeList::Kind getAttrListKi return AttributeList::AT_PnaclCall; case AttributedType::attr_inteloclbicc: return AttributeList::AT_IntelOclBicc; + case AttributedType::attr_ms_abi: + return AttributeList::AT_MSABI; + case AttributedType::attr_sysv_abi: + return AttributeList::AT_SysVABI; } llvm_unreachable("unexpected attribute kind!"); } From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 15:58:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9726A9CE; Sat, 12 Oct 2013 15:58:41 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E85723F5; Sat, 12 Oct 2013 15:58:41 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.16]) by ltcfislmsgpa01.fnfis.com (8.14.5/8.14.5) with ESMTP id r9CFweCB009492 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 12 Oct 2013 10:58:40 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.103]) by LTCFISWMSGHT05.FNFIS.com ([10.132.206.16]) with mapi id 14.02.0309.002; Sat, 12 Oct 2013 10:58:28 -0500 From: "Teske, Devin" To: Nathan Whitehorn Subject: Re: svn commit: r256343 - in head/usr.sbin/bsdinstall: . scripts Thread-Topic: svn commit: r256343 - in head/usr.sbin/bsdinstall: . scripts Thread-Index: AQHOx2PjW1uGCLtcyE2zUcTOTrV8Ig== Date: Sat, 12 Oct 2013 15:58:27 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D720FC5BB95@LTCFISWMSGMB21.FNFIS.com> References: <201310112041.r9BKfZeT002056@svn.freebsd.org> <5258F9B3.7030101@freebsd.org> In-Reply-To: <5258F9B3.7030101@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="us-ascii" Content-ID: <5A6AE30361AAC0468AC5F7B2EA23D851@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-10-12_01:2013-10-11,2013-10-12,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Oct 2013 15:58:41 -0000 On Oct 12, 2013, at 12:26 AM, Nathan Whitehorn wrote: > On 10/11/13 22:41, Devin Teske wrote: >> Author: dteske >> Date: Fri Oct 11 20:41:35 2013 >> New Revision: 256343 >> URL: https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.freebsd.= org/changeset/base/256343&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3DMrjs6= vR4%2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3DLDzuPpXPP4D5BzfISZjw%2BXitYn4aKVzfXzcrmM= NFo2U%3D%0A&s=3D3d0963d9c497f7bad0918888032ca62844580612dc48ab3a8a6768fe640= c365b >>=20 >> Log: >> Add zfsboot module as an option for automatic configuration. Default is >> to run interactively but it can be scripted too (optinally completely >> non-interactive). Currently supports GELI and all ZFS vdev types. Also >> performs validation on selections/settings providing error messages if >> necessary, explaining (in plain language) what the issue is. Currently >> the auto partitioning of naked disks only supports GPT and MBR (VTOC8 >> pending for sparc64), so is only available for i386/amd64 install. >>=20 >> Submitted by: Allan Jude , myself >> Reviewed by: Allan Jude >> Approved by: re (glebius) >=20 > Hi Devin -- >=20 > As was discussed on the mailing list, this patch still has some issues > that need to be resolved, Can you kindly provide links? I'm crawling through the mailing lists and not finding anything for the October, (current, stable, sysinstall, ... ?? = others?) Do I need to be looking back in September? I wouldn't think so, because that bit wasn't even in our development tree until October 1st: http://druidbsd.cvs.sf.net/viewvc/druidbsd/bsdinstall_zfs/usr.sbin%3A%3Absd= config%3A%3Ashare%3A%3Adevice.subr.patch?revision=3D1.1&view=3Dmarkup So there couldn't have been any discussion on it before then. So I'm just n= ot able to find the mailing lists where all the action is that they're discuss= ing it. Would be nice to find where the action is, so I could participate. > for example the use of camcontrol > unconditionally even when the disks may not be CAM Allan Adds: 9.2 should have all disks listed in camcontrol, so it shouldn't be an issue And: I think the only systems without cam based disks are old 8.x - we're only t= argeting 10 anyway. I tend to agree with those statements. > and destruction of > existing sub-partitioning for MBR disks. I think we both (Allan and I) actually responded directly to you on this on= e. We have code that handles that. It's in there. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 16:11:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8E29EE22; Sat, 12 Oct 2013 16:11:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 60EDF24A4; Sat, 12 Oct 2013 16:11:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CGBwJx008791; Sat, 12 Oct 2013 16:11:58 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CGBwKT008790; Sat, 12 Oct 2013 16:11:58 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310121611.r9CGBwKT008790@svn.freebsd.org> From: Dimitry Andric Date: Sat, 12 Oct 2013 16:11: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: r256384 - in stable: 7/contrib/binutils/bfd 8/contrib/binutils/bfd 9/contrib/binutils/bfd 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, 12 Oct 2013 16:11:58 -0000 Author: dim Date: Sat Oct 12 16:11:57 2013 New Revision: 256384 URL: http://svnweb.freebsd.org/changeset/base/256384 Log: MFC r255931: Fix a bug in ld, where indirect symbols are not handled properly during linking of a shared library, leading to corrupt indexes in the dynamic symbol table. This should fix the multimedia/ffmpegthumbnailer port. Reported by: swills Modified: stable/9/contrib/binutils/bfd/elflink.c Directory Properties: stable/9/contrib/binutils/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/binutils/bfd/elflink.c stable/8/contrib/binutils/bfd/elflink.c Directory Properties: stable/7/contrib/binutils/ (props changed) stable/8/contrib/binutils/ (props changed) Modified: stable/9/contrib/binutils/bfd/elflink.c ============================================================================== --- stable/9/contrib/binutils/bfd/elflink.c Sat Oct 12 16:03:31 2013 (r256383) +++ stable/9/contrib/binutils/bfd/elflink.c Sat Oct 12 16:11:57 2013 (r256384) @@ -488,12 +488,28 @@ bfd_elf_record_link_assignment (bfd *out if (h->root.u.undef.next != NULL || htab->root.undefs_tail == &h->root) bfd_link_repair_undef_list (&htab->root); } - - if (h->root.type == bfd_link_hash_new) + else if (h->root.type == bfd_link_hash_new) { bfd_elf_link_mark_dynamic_symbol (info, h, NULL); h->non_elf = 0; } + else if (h->root.type == bfd_link_hash_indirect) + { + const struct elf_backend_data *bed = get_elf_backend_data (output_bfd); + struct elf_link_hash_entry *hv = h; + do + hv = (struct elf_link_hash_entry *) hv->root.u.i.link; + while (hv->root.type == bfd_link_hash_indirect + || hv->root.type == bfd_link_hash_warning); + h->root.type = bfd_link_hash_undefined; + hv->root.type = bfd_link_hash_indirect; + hv->root.u.i.link = (struct bfd_link_hash_entry *) h; + (*bed->elf_backend_copy_indirect_symbol) (info, h, hv); + } + else if (h->root.type == bfd_link_hash_warning) + { + abort (); + } /* If this symbol is being provided by the linker script, and it is currently defined by a dynamic object, but not by a regular @@ -1417,10 +1433,10 @@ _bfd_elf_merge_symbol (bfd *abfd, case, we make the versioned symbol point to the normal one. */ const struct elf_backend_data *bed = get_elf_backend_data (abfd); flip->root.type = h->root.type; + flip->root.u.undef.abfd = h->root.u.undef.abfd; h->root.type = bfd_link_hash_indirect; h->root.u.i.link = (struct bfd_link_hash_entry *) flip; (*bed->elf_backend_copy_indirect_symbol) (info, flip, h); - flip->root.u.undef.abfd = h->root.u.undef.abfd; if (h->def_dynamic) { h->def_dynamic = 0; From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 16:11:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E3B73E23; Sat, 12 Oct 2013 16:11:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B7A5724A5; Sat, 12 Oct 2013 16:11:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CGBw7i008798; Sat, 12 Oct 2013 16:11:58 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CGBwPk008797; Sat, 12 Oct 2013 16:11:58 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310121611.r9CGBwPk008797@svn.freebsd.org> From: Dimitry Andric Date: Sat, 12 Oct 2013 16:11: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: r256384 - in stable: 7/contrib/binutils/bfd 8/contrib/binutils/bfd 9/contrib/binutils/bfd 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, 12 Oct 2013 16:11:59 -0000 Author: dim Date: Sat Oct 12 16:11:57 2013 New Revision: 256384 URL: http://svnweb.freebsd.org/changeset/base/256384 Log: MFC r255931: Fix a bug in ld, where indirect symbols are not handled properly during linking of a shared library, leading to corrupt indexes in the dynamic symbol table. This should fix the multimedia/ffmpegthumbnailer port. Reported by: swills Modified: stable/8/contrib/binutils/bfd/elflink.c Directory Properties: stable/8/contrib/binutils/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/binutils/bfd/elflink.c stable/9/contrib/binutils/bfd/elflink.c Directory Properties: stable/7/contrib/binutils/ (props changed) stable/9/contrib/binutils/ (props changed) Modified: stable/8/contrib/binutils/bfd/elflink.c ============================================================================== --- stable/8/contrib/binutils/bfd/elflink.c Sat Oct 12 16:03:31 2013 (r256383) +++ stable/8/contrib/binutils/bfd/elflink.c Sat Oct 12 16:11:57 2013 (r256384) @@ -438,9 +438,25 @@ bfd_elf_record_link_assignment (bfd *out if (h->root.type == bfd_link_hash_undefweak || h->root.type == bfd_link_hash_undefined) h->root.type = bfd_link_hash_new; - - if (h->root.type == bfd_link_hash_new) + else if (h->root.type == bfd_link_hash_new) h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF; + else if (h->root.type == bfd_link_hash_indirect) + { + const struct elf_backend_data *bed = get_elf_backend_data (output_bfd); + struct elf_link_hash_entry *hv = h; + do + hv = (struct elf_link_hash_entry *) hv->root.u.i.link; + while (hv->root.type == bfd_link_hash_indirect + || hv->root.type == bfd_link_hash_warning); + h->root.type = bfd_link_hash_undefined; + hv->root.type = bfd_link_hash_indirect; + hv->root.u.i.link = (struct bfd_link_hash_entry *) h; + (*bed->elf_backend_copy_indirect_symbol) (info, h, hv); + } + else if (h->root.type == bfd_link_hash_warning) + { + abort (); + } /* If this symbol is being provided by the linker script, and it is currently defined by a dynamic object, but not by a regular @@ -1142,10 +1158,10 @@ _bfd_elf_merge_symbol (bfd *abfd, case, we make the versioned symbol point to the normal one. */ const struct elf_backend_data *bed = get_elf_backend_data (abfd); flip->root.type = h->root.type; + flip->root.u.undef.abfd = h->root.u.undef.abfd; h->root.type = bfd_link_hash_indirect; h->root.u.i.link = (struct bfd_link_hash_entry *) flip; (*bed->elf_backend_copy_indirect_symbol) (bed, flip, h); - flip->root.u.undef.abfd = h->root.u.undef.abfd; if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) { h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC; From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 16:11:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 45955E25; Sat, 12 Oct 2013 16:11:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 18BBE24A6; Sat, 12 Oct 2013 16:11:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CGBwn9008805; Sat, 12 Oct 2013 16:11:58 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CGBwS5008804; Sat, 12 Oct 2013 16:11:58 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310121611.r9CGBwS5008804@svn.freebsd.org> From: Dimitry Andric Date: Sat, 12 Oct 2013 16:11:58 +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: r256384 - in stable: 7/contrib/binutils/bfd 8/contrib/binutils/bfd 9/contrib/binutils/bfd 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: Sat, 12 Oct 2013 16:11:59 -0000 Author: dim Date: Sat Oct 12 16:11:57 2013 New Revision: 256384 URL: http://svnweb.freebsd.org/changeset/base/256384 Log: MFC r255931: Fix a bug in ld, where indirect symbols are not handled properly during linking of a shared library, leading to corrupt indexes in the dynamic symbol table. This should fix the multimedia/ffmpegthumbnailer port. Reported by: swills Modified: stable/7/contrib/binutils/bfd/elflink.c Directory Properties: stable/7/contrib/binutils/ (props changed) Changes in other areas also in this revision: Modified: stable/8/contrib/binutils/bfd/elflink.c stable/9/contrib/binutils/bfd/elflink.c Directory Properties: stable/8/contrib/binutils/ (props changed) stable/9/contrib/binutils/ (props changed) Modified: stable/7/contrib/binutils/bfd/elflink.c ============================================================================== --- stable/7/contrib/binutils/bfd/elflink.c Sat Oct 12 16:03:31 2013 (r256383) +++ stable/7/contrib/binutils/bfd/elflink.c Sat Oct 12 16:11:57 2013 (r256384) @@ -438,9 +438,25 @@ bfd_elf_record_link_assignment (bfd *out if (h->root.type == bfd_link_hash_undefweak || h->root.type == bfd_link_hash_undefined) h->root.type = bfd_link_hash_new; - - if (h->root.type == bfd_link_hash_new) + else if (h->root.type == bfd_link_hash_new) h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF; + else if (h->root.type == bfd_link_hash_indirect) + { + const struct elf_backend_data *bed = get_elf_backend_data (output_bfd); + struct elf_link_hash_entry *hv = h; + do + hv = (struct elf_link_hash_entry *) hv->root.u.i.link; + while (hv->root.type == bfd_link_hash_indirect + || hv->root.type == bfd_link_hash_warning); + h->root.type = bfd_link_hash_undefined; + hv->root.type = bfd_link_hash_indirect; + hv->root.u.i.link = (struct bfd_link_hash_entry *) h; + (*bed->elf_backend_copy_indirect_symbol) (info, h, hv); + } + else if (h->root.type == bfd_link_hash_warning) + { + abort (); + } /* If this symbol is being provided by the linker script, and it is currently defined by a dynamic object, but not by a regular @@ -1142,10 +1158,10 @@ _bfd_elf_merge_symbol (bfd *abfd, case, we make the versioned symbol point to the normal one. */ const struct elf_backend_data *bed = get_elf_backend_data (abfd); flip->root.type = h->root.type; + flip->root.u.undef.abfd = h->root.u.undef.abfd; h->root.type = bfd_link_hash_indirect; h->root.u.i.link = (struct bfd_link_hash_entry *) flip; (*bed->elf_backend_copy_indirect_symbol) (bed, flip, h); - flip->root.u.undef.abfd = h->root.u.undef.abfd; if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) { h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC; From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 16:27:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5A9C5744; Sat, 12 Oct 2013 16:27:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qa0-x234.google.com (mail-qa0-x234.google.com [IPv6:2607:f8b0:400d:c00::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC7672537; Sat, 12 Oct 2013 16:27:24 +0000 (UTC) Received: by mail-qa0-f52.google.com with SMTP id w8so1230844qac.18 for ; Sat, 12 Oct 2013 09:27:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=V02VMdvtHDc5JkM+ByUtvUS2KyRjnZwN+lOMybkZ9Yc=; b=W+HMVIxxpco4I0/0My4pfV0GAl57gKd4RV7DvN5+47yghGP+3TAnVw98OEXYz4DCg4 qSyB6Og3+w11i3w6oXQg+2WUxOiRItV+IbtlSU76gW3RYKb2dhmbZfmLSi4KY5YKHvSa 1IK6OeJW70yU95vJVwtYu1dtStyNmmVwZia2PCkj7wAXEELNUwCnaCX2QnBqkomF5rri e7YZEwGLmpGgAJPzqoSVIJ/078bkpTL7UtkFMR6WJL4pIdGDE1khpBDDnRPlR6VR5rI3 DKUbfim1WPPTgyzXzOY0IzNcpFbSqFOO6UyBE/UFL9hwT7wFUad0qAcgI2qzABJHX7lU Wjnw== MIME-Version: 1.0 X-Received: by 10.224.51.131 with SMTP id d3mr24660947qag.0.1381595243783; Sat, 12 Oct 2013 09:27:23 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Sat, 12 Oct 2013 09:27:23 -0700 (PDT) In-Reply-To: <201310121257.r9CCvvjO006546@svn.freebsd.org> References: <201310121257.r9CCvvjO006546@svn.freebsd.org> Date: Sat, 12 Oct 2013 09:27:23 -0700 X-Google-Sender-Auth: ytLHBRCsJVNcpZp7O3x0TQkVl08 Message-ID: Subject: Re: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... From: Adrian Chadd To: Mark Murray 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" , "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, 12 Oct 2013 16:27:25 -0000 hihi, I've just test booted this on a MIPS board. It doesn't hang at boot waiting for entropy. http://people.freebsd.org/~adrian/mips/20131012-ar9344-boot-1.txt Thanks! -adrian On 12 October 2013 05:57, Mark Murray wrote: > Author: markm > Date: Sat Oct 12 12:57:57 2013 > New Revision: 256377 > URL: http://svnweb.freebsd.org/changeset/base/256377 > > Log: > Merge from project branch. Uninteresting commits are trimmed. > > Refactor of /dev/random device. Main points include: > > * Userland seeding is no longer used. This auto-seeds at boot time > on PC/Desktop setups; this may need some tweeking and intelligence > from those folks setting up embedded boxes, but the work is believed > to be minimal. > > * An entropy cache is written to /entropy (even during installation) > and the kernel uses this at next boot. > > * An entropy file written to /boot/entropy can be loaded by loader(8) > > * Hardware sources such as rdrand are fed into Yarrow, and are no > longer available raw. > > -----------------------------------------------------------------------= - > r256240 | des | 2013-10-09 21:14:16 +0100 (Wed, 09 Oct 2013) | 4 lines > > Add a RANDOM_RWFILE option and hide the entropy cache code behind it. > Rename YARROW_RNG and FORTUNA_RNG to RANDOM_YARROW and RANDOM_FORTUNA. > Add the RANDOM_* options to LINT. > > -----------------------------------------------------------------------= - > r256239 | des | 2013-10-09 21:12:59 +0100 (Wed, 09 Oct 2013) | 2 lines > > Define RANDOM_PURE_RNDTEST for rndtest(4). > > -----------------------------------------------------------------------= - > r256204 | des | 2013-10-09 18:51:38 +0100 (Wed, 09 Oct 2013) | 2 lines > > staticize struct random_hardware_source > > -----------------------------------------------------------------------= - > r256203 | markm | 2013-10-09 18:50:36 +0100 (Wed, 09 Oct 2013) | 2 line= s > > Wrap some policy-rich code in 'if NOTYET' until we can thresh out > what it really needs to do. > > -----------------------------------------------------------------------= - > r256184 | des | 2013-10-09 10:13:12 +0100 (Wed, 09 Oct 2013) | 2 lines > > Re-add /dev/urandom for compatibility purposes. > > -----------------------------------------------------------------------= - > r256182 | des | 2013-10-09 10:11:14 +0100 (Wed, 09 Oct 2013) | 3 lines > > Add missing include guards and move the existing ones out of the > implementation namespace. > > -----------------------------------------------------------------------= - > r256168 | markm | 2013-10-08 23:14:07 +0100 (Tue, 08 Oct 2013) | 10 lin= es > > Fix some just-noticed problems: > > o Allow this to work with "nodevice random" by fixing where the > MALLOC pool is defined. > > o Fix the explicit reseed code. This was correct as submitted, but > in the project branch doesn't need to set the "seeded" bit as this > is done correctly in the "unblock" function. > > o Remove some debug ifdeffing. > > o Adjust comments. > > -----------------------------------------------------------------------= - > r256159 | markm | 2013-10-08 19:48:11 +0100 (Tue, 08 Oct 2013) | 6 line= s > > Time to eat crow for me. > > I replaced the sx_* locks that Arthur used with regular mutexes; > this turned out the be the wrong thing to do as the locks need to > be sleepable. Revert this folly. > > # Submitted by: Arthur Mesh (In original > diff) > > -----------------------------------------------------------------------= - > r256138 | des | 2013-10-08 12:05:26 +0100 (Tue, 08 Oct 2013) | 10 lines > > Add YARROW_RNG and FORTUNA_RNG to sys/conf/options. > > Add a SYSINIT that forces a reseed during proc0 setup, which happens > fairly late in the boot process. > > Add a RANDOM_DEBUG option which enables some debugging printf()s. > > Add a new RANDOM_ATTACH entropy source which harvests entropy from the > get_cyclecount() delta across each call to a device attach method. > > -----------------------------------------------------------------------= - > r256135 | markm | 2013-10-08 07:54:52 +0100 (Tue, 08 Oct 2013) | 8 line= s > > Debugging. My attempt at EVENTHANDLER(multiuser) was a failure; use > EVENTHANDLER(mountroot) instead. > > This means we can't count on /var being present, so something will > need to be done about harvesting /var/db/entropy/... . > > Some policy now needs to be sorted out, and a pre-sync cache needs > to be written, but apart from that we are now ready to go. > > Over to review. > > -----------------------------------------------------------------------= - > r256094 | markm | 2013-10-06 23:45:02 +0100 (Sun, 06 Oct 2013) | 8 line= s > > Snapshot. > > Looking pretty good; this mostly works now. New code includes: > > * Read cached entropy at startup, both from files and from loader(8) > preloaded entropy. Failures are soft, but announced. Untested. > > * Use EVENTHANDLER to do above just before we go multiuser. Untested. > > -----------------------------------------------------------------------= - > r256088 | markm | 2013-10-06 14:01:42 +0100 (Sun, 06 Oct 2013) | 2 line= s > > Fix up the man page for random(4). This mainly removes no-longer-releva= nt > details about HW RNGs, reseeding explicitly and user-supplied > entropy. > > -----------------------------------------------------------------------= - > r256087 | markm | 2013-10-06 13:43:42 +0100 (Sun, 06 Oct 2013) | 6 line= s > > As userland writing to /dev/random is no more, remove the "better > than nothing" bootstrap mode. > > Add SWI harvesting to the mix. > > My box seeds Yarrow by itself in a few seconds! YMMV; more to follow. > > -----------------------------------------------------------------------= - > r256086 | markm | 2013-10-06 13:40:32 +0100 (Sun, 06 Oct 2013) | 11 lin= es > > Debug run. This now works, except that the "live" sources haven't > been tested. With all sources turned on, this unlocks itself in > a couple of seconds! That is no my box, and there is no guarantee > that this will be the case everywhere. > > * Cut debug prints. > > * Use the same locks/mutexes all the way through. > > * Be a tad more conservative about entropy estimates. > > -----------------------------------------------------------------------= - > r256084 | markm | 2013-10-06 13:35:29 +0100 (Sun, 06 Oct 2013) | 5 line= s > > Don't use the "real" assembler mnemonics; older compilers may not > understand them (like when building CURRENT on 9.x). > > # Submitted by: Konstantin Belousov > > -----------------------------------------------------------------------= - > r256081 | markm | 2013-10-06 10:55:28 +0100 (Sun, 06 Oct 2013) | 12 lin= es > > SNAPSHOT. > > Simplify the malloc pools; We only need one for this device. > > Simplify the harvest queue. > > Marginally improve the entropy pool hashing, making it a bit faster > in the process. > > Connect up the hardware "live" source harvesting. This is simplistic > for now, and will need to be made rate-adaptive. > > All of the above passes a compile test but needs to be debugged. > > -----------------------------------------------------------------------= - > r256042 | markm | 2013-10-04 07:55:06 +0100 (Fri, 04 Oct 2013) | 25 lin= es > > Snapshot. This passes the build test, but has not yet been finished or > debugged. > > Contains: > > * Refactor the hardware RNG CPU instruction sources to feed into > the software mixer. This is unfinished. The actual harvesting needs > to be sorted out. Modified by me (see below). > > * Remove 'frac' parameter from random_harvest(). This was never > used and adds extra code for no good reason. > > * Remove device write entropy harvesting. This provided a weak > attack vector, was not very good at bootstrapping the device. To > follow will be a replacement explicit reseed knob. > > * Separate out all the RANDOM_PURE sources into separate harvest > entities. This adds some secuity in the case where more than one > is present. > > * Review all the code and fix anything obviously messy or inconsistent. > Address som review concerns while I'm here, like rename the pseudo-rng > to 'dummy'. > > # Submitted by: Arthur Mesh (the first > item) > > -----------------------------------------------------------------------= - > r255319 | markm | 2013-09-06 18:51:52 +0100 (Fri, 06 Sep 2013) | 4 line= s > > Yarrow wants entropy estimations to be conservative; the usual idea > is that if you are certain you have N bits of entropy, you declare > N/2. > > -----------------------------------------------------------------------= - > r255075 | markm | 2013-08-30 18:47:53 +0100 (Fri, 30 Aug 2013) | 4 line= s > > Remove short-lived idea; thread to harvest (eg) RDRAND enropy into the > usual harvest queues. It was a nifty idea, but too heavyweight. > > # Submitted by: Arthur Mesh > > -----------------------------------------------------------------------= - > r255071 | markm | 2013-08-30 12:42:57 +0100 (Fri, 30 Aug 2013) | 4 line= s > > Separate out the Software RNG entropy harvesting queue and thread > into its own files. > > # Submitted by: Arthur Mesh > > -----------------------------------------------------------------------= - > r254934 | markm | 2013-08-26 20:07:03 +0100 (Mon, 26 Aug 2013) | 2 line= s > > Remove the short-lived namei experiment. > > -----------------------------------------------------------------------= - > r254928 | markm | 2013-08-26 19:35:21 +0100 (Mon, 26 Aug 2013) | 2 line= s > > Snapshot; Do some running repairs on entropy harvesting. More needs > to follow. > > -----------------------------------------------------------------------= - > r254927 | markm | 2013-08-26 19:29:51 +0100 (Mon, 26 Aug 2013) | 15 lin= es > > Snapshot of current work; > > 1) Clean up namespace; only use "Yarrow" where it is Yarrow-specific > or close enough to the Yarrow algorithm. For the rest use a neutral > name. > > 2) Tidy up headers; put private stuff in private places. More could > be done here. > > 3) Streamline the hashing/encryption; no need for a 256-bit counter; > 128 bits will last for long enough. > > There are bits of debug code lying around; these will be removed > at a later stage. > > -----------------------------------------------------------------------= - > r254784 | markm | 2013-08-24 14:54:56 +0100 (Sat, 24 Aug 2013) | 39 lin= es > > 1) example (partially humorous random_adaptor, that I call "EXAMPLE") > * It's not meant to be used in a real system, it's there to show how > the basics of how to create interfaces for random_adaptors. Perhaps > it should belong in a manual page > > 2) Move probe.c's functionality in to random_adaptors.c > * rename random_ident_hardware() to random_adaptor_choose() > > 3) Introduce a new way to choose (or select) random_adaptors via tunabl= e > "rngs_want" It's a list of comma separated names of adaptors, ordered > by preferences. I.e.: > rngs_want=3D"yarrow,rdrand" > > Such setting would cause yarrow to be preferred to rdrand. If neither o= f > them are available (or registered), then system will default to > something reasonable (currently yarrow). If yarrow is not present, then > we fall back to the adaptor that's first on the list of registered > adaptors. > > 4) Introduce a way where RNGs can play a role of entropy source. This i= s > mostly useful for HW rngs. > > The way I envision this is that every HW RNG will use this > functionality by default. Functionality to disable this is also present= . > I have an example of how to use this in random_adaptor_example.c (see > modload event, and init function) > > 5) fix kern.random.adaptors from > kern.random.adaptors: yarrowpanicblock > to > kern.random.adaptors: yarrow,panic,block > > 6) add kern.random.active_adaptor to indicate currently selected > adaptor: > root@freebsd04:~ # sysctl kern.random.active_adaptor > kern.random.active_adaptor: yarrow > > # Submitted by: Arthur Mesh > > Submitted by: Dag-Erling Sm=F8rgrav , Arthur Mesh < > arthurmesh@gmail.com> > Reviewed by: des@FreeBSD.org > Approved by: re (delphij) > Approved by: secteam (des,delphij) > > Added: > head/sys/dev/random/dummy_rng.c > - copied unchanged from r256243, > projects/random_number_generator/sys/dev/random/dummy_rng.c > head/sys/dev/random/live_entropy_sources.c > - copied unchanged from r256243, > projects/random_number_generator/sys/dev/random/live_entropy_sources.c > head/sys/dev/random/live_entropy_sources.h > - copied unchanged from r256243, > projects/random_number_generator/sys/dev/random/live_entropy_sources.h > head/sys/dev/random/rwfile.c > - copied unchanged from r256243, > projects/random_number_generator/sys/dev/random/rwfile.c > head/sys/dev/random/rwfile.h > - copied unchanged from r256243, > projects/random_number_generator/sys/dev/random/rwfile.h > Deleted: > head/sys/dev/random/pseudo_rng.c > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/initrandom > head/share/examples/kld/random_adaptor/random_adaptor_example.c > (contents, props changed) > head/share/man/man4/random.4 > head/sys/boot/forth/loader.conf > head/sys/conf/NOTES > head/sys/conf/files > head/sys/conf/files.amd64 > head/sys/conf/files.i386 > head/sys/conf/options > head/sys/dev/glxsb/glxsb.c > head/sys/dev/hifn/hifn7751.c > head/sys/dev/random/harvest.c > head/sys/dev/random/hash.h > head/sys/dev/random/ivy.c > head/sys/dev/random/nehemiah.c > head/sys/dev/random/random_adaptors.c > head/sys/dev/random/random_adaptors.h > head/sys/dev/random/random_harvestq.c > head/sys/dev/random/random_harvestq.h > head/sys/dev/random/randomdev.c > head/sys/dev/random/randomdev.h > head/sys/dev/random/randomdev_soft.c > head/sys/dev/random/randomdev_soft.h > head/sys/dev/random/yarrow.c > head/sys/dev/random/yarrow.h > head/sys/dev/rndtest/rndtest.c > head/sys/dev/safe/safe.c > head/sys/dev/syscons/scmouse.c > head/sys/dev/syscons/syscons.c > head/sys/dev/ubsec/ubsec.c > head/sys/kern/kern_intr.c > head/sys/kern/subr_bus.c > head/sys/mips/cavium/octeon_rnd.c > head/sys/modules/random/Makefile > head/sys/net/if_ethersubr.c > head/sys/net/if_tun.c > head/sys/netgraph/ng_iface.c > head/sys/sys/random.h > Directory Properties: > head/ (props changed) > > Modified: head/etc/defaults/rc.conf > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/defaults/rc.conf Sat Oct 12 12:34:19 2013 (r256376) > +++ head/etc/defaults/rc.conf Sat Oct 12 12:57:57 2013 (r256377) > @@ -651,6 +651,7 @@ entropy_save_num=3D"8" # Number of entropy > harvest_interrupt=3D"YES" # Entropy device harvests interrupt > randomness > harvest_ethernet=3D"YES" # Entropy device harvests ethernet randomness > harvest_p_to_p=3D"YES" # Entropy device harvests point-to-point random= ness > +harvest_swi=3D"YES" # Entropy device harvests internal SWI randomne= ss > dmesg_enable=3D"YES" # Save dmesg(8) to /var/run/dmesg.boot > watchdogd_enable=3D"NO" # Start the software watchdog daemon > watchdogd_flags=3D"" # Flags to watchdogd (if enabled) > > Modified: head/etc/rc.d/initrandom > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/rc.d/initrandom Sat Oct 12 12:34:19 2013 (r256376) > +++ head/etc/rc.d/initrandom Sat Oct 12 12:57:57 2013 (r256377) > @@ -14,26 +14,6 @@ name=3D"initrandom" > start_cmd=3D"initrandom_start" > stop_cmd=3D":" > > -feed_dev_random() > -{ > - if [ -f "${1}" -a -r "${1}" -a -s "${1}" ]; then > - cat "${1}" | dd of=3D/dev/random bs=3D8k 2>/dev/null > - fi > -} > - > -better_than_nothing() > -{ > - # XXX temporary until we can improve the entropy > - # harvesting rate. > - # Entropy below is not great, but better than nothing. > - # This unblocks the generator at startup > - # Note: commands are ordered to cause the most variance across > reboots. > - ( kenv; dmesg; df -ib; ps -fauxww; date; sysctl -a ) \ > - | dd of=3D/dev/random bs=3D8k 2>/dev/null > - /sbin/sha256 -q `sysctl -n kern.bootfile` \ > - | dd of=3D/dev/random bs=3D8k 2>/dev/null > -} > - > initrandom_start() > { > soft_random_generator=3D`sysctl kern.random 2>/dev/null` > @@ -63,23 +43,15 @@ initrandom_start() > else > ${SYSCTL} > kern.random.sys.harvest.point_to_point=3D0 >/dev/null > fi > - fi > > - # First pass at reseeding /dev/random. > - # > - case ${entropy_file} in > - [Nn][Oo] | '') > - ;; > - *) > - if [ -w /dev/random ]; then > - feed_dev_random "${entropy_file}" > + if checkyesno harvest_swi; then > + ${SYSCTL} kern.random.sys.harvest.swi=3D1 > >/dev/null > + echo -n ' swi' > + else > + ${SYSCTL} kern.random.sys.harvest.swi=3D0 > >/dev/null > fi > - ;; > - esac > - > - better_than_nothing > + fi > > - echo -n ' kickstart' > fi > > echo '.' > > Modified: head/share/examples/kld/random_adaptor/random_adaptor_example.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/examples/kld/random_adaptor/random_adaptor_example.c > Sat Oct 12 12:34:19 2013 (r256376) > +++ head/share/examples/kld/random_adaptor/random_adaptor_example.c > Sat Oct 12 12:57:57 2013 (r256377) > @@ -30,32 +30,29 @@ __FBSDID("$FreeBSD$"); > > #include > #include > +#include > #include > -#include > +#include > #include > > +#include > #include > #include > > -#define RNG_NAME "example" > - > static int random_example_read(void *, int); > > struct random_adaptor random_example =3D { > .ident =3D "Example RNG", > - .init =3D (random_init_func_t *)random_null_func, > - .deinit =3D (random_deinit_func_t *)random_null_func, > + .source =3D RANDOM_PURE_BOGUS, /* Make sure this is in > + * sys/random.h and is unique */ > .read =3D random_example_read, > - .write =3D (random_write_func_t *)random_null_func, > - .reseed =3D (random_reseed_func_t *)random_null_func, > - .seeded =3D 1, > }; > > /* > * Used under the license provided @ http://xkcd.com/221/ > * http://creativecommons.org/licenses/by-nc/2.5/ > */ > -static u_char > +static uint8_t > getRandomNumber(void) > { > return 4; /* chosen by fair dice roll, guaranteed to be random = */ > @@ -64,14 +61,13 @@ getRandomNumber(void) > static int > random_example_read(void *buf, int c) > { > - u_char *b; > + uint8_t *b; > int count; > > b =3D buf; > > - for (count =3D 0; count < c; count++) { > + for (count =3D 0; count < c; count++) > b[count] =3D getRandomNumber(); > - } > > printf("returning %d bytes of pure randomness\n", c); > return (c); > @@ -80,15 +76,26 @@ random_example_read(void *buf, int c) > static int > random_example_modevent(module_t mod, int type, void *unused) > { > + int error =3D 0; > > switch (type) { > case MOD_LOAD: > - random_adaptor_register(RNG_NAME, &random_example); > - EVENTHANDLER_INVOKE(random_adaptor_attach, > &random_example); > - return (0); > + live_entropy_source_register(&random_example); > + break; > + > + case MOD_UNLOAD: > + live_entropy_source_deregister(&random_example); > + break; > + > + case MOD_SHUTDOWN: > + break; > + > + default: > + error =3D EOPNOTSUPP; > + break; > } > > - return (EINVAL); > + return (error); > } > > -RANDOM_ADAPTOR_MODULE(random_example, random_example_modevent, 1); > +LIVE_ENTROPY_SRC_MODULE(live_entropy_source_example, > random_example_modevent, 1); > > Modified: head/share/man/man4/random.4 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/man/man4/random.4 Sat Oct 12 12:34:19 2013 > (r256376) > +++ head/share/man/man4/random.4 Sat Oct 12 12:57:57 2013 > (r256377) > @@ -1,4 +1,4 @@ > -.\" Copyright (c) 2001 Mark R V Murray. All rights reserved. > +.\" Copyright (c) 2001-2013 Mark R V Murray. All rights reserved. > .\" > .\" Redistribution and use in source and binary forms, with or without > .\" modification, are permitted provided that the following conditions > @@ -23,7 +23,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd August 7, 2013 > +.Dd October 12, 2013 > .Dt RANDOM 4 > .Os > .Sh NAME > @@ -43,35 +43,48 @@ The device will probe for > certain hardware entropy sources, > and use these in preference to the fallback, > which is a generator implemented in software. > -If the kernel environment MIB's > -.Va hw.nehemiah_rng_enable > -or > -.Va hw.ivy_rng_enable > -are set to > -.Dq Li 0 , > -the associated hardware entropy source will be ignored. > -.Pp > -If the device is using > -the software generator, > -writing data to > -.Nm > -would perturb the internal state. > -This perturbation of the internal state > -is the only userland method of introducing > -extra entropy into the device. > -If the writer has superuser privilege, > -then closing the device after writing > -will make the software generator reseed itself. > -This can be used for extra security, > -as it immediately introduces any/all new entropy > -into the PRNG. > -The hardware generators will generate > -sufficient quantities of entropy, > -and will therefore ignore user-supplied input. > -The software > -.Nm > -device may be controlled with > -.Xr sysctl 8 . > +.Pp > +The software generator will start in an > +.Em unseeded > +state, and will block reads until > +it is (re)seeded. > +This may cause trouble at system boot > +when keys and the like > +are generated from > +/dev/random > +so steps should be taken to ensure a > +reseed as soon as possible. > +The > +.Xr sysctl 8 > +controlling the > +.Em seeded > +status (see below) may be used > +if security is not an issue > +or for convenience > +during setup or development. > +.Pp > +This initial seeding > +of random number generators > +is a bootstrapping problem > +that needs very careful attention. > +In some cases, > +it may be difficult > +to find enough randomness > +to seed a random number generator > +until a system is fully operational, > +but the system requires random numbers > +to become fully operational. > +It is (or more accurately should be) > +critically important that the > +.Nm > +device is seeded > +before the first time it is used. > +In the case where a dummy or "blocking-only" > +device is used, > +it is the responsibility > +of the system architect > +to ensure that no blocking reads > +hold up critical processes. > .Pp > To see the current settings of the software > .Nm > @@ -81,22 +94,20 @@ device, use the command line: > .Pp > which results in something like: > .Bd -literal -offset indent > -kern.random.adaptors: yarrow > +kern.random.adaptors: yarrow,dummy > +kern.random.active_adaptor: yarrow > +kern.random.yarrow.gengateinterval: 10 > +kern.random.yarrow.bins: 10 > +kern.random.yarrow.fastthresh: 96 > +kern.random.yarrow.slowthresh: 128 > +kern.random.yarrow.slowoverthresh: 2 > kern.random.sys.seeded: 1 > kern.random.sys.harvest.ethernet: 1 > kern.random.sys.harvest.point_to_point: 1 > kern.random.sys.harvest.interrupt: 1 > -kern.random.sys.harvest.swi: 0 > -kern.random.yarrow.gengateinterval: 10 > -kern.random.yarrow.bins: 10 > -kern.random.yarrow.fastthresh: 192 > -kern.random.yarrow.slowthresh: 256 > -kern.random.yarrow.slowoverthresh: 2 > +kern.random.sys.harvest.swi: 1 > .Ed > .Pp > -(These would not be seen if a > -hardware generator is present.) > -.Pp > Other than > .Dl kern.random.adaptors > all settings are read/write. > @@ -107,9 +118,10 @@ variable indicates whether or not the > .Nm > device is in an acceptably secure state > as a result of reseeding. > -If set to 0, the device will block (on read) until the next reseed > -(which can be from an explicit write, > -or as a result of entropy harvesting). > +If set to 0, > +the device will block (on read) > +until the next reseed > +as a result of entropy harvesting. > A reseed will set the value to 1 (non-blocking). > .Pp > The > @@ -276,19 +288,6 @@ the generator produce independent sequen > However, the guessability or reproducibility of the sequence is > unimportant, > unlike the previous cases. > .Pp > -One final consideration for the seeding of random number generators > -is a bootstrapping problem. > -In some cases, it may be difficult to find enough randomness to > -seed a random number generator until a system is fully operational, > -but the system requires random numbers to become fully operational. > -There is no substitute for careful thought here, > -but the > -.Fx > -.Nm > -device, > -which is based on the Yarrow system, > -should be of some help in this area. > -.Pp > .Fx > does also provide the traditional > .Xr rand 3 > @@ -325,17 +324,7 @@ and is an implementation of the > .Em Yarrow > algorithm by Bruce Schneier, > .Em et al . > -The only hardware implementations > -currently are for the > -.Tn VIA C3 Nehemiah > -(stepping 3 or greater) > -CPU > -and the > -.Tn Intel > -.Dq Bull Mountain > -.Em RdRand > -instruction and underlying random number generator (RNG). > -More will be added in the future. > +Significant infrastructure work was done by Arthur Mesh. > .Pp > The author gratefully acknowledges > significant assistance from VIA Technologies, Inc. > > Modified: head/sys/boot/forth/loader.conf > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/boot/forth/loader.conf Sat Oct 12 12:34:19 2013 > (r256376) > +++ head/sys/boot/forth/loader.conf Sat Oct 12 12:57:57 2013 > (r256377) > @@ -39,6 +39,17 @@ bitmap_type=3D"splash_image_data" # and pl > > > ############################################################## > +### Random number generator configuration ################### > +############################################################## > + > +entropy_cache_load=3D"NO" # Set this to YES to lo= ad > entropy at boot time > +entropy_cache_name=3D"/boot/entropy" # Set this to the name of the f= ile > +entropy_cache_type=3D"/boot/entropy" > +#kern.random.sys.seeded=3D"0" # Set this to 1 to start > /dev/random > + # without waiting for a (re)seed. > + > + > +############################################################## > ### Loader settings ######################################## > ############################################################## > > > Modified: head/sys/conf/NOTES > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/NOTES Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/conf/NOTES Sat Oct 12 12:57:57 2013 (r256377) > @@ -2962,3 +2962,8 @@ options RCTL > options BROOKTREE_ALLOC_PAGES=3D(217*4+1) > options MAXFILES=3D999 > > +# Random number generator > +options RANDOM_YARROW # Yarrow RNG > +##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented > +options RANDOM_DEBUG # Debugging messages > +options RANDOM_RWFILE # Read and write entropy cache > > Modified: head/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 > --- head/sys/conf/files Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/conf/files Sat Oct 12 12:57:57 2013 (r256377) > @@ -2043,13 +2043,15 @@ rt2860.fw optional rt2860fw > | ralfw \ > no-obj no-implicit-rule \ > clean "rt2860.fw" > dev/random/harvest.c standard > -dev/random/hash.c optional random > -dev/random/pseudo_rng.c standard > +dev/random/dummy_rng.c standard > dev/random/random_adaptors.c standard > -dev/random/random_harvestq.c standard > +dev/random/live_entropy_sources.c optional random > +dev/random/random_harvestq.c optional random > dev/random/randomdev.c optional random > dev/random/randomdev_soft.c optional random > dev/random/yarrow.c optional random > +dev/random/hash.c optional random > +dev/random/rwfile.c optional random > dev/rc/rc.c optional rc > dev/re/if_re.c optional re > dev/rndtest/rndtest.c optional rndtest > > Modified: head/sys/conf/files.amd64 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/files.amd64 Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/conf/files.amd64 Sat Oct 12 12:57:57 2013 (r256377) > @@ -259,8 +259,8 @@ dev/nvme/nvme_sysctl.c optional > nvme > dev/nvme/nvme_test.c optional nvme > dev/nvme/nvme_util.c optional nvme > dev/nvram/nvram.c optional nvram isa > -dev/random/ivy.c optional random rdrand_rng > -dev/random/nehemiah.c optional random padlock_rng > +dev/random/ivy.c optional rdrand_rng > +dev/random/nehemiah.c optional padlock_rng > dev/qlxge/qls_dbg.c optional qlxge pci > dev/qlxge/qls_dump.c optional qlxge pci > dev/qlxge/qls_hw.c optional qlxge pci > > Modified: head/sys/conf/files.i386 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/files.i386 Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/conf/files.i386 Sat Oct 12 12:57:57 2013 (r256377) > @@ -257,8 +257,8 @@ dev/nvme/nvme_test.c optional nvme > dev/nvme/nvme_util.c optional nvme > dev/nvram/nvram.c optional nvram isa > dev/pcf/pcf_isa.c optional pcf > -dev/random/ivy.c optional random rdrand_rng > -dev/random/nehemiah.c optional random padlock_rng > +dev/random/ivy.c optional rdrand_rng > +dev/random/nehemiah.c optional padlock_rng > dev/sbni/if_sbni.c optional sbni > dev/sbni/if_sbni_isa.c optional sbni isa > dev/sbni/if_sbni_pci.c optional sbni pci > > Modified: head/sys/conf/options > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/options Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/conf/options Sat Oct 12 12:57:57 2013 (r256377) > @@ -904,3 +904,9 @@ RACCT opt_global.h > > # Resource Limits > RCTL opt_global.h > + > +# Random number generator(s) > +RANDOM_YARROW opt_random.h > +RANDOM_FORTUNA opt_random.h > +RANDOM_DEBUG opt_random.h > +RANDOM_RWFILE opt_random.h > > Modified: head/sys/dev/glxsb/glxsb.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/glxsb/glxsb.c Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/dev/glxsb/glxsb.c Sat Oct 12 12:57:57 2013 (r256377) > @@ -476,7 +476,7 @@ glxsb_rnd(void *v) > if (status & SB_RNS_TRNG_VALID) { > value =3D bus_read_4(sc->sc_sr, SB_RANDOM_NUM); > /* feed with one uint32 */ > - random_harvest(&value, 4, 32/2, 0, RANDOM_PURE); > + random_harvest(&value, 4, 32/2, RANDOM_PURE_GLXSB); > } > > callout_reset(&sc->sc_rngco, sc->sc_rnghz, glxsb_rnd, sc); > > Modified: head/sys/dev/hifn/hifn7751.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/hifn/hifn7751.c Sat Oct 12 12:34:19 2013 > (r256376) > +++ head/sys/dev/hifn/hifn7751.c Sat Oct 12 12:57:57 2013 > (r256377) > @@ -258,7 +258,7 @@ hifn_partname(struct hifn_softc *sc) > static void > default_harvest(struct rndtest_state *rsp, void *buf, u_int count) > { > - random_harvest(buf, count, count*NBBY/2, 0, RANDOM_PURE); > + random_harvest(buf, count, count*NBBY/2, RANDOM_PURE_HIFN); > } > > static u_int > > Copied: head/sys/dev/random/dummy_rng.c (from r256243, > projects/random_number_generator/sys/dev/random/dummy_rng.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 > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/random/dummy_rng.c Sat Oct 12 12:57:57 2013 > (r256377, copy of r256243, > projects/random_number_generator/sys/dev/random/dummy_rng.c) > @@ -0,0 +1,123 @@ > +/*- > + * Copyright (c) 2013 Arthur Mesh > + * 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 > + * in this position and unchanged. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in th= e > + * documentation and/or other materials provided with the distributio= n. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED > WARRANTIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIME= D. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, > BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF > USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * > + */ > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +static struct mtx dummy_random_mtx; > + > +/* Used to fake out unused random calls in random_adaptor */ > +static void > +random_null_func(void) > +{ > +} > + > +static int > +dummy_random_poll(int events __unused, struct thread *td __unused) > +{ > + > + return (0); > +} > + > +static int > +dummy_random_block(int flag) > +{ > + int error =3D 0; > + > + mtx_lock(&dummy_random_mtx); > + > + /* Blocking logic */ > + while (!error) { > + if (flag & O_NONBLOCK) > + error =3D EWOULDBLOCK; > + else { > + printf("random: dummy device blocking on read.\n"= ); > + error =3D msleep(&dummy_random_block, > + &dummy_random_mtx, > + PUSER | PCATCH, "block", 0); > + } > + } > + mtx_unlock(&dummy_random_mtx); > + > + return (error); > +} > + > +static void > +dummy_random_init(void) > +{ > + > + mtx_init(&dummy_random_mtx, "sleep mtx for dummy_random", > + NULL, MTX_DEF); > +} > + > +static void > +dummy_random_deinit(void) > +{ > + > + mtx_destroy(&dummy_random_mtx); > +} > + > +struct random_adaptor dummy_random =3D { > + .ident =3D "Dummy entropy device that always blocks", > + .init =3D dummy_random_init, > + .deinit =3D dummy_random_deinit, > + .block =3D dummy_random_block, > + .poll =3D dummy_random_poll, > + .read =3D (random_read_func_t *)random_null_func, > + .reseed =3D (random_reseed_func_t *)random_null_func, > + .seeded =3D 0, /* This device can never be seeded */ > +}; > + > +static int > +dummy_random_modevent(module_t mod __unused, int type, void *unused > __unused) > +{ > + > + switch (type) { > + case MOD_LOAD: > + random_adaptor_register("dummy", &dummy_random); > + EVENTHANDLER_INVOKE(random_adaptor_attach, > + &dummy_random); > + > + return (0); > + } > + > + return (EINVAL); > +} > + > +RANDOM_ADAPTOR_MODULE(dummy, dummy_random_modevent, 1); > > Modified: head/sys/dev/random/harvest.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/harvest.c Sat Oct 12 12:34:19 2013 > (r256376) > +++ head/sys/dev/random/harvest.c Sat Oct 12 12:57:57 2013 > (r256377) > @@ -48,20 +48,20 @@ __FBSDID("$FreeBSD$"); > static int read_random_phony(void *, int); > > /* Structure holding the desired entropy sources */ > -struct harvest_select harvest =3D { 1, 1, 1, 0 }; > +struct harvest_select harvest =3D { 1, 1, 1, 1 }; > static int warned =3D 0; > > /* hold the address of the routine which is actually called if > * the randomdev is loaded > */ > -static void (*reap_func)(u_int64_t, const void *, u_int, u_int, u_int, > +static void (*reap_func)(u_int64_t, const void *, u_int, u_int, > enum esource) =3D NULL; > static int (*read_func)(void *, int) =3D read_random_phony; > > /* Initialise the harvester at load time */ > void > randomdev_init_harvester(void (*reaper)(u_int64_t, const void *, u_int, > - u_int, u_int, enum esource), int (*reader)(void *, int)) > + u_int, enum esource), int (*reader)(void *, int)) > { > reap_func =3D reaper; > read_func =3D reader; > @@ -86,12 +86,10 @@ randomdev_deinit_harvester(void) > * read which can be quite expensive. > */ > void > -random_harvest(void *entropy, u_int count, u_int bits, u_int frac, > - enum esource origin) > +random_harvest(void *entropy, u_int count, u_int bits, enum esource > origin) > { > if (reap_func) > - (*reap_func)(get_cyclecount(), entropy, count, bits, frac= , > - origin); > + (*reap_func)(get_cyclecount(), entropy, count, bits, > origin); > } > > /* Userland-visible version of read_random */ > > Modified: head/sys/dev/random/hash.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=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/hash.h Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/dev/random/hash.h Sat Oct 12 12:57:57 2013 (r256377) > @@ -26,6 +26,9 @@ > * $FreeBSD$ > */ > > +#ifndef SYS_DEV_RANDOM_HASH_H_INCLUDED > +#define SYS_DEV_RANDOM_HASH_H_INCLUDED > + > #define KEYSIZE 32 /* (in bytes) =3D=3D 256 bits */ > #define BLOCKSIZE 16 /* (in bytes) =3D=3D 128 bits */ > > @@ -43,3 +46,5 @@ void randomdev_hash_iterate(struct rando > void randomdev_hash_finish(struct randomdev_hash *, void *); > void randomdev_encrypt_init(struct randomdev_key *, void *); > void randomdev_encrypt(struct randomdev_key *context, void *, void *, > unsigned); > + > +#endif > > Modified: head/sys/dev/random/ivy.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/ivy.c Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/dev/random/ivy.c Sat Oct 12 12:57:57 2013 (r256377) > @@ -30,38 +30,35 @@ > __FBSDID("$FreeBSD$"); > > #include > -#include > #include > #include > +#include > #include > -#include > +#include > #include > #include > > #include > #include > > -#include > #include > +#include > +#include > +#include > +#include > > #define RETRY_COUNT 10 > > -static void random_ivy_init(void); > -static void random_ivy_deinit(void); > static int random_ivy_read(void *, int); > > -struct random_adaptor random_ivy =3D { > +static struct random_hardware_source random_ivy =3D { > .ident =3D "Hardware, Intel IvyBridge+ RNG", > - .init =3D random_ivy_init, > - .deinit =3D random_ivy_deinit, > - .read =3D random_ivy_read, > - .write =3D (random_write_func_t *)random_null_func, > - .reseed =3D (random_reseed_func_t *)random_null_func, > - .seeded =3D 1, > + .source =3D RANDOM_PURE_RDRAND, > + .read =3D random_ivy_read > }; > > static inline int > -ivy_rng_store(long *tmp) > +ivy_rng_store(uint64_t *tmp) > { > #ifdef __GNUCLIKE_ASM > uint32_t count; > @@ -86,34 +83,26 @@ ivy_rng_store(long *tmp) > #endif > } > > -static void > -random_ivy_init(void) > -{ > -} > - > -void > -random_ivy_deinit(void) > -{ > -} > - > static int > random_ivy_read(void *buf, int c) > { > - char *b; > - long tmp; > - int count, res, retry; > + uint8_t *b; > + int count, ret, retry; > + uint64_t tmp; > > - for (count =3D c, b =3D buf; count > 0; count -=3D res, b +=3D re= s) { > + b =3D buf; > + for (count =3D c; count > 0; count -=3D ret) { > for (retry =3D 0; retry < RETRY_COUNT; retry++) { > - res =3D ivy_rng_store(&tmp); > - if (res !=3D 0) > + ret =3D ivy_rng_store(&tmp); > + if (ret !=3D 0) > break; > } > - if (res =3D=3D 0) > + if (ret =3D=3D 0) > break; > - if (res > count) > - res =3D count; > - memcpy(b, &tmp, res); > + if (ret > count) > + ret =3D count; > + memcpy(b, &tmp, ret); > + b +=3D ret; > } > return (c - count); > } > @@ -121,25 +110,35 @@ random_ivy_read(void *buf, int c) > static int > rdrand_modevent(module_t mod, int type, void *unused) > { > + int error =3D 0; > > switch (type) { > case MOD_LOAD: > - if (cpu_feature2 & CPUID2_RDRAND) { > - random_adaptor_register("rdrand", &random_ivy); > - EVENTHANDLER_INVOKE(random_adaptor_attach, > &random_ivy); > - return (0); > - } else { > + if (cpu_feature2 & CPUID2_RDRAND) > + live_entropy_source_register(&random_ivy); > + else > #ifndef KLD_MODULE > if (bootverbose) > #endif > - printf( > - "%s: RDRAND feature is not present on this > CPU\n", > + printf("%s: RDRAND is not present\n", > random_ivy.ident); > - return (0); > - } > + break; > + > + case MOD_UNLOAD: > + if (cpu_feature2 & CPUID2_RDRAND) > + live_entropy_source_deregister(&random_ivy); > + break; > + > + case MOD_SHUTDOWN: > + break; > + > + default: > + error =3D EOPNOTSUPP; > + break; > + > } > > - return (EINVAL); > + return (error); > } > > -RANDOM_ADAPTOR_MODULE(random_rdrand, rdrand_modevent, 1); > +LIVE_ENTROPY_SRC_MODULE(random_rdrand, rdrand_modevent, 1); > > Copied: head/sys/dev/random/live_entropy_sources.c (from r256243, > projects/random_number_generator/sys/dev/random/live_entropy_sources.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 > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/random/live_entropy_sources.c Sat Oct 12 12:57:57 2013 > (r256377, copy of r256243, > projects/random_number_generator/sys/dev/random/live_entropy_sources.c) > @@ -0,0 +1,195 @@ > +/*- > + * Copyright (c) 2013 Arthur Mesh > + * Copyright (c) 2013 Mark R V Murray > + * 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 > + * in this position and unchanged. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in th= e > + * documentation and/or other materials provided with the distributio= n. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED > WARRANTIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIME= D. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, > BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF > USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include > +#include > +#include > +#include > + > +#include "live_entropy_sources.h" > + > +LIST_HEAD(les_head, live_entropy_sources); > +static struct les_head sources =3D LIST_HEAD_INITIALIZER(sources); > + > +/* > + * The live_lock protects the consistency of the "struct les_head source= s" > + */ > +static struct sx les_lock; /* need a sleepable lock */ > + > +void > +live_entropy_source_register(struct random_hardware_source *rsource) > +{ > + struct live_entropy_sources *les; > + > + KASSERT(rsource !=3D NULL, ("invalid input to %s", __func__)); > + > + les =3D malloc(sizeof(struct live_entropy_sources), M_ENTROPY, > M_WAITOK); > + les->rsource =3D rsource; > + > + sx_xlock(&les_lock); > + LIST_INSERT_HEAD(&sources, les, entries); > + sx_xunlock(&les_lock); > +} > + > +void > +live_entropy_source_deregister(struct random_hardware_source *rsource) > +{ > + struct live_entropy_sources *les =3D NULL; > + > + KASSERT(rsource !=3D NULL, ("invalid input to %s", __func__)); > + > + sx_xlock(&les_lock); > + LIST_FOREACH(les, &sources, entries) > + if (les->rsource =3D=3D rsource) { > + LIST_REMOVE(les, entries); > + break; > + } > + sx_xunlock(&les_lock); > + if (les !=3D NULL) > + free(les, M_ENTROPY); > +} > + > +static int > +live_entropy_source_handler(SYSCTL_HANDLER_ARGS) > +{ > + struct live_entropy_sources *les; > + int error, count; > + > + count =3D error =3D 0; > + > + sx_slock(&les_lock); > + > + if (LIST_EMPTY(&sources)) > + error =3D SYSCTL_OUT(req, "", 0); > + else { > + LIST_FOREACH(les, &sources, entries) { > + > + error =3D SYSCTL_OUT(req, ",", count++ ? 1 : 0); > + if (error) > + break; > + > + error =3D SYSCTL_OUT(req, les->rsource->ident, > strlen(les->rsource->ident)); > + if (error) > + break; > + } > + } > + > + sx_sunlock(&les_lock); > + > + return (error); > +} > + > +static void > +live_entropy_sources_init(void *unused) > +{ > + > + SYSCTL_PROC(_kern_random, OID_AUTO, live_entropy_sources, > + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, > + NULL, 0, live_entropy_source_handler, "", > + "List of Active Live Entropy Sources"); > + > + sx_init(&les_lock, "live_entropy_sources"); > +} > + > +/* > + * Run through all "live" sources reading entropy for the given > + * number of rounds, which should be a multiple of the number > + * of entropy accumulation pools in use; 2 for Yarrow and 32 > + * for Fortuna. > + * > + * BEWARE!!! > + * This function runs inside the RNG thread! Don't do anything silly! > + * Remember that we are NOT holding harvest_mtx on entry! > + */ > +void > +live_entropy_sources_feed(int rounds, event_proc_f entropy_processor) > +{ > + static struct harvest event; > + static uint8_t buf[HARVESTSIZE]; > + struct live_entropy_sources *les; > + int i, n; > + > + sx_slock(&les_lock); > + > + /* > + * Walk over all of live entropy sources, and feed their output > + * to the system-wide RNG. > + */ > + LIST_FOREACH(les, &sources, entries) { > + > + for (i =3D 0; i < rounds; i++) { > + /* > + * This should be quick, since it's a live entrop= y > + * source. > + */ > + /* FIXME: Whine loudly if this didn't work. */ > + n =3D les->rsource->read(buf, sizeof(buf)); > + n =3D MIN(n, HARVESTSIZE); > + > + event.somecounter =3D get_cyclecount(); > + event.size =3D n; > + event.bits =3D (n*8)/2; > + event.source =3D les->rsource->source; > + memcpy(event.entropy, buf, n); > + > + /* Do the actual entropy insertion */ > + entropy_processor(&event); > + } > + > + } > + > + sx_sunlock(&les_lock); > +} > + > +static void > +live_entropy_sources_deinit(void *unused) > +{ > + > + sx_destroy(&les_lock); > +} > + > +SYSINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, > + live_entropy_sources_init, NULL); > +SYSUNINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, > + live_entropy_sources_deinit, NULL); > > Copied: head/sys/dev/random/live_entropy_sources.h (from r256243, > projects/random_number_generator/sys/dev/random/live_entropy_sources.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=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/random/live_entropy_sources.h Sat Oct 12 12:57:57 2013 > (r256377, copy of r256243, > projects/random_number_generator/sys/dev/random/live_entropy_sources.h) > @@ -0,0 +1,60 @@ > +/*- > + * Copyright (c) 2013 Arthur Mesh > + * Copyright (c) 2013 Mark R V Murray > + * 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 > + * in this position and unchanged. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in th= e > + * documentation and/or other materials provided with the distributio= n. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED > WARRANTIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIME= D. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 16:30:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0C7EA8AC; Sat, 12 Oct 2013 16:30:17 +0000 (UTC) (envelope-from mark@grondar.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2425254A; Sat, 12 Oct 2013 16:30:16 +0000 (UTC) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1VV24z-000J73-JT; Sat, 12 Oct 2013 17:30:14 +0100 Subject: Re: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: multipart/signed; boundary="Apple-Mail=_9BE35BC0-6057-45DF-BA34-FA1100F3B138"; protocol="application/pgp-signature"; micalg=pgp-sha512 From: Mark R V Murray In-Reply-To: Date: Sat, 12 Oct 2013 17:30:12 +0100 Message-Id: References: <201310121257.r9CCvvjO006546@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1510) X-SA-Score: -2.2 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mark Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 16:30:17 -0000 --Apple-Mail=_9BE35BC0-6057-45DF-BA34-FA1100F3B138 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On 12 Oct 2013, at 17:27, Adrian Chadd wrote: > hihi, >=20 > I've just test booted this on a MIPS board. It doesn't hang at boot = waiting for entropy. >=20 > http://people.freebsd.org/~adrian/mips/20131012-ar9344-boot-1.txt >=20 > Thanks! You are most welcome! M --=20 Mark R V Murray --Apple-Mail=_9BE35BC0-6057-45DF-BA34-FA1100F3B138 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.20 (Darwin) Comment: GPGTools - http://gpgtools.org iQCVAwUBUll5FN58vKOKE6LNAQpttwP+PEXCgVQ/CaqWVX1+sbcRpUI4NaN1l8j3 iToOuoQBJbjkdvxGOYniXoCSkig9B6ogp91pXl/Xb9uD+IIQn5VNDIc+SMxEvK3I D95FEGzNNVghu0JinwYP6tmXyn21+XyOOteZu3d4UZ9JdoF1+AZsHc+6La1/ZiZX LXXNZDuJoJU= =45GC -----END PGP SIGNATURE----- --Apple-Mail=_9BE35BC0-6057-45DF-BA34-FA1100F3B138-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 16:35:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4863EC0F; Sat, 12 Oct 2013 16:35:46 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC5A825A3; Sat, 12 Oct 2013 16:35:45 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.31]) by ltcfislmsgpa04.fnfis.com (8.14.5/8.14.5) with ESMTP id r9CGZgTn009685 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 12 Oct 2013 11:35:42 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.103]) by LTCFISWMSGHT03.FNFIS.com ([10.132.206.31]) with mapi id 14.02.0309.002; Sat, 12 Oct 2013 11:35:40 -0500 From: "Teske, Devin" To: Adrian Chadd Subject: Re: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... Thread-Topic: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... Thread-Index: AQHOx2kWmfQdvUXbBUerN/OTVWaLsg== Date: Sat, 12 Oct 2013 16:35:39 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D720FC5BE74@LTCFISWMSGMB21.FNFIS.com> References: <201310121257.r9CCvvjO006546@svn.freebsd.org> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="iso-8859-1" Content-ID: <6FE212CC8CFF7D4083D13E482B3A03F9@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-10-12_01:2013-10-11,2013-10-12,1970-01-01 signatures=0 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "Teske, Devin" , "svn-src-head@freebsd.org" , =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , Devin Teske , Mark Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Oct 2013 16:35:46 -0000 On Oct 12, 2013, at 9:27 AM, Adrian Chadd wrote: > hihi, >=20 > I've just test booted this on a MIPS board. It doesn't hang at boot waiti= ng for entropy. >=20 > http://people.freebsd.org/~adrian/mips/20131012-ar9344-boot-1.txt >=20 > Thanks! >=20 >=20 Hi Adrian, Can you maybe test with ZFS + Geli? I'm concerned because we told it to use= random(4) instead of urandom(4). I hope there's enough entropy when creating the geli= stuff that said process doesn't hang. I think DES's patch will help there too (not tha= t anyone testing our ZFS patches reported any hangs... including when testing GELI -= - this was before DES's patch). I gather that the more disks you have the greater the entropy must be -- so= it may have been that enough disks weren't used in the testing. I also wonder "how much entropy" did we buy with DES's patch? Enough that w= e should not worry about random(4) hanging on us during the installer for decades to= come? or might we still be worried if someone does a GELI setup with 12 disks? All-in-all, I was very worried about choosing random(4) for the GELI setup,= but am *very* happy that right before the commit, DES stepped in with the entropy stuff ;D Kudos! (just the above quandaries posited above) --=20 Devin > On 12 October 2013 05:57, Mark Murray wrote: > Author: markm > Date: Sat Oct 12 12:57:57 2013 > New Revision: 256377 > URL: http://svnweb.freebsd.org/changeset/base/256377 >=20 > Log: > Merge from project branch. Uninteresting commits are trimmed. >=20 > Refactor of /dev/random device. Main points include: >=20 > * Userland seeding is no longer used. This auto-seeds at boot time > on PC/Desktop setups; this may need some tweeking and intelligence > from those folks setting up embedded boxes, but the work is believed > to be minimal. >=20 > * An entropy cache is written to /entropy (even during installation) > and the kernel uses this at next boot. >=20 > * An entropy file written to /boot/entropy can be loaded by loader(8) >=20 > * Hardware sources such as rdrand are fed into Yarrow, and are no > longer available raw. >=20 > ------------------------------------------------------------------------ > r256240 | des | 2013-10-09 21:14:16 +0100 (Wed, 09 Oct 2013) | 4 lines >=20 > Add a RANDOM_RWFILE option and hide the entropy cache code behind it. > Rename YARROW_RNG and FORTUNA_RNG to RANDOM_YARROW and RANDOM_FORTUNA. > Add the RANDOM_* options to LINT. >=20 > ------------------------------------------------------------------------ > r256239 | des | 2013-10-09 21:12:59 +0100 (Wed, 09 Oct 2013) | 2 lines >=20 > Define RANDOM_PURE_RNDTEST for rndtest(4). >=20 > ------------------------------------------------------------------------ > r256204 | des | 2013-10-09 18:51:38 +0100 (Wed, 09 Oct 2013) | 2 lines >=20 > staticize struct random_hardware_source >=20 > ------------------------------------------------------------------------ > r256203 | markm | 2013-10-09 18:50:36 +0100 (Wed, 09 Oct 2013) | 2 lines >=20 > Wrap some policy-rich code in 'if NOTYET' until we can thresh out > what it really needs to do. >=20 > ------------------------------------------------------------------------ > r256184 | des | 2013-10-09 10:13:12 +0100 (Wed, 09 Oct 2013) | 2 lines >=20 > Re-add /dev/urandom for compatibility purposes. >=20 > ------------------------------------------------------------------------ > r256182 | des | 2013-10-09 10:11:14 +0100 (Wed, 09 Oct 2013) | 3 lines >=20 > Add missing include guards and move the existing ones out of the > implementation namespace. >=20 > ------------------------------------------------------------------------ > r256168 | markm | 2013-10-08 23:14:07 +0100 (Tue, 08 Oct 2013) | 10 lin= es >=20 > Fix some just-noticed problems: >=20 > o Allow this to work with "nodevice random" by fixing where the > MALLOC pool is defined. >=20 > o Fix the explicit reseed code. This was correct as submitted, but > in the project branch doesn't need to set the "seeded" bit as this > is done correctly in the "unblock" function. >=20 > o Remove some debug ifdeffing. >=20 > o Adjust comments. >=20 > ------------------------------------------------------------------------ > r256159 | markm | 2013-10-08 19:48:11 +0100 (Tue, 08 Oct 2013) | 6 lines >=20 > Time to eat crow for me. >=20 > I replaced the sx_* locks that Arthur used with regular mutexes; > this turned out the be the wrong thing to do as the locks need to > be sleepable. Revert this folly. >=20 > # Submitted by: Arthur Mesh (In original d= iff) >=20 > ------------------------------------------------------------------------ > r256138 | des | 2013-10-08 12:05:26 +0100 (Tue, 08 Oct 2013) | 10 lines >=20 > Add YARROW_RNG and FORTUNA_RNG to sys/conf/options. >=20 > Add a SYSINIT that forces a reseed during proc0 setup, which happens > fairly late in the boot process. >=20 > Add a RANDOM_DEBUG option which enables some debugging printf()s. >=20 > Add a new RANDOM_ATTACH entropy source which harvests entropy from the > get_cyclecount() delta across each call to a device attach method. >=20 > ------------------------------------------------------------------------ > r256135 | markm | 2013-10-08 07:54:52 +0100 (Tue, 08 Oct 2013) | 8 lines >=20 > Debugging. My attempt at EVENTHANDLER(multiuser) was a failure; use > EVENTHANDLER(mountroot) instead. >=20 > This means we can't count on /var being present, so something will > need to be done about harvesting /var/db/entropy/... . >=20 > Some policy now needs to be sorted out, and a pre-sync cache needs > to be written, but apart from that we are now ready to go. >=20 > Over to review. >=20 > ------------------------------------------------------------------------ > r256094 | markm | 2013-10-06 23:45:02 +0100 (Sun, 06 Oct 2013) | 8 lines >=20 > Snapshot. >=20 > Looking pretty good; this mostly works now. New code includes: >=20 > * Read cached entropy at startup, both from files and from loader(8) > preloaded entropy. Failures are soft, but announced. Untested. >=20 > * Use EVENTHANDLER to do above just before we go multiuser. Untested. >=20 > ------------------------------------------------------------------------ > r256088 | markm | 2013-10-06 14:01:42 +0100 (Sun, 06 Oct 2013) | 2 lines >=20 > Fix up the man page for random(4). This mainly removes no-longer-releva= nt > details about HW RNGs, reseeding explicitly and user-supplied > entropy. >=20 > ------------------------------------------------------------------------ > r256087 | markm | 2013-10-06 13:43:42 +0100 (Sun, 06 Oct 2013) | 6 lines >=20 > As userland writing to /dev/random is no more, remove the "better > than nothing" bootstrap mode. >=20 > Add SWI harvesting to the mix. >=20 > My box seeds Yarrow by itself in a few seconds! YMMV; more to follow. >=20 > ------------------------------------------------------------------------ > r256086 | markm | 2013-10-06 13:40:32 +0100 (Sun, 06 Oct 2013) | 11 lin= es >=20 > Debug run. This now works, except that the "live" sources haven't > been tested. With all sources turned on, this unlocks itself in > a couple of seconds! That is no my box, and there is no guarantee > that this will be the case everywhere. >=20 > * Cut debug prints. >=20 > * Use the same locks/mutexes all the way through. >=20 > * Be a tad more conservative about entropy estimates. >=20 > ------------------------------------------------------------------------ > r256084 | markm | 2013-10-06 13:35:29 +0100 (Sun, 06 Oct 2013) | 5 lines >=20 > Don't use the "real" assembler mnemonics; older compilers may not > understand them (like when building CURRENT on 9.x). >=20 > # Submitted by: Konstantin Belousov >=20 > ------------------------------------------------------------------------ > r256081 | markm | 2013-10-06 10:55:28 +0100 (Sun, 06 Oct 2013) | 12 lin= es >=20 > SNAPSHOT. >=20 > Simplify the malloc pools; We only need one for this device. >=20 > Simplify the harvest queue. >=20 > Marginally improve the entropy pool hashing, making it a bit faster > in the process. >=20 > Connect up the hardware "live" source harvesting. This is simplistic > for now, and will need to be made rate-adaptive. >=20 > All of the above passes a compile test but needs to be debugged. >=20 > ------------------------------------------------------------------------ > r256042 | markm | 2013-10-04 07:55:06 +0100 (Fri, 04 Oct 2013) | 25 lin= es >=20 > Snapshot. This passes the build test, but has not yet been finished or = debugged. >=20 > Contains: >=20 > * Refactor the hardware RNG CPU instruction sources to feed into > the software mixer. This is unfinished. The actual harvesting needs > to be sorted out. Modified by me (see below). >=20 > * Remove 'frac' parameter from random_harvest(). This was never > used and adds extra code for no good reason. >=20 > * Remove device write entropy harvesting. This provided a weak > attack vector, was not very good at bootstrapping the device. To > follow will be a replacement explicit reseed knob. >=20 > * Separate out all the RANDOM_PURE sources into separate harvest > entities. This adds some secuity in the case where more than one > is present. >=20 > * Review all the code and fix anything obviously messy or inconsistent. > Address som review concerns while I'm here, like rename the pseudo-rng > to 'dummy'. >=20 > # Submitted by: Arthur Mesh (the first ite= m) >=20 > ------------------------------------------------------------------------ > r255319 | markm | 2013-09-06 18:51:52 +0100 (Fri, 06 Sep 2013) | 4 lines >=20 > Yarrow wants entropy estimations to be conservative; the usual idea > is that if you are certain you have N bits of entropy, you declare > N/2. >=20 > ------------------------------------------------------------------------ > r255075 | markm | 2013-08-30 18:47:53 +0100 (Fri, 30 Aug 2013) | 4 lines >=20 > Remove short-lived idea; thread to harvest (eg) RDRAND enropy into the > usual harvest queues. It was a nifty idea, but too heavyweight. >=20 > # Submitted by: Arthur Mesh >=20 > ------------------------------------------------------------------------ > r255071 | markm | 2013-08-30 12:42:57 +0100 (Fri, 30 Aug 2013) | 4 lines >=20 > Separate out the Software RNG entropy harvesting queue and thread > into its own files. >=20 > # Submitted by: Arthur Mesh >=20 > ------------------------------------------------------------------------ > r254934 | markm | 2013-08-26 20:07:03 +0100 (Mon, 26 Aug 2013) | 2 lines >=20 > Remove the short-lived namei experiment. >=20 > ------------------------------------------------------------------------ > r254928 | markm | 2013-08-26 19:35:21 +0100 (Mon, 26 Aug 2013) | 2 lines >=20 > Snapshot; Do some running repairs on entropy harvesting. More needs > to follow. >=20 > ------------------------------------------------------------------------ > r254927 | markm | 2013-08-26 19:29:51 +0100 (Mon, 26 Aug 2013) | 15 lin= es >=20 > Snapshot of current work; >=20 > 1) Clean up namespace; only use "Yarrow" where it is Yarrow-specific > or close enough to the Yarrow algorithm. For the rest use a neutral > name. >=20 > 2) Tidy up headers; put private stuff in private places. More could > be done here. >=20 > 3) Streamline the hashing/encryption; no need for a 256-bit counter; > 128 bits will last for long enough. >=20 > There are bits of debug code lying around; these will be removed > at a later stage. >=20 > ------------------------------------------------------------------------ > r254784 | markm | 2013-08-24 14:54:56 +0100 (Sat, 24 Aug 2013) | 39 lin= es >=20 > 1) example (partially humorous random_adaptor, that I call "EXAMPLE") > * It's not meant to be used in a real system, it's there to show how > the basics of how to create interfaces for random_adaptors. Perhaps > it should belong in a manual page >=20 > 2) Move probe.c's functionality in to random_adaptors.c > * rename random_ident_hardware() to random_adaptor_choose() >=20 > 3) Introduce a new way to choose (or select) random_adaptors via tunable > "rngs_want" It's a list of comma separated names of adaptors, ordered > by preferences. I.e.: > rngs_want=3D"yarrow,rdrand" >=20 > Such setting would cause yarrow to be preferred to rdrand. If neither of > them are available (or registered), then system will default to > something reasonable (currently yarrow). If yarrow is not present, then > we fall back to the adaptor that's first on the list of registered > adaptors. >=20 > 4) Introduce a way where RNGs can play a role of entropy source. This is > mostly useful for HW rngs. >=20 > The way I envision this is that every HW RNG will use this > functionality by default. Functionality to disable this is also present. > I have an example of how to use this in random_adaptor_example.c (see > modload event, and init function) >=20 > 5) fix kern.random.adaptors from > kern.random.adaptors: yarrowpanicblock > to > kern.random.adaptors: yarrow,panic,block >=20 > 6) add kern.random.active_adaptor to indicate currently selected > adaptor: > root@freebsd04:~ # sysctl kern.random.active_adaptor > kern.random.active_adaptor: yarrow >=20 > # Submitted by: Arthur Mesh >=20 > Submitted by: Dag-Erling Sm=F8rgrav , Arthur Mesh > Reviewed by: des@FreeBSD.org > Approved by: re (delphij) > Approved by: secteam (des,delphij) >=20 > Added: > head/sys/dev/random/dummy_rng.c > - copied unchanged from r256243, projects/random_number_generator/sy= s/dev/random/dummy_rng.c > head/sys/dev/random/live_entropy_sources.c > - copied unchanged from r256243, projects/random_number_generator/sy= s/dev/random/live_entropy_sources.c > head/sys/dev/random/live_entropy_sources.h > - copied unchanged from r256243, projects/random_number_generator/sy= s/dev/random/live_entropy_sources.h > head/sys/dev/random/rwfile.c > - copied unchanged from r256243, projects/random_number_generator/sy= s/dev/random/rwfile.c > head/sys/dev/random/rwfile.h > - copied unchanged from r256243, projects/random_number_generator/sy= s/dev/random/rwfile.h > Deleted: > head/sys/dev/random/pseudo_rng.c > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/initrandom > head/share/examples/kld/random_adaptor/random_adaptor_example.c (cont= ents, props changed) > head/share/man/man4/random.4 > head/sys/boot/forth/loader.conf > head/sys/conf/NOTES > head/sys/conf/files > head/sys/conf/files.amd64 > head/sys/conf/files.i386 > head/sys/conf/options > head/sys/dev/glxsb/glxsb.c > head/sys/dev/hifn/hifn7751.c > head/sys/dev/random/harvest.c > head/sys/dev/random/hash.h > head/sys/dev/random/ivy.c > head/sys/dev/random/nehemiah.c > head/sys/dev/random/random_adaptors.c > head/sys/dev/random/random_adaptors.h > head/sys/dev/random/random_harvestq.c > head/sys/dev/random/random_harvestq.h > head/sys/dev/random/randomdev.c > head/sys/dev/random/randomdev.h > head/sys/dev/random/randomdev_soft.c > head/sys/dev/random/randomdev_soft.h > head/sys/dev/random/yarrow.c > head/sys/dev/random/yarrow.h > head/sys/dev/rndtest/rndtest.c > head/sys/dev/safe/safe.c > head/sys/dev/syscons/scmouse.c > head/sys/dev/syscons/syscons.c > head/sys/dev/ubsec/ubsec.c > head/sys/kern/kern_intr.c > head/sys/kern/subr_bus.c > head/sys/mips/cavium/octeon_rnd.c > head/sys/modules/random/Makefile > head/sys/net/if_ethersubr.c > head/sys/net/if_tun.c > head/sys/netgraph/ng_iface.c > head/sys/sys/random.h > Directory Properties: > head/ (props changed) >=20 > Modified: head/etc/defaults/rc.conf > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/defaults/rc.conf Sat Oct 12 12:34:19 2013 (r256376) > +++ head/etc/defaults/rc.conf Sat Oct 12 12:57:57 2013 (r256377) > @@ -651,6 +651,7 @@ entropy_save_num=3D"8" # Number of entropy > harvest_interrupt=3D"YES" # Entropy device harvests interrupt ran= domness > harvest_ethernet=3D"YES" # Entropy device harvests ethernet randomness > harvest_p_to_p=3D"YES" # Entropy device harvests point-to-point random= ness > +harvest_swi=3D"YES" # Entropy device harvests internal SWI randomne= ss > dmesg_enable=3D"YES" # Save dmesg(8) to /var/run/dmesg.boot > watchdogd_enable=3D"NO" # Start the software watchdog daemon > watchdogd_flags=3D"" # Flags to watchdogd (if enabled) >=20 > Modified: head/etc/rc.d/initrandom > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/rc.d/initrandom Sat Oct 12 12:34:19 2013 (r256376) > +++ head/etc/rc.d/initrandom Sat Oct 12 12:57:57 2013 (r256377) > @@ -14,26 +14,6 @@ name=3D"initrandom" > start_cmd=3D"initrandom_start" > stop_cmd=3D":" >=20 > -feed_dev_random() > -{ > - if [ -f "${1}" -a -r "${1}" -a -s "${1}" ]; then > - cat "${1}" | dd of=3D/dev/random bs=3D8k 2>/dev/null > - fi > -} > - > -better_than_nothing() > -{ > - # XXX temporary until we can improve the entropy > - # harvesting rate. > - # Entropy below is not great, but better than nothing. > - # This unblocks the generator at startup > - # Note: commands are ordered to cause the most variance across re= boots. > - ( kenv; dmesg; df -ib; ps -fauxww; date; sysctl -a ) \ > - | dd of=3D/dev/random bs=3D8k 2>/dev/null > - /sbin/sha256 -q `sysctl -n kern.bootfile` \ > - | dd of=3D/dev/random bs=3D8k 2>/dev/null > -} > - > initrandom_start() > { > soft_random_generator=3D`sysctl kern.random 2>/dev/null` > @@ -63,23 +43,15 @@ initrandom_start() > else > ${SYSCTL} kern.random.sys.harvest.point_t= o_point=3D0 >/dev/null > fi > - fi >=20 > - # First pass at reseeding /dev/random. > - # > - case ${entropy_file} in > - [Nn][Oo] | '') > - ;; > - *) > - if [ -w /dev/random ]; then > - feed_dev_random "${entropy_file}" > + if checkyesno harvest_swi; then > + ${SYSCTL} kern.random.sys.harvest.swi=3D1= >/dev/null > + echo -n ' swi' > + else > + ${SYSCTL} kern.random.sys.harvest.swi=3D0= >/dev/null > fi > - ;; > - esac > - > - better_than_nothing > + fi >=20 > - echo -n ' kickstart' > fi >=20 > echo '.' >=20 > Modified: head/share/examples/kld/random_adaptor/random_adaptor_example.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/examples/kld/random_adaptor/random_adaptor_example.c S= at Oct 12 12:34:19 2013 (r256376) > +++ head/share/examples/kld/random_adaptor/random_adaptor_example.c S= at Oct 12 12:57:57 2013 (r256377) > @@ -30,32 +30,29 @@ __FBSDID("$FreeBSD$"); >=20 > #include > #include > +#include > #include > -#include > +#include > #include >=20 > +#include > #include > #include >=20 > -#define RNG_NAME "example" > - > static int random_example_read(void *, int); >=20 > struct random_adaptor random_example =3D { > .ident =3D "Example RNG", > - .init =3D (random_init_func_t *)random_null_func, > - .deinit =3D (random_deinit_func_t *)random_null_func, > + .source =3D RANDOM_PURE_BOGUS, /* Make sure this is in > + * sys/random.h and is unique */ > .read =3D random_example_read, > - .write =3D (random_write_func_t *)random_null_func, > - .reseed =3D (random_reseed_func_t *)random_null_func, > - .seeded =3D 1, > }; >=20 > /* > * Used under the license provided @ http://xkcd.com/221/ > * http://creativecommons.org/licenses/by-nc/2.5/ > */ > -static u_char > +static uint8_t > getRandomNumber(void) > { > return 4; /* chosen by fair dice roll, guaranteed to be random = */ > @@ -64,14 +61,13 @@ getRandomNumber(void) > static int > random_example_read(void *buf, int c) > { > - u_char *b; > + uint8_t *b; > int count; >=20 > b =3D buf; >=20 > - for (count =3D 0; count < c; count++) { > + for (count =3D 0; count < c; count++) > b[count] =3D getRandomNumber(); > - } >=20 > printf("returning %d bytes of pure randomness\n", c); > return (c); > @@ -80,15 +76,26 @@ random_example_read(void *buf, int c) > static int > random_example_modevent(module_t mod, int type, void *unused) > { > + int error =3D 0; >=20 > switch (type) { > case MOD_LOAD: > - random_adaptor_register(RNG_NAME, &random_example); > - EVENTHANDLER_INVOKE(random_adaptor_attach, &random_exampl= e); > - return (0); > + live_entropy_source_register(&random_example); > + break; > + > + case MOD_UNLOAD: > + live_entropy_source_deregister(&random_example); > + break; > + > + case MOD_SHUTDOWN: > + break; > + > + default: > + error =3D EOPNOTSUPP; > + break; > } >=20 > - return (EINVAL); > + return (error); > } >=20 > -RANDOM_ADAPTOR_MODULE(random_example, random_example_modevent, 1); > +LIVE_ENTROPY_SRC_MODULE(live_entropy_source_example, random_example_mode= vent, 1); >=20 > Modified: head/share/man/man4/random.4 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/man/man4/random.4 Sat Oct 12 12:34:19 2013 (= r256376) > +++ head/share/man/man4/random.4 Sat Oct 12 12:57:57 2013 (= r256377) > @@ -1,4 +1,4 @@ > -.\" Copyright (c) 2001 Mark R V Murray. All rights reserved. > +.\" Copyright (c) 2001-2013 Mark R V Murray. All rights reserved. > .\" > .\" Redistribution and use in source and binary forms, with or without > .\" modification, are permitted provided that the following conditions > @@ -23,7 +23,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd August 7, 2013 > +.Dd October 12, 2013 > .Dt RANDOM 4 > .Os > .Sh NAME > @@ -43,35 +43,48 @@ The device will probe for > certain hardware entropy sources, > and use these in preference to the fallback, > which is a generator implemented in software. > -If the kernel environment MIB's > -.Va hw.nehemiah_rng_enable > -or > -.Va hw.ivy_rng_enable > -are set to > -.Dq Li 0 , > -the associated hardware entropy source will be ignored. > -.Pp > -If the device is using > -the software generator, > -writing data to > -.Nm > -would perturb the internal state. > -This perturbation of the internal state > -is the only userland method of introducing > -extra entropy into the device. > -If the writer has superuser privilege, > -then closing the device after writing > -will make the software generator reseed itself. > -This can be used for extra security, > -as it immediately introduces any/all new entropy > -into the PRNG. > -The hardware generators will generate > -sufficient quantities of entropy, > -and will therefore ignore user-supplied input. > -The software > -.Nm > -device may be controlled with > -.Xr sysctl 8 . > +.Pp > +The software generator will start in an > +.Em unseeded > +state, and will block reads until > +it is (re)seeded. > +This may cause trouble at system boot > +when keys and the like > +are generated from > +/dev/random > +so steps should be taken to ensure a > +reseed as soon as possible. > +The > +.Xr sysctl 8 > +controlling the > +.Em seeded > +status (see below) may be used > +if security is not an issue > +or for convenience > +during setup or development. > +.Pp > +This initial seeding > +of random number generators > +is a bootstrapping problem > +that needs very careful attention. > +In some cases, > +it may be difficult > +to find enough randomness > +to seed a random number generator > +until a system is fully operational, > +but the system requires random numbers > +to become fully operational. > +It is (or more accurately should be) > +critically important that the > +.Nm > +device is seeded > +before the first time it is used. > +In the case where a dummy or "blocking-only" > +device is used, > +it is the responsibility > +of the system architect > +to ensure that no blocking reads > +hold up critical processes. > .Pp > To see the current settings of the software > .Nm > @@ -81,22 +94,20 @@ device, use the command line: > .Pp > which results in something like: > .Bd -literal -offset indent > -kern.random.adaptors: yarrow > +kern.random.adaptors: yarrow,dummy > +kern.random.active_adaptor: yarrow > +kern.random.yarrow.gengateinterval: 10 > +kern.random.yarrow.bins: 10 > +kern.random.yarrow.fastthresh: 96 > +kern.random.yarrow.slowthresh: 128 > +kern.random.yarrow.slowoverthresh: 2 > kern.random.sys.seeded: 1 > kern.random.sys.harvest.ethernet: 1 > kern.random.sys.harvest.point_to_point: 1 > kern.random.sys.harvest.interrupt: 1 > -kern.random.sys.harvest.swi: 0 > -kern.random.yarrow.gengateinterval: 10 > -kern.random.yarrow.bins: 10 > -kern.random.yarrow.fastthresh: 192 > -kern.random.yarrow.slowthresh: 256 > -kern.random.yarrow.slowoverthresh: 2 > +kern.random.sys.harvest.swi: 1 > .Ed > .Pp > -(These would not be seen if a > -hardware generator is present.) > -.Pp > Other than > .Dl kern.random.adaptors > all settings are read/write. > @@ -107,9 +118,10 @@ variable indicates whether or not the > .Nm > device is in an acceptably secure state > as a result of reseeding. > -If set to 0, the device will block (on read) until the next reseed > -(which can be from an explicit write, > -or as a result of entropy harvesting). > +If set to 0, > +the device will block (on read) > +until the next reseed > +as a result of entropy harvesting. > A reseed will set the value to 1 (non-blocking). > .Pp > The > @@ -276,19 +288,6 @@ the generator produce independent sequen > However, the guessability or reproducibility of the sequence is unimport= ant, > unlike the previous cases. > .Pp > -One final consideration for the seeding of random number generators > -is a bootstrapping problem. > -In some cases, it may be difficult to find enough randomness to > -seed a random number generator until a system is fully operational, > -but the system requires random numbers to become fully operational. > -There is no substitute for careful thought here, > -but the > -.Fx > -.Nm > -device, > -which is based on the Yarrow system, > -should be of some help in this area. > -.Pp > .Fx > does also provide the traditional > .Xr rand 3 > @@ -325,17 +324,7 @@ and is an implementation of the > .Em Yarrow > algorithm by Bruce Schneier, > .Em et al . > -The only hardware implementations > -currently are for the > -.Tn VIA C3 Nehemiah > -(stepping 3 or greater) > -CPU > -and the > -.Tn Intel > -.Dq Bull Mountain > -.Em RdRand > -instruction and underlying random number generator (RNG). > -More will be added in the future. > +Significant infrastructure work was done by Arthur Mesh. > .Pp > The author gratefully acknowledges > significant assistance from VIA Technologies, Inc. >=20 > Modified: head/sys/boot/forth/loader.conf > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/boot/forth/loader.conf Sat Oct 12 12:34:19 2013 (= r256376) > +++ head/sys/boot/forth/loader.conf Sat Oct 12 12:57:57 2013 (= r256377) > @@ -39,6 +39,17 @@ bitmap_type=3D"splash_image_data" # and pl >=20 >=20 > ############################################################## > +### Random number generator configuration ################### > +############################################################## > + > +entropy_cache_load=3D"NO" # Set this to YES to lo= ad entropy at boot time > +entropy_cache_name=3D"/boot/entropy" # Set this to the name of the f= ile > +entropy_cache_type=3D"/boot/entropy" > +#kern.random.sys.seeded=3D"0" # Set this to 1 to start /dev/r= andom > + # without waiting for a (re)seed. > + > + > +############################################################## > ### Loader settings ######################################## > ############################################################## >=20 >=20 > Modified: head/sys/conf/NOTES > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/NOTES Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/conf/NOTES Sat Oct 12 12:57:57 2013 (r256377) > @@ -2962,3 +2962,8 @@ options RCTL > options BROOKTREE_ALLOC_PAGES=3D(217*4+1) > options MAXFILES=3D999 >=20 > +# Random number generator > +options RANDOM_YARROW # Yarrow RNG > +##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented > +options RANDOM_DEBUG # Debugging messages > +options RANDOM_RWFILE # Read and write entropy cache >=20 > Modified: head/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 > --- head/sys/conf/files Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/conf/files Sat Oct 12 12:57:57 2013 (r256377) > @@ -2043,13 +2043,15 @@ rt2860.fw optional rt2860fw= | ralfw \ > no-obj no-implicit-rule \ > clean "rt2860.fw" > dev/random/harvest.c standard > -dev/random/hash.c optional random > -dev/random/pseudo_rng.c standard > +dev/random/dummy_rng.c standard > dev/random/random_adaptors.c standard > -dev/random/random_harvestq.c standard > +dev/random/live_entropy_sources.c optional random > +dev/random/random_harvestq.c optional random > dev/random/randomdev.c optional random > dev/random/randomdev_soft.c optional random > dev/random/yarrow.c optional random > +dev/random/hash.c optional random > +dev/random/rwfile.c optional random > dev/rc/rc.c optional rc > dev/re/if_re.c optional re > dev/rndtest/rndtest.c optional rndtest >=20 > Modified: head/sys/conf/files.amd64 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/files.amd64 Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/conf/files.amd64 Sat Oct 12 12:57:57 2013 (r256377) > @@ -259,8 +259,8 @@ dev/nvme/nvme_sysctl.c optional n= vme > dev/nvme/nvme_test.c optional nvme > dev/nvme/nvme_util.c optional nvme > dev/nvram/nvram.c optional nvram isa > -dev/random/ivy.c optional random rdrand_rng > -dev/random/nehemiah.c optional random padlock_rng > +dev/random/ivy.c optional rdrand_rng > +dev/random/nehemiah.c optional padlock_rng > dev/qlxge/qls_dbg.c optional qlxge pci > dev/qlxge/qls_dump.c optional qlxge pci > dev/qlxge/qls_hw.c optional qlxge pci >=20 > Modified: head/sys/conf/files.i386 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/files.i386 Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/conf/files.i386 Sat Oct 12 12:57:57 2013 (r256377) > @@ -257,8 +257,8 @@ dev/nvme/nvme_test.c optional nvme > dev/nvme/nvme_util.c optional nvme > dev/nvram/nvram.c optional nvram isa > dev/pcf/pcf_isa.c optional pcf > -dev/random/ivy.c optional random rdrand_rng > -dev/random/nehemiah.c optional random padlock_rng > +dev/random/ivy.c optional rdrand_rng > +dev/random/nehemiah.c optional padlock_rng > dev/sbni/if_sbni.c optional sbni > dev/sbni/if_sbni_isa.c optional sbni isa > dev/sbni/if_sbni_pci.c optional sbni pci >=20 > Modified: head/sys/conf/options > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/options Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/conf/options Sat Oct 12 12:57:57 2013 (r256377) > @@ -904,3 +904,9 @@ RACCT opt_global.h >=20 > # Resource Limits > RCTL opt_global.h > + > +# Random number generator(s) > +RANDOM_YARROW opt_random.h > +RANDOM_FORTUNA opt_random.h > +RANDOM_DEBUG opt_random.h > +RANDOM_RWFILE opt_random.h >=20 > Modified: head/sys/dev/glxsb/glxsb.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/glxsb/glxsb.c Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/dev/glxsb/glxsb.c Sat Oct 12 12:57:57 2013 (r256377) > @@ -476,7 +476,7 @@ glxsb_rnd(void *v) > if (status & SB_RNS_TRNG_VALID) { > value =3D bus_read_4(sc->sc_sr, SB_RANDOM_NUM); > /* feed with one uint32 */ > - random_harvest(&value, 4, 32/2, 0, RANDOM_PURE); > + random_harvest(&value, 4, 32/2, RANDOM_PURE_GLXSB); > } >=20 > callout_reset(&sc->sc_rngco, sc->sc_rnghz, glxsb_rnd, sc); >=20 > Modified: head/sys/dev/hifn/hifn7751.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/hifn/hifn7751.c Sat Oct 12 12:34:19 2013 (= r256376) > +++ head/sys/dev/hifn/hifn7751.c Sat Oct 12 12:57:57 2013 (= r256377) > @@ -258,7 +258,7 @@ hifn_partname(struct hifn_softc *sc) > static void > default_harvest(struct rndtest_state *rsp, void *buf, u_int count) > { > - random_harvest(buf, count, count*NBBY/2, 0, RANDOM_PURE); > + random_harvest(buf, count, count*NBBY/2, RANDOM_PURE_HIFN); > } >=20 > static u_int >=20 > Copied: head/sys/dev/random/dummy_rng.c (from r256243, projects/random_nu= mber_generator/sys/dev/random/dummy_rng.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 > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/random/dummy_rng.c Sat Oct 12 12:57:57 2013 (= r256377, copy of r256243, projects/random_number_generator/sys/dev/random/d= ummy_rng.c) > @@ -0,0 +1,123 @@ > +/*- > + * Copyright (c) 2013 Arthur Mesh > + * 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 > + * in this position and unchanged. > + * 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 distributio= n. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRAN= TIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIME= D. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, = BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF = USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE= OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * > + */ > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +static struct mtx dummy_random_mtx; > + > +/* Used to fake out unused random calls in random_adaptor */ > +static void > +random_null_func(void) > +{ > +} > + > +static int > +dummy_random_poll(int events __unused, struct thread *td __unused) > +{ > + > + return (0); > +} > + > +static int > +dummy_random_block(int flag) > +{ > + int error =3D 0; > + > + mtx_lock(&dummy_random_mtx); > + > + /* Blocking logic */ > + while (!error) { > + if (flag & O_NONBLOCK) > + error =3D EWOULDBLOCK; > + else { > + printf("random: dummy device blocking on read.\n"= ); > + error =3D msleep(&dummy_random_block, > + &dummy_random_mtx, > + PUSER | PCATCH, "block", 0); > + } > + } > + mtx_unlock(&dummy_random_mtx); > + > + return (error); > +} > + > +static void > +dummy_random_init(void) > +{ > + > + mtx_init(&dummy_random_mtx, "sleep mtx for dummy_random", > + NULL, MTX_DEF); > +} > + > +static void > +dummy_random_deinit(void) > +{ > + > + mtx_destroy(&dummy_random_mtx); > +} > + > +struct random_adaptor dummy_random =3D { > + .ident =3D "Dummy entropy device that always blocks", > + .init =3D dummy_random_init, > + .deinit =3D dummy_random_deinit, > + .block =3D dummy_random_block, > + .poll =3D dummy_random_poll, > + .read =3D (random_read_func_t *)random_null_func, > + .reseed =3D (random_reseed_func_t *)random_null_func, > + .seeded =3D 0, /* This device can never be seeded */ > +}; > + > +static int > +dummy_random_modevent(module_t mod __unused, int type, void *unused __un= used) > +{ > + > + switch (type) { > + case MOD_LOAD: > + random_adaptor_register("dummy", &dummy_random); > + EVENTHANDLER_INVOKE(random_adaptor_attach, > + &dummy_random); > + > + return (0); > + } > + > + return (EINVAL); > +} > + > +RANDOM_ADAPTOR_MODULE(dummy, dummy_random_modevent, 1); >=20 > Modified: head/sys/dev/random/harvest.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/harvest.c Sat Oct 12 12:34:19 2013 (= r256376) > +++ head/sys/dev/random/harvest.c Sat Oct 12 12:57:57 2013 (= r256377) > @@ -48,20 +48,20 @@ __FBSDID("$FreeBSD$"); > static int read_random_phony(void *, int); >=20 > /* Structure holding the desired entropy sources */ > -struct harvest_select harvest =3D { 1, 1, 1, 0 }; > +struct harvest_select harvest =3D { 1, 1, 1, 1 }; > static int warned =3D 0; >=20 > /* hold the address of the routine which is actually called if > * the randomdev is loaded > */ > -static void (*reap_func)(u_int64_t, const void *, u_int, u_int, u_int, > +static void (*reap_func)(u_int64_t, const void *, u_int, u_int, > enum esource) =3D NULL; > static int (*read_func)(void *, int) =3D read_random_phony; >=20 > /* Initialise the harvester at load time */ > void > randomdev_init_harvester(void (*reaper)(u_int64_t, const void *, u_int, > - u_int, u_int, enum esource), int (*reader)(void *, int)) > + u_int, enum esource), int (*reader)(void *, int)) > { > reap_func =3D reaper; > read_func =3D reader; > @@ -86,12 +86,10 @@ randomdev_deinit_harvester(void) > * read which can be quite expensive. > */ > void > -random_harvest(void *entropy, u_int count, u_int bits, u_int frac, > - enum esource origin) > +random_harvest(void *entropy, u_int count, u_int bits, enum esource orig= in) > { > if (reap_func) > - (*reap_func)(get_cyclecount(), entropy, count, bits, frac, > - origin); > + (*reap_func)(get_cyclecount(), entropy, count, bits, orig= in); > } >=20 > /* Userland-visible version of read_random */ >=20 > Modified: head/sys/dev/random/hash.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=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/hash.h Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/dev/random/hash.h Sat Oct 12 12:57:57 2013 (r256377) > @@ -26,6 +26,9 @@ > * $FreeBSD$ > */ >=20 > +#ifndef SYS_DEV_RANDOM_HASH_H_INCLUDED > +#define SYS_DEV_RANDOM_HASH_H_INCLUDED > + > #define KEYSIZE 32 /* (in bytes) =3D=3D 256 bits */ > #define BLOCKSIZE 16 /* (in bytes) =3D=3D 128 bits */ >=20 > @@ -43,3 +46,5 @@ void randomdev_hash_iterate(struct rando > void randomdev_hash_finish(struct randomdev_hash *, void *); > void randomdev_encrypt_init(struct randomdev_key *, void *); > void randomdev_encrypt(struct randomdev_key *context, void *, void *, un= signed); > + > +#endif >=20 > Modified: head/sys/dev/random/ivy.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/ivy.c Sat Oct 12 12:34:19 2013 (r256376) > +++ head/sys/dev/random/ivy.c Sat Oct 12 12:57:57 2013 (r256377) > @@ -30,38 +30,35 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > -#include > #include > #include > +#include > #include > -#include > +#include > #include > #include >=20 > #include > #include >=20 > -#include > #include > +#include > +#include > +#include > +#include >=20 > #define RETRY_COUNT 10 >=20 > -static void random_ivy_init(void); > -static void random_ivy_deinit(void); > static int random_ivy_read(void *, int); >=20 > -struct random_adaptor random_ivy =3D { > +static struct random_hardware_source random_ivy =3D { > .ident =3D "Hardware, Intel IvyBridge+ RNG", > - .init =3D random_ivy_init, > - .deinit =3D random_ivy_deinit, > - .read =3D random_ivy_read, > - .write =3D (random_write_func_t *)random_null_func, > - .reseed =3D (random_reseed_func_t *)random_null_func, > - .seeded =3D 1, > + .source =3D RANDOM_PURE_RDRAND, > + .read =3D random_ivy_read > }; >=20 > static inline int > -ivy_rng_store(long *tmp) > +ivy_rng_store(uint64_t *tmp) > { > #ifdef __GNUCLIKE_ASM > uint32_t count; > @@ -86,34 +83,26 @@ ivy_rng_store(long *tmp) > #endif > } >=20 > -static void > -random_ivy_init(void) > -{ > -} > - > -void > -random_ivy_deinit(void) > -{ > -} > - > static int > random_ivy_read(void *buf, int c) > { > - char *b; > - long tmp; > - int count, res, retry; > + uint8_t *b; > + int count, ret, retry; > + uint64_t tmp; >=20 > - for (count =3D c, b =3D buf; count > 0; count -=3D res, b +=3D re= s) { > + b =3D buf; > + for (count =3D c; count > 0; count -=3D ret) { > for (retry =3D 0; retry < RETRY_COUNT; retry++) { > - res =3D ivy_rng_store(&tmp); > - if (res !=3D 0) > + ret =3D ivy_rng_store(&tmp); > + if (ret !=3D 0) > break; > } > - if (res =3D=3D 0) > + if (ret =3D=3D 0) > break; > - if (res > count) > - res =3D count; > - memcpy(b, &tmp, res); > + if (ret > count) > + ret =3D count; > + memcpy(b, &tmp, ret); > + b +=3D ret; > } > return (c - count); > } > @@ -121,25 +110,35 @@ random_ivy_read(void *buf, int c) > static int > rdrand_modevent(module_t mod, int type, void *unused) > { > + int error =3D 0; >=20 > switch (type) { > case MOD_LOAD: > - if (cpu_feature2 & CPUID2_RDRAND) { > - random_adaptor_register("rdrand", &random_ivy); > - EVENTHANDLER_INVOKE(random_adaptor_attach, &rando= m_ivy); > - return (0); > - } else { > + if (cpu_feature2 & CPUID2_RDRAND) > + live_entropy_source_register(&random_ivy); > + else > #ifndef KLD_MODULE > if (bootverbose) > #endif > - printf( > - "%s: RDRAND feature is not present on this CP= U\n", > + printf("%s: RDRAND is not present\n", > random_ivy.ident); > - return (0); > - } > + break; > + > + case MOD_UNLOAD: > + if (cpu_feature2 & CPUID2_RDRAND) > + live_entropy_source_deregister(&random_ivy); > + break; > + > + case MOD_SHUTDOWN: > + break; > + > + default: > + error =3D EOPNOTSUPP; > + break; > + > } >=20 > - return (EINVAL); > + return (error); > } >=20 > -RANDOM_ADAPTOR_MODULE(random_rdrand, rdrand_modevent, 1); > +LIVE_ENTROPY_SRC_MODULE(random_rdrand, rdrand_modevent, 1); >=20 > Copied: head/sys/dev/random/live_entropy_sources.c (from r256243, project= s/random_number_generator/sys/dev/random/live_entropy_sources.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 > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/random/live_entropy_sources.c Sat Oct 12 12:57:57 2013 = (r256377, copy of r256243, projects/random_number_generator/sys/dev/= random/live_entropy_sources.c) > @@ -0,0 +1,195 @@ > +/*- > + * Copyright (c) 2013 Arthur Mesh > + * Copyright (c) 2013 Mark R V Murray > + * 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 > + * in this position and unchanged. > + * 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 distributio= n. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRAN= TIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIME= D. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, = BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF = USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE= OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include > +#include > +#include > +#include > + > +#include "live_entropy_sources.h" > + > +LIST_HEAD(les_head, live_entropy_sources); > +static struct les_head sources =3D LIST_HEAD_INITIALIZER(sources); > + > +/* > + * The live_lock protects the consistency of the "struct les_head source= s" > + */ > +static struct sx les_lock; /* need a sleepable lock */ > + > +void > +live_entropy_source_register(struct random_hardware_source *rsource) > +{ > + struct live_entropy_sources *les; > + > + KASSERT(rsource !=3D NULL, ("invalid input to %s", __func__)); > + > + les =3D malloc(sizeof(struct live_entropy_sources), M_ENTROPY, M_= WAITOK); > + les->rsource =3D rsource; > + > + sx_xlock(&les_lock); > + LIST_INSERT_HEAD(&sources, les, entries); > + sx_xunlock(&les_lock); > +} > + > +void > +live_entropy_source_deregister(struct random_hardware_source *rsource) > +{ > + struct live_entropy_sources *les =3D NULL; > + > + KASSERT(rsource !=3D NULL, ("invalid input to %s", __func__)); > + > + sx_xlock(&les_lock); > + LIST_FOREACH(les, &sources, entries) > + if (les->rsource =3D=3D rsource) { > + LIST_REMOVE(les, entries); > + break; > + } > + sx_xunlock(&les_lock); > + if (les !=3D NULL) > + free(les, M_ENTROPY); > +} > + > +static int > +live_entropy_source_handler(SYSCTL_HANDLER_ARGS) > +{ > + struct live_entropy_sources *les; > + int error, count; > + > + count =3D error =3D 0; > + > + sx_slock(&les_lock); > + > + if (LIST_EMPTY(&sources)) > + error =3D SYSCTL_OUT(req, "", 0); > + else { > + LIST_FOREACH(les, &sources, entries) { > + > + error =3D SYSCTL_OUT(req, ",", count++ ? 1 : 0); > + if (error) > + break; > + > + error =3D SYSCTL_OUT(req, les->rsource->ident, st= rlen(les->rsource->ident)); > + if (error) > + break; > + } > + } > + > + sx_sunlock(&les_lock); > + > + return (error); > +} > + > +static void > +live_entropy_sources_init(void *unused) > +{ > + > + SYSCTL_PROC(_kern_random, OID_AUTO, live_entropy_sources, > + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, > + NULL, 0, live_entropy_source_handler, "", > + "List of Active Live Entropy Sources"); > + > + sx_init(&les_lock, "live_entropy_sources"); > +} > + > +/* > + * Run through all "live" sources reading entropy for the given > + * number of rounds, which should be a multiple of the number > + * of entropy accumulation pools in use; 2 for Yarrow and 32 > + * for Fortuna. > + * > + * BEWARE!!! > + * This function runs inside the RNG thread! Don't do anything silly! > + * Remember that we are NOT holding harvest_mtx on entry! > + */ > +void > +live_entropy_sources_feed(int rounds, event_proc_f entropy_processor) > +{ > + static struct harvest event; > + static uint8_t buf[HARVESTSIZE]; > + struct live_entropy_sources *les; > + int i, n; > + > + sx_slock(&les_lock); > + > + /* > + * Walk over all of live entropy sources, and feed their output > + * to the system-wide RNG. > + */ > + LIST_FOREACH(les, &sources, entries) { > + > + for (i =3D 0; i < rounds; i++) { > + /* > + * This should be quick, since it's a live entropy > + * source. > + */ > + /* FIXME: Whine loudly if this didn't work. */ > + n =3D les->rsource->read(buf, sizeof(buf)); > + n =3D MIN(n, HARVESTSIZE); > + > + event.somecounter =3D get_cyclecount(); > + event.size =3D n; > + event.bits =3D (n*8)/2; > + event.source =3D les->rsource->source; > + memcpy(event.entropy, buf, n); > + > + /* Do the actual entropy insertion */ > + entropy_processor(&event); > + } > + > + } > + > + sx_sunlock(&les_lock); > +} > + > +static void > +live_entropy_sources_deinit(void *unused) > +{ > + > + sx_destroy(&les_lock); > +} > + > +SYSINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, > + live_entropy_sources_init, NULL); > +SYSUNINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, > + live_entropy_sources_deinit, NULL); >=20 > Copied: head/sys/dev/random/live_entropy_sources.h (from r256243, project= s/random_number_generator/sys/dev/random/live_entropy_sources.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=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/random/live_entropy_sources.h Sat Oct 12 12:57:57 2013 = (r256377, copy of r256243, projects/random_number_generator/sys/dev/= random/live_entropy_sources.h) > @@ -0,0 +1,60 @@ > +/*- > + * Copyright (c) 2013 Arthur Mesh > + * Copyright (c) 2013 Mark R V Murray > + * 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 > + * in this position and unchanged. > + * 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 distributio= n. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRAN= TIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIME= D. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, >=20 > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >=20 _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 16:39:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6E2F2E4F; Sat, 12 Oct 2013 16:39:03 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 05DF625B6; Sat, 12 Oct 2013 16:39:02 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa04.fnfis.com (8.14.5/8.14.5) with ESMTP id r9CGcxjr012724 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 12 Oct 2013 11:38:59 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.103]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.02.0309.002; Sat, 12 Oct 2013 11:38:58 -0500 From: "Teske, Devin" To: Devin Teske Subject: Re: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... Thread-Topic: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... Thread-Index: AQHOx2kWmfQdvUXbBUerN/OTVWaLspnxmBUA Date: Sat, 12 Oct 2013 16:38:56 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D720FC5BEB4@LTCFISWMSGMB21.FNFIS.com> References: <201310121257.r9CCvvjO006546@svn.freebsd.org> <13CA24D6AB415D428143D44749F57D720FC5BE74@LTCFISWMSGMB21.FNFIS.com> In-Reply-To: <13CA24D6AB415D428143D44749F57D720FC5BE74@LTCFISWMSGMB21.FNFIS.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-10-12_01:2013-10-11,2013-10-12,1970-01-01 signatures=0 Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "Teske, Devin" , "svn-src-head@freebsd.org" , =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , Mark Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Oct 2013 16:39:03 -0000 On Oct 12, 2013, at 9:35 AM, Teske, Devin wrote: >=20 > On Oct 12, 2013, at 9:27 AM, Adrian Chadd wrote: >=20 >> hihi, >>=20 >> I've just test booted this on a MIPS board. It doesn't hang at boot wait= ing for entropy. >>=20 >> http://people.freebsd.org/~adrian/mips/20131012-ar9344-boot-1.txt >>=20 >> Thanks! >>=20 >>=20 >=20 > Hi Adrian, >=20 > Can you maybe test with ZFS + Geli? I'm concerned because we told it to u= se random(4) > instead of urandom(4). I hope there's enough entropy when creating the ge= li stuff that > said process doesn't hang. I think DES's patch will help there too (not t= hat anyone > testing our ZFS patches reported any hangs... including when testing GELI= -- this was > before DES's patch). >=20 > I gather that the more disks you have the greater the entropy must be -- = so it may have > been that enough disks weren't used in the testing. >=20 > I also wonder "how much entropy" did we buy with DES's patch? Enough that= we should > not worry about random(4) hanging on us during the installer for decades = to come? or > might we still be worried if someone does a GELI setup with 12 disks? >=20 > All-in-all, I was very worried about choosing random(4) for the GELI setu= p, but am *very* > happy that right before the commit, DES stepped in with the entropy stuff= ;D >=20 > Kudos! (just the above quandaries posited above) Kudos to both markm and DES I should say. markm for the sys patches on random(4) and DES for the entropy additions to= bsdinstall. But overall, my questions are about using random(4) in the installer. I thi= nk it's safe, but need to discuss/cogitate with others on. --=20 Devin >> On 12 October 2013 05:57, Mark Murray wrote: >> Author: markm >> Date: Sat Oct 12 12:57:57 2013 >> New Revision: 256377 >> URL: http://svnweb.freebsd.org/changeset/base/256377 >>=20 >> Log: >> Merge from project branch. Uninteresting commits are trimmed. >>=20 >> Refactor of /dev/random device. Main points include: >>=20 >> * Userland seeding is no longer used. This auto-seeds at boot time >> on PC/Desktop setups; this may need some tweeking and intelligence >> from those folks setting up embedded boxes, but the work is believed >> to be minimal. >>=20 >> * An entropy cache is written to /entropy (even during installation) >> and the kernel uses this at next boot. >>=20 >> * An entropy file written to /boot/entropy can be loaded by loader(8) >>=20 >> * Hardware sources such as rdrand are fed into Yarrow, and are no >> longer available raw. >>=20 >> ------------------------------------------------------------------------ >> r256240 | des | 2013-10-09 21:14:16 +0100 (Wed, 09 Oct 2013) | 4 lines >>=20 >> Add a RANDOM_RWFILE option and hide the entropy cache code behind it. >> Rename YARROW_RNG and FORTUNA_RNG to RANDOM_YARROW and RANDOM_FORTUNA. >> Add the RANDOM_* options to LINT. >>=20 >> ------------------------------------------------------------------------ >> r256239 | des | 2013-10-09 21:12:59 +0100 (Wed, 09 Oct 2013) | 2 lines >>=20 >> Define RANDOM_PURE_RNDTEST for rndtest(4). >>=20 >> ------------------------------------------------------------------------ >> r256204 | des | 2013-10-09 18:51:38 +0100 (Wed, 09 Oct 2013) | 2 lines >>=20 >> staticize struct random_hardware_source >>=20 >> ------------------------------------------------------------------------ >> r256203 | markm | 2013-10-09 18:50:36 +0100 (Wed, 09 Oct 2013) | 2 lines >>=20 >> Wrap some policy-rich code in 'if NOTYET' until we can thresh out >> what it really needs to do. >>=20 >> ------------------------------------------------------------------------ >> r256184 | des | 2013-10-09 10:13:12 +0100 (Wed, 09 Oct 2013) | 2 lines >>=20 >> Re-add /dev/urandom for compatibility purposes. >>=20 >> ------------------------------------------------------------------------ >> r256182 | des | 2013-10-09 10:11:14 +0100 (Wed, 09 Oct 2013) | 3 lines >>=20 >> Add missing include guards and move the existing ones out of the >> implementation namespace. >>=20 >> ------------------------------------------------------------------------ >> r256168 | markm | 2013-10-08 23:14:07 +0100 (Tue, 08 Oct 2013) | 10 lin= es >>=20 >> Fix some just-noticed problems: >>=20 >> o Allow this to work with "nodevice random" by fixing where the >> MALLOC pool is defined. >>=20 >> o Fix the explicit reseed code. This was correct as submitted, but >> in the project branch doesn't need to set the "seeded" bit as this >> is done correctly in the "unblock" function. >>=20 >> o Remove some debug ifdeffing. >>=20 >> o Adjust comments. >>=20 >> ------------------------------------------------------------------------ >> r256159 | markm | 2013-10-08 19:48:11 +0100 (Tue, 08 Oct 2013) | 6 lines >>=20 >> Time to eat crow for me. >>=20 >> I replaced the sx_* locks that Arthur used with regular mutexes; >> this turned out the be the wrong thing to do as the locks need to >> be sleepable. Revert this folly. >>=20 >> # Submitted by: Arthur Mesh (In original d= iff) >>=20 >> ------------------------------------------------------------------------ >> r256138 | des | 2013-10-08 12:05:26 +0100 (Tue, 08 Oct 2013) | 10 lines >>=20 >> Add YARROW_RNG and FORTUNA_RNG to sys/conf/options. >>=20 >> Add a SYSINIT that forces a reseed during proc0 setup, which happens >> fairly late in the boot process. >>=20 >> Add a RANDOM_DEBUG option which enables some debugging printf()s. >>=20 >> Add a new RANDOM_ATTACH entropy source which harvests entropy from the >> get_cyclecount() delta across each call to a device attach method. >>=20 >> ------------------------------------------------------------------------ >> r256135 | markm | 2013-10-08 07:54:52 +0100 (Tue, 08 Oct 2013) | 8 lines >>=20 >> Debugging. My attempt at EVENTHANDLER(multiuser) was a failure; use >> EVENTHANDLER(mountroot) instead. >>=20 >> This means we can't count on /var being present, so something will >> need to be done about harvesting /var/db/entropy/... . >>=20 >> Some policy now needs to be sorted out, and a pre-sync cache needs >> to be written, but apart from that we are now ready to go. >>=20 >> Over to review. >>=20 >> ------------------------------------------------------------------------ >> r256094 | markm | 2013-10-06 23:45:02 +0100 (Sun, 06 Oct 2013) | 8 lines >>=20 >> Snapshot. >>=20 >> Looking pretty good; this mostly works now. New code includes: >>=20 >> * Read cached entropy at startup, both from files and from loader(8) >> preloaded entropy. Failures are soft, but announced. Untested. >>=20 >> * Use EVENTHANDLER to do above just before we go multiuser. Untested. >>=20 >> ------------------------------------------------------------------------ >> r256088 | markm | 2013-10-06 14:01:42 +0100 (Sun, 06 Oct 2013) | 2 lines >>=20 >> Fix up the man page for random(4). This mainly removes no-longer-releva= nt >> details about HW RNGs, reseeding explicitly and user-supplied >> entropy. >>=20 >> ------------------------------------------------------------------------ >> r256087 | markm | 2013-10-06 13:43:42 +0100 (Sun, 06 Oct 2013) | 6 lines >>=20 >> As userland writing to /dev/random is no more, remove the "better >> than nothing" bootstrap mode. >>=20 >> Add SWI harvesting to the mix. >>=20 >> My box seeds Yarrow by itself in a few seconds! YMMV; more to follow. >>=20 >> ------------------------------------------------------------------------ >> r256086 | markm | 2013-10-06 13:40:32 +0100 (Sun, 06 Oct 2013) | 11 lin= es >>=20 >> Debug run. This now works, except that the "live" sources haven't >> been tested. With all sources turned on, this unlocks itself in >> a couple of seconds! That is no my box, and there is no guarantee >> that this will be the case everywhere. >>=20 >> * Cut debug prints. >>=20 >> * Use the same locks/mutexes all the way through. >>=20 >> * Be a tad more conservative about entropy estimates. >>=20 >> ------------------------------------------------------------------------ >> r256084 | markm | 2013-10-06 13:35:29 +0100 (Sun, 06 Oct 2013) | 5 lines >>=20 >> Don't use the "real" assembler mnemonics; older compilers may not >> understand them (like when building CURRENT on 9.x). >>=20 >> # Submitted by: Konstantin Belousov >>=20 >> ------------------------------------------------------------------------ >> r256081 | markm | 2013-10-06 10:55:28 +0100 (Sun, 06 Oct 2013) | 12 lin= es >>=20 >> SNAPSHOT. >>=20 >> Simplify the malloc pools; We only need one for this device. >>=20 >> Simplify the harvest queue. >>=20 >> Marginally improve the entropy pool hashing, making it a bit faster >> in the process. >>=20 >> Connect up the hardware "live" source harvesting. This is simplistic >> for now, and will need to be made rate-adaptive. >>=20 >> All of the above passes a compile test but needs to be debugged. >>=20 >> ------------------------------------------------------------------------ >> r256042 | markm | 2013-10-04 07:55:06 +0100 (Fri, 04 Oct 2013) | 25 lin= es >>=20 >> Snapshot. This passes the build test, but has not yet been finished or = debugged. >>=20 >> Contains: >>=20 >> * Refactor the hardware RNG CPU instruction sources to feed into >> the software mixer. This is unfinished. The actual harvesting needs >> to be sorted out. Modified by me (see below). >>=20 >> * Remove 'frac' parameter from random_harvest(). This was never >> used and adds extra code for no good reason. >>=20 >> * Remove device write entropy harvesting. This provided a weak >> attack vector, was not very good at bootstrapping the device. To >> follow will be a replacement explicit reseed knob. >>=20 >> * Separate out all the RANDOM_PURE sources into separate harvest >> entities. This adds some secuity in the case where more than one >> is present. >>=20 >> * Review all the code and fix anything obviously messy or inconsistent. >> Address som review concerns while I'm here, like rename the pseudo-rng >> to 'dummy'. >>=20 >> # Submitted by: Arthur Mesh (the first ite= m) >>=20 >> ------------------------------------------------------------------------ >> r255319 | markm | 2013-09-06 18:51:52 +0100 (Fri, 06 Sep 2013) | 4 lines >>=20 >> Yarrow wants entropy estimations to be conservative; the usual idea >> is that if you are certain you have N bits of entropy, you declare >> N/2. >>=20 >> ------------------------------------------------------------------------ >> r255075 | markm | 2013-08-30 18:47:53 +0100 (Fri, 30 Aug 2013) | 4 lines >>=20 >> Remove short-lived idea; thread to harvest (eg) RDRAND enropy into the >> usual harvest queues. It was a nifty idea, but too heavyweight. >>=20 >> # Submitted by: Arthur Mesh >>=20 >> ------------------------------------------------------------------------ >> r255071 | markm | 2013-08-30 12:42:57 +0100 (Fri, 30 Aug 2013) | 4 lines >>=20 >> Separate out the Software RNG entropy harvesting queue and thread >> into its own files. >>=20 >> # Submitted by: Arthur Mesh >>=20 >> ------------------------------------------------------------------------ >> r254934 | markm | 2013-08-26 20:07:03 +0100 (Mon, 26 Aug 2013) | 2 lines >>=20 >> Remove the short-lived namei experiment. >>=20 >> ------------------------------------------------------------------------ >> r254928 | markm | 2013-08-26 19:35:21 +0100 (Mon, 26 Aug 2013) | 2 lines >>=20 >> Snapshot; Do some running repairs on entropy harvesting. More needs >> to follow. >>=20 >> ------------------------------------------------------------------------ >> r254927 | markm | 2013-08-26 19:29:51 +0100 (Mon, 26 Aug 2013) | 15 lin= es >>=20 >> Snapshot of current work; >>=20 >> 1) Clean up namespace; only use "Yarrow" where it is Yarrow-specific >> or close enough to the Yarrow algorithm. For the rest use a neutral >> name. >>=20 >> 2) Tidy up headers; put private stuff in private places. More could >> be done here. >>=20 >> 3) Streamline the hashing/encryption; no need for a 256-bit counter; >> 128 bits will last for long enough. >>=20 >> There are bits of debug code lying around; these will be removed >> at a later stage. >>=20 >> ------------------------------------------------------------------------ >> r254784 | markm | 2013-08-24 14:54:56 +0100 (Sat, 24 Aug 2013) | 39 lin= es >>=20 >> 1) example (partially humorous random_adaptor, that I call "EXAMPLE") >> * It's not meant to be used in a real system, it's there to show how >> the basics of how to create interfaces for random_adaptors. Perhaps >> it should belong in a manual page >>=20 >> 2) Move probe.c's functionality in to random_adaptors.c >> * rename random_ident_hardware() to random_adaptor_choose() >>=20 >> 3) Introduce a new way to choose (or select) random_adaptors via tunable >> "rngs_want" It's a list of comma separated names of adaptors, ordered >> by preferences. I.e.: >> rngs_want=3D"yarrow,rdrand" >>=20 >> Such setting would cause yarrow to be preferred to rdrand. If neither of >> them are available (or registered), then system will default to >> something reasonable (currently yarrow). If yarrow is not present, then >> we fall back to the adaptor that's first on the list of registered >> adaptors. >>=20 >> 4) Introduce a way where RNGs can play a role of entropy source. This is >> mostly useful for HW rngs. >>=20 >> The way I envision this is that every HW RNG will use this >> functionality by default. Functionality to disable this is also present. >> I have an example of how to use this in random_adaptor_example.c (see >> modload event, and init function) >>=20 >> 5) fix kern.random.adaptors from >> kern.random.adaptors: yarrowpanicblock >> to >> kern.random.adaptors: yarrow,panic,block >>=20 >> 6) add kern.random.active_adaptor to indicate currently selected >> adaptor: >> root@freebsd04:~ # sysctl kern.random.active_adaptor >> kern.random.active_adaptor: yarrow >>=20 >> # Submitted by: Arthur Mesh >>=20 >> Submitted by: Dag-Erling Sm=F8rgrav , Arthur Mesh >> Reviewed by: des@FreeBSD.org >> Approved by: re (delphij) >> Approved by: secteam (des,delphij) >>=20 >> Added: >> head/sys/dev/random/dummy_rng.c >> - copied unchanged from r256243, projects/random_number_generator/sy= s/dev/random/dummy_rng.c >> head/sys/dev/random/live_entropy_sources.c >> - copied unchanged from r256243, projects/random_number_generator/sy= s/dev/random/live_entropy_sources.c >> head/sys/dev/random/live_entropy_sources.h >> - copied unchanged from r256243, projects/random_number_generator/sy= s/dev/random/live_entropy_sources.h >> head/sys/dev/random/rwfile.c >> - copied unchanged from r256243, projects/random_number_generator/sy= s/dev/random/rwfile.c >> head/sys/dev/random/rwfile.h >> - copied unchanged from r256243, projects/random_number_generator/sy= s/dev/random/rwfile.h >> Deleted: >> head/sys/dev/random/pseudo_rng.c >> Modified: >> head/etc/defaults/rc.conf >> head/etc/rc.d/initrandom >> head/share/examples/kld/random_adaptor/random_adaptor_example.c (cont= ents, props changed) >> head/share/man/man4/random.4 >> head/sys/boot/forth/loader.conf >> head/sys/conf/NOTES >> head/sys/conf/files >> head/sys/conf/files.amd64 >> head/sys/conf/files.i386 >> head/sys/conf/options >> head/sys/dev/glxsb/glxsb.c >> head/sys/dev/hifn/hifn7751.c >> head/sys/dev/random/harvest.c >> head/sys/dev/random/hash.h >> head/sys/dev/random/ivy.c >> head/sys/dev/random/nehemiah.c >> head/sys/dev/random/random_adaptors.c >> head/sys/dev/random/random_adaptors.h >> head/sys/dev/random/random_harvestq.c >> head/sys/dev/random/random_harvestq.h >> head/sys/dev/random/randomdev.c >> head/sys/dev/random/randomdev.h >> head/sys/dev/random/randomdev_soft.c >> head/sys/dev/random/randomdev_soft.h >> head/sys/dev/random/yarrow.c >> head/sys/dev/random/yarrow.h >> head/sys/dev/rndtest/rndtest.c >> head/sys/dev/safe/safe.c >> head/sys/dev/syscons/scmouse.c >> head/sys/dev/syscons/syscons.c >> head/sys/dev/ubsec/ubsec.c >> head/sys/kern/kern_intr.c >> head/sys/kern/subr_bus.c >> head/sys/mips/cavium/octeon_rnd.c >> head/sys/modules/random/Makefile >> head/sys/net/if_ethersubr.c >> head/sys/net/if_tun.c >> head/sys/netgraph/ng_iface.c >> head/sys/sys/random.h >> Directory Properties: >> head/ (props changed) >>=20 >> Modified: head/etc/defaults/rc.conf >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/defaults/rc.conf Sat Oct 12 12:34:19 2013 (r256376) >> +++ head/etc/defaults/rc.conf Sat Oct 12 12:57:57 2013 (r256377) >> @@ -651,6 +651,7 @@ entropy_save_num=3D"8" # Number of entropy >> harvest_interrupt=3D"YES" # Entropy device harvests interrupt ran= domness >> harvest_ethernet=3D"YES" # Entropy device harvests ethernet randomness >> harvest_p_to_p=3D"YES" # Entropy device harvests point-to-point random= ness >> +harvest_swi=3D"YES" # Entropy device harvests internal SWI randomn= ess >> dmesg_enable=3D"YES" # Save dmesg(8) to /var/run/dmesg.boot >> watchdogd_enable=3D"NO" # Start the software watchdog daemon >> watchdogd_flags=3D"" # Flags to watchdogd (if enabled) >>=20 >> Modified: head/etc/rc.d/initrandom >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/rc.d/initrandom Sat Oct 12 12:34:19 2013 (r256376) >> +++ head/etc/rc.d/initrandom Sat Oct 12 12:57:57 2013 (r256377) >> @@ -14,26 +14,6 @@ name=3D"initrandom" >> start_cmd=3D"initrandom_start" >> stop_cmd=3D":" >>=20 >> -feed_dev_random() >> -{ >> - if [ -f "${1}" -a -r "${1}" -a -s "${1}" ]; then >> - cat "${1}" | dd of=3D/dev/random bs=3D8k 2>/dev/null >> - fi >> -} >> - >> -better_than_nothing() >> -{ >> - # XXX temporary until we can improve the entropy >> - # harvesting rate. >> - # Entropy below is not great, but better than nothing. >> - # This unblocks the generator at startup >> - # Note: commands are ordered to cause the most variance across r= eboots. >> - ( kenv; dmesg; df -ib; ps -fauxww; date; sysctl -a ) \ >> - | dd of=3D/dev/random bs=3D8k 2>/dev/null >> - /sbin/sha256 -q `sysctl -n kern.bootfile` \ >> - | dd of=3D/dev/random bs=3D8k 2>/dev/null >> -} >> - >> initrandom_start() >> { >> soft_random_generator=3D`sysctl kern.random 2>/dev/null` >> @@ -63,23 +43,15 @@ initrandom_start() >> else >> ${SYSCTL} kern.random.sys.harvest.point_t= o_point=3D0 >/dev/null >> fi >> - fi >>=20 >> - # First pass at reseeding /dev/random. >> - # >> - case ${entropy_file} in >> - [Nn][Oo] | '') >> - ;; >> - *) >> - if [ -w /dev/random ]; then >> - feed_dev_random "${entropy_file}" >> + if checkyesno harvest_swi; then >> + ${SYSCTL} kern.random.sys.harvest.swi=3D= 1 >/dev/null >> + echo -n ' swi' >> + else >> + ${SYSCTL} kern.random.sys.harvest.swi=3D= 0 >/dev/null >> fi >> - ;; >> - esac >> - >> - better_than_nothing >> + fi >>=20 >> - echo -n ' kickstart' >> fi >>=20 >> echo '.' >>=20 >> Modified: head/share/examples/kld/random_adaptor/random_adaptor_example.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/share/examples/kld/random_adaptor/random_adaptor_example.c = Sat Oct 12 12:34:19 2013 (r256376) >> +++ head/share/examples/kld/random_adaptor/random_adaptor_example.c = Sat Oct 12 12:57:57 2013 (r256377) >> @@ -30,32 +30,29 @@ __FBSDID("$FreeBSD$"); >>=20 >> #include >> #include >> +#include >> #include >> -#include >> +#include >> #include >>=20 >> +#include >> #include >> #include >>=20 >> -#define RNG_NAME "example" >> - >> static int random_example_read(void *, int); >>=20 >> struct random_adaptor random_example =3D { >> .ident =3D "Example RNG", >> - .init =3D (random_init_func_t *)random_null_func, >> - .deinit =3D (random_deinit_func_t *)random_null_func, >> + .source =3D RANDOM_PURE_BOGUS, /* Make sure this is in >> + * sys/random.h and is unique */ >> .read =3D random_example_read, >> - .write =3D (random_write_func_t *)random_null_func, >> - .reseed =3D (random_reseed_func_t *)random_null_func, >> - .seeded =3D 1, >> }; >>=20 >> /* >> * Used under the license provided @ http://xkcd.com/221/ >> * http://creativecommons.org/licenses/by-nc/2.5/ >> */ >> -static u_char >> +static uint8_t >> getRandomNumber(void) >> { >> return 4; /* chosen by fair dice roll, guaranteed to be random = */ >> @@ -64,14 +61,13 @@ getRandomNumber(void) >> static int >> random_example_read(void *buf, int c) >> { >> - u_char *b; >> + uint8_t *b; >> int count; >>=20 >> b =3D buf; >>=20 >> - for (count =3D 0; count < c; count++) { >> + for (count =3D 0; count < c; count++) >> b[count] =3D getRandomNumber(); >> - } >>=20 >> printf("returning %d bytes of pure randomness\n", c); >> return (c); >> @@ -80,15 +76,26 @@ random_example_read(void *buf, int c) >> static int >> random_example_modevent(module_t mod, int type, void *unused) >> { >> + int error =3D 0; >>=20 >> switch (type) { >> case MOD_LOAD: >> - random_adaptor_register(RNG_NAME, &random_example); >> - EVENTHANDLER_INVOKE(random_adaptor_attach, &random_examp= le); >> - return (0); >> + live_entropy_source_register(&random_example); >> + break; >> + >> + case MOD_UNLOAD: >> + live_entropy_source_deregister(&random_example); >> + break; >> + >> + case MOD_SHUTDOWN: >> + break; >> + >> + default: >> + error =3D EOPNOTSUPP; >> + break; >> } >>=20 >> - return (EINVAL); >> + return (error); >> } >>=20 >> -RANDOM_ADAPTOR_MODULE(random_example, random_example_modevent, 1); >> +LIVE_ENTROPY_SRC_MODULE(live_entropy_source_example, random_example_mod= event, 1); >>=20 >> Modified: head/share/man/man4/random.4 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/share/man/man4/random.4 Sat Oct 12 12:34:19 2013 = (r256376) >> +++ head/share/man/man4/random.4 Sat Oct 12 12:57:57 2013 = (r256377) >> @@ -1,4 +1,4 @@ >> -.\" Copyright (c) 2001 Mark R V Murray. All rights reserved. >> +.\" Copyright (c) 2001-2013 Mark R V Murray. All rights reserved. >> .\" >> .\" Redistribution and use in source and binary forms, with or without >> .\" modification, are permitted provided that the following conditions >> @@ -23,7 +23,7 @@ >> .\" >> .\" $FreeBSD$ >> .\" >> -.Dd August 7, 2013 >> +.Dd October 12, 2013 >> .Dt RANDOM 4 >> .Os >> .Sh NAME >> @@ -43,35 +43,48 @@ The device will probe for >> certain hardware entropy sources, >> and use these in preference to the fallback, >> which is a generator implemented in software. >> -If the kernel environment MIB's >> -.Va hw.nehemiah_rng_enable >> -or >> -.Va hw.ivy_rng_enable >> -are set to >> -.Dq Li 0 , >> -the associated hardware entropy source will be ignored. >> -.Pp >> -If the device is using >> -the software generator, >> -writing data to >> -.Nm >> -would perturb the internal state. >> -This perturbation of the internal state >> -is the only userland method of introducing >> -extra entropy into the device. >> -If the writer has superuser privilege, >> -then closing the device after writing >> -will make the software generator reseed itself. >> -This can be used for extra security, >> -as it immediately introduces any/all new entropy >> -into the PRNG. >> -The hardware generators will generate >> -sufficient quantities of entropy, >> -and will therefore ignore user-supplied input. >> -The software >> -.Nm >> -device may be controlled with >> -.Xr sysctl 8 . >> +.Pp >> +The software generator will start in an >> +.Em unseeded >> +state, and will block reads until >> +it is (re)seeded. >> +This may cause trouble at system boot >> +when keys and the like >> +are generated from >> +/dev/random >> +so steps should be taken to ensure a >> +reseed as soon as possible. >> +The >> +.Xr sysctl 8 >> +controlling the >> +.Em seeded >> +status (see below) may be used >> +if security is not an issue >> +or for convenience >> +during setup or development. >> +.Pp >> +This initial seeding >> +of random number generators >> +is a bootstrapping problem >> +that needs very careful attention. >> +In some cases, >> +it may be difficult >> +to find enough randomness >> +to seed a random number generator >> +until a system is fully operational, >> +but the system requires random numbers >> +to become fully operational. >> +It is (or more accurately should be) >> +critically important that the >> +.Nm >> +device is seeded >> +before the first time it is used. >> +In the case where a dummy or "blocking-only" >> +device is used, >> +it is the responsibility >> +of the system architect >> +to ensure that no blocking reads >> +hold up critical processes. >> .Pp >> To see the current settings of the software >> .Nm >> @@ -81,22 +94,20 @@ device, use the command line: >> .Pp >> which results in something like: >> .Bd -literal -offset indent >> -kern.random.adaptors: yarrow >> +kern.random.adaptors: yarrow,dummy >> +kern.random.active_adaptor: yarrow >> +kern.random.yarrow.gengateinterval: 10 >> +kern.random.yarrow.bins: 10 >> +kern.random.yarrow.fastthresh: 96 >> +kern.random.yarrow.slowthresh: 128 >> +kern.random.yarrow.slowoverthresh: 2 >> kern.random.sys.seeded: 1 >> kern.random.sys.harvest.ethernet: 1 >> kern.random.sys.harvest.point_to_point: 1 >> kern.random.sys.harvest.interrupt: 1 >> -kern.random.sys.harvest.swi: 0 >> -kern.random.yarrow.gengateinterval: 10 >> -kern.random.yarrow.bins: 10 >> -kern.random.yarrow.fastthresh: 192 >> -kern.random.yarrow.slowthresh: 256 >> -kern.random.yarrow.slowoverthresh: 2 >> +kern.random.sys.harvest.swi: 1 >> .Ed >> .Pp >> -(These would not be seen if a >> -hardware generator is present.) >> -.Pp >> Other than >> .Dl kern.random.adaptors >> all settings are read/write. >> @@ -107,9 +118,10 @@ variable indicates whether or not the >> .Nm >> device is in an acceptably secure state >> as a result of reseeding. >> -If set to 0, the device will block (on read) until the next reseed >> -(which can be from an explicit write, >> -or as a result of entropy harvesting). >> +If set to 0, >> +the device will block (on read) >> +until the next reseed >> +as a result of entropy harvesting. >> A reseed will set the value to 1 (non-blocking). >> .Pp >> The >> @@ -276,19 +288,6 @@ the generator produce independent sequen >> However, the guessability or reproducibility of the sequence is unimport= ant, >> unlike the previous cases. >> .Pp >> -One final consideration for the seeding of random number generators >> -is a bootstrapping problem. >> -In some cases, it may be difficult to find enough randomness to >> -seed a random number generator until a system is fully operational, >> -but the system requires random numbers to become fully operational. >> -There is no substitute for careful thought here, >> -but the >> -.Fx >> -.Nm >> -device, >> -which is based on the Yarrow system, >> -should be of some help in this area. >> -.Pp >> .Fx >> does also provide the traditional >> .Xr rand 3 >> @@ -325,17 +324,7 @@ and is an implementation of the >> .Em Yarrow >> algorithm by Bruce Schneier, >> .Em et al . >> -The only hardware implementations >> -currently are for the >> -.Tn VIA C3 Nehemiah >> -(stepping 3 or greater) >> -CPU >> -and the >> -.Tn Intel >> -.Dq Bull Mountain >> -.Em RdRand >> -instruction and underlying random number generator (RNG). >> -More will be added in the future. >> +Significant infrastructure work was done by Arthur Mesh. >> .Pp >> The author gratefully acknowledges >> significant assistance from VIA Technologies, Inc. >>=20 >> Modified: head/sys/boot/forth/loader.conf >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/boot/forth/loader.conf Sat Oct 12 12:34:19 2013 = (r256376) >> +++ head/sys/boot/forth/loader.conf Sat Oct 12 12:57:57 2013 = (r256377) >> @@ -39,6 +39,17 @@ bitmap_type=3D"splash_image_data" # and pl >>=20 >>=20 >> ############################################################## >> +### Random number generator configuration ################### >> +############################################################## >> + >> +entropy_cache_load=3D"NO" # Set this to YES to l= oad entropy at boot time >> +entropy_cache_name=3D"/boot/entropy" # Set this to the name of the = file >> +entropy_cache_type=3D"/boot/entropy" >> +#kern.random.sys.seeded=3D"0" # Set this to 1 to start /dev/= random >> + # without waiting for a (re)seed. >> + >> + >> +############################################################## >> ### Loader settings ######################################## >> ############################################################## >>=20 >>=20 >> Modified: head/sys/conf/NOTES >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/NOTES Sat Oct 12 12:34:19 2013 (r256376) >> +++ head/sys/conf/NOTES Sat Oct 12 12:57:57 2013 (r256377) >> @@ -2962,3 +2962,8 @@ options RCTL >> options BROOKTREE_ALLOC_PAGES=3D(217*4+1) >> options MAXFILES=3D999 >>=20 >> +# Random number generator >> +options RANDOM_YARROW # Yarrow RNG >> +##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented >> +options RANDOM_DEBUG # Debugging messages >> +options RANDOM_RWFILE # Read and write entropy cache >>=20 >> Modified: head/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 >> --- head/sys/conf/files Sat Oct 12 12:34:19 2013 (r256376) >> +++ head/sys/conf/files Sat Oct 12 12:57:57 2013 (r256377) >> @@ -2043,13 +2043,15 @@ rt2860.fw optional rt2860f= w | ralfw \ >> no-obj no-implicit-rule \ >> clean "rt2860.fw" >> dev/random/harvest.c standard >> -dev/random/hash.c optional random >> -dev/random/pseudo_rng.c standard >> +dev/random/dummy_rng.c standard >> dev/random/random_adaptors.c standard >> -dev/random/random_harvestq.c standard >> +dev/random/live_entropy_sources.c optional random >> +dev/random/random_harvestq.c optional random >> dev/random/randomdev.c optional random >> dev/random/randomdev_soft.c optional random >> dev/random/yarrow.c optional random >> +dev/random/hash.c optional random >> +dev/random/rwfile.c optional random >> dev/rc/rc.c optional rc >> dev/re/if_re.c optional re >> dev/rndtest/rndtest.c optional rndtest >>=20 >> Modified: head/sys/conf/files.amd64 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/files.amd64 Sat Oct 12 12:34:19 2013 (r256376) >> +++ head/sys/conf/files.amd64 Sat Oct 12 12:57:57 2013 (r256377) >> @@ -259,8 +259,8 @@ dev/nvme/nvme_sysctl.c optional = nvme >> dev/nvme/nvme_test.c optional nvme >> dev/nvme/nvme_util.c optional nvme >> dev/nvram/nvram.c optional nvram isa >> -dev/random/ivy.c optional random rdrand_rng >> -dev/random/nehemiah.c optional random padlock_rng >> +dev/random/ivy.c optional rdrand_rng >> +dev/random/nehemiah.c optional padlock_rng >> dev/qlxge/qls_dbg.c optional qlxge pci >> dev/qlxge/qls_dump.c optional qlxge pci >> dev/qlxge/qls_hw.c optional qlxge pci >>=20 >> Modified: head/sys/conf/files.i386 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/files.i386 Sat Oct 12 12:34:19 2013 (r256376) >> +++ head/sys/conf/files.i386 Sat Oct 12 12:57:57 2013 (r256377) >> @@ -257,8 +257,8 @@ dev/nvme/nvme_test.c optional nvme >> dev/nvme/nvme_util.c optional nvme >> dev/nvram/nvram.c optional nvram isa >> dev/pcf/pcf_isa.c optional pcf >> -dev/random/ivy.c optional random rdrand_rng >> -dev/random/nehemiah.c optional random padlock_rng >> +dev/random/ivy.c optional rdrand_rng >> +dev/random/nehemiah.c optional padlock_rng >> dev/sbni/if_sbni.c optional sbni >> dev/sbni/if_sbni_isa.c optional sbni isa >> dev/sbni/if_sbni_pci.c optional sbni pci >>=20 >> Modified: head/sys/conf/options >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/options Sat Oct 12 12:34:19 2013 (r256376) >> +++ head/sys/conf/options Sat Oct 12 12:57:57 2013 (r256377) >> @@ -904,3 +904,9 @@ RACCT opt_global.h >>=20 >> # Resource Limits >> RCTL opt_global.h >> + >> +# Random number generator(s) >> +RANDOM_YARROW opt_random.h >> +RANDOM_FORTUNA opt_random.h >> +RANDOM_DEBUG opt_random.h >> +RANDOM_RWFILE opt_random.h >>=20 >> Modified: head/sys/dev/glxsb/glxsb.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/dev/glxsb/glxsb.c Sat Oct 12 12:34:19 2013 (r256376) >> +++ head/sys/dev/glxsb/glxsb.c Sat Oct 12 12:57:57 2013 (r256377) >> @@ -476,7 +476,7 @@ glxsb_rnd(void *v) >> if (status & SB_RNS_TRNG_VALID) { >> value =3D bus_read_4(sc->sc_sr, SB_RANDOM_NUM); >> /* feed with one uint32 */ >> - random_harvest(&value, 4, 32/2, 0, RANDOM_PURE); >> + random_harvest(&value, 4, 32/2, RANDOM_PURE_GLXSB); >> } >>=20 >> callout_reset(&sc->sc_rngco, sc->sc_rnghz, glxsb_rnd, sc); >>=20 >> Modified: head/sys/dev/hifn/hifn7751.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/dev/hifn/hifn7751.c Sat Oct 12 12:34:19 2013 = (r256376) >> +++ head/sys/dev/hifn/hifn7751.c Sat Oct 12 12:57:57 2013 = (r256377) >> @@ -258,7 +258,7 @@ hifn_partname(struct hifn_softc *sc) >> static void >> default_harvest(struct rndtest_state *rsp, void *buf, u_int count) >> { >> - random_harvest(buf, count, count*NBBY/2, 0, RANDOM_PURE); >> + random_harvest(buf, count, count*NBBY/2, RANDOM_PURE_HIFN); >> } >>=20 >> static u_int >>=20 >> Copied: head/sys/dev/random/dummy_rng.c (from r256243, projects/random_n= umber_generator/sys/dev/random/dummy_rng.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 >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/dev/random/dummy_rng.c Sat Oct 12 12:57:57 2013 = (r256377, copy of r256243, projects/random_number_generator/sys/dev/random/= dummy_rng.c) >> @@ -0,0 +1,123 @@ >> +/*- >> + * Copyright (c) 2013 Arthur Mesh >> + * 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 >> + * in this position and unchanged. >> + * 2. Redistributions in binary form must reproduce the above copyright >> + * notice, this list of conditions and the following disclaimer in t= he >> + * documentation and/or other materials provided with the distributi= on. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR >> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRA= NTIES >> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIM= ED. >> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, >> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,= BUT >> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF= USE, >> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE US= E 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 >> + >> +static struct mtx dummy_random_mtx; >> + >> +/* Used to fake out unused random calls in random_adaptor */ >> +static void >> +random_null_func(void) >> +{ >> +} >> + >> +static int >> +dummy_random_poll(int events __unused, struct thread *td __unused) >> +{ >> + >> + return (0); >> +} >> + >> +static int >> +dummy_random_block(int flag) >> +{ >> + int error =3D 0; >> + >> + mtx_lock(&dummy_random_mtx); >> + >> + /* Blocking logic */ >> + while (!error) { >> + if (flag & O_NONBLOCK) >> + error =3D EWOULDBLOCK; >> + else { >> + printf("random: dummy device blocking on read.\n= "); >> + error =3D msleep(&dummy_random_block, >> + &dummy_random_mtx, >> + PUSER | PCATCH, "block", 0); >> + } >> + } >> + mtx_unlock(&dummy_random_mtx); >> + >> + return (error); >> +} >> + >> +static void >> +dummy_random_init(void) >> +{ >> + >> + mtx_init(&dummy_random_mtx, "sleep mtx for dummy_random", >> + NULL, MTX_DEF); >> +} >> + >> +static void >> +dummy_random_deinit(void) >> +{ >> + >> + mtx_destroy(&dummy_random_mtx); >> +} >> + >> +struct random_adaptor dummy_random =3D { >> + .ident =3D "Dummy entropy device that always blocks", >> + .init =3D dummy_random_init, >> + .deinit =3D dummy_random_deinit, >> + .block =3D dummy_random_block, >> + .poll =3D dummy_random_poll, >> + .read =3D (random_read_func_t *)random_null_func, >> + .reseed =3D (random_reseed_func_t *)random_null_func, >> + .seeded =3D 0, /* This device can never be seeded */ >> +}; >> + >> +static int >> +dummy_random_modevent(module_t mod __unused, int type, void *unused __u= nused) >> +{ >> + >> + switch (type) { >> + case MOD_LOAD: >> + random_adaptor_register("dummy", &dummy_random); >> + EVENTHANDLER_INVOKE(random_adaptor_attach, >> + &dummy_random); >> + >> + return (0); >> + } >> + >> + return (EINVAL); >> +} >> + >> +RANDOM_ADAPTOR_MODULE(dummy, dummy_random_modevent, 1); >>=20 >> Modified: head/sys/dev/random/harvest.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/dev/random/harvest.c Sat Oct 12 12:34:19 2013 = (r256376) >> +++ head/sys/dev/random/harvest.c Sat Oct 12 12:57:57 2013 = (r256377) >> @@ -48,20 +48,20 @@ __FBSDID("$FreeBSD$"); >> static int read_random_phony(void *, int); >>=20 >> /* Structure holding the desired entropy sources */ >> -struct harvest_select harvest =3D { 1, 1, 1, 0 }; >> +struct harvest_select harvest =3D { 1, 1, 1, 1 }; >> static int warned =3D 0; >>=20 >> /* hold the address of the routine which is actually called if >> * the randomdev is loaded >> */ >> -static void (*reap_func)(u_int64_t, const void *, u_int, u_int, u_int, >> +static void (*reap_func)(u_int64_t, const void *, u_int, u_int, >> enum esource) =3D NULL; >> static int (*read_func)(void *, int) =3D read_random_phony; >>=20 >> /* Initialise the harvester at load time */ >> void >> randomdev_init_harvester(void (*reaper)(u_int64_t, const void *, u_int, >> - u_int, u_int, enum esource), int (*reader)(void *, int)) >> + u_int, enum esource), int (*reader)(void *, int)) >> { >> reap_func =3D reaper; >> read_func =3D reader; >> @@ -86,12 +86,10 @@ randomdev_deinit_harvester(void) >> * read which can be quite expensive. >> */ >> void >> -random_harvest(void *entropy, u_int count, u_int bits, u_int frac, >> - enum esource origin) >> +random_harvest(void *entropy, u_int count, u_int bits, enum esource ori= gin) >> { >> if (reap_func) >> - (*reap_func)(get_cyclecount(), entropy, count, bits, fra= c, >> - origin); >> + (*reap_func)(get_cyclecount(), entropy, count, bits, ori= gin); >> } >>=20 >> /* Userland-visible version of read_random */ >>=20 >> Modified: head/sys/dev/random/hash.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=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/dev/random/hash.h Sat Oct 12 12:34:19 2013 (r256376) >> +++ head/sys/dev/random/hash.h Sat Oct 12 12:57:57 2013 (r256377) >> @@ -26,6 +26,9 @@ >> * $FreeBSD$ >> */ >>=20 >> +#ifndef SYS_DEV_RANDOM_HASH_H_INCLUDED >> +#define SYS_DEV_RANDOM_HASH_H_INCLUDED >> + >> #define KEYSIZE 32 /* (in bytes) =3D=3D 256 bits */ >> #define BLOCKSIZE 16 /* (in bytes) =3D=3D 128 bits */ >>=20 >> @@ -43,3 +46,5 @@ void randomdev_hash_iterate(struct rando >> void randomdev_hash_finish(struct randomdev_hash *, void *); >> void randomdev_encrypt_init(struct randomdev_key *, void *); >> void randomdev_encrypt(struct randomdev_key *context, void *, void *, un= signed); >> + >> +#endif >>=20 >> Modified: head/sys/dev/random/ivy.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/dev/random/ivy.c Sat Oct 12 12:34:19 2013 (r256376) >> +++ head/sys/dev/random/ivy.c Sat Oct 12 12:57:57 2013 (r256377) >> @@ -30,38 +30,35 @@ >> __FBSDID("$FreeBSD$"); >>=20 >> #include >> -#include >> #include >> #include >> +#include >> #include >> -#include >> +#include >> #include >> #include >>=20 >> #include >> #include >>=20 >> -#include >> #include >> +#include >> +#include >> +#include >> +#include >>=20 >> #define RETRY_COUNT 10 >>=20 >> -static void random_ivy_init(void); >> -static void random_ivy_deinit(void); >> static int random_ivy_read(void *, int); >>=20 >> -struct random_adaptor random_ivy =3D { >> +static struct random_hardware_source random_ivy =3D { >> .ident =3D "Hardware, Intel IvyBridge+ RNG", >> - .init =3D random_ivy_init, >> - .deinit =3D random_ivy_deinit, >> - .read =3D random_ivy_read, >> - .write =3D (random_write_func_t *)random_null_func, >> - .reseed =3D (random_reseed_func_t *)random_null_func, >> - .seeded =3D 1, >> + .source =3D RANDOM_PURE_RDRAND, >> + .read =3D random_ivy_read >> }; >>=20 >> static inline int >> -ivy_rng_store(long *tmp) >> +ivy_rng_store(uint64_t *tmp) >> { >> #ifdef __GNUCLIKE_ASM >> uint32_t count; >> @@ -86,34 +83,26 @@ ivy_rng_store(long *tmp) >> #endif >> } >>=20 >> -static void >> -random_ivy_init(void) >> -{ >> -} >> - >> -void >> -random_ivy_deinit(void) >> -{ >> -} >> - >> static int >> random_ivy_read(void *buf, int c) >> { >> - char *b; >> - long tmp; >> - int count, res, retry; >> + uint8_t *b; >> + int count, ret, retry; >> + uint64_t tmp; >>=20 >> - for (count =3D c, b =3D buf; count > 0; count -=3D res, b +=3D r= es) { >> + b =3D buf; >> + for (count =3D c; count > 0; count -=3D ret) { >> for (retry =3D 0; retry < RETRY_COUNT; retry++) { >> - res =3D ivy_rng_store(&tmp); >> - if (res !=3D 0) >> + ret =3D ivy_rng_store(&tmp); >> + if (ret !=3D 0) >> break; >> } >> - if (res =3D=3D 0) >> + if (ret =3D=3D 0) >> break; >> - if (res > count) >> - res =3D count; >> - memcpy(b, &tmp, res); >> + if (ret > count) >> + ret =3D count; >> + memcpy(b, &tmp, ret); >> + b +=3D ret; >> } >> return (c - count); >> } >> @@ -121,25 +110,35 @@ random_ivy_read(void *buf, int c) >> static int >> rdrand_modevent(module_t mod, int type, void *unused) >> { >> + int error =3D 0; >>=20 >> switch (type) { >> case MOD_LOAD: >> - if (cpu_feature2 & CPUID2_RDRAND) { >> - random_adaptor_register("rdrand", &random_ivy); >> - EVENTHANDLER_INVOKE(random_adaptor_attach, &rand= om_ivy); >> - return (0); >> - } else { >> + if (cpu_feature2 & CPUID2_RDRAND) >> + live_entropy_source_register(&random_ivy); >> + else >> #ifndef KLD_MODULE >> if (bootverbose) >> #endif >> - printf( >> - "%s: RDRAND feature is not present on this C= PU\n", >> + printf("%s: RDRAND is not present\n", >> random_ivy.ident); >> - return (0); >> - } >> + break; >> + >> + case MOD_UNLOAD: >> + if (cpu_feature2 & CPUID2_RDRAND) >> + live_entropy_source_deregister(&random_ivy); >> + break; >> + >> + case MOD_SHUTDOWN: >> + break; >> + >> + default: >> + error =3D EOPNOTSUPP; >> + break; >> + >> } >>=20 >> - return (EINVAL); >> + return (error); >> } >>=20 >> -RANDOM_ADAPTOR_MODULE(random_rdrand, rdrand_modevent, 1); >> +LIVE_ENTROPY_SRC_MODULE(random_rdrand, rdrand_modevent, 1); >>=20 >> Copied: head/sys/dev/random/live_entropy_sources.c (from r256243, projec= ts/random_number_generator/sys/dev/random/live_entropy_sources.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 >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/dev/random/live_entropy_sources.c Sat Oct 12 12:57:57 2013= (r256377, copy of r256243, projects/random_number_generator/sys/dev= /random/live_entropy_sources.c) >> @@ -0,0 +1,195 @@ >> +/*- >> + * Copyright (c) 2013 Arthur Mesh >> + * Copyright (c) 2013 Mark R V Murray >> + * 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 >> + * in this position and unchanged. >> + * 2. Redistributions in binary form must reproduce the above copyright >> + * notice, this list of conditions and the following disclaimer in t= he >> + * documentation and/or other materials provided with the distributi= on. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR >> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRA= NTIES >> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIM= ED. >> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, >> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,= BUT >> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF= USE, >> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE US= E 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 "live_entropy_sources.h" >> + >> +LIST_HEAD(les_head, live_entropy_sources); >> +static struct les_head sources =3D LIST_HEAD_INITIALIZER(sources); >> + >> +/* >> + * The live_lock protects the consistency of the "struct les_head sourc= es" >> + */ >> +static struct sx les_lock; /* need a sleepable lock */ >> + >> +void >> +live_entropy_source_register(struct random_hardware_source *rsource) >> +{ >> + struct live_entropy_sources *les; >> + >> + KASSERT(rsource !=3D NULL, ("invalid input to %s", __func__)); >> + >> + les =3D malloc(sizeof(struct live_entropy_sources), M_ENTROPY, M= _WAITOK); >> + les->rsource =3D rsource; >> + >> + sx_xlock(&les_lock); >> + LIST_INSERT_HEAD(&sources, les, entries); >> + sx_xunlock(&les_lock); >> +} >> + >> +void >> +live_entropy_source_deregister(struct random_hardware_source *rsource) >> +{ >> + struct live_entropy_sources *les =3D NULL; >> + >> + KASSERT(rsource !=3D NULL, ("invalid input to %s", __func__)); >> + >> + sx_xlock(&les_lock); >> + LIST_FOREACH(les, &sources, entries) >> + if (les->rsource =3D=3D rsource) { >> + LIST_REMOVE(les, entries); >> + break; >> + } >> + sx_xunlock(&les_lock); >> + if (les !=3D NULL) >> + free(les, M_ENTROPY); >> +} >> + >> +static int >> +live_entropy_source_handler(SYSCTL_HANDLER_ARGS) >> +{ >> + struct live_entropy_sources *les; >> + int error, count; >> + >> + count =3D error =3D 0; >> + >> + sx_slock(&les_lock); >> + >> + if (LIST_EMPTY(&sources)) >> + error =3D SYSCTL_OUT(req, "", 0); >> + else { >> + LIST_FOREACH(les, &sources, entries) { >> + >> + error =3D SYSCTL_OUT(req, ",", count++ ? 1 : 0); >> + if (error) >> + break; >> + >> + error =3D SYSCTL_OUT(req, les->rsource->ident, s= trlen(les->rsource->ident)); >> + if (error) >> + break; >> + } >> + } >> + >> + sx_sunlock(&les_lock); >> + >> + return (error); >> +} >> + >> +static void >> +live_entropy_sources_init(void *unused) >> +{ >> + >> + SYSCTL_PROC(_kern_random, OID_AUTO, live_entropy_sources, >> + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, >> + NULL, 0, live_entropy_source_handler, "", >> + "List of Active Live Entropy Sources"); >> + >> + sx_init(&les_lock, "live_entropy_sources"); >> +} >> + >> +/* >> + * Run through all "live" sources reading entropy for the given >> + * number of rounds, which should be a multiple of the number >> + * of entropy accumulation pools in use; 2 for Yarrow and 32 >> + * for Fortuna. >> + * >> + * BEWARE!!! >> + * This function runs inside the RNG thread! Don't do anything silly! >> + * Remember that we are NOT holding harvest_mtx on entry! >> + */ >> +void >> +live_entropy_sources_feed(int rounds, event_proc_f entropy_processor) >> +{ >> + static struct harvest event; >> + static uint8_t buf[HARVESTSIZE]; >> + struct live_entropy_sources *les; >> + int i, n; >> + >> + sx_slock(&les_lock); >> + >> + /* >> + * Walk over all of live entropy sources, and feed their output >> + * to the system-wide RNG. >> + */ >> + LIST_FOREACH(les, &sources, entries) { >> + >> + for (i =3D 0; i < rounds; i++) { >> + /* >> + * This should be quick, since it's a live entro= py >> + * source. >> + */ >> + /* FIXME: Whine loudly if this didn't work. */ >> + n =3D les->rsource->read(buf, sizeof(buf)); >> + n =3D MIN(n, HARVESTSIZE); >> + >> + event.somecounter =3D get_cyclecount(); >> + event.size =3D n; >> + event.bits =3D (n*8)/2; >> + event.source =3D les->rsource->source; >> + memcpy(event.entropy, buf, n); >> + >> + /* Do the actual entropy insertion */ >> + entropy_processor(&event); >> + } >> + >> + } >> + >> + sx_sunlock(&les_lock); >> +} >> + >> +static void >> +live_entropy_sources_deinit(void *unused) >> +{ >> + >> + sx_destroy(&les_lock); >> +} >> + >> +SYSINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, >> + live_entropy_sources_init, NULL); >> +SYSUNINIT(random_adaptors, SI_SUB_DRIVERS, SI_ORDER_FIRST, >> + live_entropy_sources_deinit, NULL); >>=20 >> Copied: head/sys/dev/random/live_entropy_sources.h (from r256243, projec= ts/random_number_generator/sys/dev/random/live_entropy_sources.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=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/dev/random/live_entropy_sources.h Sat Oct 12 12:57:57 2013= (r256377, copy of r256243, projects/random_number_generator/sys/dev= /random/live_entropy_sources.h) >> @@ -0,0 +1,60 @@ >> +/*- >> + * Copyright (c) 2013 Arthur Mesh >> + * Copyright (c) 2013 Mark R V Murray >> + * 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 >> + * in this position and unchanged. >> + * 2. Redistributions in binary form must reproduce the above copyright >> + * notice, this list of conditions and the following disclaimer in t= he >> + * documentation and/or other materials provided with the distributi= on. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR >> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRA= NTIES >> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIM= ED. >> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, >>=20 >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >>=20 >=20 _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 16:39:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 85740E54; Sat, 12 Oct 2013 16:39:10 +0000 (UTC) (envelope-from mark@grondar.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4741225B8; Sat, 12 Oct 2013 16:39:10 +0000 (UTC) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1VV2Da-000J7e-6g; Sat, 12 Oct 2013 17:39:09 +0100 Subject: Re: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: multipart/signed; boundary="Apple-Mail=_2F276EC0-8B2A-4D46-8B90-B920F84B3EFA"; protocol="application/pgp-signature"; micalg=pgp-sha512 From: Mark R V Murray In-Reply-To: <13CA24D6AB415D428143D44749F57D720FC5BE74@LTCFISWMSGMB21.FNFIS.com> Date: Sat, 12 Oct 2013 17:39:05 +0100 Message-Id: References: <201310121257.r9CCvvjO006546@svn.freebsd.org> <13CA24D6AB415D428143D44749F57D720FC5BE74@LTCFISWMSGMB21.FNFIS.com> To: Devin Teske X-Mailer: Apple Mail (2.1510) X-SA-Score: -2.2 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, 12 Oct 2013 16:39:10 -0000 --Apple-Mail=_2F276EC0-8B2A-4D46-8B90-B920F84B3EFA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On 12 Oct 2013, at 17:35, "Teske, Devin" = wrote: > Can you maybe test with ZFS + Geli? I'm concerned because we told it = to use random(4) > instead of urandom(4). I hope there's enough entropy when creating the = geli stuff that > said process doesn't hang. I think DES's patch will help there too = (not that anyone > testing our ZFS patches reported any hangs... including when testing = GELI -- this was > before DES's patch). urandom is a symlink to random. M --=20 Mark R V Murray --Apple-Mail=_2F276EC0-8B2A-4D46-8B90-B920F84B3EFA Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.20 (Darwin) Comment: GPGTools - http://gpgtools.org iQCVAwUBUll7Kd58vKOKE6LNAQoKjwP/YCJXo6b0bNx+rdT2E5pVnIuZZ3Tm8boP /4f6i1pMw9fQE84zVBE9U4/OxfebDX7HFMNk23P+nUmvPpYBZQnWl/iOmJb5fJuF HGSyvD+3GlSwzTpIXLTqwxG5BSFlGJkLrFbfKhlrKi/hK9uA1xL7hyk8OG+LJjmR 7c8zhI4Kh0o= =Rr8P -----END PGP SIGNATURE----- --Apple-Mail=_2F276EC0-8B2A-4D46-8B90-B920F84B3EFA-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 16:44:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6EE82874; Sat, 12 Oct 2013 16:44:18 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 329262611; Sat, 12 Oct 2013 16:44:17 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa07.fnfis.com (8.14.5/8.14.5) with ESMTP id r9CGiHg2026247 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 12 Oct 2013 11:44:17 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.103]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.02.0309.002; Sat, 12 Oct 2013 11:44:15 -0500 From: "Teske, Devin" To: Mark R V Murray Subject: Re: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... Thread-Topic: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... Thread-Index: AQHOx2kWmfQdvUXbBUerN/OTVWaLsg== Date: Sat, 12 Oct 2013 16:44:14 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D720FC5BF0D@LTCFISWMSGMB21.FNFIS.com> References: <201310121257.r9CCvvjO006546@svn.freebsd.org> <13CA24D6AB415D428143D44749F57D720FC5BE74@LTCFISWMSGMB21.FNFIS.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="iso-8859-1" Content-ID: <3FDE58464F455146BB1DC8A42F667F6C@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-10-12_01:2013-10-11,2013-10-12,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Oct 2013 16:44:18 -0000 On Oct 12, 2013, at 9:39 AM, Mark R V Murray wrote: >=20 > On 12 Oct 2013, at 17:35, "Teske, Devin" wrot= e: >> Can you maybe test with ZFS + Geli? I'm concerned because we told it to = use random(4) >> instead of urandom(4). I hope there's enough entropy when creating the g= eli stuff that >> said process doesn't hang. I think DES's patch will help there too (not = that anyone >> testing our ZFS patches reported any hangs... including when testing GEL= I -- this was >> before DES's patch). >=20 > urandom is a symlink to random. >=20 Hmmm, interesting ;D You know... for years I've been compiling a custom apache for $work and usi= ng the --with-random=3D/dev/urandom flag. And then recently in the past couple yea= rs in 8.x I recall having problems with a GnuPG related tool that would hang due to l= ack of entropy on a freshly installed box when generating "stuff" using random(4). Are the days of choosing between urandom(4) and random(4) over? Would SSL function great on a freshly installed box even if using random(4)= for apache? (it wants to default to /dev/random anyways) --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 16:47:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8E5C1C61; Sat, 12 Oct 2013 16:47:01 +0000 (UTC) (envelope-from mark@grondar.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F77E262E; Sat, 12 Oct 2013 16:47:01 +0000 (UTC) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1VV2LC-000J8R-IJ; Sat, 12 Oct 2013 17:47:00 +0100 Subject: Re: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: multipart/signed; boundary="Apple-Mail=_F6B93F4C-E4E4-4822-873F-4B55B9CE2E11"; protocol="application/pgp-signature"; micalg=pgp-sha512 From: Mark R V Murray In-Reply-To: <13CA24D6AB415D428143D44749F57D720FC5BF0D@LTCFISWMSGMB21.FNFIS.com> Date: Sat, 12 Oct 2013 17:46:57 +0100 Message-Id: References: <201310121257.r9CCvvjO006546@svn.freebsd.org> <13CA24D6AB415D428143D44749F57D720FC5BE74@LTCFISWMSGMB21.FNFIS.com> <13CA24D6AB415D428143D44749F57D720FC5BF0D@LTCFISWMSGMB21.FNFIS.com> To: Devin Teske X-Mailer: Apple Mail (2.1510) X-SA-Score: -2.2 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, 12 Oct 2013 16:47:01 -0000 --Apple-Mail=_F6B93F4C-E4E4-4822-873F-4B55B9CE2E11 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On 12 Oct 2013, at 17:44, "Teske, Devin" = wrote: > You know... for years I've been compiling a custom apache for $work = and using the > --with-random=3D/dev/urandom flag. And then recently in the past = couple years in 8.x > I recall having problems with a GnuPG related tool that would hang due = to lack of > entropy on a freshly installed box when generating "stuff" using = random(4). >=20 > Are the days of choosing between urandom(4) and random(4) over? They were over last millennium :-) > Would SSL function great on a freshly installed box even if using = random(4) for > apache? (it wants to default to /dev/random anyways) Yup! No worse than usual. M --=20 Mark R V Murray --Apple-Mail=_F6B93F4C-E4E4-4822-873F-4B55B9CE2E11 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.20 (Darwin) Comment: GPGTools - http://gpgtools.org iQCVAwUBUll9Ad58vKOKE6LNAQq3rQP7BaMNjWqslDalXytBbLYbi0IA1gMR+4JW uX/M+HWrjDB84BQFYhbovwa9r6l8ME6LNddTPqlmqNZGFWZNo88zgSEunB7BWr86 NGroIMf75fP16KnjO/wMuYZHOU7pTNTf4TXS2ruLKENvvbcZrgeWRpxK7Qk4yuip NnaytMGH0GU= =ihmv -----END PGP SIGNATURE----- --Apple-Mail=_F6B93F4C-E4E4-4822-873F-4B55B9CE2E11-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 16:49:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 04C51E84; Sat, 12 Oct 2013 16:49:37 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B6F77263A; Sat, 12 Oct 2013 16:49:36 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa01.fnfis.com (8.14.5/8.14.5) with ESMTP id r9CGnZle032599 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sat, 12 Oct 2013 11:49:35 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.103]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.02.0309.002; Sat, 12 Oct 2013 11:49:34 -0500 From: "Teske, Devin" To: Mark R V Murray Subject: Re: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... Thread-Topic: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... Thread-Index: AQHOx2kWmfQdvUXbBUerN/OTVWaLsg== Date: Sat, 12 Oct 2013 16:49:32 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D720FC5BF76@LTCFISWMSGMB21.FNFIS.com> References: <201310121257.r9CCvvjO006546@svn.freebsd.org> <13CA24D6AB415D428143D44749F57D720FC5BE74@LTCFISWMSGMB21.FNFIS.com> <13CA24D6AB415D428143D44749F57D720FC5BF0D@LTCFISWMSGMB21.FNFIS.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.121] Content-Type: text/plain; charset="iso-8859-1" Content-ID: <65979F1501CF114FBD69A3536470383D@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-10-12_01:2013-10-11,2013-10-12,1970-01-01 signatures=0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" , "Teske, Devin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Oct 2013 16:49:37 -0000 On Oct 12, 2013, at 9:46 AM, Mark R V Murray wrote: >=20 > On 12 Oct 2013, at 17:44, "Teske, Devin" wrot= e: >=20 >> You know... for years I've been compiling a custom apache for $work and = using the >> --with-random=3D/dev/urandom flag. And then recently in the past couple = years in 8.x >> I recall having problems with a GnuPG related tool that would hang due t= o lack of >> entropy on a freshly installed box when generating "stuff" using random(= 4). >>=20 >> Are the days of choosing between urandom(4) and random(4) over? >=20 > They were over last millennium :-) >=20 Heh, Ok ;D so it sounds like a left-over from 4.11 ;D >> Would SSL function great on a freshly installed box even if using random= (4) for >> apache? (it wants to default to /dev/random anyways) >=20 > Yup! No worse than usual. >=20 Cool, thanks! That also answers my question for bsdinstall GELI setup using random(4). Doubly-thanks! --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 16:51:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EE025FC8; Sat, 12 Oct 2013 16:51:08 +0000 (UTC) (envelope-from mark@grondar.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ADF88266C; Sat, 12 Oct 2013 16:51:08 +0000 (UTC) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1VV2PB-000J8k-Tv; Sat, 12 Oct 2013 17:51:07 +0100 Subject: Re: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: multipart/signed; boundary="Apple-Mail=_3942060E-FDBB-401C-B587-209CCF5D5E1A"; protocol="application/pgp-signature"; micalg=pgp-sha512 From: Mark R V Murray In-Reply-To: <13CA24D6AB415D428143D44749F57D720FC5BF76@LTCFISWMSGMB21.FNFIS.com> Date: Sat, 12 Oct 2013 17:51:04 +0100 Message-Id: <947F8542-7693-4064-8C5C-48CB2ACC4139@grondar.org> References: <201310121257.r9CCvvjO006546@svn.freebsd.org> <13CA24D6AB415D428143D44749F57D720FC5BE74@LTCFISWMSGMB21.FNFIS.com> <13CA24D6AB415D428143D44749F57D720FC5BF0D@LTCFISWMSGMB21.FNFIS.com> <13CA24D6AB415D428143D44749F57D720FC5BF76@LTCFISWMSGMB21.FNFIS.com> To: Devin Teske X-Mailer: Apple Mail (2.1510) X-SA-Score: -2.2 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, 12 Oct 2013 16:51:09 -0000 --Apple-Mail=_3942060E-FDBB-401C-B587-209CCF5D5E1A Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=iso-8859-1 On 12 Oct 2013, at 17:49, "Teske, Devin" wrote: > Doubly-thanks! Glad to be useful. M -- Mark R V Murray --Apple-Mail=_3942060E-FDBB-401C-B587-209CCF5D5E1A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.20 (Darwin) Comment: GPGTools - http://gpgtools.org iQCVAwUBUll9+N58vKOKE6LNAQrgLwP/TxxRiUN1X8U6AoB9HA1/02c8rmoxcDf+ cQapOcvMvXdGxtm0iH8tS1Q5408tyKvmr5Cl9L6AShO/6y/mt7IRi0NEKs/Ou183 9297c5sM97HcP77WUOKB/4EQRMdAur0/KjiGKGcBkUC936iSHFuqf6UxIiIDe8JM Ehu4/dP83Eo= =N3Sn -----END PGP SIGNATURE----- --Apple-Mail=_3942060E-FDBB-401C-B587-209CCF5D5E1A-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 17:28:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7839F941; Sat, 12 Oct 2013 17:28:01 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 575E027D2; Sat, 12 Oct 2013 17:28:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CHS1s9047734; Sat, 12 Oct 2013 17:28:01 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CHRxZc047714; Sat, 12 Oct 2013 17:27:59 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201310121727.r9CHRxZc047714@svn.freebsd.org> From: Hiroki Sato Date: Sat, 12 Oct 2013 17:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256385 - in head: etc/rc.d share/man/man5 usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 17:28:01 -0000 Author: hrs Date: Sat Oct 12 17:27:59 2013 New Revision: 256385 URL: http://svnweb.freebsd.org/changeset/base/256385 Log: - Add mount.fdescfs parameter to jail(8). This is similar to mount.devfs but mounts fdescfs. The mount happens just after mount.devfs. - rc.d/jail now displays whole error message from jail(8) when a jail fails to start. Approved by: re (gjb) Modified: head/etc/rc.d/jail head/share/man/man5/rc.conf.5 head/usr.sbin/jail/command.c head/usr.sbin/jail/config.c head/usr.sbin/jail/jail.8 head/usr.sbin/jail/jail.c head/usr.sbin/jail/jailp.h Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Sat Oct 12 16:11:57 2013 (r256384) +++ head/etc/rc.d/jail Sat Oct 12 17:27:59 2013 (r256385) @@ -226,8 +226,7 @@ parse_options() eval : \${jail_${_j}_fdescfs_enable:=${jail_fdescfs_enable:-NO}} if checkyesno jail_${_j}_fdescfs_enable; then - echo " mount += " \ - "\"fdescfs ${_rootdir%/}/dev/fd fdescfs rw 0 0\";" + echo " mount.fdescfs;" fi eval : \${jail_${_j}_procfs_enable:=${jail_procfs_enable:-NO}} if checkyesno jail_${_j}_procfs_enable; then @@ -438,7 +437,7 @@ jail_start() echo -n " ${_hostname:-${_jail}}" else echo " cannot start jail \"${_hostname:-${jail}}\": " - tail +2 $_tmp + cat $_tmp fi rm -f $_tmp done Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sat Oct 12 16:11:57 2013 (r256384) +++ head/share/man/man5/rc.conf.5 Sat Oct 12 17:27:59 2013 (r256385) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 10, 2013 +.Dd October 12, 2013 .Dt RC.CONF 5 .Os .Sh NAME @@ -3992,9 +3992,7 @@ set from .Va jail_ Ns Ao Ar jname Ac Ns Va _fstab .It Li mount set from -.Va jail_ Ns Ao Ar jname Ac Ns Va _fdescfs_enable -or -.Va jail_ Ns Ao Ar jname Ac Ns Va _procfs_enable. +.Va jail_ Ns Ao Ar jname Ac Ns Va _procfs_enable . .It Li exec.fib set from .Va jail_ Ns Ao Ar jname Ac Ns Va _fib @@ -4042,6 +4040,9 @@ set from .Va jail_ Ns Ao Ar jname Ac Ns Va _devfs_ruleset . This must be an integer, not a string. +.It Li mount.fdescfs +set from +.Va jail_ Ns Ao Ar jname Ac Ns Va _fdescfs_enable .It Li allow.set_hostname set from .Va jail_ Ns Ao Ar jname Ac Ns Va _set_hostname_allow Modified: head/usr.sbin/jail/command.c ============================================================================== --- head/usr.sbin/jail/command.c Sat Oct 12 16:11:57 2013 (r256384) +++ head/usr.sbin/jail/command.c Sat Oct 12 17:27:59 2013 (r256385) @@ -106,7 +106,12 @@ next_command(struct cfjail *j) case IP_MOUNT_DEVFS: if (!bool_param(j->intparams[IP_MOUNT_DEVFS])) continue; - /* FALLTHROUGH */ + j->comstring = &dummystring; + break; + case IP_MOUNT_FDESCFS: + if (!bool_param(j->intparams[IP_MOUNT_FDESCFS])) + continue; + j->comstring = &dummystring; case IP__OP: case IP_STOP_TIMEOUT: j->comstring = &dummystring; @@ -452,6 +457,32 @@ run_command(struct cfjail *j) } break; + case IP_MOUNT_FDESCFS: + argv = alloca(7 * sizeof(char *)); + path = string_param(j->intparams[KP_PATH]); + if (path == NULL) { + jail_warnx(j, "mount.fdescfs: no path"); + return -1; + } + devpath = alloca(strlen(path) + 8); + sprintf(devpath, "%s/dev/fd", path); + if (check_path(j, "mount.fdescfs", devpath, 0, + down ? "fdescfs" : NULL) < 0) + return -1; + if (down) { + *(const char **)&argv[0] = "/sbin/umount"; + argv[1] = devpath; + argv[2] = NULL; + } else { + *(const char **)&argv[0] = _PATH_MOUNT; + *(const char **)&argv[1] = "-t"; + *(const char **)&argv[2] = "fdescfs"; + *(const char **)&argv[3] = "."; + argv[4] = devpath; + argv[5] = NULL; + } + break; + case IP_COMMAND: if (j->name != NULL) goto default_command; Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Sat Oct 12 16:11:57 2013 (r256384) +++ head/usr.sbin/jail/config.c Sat Oct 12 17:27:59 2013 (r256385) @@ -83,6 +83,7 @@ static const struct ipspec intparams[] = #endif [IP_MOUNT] = {"mount", PF_INTERNAL | PF_REV}, [IP_MOUNT_DEVFS] = {"mount.devfs", PF_INTERNAL | PF_BOOL}, + [IP_MOUNT_FDESCFS] = {"mount.fdescfs", PF_INTERNAL | PF_BOOL}, [IP_MOUNT_FSTAB] = {"mount.fstab", PF_INTERNAL}, [IP_STOP_TIMEOUT] = {"stop.timeout", PF_INTERNAL | PF_INT}, [IP_VNET_INTERFACE] = {"vnet.interface", PF_INTERNAL}, Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sat Oct 12 16:11:57 2013 (r256384) +++ head/usr.sbin/jail/jail.8 Sat Oct 12 17:27:59 2013 (r256385) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 23, 2013 +.Dd October 12, 2013 .Dt JAIL 8 .Os .Sh NAME @@ -682,7 +682,7 @@ to. An alias for each address will be added to the interface before the prison is created, and will be removed from the interface after the prison is removed. -.It Op Va ip4.addr +.It Va ip4.addr In addition to the IP addresses that are passed to the kernel, and interface and/or a netmask may also be specified, in the form .Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar netmask . @@ -691,7 +691,7 @@ will be added to that interface, as it i .Va interface parameter. If a netmask in either dotted-quad or CIDR form is given after IP address, it will be used when adding the IP alias. -.It Op Va ip6.addr +.It Va ip6.addr In addition to the IP addresses that are passed to the kernel, and interface and/or a prefix may also be specified, in the form .Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar prefix . @@ -722,11 +722,19 @@ An format file containing filesystems to mount before creating a jail. .It Va mount.devfs Mount a -.Xr devfs -filesystem on the chrooted /dev directory, and apply the ruleset in the +.Xr devfs 5 +filesystem on the chrooted +.Pa /dev +directory, and apply the ruleset in the .Va devfs_ruleset parameter (or a default of ruleset 4: devfsrules_jail) to restrict the devices visible inside the prison. +.It Va mount.fdescfs +Mount a +.Xr fdescfs 5 +filesystem on the chrooted +.Pa /dev/fd +directory. .It Va allow.dying Allow making changes to a .Va dying @@ -1165,6 +1173,8 @@ environment of the first jail. .Xr ps 1 , .Xr quota 1 , .Xr jail_set 2 , +.Xr devfs 5 , +.Xr fdescfs 5 , .Xr jail.conf 5 , .Xr procfs 5 , .Xr rc.conf 5 , Modified: head/usr.sbin/jail/jail.c ============================================================================== --- head/usr.sbin/jail/jail.c Sat Oct 12 16:11:57 2013 (r256384) +++ head/usr.sbin/jail/jail.c Sat Oct 12 17:27:59 2013 (r256385) @@ -92,6 +92,7 @@ static const enum intparam startcommands IP_MOUNT, IP__MOUNT_FROM_FSTAB, IP_MOUNT_DEVFS, + IP_MOUNT_FDESCFS, IP_EXEC_PRESTART, IP__OP, IP_VNET_INTERFACE, @@ -108,6 +109,7 @@ static const enum intparam stopcommands[ IP_STOP_TIMEOUT, IP__OP, IP_EXEC_POSTSTOP, + IP_MOUNT_FDESCFS, IP_MOUNT_DEVFS, IP__MOUNT_FROM_FSTAB, IP_MOUNT, Modified: head/usr.sbin/jail/jailp.h ============================================================================== --- head/usr.sbin/jail/jailp.h Sat Oct 12 16:11:57 2013 (r256384) +++ head/usr.sbin/jail/jailp.h Sat Oct 12 17:27:59 2013 (r256385) @@ -95,6 +95,7 @@ enum intparam { #endif IP_MOUNT, /* Mount points in fstab(5) form */ IP_MOUNT_DEVFS, /* Mount /dev under prison root */ + IP_MOUNT_FDESCFS, /* Mount /dev/fd under prison root */ IP_MOUNT_FSTAB, /* A standard fstab(5) file */ IP_STOP_TIMEOUT, /* Time to wait after sending SIGTERM */ IP_VNET_INTERFACE, /* Assign interface(s) to vnet jail */ From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 17:29:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9F3B9A9A; Sat, 12 Oct 2013 17:29:54 +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 57A7C27DC; Sat, 12 Oct 2013 17:29:54 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 3A38065BA; Sat, 12 Oct 2013 17:29:53 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id AB8775521F; Sat, 12 Oct 2013 19:29:48 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Devin Teske Subject: Re: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... References: <201310121257.r9CCvvjO006546@svn.freebsd.org> <13CA24D6AB415D428143D44749F57D720FC5BE74@LTCFISWMSGMB21.FNFIS.com> Date: Sat, 12 Oct 2013 19:29:47 +0200 In-Reply-To: <13CA24D6AB415D428143D44749F57D720FC5BE74@LTCFISWMSGMB21.FNFIS.com> (Devin Teske's message of "Sat, 12 Oct 2013 16:35:39 +0000") Message-ID: <86r4bqs8hg.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "Teske, Devin" , "svn-src-head@freebsd.org" , Mark Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 17:29:54 -0000 "Teske, Devin" writes: > Can you maybe test with ZFS + Geli? I'm concerned because we told it > to use random(4) instead of urandom(4). I hope there's enough entropy > when creating the geli stuff that said process doesn't hang. /dev/urandom is a symlink to /dev/random. Neither will block, because we explicitly mark /dev/random as seeded with a SYSINIT late in the boot (not as late as I'd like, but not too early either). > I think DES's patch will help there too (not that anyone testing our > ZFS patches reported any hangs... including when testing GELI -- this > was before DES's patch). If you mean the device attach entropy gathering, that was a case of parallel invention from Pawel and myself, where I ended up using Pawel's patch with minor modifications. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 17:31:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3596DC03; Sat, 12 Oct 2013 17:31:22 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 226112813; Sat, 12 Oct 2013 17:31:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CHVMRi051116; Sat, 12 Oct 2013 17:31:22 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CHVLAD051110; Sat, 12 Oct 2013 17:31:21 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310121731.r9CHVLAD051110@svn.freebsd.org> From: Ian Lepore Date: Sat, 12 Oct 2013 17:31: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: r256386 - in stable/9: include sys/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 17:31:22 -0000 Author: ian Date: Sat Oct 12 17:31:21 2013 New Revision: 256386 URL: http://svnweb.freebsd.org/changeset/base/256386 Log: MFC r255775 r255796 r255807 r255930 r255929 r255957: Create a separate script to generate osreldate.h rather than sourcing newvers.sh into a temporary subshell with inline make rules. Fixes PR 160646. Allow the path to the system source directory to be passed in to newvers.sh. Pass it in from include/Makefile. If it isn't passed in, fall back to the old logic of using dirname $0. Fixes PR 174422. PR: 160646 174422 Added: stable/9/include/mk-osreldate.sh - copied, changed from r255775, head/include/mk-osreldate.sh Modified: stable/9/include/Makefile stable/9/sys/conf/newvers.sh Directory Properties: stable/9/include/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/include/Makefile ============================================================================== --- stable/9/include/Makefile Sat Oct 12 17:27:59 2013 (r256385) +++ stable/9/include/Makefile Sat Oct 12 17:31:21 2013 (r256386) @@ -99,19 +99,18 @@ SHARED?= copies INCS+= osreldate.h -osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \ - ${.CURDIR}/Makefile - @${ECHO} creating osreldate.h from newvers.sh - @MAKE=${MAKE}; \ - PARAMFILE=${.CURDIR}/../sys/sys/param.h; \ - . ${.CURDIR}/../sys/conf/newvers.sh; \ - echo "$$COPYRIGHT" > osreldate.h; \ - echo "#ifdef _KERNEL" >> osreldate.h; \ - echo "#error \" cannot be used in the kernel, use \"" >> osreldate.h; \ - echo "#else" >> osreldate.h; \ - echo "#undef __FreeBSD_version" >> osreldate.h; \ - echo "#define __FreeBSD_version $$RELDATE" >> osreldate.h; \ - echo "#endif" >> osreldate.h +SYSDIR= ${.CURDIR}/../sys +NEWVERS_SH= ${SYSDIR}/conf/newvers.sh +PARAM_H= ${SYSDIR}/sys/param.h +MK_OSRELDATE_SH= ${.CURDIR}/mk-osreldate.sh + +osreldate.h vers.c: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH} + env ECHO="${ECHO}" \ + MAKE="${MAKE}" \ + NEWVERS_SH=${NEWVERS_SH} \ + PARAM_H=${PARAM_H} \ + SYSDIR=${SYSDIR} \ + sh ${MK_OSRELDATE_SH} .for i in ${LHDRS} INCSLINKS+= sys/$i ${INCLUDEDIR}/$i Copied and modified: stable/9/include/mk-osreldate.sh (from r255775, head/include/mk-osreldate.sh) ============================================================================== --- head/include/mk-osreldate.sh Sat Sep 21 22:36:07 2013 (r255775, copy source) +++ stable/9/include/mk-osreldate.sh Sat Oct 12 17:31:21 2013 (r256386) @@ -36,7 +36,9 @@ trap "rm -f $tmpfile" EXIT ${ECHO} creating osreldate.h from newvers.sh export PARAMFILE="${PARAM_H:=$CURDIR/../sys/sys/param.h}" -. "${NEWVERS_SH:=$CURDIR/../sys/conf/newvers.sh}" +set +e +. "${NEWVERS_SH:=$CURDIR/../sys/conf/newvers.sh}" || exit 1 +set -e cat > $tmpfile < Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 691133B7; Sat, 12 Oct 2013 17:46:15 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4765028D9; Sat, 12 Oct 2013 17:46:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CHkF6r058107; Sat, 12 Oct 2013 17:46:15 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CHkDbU058100; Sat, 12 Oct 2013 17:46:13 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201310121746.r9CHkDbU058100@svn.freebsd.org> From: Hiroki Sato Date: Sat, 12 Oct 2013 17:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256387 - in stable/10: etc/rc.d share/man/man5 usr.sbin/jail X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 17:46:15 -0000 Author: hrs Date: Sat Oct 12 17:46:13 2013 New Revision: 256387 URL: http://svnweb.freebsd.org/changeset/base/256387 Log: MFC 256385: - Add mount.fdescfs parameter to jail(8). This is similar to mount.devfs but mounts fdescfs. The mount happens just after mount.devfs. - rc.d/jail now displays whole error message from jail(8) when a jail fails to start. Approved by: re (gjb) Modified: stable/10/etc/rc.d/jail stable/10/share/man/man5/rc.conf.5 stable/10/usr.sbin/jail/command.c stable/10/usr.sbin/jail/config.c stable/10/usr.sbin/jail/jail.8 stable/10/usr.sbin/jail/jail.c stable/10/usr.sbin/jail/jailp.h Directory Properties: stable/10/etc/rc.d/ (props changed) stable/10/share/man/man5/ (props changed) stable/10/usr.sbin/jail/ (props changed) Modified: stable/10/etc/rc.d/jail ============================================================================== --- stable/10/etc/rc.d/jail Sat Oct 12 17:31:21 2013 (r256386) +++ stable/10/etc/rc.d/jail Sat Oct 12 17:46:13 2013 (r256387) @@ -226,8 +226,7 @@ parse_options() eval : \${jail_${_j}_fdescfs_enable:=${jail_fdescfs_enable:-NO}} if checkyesno jail_${_j}_fdescfs_enable; then - echo " mount += " \ - "\"fdescfs ${_rootdir%/}/dev/fd fdescfs rw 0 0\";" + echo " mount.fdescfs;" fi eval : \${jail_${_j}_procfs_enable:=${jail_procfs_enable:-NO}} if checkyesno jail_${_j}_procfs_enable; then @@ -438,7 +437,7 @@ jail_start() echo -n " ${_hostname:-${_jail}}" else echo " cannot start jail \"${_hostname:-${jail}}\": " - tail +2 $_tmp + cat $_tmp fi rm -f $_tmp done Modified: stable/10/share/man/man5/rc.conf.5 ============================================================================== --- stable/10/share/man/man5/rc.conf.5 Sat Oct 12 17:31:21 2013 (r256386) +++ stable/10/share/man/man5/rc.conf.5 Sat Oct 12 17:46:13 2013 (r256387) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 10, 2013 +.Dd October 12, 2013 .Dt RC.CONF 5 .Os .Sh NAME @@ -3992,9 +3992,7 @@ set from .Va jail_ Ns Ao Ar jname Ac Ns Va _fstab .It Li mount set from -.Va jail_ Ns Ao Ar jname Ac Ns Va _fdescfs_enable -or -.Va jail_ Ns Ao Ar jname Ac Ns Va _procfs_enable. +.Va jail_ Ns Ao Ar jname Ac Ns Va _procfs_enable . .It Li exec.fib set from .Va jail_ Ns Ao Ar jname Ac Ns Va _fib @@ -4042,6 +4040,9 @@ set from .Va jail_ Ns Ao Ar jname Ac Ns Va _devfs_ruleset . This must be an integer, not a string. +.It Li mount.fdescfs +set from +.Va jail_ Ns Ao Ar jname Ac Ns Va _fdescfs_enable .It Li allow.set_hostname set from .Va jail_ Ns Ao Ar jname Ac Ns Va _set_hostname_allow Modified: stable/10/usr.sbin/jail/command.c ============================================================================== --- stable/10/usr.sbin/jail/command.c Sat Oct 12 17:31:21 2013 (r256386) +++ stable/10/usr.sbin/jail/command.c Sat Oct 12 17:46:13 2013 (r256387) @@ -106,7 +106,12 @@ next_command(struct cfjail *j) case IP_MOUNT_DEVFS: if (!bool_param(j->intparams[IP_MOUNT_DEVFS])) continue; - /* FALLTHROUGH */ + j->comstring = &dummystring; + break; + case IP_MOUNT_FDESCFS: + if (!bool_param(j->intparams[IP_MOUNT_FDESCFS])) + continue; + j->comstring = &dummystring; case IP__OP: case IP_STOP_TIMEOUT: j->comstring = &dummystring; @@ -452,6 +457,32 @@ run_command(struct cfjail *j) } break; + case IP_MOUNT_FDESCFS: + argv = alloca(7 * sizeof(char *)); + path = string_param(j->intparams[KP_PATH]); + if (path == NULL) { + jail_warnx(j, "mount.fdescfs: no path"); + return -1; + } + devpath = alloca(strlen(path) + 8); + sprintf(devpath, "%s/dev/fd", path); + if (check_path(j, "mount.fdescfs", devpath, 0, + down ? "fdescfs" : NULL) < 0) + return -1; + if (down) { + *(const char **)&argv[0] = "/sbin/umount"; + argv[1] = devpath; + argv[2] = NULL; + } else { + *(const char **)&argv[0] = _PATH_MOUNT; + *(const char **)&argv[1] = "-t"; + *(const char **)&argv[2] = "fdescfs"; + *(const char **)&argv[3] = "."; + argv[4] = devpath; + argv[5] = NULL; + } + break; + case IP_COMMAND: if (j->name != NULL) goto default_command; Modified: stable/10/usr.sbin/jail/config.c ============================================================================== --- stable/10/usr.sbin/jail/config.c Sat Oct 12 17:31:21 2013 (r256386) +++ stable/10/usr.sbin/jail/config.c Sat Oct 12 17:46:13 2013 (r256387) @@ -83,6 +83,7 @@ static const struct ipspec intparams[] = #endif [IP_MOUNT] = {"mount", PF_INTERNAL | PF_REV}, [IP_MOUNT_DEVFS] = {"mount.devfs", PF_INTERNAL | PF_BOOL}, + [IP_MOUNT_FDESCFS] = {"mount.fdescfs", PF_INTERNAL | PF_BOOL}, [IP_MOUNT_FSTAB] = {"mount.fstab", PF_INTERNAL}, [IP_STOP_TIMEOUT] = {"stop.timeout", PF_INTERNAL | PF_INT}, [IP_VNET_INTERFACE] = {"vnet.interface", PF_INTERNAL}, Modified: stable/10/usr.sbin/jail/jail.8 ============================================================================== --- stable/10/usr.sbin/jail/jail.8 Sat Oct 12 17:31:21 2013 (r256386) +++ stable/10/usr.sbin/jail/jail.8 Sat Oct 12 17:46:13 2013 (r256387) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 23, 2013 +.Dd October 12, 2013 .Dt JAIL 8 .Os .Sh NAME @@ -682,7 +682,7 @@ to. An alias for each address will be added to the interface before the prison is created, and will be removed from the interface after the prison is removed. -.It Op Va ip4.addr +.It Va ip4.addr In addition to the IP addresses that are passed to the kernel, and interface and/or a netmask may also be specified, in the form .Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar netmask . @@ -691,7 +691,7 @@ will be added to that interface, as it i .Va interface parameter. If a netmask in either dotted-quad or CIDR form is given after IP address, it will be used when adding the IP alias. -.It Op Va ip6.addr +.It Va ip6.addr In addition to the IP addresses that are passed to the kernel, and interface and/or a prefix may also be specified, in the form .Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar prefix . @@ -722,11 +722,19 @@ An format file containing filesystems to mount before creating a jail. .It Va mount.devfs Mount a -.Xr devfs -filesystem on the chrooted /dev directory, and apply the ruleset in the +.Xr devfs 5 +filesystem on the chrooted +.Pa /dev +directory, and apply the ruleset in the .Va devfs_ruleset parameter (or a default of ruleset 4: devfsrules_jail) to restrict the devices visible inside the prison. +.It Va mount.fdescfs +Mount a +.Xr fdescfs 5 +filesystem on the chrooted +.Pa /dev/fd +directory. .It Va allow.dying Allow making changes to a .Va dying @@ -1165,6 +1173,8 @@ environment of the first jail. .Xr ps 1 , .Xr quota 1 , .Xr jail_set 2 , +.Xr devfs 5 , +.Xr fdescfs 5 , .Xr jail.conf 5 , .Xr procfs 5 , .Xr rc.conf 5 , Modified: stable/10/usr.sbin/jail/jail.c ============================================================================== --- stable/10/usr.sbin/jail/jail.c Sat Oct 12 17:31:21 2013 (r256386) +++ stable/10/usr.sbin/jail/jail.c Sat Oct 12 17:46:13 2013 (r256387) @@ -92,6 +92,7 @@ static const enum intparam startcommands IP_MOUNT, IP__MOUNT_FROM_FSTAB, IP_MOUNT_DEVFS, + IP_MOUNT_FDESCFS, IP_EXEC_PRESTART, IP__OP, IP_VNET_INTERFACE, @@ -108,6 +109,7 @@ static const enum intparam stopcommands[ IP_STOP_TIMEOUT, IP__OP, IP_EXEC_POSTSTOP, + IP_MOUNT_FDESCFS, IP_MOUNT_DEVFS, IP__MOUNT_FROM_FSTAB, IP_MOUNT, Modified: stable/10/usr.sbin/jail/jailp.h ============================================================================== --- stable/10/usr.sbin/jail/jailp.h Sat Oct 12 17:31:21 2013 (r256386) +++ stable/10/usr.sbin/jail/jailp.h Sat Oct 12 17:46:13 2013 (r256387) @@ -95,6 +95,7 @@ enum intparam { #endif IP_MOUNT, /* Mount points in fstab(5) form */ IP_MOUNT_DEVFS, /* Mount /dev under prison root */ + IP_MOUNT_FDESCFS, /* Mount /dev/fd under prison root */ IP_MOUNT_FSTAB, /* A standard fstab(5) file */ IP_STOP_TIMEOUT, /* Time to wait after sending SIGTERM */ IP_VNET_INTERFACE, /* Assign interface(s) to vnet jail */ From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 19:31:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 51D6ED79; Sat, 12 Oct 2013 19:31:20 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3EFEB2D6C; Sat, 12 Oct 2013 19:31:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CJVKH8014737; Sat, 12 Oct 2013 19:31:20 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CJVKA9014736; Sat, 12 Oct 2013 19:31:20 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310121931.r9CJVKA9014736@svn.freebsd.org> From: Peter Grehan Date: Sat, 12 Oct 2013 19:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256389 - 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: Sat, 12 Oct 2013 19:31:20 -0000 Author: grehan Date: Sat Oct 12 19:31:19 2013 New Revision: 256389 URL: http://svnweb.freebsd.org/changeset/base/256389 Log: Implement the virtio block 'get-ident' operation. This eliminates the annoying verbose boot error of the form g_handleattr: vtbd0 bio_length 24 len 28 -> EFAULT The ident returned by bhyve is a text string 'BHYVE-XXXX-XXXX', where the X's are the first bytes of the md5 hash of the backing filename. Reviewed by: neel Approved by: re (gjb) 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 Sat Oct 12 18:24:52 2013 (r256388) +++ head/usr.sbin/bhyve/pci_virtio_block.c Sat Oct 12 19:31:19 2013 (r256389) @@ -46,17 +46,25 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bhyverun.h" #include "pci_emul.h" #include "virtio.h" +#ifndef min +#define min(a, b) ((a) < (b) ? (a) : (b)) +#endif + #define VTBLK_RINGSZ 64 #define VTBLK_MAXSEGS 32 #define VTBLK_S_OK 0 #define VTBLK_S_IOERR 1 +#define VTBLK_S_UNSUPP 2 + +#define VTBLK_BLK_ID_BYTES 20 /* * Host capabilities @@ -85,6 +93,7 @@ struct vtblk_config { struct virtio_blk_hdr { #define VBH_OP_READ 0 #define VBH_OP_WRITE 1 +#define VBH_OP_IDENT 8 #define VBH_FLAG_BARRIER 0x80000000 /* OR'ed into vbh_type */ uint32_t vbh_type; uint32_t vbh_ioprio; @@ -106,6 +115,7 @@ struct pci_vtblk_softc { struct vqueue_info vbsc_vq; int vbsc_fd; struct vtblk_config vbsc_cfg; + char vbsc_ident[VTBLK_BLK_ID_BYTES]; }; static void pci_vtblk_reset(void *); @@ -180,7 +190,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *s for (i = 1; i < n; i++) { /* * - write op implies read-only descriptor, - * - read op implies write-only descriptor, + * - read/ident op implies write-only descriptor, * therefore test the inverse of the descriptor bit * to the op. */ @@ -189,14 +199,34 @@ pci_vtblk_proc(struct pci_vtblk_softc *s } DPRINTF(("virtio-block: %s op, %d bytes, %d segs, offset %ld\n\r", - writeop ? "write" : "read", iolen, i - 1, offset)); + writeop ? "write" : "read/ident", iolen, i - 1, offset)); - if (writeop) + switch (type) { + case VBH_OP_WRITE: err = pwritev(sc->vbsc_fd, iov + 1, i - 1, offset); - else + break; + case VBH_OP_READ: err = preadv(sc->vbsc_fd, iov + 1, i - 1, offset); + break; + case VBH_OP_IDENT: + /* Assume a single buffer */ + strlcpy(iov[1].iov_base, sc->vbsc_ident, + min(iov[1].iov_len, sizeof(sc->vbsc_ident))); + err = 0; + break; + default: + err = -ENOSYS; + break; + } - *status = err < 0 ? VTBLK_S_IOERR : VTBLK_S_OK; + /* convert errno into a virtio block error return */ + if (err < 0) { + if (err == -ENOSYS) + *status = VTBLK_S_UNSUPP; + else + *status = VTBLK_S_IOERR; + } else + *status = VTBLK_S_OK; /* * Return the descriptor back to the host. @@ -220,6 +250,8 @@ static int pci_vtblk_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) { struct stat sbuf; + MD5_CTX mdctx; + u_char digest[16]; struct pci_vtblk_softc *sc; off_t size; int fd; @@ -274,6 +306,16 @@ pci_vtblk_init(struct vmctx *ctx, struct sc->vbsc_vq.vq_qsize = VTBLK_RINGSZ; /* sc->vbsc_vq.vq_notify = we have no per-queue notify */ + /* + * Create an identifier for the backing file. Use parts of the + * md5 sum of the filename + */ + MD5Init(&mdctx); + MD5Update(&mdctx, opts, strlen(opts)); + MD5Final(digest, &mdctx); + sprintf(sc->vbsc_ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", + digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); + /* setup virtio block config space */ sc->vbsc_cfg.vbc_capacity = size / sectsz; sc->vbsc_cfg.vbc_seg_max = VTBLK_MAXSEGS; From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 19:41:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7688FF0A; Sat, 12 Oct 2013 19:41:36 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 61F752DBE; Sat, 12 Oct 2013 19:41:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CJfanL019671; Sat, 12 Oct 2013 19:41:36 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CJfaCk019670; Sat, 12 Oct 2013 19:41:36 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310121941.r9CJfaCk019670@svn.freebsd.org> From: Peter Grehan Date: Sat, 12 Oct 2013 19:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256390 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 19:41:36 -0000 Author: grehan Date: Sat Oct 12 19:41:35 2013 New Revision: 256390 URL: http://svnweb.freebsd.org/changeset/base/256390 Log: MFC r256389 Implement the virtio block 'get-ident' operation. This eliminates the annoying verbose boot error of the form g_handleattr: vtbd0 bio_length 24 len 28 -> EFAULT The ident returned by bhyve is a text string 'BHYVE-XXXX-XXXX', where the X's are the first bytes of the md5 hash of the backing filename. Approved by: re (gjb) Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c Directory Properties: stable/10/usr.sbin/bhyve/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_block.c Sat Oct 12 19:31:19 2013 (r256389) +++ stable/10/usr.sbin/bhyve/pci_virtio_block.c Sat Oct 12 19:41:35 2013 (r256390) @@ -46,17 +46,25 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bhyverun.h" #include "pci_emul.h" #include "virtio.h" +#ifndef min +#define min(a, b) ((a) < (b) ? (a) : (b)) +#endif + #define VTBLK_RINGSZ 64 #define VTBLK_MAXSEGS 32 #define VTBLK_S_OK 0 #define VTBLK_S_IOERR 1 +#define VTBLK_S_UNSUPP 2 + +#define VTBLK_BLK_ID_BYTES 20 /* * Host capabilities @@ -85,6 +93,7 @@ struct vtblk_config { struct virtio_blk_hdr { #define VBH_OP_READ 0 #define VBH_OP_WRITE 1 +#define VBH_OP_IDENT 8 #define VBH_FLAG_BARRIER 0x80000000 /* OR'ed into vbh_type */ uint32_t vbh_type; uint32_t vbh_ioprio; @@ -106,6 +115,7 @@ struct pci_vtblk_softc { struct vqueue_info vbsc_vq; int vbsc_fd; struct vtblk_config vbsc_cfg; + char vbsc_ident[VTBLK_BLK_ID_BYTES]; }; static void pci_vtblk_reset(void *); @@ -180,7 +190,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *s for (i = 1; i < n; i++) { /* * - write op implies read-only descriptor, - * - read op implies write-only descriptor, + * - read/ident op implies write-only descriptor, * therefore test the inverse of the descriptor bit * to the op. */ @@ -189,14 +199,34 @@ pci_vtblk_proc(struct pci_vtblk_softc *s } DPRINTF(("virtio-block: %s op, %d bytes, %d segs, offset %ld\n\r", - writeop ? "write" : "read", iolen, i - 1, offset)); + writeop ? "write" : "read/ident", iolen, i - 1, offset)); - if (writeop) + switch (type) { + case VBH_OP_WRITE: err = pwritev(sc->vbsc_fd, iov + 1, i - 1, offset); - else + break; + case VBH_OP_READ: err = preadv(sc->vbsc_fd, iov + 1, i - 1, offset); + break; + case VBH_OP_IDENT: + /* Assume a single buffer */ + strlcpy(iov[1].iov_base, sc->vbsc_ident, + min(iov[1].iov_len, sizeof(sc->vbsc_ident))); + err = 0; + break; + default: + err = -ENOSYS; + break; + } - *status = err < 0 ? VTBLK_S_IOERR : VTBLK_S_OK; + /* convert errno into a virtio block error return */ + if (err < 0) { + if (err == -ENOSYS) + *status = VTBLK_S_UNSUPP; + else + *status = VTBLK_S_IOERR; + } else + *status = VTBLK_S_OK; /* * Return the descriptor back to the host. @@ -220,6 +250,8 @@ static int pci_vtblk_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) { struct stat sbuf; + MD5_CTX mdctx; + u_char digest[16]; struct pci_vtblk_softc *sc; off_t size; int fd; @@ -274,6 +306,16 @@ pci_vtblk_init(struct vmctx *ctx, struct sc->vbsc_vq.vq_qsize = VTBLK_RINGSZ; /* sc->vbsc_vq.vq_notify = we have no per-queue notify */ + /* + * Create an identifier for the backing file. Use parts of the + * md5 sum of the filename + */ + MD5Init(&mdctx); + MD5Update(&mdctx, opts, strlen(opts)); + MD5Final(digest, &mdctx); + sprintf(sc->vbsc_ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", + digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); + /* setup virtio block config space */ sc->vbsc_cfg.vbc_capacity = size / sectsz; sc->vbsc_cfg.vbc_seg_max = VTBLK_MAXSEGS; From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 19:52:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9ECD8409; Sat, 12 Oct 2013 19:52:27 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B9B22E3D; Sat, 12 Oct 2013 19:52:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CJqRuF025172; Sat, 12 Oct 2013 19:52:27 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CJqRee025169; Sat, 12 Oct 2013 19:52:27 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310121952.r9CJqRee025169@svn.freebsd.org> From: Devin Teske Date: Sat, 12 Oct 2013 19:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256391 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 19:52:27 -0000 Author: dteske Date: Sat Oct 12 19:52:27 2013 New Revision: 256391 URL: http://svnweb.freebsd.org/changeset/base/256391 Log: Fix signed integer overflow detection in f_expand_number() of strings.subr. Approved by: re (glebius) Modified: head/usr.sbin/bsdconfig/share/strings.subr Modified: head/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/strings.subr Sat Oct 12 19:41:35 2013 (r256390) +++ head/usr.sbin/bsdconfig/share/strings.subr Sat Oct 12 19:52:27 2013 (r256391) @@ -341,17 +341,19 @@ f_shell_unescape() # # NOTE: Prefixes are case-insensitive. # -# Upon successful completion, the value 0 is returned (or stored to -# $var_to_set); otherwise -1. Reasons for a -1 return include: +# Upon successful completion, success status is returned; otherwise the number +# -1 is produced ($var_to_set set to -1 or if $var_to_set is NULL or missing) +# on standard output. In the case of failure, the error status will be one of: # -# Given $string contains no digits. -# An unrecognized prefix was given. -# Result too large to calculate. +# Status Reason +# 1 Given $string contains no digits +# 2 An unrecognized prefix was given +# 3 Result too large to calculate # f_expand_number() { local __string="$1" __var_to_set="$2" - local __cp __num + local __cp __num __bshift __maxinput # Remove any leading non-digits while :; do @@ -360,14 +362,14 @@ f_expand_number() [ "$__string" = "$__cp" ] && break done - # Return `-1' if string didn't contain any digits + # Produce `-1' if string didn't contain any digits if [ ! "$__string" ]; then if [ "$__var_to_set" ]; then setvar "$__var_to_set" -1 else echo -1 fi - return $FAILURE + return 1 # 1 = "Given $string contains no digits" fi # Store the numbers @@ -390,9 +392,23 @@ f_expand_number() [ "$__string" = "$__cp" ] && break done - # Test for invalid prefix + # + # Test for invalid prefix (and determine bitshift length) + # case "$__string" in - ""|[KkMmGgTtPpEe]*) : known prefix ;; + ""|[[:space:]]*) # Shortcut + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" $__num + else + echo $__num + fi + return $SUCCESS ;; + [Kk]*) __bshift=10 ;; + [Mm]*) __bshift=20 ;; + [Gg]*) __bshift=30 ;; + [Tt]*) __bshift=40 ;; + [Pp]*) __bshift=50 ;; + [Ee]*) __bshift=60 ;; *) # Unknown prefix if [ "$__var_to_set" ]; then @@ -400,29 +416,23 @@ f_expand_number() else echo -1 fi - return $FAILURE + return 2 # 2 = "An unrecognized prefix was given" esac - # Multiply the number out - case "$__string" in - [Kk]) __num=$(( $__num * 1024 )) ;; - [Mm]) __num=$(( $__num * 1048576 )) ;; - [Gg]) __num=$(( $__num * 1073741824 )) ;; - [Tt]) __num=$(( $__num * 1099511627776 )) ;; - [Pp]) __num=$(( $__num * 1125899906842624 )) ;; - [Ee]) __num=$(( $__num * 1152921504606846976 )) ;; - esac - if [ $__num -le 0 ]; then - # Arithmetic overflow + # Determine if the wheels fall off + __maxinput=$(( 0x7fffffffffffffff >> $__bshift )) + if [ $__num -gt $__maxinput ]; then + # Input (before expanding) would exceed 64-bit signed int if [ "$__var_to_set" ]; then setvar "$__var_to_set" -1 else echo -1 fi - return $FAILURE + return 3 # 3 = "Result too large to calculate" fi - # Return the number + # Shift the number out and produce it + __num=$(( $__num << $__bshift )) if [ "$__var_to_set" ]; then setvar "$__var_to_set" $__num else From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 19:54:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B3F99555; Sat, 12 Oct 2013 19:54:12 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A07E72E4D; Sat, 12 Oct 2013 19:54:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CJsC2v025754; Sat, 12 Oct 2013 19:54:12 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CJsCwV025753; Sat, 12 Oct 2013 19:54:12 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310121954.r9CJsCwV025753@svn.freebsd.org> From: Devin Teske Date: Sat, 12 Oct 2013 19:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256392 - stable/10/usr.sbin/bsdconfig/share X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 19:54:12 -0000 Author: dteske Date: Sat Oct 12 19:54:12 2013 New Revision: 256392 URL: http://svnweb.freebsd.org/changeset/base/256392 Log: MFC r256391: Fix signed integer overflow detection in f_expand_number() of strings.subr. Approved by: re (glebius) Modified: stable/10/usr.sbin/bsdconfig/share/strings.subr Directory Properties: stable/10/usr.sbin/bsdconfig/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/strings.subr Sat Oct 12 19:52:27 2013 (r256391) +++ stable/10/usr.sbin/bsdconfig/share/strings.subr Sat Oct 12 19:54:12 2013 (r256392) @@ -341,17 +341,19 @@ f_shell_unescape() # # NOTE: Prefixes are case-insensitive. # -# Upon successful completion, the value 0 is returned (or stored to -# $var_to_set); otherwise -1. Reasons for a -1 return include: +# Upon successful completion, success status is returned; otherwise the number +# -1 is produced ($var_to_set set to -1 or if $var_to_set is NULL or missing) +# on standard output. In the case of failure, the error status will be one of: # -# Given $string contains no digits. -# An unrecognized prefix was given. -# Result too large to calculate. +# Status Reason +# 1 Given $string contains no digits +# 2 An unrecognized prefix was given +# 3 Result too large to calculate # f_expand_number() { local __string="$1" __var_to_set="$2" - local __cp __num + local __cp __num __bshift __maxinput # Remove any leading non-digits while :; do @@ -360,14 +362,14 @@ f_expand_number() [ "$__string" = "$__cp" ] && break done - # Return `-1' if string didn't contain any digits + # Produce `-1' if string didn't contain any digits if [ ! "$__string" ]; then if [ "$__var_to_set" ]; then setvar "$__var_to_set" -1 else echo -1 fi - return $FAILURE + return 1 # 1 = "Given $string contains no digits" fi # Store the numbers @@ -390,9 +392,23 @@ f_expand_number() [ "$__string" = "$__cp" ] && break done - # Test for invalid prefix + # + # Test for invalid prefix (and determine bitshift length) + # case "$__string" in - ""|[KkMmGgTtPpEe]*) : known prefix ;; + ""|[[:space:]]*) # Shortcut + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" $__num + else + echo $__num + fi + return $SUCCESS ;; + [Kk]*) __bshift=10 ;; + [Mm]*) __bshift=20 ;; + [Gg]*) __bshift=30 ;; + [Tt]*) __bshift=40 ;; + [Pp]*) __bshift=50 ;; + [Ee]*) __bshift=60 ;; *) # Unknown prefix if [ "$__var_to_set" ]; then @@ -400,29 +416,23 @@ f_expand_number() else echo -1 fi - return $FAILURE + return 2 # 2 = "An unrecognized prefix was given" esac - # Multiply the number out - case "$__string" in - [Kk]) __num=$(( $__num * 1024 )) ;; - [Mm]) __num=$(( $__num * 1048576 )) ;; - [Gg]) __num=$(( $__num * 1073741824 )) ;; - [Tt]) __num=$(( $__num * 1099511627776 )) ;; - [Pp]) __num=$(( $__num * 1125899906842624 )) ;; - [Ee]) __num=$(( $__num * 1152921504606846976 )) ;; - esac - if [ $__num -le 0 ]; then - # Arithmetic overflow + # Determine if the wheels fall off + __maxinput=$(( 0x7fffffffffffffff >> $__bshift )) + if [ $__num -gt $__maxinput ]; then + # Input (before expanding) would exceed 64-bit signed int if [ "$__var_to_set" ]; then setvar "$__var_to_set" -1 else echo -1 fi - return $FAILURE + return 3 # 3 = "Result too large to calculate" fi - # Return the number + # Shift the number out and produce it + __num=$(( $__num << $__bshift )) if [ "$__var_to_set" ]; then setvar "$__var_to_set" $__num else From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 20:00:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 342046C3; Sat, 12 Oct 2013 20:00:50 +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 E26072E96; Sat, 12 Oct 2013 20:00:49 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id A8886670D; Sat, 12 Oct 2013 20:00:48 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 4A4E4553D2; Sat, 12 Oct 2013 22:00:44 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Adrian Chadd Subject: Re: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... References: <201310121257.r9CCvvjO006546@svn.freebsd.org> Date: Sat, 12 Oct 2013 22:00:44 +0200 In-Reply-To: (Adrian Chadd's message of "Sat, 12 Oct 2013 09:27:23 -0700") Message-ID: <86siw6qmxf.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mark Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 20:00:50 -0000 Adrian Chadd writes: > I've just test booted this on a MIPS board. It doesn't hang at boot waiti= ng for > entropy. > > http://people.freebsd.org/~adrian/mips/20131012-ar9344-boot-1.txt Do me a favor, rebuild your kernel with "option DEBUG_RANDOM" (to save time, just add #define DEBUG_RANDOM 1 manually to opt_random.h and do a KERNFAST build) and post the dmesg. It will show how much entropy we've accumulated before we force a reseed. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 20:01:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AFEDB72C; Sat, 12 Oct 2013 20:01:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B7782E9B; Sat, 12 Oct 2013 20:01:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CK1aG3029932; Sat, 12 Oct 2013 20:01:36 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9CK1a4e029929; Sat, 12 Oct 2013 20:01:36 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310122001.r9CK1a4e029929@svn.freebsd.org> From: Glen Barber Date: Sat, 12 Oct 2013 20:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r256393 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 20:01:36 -0000 Author: gjb Date: Sat Oct 12 20:01:36 2013 New Revision: 256393 URL: http://svnweb.freebsd.org/changeset/base/256393 Log: Update stable/10 to -BETA1 as part of the 10.0-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/conf/newvers.sh Modified: stable/10/sys/conf/newvers.sh ============================================================================== --- stable/10/sys/conf/newvers.sh Sat Oct 12 19:54:12 2013 (r256392) +++ stable/10/sys/conf/newvers.sh Sat Oct 12 20:01:36 2013 (r256393) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.0" -BRANCH="ALPHA6" +BRANCH="BETA1" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 20:05:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2919699B; Sat, 12 Oct 2013 20:05:53 +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 D5A8A2EC3; Sat, 12 Oct 2013 20:05:52 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id D67C96714; Sat, 12 Oct 2013 20:05:51 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 821DE553E0; Sat, 12 Oct 2013 22:05:47 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Adrian Chadd Subject: Re: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... References: <201310121257.r9CCvvjO006546@svn.freebsd.org> <86siw6qmxf.fsf@nine.des.no> Date: Sat, 12 Oct 2013 22:05:47 +0200 In-Reply-To: <86siw6qmxf.fsf@nine.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8r?= =?utf-8?Q?grav=22's?= message of "Sat, 12 Oct 2013 22:00:44 +0200") Message-ID: <86ob6uqmp0.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mark Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 20:05:53 -0000 Dag-Erling Sm=C3=B8rgrav writes: > Do me a favor, rebuild your kernel with "option DEBUG_RANDOM" (to save > time, just add #define DEBUG_RANDOM 1 manually to opt_random.h and do a > KERNFAST build) and post the dmesg. Sorry, I meant RANDOM_DEBUG. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 20:09:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EF9D4AA6; Sat, 12 Oct 2013 20:09:08 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [IPv6:2607:f8b0:400d:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 783642ED5; Sat, 12 Oct 2013 20:09:08 +0000 (UTC) Received: by mail-qc0-f175.google.com with SMTP id v2so3915731qcr.6 for ; Sat, 12 Oct 2013 13:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=yyhyj0IUjjdLLO0cw4qEz5fkreOBQqZbtnMyVI5uekU=; b=kjK3jzV+JFSKGTHAihwGMh85mIJPfNxyjyWql1MgkIkri1FGb5d0OzZo65QVWoq0dw dbiG6Mu+AQhtHoe6q2zSB5xqQcAi4FsIPmTAjTnYXmA1L7smbdEOnMftxkWJPhPw8CBC a2PfPvsbXReZI6oGxR49G7PI7a9+xW5xFWojKotuKkN7HeUEcyzH3jUwN80q/Hf+P/lh 3DiyuzaY75G+PYIrJOMNiDLDPFoqyoDXfwPdCFASdxBukHGfVn/OQqLJdyyR9YkWSiKG ms0bniM1vUitlnT2dfRUuptcoPd++boqrDI3qeIm3gWzC97blsu/AiSar7wb9fwKnjUF nKPw== MIME-Version: 1.0 X-Received: by 10.49.51.196 with SMTP id m4mr3518457qeo.82.1381608546974; Sat, 12 Oct 2013 13:09:06 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Sat, 12 Oct 2013 13:09:06 -0700 (PDT) In-Reply-To: <86ob6uqmp0.fsf@nine.des.no> References: <201310121257.r9CCvvjO006546@svn.freebsd.org> <86siw6qmxf.fsf@nine.des.no> <86ob6uqmp0.fsf@nine.des.no> Date: Sat, 12 Oct 2013 13:09:06 -0700 X-Google-Sender-Auth: IokReO9SOaNGbfg-EUC7dCmD_-I Message-ID: Subject: Re: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... From: Adrian Chadd To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= 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" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mark Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 20:09:09 -0000 http://people.freebsd.org/~adrian/mips/20131012-ar9344-boot-2.txt -a On 12 October 2013 13:05, Dag-Erling Sm=F8rgrav wrote: > Dag-Erling Sm=F8rgrav writes: > > Do me a favor, rebuild your kernel with "option DEBUG_RANDOM" (to save > > time, just add #define DEBUG_RANDOM 1 manually to opt_random.h and do a > > KERNFAST build) and post the dmesg. > > Sorry, I meant RANDOM_DEBUG. > > DES > -- > Dag-Erling Sm=F8rgrav - des@des.no > From owner-svn-src-all@FreeBSD.ORG Sat Oct 12 20:10:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AA6B0BF3; Sat, 12 Oct 2013 20:10:17 +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 66C722EE6; Sat, 12 Oct 2013 20:10:17 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 99BDD671F; Sat, 12 Oct 2013 20:10:16 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 4274F553EA; Sat, 12 Oct 2013 22:10:12 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Adrian Chadd Subject: Re: svn commit: r256377 - in head: etc/defaults etc/rc.d share/examples/kld/random_adaptor share/man/man4 sys/boot/forth sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe ... References: <201310121257.r9CCvvjO006546@svn.freebsd.org> <86siw6qmxf.fsf@nine.des.no> <86ob6uqmp0.fsf@nine.des.no> Date: Sat, 12 Oct 2013 22:10:12 +0200 In-Reply-To: (Adrian Chadd's message of "Sat, 12 Oct 2013 13:09:06 -0700") Message-ID: <86k3hiqmhn.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mark Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 12 Oct 2013 20:10:17 -0000 Adrian Chadd writes: > http://people.freebsd.org/~adrian/mips/20131012-ar9344-boot-2.txt Not stellar: random_yarrow_reseed(): fast: 0 68 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 random_yarrow_reseed(): slow: 0 68 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 Can you apply the following patch and try again: Index: sys/dev/random/random_adaptors.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/random/random_adaptors.c (revision 256386) +++ sys/dev/random/random_adaptors.c (working copy) @@ -239,5 +239,5 @@ (*random_adaptor->reseed)(); arc4rand(NULL, 0, 1); } -SYSINIT(random_reseed, SI_SUB_INTRINSIC_POST, SI_ORDER_SECOND, +SYSINIT(random_reseed, SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, random_adaptors_reseed, NULL); Index: sys/kern/init_main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/kern/init_main.c (revision 256386) +++ sys/kern/init_main.c (working copy) @@ -853,4 +853,4 @@ sched_add(td, SRQ_BORING); thread_unlock(td); } -SYSINIT(kickinit, SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, kick_init, NULL); +SYSINIT(kickinit, SI_SUB_KTHREAD_INIT, SI_ORDER_MIDDLE, kick_init, NULL); DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no