From owner-svn-src-head@FreeBSD.ORG Sun Oct 6 06:57:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Oct 6 10:12:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Oct 6 12:23:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: koobs@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Oct 6 15:15:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Oct 6 15:16:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Oct 6 15:59:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Oct 6 16:12:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun Oct 6 19:47:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 02:23:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 06:50:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 07:32:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 08:09:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 08:14:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 08:19:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 10:01:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 10:26:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 11:23:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 12:07:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 14:22:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 16:33:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 16:45:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 16:49:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 16:53:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 16:54:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 16:55:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 16:56:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 16:57:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 19:22:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 19:23:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 19:27:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 19:48:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 20:29:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 20:30:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 20:48:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 21:39:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 22:22:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon Oct 7 22:30:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 01:38:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 04:16:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 08:16:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 11:29:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 12:56:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 15:44:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 15:47:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 15:49:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 16:00:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 16:01:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 16:36:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 17:26:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 18:09:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 19:18:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 19:39:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 20:04:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 20:39:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 20:41:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 23:12:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 23:23:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue Oct 8 23:28:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 00:21:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 00:22:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 00:27:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 00:27:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 02:01:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 03:19:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 03:56:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 07:02:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 08:12:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 11:57:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 12:00:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 12:03:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 12:09:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 12:17:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 12:19:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 12:30:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 13:28:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 13:45:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 13:48:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 16:55:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 17:05:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 17:06:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 17:07:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 17:07:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 17:32:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 17:34:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 18:39:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 18:41:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 18:43:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 18:45:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 19:04:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 19:28:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 19:30:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 19:37:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 19:37:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 20:00:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 20:09:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 20:47:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 20:58:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 21:33:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 22:00:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 22:10:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed Oct 9 23:53:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 03:50:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 07:23:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 07:41:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 09:32:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 09:53:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 11:28:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 14:03:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 15:44:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 16:11:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 16:11:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 16:25:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 17:39:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 17:41:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 18:05:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 19:40:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 19:51:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 19:56:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 20:47:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 21:10:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 22:38:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu Oct 10 22:46:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 06:48:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 13:04:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 16:57:08 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 17:00:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 17:52:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 17:54:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 18:14:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 18:21:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 18:51:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 19:40:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 20:07:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 20:08:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 20:10:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 20:10:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 20:11:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 20:12:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 20:21:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 20:35:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 20:41:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 20:52:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 21:12:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 21:23:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri Oct 11 21:30:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 00:32:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 06:06:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 07:00:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 07:26:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 08:01:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 08:03:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 12:58:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 14:32:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 15:03:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 15:10:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 15:21:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 15:41:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 15:58:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 16:27:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 16:30:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 16:35:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 16:39:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 16:39:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 16:44:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 16:47:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 16:49:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 16:51:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 17:28:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 17:29:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 19:31:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 19:52:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 20:00:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900: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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 20:05:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 20:09:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sat Oct 12 20:10:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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