From owner-svn-src-stable@freebsd.org Sun Jul 22 21:39:28 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01921102EC27; Sun, 22 Jul 2018 21:39:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0AEE8651E; Sun, 22 Jul 2018 21:39:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 809D0138C9; Sun, 22 Jul 2018 21:39:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6MLdRFd099590; Sun, 22 Jul 2018 21:39:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6MLdRrL099589; Sun, 22 Jul 2018 21:39:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201807222139.w6MLdRrL099589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 22 Jul 2018 21:39:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336618 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 336618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2018 21:39:28 -0000 Author: kib Date: Sun Jul 22 21:39:27 2018 New Revision: 336618 URL: https://svnweb.freebsd.org/changeset/base/336618 Log: MFC r336498: When reporting an error, print the errno value. Modified: stable/11/sys/kern/imgact_elf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/imgact_elf.c ============================================================================== --- stable/11/sys/kern/imgact_elf.c Sun Jul 22 21:00:11 2018 (r336617) +++ stable/11/sys/kern/imgact_elf.c Sun Jul 22 21:39:27 2018 (r336618) @@ -861,7 +861,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, NULL, td); if (error != 0) { - uprintf("i/o error PT_INTERP\n"); + uprintf("i/o error PT_INTERP %d\n", + error); goto ret; } interp_buf[interp_name_len] = '\0'; From owner-svn-src-stable@freebsd.org Mon Jul 23 17:11:05 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 452571050640; Mon, 23 Jul 2018 17:11:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBB1D856F2; Mon, 23 Jul 2018 17:11:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id BF90510AFD2; Mon, 23 Jul 2018 13:10:57 -0400 (EDT) Subject: Re: svn commit: r336448 - stable/10 To: Peter Jeremy , rgrimes@freebsd.org References: <201807180932.w6I9WheM066205@repo.freebsd.org> <201807181441.w6IEfNMJ007767@pdx.rh.CN85.dnsmgr.net> <20180718190506.GA45754@server.rulingia.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org From: John Baldwin Message-ID: Date: Mon, 23 Jul 2018 10:10:56 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180718190506.GA45754@server.rulingia.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 23 Jul 2018 13:10:58 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 17:11:05 -0000 On 7/18/18 12:05 PM, Peter Jeremy wrote: > On 2018-Jul-18 07:41:23 -0700, "Rodney W. Grimes" wrote: >>> Author: peterj >>> Date: Wed Jul 18 09:32:43 2018 >>> New Revision: 336448 >>> URL: https://svnweb.freebsd.org/changeset/base/336448 >>> >>> Log: >>> Retrospectively document SVN branch point for stable-10 and its releases. >>> >>> This is a direct commit to stable/10 because the releases are taken >>> from the stable/10 branch. >>> >>> Approved by: jhb (mentor) >>> Differential Revision: D16263 >> >> Actually I see no reason not to document these in the mainline >> UPDATING file and making these MFC's. As is now when looking >> at UPDATING from head I can not easily find the branch point >> for any of these releases and that is probably the most useful >> time for this information. If I already have a branch I probably >> already know what its anchor point is. > > I only put the releng/x.y branch points into the relevant stable/x/UPDATING > because releng/x.y is branched off stable/x and I don't think it makes much > sense to document those in head/UPDATING. The stable/x branchpoints are in > both head/UPDATING and stable/x/UPDATING. Note that the stable/10 branch- > point was already in head/UPDATING. I agree with this. We should document them in the source branch, but not in grandparents like head where there is no single head commit that becomes releng/X.Y. > Do you have a quick way to find branch points? The best I've found is > "svn log -r 1:HEAD --limit 1 --stop-on-copy" within a branch and that > is quite resource intensive on the SVN server. Finding a file that doesn't change often like MAINTAINERS and only doing the log against that shouldn't be as bad. -- John Baldwin From owner-svn-src-stable@freebsd.org Mon Jul 23 17:35:21 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68FE21050CD0; Mon, 23 Jul 2018 17:35:21 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13B2086970; Mon, 23 Jul 2018 17:35:21 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4D841FA4F; Mon, 23 Jul 2018 17:35:20 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6NHZK4Z019158; Mon, 23 Jul 2018 17:35:20 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6NHZKZn019157; Mon, 23 Jul 2018 17:35:20 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201807231735.w6NHZKZn019157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Mon, 23 Jul 2018 17:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336643 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: dexuan X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 336643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 17:35:21 -0000 Author: dexuan Date: Mon Jul 23 17:35:20 2018 New Revision: 336643 URL: https://svnweb.freebsd.org/changeset/base/336643 Log: MFC: 336426 r336426 hyperv/hn: Fix panic in hypervisor code upon device detach event Submitted by: hselasky Reviewed by: dexuan Differential Revision: https://reviews.freebsd.org/D16139 Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 23 17:26:38 2018 (r336642) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 23 17:35:20 2018 (r336643) @@ -1161,6 +1161,13 @@ hn_ismyvf(const struct hn_softc *sc, const struct ifne strcmp(ifp->if_dname, "vlan") == 0) return (false); + /* + * During detach events ifp->if_addr might be NULL. + * Make sure the bcmp() below doesn't panic on that: + */ + if (ifp->if_addr == NULL || hn_ifp->if_addr == NULL) + return (false); + if (bcmp(IF_LLADDR(ifp), IF_LLADDR(hn_ifp), ETHER_ADDR_LEN) != 0) return (false); From owner-svn-src-stable@freebsd.org Mon Jul 23 17:36:43 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 295AD1050DBA; Mon, 23 Jul 2018 17:36:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8694386B29; Mon, 23 Jul 2018 17:36:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w6NHadMA032632; Mon, 23 Jul 2018 10:36:39 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w6NHadhr032631; Mon, 23 Jul 2018 10:36:39 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807231736.w6NHadhr032631@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r336448 - stable/10 In-Reply-To: To: John Baldwin Date: Mon, 23 Jul 2018 10:36:39 -0700 (PDT) CC: Peter Jeremy , rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 17:36:43 -0000 > On 7/18/18 12:05 PM, Peter Jeremy wrote: > > On 2018-Jul-18 07:41:23 -0700, "Rodney W. Grimes" wrote: > >>> Author: peterj > >>> Date: Wed Jul 18 09:32:43 2018 > >>> New Revision: 336448 > >>> URL: https://svnweb.freebsd.org/changeset/base/336448 > >>> > >>> Log: > >>> Retrospectively document SVN branch point for stable-10 and its releases. > >>> > >>> This is a direct commit to stable/10 because the releases are taken > >>> from the stable/10 branch. > >>> > >>> Approved by: jhb (mentor) > >>> Differential Revision: D16263 > >> > >> Actually I see no reason not to document these in the mainline > >> UPDATING file and making these MFC's. As is now when looking > >> at UPDATING from head I can not easily find the branch point > >> for any of these releases and that is probably the most useful > >> time for this information. If I already have a branch I probably > >> already know what its anchor point is. > > > > I only put the releng/x.y branch points into the relevant stable/x/UPDATING > > because releng/x.y is branched off stable/x and I don't think it makes much > > sense to document those in head/UPDATING. The stable/x branchpoints are in > > both head/UPDATING and stable/x/UPDATING. Note that the stable/10 branch- > > point was already in head/UPDATING. > > I agree with this. We should document them in the source branch, but not > in grandparents like head where there is no single head commit that becomes > releng/X.Y. My only counter to this is that often what I am investigating is the change between ^head/ and some release, say 11.2 and I really do not want to go grovel in stable/11 to find the rXXXXXX for 11.2, that is just a PITA. Though the branch point for stable/11 is interesting, it is rarely usefull for any thing very meaningful. It would actually be useful to have a file that listed all of these for all branch points maintained in ^head/. > > Do you have a quick way to find branch points? The best I've found is > > "svn log -r 1:HEAD --limit 1 --stop-on-copy" within a branch and that > > is quite resource intensive on the SVN server. > > Finding a file that doesn't change often like MAINTAINERS and only doing the > log against that shouldn't be as bad. Thats a good tip. > John Baldwin -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable@freebsd.org Mon Jul 23 17:38:36 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7611E1050E8D; Mon, 23 Jul 2018 17:38:36 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2128386DB7; Mon, 23 Jul 2018 17:38:36 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00E651FA52; Mon, 23 Jul 2018 17:38:36 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6NHcZtK019459; Mon, 23 Jul 2018 17:38:35 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6NHcZdL019458; Mon, 23 Jul 2018 17:38:35 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201807231738.w6NHcZdL019458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Mon, 23 Jul 2018 17:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r336644 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: dexuan X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 336644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 17:38:36 -0000 Author: dexuan Date: Mon Jul 23 17:38:35 2018 New Revision: 336644 URL: https://svnweb.freebsd.org/changeset/base/336644 Log: MFC: 336426 r336426 hyperv/hn: Fix panic in hypervisor code upon device detach event Submitted by: hselasky Reviewed by: dexuan Differential Revision: https://reviews.freebsd.org/D16139 Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 23 17:35:20 2018 (r336643) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 23 17:38:35 2018 (r336644) @@ -1157,6 +1157,13 @@ hn_ismyvf(const struct hn_softc *sc, const struct ifne strcmp(ifp->if_dname, "vlan") == 0) return (false); + /* + * During detach events ifp->if_addr might be NULL. + * Make sure the bcmp() below doesn't panic on that: + */ + if (ifp->if_addr == NULL || hn_ifp->if_addr == NULL) + return (false); + if (bcmp(IF_LLADDR(ifp), IF_LLADDR(hn_ifp), ETHER_ADDR_LEN) != 0) return (false); From owner-svn-src-stable@freebsd.org Mon Jul 23 18:35:59 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BC4C10520BD; Mon, 23 Jul 2018 18:35:59 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 279BB89639; Mon, 23 Jul 2018 18:35:59 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0C4C2041D; Mon, 23 Jul 2018 18:35:58 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6NIZwGw050432; Mon, 23 Jul 2018 18:35:58 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6NIZwIF050431; Mon, 23 Jul 2018 18:35:58 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201807231835.w6NIZwIF050431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Mon, 23 Jul 2018 18:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336646 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 336646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 18:35:59 -0000 Author: dab Date: Mon Jul 23 18:35:58 2018 New Revision: 336646 URL: https://svnweb.freebsd.org/changeset/base/336646 Log: MFC r336457: Make the definition of struct kevent in event.h match what the man page for kevent(2) says. This is a trivial comment-only fix. The man page for kevent(2) gives the definition of struct kevent, including a comment on each field. The actual definition in sys/event.h omitted the comments on some fields. Add the comments in. Not only does this make the man page and include file agree, but the comments are useful in and of themselves. Sponsored by: Dell EMC Modified: stable/11/sys/sys/event.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/event.h ============================================================================== --- stable/11/sys/sys/event.h Mon Jul 23 18:08:56 2018 (r336645) +++ stable/11/sys/sys/event.h Mon Jul 23 18:35:58 2018 (r336646) @@ -74,9 +74,9 @@ struct kevent { uintptr_t ident; /* identifier for this event */ short filter; /* filter for event */ - u_short flags; - u_int fflags; - intptr_t data; + u_short flags; /* action flags for kqueue */ + u_int fflags; /* filter flag value */ + intptr_t data; /* filter data value */ void *udata; /* opaque user data identifier */ }; From owner-svn-src-stable@freebsd.org Mon Jul 23 18:47:05 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6E02105242E; Mon, 23 Jul 2018 18:47:05 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5658289CFC; Mon, 23 Jul 2018 18:47:05 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 375CC205BB; Mon, 23 Jul 2018 18:47:05 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6NIl5at055743; Mon, 23 Jul 2018 18:47:05 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6NIl4LZ055742; Mon, 23 Jul 2018 18:47:04 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201807231847.w6NIl4LZ055742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Mon, 23 Jul 2018 18:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r336647 - stable/10/sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/10/sys/sys X-SVN-Commit-Revision: 336647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 18:47:05 -0000 Author: dab Date: Mon Jul 23 18:47:04 2018 New Revision: 336647 URL: https://svnweb.freebsd.org/changeset/base/336647 Log: MFC r336457: Make the definition of struct kevent in event.h match what the man page for kevent(2) says. This is a trivial comment-only fix. The man page for kevent(2) gives the definition of struct kevent, including a comment on each field. The actual definition in sys/event.h omitted the comments on some fields. Add the comments in. Not only does this make the man page and include file agree, but the comments are useful in and of themselves. Sponsored by: Dell EMC Modified: stable/10/sys/sys/event.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/event.h ============================================================================== --- stable/10/sys/sys/event.h Mon Jul 23 18:35:58 2018 (r336646) +++ stable/10/sys/sys/event.h Mon Jul 23 18:47:04 2018 (r336647) @@ -73,9 +73,9 @@ struct kevent { uintptr_t ident; /* identifier for this event */ short filter; /* filter for event */ - u_short flags; - u_int fflags; - intptr_t data; + u_short flags; /* action flags for kqueue */ + u_int fflags; /* filter flag value */ + intptr_t data; /* filter data value */ void *udata; /* opaque user data identifier */ }; From owner-svn-src-stable@freebsd.org Mon Jul 23 20:36:13 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3BAE1054334; Mon, 23 Jul 2018 20:36:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 581E58D276; Mon, 23 Jul 2018 20:36:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 9DC8F10A87D; Mon, 23 Jul 2018 16:36:11 -0400 (EDT) Subject: Re: svn commit: r336448 - stable/10 To: rgrimes@freebsd.org References: <201807231736.w6NHadhr032631@pdx.rh.CN85.dnsmgr.net> Cc: Peter Jeremy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org From: John Baldwin Message-ID: <7d86153b-8442-27a3-f152-475116c6b1f5@FreeBSD.org> Date: Mon, 23 Jul 2018 11:02:13 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201807231736.w6NHadhr032631@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 23 Jul 2018 16:36:12 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 20:36:13 -0000 On 7/23/18 10:36 AM, Rodney W. Grimes wrote: >> On 7/18/18 12:05 PM, Peter Jeremy wrote: >>> On 2018-Jul-18 07:41:23 -0700, "Rodney W. Grimes" wrote: >>>>> Author: peterj >>>>> Date: Wed Jul 18 09:32:43 2018 >>>>> New Revision: 336448 >>>>> URL: https://svnweb.freebsd.org/changeset/base/336448 >>>>> >>>>> Log: >>>>> Retrospectively document SVN branch point for stable-10 and its releases. >>>>> >>>>> This is a direct commit to stable/10 because the releases are taken >>>>> from the stable/10 branch. >>>>> >>>>> Approved by: jhb (mentor) >>>>> Differential Revision: D16263 >>>> >>>> Actually I see no reason not to document these in the mainline >>>> UPDATING file and making these MFC's. As is now when looking >>>> at UPDATING from head I can not easily find the branch point >>>> for any of these releases and that is probably the most useful >>>> time for this information. If I already have a branch I probably >>>> already know what its anchor point is. >>> >>> I only put the releng/x.y branch points into the relevant stable/x/UPDATING >>> because releng/x.y is branched off stable/x and I don't think it makes much >>> sense to document those in head/UPDATING. The stable/x branchpoints are in >>> both head/UPDATING and stable/x/UPDATING. Note that the stable/10 branch- >>> point was already in head/UPDATING. >> >> I agree with this. We should document them in the source branch, but not >> in grandparents like head where there is no single head commit that becomes >> releng/X.Y. > > My only counter to this is that often what I am investigating is > the change between ^head/ and some release, say 11.2 and I really > do not want to go grovel in stable/11 to find the rXXXXXX for 11.2, > that is just a PITA. Though the branch point for stable/11 is interesting, > it is rarely usefull for any thing very meaningful. I don't ever grovel around for this in either stable/11 or head to be honest. I usually use the svnweb interface, but doing the svn log quoted previously against a little changed-file on the branch in question (such as MAINTAINERS) via the url is really the better answer. -- John Baldwin From owner-svn-src-stable@freebsd.org Tue Jul 24 05:09:51 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B27B010402F0; Tue, 24 Jul 2018 05:09:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 570E47F6D8; Tue, 24 Jul 2018 05:09:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28ECA26D59; Tue, 24 Jul 2018 05:09:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6O59o4F074965; Tue, 24 Jul 2018 05:09:50 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6O59oWY074964; Tue, 24 Jul 2018 05:09:50 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201807240509.w6O59oWY074964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 24 Jul 2018 05:09:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336661 - stable/11/usr.bin/gzip X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/usr.bin/gzip X-SVN-Commit-Revision: 336661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2018 05:09:52 -0000 Author: delphij Date: Tue Jul 24 05:09:50 2018 New Revision: 336661 URL: https://svnweb.freebsd.org/changeset/base/336661 Log: MFC r336156: Use endian.h le32dec() instead of rolling our own. Suggested by: phk Reviewed by: imp, pfg Differential Revision: https://reviews.freebsd.org/D16192 Modified: stable/11/usr.bin/gzip/gzip.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/gzip/gzip.c ============================================================================== --- stable/11/usr.bin/gzip/gzip.c Tue Jul 24 04:38:11 2018 (r336660) +++ stable/11/usr.bin/gzip/gzip.c Tue Jul 24 05:09:50 2018 (r336661) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); * - make bzip2/compress -v/-t/-l support work as well as possible */ +#include #include #include #include @@ -1016,10 +1017,7 @@ gz_uncompress(int in, int out, char *pre, size_t prele maybe_warnx("truncated input"); goto stop_and_fail; } - origcrc = ((unsigned)z.next_in[0] & 0xff) | - ((unsigned)z.next_in[1] & 0xff) << 8 | - ((unsigned)z.next_in[2] & 0xff) << 16 | - ((unsigned)z.next_in[3] & 0xff) << 24; + origcrc = le32dec(&z.next_in[0]); if (origcrc != crc) { maybe_warnx("invalid compressed" " data--crc error"); @@ -1047,10 +1045,7 @@ gz_uncompress(int in, int out, char *pre, size_t prele maybe_warnx("truncated input"); goto stop_and_fail; } - origlen = ((unsigned)z.next_in[0] & 0xff) | - ((unsigned)z.next_in[1] & 0xff) << 8 | - ((unsigned)z.next_in[2] & 0xff) << 16 | - ((unsigned)z.next_in[3] & 0xff) << 24; + origlen = le32dec(&z.next_in[0]); if (origlen != out_sub_tot) { maybe_warnx("invalid compressed" @@ -1497,7 +1492,7 @@ file_uncompress(char *file, char *outfile, size_t outs goto lose; } infile_newdata(rv); - timestamp = ts[3] << 24 | ts[2] << 16 | ts[1] << 8 | ts[0]; + timestamp = le32dec(&ts[0]); if (header1[3] & ORIG_NAME) { rbytes = pread(fd, name, sizeof(name) - 1, GZIP_ORIGNAME); @@ -2170,16 +2165,10 @@ print_list(int fd, off_t out, const char *outfile, tim maybe_warnx("read of uncompressed size"); else { - usize = buf[4]; - usize |= (unsigned int)buf[5] << 8; - usize |= (unsigned int)buf[6] << 16; - usize |= (unsigned int)buf[7] << 24; + usize = le32dec(&buf[4]); in = (off_t)usize; #ifndef SMALL - crc = buf[0]; - crc |= (unsigned int)buf[1] << 8; - crc |= (unsigned int)buf[2] << 16; - crc |= (unsigned int)buf[3] << 24; + crc = le32dec(&buf[0]); #endif } } From owner-svn-src-stable@freebsd.org Tue Jul 24 13:13:31 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4084D104B801; Tue, 24 Jul 2018 13:13:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D31578E962; Tue, 24 Jul 2018 13:13:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE5ED40D6; Tue, 24 Jul 2018 13:13:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6ODDUd0029699; Tue, 24 Jul 2018 13:13:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6ODDUs8029698; Tue, 24 Jul 2018 13:13:30 GMT (envelope-from np@FreeBSD.org) Message-Id: <201807241313.w6ODDUs8029698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 24 Jul 2018 13:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336667 - stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 336667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2018 13:13:31 -0000 Author: np Date: Tue Jul 24 13:13:30 2018 New Revision: 336667 URL: https://svnweb.freebsd.org/changeset/base/336667 Log: cxgbe/iw_cxgbe: Do not call soaccept twice on the same socket. This is a direct commit to stable/11. Reported by: Sai Tallamraju @ Netapp Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Tue Jul 24 12:55:54 2018 (r336666) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Tue Jul 24 13:13:30 2018 (r336667) @@ -947,7 +947,6 @@ process_newconn(struct c4iw_listen_ep *master_lep, str { struct c4iw_listen_ep *real_lep = NULL; struct c4iw_ep *new_ep = NULL; - struct sockaddr_in *remote = NULL; int ret = 0; MPASS(new_so != NULL); @@ -992,20 +991,6 @@ process_newconn(struct c4iw_listen_ep *master_lep, str START_EP_TIMER(new_ep); setiwsockopt(new_so); - ret = soaccept(new_so, (struct sockaddr **)&remote); - if (ret != 0) { - CTR4(KTR_IW_CXGBE, - "%s:listen sock:%p, new sock:%p, ret:%d\n", - __func__, master_lep->com.so, new_so, ret); - if (remote != NULL) - free(remote, M_SONAME); - uninit_iwarp_socket(new_so); - soclose(new_so); - c4iw_put_ep(&new_ep->com); - c4iw_put_ep(&real_lep->com); - return; - } - free(remote, M_SONAME); /* MPA request might have been queued up on the socket already, so we * initialize the socket/upcall_handler under lock to prevent processing @@ -1118,8 +1103,10 @@ dequeue_socket(struct socket *head) SOCK_UNLOCK(so); ACCEPT_UNLOCK(); remote = NULL; - soaccept(so, (struct sockaddr **)&remote); - + if (soaccept(so, (struct sockaddr **)&remote) != 0) { + soclose(so); + so = NULL; + } free(remote, M_SONAME); return so; } From owner-svn-src-stable@freebsd.org Wed Jul 25 04:33:58 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C70E103E078; Wed, 25 Jul 2018 04:33:58 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3388EF04; Wed, 25 Jul 2018 04:33:58 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECB36157A6; Wed, 25 Jul 2018 04:33:57 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6P4Xv2g010660; Wed, 25 Jul 2018 04:33:57 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6P4Xuew010652; Wed, 25 Jul 2018 04:33:56 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201807250433.w6P4Xuew010652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 25 Jul 2018 04:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336704 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 336704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2018 04:33:58 -0000 Author: araujo Date: Wed Jul 25 04:33:56 2018 New Revision: 336704 URL: https://svnweb.freebsd.org/changeset/base/336704 Log: MFC r336188: Improve bhyve exit(3) error code. The bhyve(8) exit status indicates how the VM was terminated: 0 rebooted 1 powered off 2 halted 3 triple fault The problem is when we have wrappers around bhyve that parses the exit error code and gets an exit(1) for an error but interprets it as "powered off". So to mitigate this issue and makes it less error prone for third part applications, I have added a new exit code 4 that is "exited due to an error". For now the bhyve(8) exit status are: 0 rebooted 1 powered off 2 halted 3 triple fault 4 exited due to an error Reviewed by: @jhb Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D16161 Modified: stable/11/usr.sbin/bhyve/bhyve.8 stable/11/usr.sbin/bhyve/bhyverun.c stable/11/usr.sbin/bhyve/dbgport.c stable/11/usr.sbin/bhyve/fwctl.c stable/11/usr.sbin/bhyve/mevent_test.c stable/11/usr.sbin/bhyve/pci_e82545.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/11/usr.sbin/bhyve/bhyve.8 Wed Jul 25 04:06:09 2018 (r336703) +++ stable/11/usr.sbin/bhyve/bhyve.8 Wed Jul 25 04:33:56 2018 (r336704) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2017 +.Dd Jul 11, 2018 .Dt BHYVE 8 .Os .Sh NAME @@ -428,6 +428,8 @@ powered off halted .It 3 triple fault +.It 4 +exited due to an error .El .Sh EXAMPLES If not using a boot ROM, the guest operating system must have been loaded with Modified: stable/11/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/11/usr.sbin/bhyve/bhyverun.c Wed Jul 25 04:06:09 2018 (r336703) +++ stable/11/usr.sbin/bhyve/bhyverun.c Wed Jul 25 04:33:56 2018 (r336704) @@ -338,7 +338,7 @@ fbsdrun_deletecpu(struct vmctx *ctx, int vcpu) if (!CPU_ISSET(vcpu, &cpumask)) { fprintf(stderr, "Attempting to delete unknown cpu %d\n", vcpu); - exit(1); + exit(4); } CPU_CLR_ATOMIC(vcpu, &cpumask); @@ -672,7 +672,7 @@ vm_loop(struct vmctx *ctx, int vcpu, uint64_t startrip if (exitcode >= VM_EXITCODE_MAX || handler[exitcode] == NULL) { fprintf(stderr, "vm_loop: unexpected exitcode 0x%x\n", exitcode); - exit(1); + exit(4); } rc = (*handler[exitcode])(ctx, &vmexit[vcpu], &vcpu); @@ -683,7 +683,7 @@ vm_loop(struct vmctx *ctx, int vcpu, uint64_t startrip case VMEXIT_ABORT: abort(); default: - exit(1); + exit(4); } } fprintf(stderr, "vm_run error %d, errno %d\n", error, errno); @@ -715,7 +715,7 @@ fbsdrun_set_capabilities(struct vmctx *ctx, int cpu) err = vm_get_capability(ctx, cpu, VM_CAP_HALT_EXIT, &tmp); if (err < 0) { fprintf(stderr, "VM exit on HLT not supported\n"); - exit(1); + exit(4); } vm_set_capability(ctx, cpu, VM_CAP_HALT_EXIT, 1); if (cpu == BSP) @@ -730,7 +730,7 @@ fbsdrun_set_capabilities(struct vmctx *ctx, int cpu) if (err < 0) { fprintf(stderr, "SMP mux requested, no pause support\n"); - exit(1); + exit(4); } vm_set_capability(ctx, cpu, VM_CAP_PAUSE_EXIT, 1); if (cpu == BSP) @@ -744,7 +744,7 @@ fbsdrun_set_capabilities(struct vmctx *ctx, int cpu) if (err) { fprintf(stderr, "Unable to set x2apic state (%d)\n", err); - exit(1); + exit(4); } vm_set_capability(ctx, cpu, VM_CAP_ENABLE_INVPCID, 1); @@ -780,7 +780,7 @@ do_open(const char *vmname) } } else { perror("vm_create"); - exit(1); + exit(4); } } else { if (!romboot) { @@ -789,14 +789,14 @@ do_open(const char *vmname) * bootrom must be configured to boot it. */ fprintf(stderr, "virtual machine cannot be booted\n"); - exit(1); + exit(4); } } ctx = vm_open(vmname); if (ctx == NULL) { perror("vm_open"); - exit(1); + exit(4); } #ifndef WITHOUT_CAPSICUM @@ -818,7 +818,7 @@ do_open(const char *vmname) error = vm_reinit(ctx); if (error) { perror("vm_reinit"); - exit(1); + exit(4); } } return (ctx); @@ -879,7 +879,7 @@ main(int argc, char *argv[]) break; case 's': if (pci_parse_slot(optarg) != 0) - exit(1); + exit(4); else break; case 'S': @@ -950,7 +950,7 @@ main(int argc, char *argv[]) if (guest_ncpus > max_vcpus) { fprintf(stderr, "%d vCPUs requested but only %d available\n", guest_ncpus, max_vcpus); - exit(1); + exit(4); } fbsdrun_set_capabilities(ctx, BSP); @@ -959,13 +959,13 @@ main(int argc, char *argv[]) err = vm_setup_memory(ctx, memsize, VM_MMAP_ALL); if (err) { fprintf(stderr, "Unable to setup memory (%d)\n", errno); - exit(1); + exit(4); } error = init_msr(); if (error) { fprintf(stderr, "init_msr error %d", error); - exit(1); + exit(4); } init_mem(); @@ -980,8 +980,10 @@ main(int argc, char *argv[]) /* * Exit if a device emulation finds an error in it's initilization */ - if (init_pci(ctx) != 0) - exit(1); + if (init_pci(ctx) != 0) { + perror("device emulation initialization error"); + exit(4); + } if (gdb_port != 0) init_dbgport(gdb_port); @@ -993,7 +995,7 @@ main(int argc, char *argv[]) if (vm_set_capability(ctx, BSP, VM_CAP_UNRESTRICTED_GUEST, 1)) { fprintf(stderr, "ROM boot failed: unrestricted guest " "capability not available\n"); - exit(1); + exit(4); } error = vcpu_reset(ctx, BSP); assert(error == 0); @@ -1007,8 +1009,10 @@ main(int argc, char *argv[]) */ if (mptgen) { error = mptable_build(ctx, guest_ncpus); - if (error) - exit(1); + if (error) { + perror("error to build the guest tables"); + exit(4); + } } error = smbios_build(ctx); @@ -1047,5 +1051,5 @@ main(int argc, char *argv[]) */ mevent_dispatch(); - exit(1); + exit(4); } Modified: stable/11/usr.sbin/bhyve/dbgport.c ============================================================================== --- stable/11/usr.sbin/bhyve/dbgport.c Wed Jul 25 04:06:09 2018 (r336703) +++ stable/11/usr.sbin/bhyve/dbgport.c Wed Jul 25 04:33:56 2018 (r336704) @@ -139,8 +139,8 @@ init_dbgport(int sport) conn_fd = -1; if ((listen_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { - perror("socket"); - exit(1); + perror("cannot create socket"); + exit(4); } sin.sin_len = sizeof(sin); @@ -151,18 +151,18 @@ init_dbgport(int sport) reuse = 1; if (setsockopt(listen_fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse)) < 0) { - perror("setsockopt"); - exit(1); + perror("cannot set socket options"); + exit(4); } if (bind(listen_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { - perror("bind"); - exit(1); + perror("cannot bind socket"); + exit(4); } if (listen(listen_fd, 1) < 0) { - perror("listen"); - exit(1); + perror("cannot listen socket"); + exit(4); } #ifndef WITHOUT_CAPSICUM Modified: stable/11/usr.sbin/bhyve/fwctl.c ============================================================================== --- stable/11/usr.sbin/bhyve/fwctl.c Wed Jul 25 04:06:09 2018 (r336703) +++ stable/11/usr.sbin/bhyve/fwctl.c Wed Jul 25 04:33:56 2018 (r336704) @@ -375,7 +375,7 @@ fwctl_request(uint32_t value) /* Verify size */ if (value < 12) { printf("msg size error"); - exit(1); + exit(4); } rinfo.req_size = value; rinfo.req_count = 1; Modified: stable/11/usr.sbin/bhyve/mevent_test.c ============================================================================== --- stable/11/usr.sbin/bhyve/mevent_test.c Wed Jul 25 04:06:09 2018 (r336703) +++ stable/11/usr.sbin/bhyve/mevent_test.c Wed Jul 25 04:33:56 2018 (r336704) @@ -143,7 +143,7 @@ echoer(void *param) mev = mevent_add(fd, EVF_READ, echoer_callback, &sync); if (mev == NULL) { printf("Could not allocate echoer event\n"); - exit(1); + exit(4); } while (!pthread_cond_wait(&sync.e_cond, &sync.e_mt)) { @@ -200,8 +200,8 @@ acceptor(void *param) static int first; if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { - perror("socket"); - exit(1); + perror("cannot create socket"); + exit(4); } sin.sin_len = sizeof(sin); @@ -210,13 +210,13 @@ acceptor(void *param) sin.sin_port = htons(TEST_PORT); if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) { - perror("bind"); - exit(1); + perror("cannot bind socket"); + exit(4); } if (listen(s, 1) < 0) { - perror("listen"); - exit(1); + perror("cannot listen socket"); + exit(4); } (void) mevent_add(s, EVF_READ, acceptor_callback, NULL); Modified: stable/11/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_e82545.c Wed Jul 25 04:06:09 2018 (r336703) +++ stable/11/usr.sbin/bhyve/pci_e82545.c Wed Jul 25 04:33:56 2018 (r336704) @@ -2224,7 +2224,7 @@ e82545_open_tap(struct e82545_softc *sc, char *opts) sc->esc_tapfd = open(tbuf, O_RDWR); if (sc->esc_tapfd == -1) { DPRINTF("unable to open tap device %s\n", opts); - exit(1); + exit(4); } /* From owner-svn-src-stable@freebsd.org Wed Jul 25 15:40:28 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D08A104DFE3; Wed, 25 Jul 2018 15:40:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6BED82B09; Wed, 25 Jul 2018 15:40:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C49DD1C122; Wed, 25 Jul 2018 15:40:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6PFeRS7047701; Wed, 25 Jul 2018 15:40:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6PFeRew047700; Wed, 25 Jul 2018 15:40:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201807251540.w6PFeRew047700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 25 Jul 2018 15:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336711 - in stable/11/sys/arm64: arm64 include X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11/sys/arm64: arm64 include X-SVN-Commit-Revision: 336711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2018 15:40:28 -0000 Author: markj Date: Wed Jul 25 15:40:27 2018 New Revision: 336711 URL: https://svnweb.freebsd.org/changeset/base/336711 Log: MFC r336460: Port r324665 and r325285 to arm64. Modified: stable/11/sys/arm64/arm64/pmap.c stable/11/sys/arm64/include/pmap.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/pmap.c ============================================================================== --- stable/11/sys/arm64/arm64/pmap.c Wed Jul 25 15:14:35 2018 (r336710) +++ stable/11/sys/arm64/arm64/pmap.c Wed Jul 25 15:40:27 2018 (r336711) @@ -1851,11 +1851,11 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_spare, CTLFLAG static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp) { - struct pch new_tail; - struct pv_chunk *pc; + struct pv_chunk *pc, *pc_marker, *pc_marker_end; + struct pv_chunk_header pc_marker_b, pc_marker_end_b; struct md_page *pvh; pd_entry_t *pde; - pmap_t pmap; + pmap_t next_pmap, pmap; pt_entry_t *pte, tpte; pv_entry_t pv; vm_offset_t va; @@ -1863,31 +1863,65 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l struct spglist free; uint64_t inuse; int bit, field, freed, lvl; + static int active_reclaims = 0; PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); KASSERT(lockp != NULL, ("reclaim_pv_chunk: lockp is NULL")); + pmap = NULL; m_pc = NULL; SLIST_INIT(&free); - TAILQ_INIT(&new_tail); + bzero(&pc_marker_b, sizeof(pc_marker_b)); + bzero(&pc_marker_end_b, sizeof(pc_marker_end_b)); + pc_marker = (struct pv_chunk *)&pc_marker_b; + pc_marker_end = (struct pv_chunk *)&pc_marker_end_b; + mtx_lock(&pv_chunks_mutex); - while ((pc = TAILQ_FIRST(&pv_chunks)) != NULL && SLIST_EMPTY(&free)) { - TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + active_reclaims++; + TAILQ_INSERT_HEAD(&pv_chunks, pc_marker, pc_lru); + TAILQ_INSERT_TAIL(&pv_chunks, pc_marker_end, pc_lru); + while ((pc = TAILQ_NEXT(pc_marker, pc_lru)) != pc_marker_end && + SLIST_EMPTY(&free)) { + next_pmap = pc->pc_pmap; + if (next_pmap == NULL) { + /* + * The next chunk is a marker. However, it is + * not our marker, so active_reclaims must be + * > 1. Consequently, the next_chunk code + * will not rotate the pv_chunks list. + */ + goto next_chunk; + } mtx_unlock(&pv_chunks_mutex); - if (pmap != pc->pc_pmap) { + + /* + * A pv_chunk can only be removed from the pc_lru list + * when both pv_chunks_mutex is owned and the + * corresponding pmap is locked. + */ + if (pmap != next_pmap) { if (pmap != NULL && pmap != locked_pmap) PMAP_UNLOCK(pmap); - pmap = pc->pc_pmap; + pmap = next_pmap; /* Avoid deadlock and lock recursion. */ if (pmap > locked_pmap) { RELEASE_PV_LIST_LOCK(lockp); PMAP_LOCK(pmap); - } else if (pmap != locked_pmap && - !PMAP_TRYLOCK(pmap)) { - pmap = NULL; - TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru); mtx_lock(&pv_chunks_mutex); continue; + } else if (pmap != locked_pmap) { + if (PMAP_TRYLOCK(pmap)) { + mtx_lock(&pv_chunks_mutex); + continue; + } else { + pmap = NULL; /* pmap is not locked */ + mtx_lock(&pv_chunks_mutex); + pc = TAILQ_NEXT(pc_marker, pc_lru); + if (pc == NULL || + pc->pc_pmap != next_pmap) + continue; + goto next_chunk; + } } } @@ -1933,9 +1967,8 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l } } if (freed == 0) { - TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru); mtx_lock(&pv_chunks_mutex); - continue; + goto next_chunk; } /* Every freed mapping is for a 4 KB page. */ pmap_resident_count_dec(pmap, freed); @@ -1952,16 +1985,36 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l m_pc = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m_pc->phys_addr); mtx_lock(&pv_chunks_mutex); + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); break; } TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); - TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru); mtx_lock(&pv_chunks_mutex); /* One freed pv entry in locked_pmap is sufficient. */ if (pmap == locked_pmap) break; + +next_chunk: + TAILQ_REMOVE(&pv_chunks, pc_marker, pc_lru); + TAILQ_INSERT_AFTER(&pv_chunks, pc, pc_marker, pc_lru); + if (active_reclaims == 1 && pmap != NULL) { + /* + * Rotate the pv chunks list so that we do not + * scan the same pv chunks that could not be + * freed (because they contained a wired + * and/or superpage mapping) on every + * invocation of reclaim_pv_chunk(). + */ + while ((pc = TAILQ_FIRST(&pv_chunks)) != pc_marker) { + MPASS(pc->pc_pmap != NULL); + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + TAILQ_INSERT_TAIL(&pv_chunks, pc, pc_lru); + } + } } - TAILQ_CONCAT(&pv_chunks, &new_tail, pc_lru); + TAILQ_REMOVE(&pv_chunks, pc_marker, pc_lru); + TAILQ_REMOVE(&pv_chunks, pc_marker_end, pc_lru); + active_reclaims--; mtx_unlock(&pv_chunks_mutex); if (pmap != NULL && pmap != locked_pmap) PMAP_UNLOCK(pmap); Modified: stable/11/sys/arm64/include/pmap.h ============================================================================== --- stable/11/sys/arm64/include/pmap.h Wed Jul 25 15:14:35 2018 (r336710) +++ stable/11/sys/arm64/include/pmap.h Wed Jul 25 15:40:27 2018 (r336711) @@ -84,6 +84,7 @@ struct pmap { TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ struct vm_radix pm_root; /* spare page table pages */ }; +typedef struct pmap *pmap_t; typedef struct pv_entry { vm_offset_t pv_va; /* virtual address for mapping */ @@ -96,15 +97,20 @@ typedef struct pv_entry { */ #define _NPCM 3 #define _NPCPV 168 -struct pv_chunk { - struct pmap * pc_pmap; - TAILQ_ENTRY(pv_chunk) pc_list; - uint64_t pc_map[_NPCM]; /* bitmap; 1 = free */ +#define PV_CHUNK_HEADER \ + pmap_t pc_pmap; \ + TAILQ_ENTRY(pv_chunk) pc_list; \ + uint64_t pc_map[_NPCM]; /* bitmap; 1 = free */ \ TAILQ_ENTRY(pv_chunk) pc_lru; - struct pv_entry pc_pventry[_NPCPV]; + +struct pv_chunk_header { + PV_CHUNK_HEADER }; -typedef struct pmap *pmap_t; +struct pv_chunk { + PV_CHUNK_HEADER + struct pv_entry pc_pventry[_NPCPV]; +}; #ifdef _KERNEL extern struct pmap kernel_pmap_store; From owner-svn-src-stable@freebsd.org Wed Jul 25 21:52:53 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E90C21055145; Wed, 25 Jul 2018 21:52:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85DA58FC83; Wed, 25 Jul 2018 21:52:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 610241FEFF; Wed, 25 Jul 2018 21:52:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6PLqqJI044409; Wed, 25 Jul 2018 21:52:52 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6PLqoGs044399; Wed, 25 Jul 2018 21:52:50 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201807252152.w6PLqoGs044399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 25 Jul 2018 21:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336726 - in stable/11/release: . arm tools X-SVN-Group: stable-11 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/11/release: . arm tools X-SVN-Commit-Revision: 336726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2018 21:52:53 -0000 Author: manu Date: Wed Jul 25 21:52:49 2018 New Revision: 336726 URL: https://svnweb.freebsd.org/changeset/base/336726 Log: MFC r336598-r336600, r336721 r336598: release: Uniform release arm image size Create a 50m fat16 for all boards. Reviewed by: gjb Differential Revision: https://reviews.freebsd.org/D16238 r336599: release: Add arm_install_boot to install the commit boot bits This reduce the per-board arm_install_uboot to just install u-boot. While here remove the installation of rpi.dtb and rpi2.dtb as we load them from the UFS partition via ubldr. Reviewed by: gjb, imp (older version) Differential Revision: https://reviews.freebsd.org/D16239 r336600: release: Add rpi firmware dtb and mmc overlays for RPI-B and RPI2 This is needed with new u-boot that uses the rpi-firmware dtbs. Reviewed by: gjb Differential Revision: https://reviews.freebsd.org/D16240 r336721: release: Add OL_DIR forgot in r336600 Reviewed by: gjb Differential Revision: https://reviews.freebsd.org/D16439 Approved by: gjb (for insta-mfc of r336721) Modified: stable/11/release/arm/BANANAPI.conf stable/11/release/arm/BEAGLEBONE.conf stable/11/release/arm/CUBIEBOARD.conf stable/11/release/arm/CUBIEBOARD2.conf stable/11/release/arm/GUMSTIX.conf stable/11/release/arm/PANDABOARD.conf stable/11/release/arm/RPI-B.conf stable/11/release/arm/RPI2.conf stable/11/release/arm/WANDBOARD.conf stable/11/release/release.sh stable/11/release/tools/arm.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/release/arm/BANANAPI.conf ============================================================================== --- stable/11/release/arm/BANANAPI.conf Wed Jul 25 19:31:32 2018 (r336725) +++ stable/11/release/arm/BANANAPI.conf Wed Jul 25 21:52:49 2018 (r336726) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-bananapi" -FAT_SIZE="32m -b 1m" +FAT_SIZE="50m -b 1m" FAT_TYPE="16" IMAGE_SIZE="1G" KERNEL="ALLWINNER" @@ -20,8 +20,6 @@ export BOARDNAME="BANANAPI" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-bananapi" UBOOT_FILES="u-boot-sunxi-with-spl.bin" - FATMOUNT="${DESTDIR%${KERNEL}}/fat" - UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ of=/dev/${mddev} bs=1k seek=8 conv=sync chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" @@ -30,8 +28,6 @@ arm_install_uboot() { chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin - chroot ${CHROOTDIR} ln ${UFSMOUNT}/boot/dtb/bananapi.dtb \ - ${UFSMOUNT}/boot/dtb/sun7i-a20-bananapi.dtb chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} Modified: stable/11/release/arm/BEAGLEBONE.conf ============================================================================== --- stable/11/release/arm/BEAGLEBONE.conf Wed Jul 25 19:31:32 2018 (r336725) +++ stable/11/release/arm/BEAGLEBONE.conf Wed Jul 25 21:52:49 2018 (r336726) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-beaglebone" -FAT_SIZE="41m" +FAT_SIZE="50m" FAT_TYPE="16" IMAGE_SIZE="1G" KERNEL="BEAGLEBONE" @@ -19,25 +19,17 @@ WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-beaglebone" FATMOUNT="${DESTDIR%${KERNEL}}/fat" - UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" - chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} - chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img chroot ${CHROOTDIR} cp ${UBOOT_DIR}/boot.scr ${FATMOUNT}/boot.scr chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin - chroot ${CHROOTDIR} ln ${UFSMOUNT}/boot/dtb/beaglebone.dtb \ - ${UFSMOUNT}/boot/dtb/am335x-bone.dtb - chroot ${CHROOTDIR} ln ${UFSMOUNT}/boot/dtb/beaglebone-black.dtb \ - ${UFSMOUNT}/boot/dtb/am335x-boneblack.dtb chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} - umount_loop ${CHROOTDIR}/${UFSMOUNT} chroot ${CHROOTDIR} rmdir ${FATMOUNT} - chroot ${CHROOTDIR} rmdir ${UFSMOUNT} return 0 } Modified: stable/11/release/arm/CUBIEBOARD.conf ============================================================================== --- stable/11/release/arm/CUBIEBOARD.conf Wed Jul 25 19:31:32 2018 (r336725) +++ stable/11/release/arm/CUBIEBOARD.conf Wed Jul 25 21:52:49 2018 (r336726) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-cubieboard" -FAT_SIZE="32m -b 1m" +FAT_SIZE="50m -b 1m" FAT_TYPE="16" IMAGE_SIZE="1G" KERNEL="ALLWINNER_UP" Modified: stable/11/release/arm/CUBIEBOARD2.conf ============================================================================== --- stable/11/release/arm/CUBIEBOARD2.conf Wed Jul 25 19:31:32 2018 (r336725) +++ stable/11/release/arm/CUBIEBOARD2.conf Wed Jul 25 21:52:49 2018 (r336726) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-cubieboard2" -FAT_SIZE="32m -b 1m" +FAT_SIZE="50m -b 1m" FAT_TYPE="16" IMAGE_SIZE="1G" KERNEL="ALLWINNER" Modified: stable/11/release/arm/GUMSTIX.conf ============================================================================== --- stable/11/release/arm/GUMSTIX.conf Wed Jul 25 19:31:32 2018 (r336725) +++ stable/11/release/arm/GUMSTIX.conf Wed Jul 25 21:52:49 2018 (r336726) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="arm" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-duovero" -FAT_SIZE="41m" +FAT_SIZE="50m" FAT_TYPE="16" IMAGE_SIZE="1G" KERNEL="GUMSTIX" Modified: stable/11/release/arm/PANDABOARD.conf ============================================================================== --- stable/11/release/arm/PANDABOARD.conf Wed Jul 25 19:31:32 2018 (r336725) +++ stable/11/release/arm/PANDABOARD.conf Wed Jul 25 21:52:49 2018 (r336726) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-pandaboard" -FAT_SIZE="41m" +FAT_SIZE="50m" FAT_TYPE="16" IMAGE_SIZE="1G" KERNEL="PANDABOARD" Modified: stable/11/release/arm/RPI-B.conf ============================================================================== --- stable/11/release/arm/RPI-B.conf Wed Jul 25 19:31:32 2018 (r336725) +++ stable/11/release/arm/RPI-B.conf Wed Jul 25 21:52:49 2018 (r336726) @@ -7,12 +7,13 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-rpi sysutils/rpi-firmware" -FAT_SIZE="41m" +FAT_SIZE="50m" FAT_TYPE="16" IMAGE_SIZE="1G" KERNEL="RPI-B" MD_ARGS="-x 63 -y 255" NODOC=1 +OVERLAYS="mmc.dtbo pi3-disable-bt.dtbo" PART_SCHEME="MBR" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" @@ -22,12 +23,12 @@ arm_install_uboot() { UBOOT_FILES="u-boot.bin" RPI_FIRMWARE_FILES="bootcode.bin config.txt \ fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \ - start.elf start_cd.elf start_db.elf start_x.elf" + start.elf start_cd.elf start_db.elf start_x.elf \ + bcm2708-rpi-0-w.dtb bcm2708-rpi-b-plus.dtb bcm2708-rpi-b.dtb \ + bcm2708-rpi-cm.dtb" FATMOUNT="${DESTDIR%${KERNEL}}/fat" - UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" - chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} - chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} for _UF in ${UBOOT_FILES}; do chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \ ${FATMOUNT}/${_UF} @@ -36,17 +37,15 @@ arm_install_uboot() { chroot ${CHROOTDIR} cp -p ${RPI_FIRMWARE_DIR}/${_UF} \ ${FATMOUNT}/${_UF} done - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ - ${FATMOUNT}/ubldr.bin - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/dtb/rpi.dtb \ - ${FATMOUNT}/rpi.dtb + chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays + for _OL in ${OVERLAYS}; do + chroot ${CHROOTDIR} cp -p ${OL_DIR}/${_OL} \ + ${FATMOUNT}/overlays/${_OL} + done chroot ${CHROOTDIR} cp ${UBOOT_DIR}/boot.scr ${FATMOUNT}/boot.scr - chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} - umount_loop ${CHROOTDIR}/${UFSMOUNT} chroot ${CHROOTDIR} rmdir ${FATMOUNT} - chroot ${CHROOTDIR} rmdir ${UFSMOUNT} return 0 } Modified: stable/11/release/arm/RPI2.conf ============================================================================== --- stable/11/release/arm/RPI2.conf Wed Jul 25 19:31:32 2018 (r336725) +++ stable/11/release/arm/RPI2.conf Wed Jul 25 21:52:49 2018 (r336726) @@ -13,6 +13,7 @@ IMAGE_SIZE="1536M" KERNEL="RPI2" MD_ARGS="-x 63 -y 255" NODOC=1 +OVERLAYS="mmc.dtbo" PART_SCHEME="MBR" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" @@ -22,12 +23,11 @@ arm_install_uboot() { UBOOT_FILES="u-boot.bin" RPI_FIRMWARE_FILES="bootcode.bin config.txt \ fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \ - start.elf start_cd.elf start_db.elf start_x.elf" + start.elf start_cd.elf start_db.elf start_x.elf \ + bcm2709-rpi-2-b.dtb" FATMOUNT="${DESTDIR%${KERNEL}}/fat" - UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" - chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} - chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} for _UF in ${UBOOT_FILES}; do chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \ ${FATMOUNT}/${_UF} @@ -36,17 +36,15 @@ arm_install_uboot() { chroot ${CHROOTDIR} cp -p ${RPI_FIRMWARE_DIR}/${_UF} \ ${FATMOUNT}/${_UF} done - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ - ${FATMOUNT}/ubldr.bin - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/dtb/rpi2.dtb \ - ${FATMOUNT}/rpi2.dtb + chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays + for _OL in ${OVERLAYS}; do + chroot ${CHROOTDIR} cp -p ${OL_DIR}/${_OL} \ + ${FATMOUNT}/overlays/${_OL} + done chroot ${CHROOTDIR} cp ${UBOOT_DIR}/boot.scr ${FATMOUNT}/boot.scr - chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} - umount_loop ${CHROOTDIR}/${UFSMOUNT} chroot ${CHROOTDIR} rmdir ${FATMOUNT} - chroot ${CHROOTDIR} rmdir ${UFSMOUNT} return 0 } Modified: stable/11/release/arm/WANDBOARD.conf ============================================================================== --- stable/11/release/arm/WANDBOARD.conf Wed Jul 25 19:31:32 2018 (r336725) +++ stable/11/release/arm/WANDBOARD.conf Wed Jul 25 21:52:49 2018 (r336726) @@ -20,22 +20,8 @@ export BOARDNAME="WANDBOARD" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-wandboard" UBOOT_FILES="u-boot.imx" - FATMOUNT="${DESTDIR%${KERNEL}}/fat" - UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ of=/dev/${mddev} bs=512 seek=2 conv=sync - chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" - chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} - chroot ${CHROOTDIR} cp ${UBOOT_DIR}/boot.scr ${FATMOUNT}/boot.scr - chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ - ${FATMOUNT}/ubldr.bin - chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot - sync - umount_loop ${CHROOTDIR}/${FATMOUNT} - umount_loop ${CHROOTDIR}/${UFSMOUNT} - chroot ${CHROOTDIR} rmdir ${FATMOUNT} - chroot ${CHROOTDIR} rmdir ${UFSMOUNT} return 0 } Modified: stable/11/release/release.sh ============================================================================== --- stable/11/release/release.sh Wed Jul 25 19:31:32 2018 (r336725) +++ stable/11/release/release.sh Wed Jul 25 21:52:49 2018 (r336726) @@ -358,6 +358,21 @@ chroot_build_release() { return 0 } # chroot_build_release() +efi_boot_name() +{ + case $1 in + arm) + echo "bootarm.efi" + ;; + arm64) + echo "bootaa64.efi" + ;; + amd64) + echo "bootx86.efi" + ;; + esac +} + # chroot_arm_build_release(): Create arm SD card image. chroot_arm_build_release() { load_target_env @@ -385,6 +400,7 @@ chroot_arm_build_release() { mdconfig -f ${IMGBASE##${CHROOTDIR}} ${MD_ARGS}) arm_create_disk arm_install_base + arm_install_boot arm_install_uboot mdconfig -d -u ${mddev} chroot ${CHROOTDIR} rmdir ${DESTDIR} Modified: stable/11/release/tools/arm.subr ============================================================================== --- stable/11/release/tools/arm.subr Wed Jul 25 19:31:32 2018 (r336725) +++ stable/11/release/tools/arm.subr Wed Jul 25 21:52:49 2018 (r336726) @@ -130,6 +130,36 @@ arm_install_base() { return 0 } +arm_install_boot() { + FATMOUNT="${DESTDIR%${KERNEL}}/fat" + UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" + chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" + chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} + + if [ "${EMBEDDED_TARGET}" == "arm" ]; then + chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ + ${FATMOUNT}/ubldr.bin + fi + + BOOTFILES="$(chroot ${CHROOTDIR} \ + env TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ + WITH_UNIFIED_OBJDIR=yes \ + make -C ${WORLDDIR}/stand -V .OBJDIR)" + BOOTFILES="$(chroot ${CHROOTDIR} realpath ${BOOTFILES})" + + chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/EFI/BOOT + chroot ${CHROOTDIR} cp -p ${BOOTFILES}/efi/loader/loader.efi \ + ${FATMOUNT}/EFI/BOOT/$(efi_boot_name ${EMBEDDED_TARGET}) + + chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot + sync + umount_loop ${CHROOTDIR}/${FATMOUNT} + umount_loop ${CHROOTDIR}/${UFSMOUNT} + chroot ${CHROOTDIR} rmdir ${FATMOUNT} + chroot ${CHROOTDIR} rmdir ${UFSMOUNT} +} + arm_install_uboot() { # Override in the arm/KERNEL.conf file. From owner-svn-src-stable@freebsd.org Thu Jul 26 16:08:36 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06054105369E; Thu, 26 Jul 2018 16:08:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92090960E5; Thu, 26 Jul 2018 16:08:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 164C83401; Thu, 26 Jul 2018 16:08:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6QG8YH8003391; Thu, 26 Jul 2018 16:08:34 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6QG8Yi6003390; Thu, 26 Jul 2018 16:08:34 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201807261608.w6QG8Yi6003390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 26 Jul 2018 16:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336741 - stable/11/release/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/tools X-SVN-Commit-Revision: 336741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2018 16:08:36 -0000 Author: gjb Date: Thu Jul 26 16:08:34 2018 New Revision: 336741 URL: https://svnweb.freebsd.org/changeset/base/336741 Log: Following r336726, explicitly invoke the 'obj' target when setting BOOTFILES. On stable/11, without this change, the .OBJDIR expands to /usr/src/stand instead /usr/obj/. This is a piece of duct tape for now until I figure out why the correct directory is not being located. This is a direct commit to stable/11. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/tools/arm.subr Modified: stable/11/release/tools/arm.subr ============================================================================== --- stable/11/release/tools/arm.subr Thu Jul 26 16:08:26 2018 (r336740) +++ stable/11/release/tools/arm.subr Thu Jul 26 16:08:34 2018 (r336741) @@ -142,6 +142,10 @@ arm_install_boot() { ${FATMOUNT}/ubldr.bin fi + # Ensure the correct .OBJDIR exists. + chroot ${CHROOTDIR} env TARGET=${EMBEDDED_TARGET} \ + TARGET_ARCH=${EMBEDDED_TARGET_ARCH} WITH_UNIFIED_OBJDIR=yes \ + make -C ${WORLDDIR}/stand obj BOOTFILES="$(chroot ${CHROOTDIR} \ env TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ WITH_UNIFIED_OBJDIR=yes \ From owner-svn-src-stable@freebsd.org Thu Jul 26 19:00:31 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33CA8105763C; Thu, 26 Jul 2018 19:00:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAE8E748CA; Thu, 26 Jul 2018 19:00:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBC155496; Thu, 26 Jul 2018 19:00:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6QJ0U8j091450; Thu, 26 Jul 2018 19:00:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6QJ0UaU091448; Thu, 26 Jul 2018 19:00:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201807261900.w6QJ0UaU091448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 26 Jul 2018 19:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336749 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 336749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2018 19:00:31 -0000 Author: markj Date: Thu Jul 26 19:00:30 2018 New Revision: 336749 URL: https://svnweb.freebsd.org/changeset/base/336749 Log: MFC r336504, r336507: Provide the full module path to preload_delete_name(). Modified: stable/11/sys/kern/link_elf.c stable/11/sys/kern/link_elf_obj.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/link_elf.c ============================================================================== --- stable/11/sys/kern/link_elf.c Thu Jul 26 18:57:51 2018 (r336748) +++ stable/11/sys/kern/link_elf.c Thu Jul 26 19:00:30 2018 (r336749) @@ -1169,8 +1169,8 @@ link_elf_unload_file(linker_file_t file) static void link_elf_unload_preload(linker_file_t file) { - if (file->filename != NULL) - preload_delete_name(file->filename); + if (file->pathname != NULL) + preload_delete_name(file->pathname); } static const char * Modified: stable/11/sys/kern/link_elf_obj.c ============================================================================== --- stable/11/sys/kern/link_elf_obj.c Thu Jul 26 18:57:51 2018 (r336748) +++ stable/11/sys/kern/link_elf_obj.c Thu Jul 26 19:00:30 2018 (r336749) @@ -1030,9 +1030,8 @@ link_elf_unload_file(linker_file_t file) free(ef->ctftab, M_LINKER); free(ef->ctfoff, M_LINKER); free(ef->typoff, M_LINKER); - if (file->filename != NULL) - preload_delete_name(file->filename); - /* XXX reclaim module memory? */ + if (file->pathname != NULL) + preload_delete_name(file->pathname); return; } From owner-svn-src-stable@freebsd.org Fri Jul 27 05:40:04 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 597C510615E8; Fri, 27 Jul 2018 05:40:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F64D859E6; Fri, 27 Jul 2018 05:40:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E631913C06; Fri, 27 Jul 2018 05:40:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6R5e3Bt018259; Fri, 27 Jul 2018 05:40:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6R5e37o018258; Fri, 27 Jul 2018 05:40:03 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201807270540.w6R5e37o018258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 27 Jul 2018 05:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336755 - stable/11/sbin/fsck_msdosfs X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/sbin/fsck_msdosfs X-SVN-Commit-Revision: 336755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2018 05:40:04 -0000 Author: delphij Date: Fri Jul 27 05:40:03 2018 New Revision: 336755 URL: https://svnweb.freebsd.org/changeset/base/336755 Log: MFC r336236: Detect and handle invalid number of FATs. Modified: stable/11/sbin/fsck_msdosfs/boot.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/fsck_msdosfs/boot.c ============================================================================== --- stable/11/sbin/fsck_msdosfs/boot.c Fri Jul 27 05:21:20 2018 (r336754) +++ stable/11/sbin/fsck_msdosfs/boot.c Fri Jul 27 05:40:03 2018 (r336755) @@ -87,6 +87,10 @@ readboot(int dosfs, struct bootblock *boot) pfatal("Invalid sector size: %u", boot->bpbBytesPerSec); return FSFATAL; } + if (boot->bpbFATs == 0) { + pfatal("Invalid number of FATs: %u", boot->bpbFATs); + return FSFATAL; + } if (!boot->bpbRootDirEnts) boot->flags |= FAT32; if (boot->flags & FAT32) { From owner-svn-src-stable@freebsd.org Fri Jul 27 15:49:13 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACCC5104ED5F; Fri, 27 Jul 2018 15:49:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 610347AD6A; Fri, 27 Jul 2018 15:49:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E0AF19D5C; Fri, 27 Jul 2018 15:49:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6RFnCsN031572; Fri, 27 Jul 2018 15:49:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6RFnCsc031571; Fri, 27 Jul 2018 15:49:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201807271549.w6RFnCsc031571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 27 Jul 2018 15:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336765 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/arm64/arm64 X-SVN-Commit-Revision: 336765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2018 15:49:13 -0000 Author: markj Date: Fri Jul 27 15:49:12 2018 New Revision: 336765 URL: https://svnweb.freebsd.org/changeset/base/336765 Log: MFC r336556: Initialize the L3 page's wire count correctly after a L2 entry demotion. Modified: stable/11/sys/arm64/arm64/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/pmap.c ============================================================================== --- stable/11/sys/arm64/arm64/pmap.c Fri Jul 27 15:46:34 2018 (r336764) +++ stable/11/sys/arm64/arm64/pmap.c Fri Jul 27 15:49:12 2018 (r336765) @@ -4611,6 +4611,7 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_ * If the page table page is new, initialize it. */ if (ml3->wire_count == 1) { + ml3->wire_count = NL3PG; for (i = 0; i < Ln_ENTRIES; i++) { l3[i] = newl3 | phys; phys += L3_SIZE; From owner-svn-src-stable@freebsd.org Fri Jul 27 17:39:40 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 192291051B6A; Fri, 27 Jul 2018 17:39:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD3717F43E; Fri, 27 Jul 2018 17:39:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 886051AF38; Fri, 27 Jul 2018 17:39:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6RHdd23087972; Fri, 27 Jul 2018 17:39:39 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6RHdaIZ087956; Fri, 27 Jul 2018 17:39:36 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201807271739.w6RHdaIZ087956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 27 Jul 2018 17:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336767 - in stable/11: include lib/msun lib/msun/ld128 lib/msun/ld80 lib/msun/man lib/msun/src X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/11: include lib/msun lib/msun/ld128 lib/msun/ld80 lib/msun/man lib/msun/src X-SVN-Commit-Revision: 336767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2018 17:39:40 -0000 Author: dim Date: Fri Jul 27 17:39:36 2018 New Revision: 336767 URL: https://svnweb.freebsd.org/changeset/base/336767 Log: MFC r327400 (by eadler): cacos(3): correct spelling of 'I' In some cases we had 'i' instead of 'I'. PR: 195517 Submitted by: stephen MFC r329259 (by eadler): msun: signed overflow in atan2 As a component of atan2(y, x), the case of x == 1.0 is farmed out to atan(y). The current implementation of this comparison is vulnerable to signed integer underflow (that is, undefined behavior), and it's performed in a somewhat more complicated way than it need be. Change it to not be quite so cute, rather directly comparing the high/low bits of x to the specific IEEE-754 bit pattern that encodes 1.0. Note that while there are three different e_atan* files in the relevant directory, only this one needs fixing. e_atan2f.c already compares against the full bit pattern encoding 1.0f, while e_atan2l.cuses bitwise-ands/ors/nots and so doesn't require a change. Closes #130 Submitted by: Jeff Walden (@jswalden github PR #130) Reviewed by: bde MFC r334721 (by cem): clog.3, complex.3: Fix typos and igor style issues PR: 228783 Reported by: Karsten MFC r336299 (by mmacy): msun: add ld80/ld128 powl, cpow, cpowf, cpowl from openbsd This corresponds to the latest status (hasn't changed in 9+ years) from openbsd of ld80/ld128 powl, and source cpowf, cpow, cpowl (the complex power functions for float complex, double complex, and long double complex) which are required for C99 compliance and were missing from FreeBSD. Also required for some numerical codes using complex numbered Hamiltonians. Thanks to jhb for tracking down the issue with making weak_reference compile on powerpc. When asked to review, bde said "I don't like it" - but provided no actionable feedback or superior implementations. Discussed with: jhb Submitted by: jmd Differential Revision: https://reviews.freebsd.org/D15919 MFC r336563: Recommit r336497: Fix powl, cpow, cpowf, and cpowl imports from OpenBSD This is a follow-up to r336299. * lib/msun/Makefile: . Remove polevll.c * lib/msun/ld80/e_powl.c: . Copy contents of polevll.c to here. This is the only consumer of these functions. Make functions 'static inline'. . Make reducl a 'static inline' function. * lib/msun/man/exp.3: . Remove BUGS section that no longer applies. * lib/msun/src/math_private.h: . Remove prototypes of __p1evll() and __polevll() * lib/msun/src/s_cpow.c: * lib/msun/src/s_cpowf.c: * lib/msun/src/s_cpowl.c . Include math_private.h. . Use the CMPLX macro from either C99 or math_private.h (depends on compiler support) instead of the problematic use of complex I. Submitted by: Steve Kargl PR: 229876 Added: stable/11/lib/msun/ld128/e_powl.c - copied unchanged from r336299, head/lib/msun/ld128/e_powl.c stable/11/lib/msun/ld80/e_powl.c - copied, changed from r336299, head/lib/msun/ld80/e_powl.c stable/11/lib/msun/man/cpow.3 - copied unchanged from r336299, head/lib/msun/man/cpow.3 stable/11/lib/msun/src/s_cpow.c - copied, changed from r336299, head/lib/msun/src/s_cpow.c stable/11/lib/msun/src/s_cpowf.c - copied, changed from r336299, head/lib/msun/src/s_cpowf.c stable/11/lib/msun/src/s_cpowl.c - copied, changed from r336299, head/lib/msun/src/s_cpowl.c Modified: stable/11/include/complex.h stable/11/lib/msun/Makefile stable/11/lib/msun/Symbol.map stable/11/lib/msun/man/cacos.3 stable/11/lib/msun/man/clog.3 stable/11/lib/msun/man/complex.3 stable/11/lib/msun/man/exp.3 stable/11/lib/msun/src/e_atan2.c stable/11/lib/msun/src/e_pow.c stable/11/lib/msun/src/imprecise.c stable/11/lib/msun/src/math_private.h Directory Properties: stable/11/ (props changed) Modified: stable/11/include/complex.h ============================================================================== --- stable/11/include/complex.h Fri Jul 27 16:13:06 2018 (r336766) +++ stable/11/include/complex.h Fri Jul 27 17:39:36 2018 (r336767) @@ -95,6 +95,10 @@ double complex conj(double complex) __pure2; float complex conjf(float complex) __pure2; long double complex conjl(long double complex) __pure2; +float complex cpowf(float complex, float complex); +double complex cpow(double complex, double complex); +long double complex + cpowl(long double complex, long double complex); float complex cprojf(float complex) __pure2; double complex cproj(double complex) __pure2; long double complex Modified: stable/11/lib/msun/Makefile ============================================================================== --- stable/11/lib/msun/Makefile Fri Jul 27 16:13:06 2018 (r336766) +++ stable/11/lib/msun/Makefile Fri Jul 27 17:39:36 2018 (r336767) @@ -98,7 +98,7 @@ COMMON_SRCS+= s_copysignl.c s_fabsl.c s_llrintl.c s_lr COMMON_SRCS+= catrigl.c \ e_acoshl.c e_acosl.c e_asinl.c e_atan2l.c e_atanhl.c \ e_coshl.c e_fmodl.c e_hypotl.c \ - e_lgammal.c e_lgammal_r.c \ + e_lgammal.c e_lgammal_r.c e_powl.c \ e_remainderl.c e_sinhl.c e_sqrtl.c \ invtrig.c k_cosl.c k_sinl.c k_tanl.c \ s_asinhl.c s_atanl.c s_cbrtl.c s_ceill.c \ @@ -115,6 +115,7 @@ COMMON_SRCS+= catrig.c catrigf.c \ s_ccosh.c s_ccoshf.c s_cexp.c s_cexpf.c \ s_cimag.c s_cimagf.c s_cimagl.c \ s_conj.c s_conjf.c s_conjl.c \ + s_cpow.c s_cpowf.c s_cpowl.c \ s_cproj.c s_cprojf.c s_creal.c s_crealf.c s_creall.c \ s_csinh.c s_csinhf.c s_ctanh.c s_ctanhf.c @@ -134,7 +135,7 @@ INCS+= fenv.h math.h MAN= acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 \ ceil.3 cacos.3 ccos.3 ccosh.3 cexp.3 \ - cimag.3 clog.3 copysign.3 cos.3 cosh.3 csqrt.3 erf.3 \ + cimag.3 clog.3 copysign.3 cos.3 cosh.3 cpow.3 csqrt.3 erf.3 \ exp.3 fabs.3 fdim.3 \ feclearexcept.3 feenableexcept.3 fegetenv.3 \ fegetround.3 fenv.3 floor.3 \ @@ -172,6 +173,7 @@ MLINKS+=clog.3 clogf.3 clog.3 clogl.3 MLINKS+=copysign.3 copysignf.3 copysign.3 copysignl.3 MLINKS+=cos.3 cosf.3 cos.3 cosl.3 MLINKS+=cosh.3 coshf.3 cosh.3 coshl.3 +MLINKS+=cpow.3 cpowf.3 cpow.3 cpowl.3 MLINKS+=csqrt.3 csqrtf.3 csqrt.3 csqrtl.3 MLINKS+=erf.3 erfc.3 erf.3 erff.3 erf.3 erfcf.3 erf.3 erfl.3 erf.3 erfcl.3 MLINKS+=exp.3 expm1.3 exp.3 expm1f.3 exp.3 expm1l.3 exp.3 pow.3 exp.3 powf.3 \ Modified: stable/11/lib/msun/Symbol.map ============================================================================== --- stable/11/lib/msun/Symbol.map Fri Jul 27 16:13:06 2018 (r336766) +++ stable/11/lib/msun/Symbol.map Fri Jul 27 17:39:36 2018 (r336767) @@ -274,10 +274,10 @@ FBSD_1.3 { log1pl; log2l; logl; + powl; sinhl; tanhl; /* Implemented as weak aliases for imprecise versions */ - powl; tgammal; }; @@ -297,6 +297,9 @@ FBSD_1.5 { clog; clogf; clogl; + cpow; + cpowf; + cpowl; sincos; sincosf; sincosl; Copied: stable/11/lib/msun/ld128/e_powl.c (from r336299, head/lib/msun/ld128/e_powl.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/msun/ld128/e_powl.c Fri Jul 27 17:39:36 2018 (r336767, copy of r336299, head/lib/msun/ld128/e_powl.c) @@ -0,0 +1,443 @@ +/*- + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * Copyright (c) 2008 Stephen L. Moshier + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* powl(x,y) return x**y + * + * n + * Method: Let x = 2 * (1+f) + * 1. Compute and return log2(x) in two pieces: + * log2(x) = w1 + w2, + * where w1 has 113-53 = 60 bit trailing zeros. + * 2. Perform y*log2(x) = n+y' by simulating muti-precision + * arithmetic, where |y'|<=0.5. + * 3. Return x**y = 2**n*exp(y'*log2) + * + * Special cases: + * 1. (anything) ** 0 is 1 + * 2. (anything) ** 1 is itself + * 3. (anything) ** NAN is NAN + * 4. NAN ** (anything except 0) is NAN + * 5. +-(|x| > 1) ** +INF is +INF + * 6. +-(|x| > 1) ** -INF is +0 + * 7. +-(|x| < 1) ** +INF is +0 + * 8. +-(|x| < 1) ** -INF is +INF + * 9. +-1 ** +-INF is NAN + * 10. +0 ** (+anything except 0, NAN) is +0 + * 11. -0 ** (+anything except 0, NAN, odd integer) is +0 + * 12. +0 ** (-anything except 0, NAN) is +INF + * 13. -0 ** (-anything except 0, NAN, odd integer) is +INF + * 14. -0 ** (odd integer) = -( +0 ** (odd integer) ) + * 15. +INF ** (+anything except 0,NAN) is +INF + * 16. +INF ** (-anything except 0,NAN) is +0 + * 17. -INF ** (anything) = -0 ** (-anything) + * 18. (-anything) ** (integer) is (-1)**(integer)*(+anything**integer) + * 19. (-anything except 0 and inf) ** (non-integer) is NAN + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "math_private.h" + +static const long double bp[] = { + 1.0L, + 1.5L, +}; + +/* log_2(1.5) */ +static const long double dp_h[] = { + 0.0, + 5.8496250072115607565592654282227158546448E-1L +}; + +/* Low part of log_2(1.5) */ +static const long double dp_l[] = { + 0.0, + 1.0579781240112554492329533686862998106046E-16L +}; + +static const long double zero = 0.0L, + one = 1.0L, + two = 2.0L, + two113 = 1.0384593717069655257060992658440192E34L, + huge = 1.0e3000L, + tiny = 1.0e-3000L; + +/* 3/2 log x = 3 z + z^3 + z^3 (z^2 R(z^2)) + z = (x-1)/(x+1) + 1 <= x <= 1.25 + Peak relative error 2.3e-37 */ +static const long double LN[] = +{ + -3.0779177200290054398792536829702930623200E1L, + 6.5135778082209159921251824580292116201640E1L, + -4.6312921812152436921591152809994014413540E1L, + 1.2510208195629420304615674658258363295208E1L, + -9.9266909031921425609179910128531667336670E-1L +}; +static const long double LD[] = +{ + -5.129862866715009066465422805058933131960E1L, + 1.452015077564081884387441590064272782044E2L, + -1.524043275549860505277434040464085593165E2L, + 7.236063513651544224319663428634139768808E1L, + -1.494198912340228235853027849917095580053E1L + /* 1.0E0 */ +}; + +/* exp(x) = 1 + x - x / (1 - 2 / (x - x^2 R(x^2))) + 0 <= x <= 0.5 + Peak relative error 5.7e-38 */ +static const long double PN[] = +{ + 5.081801691915377692446852383385968225675E8L, + 9.360895299872484512023336636427675327355E6L, + 4.213701282274196030811629773097579432957E4L, + 5.201006511142748908655720086041570288182E1L, + 9.088368420359444263703202925095675982530E-3L, +}; +static const long double PD[] = +{ + 3.049081015149226615468111430031590411682E9L, + 1.069833887183886839966085436512368982758E8L, + 8.259257717868875207333991924545445705394E5L, + 1.872583833284143212651746812884298360922E3L, + /* 1.0E0 */ +}; + +static const long double + /* ln 2 */ + lg2 = 6.9314718055994530941723212145817656807550E-1L, + lg2_h = 6.9314718055994528622676398299518041312695E-1L, + lg2_l = 2.3190468138462996154948554638754786504121E-17L, + ovt = 8.0085662595372944372e-0017L, + /* 2/(3*log(2)) */ + cp = 9.6179669392597560490661645400126142495110E-1L, + cp_h = 9.6179669392597555432899980587535537779331E-1L, + cp_l = 5.0577616648125906047157785230014751039424E-17L; + +long double +powl(long double x, long double y) +{ + long double z, ax, z_h, z_l, p_h, p_l; + long double yy1, t1, t2, r, s, t, u, v, w; + long double s2, s_h, s_l, t_h, t_l; + int32_t i, j, k, yisint, n; + u_int32_t ix, iy; + int32_t hx, hy; + ieee_quad_shape_type o, p, q; + + p.value = x; + hx = p.parts32.mswhi; + ix = hx & 0x7fffffff; + + q.value = y; + hy = q.parts32.mswhi; + iy = hy & 0x7fffffff; + + + /* y==zero: x**0 = 1 */ + if ((iy | q.parts32.mswlo | q.parts32.lswhi | q.parts32.lswlo) == 0) + return one; + + /* 1.0**y = 1; -1.0**+-Inf = 1 */ + if (x == one) + return one; + if (x == -1.0L && iy == 0x7fff0000 + && (q.parts32.mswlo | q.parts32.lswhi | q.parts32.lswlo) == 0) + return one; + + /* +-NaN return x+y */ + if ((ix > 0x7fff0000) + || ((ix == 0x7fff0000) + && ((p.parts32.mswlo | p.parts32.lswhi | p.parts32.lswlo) != 0)) + || (iy > 0x7fff0000) + || ((iy == 0x7fff0000) + && ((q.parts32.mswlo | q.parts32.lswhi | q.parts32.lswlo) != 0))) + return x + y; + + /* determine if y is an odd int when x < 0 + * yisint = 0 ... y is not an integer + * yisint = 1 ... y is an odd int + * yisint = 2 ... y is an even int + */ + yisint = 0; + if (hx < 0) + { + if (iy >= 0x40700000) /* 2^113 */ + yisint = 2; /* even integer y */ + else if (iy >= 0x3fff0000) /* 1.0 */ + { + if (floorl (y) == y) + { + z = 0.5 * y; + if (floorl (z) == z) + yisint = 2; + else + yisint = 1; + } + } + } + + /* special value of y */ + if ((q.parts32.mswlo | q.parts32.lswhi | q.parts32.lswlo) == 0) + { + if (iy == 0x7fff0000) /* y is +-inf */ + { + if (((ix - 0x3fff0000) | p.parts32.mswlo | p.parts32.lswhi | + p.parts32.lswlo) == 0) + return y - y; /* +-1**inf is NaN */ + else if (ix >= 0x3fff0000) /* (|x|>1)**+-inf = inf,0 */ + return (hy >= 0) ? y : zero; + else /* (|x|<1)**-,+inf = inf,0 */ + return (hy < 0) ? -y : zero; + } + if (iy == 0x3fff0000) + { /* y is +-1 */ + if (hy < 0) + return one / x; + else + return x; + } + if (hy == 0x40000000) + return x * x; /* y is 2 */ + if (hy == 0x3ffe0000) + { /* y is 0.5 */ + if (hx >= 0) /* x >= +0 */ + return sqrtl (x); + } + } + + ax = fabsl (x); + /* special value of x */ + if ((p.parts32.mswlo | p.parts32.lswhi | p.parts32.lswlo) == 0) + { + if (ix == 0x7fff0000 || ix == 0 || ix == 0x3fff0000) + { + z = ax; /*x is +-0,+-inf,+-1 */ + if (hy < 0) + z = one / z; /* z = (1/|x|) */ + if (hx < 0) + { + if (((ix - 0x3fff0000) | yisint) == 0) + { + z = (z - z) / (z - z); /* (-1)**non-int is NaN */ + } + else if (yisint == 1) + z = -z; /* (x<0)**odd = -(|x|**odd) */ + } + return z; + } + } + + /* (x<0)**(non-int) is NaN */ + if (((((u_int32_t) hx >> 31) - 1) | yisint) == 0) + return (x - x) / (x - x); + + /* |y| is huge. + 2^-16495 = 1/2 of smallest representable value. + If (1 - 1/131072)^y underflows, y > 1.4986e9 */ + if (iy > 0x401d654b) + { + /* if (1 - 2^-113)^y underflows, y > 1.1873e38 */ + if (iy > 0x407d654b) + { + if (ix <= 0x3ffeffff) + return (hy < 0) ? huge * huge : tiny * tiny; + if (ix >= 0x3fff0000) + return (hy > 0) ? huge * huge : tiny * tiny; + } + /* over/underflow if x is not close to one */ + if (ix < 0x3ffeffff) + return (hy < 0) ? huge * huge : tiny * tiny; + if (ix > 0x3fff0000) + return (hy > 0) ? huge * huge : tiny * tiny; + } + + n = 0; + /* take care subnormal number */ + if (ix < 0x00010000) + { + ax *= two113; + n -= 113; + o.value = ax; + ix = o.parts32.mswhi; + } + n += ((ix) >> 16) - 0x3fff; + j = ix & 0x0000ffff; + /* determine interval */ + ix = j | 0x3fff0000; /* normalize ix */ + if (j <= 0x3988) + k = 0; /* |x|> 31) - 1) | (yisint - 1)) == 0) + s = -one; /* (-ve)**(odd int) */ + + /* split up y into yy1+y2 and compute (yy1+y2)*(t1+t2) */ + yy1 = y; + o.value = yy1; + o.parts32.lswlo = 0; + o.parts32.lswhi &= 0xf8000000; + yy1 = o.value; + p_l = (y - yy1) * t1 + y * t2; + p_h = yy1 * t1; + z = p_l + p_h; + o.value = z; + j = o.parts32.mswhi; + if (j >= 0x400d0000) /* z >= 16384 */ + { + /* if z > 16384 */ + if (((j - 0x400d0000) | o.parts32.mswlo | o.parts32.lswhi | + o.parts32.lswlo) != 0) + return s * huge * huge; /* overflow */ + else + { + if (p_l + ovt > z - p_h) + return s * huge * huge; /* overflow */ + } + } + else if ((j & 0x7fffffff) >= 0x400d01b9) /* z <= -16495 */ + { + /* z < -16495 */ + if (((j - 0xc00d01bc) | o.parts32.mswlo | o.parts32.lswhi | + o.parts32.lswlo) + != 0) + return s * tiny * tiny; /* underflow */ + else + { + if (p_l <= z - p_h) + return s * tiny * tiny; /* underflow */ + } + } + /* compute 2**(p_h+p_l) */ + i = j & 0x7fffffff; + k = (i >> 16) - 0x3fff; + n = 0; + if (i > 0x3ffe0000) + { /* if |z| > 0.5, set n = [z+0.5] */ + n = floorl (z + 0.5L); + t = n; + p_h -= t; + } + t = p_l + p_h; + o.value = t; + o.parts32.lswlo = 0; + o.parts32.lswhi &= 0xf8000000; + t = o.value; + u = t * lg2_h; + v = (p_l - (t - p_h)) * lg2 + t * lg2_l; + z = u + v; + w = v - (z - u); + /* exp(z) */ + t = z * z; + u = PN[0] + t * (PN[1] + t * (PN[2] + t * (PN[3] + t * PN[4]))); + v = PD[0] + t * (PD[1] + t * (PD[2] + t * (PD[3] + t))); + t1 = z - t * u / v; + r = (z * t1) / (t1 - two) - (w + z * w); + z = one - (r - z); + o.value = z; + j = o.parts32.mswhi; + j += (n << 16); + if ((j >> 16) <= 0) + z = scalbnl (z, n); /* subnormal output */ + else + { + o.parts32.mswhi = j; + z = o.value; + } + return s * z; +} Copied and modified: stable/11/lib/msun/ld80/e_powl.c (from r336299, head/lib/msun/ld80/e_powl.c) ============================================================================== --- head/lib/msun/ld80/e_powl.c Sun Jul 15 00:23:10 2018 (r336299, copy source) +++ stable/11/lib/msun/ld80/e_powl.c Fri Jul 27 17:39:36 2018 (r336767) @@ -14,6 +14,52 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "math_private.h" + +/* + * Polynomial evaluator: + * P[0] x^n + P[1] x^(n-1) + ... + P[n] + */ +static inline long double +__polevll(long double x, long double *PP, int n) +{ + long double y; + long double *P; + + P = PP; + y = *P++; + do { + y = y * x + *P++; + } while (--n); + + return (y); +} + +/* + * Polynomial evaluator: + * x^n + P[0] x^(n-1) + P[1] x^(n-2) + ... + P[n] + */ +static inline long double +__p1evll(long double x, long double *PP, int n) +{ + long double y; + long double *P; + + P = PP; + n -= 1; + y = x + *P++; + do { + y = y * x + *P++; + } while (--n); + + return (y); +} + /* powl.c * * Power function, long double precision @@ -467,7 +513,7 @@ return( z ); /* Find a multiple of 1/NXT that is within 1/NXT of x. */ -static long double +static inline long double reducl(long double x) { long double t; Modified: stable/11/lib/msun/man/cacos.3 ============================================================================== --- stable/11/lib/msun/man/cacos.3 Fri Jul 27 16:13:06 2018 (r336766) +++ stable/11/lib/msun/man/cacos.3 Fri Jul 27 17:39:36 2018 (r336767) @@ -136,9 +136,9 @@ corresponding ranges for the return values, adopted by .It Sy Function Ta Sy Branch Cut(s) Ta Sy Range .It cacos Ta (-\*(If, -1) \*(Un (1, \*(If) Ta [0, \*(Pi] .It casin Ta (-\*(If, -1) \*(Un (1, \*(If) Ta [-\*(Pi/2, \*(Pi/2] -.It catan Ta (-\*(If*I, -i) \*(Un (I, \*(If*I) Ta [-\*(Pi/2, \*(Pi/2] +.It catan Ta (-\*(If*I, -I) \*(Un (I, \*(If*I) Ta [-\*(Pi/2, \*(Pi/2] .It cacosh Ta (-\*(If, 1) Ta [-\*(Pi*I, \*(Pi*I] -.It casinh Ta (-\*(If*I, -i) \*(Un (I, \*(If*I) Ta [-\*(Pi/2*I, \*(Pi/2*I] +.It casinh Ta (-\*(If*I, -I) \*(Un (I, \*(If*I) Ta [-\*(Pi/2*I, \*(Pi/2*I] .It catanh Ta (-\*(If, -1) \*(Un (1, \*(If) Ta [-\*(Pi/2*I, \*(Pi/2*I] .El .Sh SEE ALSO Modified: stable/11/lib/msun/man/clog.3 ============================================================================== --- stable/11/lib/msun/man/clog.3 Fri Jul 27 16:13:06 2018 (r336766) +++ stable/11/lib/msun/man/clog.3 Fri Jul 27 17:39:36 2018 (r336767) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2017 +.Dd June 6, 2018 .Dt CLOG 3 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nm clogf , and .Nm clogl -.Nd complex natural logrithm functions +.Nd complex natural logarithm functions .Sh LIBRARY .Lb libm .Sh SYNOPSIS @@ -47,9 +47,9 @@ and The .Fn clog , .Fn clogf , -and +and .Fn clogl -functions compute the complex natural logrithm of +functions compute the complex natural logarithm of .Fa z . with a branch cut along the negative real axis . .Sh RETURN VALUES @@ -58,14 +58,13 @@ The function returns the complex natural logarithm value, in the range of a strip mathematically unbounded along the real axis and in the interval [-I* \*(Pi , +I* \*(Pi ] along the imaginary axis. -The function satisfies the relationship: +The function satisfies the relationship: .Fo clog .Fn conj "z" Fc = .Fo conj .Fn clog "z" Fc . .Pp - .\" Table is formatted for an 80-column xterm. .Bl -column ".Sy +\*(If + I*\*(Na" ".Sy Return value" ".Sy Divide-by-zero exception" .It Sy Argument Ta Sy Return value Ta Sy Comment @@ -86,9 +85,8 @@ The function satisfies the relationship: .It Ta Ta floating-point exception .It Ta Ta for finite y .It \*(Na + I*\*(If Ta +\*(If + I*\*(Na -.It \*(Na + I*\*(Na Ta \*(Na + I*\*(Na +.It \*(Na + I*\*(Na Ta \*(Na + I*\*(Na .El - .Sh SEE ALSO .Xr complex 3 , .Xr log 3 , Modified: stable/11/lib/msun/man/complex.3 ============================================================================== --- stable/11/lib/msun/man/complex.3 Fri Jul 27 16:13:06 2018 (r336766) +++ stable/11/lib/msun/man/complex.3 Fri Jul 27 17:39:36 2018 (r336767) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2018 +.Dd June 19, 2018 .Dt COMPLEX 3 .Os .Sh NAME @@ -63,28 +63,28 @@ and .Fn cabsl "long double complex z" , respectively. .de Cl -.Bl -column "csqrt" "complex absolute value (i.e. norm, modulus, magnitude)" +.Bl -column "csqrt" "complex absolute value (i.e., norm, modulus, magnitude)" .Em "Name Description" .. .\" Section 7.3.5 - 7.3.7 of ISO C99 standard unimplemented, see BUGS .\" Section 7.3.8 of ISO C99 standard .Ss Absolute-value Functions .Cl -cabs complex absolute value (i.e. norm, modulus, magnitude) +cabs complex absolute value (i.e., norm, modulus, magnitude) csqrt complex square root .El .Ss Exponential Function .Cl cexp exponential base e .El -.Ss Natural logrithm Function +.Ss Natural logarithm Function .Cl -clog natural logrithm +clog natural logarithm .El .\" Section 7.3.9 of ISO C99 standard .Ss Manipulation Functions .Cl -carg compute the argument (i.e. phase angle) +carg compute the argument (i.e., phase angle) cimag compute the imaginary part conj compute the complex conjugate cproj compute projection onto Riemann sphere @@ -101,6 +101,7 @@ catan arc tangent catanh arc hyperbolic tangent ccos cosine ccosh hyperbolic cosine +cpow power function csin sine csinh hyperbolic sine ctan tangent @@ -120,7 +121,3 @@ The .In complex.h functions described here conform to .St -isoC-99 . -.Sh BUGS -The power functions -.Fn cpow -are not implemented. Copied: stable/11/lib/msun/man/cpow.3 (from r336299, head/lib/msun/man/cpow.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/msun/man/cpow.3 Fri Jul 27 17:39:36 2018 (r336767, copy of r336299, head/lib/msun/man/cpow.3) @@ -0,0 +1,63 @@ +.\" Copyright (c) 2011 Martynas Venckus +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" $FreeBSD$ +.\" +.Dd $Mdocdate: June 5 2013 $ +.Dt CPOW 3 +.Os +.Sh NAME +.Nm cpow , +.Nm cpowf , +.Nm cpowl +.Nd complex power functions +.Sh SYNOPSIS +.In complex.h +.Ft double complex +.Fn cpow "double complex x" "double complex z" +.Ft float complex +.Fn cpowf "float complex x" "float complex z" +.Ft long double complex +.Fn cpowl "long double complex x" "long double complex z" +.Sh DESCRIPTION +The +.Fn cpow , +.Fn cpowf +and +.Fn cpowl +functions compute the complex number +.Fa x +raised to the complex power +.Fa z , +with a branch cut along the negative real axis for the first argument. +.Sh RETURN VALUES +The +.Fn cpow , +.Fn cpowf +and +.Fn cpowl +functions return the complex number +.Fa x +raised to the complex power +.Fa z . +.Sh SEE ALSO +.Xr cexp 3 , +.Xr clog 3 +.Sh STANDARDS +The +.Fn cpow , +.Fn cpowf +and +.Fn cpowl +functions conform to +.St -isoC-99 . Modified: stable/11/lib/msun/man/exp.3 ============================================================================== --- stable/11/lib/msun/man/exp.3 Fri Jul 27 16:13:06 2018 (r336766) +++ stable/11/lib/msun/man/exp.3 Fri Jul 27 17:39:36 2018 (r336767) @@ -180,16 +180,9 @@ If 0**0 = 1, then then \*(Na**0 = 1 too because x**0 = 1 for all finite and infinite x, i.e., independently of x. .El -.Sh BUGS -To conform with newer C/C++ standards, a stub implementation for -.Nm powl -was committed to the math library, where -.Nm powl -is mapped to -.Nm pow . -Thus, the numerical accuracy is at most that of the 53-bit double -precision implementation. .Sh SEE ALSO +.Xr clog 3 +.Xr cpow 3 .Xr fenv 3 , .Xr ldexp 3 , .Xr log 3 , Modified: stable/11/lib/msun/src/e_atan2.c ============================================================================== --- stable/11/lib/msun/src/e_atan2.c Fri Jul 27 16:13:06 2018 (r336766) +++ stable/11/lib/msun/src/e_atan2.c Fri Jul 27 17:39:36 2018 (r336767) @@ -71,7 +71,7 @@ __ieee754_atan2(double y, double x) if(((ix|((lx|-lx)>>31))>0x7ff00000)|| ((iy|((ly|-ly)>>31))>0x7ff00000)) /* x or y is NaN */ return x+y; - if((hx-0x3ff00000|lx)==0) return atan(y); /* x=1.0 */ + if(hx==0x3ff00000&&lx==0) return atan(y); /* x=1.0 */ m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */ /* when y = 0 */ Modified: stable/11/lib/msun/src/e_pow.c ============================================================================== --- stable/11/lib/msun/src/e_pow.c Fri Jul 27 16:13:06 2018 (r336766) +++ stable/11/lib/msun/src/e_pow.c Fri Jul 27 17:39:36 2018 (r336767) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); * to produce the hexadecimal values shown. */ +#include #include "math.h" #include "math_private.h" @@ -307,3 +308,7 @@ __ieee754_pow(double x, double y) else SET_HIGH_WORD(z,j); return s*z; } + +#if (LDBL_MANT_DIG == 53) +__weak_reference(pow, powl); +#endif Modified: stable/11/lib/msun/src/imprecise.c ============================================================================== --- stable/11/lib/msun/src/imprecise.c Fri Jul 27 16:13:06 2018 (r336766) +++ stable/11/lib/msun/src/imprecise.c Fri Jul 27 17:39:36 2018 (r336767) @@ -48,14 +48,6 @@ __weak_reference(imprecise_## x, x);\ WARN_IMPRECISE(x) -long double -imprecise_powl(long double x, long double y) -{ - - return pow(x, y); -} -DECLARE_WEAK(powl); - #define DECLARE_IMPRECISE(f) \ long double imprecise_ ## f ## l(long double v) { return f(v); }\ DECLARE_WEAK(f ## l) Modified: stable/11/lib/msun/src/math_private.h ============================================================================== --- stable/11/lib/msun/src/math_private.h Fri Jul 27 16:13:06 2018 (r336766) +++ stable/11/lib/msun/src/math_private.h Fri Jul 27 17:39:36 2018 (r336767) @@ -48,6 +48,47 @@ #define IEEE_WORD_ORDER BYTE_ORDER #endif +/* A union which permits us to convert between a long double and + four 32 bit ints. */ + +#if IEEE_WORD_ORDER == BIG_ENDIAN + +typedef union +{ + long double value; + struct { + u_int32_t mswhi; + u_int32_t mswlo; + u_int32_t lswhi; + u_int32_t lswlo; + } parts32; + struct { + u_int64_t msw; + u_int64_t lsw; + } parts64; +} ieee_quad_shape_type; + +#endif + +#if IEEE_WORD_ORDER == LITTLE_ENDIAN + +typedef union +{ + long double value; + struct { + u_int32_t lswlo; + u_int32_t lswhi; + u_int32_t mswlo; + u_int32_t mswhi; + } parts32; + struct { + u_int64_t lsw; + u_int64_t msw; + } parts64; +} ieee_quad_shape_type; + +#endif + #if IEEE_WORD_ORDER == BIG_ENDIAN typedef union Copied and modified: stable/11/lib/msun/src/s_cpow.c (from r336299, head/lib/msun/src/s_cpow.c) ============================================================================== --- head/lib/msun/src/s_cpow.c Sun Jul 15 00:23:10 2018 (r336299, copy source) +++ stable/11/lib/msun/src/s_cpow.c Fri Jul 27 17:39:36 2018 (r336767) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include "math_private.h" double complex cpow(double complex a, double complex z) @@ -60,7 +61,7 @@ cpow(double complex a, double complex z) y = cimag (z); absa = cabs (a); if (absa == 0.0) { - return (0.0 + 0.0 * I); + return (CMPLX(0.0, 0.0)); } arga = carg (a); r = pow (absa, x); @@ -69,6 +70,6 @@ cpow(double complex a, double complex z) r = r * exp (-y * arga); theta = theta + y * log (absa); } - w = r * cos (theta) + (r * sin (theta)) * I; + w = CMPLX(r * cos (theta), r * sin (theta)); return (w); } Copied and modified: stable/11/lib/msun/src/s_cpowf.c (from r336299, head/lib/msun/src/s_cpowf.c) ============================================================================== --- head/lib/msun/src/s_cpowf.c Sun Jul 15 00:23:10 2018 (r336299, copy source) +++ stable/11/lib/msun/src/s_cpowf.c Fri Jul 27 17:39:36 2018 (r336767) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "math_private.h" float complex cpowf(float complex a, float complex z) @@ -59,7 +60,7 @@ cpowf(float complex a, float complex z) y = cimagf(z); absa = cabsf (a); if (absa == 0.0f) { - return (0.0f + 0.0f * I); + return (CMPLXF(0.0f, 0.0f)); } arga = cargf (a); r = powf (absa, x); @@ -68,6 +69,6 @@ cpowf(float complex a, float complex z) r = r * expf (-y * arga); theta = theta + y * logf (absa); } - w = r * cosf (theta) + (r * sinf (theta)) * I; + w = CMPLXF(r * cosf (theta), r * sinf (theta)); return (w); } Copied and modified: stable/11/lib/msun/src/s_cpowl.c (from r336299, head/lib/msun/src/s_cpowl.c) ============================================================================== --- head/lib/msun/src/s_cpowl.c Sun Jul 15 00:23:10 2018 (r336299, copy source) +++ stable/11/lib/msun/src/s_cpowl.c Fri Jul 27 17:39:36 2018 (r336767) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "math_private.h" long double complex cpowl(long double complex a, long double complex z) @@ -59,7 +60,7 @@ cpowl(long double complex a, long double complex z) y = cimagl(z); absa = cabsl(a); if (absa == 0.0L) { - return (0.0L + 0.0L * I); + return (CMPLXL(0.0L, 0.0L)); } arga = cargl(a); r = powl(absa, x); @@ -68,6 +69,6 @@ cpowl(long double complex a, long double complex z) r = r * expl(-y * arga); theta = theta + y * logl(absa); } - w = r * cosl(theta) + (r * sinl(theta)) * I; + w = CMPLXL(r * cosl(theta), r * sinl(theta)); return (w); } From owner-svn-src-stable@freebsd.org Fri Jul 27 18:26:39 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C4F1052F44; Fri, 27 Jul 2018 18:26:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B50D81243; Fri, 27 Jul 2018 18:26:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 586791B77E; Fri, 27 Jul 2018 18:26:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6RIQdd9014060; Fri, 27 Jul 2018 18:26:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6RIQdEM014059; Fri, 27 Jul 2018 18:26:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201807271826.w6RIQdEM014059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Jul 2018 18:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336769 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/scsi X-SVN-Commit-Revision: 336769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2018 18:26:40 -0000 Author: mav Date: Fri Jul 27 18:26:38 2018 New Revision: 336769 URL: https://svnweb.freebsd.org/changeset/base/336769 Log: MFC r308296 (by scottl): asc/ascq 44/0 is typically a non-transient, permanent error (at least until the components are reset). Therefore retries are pointless. This is very visible in SATL systems, for example an LSI SAS controller and a SATA HDD/SSD. Modified: stable/11/sys/cam/scsi/scsi_all.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.c Fri Jul 27 18:18:20 2018 (r336768) +++ stable/11/sys/cam/scsi/scsi_all.c Fri Jul 27 18:26:38 2018 (r336769) @@ -2327,7 +2327,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x43, 0x00, SS_RDEF, "Message error") }, /* DTLPWROMAEBKVF */ - { SST(0x44, 0x00, SS_RDEF, + { SST(0x44, 0x00, SS_FATAL | EIO, "Internal target failure") }, /* DT P MAEBKVF */ { SST(0x44, 0x01, SS_RDEF, /* XXX TBD */ From owner-svn-src-stable@freebsd.org Sat Jul 28 07:37:02 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 810C61044B48; Sat, 28 Jul 2018 07:37:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DE6F7F615; Sat, 28 Jul 2018 07:37:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D0C323A80; Sat, 28 Jul 2018 07:37:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6S7b1Se025453; Sat, 28 Jul 2018 07:37:01 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6S7b12F025452; Sat, 28 Jul 2018 07:37:01 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201807280737.w6S7b12F025452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 28 Jul 2018 07:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336805 - in stable/11: share/man/man4 sys/dev/vt/hw/vga X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/vt/hw/vga X-SVN-Commit-Revision: 336805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2018 07:37:02 -0000 Author: eadler Date: Sat Jul 28 07:37:01 2018 New Revision: 336805 URL: https://svnweb.freebsd.org/changeset/base/336805 Log: MFC r335629: vt: add option to ignore NO_VGA flag in ACPI To workaround buggy firmware that sets this flag when there's actually a VGA present. Ref D16003 PR: 229235 Modified: stable/11/share/man/man4/vt.4 stable/11/sys/dev/vt/hw/vga/vt_vga.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/vt.4 ============================================================================== --- stable/11/share/man/man4/vt.4 Sat Jul 28 06:46:10 2018 (r336804) +++ stable/11/share/man/man4/vt.4 Sat Jul 28 07:37:01 2018 (r336805) @@ -44,6 +44,7 @@ In .Xr loader.conf 5 : .Cd hw.vga.textmode=1 +.Cd hw.vga.acpi_ignore_no_vga=1 .Cd kern.vty=vt .Cd kern.vt.color..rgb="" .Cd kern.vt.fb.default_mode="x" @@ -196,6 +197,10 @@ prompt or in Set to 1 to use virtual terminals in text mode instead of graphics mode. Features that require graphics mode, like loadable fonts, will be disabled. +.It Va hw.vga.acpi_ignore_no_vga +Set to 1 to force the usage of the VGA driver regardless of whether +ACPI IAPC_BOOT_ARCH signals no VGA support. +Can be used to workaround firmware bugs in the ACPI tables. .It Va kern.vty Set this value to .Ql vt Modified: stable/11/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- stable/11/sys/dev/vt/hw/vga/vt_vga.c Sat Jul 28 06:46:10 2018 (r336804) +++ stable/11/sys/dev/vt/hw/vga/vt_vga.c Sat Jul 28 07:37:01 2018 (r336805) @@ -1211,6 +1211,12 @@ vga_acpi_disabled(void) ACPI_TABLE_FADT *fadt; vm_paddr_t physaddr; uint16_t flags; + int ignore; + + TUNABLE_INT_FETCH("hw.vga.acpi_ignore_no_vga", &ignore); + + if (ignore) + return (false); physaddr = acpi_find_table(ACPI_SIG_FADT); if (physaddr == 0) From owner-svn-src-stable@freebsd.org Sat Jul 28 20:29:07 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAB8D105D585; Sat, 28 Jul 2018 20:29:07 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E2E57F8BA; Sat, 28 Jul 2018 20:29:07 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40D2A3D77; Sat, 28 Jul 2018 20:29:07 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6SKT7mK032615; Sat, 28 Jul 2018 20:29:07 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6SKT5JM032607; Sat, 28 Jul 2018 20:29:05 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807282029.w6SKT5JM032607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 28 Jul 2018 20:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336842 - in stable/11/sys/fs: nfs nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/11/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 336842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2018 20:29:07 -0000 Author: rmacklem Date: Sat Jul 28 20:29:05 2018 New Revision: 336842 URL: https://svnweb.freebsd.org/changeset/base/336842 Log: MFC: r334492 Add the BindConnectiontoSession operation to the NFSv4.1 server. Under some fairly unusual circumstances, the Linux NFSv4.1 client is doing a BindConnectiontoSession operation for TCP connections. It is also used by the ESXi6.5 NFSv4.1 client. This patch adds this operation to the NFSv4.1 server. PR: 226493 Modified: stable/11/sys/fs/nfs/nfs.h stable/11/sys/fs/nfs/nfs_commonsubs.c stable/11/sys/fs/nfs/nfs_var.h stable/11/sys/fs/nfs/nfsproto.h stable/11/sys/fs/nfsserver/nfs_nfsdserv.c stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfs/nfs.h ============================================================================== --- stable/11/sys/fs/nfs/nfs.h Sat Jul 28 20:26:25 2018 (r336841) +++ stable/11/sys/fs/nfs/nfs.h Sat Jul 28 20:29:05 2018 (r336842) @@ -288,6 +288,7 @@ struct nfsreferral { #define LCL_ADMINREVOKED 0x00008000 #define LCL_RECLAIMCOMPLETE 0x00010000 #define LCL_NFSV41 0x00020000 +#define LCL_DONEBINDCONN 0x00040000 #define LCL_GSS LCL_KERBV /* Or of all mechs */ Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonsubs.c Sat Jul 28 20:26:25 2018 (r336841) +++ stable/11/sys/fs/nfs/nfs_commonsubs.c Sat Jul 28 20:29:05 2018 (r336842) @@ -139,7 +139,7 @@ struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS] = { { 0, 2, 1, 1, LK_EXCLUSIVE, 1, 0 }, /* Write */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* ReleaseLockOwner */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Backchannel Ctrl */ - { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Bind Conn to Sess */ + { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Bind Conn to Sess */ { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Exchange ID */ { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Create Session */ { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Destroy Session */ Modified: stable/11/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/11/sys/fs/nfs/nfs_var.h Sat Jul 28 20:26:25 2018 (r336841) +++ stable/11/sys/fs/nfs/nfs_var.h Sat Jul 28 20:29:05 2018 (r336842) @@ -95,6 +95,7 @@ int nfsrv_getclient(nfsquad_t, int, struct nfsclient * nfsquad_t, uint32_t, struct nfsrv_descript *, NFSPROC_T *); int nfsrv_destroyclient(nfsquad_t, NFSPROC_T *); int nfsrv_destroysession(struct nfsrv_descript *, uint8_t *); +int nfsrv_bindconnsess(struct nfsrv_descript *, uint8_t *, int *); int nfsrv_freestateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *); int nfsrv_teststateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *); int nfsrv_adminrevoke(struct nfsd_clid *, NFSPROC_T *); @@ -230,6 +231,8 @@ int nfsrvd_sequence(struct nfsrv_descript *, int, int nfsrvd_reclaimcomplete(struct nfsrv_descript *, int, vnode_t, NFSPROC_T *, struct nfsexstuff *); int nfsrvd_destroyclientid(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_bindconnsess(struct nfsrv_descript *, int, vnode_t, NFSPROC_T *, struct nfsexstuff *); int nfsrvd_destroysession(struct nfsrv_descript *, int, vnode_t, NFSPROC_T *, struct nfsexstuff *); Modified: stable/11/sys/fs/nfs/nfsproto.h ============================================================================== --- stable/11/sys/fs/nfs/nfsproto.h Sat Jul 28 20:26:25 2018 (r336841) +++ stable/11/sys/fs/nfs/nfsproto.h Sat Jul 28 20:29:05 2018 (r336842) @@ -650,6 +650,15 @@ #define NFSFLAYUTIL_DENSE 0x1 #define NFSFLAYUTIL_COMMIT_THRU_MDS 0x2 +/* Enum values for Bind Connection to Session. */ +#define NFSCDFC4_FORE 0x1 +#define NFSCDFC4_BACK 0x2 +#define NFSCDFC4_FORE_OR_BOTH 0x3 +#define NFSCDFC4_BACK_OR_BOTH 0x7 +#define NFSCDFS4_FORE 0x1 +#define NFSCDFS4_BACK 0x2 +#define NFSCDFS4_BOTH 0x3 + /* Conversion macros */ #define vtonfsv2_mode(t,m) \ txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \ Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Sat Jul 28 20:26:25 2018 (r336841) +++ stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Sat Jul 28 20:29:05 2018 (r336842) @@ -4051,6 +4051,45 @@ nfsmout: } /* + * nfsv4 bind connection to session service + */ +APPLESTATIC int +nfsrvd_bindconnsess(struct nfsrv_descript *nd, __unused int isdgram, + __unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) +{ + uint32_t *tl; + uint8_t sessid[NFSX_V4SESSIONID]; + int error = 0, foreaft; + + if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { + nd->nd_repstat = NFSERR_WRONGSEC; + goto nfsmout; + } + NFSM_DISSECT(tl, uint32_t *, NFSX_V4SESSIONID + 2 * NFSX_UNSIGNED); + NFSBCOPY(tl, sessid, NFSX_V4SESSIONID); + tl += (NFSX_V4SESSIONID / NFSX_UNSIGNED); + foreaft = fxdr_unsigned(int, *tl++); + if (*tl == newnfs_true) { + /* RDMA is not supported. */ + nd->nd_repstat = NFSERR_NOTSUPP; + goto nfsmout; + } + + nd->nd_repstat = nfsrv_bindconnsess(nd, sessid, &foreaft); + if (nd->nd_repstat == 0) { + NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 2 * + NFSX_UNSIGNED); + NFSBCOPY(sessid, tl, NFSX_V4SESSIONID); + tl += (NFSX_V4SESSIONID / NFSX_UNSIGNED); + *tl++ = txdr_unsigned(foreaft); + *tl = newnfs_false; + } +nfsmout: + NFSEXITCODE2(error, nd); + return (error); +} + +/* * nfsv4 destroy session service */ APPLESTATIC int Modified: stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Jul 28 20:26:25 2018 (r336841) +++ stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Jul 28 20:29:05 2018 (r336842) @@ -176,7 +176,7 @@ int (*nfsrv4_ops0[NFSV41_NOPS])(struct nfsrv_descript nfsrvd_write, nfsrvd_releaselckown, nfsrvd_notsupp, - nfsrvd_notsupp, + nfsrvd_bindconnsess, nfsrvd_exchangeid, nfsrvd_createsession, nfsrvd_destroysession, Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Sat Jul 28 20:26:25 2018 (r336841) +++ stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Sat Jul 28 20:29:05 2018 (r336842) @@ -41,6 +41,7 @@ extern struct nfsstatsv1 nfsstatsv1; extern int nfsrv_lease; extern struct timeval nfsboottime; extern u_int32_t newnfs_true, newnfs_false; +extern int nfsd_debuglevel; NFSV4ROOTLOCKMUTEX; NFSSTATESPINLOCK; @@ -628,10 +629,11 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struc if (nsep != NULL) { /* Hold a reference on the xprt for a backchannel. */ if ((nsep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) - != 0 && clp->lc_req.nr_client == NULL) { - clp->lc_req.nr_client = (struct __rpc_client *) - clnt_bck_create(nd->nd_xprt->xp_socket, - cbprogram, NFSV4_CBVERS); + != 0) { + if (clp->lc_req.nr_client == NULL) + clp->lc_req.nr_client = (struct __rpc_client *) + clnt_bck_create(nd->nd_xprt->xp_socket, + cbprogram, NFSV4_CBVERS); if (clp->lc_req.nr_client != NULL) { SVC_ACQUIRE(nd->nd_xprt); nd->nd_xprt->xp_p2 = @@ -5901,9 +5903,18 @@ nfsrv_checksequence(struct nfsrv_descript *nd, uint32_ /* * If this session handles the backchannel, save the nd_xprt for this * RPC, since this is the one being used. + * RFC-5661 specifies that the fore channel will be implicitly + * bound by a Sequence operation. However, since some NFSv4.1 clients + * erroneously assumed that the back channel would be implicitly + * bound as well, do the implicit binding unless a + * BindConnectiontoSession has already been done on the session. */ if (sep->sess_clp->lc_req.nr_client != NULL && - (sep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0) { + sep->sess_cbsess.nfsess_xprt != nd->nd_xprt && + (sep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0 && + (sep->sess_clp->lc_flags & LCL_DONEBINDCONN) == 0) { + NFSD_DEBUG(2, + "nfsrv_checksequence: implicit back channel bind\n"); savxprt = sep->sess_cbsess.nfsess_xprt; SVC_ACQUIRE(nd->nd_xprt); nd->nd_xprt->xp_p2 = @@ -6033,6 +6044,80 @@ nfsrv_destroysession(struct nfsrv_descript *nd, uint8_ NFSLOCKV4ROOTMUTEX(); nfsv4_unlock(&nfsv4rootfs_lock, 1); NFSUNLOCKV4ROOTMUTEX(); + return (error); +} + +/* + * Bind a connection to a session. + * For now, only certain variants are supported, since the current session + * structure can only handle a single backchannel entry, which will be + * applied to all connections if it is set. + */ +int +nfsrv_bindconnsess(struct nfsrv_descript *nd, uint8_t *sessionid, int *foreaftp) +{ + struct nfssessionhash *shp; + struct nfsdsession *sep; + struct nfsclient *clp; + SVCXPRT *savxprt; + int error; + + error = 0; + shp = NFSSESSIONHASH(sessionid); + NFSLOCKSTATE(); + NFSLOCKSESSION(shp); + sep = nfsrv_findsession(sessionid); + if (sep != NULL) { + clp = sep->sess_clp; + if (*foreaftp == NFSCDFC4_BACK || + *foreaftp == NFSCDFC4_BACK_OR_BOTH || + *foreaftp == NFSCDFC4_FORE_OR_BOTH) { + /* Try to set up a backchannel. */ + if (clp->lc_req.nr_client == NULL) { + NFSD_DEBUG(2, "nfsrv_bindconnsess: acquire " + "backchannel\n"); + clp->lc_req.nr_client = (struct __rpc_client *) + clnt_bck_create(nd->nd_xprt->xp_socket, + sep->sess_cbprogram, NFSV4_CBVERS); + } + if (clp->lc_req.nr_client != NULL) { + NFSD_DEBUG(2, "nfsrv_bindconnsess: set up " + "backchannel\n"); + savxprt = sep->sess_cbsess.nfsess_xprt; + SVC_ACQUIRE(nd->nd_xprt); + nd->nd_xprt->xp_p2 = + clp->lc_req.nr_client->cl_private; + /* Disable idle timeout. */ + nd->nd_xprt->xp_idletimeout = 0; + sep->sess_cbsess.nfsess_xprt = nd->nd_xprt; + if (savxprt != NULL) + SVC_RELEASE(savxprt); + sep->sess_crflags |= NFSV4CRSESS_CONNBACKCHAN; + clp->lc_flags |= LCL_DONEBINDCONN; + if (*foreaftp == NFSCDFS4_BACK) + *foreaftp = NFSCDFS4_BACK; + else + *foreaftp = NFSCDFS4_BOTH; + } else if (*foreaftp != NFSCDFC4_BACK) { + NFSD_DEBUG(2, "nfsrv_bindconnsess: can't set " + "up backchannel\n"); + sep->sess_crflags &= ~NFSV4CRSESS_CONNBACKCHAN; + clp->lc_flags |= LCL_DONEBINDCONN; + *foreaftp = NFSCDFS4_FORE; + } else { + error = NFSERR_NOTSUPP; + printf("nfsrv_bindconnsess: Can't add " + "backchannel\n"); + } + } else { + NFSD_DEBUG(2, "nfsrv_bindconnsess: Set forechannel\n"); + clp->lc_flags |= LCL_DONEBINDCONN; + *foreaftp = NFSCDFS4_FORE; + } + } else + error = NFSERR_BADSESSION; + NFSUNLOCKSESSION(shp); + NFSUNLOCKSTATE(); return (error); } From owner-svn-src-stable@freebsd.org Sat Jul 28 20:38:11 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30FD1105DE04; Sat, 28 Jul 2018 20:38:11 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA21080695; Sat, 28 Jul 2018 20:38:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB27F3F3B; Sat, 28 Jul 2018 20:38:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6SKcASL038067; Sat, 28 Jul 2018 20:38:10 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6SKc9d2038061; Sat, 28 Jul 2018 20:38:09 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807282038.w6SKc9d2038061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 28 Jul 2018 20:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r336846 - in stable/10/sys/fs: nfs nfsserver X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/10/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 336846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2018 20:38:11 -0000 Author: rmacklem Date: Sat Jul 28 20:38:08 2018 New Revision: 336846 URL: https://svnweb.freebsd.org/changeset/base/336846 Log: MFC: r334492 Add the BindConnectiontoSession operation to the NFSv4.1 server. Under some fairly unusual circumstances, the Linux NFSv4.1 client is doing a BindConnectiontoSession operation for TCP connections. It is also used by the ESXi6.5 NFSv4.1 client. This patch adds this operation to the NFSv4.1 server. PR: 226493 Modified: stable/10/sys/fs/nfs/nfs.h stable/10/sys/fs/nfs/nfs_commonsubs.c stable/10/sys/fs/nfs/nfs_var.h stable/10/sys/fs/nfs/nfsproto.h stable/10/sys/fs/nfsserver/nfs_nfsdserv.c stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs.h ============================================================================== --- stable/10/sys/fs/nfs/nfs.h Sat Jul 28 20:36:23 2018 (r336845) +++ stable/10/sys/fs/nfs/nfs.h Sat Jul 28 20:38:08 2018 (r336846) @@ -288,6 +288,7 @@ struct nfsreferral { #define LCL_ADMINREVOKED 0x00008000 #define LCL_RECLAIMCOMPLETE 0x00010000 #define LCL_NFSV41 0x00020000 +#define LCL_DONEBINDCONN 0x00040000 #define LCL_GSS LCL_KERBV /* Or of all mechs */ Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Sat Jul 28 20:36:23 2018 (r336845) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Sat Jul 28 20:38:08 2018 (r336846) @@ -136,7 +136,7 @@ struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS] = { { 0, 2, 1, 1, LK_EXCLUSIVE, 1, 0 }, /* Write */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* ReleaseLockOwner */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Backchannel Ctrl */ - { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Bind Conn to Sess */ + { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Bind Conn to Sess */ { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Exchange ID */ { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Create Session */ { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Destroy Session */ Modified: stable/10/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/10/sys/fs/nfs/nfs_var.h Sat Jul 28 20:36:23 2018 (r336845) +++ stable/10/sys/fs/nfs/nfs_var.h Sat Jul 28 20:38:08 2018 (r336846) @@ -95,6 +95,7 @@ int nfsrv_getclient(nfsquad_t, int, struct nfsclient * nfsquad_t, uint32_t, struct nfsrv_descript *, NFSPROC_T *); int nfsrv_destroyclient(nfsquad_t, NFSPROC_T *); int nfsrv_destroysession(struct nfsrv_descript *, uint8_t *); +int nfsrv_bindconnsess(struct nfsrv_descript *, uint8_t *, int *); int nfsrv_freestateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *); int nfsrv_teststateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *); int nfsrv_adminrevoke(struct nfsd_clid *, NFSPROC_T *); @@ -230,6 +231,8 @@ int nfsrvd_sequence(struct nfsrv_descript *, int, int nfsrvd_reclaimcomplete(struct nfsrv_descript *, int, vnode_t, NFSPROC_T *, struct nfsexstuff *); int nfsrvd_destroyclientid(struct nfsrv_descript *, int, + vnode_t, NFSPROC_T *, struct nfsexstuff *); +int nfsrvd_bindconnsess(struct nfsrv_descript *, int, vnode_t, NFSPROC_T *, struct nfsexstuff *); int nfsrvd_destroysession(struct nfsrv_descript *, int, vnode_t, NFSPROC_T *, struct nfsexstuff *); Modified: stable/10/sys/fs/nfs/nfsproto.h ============================================================================== --- stable/10/sys/fs/nfs/nfsproto.h Sat Jul 28 20:36:23 2018 (r336845) +++ stable/10/sys/fs/nfs/nfsproto.h Sat Jul 28 20:38:08 2018 (r336846) @@ -648,6 +648,15 @@ #define NFSFLAYUTIL_DENSE 0x1 #define NFSFLAYUTIL_COMMIT_THRU_MDS 0x2 +/* Enum values for Bind Connection to Session. */ +#define NFSCDFC4_FORE 0x1 +#define NFSCDFC4_BACK 0x2 +#define NFSCDFC4_FORE_OR_BOTH 0x3 +#define NFSCDFC4_BACK_OR_BOTH 0x7 +#define NFSCDFS4_FORE 0x1 +#define NFSCDFS4_BACK 0x2 +#define NFSCDFS4_BOTH 0x3 + /* Conversion macros */ #define vtonfsv2_mode(t,m) \ txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \ Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Sat Jul 28 20:36:23 2018 (r336845) +++ stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Sat Jul 28 20:38:08 2018 (r336846) @@ -4020,6 +4020,45 @@ nfsmout: } /* + * nfsv4 bind connection to session service + */ +APPLESTATIC int +nfsrvd_bindconnsess(struct nfsrv_descript *nd, __unused int isdgram, + __unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp) +{ + uint32_t *tl; + uint8_t sessid[NFSX_V4SESSIONID]; + int error = 0, foreaft; + + if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { + nd->nd_repstat = NFSERR_WRONGSEC; + goto nfsmout; + } + NFSM_DISSECT(tl, uint32_t *, NFSX_V4SESSIONID + 2 * NFSX_UNSIGNED); + NFSBCOPY(tl, sessid, NFSX_V4SESSIONID); + tl += (NFSX_V4SESSIONID / NFSX_UNSIGNED); + foreaft = fxdr_unsigned(int, *tl++); + if (*tl == newnfs_true) { + /* RDMA is not supported. */ + nd->nd_repstat = NFSERR_NOTSUPP; + goto nfsmout; + } + + nd->nd_repstat = nfsrv_bindconnsess(nd, sessid, &foreaft); + if (nd->nd_repstat == 0) { + NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 2 * + NFSX_UNSIGNED); + NFSBCOPY(sessid, tl, NFSX_V4SESSIONID); + tl += (NFSX_V4SESSIONID / NFSX_UNSIGNED); + *tl++ = txdr_unsigned(foreaft); + *tl = newnfs_false; + } +nfsmout: + NFSEXITCODE2(error, nd); + return (error); +} + +/* * nfsv4 destroy session service */ APPLESTATIC int Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Jul 28 20:36:23 2018 (r336845) +++ stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Jul 28 20:38:08 2018 (r336846) @@ -176,7 +176,7 @@ int (*nfsrv4_ops0[NFSV41_NOPS])(struct nfsrv_descript nfsrvd_write, nfsrvd_releaselckown, nfsrvd_notsupp, - nfsrvd_notsupp, + nfsrvd_bindconnsess, nfsrvd_exchangeid, nfsrvd_createsession, nfsrvd_destroysession, Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Sat Jul 28 20:36:23 2018 (r336845) +++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Sat Jul 28 20:38:08 2018 (r336846) @@ -41,6 +41,7 @@ extern struct nfsstats newnfsstats; extern int nfsrv_lease; extern struct timeval nfsboottime; extern u_int32_t newnfs_true, newnfs_false; +extern int nfsd_debuglevel; NFSV4ROOTLOCKMUTEX; NFSSTATESPINLOCK; @@ -633,10 +634,11 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struc if (nsep != NULL) { /* Hold a reference on the xprt for a backchannel. */ if ((nsep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) - != 0 && clp->lc_req.nr_client == NULL) { - clp->lc_req.nr_client = (struct __rpc_client *) - clnt_bck_create(nd->nd_xprt->xp_socket, - cbprogram, NFSV4_CBVERS); + != 0) { + if (clp->lc_req.nr_client == NULL) + clp->lc_req.nr_client = (struct __rpc_client *) + clnt_bck_create(nd->nd_xprt->xp_socket, + cbprogram, NFSV4_CBVERS); if (clp->lc_req.nr_client != NULL) { SVC_ACQUIRE(nd->nd_xprt); nd->nd_xprt->xp_p2 = @@ -5893,9 +5895,18 @@ nfsrv_checksequence(struct nfsrv_descript *nd, uint32_ /* * If this session handles the backchannel, save the nd_xprt for this * RPC, since this is the one being used. + * RFC-5661 specifies that the fore channel will be implicitly + * bound by a Sequence operation. However, since some NFSv4.1 clients + * erroneously assumed that the back channel would be implicitly + * bound as well, do the implicit binding unless a + * BindConnectiontoSession has already been done on the session. */ if (sep->sess_clp->lc_req.nr_client != NULL && - (sep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0) { + sep->sess_cbsess.nfsess_xprt != nd->nd_xprt && + (sep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0 && + (sep->sess_clp->lc_flags & LCL_DONEBINDCONN) == 0) { + NFSD_DEBUG(2, + "nfsrv_checksequence: implicit back channel bind\n"); savxprt = sep->sess_cbsess.nfsess_xprt; SVC_ACQUIRE(nd->nd_xprt); nd->nd_xprt->xp_p2 = @@ -6025,6 +6036,80 @@ nfsrv_destroysession(struct nfsrv_descript *nd, uint8_ NFSLOCKV4ROOTMUTEX(); nfsv4_unlock(&nfsv4rootfs_lock, 1); NFSUNLOCKV4ROOTMUTEX(); + return (error); +} + +/* + * Bind a connection to a session. + * For now, only certain variants are supported, since the current session + * structure can only handle a single backchannel entry, which will be + * applied to all connections if it is set. + */ +int +nfsrv_bindconnsess(struct nfsrv_descript *nd, uint8_t *sessionid, int *foreaftp) +{ + struct nfssessionhash *shp; + struct nfsdsession *sep; + struct nfsclient *clp; + SVCXPRT *savxprt; + int error; + + error = 0; + shp = NFSSESSIONHASH(sessionid); + NFSLOCKSTATE(); + NFSLOCKSESSION(shp); + sep = nfsrv_findsession(sessionid); + if (sep != NULL) { + clp = sep->sess_clp; + if (*foreaftp == NFSCDFC4_BACK || + *foreaftp == NFSCDFC4_BACK_OR_BOTH || + *foreaftp == NFSCDFC4_FORE_OR_BOTH) { + /* Try to set up a backchannel. */ + if (clp->lc_req.nr_client == NULL) { + NFSD_DEBUG(2, "nfsrv_bindconnsess: acquire " + "backchannel\n"); + clp->lc_req.nr_client = (struct __rpc_client *) + clnt_bck_create(nd->nd_xprt->xp_socket, + sep->sess_cbprogram, NFSV4_CBVERS); + } + if (clp->lc_req.nr_client != NULL) { + NFSD_DEBUG(2, "nfsrv_bindconnsess: set up " + "backchannel\n"); + savxprt = sep->sess_cbsess.nfsess_xprt; + SVC_ACQUIRE(nd->nd_xprt); + nd->nd_xprt->xp_p2 = + clp->lc_req.nr_client->cl_private; + /* Disable idle timeout. */ + nd->nd_xprt->xp_idletimeout = 0; + sep->sess_cbsess.nfsess_xprt = nd->nd_xprt; + if (savxprt != NULL) + SVC_RELEASE(savxprt); + sep->sess_crflags |= NFSV4CRSESS_CONNBACKCHAN; + clp->lc_flags |= LCL_DONEBINDCONN; + if (*foreaftp == NFSCDFS4_BACK) + *foreaftp = NFSCDFS4_BACK; + else + *foreaftp = NFSCDFS4_BOTH; + } else if (*foreaftp != NFSCDFC4_BACK) { + NFSD_DEBUG(2, "nfsrv_bindconnsess: can't set " + "up backchannel\n"); + sep->sess_crflags &= ~NFSV4CRSESS_CONNBACKCHAN; + clp->lc_flags |= LCL_DONEBINDCONN; + *foreaftp = NFSCDFS4_FORE; + } else { + error = NFSERR_NOTSUPP; + printf("nfsrv_bindconnsess: Can't add " + "backchannel\n"); + } + } else { + NFSD_DEBUG(2, "nfsrv_bindconnsess: Set forechannel\n"); + clp->lc_flags |= LCL_DONEBINDCONN; + *foreaftp = NFSCDFS4_FORE; + } + } else + error = NFSERR_BADSESSION; + NFSUNLOCKSESSION(shp); + NFSUNLOCKSTATE(); return (error); } From owner-svn-src-stable@freebsd.org Sat Jul 28 23:34:17 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4A7510618E6; Sat, 28 Jul 2018 23:34:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48E8385B51; Sat, 28 Jul 2018 23:34:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w6SNY5ba055635 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 29 Jul 2018 02:34:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w6SNY5ba055635 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w6SNY5gd055634; Sun, 29 Jul 2018 02:34:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 29 Jul 2018 02:34:05 +0300 From: Konstantin Belousov To: Eitan Adler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r336805 - in stable/11: share/man/man4 sys/dev/vt/hw/vga Message-ID: <20180728233405.GD40119@kib.kiev.ua> References: <201807280737.w6S7b12F025452@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201807280737.w6S7b12F025452@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2018 23:34:17 -0000 On Sat, Jul 28, 2018 at 07:37:01AM +0000, Eitan Adler wrote: > Author: eadler > Date: Sat Jul 28 07:37:01 2018 > New Revision: 336805 > URL: https://svnweb.freebsd.org/changeset/base/336805 > > Log: > MFC r335629: > > vt: add option to ignore NO_VGA flag in ACPI > > To workaround buggy firmware that sets this flag when there's actually > a VGA present. > > Ref D16003 > PR: 229235 > > Modified: > stable/11/share/man/man4/vt.4 > stable/11/sys/dev/vt/hw/vga/vt_vga.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/share/man/man4/vt.4 > ============================================================================== > --- stable/11/share/man/man4/vt.4 Sat Jul 28 06:46:10 2018 (r336804) > +++ stable/11/share/man/man4/vt.4 Sat Jul 28 07:37:01 2018 (r336805) > @@ -44,6 +44,7 @@ > In > .Xr loader.conf 5 : > .Cd hw.vga.textmode=1 > +.Cd hw.vga.acpi_ignore_no_vga=1 > .Cd kern.vty=vt > .Cd kern.vt.color..rgb="" > .Cd kern.vt.fb.default_mode="x" > @@ -196,6 +197,10 @@ prompt or in > Set to 1 to use virtual terminals in text mode instead of graphics mode. > Features that require graphics mode, like loadable fonts, will be > disabled. > +.It Va hw.vga.acpi_ignore_no_vga > +Set to 1 to force the usage of the VGA driver regardless of whether > +ACPI IAPC_BOOT_ARCH signals no VGA support. > +Can be used to workaround firmware bugs in the ACPI tables. > .It Va kern.vty > Set this value to > .Ql vt > > Modified: stable/11/sys/dev/vt/hw/vga/vt_vga.c > ============================================================================== > --- stable/11/sys/dev/vt/hw/vga/vt_vga.c Sat Jul 28 06:46:10 2018 (r336804) > +++ stable/11/sys/dev/vt/hw/vga/vt_vga.c Sat Jul 28 07:37:01 2018 (r336805) > @@ -1211,6 +1211,12 @@ vga_acpi_disabled(void) > ACPI_TABLE_FADT *fadt; > vm_paddr_t physaddr; > uint16_t flags; > + int ignore; > + > + TUNABLE_INT_FETCH("hw.vga.acpi_ignore_no_vga", &ignore); > + > + if (ignore) > + return (false); If the tunable is not set, this code evaluates the stack garbage. Why did you merged this without asking the author and not looking at the followups ? > > physaddr = acpi_find_table(ACPI_SIG_FADT); > if (physaddr == 0)