From owner-svn-src-head@freebsd.org Sun Oct 11 00:01:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF2DF42D374; Sun, 11 Oct 2020 00:01:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C825S5rSSz4QGd; Sun, 11 Oct 2020 00:01:00 +0000 (UTC) (envelope-from bz@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 92FBE1235F; Sun, 11 Oct 2020 00:01:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09B010np081585; Sun, 11 Oct 2020 00:01:00 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09B010sG081584; Sun, 11 Oct 2020 00:01:00 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202010110001.09B010sG081584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 11 Oct 2020 00:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366623 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2020 00:01:01 -0000 Author: bz Date: Sun Oct 11 00:01:00 2020 New Revision: 366623 URL: https://svnweb.freebsd.org/changeset/base/366623 Log: ip_mroute: fix the viftable export sysctl It seems that in r354857 I got more than one thing wrong. Convert the SYSCTL_OPAQUE to a SYSCTL_PROC to properly export the these days allocated and not longer static per-vnet viftable array. This fixes a problem with netstat -g which would show bogus information for the IPv4 Virtual Interface Table. PR: 246626 Reported by: Ozkan KIRIK (ozkan.kirik gmail.com) MFC after: 3 days Modified: head/sys/netinet/ip_mroute.c Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Sat Oct 10 21:52:00 2020 (r366622) +++ head/sys/netinet/ip_mroute.c Sun Oct 11 00:01:00 2020 (r366623) @@ -181,13 +181,6 @@ VNET_DEFINE_STATIC(vifi_t, numvifs); #define V_numvifs VNET(numvifs) VNET_DEFINE_STATIC(struct vif *, viftable); #define V_viftable VNET(viftable) -/* - * No one should be able to "query" this before initialisation happened in - * vnet_mroute_init(), so we should still be fine. - */ -SYSCTL_OPAQUE(_net_inet_ip, OID_AUTO, viftable, CTLFLAG_VNET | CTLFLAG_RD, - &VNET_NAME(viftable), sizeof(*V_viftable) * MAXVIFS, "S,vif[MAXVIFS]", - "IPv4 Multicast Interfaces (struct vif[MAXVIFS], netinet/ip_mroute.h)"); static struct mtx vif_mtx; #define VIF_LOCK() mtx_lock(&vif_mtx) @@ -2805,6 +2798,30 @@ static SYSCTL_NODE(_net_inet_ip, OID_AUTO, mfctable, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_mfctable, "IPv4 Multicast Forwarding Table " "(struct *mfc[mfchashsize], netinet/ip_mroute.h)"); + +static int +sysctl_viflist(SYSCTL_HANDLER_ARGS) +{ + int error; + + if (req->newptr) + return (EPERM); + if (V_viftable == NULL) /* XXX unlocked */ + return (0); + error = sysctl_wire_old_buffer(req, sizeof(*V_viftable) * MAXVIFS); + if (error) + return (error); + + VIF_LOCK(); + error = SYSCTL_OUT(req, V_viftable, sizeof(*V_viftable) * MAXVIFS); + VIF_UNLOCK(); + return (error); +} + +SYSCTL_PROC(_net_inet_ip, OID_AUTO, viftable, + CTLTYPE_OPAQUE | CTLFLAG_VNET | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_viflist, "S,vif[MAXVIFS]", + "IPv4 Multicast Interfaces (struct vif[MAXVIFS], netinet/ip_mroute.h)"); static void vnet_mroute_init(const void *unused __unused) From owner-svn-src-head@freebsd.org Sun Oct 11 09:30:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A73F443D7CD; Sun, 11 Oct 2020 09:30:04 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (gromit.grondar.org [IPv6:2a01:348:e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8Gk40QjTz3g46; Sun, 11 Oct 2020 09:30:03 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from grouter.grondar.org ([88.96.155.38] helo=graphologist.grondar.org) by gromit.grondar.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94 (FreeBSD)) (envelope-from ) id 1kRXfw-000ABy-4h; Sun, 11 Oct 2020 10:29:56 +0100 Content-Type: multipart/signed; boundary="Apple-Mail=_9B2D03C8-8C3C-4934-822F-002B0F10B602"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: svn commit: r366620 - in head/sys: conf dev/random/fenestrasX From: Mark Murray In-Reply-To: <202010102145.09ALjxbF098638@repo.freebsd.org> Date: Sun, 11 Oct 2020 10:29:55 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <577C377E-CEF3-4A43-9276-82A56E5AE2FF@FreeBSD.org> References: <202010102145.09ALjxbF098638@repo.freebsd.org> To: Conrad Meyer X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4C8Gk40QjTz3g46 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:39326, ipnet:2a01:348::/32, country:GB]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2020 09:30:04 -0000 --Apple-Mail=_9B2D03C8-8C3C-4934-822F-002B0F10B602 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On 10 Oct 2020, at 22:45, Conrad Meyer wrote: > > Author: cem > Date: Sat Oct 10 21:45:59 2020 > New Revision: 366620 > URL: https://svnweb.freebsd.org/changeset/base/366620 > > Log: > Add "Fenestras X" alternative /dev/random implementation This is a much needed improvement to the (CS)PRNG, as we are now supporting SMTP architectures with many cores, where this should shine! I have not had the time to do the work myself, so I'm delighted that *someone* got to it! Thanks, Conrad! M -- --Apple-Mail=_9B2D03C8-8C3C-4934-822F-002B0F10B602 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 Comment: GPGTools - http://gpgtools.org iQEzBAEBCgAdFiEEyzPHvybPbOpU9MCxQlsJDh9CUqAFAl+C0JMACgkQQlsJDh9C UqCOmwgAptDqQxYqMYjvUoMVtRW/7q8ASi+wESoJJyQ6PwCWYzkqbDYDXEbehQXP XBD86dY8y2BMQNLReR5tMla06rp1kA6RiN4k6xP9aBt5RCR/euxlW7v0b+0Mq4Y9 CSPQE4q0ehS3EgxYTcZ7B0aQzPdGC/PnFhE7WDI0cwObQSeTdck2XDTgjx58Y3fs EWPuJSyvfZXXXwR78E1qtyoUissxdTW5sqrZevsFffWwO3EH/ZI/rUhEcIqlVI/S iA/vj6FGECcdwgQQOI6QScb743/wpi6WW7hM7SR22LyAH7rTlquwCpWuHanM7AvW 4F4nSTCh/BrAWjE6DMrmNLnf4rpVLA== =WR+t -----END PGP SIGNATURE----- --Apple-Mail=_9B2D03C8-8C3C-4934-822F-002B0F10B602-- From owner-svn-src-head@freebsd.org Sun Oct 11 10:40:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 965E743F6F9; Sun, 11 Oct 2020 10:40:12 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8JH02Q1Gz428B; Sun, 11 Oct 2020 10:40:12 +0000 (UTC) (envelope-from danfe@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 3600F1A58D; Sun, 11 Oct 2020 10:40:12 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09BAeCAN073783; Sun, 11 Oct 2020 10:40:12 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09BAeCfg073782; Sun, 11 Oct 2020 10:40:12 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <202010111040.09BAeCfg073782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Sun, 11 Oct 2020 10:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366626 - head/sbin/reboot X-SVN-Group: head X-SVN-Commit-Author: danfe X-SVN-Commit-Paths: head/sbin/reboot X-SVN-Commit-Revision: 366626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2020 10:40:12 -0000 Author: danfe (ports committer) Date: Sun Oct 11 10:40:11 2020 New Revision: 366626 URL: https://svnweb.freebsd.org/changeset/base/366626 Log: The nextboot(8) manual page currently says that the loader(8) would delete the /boot/nextboot.conf file or its contents which is 1) not the most user- friendly way of working with custom configurations, and 2) simply not true for both Forth and Lua implementations: they would not delete it, but just change the setting to "NO", that is, disable it. While at it, add one missing serial (Oxford) comma and fix some bogus line wraps along the way. Approved by: bcr (manpages) Differential Revision: https://reviews.freebsd.org/D25971 Modified: head/sbin/reboot/nextboot.8 Modified: head/sbin/reboot/nextboot.8 ============================================================================== --- head/sbin/reboot/nextboot.8 Sun Oct 11 09:05:13 2020 (r366625) +++ head/sbin/reboot/nextboot.8 Sun Oct 11 10:40:11 2020 (r366626) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 19, 2020 +.Dd October 11, 2020 .Dt NEXTBOOT 8 .Os .Sh NAME @@ -41,14 +41,14 @@ .Sh DESCRIPTION The .Nm -utility allows specifying some combination of an alternate kernel, boot flags -and kernel environment for the -next time the machine is booted. +utility allows specifying some combination of an alternate kernel, boot +flags, and kernel environment for the next time the machine is booted. Once the .Xr loader 8 -loads in the new kernel -information, it is deleted so in case the new kernel hangs the machine, -once it is rebooted, the machine will automatically revert to its previous +loads in the new kernel information from the +.Pa /boot/nextboot.conf +file, it is disabled so in case the new kernel hangs the machine, once +it is rebooted, the machine will automatically revert to its previous configuration. .Pp The options are as follows: From owner-svn-src-head@freebsd.org Sun Oct 11 12:29:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23F3D3F322D for ; Sun, 11 Oct 2020 12:29:16 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st43p00im-zteg10063501.me.com (st43p00im-zteg10063501.me.com [17.58.63.176]) (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 4C8Lhq4lLHz48Qm for ; Sun, 11 Oct 2020 12:29:15 +0000 (UTC) (envelope-from tsoome@me.com) Received: from [10.5.251.89] (251-37-131-46.dyn.estpak.ee [46.131.37.251]) by st43p00im-zteg10063501.me.com (Postfix) with ESMTPSA id E2D05C803D2; Sun, 11 Oct 2020 12:20:19 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Toomas Soome Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r366626 - head/sbin/reboot Date: Sun, 11 Oct 2020 15:20:16 +0300 Message-Id: <8601CC07-3A43-461A-915C-3CB68BADF41A@me.com> References: <202010111040.09BAeCfg073782@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <202010111040.09BAeCfg073782@repo.freebsd.org> To: Alexey Dokuchaev X-Mailer: iPhone Mail (18A393) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-10-11_06:2020-10-09, 2020-10-11 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2006250000 definitions=main-2010110117 X-Rspamd-Queue-Id: 4C8Lhq4lLHz48Qm X-Spamd-Bar: ++++++ X-Spamd-Result: default: False [6.65 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GREYLIST(0.00)[pass,body]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:17.58.0.0/16:c]; FREEMAIL_FROM(0.00)[me.com]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[me.com:+]; DMARC_POLICY_ALLOW(0.00)[me.com,quarantine]; NEURAL_HAM_SHORT(-0.28)[-0.283]; RCVD_IN_DNSWL_LOW(-0.10)[17.58.63.176:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[me.com]; ASN(0.00)[asn:714, ipnet:17.58.63.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[me.com:dkim]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_XBL(5.00)[46.131.37.251:received]; R_DKIM_ALLOW(0.00)[me.com:s=1a1hai]; FREEFALL_USER(0.00)[tsoome]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_MEDIUM(0.69)[0.687]; BAD_REP_POLICIES(0.10)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.84)[0.843]; RWL_MAILSPIKE_POSSIBLE(0.00)[17.58.63.176:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head] X-Spam: Yes X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2020 12:29:16 -0000 Please note, the remove is done by rc script during the boot. Also nextboot.= conf not generic configuration file (such as loader.conf or loader.conf.loca= l), but the implementation specific file, part of special feature. That is, o= ne should not assume the presence of nextboot.conf file, make assumptions ab= out its content, or perform manual edits on it. Rgds, Toomas > On 11. Oct 2020, at 13:40, Alexey Dokuchaev wrote: >=20 > =EF=BB=BFAuthor: danfe (ports committer) > Date: Sun Oct 11 10:40:11 2020 > New Revision: 366626 > URL: https://svnweb.freebsd.org/changeset/base/366626 >=20 > Log: > The nextboot(8) manual page currently says that the loader(8) would delet= e > the /boot/nextboot.conf file or its contents which is 1) not the most use= r- > friendly way of working with custom configurations, and 2) simply not tru= e > for both Forth and Lua implementations: they would not delete it, but jus= t > change the setting to "NO", that is, disable it. >=20 > While at it, add one missing serial (Oxford) comma and fix some bogus lin= e > wraps along the way. >=20 > Approved by: bcr (manpages) > Differential Revision: https://reviews.freebsd.org/D25971 >=20 > Modified: > head/sbin/reboot/nextboot.8 >=20 > Modified: head/sbin/reboot/nextboot.8 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/sbin/reboot/nextboot.8 Sun Oct 11 09:05:13 2020 (r366625) > +++ head/sbin/reboot/nextboot.8 Sun Oct 11 10:40:11 2020 (r366626) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd September 19, 2020 > +.Dd October 11, 2020 > .Dt NEXTBOOT 8 > .Os > .Sh NAME > @@ -41,14 +41,14 @@ > .Sh DESCRIPTION > The > .Nm > -utility allows specifying some combination of an alternate kernel, boot f= lags > -and kernel environment for the > -next time the machine is booted. > +utility allows specifying some combination of an alternate kernel, boot > +flags, and kernel environment for the next time the machine is booted. > Once the > .Xr loader 8 > -loads in the new kernel > -information, it is deleted so in case the new kernel hangs the machine, > -once it is rebooted, the machine will automatically revert to its previou= s > +loads in the new kernel information from the > +.Pa /boot/nextboot.conf > +file, it is disabled so in case the new kernel hangs the machine, once > +it is rebooted, the machine will automatically revert to its previous > configuration. > .Pp > The options are as follows: From owner-svn-src-head@freebsd.org Sun Oct 11 13:01:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 903F43F3CB7; Sun, 11 Oct 2020 13:01:51 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8MQR2qYzz4CmX; Sun, 11 Oct 2020 13:01:51 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1602421311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fP2xC7obF9b2TBG5NvtV92VZVpj4aTYcY1jqLeGKzOw=; b=u6+ExhE8rBbOaYzbw4ss08lCIhMSbbgXut0R8pjkPkKNgjF+AkPwnr40A4eLYJErA+HxfF SqOgXDBY4VHVLWNpTD5LZ5ocCZE0poi+/Vc9YXhbgnqxKNP013fbMIWQVVrOAyk1mCWnt4 3YJ+jk5+LFlGtpcNAuze5WmhlneQI3CpqKzWwjng63IpItIfOCQJHkSaZTXwzPK7MYqrje zXdnGFnkovsfTeFXlws0mj6ZYjrtoZuUONMMrbwP5iiHMyWkbJVMTYNz09envgiK/infeD RYIL2Eddo5ycIGkkeqnY768SfqieRV3QEbbnFY/UNFfJFHo/kWwMaNwsM/DkHg== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 4E5171737B; Sun, 11 Oct 2020 13:01:51 +0000 (UTC) Date: Sun, 11 Oct 2020 13:01:51 +0000 From: Alexey Dokuchaev To: Toomas Soome Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366626 - head/sbin/reboot Message-ID: <20201011130151.GA32755@FreeBSD.org> References: <202010111040.09BAeCfg073782@repo.freebsd.org> <8601CC07-3A43-461A-915C-3CB68BADF41A@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8601CC07-3A43-461A-915C-3CB68BADF41A@me.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1602421311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fP2xC7obF9b2TBG5NvtV92VZVpj4aTYcY1jqLeGKzOw=; b=ZkcFiJg+HxLXinO/hxCySorf7EDfXKqBMmITydXQhmss63mZ8T+lVCJYMmA2TVrm5HZHOG CGtKj1pLE/J6JK3iE/YR1xrPeZlpKnmvSZYL2eUf3lnBW/6GLneKujulx7NS2cUIeaLxBp UuwuTla2YlW/IniQAJJT8mn2t10kWTDUlABdPvNtsp5sRnz6ngthVDQKmu4AxrZvqzUBmA /c6v26TLv/2imVr+FaNQpJhNsDLn0iKDEt5wSTIuFoHK7F5BheLXFghPZ2QtvXNlcZ5uqh 3+uPT+sifSwaIlf4W1IDKMpFFtL2ThKeEdiTwiil0N4AcUJ0ND4N3HAvGEYIMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1602421311; a=rsa-sha256; cv=none; b=gRbsBXCRd8fhYIrGjr01KprhmSOpIb+CqhHmYV639FI2KlhUFuLO29HMljh4wtKX/RTVZJ +BRoPZ8EKSvIf8Br1SnQ5RwO0/1Qm27wBkhz3uRFHp5Y75S3dAAY7qtoWLsGib63uzvfz5 Xb3DYpaOhD9PVMRmbYPJ0dwV9tNt7SO5tuWL0VIbaz5k5TgqX+lT0mo1uVpucQLr9NOVRc IF0xvTZYfnVsz6U48Y2mqRxa+637AtqXOWHc8gAX8iFKKD4r1zWbjWonvn8nDU7dV+8VST LcNkqO6QMDGZP5p7NOWtDoem3xKTNlDhtAPIFRq7IrHRcl1C0cdqQXDI/sfipQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2020 13:01:51 -0000 On Sun, Oct 11, 2020 at 03:20:16PM +0300, Toomas Soome wrote: > Please note, the remove is done by rc script during the boot. But not by the loader(8) as the page used to claim. It confused me how to avoid the remove, and only later I've discovered with some relief that it is in fact not being removed, but only disabled (which IMHO is a lot more graceful and thus correct behavior). > Also nextboot.conf not generic configuration file (such as loader.conf > or loader.conf.local), but the implementation specific file, part of > special feature. > > That is, one should not assume the presence of nextboot.conf file, make > assumptions about its content, or perform manual edits on it. Do we want it to be the second-class citizen like this? Would it make better sense by documenting it more completely instead? ./danfe From owner-svn-src-head@freebsd.org Sun Oct 11 13:08:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10F1E3F3CC4 for ; Sun, 11 Oct 2020 13:08:20 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st43p00im-ztdg10071801.me.com (st43p00im-ztdg10071801.me.com [17.58.63.171]) (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 4C8MYv1JF4z4Cbl for ; Sun, 11 Oct 2020 13:08:18 +0000 (UTC) (envelope-from tsoome@me.com) Received: from nazgul.lan (148-52-235-80.sta.estpak.ee [80.235.52.148]) by st43p00im-ztdg10071801.me.com (Postfix) with ESMTPSA id 625C35401C3; Sun, 11 Oct 2020 13:08:17 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: svn commit: r366626 - head/sbin/reboot From: Toomas Soome In-Reply-To: <20201011130151.GA32755@FreeBSD.org> Date: Sun, 11 Oct 2020 16:08:09 +0300 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <35355AD6-42C6-48A2-8FCF-A371A82D683A@me.com> References: <202010111040.09BAeCfg073782@repo.freebsd.org> <8601CC07-3A43-461A-915C-3CB68BADF41A@me.com> <20201011130151.GA32755@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-10-11_06:2020-10-09, 2020-10-11 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=779 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2006250000 definitions=main-2010110125 X-Rspamd-Queue-Id: 4C8MYv1JF4z4Cbl X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.66 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:17.58.0.0/16:c]; FREEMAIL_FROM(0.00)[me.com]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[me.com:+]; DMARC_POLICY_ALLOW(-0.50)[me.com,quarantine]; NEURAL_HAM_SHORT(-1.10)[-1.099]; RCVD_IN_DNSWL_LOW(-0.10)[17.58.63.171:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[me.com]; ASN(0.00)[asn:714, ipnet:17.58.63.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[me.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.986]; R_DKIM_ALLOW(-0.20)[me.com:s=1a1hai]; FREEFALL_USER(0.00)[tsoome]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-0.98)[-0.976]; MIME_GOOD(-0.10)[text/plain]; RECEIVED_SPAMHAUS_PBL(0.00)[80.235.52.148:received]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[17.58.63.171:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2020 13:08:20 -0000 > On 11. Oct 2020, at 16:01, Alexey Dokuchaev wrote: >=20 > On Sun, Oct 11, 2020 at 03:20:16PM +0300, Toomas Soome wrote: >> Please note, the remove is done by rc script during the boot. >=20 > But not by the loader(8) as the page used to claim. It confused me = how to > avoid the remove, and only later I've discovered with some relief that = it > is in fact not being removed, but only disabled (which IMHO is a lot = more > graceful and thus correct behavior). >=20 >> Also nextboot.conf not generic configuration file (such as = loader.conf >> or loader.conf.local), but the implementation specific file, part of >> special feature. >>=20 >> That is, one should not assume the presence of nextboot.conf file, = make >> assumptions about its content, or perform manual edits on it. >=20 > Do we want it to be the second-class citizen like this? Would it make > better sense by documenting it more completely instead? >=20 > ./danfe It is not really about being second-class citizen, it really is about if = and how we can implement the feature. With UFS there is a limited write = (write to existing, allocated disk blocks), with zfs there is no write = to file system at all. rgds, toomas= From owner-svn-src-head@freebsd.org Sun Oct 11 13:30:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 551EE3F479B; Sun, 11 Oct 2020 13:30:23 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8N3M1Wm1z4DyD; Sun, 11 Oct 2020 13:30:23 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1602423023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=e/X1WRXOjJ62Qf2eu3tpvr9oM8DG6CB2sGgyHW+WuM8=; b=TyHsMIBvenAaEaxJ+Cfh20f9R/uMNv1R+Q0FcUZi044WX+968zGuD0yWkpt40FGHOYHWlI Fwq+3glXpMfQqvgL0g4q5L2zbBX7aKIMvQDd1ocvxUo7GYTIeyH+or/gN5bU1NbZNDDGKV FBHcJqs46fF4gIZJEsqvDvdxw0nQHPaaVvzvfonVeLqFVxSJhAo+W+s0leJXNyBtoUvGYW 29FEcQ/aJIIhxZEo3KMjIYjf19+kYDbcLGp511TKx16n+nI7YE/LnyHmZU0N1+5UZmGG0y Y6kTJU7QmuAEH6ELtnSWP9UTpN2EgoY2nq9v/RLWoz/8UFtCiEMeOYEre65fsQ== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 2C73F17CD2; Sun, 11 Oct 2020 13:30:23 +0000 (UTC) Date: Sun, 11 Oct 2020 13:30:23 +0000 From: Alexey Dokuchaev To: Toomas Soome Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366626 - head/sbin/reboot Message-ID: <20201011133023.GA67893@FreeBSD.org> References: <202010111040.09BAeCfg073782@repo.freebsd.org> <8601CC07-3A43-461A-915C-3CB68BADF41A@me.com> <20201011130151.GA32755@FreeBSD.org> <35355AD6-42C6-48A2-8FCF-A371A82D683A@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <35355AD6-42C6-48A2-8FCF-A371A82D683A@me.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1602423023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=e/X1WRXOjJ62Qf2eu3tpvr9oM8DG6CB2sGgyHW+WuM8=; b=bTTa2gQ9CiiHYlowMmnJn9txK8EAi2hmO0+q5YeLewcT3CAvVWKE0u5RG6afTAwesof60J urc8E+OCXcvXdFbRjFMa5Fb7I6T5w41dSnUGIYC39+LrBOMr3efuAzwdz0MqD8QpgMcEK6 QWvR3K1YRgrI5kwLyLjqU9QFcKcdygPrv3nFDICI9RBbOhwq09suD+9h7XHk+lr139hl5E YzWquF3qgZH2tXQ1nyzJH3/jWClET/KItlh1lxg8e6WlVQYCI/WcMhRgzedojITHtqHn5K ZRjzVUin6D//B0pOx0TJI8Hia/Bpto3QTUfrXnln0nIja2jnth7oYcD9E3osOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1602423023; a=rsa-sha256; cv=none; b=GDzeyoTFDyQA+E0f4dxTgc0rvnAU/s+Jj0IbptxX82rzXABGaDoRaaA/z/dnZZzZ2uxctX aFuy0r4B1A8aBjp3cl3Fhb0sNIA7y+ALet8pJdPSo0cvkM54xDXoTFvAhRWutJQdhtysAa 6abDUhNi8sHbNGEkUolw/FnX+25sBplGmh1TVGTK+ocDWJk12Sxl90miD1gN/Wd+FBRSur 4BO6p0C46EGFFKAt2Nx2hYM05BezfGXSHq8HUJvhQGJdVRcFwPfWL5y/MyDCR2W6T1fyab u33PF7+bSHUVLem7ly/N1Ib+FZePUcluLjTI1UIvDUdkaPUPRm0mAVT+03Gq7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2020 13:30:23 -0000 On Sun, Oct 11, 2020 at 04:08:09PM +0300, Toomas Soome wrote: > > On 11. Oct 2020, at 16:01, Alexey Dokuchaev wrote: > >> ... > >> Also nextboot.conf not generic configuration file (such as loader.conf > >> or loader.conf.local), but the implementation specific file, part of > >> special feature. > >> > >> That is, one should not assume the presence of nextboot.conf file, make > >> assumptions about its content, or perform manual edits on it. > > > > Do we want it to be the second-class citizen like this? Would it make > > better sense by documenting it more completely instead? > > It is not really about being second-class citizen, it really is about if > and how we can implement the feature. With UFS there is a limited write > (write to existing, allocated disk blocks), with ZFS there is no write to > file system at all. I see; that would explain why loader(8) replaces the "YES" -> "NO", but I guess I'd have to read the discussion on -rc@ which lead to r177062, because I don't see the reason for it to be removed (twice) if it's being disabled by the loader(8) earlier anyway. ./danfe From owner-svn-src-head@freebsd.org Sun Oct 11 13:59:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A5DF3F5329; Sun, 11 Oct 2020 13:59:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8NjL2gkWz4G4g; Sun, 11 Oct 2020 13:59:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 3A7192134D; Sun, 11 Oct 2020 13:59:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f178.google.com with SMTP id 140so13617484qko.2; Sun, 11 Oct 2020 06:59:50 -0700 (PDT) X-Gm-Message-State: AOAM531iiu3PwRmXswysMj2SMped9aD/b9BnHbSDzg4dZTklNUXg/s2Y TXoRM4iStywu/G7vie9wAhHpSGF1Yzg2auZ5Dbc= X-Google-Smtp-Source: ABdhPJxbU1LZSu7n6EIN5NqFnmVqYXXN5T9QdbTTUNuXMkxvy7gtjCUTukhWc2Y6EOVIhQiXf3p+a2x4G2D7ew32ZAQ= X-Received: by 2002:a05:620a:ced:: with SMTP id c13mr2345994qkj.120.1602424789719; Sun, 11 Oct 2020 06:59:49 -0700 (PDT) MIME-Version: 1.0 References: <202010111040.09BAeCfg073782@repo.freebsd.org> <8601CC07-3A43-461A-915C-3CB68BADF41A@me.com> <20201011130151.GA32755@FreeBSD.org> <35355AD6-42C6-48A2-8FCF-A371A82D683A@me.com> <20201011133023.GA67893@FreeBSD.org> In-Reply-To: <20201011133023.GA67893@FreeBSD.org> From: Kyle Evans Date: Sun, 11 Oct 2020 08:59:38 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366626 - head/sbin/reboot To: Alexey Dokuchaev Cc: Toomas Soome , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2020 13:59:50 -0000 On Sun, Oct 11, 2020 at 8:30 AM Alexey Dokuchaev wrote: > > On Sun, Oct 11, 2020 at 04:08:09PM +0300, Toomas Soome wrote: > > > On 11. Oct 2020, at 16:01, Alexey Dokuchaev wrote: > > >> ... > > >> Also nextboot.conf not generic configuration file (such as loader.conf > > >> or loader.conf.local), but the implementation specific file, part of > > >> special feature. > > >> > > >> That is, one should not assume the presence of nextboot.conf file, make > > >> assumptions about its content, or perform manual edits on it. > > > > > > Do we want it to be the second-class citizen like this? Would it make > > > better sense by documenting it more completely instead? > > > > It is not really about being second-class citizen, it really is about if > > and how we can implement the feature. With UFS there is a limited write > > (write to existing, allocated disk blocks), with ZFS there is no write to > > file system at all. > > I see; that would explain why loader(8) replaces the "YES" -> "NO", > but I guess I'd have to read the discussion on -rc@ which lead to r177062, > because I don't see the reason for it to be removed (twice) if it's being > disabled by the loader(8) earlier anyway. > IMO both steps are important. You have to (at least try to) disable it in case it doesn't get you all the way to multi-user, but then you don't want the old contents of nextboot.conf being inadvertently used on another boot if someone's habitually `nextboot -a`ing. From owner-svn-src-head@freebsd.org Sun Oct 11 15:12:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EBF13F6A2B for ; Sun, 11 Oct 2020 15:12:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8QKh2D5Rz4KCX for ; Sun, 11 Oct 2020 15:12:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf34.google.com with SMTP id 13so7185920qvc.9 for ; Sun, 11 Oct 2020 08:12:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UgzgxSjAXUSH4Acq/PieE8NXKuuGwuJRSEKrqy00EtE=; b=dfbMlqmyjQUZGhkuAR74msN15hQ1+Ds2Zum7QdTJbIhCTpnd/l+r2wRxU6llRT/1BP Va+5mVWzcThtsMBcO3hiIOX2Es2F6n+zqIPfImYvWvE1mDfF0QMMdC8WaBszDPAbV7Ys 2Ie4qzr1UWXjEOcGWZo2jflEv1EFsebg2LDWQCZ7lnmwltibW+DcaKV71S7YOvf2EXxg ZBzVT5lztYc9yp7Dcz0xhfWpaJQpb0b+j6Z6gv3EJ8lroVT1aild+rkEWdwLjtZTLPXR b4aF7s4NQXhoTtAD/T8nXg4hcbxvwEC+JnNmtbj7x9P9ByXp8MSKeRR2Jq9FD3ZJconm zTgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UgzgxSjAXUSH4Acq/PieE8NXKuuGwuJRSEKrqy00EtE=; b=OzPBh51zZi81dd3dZpjvpgVq9znvnqflI1YQOPUX0Ho7Z5THr6L+wsv7TCQQF01fLm BgBa8lzKVcl0qncATT4Xeo5nn26CC4wZVpzDN5u/pmds5lvq/02vfAvSKlIJjhRLAmve 46z3ycaFnV5jynV/K/pEOEy7fhU+mH2JI+dNtVAJx51pLxF+I4gHj/M1nJi3FGVNGHEV Heu6fH8hRHHI0nMR6QwXlDgEChE95D9SFSIA6W6NwjoKcq7Ab1Y3m5rTZe8A8joJa0kN 5ml/RjvGka3aUlVpVdw0SJxIawWx6qCZJaUmaY5cuXJymfL+63feEBzdUl8iDRsSxhUy LriQ== X-Gm-Message-State: AOAM531o+FnoIa8H7guM0kenIkvfvW1Z010KbGJeCivuyaD5FWQWXut/ TgBDFHxM3l/wAfMXI/wzaxrUNPYXFxXScy9zV7RWmw== X-Google-Smtp-Source: ABdhPJwaVe5OY0eIR6rVZtuCmYoCHsfw59AusrbkuoJ5kjqUS3EeypVlUxsRUyekiSZ9e35LAwb0RdueXggcN88e27Y= X-Received: by 2002:a05:6214:174f:: with SMTP id dc15mr20736890qvb.26.1602429174925; Sun, 11 Oct 2020 08:12:54 -0700 (PDT) MIME-Version: 1.0 References: <202010111040.09BAeCfg073782@repo.freebsd.org> <8601CC07-3A43-461A-915C-3CB68BADF41A@me.com> <20201011130151.GA32755@FreeBSD.org> <35355AD6-42C6-48A2-8FCF-A371A82D683A@me.com> <20201011133023.GA67893@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Sun, 11 Oct 2020 09:12:43 -0600 Message-ID: Subject: Re: svn commit: r366626 - head/sbin/reboot To: Kyle Evans Cc: Alexey Dokuchaev , Toomas Soome , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4C8QKh2D5Rz4KCX X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=dfbMlqmy; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f34) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.50 / 15.00]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.005]; NEURAL_HAM_LONG(-1.00)[-0.996]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.50)[-0.499]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f34:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_CC(0.00)[freebsd.org,me.com]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2020 15:12:57 -0000 On Sun, Oct 11, 2020, 8:00 AM Kyle Evans wrote: > On Sun, Oct 11, 2020 at 8:30 AM Alexey Dokuchaev > wrote: > > > > On Sun, Oct 11, 2020 at 04:08:09PM +0300, Toomas Soome wrote: > > > > On 11. Oct 2020, at 16:01, Alexey Dokuchaev wrote: > > > >> ... > > > >> Also nextboot.conf not generic configuration file (such as > loader.conf > > > >> or loader.conf.local), but the implementation specific file, part of > > > >> special feature. > > > >> > > > >> That is, one should not assume the presence of nextboot.conf file, > make > > > >> assumptions about its content, or perform manual edits on it. > > > > > > > > Do we want it to be the second-class citizen like this? Would it > make > > > > better sense by documenting it more completely instead? > > > > > > It is not really about being second-class citizen, it really is about > if > > > and how we can implement the feature. With UFS there is a limited write > > > (write to existing, allocated disk blocks), with ZFS there is no write > to > > > file system at all. > > > > I see; that would explain why loader(8) replaces the "YES" -> > "NO", > > but I guess I'd have to read the discussion on -rc@ which lead to > r177062, > > because I don't see the reason for it to be removed (twice) if it's being > > disabled by the loader(8) earlier anyway. > > > > IMO both steps are important. You have to (at least try to) disable it > in case it doesn't get you all the way to multi-user, but then you > don't want the old contents of nextboot.conf being inadvertently used > on another boot if someone's habitually `nextboot -a`ing. > There were cases that were discussed when the geature went in that required it to be removed in some failure modes for full functionality. I don't recall if they were in the rc thread or somewhere else. And honestly, nextboot.conf is special in so many ways. We have no unlink in the loader for UFS and no write for ZFS or MSDOS. In those cases, the rm from rc is what you want (though lately we use a different mechanism for ZFS). So the docs were right before, in the big picture. The implementation detail now enshrined there is unwise. I'm not likely to remove it, but if UFS grows unlink in the future, this man page will need to change. Then again, all the loser man pages need a complete rewrite, or close to it. Warner > From owner-svn-src-head@freebsd.org Sun Oct 11 16:01:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 605C33F79CF; Sun, 11 Oct 2020 16:01:18 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8RPV2Bknz4MPG; Sun, 11 Oct 2020 16:01:18 +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 167EC1E216; Sun, 11 Oct 2020 16:01:18 +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 09BG1IZY076845; Sun, 11 Oct 2020 16:01:18 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09BG1GxA076837; Sun, 11 Oct 2020 16:01:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010111601.09BG1GxA076837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 11 Oct 2020 16:01:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366628 - in head/sys: amd64/conf arm64/conf conf dev/axgbe modules modules/axgbe modules/axgbe/if_axa modules/axgbe/if_axp X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: amd64/conf arm64/conf conf dev/axgbe modules modules/axgbe modules/axgbe/if_axa modules/axgbe/if_axp X-SVN-Commit-Revision: 366628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2020 16:01:18 -0000 Author: manu Date: Sun Oct 11 16:01:16 2020 New Revision: 366628 URL: https://svnweb.freebsd.org/changeset/base/366628 Log: 10Gigabit Ethernet driver for AMD SoC This patch has the driver for 10Gigabit Ethernet controller in AMD SoC. This driver is written compatible to the Iflib framework. The existing driver is for the old version of hardware. The submitted driver here is for the recent versions of the hardware where the Ethernet controller is PCI-E based. Submitted by: Rajesh Kumar MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D25793 Added: head/sys/dev/axgbe/if_axgbe_pci.c (contents, props changed) head/sys/dev/axgbe/xgbe-dcb.c (contents, props changed) head/sys/dev/axgbe/xgbe-i2c.c (contents, props changed) head/sys/dev/axgbe/xgbe-phy-v1.c (contents, props changed) head/sys/dev/axgbe/xgbe-phy-v2.c (contents, props changed) head/sys/dev/axgbe/xgbe-ptp.c (contents, props changed) head/sys/dev/axgbe/xgbe-sysctl.c (contents, props changed) head/sys/dev/axgbe/xgbe-txrx.c (contents, props changed) head/sys/dev/axgbe/xgbe_osdep.c (contents, props changed) head/sys/modules/axgbe/ head/sys/modules/axgbe/Makefile (contents, props changed) head/sys/modules/axgbe/if_axa/ head/sys/modules/axgbe/if_axa/Makefile (contents, props changed) head/sys/modules/axgbe/if_axp/ head/sys/modules/axgbe/if_axp/Makefile (contents, props changed) Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/NOTES head/sys/arm64/conf/GENERIC head/sys/arm64/conf/NOTES head/sys/conf/files.amd64 head/sys/conf/files.arm64 head/sys/dev/axgbe/if_axgbe.c head/sys/dev/axgbe/xgbe-common.h head/sys/dev/axgbe/xgbe-desc.c head/sys/dev/axgbe/xgbe-dev.c head/sys/dev/axgbe/xgbe-drv.c head/sys/dev/axgbe/xgbe-mdio.c head/sys/dev/axgbe/xgbe.h head/sys/dev/axgbe/xgbe_osdep.h head/sys/modules/Makefile Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Oct 11 13:39:04 2020 (r366627) +++ head/sys/amd64/conf/GENERIC Sun Oct 11 16:01:16 2020 (r366628) @@ -248,6 +248,7 @@ device ixl # Intel 700 Series Physical Function device iavf # Intel Adaptive Virtual Function device ice # Intel 800 Series Physical Function device vmx # VMware VMXNET3 Ethernet +device axp # AMD EPYC integrated NIC # PCI Ethernet NICs. device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Sun Oct 11 13:39:04 2020 (r366627) +++ head/sys/amd64/conf/NOTES Sun Oct 11 16:01:16 2020 (r366628) @@ -328,6 +328,7 @@ device nfe # nVidia nForce MCP on-board Ethernet device sfxge # Solarflare SFC9000 10Gb Ethernet device vmx # VMware VMXNET3 Ethernet device wpi # Intel 3945ABG wireless NICs. +device axp # AMD EPYC integrated NIC # IEEE 802.11 adapter firmware modules Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sun Oct 11 13:39:04 2020 (r366627) +++ head/sys/arm64/conf/GENERIC Sun Oct 11 16:01:16 2020 (r366628) @@ -167,7 +167,7 @@ device mdio device mii device miibus # MII bus support device awg # Allwinner EMAC Gigabit Ethernet -device axgbe # AMD Opteron A1100 integrated NIC +device axa # AMD Opteron A1100 integrated NIC device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet device neta # Marvell Armada 370/38x/XP/3700 NIC device smc # SMSC LAN91C111 Modified: head/sys/arm64/conf/NOTES ============================================================================== --- head/sys/arm64/conf/NOTES Sun Oct 11 13:39:04 2020 (r366627) +++ head/sys/arm64/conf/NOTES Sun Oct 11 16:01:16 2020 (r366628) @@ -76,7 +76,7 @@ options PCI_IOV # PCI SR-IOV support # Ethernet NICs device mdio device awg # Allwinner EMAC Gigabit Ethernet -device axgbe # AMD Opteron A1100 integrated NIC +device axa # AMD Opteron A1100 integrated NIC device neta # Marvell Armada 370/38x/XP/3700 NIC device smc # SMSC LAN91C111 device vnic # Cavium ThunderX NIC Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Oct 11 13:39:04 2020 (r366627) +++ head/sys/conf/files.amd64 Sun Oct 11 16:01:16 2020 (r366628) @@ -142,6 +142,16 @@ dev/agp/agp_amd64.c optional agp dev/agp/agp_i810.c optional agp dev/agp/agp_via.c optional agp dev/amdgpio/amdgpio.c optional amdgpio +dev/axgbe/if_axgbe_pci.c optional axp +dev/axgbe/xgbe-desc.c optional axp +dev/axgbe/xgbe-dev.c optional axp +dev/axgbe/xgbe-drv.c optional axp +dev/axgbe/xgbe-mdio.c optional axp +dev/axgbe/xgbe-sysctl.c optional axp +dev/axgbe/xgbe-txrx.c optional axp +dev/axgbe/xgbe_osdep.c optional axp +dev/axgbe/xgbe-i2c.c optional axp +dev/axgbe/xgbe-phy-v2.c optional axp dev/hyperv/vmbus/amd64/hyperv_machdep.c optional hyperv dev/hyperv/vmbus/amd64/vmbus_vector.S optional hyperv dev/ice/if_ice_iflib.c optional ice pci \ Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sun Oct 11 13:39:04 2020 (r366627) +++ head/sys/conf/files.arm64 Sun Oct 11 16:01:16 2020 (r366628) @@ -249,11 +249,15 @@ dev/acpica/acpi_pxm.c optional acpi dev/ahci/ahci_fsl_fdt.c optional SOC_NXP_LS ahci fdt dev/ahci/ahci_generic.c optional ahci dev/altera/dwc/if_dwc_socfpga.c optional fdt dwc_socfpga -dev/axgbe/if_axgbe.c optional axgbe -dev/axgbe/xgbe-desc.c optional axgbe -dev/axgbe/xgbe-dev.c optional axgbe -dev/axgbe/xgbe-drv.c optional axgbe -dev/axgbe/xgbe-mdio.c optional axgbe +dev/axgbe/if_axgbe.c optional axa +dev/axgbe/xgbe-desc.c optional axa +dev/axgbe/xgbe-dev.c optional axa +dev/axgbe/xgbe-drv.c optional axa +dev/axgbe/xgbe-mdio.c optional axa +dev/axgbe/xgbe-sysctl.c optional axa +dev/axgbe/xgbe-txrx.c optional axa +dev/axgbe/xgbe_osdep.c optional axa +dev/axgbe/xgbe-phy-v1.c optional axa dev/cpufreq/cpufreq_dt.c optional cpufreq fdt dev/gpio/pl061.c optional pl061 gpio dev/gpio/pl061_acpi.c optional pl061 gpio acpi Modified: head/sys/dev/axgbe/if_axgbe.c ============================================================================== --- head/sys/dev/axgbe/if_axgbe.c Sun Oct 11 13:39:04 2020 (r366627) +++ head/sys/dev/axgbe/if_axgbe.c Sun Oct 11 16:01:16 2020 (r366628) @@ -1,6 +1,8 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2016,2017 SoftIron Inc. - * All rights reserved. + * Copyright (c) 2020 Advanced Micro Devices, Inc. * * This software was developed by Andrew Turner under * the sponsorship of SoftIron Inc. @@ -114,6 +116,14 @@ static struct resource_spec mac_spec[] = { { -1, 0 } }; +static struct xgbe_version_data xgbe_v1 = { + .init_function_ptrs_phy_impl = xgbe_init_function_ptrs_phy_v1, + .xpcs_access = XGBE_XPCS_ACCESS_V1, + .tx_max_fifo_size = 81920, + .rx_max_fifo_size = 81920, + .tx_tstamp_workaround = 1, +}; + MALLOC_DEFINE(M_AXGBE, "axgbe", "axgbe data"); static void @@ -135,14 +145,13 @@ axgbe_ioctl(struct ifnet *ifp, unsigned long command, { struct axgbe_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; - int error; + int error = 0; switch(command) { case SIOCSIFMTU: if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU_JUMBO) error = EINVAL; - else - error = xgbe_change_mtu(ifp, ifr->ifr_mtu); + /* TODO - change it to iflib way */ break; case SIOCSIFFLAGS: error = 0; @@ -307,6 +316,7 @@ axgbe_attach(device_t dev) sc = device_get_softc(dev); + sc->prv.vdata = &xgbe_v1; node = ofw_bus_get_node(dev); if (OF_getencprop(node, "phy-handle", &phy_handle, sizeof(phy_handle)) <= 0) { @@ -391,6 +401,7 @@ axgbe_attach(device_t dev) sc->prv.phy.advertising = ADVERTISED_10000baseKR_Full | ADVERTISED_1000baseKX_Full; + /* * Read the needed properties from the phy node. */ @@ -466,13 +477,11 @@ axgbe_attach(device_t dev) /* Check if the NIC is DMA coherent */ sc->prv.coherent = OF_hasprop(node, "dma-coherent"); if (sc->prv.coherent) { - sc->prv.axdomain = XGBE_DMA_OS_AXDOMAIN; - sc->prv.arcache = XGBE_DMA_OS_ARCACHE; - sc->prv.awcache = XGBE_DMA_OS_AWCACHE; + sc->prv.arcr = XGBE_DMA_OS_ARCR; + sc->prv.awcr = XGBE_DMA_OS_AWCR; } else { - sc->prv.axdomain = XGBE_DMA_SYS_AXDOMAIN; - sc->prv.arcache = XGBE_DMA_SYS_ARCACHE; - sc->prv.awcache = XGBE_DMA_SYS_AWCACHE; + sc->prv.arcr = XGBE_DMA_SYS_ARCR; + sc->prv.awcr = XGBE_DMA_SYS_AWCR; } /* Create the lock & workqueues */ @@ -486,6 +495,7 @@ axgbe_attach(device_t dev) xgbe_init_function_ptrs_phy(&sc->prv.phy_if); xgbe_init_function_ptrs_dev(&sc->prv.hw_if); xgbe_init_function_ptrs_desc(&sc->prv.desc_if); + sc->prv.vdata->init_function_ptrs_phy_impl(&sc->prv.phy_if); /* Reset the hardware */ sc->prv.hw_if.exit(&sc->prv); @@ -494,16 +504,14 @@ axgbe_attach(device_t dev) xgbe_get_all_hw_features(&sc->prv); /* Set default values */ - sc->prv.pblx8 = DMA_PBL_X8_ENABLE; sc->prv.tx_desc_count = XGBE_TX_DESC_CNT; sc->prv.tx_sf_mode = MTL_TSF_ENABLE; sc->prv.tx_threshold = MTL_TX_THRESHOLD_64; - sc->prv.tx_pbl = DMA_PBL_16; sc->prv.tx_osp_mode = DMA_OSP_ENABLE; sc->prv.rx_desc_count = XGBE_RX_DESC_CNT; sc->prv.rx_sf_mode = MTL_RSF_DISABLE; sc->prv.rx_threshold = MTL_RX_THRESHOLD_64; - sc->prv.rx_pbl = DMA_PBL_16; + sc->prv.pbl = DMA_PBL_128; sc->prv.pause_autoneg = 1; sc->prv.tx_pause = 1; sc->prv.rx_pause = 1; @@ -528,7 +536,7 @@ axgbe_attach(device_t dev) ifp->if_softc = sc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = axgbe_ioctl; - ifp->if_transmit = xgbe_xmit; + /* TODO - change it to iflib way */ ifp->if_qflush = axgbe_qflush; ifp->if_get_counter = axgbe_get_counter; @@ -550,11 +558,7 @@ axgbe_attach(device_t dev) set_bit(XGBE_DOWN, &sc->prv.dev_state); - if (xgbe_open(ifp) < 0) { - device_printf(dev, "ndo_open failed\n"); - return (ENXIO); - } - + /* TODO - change it to iflib way */ return (0); } @@ -562,6 +566,7 @@ static device_method_t axgbe_methods[] = { /* Device interface */ DEVMETHOD(device_probe, axgbe_probe), DEVMETHOD(device_attach, axgbe_attach), + { 0, 0 } }; @@ -569,8 +574,9 @@ static devclass_t axgbe_devclass; DEFINE_CLASS_0(axgbe, axgbe_driver, axgbe_methods, sizeof(struct axgbe_softc)); -DRIVER_MODULE(axgbe, simplebus, axgbe_driver, axgbe_devclass, 0, 0); +DRIVER_MODULE(axa, simplebus, axgbe_driver, axgbe_devclass, 0, 0); + static struct ofw_compat_data phy_compat_data[] = { { "amd,xgbe-phy-seattle-v1a", true }, { NULL, false } @@ -605,6 +611,7 @@ static device_method_t axgbephy_methods[] = { /* Device interface */ DEVMETHOD(device_probe, axgbephy_probe), DEVMETHOD(device_attach, axgbephy_attach), + { 0, 0 } }; Added: head/sys/dev/axgbe/if_axgbe_pci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/axgbe/if_axgbe_pci.c Sun Oct 11 16:01:16 2020 (r366628) @@ -0,0 +1,2339 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Advanced Micro Devices, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Contact Information : + * Rajesh Kumar + * Shreyank Amartya + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include "xgbe.h" +#include "xgbe-common.h" + +#include "miibus_if.h" +#include "ifdi_if.h" +#include "opt_inet.h" +#include "opt_inet6.h" + +MALLOC_DEFINE(M_AXGBE, "axgbe", "axgbe data"); + +extern struct if_txrx axgbe_txrx; + +/* Function prototypes */ +static void *axgbe_register(device_t); +static int axgbe_if_attach_pre(if_ctx_t); +static int axgbe_if_attach_post(if_ctx_t); +static int axgbe_if_detach(if_ctx_t); +static void axgbe_if_stop(if_ctx_t); +static void axgbe_if_init(if_ctx_t); + +/* Queue related routines */ +static int axgbe_if_tx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, int); +static int axgbe_if_rx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, int); +static int axgbe_alloc_channels(if_ctx_t); +static void axgbe_if_queues_free(if_ctx_t); +static int axgbe_if_tx_queue_intr_enable(if_ctx_t, uint16_t); +static int axgbe_if_rx_queue_intr_enable(if_ctx_t, uint16_t); + +/* Interrupt related routines */ +static void axgbe_if_disable_intr(if_ctx_t); +static void axgbe_if_enable_intr(if_ctx_t); +static int axgbe_if_msix_intr_assign(if_ctx_t, int); +static void xgbe_free_intr(struct xgbe_prv_data *, struct resource *, void *, int); + +/* Init and Iflib routines */ +static void axgbe_pci_init(struct xgbe_prv_data *); +static void axgbe_pci_stop(if_ctx_t); +static void xgbe_disable_rx_tx_int(struct xgbe_prv_data *, struct xgbe_channel *); +static void xgbe_disable_rx_tx_ints(struct xgbe_prv_data *); +static int axgbe_if_mtu_set(if_ctx_t, uint32_t); +static void axgbe_if_update_admin_status(if_ctx_t); +static void axgbe_if_media_status(if_ctx_t, struct ifmediareq *); +static int axgbe_if_media_change(if_ctx_t); +static int axgbe_if_promisc_set(if_ctx_t, int); +static uint64_t axgbe_if_get_counter(if_ctx_t, ift_counter); +static void axgbe_if_vlan_register(if_ctx_t, uint16_t); +static void axgbe_if_vlan_unregister(if_ctx_t, uint16_t); +#if __FreeBSD_version >= 1300000 +static bool axgbe_if_needs_restart(if_ctx_t, enum iflib_restart_event); +#endif +static void axgbe_set_counts(if_ctx_t); +static void axgbe_init_iflib_softc_ctx(struct axgbe_if_softc *); + +/* MII interface registered functions */ +static int axgbe_miibus_readreg(device_t, int, int); +static int axgbe_miibus_writereg(device_t, int, int, int); +static void axgbe_miibus_statchg(device_t); + +/* ISR routines */ +static int axgbe_dev_isr(void *); +static void axgbe_ecc_isr(void *); +static void axgbe_i2c_isr(void *); +static void axgbe_an_isr(void *); +static int axgbe_msix_que(void *); + +/* Timer routines */ +static void xgbe_service(void *, int); +static void xgbe_service_timer(void *); +static void xgbe_init_timers(struct xgbe_prv_data *); +static void xgbe_stop_timers(struct xgbe_prv_data *); + +/* Dump routines */ +static void xgbe_dump_prop_registers(struct xgbe_prv_data *); + +/* + * Allocate only for MAC (BAR0) and PCS (BAR1) registers, and just point the + * MSI-X table bar (BAR5) to iflib. iflib will do the allocation for MSI-X + * table. + */ +static struct resource_spec axgbe_pci_mac_spec[] = { + { SYS_RES_MEMORY, PCIR_BAR(0), RF_ACTIVE }, /* MAC regs */ + { SYS_RES_MEMORY, PCIR_BAR(1), RF_ACTIVE }, /* PCS regs */ + { -1, 0 } +}; + +static pci_vendor_info_t axgbe_vendor_info_array[] = +{ + PVID(0x1022, 0x1458, "AMD 10 Gigabit Ethernet Driver"), + PVID(0x1022, 0x1459, "AMD 10 Gigabit Ethernet Driver"), + PVID_END +}; + +static struct xgbe_version_data xgbe_v2a = { + .init_function_ptrs_phy_impl = xgbe_init_function_ptrs_phy_v2, + .xpcs_access = XGBE_XPCS_ACCESS_V2, + .mmc_64bit = 1, + .tx_max_fifo_size = 229376, + .rx_max_fifo_size = 229376, + .tx_tstamp_workaround = 1, + .ecc_support = 1, + .i2c_support = 1, + .irq_reissue_support = 1, + .tx_desc_prefetch = 5, + .rx_desc_prefetch = 5, + .an_cdr_workaround = 1, +}; + +static struct xgbe_version_data xgbe_v2b = { + .init_function_ptrs_phy_impl = xgbe_init_function_ptrs_phy_v2, + .xpcs_access = XGBE_XPCS_ACCESS_V2, + .mmc_64bit = 1, + .tx_max_fifo_size = 65536, + .rx_max_fifo_size = 65536, + .tx_tstamp_workaround = 1, + .ecc_support = 1, + .i2c_support = 1, + .irq_reissue_support = 1, + .tx_desc_prefetch = 5, + .rx_desc_prefetch = 5, + .an_cdr_workaround = 1, +}; + +/* Device Interface */ +static device_method_t ax_methods[] = { + DEVMETHOD(device_register, axgbe_register), + DEVMETHOD(device_probe, iflib_device_probe), + DEVMETHOD(device_attach, iflib_device_attach), + DEVMETHOD(device_detach, iflib_device_detach), + + /* MII interface */ + DEVMETHOD(miibus_readreg, axgbe_miibus_readreg), + DEVMETHOD(miibus_writereg, axgbe_miibus_writereg), + DEVMETHOD(miibus_statchg, axgbe_miibus_statchg), + + DEVMETHOD_END +}; + +static driver_t ax_driver = { + "ax", ax_methods, sizeof(struct axgbe_if_softc), +}; + +devclass_t ax_devclass; +DRIVER_MODULE(axp, pci, ax_driver, ax_devclass, 0, 0); +DRIVER_MODULE(miibus, ax, miibus_driver, miibus_devclass, 0, 0); +IFLIB_PNP_INFO(pci, ax_driver, axgbe_vendor_info_array); + +MODULE_DEPEND(ax, pci, 1, 1, 1); +MODULE_DEPEND(ax, ether, 1, 1, 1); +MODULE_DEPEND(ax, iflib, 1, 1, 1); +MODULE_DEPEND(ax, miibus, 1, 1, 1); + +/* Iflib Interface */ +static device_method_t axgbe_if_methods[] = { + DEVMETHOD(ifdi_attach_pre, axgbe_if_attach_pre), + DEVMETHOD(ifdi_attach_post, axgbe_if_attach_post), + DEVMETHOD(ifdi_detach, axgbe_if_detach), + DEVMETHOD(ifdi_init, axgbe_if_init), + DEVMETHOD(ifdi_stop, axgbe_if_stop), + DEVMETHOD(ifdi_msix_intr_assign, axgbe_if_msix_intr_assign), + DEVMETHOD(ifdi_intr_enable, axgbe_if_enable_intr), + DEVMETHOD(ifdi_intr_disable, axgbe_if_disable_intr), + DEVMETHOD(ifdi_tx_queue_intr_enable, axgbe_if_tx_queue_intr_enable), + DEVMETHOD(ifdi_rx_queue_intr_enable, axgbe_if_rx_queue_intr_enable), + DEVMETHOD(ifdi_tx_queues_alloc, axgbe_if_tx_queues_alloc), + DEVMETHOD(ifdi_rx_queues_alloc, axgbe_if_rx_queues_alloc), + DEVMETHOD(ifdi_queues_free, axgbe_if_queues_free), + DEVMETHOD(ifdi_update_admin_status, axgbe_if_update_admin_status), + DEVMETHOD(ifdi_mtu_set, axgbe_if_mtu_set), + DEVMETHOD(ifdi_media_status, axgbe_if_media_status), + DEVMETHOD(ifdi_media_change, axgbe_if_media_change), + DEVMETHOD(ifdi_promisc_set, axgbe_if_promisc_set), + DEVMETHOD(ifdi_get_counter, axgbe_if_get_counter), + DEVMETHOD(ifdi_vlan_register, axgbe_if_vlan_register), + DEVMETHOD(ifdi_vlan_unregister, axgbe_if_vlan_unregister), +#if __FreeBSD_version >= 1300000 + DEVMETHOD(ifdi_needs_restart, axgbe_if_needs_restart), +#endif + DEVMETHOD_END +}; + +static driver_t axgbe_if_driver = { + "axgbe_if", axgbe_if_methods, sizeof(struct axgbe_if_softc) +}; + +/* Iflib Shared Context */ +static struct if_shared_ctx axgbe_sctx_init = { + .isc_magic = IFLIB_MAGIC, + .isc_driver = &axgbe_if_driver, + .isc_q_align = PAGE_SIZE, + .isc_tx_maxsize = XGBE_TSO_MAX_SIZE + sizeof(struct ether_vlan_header), + .isc_tx_maxsegsize = PAGE_SIZE, + .isc_tso_maxsize = XGBE_TSO_MAX_SIZE + sizeof(struct ether_vlan_header), + .isc_tso_maxsegsize = PAGE_SIZE, + .isc_rx_maxsize = MJUM9BYTES, + .isc_rx_maxsegsize = MJUM9BYTES, + .isc_rx_nsegments = 1, + .isc_admin_intrcnt = 4, + + .isc_vendor_info = axgbe_vendor_info_array, + .isc_driver_version = XGBE_DRV_VERSION, + + .isc_nrxd_min = {XGBE_RX_DESC_CNT_MIN, XGBE_RX_DESC_CNT_MIN}, + .isc_nrxd_default = {XGBE_RX_DESC_CNT_DEFAULT, XGBE_RX_DESC_CNT_DEFAULT}, + .isc_nrxd_max = {XGBE_RX_DESC_CNT_MAX, XGBE_RX_DESC_CNT_MAX}, + .isc_ntxd_min = {XGBE_TX_DESC_CNT_MIN}, + .isc_ntxd_default = {XGBE_TX_DESC_CNT_DEFAULT}, + .isc_ntxd_max = {XGBE_TX_DESC_CNT_MAX}, + + .isc_nfl = 2, + .isc_ntxqs = 1, + .isc_nrxqs = 2, + .isc_flags = IFLIB_TSO_INIT_IP | IFLIB_NEED_SCRATCH | + IFLIB_NEED_ZERO_CSUM | IFLIB_NEED_ETHER_PAD, +}; + +static void * +axgbe_register(device_t dev) +{ + return (&axgbe_sctx_init); +} + +/* MII Interface Functions */ +static int +axgbe_miibus_readreg(device_t dev, int phy, int reg) +{ + struct axgbe_if_softc *sc = iflib_get_softc(device_get_softc(dev)); + struct xgbe_prv_data *pdata = &sc->pdata; + int val; + + axgbe_printf(3, "%s: phy %d reg %d\n", __func__, phy, reg); + + val = xgbe_phy_mii_read(pdata, phy, reg); + + axgbe_printf(2, "%s: val 0x%x\n", __func__, val); + return (val & 0xFFFF); +} + +static int +axgbe_miibus_writereg(device_t dev, int phy, int reg, int val) +{ + struct axgbe_if_softc *sc = iflib_get_softc(device_get_softc(dev)); + struct xgbe_prv_data *pdata = &sc->pdata; + + axgbe_printf(3, "%s: phy %d reg %d val 0x%x\n", __func__, phy, reg, val); + + xgbe_phy_mii_write(pdata, phy, reg, val); + + return(0); +} + +static void +axgbe_miibus_statchg(device_t dev) +{ + struct axgbe_if_softc *sc = iflib_get_softc(device_get_softc(dev)); + struct xgbe_prv_data *pdata = &sc->pdata; + struct mii_data *mii = device_get_softc(pdata->axgbe_miibus); + struct ifnet *ifp = pdata->netdev; + int bmsr; + + axgbe_printf(2, "%s: Link %d/%d\n", __func__, pdata->phy.link, + pdata->phy_link); + + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + pdata->phy.link = 1; + break; + case IFM_1000_T: + case IFM_1000_SX: + case IFM_2500_SX: + pdata->phy.link = 1; + break; + default: + pdata->phy.link = 0; + break; + } + } else + pdata->phy_link = 0; + + bmsr = axgbe_miibus_readreg(pdata->dev, pdata->mdio_addr, MII_BMSR); + if (bmsr & BMSR_ANEG) { + + axgbe_printf(2, "%s: Autoneg Done\n", __func__); + + /* Raise AN Interrupt */ + XMDIO_WRITE(pdata, MDIO_MMD_AN, MDIO_AN_INTMASK, + XGBE_AN_CL73_INT_MASK); + } +} + +static int +axgbe_if_attach_pre(if_ctx_t ctx) +{ + struct axgbe_if_softc *sc; + struct xgbe_prv_data *pdata; + struct resource *mac_res[2]; + if_softc_ctx_t scctx; + if_shared_ctx_t sctx; + device_t dev; + unsigned int ma_lo, ma_hi; + unsigned int reg; + + sc = iflib_get_softc(ctx); + sc->pdata.dev = dev = iflib_get_dev(ctx); + sc->sctx = sctx = iflib_get_sctx(ctx); + sc->scctx = scctx = iflib_get_softc_ctx(ctx); + sc->media = iflib_get_media(ctx); + sc->ctx = ctx; + sc->link_status = LINK_STATE_DOWN; + pdata = &sc->pdata; + pdata->netdev = iflib_get_ifp(ctx); + + spin_lock_init(&pdata->xpcs_lock); + + /* Initialize locks */ + mtx_init(&pdata->rss_mutex, "xgbe rss mutex lock", NULL, MTX_DEF); + mtx_init(&pdata->mdio_mutex, "xgbe MDIO mutex lock", NULL, MTX_SPIN); + + /* Allocate VLAN bitmap */ + pdata->active_vlans = bit_alloc(VLAN_NVID, M_AXGBE, M_WAITOK|M_ZERO); + pdata->num_active_vlans = 0; + + /* Get the version data */ + DBGPR("%s: Device ID: 0x%x\n", __func__, pci_get_device(dev)); + if (pci_get_device(dev) == 0x1458) + sc->pdata.vdata = &xgbe_v2a; + else if (pci_get_device(dev) == 0x1459) + sc->pdata.vdata = &xgbe_v2b; + + /* PCI setup */ + if (bus_alloc_resources(dev, axgbe_pci_mac_spec, mac_res)) + return (ENXIO); + + sc->pdata.xgmac_res = mac_res[0]; + sc->pdata.xpcs_res = mac_res[1]; + + /* Set the PCS indirect addressing definition registers*/ + pdata->xpcs_window_def_reg = PCS_V2_WINDOW_DEF; + pdata->xpcs_window_sel_reg = PCS_V2_WINDOW_SELECT; + + /* Configure the PCS indirect addressing support */ + reg = XPCS32_IOREAD(pdata, pdata->xpcs_window_def_reg); + pdata->xpcs_window = XPCS_GET_BITS(reg, PCS_V2_WINDOW_DEF, OFFSET); + pdata->xpcs_window <<= 6; + pdata->xpcs_window_size = XPCS_GET_BITS(reg, PCS_V2_WINDOW_DEF, SIZE); + pdata->xpcs_window_size = 1 << (pdata->xpcs_window_size + 7); + pdata->xpcs_window_mask = pdata->xpcs_window_size - 1; + DBGPR("xpcs window def : %#010x\n", + pdata->xpcs_window_def_reg); + DBGPR("xpcs window sel : %#010x\n", + pdata->xpcs_window_sel_reg); + DBGPR("xpcs window : %#010x\n", + pdata->xpcs_window); + DBGPR("xpcs window size : %#010x\n", + pdata->xpcs_window_size); + DBGPR("xpcs window mask : %#010x\n", + pdata->xpcs_window_mask); + + /* Enable all interrupts in the hardware */ + XP_IOWRITE(pdata, XP_INT_EN, 0x1fffff); + + /* Retrieve the MAC address */ + ma_lo = XP_IOREAD(pdata, XP_MAC_ADDR_LO); + ma_hi = XP_IOREAD(pdata, XP_MAC_ADDR_HI); + pdata->mac_addr[0] = ma_lo & 0xff; + pdata->mac_addr[1] = (ma_lo >> 8) & 0xff; + pdata->mac_addr[2] = (ma_lo >>16) & 0xff; + pdata->mac_addr[3] = (ma_lo >> 24) & 0xff; + pdata->mac_addr[4] = ma_hi & 0xff; + pdata->mac_addr[5] = (ma_hi >> 8) & 0xff; + if (!XP_GET_BITS(ma_hi, XP_MAC_ADDR_HI, VALID)) { + axgbe_error("Invalid mac address\n"); + return (EINVAL); + } + iflib_set_mac(ctx, pdata->mac_addr); + + /* Clock settings */ + pdata->sysclk_rate = XGBE_V2_DMA_CLOCK_FREQ; + pdata->ptpclk_rate = XGBE_V2_PTP_CLOCK_FREQ; + + /* Set the DMA coherency values */ + pdata->coherent = 1; + pdata->arcr = XGBE_DMA_PCI_ARCR; + pdata->awcr = XGBE_DMA_PCI_AWCR; + pdata->awarcr = XGBE_DMA_PCI_AWARCR; + + /* Read the port property registers */ + pdata->pp0 = XP_IOREAD(pdata, XP_PROP_0); + pdata->pp1 = XP_IOREAD(pdata, XP_PROP_1); + pdata->pp2 = XP_IOREAD(pdata, XP_PROP_2); + pdata->pp3 = XP_IOREAD(pdata, XP_PROP_3); + pdata->pp4 = XP_IOREAD(pdata, XP_PROP_4); + DBGPR("port property 0 = %#010x\n", pdata->pp0); + DBGPR("port property 1 = %#010x\n", pdata->pp1); + DBGPR("port property 2 = %#010x\n", pdata->pp2); + DBGPR("port property 3 = %#010x\n", pdata->pp3); + DBGPR("port property 4 = %#010x\n", pdata->pp4); + + /* Set the maximum channels and queues */ + pdata->tx_max_channel_count = XP_GET_BITS(pdata->pp1, XP_PROP_1, + MAX_TX_DMA); + pdata->rx_max_channel_count = XP_GET_BITS(pdata->pp1, XP_PROP_1, + MAX_RX_DMA); + pdata->tx_max_q_count = XP_GET_BITS(pdata->pp1, XP_PROP_1, + MAX_TX_QUEUES); + pdata->rx_max_q_count = XP_GET_BITS(pdata->pp1, XP_PROP_1, + MAX_RX_QUEUES); + DBGPR("max tx/rx channel count = %u/%u\n", + pdata->tx_max_channel_count, pdata->rx_max_channel_count); + DBGPR("max tx/rx hw queue count = %u/%u\n", + pdata->tx_max_q_count, pdata->rx_max_q_count); + + axgbe_set_counts(ctx); + + /* Set the maximum fifo amounts */ + pdata->tx_max_fifo_size = XP_GET_BITS(pdata->pp2, XP_PROP_2, + TX_FIFO_SIZE); + pdata->tx_max_fifo_size *= 16384; + pdata->tx_max_fifo_size = min(pdata->tx_max_fifo_size, + pdata->vdata->tx_max_fifo_size); + pdata->rx_max_fifo_size = XP_GET_BITS(pdata->pp2, XP_PROP_2, + RX_FIFO_SIZE); + pdata->rx_max_fifo_size *= 16384; + pdata->rx_max_fifo_size = min(pdata->rx_max_fifo_size, + pdata->vdata->rx_max_fifo_size); + DBGPR("max tx/rx max fifo size = %u/%u\n", + pdata->tx_max_fifo_size, pdata->rx_max_fifo_size); + + /* Initialize IFLIB if_softc_ctx_t */ + axgbe_init_iflib_softc_ctx(sc); + + /* Alloc channels */ + if (axgbe_alloc_channels(ctx)) { + axgbe_error("Unable to allocate channel memory\n"); + return (ENOMEM); + } + + TASK_INIT(&pdata->service_work, 0, xgbe_service, pdata); + + /* create the workqueue */ + pdata->dev_workqueue = taskqueue_create("axgbe", M_WAITOK, + taskqueue_thread_enqueue, &pdata->dev_workqueue); + taskqueue_start_threads(&pdata->dev_workqueue, 1, PI_NET, + "axgbe dev taskq"); + + /* Init timers */ + xgbe_init_timers(pdata); + + return (0); +} /* axgbe_if_attach_pre */ + +static void +xgbe_init_all_fptrs(struct xgbe_prv_data *pdata) +{ + xgbe_init_function_ptrs_dev(&pdata->hw_if); + xgbe_init_function_ptrs_phy(&pdata->phy_if); + xgbe_init_function_ptrs_i2c(&pdata->i2c_if); + xgbe_init_function_ptrs_desc(&pdata->desc_if); + + pdata->vdata->init_function_ptrs_phy_impl(&pdata->phy_if); +} + +static void +axgbe_set_counts(if_ctx_t ctx) +{ + struct axgbe_if_softc *sc = iflib_get_softc(ctx);; + struct xgbe_prv_data *pdata = &sc->pdata; + cpuset_t lcpus; + int cpu_count, err; + size_t len; + + /* Set all function pointers */ + xgbe_init_all_fptrs(pdata); + + /* Populate the hardware features */ + xgbe_get_all_hw_features(pdata); + + if (!pdata->tx_max_channel_count) + pdata->tx_max_channel_count = pdata->hw_feat.tx_ch_cnt; + if (!pdata->rx_max_channel_count) + pdata->rx_max_channel_count = pdata->hw_feat.rx_ch_cnt; + + if (!pdata->tx_max_q_count) + pdata->tx_max_q_count = pdata->hw_feat.tx_q_cnt; + if (!pdata->rx_max_q_count) + pdata->rx_max_q_count = pdata->hw_feat.rx_q_cnt; + + /* + * Calculate the number of Tx and Rx rings to be created + * -Tx (DMA) Channels map 1-to-1 to Tx Queues so set + * the number of Tx queues to the number of Tx channels + * enabled + * -Rx (DMA) Channels do not map 1-to-1 so use the actual + * number of Rx queues or maximum allowed + */ + + /* Get cpu count from sysctl */ + len = sizeof(cpu_count); + err = kernel_sysctlbyname(curthread, "hw.ncpu", &cpu_count, &len, NULL, + 0, NULL, 0); + if (err) { + axgbe_error("Unable to fetch number of cpus\n"); + cpu_count = 1; + } + + if (bus_get_cpus(pdata->dev, INTR_CPUS, sizeof(lcpus), &lcpus) != 0) { + axgbe_error("Unable to fetch CPU list\n"); + /* TODO - handle CPU_COPY(&all_cpus, &lcpus); */ + } + + DBGPR("ncpu %d intrcpu %d\n", cpu_count, CPU_COUNT(&lcpus)); + + pdata->tx_ring_count = min(CPU_COUNT(&lcpus), pdata->hw_feat.tx_ch_cnt); + pdata->tx_ring_count = min(pdata->tx_ring_count, + pdata->tx_max_channel_count); + pdata->tx_ring_count = min(pdata->tx_ring_count, pdata->tx_max_q_count); + + pdata->tx_q_count = pdata->tx_ring_count; + + pdata->rx_ring_count = min(CPU_COUNT(&lcpus), pdata->hw_feat.rx_ch_cnt); + pdata->rx_ring_count = min(pdata->rx_ring_count, + pdata->rx_max_channel_count); + + pdata->rx_q_count = min(pdata->hw_feat.rx_q_cnt, pdata->rx_max_q_count); + + DBGPR("TX/RX max channel count = %u/%u\n", + pdata->tx_max_channel_count, pdata->rx_max_channel_count); + DBGPR("TX/RX max queue count = %u/%u\n", + pdata->tx_max_q_count, pdata->rx_max_q_count); + DBGPR("TX/RX DMA ring count = %u/%u\n", + pdata->tx_ring_count, pdata->rx_ring_count); + DBGPR("TX/RX hardware queue count = %u/%u\n", + pdata->tx_q_count, pdata->rx_q_count); +} /* axgbe_set_counts */ + +static void +axgbe_init_iflib_softc_ctx(struct axgbe_if_softc *sc) +{ + struct xgbe_prv_data *pdata = &sc->pdata; + if_softc_ctx_t scctx = sc->scctx; + if_shared_ctx_t sctx = sc->sctx; + int i; + + scctx->isc_nrxqsets = pdata->rx_q_count; + scctx->isc_ntxqsets = pdata->tx_q_count; + scctx->isc_msix_bar = pci_msix_table_bar(pdata->dev); + scctx->isc_tx_nsegments = 32; + + for (i = 0; i < sctx->isc_ntxqs; i++) { + scctx->isc_txqsizes[i] = + roundup2(scctx->isc_ntxd[i] * sizeof(struct xgbe_ring_desc), + 128); + scctx->isc_txd_size[i] = sizeof(struct xgbe_ring_desc); + } + + for (i = 0; i < sctx->isc_nrxqs; i++) { + scctx->isc_rxqsizes[i] = + roundup2(scctx->isc_nrxd[i] * sizeof(struct xgbe_ring_desc), + 128); + scctx->isc_rxd_size[i] = sizeof(struct xgbe_ring_desc); + } + + scctx->isc_tx_tso_segments_max = 32; + scctx->isc_tx_tso_size_max = XGBE_TSO_MAX_SIZE; + scctx->isc_tx_tso_segsize_max = PAGE_SIZE; + + /* + * Set capabilities + * 1) IFLIB automatically adds IFCAP_HWSTATS, so need to set explicitly + * 2) isc_tx_csum_flags is mandatory if IFCAP_TXCSUM (included in + * IFCAP_HWCSUM) is set + */ + scctx->isc_tx_csum_flags = (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP | + CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_SCTP_IPV6 | + CSUM_TSO); + scctx->isc_capenable = (IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | + IFCAP_JUMBO_MTU | + IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWFILTER | + IFCAP_VLAN_HWCSUM | + IFCAP_TSO | IFCAP_VLAN_HWTSO); + scctx->isc_capabilities = scctx->isc_capenable; + + /* + * Set rss_table_size alone when adding RSS support. rss_table_mask + * will be set by IFLIB based on rss_table_size + */ + scctx->isc_rss_table_size = XGBE_RSS_MAX_TABLE_SIZE; + + scctx->isc_ntxqsets_max = XGBE_MAX_QUEUES; + scctx->isc_nrxqsets_max = XGBE_MAX_QUEUES; + + scctx->isc_txrx = &axgbe_txrx; +} + +static int +axgbe_alloc_channels(if_ctx_t ctx) +{ + struct axgbe_if_softc *sc = iflib_get_softc(ctx); + struct xgbe_prv_data *pdata = &sc->pdata; + struct xgbe_channel *channel; + int i, j, count; + + DBGPR("%s: txqs %d rxqs %d\n", __func__, pdata->tx_ring_count, + pdata->rx_ring_count); + + /* Iflibe sets based on isc_ntxqsets/nrxqsets */ + count = max_t(unsigned int, pdata->tx_ring_count, pdata->rx_ring_count); + + /* Allocate channel memory */ + for (i = 0; i < count ; i++) { + channel = (struct xgbe_channel*)malloc(sizeof(struct xgbe_channel), + M_AXGBE, M_NOWAIT | M_ZERO); + + if (channel == NULL) { + for (j = 0; j < i; j++) { + free(pdata->channel[j], M_AXGBE); + pdata->channel[j] = NULL; + } + return (ENOMEM); + } + + pdata->channel[i] = channel; + } + + pdata->total_channel_count = count; + DBGPR("Channel count set to: %u\n", pdata->total_channel_count); + + for (i = 0; i < count; i++) { + + channel = pdata->channel[i]; + snprintf(channel->name, sizeof(channel->name), "channel-%d",i); + + channel->pdata = pdata; + channel->queue_index = i; + channel->dma_tag = rman_get_bustag(pdata->xgmac_res); + bus_space_subregion(channel->dma_tag, + rman_get_bushandle(pdata->xgmac_res), + DMA_CH_BASE + (DMA_CH_INC * i), DMA_CH_INC, + &channel->dma_handle); + channel->tx_ring = NULL; + channel->rx_ring = NULL; + } + + return (0); +} /* axgbe_alloc_channels */ + +static void +xgbe_service(void *ctx, int pending) +{ + struct xgbe_prv_data *pdata = ctx; + struct axgbe_if_softc *sc = (struct axgbe_if_softc *)pdata; + bool prev_state = false; + + /* Get previous link status */ + prev_state = pdata->phy.link; + + pdata->phy_if.phy_status(pdata); + + if (prev_state != pdata->phy.link) { + pdata->phy_link = pdata->phy.link; + axgbe_if_update_admin_status(sc->ctx); + } + + callout_reset(&pdata->service_timer, 1*hz, xgbe_service_timer, pdata); +} + +static void +xgbe_service_timer(void *data) +{ + struct xgbe_prv_data *pdata = data; + + taskqueue_enqueue(pdata->dev_workqueue, &pdata->service_work); +} + +static void +xgbe_init_timers(struct xgbe_prv_data *pdata) +{ + callout_init(&pdata->service_timer, 1*hz); +} + +static void +xgbe_start_timers(struct xgbe_prv_data *pdata) +{ + callout_reset(&pdata->service_timer, 1*hz, xgbe_service_timer, pdata); +} + +static void +xgbe_stop_timers(struct xgbe_prv_data *pdata) +{ + callout_drain(&pdata->service_timer); + callout_stop(&pdata->service_timer); +} + +static void +xgbe_dump_phy_registers(struct xgbe_prv_data *pdata) +{ + axgbe_printf(1, "\n************* PHY Reg dump *********************\n"); + + axgbe_printf(1, "PCS Control Reg (%#06x) = %#06x\n", MDIO_CTRL1, + XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_CTRL1)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Oct 12 02:13:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F19C429DFD; Mon, 12 Oct 2020 02:13:24 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8hzm2Llqz4n7J; Mon, 12 Oct 2020 02:13:24 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1602468804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0mbg9pbcvF72C5weHpAeg3X2FnY5pWV8MDFr92ct+Ag=; b=o9TSyX5xC8VlTSqESHNwqn+nwYcz+d/8QSEUjwvwDISOgLq9Tj9Tc6lCWuFl7RrwNlSZ7W 8DKu3F1CTgT2ZroLqfZCt6m0Cm29CkH9k5TKRUXp9H0jmzmKgJb/LyDrDobHHa7ttsd1IC mU9Z4I+PUuj5szXNUHuDViOzLThfy6DXEfRCbWGskg7Em+Oydi5pltXoUlPmF1uRlNKhht z2okHDu7jmgdzP6pct851BAqobcu7o9KXMIVFdB+2MoY965sRp30e7TvPbT7YWOFMtLUl2 HsJ8Xz2raz5L09Wd6C3pR58zmUT6Pb9+YZpiB8heqZR2qC1Gh3hI5fmkB0cjvA== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 384F41C47E; Mon, 12 Oct 2020 02:13:24 +0000 (UTC) Date: Mon, 12 Oct 2020 02:13:24 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: Kyle Evans , Toomas Soome , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r366626 - head/sbin/reboot Message-ID: <20201012021324.GA38670@FreeBSD.org> References: <202010111040.09BAeCfg073782@repo.freebsd.org> <8601CC07-3A43-461A-915C-3CB68BADF41A@me.com> <20201011130151.GA32755@FreeBSD.org> <35355AD6-42C6-48A2-8FCF-A371A82D683A@me.com> <20201011133023.GA67893@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1602468804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0mbg9pbcvF72C5weHpAeg3X2FnY5pWV8MDFr92ct+Ag=; b=I4poM9WtLAMY9ZhDZBLCYYQCNPAiBymVsNiakfI0W0bytSkk4a0bX5Gshrv3YSEut9CUd4 1h/6TMPsrWOcFQYfFM1ZiC93LRJ7zRs5LeF/4K9M0RdIcSa1pp3153EMTgAbtr8SrzexK+ CS9WkBkddv9VMey2mjV8kszTZbo68eKqecLqYkSrxxC1spfMjCafDGpIxcL9SbF1tRQ2b/ zBjQRz/zjV3rd3QJ+F1/JKkr/4vMJXpIhSxyhkCIoyDyktI+NWweIiNVt4vYNl1GRVgF4B 4aKqPV+vC1wz2E2SyhwqMDphzeSyut27mXGsHLOTQ94S/SPZSoUWFz7KkPy7/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1602468804; a=rsa-sha256; cv=none; b=iaf5nEmMlN2Pr7h6Q9KfgJR8WRdNk+2kUGZBOdirbuTi77NU/ViDuRHbx/UldJqSHbZAy2 fLFt96YsUBSY1s9J+iAomBVu6dHqH0Lotny6+xl+IP3+XrDes86smSSyIF2VLB/JnPq8Cj 92gjLjPcmTL1cOihR2sUu/6ogihfrfzikyLaG/n8d/gEJLIb62UJEQOoAROEbqjI/lS8gw w8ooIUtSNYHKt4LJvmnl/vSyA6Z0LEdnt1epbLr4rgQUuutPLheu/kUnV22IyQCRs+wAmg I1MyPKDrBYICnlYKS6hr3/YOkd6aOnaf0MEGXP9kniUlosd5hElN5GkZH2oNGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 02:13:24 -0000 On Sun, Oct 11, 2020 at 09:12:43AM -0600, Warner Losh wrote: > ... > There were cases that were discussed when the feature went in that > required it to be removed in some failure modes for full functionality. > I don't recall if they were in the rc thread or somewhere else. You mean, literally delete the file, that is, nextboot_enable="NO" can not be enough? > And honestly, nextboot.conf is special in so many ways. We have no > unlink in the loader for UFS and no write for ZFS or MSDOS. In those What's the problem with in-place overwrite in the FAT case? > cases, the rm from rc is what you want I still don't understand how could rm be better than graceful disabling alternative configuration with nextboot_enable="NO". I most certainly do *not* like when my custom config files are being removed, especially silently. When I see nextboot_enable="NO" I know that the file had been processed, and processed by the machine, not me (since I would never add trailing space). When I don't see the file, I'd be questioning myself if I've ever added it here, or maybe I put in the wrong location. > I'm not likely to remove it, but if UFS grows unlink in the future, > this man page will need to change. Just because it's easier to implemented unlink for UFS then (over)write for ZFS? > Then again, all the loser [loader?] man pages need a complete rewrite, > or close to it. Personally I find them quite useful, except when they contradict the reality (like this time). In these cases, I'd fix them. ./danfe From owner-svn-src-head@freebsd.org Mon Oct 12 03:17:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5083F42AF5A for ; Mon, 12 Oct 2020 03:17:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8kQB4vgKz4q42 for ; Mon, 12 Oct 2020 03:17:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x844.google.com with SMTP id a9so12657305qto.11 for ; Sun, 11 Oct 2020 20:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=b/Wvc/KzItEiT3eqpeX702qP3vVp/qHCLecBcJRS/3M=; b=oqag8xmsyfIvOkUuYBnrVWDtBn4/ZSIXA3yNdasT62j9/NwqD9F4wocXeOH6H+f2pw H1iMPn9dV7qsmQvUcypr9qAR9gEOkfIXkGsLaRnqIWfoLkInM0+vFV5szUo66kIlxSth +hdZeE0ASosUiqlAtLseB5wjsEAt6BKZGoIZyRodTKVdqrjusKw1jk8ZuHD3lc7w4z9D 5KWSGsL1pOTSnakqco8vqhozXy5yk2qKXaivvvs7aw23npQwHjM3UsY3zZr1CtfJyivt xPboioh0gHqQiDRUH9B6pTc/p6KMyFRvfE+deww80qC5wA+ZHu/f/3l4CT9L0zIxBZxp PUYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b/Wvc/KzItEiT3eqpeX702qP3vVp/qHCLecBcJRS/3M=; b=Rsne4hIAlsKF2RAk/vB0if/aUBzWsUTkjYU9AG7Rd+VuhMvEitZpxLj66dsDkophbY NaF7ia72iPRENQyTqRVuWxHJAS6BKHcRpKdP1RdBqcRXP3zOyRlk37zmqq6c/sJz3N4M +A/4fbYOEPC39has0m/sMjErYFUmNct9HQUB9d32+m2oZGbOou85d17au1r2pdN2Wi4Y EtH7kuxtGySzUfiL7SqW5fEDKPZYmu2AOUBIVyiwbD/e8ZjkMImx4TjFIxLKe6gLt806 SuD6NpiB7Zhpl9YxoMr+oYRH6drSIuMBnWUKaQKLAZdj6+47RgOzS8UTbwEMJNg915aa fRVA== X-Gm-Message-State: AOAM533rQjxrqBNgli4NgMXhs73gNbNWhRxUYJ8Xmaj7OTEvfZMHdB0U Bj5z2L80Q8RpdVMI0gn7f+L6cs3J9xVJaZlbFLI2WA== X-Google-Smtp-Source: ABdhPJxrlPgA2Uqa82AL6nDuvxNRxqmuCQ1uljyezAGoS1TlUyaMZCai5ThH7XQtkPcdr5+HYdT+wUdpHtqt/5a4Px0= X-Received: by 2002:ac8:3178:: with SMTP id h53mr8184814qtb.187.1602472673558; Sun, 11 Oct 2020 20:17:53 -0700 (PDT) MIME-Version: 1.0 References: <202010111040.09BAeCfg073782@repo.freebsd.org> <8601CC07-3A43-461A-915C-3CB68BADF41A@me.com> <20201011130151.GA32755@FreeBSD.org> <35355AD6-42C6-48A2-8FCF-A371A82D683A@me.com> <20201011133023.GA67893@FreeBSD.org> <20201012021324.GA38670@FreeBSD.org> In-Reply-To: <20201012021324.GA38670@FreeBSD.org> From: Warner Losh Date: Sun, 11 Oct 2020 21:17:42 -0600 Message-ID: Subject: Re: svn commit: r366626 - head/sbin/reboot To: Alexey Dokuchaev Cc: Kyle Evans , Toomas Soome , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4C8kQB4vgKz4q42 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=oqag8xms; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::844) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.55 / 15.00]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-1.01)[-1.007]; NEURAL_HAM_LONG(-1.01)[-1.008]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.54)[-0.537]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::844:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_CC(0.00)[freebsd.org,me.com]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 03:17:55 -0000 On Sun, Oct 11, 2020, 8:13 PM Alexey Dokuchaev wrote: > On Sun, Oct 11, 2020 at 09:12:43AM -0600, Warner Losh wrote: > > ... > > There were cases that were discussed when the feature went in that > > required it to be removed in some failure modes for full functionality. > > I don't recall if they were in the rc thread or somewhere else. > > You mean, literally delete the file, that is, nextboot_enable="NO" can > not be enough? > Yes. Sometimes it's not reliably written in some failure scenarios. In those cases it must be deleted. > And honestly, nextboot.conf is special in so many ways. We have no > > unlink in the loader for UFS and no write for ZFS or MSDOS. In those > > What's the problem with in-place overwrite in the FAT case? > Last I checked, it wasn't implemented. It could be done, but hasn't been. > cases, the rm from rc is what you want > > I still don't understand how could rm be better than graceful disabling > alternative configuration with nextboot_enable="NO". I most certainly > do *not* like when my custom config files are being removed, especially > silently. When I see nextboot_enable="NO" I know that the file > had been processed, and processed by the machine, not me (since I would > never add trailing space). When I don't see the file, I'd be questioning > myself if I've ever added it here, or maybe I put in the wrong location. > Nextboot.conf is special. It will be deleted. It doesn't belong to you, it belongs to nextboot(8). > I'm not likely to remove it, but if UFS grows unlink in the future, > > this man page will need to change. > > Just because it's easier to implemented unlink for UFS then (over)write > for ZFS? > Both are hard in ZFS. Unlink has issues that I hadn't recalled, so that path is unlikely... > Then again, all the loser [loader?] man pages need a complete rewrite, > > or close to it. > > Personally I find them quite useful, except when they contradict the > reality (like this time). In these cases, I'd fix them. > For now, it's fine. Warner > From owner-svn-src-head@freebsd.org Mon Oct 12 03:33:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DAAE42B205; Mon, 12 Oct 2020 03:33:33 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8kmF3PTDz4qnN; Mon, 12 Oct 2020 03:33:33 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1602473613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6B4rw4Z3angHWCZ0aJV5vCF4c8wvr3kGNnLGJAv5BKg=; b=D+G/u2iIoDhzDwChBKOQO64KtpGMLYoI0n25mN8eNaYNyPhicCk5MLxWv7IG79p56SQpRn 15kH3nSFoKTSsHOisfCcyhsnBkYnUrIrOuna136KG1FltBQHX+5JEPEiqSwPhQd5Q1gnAw ecxVuiFPRG+7L/mv/aBVjdsU1bsdoxV7ys4K9G9cXwlLpJ3IBQm8D3tC7VNc0lAEQfsmuX FE2JrghmcyZnnl3feGQqDaUknZdx+CQjvEi9FdM65M33SiGIt6OAYd1EWMYyVErbumUYn0 1gxZlx1WTFOgqnBQvN7D6Czal8yoSTssft58+3sqQuGCQVTmAm3stNU69eWq3Q== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 66C311CFBD; Mon, 12 Oct 2020 03:33:33 +0000 (UTC) Date: Mon, 12 Oct 2020 03:33:33 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: Kyle Evans , Toomas Soome , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r366626 - head/sbin/reboot Message-ID: <20201012033333.GB38670@FreeBSD.org> References: <202010111040.09BAeCfg073782@repo.freebsd.org> <8601CC07-3A43-461A-915C-3CB68BADF41A@me.com> <20201011130151.GA32755@FreeBSD.org> <35355AD6-42C6-48A2-8FCF-A371A82D683A@me.com> <20201011133023.GA67893@FreeBSD.org> <20201012021324.GA38670@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1602473613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6B4rw4Z3angHWCZ0aJV5vCF4c8wvr3kGNnLGJAv5BKg=; b=mCi8eCgkfSrTHmihtjxgq/rfxOwvbndnPfv75PcPOK+48HAbQF9DaXUzurN3YEIEWnj0zn ab4ey+tanHyvp17BUDo4/GYIJqLoiwIAAEtRdj3BCReEbs3bspxnVtwpeDBBlJNa8aDmxa /MfTrBUlu4xhcdmJtcrjSqbLrs8x7F929elgnZcceF9YzSemev19h74BQc5C3kA57Xjr1+ GSzpCdlpTTQ/lFIjdxt/hKjtM9eQS2HPHL6pz1JurCEhJJnWqSthIRJuiPb13eddEH3UPr fTgnvzASh/eanBEgvoYxMqyc53v9atgo429ecuRODBvgHNFQLdfoRCPB7Tu8MQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1602473613; a=rsa-sha256; cv=none; b=iv1VYBXOVk7RIG4ei/AOlPam3F9QXMX022TzB1W5nKQ+qd8BaqqXcSWnQlMzmn+LXADYeZ Rq2NnV6A61r/AITFygTvH0ZMtWdKHSWXKRcVIjt+ScQGNbJrhxxK8bf0lMZcZfMSNGJxzh +ohKz4X0MmSsd1L2aYunA1OwDehvWBoOn3UJ6W6yhFKrUhZ2FtJoXVdDrszQBtHJNZ+9a/ BF40fgYvk7mQ7Nw8kCKMunx4xs7GCORQymUPD5aD/6yuZiduoHmG4nOTz3lk2nsh9I0j4U 3Is0e5J4+yBw+D/Z86yWvMP2+b4EZezoCDDIYAPa6SnApmvITI7zZ7vc+IbJrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 03:33:33 -0000 On Sun, Oct 11, 2020 at 09:17:42PM -0600, Warner Losh wrote: > On Sun, Oct 11, 2020, 8:13 PM Alexey Dokuchaev wrote: > > ... > > I still don't understand how could rm be better than graceful disabling > > alternative configuration with nextboot_enable="NO". I most certainly > > do *not* like when my custom config files are being removed, especially > > silently. When I see nextboot_enable="NO" I know that the file > > had been processed, and processed by the machine, not me (since I would > > never add trailing space). When I don't see the file, I'd be questioning > > myself if I've ever added it here, or maybe I put in the wrong location. > > Nextboot.conf is special. It will be deleted. It doesn't belong to you, it > belongs to nextboot(8). OK, I see your point. > > Personally I find them quite useful, except when they contradict the > > reality (like this time). In these cases, I'd fix them. > > For now, it's fine. Fair enough; I guess we can now wrap this discussion up, thanks! ./danfe From owner-svn-src-head@freebsd.org Mon Oct 12 05:56:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AFA542D201; Mon, 12 Oct 2020 05:56:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8nxB3ZJ9z3StW; Mon, 12 Oct 2020 05:56:30 +0000 (UTC) (envelope-from imp@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 5992E27D98; Mon, 12 Oct 2020 05:56:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09C5uUX9091470; Mon, 12 Oct 2020 05:56:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09C5uUrI091469; Mon, 12 Oct 2020 05:56:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010120556.09C5uUrI091469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Oct 2020 05:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366629 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 366629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 05:56:30 -0000 Author: imp Date: Mon Oct 12 05:56:29 2020 New Revision: 366629 URL: https://svnweb.freebsd.org/changeset/base/366629 Log: systm.h: forward declare ucred for _STANDALONE too There's a number of types we forward declare for the kernel. We need struct ucred for the ZSTD ZFS integration, so go ahead and forward declare it here too. Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sun Oct 11 16:01:16 2020 (r366628) +++ head/sys/sys/systm.h Mon Oct 12 05:56:29 2020 (r366629) @@ -124,6 +124,7 @@ void vpanic(const char *, __va_list) __dead2 __printfl #if defined(_STANDALONE) +struct ucred; /* * Until we have more experience with KASSERTS that are called * from the boot loader, they are off. The bootloader does this From owner-svn-src-head@freebsd.org Mon Oct 12 09:34:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0647C432296; Mon, 12 Oct 2020 09:34:51 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8tn661H8z3gDH; Mon, 12 Oct 2020 09:34:50 +0000 (UTC) (envelope-from tsoome@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 B1730A6F0; Mon, 12 Oct 2020 09:34:50 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09C9Yoa4028027; Mon, 12 Oct 2020 09:34:50 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09C9Yo6D028026; Mon, 12 Oct 2020 09:34:50 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202010120934.09C9Yo6D028026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 12 Oct 2020 09:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366631 - head/stand/i386/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/common X-SVN-Commit-Revision: 366631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 09:34:51 -0000 Author: tsoome Date: Mon Oct 12 09:34:50 2020 New Revision: 366631 URL: https://svnweb.freebsd.org/changeset/base/366631 Log: loader: edd_device_path_v3 is too small The EDD v3[1], see table 13, page 33, does define device path as double qword, that is, 16 bytes, we have only qword. Also remove edd_device_path_v4 and edd_params_v4 because those are not used, and there is no size difference in v3 versus v4. [1] http://www.t13.org/documents/UploadedDocuments/docs2004/d1572r3-EDD3.pdf MFC after: 2 weeks Modified: head/stand/i386/common/edd.h Modified: head/stand/i386/common/edd.h ============================================================================== --- head/stand/i386/common/edd.h Mon Oct 12 08:43:21 2020 (r366630) +++ head/stand/i386/common/edd.h Mon Oct 12 09:34:50 2020 (r366631) @@ -71,7 +71,7 @@ struct edd_device_path_v3 { char host_bus[4]; char interface[8]; uint64_t interface_path; - uint64_t device_path; + uint64_t device_path[2]; uint8_t reserved2[1]; uint8_t checksum; } __packed; @@ -79,23 +79,6 @@ struct edd_device_path_v3 { struct edd_params_v3 { struct edd_params params; struct edd_device_path_v3 device_path; -} __packed; - -struct edd_device_path_v4 { - uint16_t key; - uint8_t len; - uint8_t reserved[3]; - char host_bus[4]; - char interface[8]; - uint64_t interface_path; - uint64_t device_path[2]; - uint8_t reserved2[1]; - uint8_t checksum; -} __packed; - -struct edd_params_v4 { - struct edd_params params; - struct edd_device_path_v4 device_path; } __packed; #define EDD_FLAGS_DMA_BOUNDARY_HANDLING 0x0001 From owner-svn-src-head@freebsd.org Mon Oct 12 10:21:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B91124330BE for ; Mon, 12 Oct 2020 10:21:31 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8vpy6dGkz40JB; Mon, 12 Oct 2020 10:21:30 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id 09CAL7m7047646 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Oct 2020 10:21:10 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: danfe@freebsd.org Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.16.1/8.16.1) with ESMTPS id 09CALBxh001480 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 12 Oct 2020 17:21:11 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r366626 - head/sbin/reboot To: Alexey Dokuchaev , Warner Losh References: <202010111040.09BAeCfg073782@repo.freebsd.org> <8601CC07-3A43-461A-915C-3CB68BADF41A@me.com> <20201011130151.GA32755@FreeBSD.org> <35355AD6-42C6-48A2-8FCF-A371A82D683A@me.com> <20201011133023.GA67893@FreeBSD.org> <20201012021324.GA38670@FreeBSD.org> <20201012033333.GB38670@FreeBSD.org> Cc: Kyle Evans , Toomas Soome , src-committers , svn-src-all , svn-src-head From: Eugene Grosbein Message-ID: <4b263aa7-a56a-7c3a-e97f-172d4451e2d0@grosbein.net> Date: Mon, 12 Oct 2020 17:21:04 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20201012033333.GB38670@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains * -0.0 NICE_REPLY_A Looks like a legit reply (A) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 4C8vpy6dGkz40JB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-2.37 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[eugen]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-0.91)[-0.906]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; NEURAL_HAM_LONG(-0.95)[-0.951]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; R_SPF_PERMFAIL(0.00)[empty SPF record]; NEURAL_HAM_SHORT(-0.42)[-0.416]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; FREEMAIL_CC(0.00)[freebsd.org,me.com]; MAILMAN_DEST(0.00)[svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 10:21:31 -0000 12.10.2020 10:33, Alexey Dokuchaev wrote: > On Sun, Oct 11, 2020 at 09:17:42PM -0600, Warner Losh wrote: >> On Sun, Oct 11, 2020, 8:13 PM Alexey Dokuchaev wrote: >>> ... >>> I still don't understand how could rm be better than graceful disabling >>> alternative configuration with nextboot_enable="NO". I most certainly >>> do *not* like when my custom config files are being removed, especially >>> silently. When I see nextboot_enable="NO" I know that the file >>> had been processed, and processed by the machine, not me (since I would >>> never add trailing space). When I don't see the file, I'd be questioning >>> myself if I've ever added it here, or maybe I put in the wrong location. >> >> Nextboot.conf is special. It will be deleted. It doesn't belong to you, it >> belongs to nextboot(8). > > OK, I see your point. > >>> Personally I find them quite useful, except when they contradict the >>> reality (like this time). In these cases, I'd fix them. >> >> For now, it's fine. Note that testing kernel sometimes *requires* additional set of loader settings like kernel parameter tuning and/or set of kernel modules loaded including NICs or GEOMs like gjournal/graid that may affect boot process. And our loader does apply such settings when processing nextboot.conf. Maybe this is the reason nextboot.conf should be removed after it fired once. I personally edit it manually every time I use this feature and I keep a copy of the file with distinct name to restore it for another run. From owner-svn-src-head@freebsd.org Mon Oct 12 10:42:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 168B3433717; Mon, 12 Oct 2020 10:42:16 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8wGv6jfJz41fy; Mon, 12 Oct 2020 10:42:15 +0000 (UTC) (envelope-from arichardson@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 B0430B4A3; Mon, 12 Oct 2020 10:42:15 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09CAgFKY071435; Mon, 12 Oct 2020 10:42:15 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09CAgFYw071433; Mon, 12 Oct 2020 10:42:15 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202010121042.09CAgFYw071433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 12 Oct 2020 10:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366632 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 366632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 10:42:16 -0000 Author: arichardson Date: Mon Oct 12 10:42:14 2020 New Revision: 366632 URL: https://svnweb.freebsd.org/changeset/base/366632 Log: Fix building on Linux/macOS after r366622 We have to bootstrap arc4random.c, so guard the FenestrasX code to avoid using it on Linux/macOS. Reviewed By: cem Differential Revision: https://reviews.freebsd.org/D26738 Modified: head/lib/libc/gen/arc4random.c head/lib/libc/gen/arc4random.h Modified: head/lib/libc/gen/arc4random.c ============================================================================== --- head/lib/libc/gen/arc4random.c Mon Oct 12 09:34:50 2020 (r366631) +++ head/lib/libc/gen/arc4random.c Mon Oct 12 10:42:14 2020 (r366632) @@ -46,6 +46,11 @@ __FBSDID("$FreeBSD$"); #define CHACHA_EMBED #define KEYSTREAM_ONLY +#if defined(__FreeBSD__) +#define ARC4RANDOM_FXRNG 1 +#else +#define ARC4RANDOM_FXRNG 0 +#endif #include "chacha.c" #define minimum(a, b) ((a) < (b) ? (a) : (b)) Modified: head/lib/libc/gen/arc4random.h ============================================================================== --- head/lib/libc/gen/arc4random.h Mon Oct 12 09:34:50 2020 (r366631) +++ head/lib/libc/gen/arc4random.h Mon Oct 12 10:42:14 2020 (r366632) @@ -27,9 +27,11 @@ #include #include #include +#if ARC4RANDOM_FXRNG != 0 #include /* for sys/vdso.h only. */ #include #include +#endif #include #include @@ -37,6 +39,7 @@ #include #include +#if ARC4RANDOM_FXRNG != 0 /* * The kernel root seed version is a 64-bit counter, but we truncate it to a * 32-bit value in userspace for the convenience of 32-bit platforms. 32-bit @@ -51,6 +54,7 @@ */ #define fxrng_load_acq_generation(x) atomic_load_acq_32(x) static struct vdso_fxrng_generation_1 *vdso_fxrngp; +#endif static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; #define _ARC4_LOCK() \ @@ -74,6 +78,7 @@ _getentropy_fail(void) static inline void _rs_initialize_fxrng(void) { +#if ARC4RANDOM_FXRNG != 0 struct vdso_fxrng_generation_1 *fxrngp; int error; @@ -91,6 +96,7 @@ _rs_initialize_fxrng(void) return; vdso_fxrngp = fxrngp; +#endif } static inline int @@ -131,13 +137,14 @@ _rs_forkdetect(void) /* Detect fork (minherit(2) INHERIT_ZERO). */ if (__predict_false(rs == NULL || rsx == NULL)) return; +#if ARC4RANDOM_FXRNG != 0 /* If present, detect kernel FenestrasX seed version change. */ if (vdso_fxrngp == NULL) return; if (__predict_true(rsx->rs_seed_generation == fxrng_load_acq_generation(&vdso_fxrngp->fx_generation32))) return; - +#endif /* Invalidate rs_buf to force "stir" (reseed). */ memset(rs, 0, sizeof(*rs)); } From owner-svn-src-head@freebsd.org Mon Oct 12 10:42:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B994243362B; Mon, 12 Oct 2020 10:42:20 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8wH03TVqz41jg; Mon, 12 Oct 2020 10:42:20 +0000 (UTC) (envelope-from arichardson@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 4D372B684; Mon, 12 Oct 2020 10:42:20 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09CAgKGR071489; Mon, 12 Oct 2020 10:42:20 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09CAgKVQ071488; Mon, 12 Oct 2020 10:42:20 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202010121042.09CAgKVQ071488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 12 Oct 2020 10:42:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366633 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 366633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 10:42:21 -0000 Author: arichardson Date: Mon Oct 12 10:42:19 2020 New Revision: 366633 URL: https://svnweb.freebsd.org/changeset/base/366633 Log: Don't use install(1) for the library symlinks in the build directory It appears this was changed from ln to use install in rS245752. I noticed this because my buildenv was setting INSTALL=install -U -M //METALOG and then these links fail to be created with the following error: install: open //METALOG: Permission denied Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D26618 Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Mon Oct 12 10:42:14 2020 (r366632) +++ head/share/mk/bsd.lib.mk Mon Oct 12 10:42:19 2020 (r366633) @@ -312,7 +312,8 @@ ${SHLIB_NAME_FULL}: ${SOBJS} @${ECHO} building shared library ${SHLIB_NAME} @rm -f ${SHLIB_NAME} ${SHLIB_LINK} .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) && ${MK_DEBUG_FILES} == "no" - @${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${SHLIB_NAME} ${SHLIB_LINK} + # Note: This uses ln instead of ${INSTALL_LIBSYMLINK} since we are in OBJDIR + @${LN:Uln} -fs ${SHLIB_NAME} ${SHLIB_LINK} .endif ${_LD:N${CCACHE_BIN}} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ -o ${.TARGET} -Wl,-soname,${SONAME} ${SOBJS} ${LDADD} @@ -326,7 +327,8 @@ ${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \ ${SHLIB_NAME_FULL} ${.TARGET} .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) - @${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${SHLIB_NAME} ${SHLIB_LINK} + # Note: This uses ln instead of ${INSTALL_LIBSYMLINK} since we are in OBJDIR + @${LN:Uln} -fs ${SHLIB_NAME} ${SHLIB_LINK} .endif ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} From owner-svn-src-head@freebsd.org Mon Oct 12 10:42:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1205433637; Mon, 12 Oct 2020 10:42:25 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8wH52Lgtz41k5; Mon, 12 Oct 2020 10:42:25 +0000 (UTC) (envelope-from arichardson@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 EE54FB26C; Mon, 12 Oct 2020 10:42:24 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09CAgO6M071543; Mon, 12 Oct 2020 10:42:24 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09CAgOYV071542; Mon, 12 Oct 2020 10:42:24 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202010121042.09CAgOYV071542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 12 Oct 2020 10:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366634 - head/contrib/nvi/common X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/contrib/nvi/common X-SVN-Commit-Revision: 366634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 10:42:26 -0000 Author: arichardson Date: Mon Oct 12 10:42:24 2020 New Revision: 366634 URL: https://svnweb.freebsd.org/changeset/base/366634 Log: Fix buildworld on Linux/macOS after nvi update This re-applies r365941 which was lost in the nvi update. Modified: head/contrib/nvi/common/common.h Modified: head/contrib/nvi/common/common.h ============================================================================== --- head/contrib/nvi/common/common.h Mon Oct 12 10:42:19 2020 (r366633) +++ head/contrib/nvi/common/common.h Mon Oct 12 10:42:24 2020 (r366634) @@ -14,7 +14,7 @@ #ifdef __linux__ #include "/usr/include/db1/db.h" /* Only include db1. */ #else -#include "/usr/include/db.h" /* Only include db1. */ +#include /* Only include db1. */ #endif #include /* May refer to the bundled regex. */ From owner-svn-src-head@freebsd.org Mon Oct 12 10:42:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D248433645; Mon, 12 Oct 2020 10:42:34 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8wHF2Pjcz41pV; Mon, 12 Oct 2020 10:42:33 +0000 (UTC) (envelope-from arichardson@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 60557B68A; Mon, 12 Oct 2020 10:42:29 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09CAgTVR071597; Mon, 12 Oct 2020 10:42:29 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09CAgT0p071596; Mon, 12 Oct 2020 10:42:29 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202010121042.09CAgT0p071596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 12 Oct 2020 10:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366635 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 366635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 10:42:34 -0000 Author: arichardson Date: Mon Oct 12 10:42:28 2020 New Revision: 366635 URL: https://svnweb.freebsd.org/changeset/base/366635 Log: Fix build with -DBOOTSTRAP_ALL_TOOLS sbin/sysctl can no longer be bootstrapped on FreeBSD 12 after r366465, so create a symlink to the host tool instead of trying to build it. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Oct 12 10:42:24 2020 (r366634) +++ head/Makefile.inc1 Mon Oct 12 10:42:28 2020 (r366635) @@ -2330,7 +2330,10 @@ _basic_bootstrap_tools+=usr.bin/ldd .endif # sysctl/chflags are required for installkernel: .if !defined(CROSSBUILD_HOST) -_basic_bootstrap_tools+=sbin/sysctl bin/chflags +_basic_bootstrap_tools+=bin/chflags +# Note: sysctl does not bootstrap on FreeBSD < 13 anymore, but that doesn't +# matter since we don't need any of the new features for the build. +_bootstrap_tools_links+=sysctl .else # When building on non-FreeBSD, install a fake chflags instead since the # version from the source tree cannot work. We also don't need sysctl since we From owner-svn-src-head@freebsd.org Mon Oct 12 10:42:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABC804334C0; Mon, 12 Oct 2020 10:42:38 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8wHL0Dlfz42F5; Mon, 12 Oct 2020 10:42:37 +0000 (UTC) (envelope-from arichardson@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 EB772B274; Mon, 12 Oct 2020 10:42:33 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09CAgXqB071650; Mon, 12 Oct 2020 10:42:33 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09CAgXNt071649; Mon, 12 Oct 2020 10:42:33 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202010121042.09CAgXNt071649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 12 Oct 2020 10:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366636 - head/lib/libclang_rt X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/lib/libclang_rt X-SVN-Commit-Revision: 366636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 10:42:38 -0000 Author: arichardson Date: Mon Oct 12 10:42:33 2020 New Revision: 366636 URL: https://svnweb.freebsd.org/changeset/base/366636 Log: Enable SUBDIR_PARELLEL in lib/libclang_rt I noticed that this part of the build was taking much longer than expected. Turns out it's due to not running the subdirs in parallel. Reduces `make all` inside lib/libclang_rt time from 63s to 20s with -j32. Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D26623 Modified: head/lib/libclang_rt/Makefile Modified: head/lib/libclang_rt/Makefile ============================================================================== --- head/lib/libclang_rt/Makefile Mon Oct 12 10:42:28 2020 (r366635) +++ head/lib/libclang_rt/Makefile Mon Oct 12 10:42:33 2020 (r366636) @@ -32,4 +32,6 @@ SUBDIR+= xray-profiling SUBDIR+= profile +SUBDIR_PARALLEL= + .include From owner-svn-src-head@freebsd.org Mon Oct 12 11:27:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C0A543435C; Mon, 12 Oct 2020 11:27:09 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8xGh6Whxz44mp; Mon, 12 Oct 2020 11:27:08 +0000 (UTC) (envelope-from arichardson@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 C35D1BA4C; Mon, 12 Oct 2020 11:27:08 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09CBR8SL097256; Mon, 12 Oct 2020 11:27:08 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09CBR8j7097255; Mon, 12 Oct 2020 11:27:08 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202010121127.09CBR8j7097255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 12 Oct 2020 11:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366644 - in head/stand/efi: boot1 loader X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head/stand/efi: boot1 loader X-SVN-Commit-Revision: 366644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 11:27:09 -0000 Author: arichardson Date: Mon Oct 12 11:27:08 2020 New Revision: 366644 URL: https://svnweb.freebsd.org/changeset/base/366644 Log: Link efi programs with -pie rather than -shared This was causing build failures in CheriBSD where we were passing -pie already by default. Reviewed By: andrew Differential Revision: https://reviews.freebsd.org/D24787 Modified: head/stand/efi/boot1/Makefile head/stand/efi/loader/Makefile Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Mon Oct 12 11:04:52 2020 (r366643) +++ head/stand/efi/boot1/Makefile Mon Oct 12 11:27:08 2020 (r366644) @@ -63,7 +63,7 @@ FILES= ${BOOT1}.efi FILESMODE_${BOOT1}.efi= ${BINMODE} LDSCRIPT= ${EFISRC}/loader/arch/${MACHINE}/ldscript.${MACHINE} -LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared +LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS+= -mgeneral-regs-only Modified: head/stand/efi/loader/Makefile ============================================================================== --- head/stand/efi/loader/Makefile Mon Oct 12 11:04:52 2020 (r366643) +++ head/stand/efi/loader/Makefile Mon Oct 12 11:27:08 2020 (r366644) @@ -82,7 +82,7 @@ LINKS+= ${BINDIR}/${LOADER}.efi ${BINDIR}/loader.efi .endif LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} -LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared +LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie CLEANFILES+= loader.efi From owner-svn-src-head@freebsd.org Mon Oct 12 12:39:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE560436CF2; Mon, 12 Oct 2020 12:39:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8ytK4Mx8z49ZH; Mon, 12 Oct 2020 12:39:37 +0000 (UTC) (envelope-from kp@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 74C27CB8D; Mon, 12 Oct 2020 12:39:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09CCdboZ040382; Mon, 12 Oct 2020 12:39:37 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09CCdbSm040381; Mon, 12 Oct 2020 12:39:37 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202010121239.09CCdbSm040381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 12 Oct 2020 12:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366647 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 366647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 12:39:37 -0000 Author: kp Date: Mon Oct 12 12:39:37 2020 New Revision: 366647 URL: https://svnweb.freebsd.org/changeset/base/366647 Log: pf: create a kif for flags If userspace tries to set flags (e.g. 'set skip on ') and doesn't exist we should create a kif so that we apply the flags when the does turn up. Otherwise we'd end up in surprising situations where the rules say the interface should be skipped, but it's not until the rules get re-applied. Reviewed by: Lutz Donnerhacke MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26742 Modified: head/sys/netpfil/pf/pf_if.c Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Mon Oct 12 11:40:43 2020 (r366646) +++ head/sys/netpfil/pf/pf_if.c Mon Oct 12 12:39:37 2020 (r366647) @@ -801,9 +801,16 @@ int pfi_set_flags(const char *name, int flags) { struct epoch_tracker et; - struct pfi_kif *p; + struct pfi_kif *p, *kif; + kif = malloc(sizeof(*kif), PFI_MTYPE, M_NOWAIT); + if (kif == NULL) + return (ENOMEM); + NET_EPOCH_ENTER(et); + + kif = pfi_kif_attach(kif, name); + RB_FOREACH(p, pfi_ifhead, &V_pfi_ifs) { if (pfi_skip_if(name, p)) continue; @@ -817,13 +824,20 @@ int pfi_clear_flags(const char *name, int flags) { struct epoch_tracker et; - struct pfi_kif *p; + struct pfi_kif *p, *tmp; NET_EPOCH_ENTER(et); - RB_FOREACH(p, pfi_ifhead, &V_pfi_ifs) { + RB_FOREACH_SAFE(p, pfi_ifhead, &V_pfi_ifs, tmp) { if (pfi_skip_if(name, p)) continue; p->pfik_flags &= ~flags; + + if (p->pfik_ifp == NULL && p->pfik_group == NULL && + p->pfik_flags == 0) { + /* Delete this kif. */ + RB_REMOVE(pfi_ifhead, &V_pfi_ifs, p); + free(p, PFI_MTYPE); + } } NET_EPOCH_EXIT(et); return (0); From owner-svn-src-head@freebsd.org Mon Oct 12 12:41:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 633D1436D2C; Mon, 12 Oct 2020 12:41:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8yw720qyz49f4; Mon, 12 Oct 2020 12:41:11 +0000 (UTC) (envelope-from kp@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 286FFC7F2; Mon, 12 Oct 2020 12:41:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09CCfBt9042121; Mon, 12 Oct 2020 12:41:11 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09CCfBOu042120; Mon, 12 Oct 2020 12:41:11 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202010121241.09CCfBOu042120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 12 Oct 2020 12:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366648 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 366648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 12:41:11 -0000 Author: kp Date: Mon Oct 12 12:41:10 2020 New Revision: 366648 URL: https://svnweb.freebsd.org/changeset/base/366648 Log: pf tests: Test that 'set skip on ' works on new group members There's a know issue where new group members don't get the 'set skip on' applied until the rules are re-loaded. Do this by setting rules that block all traffic, but skip members of the 'epair' group. If we can communicate over the epair interface we know the set skip rule took effect, even if the rule was set before the interface was created. MFC after: 2 weeks Modified: head/tests/sys/netpfil/pf/set_skip.sh Modified: head/tests/sys/netpfil/pf/set_skip.sh ============================================================================== --- head/tests/sys/netpfil/pf/set_skip.sh Mon Oct 12 12:39:37 2020 (r366647) +++ head/tests/sys/netpfil/pf/set_skip.sh Mon Oct 12 12:41:10 2020 (r366648) @@ -85,8 +85,41 @@ set_skip_group_lo_cleanup() pft_cleanup } +atf_test_case "set_skip_dynamic" "cleanup" +set_skip_dynamic_head() +{ + atf_set descr "Cope with group changes" + atf_set require.user root +} + +set_skip_dynamic_body() +{ + pft_init + + set -x + + vnet_mkjail alcatraz + jexec alcatraz pfctl -e + pft_set_rules alcatraz "set skip on epair" \ + "block" + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.2/24 up + ifconfig ${epair}b vnet alcatraz + + jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up + + atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 192.0.2.2 +} + +set_skip_dynamic_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "set_skip_group" atf_add_test_case "set_skip_group_lo" + atf_add_test_case "set_skip_dynamic" } From owner-svn-src-head@freebsd.org Mon Oct 12 13:55:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2246243882C for ; Mon, 12 Oct 2020 13:55:27 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C90Yp2j18z4Fdb for ; Mon, 12 Oct 2020 13:55:26 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f45.google.com with SMTP id s9so7205167wro.8 for ; Mon, 12 Oct 2020 06:55:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ardN/b4qBBCaQBGCWzvr8BXozcrBZWW9aokXQEV8sUk=; b=bxuwvj9yzlQS2T50oW0PBj68moyMA/WC4RBdPXcKUfyoH5as8VjBwPK8TY5bSsiFrI 4A/ysjQXPPGUnYQV5Tey2iJxh320NxgoqQSXpjmx76CsKHnPQ9+ggL76ksh0wPI9JFgv RapHDotvI4g94rAzm2G57IbzNakwkr5y3J/jLhP6I4lJnuOCxRUyEYZUF2be7QSjd2aW mKcoJd60coBQPbGtXFzidDhEgFWy/F5m+LUlG67SS6w5acxKeeSW3cLtJR6zcv1BaP1a xDwseinTwUtcQKwBdy74ek9ZDNJ3NO40KJv60vL91J401SBKG1AO24xzN8Oexop4CKzS +9Ew== X-Gm-Message-State: AOAM533XRyWX/MCsWi+KxXVvOBjJKHDELDqA4LS6oNQD4KDDADVBPKjV JMfv+c/2dyBYt9fLvKuO3Vm2pw== X-Google-Smtp-Source: ABdhPJwvVgpPrBb1v9ORBmbaM71NQgvgkJhF+duYOComuoOosbzdwdodDk0lko+QA11QVHRf3haDUA== X-Received: by 2002:adf:bbd2:: with SMTP id z18mr32209101wrg.166.1602510924663; Mon, 12 Oct 2020 06:55:24 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id n4sm10148494wrr.91.2020.10.12.06.55.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2020 06:55:23 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r366634 - head/contrib/nvi/common From: Jessica Clarke In-Reply-To: <202010121042.09CAgOYV071542@repo.freebsd.org> Date: Mon, 12 Oct 2020 14:55:21 +0100 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: References: <202010121042.09CAgOYV071542@repo.freebsd.org> To: Alex Richardson X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4C90Yp2j18z4Fdb X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.45 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-1.89 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.41)[-0.405]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.01)[-1.010]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-0.97)[-0.971]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.45:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.45:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 13:55:27 -0000 On 12 Oct 2020, at 11:42, Alex Richardson wrote: > --- head/contrib/nvi/common/common.h Mon Oct 12 10:42:19 2020 (r366633) > +++ head/contrib/nvi/common/common.h Mon Oct 12 10:42:24 2020 (r366634) > @@ -14,7 +14,7 @@ > #ifdef __linux__ > #include "/usr/include/db1/db.h" /* Only include db1. */ > #else > -#include "/usr/include/db.h" /* Only include db1. */ > +#include /* Only include db1. */ > #endif Can this not be expressed more nicely as the following? /* Only include db1 */ #if __has_include() #include #else #include #endif Jess From owner-svn-src-head@freebsd.org Mon Oct 12 13:57:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8E80438578; Mon, 12 Oct 2020 13:57:48 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C90cX2zlGz4Fpx; Mon, 12 Oct 2020 13:57:48 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f41.google.com with SMTP id u8so23341086ejg.1; Mon, 12 Oct 2020 06:57:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=w3cntkWgkptBUAAQjjl2bbOjuqrRsZ5T/RIeYSUgNqc=; b=QGp9IcMwaifZwHwR1yuLgbrjDM0fCXjCas60vb9nGQjDGvvW1mlEMZDqK1uz4CN2+D DnPJK3FePn+g3338g5MtmljQH908dicpd/6zRSmdhsadisFCzHWhZY/S8GqFVaBo9fum jsePYbBth45zNHYR0EXnQMNcx2qBbNgO5woPqquEBeMUI9+bNYI0E1uLIaJYPNg+f2hJ 1A+8+sWbgzMXe85RmggmivFHtv/TD7DQW2elBz0U2l6KxE4RljIlCkd300nCM2HB6H8g MMlNwoXEMbj351qJWx6qYID3Sd6m9f+7S4g8XI1JCOEosGwRqi+lhsGYUHyednorOmHv w2vQ== X-Gm-Message-State: AOAM533Hgx6slgEwIAm2QTTQ23SGejtDjjoqK9SP6VsWJ31eWjrMoSQh XCZdJO1n53L59rKD6+hdKs/R/u7d9+pkqQ== X-Google-Smtp-Source: ABdhPJxP72vpAxibhqSkho2k99YRL6ZPuliUnR2ueeCgIQ4B2pf/vDTk1F13slu2UB+LuYL24Bg6oQ== X-Received: by 2002:a17:906:fb86:: with SMTP id lr6mr27973002ejb.510.1602511066806; Mon, 12 Oct 2020 06:57:46 -0700 (PDT) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com. [209.85.128.47]) by smtp.gmail.com with ESMTPSA id rs18sm10783007ejb.69.2020.10.12.06.57.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Oct 2020 06:57:46 -0700 (PDT) Received: by mail-wm1-f47.google.com with SMTP id b127so4818844wmb.3; Mon, 12 Oct 2020 06:57:46 -0700 (PDT) X-Received: by 2002:a05:600c:2707:: with SMTP id 7mr11233878wmm.147.1602511066042; Mon, 12 Oct 2020 06:57:46 -0700 (PDT) MIME-Version: 1.0 References: <202010121042.09CAgOYV071542@repo.freebsd.org> In-Reply-To: From: Alexander Richardson Date: Mon, 12 Oct 2020 14:57:35 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366634 - head/contrib/nvi/common To: Jessica Clarke Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4C90cX2zlGz4Fpx X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 13:57:48 -0000 On Mon, 12 Oct 2020 at 14:55, Jessica Clarke wrote: > > On 12 Oct 2020, at 11:42, Alex Richardson wrote: > > --- head/contrib/nvi/common/common.h Mon Oct 12 10:42:19 2020 (r366633) > > +++ head/contrib/nvi/common/common.h Mon Oct 12 10:42:24 2020 (r366634) > > @@ -14,7 +14,7 @@ > > #ifdef __linux__ > > #include "/usr/include/db1/db.h" /* Only include db1. */ > > #else > > -#include "/usr/include/db.h" /* Only include db1. */ > > +#include /* Only include db1. */ > > #endif > > Can this not be expressed more nicely as the following? > > /* Only include db1 */ > #if __has_include() > #include > #else > #include > #endif > > Jess > Yes it could, but I'd prefer it if upstream fixes it instead so we can drop this diff. See also https://github.com/lichray/nvi2/issues/69. From owner-svn-src-head@freebsd.org Mon Oct 12 18:02:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93BAE43D1C8; Mon, 12 Oct 2020 18:02:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C963J3QzDz4Vwm; Mon, 12 Oct 2020 18:02:52 +0000 (UTC) (envelope-from ian@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 58F88104AA; Mon, 12 Oct 2020 18:02:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09CI2qL2043787; Mon, 12 Oct 2020 18:02:52 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09CI2qlo043786; Mon, 12 Oct 2020 18:02:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202010121802.09CI2qlo043786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 12 Oct 2020 18:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366652 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 366652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 18:02:52 -0000 Author: ian Date: Mon Oct 12 18:02:51 2020 New Revision: 366652 URL: https://svnweb.freebsd.org/changeset/base/366652 Log: Bug fixes for the ads111x driver... make configurable gain and sample rate hints work on per-channel basis as documented, rather than chip-wide. Also, when configured via hints, return BUS_PROBE_NOWILDCARD on successful hints match, so that the hints don't bogusly match other types of i2c chips. Modified: head/sys/dev/iicbus/ads111x.c Modified: head/sys/dev/iicbus/ads111x.c ============================================================================== --- head/sys/dev/iicbus/ads111x.c Mon Oct 12 17:43:38 2020 (r366651) +++ head/sys/dev/iicbus/ads111x.c Mon Oct 12 18:02:51 2020 (r366652) @@ -456,12 +456,15 @@ ads111x_add_channels(struct ads111x_softc *sc) name = device_get_name(sc->dev); unit = device_get_unit(sc->dev); for (chan = 0; chan < sc->chipinfo->numchan; ++chan) { + char resname[16]; found = false; gainidx = DEFAULT_GAINIDX; rateidx = DEFAULT_RATEIDX; - if (resource_int_value(name, unit, "gain_index", &gainidx) == 0) + snprintf(resname, sizeof(resname), "%d.gain_index", chan); + if (resource_int_value(name, unit, resname, &gainidx) == 0) found = true; - if (resource_int_value(name, unit, "rate_index", &gainidx) == 0) + snprintf(resname, sizeof(resname), "%d.rate_index", chan); + if (resource_int_value(name, unit, resname, &rateidx) == 0) found = true; if (found) { ads111x_setup_channel(sc, chan, gainidx, rateidx); @@ -522,7 +525,11 @@ ads111x_probe(device_t dev) info = ads111x_find_chipinfo(dev); if (info != NULL) { device_set_desc(dev, info->name); +#ifdef FDT return (BUS_PROBE_DEFAULT); +#else + return (BUS_PROBE_NOWILDCARD); +#endif } return (ENXIO); From owner-svn-src-head@freebsd.org Mon Oct 12 21:35:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10C084289E9; Mon, 12 Oct 2020 21:35:31 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9Bmf6cv5z3SY3; Mon, 12 Oct 2020 21:35:30 +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 C255312AB5; Mon, 12 Oct 2020 21:35:30 +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 09CLZU3O073519; Mon, 12 Oct 2020 21:35:30 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09CLZTSD073511; Mon, 12 Oct 2020 21:35:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202010122135.09CLZTSD073511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 12 Oct 2020 21:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366655 - in head: contrib/llvm-project/clang/include/clang/Driver contrib/llvm-project/clang/lib/Driver/ToolChains contrib/llvm-project/llvm/lib/CodeGen contrib/llvm-project/llvm/lib/C... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm-project/clang/include/clang/Driver contrib/llvm-project/clang/lib/Driver/ToolChains contrib/llvm-project/llvm/lib/CodeGen contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG lib/c... X-SVN-Commit-Revision: 366655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 21:35:31 -0000 Author: dim Date: Mon Oct 12 21:35:29 2020 New Revision: 366655 URL: https://svnweb.freebsd.org/changeset/base/366655 Log: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp release/11.x llvmorg-11.0.0-0-g176249bd673 (aka 11.0.0 release). MFC after: 4 weeks X-MFC-With: r364284 Modified: head/contrib/llvm-project/clang/include/clang/Driver/Options.td head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp head/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp head/lib/clang/include/VCSVersion.inc head/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: head/contrib/llvm-project/ (props changed) head/contrib/llvm-project/clang/ (props changed) head/contrib/llvm-project/llvm/ (props changed) Modified: head/contrib/llvm-project/clang/include/clang/Driver/Options.td ============================================================================== --- head/contrib/llvm-project/clang/include/clang/Driver/Options.td Mon Oct 12 21:31:49 2020 (r366654) +++ head/contrib/llvm-project/clang/include/clang/Driver/Options.td Mon Oct 12 21:35:29 2020 (r366655) @@ -1435,11 +1435,11 @@ def fno_pch_validate_input_files_content: Group, Flags<[DriverOption]>; def fpch_instantiate_templates: Flag <["-"], "fpch-instantiate-templates">, - Group, Flags<[CC1Option]>, + Group, Flags<[CC1Option, CoreOption]>, HelpText<"Instantiate templates already while building a PCH">; def fno_pch_instantiate_templates: Flag <["-"], "fno-pch-instantiate-templates">, - Group, Flags<[CC1Option]>; + Group, Flags<[CC1Option, CoreOption]>; defm pch_codegen: OptInFFlag<"pch-codegen", "Generate ", "Do not generate ", "code for uses of this PCH that assumes an explicit object file will be built for the PCH">; defm pch_debuginfo: OptInFFlag<"pch-debuginfo", "Generate ", "Do not generate ", Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Mon Oct 12 21:31:49 2020 (r366654) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Mon Oct 12 21:35:29 2020 (r366655) @@ -1197,7 +1197,11 @@ void Clang::AddPreprocessingOptions(Compilation &C, co if (YcArg && JA.getKind() >= Action::PrecompileJobClass && JA.getKind() <= Action::AssembleJobClass) { CmdArgs.push_back(Args.MakeArgString("-building-pch-with-obj")); - CmdArgs.push_back(Args.MakeArgString("-fpch-instantiate-templates")); + // -fpch-instantiate-templates is the default when creating + // precomp using /Yc + if (Args.hasFlag(options::OPT_fpch_instantiate_templates, + options::OPT_fno_pch_instantiate_templates, true)) + CmdArgs.push_back(Args.MakeArgString("-fpch-instantiate-templates")); } if (YcArg || YuArg) { StringRef ThroughHeader = YcArg ? YcArg->getValue() : YuArg->getValue(); Modified: head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon Oct 12 21:31:49 2020 (r366654) +++ head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon Oct 12 21:35:29 2020 (r366655) @@ -5751,10 +5751,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue O // If we already have the use of the negated floating constant, it is free // to negate it even it has multiple uses. - if (!Op.hasOneUse() && CFP.use_empty()) { - RemoveDeadNode(CFP); + if (!Op.hasOneUse() && CFP.use_empty()) break; - } Cost = NegatibleCost::Neutral; return CFP; } Modified: head/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp Mon Oct 12 21:31:49 2020 (r366654) +++ head/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp Mon Oct 12 21:35:29 2020 (r366655) @@ -627,6 +627,14 @@ bool TailDuplicator::shouldTailDuplicate(bool IsSimple if (PreRegAlloc && MI.isCall()) return false; + // TailDuplicator::appendCopies will erroneously place COPYs after + // INLINEASM_BR instructions after 4b0aa5724fea, which demonstrates the same + // bug that was fixed in f7a53d82c090. + // FIXME: Use findPHICopyInsertPoint() to find the correct insertion point + // for the COPY when replacing PHIs. + if (MI.getOpcode() == TargetOpcode::INLINEASM_BR) + return false; + if (MI.isBundle()) InstrCount += MI.getBundleSize(); else if (!MI.isPHI() && !MI.isMetaInstruction()) Modified: head/lib/clang/include/VCSVersion.inc ============================================================================== --- head/lib/clang/include/VCSVersion.inc Mon Oct 12 21:31:49 2020 (r366654) +++ head/lib/clang/include/VCSVersion.inc Mon Oct 12 21:35:29 2020 (r366655) @@ -1,14 +1,14 @@ // $FreeBSD$ -#define LLVM_REVISION "llvmorg-11.0.0-rc5-0-g60a25202a7d" +#define LLVM_REVISION "llvmorg-11.0.0-0-g176249bd673" #define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git" -#define CLANG_REVISION "llvmorg-11.0.0-rc5-0-g60a25202a7d" +#define CLANG_REVISION "llvmorg-11.0.0-0-g176249bd673" #define CLANG_REPOSITORY "git@github.com:llvm/llvm-project.git" // - -#define LLD_REVISION "llvmorg-11.0.0-rc5-0-g60a25202a7d-1300007" +#define LLD_REVISION "llvmorg-11.0.0-0-g176249bd673-1300007" #define LLD_REPOSITORY "FreeBSD" -#define LLDB_REVISION "llvmorg-11.0.0-rc5-0-g60a25202a7d" +#define LLDB_REVISION "llvmorg-11.0.0-0-g176249bd673" #define LLDB_REPOSITORY "git@github.com:llvm/llvm-project.git" Modified: head/lib/clang/include/llvm/Support/VCSRevision.h ============================================================================== --- head/lib/clang/include/llvm/Support/VCSRevision.h Mon Oct 12 21:31:49 2020 (r366654) +++ head/lib/clang/include/llvm/Support/VCSRevision.h Mon Oct 12 21:35:29 2020 (r366655) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define LLVM_REVISION "llvmorg-11.0.0-rc5-0-g60a25202a7d" +#define LLVM_REVISION "llvmorg-11.0.0-0-g176249bd673" #define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git" From owner-svn-src-head@freebsd.org Mon Oct 12 22:07:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EB4D4299A3; Mon, 12 Oct 2020 22:07:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9CTs0l5Sz3Tqw; Mon, 12 Oct 2020 22:07:45 +0000 (UTC) (envelope-from imp@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 F0DE512DF6; Mon, 12 Oct 2020 22:07:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09CM7iVo092242; Mon, 12 Oct 2020 22:07:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09CM7iwQ092241; Mon, 12 Oct 2020 22:07:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010122207.09CM7iwQ092241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Oct 2020 22:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366656 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 22:07:45 -0000 Author: imp Date: Mon Oct 12 22:07:44 2020 New Revision: 366656 URL: https://svnweb.freebsd.org/changeset/base/366656 Log: newbus: use ssize_t to match sb's len and size, fix ordering of space check Both s_len and s_size are ssize_t, so their differece is also more properly a ssize_t not a size_t. Also, assert that len is <= size when we enter. This should always be the case. Ensure that we have that one byte that we write to the end of the buffer before we do so, though the error should already be set on the buffer if not, and the only times we supply 'partial' buffers they should be plenty large. Reviewed by: cem, jhb (prior version, I did cem's suggestion) Differential Revsion: https://reviews.freebsd.org/D26752 Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Oct 12 21:35:29 2020 (r366655) +++ head/sys/kern/subr_bus.c Mon Oct 12 22:07:44 2020 (r366656) @@ -4956,18 +4956,19 @@ static int bus_child_pnpinfo_sb(device_t dev, struct sbuf *sb) { char *p; - size_t space; + ssize_t space; MPASS((sb->s_flags & SBUF_INCLUDENUL) == 0); + MPASS(sb->s_size >= sb->s_len); if (sb->s_error != 0) return (-1); - p = EOB(sb); - *p = '\0'; /* sbuf buffer isn't NUL terminated until sbuf_finish() */ space = SPACE(sb); if (space <= 1) { sb->s_error = ENOMEM; return (-1); } + p = EOB(sb); + *p = '\0'; /* sbuf buffer isn't NUL terminated until sbuf_finish() */ bus_child_pnpinfo_str(dev, p, space); sb->s_len += strlen(p); return (0); @@ -4985,18 +4986,19 @@ static int bus_child_location_sb(device_t dev, struct sbuf *sb) { char *p; - size_t space; + ssize_t space; MPASS((sb->s_flags & SBUF_INCLUDENUL) == 0); + MPASS(sb->s_size >= sb->s_len); if (sb->s_error != 0) return (-1); - p = EOB(sb); - *p = '\0'; /* sbuf buffer isn't NUL terminated until sbuf_finish() */ space = SPACE(sb); if (space <= 1) { sb->s_error = ENOMEM; return (-1); } + p = EOB(sb); + *p = '\0'; /* sbuf buffer isn't NUL terminated until sbuf_finish() */ bus_child_location_str(dev, p, space); sb->s_len += strlen(p); return (0); From owner-svn-src-head@freebsd.org Mon Oct 12 22:19:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 273FE429D0C; Mon, 12 Oct 2020 22:19:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9Cl60VxYz3VYY; Mon, 12 Oct 2020 22:19:14 +0000 (UTC) (envelope-from imp@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 E3D0F13795; Mon, 12 Oct 2020 22:19:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09CMJDqp098255; Mon, 12 Oct 2020 22:19:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09CMJ8JQ098226; Mon, 12 Oct 2020 22:19:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010122219.09CMJ8JQ098226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Oct 2020 22:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366657 - in head: stand/efi/boot1 stand/libsa/zfs sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/uts/common/os sys/contrib/openzfs/include/os/freebsd/linux sys/contrib/openzfs/include/... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: stand/efi/boot1 stand/libsa/zfs sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/uts/common/os sys/contrib/openzfs/include/os/freebsd/linux sys/contrib/openzfs/include/os/freebsd/spl/rpc sys/co... X-SVN-Commit-Revision: 366657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2020 22:19:14 -0000 Author: imp Date: Mon Oct 12 22:19:07 2020 New Revision: 366657 URL: https://svnweb.freebsd.org/changeset/base/366657 Log: Add zstd support to the boot loader. Add support to the _STANDALONE environment enough bits of the kernel that we can compile it. We still have a small zstd_shim.c since there were 3 items that were a bit hard to nail down and may be cleaned up in the future. These go hand in hand with a number of commits to sys/sys in the past weeks, should this need be MFCd. Discussed with: mmacy (in review and on IRC/Slack) Reviewed by: freqlabs (on openzfs repo) Differential Revision: https://reviews.freebsd.org/D26218 Added: head/stand/libsa/zfs/zstd_shim.c (contents, props changed) - copied, changed from r366656, head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem_cache.h Deleted: head/sys/cddl/contrib/opensolaris/uts/common/os/list.c Modified: head/stand/efi/boot1/Makefile head/stand/libsa/zfs/Makefile.inc head/stand/libsa/zfs/zfsimpl.c head/sys/cddl/boot/zfs/zfsimpl.h head/sys/cddl/boot/zfs/zfssubr.c head/sys/contrib/openzfs/include/os/freebsd/linux/compiler.h head/sys/contrib/openzfs/include/os/freebsd/spl/rpc/xdr.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/atomic.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/byteorder.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/condvar.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem_cache.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/proc.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/sig.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/sysmacros.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/taskq.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/uio.h head/sys/contrib/openzfs/include/sys/nvpair.h head/sys/contrib/openzfs/include/sys/zfs_context.h head/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/param.h head/sys/contrib/openzfs/module/os/freebsd/spl/list.c Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Mon Oct 12 22:07:44 2020 (r366656) +++ head/stand/efi/boot1/Makefile Mon Oct 12 22:19:07 2020 (r366657) @@ -40,6 +40,7 @@ CFLAGS.zfs_module.c+= -I${SYSDIR}/contrib/openzfs/incl CFLAGS.zfs_module.c+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/spl CFLAGS.zfs_module.c+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/contrib/opensolaris/common/lz4 +CFLAGS.zfs_module.c+= -include ${ZFSOSINC}/spl/sys/ccompile.h CFLAGS+= -DEFI_ZFS_BOOT .endif Modified: head/stand/libsa/zfs/Makefile.inc ============================================================================== --- head/stand/libsa/zfs/Makefile.inc Mon Oct 12 22:07:44 2020 (r366656) +++ head/stand/libsa/zfs/Makefile.inc Mon Oct 12 22:19:07 2020 (r366657) @@ -1,17 +1,37 @@ # $FreeBSD$ .PATH: ${ZFSSRC} -SRCS+= zfs.c nvlist.c skein.c skein_block.c list.c .PATH: ${SYSDIR}/crypto/skein -.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/os +.PATH: ${ZFSOSSRC}/spl +.PATH: ${OZFS}/module/zstd/lib +ZFSSRC= zfs.c nvlist.c skein.c skein_block.c list.c zstd_shim.c zstd.c +SRCS+= ${ZFSSRC} CFLAGS+= -I${LDRSRC} CFLAGS+= -I${SYSDIR}/cddl/boot/zfs -CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/common CFLAGS+= -I${SYSDIR}/crypto/skein +ZFS_EARLY= -I${ZFSOSINC} \ + -I${ZFSOSINC}/spl \ + -I${ZFSOSINC}/zfs + +.for i in ${ZFSSRC} +CFLAGS.$i+= -include ${ZFSOSINC}/spl/sys/ccompile.h +.endfor + +CFLAGS_EARLY.list.c+= ${ZFS_EARLY} +CFLAGS_EARLY.zstd_shim.c+= ${ZFS_EARLY} + +# Can't use the early flags because there's two conflicting definitions of boolean_t in +# the zfs code that need to be unified. +CFLAGS.nvlist.c+= -I${ZFSOSINC}/spl +CFLAGS.zfs.c+= -I${ZFSOSINC}/spl \ + -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 +CFLAGS.zstd_shim.c+= -DIN_BASE -I${OZFS}/include + # Do not unroll skein loops, reduce code size CFLAGS.skein_block.c+= -DSKEIN_LOOP=111 + CFLAGS+= -I${SYSDIR}/contrib/openzfs/include CFLAGS+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs CFLAGS.zfs.c+= -I${SYSDIR}/cddl/contrib/opensolaris/common/lz4 Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Mon Oct 12 22:07:44 2020 (r366656) +++ head/stand/libsa/zfs/zfsimpl.c Mon Oct 12 22:19:07 2020 (r366657) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "zfsimpl.h" #include "zfssubr.c" +extern int zstd_init(void); struct zfsmount { const spa_t *spa; @@ -170,6 +171,7 @@ zfs_init(void) dnode_cache_buf = malloc(SPA_MAXBLOCKSIZE); zfs_init_crc(); + zstd_init(); } static int Copied and modified: head/stand/libsa/zfs/zstd_shim.c (from r366656, head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem_cache.h) ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem_cache.h Mon Oct 12 22:07:44 2020 (r366656, copy source) +++ head/stand/libsa/zfs/zstd_shim.c Mon Oct 12 22:19:07 2020 (r366657) @@ -1,6 +1,5 @@ -/* - * Copyright (c) 2020 iXsystems, Inc. - * All rights reserved. +/*- + * Copyright (c) 2020 M. Warner Losh * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -11,10 +10,10 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) @@ -23,27 +22,19 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); +/* + * Small amount of shim code needed to get zfs_zstd.c to compile. These items + * here should all be defined in the SPL or as part of libstand somewhere, but + * aren't for reasons that haven't been tracked down yet. Ideally, they would + * all go away and we'd compile zfs_zstd.c directly. Based on an original by + * Matt Macey, but only the #include remains untouched from that. + */ -#ifndef _SPL_KMEM_CACHE_H -#define _SPL_KMEM_CACHE_H +#define ZFS_MODULE_PARAM_ARGS void +typedef int boolean_t; /* This one may be tough to get rid of */ -#include - -/* kmem move callback return values */ -typedef enum kmem_cbrc { - KMEM_CBRC_YES = 0, /* Object moved */ - KMEM_CBRC_NO = 1, /* Object not moved */ - KMEM_CBRC_LATER = 2, /* Object not moved, try again later */ - KMEM_CBRC_DONT_NEED = 3, /* Neither object is needed */ - KMEM_CBRC_DONT_KNOW = 4, /* Object unknown */ -} kmem_cbrc_t; - -extern void spl_kmem_cache_set_move(kmem_cache_t *, - kmem_cbrc_t (*)(void *, void *, size_t, void *)); - -#define kmem_cache_set_move(skc, move) spl_kmem_cache_set_move(skc, move) - -#endif +#include Modified: head/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- head/sys/cddl/boot/zfs/zfsimpl.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/cddl/boot/zfs/zfsimpl.h Mon Oct 12 22:19:07 2020 (r366657) @@ -611,7 +611,61 @@ enum zio_compress { ZIO_COMPRESS_GZIP_9, ZIO_COMPRESS_ZLE, ZIO_COMPRESS_LZ4, + ZIO_COMPRESS_ZSTD, ZIO_COMPRESS_FUNCTIONS +}; + +enum zio_zstd_levels { + ZIO_ZSTD_LEVEL_INHERIT = 0, + ZIO_ZSTD_LEVEL_1, +#define ZIO_ZSTD_LEVEL_MIN ZIO_ZSTD_LEVEL_1 + ZIO_ZSTD_LEVEL_2, + ZIO_ZSTD_LEVEL_3, +#define ZIO_ZSTD_LEVEL_DEFAULT ZIO_ZSTD_LEVEL_3 + ZIO_ZSTD_LEVEL_4, + ZIO_ZSTD_LEVEL_5, + ZIO_ZSTD_LEVEL_6, + ZIO_ZSTD_LEVEL_7, + ZIO_ZSTD_LEVEL_8, + ZIO_ZSTD_LEVEL_9, + ZIO_ZSTD_LEVEL_10, + ZIO_ZSTD_LEVEL_11, + ZIO_ZSTD_LEVEL_12, + ZIO_ZSTD_LEVEL_13, + ZIO_ZSTD_LEVEL_14, + ZIO_ZSTD_LEVEL_15, + ZIO_ZSTD_LEVEL_16, + ZIO_ZSTD_LEVEL_17, + ZIO_ZSTD_LEVEL_18, + ZIO_ZSTD_LEVEL_19, +#define ZIO_ZSTD_LEVEL_MAX ZIO_ZSTD_LEVEL_19 + ZIO_ZSTD_LEVEL_RESERVE = 101, /* Leave room for new positive levels */ + ZIO_ZSTD_LEVEL_FAST, /* Fast levels are negative */ + ZIO_ZSTD_LEVEL_FAST_1, +#define ZIO_ZSTD_LEVEL_FAST_DEFAULT ZIO_ZSTD_LEVEL_FAST_1 + ZIO_ZSTD_LEVEL_FAST_2, + ZIO_ZSTD_LEVEL_FAST_3, + ZIO_ZSTD_LEVEL_FAST_4, + ZIO_ZSTD_LEVEL_FAST_5, + ZIO_ZSTD_LEVEL_FAST_6, + ZIO_ZSTD_LEVEL_FAST_7, + ZIO_ZSTD_LEVEL_FAST_8, + ZIO_ZSTD_LEVEL_FAST_9, + ZIO_ZSTD_LEVEL_FAST_10, + ZIO_ZSTD_LEVEL_FAST_20, + ZIO_ZSTD_LEVEL_FAST_30, + ZIO_ZSTD_LEVEL_FAST_40, + ZIO_ZSTD_LEVEL_FAST_50, + ZIO_ZSTD_LEVEL_FAST_60, + ZIO_ZSTD_LEVEL_FAST_70, + ZIO_ZSTD_LEVEL_FAST_80, + ZIO_ZSTD_LEVEL_FAST_90, + ZIO_ZSTD_LEVEL_FAST_100, + ZIO_ZSTD_LEVEL_FAST_500, + ZIO_ZSTD_LEVEL_FAST_1000, +#define ZIO_ZSTD_LEVEL_FAST_MAX ZIO_ZSTD_LEVEL_FAST_1000 + ZIO_ZSTD_LEVEL_AUTO = 251, /* Reserved for future use */ + ZIO_ZSTD_LEVEL_LEVELS }; #define ZIO_COMPRESS_ON_VALUE ZIO_COMPRESS_LZJB Modified: head/sys/cddl/boot/zfs/zfssubr.c ============================================================================== --- head/sys/cddl/boot/zfs/zfssubr.c Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/cddl/boot/zfs/zfssubr.c Mon Oct 12 22:19:07 2020 (r366657) @@ -30,8 +30,6 @@ __FBSDID("$FreeBSD$"); static uint64_t zfs_crc64_table[256]; -#define ECKSUM 666 - #define ASSERT3S(x, y, z) ((void)0) #define ASSERT3U(x, y, z) ((void)0) #define ASSERT3P(x, y, z) ((void)0) @@ -107,6 +105,10 @@ typedef struct zio_checksum_info { #include "sha256.c" #include "skein_zfs.c" +extern int zfs_zstd_decompress(void *s_start, void *d_start, size_t s_len, + size_t d_len, int n); + + static zio_checksum_info_t zio_checksum_table[ZIO_CHECKSUM_FUNCTIONS] = { {{NULL, NULL}, NULL, NULL, 0, "inherit"}, {{NULL, NULL}, NULL, NULL, 0, "on"}, @@ -181,6 +183,7 @@ static zio_compress_info_t zio_compress_table[ZIO_COMP {NULL, NULL, 9, "gzip-9"}, {NULL, zle_decompress, 64, "zle"}, {NULL, lz4_decompress, 0, "lz4"}, + {NULL, zfs_zstd_decompress, ZIO_ZSTD_LEVEL_DEFAULT, "zstd"} }; static void Modified: head/sys/contrib/openzfs/include/os/freebsd/linux/compiler.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/linux/compiler.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/linux/compiler.h Mon Oct 12 22:19:07 2020 (r366657) @@ -68,7 +68,7 @@ #define noinline __noinline #define ____cacheline_aligned __aligned(CACHE_LINE_SIZE) -#ifndef _KERNEL +#if !defined(_KERNEL) && !defined(_STANDALONE) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #endif Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/rpc/xdr.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/rpc/xdr.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/rpc/xdr.h Mon Oct 12 22:19:07 2020 (r366657) @@ -33,7 +33,7 @@ #include #include_next -#ifndef _KERNEL +#if !defined(_KERNEL) && !defined(_STANDALONE) #include @@ -66,6 +66,6 @@ xdrmem_control(XDR *xdrs, int request, void *info) xdrmem_control((xdrs), (req), (op)) : \ (*(xdrs)->x_ops->x_control)(xdrs, req, op)) -#endif /* !_KERNEL */ +#endif /* !_KERNEL && !_STANDALONE */ #endif /* !_OPENSOLARIS_RPC_XDR_H_ */ Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/atomic.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/atomic.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/atomic.h Mon Oct 12 22:19:07 2020 (r366657) @@ -29,6 +29,8 @@ #ifndef _OPENSOLARIS_SYS_ATOMIC_H_ #define _OPENSOLARIS_SYS_ATOMIC_H_ +#ifndef _STANDALONE + #include #include @@ -178,5 +180,14 @@ atomic_cas_ptr(volatile void *target, void *cmp, void (uint32_t)cmp, (uint32_t)newval)); } #endif /* !defined(COMPAT_32BIT) && defined(__LP64__) */ + +#else /* _STANDALONE */ +/* + * sometimes atomic_add_64 is defined, sometimes not, but the + * following is always right for the boot loader. + */ +#undef atomic_add_64 +#define atomic_add_64(ptr, val) *(ptr) += val +#endif /* !_STANDALONE */ #endif /* !_OPENSOLARIS_SYS_ATOMIC_H_ */ Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/byteorder.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/byteorder.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/byteorder.h Mon Oct 12 22:19:07 2020 (r366657) @@ -80,10 +80,11 @@ #define BE_64(x) BSWAP_64(x) #endif +#if !defined(_STANDALONE) #if BYTE_ORDER == _BIG_ENDIAN #define htonll(x) BMASK_64(x) #define ntohll(x) BMASK_64(x) -#else +#else /* BYTE_ORDER == _LITTLE_ENDIAN */ #ifndef __LP64__ static __inline__ uint64_t htonll(uint64_t n) @@ -96,11 +97,12 @@ ntohll(uint64_t n) { return ((((uint64_t)ntohl(n)) << 32) + ntohl(n >> 32)); } -#else +#else /* !__LP64__ */ #define htonll(x) BSWAP_64(x) #define ntohll(x) BSWAP_64(x) -#endif -#endif +#endif /* __LP64__ */ +#endif /* BYTE_ORDER */ +#endif /* _STANDALONE */ #define BE_IN32(xa) htonl(*((uint32_t *)(void *)(xa))) Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h Mon Oct 12 22:19:07 2020 (r366657) @@ -113,9 +113,9 @@ extern "C" { #define __VPRINTFLIKE(__n) __sun_attr__((__VPRINTFLIKE__(__n))) #define __KPRINTFLIKE(__n) __sun_attr__((__KPRINTFLIKE__(__n))) #define __KVPRINTFLIKE(__n) __sun_attr__((__KVPRINTFLIKE__(__n))) -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_STANDALONE) #define __NORETURN __sun_attr__((__noreturn__)) -#endif +#endif /* _KERNEL || _STANDALONE */ #define __CONST __sun_attr__((__const__)) #define __PURE __sun_attr__((__pure__)) @@ -174,7 +174,7 @@ typedef int enum_t; #define __exit #endif -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_STANDALONE) #define param_set_charp(a, b) (0) #define ATTR_UID AT_UID #define ATTR_GID AT_GID @@ -183,9 +183,15 @@ typedef int enum_t; #define ATTR_CTIME AT_CTIME #define ATTR_MTIME AT_MTIME #define ATTR_ATIME AT_ATIME +#if defined(_STANDALONE) +#define vmem_free kmem_free +#define vmem_zalloc kmem_zalloc +#define vmem_alloc kmem_zalloc +#else #define vmem_free zfs_kmem_free #define vmem_zalloc(size, flags) zfs_kmem_alloc(size, flags | M_ZERO) #define vmem_alloc zfs_kmem_alloc +#endif #define MUTEX_NOLOCKDEP 0 #define RW_NOLOCKDEP 0 Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h Mon Oct 12 22:19:07 2020 (r366657) @@ -52,42 +52,33 @@ extern "C" { /*PRINTFLIKE2*/ extern void cmn_err(int, const char *, ...) __KPRINTFLIKE(2); -#pragma rarely_called(cmn_err) extern void vzcmn_err(zoneid_t, int, const char *, __va_list) __KVPRINTFLIKE(3); -#pragma rarely_called(vzcmn_err) extern void vcmn_err(int, const char *, __va_list) __KVPRINTFLIKE(2); -#pragma rarely_called(vcmn_err) /*PRINTFLIKE3*/ extern void zcmn_err(zoneid_t, int, const char *, ...) __KPRINTFLIKE(3); -#pragma rarely_called(zcmn_err) extern void vzprintf(zoneid_t, const char *, __va_list) __KVPRINTFLIKE(2); -#pragma rarely_called(vzprintf) /*PRINTFLIKE2*/ extern void zprintf(zoneid_t, const char *, ...) __KPRINTFLIKE(2); -#pragma rarely_called(zprintf) extern void vuprintf(const char *, __va_list) __KVPRINTFLIKE(1); -#pragma rarely_called(vuprintf) /*PRINTFLIKE1*/ extern void panic(const char *, ...) __KPRINTFLIKE(1) __NORETURN; -#pragma rarely_called(panic) extern void vpanic(const char *, __va_list) __KVPRINTFLIKE(1) __NORETURN; -#pragma rarely_called(vpanic) #endif /* !_ASM */ Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/condvar.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/condvar.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/condvar.h Mon Oct 12 22:19:07 2020 (r366657) @@ -36,6 +36,7 @@ #include #include #include +#include /* * cv_timedwait() is similar to cv_wait() except that it additionally expects Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem.h Mon Oct 12 22:19:07 2020 (r366657) @@ -29,6 +29,7 @@ #ifndef _OPENSOLARIS_SYS_KMEM_H_ #define _OPENSOLARIS_SYS_KMEM_H_ +#ifdef _KERNEL #include #include #include @@ -93,5 +94,14 @@ void *calloc(size_t n, size_t s); zfs_kmem_alloc((size), (kmflags) | M_ZERO) #define kmem_free(buf, size) zfs_kmem_free((buf), (size)) +#endif /* _KERNEL */ + +#ifdef _STANDALONE +/* + * At the moment, we just need it for the type. We redirect the alloc/free + * routines to the usual Free and Malloc in that environment. + */ +typedef int kmem_cache_t; +#endif /* _STANDALONE */ #endif /* _OPENSOLARIS_SYS_KMEM_H_ */ Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem_cache.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem_cache.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem_cache.h Mon Oct 12 22:19:07 2020 (r366657) @@ -30,6 +30,7 @@ #ifndef _SPL_KMEM_CACHE_H #define _SPL_KMEM_CACHE_H +#ifdef _KERNEL #include /* kmem move callback return values */ @@ -45,5 +46,7 @@ extern void spl_kmem_cache_set_move(kmem_cache_t *, kmem_cbrc_t (*)(void *, void *, size_t, void *)); #define kmem_cache_set_move(skc, move) spl_kmem_cache_set_move(skc, move) + +#endif /* _KERNEL */ #endif Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h Mon Oct 12 22:19:07 2020 (r366657) @@ -24,8 +24,11 @@ #ifndef _SPL_KSTAT_H #define _SPL_KSTAT_H + #include +#ifndef _STANDALONE #include +#endif struct list_head {}; #include #include @@ -129,9 +132,10 @@ struct kstat_s { kstat_raw_ops_t ks_raw_ops; /* ops table for raw type */ char *ks_raw_buf; /* buf used for raw ops */ size_t ks_raw_bufsize; /* size of raw ops buffer */ +#ifndef _STANDALONE struct sysctl_ctx_list ks_sysctl_ctx; struct sysctl_oid *ks_sysctl_root; - +#endif /* _STANDALONE */ }; typedef struct kstat_named_s { @@ -216,10 +220,16 @@ extern void kstat_runq_exit(kstat_io_t *); __kstat_set_seq_raw_ops(k, h, d, a) #define kstat_set_raw_ops(k, h, d, a) \ __kstat_set_raw_ops(k, h, d, a) +#ifndef _STANDALONE #define kstat_create(m, i, n, c, t, s, f) \ __kstat_create(m, i, n, c, t, s, f) #define kstat_install(k) __kstat_install(k) #define kstat_delete(k) __kstat_delete(k) +#else +#define kstat_create(m, i, n, c, t, s, f) ((kstat_t *)0) +#define kstat_install(k) +#define kstat_delete(k) +#endif #endif /* _SPL_KSTAT_H */ Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/proc.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/proc.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/proc.h Mon Oct 12 22:19:07 2020 (r366657) @@ -41,7 +41,7 @@ #include #include - +#ifdef _KERNEL #define CPU curcpu #define minclsyspri PRIBIO #define defclsyspri minclsyspri @@ -111,4 +111,5 @@ zfs_proc_is_caller(proc_t *p) return (p == curproc); } +#endif /* _KERNEL */ #endif /* _OPENSOLARIS_SYS_PROC_H_ */ Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/procfs_list.h Mon Oct 12 22:19:07 2020 (r366657) @@ -25,6 +25,8 @@ #ifndef _SPL_PROCFS_LIST_H #define _SPL_PROCFS_LIST_H +#ifndef _STANDALONE + #include #include @@ -63,5 +65,9 @@ void procfs_list_install(const char *module, void procfs_list_uninstall(procfs_list_t *procfs_list); void procfs_list_destroy(procfs_list_t *procfs_list); void procfs_list_add(procfs_list_t *procfs_list, void *p); + +#else +typedef int procfs_list_t; +#endif /* !_STANDALONE */ #endif /* _SPL_PROCFS_LIST_H */ Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/sig.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/sig.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/sig.h Mon Oct 12 22:19:07 2020 (r366657) @@ -29,6 +29,8 @@ #ifndef _OPENSOLARIS_SYS_SIG_H_ #define _OPENSOLARIS_SYS_SIG_H_ +#ifndef _STANDALONE + #include_next #include #include @@ -62,4 +64,7 @@ issig(int why) } return (0); } + +#endif /* !_STANDALONE */ + #endif /* _OPENSOLARIS_SYS_SIG_H_ */ Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/sysmacros.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/sysmacros.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/sysmacros.h Mon Oct 12 22:19:07 2020 (r366657) @@ -31,6 +31,7 @@ #define _SYS_SYSMACROS_H #include +#include #include #include #include @@ -71,7 +72,11 @@ extern "C" { #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #endif +#ifdef _STANDALONE +#define boot_ncpus 1 +#else /* _STANDALONE */ #define boot_ncpus mp_ncpus +#endif /* _STANDALONE */ #define kpreempt_disable() critical_enter() #define kpreempt_enable() critical_exit() #define CPU_SEQID curcpu @@ -319,7 +324,7 @@ extern unsigned char bcd_to_byte[256]; /* avoid any possibility of clashing with version */ -#define offsetof(s, m) ((size_t)(&(((s *)0)->m))) +#define offsetof(type, field) __offsetof(type, field) #endif /* Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/taskq.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/taskq.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/taskq.h Mon Oct 12 22:19:07 2020 (r366657) @@ -26,6 +26,8 @@ #ifndef _SYS_TASKQ_H #define _SYS_TASKQ_H +#ifdef _KERNEL + #include #include #include @@ -111,5 +113,12 @@ void taskq_resume(taskq_t *); #ifdef __cplusplus } #endif + +#endif /* _KERNEL */ + +#ifdef _STANDALONE +typedef int taskq_ent_t; +#define taskq_init_ent(x) +#endif /* _STANDALONE */ #endif /* _SYS_TASKQ_H */ Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/uio.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/uio.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/uio.h Mon Oct 12 22:19:07 2020 (r366657) @@ -29,6 +29,8 @@ #ifndef _OPENSOLARIS_SYS_UIO_H_ #define _OPENSOLARIS_SYS_UIO_H_ +#ifndef _STANDALONE + #include_next #include #include @@ -106,5 +108,7 @@ uio_index_at_offset(uio_t *uio, offset_t off, uint_t * return (off); } + +#endif /* !_STANDALONE */ #endif /* !_OPENSOLARIS_SYS_UIO_H_ */ Modified: head/sys/contrib/openzfs/include/sys/nvpair.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/nvpair.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/sys/nvpair.h Mon Oct 12 22:19:07 2020 (r366657) @@ -62,7 +62,7 @@ typedef enum { DATA_TYPE_UINT8, DATA_TYPE_BOOLEAN_ARRAY, DATA_TYPE_INT8_ARRAY, -#if !defined(_KERNEL) +#if !defined(_KERNEL) && !defined(_STANDALONE) DATA_TYPE_UINT8_ARRAY, DATA_TYPE_DOUBLE #else @@ -191,7 +191,7 @@ int nvlist_add_uint64_array(nvlist_t *, const char *, int nvlist_add_string_array(nvlist_t *, const char *, char *const *, uint_t); int nvlist_add_nvlist_array(nvlist_t *, const char *, nvlist_t **, uint_t); int nvlist_add_hrtime(nvlist_t *, const char *, hrtime_t); -#if !defined(_KERNEL) +#if !defined(_KERNEL) && !defined(_STANDALONE) int nvlist_add_double(nvlist_t *, const char *, double); #endif @@ -228,7 +228,7 @@ int nvlist_lookup_nvlist_array(nvlist_t *, const char nvlist_t ***, uint_t *); int nvlist_lookup_hrtime(nvlist_t *, const char *, hrtime_t *); int nvlist_lookup_pairs(nvlist_t *, int, ...); -#if !defined(_KERNEL) +#if !defined(_KERNEL) && !defined(_STANDALONE) int nvlist_lookup_double(nvlist_t *, const char *, double *); #endif @@ -269,7 +269,7 @@ int nvpair_value_uint64_array(nvpair_t *, uint64_t **, int nvpair_value_string_array(nvpair_t *, char ***, uint_t *); int nvpair_value_nvlist_array(nvpair_t *, nvlist_t ***, uint_t *); int nvpair_value_hrtime(nvpair_t *, hrtime_t *); -#if !defined(_KERNEL) +#if !defined(_KERNEL) && !defined(_STANDALONE) int nvpair_value_double(nvpair_t *, double *); #endif Modified: head/sys/contrib/openzfs/include/sys/zfs_context.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/zfs_context.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/include/sys/zfs_context.h Mon Oct 12 22:19:07 2020 (r366657) @@ -32,7 +32,15 @@ extern "C" { #endif -#ifdef __KERNEL__ +/* + * This code compiles in three different contexts. When __KERNEL__ is defined, + * the code uses "unix-like" kernel interfaces. When _STANDALONE is defined, the + * code is running in a reduced capacity environment of the boot loader which is + * generally a subset of both POSIX and kernel interfaces (with a few unique + * interfaces too). When neither are defined, it's in a userland POSIX or + * similar environment. + */ +#if defined(__KERNEL__) || defined(_STANDALONE) #include #include #include @@ -65,7 +73,7 @@ extern "C" { #include #include #include -#else /* _KERNEL */ +#else /* _KERNEL || _STANDALONE */ #define _SYS_MUTEX_H #define _SYS_RWLOCK_H @@ -759,7 +767,7 @@ extern int kmem_cache_reap_active(void); #define __init #define __exit -#endif /* _KERNEL */ +#endif /* _KERNEL || _STANDALONE */ #ifdef __cplusplus }; Modified: head/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/param.h ============================================================================== --- head/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/param.h Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/param.h Mon Oct 12 22:19:07 2020 (r366657) @@ -45,10 +45,6 @@ */ #define MAXNAMELEN 256 -#ifndef IN_BASE -#define UID_NOBODY 60001 /* user ID no body */ -#define GID_NOBODY UID_NOBODY -#endif #define UID_NOACCESS 60002 /* user ID no access */ #define MAXUID UINT32_MAX /* max user id */ Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/list.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/spl/list.c Mon Oct 12 22:07:44 2020 (r366656) +++ head/sys/contrib/openzfs/module/os/freebsd/spl/list.c Mon Oct 12 22:19:07 2020 (r366657) @@ -27,10 +27,10 @@ * Generic doubly-linked list implementation */ +#include #include #include #include -#include #include #define list_d2l(a, obj) ((list_node_t *)(((char *)obj) + (a)->list_offset)) From owner-svn-src-head@freebsd.org Tue Oct 13 02:36:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 464E342F902; Tue, 13 Oct 2020 02:36:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9KRj1B3hz40bQ; Tue, 13 Oct 2020 02:36:17 +0000 (UTC) (envelope-from imp@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 E1E7816163; Tue, 13 Oct 2020 02:36:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09D2aG4I059741; Tue, 13 Oct 2020 02:36:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09D2aG4h059738; Tue, 13 Oct 2020 02:36:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010130236.09D2aG4h059738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 13 Oct 2020 02:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366658 - in head: stand/libsa/zfs sys/cddl/boot/zfs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: stand/libsa/zfs sys/cddl/boot/zfs X-SVN-Commit-Revision: 366658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 02:36:17 -0000 Author: imp Date: Tue Oct 13 02:36:16 2020 New Revision: 366658 URL: https://svnweb.freebsd.org/changeset/base/366658 Log: Turn off zstd on aarch64 loader support for zstd and zfs doesn't work for aarch64. Disable it to unbreak the build. Modified: head/stand/libsa/zfs/Makefile.inc head/stand/libsa/zfs/zfsimpl.c head/sys/cddl/boot/zfs/zfssubr.c Modified: head/stand/libsa/zfs/Makefile.inc ============================================================================== --- head/stand/libsa/zfs/Makefile.inc Mon Oct 12 22:19:07 2020 (r366657) +++ head/stand/libsa/zfs/Makefile.inc Tue Oct 13 02:36:16 2020 (r366658) @@ -4,7 +4,11 @@ .PATH: ${SYSDIR}/crypto/skein .PATH: ${ZFSOSSRC}/spl .PATH: ${OZFS}/module/zstd/lib -ZFSSRC= zfs.c nvlist.c skein.c skein_block.c list.c zstd_shim.c zstd.c +ZFSSRC= zfs.c nvlist.c skein.c skein_block.c list.c +.if ${MACHINE_ARCH} != aarch64 +ZFSSRC+= zstd_shim.c zstd.c +CFLAGS+= -DHAS_ZSTD_ZFS +.endif SRCS+= ${ZFSSRC} CFLAGS+= -I${LDRSRC} Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Mon Oct 12 22:19:07 2020 (r366657) +++ head/stand/libsa/zfs/zfsimpl.c Tue Oct 13 02:36:16 2020 (r366658) @@ -42,7 +42,9 @@ __FBSDID("$FreeBSD$"); #include "zfsimpl.h" #include "zfssubr.c" +#ifdef HAS_ZSTD_ZFS extern int zstd_init(void); +#endif struct zfsmount { const spa_t *spa; @@ -130,7 +132,9 @@ static const char *features_for_read[] = { "com.delphix:device_removal", "com.delphix:obsolete_counts", "com.intel:allocation_classes", +#ifdef HAS_ZSTD_ZFS "org.freebsd:zstd_compress", +#endif NULL }; @@ -171,7 +175,9 @@ zfs_init(void) dnode_cache_buf = malloc(SPA_MAXBLOCKSIZE); zfs_init_crc(); +#ifdef HAS_ZSTD_ZFS zstd_init(); +#endif } static int Modified: head/sys/cddl/boot/zfs/zfssubr.c ============================================================================== --- head/sys/cddl/boot/zfs/zfssubr.c Mon Oct 12 22:19:07 2020 (r366657) +++ head/sys/cddl/boot/zfs/zfssubr.c Tue Oct 13 02:36:16 2020 (r366658) @@ -105,10 +105,11 @@ typedef struct zio_checksum_info { #include "sha256.c" #include "skein_zfs.c" +#ifdef HAS_ZSTD_ZFS extern int zfs_zstd_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n); +#endif - static zio_checksum_info_t zio_checksum_table[ZIO_CHECKSUM_FUNCTIONS] = { {{NULL, NULL}, NULL, NULL, 0, "inherit"}, {{NULL, NULL}, NULL, NULL, 0, "on"}, @@ -183,7 +184,9 @@ static zio_compress_info_t zio_compress_table[ZIO_COMP {NULL, NULL, 9, "gzip-9"}, {NULL, zle_decompress, 64, "zle"}, {NULL, lz4_decompress, 0, "lz4"}, +#ifdef HAS_ZSTD_ZFS {NULL, zfs_zstd_decompress, ZIO_ZSTD_LEVEL_DEFAULT, "zstd"} +#endif }; static void From owner-svn-src-head@freebsd.org Tue Oct 13 03:49:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D9CF430646; Tue, 13 Oct 2020 03:49:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9M3s19jBz43cd; Tue, 13 Oct 2020 03:49:13 +0000 (UTC) (envelope-from imp@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 0705B16ECD; Tue, 13 Oct 2020 03:49:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09D3nCpK004204; Tue, 13 Oct 2020 03:49:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09D3nC87004203; Tue, 13 Oct 2020 03:49:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010130349.09D3nC87004203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 13 Oct 2020 03:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366659 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 366659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 03:49:13 -0000 Author: imp Date: Tue Oct 13 03:49:12 2020 New Revision: 366659 URL: https://svnweb.freebsd.org/changeset/base/366659 Log: Add back org.freebsd:zstd_compress to features_for_read This list is the of features that are allowed on the whole pool, not the list of features that are implemented. Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Tue Oct 13 02:36:16 2020 (r366658) +++ head/stand/libsa/zfs/zfsimpl.c Tue Oct 13 03:49:12 2020 (r366659) @@ -132,9 +132,7 @@ static const char *features_for_read[] = { "com.delphix:device_removal", "com.delphix:obsolete_counts", "com.intel:allocation_classes", -#ifdef HAS_ZSTD_ZFS "org.freebsd:zstd_compress", -#endif NULL }; From owner-svn-src-head@freebsd.org Tue Oct 13 04:37:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DE1A431FE7; Tue, 13 Oct 2020 04:37:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9N860MHkz467H; Tue, 13 Oct 2020 04:37:58 +0000 (UTC) (envelope-from imp@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 E518717A56; Tue, 13 Oct 2020 04:37:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09D4bvXf034680; Tue, 13 Oct 2020 04:37:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09D4bvV1034679; Tue, 13 Oct 2020 04:37:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010130437.09D4bvV1034679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 13 Oct 2020 04:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366660 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 366660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 04:37:58 -0000 Author: imp Date: Tue Oct 13 04:37:57 2020 New Revision: 366660 URL: https://svnweb.freebsd.org/changeset/base/366660 Log: Force __BMI__ experimental instructions off. The OpenZFS code that uses the BMI instructions is broken. Forcibly disable them to prevent their use. When enabled, the build breaks. This fixes the build when compiled for a core with BMI instructions. This is the same fix committed in r364777, for the same issue. Submitted by: Jung-uk Kim Modified: head/stand/libsa/zfs/Makefile.inc Modified: head/stand/libsa/zfs/Makefile.inc ============================================================================== --- head/stand/libsa/zfs/Makefile.inc Tue Oct 13 03:49:12 2020 (r366659) +++ head/stand/libsa/zfs/Makefile.inc Tue Oct 13 04:37:57 2020 (r366660) @@ -31,6 +31,7 @@ CFLAGS_EARLY.zstd_shim.c+= ${ZFS_EARLY} CFLAGS.nvlist.c+= -I${ZFSOSINC}/spl CFLAGS.zfs.c+= -I${ZFSOSINC}/spl \ -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 +CFLAGS.zstd.c+= -U__BMI__ CFLAGS.zstd_shim.c+= -DIN_BASE -I${OZFS}/include # Do not unroll skein loops, reduce code size From owner-svn-src-head@freebsd.org Tue Oct 13 05:19:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 255AB434D9D; Tue, 13 Oct 2020 05:19:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9P3T09ZPz49c2; Tue, 13 Oct 2020 05:19:01 +0000 (UTC) (envelope-from imp@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 DD71E181E6; Tue, 13 Oct 2020 05:19:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09D5J0Wv058915; Tue, 13 Oct 2020 05:19:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09D5J0lU058914; Tue, 13 Oct 2020 05:19:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010130519.09D5J0lU058914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 13 Oct 2020 05:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366661 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 366661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 05:19:01 -0000 Author: imp Date: Tue Oct 13 05:19:00 2020 New Revision: 366661 URL: https://svnweb.freebsd.org/changeset/base/366661 Log: Document the rather suprising behavior with ' inside action rules. To prevent issues with odd shell characters appearing in, a surprising shell feature is used. Document it and a workaround for it. Differential Revision: https://reviews.freebsd.org/D26723 Modified: head/sbin/devd/devd.conf.5 Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Tue Oct 13 04:37:57 2020 (r366660) +++ head/sbin/devd/devd.conf.5 Tue Oct 13 05:19:00 2020 (r366661) @@ -40,7 +40,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd August 18, 2020 +.Dd October 12, 2020 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -662,6 +662,59 @@ For example: // is a new comment, even though it is logically // part of the previous comment. .Ed +.Ss Notes on Variable Expansion +To prevent issues with special shell characters, the following happens for each +variable +.Ic $foo . +.Bl -enum +.It +The characters +.Dq $' +are inserted. +.It +The string +.Dq $foo +is removed. +.It +The value of the +.Ic foo +variable is inserted into the buffer with all single quote characters +prefixed by a backslash. +.El +.Pp +See +.Xr sh 1 +for what this construct means. +It is safe in all context, except one: inside single quotes. +If foo=meta and bar=var, then a rule like the following: +.Bd -literal -offset indent -compact +action "echo '$foo $bar'"; +.Ed +will be presented to the shell via +.Xr system 3 +as +.Bd -literal -offset indent -compact +echo '$'meta' $'var'' +.Ed +which produces the following output: +.Bd -literal -offset indent -compact +$meta $var +.Ed +as its output. +This is an unanticipated result. +A future version of this software will change this behavior. +Users are discouraged from using single quotes inside +.Ic action +value without due care. +.Pp +The above should be written as +.Bd -literal -offset indent -compact +action "echo $foo' '$bar" +.Ed +to produce a single argument to echo. +Given the above expansion, juxtaposing bare variables with +single quote expressions will produce the right output, +regardless of the value of the variable. .Sh FILES .Bl -tag -width ".Pa /etc/devd.conf" -compact .It Pa /etc/devd.conf @@ -733,6 +786,9 @@ detach 0 { The installed .Pa /etc/devd.conf has many additional examples. +.Sh BUGS +The variable expansion's interaction with single quotes is +suboptimal and surprising. .Sh SEE ALSO .Xr cam 4 , .Xr coretemp 4 , From owner-svn-src-head@freebsd.org Tue Oct 13 05:32:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F26794351A6; Tue, 13 Oct 2020 05:32:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9PLS66rJz4CXH; Tue, 13 Oct 2020 05:32:00 +0000 (UTC) (envelope-from imp@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 B60BE188BD; Tue, 13 Oct 2020 05:32:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09D5W0mp068360; Tue, 13 Oct 2020 05:32:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09D5W05J068359; Tue, 13 Oct 2020 05:32:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010130532.09D5W05J068359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 13 Oct 2020 05:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366662 - head/sbin/devmatch X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devmatch X-SVN-Commit-Revision: 366662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 05:32:01 -0000 Author: imp Date: Tue Oct 13 05:32:00 2020 New Revision: 366662 URL: https://svnweb.freebsd.org/changeset/base/366662 Log: devmatch: First appeared in 12.0 Document that devmatch first appeared in FreeBSD 12.0. Also can't -> can not. But it doesn't help the sentence much. MFC After: 3 days Modified: head/sbin/devmatch/devmatch.8 Modified: head/sbin/devmatch/devmatch.8 ============================================================================== --- head/sbin/devmatch/devmatch.8 Tue Oct 13 05:19:00 2020 (r366661) +++ head/sbin/devmatch/devmatch.8 Tue Oct 13 05:32:00 2020 (r366662) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 16, 2018 +.Dd October 12, 2020 .Dt DEVMATCH 8 .Os .Sh NAME @@ -62,7 +62,7 @@ Parse and use a standard NOMATCH event from for matching instead of searching the device tree. .It Fl u Fl -unbound Attempt to produce a list of those drivers with PNP info whose driver -tables with that PNP info can't be found. +tables with that PNP info can not be found. .It Fl v Fl -verbose Produce more verbose output. .El @@ -94,3 +94,7 @@ logical equivalent in USB, PCI, and others. .Pp Many drivers currently lack proper PNP table decorations and need to be updated. +.Sh HISTORY +.Nm +first appeared in +.Fx 12.0 . From owner-svn-src-head@freebsd.org Tue Oct 13 05:39:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAA86435532; Tue, 13 Oct 2020 05:39:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9PWM5XXhz4CcJ; Tue, 13 Oct 2020 05:39:43 +0000 (UTC) (envelope-from imp@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 A0C8E18A30; Tue, 13 Oct 2020 05:39:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09D5dhl5071350; Tue, 13 Oct 2020 05:39:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09D5dhrJ071349; Tue, 13 Oct 2020 05:39:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010130539.09D5dhrJ071349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 13 Oct 2020 05:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366663 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 366663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 05:39:43 -0000 Author: imp Date: Tue Oct 13 05:39:43 2020 New Revision: 366663 URL: https://svnweb.freebsd.org/changeset/base/366663 Log: Document /boot/config as well as /boot.config Add a note about /boot/config being an alternative location for this information. Correct description of -P. Modified: head/share/man/man5/boot.config.5 Modified: head/share/man/man5/boot.config.5 ============================================================================== --- head/share/man/man5/boot.config.5 Tue Oct 13 05:32:00 2020 (r366662) +++ head/share/man/man5/boot.config.5 Tue Oct 13 05:39:43 2020 (r366663) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd May 13, 2007 +.Dd October 12, 2020 .Dt BOOT.CONFIG 5 .Os .Sh NAME @@ -68,6 +68,8 @@ manual page. .Bl -tag -width /boot.config -compact .It Pa /boot.config parameters for the boot blocks (optional) +.It Pa /boot/config +Altnerate location for boot config information .El .Sh EXAMPLES The command: @@ -76,7 +78,8 @@ The command: .Ed .Pp will activate the serial console of -.Fx . +.Fx +if no keyboard is present, otherwise video console will be used. .Pp The command: .Bd -literal -offset indent From owner-svn-src-head@freebsd.org Tue Oct 13 05:50:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA30C4354F7; Tue, 13 Oct 2020 05:50:03 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9PlH4v69z4DDG; Tue, 13 Oct 2020 05:50:03 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1602568203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=M/InGz/gAYcHQs3LqzHC6led8tgf+6cgKxsutlYGyic=; b=M8NPKFANf38tLZrHXpioW7HG+K//RrNi6u6VD7JB8dlSSzl3slcBioVuWEuZVgL5VJh6St yjGfsuXVI2ZUJCSfAH2hiTqPDpo3E0Zmdrf9xPOLEr462z+ncb4va2Ez/TZC7u4w75TQGJ Hh/Izyrsrzs4MZ7vouLy2xnOJFbxn1JxnXIKlVeSMIaIdxeWuIgjSEwAeZMqLFnVMIsV95 UlXb8dNBp7TphI80U+gq4npHlP807327nf9Xfo+T7qMuSRDmvstJWE/p0JdSa7n8dn0me8 E5RLWuCgtRKTlNsrUKfFxbMZXoT2fHIlHcCHnwVFAfTLTwVEmM76kNdUWTfqIw== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 84E92F20E; Tue, 13 Oct 2020 05:50:03 +0000 (UTC) Date: Tue, 13 Oct 2020 05:50:03 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366662 - head/sbin/devmatch Message-ID: <20201013055003.GA98999@FreeBSD.org> References: <202010130532.09D5W05J068359@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010130532.09D5W05J068359@repo.freebsd.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1602568203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=M/InGz/gAYcHQs3LqzHC6led8tgf+6cgKxsutlYGyic=; b=i2kuDCPVNZvdABn6HVUSIa+065hRlxMTavMrfk0nWCOlkE+ZughWd5dxs8w49CPxMUS2ZT xXQWKMMBJj76XCfaTg/sG4dknJHaMP3fGs5Fup3i0UZ7HM8XJVhdUyg/cclJ6A7FkZ1m9H Q52Ghd4PZ5I+JaBUTS8IF4457tr8aIbiC14B9LFaN6nb495pncHw+tD3ISQhXXUWW91bUd zXFI1NgAIwy8WRQMYESc7lMq1TmYacFGFnv7NrEoJ9Jk8Dome9BQKFV2gfWPZ7SWXmPPWc Vxl/dbE9rxSlS0Bbps/jnpQvwuq/H+uPzNAMFk8Of2zykgI1yBJhDsO35btCVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1602568203; a=rsa-sha256; cv=none; b=nskbJnxTpDx37X7193uY4VICRnDQIYaajzjBTdX3KVh1cuLKWr2QgKKBInJm2ERxblLEi/ GhEaPZi8RzfIwAZ2fy3uLYfvPNsx/qvOQdis6WCAsb8qXbtvr5BCjzrKcMVKtOG9r3TVfb eTlGnUXQ+T7ZB+trxouSmNMF2cqiOFyXOeYeABJZDTCzgvFq2o0CVhYg7XeHHFViM2ZHgW /5o4kRRE3L8YOVp8p1334LeHt4/PzMp8kfcB3VeRS6tw4rUXUrkX2YbO3u1+rmmzuVcbx/ tLKjX6Od3K3EjN5CGqfkjLcUw4gEWi8KyiDikJFGLoOcJaUn2vpLNrH08JpV9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 05:50:03 -0000 On Tue, Oct 13, 2020 at 05:32:00AM +0000, Warner Losh wrote: > New Revision: 366662 > URL: https://svnweb.freebsd.org/changeset/base/366662 > > Log: > devmatch: First appeared in 12.0 > > Document that devmatch first appeared in FreeBSD 12.0. > Also can't -> can not. But it doesn't help the sentence much. > > ... > @@ -62,7 +62,7 @@ Parse and use a standard NOMATCH event from > for matching instead of searching the device tree. > .It Fl u Fl -unbound > Attempt to produce a list of those drivers with PNP info whose driver > -tables with that PNP info can't be found. > +tables with that PNP info can not be found. Are you sure you've really meant "can not" and not "cannot" here? ./danfe From owner-svn-src-head@freebsd.org Tue Oct 13 06:16:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08FAE436505 for ; Tue, 13 Oct 2020 06:16:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9QKx0LrGz4Fqw for ; Tue, 13 Oct 2020 06:16:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf30.google.com with SMTP id s17so9493068qvr.11 for ; Mon, 12 Oct 2020 23:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7lfK5fHrFc5LTZjotPe3iNyeNalNISrLKwNFNnKElu4=; b=R9qL4AIXakhUu2P0P3TlIx861iHouB72EOmZm1mzLvgrFVu87dUKqd8vsn062kRd2h EoLHvlV+7RAIKBAeiinwp3pactHfZd3l3I89E3w/vl2cx6M51z/7x6TQBgbvtbCyIDQ0 7fKzei0GlB91tSsjoTg23DrTZhSnNPCYtzhkl8Lh4m5qGWRfaCJD6GX84q9kHTzE7D7O GiGW8LrvS+JNPAsmQcv+6vI+Co7f7mE/4GUpnbKe/Zn2C0uCpBveCTwpdmvU7Tm6Qzxg DQx4eIsCnofm2hIwhC8ARlETGJ8r+f/Kaw7Z7hkDHUsofNv6qlbhYawV1vLGC/rjGl98 /g1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7lfK5fHrFc5LTZjotPe3iNyeNalNISrLKwNFNnKElu4=; b=NwP/L9PdR/+Vn4IbtxhQb6/0d7YiK1ZX3sRXLE2c9p/vgbOo+WQEZoKku+2T4l7+8P nTZ7WZyYBpBDz3T/18DUxHOvf6+NGl5iI3w/e6O7i+R2z1Y4ztfI0R6+bLg2abWeTMUC 62cyv2oY2XfJvOum5itToi4BPBJvZFTveaQEKkJUm5UQP9CZgQHv9RMKMdKbfDFlmibO 8g59i1tQPTu4cuc1EOntJrSCcr3sM3VzXR+42Ar7zRZktKs4NrvtoaalYlyHaNSuPvlE plk03tJdWC1pZn/MzkbMoODglv+aVu6rtZdmPDTS7QmxhT1nCkzJ4t+g35g2RdgqCajS opPA== X-Gm-Message-State: AOAM530Kge/nV2X7+230jlYc1ELPZabpbiVk80MSWx8bdLayhSz8afIg lUTxMdlQKJGISqsUBYvngW/YLaT8fhn5StF0SDNavA== X-Google-Smtp-Source: ABdhPJwQjgyg2uHnaPSG7LSz75QgjCvhfEcvp1IKKeuTB7AtWm5EzpMzoZ9+CsPMIc8wcvSb7DueZTCLLO8xJyrCPKs= X-Received: by 2002:a0c:e403:: with SMTP id o3mr28704108qvl.23.1602569795835; Mon, 12 Oct 2020 23:16:35 -0700 (PDT) MIME-Version: 1.0 References: <202010130532.09D5W05J068359@repo.freebsd.org> <20201013055003.GA98999@FreeBSD.org> In-Reply-To: <20201013055003.GA98999@FreeBSD.org> From: Warner Losh Date: Tue, 13 Oct 2020 00:16:23 -0600 Message-ID: Subject: Re: svn commit: r366662 - head/sbin/devmatch To: Alexey Dokuchaev Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 4C9QKx0LrGz4Fqw X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=R9qL4AIX; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f30) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.71 / 15.00]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.96)[-0.961]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.001]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.75)[-0.752]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f30:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 06:16:38 -0000 On Mon, Oct 12, 2020, 11:50 PM Alexey Dokuchaev wrote: > On Tue, Oct 13, 2020 at 05:32:00AM +0000, Warner Losh wrote: > > New Revision: 366662 > > URL: https://svnweb.freebsd.org/changeset/base/366662 > > > > Log: > > devmatch: First appeared in 12.0 > > > > Document that devmatch first appeared in FreeBSD 12.0. > > Also can't -> can not. But it doesn't help the sentence much. > > > > ... > > @@ -62,7 +62,7 @@ Parse and use a standard NOMATCH event from > > for matching instead of searching the device tree. > > .It Fl u Fl -unbound > > Attempt to produce a list of those drivers with PNP info whose driver > > -tables with that PNP info can't be found. > > +tables with that PNP info can not be found. > > Are you sure you've really meant "can not" and not "cannot" here? > They are variants of the same word (though it seems the one word variationis more common here).... the whole sentence is a trainwreck, though, and I should have just completely rewritten it. Warner > From owner-svn-src-head@freebsd.org Tue Oct 13 06:22:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 263CF436376; Tue, 13 Oct 2020 06:22:36 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9QSq75B2z4GGB; Tue, 13 Oct 2020 06:22:35 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1602570156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FQ4xW5mNVETWQMS9I/PNX3DEU9uzCheSN1F3Pb45+WA=; b=i428kTuo7dwwN7aV4X+6j0kD94DzDEcsv/pc95t2pFADAWuQLj685Lexu1gJy2hTQy9rb+ aTKP2jTIeEWz9eT8gRWyNMGyi11hAw2lyNafNAOog58p4ESdnk+VlE5tUvnFHfWYzdFCKs aPV0AWXqdyKd0ZSUvObmUSLm7n/eBHiKqPlMSShvm3J+hVZohh1U0z+zsBj82t4cBvDYyA hr0nMbxgewC49crhSxFQdK2QC+mZdYgIQNd+X7HA7RzSHcrgobMYuL35crhdVMkZmzxCsf 1mZFLA1cMwWuhtmyEaskqFEa3vQvnc7OVl77sd57XKk5GYWXBcx+YztkiG1+Lg== Received: by freefall.freebsd.org (Postfix, from userid 1033) id EB7EEFC8E; Tue, 13 Oct 2020 06:22:35 +0000 (UTC) Date: Tue, 13 Oct 2020 06:22:35 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366662 - head/sbin/devmatch Message-ID: <20201013062235.GA25213@FreeBSD.org> References: <202010130532.09D5W05J068359@repo.freebsd.org> <20201013055003.GA98999@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1602570156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FQ4xW5mNVETWQMS9I/PNX3DEU9uzCheSN1F3Pb45+WA=; b=Vup43nVUlYGyR64tUW+JpC1GUEI+iTG++TXNBwTHfptSprzewVlU1fkSjtQPSfkGLOLrbv CcM+X1Wfd/YwBCWz1e9nk/sJwgaGKiuEgaqivPLICO//dEBnbBKrbTLmCziG+cFye+BEG2 xcvevHFjQ76+UOgizguVHvDq2x8tWq1EP3xUGl5LVziV/ESbaXNgilvDJ64z6FQk6G8HTc FLDQ599fZqLHMdm9bXu1T/aJQeIfHdcrL1OM/AbLicnnL+u4MKdQ5pBI/GO3jGfO4mOtwK l/K56Yj9cA+IflpZXlPSncVEdpg/NmsgFTJ1Fz4ftuBUHkt2vFyyeMQrK0dlRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1602570156; a=rsa-sha256; cv=none; b=KLgAPlhUhgE7L+8j4zmMW4qQKqug8L6Hzz5zze2D81mslH7h+DZ6dpvV+VD7dOSkszEqnP TEzWplCPr8RXhwsoq0btLTjyIwuWgeZH/phRum/+hEZRh4SjUVf0Ndo6p0oCTo0VloShXH 3XWxoFf5rAaz2wqcsZvuGGuW9QPIEyz9tVyqN5JT5m8QU2OUfTl7yjjzctESGyTiZnZMNU 8Wc/Yn+FitUOvi14U1GPZv9qm+PvXoMl3Vytg9HAorcmybkznQwRnaR2TVfHckEdQrCJs0 3+WZ5YN+WzrcZnPow8Tefr0z8F92F7PJtzaIMKtzUWpxAiBsQiUDR02F8/FHtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 06:22:36 -0000 On Tue, Oct 13, 2020 at 12:16:23AM -0600, Warner Losh wrote: > On Mon, Oct 12, 2020, 11:50 PM Alexey Dokuchaev wrote: > > On Tue, Oct 13, 2020 at 05:32:00AM +0000, Warner Losh wrote: > > > New Revision: 366662 > > > URL: https://svnweb.freebsd.org/changeset/base/366662 > > > > > > Log: > > > devmatch: First appeared in 12.0 > > > > > > Document that devmatch first appeared in FreeBSD 12.0. > > > Also can't -> can not. But it doesn't help the sentence much. > > > > > > ... > > > @@ -62,7 +62,7 @@ Parse and use a standard NOMATCH event from > > > for matching instead of searching the device tree. > > > .It Fl u Fl -unbound > > > Attempt to produce a list of those drivers with PNP info whose driver > > > -tables with that PNP info can't be found. > > > +tables with that PNP info can not be found. > > > > Are you sure you've really meant "can not" and not "cannot" here? > > They are variants of the same word (though it seems the one word > variationis more common here) No, they're not*, examples of "can not" usage: - We can not only build the house, we can also sell it for a profit. - Maybe I can not worry about this for a few days. > the whole sentence is a trainwreck, though, and I should have just > completely rewritten it. I do agree. :-) ./danfe *) https://grammar.yourdictionary.com/vs/cannot-vs-can-not-vs-cant-differences-explained.html From owner-svn-src-head@freebsd.org Tue Oct 13 08:14:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2AFDF439787; Tue, 13 Oct 2020 08:14:34 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9Sy20RBTz4Nxx; Tue, 13 Oct 2020 08:14:34 +0000 (UTC) (envelope-from arichardson@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 E7EC01A16C; Tue, 13 Oct 2020 08:14:33 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09D8EXHa073407; Tue, 13 Oct 2020 08:14:33 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09D8EXfP073406; Tue, 13 Oct 2020 08:14:33 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202010130814.09D8EXfP073406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 13 Oct 2020 08:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366664 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 366664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 08:14:34 -0000 Author: arichardson Date: Tue Oct 13 08:14:33 2020 New Revision: 366664 URL: https://svnweb.freebsd.org/changeset/base/366664 Log: Stop using -O instead of -O2 for MIPS Until clang 11 that was equivalent to -O2, but clang changed it to -O1 so generated MIPS code will now be unnecessarily slow. It also removes a weird special case from sys.mk. This is similar to the D26471 change for debug kernels and should not change anything since everything was previously building MIPS code at -O2 until the clang 11 update. Reviewed By: trasz Differential Revision: https://reviews.freebsd.org/D26749 Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Tue Oct 13 05:39:43 2020 (r366663) +++ head/share/mk/sys.mk Tue Oct 13 08:14:33 2020 (r366664) @@ -166,11 +166,7 @@ CC ?= c89 CFLAGS ?= -O .else CC ?= cc -.if ${MACHINE_CPUARCH} == "mips" -CFLAGS ?= -O -pipe -.else CFLAGS ?= -O2 -pipe -.endif .if defined(NO_STRICT_ALIASING) CFLAGS += -fno-strict-aliasing .endif From owner-svn-src-head@freebsd.org Tue Oct 13 10:26:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8438B43CD32; Tue, 13 Oct 2020 10:26:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9Wt02wNHz4WfX; Tue, 13 Oct 2020 10:26:16 +0000 (UTC) (envelope-from andrew@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 475E01C0DD; Tue, 13 Oct 2020 10:26:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DAQGtW056629; Tue, 13 Oct 2020 10:26:16 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DAQFAX056628; Tue, 13 Oct 2020 10:26:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202010131026.09DAQFAX056628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 13 Oct 2020 10:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366665 - in head: sys/arm64/arm64 tests/sys/vm X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head: sys/arm64/arm64 tests/sys/vm X-SVN-Commit-Revision: 366665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 10:26:16 -0000 Author: andrew Date: Tue Oct 13 10:26:15 2020 New Revision: 366665 URL: https://svnweb.freebsd.org/changeset/base/366665 Log: Fix write only mappings on arm64 When trapping on a wrote access to a buffer the kernel has mapped as write only we should only pass the VM_PROT_WRITE flag. Previously the call to vm_fault_trap as the VM_PROT_READ flag was unexpected. Reported by: manu Sponsored by: Innovate UK Modified: head/sys/arm64/arm64/trap.c head/tests/sys/vm/mmap_test.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Tue Oct 13 08:14:33 2020 (r366664) +++ head/sys/arm64/arm64/trap.c Tue Oct 13 10:26:15 2020 (r366665) @@ -301,7 +301,7 @@ data_abort(struct thread *td, struct trapframe *frame, break; default: ftype = (esr & ISS_DATA_WnR) == 0 ? VM_PROT_READ : - VM_PROT_READ | VM_PROT_WRITE; + VM_PROT_WRITE; break; } Modified: head/tests/sys/vm/mmap_test.c ============================================================================== --- head/tests/sys/vm/mmap_test.c Tue Oct 13 08:14:33 2020 (r366664) +++ head/tests/sys/vm/mmap_test.c Tue Oct 13 10:26:15 2020 (r366665) @@ -259,6 +259,21 @@ ATF_TC_BODY(mmap__dev_zero_shared, tc) close(fd); } +ATF_TC_WITHOUT_HEAD(mmap__write_only); +ATF_TC_BODY(mmap__write_only, tc) +{ + void *p; + int pagesize; + + ATF_REQUIRE((pagesize = getpagesize()) > 0); + p = mmap(NULL, pagesize, PROT_WRITE, MAP_ANON, -1, 0); + ATF_REQUIRE(p != MAP_FAILED); + + *(volatile uint32_t *)p = 0x12345678; + + munmap(p, pagesize); +} + ATF_TP_ADD_TCS(tp) { @@ -266,6 +281,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, mmap__bad_arguments); ATF_TP_ADD_TC(tp, mmap__dev_zero_private); ATF_TP_ADD_TC(tp, mmap__dev_zero_shared); + ATF_TP_ADD_TC(tp, mmap__write_only); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Tue Oct 13 10:31:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D7C443CDCF; Tue, 13 Oct 2020 10:31:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9Wzh6dMsz4X6R; Tue, 13 Oct 2020 10:31:12 +0000 (UTC) (envelope-from andrew@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 C6E0F1BF4E; Tue, 13 Oct 2020 10:31:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DAVCeF059992; Tue, 13 Oct 2020 10:31:12 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DAVCJa059991; Tue, 13 Oct 2020 10:31:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202010131031.09DAVCJa059991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 13 Oct 2020 10:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366666 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 366666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 10:31:13 -0000 Author: andrew Date: Tue Oct 13 10:31:12 2020 New Revision: 366666 URL: https://svnweb.freebsd.org/changeset/base/366666 Log: Bump __FreeBSD_version for the fix to arm64 write-only mappings Sponsored by: Innovate UK Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Oct 13 10:26:15 2020 (r366665) +++ head/sys/sys/param.h Tue Oct 13 10:31:12 2020 (r366666) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300119 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300120 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Tue Oct 13 11:04:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1D5143D2E9; Tue, 13 Oct 2020 11:04:00 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9XjX5dH0z4YPq; Tue, 13 Oct 2020 11:04:00 +0000 (UTC) (envelope-from kp@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 A53791C8B2; Tue, 13 Oct 2020 11:04:00 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DB40UL080881; Tue, 13 Oct 2020 11:04:00 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DB40vI080880; Tue, 13 Oct 2020 11:04:00 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202010131104.09DB40vI080880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 13 Oct 2020 11:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366667 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 366667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 11:04:00 -0000 Author: kp Date: Tue Oct 13 11:04:00 2020 New Revision: 366667 URL: https://svnweb.freebsd.org/changeset/base/366667 Log: pf: do not remove kifs that are referenced by rules Even if a kif doesn't have an ifp or if_group pointer we still can't delete it if it's referenced by a rule. In other words: we must check rulerefs as well. While we're here also teach pfi_kif_unref() not to remove kifs with flags. Reported-by: syzbot+b31d1d7e12c5d4d42f28@syzkaller.appspotmail.com MFC after: 2 weeks Modified: head/sys/netpfil/pf/pf_if.c Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Tue Oct 13 10:31:12 2020 (r366666) +++ head/sys/netpfil/pf/pf_if.c Tue Oct 13 11:04:00 2020 (r366667) @@ -282,8 +282,10 @@ pfi_kif_unref(struct pfi_kif *kif) if (kif->pfik_rulerefs > 0) return; - /* kif referencing an existing ifnet or group should exist. */ - if (kif->pfik_ifp != NULL || kif->pfik_group != NULL || kif == V_pfi_all) + /* kif referencing an existing ifnet or group or holding flags should + * exist. */ + if (kif->pfik_ifp != NULL || kif->pfik_group != NULL || + kif == V_pfi_all || kif->pfik_flags != 0) return; RB_REMOVE(pfi_ifhead, &V_pfi_ifs, kif); @@ -833,7 +835,7 @@ pfi_clear_flags(const char *name, int flags) p->pfik_flags &= ~flags; if (p->pfik_ifp == NULL && p->pfik_group == NULL && - p->pfik_flags == 0) { + p->pfik_flags == 0 && p->pfik_rulerefs == 0) { /* Delete this kif. */ RB_REMOVE(pfi_ifhead, &V_pfi_ifs, p); free(p, PFI_MTYPE); From owner-svn-src-head@freebsd.org Tue Oct 13 14:10:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A6BE44372A; Tue, 13 Oct 2020 14:10:50 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9cs60ngkz3XVN; Tue, 13 Oct 2020 14:10:50 +0000 (UTC) (envelope-from scottl@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 F2A591E8A2; Tue, 13 Oct 2020 14:10:49 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DEAnxl092288; Tue, 13 Oct 2020 14:10:49 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DEAncc092286; Tue, 13 Oct 2020 14:10:49 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <202010131410.09DEAncc092286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 13 Oct 2020 14:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366668 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 366668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 14:10:50 -0000 Author: scottl Date: Tue Oct 13 14:10:49 2020 New Revision: 366668 URL: https://svnweb.freebsd.org/changeset/base/366668 Log: Bring the request_descriptor union into harmony internally. No functional change. Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mps/mps.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Tue Oct 13 11:04:00 2020 (r366667) +++ head/sys/dev/mpr/mpr.c Tue Oct 13 14:10:49 2020 (r366668) @@ -129,13 +129,13 @@ static char mpt2_reset_magic[] = { 0x00, 0x0f, 0x04, 0 * Otherwise it will throw this error: * "aggregate value used where an integer was expected" */ -typedef union _reply_descriptor { +typedef union { u64 word; struct { u32 low; u32 high; } u; -} reply_descriptor, request_descriptor; +} request_descriptor_t; /* Rate limit chain-fail messages to 1 per minute */ static struct timeval mpr_chainfail_interval = { 60, 0 }; @@ -1121,7 +1121,7 @@ mpr_request_sync(struct mpr_softc *sc, void *req, MPI2 static void mpr_enqueue_request(struct mpr_softc *sc, struct mpr_command *cm) { - request_descriptor rd; + request_descriptor_t rd; MPR_FUNCTRACE(sc); mpr_dprint(sc, MPR_TRACE, "SMID %u cm %p ccb %p\n", Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Tue Oct 13 11:04:00 2020 (r366667) +++ head/sys/dev/mps/mps.c Tue Oct 13 14:10:49 2020 (r366668) @@ -128,13 +128,13 @@ static char mpt2_reset_magic[] = { 0x00, 0x0f, 0x04, 0 * "aggregate value used where an integer was expected" */ -typedef union _reply_descriptor { +typedef union { u64 word; struct { u32 low; u32 high; } u; -}reply_descriptor,address_descriptor; +} request_descriptor_t; /* Rate limit chain-fail messages to 1 per minute */ static struct timeval mps_chainfail_interval = { 60, 0 }; @@ -1098,7 +1098,7 @@ mps_request_sync(struct mps_softc *sc, void *req, MPI2 static void mps_enqueue_request(struct mps_softc *sc, struct mps_command *cm) { - reply_descriptor rd; + request_descriptor_t rd; MPS_FUNCTRACE(sc); mps_dprint(sc, MPS_TRACE, "SMID %u cm %p ccb %p\n", cm->cm_desc.Default.SMID, cm, cm->cm_ccb); From owner-svn-src-head@freebsd.org Tue Oct 13 16:19:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06EFE4458A4; Tue, 13 Oct 2020 16:19:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9gjP69TMz3drY; Tue, 13 Oct 2020 16:19:21 +0000 (UTC) (envelope-from hselasky@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 9F73220389; Tue, 13 Oct 2020 16:19:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DGJLxm072503; Tue, 13 Oct 2020 16:19:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DGJLLs072502; Tue, 13 Oct 2020 16:19:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010131619.09DGJLLs072502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Oct 2020 16:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366669 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 366669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 16:19:22 -0000 Author: hselasky Date: Tue Oct 13 16:19:21 2020 New Revision: 366669 URL: https://svnweb.freebsd.org/changeset/base/366669 Log: Implement more RCU list functions in the LinuxKPI. This also fixes a bug in the existing list_add_rcu() where the prev->prev pointer was updated to the new element instead of next->prev. Currently this function is not widely used. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/compat/linuxkpi/common/include/linux/rculist.h Modified: head/sys/compat/linuxkpi/common/include/linux/rculist.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/rculist.h Tue Oct 13 14:10:49 2020 (r366668) +++ head/sys/compat/linuxkpi/common/include/linux/rculist.h Tue Oct 13 16:19:21 2020 (r366669) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2015 François Tigeot - * Copyright (c) 2016-2017 Mellanox Technologies, Ltd. + * Copyright (c) 2016-2020 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +37,7 @@ container_of(READ_ONCE(ptr), type, member) #define list_next_rcu(head) (*((struct list_head **)(&(head)->next))) +#define list_prev_rcu(head) (*((struct list_head **)(&(head)->prev))) #define list_for_each_entry_rcu(pos, head, member) \ for (pos = list_entry_rcu((head)->next, typeof(*(pos)), member); \ @@ -44,12 +45,44 @@ pos = list_entry_rcu((pos)->member.next, typeof(*(pos)), member)) static inline void -list_add_rcu(struct list_head *new, struct list_head *prev) +linux_list_add_rcu(struct list_head *new, struct list_head *prev, + struct list_head *next) { - new->next = prev->next; + new->next = next; new->prev = prev; rcu_assign_pointer(list_next_rcu(prev), new); - prev->prev = new; + next->prev = new; +} + +static inline void +list_add_rcu(struct list_head *new, struct list_head *head) +{ + linux_list_add_rcu(new, head, head->next); +} + +static inline void +list_add_tail_rcu(struct list_head *new, struct list_head *head) +{ + linux_list_add_rcu(new, head->prev, head); +} + +static inline void +__list_del_rcu(struct list_head *prev, struct list_head *next) +{ + next->prev = prev; + rcu_assign_pointer(list_next_rcu(prev), next); +} + +static inline void +__list_del_entry_rcu(struct list_head *entry) +{ + __list_del_rcu(entry->prev, entry->next); +} + +static inline void +list_del_rcu(struct list_head *entry) +{ + __list_del_rcu(entry->prev, entry->next); } #define hlist_first_rcu(head) (*((struct hlist_node **)(&(head)->first))) From owner-svn-src-head@freebsd.org Tue Oct 13 16:51:06 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2115C446280; Tue, 13 Oct 2020 16:51:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9hQ207HWz3g1j; Tue, 13 Oct 2020 16:51:06 +0000 (UTC) (envelope-from andrew@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 DD698207C9; Tue, 13 Oct 2020 16:51:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DGp53q094223; Tue, 13 Oct 2020 16:51:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DGp514094222; Tue, 13 Oct 2020 16:51:05 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202010131651.09DGp514094222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 13 Oct 2020 16:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366670 - head/stand/efi/loader/arch/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/stand/efi/loader/arch/arm64 X-SVN-Commit-Revision: 366670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 16:51:06 -0000 Author: andrew Date: Tue Oct 13 16:51:05 2020 New Revision: 366670 URL: https://svnweb.freebsd.org/changeset/base/366670 Log: Use adrp in the arm64 efi loader On startup the arm64 efi loaders need to know PC-relative addresses. Previously we used the adr instruction to find this address, however this instruction is limited to +/- 1MiB. Switch to adrp to find the 4k page the address is within and an add to set the bottom 12 bits. This lets us address +/- 4GiB which should be large enough for now. Reported by: imp MFC after: 2 weeks Sponsored by: Innovate UK Modified: head/stand/efi/loader/arch/arm64/start.S Modified: head/stand/efi/loader/arch/arm64/start.S ============================================================================== --- head/stand/efi/loader/arch/arm64/start.S Tue Oct 13 16:19:21 2020 (r366669) +++ head/stand/efi/loader/arch/arm64/start.S Tue Oct 13 16:51:05 2020 (r366670) @@ -142,8 +142,10 @@ _start: /* Save the boot params to the stack */ stp x0, x1, [sp, #-16]! - adr x0, __bss_start - adr x1, __bss_end + adrp x0, __bss_start + add x0, x0, :lo12:__bss_start + adrp x1, __bss_end + add x1, x1, :lo12:__bss_end b 2f @@ -153,8 +155,10 @@ _start: cmp x0, x1 b.lo 1b - adr x0, ImageBase - adr x1, _DYNAMIC + adrp x0, ImageBase + add x0, x0, :lo12:ImageBase + adrp x1, _DYNAMIC + add x1, x1, :lo12:_DYNAMIC bl self_reloc @@ -165,7 +169,8 @@ _start: * Load the stack to use. The default stack may be too small for * the lua loader. */ - adr x2, initstack_end + adrp x2, initstack_end + add x2, x2, :lo12:initstack_end mov sp, x2 #endif From owner-svn-src-head@freebsd.org Tue Oct 13 17:14:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 147C344637F; Tue, 13 Oct 2020 17:14:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9hx26qhrz3gnx; Tue, 13 Oct 2020 17:14:30 +0000 (UTC) (envelope-from brooks@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 C973D20ACD; Tue, 13 Oct 2020 17:14:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DHEUmA009277; Tue, 13 Oct 2020 17:14:30 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DHEUsF009276; Tue, 13 Oct 2020 17:14:30 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202010131714.09DHEUsF009276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 13 Oct 2020 17:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366671 - head/lib/libgssapi X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libgssapi X-SVN-Commit-Revision: 366671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 17:14:31 -0000 Author: brooks Date: Tue Oct 13 17:14:30 2020 New Revision: 366671 URL: https://svnweb.freebsd.org/changeset/base/366671 Log: libgssapi: modernize static string array use Use designated initializers to document positions in the arrays rather than requiring counting. Use nitems() rather than rolling it by hand to count elements. Also, passify a Clang 12 warning about suspcious string concatenation within an array initializer by adding parentheses. Reviewed by: emaste MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26592 Modified: head/lib/libgssapi/gss_display_status.c Modified: head/lib/libgssapi/gss_display_status.c ============================================================================== --- head/lib/libgssapi/gss_display_status.c Tue Oct 13 16:51:05 2020 (r366670) +++ head/lib/libgssapi/gss_display_status.c Tue Oct 13 17:14:30 2020 (r366671) @@ -92,6 +92,7 @@ * SUCH DAMAGE. */ +#include #include #include #include @@ -105,17 +106,15 @@ static const char * calling_error(OM_uint32 v) { static const char *msgs[] = { - NULL, /* 0 */ - "A required input parameter could not be read.", /* */ - "A required output parameter could not be written.", /* */ - "A parameter was malformed" + [0] = "", + [1] = "A required input parameter could not be read.", + [2] = "A required output parameter could not be written.", + [3] = "A parameter was malformed", }; v >>= GSS_C_CALLING_ERROR_OFFSET; - if (v == 0) - return ""; - else if (v >= sizeof(msgs)/sizeof(*msgs)) + if (v >= nitems(msgs)) return "unknown calling error"; else return msgs[v]; @@ -125,31 +124,31 @@ static const char * routine_error(OM_uint32 v) { static const char *msgs[] = { - "Function completed successfully", /* 0 */ - "An unsupported mechanism was requested", - "An invalid name was supplied", - "A supplied name was of an unsupported type", - "Incorrect channel bindings were supplied", - "An invalid status code was supplied", - "A token had an invalid MIC", - "No credentials were supplied, " - "or the credentials were unavailable or inaccessible.", - "No context has been established", - "A token was invalid", - "A credential was invalid", - "The referenced credentials have expired", - "The context has expired", - "Miscellaneous failure (see text)", - "The quality-of-protection requested could not be provide", - "The operation is forbidden by local security policy", - "The operation or option is not available", - "The requested credential element already exists", - "The provided name was not a mechanism name.", + [0] = "Function completed successfully", + [1] = "An unsupported mechanism was requested", + [2] = "An invalid name was supplied", + [3] = "A supplied name was of an unsupported type", + [4] = "Incorrect channel bindings were supplied", + [5] = "An invalid status code was supplied", + [6] = "A token had an invalid MIC", + [7] = ("No credentials were supplied, " + "or the credentials were unavailable or inaccessible."), + [8] = "No context has been established", + [9] = "A token was invalid", + [10] = "A credential was invalid", + [11] = "The referenced credentials have expired", + [12] = "The context has expired", + [13] = "Miscellaneous failure (see text)", + [14] = "The quality-of-protection requested could not be provide", + [15] = "The operation is forbidden by local security policy", + [16] = "The operation or option is not available", + [17] = "The requested credential element already exists", + [18] = "The provided name was not a mechanism name.", }; v >>= GSS_C_ROUTINE_ERROR_OFFSET; - if (v >= sizeof(msgs)/sizeof(*msgs)) + if (v >= nitems(msgs)) return "unknown routine error"; else return msgs[v]; @@ -159,17 +158,17 @@ static const char * supplementary_error(OM_uint32 v) { static const char *msgs[] = { - "normal completion", - "continuation call to routine required", - "duplicate per-message token detected", - "timed-out per-message token detected", - "reordered (early) per-message token detected", - "skipped predecessor token(s) detected" + [0] = "normal completion", + [1] = "continuation call to routine required", + [2] = "duplicate per-message token detected", + [3] = "timed-out per-message token detected", + [4] = "reordered (early) per-message token detected", + [5] = "skipped predecessor token(s) detected", }; v >>= GSS_C_SUPPLEMENTARY_OFFSET; - if (v >= sizeof(msgs)/sizeof(*msgs)) + if (v >= nitems(msgs)) return "unknown routine error"; else return msgs[v]; From owner-svn-src-head@freebsd.org Tue Oct 13 17:26:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0C7D4463FA; Tue, 13 Oct 2020 17:26:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9jBZ3blLz3ybg; Tue, 13 Oct 2020 17:26:14 +0000 (UTC) (envelope-from jhb@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 6004F21101; Tue, 13 Oct 2020 17:26:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DHQEGv015547; Tue, 13 Oct 2020 17:26:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DHQDTu015541; Tue, 13 Oct 2020 17:26:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010131726.09DHQDTu015541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 13 Oct 2020 17:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366672 - in head: share/man/man9 sys/crypto/aesni sys/crypto/blake2 sys/crypto/via sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man9 sys/crypto/aesni sys/crypto/blake2 sys/crypto/via sys/i386/include X-SVN-Commit-Revision: 366672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 17:26:14 -0000 Author: jhb Date: Tue Oct 13 17:26:12 2020 New Revision: 366672 URL: https://svnweb.freebsd.org/changeset/base/366672 Log: Add a for i386 that includes . arm64 has a similar wrapper. This permits defining as the standard header for fpu_kern_*. Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D26753 Added: head/sys/i386/include/fpu.h (contents, props changed) Modified: head/share/man/man9/fpu_kern.9 head/sys/crypto/aesni/aesni.c head/sys/crypto/aesni/aesni.h head/sys/crypto/blake2/blake2_cryptodev.c head/sys/crypto/via/padlock.h Modified: head/share/man/man9/fpu_kern.9 ============================================================================== --- head/share/man/man9/fpu_kern.9 Tue Oct 13 17:14:30 2020 (r366671) +++ head/share/man/man9/fpu_kern.9 Tue Oct 13 17:26:12 2020 (r366672) @@ -23,13 +23,14 @@ .\" .\" $FreeBSD$ .\" -.Dd March 7, 2018 +.Dd October 13, 2020 .Dt FPU_KERN 9 .Os .Sh NAME .Nm fpu_kern .Nd "facility to use the FPU in the kernel" .Sh SYNOPSIS +.In machine/fpu.h .Ft struct fpu_kern_ctx * .Fn fpu_kern_alloc_ctx "u_int flags" .Ft void Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Tue Oct 13 17:14:30 2020 (r366671) +++ head/sys/crypto/aesni/aesni.c Tue Oct 13 17:26:12 2020 (r366672) @@ -60,11 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__i386__) -#include -#elif defined(__amd64__) #include -#endif static struct mtx_padalign *ctx_mtx; static struct fpu_kern_ctx **ctx_fpu; Modified: head/sys/crypto/aesni/aesni.h ============================================================================== --- head/sys/crypto/aesni/aesni.h Tue Oct 13 17:14:30 2020 (r366671) +++ head/sys/crypto/aesni/aesni.h Tue Oct 13 17:26:12 2020 (r366672) @@ -40,10 +40,6 @@ #include #include #include -#endif -#if defined(__i386__) -#include -#elif defined(__amd64__) #include #endif Modified: head/sys/crypto/blake2/blake2_cryptodev.c ============================================================================== --- head/sys/crypto/blake2/blake2_cryptodev.c Tue Oct 13 17:14:30 2020 (r366671) +++ head/sys/crypto/blake2/blake2_cryptodev.c Tue Oct 13 17:26:12 2020 (r366672) @@ -43,11 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__amd64__) #include -#elif defined(__i386__) -#include -#endif struct blake2_session { size_t mlen; Modified: head/sys/crypto/via/padlock.h ============================================================================== --- head/sys/crypto/via/padlock.h Tue Oct 13 17:14:30 2020 (r366671) +++ head/sys/crypto/via/padlock.h Tue Oct 13 17:26:12 2020 (r366672) @@ -32,11 +32,7 @@ #include #include -#if defined(__i386__) -#include -#elif defined(__amd64__) #include -#endif union padlock_cw { uint64_t raw; Added: head/sys/i386/include/fpu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/include/fpu.h Tue Oct 13 17:26:12 2020 (r366672) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + * + * $FreeBSD$ + */ +#include From owner-svn-src-head@freebsd.org Tue Oct 13 17:27:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9717D4468E7; Tue, 13 Oct 2020 17:27:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9jDB3WbSz3yT0; Tue, 13 Oct 2020 17:27:38 +0000 (UTC) (envelope-from jhb@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 4280120E29; Tue, 13 Oct 2020 17:27:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DHRc33015651; Tue, 13 Oct 2020 17:27:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DHRbdu015648; Tue, 13 Oct 2020 17:27:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010131727.09DHRbdu015648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 13 Oct 2020 17:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366673 - in head/sys/i386: i386 include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/i386: i386 include X-SVN-Commit-Revision: 366673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 17:27:38 -0000 Author: jhb Date: Tue Oct 13 17:27:37 2020 New Revision: 366673 URL: https://svnweb.freebsd.org/changeset/base/366673 Log: Add support for FPU_KERN_NOCTX. This mirrors the implementation on amd64. Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D26754 Modified: head/sys/i386/i386/npx.c head/sys/i386/include/npx.h head/sys/i386/include/pcb.h Modified: head/sys/i386/i386/npx.c ============================================================================== --- head/sys/i386/i386/npx.c Tue Oct 13 17:26:12 2020 (r366672) +++ head/sys/i386/i386/npx.c Tue Oct 13 17:27:37 2020 (r366673) @@ -886,6 +886,9 @@ npxdna(void) return (0); td = curthread; critical_enter(); + + KASSERT((curpcb->pcb_flags & PCB_NPXNOSAVE) == 0, + ("npxdna while in fpu_kern_enter(FPU_KERN_NOCTX)")); if (__predict_false(PCPU_GET(fpcurthread) == td)) { /* * Some virtual machines seems to set %cr0.TS at @@ -1390,8 +1393,34 @@ fpu_kern_enter(struct thread *td, struct fpu_kern_ctx { struct pcb *pcb; - KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) == 0, ("using inuse ctx")); + pcb = td->td_pcb; + KASSERT((flags & FPU_KERN_NOCTX) != 0 || ctx != NULL, + ("ctx is required when !FPU_KERN_NOCTX")); + KASSERT(ctx == NULL || (ctx->flags & FPU_KERN_CTX_INUSE) == 0, + ("using inuse ctx")); + KASSERT((pcb->pcb_flags & PCB_NPXNOSAVE) == 0, + ("recursive fpu_kern_enter while in PCB_NPXNOSAVE state")); + if ((flags & FPU_KERN_NOCTX) != 0) { + critical_enter(); + stop_emulating(); + if (curthread == PCPU_GET(fpcurthread)) { + fpusave(curpcb->pcb_save); + PCPU_SET(fpcurthread, NULL); + } else { + KASSERT(PCPU_GET(fpcurthread) == NULL, + ("invalid fpcurthread")); + } + + /* + * This breaks XSAVEOPT tracker, but + * PCB_NPXNOSAVE state is supposed to never need to + * save FPU context at all. + */ + fpurstor(npx_initialstate); + pcb->pcb_flags |= PCB_KERNNPX | PCB_NPXNOSAVE | PCB_NPXINITDONE; + return; + } if ((flags & FPU_KERN_KTHR) != 0 && is_fpu_kern_thread(0)) { ctx->flags = FPU_KERN_CTX_DUMMY | FPU_KERN_CTX_INUSE; return; @@ -1416,17 +1445,32 @@ fpu_kern_leave(struct thread *td, struct fpu_kern_ctx { struct pcb *pcb; - KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) != 0, - ("leaving not inuse ctx")); - ctx->flags &= ~FPU_KERN_CTX_INUSE; - - if (is_fpu_kern_thread(0) && (ctx->flags & FPU_KERN_CTX_DUMMY) != 0) - return (0); pcb = td->td_pcb; - critical_enter(); - if (curthread == PCPU_GET(fpcurthread)) - npxdrop(); - pcb->pcb_save = ctx->prev; + + if ((pcb->pcb_flags & PCB_NPXNOSAVE) != 0) { + KASSERT(ctx == NULL, ("non-null ctx after FPU_KERN_NOCTX")); + KASSERT(PCPU_GET(fpcurthread) == NULL, + ("non-NULL fpcurthread for PCB_NPXNOSAVE")); + CRITICAL_ASSERT(td); + + pcb->pcb_flags &= ~(PCB_NPXNOSAVE | PCB_NPXINITDONE); + start_emulating(); + } else { + KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) != 0, + ("leaving not inuse ctx")); + ctx->flags &= ~FPU_KERN_CTX_INUSE; + + if (is_fpu_kern_thread(0) && + (ctx->flags & FPU_KERN_CTX_DUMMY) != 0) + return (0); + KASSERT((ctx->flags & FPU_KERN_CTX_DUMMY) == 0, + ("dummy ctx")); + critical_enter(); + if (curthread == PCPU_GET(fpcurthread)) + npxdrop(); + pcb->pcb_save = ctx->prev; + } + if (pcb->pcb_save == get_pcb_user_save_pcb(pcb)) { if ((pcb->pcb_flags & PCB_NPXUSERINITDONE) != 0) pcb->pcb_flags |= PCB_NPXINITDONE; Modified: head/sys/i386/include/npx.h ============================================================================== --- head/sys/i386/include/npx.h Tue Oct 13 17:26:12 2020 (r366672) +++ head/sys/i386/include/npx.h Tue Oct 13 17:27:37 2020 (r366673) @@ -92,6 +92,7 @@ void fpu_save_area_reset(union savefpu *fsa); #define FPU_KERN_NORMAL 0x0000 #define FPU_KERN_NOWAIT 0x0001 #define FPU_KERN_KTHR 0x0002 +#define FPU_KERN_NOCTX 0x0004 #endif Modified: head/sys/i386/include/pcb.h ============================================================================== --- head/sys/i386/include/pcb.h Tue Oct 13 17:26:12 2020 (r366672) +++ head/sys/i386/include/pcb.h Tue Oct 13 17:27:37 2020 (r366673) @@ -86,6 +86,7 @@ struct pcb { #define PCB_VM86CALL 0x10 /* in vm86 call */ #define PCB_NPXUSERINITDONE 0x20 /* user fpu state is initialized */ #define PCB_KERNNPX 0x40 /* kernel uses npx */ +#define PCB_NPXNOSAVE 0x80 /* no save area for current FPU ctx */ uint16_t pcb_initial_npxcw; From owner-svn-src-head@freebsd.org Tue Oct 13 17:30:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A283446B4B; Tue, 13 Oct 2020 17:30:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9jHb1pBGz40GB; Tue, 13 Oct 2020 17:30:35 +0000 (UTC) (envelope-from jhb@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 0A3F221108; Tue, 13 Oct 2020 17:30:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DHUYfg015850; Tue, 13 Oct 2020 17:30:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DHUYqx015847; Tue, 13 Oct 2020 17:30:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010131730.09DHUYqx015847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 13 Oct 2020 17:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366674 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 17:30:35 -0000 Author: jhb Date: Tue Oct 13 17:30:34 2020 New Revision: 366674 URL: https://svnweb.freebsd.org/changeset/base/366674 Log: Permit sending empty fragments for TLS 1.0. Due to a weakness in the TLS 1.0 protocol, OpenSSL will periodically send empty TLS records ("empty fragments"). These TLS records have no payload (and thus a page count of zero). m_uiotombuf_nomap() was returning NULL instead of an empty mbuf, and a few places needed to be updated to treat an empty TLS record as having a page count of "1" as 0 means "no work to do" (e.g. nothing to encrypt, or nothing to mark ready via sbready()). Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D26729 Modified: head/sys/kern/uipc_ktls.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_sockbuf.c Modified: head/sys/kern/uipc_ktls.c ============================================================================== --- head/sys/kern/uipc_ktls.c Tue Oct 13 17:27:37 2020 (r366673) +++ head/sys/kern/uipc_ktls.c Tue Oct 13 17:30:34 2020 (r366674) @@ -1384,7 +1384,9 @@ ktls_seq(struct sockbuf *sb, struct mbuf *m) * The enq_count argument on return is set to the number of pages of * payload data for this entire chain that need to be encrypted via SW * encryption. The returned value should be passed to ktls_enqueue - * when scheduling encryption of this chain of mbufs. + * when scheduling encryption of this chain of mbufs. To handle the + * special case of empty fragments for TLS 1.0 sessions, an empty + * fragment counts as one page. */ void ktls_frame(struct mbuf *top, struct ktls_session *tls, int *enq_cnt, @@ -1400,12 +1402,16 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, *enq_cnt = 0; for (m = top; m != NULL; m = m->m_next) { /* - * All mbufs in the chain should be non-empty TLS - * records whose payload does not exceed the maximum - * frame length. + * All mbufs in the chain should be TLS records whose + * payload does not exceed the maximum frame length. + * + * Empty TLS records are permitted when using CBC. */ - KASSERT(m->m_len <= maxlen && m->m_len > 0, + KASSERT(m->m_len <= maxlen && + (tls->params.cipher_algorithm == CRYPTO_AES_CBC ? + m->m_len >= 0 : m->m_len > 0), ("ktls_frame: m %p len %d\n", m, m->m_len)); + /* * TLS frames require unmapped mbufs to store session * info. @@ -1496,7 +1502,11 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, if (tls->mode == TCP_TLS_MODE_SW) { m->m_flags |= M_NOTREADY; m->m_epg_nrdy = m->m_epg_npgs; - *enq_cnt += m->m_epg_npgs; + if (__predict_false(tls_len == 0)) { + /* TLS 1.0 empty fragment. */ + *enq_cnt += 1; + } else + *enq_cnt += m->m_epg_npgs; } } } @@ -1961,7 +1971,11 @@ retry_page: dst_iov[i].iov_len = len; } - npages += i; + if (__predict_false(m->m_epg_npgs == 0)) { + /* TLS 1.0 empty fragment. */ + npages++; + } else + npages += i; error = (*tls->sw_encrypt)(tls, (const struct tls_record_layer *)m->m_epg_hdr, Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Tue Oct 13 17:27:37 2020 (r366673) +++ head/sys/kern/uipc_mbuf.c Tue Oct 13 17:30:34 2020 (r366674) @@ -1655,6 +1655,8 @@ m_uiotombuf_nomap(struct uio *uio, int how, int len, i int pflags = malloc2vm_flags(how) | VM_ALLOC_NOOBJ | VM_ALLOC_NODUMP | VM_ALLOC_WIRED; + MPASS((flags & M_PKTHDR) == 0); + /* * len can be zero or an arbitrary large value bound by * the total data supplied by the uio. @@ -1668,10 +1670,23 @@ m_uiotombuf_nomap(struct uio *uio, int how, int len, i maxseg = MBUF_PEXT_MAX_PGS * PAGE_SIZE; /* + * If total is zero, return an empty mbuf. This can occur + * for TLS 1.0 connections which send empty fragments as + * a countermeasure against the known-IV weakness in CBC + * ciphersuites. + */ + if (__predict_false(total == 0)) { + mb = mb_alloc_ext_pgs(how, mb_free_mext_pgs); + if (mb == NULL) + return (NULL); + mb->m_epg_flags = EPG_FLAG_ANON; + return (mb); + } + + /* * Allocate the pages */ m = NULL; - MPASS((flags & M_PKTHDR) == 0); while (total > 0) { mb = mb_alloc_ext_pgs(how, mb_free_mext_pgs); if (mb == NULL) Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Tue Oct 13 17:27:37 2020 (r366673) +++ head/sys/kern/uipc_sockbuf.c Tue Oct 13 17:30:34 2020 (r366674) @@ -212,7 +212,7 @@ sbready(struct sockbuf *sb, struct mbuf *m0, int count while (count > 0) { KASSERT(m->m_flags & M_NOTREADY, ("%s: m %p !M_NOTREADY", __func__, m)); - if ((m->m_flags & M_EXTPG) != 0) { + if ((m->m_flags & M_EXTPG) != 0 && m->m_epg_npgs != 0) { if (count < m->m_epg_nrdy) { m->m_epg_nrdy -= count; count = 0; From owner-svn-src-head@freebsd.org Tue Oct 13 18:00:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78953447640; Tue, 13 Oct 2020 18:00:24 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9jy02XGMz41QH; Tue, 13 Oct 2020 18:00:24 +0000 (UTC) (envelope-from rew@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 3B471215B2; Tue, 13 Oct 2020 18:00:24 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DI0O3T034251; Tue, 13 Oct 2020 18:00:24 GMT (envelope-from rew@FreeBSD.org) Received: (from rew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DI0Oal034250; Tue, 13 Oct 2020 18:00:24 GMT (envelope-from rew@FreeBSD.org) Message-Id: <202010131800.09DI0Oal034250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rew set sender to rew@FreeBSD.org using -f From: Robert Wing Date: Tue, 13 Oct 2020 18:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366676 - head/usr.sbin/ctld X-SVN-Group: head X-SVN-Commit-Author: rew X-SVN-Commit-Paths: head/usr.sbin/ctld X-SVN-Commit-Revision: 366676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 18:00:24 -0000 Author: rew Date: Tue Oct 13 18:00:23 2020 New Revision: 366676 URL: https://svnweb.freebsd.org/changeset/base/366676 Log: ctl.conf(5): fix LUN size in UCL format example. Remove quotes around size in the LUN section and change the suffix to 'GB'. The UCL format does recognize 'G' on its own, which uses a base 10 multiplier where 'GB' uses a 2 power multiplier. Document the difference between valid suffixes when using ctl.conf(5) in the general syntax form or in UCL format. Reviewed by: kevans, mav Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D26716 Modified: head/usr.sbin/ctld/ctl.conf.5 Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Tue Oct 13 17:50:01 2020 (r366675) +++ head/usr.sbin/ctld/ctl.conf.5 Tue Oct 13 18:00:23 2020 (r366676) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2016 +.Dd October 13, 2020 .Dt CTL.CONF 5 .Os .Sh NAME @@ -426,7 +426,12 @@ property set. .It Ic serial Ar string The SCSI serial number presented to the initiator. .It Ic size Ar size -The LUN size, in bytes. +The LUN size, in bytes or by number with a suffix of +.Sy K , M , G , T +(for kilobytes, megabytes, gigabytes, or terabytes). +When the configuration is in UCL format, use the suffix format +.Sy kKmMgG Ns | Ns Sy bB , +(i.e., 4GB, 4gb, and 4Gb are all equivalent). .El .Sh FILES .Bl -tag -width ".Pa /etc/ctl.conf" -compact @@ -536,7 +541,7 @@ lun { example_0 { path = /dev/zvol/tank/example_0 blocksize = 4096 - size = "4G" + size = 4GB } example_1 { From owner-svn-src-head@freebsd.org Tue Oct 13 18:04:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09595447895; Tue, 13 Oct 2020 18:04:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9k2W6VG8z41fx; Tue, 13 Oct 2020 18:04:19 +0000 (UTC) (envelope-from jhb@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 C34A0214F8; Tue, 13 Oct 2020 18:04:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DI4JSu040082; Tue, 13 Oct 2020 18:04:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DI4JR3040081; Tue, 13 Oct 2020 18:04:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010131804.09DI4JR3040081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 13 Oct 2020 18:04:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366677 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 366677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 18:04:20 -0000 Author: jhb Date: Tue Oct 13 18:04:19 2020 New Revision: 366677 URL: https://svnweb.freebsd.org/changeset/base/366677 Log: Add support to the KTLS OCF module for AES-CBC MTE ciphersuites. This is a simplistic approach which encrypts each TLS record in two separate passes: one to generate the MAC and a second to encrypt. This supports TLS 1.0 connections with implicit IVs as well as TLS 1.1+ with explicit IVs. Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D26730 Modified: head/sys/opencrypto/ktls_ocf.c Modified: head/sys/opencrypto/ktls_ocf.c ============================================================================== --- head/sys/opencrypto/ktls_ocf.c Tue Oct 13 18:00:23 2020 (r366676) +++ head/sys/opencrypto/ktls_ocf.c Tue Oct 13 18:04:19 2020 (r366677) @@ -45,7 +45,17 @@ __FBSDID("$FreeBSD$"); struct ocf_session { crypto_session_t sid; + crypto_session_t mac_sid; + int mac_len; struct mtx lock; + bool implicit_iv; + + /* Only used for TLS 1.0 with the implicit IV. */ +#ifdef INVARIANTS + bool in_progress; + uint64_t next_seqno; +#endif + char iv[AES_BLOCK_LEN]; }; struct ocf_operation { @@ -62,6 +72,16 @@ static SYSCTL_NODE(_kern_ipc_tls_stats, OID_AUTO, ocf, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Kernel TLS offload via OCF stats"); +static counter_u64_t ocf_tls10_cbc_crypts; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls10_cbc_crypts, + CTLFLAG_RD, &ocf_tls10_cbc_crypts, + "Total number of OCF TLS 1.0 CBC encryption operations"); + +static counter_u64_t ocf_tls11_cbc_crypts; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls11_cbc_crypts, + CTLFLAG_RD, &ocf_tls11_cbc_crypts, + "Total number of OCF TLS 1.1/1.2 CBC encryption operations"); + static counter_u64_t ocf_tls12_gcm_crypts; SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_gcm_crypts, CTLFLAG_RD, &ocf_tls12_gcm_crypts, @@ -135,6 +155,166 @@ ktls_ocf_dispatch(struct ocf_session *os, struct crypt } static int +ktls_ocf_tls_cbc_encrypt(struct ktls_session *tls, + const struct tls_record_layer *hdr, uint8_t *trailer, struct iovec *iniov, + struct iovec *outiov, int iovcnt, uint64_t seqno, + uint8_t record_type __unused) +{ + struct uio uio, out_uio; + struct tls_mac_data ad; + struct cryptop crp; + struct ocf_session *os; + struct iovec iov[iovcnt + 2]; + struct iovec out_iov[iovcnt + 1]; + int i, error; + uint16_t tls_comp_len; + uint8_t pad; + bool inplace; + + os = tls->cipher; + +#ifdef INVARIANTS + if (os->implicit_iv) { + mtx_lock(&os->lock); + KASSERT(!os->in_progress, + ("concurrent implicit IV encryptions")); + if (os->next_seqno != seqno) { + printf("KTLS CBC: TLS records out of order. " + "Expected %ju, got %ju\n", + (uintmax_t)os->next_seqno, (uintmax_t)seqno); + mtx_unlock(&os->lock); + return (EINVAL); + } + os->in_progress = true; + mtx_unlock(&os->lock); + } +#endif + + /* + * Compute the payload length. + * + * XXX: This could be easily computed O(1) from the mbuf + * fields, but we don't have those accessible here. Can + * at least compute inplace as well while we are here. + */ + tls_comp_len = 0; + inplace = true; + for (i = 0; i < iovcnt; i++) { + tls_comp_len += iniov[i].iov_len; + if (iniov[i].iov_base != outiov[i].iov_base) + inplace = false; + } + + /* Initialize the AAD. */ + ad.seq = htobe64(seqno); + ad.type = hdr->tls_type; + ad.tls_vmajor = hdr->tls_vmajor; + ad.tls_vminor = hdr->tls_vminor; + ad.tls_length = htons(tls_comp_len); + + /* First, compute the MAC. */ + iov[0].iov_base = &ad; + iov[0].iov_len = sizeof(ad); + memcpy(&iov[1], iniov, sizeof(*iniov) * iovcnt); + iov[iovcnt + 1].iov_base = trailer; + iov[iovcnt + 1].iov_len = os->mac_len; + uio.uio_iov = iov; + uio.uio_iovcnt = iovcnt + 2; + uio.uio_offset = 0; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_td = curthread; + uio.uio_resid = sizeof(ad) + tls_comp_len + os->mac_len; + + crypto_initreq(&crp, os->mac_sid); + crp.crp_payload_start = 0; + crp.crp_payload_length = sizeof(ad) + tls_comp_len; + crp.crp_digest_start = crp.crp_payload_length; + crp.crp_op = CRYPTO_OP_COMPUTE_DIGEST; + crp.crp_flags = CRYPTO_F_CBIMM; + crypto_use_uio(&crp, &uio); + error = ktls_ocf_dispatch(os, &crp); + + crypto_destroyreq(&crp); + if (error) { +#ifdef INVARIANTS + if (os->implicit_iv) { + mtx_lock(&os->lock); + os->in_progress = false; + mtx_unlock(&os->lock); + } +#endif + return (error); + } + + /* Second, add the padding. */ + pad = (unsigned)(AES_BLOCK_LEN - (tls_comp_len + os->mac_len + 1)) % + AES_BLOCK_LEN; + for (i = 0; i < pad + 1; i++) + trailer[os->mac_len + i] = pad; + + /* Finally, encrypt the record. */ + + /* + * Don't recopy the input iovec, instead just adjust the + * trailer length and skip over the AAD vector in the uio. + */ + iov[iovcnt + 1].iov_len += pad + 1; + uio.uio_iov = iov + 1; + uio.uio_iovcnt = iovcnt + 1; + uio.uio_resid = tls_comp_len + iov[iovcnt + 1].iov_len; + KASSERT(uio.uio_resid % AES_BLOCK_LEN == 0, + ("invalid encryption size")); + + crypto_initreq(&crp, os->sid); + crp.crp_payload_start = 0; + crp.crp_payload_length = uio.uio_resid; + crp.crp_op = CRYPTO_OP_ENCRYPT; + crp.crp_flags = CRYPTO_F_CBIMM | CRYPTO_F_IV_SEPARATE; + if (os->implicit_iv) + memcpy(crp.crp_iv, os->iv, AES_BLOCK_LEN); + else + memcpy(crp.crp_iv, hdr + 1, AES_BLOCK_LEN); + crypto_use_uio(&crp, &uio); + if (!inplace) { + memcpy(out_iov, outiov, sizeof(*iniov) * iovcnt); + out_iov[iovcnt] = iov[iovcnt + 1]; + out_uio.uio_iov = out_iov; + out_uio.uio_iovcnt = iovcnt + 1; + out_uio.uio_offset = 0; + out_uio.uio_segflg = UIO_SYSSPACE; + out_uio.uio_td = curthread; + out_uio.uio_resid = uio.uio_resid; + crypto_use_output_uio(&crp, &out_uio); + } + + if (os->implicit_iv) + counter_u64_add(ocf_tls10_cbc_crypts, 1); + else + counter_u64_add(ocf_tls11_cbc_crypts, 1); + if (inplace) + counter_u64_add(ocf_inplace, 1); + else + counter_u64_add(ocf_separate_output, 1); + error = ktls_ocf_dispatch(os, &crp); + + crypto_destroyreq(&crp); + + if (os->implicit_iv) { + KASSERT(os->mac_len + pad + 1 >= AES_BLOCK_LEN, + ("trailer too short to read IV")); + memcpy(os->iv, trailer + os->mac_len + pad + 1 - AES_BLOCK_LEN, + AES_BLOCK_LEN); +#ifdef INVARIANTS + mtx_lock(&os->lock); + os->next_seqno = seqno + 1; + os->in_progress = false; + mtx_unlock(&os->lock); +#endif + } + return (error); +} + +static int ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, const struct tls_record_layer *hdr, uint8_t *trailer, struct iovec *iniov, struct iovec *outiov, int iovcnt, uint64_t seqno, @@ -377,12 +557,14 @@ ktls_ocf_free(struct ktls_session *tls) static int ktls_ocf_try(struct socket *so, struct ktls_session *tls, int direction) { - struct crypto_session_params csp; + struct crypto_session_params csp, mac_csp; struct ocf_session *os; - int error; + int error, mac_len; memset(&csp, 0, sizeof(csp)); - csp.csp_flags |= CSP_F_SEPARATE_OUTPUT | CSP_F_SEPARATE_AAD; + memset(&mac_csp, 0, sizeof(mac_csp)); + mac_csp.csp_mode = CSP_MODE_NONE; + mac_len = 0; switch (tls->params.cipher_algorithm) { case CRYPTO_AES_NIST_GCM_16: @@ -393,27 +575,75 @@ ktls_ocf_try(struct socket *so, struct ktls_session *t default: return (EINVAL); } + + /* Only TLS 1.2 and 1.3 are supported. */ + if (tls->params.tls_vmajor != TLS_MAJOR_VER_ONE || + tls->params.tls_vminor < TLS_MINOR_VER_TWO || + tls->params.tls_vminor > TLS_MINOR_VER_THREE) + return (EPROTONOSUPPORT); + + /* TLS 1.3 is not yet supported for receive. */ + if (direction == KTLS_RX && + tls->params.tls_vminor == TLS_MINOR_VER_THREE) + return (EPROTONOSUPPORT); + + csp.csp_flags |= CSP_F_SEPARATE_OUTPUT | CSP_F_SEPARATE_AAD; csp.csp_mode = CSP_MODE_AEAD; csp.csp_cipher_alg = CRYPTO_AES_NIST_GCM_16; csp.csp_cipher_key = tls->params.cipher_key; csp.csp_cipher_klen = tls->params.cipher_key_len; csp.csp_ivlen = AES_GCM_IV_LEN; break; + case CRYPTO_AES_CBC: + switch (tls->params.cipher_key_len) { + case 128 / 8: + case 256 / 8: + break; + default: + return (EINVAL); + } + + switch (tls->params.auth_algorithm) { + case CRYPTO_SHA1_HMAC: + mac_len = SHA1_HASH_LEN; + break; + case CRYPTO_SHA2_256_HMAC: + mac_len = SHA2_256_HASH_LEN; + break; + case CRYPTO_SHA2_384_HMAC: + mac_len = SHA2_384_HASH_LEN; + break; + default: + return (EINVAL); + } + + /* Only TLS 1.0-1.2 are supported. */ + if (tls->params.tls_vmajor != TLS_MAJOR_VER_ONE || + tls->params.tls_vminor < TLS_MINOR_VER_ZERO || + tls->params.tls_vminor > TLS_MINOR_VER_TWO) + return (EPROTONOSUPPORT); + + /* AES-CBC is not supported for receive. */ + if (direction == KTLS_RX) + return (EPROTONOSUPPORT); + + csp.csp_flags |= CSP_F_SEPARATE_OUTPUT; + csp.csp_mode = CSP_MODE_CIPHER; + csp.csp_cipher_alg = CRYPTO_AES_CBC; + csp.csp_cipher_key = tls->params.cipher_key; + csp.csp_cipher_klen = tls->params.cipher_key_len; + csp.csp_ivlen = AES_BLOCK_LEN; + + mac_csp.csp_flags |= CSP_F_SEPARATE_OUTPUT; + mac_csp.csp_mode = CSP_MODE_DIGEST; + mac_csp.csp_auth_alg = tls->params.auth_algorithm; + mac_csp.csp_auth_key = tls->params.auth_key; + mac_csp.csp_auth_klen = tls->params.auth_key_len; + break; default: return (EPROTONOSUPPORT); } - /* Only TLS 1.2 and 1.3 are supported. */ - if (tls->params.tls_vmajor != TLS_MAJOR_VER_ONE || - tls->params.tls_vminor < TLS_MINOR_VER_TWO || - tls->params.tls_vminor > TLS_MINOR_VER_THREE) - return (EPROTONOSUPPORT); - - /* TLS 1.3 is not yet supported for receive. */ - if (direction == KTLS_RX && - tls->params.tls_vminor == TLS_MINOR_VER_THREE) - return (EPROTONOSUPPORT); - os = malloc(sizeof(*os), M_KTLS_OCF, M_NOWAIT | M_ZERO); if (os == NULL) return (ENOMEM); @@ -425,15 +655,34 @@ ktls_ocf_try(struct socket *so, struct ktls_session *t return (error); } + if (mac_csp.csp_mode != CSP_MODE_NONE) { + error = crypto_newsession(&os->mac_sid, &mac_csp, + CRYPTO_FLAG_HARDWARE | CRYPTO_FLAG_SOFTWARE); + if (error) { + crypto_freesession(os->sid); + free(os, M_KTLS_OCF); + return (error); + } + os->mac_len = mac_len; + } + mtx_init(&os->lock, "ktls_ocf", NULL, MTX_DEF); tls->cipher = os; - if (direction == KTLS_TX) { - if (tls->params.tls_vminor == TLS_MINOR_VER_THREE) - tls->sw_encrypt = ktls_ocf_tls13_gcm_encrypt; - else - tls->sw_encrypt = ktls_ocf_tls12_gcm_encrypt; + if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16) { + if (direction == KTLS_TX) { + if (tls->params.tls_vminor == TLS_MINOR_VER_THREE) + tls->sw_encrypt = ktls_ocf_tls13_gcm_encrypt; + else + tls->sw_encrypt = ktls_ocf_tls12_gcm_encrypt; + } else { + tls->sw_decrypt = ktls_ocf_tls12_gcm_decrypt; + } } else { - tls->sw_decrypt = ktls_ocf_tls12_gcm_decrypt; + tls->sw_encrypt = ktls_ocf_tls_cbc_encrypt; + if (tls->params.tls_vminor == TLS_MINOR_VER_ZERO) { + os->implicit_iv = true; + memcpy(os->iv, tls->params.iv, AES_BLOCK_LEN); + } } tls->free = ktls_ocf_free; return (0); @@ -453,6 +702,8 @@ ktls_ocf_modevent(module_t mod, int what, void *arg) switch (what) { case MOD_LOAD: + ocf_tls10_cbc_crypts = counter_u64_alloc(M_WAITOK); + ocf_tls11_cbc_crypts = counter_u64_alloc(M_WAITOK); ocf_tls12_gcm_crypts = counter_u64_alloc(M_WAITOK); ocf_tls13_gcm_crypts = counter_u64_alloc(M_WAITOK); ocf_inplace = counter_u64_alloc(M_WAITOK); @@ -463,6 +714,8 @@ ktls_ocf_modevent(module_t mod, int what, void *arg) error = ktls_crypto_backend_deregister(&ocf_backend); if (error) return (error); + counter_u64_free(ocf_tls10_cbc_crypts); + counter_u64_free(ocf_tls11_cbc_crypts); counter_u64_free(ocf_tls12_gcm_crypts); counter_u64_free(ocf_tls13_gcm_crypts); counter_u64_free(ocf_inplace); From owner-svn-src-head@freebsd.org Tue Oct 13 18:28:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7AB32448088; Tue, 13 Oct 2020 18:28:49 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9kZn2fXtz42r3; Tue, 13 Oct 2020 18:28:49 +0000 (UTC) (envelope-from tychon@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 3E8BB2166F; Tue, 13 Oct 2020 18:28:49 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DISn34052542; Tue, 13 Oct 2020 18:28:49 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DISnmc052541; Tue, 13 Oct 2020 18:28:49 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <202010131828.09DISnmc052541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Tue, 13 Oct 2020 18:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366678 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 366678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 18:28:49 -0000 Author: tychon Date: Tue Oct 13 18:28:48 2020 New Revision: 366678 URL: https://svnweb.freebsd.org/changeset/base/366678 Log: eliminate possible race in parallel TLB shootdown IPI On the target side TLB shootdown IPI handler, prevent the compiler from performing a forward store optimization which may mask a subsequent update to the scoreboard by the initiator. Reported by: Max Laier, Anton Rang Discussed with: kib Sponsored by: Dell EMC Isilon Modified: head/sys/amd64/amd64/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Tue Oct 13 18:04:19 2020 (r366677) +++ head/sys/amd64/amd64/mp_machdep.c Tue Oct 13 18:28:48 2020 (r366678) @@ -1094,7 +1094,7 @@ invlop_handler(void) for (;;) { for (initiator_cpu_id = 0; initiator_cpu_id <= mp_maxid; initiator_cpu_id++) { - if (scoreboard[initiator_cpu_id] == 0) + if (atomic_load_int(&scoreboard[initiator_cpu_id]) == 0) break; } if (initiator_cpu_id > mp_maxid) From owner-svn-src-head@freebsd.org Tue Oct 13 18:35:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22FE94481A0; Tue, 13 Oct 2020 18:35:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9kkm069dz43Bc; Tue, 13 Oct 2020 18:35:44 +0000 (UTC) (envelope-from adrian@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 D7F322175F; Tue, 13 Oct 2020 18:35:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DIZhJO058605; Tue, 13 Oct 2020 18:35:43 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DIZhQH058604; Tue, 13 Oct 2020 18:35:43 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202010131835.09DIZhQH058604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 13 Oct 2020 18:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366679 - head/tools/tools/ath/athdebug X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/ath/athdebug X-SVN-Commit-Revision: 366679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 18:35:44 -0000 Author: adrian Date: Tue Oct 13 18:35:43 2020 New Revision: 366679 URL: https://svnweb.freebsd.org/changeset/base/366679 Log: [athdebug] Fix warnings generated by gcc on mips * commented out currently unused/dead code; need to see what it was once used for * remove unused variable * fix typing Modified: head/tools/tools/ath/athdebug/athdebug.c Modified: head/tools/tools/ath/athdebug/athdebug.c ============================================================================== --- head/tools/tools/ath/athdebug/athdebug.c Tue Oct 13 18:28:48 2020 (r366678) +++ head/tools/tools/ath/athdebug/athdebug.c Tue Oct 13 18:35:43 2020 (r366679) @@ -112,7 +112,7 @@ static struct { static uint64_t getflag(const char *name, int len) { - int i; + unsigned int i; for (i = 0; i < nitems(flags); i++) if (strncasecmp(flags[i].name, name, len) == 0) @@ -120,6 +120,7 @@ getflag(const char *name, int len) return 0; } +#if 0 static const char * getflagname(u_int flag) { @@ -130,11 +131,12 @@ getflagname(u_int flag) return flags[i].name; return "???"; } +#endif static void usage(void) { - int i; + unsigned int i; fprintf(stderr, "usage: %s [-i device] [flags]\n", progname); fprintf(stderr, "where flags are:\n"); @@ -149,7 +151,8 @@ main(int argc, char *argv[]) const char *ifname; const char *cp, *tp; const char *sep; - int c, op, i; + int op; + unsigned int i; uint64_t debug, ndebug; size_t debuglen; char oid[256]; From owner-svn-src-head@freebsd.org Tue Oct 13 18:36:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCEE84481B6; Tue, 13 Oct 2020 18:36:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9kll5Pgxz43JT; Tue, 13 Oct 2020 18:36:35 +0000 (UTC) (envelope-from adrian@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 9A98021B6C; Tue, 13 Oct 2020 18:36:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DIaZB1058692; Tue, 13 Oct 2020 18:36:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DIaZE7058691; Tue, 13 Oct 2020 18:36:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202010131836.09DIaZE7058691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 13 Oct 2020 18:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366680 - head/tools/tools/ath X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/ath X-SVN-Commit-Revision: 366680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 18:36:35 -0000 Author: adrian Date: Tue Oct 13 18:36:35 2020 New Revision: 366680 URL: https://svnweb.freebsd.org/changeset/base/366680 Log: [ath] Set WARNS to 0 here for now There are still more warnings to fix here, but gcc on mips treats a lot of these as failures. So stop it stopping me for now whilst I fix them. Modified: head/tools/tools/ath/Makefile.inc Modified: head/tools/tools/ath/Makefile.inc ============================================================================== --- head/tools/tools/ath/Makefile.inc Tue Oct 13 18:35:43 2020 (r366679) +++ head/tools/tools/ath/Makefile.inc Tue Oct 13 18:36:35 2020 (r366680) @@ -5,6 +5,8 @@ MAN= ATH_DEFAULT= ath0 +WARNS?= 0 + CFLAGS+=-DATH_DEFAULT='"${ATH_DEFAULT}"' CFLAGS+=-I${.CURDIR} CFLAGS+=-I${.CURDIR}/../common From owner-svn-src-head@freebsd.org Tue Oct 13 18:57:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AEBE448C26; Tue, 13 Oct 2020 18:57:43 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9lD66lwyz46rx; Tue, 13 Oct 2020 18:57:42 +0000 (UTC) (envelope-from ae@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 AE35F22188; Tue, 13 Oct 2020 18:57:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DIvgnb075138; Tue, 13 Oct 2020 18:57:42 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DIvgG7075137; Tue, 13 Oct 2020 18:57:42 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202010131857.09DIvgG7075137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 13 Oct 2020 18:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366681 - head/sys/netpfil/ipfw/nat64 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 366681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 18:57:43 -0000 Author: ae Date: Tue Oct 13 18:57:42 2020 New Revision: 366681 URL: https://svnweb.freebsd.org/changeset/base/366681 Log: Add IPv4 fragments reassembling to NAT64LSN. NAT64LSN requires the presence of upper level protocol header in a IPv4 datagram to find corresponding state to make translation. Now it will be handled automatically by nat64lsn instance. Reviewed by: melifaro Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D26758 Modified: head/sys/netpfil/ipfw/nat64/nat64lsn.c Modified: head/sys/netpfil/ipfw/nat64/nat64lsn.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64lsn.c Tue Oct 13 18:36:35 2020 (r366680) +++ head/sys/netpfil/ipfw/nat64/nat64lsn.c Tue Oct 13 18:57:42 2020 (r366681) @@ -547,6 +547,57 @@ nat64lsn_get_state4to6(struct nat64lsn_cfg *cfg, struc return (NULL); } +/* + * Reassemble IPv4 fragments, make PULLUP if needed, get some ULP fields + * that might be unknown until reassembling is completed. + */ +static struct mbuf* +nat64lsn_reassemble4(struct nat64lsn_cfg *cfg, struct mbuf *m, + uint16_t *port) +{ + struct ip *ip; + int len; + + m = ip_reass(m); + if (m == NULL) + return (NULL); + /* IP header must be contigious after ip_reass() */ + ip = mtod(m, struct ip *); + len = ip->ip_hl << 2; + switch (ip->ip_p) { + case IPPROTO_ICMP: + len += ICMP_MINLEN; /* Enough to get icmp_id */ + break; + case IPPROTO_TCP: + len += sizeof(struct tcphdr); + break; + case IPPROTO_UDP: + len += sizeof(struct udphdr); + break; + default: + m_freem(m); + NAT64STAT_INC(&cfg->base.stats, noproto); + return (NULL); + } + if (m->m_len < len) { + m = m_pullup(m, len); + if (m == NULL) { + NAT64STAT_INC(&cfg->base.stats, nomem); + return (NULL); + } + ip = mtod(m, struct ip *); + } + switch (ip->ip_p) { + case IPPROTO_TCP: + *port = ntohs(L3HDR(ip, struct tcphdr *)->th_dport); + break; + case IPPROTO_UDP: + *port = ntohs(L3HDR(ip, struct udphdr *)->uh_dport); + break; + } + return (m); +} + static int nat64lsn_translate4(struct nat64lsn_cfg *cfg, const struct ipfw_flow_id *f_id, struct mbuf **mp) @@ -566,6 +617,14 @@ nat64lsn_translate4(struct nat64lsn_cfg *cfg, if (addr < cfg->prefix4 || addr > cfg->pmask4) { NAT64STAT_INC(&cfg->base.stats, nomatch4); return (cfg->nomatch_verdict); + } + + /* Reassemble fragments if needed */ + ret = ntohs(mtod(*mp, struct ip *)->ip_off); + if ((ret & (IP_MF | IP_OFFMASK)) != 0) { + *mp = nat64lsn_reassemble4(cfg, *mp, &port); + if (*mp == NULL) + return (IP_FW_DENY); } /* Check if protocol is supported */ From owner-svn-src-head@freebsd.org Tue Oct 13 19:34:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B69444993B; Tue, 13 Oct 2020 19:34:37 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9m2h6cXYz49dS; Tue, 13 Oct 2020 19:34:36 +0000 (UTC) (envelope-from ae@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 C666C221F2; Tue, 13 Oct 2020 19:34:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DJYaLW099241; Tue, 13 Oct 2020 19:34:36 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DJYabV099240; Tue, 13 Oct 2020 19:34:36 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202010131934.09DJYabV099240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 13 Oct 2020 19:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366682 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 19:34:37 -0000 Author: ae Date: Tue Oct 13 19:34:36 2020 New Revision: 366682 URL: https://svnweb.freebsd.org/changeset/base/366682 Log: Join to AllHosts multicast group again when adding an existing IPv4 address. When SIOCAIFADDR ioctl configures an IPv4 address that is already exist, it removes old ifaddr. When this IPv4 address is only one configured on the interface, this also leads to leaving from AllHosts multicast group. Then an address is added again, but due to the bug, this doesn't lead to joining to AllHosts multicast group. Submitted by: yannis.planus_alstomgroup.com Reviewed by: gnn MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26757 Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue Oct 13 18:57:42 2020 (r366681) +++ head/sys/netinet/in.c Tue Oct 13 19:34:36 2020 (r366682) @@ -377,10 +377,11 @@ in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifne continue; it = (struct in_ifaddr *)ifa; - iaIsFirst = false; if (it->ia_addr.sin_addr.s_addr == addr->sin_addr.s_addr && prison_check_ip4(td->td_ucred, &addr->sin_addr) == 0) ia = it; + else + iaIsFirst = false; } NET_EPOCH_EXIT(et); From owner-svn-src-head@freebsd.org Tue Oct 13 19:42:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3500F449AE3; Tue, 13 Oct 2020 19:42:23 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9mCg0jw6z4CM5; Tue, 13 Oct 2020 19:42:23 +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 F03DA22946; Tue, 13 Oct 2020 19:42:22 +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 09DJgMTN004852; Tue, 13 Oct 2020 19:42:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DJgMWk004851; Tue, 13 Oct 2020 19:42:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202010131942.09DJgMWk004851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 13 Oct 2020 19:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366683 - head/contrib/llvm-project/clang/lib/Sema X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm-project/clang/lib/Sema X-SVN-Commit-Revision: 366683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 19:42:23 -0000 Author: dim Date: Tue Oct 13 19:42:22 2020 New Revision: 366683 URL: https://svnweb.freebsd.org/changeset/base/366683 Log: Merge commit 35ecc7fe4 from llvm git (by Hubert Tong): [clang][Sema] Fix PR47676: Handle dependent AltiVec C-style cast Fix premature decision in the presence of type-dependent expression operands on whether AltiVec vector initializations from single expressions are "splat" operations. Verify that the instantiation is able to determine the correct cast semantics for both the scalar type and the vector type case. Note that, because the change only affects the single-expression case (and the target type is an AltiVec-style vector type), the replacement of a parenthesized list with a parenthesized expression does not change the semantics of the program in a program-observable manner. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D88526 This should fix 'Assertion failed: (isScalarType()), function getScalarTypeKind, file /usr/src/contrib/llvm-project/clang/lib/AST /Type.cpp, line 2146', when building the graphics/opencv-core port for powerpc64le. Requested by: pkubaj MFC after: 4 weeks X-MFC-With: r364284 Modified: head/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp Modified: head/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp Tue Oct 13 19:34:36 2020 (r366682) +++ head/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp Tue Oct 13 19:42:22 2020 (r366683) @@ -7402,7 +7402,7 @@ Sema::ActOnCastExpr(Scope *S, SourceLocation LParenLoc } if (PE || PLE->getNumExprs() == 1) { Expr *E = (PE ? PE->getSubExpr() : PLE->getExpr(0)); - if (!E->getType()->isVectorType()) + if (!E->isTypeDependent() && !E->getType()->isVectorType()) isVectorLiteral = true; } else From owner-svn-src-head@freebsd.org Tue Oct 13 20:04:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2556A44A276; Tue, 13 Oct 2020 20:04:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9mht0DnQz4DCN; Tue, 13 Oct 2020 20:04:14 +0000 (UTC) (envelope-from brooks@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 DF88222B47; Tue, 13 Oct 2020 20:04:13 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DK4D3Y018258; Tue, 13 Oct 2020 20:04:13 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DK4DlY018257; Tue, 13 Oct 2020 20:04:13 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202010132004.09DK4DlY018257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 13 Oct 2020 20:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366684 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 366684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 20:04:14 -0000 Author: brooks Date: Tue Oct 13 20:04:13 2020 New Revision: 366684 URL: https://svnweb.freebsd.org/changeset/base/366684 Log: Remove --ld-path=* from _LDFLAGS It makes no sense to pass --ld-path to direct ${LD} invocations. This was missed in r366270 due to not doing a clean build. Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Tue Oct 13 19:42:22 2020 (r366683) +++ head/share/mk/sys.mk Tue Oct 13 20:04:13 2020 (r366684) @@ -240,7 +240,7 @@ LFLAGS ?= # compiler driver flags (e.g. -mabi=*) that conflict with flags to LD. LD ?= ld LDFLAGS ?= -_LDFLAGS = ${LDFLAGS:S/-Wl,//g:N-mabi=*:N-fuse-ld=*} +_LDFLAGS = ${LDFLAGS:S/-Wl,//g:N-mabi=*:N-fuse-ld=*:N--ld-path=*} MAKE ?= make From owner-svn-src-head@freebsd.org Tue Oct 13 20:40:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F71944AE54; Tue, 13 Oct 2020 20:40:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9nVK6fyGz4Fn1; Tue, 13 Oct 2020 20:40:09 +0000 (UTC) (envelope-from mjg@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 C3D6D2331E; Tue, 13 Oct 2020 20:40:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DKe9Ed037172; Tue, 13 Oct 2020 20:40:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DKe9xG037171; Tue, 13 Oct 2020 20:40:09 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010132040.09DKe9xG037171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 13 Oct 2020 20:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366685 - head/sys/contrib/openzfs/module/os/freebsd/spl X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/contrib/openzfs/module/os/freebsd/spl X-SVN-Commit-Revision: 366685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 20:40:10 -0000 Author: mjg Date: Tue Oct 13 20:40:09 2020 New Revision: 366685 URL: https://svnweb.freebsd.org/changeset/base/366685 Log: FreeBSD: fix panic due to tqid overflow The 32-bit counter eventually wraps to 0 which is a sentinel for invalid id. Make it 64-bit on LP64 platforms and 0-check otherwise. Note: Linux counterpart uses id stored per queue instead of a global. I did not check going that way is feasible with the goal being the minimal fix doing the job. Reported by: YAMAMOTO Shigeru Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D26759 Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c Modified: head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c Tue Oct 13 20:04:13 2020 (r366684) +++ head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c Tue Oct 13 20:40:09 2020 (r366685) @@ -67,7 +67,7 @@ static unsigned long tqenthash; static unsigned long tqenthashlock; static struct sx *tqenthashtbl_lock; -static uint32_t tqidnext = 1; +static taskqid_t tqidnext; #define TQIDHASH(tqid) (&tqenthashtbl[(tqid) & tqenthash]) #define TQIDHASHLOCK(tqid) (&tqenthashtbl_lock[((tqid) & tqenthashlock)]) @@ -90,7 +90,6 @@ system_taskq_init(void *arg) M_TASKQ, M_WAITOK | M_ZERO); for (i = 0; i < tqenthashlock + 1; i++) sx_init_flags(&tqenthashtbl_lock[i], "tqenthash", SX_DUPOK); - tqidnext = 1; taskq_zone = uma_zcreate("taskq_zone", sizeof (taskq_ent_t), NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0); @@ -121,6 +120,28 @@ system_taskq_fini(void *arg) SYSUNINIT(system_taskq_fini, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_fini, NULL); +#ifdef __LP64__ +static taskqid_t +__taskq_genid(void) +{ + + return (atomic_fetchadd_long(&tqidnext, 1) + 1); +} +#else +static taskqid_t +__taskq_genid(void) +{ + taskqid_t tqid; + + for (;;) { + tqid = atomic_fetchadd_int(&tqidnext, 1) + 1; + if (__predict_true(tqid != 0)) + break; + } + return (tqid); +} +#endif + static taskq_ent_t * taskq_lookup(taskqid_t tqid) { @@ -140,8 +161,10 @@ taskq_lookup(taskqid_t tqid) static taskqid_t taskq_insert(taskq_ent_t *ent) { - taskqid_t tqid = atomic_fetchadd_int(&tqidnext, 1); + taskqid_t tqid; + tqid = __taskq_genid(); + VERIFY(tqid); ent->tqent_id = tqid; ent->tqent_registered = B_TRUE; sx_xlock(TQIDHASHLOCK(tqid)); @@ -289,7 +312,7 @@ taskq_dispatch_delay(taskq_t *tq, task_func_t func, vo uint_t flags, clock_t expire_time) { taskq_ent_t *task; - taskqid_t tid; + taskqid_t tqid; clock_t timo; int mflag; @@ -310,13 +333,13 @@ taskq_dispatch_delay(taskq_t *tq, task_func_t func, vo task->tqent_type = TIMEOUT_TASK; task->tqent_cancelled = B_FALSE; refcount_init(&task->tqent_rc, 1); - tid = taskq_insert(task); + tqid = taskq_insert(task); TIMEOUT_TASK_INIT(tq->tq_queue, &task->tqent_timeout_task, 0, taskq_run, task); taskqueue_enqueue_timeout(tq->tq_queue, &task->tqent_timeout_task, timo); - return (tid); + return (tqid); } taskqid_t @@ -324,7 +347,7 @@ taskq_dispatch(taskq_t *tq, task_func_t func, void *ar { taskq_ent_t *task; int mflag, prio; - taskqid_t tid; + taskqid_t tqid; if ((flags & (TQ_SLEEP | TQ_NOQUEUE)) == TQ_SLEEP) mflag = M_WAITOK; @@ -344,11 +367,10 @@ taskq_dispatch(taskq_t *tq, task_func_t func, void *ar task->tqent_arg = arg; task->tqent_cancelled = B_FALSE; task->tqent_type = NORMAL_TASK; - tid = taskq_insert(task); + tqid = taskq_insert(task); TASK_INIT(&task->tqent_task, prio, taskq_run, task); taskqueue_enqueue(tq->tq_queue, &task->tqent_task); - VERIFY(tid); - return (tid); + return (tqid); } static void From owner-svn-src-head@freebsd.org Tue Oct 13 20:41:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65A1D44AD7D; Tue, 13 Oct 2020 20:41:52 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9nXJ23vDz4G4m; Tue, 13 Oct 2020 20:41:52 +0000 (UTC) (envelope-from rpokala@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 116D52347D; Tue, 13 Oct 2020 20:41:52 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DKfpZR042848; Tue, 13 Oct 2020 20:41:51 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DKfpMR042847; Tue, 13 Oct 2020 20:41:51 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <202010132041.09DKfpMR042847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Tue, 13 Oct 2020 20:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366686 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 366686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 20:41:52 -0000 Author: rpokala Date: Tue Oct 13 20:41:51 2020 New Revision: 366686 URL: https://svnweb.freebsd.org/changeset/base/366686 Log: Allow IP over IB to work with multiple FIBs. Call M_SETFIB() to make sure the IPoIB packet is directed to the correct interface-specific FIB. This was sufficient to allow general-purpose routing using the default FIB, and a separate FIB for routing between IPoIB on ib0 and IPoEthernet on mce0. Reviewed by: hselasky Obtained from: Anmol Kumar MFC after: 1 week Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D25239 Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Tue Oct 13 20:40:09 2020 (r366685) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Tue Oct 13 20:41:51 2020 (r366686) @@ -1617,6 +1617,8 @@ ipoib_demux(struct ifnet *ifp, struct mbuf *m, u_short m_freem(m); return; } + /* Direct packet to correct FIB based on interface config */ + M_SETFIB(m, ifp->if_fib); /* * Dispatch frame to upper layer. */ From owner-svn-src-head@freebsd.org Tue Oct 13 20:43:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 021C244B03B; Tue, 13 Oct 2020 20:43:37 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9nZJ6Kfmz4GRm; Tue, 13 Oct 2020 20:43:36 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (c-98-207-126-143.hsd1.ca.comcast.net [98.207.126.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 3EEE61A500; Tue, 13 Oct 2020 20:43:36 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.41.20091302 Date: Tue, 13 Oct 2020 13:43:31 -0700 Subject: Re: svn commit: r366686 - head/sys/ofed/drivers/infiniband/ulp/ipoib From: Ravi Pokala To: Ravi Pokala , , , Message-ID: Thread-Topic: svn commit: r366686 - head/sys/ofed/drivers/infiniband/ulp/ipoib References: <202010132041.09DKfpMR042847@repo.freebsd.org> In-Reply-To: <202010132041.09DKfpMR042847@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 20:43:37 -0000 -----Original Message----- From: on behalf of Ravi Pokala Date: 2020-10-13, Tuesday at 13:41 To: , , Subject: svn commit: r366686 - head/sys/ofed/drivers/infiniband/ulp/ipoib Author: rpokala Date: Tue Oct 13 20:41:51 2020 New Revision: 366686 URL: https://svnweb.freebsd.org/changeset/base/366686 Log: Allow IP over IB to work with multiple FIBs. Call M_SETFIB() to make sure the IPoIB packet is directed to the correct interface-specific FIB. This was sufficient to allow general-purpose routing using the default FIB, and a separate FIB for routing between IPoIB on ib0 and IPoEthernet on mce0. Reviewed by: hselasky Obtained from: Anmol Kumar MFC after: 1 week Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D25239 That's actually https://reviews.freebsd.org/D26733 -Ravi (rpokala@) Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Tue Oct 13 20:40:09 2020 (r366685) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Tue Oct 13 20:41:51 2020 (r366686) @@ -1617,6 +1617,8 @@ ipoib_demux(struct ifnet *ifp, struct mbuf *m, u_short m_freem(m); return; } + /* Direct packet to correct FIB based on interface config */ + M_SETFIB(m, ifp->if_fib); /* * Dispatch frame to upper layer. */ From owner-svn-src-head@freebsd.org Tue Oct 13 22:20:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0B0744CF4A; Tue, 13 Oct 2020 22:20:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9qjb4jwdz4M17; Tue, 13 Oct 2020 22:20:03 +0000 (UTC) (envelope-from jhb@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 8521F240DF; Tue, 13 Oct 2020 22:20:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DMK3CC098652; Tue, 13 Oct 2020 22:20:03 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DMK3b5098651; Tue, 13 Oct 2020 22:20:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010132220.09DMK3b5098651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 13 Oct 2020 22:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366687 - head/tools/tools/crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tools/tools/crypto X-SVN-Commit-Revision: 366687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 22:20:03 -0000 Author: jhb Date: Tue Oct 13 22:20:03 2020 New Revision: 366687 URL: https://svnweb.freebsd.org/changeset/base/366687 Log: Fix various warnings with higher WARNS. - Rename global 'crid' to 'requested_crid' to avoid shadowing. - Remove some unused function arguments. - Use __DECONST(). Modified: head/tools/tools/crypto/cryptocheck.c Modified: head/tools/tools/crypto/cryptocheck.c ============================================================================== --- head/tools/tools/crypto/cryptocheck.c Tue Oct 13 20:41:51 2020 (r366686) +++ head/tools/tools/crypto/cryptocheck.c Tue Oct 13 22:20:03 2020 (r366687) @@ -144,7 +144,7 @@ struct ocf_session { int crid; }; -const struct alg { +static const struct alg { const char *name; int cipher; int mac; @@ -215,7 +215,7 @@ const struct alg { }; static bool verbose; -static int crid; +static int requested_crid; static size_t aad_sizes[48], sizes[128]; static u_int naad_sizes, nsizes; @@ -340,7 +340,7 @@ crlookup(const char *devname) return (find.crid); } -const char * +static const char * crfind(int crid) { static struct crypt_find_op find; @@ -427,7 +427,7 @@ static void ocf_init_sop(struct session2_op *sop) { memset(sop, 0, sizeof(*sop)); - sop->crid = crid; + sop->crid = requested_crid; } static bool @@ -439,7 +439,7 @@ ocf_init_session(struct session2_op *sop, const char * fd = crget(); if (ioctl(fd, CIOCGSESSION2, sop) < 0) { warn("cryptodev %s %s not supported for device %s", - type, name, crfind(crid)); + type, name, crfind(sop->crid)); close(fd); ses->fd = -1; return (false); @@ -483,7 +483,6 @@ ocf_hash(const struct alg *alg, const char *buffer, si struct ocf_session ses; struct session2_op sop; struct crypt_op cop; - int error; ocf_init_sop(&sop); sop.mac = alg->mac; @@ -493,12 +492,12 @@ ocf_hash(const struct alg *alg, const char *buffer, si ocf_init_cop(&ses, &cop); cop.op = 0; cop.len = size; - cop.src = (char *)buffer; + cop.src = __DECONST(char *, buffer); cop.mac = digest; if (ioctl(ses.fd, CIOCCRYPT, &cop) < 0) { warn("cryptodev %s (%zu) HASH failed for device %s", alg->name, - size, crfind(crid)); + size, crfind(ses.crid)); ocf_destroy_session(&ses); return (false); } @@ -555,7 +554,7 @@ run_hash_test(const struct alg *alg, size_t size) memset(test_digest, 0x3c, sizeof(test_digest)); md = alg->evp_md(); - assert(EVP_MD_size(md) <= sizeof(control_digest)); + assert((size_t)EVP_MD_size(md) <= sizeof(control_digest)); buffer = alloc_buffer(size); @@ -597,7 +596,7 @@ ocf_hmac(const struct alg *alg, const char *buffer, si ocf_init_sop(&sop); sop.mackeylen = key_len; - sop.mackey = (char *)key; + sop.mackey = __DECONST(char *, key); sop.mac = alg->mac; if (!ocf_init_session(&sop, "HMAC", alg->name, &ses)) return (false); @@ -605,12 +604,12 @@ ocf_hmac(const struct alg *alg, const char *buffer, si ocf_init_cop(&ses, &cop); cop.op = 0; cop.len = size; - cop.src = (char *)buffer; + cop.src = __DECONST(char *, buffer); cop.mac = digest; if (ioctl(ses.fd, CIOCCRYPT, &cop) < 0) { warn("cryptodev %s (%zu) HMAC failed for device %s", alg->name, - size, crfind(crid)); + size, crfind(ses.crid)); ocf_destroy_session(&ses); return (false); } @@ -634,7 +633,7 @@ run_hmac_test(const struct alg *alg, size_t size) md = alg->evp_md(); key_len = EVP_MD_size(md); - assert(EVP_MD_size(md) <= sizeof(control_digest)); + assert((size_t)EVP_MD_size(md) <= sizeof(control_digest)); key = alloc_buffer(key_len); buffer = alloc_buffer(size); @@ -696,7 +695,7 @@ openssl_cipher(const struct alg *alg, const EVP_CIPHER errx(1, "OpenSSL %s (%zu) cipher final failed: %s", alg->name, size, ERR_error_string(ERR_get_error(), NULL)); total += outl; - if (total != size) + if ((size_t)total != size) errx(1, "OpenSSL %s (%zu) cipher size mismatch: %d", alg->name, size, total); EVP_CIPHER_CTX_free(ctx); @@ -710,7 +709,7 @@ ocf_init_cipher_session(const struct alg *alg, const c ocf_init_sop(&sop); sop.keylen = key_len; - sop.key = (char *)key; + sop.key = __DECONST(char *, key); sop.cipher = alg->cipher; return (ocf_init_session(&sop, "cipher", alg->name, ses)); } @@ -724,13 +723,13 @@ ocf_cipher(const struct ocf_session *ses, const struct ocf_init_cop(ses, &cop); cop.op = op; cop.len = size; - cop.src = (char *)input; + cop.src = __DECONST(char *, input); cop.dst = output; - cop.iv = (char *)iv; + cop.iv = __DECONST(char *, iv); if (ioctl(ses->fd, CIOCCRYPT, &cop) < 0) { warn("cryptodev %s (%zu) cipher failed for device %s", - alg->name, size, crfind(crid)); + alg->name, size, crfind(ses->crid)); return (false); } @@ -842,18 +841,18 @@ ocf_init_eta_session(const struct alg *alg, const char ocf_init_sop(&sop); sop.keylen = cipher_key_len; - sop.key = (char *)cipher_key; + sop.key = __DECONST(char *, cipher_key); sop.cipher = alg->cipher; sop.mackeylen = auth_key_len; - sop.mackey = (char *)auth_key; + sop.mackey = __DECONST(char *, auth_key); sop.mac = alg->mac; return (ocf_init_session(&sop, "ETA", alg->name, ses)); } static int -ocf_eta(const struct ocf_session *ses, const struct alg *alg, const char *iv, - size_t iv_len, const char *aad, size_t aad_len, const char *input, - char *output, size_t size, char *digest, int op) +ocf_eta(const struct ocf_session *ses, const char *iv, size_t iv_len, + const char *aad, size_t aad_len, const char *input, char *output, + size_t size, char *digest, int op) { int ret; @@ -865,11 +864,11 @@ ocf_eta(const struct ocf_session *ses, const struct al caead.len = size; caead.aadlen = aad_len; caead.ivlen = iv_len; - caead.src = (char *)input; + caead.src = __DECONST(char *, input); caead.dst = output; - caead.aad = (char *)aad; + caead.aad = __DECONST(char *, aad); caead.tag = digest; - caead.iv = (char *)iv; + caead.iv = __DECONST(char *, iv); ret = ioctl(ses->fd, CIOCCRYPTAEAD, &caead); } else { @@ -878,10 +877,10 @@ ocf_eta(const struct ocf_session *ses, const struct al ocf_init_cop(ses, &cop); cop.op = op; cop.len = size; - cop.src = (char *)input; + cop.src = __DECONST(char *, input); cop.dst = output; cop.mac = digest; - cop.iv = (char *)iv; + cop.iv = __DECONST(char *, iv); ret = ioctl(ses->fd, CIOCCRYPT, &cop); } @@ -897,7 +896,7 @@ run_eta_test(const struct alg *alg, size_t aad_len, si struct ocf_session ses; const EVP_CIPHER *cipher; const EVP_MD *md; - char *aad, *buffer, *cleartext, *ciphertext; + char *buffer, *cleartext, *ciphertext; char *iv, *auth_key, *cipher_key; u_int iv_len, auth_key_len, cipher_key_len, digest_len; int error; @@ -958,9 +957,9 @@ run_eta_test(const struct alg *alg, size_t aad_len, si goto out; /* OCF encrypt + HMAC. */ - error = ocf_eta(&ses, alg, iv, iv_len, - aad_len != 0 ? cleartext : NULL, aad_len, cleartext + aad_len, - buffer + aad_len, size, test_digest, COP_ENCRYPT); + error = ocf_eta(&ses, iv, iv_len, aad_len != 0 ? cleartext : NULL, + aad_len, cleartext + aad_len, buffer + aad_len, size, test_digest, + COP_ENCRYPT); if (error != 0) { warnc(error, "cryptodev %s (%zu, %zu) ETA failed for device %s", alg->name, aad_len, size, crfind(ses.crid)); @@ -990,9 +989,9 @@ run_eta_test(const struct alg *alg, size_t aad_len, si } /* OCF HMAC + decrypt. */ - error = ocf_eta(&ses, alg, iv, iv_len, - aad_len != 0 ? ciphertext : NULL, aad_len, ciphertext + aad_len, - buffer + aad_len, size, test_digest, COP_DECRYPT); + error = ocf_eta(&ses, iv, iv_len, aad_len != 0 ? ciphertext : NULL, + aad_len, ciphertext + aad_len, buffer + aad_len, size, test_digest, + COP_DECRYPT); if (error != 0) { warnc(error, "cryptodev %s (%zu, %zu) ETA failed for device %s", alg->name, aad_len, size, crfind(ses.crid)); @@ -1010,9 +1009,9 @@ run_eta_test(const struct alg *alg, size_t aad_len, si /* Verify OCF HMAC + decrypt fails with busted MAC. */ test_digest[0] ^= 0x1; - error = ocf_eta(&ses, alg, iv, iv_len, - aad_len != 0 ? ciphertext : NULL, aad_len, ciphertext + aad_len, - buffer + aad_len, size, test_digest, COP_DECRYPT); + error = ocf_eta(&ses, iv, iv_len, aad_len != 0 ? ciphertext : NULL, + aad_len, ciphertext + aad_len, buffer + aad_len, size, test_digest, + COP_DECRYPT); if (error != EBADMSG) { if (error != 0) warnc(error, @@ -1079,7 +1078,7 @@ ocf_gmac(const struct alg *alg, const char *input, siz ocf_init_sop(&sop); sop.mackeylen = key_len; - sop.mackey = (char *)key; + sop.mackey = __DECONST(char *, key); sop.mac = alg->mac; if (!ocf_init_session(&sop, "GMAC", alg->name, &ses)) return (false); @@ -1087,13 +1086,13 @@ ocf_gmac(const struct alg *alg, const char *input, siz ocf_init_cop(&ses, &cop); cop.op = 0; cop.len = size; - cop.src = (char *)input; + cop.src = __DECONST(char *, input); cop.mac = tag; cop.iv = iv; if (ioctl(ses.fd, CIOCCRYPT, &cop) < 0) { warn("cryptodev %s (%zu) failed for device %s", alg->name, - size, crfind(crid)); + size, crfind(ses.crid)); ocf_destroy_session(&ses); return (false); } @@ -1108,7 +1107,7 @@ run_gmac_test(const struct alg *alg, size_t size) { const EVP_CIPHER *cipher; char *iv, *key, *buffer; - u_int iv_len, key_len, digest_len; + u_int iv_len, key_len; int crid; char control_tag[AES_GMAC_HASH_LEN], test_tag[AES_GMAC_HASH_LEN]; @@ -1181,7 +1180,7 @@ openssl_gcm_encrypt(const struct alg *alg, const EVP_C errx(1, "OpenSSL %s (%zu) encrypt final failed: %s", alg->name, size, ERR_error_string(ERR_get_error(), NULL)); total += outl; - if (total != size) + if ((size_t)total != size) errx(1, "OpenSSL %s (%zu) encrypt size mismatch: %d", alg->name, size, total); if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, AES_GMAC_HASH_LEN, @@ -1281,7 +1280,7 @@ openssl_ccm_encrypt(const struct alg *alg, const EVP_C errx(1, "OpenSSL %s (%zu) encrypt final failed: %s", alg->name, size, ERR_error_string(ERR_get_error(), NULL)); total += outl; - if (total != size) + if ((size_t)total != size) errx(1, "OpenSSL %s (%zu) encrypt size mismatch: %d", alg->name, size, total); if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_CCM_GET_TAG, AES_CBC_MAC_HASH_LEN, @@ -1299,15 +1298,15 @@ ocf_init_aead_session(const struct alg *alg, const cha ocf_init_sop(&sop); sop.keylen = key_len; - sop.key = (char *)key; + sop.key = __DECONST(char *, key); sop.cipher = alg->cipher; return (ocf_init_session(&sop, "AEAD", alg->name, ses)); } static int -ocf_aead(const struct ocf_session *ses, const struct alg *alg, const char *iv, - size_t iv_len, const char *aad, size_t aad_len, const char *input, - char *output, size_t size, char *tag, int op) +ocf_aead(const struct ocf_session *ses, const char *iv, size_t iv_len, + const char *aad, size_t aad_len, const char *input, char *output, + size_t size, char *tag, int op) { struct crypt_aead caead; @@ -1316,11 +1315,11 @@ ocf_aead(const struct ocf_session *ses, const struct a caead.len = size; caead.aadlen = aad_len; caead.ivlen = iv_len; - caead.src = (char *)input; + caead.src = __DECONST(char *, input); caead.dst = output; - caead.aad = (char *)aad; + caead.aad = __DECONST(char *, aad); caead.tag = tag; - caead.iv = (char *)iv; + caead.iv = __DECONST(char *, iv); if (ioctl(ses->fd, CIOCCRYPTAEAD, &caead) < 0) return (errno); @@ -1391,7 +1390,7 @@ run_aead_test(const struct alg *alg, size_t aad_len, s goto out; /* OCF encrypt */ - error = ocf_aead(&ses, alg, iv, iv_len, aad, aad_len, cleartext, buffer, + error = ocf_aead(&ses, iv, iv_len, aad, aad_len, cleartext, buffer, size, test_tag, COP_ENCRYPT); if (error != 0) { warnc(error, "cryptodev %s (%zu, %zu) failed for device %s", @@ -1403,7 +1402,7 @@ run_aead_test(const struct alg *alg, size_t aad_len, s aad_len, size); printf("control:\n"); hexdump(ciphertext, size, NULL, 0); - printf("test (cryptodev device %s):\n", crfind(crid)); + printf("test (cryptodev device %s):\n", crfind(ses.crid)); hexdump(buffer, size, NULL, 0); goto out; } @@ -1412,13 +1411,13 @@ run_aead_test(const struct alg *alg, size_t aad_len, s size); printf("control:\n"); hexdump(control_tag, sizeof(control_tag), NULL, 0); - printf("test (cryptodev device %s):\n", crfind(crid)); + printf("test (cryptodev device %s):\n", crfind(ses.crid)); hexdump(test_tag, sizeof(test_tag), NULL, 0); goto out; } /* OCF decrypt */ - error = ocf_aead(&ses, alg, iv, iv_len, aad, aad_len, ciphertext, + error = ocf_aead(&ses, iv, iv_len, aad, aad_len, ciphertext, buffer, size, control_tag, COP_DECRYPT); if (error != 0) { warnc(error, "cryptodev %s (%zu, %zu) failed for device %s", @@ -1430,14 +1429,14 @@ run_aead_test(const struct alg *alg, size_t aad_len, s aad_len, size); printf("control:\n"); hexdump(cleartext, size, NULL, 0); - printf("test (cryptodev device %s):\n", crfind(crid)); + printf("test (cryptodev device %s):\n", crfind(ses.crid)); hexdump(buffer, size, NULL, 0); goto out; } /* Verify OCF decrypt fails with busted tag. */ test_tag[0] ^= 0x1; - error = ocf_aead(&ses, alg, iv, iv_len, aad, aad_len, ciphertext, + error = ocf_aead(&ses, iv, iv_len, aad, aad_len, ciphertext, buffer, size, test_tag, COP_DECRYPT); if (error != EBADMSG) { if (error != 0) @@ -1585,7 +1584,7 @@ main(int ac, char **av) int ch; algname = NULL; - crid = CRYPTO_FLAG_HARDWARE; + requested_crid = CRYPTO_FLAG_HARDWARE; testall = false; verbose = false; while ((ch = getopt(ac, av, "A:a:d:vz")) != -1) @@ -1604,7 +1603,7 @@ main(int ac, char **av) algname = optarg; break; case 'd': - crid = crlookup(optarg); + requested_crid = crlookup(optarg); break; case 'v': verbose = true; From owner-svn-src-head@freebsd.org Tue Oct 13 22:23:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2AFDE44D02D; Tue, 13 Oct 2020 22:23:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9qnJ6vztz4MNm; Tue, 13 Oct 2020 22:23:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:203a:bebe:295d:8047]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 725FA1B04D; Tue, 13 Oct 2020 22:23:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r366687 - head/tools/tools/crypto From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010132220.09DMK3b5098651@repo.freebsd.org> Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <8c5b7c5a-3d59-4d31-22ef-c07c15fb1f3d@FreeBSD.org> Date: Tue, 13 Oct 2020 15:23:15 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202010132220.09DMK3b5098651@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 22:23:17 -0000 On 10/13/20 3:20 PM, John Baldwin wrote: > Author: jhb > Date: Tue Oct 13 22:20:03 2020 > New Revision: 366687 > URL: https://svnweb.freebsd.org/changeset/base/366687 > > Log: > Fix various warnings with higher WARNS. > > - Rename global 'crid' to 'requested_crid' to avoid shadowing. > - Remove some unused function arguments. > - Use __DECONST(). Oops, missed these: Reviewed by: markj, kevans Differential Revision: https://reviews.freebsd.org/D26763 -- John Baldwin From owner-svn-src-head@freebsd.org Tue Oct 13 22:49:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 551BB44D914; Tue, 13 Oct 2020 22:49:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9rMr1YXGz4Ny6; Tue, 13 Oct 2020 22:49:44 +0000 (UTC) (envelope-from adrian@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 19AEF24C24; Tue, 13 Oct 2020 22:49:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09DMnhxT017545; Tue, 13 Oct 2020 22:49:43 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DMnhls017544; Tue, 13 Oct 2020 22:49:43 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202010132249.09DMnhls017544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 13 Oct 2020 22:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366688 - head/lib/libcasper/services/cap_dns X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/lib/libcasper/services/cap_dns X-SVN-Commit-Revision: 366688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 22:49:44 -0000 Author: adrian Date: Tue Oct 13 22:49:43 2020 New Revision: 366688 URL: https://svnweb.freebsd.org/changeset/base/366688 Log: [libcasper] Update cap_dns API to not trigger unused variable warnings when disabled When compiling without casper these API calls result in unused variable warnings. Using #defines was lovely in the past but unfortunately it triggers warnings which can cascade into errors. Instead, just inline with some fallthrough functions and keep things happy. Tested: * gcc-6 targeting mips32, with casper disabled Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D26762 Modified: head/lib/libcasper/services/cap_dns/cap_dns.h Modified: head/lib/libcasper/services/cap_dns/cap_dns.h ============================================================================== --- head/lib/libcasper/services/cap_dns/cap_dns.h Tue Oct 13 22:20:03 2020 (r366687) +++ head/lib/libcasper/services/cap_dns/cap_dns.h Tue Oct 13 22:49:43 2020 (r366688) @@ -39,6 +39,15 @@ #include #include /* socklen_t */ +/* + * Pull these in if we're just inlining calls to the underlying + * libc functions. + */ +#ifndef WITH_CASPER +#include +#include +#endif /* WITH_CASPER */ + struct addrinfo; struct hostent; @@ -64,17 +73,62 @@ int cap_dns_family_limit(cap_channel_t *chan, const in __END_DECLS #else -#define cap_gethostbyname(chan, name) gethostbyname(name) -#define cap_gethostbyname2(chan, name, type) gethostbyname2(name, type) -#define cap_gethostbyaddr(chan, addr, len, type) gethostbyaddr(addr, len, type) -#define cap_getaddrinfo(chan, hostname, servname, hints, res) \ - getaddrinfo(hostname, servname, hints, res) -#define cap_getnameinfo(chan, sa, salen, host, hostlen, serv, servlen, flags) \ - getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) +static inline struct hostent * +cap_gethostbyname(cap_channel_t *chan __unused, const char *name) +{ -#define cap_dns_type_limit(chan, types, ntypes) (0) -#define cap_dns_family_limit(chan, families, nfamilies) (0) -#endif + return (gethostbyname(name)); +} + +static inline struct hostent * +cap_gethostbyname2(cap_channel_t *chan __unused, const char *name, int type) +{ + + return (gethostbyname2(name, type)); +} + +static inline struct hostent * +cap_gethostbyaddr(cap_channel_t *chan __unused, const void *addr, + socklen_t len, int type) +{ + + return (gethostbyaddr(addr, len, type)); +} + +static inline int cap_getaddrinfo(cap_channel_t *chan __unused, + const char *hostname, const char *servname, const struct addrinfo *hints, + struct addrinfo **res) +{ + + return (getaddrinfo(hostname, servname, hints, res)); +} + +static inline int cap_getnameinfo(cap_channel_t *chan __unused, + const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, + char *serv, size_t servlen, int flags) +{ + + return (getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)); +} + +static inline int +cap_dns_type_limit(cap_channel_t *chan __unused, + const char * const *types __unused, + size_t ntypes __unused) +{ + + return (0); +} + +static inline int +cap_dns_family_limit(cap_channel_t *chan __unused, + const int *families __unused, + size_t nfamilies __unused) +{ + + return (0); +} +#endif /* WITH_CASPER */ #endif /* !_CAP_DNS_H_ */ From owner-svn-src-head@freebsd.org Tue Oct 13 23:29:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FDBF44E283; Tue, 13 Oct 2020 23:29:08 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9sFH6v0Mz4QTr; Tue, 13 Oct 2020 23:29:07 +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 CC5AB24F7C; Tue, 13 Oct 2020 23:29:07 +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 09DNT7sP041885; Tue, 13 Oct 2020 23:29:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09DNT79J041883; Tue, 13 Oct 2020 23:29:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010132329.09DNT79J041883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 13 Oct 2020 23:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366689 - in head/sys/cam: ata nvme scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/cam: ata nvme scsi X-SVN-Commit-Revision: 366689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 23:29:08 -0000 Author: mav Date: Tue Oct 13 23:29:06 2020 New Revision: 366689 URL: https://svnweb.freebsd.org/changeset/base/366689 Log: Fix sbuf_finish() error code check in user-space. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ata/ata_all.c head/sys/cam/nvme/nvme_all.c head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Tue Oct 13 22:49:43 2020 (r366688) +++ head/sys/cam/ata/ata_all.c Tue Oct 13 23:29:06 2020 (r366689) @@ -318,7 +318,12 @@ ata_cmd_string(struct ata_cmd *cmd, char *cmd_string, ata_cmd_sbuf(cmd, &sb); error = sbuf_finish(&sb); - if (error != 0 && error != ENOMEM) + if (error != 0 && +#ifdef _KERNEL + error != ENOMEM) +#else + errno != ENOMEM) +#endif return (""); return(sbuf_data(&sb)); @@ -348,7 +353,12 @@ ata_res_string(struct ata_res *res, char *res_string, ata_res_sbuf(res, &sb); error = sbuf_finish(&sb); - if (error != 0 && error != ENOMEM) + if (error != 0 && +#ifdef _KERNEL + error != ENOMEM) +#else + errno != ENOMEM) +#endif return (""); return(sbuf_data(&sb)); Modified: head/sys/cam/nvme/nvme_all.c ============================================================================== --- head/sys/cam/nvme/nvme_all.c Tue Oct 13 22:49:43 2020 (r366688) +++ head/sys/cam/nvme/nvme_all.c Tue Oct 13 23:29:06 2020 (r366689) @@ -152,7 +152,12 @@ nvme_cmd_string(const struct nvme_command *cmd, char * nvme_cmd_sbuf(cmd, &sb); error = sbuf_finish(&sb); - if (error != 0 && error != ENOMEM) + if (error != 0 && +#ifdef _KERNEL + error != ENOMEM) +#else + errno != ENOMEM) +#endif return (""); return(sbuf_data(&sb)); Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Tue Oct 13 22:49:43 2020 (r366688) +++ head/sys/cam/scsi/scsi_all.c Tue Oct 13 23:29:06 2020 (r366689) @@ -3486,7 +3486,12 @@ scsi_cdb_string(u_int8_t *cdb_ptr, char *cdb_string, s /* ENOMEM just means that the fixed buffer is full, OK to ignore */ error = sbuf_finish(&sb); - if (error != 0 && error != ENOMEM) + if (error != 0 && +#ifdef _KERNEL + error != ENOMEM) +#else + errno != ENOMEM) +#endif return (""); return(sbuf_data(&sb)); From owner-svn-src-head@freebsd.org Wed Oct 14 00:01:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44F4F44E771; Wed, 14 Oct 2020 00:01:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9syP6sgHz4RjN; Wed, 14 Oct 2020 00:01:17 +0000 (UTC) (envelope-from adrian@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 D00C325AA3; Wed, 14 Oct 2020 00:01:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09E01HNg061287; Wed, 14 Oct 2020 00:01:17 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09E01HuA061286; Wed, 14 Oct 2020 00:01:17 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202010140001.09E01HuA061286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 14 Oct 2020 00:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366690 - head/usr.sbin/traceroute6 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/usr.sbin/traceroute6 X-SVN-Commit-Revision: 366690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 00:01:18 -0000 Author: adrian Date: Wed Oct 14 00:01:17 2020 New Revision: 366690 URL: https://svnweb.freebsd.org/changeset/base/366690 Log: [traceroute6] Don't do the casper bits when we're not doing casper This with the previous patch I committed makes traceroute6/traceroute compile fine when libcasper isn't enabled. This complains strongly with unused variables and such when compiled with gcc-6 on mips32. Tested: * compiled/run on mips32 hardware (AR9344) Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D26773 Modified: head/usr.sbin/traceroute6/traceroute6.c Modified: head/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.c Tue Oct 13 23:29:06 2020 (r366689) +++ head/usr.sbin/traceroute6/traceroute6.c Wed Oct 14 00:01:17 2020 (r366690) @@ -1527,8 +1527,9 @@ get_uphdr(struct ip6_hdr *ip6, u_char *lim) } void -capdns_open() +capdns_open(void) { +#ifdef WITH_CASPER const char *types[] = { "NAME", "ADDR" }; int families[1]; cap_channel_t *casper; @@ -1545,6 +1546,7 @@ capdns_open() if (cap_dns_family_limit(capdns, families, nitems(families)) < 0) errx(1, "unable to limit access to system.dns service"); cap_close(casper); +#endif /* WITH_CASPER */ } void From owner-svn-src-head@freebsd.org Wed Oct 14 02:23:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71E6E4298A2; Wed, 14 Oct 2020 02:23:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9x6t2SnRz4YNf; Wed, 14 Oct 2020 02:23:50 +0000 (UTC) (envelope-from mjg@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 35F8827441; Wed, 14 Oct 2020 02:23:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09E2No7l052091; Wed, 14 Oct 2020 02:23:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09E2Nojx052090; Wed, 14 Oct 2020 02:23:50 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010140223.09E2Nojx052090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 14 Oct 2020 02:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366692 - head/sys/dev/axgbe X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/dev/axgbe X-SVN-Commit-Revision: 366692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 02:23:50 -0000 Author: mjg Date: Wed Oct 14 02:23:49 2020 New Revision: 366692 URL: https://svnweb.freebsd.org/changeset/base/366692 Log: axgbe: fix tinderbox build Modified: head/sys/dev/axgbe/xgbe.h Modified: head/sys/dev/axgbe/xgbe.h ============================================================================== --- head/sys/dev/axgbe/xgbe.h Wed Oct 14 01:47:00 2020 (r366691) +++ head/sys/dev/axgbe/xgbe.h Wed Oct 14 02:23:49 2020 (r366692) @@ -117,9 +117,7 @@ #define __XGBE_H__ #include -#if __FreeBSD_version < 1300000 #include -#endif #include #include #include From owner-svn-src-head@freebsd.org Wed Oct 14 08:04:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0BF6431286; Wed, 14 Oct 2020 08:04:39 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CB4h759Jyz4r03; Wed, 14 Oct 2020 08:04:39 +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 9484FB3C6; Wed, 14 Oct 2020 08:04:39 +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 09E84dUE062401; Wed, 14 Oct 2020 08:04:39 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09E84dci062400; Wed, 14 Oct 2020 08:04:39 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010140804.09E84dci062400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 14 Oct 2020 08:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366694 - head/sys/dev/cxgbe/cudbg X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/cudbg X-SVN-Commit-Revision: 366694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 08:04:39 -0000 Author: np Date: Wed Oct 14 08:04:39 2020 New Revision: 366694 URL: https://svnweb.freebsd.org/changeset/base/366694 Log: cxgbe(4): unimplemented cudbg routines should return the correct internal error code and not an errno. Submitted by: Krishnamraju Eraparaju @ Chelsio MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/cudbg/cudbg_lib.c Modified: head/sys/dev/cxgbe/cudbg/cudbg_lib.c ============================================================================== --- head/sys/dev/cxgbe/cudbg/cudbg_lib.c Wed Oct 14 06:25:55 2020 (r366693) +++ head/sys/dev/cxgbe/cudbg/cudbg_lib.c Wed Oct 14 08:04:39 2020 (r366694) @@ -2027,7 +2027,7 @@ err1: err: return rc; #endif - return (EDOOFUS); + return (CUDBG_STATUS_NOT_IMPLEMENTED); } /* CIM OBQ */ @@ -2664,7 +2664,7 @@ err1: err: return rc; #endif - return (EDOOFUS); + return (CUDBG_STATUS_NOT_IMPLEMENTED); } static void collect_mem_info(struct cudbg_init *pdbg_init, @@ -3130,7 +3130,7 @@ err1: err: return rc; #endif - return (EDOOFUS); + return (CUDBG_STATUS_NOT_IMPLEMENTED); } static int collect_pbt_tables(struct cudbg_init *pdbg_init, @@ -4450,5 +4450,5 @@ err1: err: return rc; #endif - return (EDOOFUS); + return (CUDBG_STATUS_NOT_IMPLEMENTED); } From owner-svn-src-head@freebsd.org Wed Oct 14 09:22:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D77AB432E7C; Wed, 14 Oct 2020 09:22:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CB6QR5MdXz3RdP; Wed, 14 Oct 2020 09:22:55 +0000 (UTC) (envelope-from ae@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 9BBCEC432; Wed, 14 Oct 2020 09:22:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09E9Mtrt012439; Wed, 14 Oct 2020 09:22:55 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09E9Mtr4012436; Wed, 14 Oct 2020 09:22:55 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202010140922.09E9Mtr4012436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 14 Oct 2020 09:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366695 - in head: share/man/man4 sys/netinet sys/sys X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head: share/man/man4 sys/netinet sys/sys X-SVN-Commit-Revision: 366695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 09:22:55 -0000 Author: ae Date: Wed Oct 14 09:22:54 2020 New Revision: 366695 URL: https://svnweb.freebsd.org/changeset/base/366695 Log: Implement SIOCGIFALIAS. It is lightweight way to check if an IPv4 address exists. Submitted by: Roy Marples Reviewed by: gnn, melifaro MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26636 Modified: head/share/man/man4/netintro.4 head/sys/netinet/in.c head/sys/sys/sockio.h Modified: head/share/man/man4/netintro.4 ============================================================================== --- head/share/man/man4/netintro.4 Wed Oct 14 08:04:39 2020 (r366694) +++ head/share/man/man4/netintro.4 Wed Oct 14 09:22:54 2020 (r366695) @@ -28,7 +28,7 @@ .\" @(#)netintro.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd January 26, 2012 +.Dd October 14, 2020 .Dt NETINTRO 4 .Os .Sh NAME @@ -349,6 +349,13 @@ multiple masks or destination addresses, and also adop convention that specification of the default address means to delete the first address for the interface belonging to the address family in which the original socket was opened. +.It Dv SIOCGIFALIAS +This request provides means to get additional addresses +together with netmask and broadcast/destination from an +interface. +It also uses the +.Vt ifaliasreq +structure. .It Dv SIOCGIFCONF Get interface configuration list. This request takes an Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Wed Oct 14 08:04:39 2020 (r366694) +++ head/sys/netinet/in.c Wed Oct 14 09:22:54 2020 (r366695) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); static int in_aifaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); static int in_difaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); +static int in_gifaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); static void in_socktrim(struct sockaddr_in *); static void in_purgemaddrs(struct ifnet *); @@ -237,6 +238,11 @@ in_control(struct socket *so, u_long cmd, caddr_t data case SIOCGIFDSTADDR: case SIOCGIFNETMASK: break; + case SIOCGIFALIAS: + sx_xlock(&in_control_sx); + error = in_gifaddr_ioctl(cmd, data, ifp, td); + sx_xunlock(&in_control_sx); + return (error); case SIOCDIFADDR: sx_xlock(&in_control_sx); error = in_difaddr_ioctl(cmd, data, ifp, td); @@ -646,6 +652,60 @@ in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifne IFADDR_EVENT_DEL); ifa_free(&ia->ia_ifa); /* in_ifaddrhead */ + return (0); +} + +static int +in_gifaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td) +{ + struct in_aliasreq *ifra = (struct in_aliasreq *)data; + const struct sockaddr_in *addr = &ifra->ifra_addr; + struct epoch_tracker et; + struct ifaddr *ifa; + struct in_ifaddr *ia; + + /* + * ifra_addr must be present and be of INET family. + */ + if (addr->sin_len != sizeof(struct sockaddr_in) || + addr->sin_family != AF_INET) + return (EINVAL); + + /* + * See whether address exist. + */ + ia = NULL; + NET_EPOCH_ENTER(et); + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + struct in_ifaddr *it; + + if (ifa->ifa_addr->sa_family != AF_INET) + continue; + + it = (struct in_ifaddr *)ifa; + if (it->ia_addr.sin_addr.s_addr == addr->sin_addr.s_addr && + prison_check_ip4(td->td_ucred, &addr->sin_addr) == 0) { + ia = it; + break; + } + } + if (ia == NULL) { + NET_EPOCH_EXIT(et); + return (EADDRNOTAVAIL); + } + + ifra->ifra_mask = ia->ia_sockmask; + if ((ifp->if_flags & IFF_POINTOPOINT) && + ia->ia_dstaddr.sin_family == AF_INET) + ifra->ifra_dstaddr = ia->ia_dstaddr; + else if ((ifp->if_flags & IFF_BROADCAST) && + ia->ia_broadaddr.sin_family == AF_INET) + ifra->ifra_broadaddr = ia->ia_broadaddr; + else + memset(&ifra->ifra_broadaddr, 0, + sizeof(ifra->ifra_broadaddr)); + + NET_EPOCH_EXIT(et); return (0); } Modified: head/sys/sys/sockio.h ============================================================================== --- head/sys/sys/sockio.h Wed Oct 14 08:04:39 2020 (r366694) +++ head/sys/sys/sockio.h Wed Oct 14 09:22:54 2020 (r366695) @@ -84,6 +84,7 @@ #define SIOCGIFDESCR _IOWR('i', 42, struct ifreq) /* get ifnet descr */ #define SIOCAIFADDR _IOW('i', 43, struct ifaliasreq)/* add/chg IF alias */ #define SIOCGIFDATA _IOW('i', 44, struct ifreq) /* get if_data */ +#define SIOCGIFALIAS _IOWR('i', 45, struct ifaliasreq)/* get IF alias */ #define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */ #define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */ From owner-svn-src-head@freebsd.org Wed Oct 14 10:12:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D20A4346AD; Wed, 14 Oct 2020 10:12:40 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CB7Wr2j6tz3Wbx; Wed, 14 Oct 2020 10:12:40 +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 3FF43D001; Wed, 14 Oct 2020 10:12:40 +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 09EACeqT043329; Wed, 14 Oct 2020 10:12:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09EACeDr043328; Wed, 14 Oct 2020 10:12:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010141012.09EACeDr043328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 14 Oct 2020 10:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366696 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 366696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 10:12:40 -0000 Author: np Date: Wed Oct 14 10:12:39 2020 New Revision: 366696 URL: https://svnweb.freebsd.org/changeset/base/366696 Log: cxgbe(4): Do not request FEC when requesting speeds that don't have FEC. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Wed Oct 14 09:22:54 2020 (r366695) +++ head/sys/dev/cxgbe/common/t4_hw.c Wed Oct 14 10:12:39 2020 (r366696) @@ -3915,7 +3915,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m speed = fwcap_top_speed(lc->pcaps); fec = 0; - if (fec_supported(lc->pcaps)) { + if (fec_supported(speed)) { if (lc->requested_fec == FEC_AUTO) { if (lc->pcaps & FW_PORT_CAP32_FORCE_FEC) { if (speed & FW_PORT_CAP32_SPEED_100G) { From owner-svn-src-head@freebsd.org Wed Oct 14 12:28:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96930437DE5; Wed, 14 Oct 2020 12:28:42 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBBXp3VpBz3drF; Wed, 14 Oct 2020 12:28:42 +0000 (UTC) (envelope-from arichardson@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 5781CE4B8; Wed, 14 Oct 2020 12:28:42 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09ECSgL9023439; Wed, 14 Oct 2020 12:28:42 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ECSg0D023438; Wed, 14 Oct 2020 12:28:42 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202010141228.09ECSg0D023438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 14 Oct 2020 12:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366697 - head/usr.bin/xinstall X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.bin/xinstall X-SVN-Commit-Revision: 366697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 12:28:42 -0000 Author: arichardson Date: Wed Oct 14 12:28:41 2020 New Revision: 366697 URL: https://svnweb.freebsd.org/changeset/base/366697 Log: install(1): Avoid unncessary fstatfs() calls and use mmap() based on size According to git blame the trymmap() function was added in 1996 to skip mmap() calls for NFS file systems. However, nowadays mmap() should be perfectly safe even on NFS. Importantly, onl ufs and cd9660 file systems were whitelisted so we don't use mmap() on ZFS. It also prevents the use of mmap() when bootstrapping from macOS/Linux since on those systems the trymmap() function was always returning zero due to the missing MFSNAMELEN define. This change keeps the trymmap() function but changes it to check whether using mmap() can reduce the number of system calls that are required. Using mmap() only reduces the number of system calls if we need multiple read() syscalls, i.e. if the file size is > MAXBSIZE. However, mmap() is more expensive than read() so this sets the threshold at 4 fewer syscalls. Additionally, for larger file size mmap() can significantly increase the number of page faults, so avoid it in that case. It's unclear whether using mmap() is ever faster than a read with an appropriate buffer size, but this change at least removes two unnecessary system calls for every file that is installed. Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D26041 Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Wed Oct 14 10:12:39 2020 (r366696) +++ head/usr.bin/xinstall/xinstall.c Wed Oct 14 12:28:41 2020 (r366697) @@ -148,7 +148,7 @@ static void metadata_log(const char *, const char *, s const char *, const char *, off_t); static int parseid(const char *, id_t *); static int strip(const char *, int, const char *, char **); -static int trymmap(int); +static int trymmap(size_t); static void usage(void); int @@ -1087,7 +1087,7 @@ compare(int from_fd, const char *from_name __unused, s if (do_digest) digest_init(&ctx); done_compare = 0; - if (trymmap(from_fd) && trymmap(to_fd)) { + if (trymmap(from_len) && trymmap(to_len)) { p = mmap(NULL, from_len, PROT_READ, MAP_SHARED, from_fd, (off_t)0); if (p == MAP_FAILED) @@ -1248,13 +1248,8 @@ copy(int from_fd, const char *from_name, int to_fd, co digest_init(&ctx); - /* - * Mmap and write if less than 8M (the limit is so we don't totally - * trash memory on big files. This is really a minor hack, but it - * wins some CPU back. - */ done_copy = 0; - if (size <= 8 * 1048576 && trymmap(from_fd) && + if (trymmap((size_t)size) && (p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, from_fd, (off_t)0)) != MAP_FAILED) { nw = write(to_fd, p, size); @@ -1523,20 +1518,23 @@ usage(void) * return true (1) if mmap should be tried, false (0) if not. */ static int -trymmap(int fd) +trymmap(size_t filesize) { -/* - * The ifdef is for bootstrapping - f_fstypename doesn't exist in - * pre-Lite2-merge systems. - */ -#ifdef MFSNAMELEN - struct statfs stfs; - - if (fstatfs(fd, &stfs) != 0) - return (0); - if (strcmp(stfs.f_fstypename, "ufs") == 0 || - strcmp(stfs.f_fstypename, "cd9660") == 0) - return (1); -#endif - return (0); + /* + * This function existed to skip mmap() for NFS file systems whereas + * nowadays mmap() should be perfectly safe. Nevertheless, using mmap() + * only reduces the number of system calls if we need multiple read() + * syscalls, i.e. if the file size is > MAXBSIZE. However, mmap() is + * more expensive than read() so set the threshold at 4 fewer syscalls. + * Additionally, for larger file size mmap() can significantly increase + * the number of page faults, so avoid it in that case. + * + * Note: the 8MB limit is not based on any meaningful benchmarking + * results, it is simply reusing the same value that was used before + * and also matches bin/cp. + * + * XXX: Maybe we shouldn't bother with mmap() at all, since we use + * MAXBSIZE the syscall overhead of read() shouldn't be too high? + */ + return (filesize > 4 * MAXBSIZE && filesize < 8 * 1024 * 1024); } From owner-svn-src-head@freebsd.org Wed Oct 14 12:28:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC7D4437ED3; Wed, 14 Oct 2020 12:28:52 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBBXy3XJhz3dpL; Wed, 14 Oct 2020 12:28:49 +0000 (UTC) (envelope-from arichardson@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 4DFABE36E; Wed, 14 Oct 2020 12:28:49 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09ECSnFN023502; Wed, 14 Oct 2020 12:28:49 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ECSn64023501; Wed, 14 Oct 2020 12:28:49 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202010141228.09ECSn64023501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 14 Oct 2020 12:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366698 - head/sys/modules X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/sys/modules X-SVN-Commit-Revision: 366698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 12:28:52 -0000 Author: arichardson Date: Wed Oct 14 12:28:48 2020 New Revision: 366698 URL: https://svnweb.freebsd.org/changeset/base/366698 Log: Don't build the malo module with clang 10 Compiling it with LLVM 10 triggers https://bugs.llvm.org/show_bug.cgi?id=44351 While LLVM 11 is the default compiler, I regularly build with CROSS_TOOLCHAIN=llvm10 or use system packages for clang on Linux/macOS and those have not been updated to 11 yet. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Oct 14 12:28:41 2020 (r366697) +++ head/sys/modules/Makefile Wed Oct 14 12:28:48 2020 (r366698) @@ -224,7 +224,7 @@ SUBDIR= \ mac_seeotheruids \ mac_stub \ mac_test \ - malo \ + ${_malo} \ md \ mdio \ mem \ @@ -802,6 +802,12 @@ _cloudabi64= cloudabi64 .if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64" _bcm283x_clkman= bcm283x_clkman _bcm283x_pwm= bcm283x_pwm +.endif + +.if !(${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 110000) +# LLVM 10 crashes when building if_malo_pci.c, fixed in LLVM11: +# https://bugs.llvm.org/show_bug.cgi?id=44351 +_malo= malo .endif SUBDIR+=${MODULES_EXTRA} From owner-svn-src-head@freebsd.org Wed Oct 14 12:28:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34031437E45; Wed, 14 Oct 2020 12:28:55 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBBY30SJmz3ds5; Wed, 14 Oct 2020 12:28:55 +0000 (UTC) (envelope-from arichardson@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 D5E24E645; Wed, 14 Oct 2020 12:28:54 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09ECSsRs023558; Wed, 14 Oct 2020 12:28:54 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ECSsd5023556; Wed, 14 Oct 2020 12:28:54 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202010141228.09ECSsd5023556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 14 Oct 2020 12:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366699 - in head: kerberos5/include tools/build tools/build/cross-build/include/common/sys X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: kerberos5/include tools/build tools/build/cross-build/include/common/sys X-SVN-Commit-Revision: 366699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 12:28:55 -0000 Author: arichardson Date: Wed Oct 14 12:28:54 2020 New Revision: 366699 URL: https://svnweb.freebsd.org/changeset/base/366699 Log: Fix more -Wundef warnings during bootstrap Modified: head/kerberos5/include/config.h head/tools/build/Makefile head/tools/build/cross-build/include/common/sys/cdefs.h Modified: head/kerberos5/include/config.h ============================================================================== --- head/kerberos5/include/config.h Wed Oct 14 12:28:48 2020 (r366698) +++ head/kerberos5/include/config.h Wed Oct 14 12:28:54 2020 (r366699) @@ -975,7 +975,7 @@ static /**/const char *const rcsid[] = { (const char * #define HAVE_STRVISX 1 /* Define to 1 if you have the `svis' function. */ -/* #undef HAVE_SVIS */ +#define HAVE_SVIS 1 /* Define if you have the function `swab'. */ #define HAVE_SWAB 1 Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Wed Oct 14 12:28:48 2020 (r366698) +++ head/tools/build/Makefile Wed Oct 14 12:28:54 2020 (r366699) @@ -57,8 +57,8 @@ _WITH_STRSVIS!= grep -c strsvis ${HOST_INCLUDE_ROOT}/v .PATH: ${.CURDIR}/../../contrib/libc-vis INCS+= vis.h SRCS+= vis.c unvis.c -CFLAGS.vis.c+= -I${.CURDIR}/../../contrib/libc-vis -CFLAGS.unvis.c+= -I${.CURDIR}/../../contrib/libc-vis +CFLAGS.vis.c+= -I${.CURDIR}/../../contrib/libc-vis -DHAVE_VIS=0 -DHAVE_SVIS=0 +CFLAGS.unvis.c+= -I${.CURDIR}/../../contrib/libc-vis -DHAVE_VIS=0 -DHAVE_SVIS=0 .endif _WITH_REALLOCARRAY!= grep -c reallocarray ${HOST_INCLUDE_ROOT}/stdlib.h || true Modified: head/tools/build/cross-build/include/common/sys/cdefs.h ============================================================================== --- head/tools/build/cross-build/include/common/sys/cdefs.h Wed Oct 14 12:28:48 2020 (r366698) +++ head/tools/build/cross-build/include/common/sys/cdefs.h Wed Oct 14 12:28:54 2020 (r366699) @@ -190,11 +190,6 @@ typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; -/* This is needed so that BSNMP doesn't redeclare an incompatible version */ -#define HAVE_STRLCPY 1 -/* The compiler supports __func__ */ -#define HAVE_DECL___FUNC__ 1 - /* On MacOS __CONCAT is defined as x ## y, which won't expand macros */ #undef __CONCAT #define __CONCAT1(x, y) x##y From owner-svn-src-head@freebsd.org Wed Oct 14 13:13:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF7AC439215; Wed, 14 Oct 2020 13:13:15 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBCXC4F9kz3yMX; Wed, 14 Oct 2020 13:13:15 +0000 (UTC) (envelope-from mmel@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 75190EBCD; Wed, 14 Oct 2020 13:13:15 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09EDDF5Z053752; Wed, 14 Oct 2020 13:13:15 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09EDDFpq053751; Wed, 14 Oct 2020 13:13:15 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202010141313.09EDDFpq053751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 14 Oct 2020 13:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366700 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 366700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 13:13:15 -0000 Author: mmel Date: Wed Oct 14 13:13:14 2020 New Revision: 366700 URL: https://svnweb.freebsd.org/changeset/base/366700 Log: Add 'netserver' command to EFI loader. In some environments is difficult to access bootp/dhcp configuration as "standard user". Add a command that allows to set or display the URI of the network server used as "net:" device. Currently only tftp and nfs protocols are supported. Typical usage pattern is: netserver tftp://192.168.168.1/path_to_obj_dir/arm.armv7/sys/GENERIC/ boot net:kernel Reviewed by: imp, kevans MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D26736 Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Wed Oct 14 12:28:54 2020 (r366699) +++ head/stand/efi/loader/main.c Wed Oct 14 13:13:14 2020 (r366700) @@ -40,10 +40,14 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include +#include #include #include #include #include +#include +#include #include #include @@ -1594,3 +1598,34 @@ command_chain(int argc, char *argv[]) } COMMAND_SET(chain, "chain", "chain load file", command_chain); + +extern struct in_addr servip; +static int +command_netserver(int argc, char *argv[]) +{ + char *proto; + n_long rootaddr; + + if (argc > 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } + if (argc < 2) { + proto = netproto == NET_TFTP ? "tftp://" : "nfs://"; + printf("Netserver URI: %s%s%s\n", proto, intoa(rootip.s_addr), + rootpath); + return (CMD_OK); + } + if (argc == 2) { + strncpy(rootpath, argv[1], sizeof(rootpath)); + rootpath[sizeof(rootpath) -1] = '\0'; + if ((rootaddr = net_parse_rootpath()) != INADDR_NONE) + servip.s_addr = rootip.s_addr = rootaddr; + return (CMD_OK); + } + return (CMD_ERROR); /* not reached */ + +} + +COMMAND_SET(netserver, "netserver", "change or display netserver URI", + command_netserver); From owner-svn-src-head@freebsd.org Wed Oct 14 13:29:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4B44439673; Wed, 14 Oct 2020 13:29:03 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBCtR0JSKz404y; Wed, 14 Oct 2020 13:29:01 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id n6so3800903wrm.13; Wed, 14 Oct 2020 06:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MSQBdFO4XBoyhQn8n683lLpkVRytTnZt+RXLxOhgH6A=; b=WFhwW9ThVhbGelNFLjlZfl/RJ1c0buONcTZ+4IXXzc+qjYQ9Kp52qkIhsO9cMbkaBo VO1WyhXOeNtvpI4SArn5P+F6elJfP9RgvPpC1t1aaKLWTZmzJH3xBXKmYc8cKbNwZMWM 9yxfCHUiucLJAiAdxnV8JOktWVgt5bgWTd4+jutnHcZuQtAbJEIbl66RxYv4Qkd9dhAw cmkQjYrZWDr5rY/lr7ouvkdfy6qKE5XYny5q9te3hNm4//opSKTcxKnDsOC5o7+w3F+Y gsXIS4mUNBZ9NFf37BFHUbXq9+p6VjnhAPiJrKgsaXS6szQbzeTg1SGIY6WHnT7mJTXx sH8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=MSQBdFO4XBoyhQn8n683lLpkVRytTnZt+RXLxOhgH6A=; b=QihrPmbedYDz9U9JR69C2FVjMYl1bDyYLnxC+wjOe5+Vd0Jgo2Lp3oizyM9ror/JS9 NPU2gdHRIZVlyXzprA9OKdSt16MN6bRU+JiwaWCl2c0zn6GJIPiTB7S3b/K/pZPOJZqW r1BBeirg+faC21EcOFaUtKtqv24kolcjGjLrZ9fNO/JfEc4fIHQ6Vv3YzsT+WM798Y61 hBeQ5gUJaBAOofoAoROJxp8uJA+/BEkaTgAuu8A0Uv2aYxXbs7+OL6uszcGAUuNlAITC vCJIQ0wVoQKTh3UXpuF4jtprprsDkA07HO/oViO2w/FuOAMDN5oc9ZMRywqH4VLEsF60 1fDQ== X-Gm-Message-State: AOAM5327rkEb54XuUilEfDtNjTFQY9vHgVKRups6QFaHGglKue7f/uhi kV0U37K4xbZCSb9hz7uhpNfYvkCgFRbJaFgSxmaBBi1eqw0= X-Google-Smtp-Source: ABdhPJx9GkuiGQMtkuSZAayYU//ImBOy7fJdgDiZXBxHb2eTmcTTHWVrPwwVuybIvcmrB3WJ0sNw8uCPklbfHGEk3vE= X-Received: by 2002:adf:a306:: with SMTP id c6mr5496064wrb.160.1602682138603; Wed, 14 Oct 2020 06:28:58 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:c448:0:0:0:0:0 with HTTP; Wed, 14 Oct 2020 06:28:57 -0700 (PDT) In-Reply-To: <202010141228.09ECSg0D023438@repo.freebsd.org> References: <202010141228.09ECSg0D023438@repo.freebsd.org> From: Mateusz Guzik Date: Wed, 14 Oct 2020 15:28:57 +0200 Message-ID: Subject: Re: svn commit: r366697 - head/usr.bin/xinstall To: Alex Richardson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CBCtR0JSKz404y X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 13:29:03 -0000 This should use copy_file_range (also available on Linux). On 10/14/20, Alex Richardson wrote: > Author: arichardson > Date: Wed Oct 14 12:28:41 2020 > New Revision: 366697 > URL: https://svnweb.freebsd.org/changeset/base/366697 > > Log: > install(1): Avoid unncessary fstatfs() calls and use mmap() based on size > > According to git blame the trymmap() function was added in 1996 to skip > mmap() calls for NFS file systems. However, nowadays mmap() should be > perfectly safe even on NFS. Importantly, onl ufs and cd9660 file systems > were whitelisted so we don't use mmap() on ZFS. It also prevents the use > of mmap() when bootstrapping from macOS/Linux since on those systems the > trymmap() function was always returning zero due to the missing > MFSNAMELEN > define. > > This change keeps the trymmap() function but changes it to check whether > using mmap() can reduce the number of system calls that are required. > Using mmap() only reduces the number of system calls if we need multiple > read() > syscalls, i.e. if the file size is > MAXBSIZE. However, mmap() is more > expensive > than read() so this sets the threshold at 4 fewer syscalls. Additionally, > for > larger file size mmap() can significantly increase the number of page > faults, > so avoid it in that case. > > It's unclear whether using mmap() is ever faster than a read with an > appropriate > buffer size, but this change at least removes two unnecessary system > calls > for every file that is installed. > > Reviewed By: markj > Differential Revision: https://reviews.freebsd.org/D26041 > > Modified: > head/usr.bin/xinstall/xinstall.c > > Modified: head/usr.bin/xinstall/xinstall.c > ============================================================================== > --- head/usr.bin/xinstall/xinstall.c Wed Oct 14 10:12:39 2020 (r366696) > +++ head/usr.bin/xinstall/xinstall.c Wed Oct 14 12:28:41 2020 (r366697) > @@ -148,7 +148,7 @@ static void metadata_log(const char *, const char *, s > const char *, const char *, off_t); > static int parseid(const char *, id_t *); > static int strip(const char *, int, const char *, char **); > -static int trymmap(int); > +static int trymmap(size_t); > static void usage(void); > > int > @@ -1087,7 +1087,7 @@ compare(int from_fd, const char *from_name __unused, > s > if (do_digest) > digest_init(&ctx); > done_compare = 0; > - if (trymmap(from_fd) && trymmap(to_fd)) { > + if (trymmap(from_len) && trymmap(to_len)) { > p = mmap(NULL, from_len, PROT_READ, MAP_SHARED, > from_fd, (off_t)0); > if (p == MAP_FAILED) > @@ -1248,13 +1248,8 @@ copy(int from_fd, const char *from_name, int to_fd, > co > > digest_init(&ctx); > > - /* > - * Mmap and write if less than 8M (the limit is so we don't totally > - * trash memory on big files. This is really a minor hack, but it > - * wins some CPU back. > - */ > done_copy = 0; > - if (size <= 8 * 1048576 && trymmap(from_fd) && > + if (trymmap((size_t)size) && > (p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, > from_fd, (off_t)0)) != MAP_FAILED) { > nw = write(to_fd, p, size); > @@ -1523,20 +1518,23 @@ usage(void) > * return true (1) if mmap should be tried, false (0) if not. > */ > static int > -trymmap(int fd) > +trymmap(size_t filesize) > { > -/* > - * The ifdef is for bootstrapping - f_fstypename doesn't exist in > - * pre-Lite2-merge systems. > - */ > -#ifdef MFSNAMELEN > - struct statfs stfs; > - > - if (fstatfs(fd, &stfs) != 0) > - return (0); > - if (strcmp(stfs.f_fstypename, "ufs") == 0 || > - strcmp(stfs.f_fstypename, "cd9660") == 0) > - return (1); > -#endif > - return (0); > + /* > + * This function existed to skip mmap() for NFS file systems whereas > + * nowadays mmap() should be perfectly safe. Nevertheless, using mmap() > + * only reduces the number of system calls if we need multiple read() > + * syscalls, i.e. if the file size is > MAXBSIZE. However, mmap() is > + * more expensive than read() so set the threshold at 4 fewer syscalls. > + * Additionally, for larger file size mmap() can significantly increase > + * the number of page faults, so avoid it in that case. > + * > + * Note: the 8MB limit is not based on any meaningful benchmarking > + * results, it is simply reusing the same value that was used before > + * and also matches bin/cp. > + * > + * XXX: Maybe we shouldn't bother with mmap() at all, since we use > + * MAXBSIZE the syscall overhead of read() shouldn't be too high? > + */ > + return (filesize > 4 * MAXBSIZE && filesize < 8 * 1024 * 1024); > } > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Wed Oct 14 13:35:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC5D6439734; Wed, 14 Oct 2020 13:35:36 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBD1z5BCFz40nw; Wed, 14 Oct 2020 13:35:35 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f65.google.com with SMTP id md26so4835818ejb.10; Wed, 14 Oct 2020 06:35:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R3YWVNVQ+T+Ovka9wGpIlPBcW2MFSJgs8P1AjkxB5vQ=; b=iAoGOq9iguNSHzSrcXGL71keAj8DJbkf+JhDyFeRq4y+cG0MVRiRSunUrOcf6YXRXY 83tp/rZGIb17+PZddhKlyipiKbm1u+1+jSXs3PZqAbhtDaXNdG2oS8l9RmohRAG7+0Gn oZPtKRQnwXo9B/LuVFTDPDcvgFFd4DeBz/PYLwg6uL/HymweB47uWzd+rTzYAvsjFt86 6BXiJ1ReWsuOeQlmByb+Rl/57j0+PIKHE/fQNEff78lbalTdtM2DREy2O2Sa9MgaVF8d Rq0WjaAU3aXkYhbpz/fTHrH7jtL+jRsyPMo4kunsPq4kCttR8lf1pjDOUJ8DtiCDM0Bd SQFQ== X-Gm-Message-State: AOAM532Kq79El6WP86ZlGOnop7UCHYeWbwS6Dj4wUzsTAVftg6QHlaBh XB0NVerGDJvzjAbHqT4shmHjo27fuD5aDg== X-Google-Smtp-Source: ABdhPJx1Ysv4bFoUgae2s883wuJyf1aezOAuVNVGchB8Zsj4um7RD69DHDQ7A28WZBZIcg41F3uh2w== X-Received: by 2002:a17:906:d0c6:: with SMTP id bq6mr5220150ejb.16.1602682533897; Wed, 14 Oct 2020 06:35:33 -0700 (PDT) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com. [209.85.221.41]) by smtp.gmail.com with ESMTPSA id u23sm741998ejy.87.2020.10.14.06.35.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Oct 2020 06:35:33 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id n6so3828480wrm.13; Wed, 14 Oct 2020 06:35:33 -0700 (PDT) X-Received: by 2002:a5d:5387:: with SMTP id d7mr5560989wrv.224.1602682533356; Wed, 14 Oct 2020 06:35:33 -0700 (PDT) MIME-Version: 1.0 References: <202010141228.09ECSg0D023438@repo.freebsd.org> In-Reply-To: From: Alexander Richardson Date: Wed, 14 Oct 2020 14:35:22 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366697 - head/usr.bin/xinstall To: Mateusz Guzik Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CBD1z5BCFz40nw X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of arichardsonkde@gmail.com designates 209.85.218.65 as permitted sender) smtp.mailfrom=arichardsonkde@gmail.com X-Spamd-Result: default: False [-1.89 / 15.00]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-0.995]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; ARC_NA(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.218.65:from]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.12)[-0.122]; RCVD_IN_DNSWL_NONE(0.00)[209.85.218.65:from]; NEURAL_HAM_MEDIUM(-0.78)[-0.777]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[arichardson@freebsd.org,arichardsonkde@gmail.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[arichardson@freebsd.org,arichardsonkde@gmail.com]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 13:35:36 -0000 On Wed, 14 Oct 2020 at 14:29, Mateusz Guzik wrote: > > This should use copy_file_range (also available on Linux). > I agree. I even mentioned this in https://reviews.freebsd.org/D26041#589287. This change avoids the two unnecessary syscalls, but I agree that longer-term install should share the copy_file_range code with cp. The only thing that copy_file_range won't speed up is the check whether source and target are already identical. Alex > On 10/14/20, Alex Richardson wrote: > > Author: arichardson > > Date: Wed Oct 14 12:28:41 2020 > > New Revision: 366697 > > URL: https://svnweb.freebsd.org/changeset/base/366697 > > > > Log: > > install(1): Avoid unncessary fstatfs() calls and use mmap() based on size > > > > According to git blame the trymmap() function was added in 1996 to skip > > mmap() calls for NFS file systems. However, nowadays mmap() should be > > perfectly safe even on NFS. Importantly, onl ufs and cd9660 file systems > > were whitelisted so we don't use mmap() on ZFS. It also prevents the use > > of mmap() when bootstrapping from macOS/Linux since on those systems the > > trymmap() function was always returning zero due to the missing > > MFSNAMELEN > > define. > > > > This change keeps the trymmap() function but changes it to check whether > > using mmap() can reduce the number of system calls that are required. > > Using mmap() only reduces the number of system calls if we need multiple > > read() > > syscalls, i.e. if the file size is > MAXBSIZE. However, mmap() is more > > expensive > > than read() so this sets the threshold at 4 fewer syscalls. Additionally, > > for > > larger file size mmap() can significantly increase the number of page > > faults, > > so avoid it in that case. > > > > It's unclear whether using mmap() is ever faster than a read with an > > appropriate > > buffer size, but this change at least removes two unnecessary system > > calls > > for every file that is installed. > > > > Reviewed By: markj > > Differential Revision: https://reviews.freebsd.org/D26041 > > > > Modified: > > head/usr.bin/xinstall/xinstall.c > > > > Modified: head/usr.bin/xinstall/xinstall.c > > ============================================================================== > > --- head/usr.bin/xinstall/xinstall.c Wed Oct 14 10:12:39 2020 (r366696) > > +++ head/usr.bin/xinstall/xinstall.c Wed Oct 14 12:28:41 2020 (r366697) > > @@ -148,7 +148,7 @@ static void metadata_log(const char *, const char *, s > > const char *, const char *, off_t); > > static int parseid(const char *, id_t *); > > static int strip(const char *, int, const char *, char **); > > -static int trymmap(int); > > +static int trymmap(size_t); > > static void usage(void); > > > > int > > @@ -1087,7 +1087,7 @@ compare(int from_fd, const char *from_name __unused, > > s > > if (do_digest) > > digest_init(&ctx); > > done_compare = 0; > > - if (trymmap(from_fd) && trymmap(to_fd)) { > > + if (trymmap(from_len) && trymmap(to_len)) { > > p = mmap(NULL, from_len, PROT_READ, MAP_SHARED, > > from_fd, (off_t)0); > > if (p == MAP_FAILED) > > @@ -1248,13 +1248,8 @@ copy(int from_fd, const char *from_name, int to_fd, > > co > > > > digest_init(&ctx); > > > > - /* > > - * Mmap and write if less than 8M (the limit is so we don't totally > > - * trash memory on big files. This is really a minor hack, but it > > - * wins some CPU back. > > - */ > > done_copy = 0; > > - if (size <= 8 * 1048576 && trymmap(from_fd) && > > + if (trymmap((size_t)size) && > > (p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, > > from_fd, (off_t)0)) != MAP_FAILED) { > > nw = write(to_fd, p, size); > > @@ -1523,20 +1518,23 @@ usage(void) > > * return true (1) if mmap should be tried, false (0) if not. > > */ > > static int > > -trymmap(int fd) > > +trymmap(size_t filesize) > > { > > -/* > > - * The ifdef is for bootstrapping - f_fstypename doesn't exist in > > - * pre-Lite2-merge systems. > > - */ > > -#ifdef MFSNAMELEN > > - struct statfs stfs; > > - > > - if (fstatfs(fd, &stfs) != 0) > > - return (0); > > - if (strcmp(stfs.f_fstypename, "ufs") == 0 || > > - strcmp(stfs.f_fstypename, "cd9660") == 0) > > - return (1); > > -#endif > > - return (0); > > + /* > > + * This function existed to skip mmap() for NFS file systems whereas > > + * nowadays mmap() should be perfectly safe. Nevertheless, using mmap() > > + * only reduces the number of system calls if we need multiple read() > > + * syscalls, i.e. if the file size is > MAXBSIZE. However, mmap() is > > + * more expensive than read() so set the threshold at 4 fewer syscalls. > > + * Additionally, for larger file size mmap() can significantly increase > > + * the number of page faults, so avoid it in that case. > > + * > > + * Note: the 8MB limit is not based on any meaningful benchmarking > > + * results, it is simply reusing the same value that was used before > > + * and also matches bin/cp. > > + * > > + * XXX: Maybe we shouldn't bother with mmap() at all, since we use > > + * MAXBSIZE the syscall overhead of read() shouldn't be too high? > > + */ > > + return (filesize > 4 * MAXBSIZE && filesize < 8 * 1024 * 1024); > > } > > _______________________________________________ > > svn-src-all@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-all > > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > > > > -- > Mateusz Guzik From owner-svn-src-head@freebsd.org Wed Oct 14 13:39:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DADB74396E8; Wed, 14 Oct 2020 13:39:50 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBD6t5P8lz4121; Wed, 14 Oct 2020 13:39:50 +0000 (UTC) (envelope-from br@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 9C657F23A; Wed, 14 Oct 2020 13:39:50 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09EDdoNX067159; Wed, 14 Oct 2020 13:39:50 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09EDdomv067158; Wed, 14 Oct 2020 13:39:50 GMT (envelope-from br@FreeBSD.org) Message-Id: <202010141339.09EDdomv067158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 14 Oct 2020 13:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366701 - head/sys/dev/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/iommu X-SVN-Commit-Revision: 366701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 13:39:50 -0000 Author: br Date: Wed Oct 14 13:39:50 2020 New Revision: 366701 URL: https://svnweb.freebsd.org/changeset/base/366701 Log: Rename a header protection macro. Sponsored by: DARPA, AFRL Modified: head/sys/dev/iommu/iommu.h Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Wed Oct 14 13:13:14 2020 (r366700) +++ head/sys/dev/iommu/iommu.h Wed Oct 14 13:39:50 2020 (r366701) @@ -31,8 +31,8 @@ * $FreeBSD$ */ -#ifndef _SYS_IOMMU_H_ -#define _SYS_IOMMU_H_ +#ifndef _DEV_IOMMU_IOMMU_H_ +#define _DEV_IOMMU_IOMMU_H_ /* Host or physical memory address, after translation. */ typedef uint64_t iommu_haddr_t; @@ -237,4 +237,4 @@ struct iommu_ctx *iommu_get_dev_ctx(device_t dev); SYSCTL_DECL(_hw_iommu); -#endif /* !_SYS_IOMMU_H_ */ +#endif /* !_DEV_IOMMU_IOMMU_H_ */ From owner-svn-src-head@freebsd.org Wed Oct 14 13:40:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BEFB4398E9 for ; Wed, 14 Oct 2020 13:40:47 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBD7y3Gh9z41CK for ; Wed, 14 Oct 2020 13:40:46 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f65.google.com with SMTP id g12so3883228wrp.10 for ; Wed, 14 Oct 2020 06:40:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ggcUxikSGbq1GxDLQ+Zni7Y9Xc62eUFXMBAaLwCu0pg=; b=YapMSpqAng25/YT8UJROKePG86thW3FxdZVfOBj4AXKnp/TJ10K3O+JffVZI48eqW8 0c6ogtSRJ3K4TzX/8CGL468EE397uhaN222VGF4ugTnpLkzUvxx96mJBdP+zTPlggtow zTyqHlRA7ZPiGOpGHAm0v/0JLBZxsvPS5ytPNHBjjaUnqx373bJVRDx0r5NHA6G//1c3 79fU4jwudPPryOp6qfalVltYxkV0XvOo0O7fEQBl2JWrpkOvYdRsZ5kHj1C2pPemiBk4 IbLJ9vOsX6gpV+qx0OKyHDxPXOIsFy31mTG9gndyTjrcBsXqcjM5Rs9Eva+i5mpir+LF J/zg== X-Gm-Message-State: AOAM531szmDN8Hi8i7x2CytbKzBymhJ4Gv/9SqB9LYYkSNLbqhVmOROp recyLN78BNyg03ZbV0c2ulg+HQ== X-Google-Smtp-Source: ABdhPJynjKW8rz0d+gkqIMhWYk0W7l5cZYsXU7d2RZts7bP+gpcdvvqXcblbzwIPpMl+hJi7vQyyNQ== X-Received: by 2002:adf:eccb:: with SMTP id s11mr5700613wro.135.1602682844772; Wed, 14 Oct 2020 06:40:44 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id q6sm3961608wma.0.2020.10.14.06.40.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2020 06:40:44 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r366697 - head/usr.bin/xinstall From: Jessica Clarke In-Reply-To: Date: Wed, 14 Oct 2020 14:40:42 +0100 Cc: Alex Richardson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202010141228.09ECSg0D023438@repo.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4CBD7y3Gh9z41CK X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.65 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-1.79 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.28)[-0.275]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.989]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.03)[-1.027]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.65:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.65:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 13:40:47 -0000 On 14 Oct 2020, at 14:28, Mateusz Guzik wrote: >=20 > This should use copy_file_range (also available on Linux). I assume this is a bootstrap tool and hence the system OS and version is relevant. macOS does not have copy_file_range, and FreeBSD only has it in -CURRENT so that would break building on 11.x and 12.x. So any use would need to be guarded by preprocessor checks (and there are still actively-supported Linux distributions out there that are based on too-old versions of the kernel and/or glibc to include it). (FYI macOS's equivalent is copyfile(3)... maybe one day it will adopt the copy_file_range(2) interface too) Jess > On 10/14/20, Alex Richardson wrote: >> Author: arichardson >> Date: Wed Oct 14 12:28:41 2020 >> New Revision: 366697 >> URL: https://svnweb.freebsd.org/changeset/base/366697 >>=20 >> Log: >> install(1): Avoid unncessary fstatfs() calls and use mmap() based on = size >>=20 >> According to git blame the trymmap() function was added in 1996 to = skip >> mmap() calls for NFS file systems. However, nowadays mmap() should = be >> perfectly safe even on NFS. Importantly, onl ufs and cd9660 file = systems >> were whitelisted so we don't use mmap() on ZFS. It also prevents the = use >> of mmap() when bootstrapping from macOS/Linux since on those systems = the >> trymmap() function was always returning zero due to the missing >> MFSNAMELEN >> define. >>=20 >> This change keeps the trymmap() function but changes it to check = whether >> using mmap() can reduce the number of system calls that are = required. >> Using mmap() only reduces the number of system calls if we need = multiple >> read() >> syscalls, i.e. if the file size is > MAXBSIZE. However, mmap() is = more >> expensive >> than read() so this sets the threshold at 4 fewer syscalls. = Additionally, >> for >> larger file size mmap() can significantly increase the number of = page >> faults, >> so avoid it in that case. >>=20 >> It's unclear whether using mmap() is ever faster than a read with an >> appropriate >> buffer size, but this change at least removes two unnecessary system >> calls >> for every file that is installed. >>=20 >> Reviewed By: markj >> Differential Revision: https://reviews.freebsd.org/D26041 >>=20 >> Modified: >> head/usr.bin/xinstall/xinstall.c >>=20 >> Modified: head/usr.bin/xinstall/xinstall.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/usr.bin/xinstall/xinstall.c Wed Oct 14 10:12:39 2020 = (r366696) >> +++ head/usr.bin/xinstall/xinstall.c Wed Oct 14 12:28:41 2020 = (r366697) >> @@ -148,7 +148,7 @@ static void metadata_log(const char *, const = char *, s >> const char *, const char *, off_t); >> static int parseid(const char *, id_t *); >> static int strip(const char *, int, const char *, char **); >> -static int trymmap(int); >> +static int trymmap(size_t); >> static void usage(void); >>=20 >> int >> @@ -1087,7 +1087,7 @@ compare(int from_fd, const char *from_name = __unused, >> s >> if (do_digest) >> digest_init(&ctx); >> done_compare =3D 0; >> - if (trymmap(from_fd) && trymmap(to_fd)) { >> + if (trymmap(from_len) && trymmap(to_len)) { >> p =3D mmap(NULL, from_len, PROT_READ, = MAP_SHARED, >> from_fd, (off_t)0); >> if (p =3D=3D MAP_FAILED) >> @@ -1248,13 +1248,8 @@ copy(int from_fd, const char *from_name, int = to_fd, >> co >>=20 >> digest_init(&ctx); >>=20 >> - /* >> - * Mmap and write if less than 8M (the limit is so we don't = totally >> - * trash memory on big files. This is really a minor hack, but = it >> - * wins some CPU back. >> - */ >> done_copy =3D 0; >> - if (size <=3D 8 * 1048576 && trymmap(from_fd) && >> + if (trymmap((size_t)size) && >> (p =3D mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, >> from_fd, (off_t)0)) !=3D MAP_FAILED) { >> nw =3D write(to_fd, p, size); >> @@ -1523,20 +1518,23 @@ usage(void) >> * return true (1) if mmap should be tried, false (0) if not. >> */ >> static int >> -trymmap(int fd) >> +trymmap(size_t filesize) >> { >> -/* >> - * The ifdef is for bootstrapping - f_fstypename doesn't exist in >> - * pre-Lite2-merge systems. >> - */ >> -#ifdef MFSNAMELEN >> - struct statfs stfs; >> - >> - if (fstatfs(fd, &stfs) !=3D 0) >> - return (0); >> - if (strcmp(stfs.f_fstypename, "ufs") =3D=3D 0 || >> - strcmp(stfs.f_fstypename, "cd9660") =3D=3D 0) >> - return (1); >> -#endif >> - return (0); >> + /* >> + * This function existed to skip mmap() for NFS file systems = whereas >> + * nowadays mmap() should be perfectly safe. Nevertheless, using = mmap() >> + * only reduces the number of system calls if we need multiple = read() >> + * syscalls, i.e. if the file size is > MAXBSIZE. However, = mmap() is >> + * more expensive than read() so set the threshold at 4 fewer = syscalls. >> + * Additionally, for larger file size mmap() can significantly = increase >> + * the number of page faults, so avoid it in that case. >> + * >> + * Note: the 8MB limit is not based on any meaningful = benchmarking >> + * results, it is simply reusing the same value that was used = before >> + * and also matches bin/cp. >> + * >> + * XXX: Maybe we shouldn't bother with mmap() at all, since we = use >> + * MAXBSIZE the syscall overhead of read() shouldn't be too = high? >> + */ >> + return (filesize > 4 * MAXBSIZE && filesize < 8 * 1024 * 1024); >> } >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to = "svn-src-all-unsubscribe@freebsd.org" >>=20 >=20 >=20 > --=20 > Mateusz Guzik From owner-svn-src-head@freebsd.org Wed Oct 14 14:06:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0DE443A4FF; Wed, 14 Oct 2020 14:06:10 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBDjG66WHz42g6; Wed, 14 Oct 2020 14:06:10 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x442.google.com with SMTP id g12so3993115wrp.10; Wed, 14 Oct 2020 07:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/zqEBS139gaHawBXFwVSSx6fXcyFU61HS2rFMeN7fh0=; b=Mr+gFdsgniiQUaq7euTJZ/hhm72qkrJkRdr6mp+xsNajFC0ewj1cFbnGaruBBpuBbP q5dNeSIAlrkVPyRmLjwZzbB7v2f1eyoga8llzZbvl+rrwaBrC4NvXmNoMZBWiaRvcSIl loplR9GFPs8Flfhqh7bhVonvtNE7i9sQfYE/WavOAoc/fQMs+uBe1RpFG5vv5/uEBIaZ C0EjmcysEiRID2rkrJreq1Y3NajhlDnB0i+ZBmL4wyQNOEBbV//ABHbsxJpkEm1//XhX rnHIhkvr1XM4crGmekedRqOUC/+XFjf10dUAAF4XZh0jFGeiEA3eZ3KNIci+ayYwJpB3 bgAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/zqEBS139gaHawBXFwVSSx6fXcyFU61HS2rFMeN7fh0=; b=tTOP5Vrpu6yCnECbJymazGyD7l19xZejNr/P4I3XxXLawLckkPzca8URSE//HzybmS QZJ9Bh8CU6EGrR29aNhq+ujDsBnDeQx+Ole2jRvbCWA41E1e9IHfvblJ6WYFlE3NHRe4 ZiOQuyM4SRwwt6DdfKc+YRYnZa9Tda5meoNlsPFNTlLGJzdr3iqRHnwS+wBuhX7/APqE WygiRu1dGlwCDrm/e5+x8zBGq3lyMI+t7d97TNuJBcNv2oJIyqeIazznVBn4F2uHkTKZ 65TZnJMVy20nDkniGFUL1qtp5yTf0Kmfezwq3TiuHha5DrUrAzFbdS7B2nie2cO1yvJQ bCLA== X-Gm-Message-State: AOAM530rVL3wXfQEj8ys4ezYKjMe524SaQ1B+kz08v2iWEg5JUhzysTZ SEBmk0RWhdMdKcfgKsbtGzTQDEQALzc5sCBzZgsnEnGtbJU= X-Google-Smtp-Source: ABdhPJzhyYJ12AWN+q5T4H7FmiCw84Qk8sAFzC7Ejzpw+uhWsp4IhfdWDp6pvMpAgH8SsBKZGJpOUqkkpyLo4nOJ1/E= X-Received: by 2002:a5d:4cd1:: with SMTP id c17mr5837081wrt.109.1602684368528; Wed, 14 Oct 2020 07:06:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:c448:0:0:0:0:0 with HTTP; Wed, 14 Oct 2020 07:06:07 -0700 (PDT) In-Reply-To: References: <202010141228.09ECSg0D023438@repo.freebsd.org> From: Mateusz Guzik Date: Wed, 14 Oct 2020 16:06:07 +0200 Message-ID: Subject: Re: svn commit: r366697 - head/usr.bin/xinstall To: Alexander Richardson Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CBDjG66WHz42g6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 14:06:11 -0000 On 10/14/20, Alexander Richardson wrote: > On Wed, 14 Oct 2020 at 14:29, Mateusz Guzik wrote: >> >> This should use copy_file_range (also available on Linux). >> > > I agree. I even mentioned this in > https://reviews.freebsd.org/D26041#589287. > This change avoids the two unnecessary syscalls, but I agree that > longer-term install should share the copy_file_range code with cp. > The only thing that copy_file_range won't speed up is the check > whether source and target are already identical. > So did a quick check with make install in bin/cp: install -s -o root -g wheel -m 555 cp /zoo/lynx4/bin/cp install -o root -g wheel -m 444 cp.debug /zoo/lynx4/usr/lib/debug/bin/cp.debug install -o root -g wheel -m 444 cp.1.gz /zoo/lynx4/usr/share/man/man1/ None of these result in calling the compare routine. Looking at truss output it seems the biggest win for these files would be to avoid root:wheel translation. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Wed Oct 14 14:12:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE14243AA16; Wed, 14 Oct 2020 14:12:16 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBDrJ4Vm2z432M; Wed, 14 Oct 2020 14:12:16 +0000 (UTC) (envelope-from br@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 7E996F6F8; Wed, 14 Oct 2020 14:12:16 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09EECGv9087877; Wed, 14 Oct 2020 14:12:16 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09EECGYL087875; Wed, 14 Oct 2020 14:12:16 GMT (envelope-from br@FreeBSD.org) Message-Id: <202010141412.09EECGYL087875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 14 Oct 2020 14:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366702 - head/sys/dev/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/iommu X-SVN-Commit-Revision: 366702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 14:12:16 -0000 Author: br Date: Wed Oct 14 14:12:15 2020 New Revision: 366702 URL: https://svnweb.freebsd.org/changeset/base/366702 Log: Add iommu_get_ctx_domain() that allows to get iommu domain for a given iommu context. Submitted by: andrew Sponsored by: Innovate DSbD Modified: head/sys/dev/iommu/iommu.h head/sys/dev/iommu/iommu_gas.c Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Wed Oct 14 13:39:50 2020 (r366701) +++ head/sys/dev/iommu/iommu.h Wed Oct 14 14:12:15 2020 (r366702) @@ -234,6 +234,7 @@ int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_d bus_dma_tag_t iommu_get_dma_tag(device_t dev, device_t child); struct iommu_ctx *iommu_get_dev_ctx(device_t dev); +struct iommu_domain *iommu_get_ctx_domain(struct iommu_ctx *ctx); SYSCTL_DECL(_hw_iommu); Modified: head/sys/dev/iommu/iommu_gas.c ============================================================================== --- head/sys/dev/iommu/iommu_gas.c Wed Oct 14 13:39:50 2020 (r366701) +++ head/sys/dev/iommu/iommu_gas.c Wed Oct 14 14:12:15 2020 (r366702) @@ -208,6 +208,13 @@ iommu_gas_rb_remove(struct iommu_domain *domain, struc RB_REMOVE(iommu_gas_entries_tree, &domain->rb_root, entry); } +struct iommu_domain * +iommu_get_ctx_domain(struct iommu_ctx *ctx) +{ + + return (ctx->domain); +} + void iommu_gas_init_domain(struct iommu_domain *domain) { From owner-svn-src-head@freebsd.org Wed Oct 14 14:29:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2A5243AF71; Wed, 14 Oct 2020 14:29:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBFDh5kPHz43xP; Wed, 14 Oct 2020 14:29:56 +0000 (UTC) (envelope-from adrian@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 A7DACFDA6; Wed, 14 Oct 2020 14:29:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09EETu2Y097539; Wed, 14 Oct 2020 14:29:56 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09EETuwJ097538; Wed, 14 Oct 2020 14:29:56 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202010141429.09EETuwJ097538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 14 Oct 2020 14:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366703 - head/sys/crypto/skein/amd64 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/crypto/skein/amd64 X-SVN-Commit-Revision: 366703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 14:29:56 -0000 Author: adrian Date: Wed Oct 14 14:29:56 2020 New Revision: 366703 URL: https://svnweb.freebsd.org/changeset/base/366703 Log: [skein] Fix compilation on gnu assembler with gcc-6 and gcc-9 For some reason I don't want to really understand, the following happens with gnu as. /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S: Assembler messages: /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:466: Error: found '(', expected: ')' /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:466: Error: junk at end of line, first unrecognized character is `(' /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:795: Error: found '(', expected: ')' /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:795: Error: junk at end of line, first unrecognized character is `(' /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:885: Error: non-constant expression in ".if" statement /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:885: Error: non-constant expression in ".if" statement /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:885: Error: non-constant expression in ".if" statement /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:885: Error: non-constant expression in ".if" statement /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:885: Error: non-constant expression in ".if" statement /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:885: Error: non-constant expression in ".if" statement After an exhaustive search and experimentation at 11pm, I discovered that putting them in parentheses fixes the compilation. Ed pointed out that I could likely fix this in a bunch of other locations but I'd rather leave these alone until other options are enabled. Tested: * gcc-6, amd64 Reviewed by: emaste Modified: head/sys/crypto/skein/amd64/skein_block_asm.S Modified: head/sys/crypto/skein/amd64/skein_block_asm.S ============================================================================== --- head/sys/crypto/skein/amd64/skein_block_asm.S Wed Oct 14 14:12:15 2020 (r366702) +++ head/sys/crypto/skein/amd64/skein_block_asm.S Wed Oct 14 14:29:56 2020 (r366703) @@ -277,7 +277,7 @@ _STK_OFFS_ = 0 #starting offset f StackVar X_stk ,8*(WCNT) #local context vars StackVar ksTwk ,8*3 #key schedule: tweak words StackVar ksKey ,8*(WCNT)+8 #key schedule: key words - .if (SKEIN_ASM_UNROLL & (\BLK_BITS)) == 0 + .if ((SKEIN_ASM_UNROLL) & (\BLK_BITS)) == 0 StackVar ksRot ,16*(\KS_CNT) #leave space for "rotation" to happen .endif StackVar Wcopy ,8*(WCNT) #copy of input block @@ -749,7 +749,7 @@ C_label Skein_256_Unroll_Cnt # MACRO: eight rounds for 512-bit blocks # .macro R_512_FourRounds _RR_ #RR = base round number (0 % 8) - .if (SKEIN_ASM_UNROLL & 512) + .if ((SKEIN_ASM_UNROLL) & 512) # here for fully unrolled case. _II_ = ((\_RR_)/4) + 1 #key injection counter R_512_OneRound 8, 9,10,11,12,13,14,15,%((\_RR_)+0),,, @@ -978,7 +978,7 @@ rIdx_offs = tmpStk_1024 movq %\reg1 , xDebug_1024+8*\w1(%rsp) # (before inline key injection) .endif _II_ = ((\_RN0_)/4)+1 #injection count - .if SKEIN_ASM_UNROLL & 1024 #here to do fully unrolled key injection + .if (SKEIN_ASM_UNROLL) & 1024 #here to do fully unrolled key injection addq ksKey+ 8*((_II_+\w0) % 17)(%rsp),%\reg0 addq ksKey+ 8*((_II_+\w1) % 17)(%rsp),%\reg1 .if \w1 == 13 #tweak injection From owner-svn-src-head@freebsd.org Wed Oct 14 14:51:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5690443B2FE; Wed, 14 Oct 2020 14:51:12 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBFjD1fG8z45jp; Wed, 14 Oct 2020 14:51:12 +0000 (UTC) (envelope-from br@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 1CBE1FC71; Wed, 14 Oct 2020 14:51:12 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09EEpBDC012647; Wed, 14 Oct 2020 14:51:11 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09EEpB24012645; Wed, 14 Oct 2020 14:51:11 GMT (envelope-from br@FreeBSD.org) Message-Id: <202010141451.09EEpB24012645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 14 Oct 2020 14:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366704 - in head/sys: dev/iommu i386/include X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu i386/include X-SVN-Commit-Revision: 366704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 14:51:12 -0000 Author: br Date: Wed Oct 14 14:51:11 2020 New Revision: 366704 URL: https://svnweb.freebsd.org/changeset/base/366704 Log: Add a per-each macro IOMMU_DOMAIN_UNLOAD_SLEEP which allows to sleep during iommu guest address space entries unload. Suggested by: kib Sponsored by: Innovate DSbD Differential Revision: https://reviews.freebsd.org/D26722 Modified: head/sys/dev/iommu/busdma_iommu.c head/sys/i386/include/iommu.h Modified: head/sys/dev/iommu/busdma_iommu.c ============================================================================== --- head/sys/dev/iommu/busdma_iommu.c Wed Oct 14 14:29:56 2020 (r366703) +++ head/sys/dev/iommu/busdma_iommu.c Wed Oct 14 14:51:11 2020 (r366704) @@ -888,7 +888,7 @@ iommu_bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap struct bus_dmamap_iommu *map; struct iommu_ctx *ctx; struct iommu_domain *domain; -#if defined(__amd64__) +#ifndef IOMMU_DOMAIN_UNLOAD_SLEEP struct iommu_map_entries_tailq entries; #endif @@ -898,13 +898,13 @@ iommu_bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap domain = ctx->domain; atomic_add_long(&ctx->unloads, 1); -#if defined(__i386__) +#if defined(IOMMU_DOMAIN_UNLOAD_SLEEP) IOMMU_DOMAIN_LOCK(domain); TAILQ_CONCAT(&domain->unload_entries, &map->map_entries, dmamap_link); IOMMU_DOMAIN_UNLOCK(domain); taskqueue_enqueue(domain->iommu->delayed_taskqueue, &domain->unload_task); -#else /* defined(__amd64__) */ +#else TAILQ_INIT(&entries); IOMMU_DOMAIN_LOCK(domain); TAILQ_CONCAT(&entries, &map->map_entries, dmamap_link); Modified: head/sys/i386/include/iommu.h ============================================================================== --- head/sys/i386/include/iommu.h Wed Oct 14 14:29:56 2020 (r366703) +++ head/sys/i386/include/iommu.h Wed Oct 14 14:51:11 2020 (r366704) @@ -4,3 +4,5 @@ /* $FreeBSD$ */ #include + +#define IOMMU_DOMAIN_UNLOAD_SLEEP From owner-svn-src-head@freebsd.org Wed Oct 14 15:31:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B45BE43C765; Wed, 14 Oct 2020 15:31:42 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBGby4QGcz47RX; Wed, 14 Oct 2020 15:31:42 +0000 (UTC) (envelope-from andrew@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 7C0BC107D7; Wed, 14 Oct 2020 15:31:42 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09EFVgFh037082; Wed, 14 Oct 2020 15:31:42 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09EFVg5C037081; Wed, 14 Oct 2020 15:31:42 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202010141531.09EFVg5C037081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 14 Oct 2020 15:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366706 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 366706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 15:31:42 -0000 Author: andrew Date: Wed Oct 14 15:31:42 2020 New Revision: 366706 URL: https://svnweb.freebsd.org/changeset/base/366706 Log: Remove direct user access from the arm64 copyinstr These already use the load variant that simulates userspace access. Remove the macros that enable normal loads and stores from userspace as they are unneeded. Sponsored by: Innovate UK Modified: head/sys/arm64/arm64/copyinout.S Modified: head/sys/arm64/arm64/copyinout.S ============================================================================== --- head/sys/arm64/arm64/copyinout.S Wed Oct 14 15:26:19 2020 (r366705) +++ head/sys/arm64/arm64/copyinout.S Wed Oct 14 15:31:42 2020 (r366706) @@ -100,7 +100,6 @@ ENTRY(copyinstr) adr x6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(x6, x7) /* Set the handler */ - ENTER_USER_ACCESS(w6, x7) ldr x7, =VM_MAXUSER_ADDRESS 1: cmp x0, x7 @@ -113,8 +112,7 @@ ENTRY(copyinstr) sub x2, x2, #1 /* len-- */ cbnz x2, 1b -2: EXIT_USER_ACCESS(w6) - SET_FAULT_HANDLER(xzr, x7) /* Clear the handler */ +2: SET_FAULT_HANDLER(xzr, x7) /* Clear the handler */ 3: cbz x3, 4f /* Check if done != NULL */ From owner-svn-src-head@freebsd.org Wed Oct 14 15:50:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CAB2143CE9B; Wed, 14 Oct 2020 15:50:28 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBH1c4y9Vz49Pd; Wed, 14 Oct 2020 15:50:28 +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 8DED6109DD; Wed, 14 Oct 2020 15:50:28 +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 09EFoS7A046503; Wed, 14 Oct 2020 15:50:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09EFoSNt046502; Wed, 14 Oct 2020 15:50:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010141550.09EFoSNt046502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 14 Oct 2020 15:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366707 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 366707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 15:50:28 -0000 Author: mav Date: Wed Oct 14 15:50:28 2020 New Revision: 366707 URL: https://svnweb.freebsd.org/changeset/base/366707 Log: Use RTD3 Entry Latency value as shutdown timeout. This field was not in specs when the driver was written, but now there are SSDs with the reported latency of 10s, where hardcoded value of 5s seems to be not enough sometimes, causing shutdown timeout messages. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Wed Oct 14 15:31:42 2020 (r366706) +++ head/sys/dev/nvme/nvme_ctrlr.c Wed Oct 14 15:50:28 2020 (r366707) @@ -1510,22 +1510,24 @@ nvme_ctrlr_shutdown(struct nvme_controller *ctrlr) { uint32_t cc; uint32_t csts; - int ticks = 0; + int ticks = 0, timeout; cc = nvme_mmio_read_4(ctrlr, cc); cc &= ~(NVME_CC_REG_SHN_MASK << NVME_CC_REG_SHN_SHIFT); cc |= NVME_SHN_NORMAL << NVME_CC_REG_SHN_SHIFT; nvme_mmio_write_4(ctrlr, cc, cc); + timeout = ctrlr->cdata.rtd3e == 0 ? 5 * hz : + ((uint64_t)ctrlr->cdata.rtd3e * hz + 999999) / 1000000; while (1) { csts = nvme_mmio_read_4(ctrlr, csts); if (csts == 0xffffffff) /* Hot unplug. */ break; if (NVME_CSTS_GET_SHST(csts) == NVME_SHST_COMPLETE) break; - if (ticks++ > 5*hz) { + if (ticks++ > timeout) { nvme_printf(ctrlr, "did not complete shutdown within" - " 5 seconds of notification\n"); + " %d ticks of notification\n", timeout); break; } pause("nvme shn", 1); From owner-svn-src-head@freebsd.org Wed Oct 14 17:39:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1060943EE4F; Wed, 14 Oct 2020 17:39:52 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBKRq74fvz4HQy; Wed, 14 Oct 2020 17:39:51 +0000 (UTC) (envelope-from arichardson@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 D5FFC120AB; Wed, 14 Oct 2020 17:39:51 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09EHdpmT014497; Wed, 14 Oct 2020 17:39:51 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09EHdpbi014493; Wed, 14 Oct 2020 17:39:51 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202010141739.09EHdpbi014493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 14 Oct 2020 17:39:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366708 - in head/sbin/pfctl/tests: . files X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head/sbin/pfctl/tests: . files X-SVN-Commit-Revision: 366708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 17:39:52 -0000 Author: arichardson Date: Wed Oct 14 17:39:50 2020 New Revision: 366708 URL: https://svnweb.freebsd.org/changeset/base/366708 Log: Rewrite pfctl_test in C to reduce testsuite run time The new C test takes 25 seconds on QEMU-RISC-V, wheras the shell version takes 332 seconds. Even with the latest optimizations to atf-sh this test still takes a few seconds to startup in QEMU. Re-writing it in C reduces the runtime for a single test from about 2-3 seconds to less than .5 seconds. Since there are ~80 tests, this adds up to about 3-4 minutes. This may not seem like a big speedup, but before the recent optimizations to avoid atf_get_srcdir, each test took almost 100 seconds on QEMU RISC-V instead of 3. This also significantly reduces the time it takes to list the available test cases, which speeds up running the tests via kyua: ``` root@qemu-riscv64-alex:~ # /usr/bin/time kyua test -k /usr/tests/sbin/pfctl/Kyuafile pfctl_test_old ... 158/158 passed (0 failed) 332.08 real 42.58 user 286.17 sys root@qemu-riscv64-alex:~ # /usr/bin/time kyua test -k /usr/tests/sbin/pfctl/Kyuafile pfctl_test 158/158 passed (0 failed) 24.96 real 9.75 user 14.26 sys root@qemu-riscv64-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test pf1001 pfctl_test: WARNING: Running test cases outside of kyua(1) is unsupported pfctl_test: WARNING: No isolation nor timeout control is being applied; you may get unexpected failures; see atf-test-case(4) Running pfctl -o none -nvf /usr/tests/sbin/pfctl/./files/pf1001.in --- binat on em0 inet6 from fc00::/64 to any -> fc00:0:0:1::/64 binat on em0 inet6 from any to fc00:0:0:1::/64 -> fc00::/64 --- passed 0.17 real 0.06 user 0.08 sys root@qemu-riscv64-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test_old pf1001 pfctl_test_old: WARNING: Running test cases outside of kyua(1) is unsupported pfctl_test_old: WARNING: No isolation nor timeout control is being applied; you may get unexpected failures; see atf-test-case(4) Id Refs Name 141 1 pf Executing command [ pfctl -o none -nvf - ] passed 1.73 real 0.25 user 1.41 sys root@qemu-riscv64-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test_old -l > /dev/null 24.36 real 2.26 user 21.86 sys root@qemu-riscv64-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test -l > /dev/null 0.04 real 0.02 user 0.01 sys ``` The speedups are even more noticeable on CHERI-RISC-V (since QEMU runs slower when emulating CHERI instructions): ``` root@qemu-cheri-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test_new -l > /dev/null 0.51 real 0.49 user 0.00 sys root@qemu-cheri-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test -l > /dev/null 34.20 real 32.69 user 0.16 sys root@qemu-cheri-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test pf1001 pfctl_test: WARNING: Running test cases outside of kyua(1) is unsupported pfctl_test: WARNING: No isolation nor timeout control is being applied; you may get unexpected failures; see atf-test-case(4) Id Refs Name 147 1 pf Executing command [ pfctl -o none -nvf - ] passed 5.74 real 5.41 user 0.03 sys root@qemu-cheri-alex:/usr/tests/sbin/pfctl # /usr/bin/time ./pfctl_test_new pf1001 pfctl_test_new: WARNING: Running test cases outside of kyua(1) is unsupported pfctl_test_new: WARNING: No isolation nor timeout control is being applied; you may get unexpected failures; see atf-test-case(4) Running pfctl -o none -nvf /usr/tests/sbin/pfctl/./files/pf1001.in --- binat on em0 inet6 from fc00::/64 to any -> fc00:0:0:1::/64 binat on em0 inet6 from any to fc00:0:0:1::/64 -> fc00::/64 --- passed 0.68 real 0.66 user 0.00 sys root@qemu-cheri-alex:/usr/tests/sbin/pfctl # ``` Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D26779 Added: head/sbin/pfctl/tests/pfctl_test.c (contents, props changed) head/sbin/pfctl/tests/pfctl_test_list.inc (contents, props changed) Deleted: head/sbin/pfctl/tests/files/pfctl_test_descr.sh head/sbin/pfctl/tests/pfctl_test.sh Modified: head/sbin/pfctl/tests/Makefile head/sbin/pfctl/tests/files/Makefile Modified: head/sbin/pfctl/tests/Makefile ============================================================================== --- head/sbin/pfctl/tests/Makefile Wed Oct 14 15:50:28 2020 (r366707) +++ head/sbin/pfctl/tests/Makefile Wed Oct 14 17:39:50 2020 (r366708) @@ -2,9 +2,11 @@ PACKAGE= tests -ATF_TESTS_SH= pfctl_test \ - macro +ATF_TESTS_C= pfctl_test +ATF_TESTS_SH= macro +LIBADD+= sbuf SUBDIR+= files +WARNS=6 .include Modified: head/sbin/pfctl/tests/files/Makefile ============================================================================== --- head/sbin/pfctl/tests/files/Makefile Wed Oct 14 15:50:28 2020 (r366707) +++ head/sbin/pfctl/tests/files/Makefile Wed Oct 14 17:39:50 2020 (r366708) @@ -7,6 +7,5 @@ BINDIR= ${TESTSDIR} # We use ${.CURDIR} as workaround so that the glob patterns work. FILES!= echo ${.CURDIR}/pf????.in ${.CURDIR}/pf????.include ${.CURDIR}/pf????.ok -FILES+= ${.CURDIR}/pfctl_test_descr.sh .include Added: head/sbin/pfctl/tests/pfctl_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/pfctl_test.c Wed Oct 14 17:39:50 2020 (r366708) @@ -0,0 +1,230 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This work was supported by Innovate UK project 105694, "Digital Security by + * Design (DSbD) Technology Platform Prototype". + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* + * Tests 0001-0999 are copied from OpenBSD's regress/sbin/pfctl. + * Tests 1001-1999 are ours (FreeBSD's own). + * + * pf: Run pfctl -nv on pfNNNN.in and check that the output matches pfNNNN.ok. + * Copied from OpenBSD. Main differences are some things not working + * in FreeBSD: + * * The action 'match' + * * The command 'set reassemble' + * * The 'from'/'to' options together with 'route-to' + * * The option 'scrub' (it is an action in FreeBSD) + * * Accepting undefined routing tables in actions (??: see pf0093.in) + * * The 'route' option + * * The 'set queue def' option + * selfpf: Feed pfctl output through pfctl again and verify it stays the same. + * Copied from OpenBSD. + */ + +static bool +check_pf_module_available() +{ + int modid; + struct module_stat stat; + + if ((modid = modfind("pf")) < 0) { + warn("pf module not found"); + return false; + } + stat.version = sizeof(struct module_stat); + if (modstat(modid, &stat) < 0) { + warn("can't stat pf module id %d", modid); + return false; + } + return (true); +} + +extern char **environ; + +static struct sbuf * +read_fd(int fd, size_t sizehint) +{ + struct sbuf *sb; + ssize_t count; + char buffer[MAXBSIZE]; + + sb = sbuf_new(NULL, NULL, sizehint, SBUF_AUTOEXTEND); + errno = 0; + while ((count = read(fd, buffer, sizeof(buffer) - 1)) > 0) { + sbuf_bcat(sb, buffer, count); + } + ATF_REQUIRE_ERRNO(0, count == 0 && "Should have reached EOF"); + sbuf_finish(sb); /* Ensure NULL-termination */ + return (sb); +} + +static struct sbuf * +read_file(const char *filename) +{ + struct stat s; + struct sbuf *result; + int fd; + + errno = 0; + ATF_REQUIRE_EQ_MSG(stat(filename, &s), 0, "cannot stat %s", filename); + fd = open(filename, O_RDONLY); + ATF_REQUIRE_ERRNO(0, fd > 0); + result = read_fd(fd, s.st_size); + ATF_REQUIRE_ERRNO(0, close(fd) == 0); + return (result); +} + +static void +run_pfctl_test(const char *input_path, const char *expected_path, + const atf_tc_t *tc) +{ + int status; + pid_t pid; + int pipefds[2]; + char input_files_path[PATH_MAX]; + struct sbuf *expected_output; + struct sbuf *real_output; + posix_spawn_file_actions_t action; + + if (!check_pf_module_available()) + atf_tc_skip("pf(4) is not loaded"); + + /* The test inputs need to be able to use relative includes. */ + snprintf(input_files_path, sizeof(input_files_path), "%s/files", + atf_tc_get_config_var(tc, "srcdir")); + ATF_REQUIRE_ERRNO(0, chdir(input_files_path) == 0); + + ATF_REQUIRE_ERRNO(0, pipe(pipefds) == 0); + expected_output = read_file(expected_path); + + posix_spawn_file_actions_init(&action); + posix_spawn_file_actions_addclose(&action, STDIN_FILENO); + posix_spawn_file_actions_addclose(&action, pipefds[1]); + posix_spawn_file_actions_adddup2(&action, pipefds[0], STDOUT_FILENO); + posix_spawn_file_actions_adddup2(&action, pipefds[0], STDERR_FILENO); + + const char *argv[] = { "pfctl", "-o", "none", "-nvf", input_path, + NULL }; + printf("Running %s %s %s %s %s\n", argv[0], argv[1], argv[2], argv[3], + argv[4]); + status = posix_spawnp( + &pid, "pfctl", &action, NULL, __DECONST(char **, argv), environ); + ATF_REQUIRE_EQ_MSG( + status, 0, "posix_spawn failed: %s", strerror(errno)); + posix_spawn_file_actions_destroy(&action); + close(pipefds[0]); + + real_output = read_fd(pipefds[1], 0); + printf("---\n%s---\n", sbuf_data(real_output)); + ATF_REQUIRE_EQ(waitpid(pid, &status, 0), pid); + ATF_REQUIRE_MSG(WIFEXITED(status), + "pfctl returned non-zero! Output:\n %s", sbuf_data(real_output)); + + ATF_CHECK_STREQ(sbuf_data(expected_output), sbuf_data(real_output)); + sbuf_delete(expected_output); + sbuf_delete(real_output); + close(pipefds[1]); +} + +static void +do_pf_test(const char *number, const atf_tc_t *tc) +{ + char *input_path; + char *expected_path; + asprintf(&input_path, "%s/files/pf%s.in", + atf_tc_get_config_var(tc, "srcdir"), number); + asprintf(&expected_path, "%s/files/pf%s.ok", + atf_tc_get_config_var(tc, "srcdir"), number); + run_pfctl_test(input_path, expected_path, tc); + free(input_path); + free(expected_path); +} + +static void +do_selfpf_test(const char *number, const atf_tc_t *tc) +{ + char *expected_path; + asprintf(&expected_path, "%s/files/pf%s.ok", + atf_tc_get_config_var(tc, "srcdir"), number); + run_pfctl_test(expected_path, expected_path, tc); + free(expected_path); +} + +#define PFCTL_TEST(number, descr) \ + ATF_TC(pf##number); \ + ATF_TC_HEAD(pf##number, tc) \ + { \ + atf_tc_set_md_var(tc, "descr", descr); \ + } \ + ATF_TC_BODY(pf##number, tc) \ + { \ + do_pf_test(#number, tc); \ + } \ + ATF_TC(selfpf##number); \ + ATF_TC_HEAD(selfpf##number, tc) \ + { \ + atf_tc_set_md_var(tc, "descr", "Self " descr); \ + } \ + ATF_TC_BODY(selfpf##number, tc) \ + { \ + do_selfpf_test(#number, tc); \ + } +#include "pfctl_test_list.inc" +#undef PFCTL_TEST + +ATF_TP_ADD_TCS(tp) +{ +#define PFCTL_TEST(number, descr) \ + ATF_TP_ADD_TC(tp, pf##number); \ + ATF_TP_ADD_TC(tp, selfpf##number); +#include "pfctl_test_list.inc" +#undef PFCTL_TEST + + return atf_no_error(); +} Added: head/sbin/pfctl/tests/pfctl_test_list.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/tests/pfctl_test_list.inc Wed Oct 14 17:39:50 2020 (r366708) @@ -0,0 +1,118 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * This work was supported by Innovate UK project 105694, "Digital Security by + * Design (DSbD) Technology Platform Prototype". + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * No include guards since this file is included multiple times by pfctl_test + * to avoid duplicating code. + */ +PFCTL_TEST(0001, "Pass with labels") +PFCTL_TEST(0002, "Block/pass") +PFCTL_TEST(0003, "Block/pass with flags") +PFCTL_TEST(0004, "Block") +PFCTL_TEST(0005, "Block with variables") +PFCTL_TEST(0006, "Variables") +PFCTL_TEST(0007, "Block/pass with return") +PFCTL_TEST(0008, "Block with address list") +PFCTL_TEST(0009, "Block with interface list") +PFCTL_TEST(0010, "Block/pass with return") +PFCTL_TEST(0011, "Block/pass ICMP") +PFCTL_TEST(0012, "Pass to subnets") +PFCTL_TEST(0013, "Pass quick") +PFCTL_TEST(0014, "Pass quick IPv6") +PFCTL_TEST(0016, "Pass with no state") +PFCTL_TEST(0018, "Address lists") +PFCTL_TEST(0019, "Lists") +PFCTL_TEST(0020, "Lists") +PFCTL_TEST(0022, "Set options") +PFCTL_TEST(0023, "Block on negated interface") +PFCTL_TEST(0024, "Variable concatenation") +PFCTL_TEST(0025, "Antispoof") +PFCTL_TEST(0026, "Block from negated interface") +PFCTL_TEST(0028, "Block with log and quick") +PFCTL_TEST(0030, "Line continuation") +PFCTL_TEST(0031, "Block policy") +PFCTL_TEST(0032, "Pass to any") +PFCTL_TEST(0034, "Pass with probability") +PFCTL_TEST(0035, "Matching on TOS") +PFCTL_TEST(0038, "Pass with user") +PFCTL_TEST(0039, "Ordered opts") +PFCTL_TEST(0040, "Block/pass") +PFCTL_TEST(0041, "Anchors") +PFCTL_TEST(0047, "Pass with labels") +PFCTL_TEST(0048, "Tables") +PFCTL_TEST(0049, "Broadcast and network modifiers") +PFCTL_TEST(0050, "Double macro set") +PFCTL_TEST(0052, "Set optimization") +PFCTL_TEST(0053, "Pass with labels") +PFCTL_TEST(0055, "Set options") +PFCTL_TEST(0056, "State opts") +PFCTL_TEST(0057, "Variables") +PFCTL_TEST(0060, "Pass from multicast") +PFCTL_TEST(0061, "Dynaddr with netmask") +PFCTL_TEST(0065, "Antispoof with labels") +PFCTL_TEST(0067, "Tags") +PFCTL_TEST(0069, "Tags") +PFCTL_TEST(0070, "Tags") +PFCTL_TEST(0071, "Tags") +PFCTL_TEST(0072, "Tags") +PFCTL_TEST(0074, "Synproxy") +PFCTL_TEST(0075, "Block quick with tags") +PFCTL_TEST(0077, "Dynaddr with netmask") +PFCTL_TEST(0078, "Table with label") +PFCTL_TEST(0079, "No-route with label") +PFCTL_TEST(0081, "Address list and table list with no-route") +PFCTL_TEST(0082, "Pass with interface, table and no-route") +PFCTL_TEST(0084, "Source track") +PFCTL_TEST(0085, "Tag macro expansion") +PFCTL_TEST(0087, "Optimization rule reordering") +PFCTL_TEST(0088, "Optimization duplicate rules handling") +PFCTL_TEST(0089, "TCP connection tracking") +PFCTL_TEST(0090, "Log opts") +PFCTL_TEST(0091, "Nested anchors") +PFCTL_TEST(0092, "Comments") +PFCTL_TEST(0094, "Address ranges") +PFCTL_TEST(0095, "Include") +PFCTL_TEST(0096, "Variables") +PFCTL_TEST(0097, "Divert-to") +PFCTL_TEST(0098, "Pass") +PFCTL_TEST(0100, "Anchor with multiple path components") +PFCTL_TEST(0101, "Prio") +PFCTL_TEST(0102, "Address lists with mixed address family") +PFCTL_TEST(0104, "Divert-to with localhost") +PFCTL_TEST(1001, "Binat") +PFCTL_TEST(1002, "Set timeout interval") +PFCTL_TEST(1003, "ALTQ") +PFCTL_TEST(1004, "ALTQ with Codel") +PFCTL_TEST(1005, "PR 231323") From owner-svn-src-head@freebsd.org Wed Oct 14 19:01:06 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1533A440542; Wed, 14 Oct 2020 19:01:06 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 4CBMFY0fpQz4M5C; Wed, 14 Oct 2020 19:01:04 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 351F33C0199; Wed, 14 Oct 2020 19:01:04 +0000 (UTC) Date: Wed, 14 Oct 2020 19:01:04 +0000 From: Brooks Davis To: Jessica Clarke Cc: Mateusz Guzik , Alex Richardson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366697 - head/usr.bin/xinstall Message-ID: <20201014190104.GC3588@spindle.one-eyed-alien.net> References: <202010141228.09ECSg0D023438@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XWOWbaMNXpFDWE00" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4CBMFY0fpQz4M5C X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-3.23 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.954]; FREEFALL_USER(0.00)[brooks]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.984]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.40)[-0.396]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 19:01:06 -0000 --XWOWbaMNXpFDWE00 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 14, 2020 at 02:40:42PM +0100, Jessica Clarke wrote: > On 14 Oct 2020, at 14:28, Mateusz Guzik wrote: > >=20 > > This should use copy_file_range (also available on Linux). >=20 > I assume this is a bootstrap tool and hence the system OS and version > is relevant. macOS does not have copy_file_range, and FreeBSD only has > it in -CURRENT so that would break building on 11.x and 12.x. So any > use would need to be guarded by preprocessor checks (and there are > still actively-supported Linux distributions out there that are based > on too-old versions of the kernel and/or glibc to include it). >=20 > (FYI macOS's equivalent is copyfile(3)... maybe one day it will adopt > the copy_file_range(2) interface too) copyfile has different semantics, not the least of which is supporting file clones. Once ZFS grows file clone support it would be nice if install supported them as well. I'd love to only pay the inode cost for installed files when I'm just building a disk image. -- Brooks --XWOWbaMNXpFDWE00 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJfh0rvAAoJEKzQXbSebgfAOzEH/3P7QRd/784vNugHdf16EgEd jt1gIf7ouxCOV1Im2IDNInm6KxxD40vOiSEPihBpGpp51UFzEoekNyprtp0IiXmW gOY+SwF1I62xsZeRDrZRSHk9N/4XJsr9pSd3cyXWj8MSqBY0Y7SArPSs0Q18ayQa hhgtYHFSICDAm/eId0oHXpRdqT367Qc2fLIqgayqFZTApCnXmFBXUx1KY2UDnaUF Xw+e2f+lCMxczXOEZNRgYzIh/0eoUc9lUXgrNBYkCOXBNNEVWN5LoTI2qYnGrYWJ 39HxkEMPndAAc8N/yKAYYyhq1aApDGyqAj+ch1VP/y66QGFVszuY+9EKzes58hY= =0NAg -----END PGP SIGNATURE----- --XWOWbaMNXpFDWE00-- From owner-svn-src-head@freebsd.org Wed Oct 14 20:55:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADFA74422FD; Wed, 14 Oct 2020 20:55:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBPnc3yCgz4RWm; Wed, 14 Oct 2020 20:55:32 +0000 (UTC) (envelope-from adrian@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 6668D143D5; Wed, 14 Oct 2020 20:55:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09EKtWvW037093; Wed, 14 Oct 2020 20:55:32 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09EKtWo1037092; Wed, 14 Oct 2020 20:55:32 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202010142055.09EKtWo1037092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 14 Oct 2020 20:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366709 - head/sys/crypto/skein/amd64 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/crypto/skein/amd64 X-SVN-Commit-Revision: 366709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 20:55:32 -0000 Author: adrian Date: Wed Oct 14 20:55:31 2020 New Revision: 366709 URL: https://svnweb.freebsd.org/changeset/base/366709 Log: [skein] Fix compile issue with unknown symbol SKEIN_ASM_UNROLL1024 Weirdly, I needed to sprinkle more parens here to get gcc-as in 6.4 to correctly generate things. Without them, I'd get an unknown variable reference to SKEIN_ASM_UNROLL1024. This at least links now, but I haven't run any test cases against it. It may be worthwhile doing it in case gcc-as demands we liberally sprinkle more brackets around variables in .if statements. Thanks to ed for the suggestion of just sprinkling more brackets to see if that helped. Reviewed by: emaste Modified: head/sys/crypto/skein/amd64/skein_block_asm.S Modified: head/sys/crypto/skein/amd64/skein_block_asm.S ============================================================================== --- head/sys/crypto/skein/amd64/skein_block_asm.S Wed Oct 14 17:39:50 2020 (r366708) +++ head/sys/crypto/skein/amd64/skein_block_asm.S Wed Oct 14 20:55:31 2020 (r366709) @@ -41,7 +41,7 @@ SKEIN_UNROLL_1024 = (_SKEIN_LOOP ) % 10 SKEIN_ASM_UNROLL = 0 .irp _NN_,256,512,1024 .if (SKEIN_UNROLL_\_NN_) == 0 -SKEIN_ASM_UNROLL = SKEIN_ASM_UNROLL + \_NN_ +SKEIN_ASM_UNROLL = (SKEIN_ASM_UNROLL) + \_NN_ .endif .endr ################# @@ -397,7 +397,7 @@ _NN_ = _NN_ - 1 .macro Skein_Debug_Round BLK_BITS,R,RDI_OFFS,afterOp # call the appropriate (local) debug "function" pushq %rdx #save rdx, so we can use it for round "number" - .if (SKEIN_ASM_UNROLL & \BLK_BITS) || (\R >= SKEIN_RND_SPECIAL) + .if ((SKEIN_ASM_UNROLL) & \BLK_BITS) || (\R >= SKEIN_RND_SPECIAL) movq $\R,%rdx .else #compute round number using edi _rOffs_ = \RDI_OFFS + 0 @@ -533,7 +533,7 @@ Skein_256_block_loop: Skein_Debug_Round 256,SKEIN_RND_KEY_INITIAL .endif # -.if ((SKEIN_ASM_UNROLL & 256) == 0) +.if (((SKEIN_ASM_UNROLL) & 256) == 0) movq %r8 ,ksKey+40+F_O(%rbp) #save key schedule on stack for looping code movq %r9 ,ksKey+ 8+F_O(%rbp) movq %r10,ksKey+16+F_O(%rbp) @@ -549,7 +549,7 @@ Skein_256_block_loop: # # now the key schedule is computed. Start the rounds # -.if SKEIN_ASM_UNROLL & 256 +.if (SKEIN_ASM_UNROLL) & 256 _UNROLL_CNT = ROUNDS_256/8 .else _UNROLL_CNT = SKEIN_UNROLL_256 @@ -566,20 +566,20 @@ _Rbase_ = 0 addReg rax, rbx RotL64 rbx, 256,%((4*_Rbase_+0) % 8),0 addReg rcx, rdx - .if (SKEIN_ASM_UNROLL & 256) == 0 + .if ((SKEIN_ASM_UNROLL) & 256) == 0 movq ksKey+8*1+F_O(%rbp,%rdi,8),%r8 .endif xorReg rbx, rax RotL64 rdx, 256,%((4*_Rbase_+0) % 8),1 xorReg rdx, rcx - .if SKEIN_ASM_UNROLL & 256 + .if (SKEIN_ASM_UNROLL) & 256 .irp _r0_,%( 8+(_Rbase_+3) % 5) .irp _r1_,%(13+(_Rbase_+2) % 3) leaq (%r\_r0_,%r\_r1_),%rdi #precompute key injection value for %rcx .endr .endr .endif - .if (SKEIN_ASM_UNROLL & 256) == 0 + .if ((SKEIN_ASM_UNROLL) & 256) == 0 movq ksTwk+8*1+F_O(%rbp,%rdi,8),%r13 .endif Skein_Debug_Round 256,%(4*_Rbase_+1) @@ -588,17 +588,17 @@ _Rbase_ = 0 addReg rax, rdx RotL64 rdx, 256,%((4*_Rbase_+1) % 8),0 xorReg rdx, rax - .if (SKEIN_ASM_UNROLL & 256) == 0 + .if ((SKEIN_ASM_UNROLL) & 256) == 0 movq ksKey+8*2+F_O(%rbp,%rdi,8),%r9 .endif addReg rcx, rbx RotL64 rbx, 256,%((4*_Rbase_+1) % 8),1 xorReg rbx, rcx - .if (SKEIN_ASM_UNROLL & 256) == 0 + .if ((SKEIN_ASM_UNROLL) & 256) == 0 movq ksKey+8*4+F_O(%rbp,%rdi,8),%r11 .endif Skein_Debug_Round 256,%(4*_Rbase_+2) - .if SKEIN_ASM_UNROLL & 256 + .if (SKEIN_ASM_UNROLL) & 256 .irp _r0_,%( 8+(_Rbase_+2) % 5) .irp _r1_,%(13+(_Rbase_+1) % 3) leaq (%r\_r0_,%r\_r1_),%rsi #precompute key injection value for %rbx @@ -609,13 +609,13 @@ _Rbase_ = 0 addReg rax, rbx RotL64 rbx, 256,%((4*_Rbase_+2) % 8),0 addReg rcx, rdx - .if (SKEIN_ASM_UNROLL & 256) == 0 + .if ((SKEIN_ASM_UNROLL) & 256) == 0 movq ksKey+8*3+F_O(%rbp,%rdi,8),%r10 .endif xorReg rbx, rax RotL64 rdx, 256,%((4*_Rbase_+2) % 8),1 xorReg rdx, rcx - .if (SKEIN_ASM_UNROLL & 256) == 0 + .if ((SKEIN_ASM_UNROLL) & 256) == 0 movq %r8,ksKey+8*6+F_O(%rbp,%rdi,8) #"rotate" the key leaq 1(%r11,%rdi),%r11 #precompute key + tweak .endif @@ -624,7 +624,7 @@ _Rbase_ = 0 addReg rax, rdx RotL64 rdx, 256,%((4*_Rbase_+3) % 8),0 addReg rcx, rbx - .if (SKEIN_ASM_UNROLL & 256) == 0 + .if ((SKEIN_ASM_UNROLL) & 256) == 0 addq ksTwk+8*2+F_O(%rbp,%rdi,8),%r10 #precompute key + tweak movq %r13,ksTwk+8*4+F_O(%rbp,%rdi,8) #"rotate" the tweak .endif @@ -632,12 +632,12 @@ _Rbase_ = 0 RotL64 rbx, 256,%((4*_Rbase_+3) % 8),1 xorReg rbx, rcx Skein_Debug_Round 256,%(4*_Rbase_+4) - .if (SKEIN_ASM_UNROLL & 256) == 0 + .if ((SKEIN_ASM_UNROLL) & 256) == 0 addReg r9 ,r13 #precompute key+tweak .endif #inject key schedule words _Rbase_ = _Rbase_+1 - .if SKEIN_ASM_UNROLL & 256 + .if (SKEIN_ASM_UNROLL) & 256 addReg rax,r,%(8+((_Rbase_+0) % 5)) addReg rbx,rsi addReg rcx,rdi @@ -652,7 +652,7 @@ _Rbase_ = _Rbase_+1 Skein_Debug_Round 256,SKEIN_RND_KEY_INJECT .endr #rept _UNROLL_CNT # -.if (SKEIN_ASM_UNROLL & 256) == 0 +.if ((SKEIN_ASM_UNROLL) & 256) == 0 cmpq $2*(ROUNDS_256/8),%rdi jb Skein_256_round_loop .endif # (SKEIN_ASM_UNROLL & 256) == 0 @@ -867,7 +867,7 @@ Skein_512_block_loop: ################# # now the key schedule is computed. Start the rounds # -.if SKEIN_ASM_UNROLL & 512 +.if (SKEIN_ASM_UNROLL) & 512 _UNROLL_CNT = ROUNDS_512/8 .else _UNROLL_CNT = SKEIN_UNROLL_512 @@ -884,7 +884,7 @@ _Rbase_ = 0 _Rbase_ = _Rbase_+1 .endr #rept _UNROLL_CNT # -.if (SKEIN_ASM_UNROLL & 512) == 0 +.if ((SKEIN_ASM_UNROLL) & 512) == 0 cmpq $2*(ROUNDS_512/8),%rdi jb Skein_512_round_loop movq ctxPtr +F_O(%rbp),%rdi #restore rdi --> context @@ -1062,7 +1062,7 @@ _Rn_ = (\_RR_) + 3 Skein_Debug_Round 1024,%(_Rn_+1) .endif - .if (SKEIN_ASM_UNROLL & 1024) == 0 #here with rdi == rIdx, X0 on stack + .if ((SKEIN_ASM_UNROLL) & 1024) == 0 #here with rdi == rIdx, X0 on stack #"rotate" the key schedule on the stack i8 = o1K_r8 i0 = o1K_rdi @@ -1098,7 +1098,7 @@ Skein1024_block_loop: # R8 ..R15 = X8..X15 (state words) # RBP = temp (used for X0 and X2) # - .if (SKEIN_ASM_UNROLL & 1024) == 0 + .if ((SKEIN_ASM_UNROLL) & 1024) == 0 xorq %rax,%rax #init loop index on the stack movq %rax,rIdx_offs(%rsp) .endif @@ -1159,7 +1159,7 @@ _oo_ = o1K_\_rr_ #offset ass ################# # now the key schedule is computed. Start the rounds # -.if SKEIN_ASM_UNROLL & 1024 +.if (SKEIN_ASM_UNROLL) & 1024 _UNROLL_CNT = ROUNDS_1024/8 .else _UNROLL_CNT = SKEIN_UNROLL_1024 @@ -1175,7 +1175,7 @@ _Rbase_ = 0 _Rbase_ = _Rbase_+1 .endr #rept _UNROLL_CNT # -.if (SKEIN_ASM_UNROLL & 1024) == 0 +.if ((SKEIN_ASM_UNROLL) & 1024) == 0 cmpq $2*(ROUNDS_1024/8),tmpStk_1024(%rsp) #see .if we are done jb Skein1024_round_loop .endif From owner-svn-src-head@freebsd.org Wed Oct 14 21:22:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99E9E443604; Wed, 14 Oct 2020 21:22:24 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBQNc3d2fz4Sxq; Wed, 14 Oct 2020 21:22:24 +0000 (UTC) (envelope-from br@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 6124914AB8; Wed, 14 Oct 2020 21:22:24 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09ELMOGS055305; Wed, 14 Oct 2020 21:22:24 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ELMO5C055304; Wed, 14 Oct 2020 21:22:24 GMT (envelope-from br@FreeBSD.org) Message-Id: <202010142122.09ELMO5C055304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 14 Oct 2020 21:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366710 - head/sys/dev/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/iommu X-SVN-Commit-Revision: 366710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 21:22:24 -0000 Author: br Date: Wed Oct 14 21:22:23 2020 New Revision: 366710 URL: https://svnweb.freebsd.org/changeset/base/366710 Log: Split-out iommu type definitions to a separate header. Reviewed by: kib Sponsored by: Innovate DSbD Differential Revision: https://reviews.freebsd.org/D26780 Added: head/sys/dev/iommu/iommu_types.h (contents, props changed) Modified: head/sys/dev/iommu/iommu.h Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Wed Oct 14 20:55:31 2020 (r366709) +++ head/sys/dev/iommu/iommu.h Wed Oct 14 21:22:23 2020 (r366710) @@ -34,10 +34,7 @@ #ifndef _DEV_IOMMU_IOMMU_H_ #define _DEV_IOMMU_IOMMU_H_ -/* Host or physical memory address, after translation. */ -typedef uint64_t iommu_haddr_t; -/* Guest or bus address, before translation. */ -typedef uint64_t iommu_gaddr_t; +#include struct bus_dma_tag_common; struct iommu_map_entry; Added: head/sys/dev/iommu/iommu_types.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iommu/iommu_types.h Wed Oct 14 21:22:23 2020 (r366710) @@ -0,0 +1,42 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_IOMMU_IOMMU_TYPES_H_ +#define _DEV_IOMMU_IOMMU_TYPES_H_ + +/* Host or physical memory address, after translation. */ +typedef uint64_t iommu_haddr_t; +/* Guest or bus address, before translation. */ +typedef uint64_t iommu_gaddr_t; + +#endif /* !_DEV_IOMMU_IOMMU_TYPES_H_ */ From owner-svn-src-head@freebsd.org Wed Oct 14 22:51:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C3B3444565; Wed, 14 Oct 2020 22:51:49 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBSMn3qYJz4Xfd; Wed, 14 Oct 2020 22:51:49 +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 6658215B24; Wed, 14 Oct 2020 22:51:49 +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 09EMpnKL008722; Wed, 14 Oct 2020 22:51:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09EMpf29006160; Wed, 14 Oct 2020 22:51:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010142251.09EMpf29006160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 14 Oct 2020 22:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366711 - in head/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 kern mips/atheros mips/atheros/ar531x mips/beri mips/broadcom mips/cavium mips/ingenic mips/malta mips/mediatek mips/mip... X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 kern mips/atheros mips/atheros/ar531x mips/beri mips/broadcom mips/cavium mips/ingenic mips/malta mips/mediatek mips/mips mips/nlm powerpc/aim po... X-SVN-Commit-Revision: 366711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 22:51:49 -0000 Author: kib Date: Wed Oct 14 22:51:40 2020 New Revision: 366711 URL: https://svnweb.freebsd.org/changeset/base/366711 Log: Avoid dump_avail[] redefinition. Move dump_avail[] extern declaration and inlines into a new header vm/vm_dumpset.h. This fixes default gcc build for mips. Reviewed by: alc, scottph Tested by: kevans (previous version) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26741 Added: head/sys/vm/vm_dumpset.h (contents, props changed) Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/minidump_machdep.c head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/uma_machdep.c head/sys/arm/arm/mem.c head/sys/arm/arm/minidump_machdep.c head/sys/arm64/arm64/minidump_machdep.c head/sys/arm64/arm64/pmap.c head/sys/arm64/arm64/uma_machdep.c head/sys/i386/i386/machdep.c head/sys/i386/i386/minidump_machdep_base.c head/sys/kern/kern_dump.c head/sys/kern/subr_physmem.c head/sys/mips/atheros/ar531x/ar5315_machdep.c head/sys/mips/atheros/ar71xx_machdep.c head/sys/mips/beri/beri_machdep.c head/sys/mips/broadcom/bcm_machdep.c head/sys/mips/cavium/octeon_machdep.c head/sys/mips/ingenic/jz4780_machdep.c head/sys/mips/malta/malta_machdep.c head/sys/mips/mediatek/mtk_machdep.c head/sys/mips/mips/minidump_machdep.c head/sys/mips/mips/pmap.c head/sys/mips/mips/uma_machdep.c head/sys/mips/nlm/xlp_machdep.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/mmu_radix.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/powerpc/minidump_machdep.c head/sys/powerpc/powerpc/uma_machdep.c head/sys/riscv/riscv/minidump_machdep.c head/sys/riscv/riscv/pmap.c head/sys/riscv/riscv/uma_machdep.c head/sys/vm/uma_core.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_phys.h head/sys/x86/x86/nexus.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/amd64/amd64/machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -95,14 +95,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include #include -#include #include +#include #ifdef DDB #ifndef KDB Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/amd64/amd64/minidump_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/amd64/amd64/pmap.c Wed Oct 14 22:51:40 2020 (r366711) @@ -149,6 +149,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/amd64/amd64/uma_machdep.c ============================================================================== --- head/sys/amd64/amd64/uma_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/amd64/amd64/uma_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -36,12 +36,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include -#include void * uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, Modified: head/sys/arm/arm/mem.c ============================================================================== --- head/sys/arm/arm/mem.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/arm/arm/mem.c Wed Oct 14 22:51:40 2020 (r366711) @@ -65,11 +65,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include /* * Used in /dev/mem drivers and elsewhere Modified: head/sys/arm/arm/minidump_machdep.c ============================================================================== --- head/sys/arm/arm/minidump_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/arm/arm/minidump_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm64/arm64/minidump_machdep.c ============================================================================== --- head/sys/arm64/arm64/minidump_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/arm64/arm64/minidump_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/arm64/arm64/pmap.c Wed Oct 14 22:51:40 2020 (r366711) @@ -143,6 +143,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/arm64/arm64/uma_machdep.c ============================================================================== --- head/sys/arm64/arm64/uma_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/arm64/arm64/uma_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -34,12 +34,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include -#include void * uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/i386/i386/machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -94,14 +94,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include #include -#include #include +#include #ifdef DDB #ifndef KDB Modified: head/sys/i386/i386/minidump_machdep_base.c ============================================================================== --- head/sys/i386/i386/minidump_machdep_base.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/i386/i386/minidump_machdep_base.c Wed Oct 14 22:51:40 2020 (r366711) @@ -43,11 +43,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include #include CTASSERT(sizeof(struct kerneldumpheader) == 512); Modified: head/sys/kern/kern_dump.c ============================================================================== --- head/sys/kern/kern_dump.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/kern/kern_dump.c Wed Oct 14 22:51:40 2020 (r366711) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/kern/subr_physmem.c ============================================================================== --- head/sys/kern/subr_physmem.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/kern/subr_physmem.c Wed Oct 14 22:51:40 2020 (r366711) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* Modified: head/sys/mips/atheros/ar531x/ar5315_machdep.c ============================================================================== --- head/sys/mips/atheros/ar531x/ar5315_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/mips/atheros/ar531x/ar5315_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- head/sys/mips/atheros/ar71xx_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/mips/atheros/ar71xx_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/mips/beri/beri_machdep.c ============================================================================== --- head/sys/mips/beri/beri_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/mips/beri/beri_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/mips/broadcom/bcm_machdep.c ============================================================================== --- head/sys/mips/broadcom/bcm_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/mips/broadcom/bcm_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/mips/cavium/octeon_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/mips/ingenic/jz4780_machdep.c ============================================================================== --- head/sys/mips/ingenic/jz4780_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/mips/ingenic/jz4780_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/mips/malta/malta_machdep.c ============================================================================== --- head/sys/mips/malta/malta_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/mips/malta/malta_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/mips/mediatek/mtk_machdep.c ============================================================================== --- head/sys/mips/mediatek/mtk_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/mips/mediatek/mtk_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/mips/mips/minidump_machdep.c ============================================================================== --- head/sys/mips/mips/minidump_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/mips/mips/minidump_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -42,13 +42,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include #include -#include #include #include Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/mips/mips/pmap.c Wed Oct 14 22:51:40 2020 (r366711) @@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/mips/mips/uma_machdep.c ============================================================================== --- head/sys/mips/mips/uma_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/mips/mips/uma_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -36,12 +36,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include -#include void * uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, Modified: head/sys/mips/nlm/xlp_machdep.c ============================================================================== --- head/sys/mips/nlm/xlp_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/mips/nlm/xlp_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/powerpc/aim/mmu_oea64.c Wed Oct 14 22:51:40 2020 (r366711) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/powerpc/aim/mmu_radix.c ============================================================================== --- head/sys/powerpc/aim/mmu_radix.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/powerpc/aim/mmu_radix.c Wed Oct 14 22:51:40 2020 (r366711) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/powerpc/booke/pmap.c Wed Oct 14 22:51:40 2020 (r366711) @@ -99,16 +99,17 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include -#include #include #include #include #include +#include #include #include Modified: head/sys/powerpc/powerpc/minidump_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/minidump_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/powerpc/powerpc/minidump_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include Modified: head/sys/powerpc/powerpc/uma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/uma_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/powerpc/powerpc/uma_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -36,15 +36,16 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include #include #include #include -#include static int hw_uma_mdpages; SYSCTL_INT(_hw, OID_AUTO, uma_mdpages, CTLFLAG_RD, &hw_uma_mdpages, 0, Modified: head/sys/riscv/riscv/minidump_machdep.c ============================================================================== --- head/sys/riscv/riscv/minidump_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/riscv/riscv/minidump_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/riscv/riscv/pmap.c Wed Oct 14 22:51:40 2020 (r366711) @@ -152,6 +152,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/riscv/riscv/uma_machdep.c ============================================================================== --- head/sys/riscv/riscv/uma_machdep.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/riscv/riscv/uma_machdep.c Wed Oct 14 22:51:40 2020 (r366711) @@ -34,12 +34,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include -#include void * uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/vm/uma_core.c Wed Oct 14 22:51:40 2020 (r366711) @@ -82,16 +82,17 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -#include #include #include #include #include #include +#include #include #include #include Added: head/sys/vm/vm_dumpset.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/vm/vm_dumpset.h Wed Oct 14 22:51:40 2020 (r366711) @@ -0,0 +1,99 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020, Scott Phillips + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_DUMPSET_H_ +#define _SYS_DUMPSET_H_ + +#include +#include + +extern struct bitset *vm_page_dump; +extern long vm_page_dump_pages; +extern vm_paddr_t dump_avail[PHYS_AVAIL_COUNT]; + +static inline void +dump_add_page(vm_paddr_t pa) +{ + vm_pindex_t adj; + int i; + + adj = 0; + for (i = 0; dump_avail[i + 1] != 0; i += 2) { + if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) { + BIT_SET_ATOMIC(vm_page_dump_pages, + (pa >> PAGE_SHIFT) - (dump_avail[i] >> PAGE_SHIFT) + + adj, vm_page_dump); + return; + } + adj += howmany(dump_avail[i + 1], PAGE_SIZE) - + dump_avail[i] / PAGE_SIZE; + } +} + +static inline void +dump_drop_page(vm_paddr_t pa) +{ + vm_pindex_t adj; + int i; + + adj = 0; + for (i = 0; dump_avail[i + 1] != 0; i += 2) { + if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) { + BIT_CLR_ATOMIC(vm_page_dump_pages, + (pa >> PAGE_SHIFT) - (dump_avail[i] >> PAGE_SHIFT) + + adj, vm_page_dump); + return; + } + adj += howmany(dump_avail[i + 1], PAGE_SIZE) - + dump_avail[i] / PAGE_SIZE; + } +} + +static inline vm_paddr_t +vm_page_dump_index_to_pa(int bit) +{ + int i, tot; + + for (i = 0; dump_avail[i + 1] != 0; i += 2) { + tot = howmany(dump_avail[i + 1], PAGE_SIZE) - + dump_avail[i] / PAGE_SIZE; + if (bit < tot) + return ((vm_paddr_t)bit * PAGE_SIZE + + (dump_avail[i] & ~PAGE_MASK)); + bit -= tot; + } + return ((vm_paddr_t)NULL); +} + +#define VM_PAGE_DUMP_FOREACH(pa) \ + for (vm_pindex_t __b = BIT_FFS(vm_page_dump_pages, vm_page_dump); \ + (pa) = vm_page_dump_index_to_pa(__b - 1), __b != 0; \ + __b = BIT_FFS_AT(vm_page_dump_pages, vm_page_dump, __b)) + +#endif /* _SYS_DUMPSET_H_ */ Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/vm/vm_page.c Wed Oct 14 22:51:40 2020 (r366711) @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/vm/vm_page.h Wed Oct 14 22:51:40 2020 (r366711) @@ -69,8 +69,6 @@ #ifndef _VM_PAGE_ #define _VM_PAGE_ -#include -#include #include /* @@ -586,69 +584,6 @@ malloc2vm_flags(int malloc_flags) #define PS_ALL_DIRTY 0x1 #define PS_ALL_VALID 0x2 #define PS_NONE_BUSY 0x4 - -extern struct bitset *vm_page_dump; -extern long vm_page_dump_pages; -extern vm_paddr_t dump_avail[]; - -static inline void -dump_add_page(vm_paddr_t pa) -{ - vm_pindex_t adj; - int i; - - adj = 0; - for (i = 0; dump_avail[i + 1] != 0; i += 2) { - if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) { - BIT_SET_ATOMIC(vm_page_dump_pages, - (pa >> PAGE_SHIFT) - (dump_avail[i] >> PAGE_SHIFT) + - adj, vm_page_dump); - return; - } - adj += howmany(dump_avail[i + 1], PAGE_SIZE) - - dump_avail[i] / PAGE_SIZE; - } -} - -static inline void -dump_drop_page(vm_paddr_t pa) -{ - vm_pindex_t adj; - int i; - - adj = 0; - for (i = 0; dump_avail[i + 1] != 0; i += 2) { - if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) { - BIT_CLR_ATOMIC(vm_page_dump_pages, - (pa >> PAGE_SHIFT) - (dump_avail[i] >> PAGE_SHIFT) + - adj, vm_page_dump); - return; - } - adj += howmany(dump_avail[i + 1], PAGE_SIZE) - - dump_avail[i] / PAGE_SIZE; - } -} - -static inline vm_paddr_t -vm_page_dump_index_to_pa(int bit) -{ - int i, tot; - - for (i = 0; dump_avail[i + 1] != 0; i += 2) { - tot = howmany(dump_avail[i + 1], PAGE_SIZE) - - dump_avail[i] / PAGE_SIZE; - if (bit < tot) - return ((vm_paddr_t)bit * PAGE_SIZE + - (dump_avail[i] & ~PAGE_MASK)); - bit -= tot; - } - return ((vm_paddr_t)NULL); -} - -#define VM_PAGE_DUMP_FOREACH(pa) \ - for (vm_pindex_t __b = BIT_FFS(vm_page_dump_pages, vm_page_dump); \ - (pa) = vm_page_dump_index_to_pa(__b - 1), __b != 0; \ - __b = BIT_FFS_AT(vm_page_dump_pages, vm_page_dump, __b)) bool vm_page_busy_acquire(vm_page_t m, int allocflags); void vm_page_busy_downgrade(vm_page_t m); Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/vm/vm_phys.h Wed Oct 14 22:51:40 2020 (r366711) @@ -47,7 +47,6 @@ #endif extern vm_paddr_t phys_avail[PHYS_AVAIL_COUNT]; -extern vm_paddr_t dump_avail[PHYS_AVAIL_COUNT]; /* Domains must be dense (non-sparse) and zero-based. */ struct mem_affinity { Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Wed Oct 14 21:22:23 2020 (r366710) +++ head/sys/x86/x86/nexus.c Wed Oct 14 22:51:40 2020 (r366711) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@freebsd.org Wed Oct 14 22:57:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2C884449C8; Wed, 14 Oct 2020 22:57:52 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBSVm4kgtz4Xgr; Wed, 14 Oct 2020 22:57:52 +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 8164615D0F; Wed, 14 Oct 2020 22:57:52 +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 09EMvqCu010778; Wed, 14 Oct 2020 22:57:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09EMvpU0010772; Wed, 14 Oct 2020 22:57:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010142257.09EMvpU0010772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 14 Oct 2020 22:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366712 - in head/sys: amd64/amd64 i386/i386 x86/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 x86/include x86/x86 X-SVN-Commit-Revision: 366712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 22:57:52 -0000 Author: kib Date: Wed Oct 14 22:57:50 2020 New Revision: 366712 URL: https://svnweb.freebsd.org/changeset/base/366712 Log: Limit workaround for errata E400 to appropriate AMD cpus. From Linux sources and several datasheets I looked at, it seems that the workaround is only needed on families 0xf and 0x10. For instance, Ryzens do not implement the accessed MSR at all, it is documented as reserved. Also, hypervisors should not allow guest to put CPU into idle state, so activate workaround only when on bare hardware. While there, style the code: move MSR defines to specialreg.h move identification to initcpu.c Reported by: whu Reviewed by: avg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26470 Modified: head/sys/amd64/amd64/initcpu.c head/sys/amd64/amd64/machdep.c head/sys/i386/i386/initcpu.c head/sys/i386/i386/machdep.c head/sys/x86/include/specialreg.h head/sys/x86/include/x86_var.h head/sys/x86/x86/cpu_machdep.c Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Wed Oct 14 22:51:40 2020 (r366711) +++ head/sys/amd64/amd64/initcpu.c Wed Oct 14 22:57:50 2020 (r366712) @@ -69,6 +69,23 @@ init_amd(void) uint64_t msr; /* + * C1E renders the local APIC timer dead, so we disable it by + * reading the Interrupt Pending Message register and clearing + * both C1eOnCmpHalt (bit 28) and SmiOnCmpHalt (bit 27). + * + * Reference: + * "BIOS and Kernel Developer's Guide for AMD NPT Family 0Fh Processors" + * #32559 revision 3.00+ + * + * Detect the presence of C1E capability mostly on latest + * dual-cores (or future) k8 family. Affected models range is + * taken from Linux sources. + */ + if ((CPUID_TO_FAMILY(cpu_id) == 0xf || + CPUID_TO_FAMILY(cpu_id) == 0x10) && (cpu_feature2 & CPUID2_HV) == 0) + cpu_amdc1e_bug = 1; + + /* * Work around Erratum 721 for Family 10h and 12h processors. * These processors may incorrectly update the stack pointer * after a long series of push and/or near-call instructions, Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed Oct 14 22:51:40 2020 (r366711) +++ head/sys/amd64/amd64/machdep.c Wed Oct 14 22:57:50 2020 (r366712) @@ -1928,8 +1928,6 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) if (env != NULL) strlcpy(kernelname, env, sizeof(kernelname)); - cpu_probe_amdc1e(); - kcsan_cpu_init(0); #ifdef FDT Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Wed Oct 14 22:51:40 2020 (r366711) +++ head/sys/i386/i386/initcpu.c Wed Oct 14 22:57:50 2020 (r366712) @@ -720,8 +720,8 @@ initializecpu(void) break; } break; -#ifdef CPU_ATHLON_SSE_HACK case CPU_VENDOR_AMD: +#ifdef CPU_ATHLON_SSE_HACK /* * Sometimes the BIOS doesn't enable SSE instructions. * According to AMD document 20734, the mobile @@ -738,8 +738,16 @@ initializecpu(void) do_cpuid(1, regs); cpu_feature = regs[3]; } - break; #endif + /* + * Detect C1E that breaks APIC. See comment in + * amd64/initcpu.c. + */ + if ((CPUID_TO_FAMILY(cpu_id) == 0xf || + CPUID_TO_FAMILY(cpu_id) == 0x10) && + (cpu_feature2 & CPUID2_HV) == 0) + cpu_amdc1e_bug = 1; + break; case CPU_VENDOR_CENTAUR: init_via(); break; Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Wed Oct 14 22:51:40 2020 (r366711) +++ head/sys/i386/i386/machdep.c Wed Oct 14 22:57:50 2020 (r366712) @@ -2505,8 +2505,6 @@ init386(int first) thread0.td_pcb->pcb_ext = 0; thread0.td_frame = &proc0_tf; - cpu_probe_amdc1e(); - #ifdef FDT x86_init_fdt(); #endif Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Wed Oct 14 22:51:40 2020 (r366711) +++ head/sys/x86/include/specialreg.h Wed Oct 14 22:57:50 2020 (r366712) @@ -1126,6 +1126,7 @@ #define MSR_NB_CFG1 0xc001001f /* NB configuration 1 */ #define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ #define MSR_MC0_CTL_MASK 0xc0010044 +#define MSR_AMDK8_IPM 0xc0010055 #define MSR_P_STATE_LIMIT 0xc0010061 /* P-state Current Limit Register */ #define MSR_P_STATE_CONTROL 0xc0010062 /* P-state Control Register */ #define MSR_P_STATE_STATUS 0xc0010063 /* P-state Status Register */ @@ -1142,6 +1143,9 @@ /* MSR_VM_CR related */ #define VM_CR_SVMDIS 0x10 /* SVM: disabled by BIOS */ + +#define AMDK8_SMIONCMPHALT (1ULL << 27) +#define AMDK8_C1EONCMPHALT (1ULL << 28) /* VIA ACE crypto featureset: for via_feature_rng */ #define VIA_HAS_RNG 1 /* cpu has RNG */ Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Wed Oct 14 22:51:40 2020 (r366711) +++ head/sys/x86/include/x86_var.h Wed Oct 14 22:57:50 2020 (r366712) @@ -94,6 +94,7 @@ extern int hw_ssb_active; extern int x86_taa_enable; extern int cpu_flush_rsb_ctxsw; extern int x86_rngds_mitg_enable; +extern int cpu_amdc1e_bug; struct pcb; struct thread; Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Wed Oct 14 22:51:40 2020 (r366711) +++ head/sys/x86/x86/cpu_machdep.c Wed Oct 14 22:57:50 2020 (r366712) @@ -486,7 +486,9 @@ cpu_mwait_usable(void) } void (*cpu_idle_hook)(sbintime_t) = NULL; /* ACPI idle hook. */ -static int cpu_ident_amdc1e = 0; /* AMD C1E supported. */ + +int cpu_amdc1e_bug = 0; /* AMD C1E APIC workaround required. */ + static int idle_mwait = 1; /* Use MONITOR/MWAIT for short idle. */ SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RWTUN, &idle_mwait, 0, "Use MONITOR/MWAIT for short idle"); @@ -587,35 +589,6 @@ cpu_idle_spin(sbintime_t sbt) } } -/* - * C1E renders the local APIC timer dead, so we disable it by - * reading the Interrupt Pending Message register and clearing - * both C1eOnCmpHalt (bit 28) and SmiOnCmpHalt (bit 27). - * - * Reference: - * "BIOS and Kernel Developer's Guide for AMD NPT Family 0Fh Processors" - * #32559 revision 3.00+ - */ -#define MSR_AMDK8_IPM 0xc0010055 -#define AMDK8_SMIONCMPHALT (1ULL << 27) -#define AMDK8_C1EONCMPHALT (1ULL << 28) -#define AMDK8_CMPHALT (AMDK8_SMIONCMPHALT | AMDK8_C1EONCMPHALT) - -void -cpu_probe_amdc1e(void) -{ - - /* - * Detect the presence of C1E capability mostly on latest - * dual-cores (or future) k8 family. - */ - if (cpu_vendor_id == CPU_VENDOR_AMD && - (cpu_id & 0x00000f00) == 0x00000f00 && - (cpu_id & 0x0fff0000) >= 0x00040000) { - cpu_ident_amdc1e = 1; - } -} - void (*cpu_idle_fn)(sbintime_t) = cpu_idle_acpi; void @@ -645,10 +618,11 @@ cpu_idle(int busy) } /* Apply AMD APIC timer C1E workaround. */ - if (cpu_ident_amdc1e && cpu_disable_c3_sleep) { + if (cpu_amdc1e_bug && cpu_disable_c3_sleep) { msr = rdmsr(MSR_AMDK8_IPM); - if (msr & AMDK8_CMPHALT) - wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT); + if ((msr & (AMDK8_SMIONCMPHALT | AMDK8_C1EONCMPHALT)) != 0) + wrmsr(MSR_AMDK8_IPM, msr & ~(AMDK8_SMIONCMPHALT | + AMDK8_C1EONCMPHALT)); } /* Call main idle method. */ From owner-svn-src-head@freebsd.org Wed Oct 14 23:01:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50B90444938; Wed, 14 Oct 2020 23:01:43 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBSbC17Srz4YJ3; Wed, 14 Oct 2020 23:01:43 +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 0A17515F9E; Wed, 14 Oct 2020 23:01:43 +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 09EN1g66015644; Wed, 14 Oct 2020 23:01:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09EN1gLi015640; Wed, 14 Oct 2020 23:01:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010142301.09EN1gLi015640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 14 Oct 2020 23:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366713 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-SVN-Commit-Revision: 366713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 23:01:43 -0000 Author: kib Date: Wed Oct 14 23:01:41 2020 New Revision: 366713 URL: https://svnweb.freebsd.org/changeset/base/366713 Log: Fix for mis-interpretation of PCB_KERNFPU. RIght now PCB_KERNFPU is used both as indication that kernel prepared hardware FPU context to use and that the thread is fpu-kern thread. This also breaks fpu_kern_enter(FPU_KERN_NOCTX), since fpu_kern_leave() then clears PCB_KERNFPU. Introduce new flag PCB_KERNFPU_THR which indicates that the thread is fpu-kern. Do not clear PCB_KERNFPU if fpu-kern thread leaves noctx fpu region. Reported and tested by: jhb (amd64) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25511 Modified: head/sys/amd64/amd64/fpu.c head/sys/amd64/include/pcb.h head/sys/i386/i386/npx.c head/sys/i386/include/pcb.h Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Wed Oct 14 22:57:50 2020 (r366712) +++ head/sys/amd64/amd64/fpu.c Wed Oct 14 23:01:41 2020 (r366713) @@ -1230,8 +1230,9 @@ fpu_kern_leave(struct thread *td, struct fpu_kern_ctx if (pcb->pcb_save == get_pcb_user_save_pcb(pcb)) { if ((pcb->pcb_flags & PCB_USERFPUINITDONE) != 0) { set_pcb_flags(pcb, PCB_FPUINITDONE); - clear_pcb_flags(pcb, PCB_KERNFPU); - } else + if ((pcb->pcb_flags & PCB_KERNFPU_THR) == 0) + clear_pcb_flags(pcb, PCB_KERNFPU); + } else if ((pcb->pcb_flags & PCB_KERNFPU_THR) == 0) clear_pcb_flags(pcb, PCB_FPUINITDONE | PCB_KERNFPU); } else { if ((ctx->flags & FPU_KERN_CTX_FPUINITDONE) != 0) @@ -1254,7 +1255,7 @@ fpu_kern_thread(u_int flags) ("mangled pcb_save")); KASSERT(PCB_USER_FPU(curpcb), ("recursive call")); - set_pcb_flags(curpcb, PCB_KERNFPU); + set_pcb_flags(curpcb, PCB_KERNFPU | PCB_KERNFPU_THR); return (0); } @@ -1264,7 +1265,7 @@ is_fpu_kern_thread(u_int flags) if ((curthread->td_pflags & TDP_KTHREAD) == 0) return (0); - return ((curpcb->pcb_flags & PCB_KERNFPU) != 0); + return ((curpcb->pcb_flags & PCB_KERNFPU_THR) != 0); } /* Modified: head/sys/amd64/include/pcb.h ============================================================================== --- head/sys/amd64/include/pcb.h Wed Oct 14 22:57:50 2020 (r366712) +++ head/sys/amd64/include/pcb.h Wed Oct 14 23:01:41 2020 (r366713) @@ -84,6 +84,7 @@ struct pcb { #define PCB_KERNFPU 0x04 /* kernel uses fpu */ #define PCB_FPUINITDONE 0x08 /* fpu state is initialized */ #define PCB_USERFPUINITDONE 0x10 /* fpu user state is initialized */ +#define PCB_KERNFPU_THR 0x20 /* fpu_kern_thread() */ #define PCB_32BIT 0x40 /* process has 32 bit context (segs etc) */ #define PCB_FPUNOSAVE 0x80 /* no save area for current FPU ctx */ Modified: head/sys/i386/i386/npx.c ============================================================================== --- head/sys/i386/i386/npx.c Wed Oct 14 22:57:50 2020 (r366712) +++ head/sys/i386/i386/npx.c Wed Oct 14 23:01:41 2020 (r366713) @@ -1472,11 +1472,12 @@ fpu_kern_leave(struct thread *td, struct fpu_kern_ctx } if (pcb->pcb_save == get_pcb_user_save_pcb(pcb)) { - if ((pcb->pcb_flags & PCB_NPXUSERINITDONE) != 0) + if ((pcb->pcb_flags & PCB_NPXUSERINITDONE) != 0) { pcb->pcb_flags |= PCB_NPXINITDONE; - else - pcb->pcb_flags &= ~PCB_NPXINITDONE; - pcb->pcb_flags &= ~PCB_KERNNPX; + if ((pcb->pcb_flags & PCB_KERNNPX_THR) == 0) + pcb->pcb_flags |= ~PCB_KERNNPX; + } else if ((pcb->pcb_flags & PCB_KERNNPX_THR) == 0) + pcb->pcb_flags &= ~(PCB_NPXINITDONE | PCB_KERNNPX); } else { if ((ctx->flags & FPU_KERN_CTX_NPXINITDONE) != 0) pcb->pcb_flags |= PCB_NPXINITDONE; @@ -1498,7 +1499,7 @@ fpu_kern_thread(u_int flags) ("mangled pcb_save")); KASSERT(PCB_USER_FPU(curpcb), ("recursive call")); - curpcb->pcb_flags |= PCB_KERNNPX; + curpcb->pcb_flags |= PCB_KERNNPX | PCB_KERNNPX_THR; return (0); } @@ -1508,7 +1509,7 @@ is_fpu_kern_thread(u_int flags) if ((curthread->td_pflags & TDP_KTHREAD) == 0) return (0); - return ((curpcb->pcb_flags & PCB_KERNNPX) != 0); + return ((curpcb->pcb_flags & PCB_KERNNPX_THR) != 0); } /* Modified: head/sys/i386/include/pcb.h ============================================================================== --- head/sys/i386/include/pcb.h Wed Oct 14 22:57:50 2020 (r366712) +++ head/sys/i386/include/pcb.h Wed Oct 14 23:01:41 2020 (r366713) @@ -82,6 +82,7 @@ struct pcb { u_int pcb_flags; #define PCB_DBREGS 0x02 /* process using debug registers */ +#define PCB_KERNNPX_THR 0x04 /* fpu_kern_thread() */ #define PCB_NPXINITDONE 0x08 /* fpu state is initialized */ #define PCB_VM86CALL 0x10 /* in vm86 call */ #define PCB_NPXUSERINITDONE 0x20 /* user fpu state is initialized */ From owner-svn-src-head@freebsd.org Thu Oct 15 03:12:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6521042D71B; Thu, 15 Oct 2020 03:12:01 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBZ8124YBz3Z2R; Thu, 15 Oct 2020 03:12:01 +0000 (UTC) (envelope-from scottph@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 2B4C018FA9; Thu, 15 Oct 2020 03:12:01 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09F3C1bl071656; Thu, 15 Oct 2020 03:12:01 GMT (envelope-from scottph@FreeBSD.org) Received: (from scottph@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09F3C1vx071655; Thu, 15 Oct 2020 03:12:01 GMT (envelope-from scottph@FreeBSD.org) Message-Id: <202010150312.09F3C1vx071655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottph set sender to scottph@FreeBSD.org using -f From: D Scott Phillips Date: Thu, 15 Oct 2020 03:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366715 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: scottph X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 366715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 03:12:01 -0000 Author: scottph Date: Thu Oct 15 03:12:00 2020 New Revision: 366715 URL: https://svnweb.freebsd.org/changeset/base/366715 Log: arm64: Increase NIRQ to 16k Ampere Altra in a dual socket configuration has 12 ITSes for the 12 PCIe root complexes. The NIRQ interrupts are statically split between each child of the gic bus, so here we increase that value. 16k is enough for (#cpus * #its * max_pcie_bifurcation) LPIs + (#SPIs and #PPIs) Reviewed by: jhb Approved by: scottl (implicit) MFC after: 1 week Sponsored by: Ampere Computing Differential Revision: https://reviews.freebsd.org/D26766 Modified: head/sys/arm64/include/intr.h Modified: head/sys/arm64/include/intr.h ============================================================================== --- head/sys/arm64/include/intr.h Thu Oct 15 00:50:26 2020 (r366714) +++ head/sys/arm64/include/intr.h Thu Oct 15 03:12:00 2020 (r366715) @@ -36,7 +36,7 @@ #include #ifndef NIRQ -#define NIRQ 2048 /* XXX - It should be an option. */ +#define NIRQ 16384 /* XXX - It should be an option. */ #endif static inline void From owner-svn-src-head@freebsd.org Thu Oct 15 04:48:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA9D043214D; Thu, 15 Oct 2020 04:48:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBcH35NqRz3gnD; Thu, 15 Oct 2020 04:48:15 +0000 (UTC) (envelope-from mjg@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 9B5231A226; Thu, 15 Oct 2020 04:48:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09F4mFQ9028604; Thu, 15 Oct 2020 04:48:15 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09F4mFNx028602; Thu, 15 Oct 2020 04:48:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010150448.09F4mFNx028602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 15 Oct 2020 04:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366716 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 366716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 04:48:15 -0000 Author: mjg Date: Thu Oct 15 04:48:14 2020 New Revision: 366716 URL: https://svnweb.freebsd.org/changeset/base/366716 Log: vfs: add VOP_EAGAIN Can be used to stub fplookup for example. Modified: head/sys/kern/vfs_default.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Thu Oct 15 03:12:00 2020 (r366715) +++ head/sys/kern/vfs_default.c Thu Oct 15 04:48:14 2020 (r366716) @@ -198,6 +198,13 @@ vop_enoent(struct vop_generic_args *ap) } int +vop_eagain(struct vop_generic_args *ap) +{ + + return (EAGAIN); +} + +int vop_null(struct vop_generic_args *ap) { Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Thu Oct 15 03:12:00 2020 (r366715) +++ head/sys/sys/vnode.h Thu Oct 15 04:48:14 2020 (r366716) @@ -828,6 +828,7 @@ int vop_ebadf(struct vop_generic_args *ap); int vop_einval(struct vop_generic_args *ap); int vop_enoent(struct vop_generic_args *ap); int vop_enotty(struct vop_generic_args *ap); +int vop_eagain(struct vop_generic_args *ap); int vop_null(struct vop_generic_args *ap); int vop_panic(struct vop_generic_args *ap); int dead_poll(struct vop_poll_args *ap); @@ -1001,6 +1002,7 @@ extern struct vop_vector default_vnodeops; #define VOP_EINVAL ((void*)(uintptr_t)vop_einval) #define VOP_ENOENT ((void*)(uintptr_t)vop_enoent) #define VOP_EOPNOTSUPP ((void*)(uintptr_t)vop_eopnotsupp) +#define VOP_EAGAIN ((void*)(uintptr_t)vop_eagain) /* fifo_vnops.c */ int fifo_printinfo(struct vnode *); From owner-svn-src-head@freebsd.org Thu Oct 15 04:49:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4E8D431C84; Thu, 15 Oct 2020 04:49:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBcJb4M8qz3y1K; Thu, 15 Oct 2020 04:49:35 +0000 (UTC) (envelope-from mjg@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 78F0B19EE0; Thu, 15 Oct 2020 04:49:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09F4nZ4T028704; Thu, 15 Oct 2020 04:49:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09F4nZIv028702; Thu, 15 Oct 2020 04:49:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010150449.09F4nZIv028702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 15 Oct 2020 04:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366717 - head/sys/contrib/openzfs/module/os/freebsd/zfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/contrib/openzfs/module/os/freebsd/zfs X-SVN-Commit-Revision: 366717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 04:49:35 -0000 Author: mjg Date: Thu Oct 15 04:49:34 2020 New Revision: 366717 URL: https://svnweb.freebsd.org/changeset/base/366717 Log: zfs: add missing fplookup vops Some vnodes come with a hack which inherits the fplookup flag despite having vops which don't provide the routine. Reported by: YAMAMOTO Shigeru Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c Thu Oct 15 04:48:14 2020 (r366716) +++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c Thu Oct 15 04:49:34 2020 (r366717) @@ -798,6 +798,7 @@ zfsctl_common_getacl(struct vop_getacl_args *ap) static struct vop_vector zfsctl_ops_root = { .vop_default = &default_vnodeops, + .vop_fplookup_vexec = VOP_EAGAIN, .vop_open = zfsctl_common_open, .vop_close = zfsctl_common_close, .vop_ioctl = VOP_EINVAL, @@ -1115,6 +1116,7 @@ zfsctl_snapdir_getattr(struct vop_getattr_args *ap) static struct vop_vector zfsctl_ops_snapdir = { .vop_default = &default_vnodeops, + .vop_fplookup_vexec = VOP_EAGAIN, .vop_open = zfsctl_common_open, .vop_close = zfsctl_common_close, .vop_getattr = zfsctl_snapdir_getattr, @@ -1216,6 +1218,7 @@ zfsctl_snapshot_vptocnp(struct vop_vptocnp_args *ap) */ static struct vop_vector zfsctl_ops_snapshot = { .vop_default = NULL, /* ensure very restricted access */ + .vop_fplookup_vexec = VOP_EAGAIN, .vop_inactive = zfsctl_snapshot_inactive, #if __FreeBSD_version >= 1300045 .vop_need_inactive = vop_stdneed_inactive, Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Thu Oct 15 04:48:14 2020 (r366716) +++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Thu Oct 15 04:49:34 2020 (r366717) @@ -6619,6 +6619,7 @@ VFS_VOP_VECTOR_REGISTER(zfs_fifoops); */ struct vop_vector zfs_shareops = { .vop_default = &default_vnodeops, + .vop_fplookup_vexec = VOP_EAGAIN, .vop_access = zfs_freebsd_access, .vop_inactive = zfs_freebsd_inactive, .vop_reclaim = zfs_freebsd_reclaim, From owner-svn-src-head@freebsd.org Thu Oct 15 05:04:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A491D4325D8; Thu, 15 Oct 2020 05:04:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBcfL3kZpz3ygt; Thu, 15 Oct 2020 05:04:58 +0000 (UTC) (envelope-from mjg@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 5F0E91A442; Thu, 15 Oct 2020 05:04:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09F54wEe040462; Thu, 15 Oct 2020 05:04:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09F54w7C040461; Thu, 15 Oct 2020 05:04:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010150504.09F54w7C040461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 15 Oct 2020 05:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366718 - head/sys/contrib/openzfs/module/os/freebsd/zfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/contrib/openzfs/module/os/freebsd/zfs X-SVN-Commit-Revision: 366718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 05:04:58 -0000 Author: mjg Date: Thu Oct 15 05:04:57 2020 New Revision: 366718 URL: https://svnweb.freebsd.org/changeset/base/366718 Log: zfs: g/c unused vop_vector zfsctl_ops_shares_dir Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c Thu Oct 15 04:49:34 2020 (r366717) +++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c Thu Oct 15 05:04:57 2020 (r366718) @@ -314,7 +314,6 @@ sfs_readdir_common(uint64_t parent_id, uint64_t id, st static struct vop_vector zfsctl_ops_root; static struct vop_vector zfsctl_ops_snapdir; static struct vop_vector zfsctl_ops_snapshot; -static struct vop_vector zfsctl_ops_shares_dir; void zfsctl_init(void) @@ -331,8 +330,7 @@ zfsctl_is_node(vnode_t *vp) { return (vn_matchops(vp, zfsctl_ops_root) || vn_matchops(vp, zfsctl_ops_snapdir) || - vn_matchops(vp, zfsctl_ops_snapshot) || - vn_matchops(vp, zfsctl_ops_shares_dir)); + vn_matchops(vp, zfsctl_ops_snapshot)); } From owner-svn-src-head@freebsd.org Thu Oct 15 05:11:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF1254325F7; Thu, 15 Oct 2020 05:11:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBcnc5B05z40GF; Thu, 15 Oct 2020 05:11:16 +0000 (UTC) (envelope-from mjg@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 951BD1A714; Thu, 15 Oct 2020 05:11:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09F5BGtx042560; Thu, 15 Oct 2020 05:11:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09F5BGvS042559; Thu, 15 Oct 2020 05:11:16 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010150511.09F5BGvS042559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 15 Oct 2020 05:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366719 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 366719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 05:11:16 -0000 Author: mjg Date: Thu Oct 15 05:11:16 2020 New Revision: 366719 URL: https://svnweb.freebsd.org/changeset/base/366719 Log: Bump __FreeBSD_version after addition of VOP_EAGAIN Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Oct 15 05:04:57 2020 (r366718) +++ head/sys/sys/param.h Thu Oct 15 05:11:16 2020 (r366719) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300120 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300121 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Thu Oct 15 05:57:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94B9843356E; Thu, 15 Oct 2020 05:57:21 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBdpn3KwCz42TP; Thu, 15 Oct 2020 05:57:21 +0000 (UTC) (envelope-from whu@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 3D8F71B01C; Thu, 15 Oct 2020 05:57:21 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09F5vLeL072164; Thu, 15 Oct 2020 05:57:21 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09F5vLlU072163; Thu, 15 Oct 2020 05:57:21 GMT (envelope-from whu@FreeBSD.org) Message-Id: <202010150557.09F5vLlU072163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Thu, 15 Oct 2020 05:57:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366720 - head/sys/dev/hyperv/pcib X-SVN-Group: head X-SVN-Commit-Author: whu X-SVN-Commit-Paths: head/sys/dev/hyperv/pcib X-SVN-Commit-Revision: 366720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 05:57:21 -0000 Author: whu Date: Thu Oct 15 05:57:20 2020 New Revision: 366720 URL: https://svnweb.freebsd.org/changeset/base/366720 Log: Hyper-V: pcib: Check revoke status during device attach It is possible that the vmbus pcib channel is revoked during attach path. The attach path could be waiting for response from host and this response will never arrive since the channel has already been revoked from host point of view. Check this situation during wait complete and return failed if this happens. Reported by: Netapp MFC after: 2 weeks Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D26486 Modified: head/sys/dev/hyperv/pcib/vmbus_pcib.c Modified: head/sys/dev/hyperv/pcib/vmbus_pcib.c ============================================================================== --- head/sys/dev/hyperv/pcib/vmbus_pcib.c Thu Oct 15 05:11:16 2020 (r366719) +++ head/sys/dev/hyperv/pcib/vmbus_pcib.c Thu Oct 15 05:57:20 2020 (r366720) @@ -117,6 +117,31 @@ wait_for_completion(struct completion *c) mtx_unlock(&c->lock); } +/* + * Return: 0 if completed, a non-zero value if timed out. + */ +static int +wait_for_completion_timeout(struct completion *c, int timeout) +{ + int ret; + + mtx_lock(&c->lock); + + if (c->done == 0) + mtx_sleep(c, &c->lock, 0, "hvwfc", timeout); + + if (c->done > 0) { + c->done--; + ret = 0; + } else { + ret = 1; + } + + mtx_unlock(&c->lock); + + return (ret); +} + #define PCI_MAKE_VERSION(major, minor) ((uint32_t)(((major) << 16) | (major))) enum { @@ -438,6 +463,25 @@ struct compose_comp_ctxt { struct tran_int_desc int_desc; }; +/* + * It is possible the device is revoked during initialization. + * Check if this happens during wait. + * Return: 0 if response arrived, ENODEV if device revoked. + */ +static int +wait_for_response(struct hv_pcibus *hbus, struct completion *c) +{ + do { + if (vmbus_chan_is_revoked(hbus->sc->chan)) { + device_printf(hbus->pcib, + "The device is revoked.\n"); + return (ENODEV); + } + } while (wait_for_completion_timeout(c, hz /10) != 0); + + return 0; +} + static void hv_pci_generic_compl(void *context, struct pci_response *resp, int resp_packet_size) @@ -568,7 +612,9 @@ new_pcichild_device(struct hv_pcibus *hbus, struct pci if (ret) goto err; - wait_for_completion(&comp_pkt.host_event); + if (wait_for_response(hbus, &comp_pkt.host_event)) + goto err; + free_completion(&comp_pkt.host_event); hpdev->desc = *desc; @@ -1011,11 +1057,16 @@ hv_pci_protocol_negotiation(struct hv_pcibus *hbus) ret = vmbus_chan_send(hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, version_req, sizeof(*version_req), (uint64_t)(uintptr_t)&ctxt.pkt); - if (ret) + if (!ret) + ret = wait_for_response(hbus, &comp_pkt.host_event); + + if (ret) { + device_printf(hbus->pcib, + "vmbus_pcib failed to request version: %d\n", + ret); goto out; + } - wait_for_completion(&comp_pkt.host_event); - if (comp_pkt.completion_status < 0) { device_printf(hbus->pcib, "vmbus_pcib version negotiation failed: %x\n", @@ -1072,11 +1123,12 @@ hv_pci_enter_d0(struct hv_pcibus *hbus) ret = vmbus_chan_send(hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, d0_entry, sizeof(*d0_entry), (uint64_t)(uintptr_t)&ctxt.pkt); + if (!ret) + ret = wait_for_response(hbus, &comp_pkt.host_event); + if (ret) goto out; - wait_for_completion(&comp_pkt.host_event); - if (comp_pkt.completion_status < 0) { device_printf(hbus->pcib, "vmbus_pcib failed to enable D0\n"); ret = EPROTO; @@ -1125,14 +1177,14 @@ hv_send_resources_allocated(struct hv_pcibus *hbus) VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, &pkt->message, sizeof(*res_assigned), (uint64_t)(uintptr_t)pkt); - if (ret) { - free_completion(&comp_pkt.host_event); - break; - } + if (!ret) + ret = wait_for_response(hbus, &comp_pkt.host_event); - wait_for_completion(&comp_pkt.host_event); free_completion(&comp_pkt.host_event); + if (ret) + break; + if (comp_pkt.completion_status < 0) { ret = EPROTO; device_printf(hbus->pcib, @@ -1413,9 +1465,11 @@ vmbus_pcib_attach(device_t dev) goto vmbus_close; ret = hv_pci_query_relations(hbus); + if (!ret) + ret = wait_for_response(hbus, hbus->query_comp); + if (ret) goto vmbus_close; - wait_for_completion(hbus->query_comp); ret = hv_pci_enter_d0(hbus); if (ret) From owner-svn-src-head@freebsd.org Thu Oct 15 05:58:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 623694334F7; Thu, 15 Oct 2020 05:58:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBdrg1zDbz42T1; Thu, 15 Oct 2020 05:58:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x544.google.com with SMTP id o3so1192656pgr.11; Wed, 14 Oct 2020 22:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WYnQFcaw3ap4oZ2A12ERkyA+4Jk8IsjUfTaG53eziEU=; b=sJDkxoz57ADTDVhEg2oDmWlwH89HzfJspi6LyoT6Gs66YWVKYdlriH++SbEPrxUBXT agDbouOynxiriaF8nAyJJ2Us9TBQMmlY5VXexNlpt8VtqNjY/PwToG67ipgjiQmesVjC Ne4y3hHbp5QVpr+xjeeb9yHShcB98BWkYbhQlHvNcgnWfG5w/UBd66CJ7i1zO+aYDjWF nnZWcaeMhPlWPDX8F0Sa10gqBwUzRMLs1v46JuskEFXJVw7ZsI6QZXgDb3tnw23wfkb6 lUkreIK71d1ZANrIK+p13hoH+N6Inv9VVFr2MkWaDIZciBNMfrSe0oWJLydDoC3QHFkt dwsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WYnQFcaw3ap4oZ2A12ERkyA+4Jk8IsjUfTaG53eziEU=; b=W8gCRWMlAoK+u7Al/Ew0QTIFRI6klUyI9Ak0te6K3BnyMt5R0YHclrrqL7UBmsXcOr XEtDI7h1cwi+uwN4ICPf9oOUQ50FjHGWCyRE/ZGC3O9PA6LRYTVEnu7n1WcgGklBTnmz AVsYdGDduqjnwZ8LhY9vSyaYmsbTHIbbBzwOyAQlQ/y3WEhr0FFPx5+S1eC+1zo09o7L PL3mzRnLMiVC5VOtA4p6tCYgGeFpbZmT7+mZ+pnDvwyHRNsIMkoNdbwuB5+t+t/bEHNi lpNPpobt45TLLI6O3Od0JxsvV4xm76JnSoEorcAYHwMhvgb6NQoEsEc5LxyveEeDTss1 7X6w== X-Gm-Message-State: AOAM532B9K4kS4d6B//L5jQlmWhyRXaFa+6pW9DbcnSIiOlTnnAg0EmP yT9dkk2NmKczpsxGLWd6XD4bpFWc33uygw== X-Google-Smtp-Source: ABdhPJyxpuEgnBdh1DzAqWs/fGKthehC7DFIsCzb66KONSjSyiKQxPFtX7hBW0CiY7dPYG4rF+EMvQ== X-Received: by 2002:a63:1647:: with SMTP id 7mr2066797pgw.446.1602741537577; Wed, 14 Oct 2020 22:58:57 -0700 (PDT) Received: from [192.168.20.26] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id hg15sm1608294pjb.39.2020.10.14.22.58.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2020 22:58:57 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r366697 - head/usr.bin/xinstall From: Enji Cooper In-Reply-To: <202010141228.09ECSg0D023438@repo.freebsd.org> Date: Wed, 14 Oct 2020 22:58:56 -0700 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <463B3544-BF7B-49FF-82EA-ECB5D8FBB17B@gmail.com> References: <202010141228.09ECSg0D023438@repo.freebsd.org> To: Alex Richardson X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4CBdrg1zDbz42T1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 05:58:59 -0000 > On Oct 14, 2020, at 5:28 AM, Alex Richardson = wrote: >=20 > Author: arichardson > Date: Wed Oct 14 12:28:41 2020 > New Revision: 366697 > URL: https://svnweb.freebsd.org/changeset/base/366697 >=20 > Log: > install(1): Avoid unncessary fstatfs() calls and use mmap() based on = size >=20 > According to git blame the trymmap() function was added in 1996 to = skip > mmap() calls for NFS file systems. However, nowadays mmap() should be > perfectly safe even on NFS. Importantly, onl ufs and cd9660 file = systems > were whitelisted so we don't use mmap() on ZFS. It also prevents the = use > of mmap() when bootstrapping from macOS/Linux since on those systems = the > trymmap() function was always returning zero due to the missing = MFSNAMELEN > define. >=20 > This change keeps the trymmap() function but changes it to check = whether > using mmap() can reduce the number of system calls that are required. > Using mmap() only reduces the number of system calls if we need = multiple read() > syscalls, i.e. if the file size is > MAXBSIZE. However, mmap() is = more expensive > than read() so this sets the threshold at 4 fewer syscalls. = Additionally, for > larger file size mmap() can significantly increase the number of page = faults, > so avoid it in that case. >=20 > It's unclear whether using mmap() is ever faster than a read with an = appropriate > buffer size, but this change at least removes two unnecessary system = calls > for every file that is installed. >=20 > Reviewed By: markj > Differential Revision: https://reviews.freebsd.org/D26041 * Has this change been tested out with source filesystems other = than UFS/ZFS? Not all filesystems support mmap(2). * trymmap(..) seems to be less about computing whether or not = the filesystem should use mmap(2) after this change, but how it should = use mmap(2). Seems like a misnamed function call now. Cheers, -Enji= From owner-svn-src-head@freebsd.org Thu Oct 15 08:15:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B736436DDF; Thu, 15 Oct 2020 08:15:05 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBhsh1DWVz49lR; Thu, 15 Oct 2020 08:15:04 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f66.google.com with SMTP id a3so2264149ejy.11; Thu, 15 Oct 2020 01:15:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LuaJfgIKpVdI7e2BREzIKyWu16PvMdnlzu7OTxr2NuU=; b=Sm8jSZFBr8HuhBJsGhCkXYu6t19uy+YbN/+GfnSyvalImcxK9lC34MawWHAMdpsKik z93k4teifmmGpOePFxCIEzyeSOLCm0Ap3Jyxj0bFkD978Mmz2XGXWS+aSJo5Gv1rJFZK 5SOQK7tqYWtwDPfylP9CX7JDDoZ5QK5P5lzIhDc7ChhF9eG2yAjttTsvP1kcTD6Uud+M guBejWvRF3hSnA8eAEBq8yfCsogkr8mR/pF+oeP9+WCgqqGTvx672x8ajXFVMT48bP8w oa6ZNjeW7ZYgF9FQMlyL/69J5xiVBK5WnUkaQvfU//e3mQ/7PsU8yXIDLuSvbLowODs+ D2gQ== X-Gm-Message-State: AOAM53344jwLJsjN5ElcOuSWXwDZeAYZ+Kyo46aarn8IuFXGkTRXEGUS FG/+FpbMvsmT237hWjoJmO0pY250bm2hSw== X-Google-Smtp-Source: ABdhPJxyXtBGVISUZrWvGRDbITpSzPgscJYEqCp7HO/syXnVkUv+aU2TxxlBohFclcZhzzegQCSELA== X-Received: by 2002:a17:906:3c03:: with SMTP id h3mr645030ejg.78.1602749702391; Thu, 15 Oct 2020 01:15:02 -0700 (PDT) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com. [209.85.128.53]) by smtp.gmail.com with ESMTPSA id j18sm1002345ejc.111.2020.10.15.01.15.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Oct 2020 01:15:02 -0700 (PDT) Received: by mail-wm1-f53.google.com with SMTP id b127so2503226wmb.3; Thu, 15 Oct 2020 01:15:01 -0700 (PDT) X-Received: by 2002:a1c:c28a:: with SMTP id s132mr2667818wmf.67.1602749701737; Thu, 15 Oct 2020 01:15:01 -0700 (PDT) MIME-Version: 1.0 References: <202010141228.09ECSg0D023438@repo.freebsd.org> <463B3544-BF7B-49FF-82EA-ECB5D8FBB17B@gmail.com> In-Reply-To: <463B3544-BF7B-49FF-82EA-ECB5D8FBB17B@gmail.com> From: Alexander Richardson Date: Thu, 15 Oct 2020 09:14:51 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366697 - head/usr.bin/xinstall To: Enji Cooper Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4CBhsh1DWVz49lR X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of arichardsonkde@gmail.com designates 209.85.218.66 as permitted sender) smtp.mailfrom=arichardsonkde@gmail.com X-Spamd-Result: default: False [-2.02 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[arichardson@freebsd.org,arichardsonkde@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-0.996]; RWL_MAILSPIKE_GOOD(0.00)[209.85.218.66:from]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.32)[-0.323]; RCVD_IN_DNSWL_NONE(0.00)[209.85.218.66:from]; NEURAL_HAM_MEDIUM(-0.70)[-0.698]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[arichardson@freebsd.org,arichardsonkde@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 08:15:05 -0000 On Thu, 15 Oct 2020 at 06:59, Enji Cooper wrote: > > > > On Oct 14, 2020, at 5:28 AM, Alex Richardson wrote: > > > > Author: arichardson > > Date: Wed Oct 14 12:28:41 2020 > > New Revision: 366697 > > URL: https://svnweb.freebsd.org/changeset/base/366697 > > > > Log: > > install(1): Avoid unncessary fstatfs() calls and use mmap() based on size > > > > According to git blame the trymmap() function was added in 1996 to skip > > mmap() calls for NFS file systems. However, nowadays mmap() should be > > perfectly safe even on NFS. Importantly, onl ufs and cd9660 file systems > > were whitelisted so we don't use mmap() on ZFS. It also prevents the use > > of mmap() when bootstrapping from macOS/Linux since on those systems the > > trymmap() function was always returning zero due to the missing MFSNAMELEN > > define. > > > > This change keeps the trymmap() function but changes it to check whether > > using mmap() can reduce the number of system calls that are required. > > Using mmap() only reduces the number of system calls if we need multiple read() > > syscalls, i.e. if the file size is > MAXBSIZE. However, mmap() is more expensive > > than read() so this sets the threshold at 4 fewer syscalls. Additionally, for > > larger file size mmap() can significantly increase the number of page faults, > > so avoid it in that case. > > > > It's unclear whether using mmap() is ever faster than a read with an appropriate > > buffer size, but this change at least removes two unnecessary system calls > > for every file that is installed. > > > > Reviewed By: markj > > Differential Revision: https://reviews.freebsd.org/D26041 > > * Has this change been tested out with source filesystems other than UFS/ZFS? Not all filesystems support mmap(2). I've used ext4 and afps, but it doesn't matter since there's a fallback. > * trymmap(..) seems to be less about computing whether or not the filesystem should use mmap(2) after this change, but how it should use mmap(2). Seems like a misnamed function call now. There was always fallback code in case mmap fails: https://github.com/freebsd/freebsd/blob/8349de39d23fc152c3782ee3b9eeab3df4610944/usr.bin/xinstall/xinstall.c#L1253 and https://github.com/freebsd/freebsd/blob/8349de39d23fc152c3782ee3b9eeab3df4610944/usr.bin/xinstall/xinstall.c#L1253 so it is really "should I try to use mmap()". Alex From owner-svn-src-head@freebsd.org Thu Oct 15 11:44:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF9E343B07E; Thu, 15 Oct 2020 11:44:28 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBnWJ57y3z4NqR; Thu, 15 Oct 2020 11:44:28 +0000 (UTC) (envelope-from whu@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 93E271F076; Thu, 15 Oct 2020 11:44:28 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09FBiSFj088173; Thu, 15 Oct 2020 11:44:28 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FBiSNV088172; Thu, 15 Oct 2020 11:44:28 GMT (envelope-from whu@FreeBSD.org) Message-Id: <202010151144.09FBiSNV088172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Thu, 15 Oct 2020 11:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366721 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: whu X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 366721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 11:44:28 -0000 Author: whu Date: Thu Oct 15 11:44:28 2020 New Revision: 366721 URL: https://svnweb.freebsd.org/changeset/base/366721 Log: Hyper-V: hn: Relinquish cpu in HN_LOCK to avoid deadlock The try lock loop in HN_LOCK put the thread spinning on cpu if the lock is not available. It is possible to cause deadlock if the thread holding the lock is sleeping. Relinquish the cpu to work around this problem even it doesn't completely solve the issue. The priority inversion could cause the livelock no matter how less likely it could happen. A more complete solution may be needed in the future. Reported by: Microsoft, Netapp MFC after: 2 weeks Sponsored by: Microsoft Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Thu Oct 15 05:57:20 2020 (r366720) +++ head/sys/dev/hyperv/netvsc/if_hn.c Thu Oct 15 11:44:28 2020 (r366721) @@ -71,8 +71,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include @@ -165,8 +167,11 @@ __FBSDID("$FreeBSD$"); #define HN_LOCK_ASSERT(sc) sx_assert(&(sc)->hn_lock, SA_XLOCKED) #define HN_LOCK(sc) \ do { \ - while (sx_try_xlock(&(sc)->hn_lock) == 0) \ + while (sx_try_xlock(&(sc)->hn_lock) == 0) { \ + /* Relinquish cpu to avoid deadlock */ \ + sched_relinquish(curthread); \ DELAY(1000); \ + } \ } while (0) #define HN_UNLOCK(sc) sx_xunlock(&(sc)->hn_lock) From owner-svn-src-head@freebsd.org Thu Oct 15 12:48:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7667F43DEC6; Thu, 15 Oct 2020 12:48:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBpxC2Wg1z4SDk; Thu, 15 Oct 2020 12:48:31 +0000 (UTC) (envelope-from trasz@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 3AAFB1F679; Thu, 15 Oct 2020 12:48:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09FCmVOv025002; Thu, 15 Oct 2020 12:48:31 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FCmVQd025001; Thu, 15 Oct 2020 12:48:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010151248.09FCmVQd025001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 15 Oct 2020 12:48:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366722 - head/sys/compat/linprocfs X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linprocfs X-SVN-Commit-Revision: 366722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 12:48:31 -0000 Author: trasz Date: Thu Oct 15 12:48:30 2020 New Revision: 366722 URL: https://svnweb.freebsd.org/changeset/base/366722 Log: With some popular multiplayer games (such as Counter-Strike: Global Offensive) the Linux Steam client likes to occasionally scan the game process memory, presumably as part anti-cheat measures. Turns out the client also expects each inode entry to be followed by a space character, otherwise the parsing code crashes. PR: 248216 Submitted by: Alex S MFC after: 2 weeks Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Thu Oct 15 11:44:28 2020 (r366721) +++ head/sys/compat/linprocfs/linprocfs.c Thu Oct 15 12:48:30 2020 (r366722) @@ -1249,7 +1249,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) 0, 0, (u_long)ino, - *name ? " " : "", + *name ? " " : " ", name ); if (freename) From owner-svn-src-head@freebsd.org Thu Oct 15 13:43:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E469243F152; Thu, 15 Oct 2020 13:43:43 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBr8v5YZSz4W39; Thu, 15 Oct 2020 13:43:43 +0000 (UTC) (envelope-from nwhitehorn@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 A216E207B3; Thu, 15 Oct 2020 13:43:43 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09FDhhMu061770; Thu, 15 Oct 2020 13:43:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FDhhTM061769; Thu, 15 Oct 2020 13:43:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <202010151343.09FDhhTM061769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Thu, 15 Oct 2020 13:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366723 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 366723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 13:43:44 -0000 Author: nwhitehorn Date: Thu Oct 15 13:43:43 2020 New Revision: 366723 URL: https://svnweb.freebsd.org/changeset/base/366723 Log: Provide a slightly more-tolerant set of thermal parameters for PowerMac motherboard temperatures. In particular, the U4 northbridge die is very hard to cool or heat effectively with fans and is not responsive to load. It generally sits around 64C, where it seems happy, so (like Linux) just declare that to be its target temperature. This makes the PowerMac G5 much less loud, with no change in the temperatures of any system components. MFC after: 2 weeks Modified: head/sys/dev/iicbus/max6690.c Modified: head/sys/dev/iicbus/max6690.c ============================================================================== --- head/sys/dev/iicbus/max6690.c Thu Oct 15 12:48:30 2020 (r366722) +++ head/sys/dev/iicbus/max6690.c Thu Oct 15 13:43:43 2020 (r366723) @@ -213,8 +213,17 @@ max6690_fill_sensor_prop(device_t dev) for (j = 0; j < i; j++) { sc->sc_sensors[j].dev = dev; - sc->sc_sensors[j].therm.target_temp = 400 + ZERO_C_TO_K; - sc->sc_sensors[j].therm.max_temp = 800 + ZERO_C_TO_K; + /* + * Target value for "KODIAK DIODE" (= northbridge die) should + * be 64C (value from Linux). It operates fine at that + * temperature and has limited responsivity to the fan aimed at + * it, so no point in trying to cool it to 40C. + */ + if (strcmp(sc->sc_sensors[j].therm.name, "KODIAK DIODE") == 0) + sc->sc_sensors[j].therm.target_temp = 640 + ZERO_C_TO_K; + else + sc->sc_sensors[j].therm.target_temp = 400 + ZERO_C_TO_K; + sc->sc_sensors[j].therm.max_temp = 850 + ZERO_C_TO_K; sc->sc_sensors[j].therm.read = (int (*)(struct pmac_therm *))(max6690_sensor_read); From owner-svn-src-head@freebsd.org Thu Oct 15 13:47:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6756443F39B; Thu, 15 Oct 2020 13:47:53 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBrFj1Bd4z4W92; Thu, 15 Oct 2020 13:47:53 +0000 (UTC) (envelope-from br@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 0CDD9205A8; Thu, 15 Oct 2020 13:47:53 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09FDlqdP062016; Thu, 15 Oct 2020 13:47:52 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FDlqpm062010; Thu, 15 Oct 2020 13:47:52 GMT (envelope-from br@FreeBSD.org) Message-Id: <202010151347.09FDlqpm062010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 15 Oct 2020 13:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366724 - head/sys/dev/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/iommu X-SVN-Commit-Revision: 366724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 13:47:53 -0000 Author: br Date: Thu Oct 15 13:47:52 2020 New Revision: 366724 URL: https://svnweb.freebsd.org/changeset/base/366724 Log: Split-out Guest Address Space (GAS) macroses to a separate header. Sponsored by: Innovate DSbD Added: head/sys/dev/iommu/iommu_gas.h (contents, props changed) Modified: head/sys/dev/iommu/busdma_iommu.h head/sys/dev/iommu/iommu.h head/sys/dev/iommu/iommu_gas.c Modified: head/sys/dev/iommu/busdma_iommu.h ============================================================================== --- head/sys/dev/iommu/busdma_iommu.h Thu Oct 15 13:43:43 2020 (r366723) +++ head/sys/dev/iommu/busdma_iommu.h Thu Oct 15 13:47:52 2020 (r366724) @@ -35,6 +35,7 @@ #define __X86_IOMMU_BUSDMA_DMAR_H #include +#include struct bus_dma_tag_iommu { struct bus_dma_tag_common common; Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Thu Oct 15 13:43:43 2020 (r366723) +++ head/sys/dev/iommu/iommu.h Thu Oct 15 13:47:52 2020 (r366724) @@ -65,18 +65,6 @@ struct iommu_map_entry { struct iommu_qi_genseq gseq; }; -#define IOMMU_MAP_ENTRY_PLACE 0x0001 /* Fake entry */ -#define IOMMU_MAP_ENTRY_RMRR 0x0002 /* Permanent, not linked by - dmamap_link */ -#define IOMMU_MAP_ENTRY_MAP 0x0004 /* Busdma created, linked by - dmamap_link */ -#define IOMMU_MAP_ENTRY_UNMAPPED 0x0010 /* No backing pages */ -#define IOMMU_MAP_ENTRY_QI_NF 0x0020 /* qi task, do not free entry */ -#define IOMMU_MAP_ENTRY_READ 0x1000 /* Read permitted */ -#define IOMMU_MAP_ENTRY_WRITE 0x2000 /* Write permitted */ -#define IOMMU_MAP_ENTRY_SNOOP 0x4000 /* Snoop */ -#define IOMMU_MAP_ENTRY_TM 0x8000 /* Transient */ - struct iommu_unit { struct mtx lock; int unit; @@ -148,17 +136,6 @@ struct iommu_ctx { page table */ #define IOMMU_DOMAIN_RMRR 0x0020 /* Domain contains RMRR entry, cannot be turned off */ - -/* Map flags */ -#define IOMMU_MF_CANWAIT 0x0001 -#define IOMMU_MF_CANSPLIT 0x0002 -#define IOMMU_MF_RMRR 0x0004 - -#define IOMMU_PGF_WAITOK 0x0001 -#define IOMMU_PGF_ZERO 0x0002 -#define IOMMU_PGF_ALLOC 0x0004 -#define IOMMU_PGF_NOALLOC 0x0008 -#define IOMMU_PGF_OBJL 0x0010 #define IOMMU_LOCK(unit) mtx_lock(&(unit)->lock) #define IOMMU_UNLOCK(unit) mtx_unlock(&(unit)->lock) Modified: head/sys/dev/iommu/iommu_gas.c ============================================================================== --- head/sys/dev/iommu/iommu_gas.c Thu Oct 15 13:43:43 2020 (r366723) +++ head/sys/dev/iommu/iommu_gas.c Thu Oct 15 13:47:52 2020 (r366724) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Added: head/sys/dev/iommu/iommu_gas.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iommu/iommu_gas.h Thu Oct 15 13:47:52 2020 (r366724) @@ -0,0 +1,60 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_IOMMU_IOMMU_GAS_H_ +#define _DEV_IOMMU_IOMMU_GAS_H_ + +/* Map flags */ +#define IOMMU_MF_CANWAIT 0x0001 +#define IOMMU_MF_CANSPLIT 0x0002 +#define IOMMU_MF_RMRR 0x0004 + +#define IOMMU_PGF_WAITOK 0x0001 +#define IOMMU_PGF_ZERO 0x0002 +#define IOMMU_PGF_ALLOC 0x0004 +#define IOMMU_PGF_NOALLOC 0x0008 +#define IOMMU_PGF_OBJL 0x0010 + +#define IOMMU_MAP_ENTRY_PLACE 0x0001 /* Fake entry */ +#define IOMMU_MAP_ENTRY_RMRR 0x0002 /* Permanent, not linked by + dmamap_link */ +#define IOMMU_MAP_ENTRY_MAP 0x0004 /* Busdma created, linked by + dmamap_link */ +#define IOMMU_MAP_ENTRY_UNMAPPED 0x0010 /* No backing pages */ +#define IOMMU_MAP_ENTRY_QI_NF 0x0020 /* qi task, do not free entry */ +#define IOMMU_MAP_ENTRY_READ 0x1000 /* Read permitted */ +#define IOMMU_MAP_ENTRY_WRITE 0x2000 /* Write permitted */ +#define IOMMU_MAP_ENTRY_SNOOP 0x4000 /* Snoop */ +#define IOMMU_MAP_ENTRY_TM 0x8000 /* Transient */ + +#endif /* !_DEV_IOMMU_IOMMU_GAS_H_ */ From owner-svn-src-head@freebsd.org Thu Oct 15 14:17:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2F4B43FCC5; Thu, 15 Oct 2020 14:17:45 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBrw94P5pz4XrZ; Thu, 15 Oct 2020 14:17:45 +0000 (UTC) (envelope-from 0mp@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 7B23620ACE; Thu, 15 Oct 2020 14:17:45 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09FEHjEc080475; Thu, 15 Oct 2020 14:17:45 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FEHjjq080474; Thu, 15 Oct 2020 14:17:45 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202010151417.09FEHjjq080474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 15 Oct 2020 14:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366725 - head/lib/geom/eli X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/lib/geom/eli X-SVN-Commit-Revision: 366725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 14:17:45 -0000 Author: 0mp (doc,ports committer) Date: Thu Oct 15 14:17:45 2020 New Revision: 366725 URL: https://svnweb.freebsd.org/changeset/base/366725 Log: Fix formatting of SYNOPSIS There was an unnecessary newline being added before Nm. MFC after: 3 days Modified: head/lib/geom/eli/geli.8 Modified: head/lib/geom/eli/geli.8 ============================================================================== --- head/lib/geom/eli/geli.8 Thu Oct 15 13:47:52 2020 (r366724) +++ head/lib/geom/eli/geli.8 Thu Oct 15 14:17:45 2020 (r366725) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 22, 2020 +.Dd October 15, 2020 .Dt GELI 8 .Os .Sh NAME @@ -45,8 +45,7 @@ to your geom_eli_load="YES" .Ed .Pp -Usage of the -.Nm +.No Usage of the Nm utility: .Pp .Nm From owner-svn-src-head@freebsd.org Thu Oct 15 14:37:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 97B8943FEE9; Thu, 15 Oct 2020 14:37:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBsMN3YSkz4YZM; Thu, 15 Oct 2020 14:37:52 +0000 (UTC) (envelope-from emaste@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 5E2A820D6B; Thu, 15 Oct 2020 14:37:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09FEbqZ2092719; Thu, 15 Oct 2020 14:37:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FEbpVD092716; Thu, 15 Oct 2020 14:37:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202010151437.09FEbpVD092716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 15 Oct 2020 14:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366726 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 366726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 14:37:52 -0000 Author: emaste Date: Thu Oct 15 14:37:51 2020 New Revision: 366726 URL: https://svnweb.freebsd.org/changeset/base/366726 Log: move vmware pv drivers to sys/conf/files VMware now has arm64 support; move these to MI files in advance of building them on arm64. PR: 250308 Reported by: Vincent Milum Jr MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.i386 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Oct 15 14:17:45 2020 (r366725) +++ head/sys/conf/files Thu Oct 15 14:37:51 2020 (r366726) @@ -3455,6 +3455,18 @@ dev/virtio/random/virtio_random.c optional virtio_rand dev/virtio/console/virtio_console.c optional virtio_console dev/vkbd/vkbd.c optional vkbd dev/vmgenc/vmgenc_acpi.c optional acpi +dev/vmware/vmxnet3/if_vmx.c optional vmx +dev/vmware/vmci/vmci.c optional vmci +dev/vmware/vmci/vmci_datagram.c optional vmci +dev/vmware/vmci/vmci_doorbell.c optional vmci +dev/vmware/vmci/vmci_driver.c optional vmci +dev/vmware/vmci/vmci_event.c optional vmci +dev/vmware/vmci/vmci_hashtable.c optional vmci +dev/vmware/vmci/vmci_kernel_if.c optional vmci +dev/vmware/vmci/vmci_qpair.c optional vmci +dev/vmware/vmci/vmci_queue_pair.c optional vmci +dev/vmware/vmci/vmci_resource.c optional vmci +dev/vmware/pvscsi/pvscsi.c optional pvscsi dev/vr/if_vr.c optional vr pci dev/vt/colors/vt_termcolors.c optional vt dev/vt/font/vt_font_default.c optional vt Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Oct 15 14:17:45 2020 (r366725) +++ head/sys/conf/files.amd64 Thu Oct 15 14:37:51 2020 (r366726) @@ -378,18 +378,6 @@ dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_x86.c optional uart dev/viawd/viawd.c optional viawd -dev/vmware/vmxnet3/if_vmx.c optional vmx -dev/vmware/vmci/vmci.c optional vmci -dev/vmware/vmci/vmci_datagram.c optional vmci -dev/vmware/vmci/vmci_doorbell.c optional vmci -dev/vmware/vmci/vmci_driver.c optional vmci -dev/vmware/vmci/vmci_event.c optional vmci -dev/vmware/vmci/vmci_hashtable.c optional vmci -dev/vmware/vmci/vmci_kernel_if.c optional vmci -dev/vmware/vmci/vmci_qpair.c optional vmci -dev/vmware/vmci/vmci_queue_pair.c optional vmci -dev/vmware/vmci/vmci_resource.c optional vmci -dev/vmware/pvscsi/pvscsi.c optional pvscsi dev/vmd/vmd.c optional vmd dev/vmd/vmd_bus.c optional vmd_bus dev/wbwd/wbwd.c optional wbwd Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Oct 15 14:17:45 2020 (r366725) +++ head/sys/conf/files.i386 Thu Oct 15 14:37:51 2020 (r366726) @@ -126,18 +126,6 @@ dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_x86.c optional uart dev/viawd/viawd.c optional viawd -dev/vmware/vmxnet3/if_vmx.c optional vmx -dev/vmware/vmci/vmci.c optional vmci -dev/vmware/vmci/vmci_datagram.c optional vmci -dev/vmware/vmci/vmci_doorbell.c optional vmci -dev/vmware/vmci/vmci_driver.c optional vmci -dev/vmware/vmci/vmci_event.c optional vmci -dev/vmware/vmci/vmci_hashtable.c optional vmci -dev/vmware/vmci/vmci_kernel_if.c optional vmci -dev/vmware/vmci/vmci_qpair.c optional vmci -dev/vmware/vmci/vmci_queue_pair.c optional vmci -dev/vmware/vmci/vmci_resource.c optional vmci -dev/vmware/pvscsi/pvscsi.c optional pvscsi dev/acpi_support/acpi_wmi_if.m standard dev/wbwd/wbwd.c optional wbwd i386/acpica/acpi_machdep.c optional acpi From owner-svn-src-head@freebsd.org Thu Oct 15 14:47:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1D9144088F; Thu, 15 Oct 2020 14:47:38 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBsZf4Wrnz4ZDK; Thu, 15 Oct 2020 14:47:38 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p4fd3a1f5.dip0.t-ipconnect.de [79.211.161.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id 3A9C62D20F; Thu, 15 Oct 2020 14:47:38 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Thu, 15 Oct 2020 16:47:35 +0200 From: Gordon Bergling To: Mateusz Piotrowski <0mp@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366725 - head/lib/geom/eli Message-ID: <20201015144735.GA33346@lion.0xfce3.net> References: <202010151417.09FEHjjq080474@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010151417.09FEHjjq080474@repo.freebsd.org> X-Url: X-Operating-System: FreeBSD 12.2-STABLE amd64 X-Host-Uptime: 4:34PM up 22:26, 4 users, load averages: 0.38, 0.44, 0.48 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 14:47:38 -0000 Hi Mateusz, On Thu, Oct 15, 2020 at 02:17:45PM +0000, Mateusz Piotrowski wrote: > Author: 0mp (doc,ports committer) > Date: Thu Oct 15 14:17:45 2020 > New Revision: 366725 > URL: https://svnweb.freebsd.org/changeset/base/366725 > > Log: > Fix formatting of SYNOPSIS > > There was an unnecessary newline being added before Nm. > > MFC after: 3 days > > Modified: > head/lib/geom/eli/geli.8 > > Modified: head/lib/geom/eli/geli.8 > ============================================================================== > --- head/lib/geom/eli/geli.8 Thu Oct 15 13:47:52 2020 (r366724) > +++ head/lib/geom/eli/geli.8 Thu Oct 15 14:17:45 2020 (r366725) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 22, 2020 > +.Dd October 15, 2020 > .Dt GELI 8 > .Os > .Sh NAME > @@ -45,8 +45,7 @@ to your > geom_eli_load="YES" > .Ed > .Pp > -Usage of the > -.Nm > +.No Usage of the Nm > utility: > .Pp > .Nm The formatting of the SYNOPSIS was correct before this change. It's a common practice in man pages to use The .Nm utility ... Your change is looking somewhat strange, since ".No Usage of the Nm" reads like the man page would renders "Nm", since it is not used as macro. A .Dd bump is also not necessary since no user visible changes were made to the man page. -- Gordon From owner-svn-src-head@freebsd.org Thu Oct 15 14:55:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8456044085B; Thu, 15 Oct 2020 14:55:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBslJ2wRcz4Zfg; Thu, 15 Oct 2020 14:55:08 +0000 (UTC) (envelope-from adrian@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 48E6421521; Thu, 15 Oct 2020 14:55:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09FEt8YW004987; Thu, 15 Oct 2020 14:55:08 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FEt8Ec004986; Thu, 15 Oct 2020 14:55:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202010151455.09FEt8Ec004986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 15 Oct 2020 14:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366727 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libc/sys X-SVN-Commit-Revision: 366727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 14:55:08 -0000 Author: adrian Date: Thu Oct 15 14:55:07 2020 New Revision: 366727 URL: https://svnweb.freebsd.org/changeset/base/366727 Log: [tests] Fix itimer test warning-errors on gcc-6.4 This fixes a "suggested parens" compile warning-into-error that shows up on gcc-6.4. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D26789 Modified: head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c Thu Oct 15 14:37:51 2020 (r366726) +++ head/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c Thu Oct 15 14:55:07 2020 (r366727) @@ -195,8 +195,8 @@ ATF_TC_BODY(setitimer_old, tc) ATF_REQUIRE(setitimer(ITIMER_REAL, &it, &ot) == 0); #ifdef __FreeBSD__ - ATF_REQUIRE_MSG(ot.it_value.tv_sec < 4 || - ot.it_value.tv_sec == 4 && ot.it_value.tv_usec <= 3, + ATF_REQUIRE_MSG((ot.it_value.tv_sec < 4) || + (ot.it_value.tv_sec == 4 && ot.it_value.tv_usec <= 3), "setitimer(2) returned invalid it_value: %jd %jd", (intmax_t)ot.it_value.tv_sec, (intmax_t)ot.it_value.tv_usec); #else From owner-svn-src-head@freebsd.org Thu Oct 15 14:56:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FBAC440B62; Thu, 15 Oct 2020 14:56:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBsnJ1sqhz4b13; Thu, 15 Oct 2020 14:56:52 +0000 (UTC) (envelope-from adrian@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 249D5212B3; Thu, 15 Oct 2020 14:56:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09FEuqmI005109; Thu, 15 Oct 2020 14:56:52 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FEuqKV005108; Thu, 15 Oct 2020 14:56:52 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202010151456.09FEuqKV005108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 15 Oct 2020 14:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366728 - head/sbin/pfctl/tests X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sbin/pfctl/tests X-SVN-Commit-Revision: 366728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 14:56:52 -0000 Author: adrian Date: Thu Oct 15 14:56:51 2020 New Revision: 366728 URL: https://svnweb.freebsd.org/changeset/base/366728 Log: [pfctl_tests] Add missing void to empty function declaration Our gcc-6.4 flags require non-empty function declarations. Fix this to match the rest of the codebase. Tested: * compiled on gcc-6.4 for amd64 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D26795 Modified: head/sbin/pfctl/tests/pfctl_test.c Modified: head/sbin/pfctl/tests/pfctl_test.c ============================================================================== --- head/sbin/pfctl/tests/pfctl_test.c Thu Oct 15 14:55:07 2020 (r366727) +++ head/sbin/pfctl/tests/pfctl_test.c Thu Oct 15 14:56:51 2020 (r366728) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); */ static bool -check_pf_module_available() +check_pf_module_available(void) { int modid; struct module_stat stat; From owner-svn-src-head@freebsd.org Thu Oct 15 15:36:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9706B44117A; Thu, 15 Oct 2020 15:36:09 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBtfd3Wbmz4d2t; Thu, 15 Oct 2020 15:36:09 +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 57B3F21BA6; Thu, 15 Oct 2020 15:36:09 +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 09FFa9ur029903; Thu, 15 Oct 2020 15:36:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FFa90a029902; Thu, 15 Oct 2020 15:36:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010151536.09FFa90a029902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 15 Oct 2020 15:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366730 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 366730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 15:36:09 -0000 Author: mav Date: Thu Oct 15 15:36:08 2020 New Revision: 366730 URL: https://svnweb.freebsd.org/changeset/base/366730 Log: Fix nvmecontrol logpage -i parameter. MFC after: 3 days Modified: head/sbin/nvmecontrol/logpage.c Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Thu Oct 15 15:07:25 2020 (r366729) +++ head/sbin/nvmecontrol/logpage.c Thu Oct 15 15:36:08 2020 (r366730) @@ -84,7 +84,7 @@ static const struct opts logpage_opts[] = { "Page to dump"), OPT("lsp", 'f', arg_uint8, opt, lsp, "Log Specific Field"), - OPT("lsi", 'i', arg_uint16, opt, lsp, + OPT("lsi", 'i', arg_uint16, opt, lsi, "Log Specific Identifier"), OPT("rae", 'r', arg_none, opt, rae, "Retain Asynchronous Event"), From owner-svn-src-head@freebsd.org Thu Oct 15 17:05:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87E9C442DA6; Thu, 15 Oct 2020 17:05:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBwdZ361Nz3TCQ; Thu, 15 Oct 2020 17:05:22 +0000 (UTC) (envelope-from brooks@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 49AFD228C3; Thu, 15 Oct 2020 17:05:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09FH5MuQ085085; Thu, 15 Oct 2020 17:05:22 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FH5MW7085084; Thu, 15 Oct 2020 17:05:22 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202010151705.09FH5MW7085084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 15 Oct 2020 17:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366731 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 17:05:22 -0000 Author: brooks Date: Thu Oct 15 17:05:21 2020 New Revision: 366731 URL: https://svnweb.freebsd.org/changeset/base/366731 Log: physio: Don't store user addresses in bio_data Only assign the address from the iovec to bio_data if it is a kernel address. This was the single place where bio_data stored (however briefly) a userspace pointer. Reviewed by: imp, markj Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26783 Modified: head/sys/kern/kern_physio.c Modified: head/sys/kern/kern_physio.c ============================================================================== --- head/sys/kern/kern_physio.c Thu Oct 15 15:36:08 2020 (r366730) +++ head/sys/kern/kern_physio.c Thu Oct 15 17:05:21 2020 (r366731) @@ -45,7 +45,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) struct buf *pbuf; struct bio *bp; struct vm_page **pages; - caddr_t sa; + char *base, *sa; u_int iolen, poff; int error, i, npages, maxpages; vm_prot_t prot; @@ -140,7 +140,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) curthread->td_ru.ru_oublock++; } bp->bio_offset = uio->uio_offset; - bp->bio_data = uio->uio_iov[i].iov_base; + base = uio->uio_iov[i].iov_base; bp->bio_length = uio->uio_iov[i].iov_len; if (bp->bio_length > dev->si_iosize_max) bp->bio_length = dev->si_iosize_max; @@ -153,13 +153,13 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) * larger than MAXPHYS - PAGE_SIZE must be * page aligned or it will be fragmented. */ - poff = (vm_offset_t)bp->bio_data & PAGE_MASK; + poff = (vm_offset_t)base & PAGE_MASK; if (pbuf && bp->bio_length + poff > pbuf->b_kvasize) { if (dev->si_flags & SI_NOSPLIT) { uprintf("%s: request ptr %p is not " "on a page boundary; cannot split " "request\n", devtoname(dev), - bp->bio_data); + base); error = EFBIG; goto doerror; } @@ -174,7 +174,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) if (pages) { if ((npages = vm_fault_quick_hold_pages( &curproc->p_vmspace->vm_map, - (vm_offset_t)bp->bio_data, bp->bio_length, + (vm_offset_t)base, bp->bio_length, prot, pages, maxpages)) < 0) { error = EFAULT; goto doerror; @@ -190,7 +190,8 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) bp->bio_data = unmapped_buf; bp->bio_flags |= BIO_UNMAPPED; } - } + } else + bp->bio_data = base; csw->d_strategy(bp); if (uio->uio_rw == UIO_READ) From owner-svn-src-head@freebsd.org Thu Oct 15 17:12:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C5B74430B5; Thu, 15 Oct 2020 17:12:59 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBwpM2ddFz3TW0; Thu, 15 Oct 2020 17:12:59 +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 3DB4322BC5; Thu, 15 Oct 2020 17:12:59 +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 09FHCx6O091242; Thu, 15 Oct 2020 17:12:59 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FHCwA8091241; Thu, 15 Oct 2020 17:12:58 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202010151712.09FHCwA8091241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 15 Oct 2020 17:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366732 - in head/release: amd64 arm64 X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in head/release: amd64 arm64 X-SVN-Commit-Revision: 366732 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 17:12:59 -0000 Author: gjb Date: Thu Oct 15 17:12:58 2020 New Revision: 366732 URL: https://svnweb.freebsd.org/changeset/base/366732 Log: Increase the amd64 ISO ESP file size from 800KB to 1024KB. At some poing over the last week, the bootx64.efi file has grown past the 800KB threshold, resulting in being unable to copy it to the EFI/BOOT directory. # stat -f %z efiboot.znWo7m 819200 # stat -f %z stand-test.PIEugN/EFI/BOOT/bootx64.efi 842752 The comment in the script that creates the ISOs suggests that 800KB is the maximum allowed for the boot code, however I was able to boot an ISO with a 1024KB boot partition. Additionally, I verified against an ISO from OtherOS, where the boot EFI partition is 2.4MB. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/release/amd64/mkisoimages.sh head/release/arm64/mkisoimages.sh Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Thu Oct 15 17:05:21 2020 (r366731) +++ head/release/amd64/mkisoimages.sh Thu Oct 15 17:12:58 2020 (r366732) @@ -46,10 +46,10 @@ if [ "$1" = "-b" ]; then bootable="-o bootimage=i386;$BASEBITSDIR/boot/cdboot -o no-emul-boot" # Make EFI system partition. - # The ISO file is a special case, in that it only has a maximum of - # 800 KB available for the boot code. So make an 800 KB ESP espfilename=$(mktemp /tmp/efiboot.XXXXXX) - make_esp_file ${espfilename} 800 ${BASEBITSDIR}/boot/loader.efi + # ESP file size in KB. + espsize="1024" + make_esp_file ${espfilename} ${espsize} ${BASEBITSDIR}/boot/loader.efi bootable="$bootable -o bootimage=i386;${espfilename} -o no-emul-boot -o platformid=efi" shift Modified: head/release/arm64/mkisoimages.sh ============================================================================== --- head/release/arm64/mkisoimages.sh Thu Oct 15 17:05:21 2020 (r366731) +++ head/release/arm64/mkisoimages.sh Thu Oct 15 17:12:58 2020 (r366732) @@ -40,10 +40,10 @@ if [ "$1" = "-b" ]; then BASEBITSDIR="$4" # Make an EFI system partition. - # The ISO file is a special case, in that it only has a maximum of - # 800 KB available for the boot code. So make an 800 KB ESP espfilename=$(mktemp /tmp/efiboot.XXXXXX) - make_esp_file ${espfilename} 800 ${BASEBITSDIR}/boot/loader.efi + # ESP file size in KB. + espsize="1024" + make_esp_file ${espfilename} ${espsize} ${BASEBITSDIR}/boot/loader.efi bootable="-o bootimage=efi;${espfilename} -o no-emul-boot -o platformid=efi" From owner-svn-src-head@freebsd.org Thu Oct 15 17:40:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07C7744347C; Thu, 15 Oct 2020 17:40:03 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBxPZ6RK0z3WMn; Thu, 15 Oct 2020 17:40:02 +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 BCDD122C76; Thu, 15 Oct 2020 17:40:02 +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 09FHe2G0006697; Thu, 15 Oct 2020 17:40:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FHe2KM006696; Thu, 15 Oct 2020 17:40:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202010151740.09FHe2KM006696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 15 Oct 2020 17:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366733 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 366733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 17:40:03 -0000 Author: mav Date: Thu Oct 15 17:40:02 2020 New Revision: 366733 URL: https://svnweb.freebsd.org/changeset/base/366733 Log: Drop unsolicited responses to the still attaching CODECs. It is reported to fix kernel panics when early unsolicited responses delivered to the CODEC device not having driver attached yet. PR: 250248 Reported by: Rajeev Pillai Reviewed by: avg MFC after: 2 weeks Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Thu Oct 15 17:12:58 2020 (r366732) +++ head/sys/dev/sound/pci/hda/hdac.c Thu Oct 15 17:40:02 2020 (r366733) @@ -990,7 +990,8 @@ hdac_unsolq_flush(struct hdac_softc *sc) sc->unsolq_rp %= HDAC_UNSOLQ_MAX; cad = sc->unsolq[sc->unsolq_rp++]; sc->unsolq_rp %= HDAC_UNSOLQ_MAX; - if ((child = sc->codecs[cad].dev) != NULL) + if ((child = sc->codecs[cad].dev) != NULL && + device_is_attached(child)) HDAC_UNSOL_INTR(child, resp); ret++; } From owner-svn-src-head@freebsd.org Thu Oct 15 17:42:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03795443D84; Thu, 15 Oct 2020 17:42:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBxSG5xnSz3X09; Thu, 15 Oct 2020 17:42:22 +0000 (UTC) (envelope-from mjg@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 AFAAF2350E; Thu, 15 Oct 2020 17:42:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09FHgMlC012787; Thu, 15 Oct 2020 17:42:22 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FHgMfe012786; Thu, 15 Oct 2020 17:42:22 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010151742.09FHgMfe012786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 15 Oct 2020 17:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366734 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 17:42:23 -0000 Author: mjg Date: Thu Oct 15 17:42:22 2020 New Revision: 366734 URL: https://svnweb.freebsd.org/changeset/base/366734 Log: cache: make neglist an array given the static size Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Oct 15 17:40:02 2020 (r366733) +++ head/sys/kern/vfs_cache.c Thu Oct 15 17:42:22 2020 (r366734) @@ -305,17 +305,18 @@ SYSCTL_BOOL(_vfs, OID_AUTO, cache_fast_revlookup, CTLF static struct mtx __exclusive_cache_line ncneg_shrink_lock; +#define ncneghash 3 +#define numneglists (ncneghash + 1) + struct neglist { struct mtx nl_lock; TAILQ_HEAD(, namecache) nl_list; } __aligned(CACHE_LINE_SIZE); -static struct neglist __read_mostly *neglists; +static struct neglist neglists[numneglists]; static struct neglist ncneg_hot; static u_long numhotneg; -#define ncneghash 3 -#define numneglists (ncneghash + 1) static inline struct neglist * NCP2NEGLIST(struct namecache *ncp) { @@ -2091,8 +2092,6 @@ nchinit(void *dummy __unused) for (i = 0; i < numvnodelocks; i++) mtx_init(&vnodelocks[i], "ncvn", NULL, MTX_DUPOK | MTX_RECURSE); - neglists = malloc(sizeof(*neglists) * numneglists, M_VFSCACHE, - M_WAITOK | M_ZERO); for (i = 0; i < numneglists; i++) { mtx_init(&neglists[i].nl_lock, "ncnegl", NULL, MTX_DEF); TAILQ_INIT(&neglists[i].nl_list); From owner-svn-src-head@freebsd.org Thu Oct 15 17:44:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82E46443751; Thu, 15 Oct 2020 17:44:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBxVV2qRpz3XDd; Thu, 15 Oct 2020 17:44:18 +0000 (UTC) (envelope-from mjg@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 442CD2349F; Thu, 15 Oct 2020 17:44:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09FHiIvi013130; Thu, 15 Oct 2020 17:44:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FHiI0h013129; Thu, 15 Oct 2020 17:44:18 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010151744.09FHiI0h013129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 15 Oct 2020 17:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366735 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 17:44:18 -0000 Author: mjg Date: Thu Oct 15 17:44:17 2020 New Revision: 366735 URL: https://svnweb.freebsd.org/changeset/base/366735 Log: cache: split hotlist between existing negative lists This simplifies the code while allowing for concurrent negative eviction down the road. Cache misses increased slightly due to higher rate of evictions allowed by the change. The current algorithm remains too aggressive. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Oct 15 17:42:22 2020 (r366734) +++ head/sys/kern/vfs_cache.c Thu Oct 15 17:44:17 2020 (r366735) @@ -311,11 +311,11 @@ static struct mtx __exclusive_cache_line ncneg_shrink_ struct neglist { struct mtx nl_lock; TAILQ_HEAD(, namecache) nl_list; + TAILQ_HEAD(, namecache) nl_hotlist; + u_long nl_hotnum; } __aligned(CACHE_LINE_SIZE); static struct neglist neglists[numneglists]; -static struct neglist ncneg_hot; -static u_long numhotneg; static inline struct neglist * NCP2NEGLIST(struct namecache *ncp) @@ -471,7 +471,6 @@ static long zap_and_exit_bucket_fail2; STATNODE_ULONG( static long cache_lock_vnodes_cel_3_failures; STATNODE_ULONG(cache_lock_vnodes_cel_3_failures, "Number of times 3-way vnode locking failed"); -STATNODE_ULONG(numhotneg, "Number of hot negative entries"); STATNODE_COUNTER(numneg_evicted, "Number of negative entries evicted when adding a new entry"); STATNODE_COUNTER(shrinking_skipped, @@ -682,6 +681,21 @@ SYSCTL_PROC(_vfs_cache, OID_AUTO, nchstats, CTLTYPE_OP CTLFLAG_MPSAFE, 0, 0, sysctl_nchstats, "LU", "VFS cache effectiveness statistics"); +static int +sysctl_hotnum(SYSCTL_HANDLER_ARGS) +{ + int i, out; + + out = 0; + for (i = 0; i < numneglists; i++) + out += neglists[i].nl_hotnum; + + return (SYSCTL_OUT(req, &out, sizeof(out))); +} +SYSCTL_PROC(_vfs_cache, OID_AUTO, hotnum, CTLTYPE_INT | CTLFLAG_RD | + CTLFLAG_MPSAFE, 0, 0, sysctl_hotnum, "I", + "Number of hot negative entries"); + #ifdef DIAGNOSTIC /* * Grab an atomic snapshot of the name cache hash chain lengths @@ -802,16 +816,14 @@ cache_negative_hit(struct namecache *ncp) if ((negstate->neg_flag & NEG_HOT) != 0) return; neglist = NCP2NEGLIST(ncp); - mtx_lock(&ncneg_hot.nl_lock); mtx_lock(&neglist->nl_lock); if ((negstate->neg_flag & NEG_HOT) == 0) { - numhotneg++; TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); - TAILQ_INSERT_TAIL(&ncneg_hot.nl_list, ncp, nc_dst); + TAILQ_INSERT_TAIL(&neglist->nl_hotlist, ncp, nc_dst); + neglist->nl_hotnum++; negstate->neg_flag |= NEG_HOT; } mtx_unlock(&neglist->nl_lock); - mtx_unlock(&ncneg_hot.nl_lock); } static void @@ -833,72 +845,42 @@ cache_negative_remove(struct namecache *ncp) { struct neglist *neglist; struct negstate *negstate; - bool hot_locked = false; - bool list_locked = false; cache_assert_bucket_locked(ncp); neglist = NCP2NEGLIST(ncp); negstate = NCP2NEGSTATE(ncp); + mtx_lock(&neglist->nl_lock); if ((negstate->neg_flag & NEG_HOT) != 0) { - hot_locked = true; - mtx_lock(&ncneg_hot.nl_lock); - if ((negstate->neg_flag & NEG_HOT) == 0) { - list_locked = true; - mtx_lock(&neglist->nl_lock); - } + TAILQ_REMOVE(&neglist->nl_hotlist, ncp, nc_dst); + neglist->nl_hotnum--; } else { - list_locked = true; - mtx_lock(&neglist->nl_lock); - /* - * We may be racing against promotion in lockless lookup. - */ - if ((negstate->neg_flag & NEG_HOT) != 0) { - mtx_unlock(&neglist->nl_lock); - hot_locked = true; - mtx_lock(&ncneg_hot.nl_lock); - mtx_lock(&neglist->nl_lock); - } - } - if ((negstate->neg_flag & NEG_HOT) != 0) { - mtx_assert(&ncneg_hot.nl_lock, MA_OWNED); - TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); - numhotneg--; - } else { - mtx_assert(&neglist->nl_lock, MA_OWNED); TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); } - if (list_locked) - mtx_unlock(&neglist->nl_lock); - if (hot_locked) - mtx_unlock(&ncneg_hot.nl_lock); + mtx_unlock(&neglist->nl_lock); atomic_subtract_long(&numneg, 1); } -static void -cache_negative_shrink_select(struct namecache **ncpp, - struct neglist **neglistpp) +static struct neglist * +cache_negative_shrink_select(void) { struct neglist *neglist; - struct namecache *ncp; static u_int cycle; u_int i; - *ncpp = ncp = NULL; - + cycle++; for (i = 0; i < numneglists; i++) { neglist = &neglists[(cycle + i) % numneglists]; - if (TAILQ_FIRST(&neglist->nl_list) == NULL) + if (TAILQ_FIRST(&neglist->nl_list) == NULL && + TAILQ_FIRST(&neglist->nl_hotlist) == NULL) continue; mtx_lock(&neglist->nl_lock); - ncp = TAILQ_FIRST(&neglist->nl_list); - if (ncp != NULL) - break; + if (TAILQ_FIRST(&neglist->nl_list) != NULL || + TAILQ_FIRST(&neglist->nl_hotlist) != NULL) + return (neglist); mtx_unlock(&neglist->nl_lock); } - *neglistpp = neglist; - *ncpp = ncp; - cycle++; + return (NULL); } static void @@ -916,28 +898,23 @@ cache_negative_zap_one(void) return; } - mtx_lock(&ncneg_hot.nl_lock); - ncp = TAILQ_FIRST(&ncneg_hot.nl_list); + neglist = cache_negative_shrink_select(); + mtx_unlock(&ncneg_shrink_lock); + if (neglist == NULL) { + return; + } + + ncp = TAILQ_FIRST(&neglist->nl_hotlist); if (ncp != NULL) { - neglist = NCP2NEGLIST(ncp); negstate = NCP2NEGSTATE(ncp); - mtx_lock(&neglist->nl_lock); - MPASS((negstate->neg_flag & NEG_HOT) != 0); - TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); + TAILQ_REMOVE(&neglist->nl_hotlist, ncp, nc_dst); TAILQ_INSERT_TAIL(&neglist->nl_list, ncp, nc_dst); + neglist->nl_hotnum--; negstate->neg_flag &= ~NEG_HOT; - numhotneg--; - mtx_unlock(&neglist->nl_lock); } - mtx_unlock(&ncneg_hot.nl_lock); - - cache_negative_shrink_select(&ncp, &neglist); - - mtx_unlock(&ncneg_shrink_lock); - if (ncp == NULL) - return; - - MPASS(ncp->nc_flag & NCF_NEGATIVE); + ncp = TAILQ_FIRST(&neglist->nl_list); + MPASS(ncp != NULL); + negstate = NCP2NEGSTATE(ncp); dvlp = VP2VNODELOCK(ncp->nc_dvp); blp = NCP2BUCKETLOCK(ncp); mtx_unlock(&neglist->nl_lock); @@ -2095,9 +2072,8 @@ nchinit(void *dummy __unused) for (i = 0; i < numneglists; i++) { mtx_init(&neglists[i].nl_lock, "ncnegl", NULL, MTX_DEF); TAILQ_INIT(&neglists[i].nl_list); + TAILQ_INIT(&neglists[i].nl_hotlist); } - mtx_init(&ncneg_hot.nl_lock, "ncneglh", NULL, MTX_DEF); - TAILQ_INIT(&ncneg_hot.nl_list); mtx_init(&ncneg_shrink_lock, "ncnegs", NULL, MTX_DEF); } @@ -3413,7 +3389,6 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, neglist = NCP2NEGLIST(oncp); cache_fpl_smr_exit(fpl); - mtx_lock(&ncneg_hot.nl_lock); mtx_lock(&neglist->nl_lock); /* * For hash iteration. @@ -3461,9 +3436,9 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, negstate = NCP2NEGSTATE(ncp); if ((negstate->neg_flag & NEG_HOT) == 0) { - numhotneg++; TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); - TAILQ_INSERT_TAIL(&ncneg_hot.nl_list, ncp, nc_dst); + TAILQ_INSERT_TAIL(&neglist->nl_hotlist, ncp, nc_dst); + neglist->nl_hotnum++; negstate->neg_flag |= NEG_HOT; } @@ -3471,13 +3446,11 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, counter_u64_add(numneghits, 1); cache_fpl_smr_exit(fpl); mtx_unlock(&neglist->nl_lock); - mtx_unlock(&ncneg_hot.nl_lock); vdrop(dvp); return (cache_fpl_handled(fpl, ENOENT)); out_abort: cache_fpl_smr_exit(fpl); mtx_unlock(&neglist->nl_lock); - mtx_unlock(&ncneg_hot.nl_lock); vdrop(dvp); return (cache_fpl_aborted(fpl)); } From owner-svn-src-head@freebsd.org Thu Oct 15 18:03:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB521443FB4; Thu, 15 Oct 2020 18:03:14 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBxwL4X0Pz3YSW; Thu, 15 Oct 2020 18:03:14 +0000 (UTC) (envelope-from jrtc27@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 7EAF223927; Thu, 15 Oct 2020 18:03:14 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09FI3EPt026263; Thu, 15 Oct 2020 18:03:14 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FI3E8I026262; Thu, 15 Oct 2020 18:03:14 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202010151803.09FI3E8I026262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Thu, 15 Oct 2020 18:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366736 - head/usr.sbin/kldxref X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: head/usr.sbin/kldxref X-SVN-Commit-Revision: 366736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 18:03:14 -0000 Author: jrtc27 Date: Thu Oct 15 18:03:14 2020 New Revision: 366736 URL: https://svnweb.freebsd.org/changeset/base/366736 Log: kldxref: Avoid buffer overflows in parse_pnp_list We convert a string like "W32:vendor/device" into "I:vendor;I:device", where the output is longer than the input, but only allocate space equal to the length of the input, leading to a buffer overflow. Instead use open_memstream so we get a safe dynamically-grown buffer. Found by: CHERI Reviewed by: imp, jhb (mentor) Approved by: imp, jhb (mentor) Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D26637 Modified: head/usr.sbin/kldxref/kldxref.c Modified: head/usr.sbin/kldxref/kldxref.c ============================================================================== --- head/usr.sbin/kldxref/kldxref.c Thu Oct 15 17:44:17 2020 (r366735) +++ head/usr.sbin/kldxref/kldxref.c Thu Oct 15 18:03:14 2020 (r366736) @@ -235,14 +235,17 @@ parse_pnp_list(const char *desc, char **new_desc, pnp_ const char *walker, *ep; const char *colon, *semi; struct pnp_elt *elt; - char *nd; char type[8], key[32]; int off; + size_t new_desc_size; + FILE *fp; walker = desc; ep = desc + strlen(desc); off = 0; - nd = *new_desc = malloc(strlen(desc) + 1); + fp = open_memstream(new_desc, &new_desc_size); + if (fp == NULL) + err(1, "Could not open new memory stream"); if (verbose > 1) printf("Converting %s into a list\n", desc); while (walker < ep) { @@ -336,42 +339,44 @@ parse_pnp_list(const char *desc, char **new_desc, pnp_ off = elt->pe_offset + sizeof(void *); } if (elt->pe_kind & TYPE_PAIRED) { - char *word, *ctx; + char *word, *ctx, newtype; for (word = strtok_r(key, "/", &ctx); word; word = strtok_r(NULL, "/", &ctx)) { - sprintf(nd, "%c:%s;", elt->pe_kind & TYPE_FLAGGED ? 'J' : 'I', - word); - nd += strlen(nd); + newtype = elt->pe_kind & TYPE_FLAGGED ? 'J' : 'I'; + fprintf(fp, "%c:%s;", newtype, word); } - } else { + char newtype; + if (elt->pe_kind & TYPE_FLAGGED) - *nd++ = 'J'; + newtype = 'J'; else if (elt->pe_kind & TYPE_GE) - *nd++ = 'G'; + newtype = 'G'; else if (elt->pe_kind & TYPE_LE) - *nd++ = 'L'; + newtype = 'L'; else if (elt->pe_kind & TYPE_MASK) - *nd++ = 'M'; + newtype = 'M'; else if (elt->pe_kind & TYPE_INT) - *nd++ = 'I'; + newtype = 'I'; else if (elt->pe_kind == TYPE_D) - *nd++ = 'D'; + newtype = 'D'; else if (elt->pe_kind == TYPE_Z || elt->pe_kind == TYPE_E) - *nd++ = 'Z'; + newtype = 'Z'; else if (elt->pe_kind == TYPE_T) - *nd++ = 'T'; + newtype = 'T'; else errx(1, "Impossible type %x\n", elt->pe_kind); - *nd++ = ':'; - strcpy(nd, key); - nd += strlen(nd); - *nd++ = ';'; + fprintf(fp, "%c:%s;", newtype, key); } } - *nd++ = '\0'; + if (ferror(fp) != 0) { + fclose(fp); + errx(1, "Exhausted space converting description %s", desc); + } + if (fclose(fp) != 0) + errx(1, "Failed to close memory stream"); return (0); err: errx(1, "Parse error of description string %s", desc); From owner-svn-src-head@freebsd.org Thu Oct 15 19:34:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16173445BAA for ; Thu, 15 Oct 2020 19:34:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBzxz0N8dz3cyk for ; Thu, 15 Oct 2020 19:34:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf35.google.com with SMTP id o25so86450qvf.7 for ; Thu, 15 Oct 2020 12:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wrONjLbvc/CAyS60Q49pke0gfokyV/zmL0Fq+0Us6k4=; b=UWyX3HGqLHq3DYxm9x00PJQ3AD3Xee9OizI6sqsNeJC4rZk6iRD3/Rn/YaiZnW/drN Pvve3/reDFDC2W8qgxctvPuqwbKI6lR3OxEkA96Rwnzw7SXwUO11Smip0fRv+OPjQUPI o9CCzRV7NeAlfrRJWQNeYp9UP0SaWbEaCg+CBPK9AgEVMJCKmX8GK+ZyZZR4qWF9bPpS VlSRqLBq28anq4swC2fwIRicfxkS5wjSw7qmPaQSkzVWUZIPbDh9nLyqsa1v+5P2ARRv qo1SMbRBY47RmEm9s0f6qPrrW7j0hboW8JjZ07IVc0DqRA1zoFT85LDXo/loujncWma2 DEaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wrONjLbvc/CAyS60Q49pke0gfokyV/zmL0Fq+0Us6k4=; b=YiNIAwz6ZTbX1fRHmNjq8pxwoGlX9pQHLy8fPAzBnHmk9yf0ClEOhPuZ9GqaAxcns9 1ZZiJDlv31/4TTX9TNkV9mKG49+NT4+65znmezuNVIHIYiDXP2g49YaKVyhfJmu/qDBq 0TSG45+hUVvQvaqZG367iFVMEpi5rhCfpZrubiPhBCSqh+ZVX8921nN4+9KH/chCzwfF Ll8a4834vHdJAhDSxxXzOM7IcObWOdsFCOnmet6JWGip/xDqVaPXoyCHcDqt+5iTSfMZ xAnE3NdzrsWbPu2527iooxIneFedR+kbBvibwrgBkinoM4bGqjRwJMbNp7ROyAeaPKZy 5qTg== X-Gm-Message-State: AOAM532SLP3S3UR29v00FCdCpvtkqfuG4SQVpjMQpaG6zKuxwAuFKhs3 ftcfZfoA/G8/cCGbtbG6WA2eRwGJTvUe5jCS4Q0FtQ== X-Google-Smtp-Source: ABdhPJxIWkztsHSgzKP0Iivpp56fzykl4sRPo5yZxyTf49N8n2jvF3bUgm+9z4SqRiUzN3qjR9glrP7egCCLXuIAnnY= X-Received: by 2002:a05:6214:10c4:: with SMTP id r4mr133950qvs.62.1602790485592; Thu, 15 Oct 2020 12:34:45 -0700 (PDT) MIME-Version: 1.0 References: <202010151712.09FHCwA8091241@repo.freebsd.org> In-Reply-To: <202010151712.09FHCwA8091241@repo.freebsd.org> From: Warner Losh Date: Thu, 15 Oct 2020 13:34:34 -0600 Message-ID: Subject: Re: svn commit: r366732 - in head/release: amd64 arm64 To: Glen Barber Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4CBzxz0N8dz3cyk X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=UWyX3HGq; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f35) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.72 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.86)[-0.856]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_SPAM_SHORT(0.14)[0.140]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f35:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-head]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 19:34:48 -0000 I'd recommend bumping this to 2MB or larger. This most likely is from the zstd landing which pushed arm64's size over the 1MB limit in memory, so it's only a matter of time before the file grows past 1MB in size. Warner On Thu, Oct 15, 2020 at 11:13 AM Glen Barber wrote: > Author: gjb > Date: Thu Oct 15 17:12:58 2020 > New Revision: 366732 > URL: https://svnweb.freebsd.org/changeset/base/366732 > > Log: > Increase the amd64 ISO ESP file size from 800KB to 1024KB. > > At some poing over the last week, the bootx64.efi file has grown > past the 800KB threshold, resulting in being unable to copy it to > the EFI/BOOT directory. > > # stat -f %z efiboot.znWo7m > 819200 > # stat -f %z stand-test.PIEugN/EFI/BOOT/bootx64.efi > 842752 > > The comment in the script that creates the ISOs suggests that 800KB > is the maximum allowed for the boot code, however I was able to > boot an ISO with a 1024KB boot partition. Additionally, I verified > against an ISO from OtherOS, where the boot EFI partition is 2.4MB. > > Sponsored by: Rubicon Communications, LLC (netgate.com) > > Modified: > head/release/amd64/mkisoimages.sh > head/release/arm64/mkisoimages.sh > > Modified: head/release/amd64/mkisoimages.sh > > ============================================================================== > --- head/release/amd64/mkisoimages.sh Thu Oct 15 17:05:21 2020 > (r366731) > +++ head/release/amd64/mkisoimages.sh Thu Oct 15 17:12:58 2020 > (r366732) > @@ -46,10 +46,10 @@ if [ "$1" = "-b" ]; then > bootable="-o bootimage=i386;$BASEBITSDIR/boot/cdboot -o > no-emul-boot" > > # Make EFI system partition. > - # The ISO file is a special case, in that it only has a maximum of > - # 800 KB available for the boot code. So make an 800 KB ESP > espfilename=$(mktemp /tmp/efiboot.XXXXXX) > - make_esp_file ${espfilename} 800 ${BASEBITSDIR}/boot/loader.efi > + # ESP file size in KB. > + espsize="1024" > + make_esp_file ${espfilename} ${espsize} > ${BASEBITSDIR}/boot/loader.efi > bootable="$bootable -o bootimage=i386;${espfilename} -o > no-emul-boot -o platformid=efi" > > shift > > Modified: head/release/arm64/mkisoimages.sh > > ============================================================================== > --- head/release/arm64/mkisoimages.sh Thu Oct 15 17:05:21 2020 > (r366731) > +++ head/release/arm64/mkisoimages.sh Thu Oct 15 17:12:58 2020 > (r366732) > @@ -40,10 +40,10 @@ if [ "$1" = "-b" ]; then > BASEBITSDIR="$4" > > # Make an EFI system partition. > - # The ISO file is a special case, in that it only has a maximum of > - # 800 KB available for the boot code. So make an 800 KB ESP > espfilename=$(mktemp /tmp/efiboot.XXXXXX) > - make_esp_file ${espfilename} 800 ${BASEBITSDIR}/boot/loader.efi > + # ESP file size in KB. > + espsize="1024" > + make_esp_file ${espfilename} ${espsize} > ${BASEBITSDIR}/boot/loader.efi > > bootable="-o bootimage=efi;${espfilename} -o no-emul-boot -o > platformid=efi" > > From owner-svn-src-head@freebsd.org Thu Oct 15 19:36:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0862F445E87 for ; Thu, 15 Oct 2020 19:36:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBzzy0QTjz3d5B for ; Thu, 15 Oct 2020 19:36:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x734.google.com with SMTP id x20so129743qkn.1 for ; Thu, 15 Oct 2020 12:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EwMnadgbV7PtG+nTXbnDAeZmvtEHHQUpRUgWBqcWugE=; b=bA54CozXuFTTH+buiyyUqC10pNOcZ5wXFxc5S+ePeJwdcNtF9D8sJi0FMXPeLxMuW+ 4iZrTH9gXGB2medLDc4kafK/94bMpsZxl+3Fji2GADhsbk2/NEdiRNQH8ZeQDD9wxDKv YkneGte8Nnm2PlzhLLYfNXBbTEsf/LTCeitvNds1M14LWc2gQriLnbOHKsO1lhjySVRh jKaMNREU6q2nGcdrcOh3CUvLqnACcjIhUbT1GH1z/a1xx36fxNKQvwJD5ABjP2vd2BfF xPbgirGEFiWeOi3dWMzvd1Qe7kmAvuBMa/88jeMF2KAD0o9BFh0h1Fsp39mo+OdFtiBz qpvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EwMnadgbV7PtG+nTXbnDAeZmvtEHHQUpRUgWBqcWugE=; b=e5YW3uRK3p70hZFhxToXin57JCEA8Ko/KCuB9r/oIE1HEnwA2/GKR+R0weJ9FT4YCk JfpCAlwRFjyJBO3/3CtlEPz6OHhFRGDPgCUQZBqOGZzJM9BLDs1edaMiOYJBFyYv5BZa bStfSK054t3MPAsGWckHM/wRTfN/taq0nma5XQ++NVACkJRW9xxuOyGCJ8TZEfbqT4La 5dSjiVRzonJRMRQu9GBpFaS1y+mmQ7Y+lRh0Jp/fX03d+vTjaumg/sbvV7f9Nq7Rqbeg vcU6bpLC1hW2maICzXJ6HPDhXqNiUuw70NKzx+HIzIWm5Ja2CGRqkpyQ5Af0yfuKS8uI Z4/g== X-Gm-Message-State: AOAM530EPTHSRRABysjVC2CH22Bd48znvs14auTcq51/uboHmywcCJPT SvBaL1nnoOp2R0aScAMiGKNHUbWFfjYwnpnQlNQ0iA== X-Google-Smtp-Source: ABdhPJy5MOAEqFb4kVHye1tfiwX17ZbQAfTqjGcKfaNsUIbDhR40V13Wzrnz/RXyvzAYsn2Va4ON67Kf1iQZdveiQqo= X-Received: by 2002:a05:620a:15a9:: with SMTP id f9mr351382qkk.359.1602790589099; Thu, 15 Oct 2020 12:36:29 -0700 (PDT) MIME-Version: 1.0 References: <202010151712.09FHCwA8091241@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 15 Oct 2020 13:36:18 -0600 Message-ID: Subject: Re: svn commit: r366732 - in head/release: amd64 arm64 To: Glen Barber Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4CBzzy0QTjz3d5B X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=bA54CozX; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::734) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.71 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.85)[-0.853]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_SPAM_SHORT(0.14)[0.139]; NEURAL_HAM_LONG(-1.00)[-0.999]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::734:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-head]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 19:36:31 -0000 And on a related note, I can make it so we can build w/o ZSTD in the CD boot loader because it's not needed there. I'd rather not, but if the 800k limit is a real thing in relevant places, we have that as an option. Warner On Thu, Oct 15, 2020 at 1:34 PM Warner Losh wrote: > I'd recommend bumping this to 2MB or larger. > > This most likely is from the zstd landing which pushed arm64's size over > the 1MB limit in memory, so it's only a matter of time before the file > grows past 1MB in size. > > Warner > > On Thu, Oct 15, 2020 at 11:13 AM Glen Barber wrote: > >> Author: gjb >> Date: Thu Oct 15 17:12:58 2020 >> New Revision: 366732 >> URL: https://svnweb.freebsd.org/changeset/base/366732 >> >> Log: >> Increase the amd64 ISO ESP file size from 800KB to 1024KB. >> >> At some poing over the last week, the bootx64.efi file has grown >> past the 800KB threshold, resulting in being unable to copy it to >> the EFI/BOOT directory. >> >> # stat -f %z efiboot.znWo7m >> 819200 >> # stat -f %z stand-test.PIEugN/EFI/BOOT/bootx64.efi >> 842752 >> >> The comment in the script that creates the ISOs suggests that 800KB >> is the maximum allowed for the boot code, however I was able to >> boot an ISO with a 1024KB boot partition. Additionally, I verified >> against an ISO from OtherOS, where the boot EFI partition is 2.4MB. >> >> Sponsored by: Rubicon Communications, LLC (netgate.com) >> >> Modified: >> head/release/amd64/mkisoimages.sh >> head/release/arm64/mkisoimages.sh >> >> Modified: head/release/amd64/mkisoimages.sh >> >> ============================================================================== >> --- head/release/amd64/mkisoimages.sh Thu Oct 15 17:05:21 2020 >> (r366731) >> +++ head/release/amd64/mkisoimages.sh Thu Oct 15 17:12:58 2020 >> (r366732) >> @@ -46,10 +46,10 @@ if [ "$1" = "-b" ]; then >> bootable="-o bootimage=i386;$BASEBITSDIR/boot/cdboot -o >> no-emul-boot" >> >> # Make EFI system partition. >> - # The ISO file is a special case, in that it only has a maximum of >> - # 800 KB available for the boot code. So make an 800 KB ESP >> espfilename=$(mktemp /tmp/efiboot.XXXXXX) >> - make_esp_file ${espfilename} 800 ${BASEBITSDIR}/boot/loader.efi >> + # ESP file size in KB. >> + espsize="1024" >> + make_esp_file ${espfilename} ${espsize} >> ${BASEBITSDIR}/boot/loader.efi >> bootable="$bootable -o bootimage=i386;${espfilename} -o >> no-emul-boot -o platformid=efi" >> >> shift >> >> Modified: head/release/arm64/mkisoimages.sh >> >> ============================================================================== >> --- head/release/arm64/mkisoimages.sh Thu Oct 15 17:05:21 2020 >> (r366731) >> +++ head/release/arm64/mkisoimages.sh Thu Oct 15 17:12:58 2020 >> (r366732) >> @@ -40,10 +40,10 @@ if [ "$1" = "-b" ]; then >> BASEBITSDIR="$4" >> >> # Make an EFI system partition. >> - # The ISO file is a special case, in that it only has a maximum of >> - # 800 KB available for the boot code. So make an 800 KB ESP >> espfilename=$(mktemp /tmp/efiboot.XXXXXX) >> - make_esp_file ${espfilename} 800 ${BASEBITSDIR}/boot/loader.efi >> + # ESP file size in KB. >> + espsize="1024" >> + make_esp_file ${espfilename} ${espsize} >> ${BASEBITSDIR}/boot/loader.efi >> >> bootable="-o bootimage=efi;${espfilename} -o no-emul-boot -o >> platformid=efi" >> >> From owner-svn-src-head@freebsd.org Thu Oct 15 20:21:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4672C446D06; Thu, 15 Oct 2020 20:21:17 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CC0zd19z6z40QM; Thu, 15 Oct 2020 20:21:17 +0000 (UTC) (envelope-from mhorne@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 E709124CE7; Thu, 15 Oct 2020 20:21:16 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09FKLGf2016518; Thu, 15 Oct 2020 20:21:16 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FKLGsb016515; Thu, 15 Oct 2020 20:21:16 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010152021.09FKLGsb016515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Thu, 15 Oct 2020 20:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366737 - in head/sys: amd64/amd64 arm/arm arm64/arm64 riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm/arm arm64/arm64 riscv/riscv X-SVN-Commit-Revision: 366737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 20:21:17 -0000 Author: mhorne Date: Thu Oct 15 20:21:15 2020 New Revision: 366737 URL: https://svnweb.freebsd.org/changeset/base/366737 Log: Simplify preload_dump() condition Hiding this feature behind RB_VERBOSE is gratuitous. The tunable is enough to limit its use to only those who explicitly request it. Suggested by: kevans Modified: head/sys/amd64/amd64/machdep.c head/sys/arm/arm/machdep.c head/sys/arm64/arm64/machdep.c head/sys/riscv/riscv/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Oct 15 18:03:14 2020 (r366736) +++ head/sys/amd64/amd64/machdep.c Thu Oct 15 20:21:15 2020 (r366737) @@ -1859,8 +1859,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) * output is required. If it's grossly incorrect the kernel will never * make it this far. */ - if ((boothowto & RB_VERBOSE) && - getenv_is_true("debug.dump_modinfo_at_boot")) + if (getenv_is_true("debug.dump_modinfo_at_boot")) preload_dump(); #ifdef DEV_ISA Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Thu Oct 15 18:03:14 2020 (r366736) +++ head/sys/arm/arm/machdep.c Thu Oct 15 20:21:15 2020 (r366737) @@ -1032,8 +1032,7 @@ initarm(struct arm_boot_params *abp) * output is required. If it's grossly incorrect the kernel will never * make it this far. */ - if ((boothowto & RB_VERBOSE) && - getenv_is_true("debug.dump_modinfo_at_boot")) + if (getenv_is_true("debug.dump_modinfo_at_boot")) preload_dump(); env = kern_getenv("kernelname"); Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Thu Oct 15 18:03:14 2020 (r366736) +++ head/sys/arm64/arm64/machdep.c Thu Oct 15 20:21:15 2020 (r366737) @@ -1247,8 +1247,7 @@ initarm(struct arm64_bootparams *abp) * output is required. If it's grossly incorrect the kernel will never * make it this far. */ - if ((boothowto & RB_VERBOSE) && - getenv_is_true("debug.dump_modinfo_at_boot")) + if (getenv_is_true("debug.dump_modinfo_at_boot")) preload_dump(); init_proc0(abp->kern_stack); Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Thu Oct 15 18:03:14 2020 (r366736) +++ head/sys/riscv/riscv/machdep.c Thu Oct 15 20:21:15 2020 (r366737) @@ -954,8 +954,7 @@ initriscv(struct riscv_bootparams *rvbp) * output is required. If it's grossly incorrect the kernel will never * make it this far. */ - if ((boothowto & RB_VERBOSE) && - getenv_is_true("debug.dump_modinfo_at_boot")) + if (getenv_is_true("debug.dump_modinfo_at_boot")) preload_dump(); init_proc0(rvbp->kern_stack); From owner-svn-src-head@freebsd.org Thu Oct 15 23:05:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CDA62449506; Thu, 15 Oct 2020 23:05:14 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CC4cp56wLz4738; Thu, 15 Oct 2020 23:05:14 +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 8EEE326C45; Thu, 15 Oct 2020 23:05:14 +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 09FN5EbF019394; Thu, 15 Oct 2020 23:05:14 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09FN5EJQ019392; Thu, 15 Oct 2020 23:05:14 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202010152305.09FN5EJQ019392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 15 Oct 2020 23:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366738 - in head/release: amd64 arm64 X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in head/release: amd64 arm64 X-SVN-Commit-Revision: 366738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2020 23:05:14 -0000 Author: gjb Date: Thu Oct 15 23:05:13 2020 New Revision: 366738 URL: https://svnweb.freebsd.org/changeset/base/366738 Log: Bump the ISO EFI partition size from 1024 to 2048, following r366732. Suggested by: imp Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/release/amd64/mkisoimages.sh head/release/arm64/mkisoimages.sh Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Thu Oct 15 20:21:15 2020 (r366737) +++ head/release/amd64/mkisoimages.sh Thu Oct 15 23:05:13 2020 (r366738) @@ -48,7 +48,7 @@ if [ "$1" = "-b" ]; then # Make EFI system partition. espfilename=$(mktemp /tmp/efiboot.XXXXXX) # ESP file size in KB. - espsize="1024" + espsize="2048" make_esp_file ${espfilename} ${espsize} ${BASEBITSDIR}/boot/loader.efi bootable="$bootable -o bootimage=i386;${espfilename} -o no-emul-boot -o platformid=efi" Modified: head/release/arm64/mkisoimages.sh ============================================================================== --- head/release/arm64/mkisoimages.sh Thu Oct 15 20:21:15 2020 (r366737) +++ head/release/arm64/mkisoimages.sh Thu Oct 15 23:05:13 2020 (r366738) @@ -42,7 +42,7 @@ if [ "$1" = "-b" ]; then # Make an EFI system partition. espfilename=$(mktemp /tmp/efiboot.XXXXXX) # ESP file size in KB. - espsize="1024" + espsize="2048" make_esp_file ${espfilename} ${espsize} ${BASEBITSDIR}/boot/loader.efi bootable="-o bootimage=efi;${espfilename} -o no-emul-boot -o platformid=efi" From owner-svn-src-head@freebsd.org Fri Oct 16 00:55:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9044744B21A; Fri, 16 Oct 2020 00:55:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CC73f2zzLz4DVv; Fri, 16 Oct 2020 00:55:10 +0000 (UTC) (envelope-from mjg@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 4AE1383B4; Fri, 16 Oct 2020 00:55:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09G0tAkp086284; Fri, 16 Oct 2020 00:55:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09G0tAAC086283; Fri, 16 Oct 2020 00:55:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010160055.09G0tAAC086283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 16 Oct 2020 00:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366740 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 00:55:10 -0000 Author: mjg Date: Fri Oct 16 00:55:09 2020 New Revision: 366740 URL: https://svnweb.freebsd.org/changeset/base/366740 Log: cache: neglist -> nl; negstate -> ns No functional changes. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Oct 16 00:01:01 2020 (r366739) +++ head/sys/kern/vfs_cache.c Fri Oct 16 00:55:09 2020 (r366740) @@ -799,85 +799,85 @@ SYSCTL_PROC(_debug_hashstat, OID_AUTO, nchash, CTLTYPE static void cache_negative_init(struct namecache *ncp) { - struct negstate *negstate; + struct negstate *ns; ncp->nc_flag |= NCF_NEGATIVE; - negstate = NCP2NEGSTATE(ncp); - negstate->neg_flag = 0; + ns = NCP2NEGSTATE(ncp); + ns->neg_flag = 0; } static void cache_negative_hit(struct namecache *ncp) { - struct neglist *neglist; - struct negstate *negstate; + struct neglist *nl; + struct negstate *ns; - negstate = NCP2NEGSTATE(ncp); - if ((negstate->neg_flag & NEG_HOT) != 0) + ns = NCP2NEGSTATE(ncp); + if ((ns->neg_flag & NEG_HOT) != 0) return; - neglist = NCP2NEGLIST(ncp); - mtx_lock(&neglist->nl_lock); - if ((negstate->neg_flag & NEG_HOT) == 0) { - TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); - TAILQ_INSERT_TAIL(&neglist->nl_hotlist, ncp, nc_dst); - neglist->nl_hotnum++; - negstate->neg_flag |= NEG_HOT; + nl = NCP2NEGLIST(ncp); + mtx_lock(&nl->nl_lock); + if ((ns->neg_flag & NEG_HOT) == 0) { + TAILQ_REMOVE(&nl->nl_list, ncp, nc_dst); + TAILQ_INSERT_TAIL(&nl->nl_hotlist, ncp, nc_dst); + nl->nl_hotnum++; + ns->neg_flag |= NEG_HOT; } - mtx_unlock(&neglist->nl_lock); + mtx_unlock(&nl->nl_lock); } static void cache_negative_insert(struct namecache *ncp) { - struct neglist *neglist; + struct neglist *nl; MPASS(ncp->nc_flag & NCF_NEGATIVE); cache_assert_bucket_locked(ncp); - neglist = NCP2NEGLIST(ncp); - mtx_lock(&neglist->nl_lock); - TAILQ_INSERT_TAIL(&neglist->nl_list, ncp, nc_dst); - mtx_unlock(&neglist->nl_lock); + nl = NCP2NEGLIST(ncp); + mtx_lock(&nl->nl_lock); + TAILQ_INSERT_TAIL(&nl->nl_list, ncp, nc_dst); + mtx_unlock(&nl->nl_lock); atomic_add_long(&numneg, 1); } static void cache_negative_remove(struct namecache *ncp) { - struct neglist *neglist; - struct negstate *negstate; + struct neglist *nl; + struct negstate *ns; cache_assert_bucket_locked(ncp); - neglist = NCP2NEGLIST(ncp); - negstate = NCP2NEGSTATE(ncp); - mtx_lock(&neglist->nl_lock); - if ((negstate->neg_flag & NEG_HOT) != 0) { - TAILQ_REMOVE(&neglist->nl_hotlist, ncp, nc_dst); - neglist->nl_hotnum--; + nl = NCP2NEGLIST(ncp); + ns = NCP2NEGSTATE(ncp); + mtx_lock(&nl->nl_lock); + if ((ns->neg_flag & NEG_HOT) != 0) { + TAILQ_REMOVE(&nl->nl_hotlist, ncp, nc_dst); + nl->nl_hotnum--; } else { - TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); + TAILQ_REMOVE(&nl->nl_list, ncp, nc_dst); } - mtx_unlock(&neglist->nl_lock); + mtx_unlock(&nl->nl_lock); atomic_subtract_long(&numneg, 1); } static struct neglist * cache_negative_shrink_select(void) { - struct neglist *neglist; + struct neglist *nl; static u_int cycle; u_int i; cycle++; for (i = 0; i < numneglists; i++) { - neglist = &neglists[(cycle + i) % numneglists]; - if (TAILQ_FIRST(&neglist->nl_list) == NULL && - TAILQ_FIRST(&neglist->nl_hotlist) == NULL) + nl = &neglists[(cycle + i) % numneglists]; + if (TAILQ_FIRST(&nl->nl_list) == NULL && + TAILQ_FIRST(&nl->nl_hotlist) == NULL) continue; - mtx_lock(&neglist->nl_lock); - if (TAILQ_FIRST(&neglist->nl_list) != NULL || - TAILQ_FIRST(&neglist->nl_hotlist) != NULL) - return (neglist); - mtx_unlock(&neglist->nl_lock); + mtx_lock(&nl->nl_lock); + if (TAILQ_FIRST(&nl->nl_list) != NULL || + TAILQ_FIRST(&nl->nl_hotlist) != NULL) + return (nl); + mtx_unlock(&nl->nl_lock); } return (NULL); @@ -887,8 +887,8 @@ static void cache_negative_zap_one(void) { struct namecache *ncp, *ncp2; - struct neglist *neglist; - struct negstate *negstate; + struct neglist *nl; + struct negstate *ns; struct mtx *dvlp; struct mtx *blp; @@ -898,26 +898,26 @@ cache_negative_zap_one(void) return; } - neglist = cache_negative_shrink_select(); + nl = cache_negative_shrink_select(); mtx_unlock(&ncneg_shrink_lock); - if (neglist == NULL) { + if (nl == NULL) { return; } - ncp = TAILQ_FIRST(&neglist->nl_hotlist); + ncp = TAILQ_FIRST(&nl->nl_hotlist); if (ncp != NULL) { - negstate = NCP2NEGSTATE(ncp); - TAILQ_REMOVE(&neglist->nl_hotlist, ncp, nc_dst); - TAILQ_INSERT_TAIL(&neglist->nl_list, ncp, nc_dst); - neglist->nl_hotnum--; - negstate->neg_flag &= ~NEG_HOT; + ns = NCP2NEGSTATE(ncp); + TAILQ_REMOVE(&nl->nl_hotlist, ncp, nc_dst); + TAILQ_INSERT_TAIL(&nl->nl_list, ncp, nc_dst); + nl->nl_hotnum--; + ns->neg_flag &= ~NEG_HOT; } - ncp = TAILQ_FIRST(&neglist->nl_list); + ncp = TAILQ_FIRST(&nl->nl_list); MPASS(ncp != NULL); - negstate = NCP2NEGSTATE(ncp); + ns = NCP2NEGSTATE(ncp); dvlp = VP2VNODELOCK(ncp->nc_dvp); blp = NCP2BUCKETLOCK(ncp); - mtx_unlock(&neglist->nl_lock); + mtx_unlock(&nl->nl_lock); mtx_lock(dvlp); mtx_lock(blp); /* @@ -926,7 +926,7 @@ cache_negative_zap_one(void) * and used by a different vnode. */ vfs_smr_enter(); - ncp2 = TAILQ_FIRST(&neglist->nl_list); + ncp2 = TAILQ_FIRST(&nl->nl_list); if (ncp != ncp2 || dvlp != VP2VNODELOCK(ncp2->nc_dvp) || blp != NCP2BUCKETLOCK(ncp2)) { vfs_smr_exit(); @@ -1439,7 +1439,7 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st struct timespec *tsp, int *ticksp) { struct namecache *ncp; - struct negstate *negstate; + struct negstate *ns; uint32_t hash; enum vgetstate vs; int error; @@ -1528,8 +1528,8 @@ negative_success: * TODO: We need to take locks to promote an entry. Code doing it * in SMR lookup can be modified to be shared. */ - negstate = NCP2NEGSTATE(ncp); - if ((negstate->neg_flag & NEG_HOT) == 0 || + ns = NCP2NEGSTATE(ncp); + if ((ns->neg_flag & NEG_HOT) == 0 || !cache_ncp_canuse(ncp)) { vfs_smr_exit(); goto out_fallback; @@ -3375,8 +3375,8 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, { struct componentname *cnp; struct namecache *ncp; - struct neglist *neglist; - struct negstate *negstate; + struct neglist *nl; + struct negstate *ns; struct vnode *dvp; u_char nc_flag; @@ -3386,10 +3386,10 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, if (!vhold_smr(dvp)) return (cache_fpl_aborted(fpl)); - neglist = NCP2NEGLIST(oncp); + nl = NCP2NEGLIST(oncp); cache_fpl_smr_exit(fpl); - mtx_lock(&neglist->nl_lock); + mtx_lock(&nl->nl_lock); /* * For hash iteration. */ @@ -3434,23 +3434,23 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, goto out_abort; } - negstate = NCP2NEGSTATE(ncp); - if ((negstate->neg_flag & NEG_HOT) == 0) { - TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); - TAILQ_INSERT_TAIL(&neglist->nl_hotlist, ncp, nc_dst); - neglist->nl_hotnum++; - negstate->neg_flag |= NEG_HOT; + ns = NCP2NEGSTATE(ncp); + if ((ns->neg_flag & NEG_HOT) == 0) { + TAILQ_REMOVE(&nl->nl_list, ncp, nc_dst); + TAILQ_INSERT_TAIL(&nl->nl_hotlist, ncp, nc_dst); + nl->nl_hotnum++; + ns->neg_flag |= NEG_HOT; } SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); counter_u64_add(numneghits, 1); cache_fpl_smr_exit(fpl); - mtx_unlock(&neglist->nl_lock); + mtx_unlock(&nl->nl_lock); vdrop(dvp); return (cache_fpl_handled(fpl, ENOENT)); out_abort: cache_fpl_smr_exit(fpl); - mtx_unlock(&neglist->nl_lock); + mtx_unlock(&nl->nl_lock); vdrop(dvp); return (cache_fpl_aborted(fpl)); } @@ -3751,7 +3751,7 @@ cache_fplookup_next(struct cache_fpl *fpl) { struct componentname *cnp; struct namecache *ncp; - struct negstate *negstate; + struct negstate *ns; struct vnode *dvp, *tvp; u_char nc_flag; uint32_t hash; @@ -3790,8 +3790,8 @@ cache_fplookup_next(struct cache_fpl *fpl) if (__predict_false(fpl->cnp->cn_nameiop != LOOKUP)) { return (cache_fpl_partial(fpl)); } - negstate = NCP2NEGSTATE(ncp); - neg_hot = ((negstate->neg_flag & NEG_HOT) != 0); + ns = NCP2NEGSTATE(ncp); + neg_hot = ((ns->neg_flag & NEG_HOT) != 0); if (__predict_false(!cache_ncp_canuse(ncp))) { return (cache_fpl_partial(fpl)); } From owner-svn-src-head@freebsd.org Fri Oct 16 00:55:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16C3044AE4B; Fri, 16 Oct 2020 00:55:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CC7436thBz4F4J; Fri, 16 Oct 2020 00:55:31 +0000 (UTC) (envelope-from mjg@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 D03D927FC0; Fri, 16 Oct 2020 00:55:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09G0tVZS086340; Fri, 16 Oct 2020 00:55:31 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09G0tVxu086339; Fri, 16 Oct 2020 00:55:31 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010160055.09G0tVxu086339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 16 Oct 2020 00:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366741 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 00:55:32 -0000 Author: mjg Date: Fri Oct 16 00:55:31 2020 New Revision: 366741 URL: https://svnweb.freebsd.org/changeset/base/366741 Log: cache: dedup code for negative promotion Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Oct 16 00:55:09 2020 (r366740) +++ head/sys/kern/vfs_cache.c Fri Oct 16 00:55:31 2020 (r366741) @@ -807,22 +807,34 @@ cache_negative_init(struct namecache *ncp) } static void -cache_negative_hit(struct namecache *ncp) +cache_negative_promote(struct namecache *ncp) { struct neglist *nl; struct negstate *ns; ns = NCP2NEGSTATE(ncp); - if ((ns->neg_flag & NEG_HOT) != 0) - return; nl = NCP2NEGLIST(ncp); - mtx_lock(&nl->nl_lock); + mtx_assert(&nl->nl_lock, MA_OWNED); if ((ns->neg_flag & NEG_HOT) == 0) { TAILQ_REMOVE(&nl->nl_list, ncp, nc_dst); TAILQ_INSERT_TAIL(&nl->nl_hotlist, ncp, nc_dst); nl->nl_hotnum++; ns->neg_flag |= NEG_HOT; } +} + +static void +cache_negative_hit(struct namecache *ncp) +{ + struct neglist *nl; + struct negstate *ns; + + ns = NCP2NEGSTATE(ncp); + if ((ns->neg_flag & NEG_HOT) != 0) + return; + nl = NCP2NEGLIST(ncp); + mtx_lock(&nl->nl_lock); + cache_negative_promote(ncp); mtx_unlock(&nl->nl_lock); } @@ -3376,7 +3388,6 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, struct componentname *cnp; struct namecache *ncp; struct neglist *nl; - struct negstate *ns; struct vnode *dvp; u_char nc_flag; @@ -3434,13 +3445,7 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, goto out_abort; } - ns = NCP2NEGSTATE(ncp); - if ((ns->neg_flag & NEG_HOT) == 0) { - TAILQ_REMOVE(&nl->nl_list, ncp, nc_dst); - TAILQ_INSERT_TAIL(&nl->nl_hotlist, ncp, nc_dst); - nl->nl_hotnum++; - ns->neg_flag |= NEG_HOT; - } + cache_negative_promote(ncp); SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); counter_u64_add(numneghits, 1); From owner-svn-src-head@freebsd.org Fri Oct 16 00:55:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EA6E44B13C; Fri, 16 Oct 2020 00:55:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CC74Y6cCRz4F0M; Fri, 16 Oct 2020 00:55:57 +0000 (UTC) (envelope-from mjg@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 C5C6E86EE; Fri, 16 Oct 2020 00:55:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09G0tvSZ086405; Fri, 16 Oct 2020 00:55:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09G0tvLf086404; Fri, 16 Oct 2020 00:55:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010160055.09G0tvLf086404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 16 Oct 2020 00:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366742 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 00:55:58 -0000 Author: mjg Date: Fri Oct 16 00:55:57 2020 New Revision: 366742 URL: https://svnweb.freebsd.org/changeset/base/366742 Log: cache: elide vhold/vdrop around promoting negative entry Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Oct 16 00:55:31 2020 (r366741) +++ head/sys/kern/vfs_cache.c Fri Oct 16 00:55:57 2020 (r366742) @@ -3394,9 +3394,6 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, cnp = fpl->cnp; dvp = fpl->dvp; - if (!vhold_smr(dvp)) - return (cache_fpl_aborted(fpl)); - nl = NCP2NEGLIST(oncp); cache_fpl_smr_exit(fpl); @@ -3409,6 +3406,10 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, /* * Avoid all surprises by only succeeding if we got the same entry and * bailing completely otherwise. + * XXX There are no provisions to keep the vnode around, meaning we may + * end up promoting a negative entry for a *new* vnode and returning + * ENOENT on its account. This is the error we want to return anyway + * and promotion is harmless. * * In particular at this point there can be a new ncp which matches the * search but hashes to a different neglist. @@ -3451,12 +3452,10 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, counter_u64_add(numneghits, 1); cache_fpl_smr_exit(fpl); mtx_unlock(&nl->nl_lock); - vdrop(dvp); return (cache_fpl_handled(fpl, ENOENT)); out_abort: cache_fpl_smr_exit(fpl); mtx_unlock(&nl->nl_lock); - vdrop(dvp); return (cache_fpl_aborted(fpl)); } From owner-svn-src-head@freebsd.org Fri Oct 16 00:56:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C712544B248; Fri, 16 Oct 2020 00:56:14 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CC74t4Zqlz4FDk; Fri, 16 Oct 2020 00:56:14 +0000 (UTC) (envelope-from mjg@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 814DD84EC; Fri, 16 Oct 2020 00:56:14 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09G0uEmh086465; Fri, 16 Oct 2020 00:56:14 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09G0uEag086464; Fri, 16 Oct 2020 00:56:14 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010160056.09G0uEag086464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 16 Oct 2020 00:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366743 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366743 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 00:56:14 -0000 Author: mjg Date: Fri Oct 16 00:56:13 2020 New Revision: 366743 URL: https://svnweb.freebsd.org/changeset/base/366743 Log: cache: support negative entry promotion in slowpath smr Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Oct 16 00:55:57 2020 (r366742) +++ head/sys/kern/vfs_cache.c Fri Oct 16 00:56:13 2020 (r366743) @@ -806,6 +806,9 @@ cache_negative_init(struct namecache *ncp) ns->neg_flag = 0; } +/* + * Move a negative entry to the hot list. + */ static void cache_negative_promote(struct namecache *ncp) { @@ -823,6 +826,87 @@ cache_negative_promote(struct namecache *ncp) } } +/* + * Move a negative entry to the hot list if it matches the lookup. + * + * We have to take locks, but they may be contended and in the worst + * case we may need to go off CPU. We don't want to spin within the + * smr section and we can't block with it. Exiting the section means + * the found entry could have been evicted. We are going to look it + * up again. + */ +static bool +cache_negative_promote_cond(struct vnode *dvp, struct componentname *cnp, + struct namecache *oncp, uint32_t hash) +{ + struct namecache *ncp; + struct neglist *nl; + u_char nc_flag; + + nl = NCP2NEGLIST(oncp); + + mtx_lock(&nl->nl_lock); + /* + * For hash iteration. + */ + vfs_smr_enter(); + + /* + * Avoid all surprises by only succeeding if we got the same entry and + * bailing completely otherwise. + * XXX There are no provisions to keep the vnode around, meaning we may + * end up promoting a negative entry for a *new* vnode and returning + * ENOENT on its account. This is the error we want to return anyway + * and promotion is harmless. + * + * In particular at this point there can be a new ncp which matches the + * search but hashes to a different neglist. + */ + CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + if (ncp == oncp) + break; + } + + /* + * No match to begin with. + */ + if (__predict_false(ncp == NULL)) { + goto out_abort; + } + + /* + * The newly found entry may be something different... + */ + if (!(ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && + !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen))) { + goto out_abort; + } + + /* + * ... and not even negative. + */ + nc_flag = atomic_load_char(&ncp->nc_flag); + if ((nc_flag & NCF_NEGATIVE) == 0) { + goto out_abort; + } + + if (__predict_false(!cache_ncp_canuse(ncp))) { + goto out_abort; + } + + cache_negative_promote(ncp); + + SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); + counter_u64_add(numneghits, 1); + vfs_smr_exit(); + mtx_unlock(&nl->nl_lock); + return (true); +out_abort: + vfs_smr_exit(); + mtx_unlock(&nl->nl_lock); + return (false); +} + static void cache_negative_hit(struct namecache *ncp) { @@ -1455,7 +1539,7 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st uint32_t hash; enum vgetstate vs; int error; - bool whiteout; + bool whiteout, neg_hot; u_short nc_flag; MPASS((tsp == NULL && ticksp == NULL) || (tsp != NULL && ticksp != NULL)); @@ -1532,21 +1616,23 @@ negative_success: } } - SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); cache_out_ts(ncp, tsp, ticksp); - counter_u64_add(numneghits, 1); whiteout = (ncp->nc_flag & NCF_WHITE); - /* - * TODO: We need to take locks to promote an entry. Code doing it - * in SMR lookup can be modified to be shared. - */ ns = NCP2NEGSTATE(ncp); - if ((ns->neg_flag & NEG_HOT) == 0 || - !cache_ncp_canuse(ncp)) { + neg_hot = ((ns->neg_flag & NEG_HOT) != 0); + if (__predict_false(!cache_ncp_canuse(ncp))) { vfs_smr_exit(); goto out_fallback; } - vfs_smr_exit(); + if (neg_hot) { + vfs_smr_exit(); + if (!cache_negative_promote_cond(dvp, cnp, ncp, hash)) + goto out_fallback; + } else { + SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); + counter_u64_add(numneghits, 1); + vfs_smr_exit(); + } if (whiteout) cnp->cn_flags |= ISWHITEOUT; return (ENOENT); @@ -3373,90 +3459,21 @@ cache_fplookup_vnode_supported(struct vnode *vp) return (vp->v_type != VLNK); } -/* - * Move a negative entry to the hot list. - * - * We have to take locks, but they may be contended and in the worst - * case we may need to go off CPU. We don't want to spin within the - * smr section and we can't block with it. Instead we are going to - * look up the entry again. - */ static int __noinline cache_fplookup_negative_promote(struct cache_fpl *fpl, struct namecache *oncp, uint32_t hash) { struct componentname *cnp; - struct namecache *ncp; - struct neglist *nl; struct vnode *dvp; - u_char nc_flag; cnp = fpl->cnp; dvp = fpl->dvp; - nl = NCP2NEGLIST(oncp); cache_fpl_smr_exit(fpl); - - mtx_lock(&nl->nl_lock); - /* - * For hash iteration. - */ - cache_fpl_smr_enter(fpl); - - /* - * Avoid all surprises by only succeeding if we got the same entry and - * bailing completely otherwise. - * XXX There are no provisions to keep the vnode around, meaning we may - * end up promoting a negative entry for a *new* vnode and returning - * ENOENT on its account. This is the error we want to return anyway - * and promotion is harmless. - * - * In particular at this point there can be a new ncp which matches the - * search but hashes to a different neglist. - */ - CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { - if (ncp == oncp) - break; - } - - /* - * No match to begin with. - */ - if (__predict_false(ncp == NULL)) { - goto out_abort; - } - - /* - * The newly found entry may be something different... - */ - if (!(ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && - !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen))) { - goto out_abort; - } - - /* - * ... and not even negative. - */ - nc_flag = atomic_load_char(&ncp->nc_flag); - if ((nc_flag & NCF_NEGATIVE) == 0) { - goto out_abort; - } - - if (__predict_false(!cache_ncp_canuse(ncp))) { - goto out_abort; - } - - cache_negative_promote(ncp); - - SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); - counter_u64_add(numneghits, 1); - cache_fpl_smr_exit(fpl); - mtx_unlock(&nl->nl_lock); - return (cache_fpl_handled(fpl, ENOENT)); -out_abort: - cache_fpl_smr_exit(fpl); - mtx_unlock(&nl->nl_lock); - return (cache_fpl_aborted(fpl)); + if (cache_negative_promote_cond(dvp, cnp, oncp, hash)) + return (cache_fpl_handled(fpl, ENOENT)); + else + return (cache_fpl_aborted(fpl)); } /* From owner-svn-src-head@freebsd.org Fri Oct 16 02:19:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2098E44C7C3; Fri, 16 Oct 2020 02:19:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CC8x16xyfz4JW1; Fri, 16 Oct 2020 02:19:33 +0000 (UTC) (envelope-from mjg@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 CEAAF94E7; Fri, 16 Oct 2020 02:19:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09G2JXSp035622; Fri, 16 Oct 2020 02:19:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09G2JXuD035621; Fri, 16 Oct 2020 02:19:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010160219.09G2JXuD035621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 16 Oct 2020 02:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366744 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 02:19:34 -0000 Author: mjg Date: Fri Oct 16 02:19:33 2020 New Revision: 366744 URL: https://svnweb.freebsd.org/changeset/base/366744 Log: cache: flip inverted condition in previous It happened to not affect correctness in that the fallback code would simply neglect to promote the entry. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Oct 16 00:56:13 2020 (r366743) +++ head/sys/kern/vfs_cache.c Fri Oct 16 02:19:33 2020 (r366744) @@ -1624,7 +1624,7 @@ negative_success: vfs_smr_exit(); goto out_fallback; } - if (neg_hot) { + if (!neg_hot) { vfs_smr_exit(); if (!cache_negative_promote_cond(dvp, cnp, ncp, hash)) goto out_fallback; From owner-svn-src-head@freebsd.org Fri Oct 16 09:58:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C7DF42EAE3; Fri, 16 Oct 2020 09:58:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCM6C3lMbz4hZp; Fri, 16 Oct 2020 09:58:11 +0000 (UTC) (envelope-from trasz@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 5E621E576; Fri, 16 Oct 2020 09:58:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09G9wBqH018388; Fri, 16 Oct 2020 09:58:11 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09G9wBIq018387; Fri, 16 Oct 2020 09:58:11 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010160958.09G9wBIq018387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 16 Oct 2020 09:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366748 - head/sys/fs/pseudofs X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/fs/pseudofs X-SVN-Commit-Revision: 366748 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 09:58:11 -0000 Author: trasz Date: Fri Oct 16 09:58:10 2020 New Revision: 366748 URL: https://svnweb.freebsd.org/changeset/base/366748 Log: Bump pseudofs size limit from 128kB to 1MB. The old limit could result in process' memory maps being truncated. PR: 237883 Submitted by: dchagin MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20575 Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Fri Oct 16 08:56:20 2020 (r366747) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Fri Oct 16 09:58:10 2020 (r366748) @@ -68,6 +68,8 @@ __FBSDID("$FreeBSD$"); KASSERT((pn)->pn_type == pfstype_symlink, \ ("%s(): VLNK vnode refers to non-link pfs_node", __func__)) +#define PFS_MAXBUFSIZ 1024 * 1024 + /* * Returns the fileno, adjusted for target pid */ @@ -677,8 +679,8 @@ pfs_read(struct vop_read_args *va) goto ret; } buflen = uio->uio_offset + uio->uio_resid; - if (buflen > MAXPHYS) - buflen = MAXPHYS; + if (buflen > PFS_MAXBUFSIZ) + buflen = PFS_MAXBUFSIZ; sb = sbuf_new(sb, NULL, buflen + 1, 0); if (sb == NULL) { From owner-svn-src-head@freebsd.org Fri Oct 16 10:10:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 835F842F786; Fri, 16 Oct 2020 10:10:10 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCMN22s4Zz4jJ8; Fri, 16 Oct 2020 10:10:10 +0000 (UTC) (envelope-from trasz@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 45487ED10; Fri, 16 Oct 2020 10:10:10 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GAAAe5024792; Fri, 16 Oct 2020 10:10:10 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GAA9J0024790; Fri, 16 Oct 2020 10:10:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010161010.09GAA9J0024790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 16 Oct 2020 10:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366749 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 366749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 10:10:10 -0000 Author: trasz Date: Fri Oct 16 10:10:09 2020 New Revision: 366749 URL: https://svnweb.freebsd.org/changeset/base/366749 Log: Make linux getrlimit(2) and prlimit(2) return something reasonable for linux-specific limits. Fixes prlimit (util-linux-2.31.1-0.4ubuntu3.7). Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26777 Modified: head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_misc.h Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Fri Oct 16 09:58:10 2020 (r366748) +++ head/sys/compat/linux/linux_misc.c Fri Oct 16 10:10:09 2020 (r366749) @@ -1373,6 +1373,28 @@ linux_getgroups(struct thread *td, struct linux_getgro return (0); } +static bool +linux_get_dummy_limit(l_uint resource, struct rlimit *rlim) +{ + + switch (resource) { + case LINUX_RLIMIT_LOCKS: + case LINUX_RLIMIT_SIGPENDING: + case LINUX_RLIMIT_MSGQUEUE: + case LINUX_RLIMIT_RTTIME: + rlim->rlim_cur = LINUX_RLIM_INFINITY; + rlim->rlim_max = LINUX_RLIM_INFINITY; + return (true); + case LINUX_RLIMIT_NICE: + case LINUX_RLIMIT_RTPRIO: + rlim->rlim_cur = 0; + rlim->rlim_max = 0; + return (true); + default: + return (false); + } +} + int linux_setrlimit(struct thread *td, struct linux_setrlimit_args *args) { @@ -1405,6 +1427,12 @@ linux_old_getrlimit(struct thread *td, struct linux_ol struct rlimit bsd_rlim; u_int which; + if (linux_get_dummy_limit(args->resource, &bsd_rlim)) { + rlim.rlim_cur = bsd_rlim.rlim_cur; + rlim.rlim_max = bsd_rlim.rlim_max; + return (copyout(&rlim, args->rlim, sizeof(rlim))); + } + if (args->resource >= LINUX_RLIM_NLIMITS) return (EINVAL); @@ -1440,6 +1468,12 @@ linux_getrlimit(struct thread *td, struct linux_getrli struct rlimit bsd_rlim; u_int which; + if (linux_get_dummy_limit(args->resource, &bsd_rlim)) { + rlim.rlim_cur = bsd_rlim.rlim_cur; + rlim.rlim_max = bsd_rlim.rlim_max; + return (copyout(&rlim, args->rlim, sizeof(rlim))); + } + if (args->resource >= LINUX_RLIM_NLIMITS) return (EINVAL); @@ -2137,6 +2171,14 @@ linux_prlimit64(struct thread *td, struct linux_prlimi u_int which; int flags; int error; + + if (args->new == NULL && args->old != NULL) { + if (linux_get_dummy_limit(args->resource, &rlim)) { + lrlim.rlim_cur = rlim.rlim_cur; + lrlim.rlim_max = rlim.rlim_max; + return (copyout(&lrlim, args->old, sizeof(lrlim))); + } + } if (args->resource >= LINUX_RLIM_NLIMITS) return (EINVAL); Modified: head/sys/compat/linux/linux_misc.h ============================================================================== --- head/sys/compat/linux/linux_misc.h Fri Oct 16 09:58:10 2020 (r366748) +++ head/sys/compat/linux/linux_misc.h Fri Oct 16 10:10:09 2020 (r366749) @@ -137,12 +137,12 @@ extern int stclohz; #define LINUX_P_PID 1 #define LINUX_P_PGID 2 -#define LINUX_RLIMIT_LOCKS RLIM_NLIMITS + 1 -#define LINUX_RLIMIT_SIGPENDING RLIM_NLIMITS + 2 -#define LINUX_RLIMIT_MSGQUEUE RLIM_NLIMITS + 3 -#define LINUX_RLIMIT_NICE RLIM_NLIMITS + 4 -#define LINUX_RLIMIT_RTPRIO RLIM_NLIMITS + 5 -#define LINUX_RLIMIT_RTTIME RLIM_NLIMITS + 6 +#define LINUX_RLIMIT_LOCKS 10 +#define LINUX_RLIMIT_SIGPENDING 11 +#define LINUX_RLIMIT_MSGQUEUE 12 +#define LINUX_RLIMIT_NICE 13 +#define LINUX_RLIMIT_RTPRIO 14 +#define LINUX_RLIMIT_RTTIME 15 #define LINUX_RLIM_INFINITY (~0UL) From owner-svn-src-head@freebsd.org Fri Oct 16 10:44:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F783430583; Fri, 16 Oct 2020 10:44:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCN822vFzz4l6y; Fri, 16 Oct 2020 10:44:50 +0000 (UTC) (envelope-from tuexen@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 448C0F04A; Fri, 16 Oct 2020 10:44:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GAior4048947; Fri, 16 Oct 2020 10:44:50 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GAinwx048942; Fri, 16 Oct 2020 10:44:49 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010161044.09GAinwx048942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 16 Oct 2020 10:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366750 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 10:44:50 -0000 Author: tuexen Date: Fri Oct 16 10:44:48 2020 New Revision: 366750 URL: https://svnweb.freebsd.org/changeset/base/366750 Log: Improve the handling of cookie life times. The staleness reported in an error cause is in us, not ms. Enforce limits on the life time via sysct; and socket options consistently. Update the description of the sysctl variable to use the right unit. Also do some minor cleanups. This also fixes an interger overflow issue if the peer can modify the cookie. This was reported by Felix Weinrank by fuzz testing the userland stack and in https://oss-fuzz.com/testcase-detail/4800394024452096 MFC after: 3 days Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Fri Oct 16 10:10:09 2020 (r366749) +++ head/sys/netinet/sctp.h Fri Oct 16 10:44:48 2020 (r366750) @@ -599,6 +599,7 @@ struct sctp_error_auth_invalid_hmac { */ #define SCTP_MAX_SACK_DELAY 500 /* per RFC4960 */ #define SCTP_MAX_HB_INTERVAL 14400000 /* 4 hours in ms */ +#define SCTP_MIN_COOKIE_LIFE 1000 /* 1 second in ms */ #define SCTP_MAX_COOKIE_LIFE 3600000 /* 1 hour in ms */ /* Types of logging/KTR tracing that can be enabled via the Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Fri Oct 16 10:10:09 2020 (r366749) +++ head/sys/netinet/sctp_input.c Fri Oct 16 10:44:48 2020 (r366750) @@ -1164,13 +1164,10 @@ sctp_handle_error(struct sctp_chunkhdr *ch, struct sctp_error_stale_cookie *stale_cookie; stale_cookie = (struct sctp_error_stale_cookie *)cause; - asoc->cookie_preserve_req = ntohl(stale_cookie->stale_time); - /* Double it to be more robust on RTX */ - if (asoc->cookie_preserve_req <= UINT32_MAX / 2) { - asoc->cookie_preserve_req *= 2; - } else { - asoc->cookie_preserve_req = UINT32_MAX; - } + /* stable_time is in usec, convert to msec. */ + asoc->cookie_preserve_req = ntohl(stale_cookie->stale_time) / 1000; + /* Double it to be more robust on RTX. */ + asoc->cookie_preserve_req *= 2; asoc->stale_cookie_count++; if (asoc->stale_cookie_count > asoc->max_init_times) { @@ -2254,7 +2251,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in unsigned int sig_offset, cookie_offset; unsigned int cookie_len; struct timeval now; - struct timeval time_expires; + struct timeval time_entered, time_expires; int notification = 0; struct sctp_nets *netl; int had_a_existing_tcb = 0; @@ -2382,13 +2379,30 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in return (NULL); } + if (sctp_ticks_to_msecs(cookie->cookie_life) > SCTP_MAX_COOKIE_LIFE) { + SCTPDBG(SCTP_DEBUG_INPUT2, "handle_cookie_echo: Invalid cookie lifetime\n"); + return (NULL); + } + time_entered.tv_sec = cookie->time_entered.tv_sec; + time_entered.tv_usec = cookie->time_entered.tv_usec; + if ((time_entered.tv_sec < 0) || + (time_entered.tv_usec < 0) || + (time_entered.tv_usec >= 1000000)) { + /* Invalid time stamp. Cookie must have been modified. */ + SCTPDBG(SCTP_DEBUG_INPUT2, "handle_cookie_echo: Invalid time stamp\n"); + return (NULL); + } + (void)SCTP_GETTIME_TIMEVAL(&now); + if (timevalcmp(&now, &time_entered, <)) { + SCTPDBG(SCTP_DEBUG_INPUT2, "handle_cookie_echo: cookie generated in the future!\n"); + return (NULL); + } /* - * check the cookie timestamps to be sure it's not stale + * Check the cookie timestamps to be sure it's not stale. + * cookie_life is in ticks, so we convert to seconds. */ - (void)SCTP_GETTIME_TIMEVAL(&now); - /* Expire time is in Ticks, so we convert to seconds */ - time_expires.tv_sec = cookie->time_entered.tv_sec + sctp_ticks_to_secs(cookie->cookie_life); - time_expires.tv_usec = cookie->time_entered.tv_usec; + time_expires.tv_sec = time_entered.tv_sec + sctp_ticks_to_secs(cookie->cookie_life); + time_expires.tv_usec = time_entered.tv_usec; if (timevalcmp(&now, &time_expires, >)) { /* cookie is stale! */ struct mbuf *op_err; @@ -2406,8 +2420,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in SCTP_BUF_LEN(op_err) = sizeof(struct sctp_error_stale_cookie); cause = mtod(op_err, struct sctp_error_stale_cookie *); cause->cause.code = htons(SCTP_CAUSE_STALE_COOKIE); - cause->cause.length = htons((sizeof(struct sctp_paramhdr) + - (sizeof(uint32_t)))); + cause->cause.length = htons(sizeof(struct sctp_error_stale_cookie)); diff = now; timevalsub(&diff, &time_expires); if ((uint32_t)diff.tv_sec > UINT32_MAX / 1000000) { Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Oct 16 10:10:09 2020 (r366749) +++ head/sys/netinet/sctp_output.c Fri Oct 16 10:44:48 2020 (r366750) @@ -4814,7 +4814,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp } /* now any cookie time extensions */ - if (stcb->asoc.cookie_preserve_req) { + if (stcb->asoc.cookie_preserve_req > 0) { struct sctp_cookie_perserve_param *cookie_preserve; if (padding_len > 0) { Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Fri Oct 16 10:10:09 2020 (r366749) +++ head/sys/netinet/sctp_sysctl.h Fri Oct 16 10:44:48 2020 (r366750) @@ -317,10 +317,10 @@ struct sctp_sysctl { #define SCTPCTL_INIT_RTO_MAX_MAX 0xFFFFFFFF #define SCTPCTL_INIT_RTO_MAX_DEFAULT SCTP_RTO_UPPER_BOUND -/* valid_cookie_life: Default cookie lifetime in sec */ -#define SCTPCTL_VALID_COOKIE_LIFE_DESC "Default cookie lifetime in seconds" -#define SCTPCTL_VALID_COOKIE_LIFE_MIN 0 -#define SCTPCTL_VALID_COOKIE_LIFE_MAX 0xFFFFFFFF +/* valid_cookie_life: Default cookie lifetime in ms */ +#define SCTPCTL_VALID_COOKIE_LIFE_DESC "Default cookie lifetime in ms" +#define SCTPCTL_VALID_COOKIE_LIFE_MIN SCTP_MIN_COOKIE_LIFE +#define SCTPCTL_VALID_COOKIE_LIFE_MAX SCTP_MAX_COOKIE_LIFE #define SCTPCTL_VALID_COOKIE_LIFE_DEFAULT SCTP_DEFAULT_COOKIE_LIFE /* init_rtx_max: Default maximum number of retransmission for INIT chunks */ Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Fri Oct 16 10:10:09 2020 (r366749) +++ head/sys/netinet/sctp_usrreq.c Fri Oct 16 10:44:48 2020 (r366750) @@ -5699,18 +5699,20 @@ sctp_setopt(struct socket *so, int optname, void *optv SCTP_CHECK_AND_CAST(sasoc, optval, struct sctp_assocparams, optsize); SCTP_FIND_STCB(inp, stcb, sasoc->sasoc_assoc_id); - if (sasoc->sasoc_cookie_life) { + if (sasoc->sasoc_cookie_life > 0) { /* boundary check the cookie life */ - if (sasoc->sasoc_cookie_life < 1000) - sasoc->sasoc_cookie_life = 1000; + if (sasoc->sasoc_cookie_life < SCTP_MIN_COOKIE_LIFE) { + sasoc->sasoc_cookie_life = SCTP_MIN_COOKIE_LIFE; + } if (sasoc->sasoc_cookie_life > SCTP_MAX_COOKIE_LIFE) { sasoc->sasoc_cookie_life = SCTP_MAX_COOKIE_LIFE; } } if (stcb) { - if (sasoc->sasoc_asocmaxrxt) + if (sasoc->sasoc_asocmaxrxt > 0) { stcb->asoc.max_send_times = sasoc->sasoc_asocmaxrxt; - if (sasoc->sasoc_cookie_life) { + } + if (sasoc->sasoc_cookie_life > 0) { stcb->asoc.cookie_life = sctp_msecs_to_ticks(sasoc->sasoc_cookie_life); } SCTP_TCB_UNLOCK(stcb); @@ -5720,9 +5722,10 @@ sctp_setopt(struct socket *so, int optname, void *optv ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) && (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC))) { SCTP_INP_WLOCK(inp); - if (sasoc->sasoc_asocmaxrxt) + if (sasoc->sasoc_asocmaxrxt > 0) { inp->sctp_ep.max_send_times = sasoc->sasoc_asocmaxrxt; - if (sasoc->sasoc_cookie_life) { + } + if (sasoc->sasoc_cookie_life > 0) { inp->sctp_ep.def_cookie_life = sctp_msecs_to_ticks(sasoc->sasoc_cookie_life); } SCTP_INP_WUNLOCK(inp); From owner-svn-src-head@freebsd.org Fri Oct 16 10:47:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73D20430697; Fri, 16 Oct 2020 10:47:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCNCY09Lgz4lVd; Fri, 16 Oct 2020 10:47:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 09GAliqe024859 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 16 Oct 2020 13:47:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 09GAliqe024859 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 09GAliZx024858; Fri, 16 Oct 2020 13:47:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 16 Oct 2020 13:47:44 +0300 From: Konstantin Belousov To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366748 - head/sys/fs/pseudofs Message-ID: <20201016104744.GU2643@kib.kiev.ua> References: <202010160958.09G9wBIq018387@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010160958.09G9wBIq018387@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4CCNCY09Lgz4lVd X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 10:47:53 -0000 On Fri, Oct 16, 2020 at 09:58:11AM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Fri Oct 16 09:58:10 2020 > New Revision: 366748 > URL: https://svnweb.freebsd.org/changeset/base/366748 > > Log: > Bump pseudofs size limit from 128kB to 1MB. The old limit could result > in process' memory maps being truncated. New limit could as well. From owner-svn-src-head@freebsd.org Fri Oct 16 11:01:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEA96430AA7; Fri, 16 Oct 2020 11:01:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCNW54kSpz4mLK; Fri, 16 Oct 2020 11:01:21 +0000 (UTC) (envelope-from hselasky@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 85A4CF5C0; Fri, 16 Oct 2020 11:01:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GB1LUb057201; Fri, 16 Oct 2020 11:01:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GB1L6o057200; Fri, 16 Oct 2020 11:01:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010161101.09GB1L6o057200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 16 Oct 2020 11:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366751 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 366751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 11:01:21 -0000 Author: hselasky Date: Fri Oct 16 11:01:21 2020 New Revision: 366751 URL: https://svnweb.freebsd.org/changeset/base/366751 Log: Remove ifdefs around IS_ALIGNED() definition in the LinuxKPI. Discussed with: manu@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Fri Oct 16 10:44:48 2020 (r366750) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Fri Oct 16 11:01:21 2020 (r366751) @@ -135,10 +135,7 @@ extern const volatile int lkpi_build_bug_on_zero; #define ALIGN(x, y) roundup2((x), (y)) #undef PTR_ALIGN #define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) -#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 -/* Moved from linuxkpi_gplv2 */ #define IS_ALIGNED(x, a) (((x) & ((__typeof(x))(a) - 1)) == 0) -#endif #define DIV_ROUND_UP(x, n) howmany(x, n) #define __KERNEL_DIV_ROUND_UP(x, n) howmany(x, n) #define DIV_ROUND_UP_ULL(x, n) DIV_ROUND_UP((unsigned long long)(x), (n)) From owner-svn-src-head@freebsd.org Fri Oct 16 11:06:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DEB84430D9F; Fri, 16 Oct 2020 11:06:34 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCNd65VWSz4mft; Fri, 16 Oct 2020 11:06:34 +0000 (UTC) (envelope-from mw@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 A0357F72C; Fri, 16 Oct 2020 11:06:34 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GB6Y1V061326; Fri, 16 Oct 2020 11:06:34 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GB6X7d061322; Fri, 16 Oct 2020 11:06:33 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202010161106.09GB6X7d061322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Fri, 16 Oct 2020 11:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366752 - in head: share/man/man9 sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head: share/man/man9 sys/opencrypto X-SVN-Commit-Revision: 366752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 11:06:34 -0000 Author: mw Date: Fri Oct 16 11:06:33 2020 New Revision: 366752 URL: https://svnweb.freebsd.org/changeset/base/366752 Log: Prepare crypto framework for IPsec ESN support This permits requests (netipsec ESP and AH protocol) to provide the IPsec ESN (Extended Sequence Numbers) in a separate buffer. As with separate output buffer and separate AAD buffer not all drivers support this feature. Consumer must request use of this feature via new session flag. Submitted by: Grzegorz Jaszczyk Patryk Duda Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D24838 Obtained from: Semihalf Sponsored by: Stormshield Modified: head/share/man/man9/crypto_request.9 head/share/man/man9/crypto_session.9 head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h Modified: head/share/man/man9/crypto_request.9 ============================================================================== --- head/share/man/man9/crypto_request.9 Fri Oct 16 11:01:21 2020 (r366751) +++ head/share/man/man9/crypto_request.9 Fri Oct 16 11:06:33 2020 (r366752) @@ -302,6 +302,24 @@ as a single buffer pointed to by In either case, .Fa crp_aad_length always indicates the amount of AAD in bytes. +.Ss Request ESN +IPsec requests may optionally include Extended Sequence Numbers (ESN). +ESN may either be supplied in +.Fa crp_esn +or as part of the AAD pointed to by +.Fa crp_aad . +.Pp +If the ESN is stored in +.Fa crp_esn , +.Dv CSP_F_ESN +should be set in +.Fa csp_flags . +This use case is dedicated for encrypt and authenticate mode, since the +high-order 32 bits of the sequence number are appended after the Next Header +(RFC 4303). +.Pp +AEAD modes supply the ESN in a separate AAD buffer (see e.g. RFC 4106, Chapter 5 +AAD Construction). .Ss Request IV and/or Nonce Some cryptographic operations require an IV or nonce as an input. An IV may be stored either in the IV region of the data buffer or in Modified: head/share/man/man9/crypto_session.9 ============================================================================== --- head/share/man/man9/crypto_session.9 Fri Oct 16 11:01:21 2020 (r366751) +++ head/share/man/man9/crypto_session.9 Fri Oct 16 11:06:33 2020 (r366752) @@ -201,6 +201,15 @@ Sessions with this flag set permit requests with AAD p a region of the input buffer or in a single, virtually-contiguous buffer. Sessions without this flag only permit requests with AAD passed in as a region in the input buffer. +.It Dv CSP_F_ESN +Support requests that use a separate buffer for IPsec ESN (Extended Sequence +Numbers). +.Pp +Sessions with this flag set permit requests with IPsec ESN passed in special +buffer. +It is required for IPsec ESN support of encrypt and authenticate mode where +the high-order 32 bits of the sequence number are appended after the Next +Header (RFC 4303). .El .It Fa csp_ivlen If either the cipher or authentication algorithms require an explicit Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Fri Oct 16 11:01:21 2020 (r366751) +++ head/sys/opencrypto/crypto.c Fri Oct 16 11:06:33 2020 (r366752) @@ -743,6 +743,8 @@ alg_is_aead(int alg) return (alg_type(alg) == ALG_AEAD); } +#define SUPPORTED_SES (CSP_F_SEPARATE_OUTPUT | CSP_F_SEPARATE_AAD | CSP_F_ESN) + /* Various sanity checks on crypto session parameters. */ static bool check_csp(const struct crypto_session_params *csp) @@ -750,8 +752,7 @@ check_csp(const struct crypto_session_params *csp) struct auth_hash *axf; /* Mode-independent checks. */ - if ((csp->csp_flags & ~(CSP_F_SEPARATE_OUTPUT | CSP_F_SEPARATE_AAD)) != - 0) + if ((csp->csp_flags & ~(SUPPORTED_SES)) != 0) return (false); if (csp->csp_ivlen < 0 || csp->csp_cipher_klen < 0 || csp->csp_auth_klen < 0 || csp->csp_auth_mlen < 0) Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Fri Oct 16 11:01:21 2020 (r366751) +++ head/sys/opencrypto/cryptodev.h Fri Oct 16 11:06:33 2020 (r366752) @@ -377,6 +377,7 @@ struct crypto_session_params { #define CSP_F_SEPARATE_OUTPUT 0x0001 /* Requests can use separate output */ #define CSP_F_SEPARATE_AAD 0x0002 /* Requests can use separate AAD */ +#define CSP_F_ESN 0x0004 /* Requests can use seperate ESN field */ int csp_ivlen; /* IV length in bytes. */ @@ -485,6 +486,8 @@ struct cryptop { void *crp_aad; /* AAD buffer. */ int crp_aad_start; /* Location of AAD. */ int crp_aad_length; /* 0 => no AAD. */ + uint8_t crp_esn[4]; /* high-order ESN */ + int crp_iv_start; /* Location of IV. IV length is from * the session. */ From owner-svn-src-head@freebsd.org Fri Oct 16 11:18:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C87E5431069; Fri, 16 Oct 2020 11:18:13 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCNtY4wzjz4n0c; Fri, 16 Oct 2020 11:18:13 +0000 (UTC) (envelope-from mw@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 8CA40F986; Fri, 16 Oct 2020 11:18:13 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GBIDJY067776; Fri, 16 Oct 2020 11:18:13 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GBIDSv067775; Fri, 16 Oct 2020 11:18:13 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202010161118.09GBIDSv067775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Fri, 16 Oct 2020 11:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366753 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 366753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 11:18:13 -0000 Author: mw Date: Fri Oct 16 11:18:13 2020 New Revision: 366753 URL: https://svnweb.freebsd.org/changeset/base/366753 Log: Add support for ESN in cryptosoft This patch adds support for IPsec ESN (Extended Sequence Numbers) in encrypt and authenticate mode (eg. AES-CBC and SHA256) and combined mode (eg. AES-GCM). For encrypt and authenticate mode the ESN is stored in separate crp_esn buffer because the high-order 32 bits of the sequence number are appended after the Next Header (RFC 4303). For combined modes the high-order 32 bits of the sequence number [e.g. RFC 4106, Chapter 5 AAD Construction] are part of crp_aad (prepared by netipsec layer in case of ESN support enabled), therefore non visible diff around combined modes. Submitted by: Grzegorz Jaszczyk Patryk Duda Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D22364 Obtained from: Semihalf Sponsored by: Stormshield Modified: head/sys/opencrypto/cryptosoft.c Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Fri Oct 16 11:06:33 2020 (r366752) +++ head/sys/opencrypto/cryptosoft.c Fri Oct 16 11:18:13 2020 (r366753) @@ -327,8 +327,8 @@ swcr_authcompute(struct swcr_session *ses, struct cryp axf = sw->sw_axf; + csp = crypto_get_params(crp->crp_session); if (crp->crp_auth_key != NULL) { - csp = crypto_get_params(crp->crp_session); swcr_authprepare(axf, sw, crp->crp_auth_key, csp->csp_auth_klen); } @@ -354,6 +354,9 @@ swcr_authcompute(struct swcr_session *ses, struct cryp if (err) goto out; + if (csp->csp_flags & CSP_F_ESN) + axf->Update(&ctx, crp->crp_esn, 4); + axf->Final(aalg, &ctx); if (sw->sw_octx != NULL) { bcopy(sw->sw_octx, &ctx, axf->ctxsize); @@ -1235,12 +1238,12 @@ swcr_cipher_supported(const struct crypto_session_para return (true); } +#define SUPPORTED_SES (CSP_F_SEPARATE_OUTPUT | CSP_F_SEPARATE_AAD | CSP_F_ESN) + static int swcr_probesession(device_t dev, const struct crypto_session_params *csp) { - - if ((csp->csp_flags & ~(CSP_F_SEPARATE_OUTPUT | CSP_F_SEPARATE_AAD)) != - 0) + if ((csp->csp_flags & ~(SUPPORTED_SES)) != 0) return (EINVAL); switch (csp->csp_mode) { case CSP_MODE_COMPRESS: From owner-svn-src-head@freebsd.org Fri Oct 16 11:21:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 49BBB43159B; Fri, 16 Oct 2020 11:21:57 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCNys1H5rz4nLq; Fri, 16 Oct 2020 11:21:57 +0000 (UTC) (envelope-from mw@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 0F940F7CC; Fri, 16 Oct 2020 11:21:57 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GBLuYg073546; Fri, 16 Oct 2020 11:21:56 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GBLuow073545; Fri, 16 Oct 2020 11:21:56 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202010161121.09GBLuow073545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Fri, 16 Oct 2020 11:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366754 - head/sys/crypto/aesni X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/crypto/aesni X-SVN-Commit-Revision: 366754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 11:21:57 -0000 Author: mw Date: Fri Oct 16 11:21:56 2020 New Revision: 366754 URL: https://svnweb.freebsd.org/changeset/base/366754 Log: Add support for ESN in AES-NI crypto driver This patch adds support for IPsec ESN (Extended Sequence Numbers) in encrypt and authenticate mode (eg. AES-CBC and SHA256) and combined mode (eg. AES-GCM). For the encrypt and authenticate mode the ESN is stored in separate crp_esn buffer because the high-order 32 bits of the sequence number are appended after the Next Header (RFC 4303). For the combined modes the high-order 32 bits of the sequence number [e.g. RFC 4106, Chapter 5 AAD Construction] are part of crp_aad (prepared by netipsec layer in case of ESN support enabled), therefore non visible diff around combined modes. Submitted by: Grzegorz Jaszczyk Patryk Duda Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D22365 Obtained from: Semihalf Sponsored by: Stormshield Modified: head/sys/crypto/aesni/aesni.c Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Fri Oct 16 11:18:13 2020 (r366753) +++ head/sys/crypto/aesni/aesni.c Fri Oct 16 11:21:56 2020 (r366754) @@ -249,14 +249,15 @@ aesni_cipher_supported(struct aesni_softc *sc, } } +#define SUPPORTED_SES (CSP_F_SEPARATE_OUTPUT | CSP_F_SEPARATE_AAD | CSP_F_ESN) + static int aesni_probesession(device_t dev, const struct crypto_session_params *csp) { struct aesni_softc *sc; sc = device_get_softc(dev); - if ((csp->csp_flags & ~(CSP_F_SEPARATE_OUTPUT | CSP_F_SEPARATE_AAD)) != - 0) + if ((csp->csp_flags & ~(SUPPORTED_SES)) != 0) return (EINVAL); switch (csp->csp_mode) { case CSP_MODE_DIGEST: @@ -864,6 +865,10 @@ aesni_cipher_mac(struct aesni_session *ses, struct cry else crypto_apply(crp, crp->crp_payload_start, crp->crp_payload_length, ses->hash_update, &sctx); + + if (csp->csp_flags & CSP_F_ESN) + ses->hash_update(&sctx, crp->crp_esn, 4); + ses->hash_finalize(res, &sctx); /* Outer hash: (K ^ OPAD) || inner hash */ From owner-svn-src-head@freebsd.org Fri Oct 16 11:22:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12CB94315A9; Fri, 16 Oct 2020 11:22:30 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCNzT6nCFz4npl; Fri, 16 Oct 2020 11:22:29 +0000 (UTC) (envelope-from mw@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 CC741F9A4; Fri, 16 Oct 2020 11:22:29 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GBMTeA073644; Fri, 16 Oct 2020 11:22:29 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GBMTsM073643; Fri, 16 Oct 2020 11:22:29 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202010161122.09GBMTsM073643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Fri, 16 Oct 2020 11:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366755 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 366755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 11:22:30 -0000 Author: mw Date: Fri Oct 16 11:22:29 2020 New Revision: 366755 URL: https://svnweb.freebsd.org/changeset/base/366755 Log: Add SADB_SAFLAGS_ESN flag This flag is going to be used by IKE daemon to signal if Extended Sequence Number feature is going to be used. Value for this flag was taken from OpenBSD source code https://github.com/openbsd/src/commit/6b4cbaf181c6b60701d9fb888fd0e7a4333eecbd Submitted by: Patryk Duda Reviewed by: ae Differential revision: https://reviews.freebsd.org/D22366 Obtained from: Semihalf Sponsored by: Stormshield Modified: head/sys/net/pfkeyv2.h Modified: head/sys/net/pfkeyv2.h ============================================================================== --- head/sys/net/pfkeyv2.h Fri Oct 16 11:21:56 2020 (r366754) +++ head/sys/net/pfkeyv2.h Fri Oct 16 11:22:29 2020 (r366755) @@ -348,6 +348,8 @@ _Static_assert(sizeof(struct sadb_x_sa_replay) == 8, " #define SADB_SASTATE_MAX 3 #define SADB_SAFLAGS_PFS 1 +/* SADB_X_SAFLAGS_ESN was defined in sys/net/pfkeyv2.h in OpenBSD sources */ +#define SADB_X_SAFLAGS_ESN 0x400 /* * Though some of these numbers (both _AALG and _EALG) appear to be From owner-svn-src-head@freebsd.org Fri Oct 16 11:23:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D98C431540; Fri, 16 Oct 2020 11:23:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCP0g2r2nz4p8P; Fri, 16 Oct 2020 11:23:31 +0000 (UTC) (envelope-from trasz@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 44E5AF3FF; Fri, 16 Oct 2020 11:23:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GBNVkW073740; Fri, 16 Oct 2020 11:23:31 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GBNUhp073737; Fri, 16 Oct 2020 11:23:30 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010161123.09GBNUhp073737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 16 Oct 2020 11:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366756 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 366756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 11:23:31 -0000 Author: trasz Date: Fri Oct 16 11:23:30 2020 New Revision: 366756 URL: https://svnweb.freebsd.org/changeset/base/366756 Log: Set default stack size for Linux apps to 8MB. This matches Linux' defaults, makes core files smaller, and fixes applications which use pthread_join(3) in a wrong way, namely Steam. This is based on a patch submitted by Jason Yang, which I've reworked to set the limit instead of only changing the value reported (which is enough to fix the bug for Linux pthreads, but could be confusing). PR: 248225 Submitted by: Jason_YH_Yang at wistron.com (earlier version) Analyzed by: Alex S Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26778 Modified: head/sys/compat/linux/linux_emul.c head/sys/compat/linux/linux_mib.c head/sys/compat/linux/linux_mib.h Modified: head/sys/compat/linux/linux_emul.c ============================================================================== --- head/sys/compat/linux/linux_emul.c Fri Oct 16 11:22:29 2020 (r366755) +++ head/sys/compat/linux/linux_emul.c Fri Oct 16 11:23:30 2020 (r366756) @@ -115,6 +115,29 @@ linux_set_default_openfiles(struct thread *td, struct KASSERT(error == 0, ("kern_proc_setrlimit failed")); } +/* + * The default stack size limit in Linux is 8MB. + */ +static void +linux_set_default_stacksize(struct thread *td, struct proc *p) +{ + struct rlimit rlim; + int error; + + if (linux_default_stacksize < 0) + return; + + PROC_LOCK(p); + lim_rlimit_proc(p, RLIMIT_STACK, &rlim); + PROC_UNLOCK(p); + if (rlim.rlim_cur != rlim.rlim_max || + rlim.rlim_cur <= linux_default_stacksize) + return; + rlim.rlim_cur = linux_default_stacksize; + error = kern_proc_setrlimit(td, p, RLIMIT_STACK, &rlim); + KASSERT(error == 0, ("kern_proc_setrlimit failed")); +} + void linux_proc_init(struct thread *td, struct thread *newtd, int flags) { @@ -145,6 +168,7 @@ linux_proc_init(struct thread *td, struct thread *newt newtd->td_emuldata = em; linux_set_default_openfiles(td, p); + linux_set_default_stacksize(td, p); } else { p = td->td_proc; Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Fri Oct 16 11:22:29 2020 (r366755) +++ head/sys/compat/linux/linux_mib.c Fri Oct 16 11:23:30 2020 (r366756) @@ -72,6 +72,11 @@ SYSCTL_INT(_compat_linux, OID_AUTO, default_openfiles, &linux_default_openfiles, 0, "Default soft openfiles resource limit, or -1 for unlimited"); +int linux_default_stacksize = 8 * 1024 * 1024; +SYSCTL_INT(_compat_linux, OID_AUTO, default_stacksize, CTLFLAG_RWTUN, + &linux_default_stacksize, 0, + "Default soft stack size resource limit, or -1 for unlimited"); + int linux_ignore_ip_recverr = 1; SYSCTL_INT(_compat_linux, OID_AUTO, ignore_ip_recverr, CTLFLAG_RWTUN, &linux_ignore_ip_recverr, 0, "Ignore enabling IP_RECVERR"); Modified: head/sys/compat/linux/linux_mib.h ============================================================================== --- head/sys/compat/linux/linux_mib.h Fri Oct 16 11:22:29 2020 (r366755) +++ head/sys/compat/linux/linux_mib.h Fri Oct 16 11:23:30 2020 (r366756) @@ -64,6 +64,7 @@ int linux_kernver(struct thread *td); extern int linux_debug; extern int linux_default_openfiles; +extern int linux_default_stacksize; extern int linux_ignore_ip_recverr; extern int linux_preserve_vstatus; extern bool linux_map_sched_prio; From owner-svn-src-head@freebsd.org Fri Oct 16 11:24:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EAE84317B4; Fri, 16 Oct 2020 11:24:14 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCP1T73nDz4p2K; Fri, 16 Oct 2020 11:24:13 +0000 (UTC) (envelope-from mw@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 BB78FF7DE; Fri, 16 Oct 2020 11:24:13 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GBODZB073838; Fri, 16 Oct 2020 11:24:13 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GBOCTw073832; Fri, 16 Oct 2020 11:24:12 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202010161124.09GBOCTw073832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Fri, 16 Oct 2020 11:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366757 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 366757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 11:24:14 -0000 Author: mw Date: Fri Oct 16 11:24:12 2020 New Revision: 366757 URL: https://svnweb.freebsd.org/changeset/base/366757 Log: Implement anti-replay algorithm with ESN support As RFC 4304 describes there is anti-replay algorithm responsibility to provide appropriate value of Extended Sequence Number. This patch introduces anti-replay algorithm with ESN support based on RFC 4304, however to avoid performance regressions window implementation was based on RFC 6479, which was already implemented in FreeBSD. To keep things clean and improve code readability, implementation of window is kept in seperate functions. Submitted by: Grzegorz Jaszczyk Patryk Duda Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D22367 Obtained from: Semihalf Sponsored by: Stormshield Modified: head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec.h head/sys/netipsec/key_debug.c head/sys/netipsec/keydb.h head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Fri Oct 16 11:23:30 2020 (r366756) +++ head/sys/netipsec/ipsec.c Fri Oct 16 11:24:12 2020 (r366757) @@ -1173,7 +1173,67 @@ ipsec_hdrsiz_inpcb(struct inpcb *inp) return (sz); } + +#define IPSEC_BITMAP_INDEX_MASK(w) (w - 1) +#define IPSEC_REDUNDANT_BIT_SHIFTS 5 +#define IPSEC_REDUNDANT_BITS (1 << IPSEC_REDUNDANT_BIT_SHIFTS) +#define IPSEC_BITMAP_LOC_MASK (IPSEC_REDUNDANT_BITS - 1) + /* + * Functions below are responsible for checking and updating bitmap. + * These are used to separate ipsec_chkreplay() and ipsec_updatereplay() + * from window implementation + * + * Based on RFC 6479. Blocks are 32 bits unsigned integers + */ + +static inline int +check_window(const struct secreplay *replay, uint64_t seq) +{ + int index, bit_location; + + bit_location = seq & IPSEC_BITMAP_LOC_MASK; + index = (seq >> IPSEC_REDUNDANT_BIT_SHIFTS) + & IPSEC_BITMAP_INDEX_MASK(replay->bitmap_size); + + /* This packet already seen? */ + return ((replay->bitmap)[index] & (1 << bit_location)); +} + +static inline void +advance_window(const struct secreplay *replay, uint64_t seq) +{ + int i; + uint64_t index, index_cur, diff; + + index_cur = replay->last >> IPSEC_REDUNDANT_BIT_SHIFTS; + index = seq >> IPSEC_REDUNDANT_BIT_SHIFTS; + diff = index - index_cur; + + if (diff > replay->bitmap_size) { + /* something unusual in this case */ + diff = replay->bitmap_size; + } + + for (i = 0; i < diff; i++) { + replay->bitmap[(i + index_cur + 1) + & IPSEC_BITMAP_INDEX_MASK(replay->bitmap_size)] = 0; + } +} + +static inline void +set_window(const struct secreplay *replay, uint64_t seq) +{ + int index, bit_location; + + bit_location = seq & IPSEC_BITMAP_LOC_MASK; + index = (seq >> IPSEC_REDUNDANT_BIT_SHIFTS) + & IPSEC_BITMAP_INDEX_MASK(replay->bitmap_size); + + replay->bitmap[index] |= (1 << bit_location); +} + +/* * Check the variable replay window. * ipsec_chkreplay() performs replay check before ICV verification. * ipsec_updatereplay() updates replay bitmap. This must be called after @@ -1181,20 +1241,17 @@ ipsec_hdrsiz_inpcb(struct inpcb *inp) * beforehand). * 0 (zero) is returned if packet disallowed, 1 if packet permitted. * - * Based on RFC 6479. Blocks are 32 bits unsigned integers + * Based on RFC 4303 */ -#define IPSEC_BITMAP_INDEX_MASK(w) (w - 1) -#define IPSEC_REDUNDANT_BIT_SHIFTS 5 -#define IPSEC_REDUNDANT_BITS (1 << IPSEC_REDUNDANT_BIT_SHIFTS) -#define IPSEC_BITMAP_LOC_MASK (IPSEC_REDUNDANT_BITS - 1) - int -ipsec_chkreplay(uint32_t seq, struct secasvar *sav) +ipsec_chkreplay(uint32_t seq, uint32_t *seqhigh, struct secasvar *sav) { - const struct secreplay *replay; - uint32_t wsizeb; /* Constant: window size. */ - int index, bit_location; + char buf[128]; + struct secreplay *replay; + uint32_t window; + uint32_t tl, th, bl; + uint32_t seqh; IPSEC_ASSERT(sav != NULL, ("Null SA")); IPSEC_ASSERT(sav->replay != NULL, ("Null replay state")); @@ -1205,36 +1262,96 @@ ipsec_chkreplay(uint32_t seq, struct secasvar *sav) if (replay->wsize == 0) return (1); - /* Constant. */ - wsizeb = replay->wsize << 3; - - /* Sequence number of 0 is invalid. */ - if (seq == 0) + /* Zero sequence number is not allowed. */ + if (seq == 0 && replay->last == 0) return (0); - /* First time is always okay. */ - if (replay->count == 0) - return (1); + window = replay->wsize << 3; /* Size of window */ + tl = (uint32_t)replay->last; /* Top of window, lower part */ + th = (uint32_t)(replay->last >> 32); /* Top of window, high part */ + bl = tl - window + 1; /* Bottom of window, lower part */ - /* Larger sequences are okay. */ - if (seq > replay->lastseq) + /* + * We keep the high part intact when: + * 1) the seq is within [bl, 0xffffffff] and the whole window is + * within one subspace; + * 2) the seq is within [0, bl) and window spans two subspaces. + */ + if ((tl >= window - 1 && seq >= bl) || + (tl < window - 1 && seq < bl)) { + *seqhigh = th; + if (seq <= tl) { + /* Sequence number inside window - check against replay */ + if (check_window(replay, seq)) + return (0); + } + + /* Sequence number above top of window or not found in bitmap */ return (1); + } - /* Over range to check, i.e. too old or wrapped. */ - if (replay->lastseq - seq >= wsizeb) - return (0); + /* + * If ESN is not enabled and packet with highest sequence number + * was received we should report overflow + */ + if (tl == 0xffffffff && !(sav->flags & SADB_X_SAFLAGS_ESN)) { + /* Set overflow flag. */ + replay->overflow++; - /* The sequence is inside the sliding window - * now check the bit in the bitmap - * bit location only depends on the sequence number + if ((sav->flags & SADB_X_EXT_CYCSEQ) == 0) { + if (sav->sah->saidx.proto == IPPROTO_ESP) + ESPSTAT_INC(esps_wrap); + else if (sav->sah->saidx.proto == IPPROTO_AH) + AHSTAT_INC(ahs_wrap); + return (0); + } + + ipseclog((LOG_WARNING, "%s: replay counter made %d cycle. %s\n", + __func__, replay->overflow, + ipsec_sa2str(sav, buf, sizeof(buf)))); + } + + /* + * Seq is within [bl, 0xffffffff] and bl is within + * [0xffffffff-window, 0xffffffff]. This means we got a seq + * which is within our replay window, but in the previous + * subspace. */ - bit_location = seq & IPSEC_BITMAP_LOC_MASK; - index = (seq >> IPSEC_REDUNDANT_BIT_SHIFTS) - & IPSEC_BITMAP_INDEX_MASK(replay->bitmap_size); + if (tl < window - 1 && seq >= bl) { + if (th == 0) + return (0); + *seqhigh = th - 1; + seqh = th - 1; + if (check_window(replay, seq)) + return (0); + return (1); + } - /* This packet already seen? */ - if ((replay->bitmap)[index] & (1 << bit_location)) - return (0); + /* + * Seq is within [0, bl) but the whole window is within one subspace. + * This means that seq has wrapped and is in next subspace + */ + *seqhigh = th + 1; + seqh = th + 1; + + /* Don't let high part wrap. */ + if (seqh == 0) { + /* Set overflow flag. */ + replay->overflow++; + + if ((sav->flags & SADB_X_EXT_CYCSEQ) == 0) { + if (sav->sah->saidx.proto == IPPROTO_ESP) + ESPSTAT_INC(esps_wrap); + else if (sav->sah->saidx.proto == IPPROTO_AH) + AHSTAT_INC(ahs_wrap); + return (0); + } + + ipseclog((LOG_WARNING, "%s: replay counter made %d cycle. %s\n", + __func__, replay->overflow, + ipsec_sa2str(sav, buf, sizeof(buf)))); + } + return (1); } @@ -1246,84 +1363,90 @@ ipsec_chkreplay(uint32_t seq, struct secasvar *sav) int ipsec_updatereplay(uint32_t seq, struct secasvar *sav) { - char buf[128]; struct secreplay *replay; - uint32_t wsizeb; /* Constant: window size. */ - int diff, index, bit_location; + uint32_t window; + uint32_t tl, th, bl; + uint32_t seqh; IPSEC_ASSERT(sav != NULL, ("Null SA")); IPSEC_ASSERT(sav->replay != NULL, ("Null replay state")); replay = sav->replay; + /* No need to check replay if disabled. */ if (replay->wsize == 0) - goto ok; /* No need to check replay. */ + return (0); - /* Constant. */ - wsizeb = replay->wsize << 3; - - /* Sequence number of 0 is invalid. */ - if (seq == 0) + /* Zero sequence number is not allowed. */ + if (seq == 0 && replay->last == 0) return (1); - /* The packet is too old, no need to update */ - if (wsizeb + seq < replay->lastseq) - goto ok; + window = replay->wsize << 3; /* Size of window */ + tl = (uint32_t)replay->last; /* Top of window, lower part */ + th = (uint32_t)(replay->last >> 32); /* Top of window, high part */ + bl = tl - window + 1; /* Bottom of window, lower part */ - /* Now update the bit */ - index = (seq >> IPSEC_REDUNDANT_BIT_SHIFTS); - - /* First check if the sequence number is in the range */ - if (seq > replay->lastseq) { - int id; - int index_cur = replay->lastseq >> IPSEC_REDUNDANT_BIT_SHIFTS; - - diff = index - index_cur; - if (diff > replay->bitmap_size) { - /* something unusual in this case */ - diff = replay->bitmap_size; + /* + * We keep the high part intact when: + * 1) the seq is within [bl, 0xffffffff] and the whole window is + * within one subspace; + * 2) the seq is within [0, bl) and window spans two subspaces. + */ + if ((tl >= window - 1 && seq >= bl) || + (tl < window - 1 && seq < bl)) { + seqh = th; + if (seq <= tl) { + /* Sequence number inside window - check against replay */ + if (check_window(replay, seq)) + return (1); + set_window(replay, seq); + } else { + advance_window(replay, ((uint64_t)seqh << 32) | seq); + set_window(replay, seq); + replay->last = ((uint64_t)seqh << 32) | seq; } - for (id = 0; id < diff; ++id) { - replay->bitmap[(id + index_cur + 1) - & IPSEC_BITMAP_INDEX_MASK(replay->bitmap_size)] = 0; - } - - replay->lastseq = seq; + /* Sequence number above top of window or not found in bitmap */ + replay->count++; + return (0); } - index &= IPSEC_BITMAP_INDEX_MASK(replay->bitmap_size); - bit_location = seq & IPSEC_BITMAP_LOC_MASK; - - /* this packet has already been received */ - if (replay->bitmap[index] & (1 << bit_location)) + if (!(sav->flags & SADB_X_SAFLAGS_ESN)) return (1); - replay->bitmap[index] |= (1 << bit_location); - -ok: - if (replay->count == ~0) { - /* Set overflow flag. */ - replay->overflow++; - - /* Don't increment, no more packets accepted. */ - if ((sav->flags & SADB_X_EXT_CYCSEQ) == 0) { - if (sav->sah->saidx.proto == IPPROTO_AH) - AHSTAT_INC(ahs_wrap); - else if (sav->sah->saidx.proto == IPPROTO_ESP) - ESPSTAT_INC(esps_wrap); + /* + * Seq is within [bl, 0xffffffff] and bl is within + * [0xffffffff-window, 0xffffffff]. This means we got a seq + * which is within our replay window, but in the previous + * subspace. + */ + if (tl < window - 1 && seq >= bl) { + if (th == 0) return (1); - } + if (check_window(replay, seq)) + return (1); - ipseclog((LOG_WARNING, "%s: replay counter made %d cycle. %s\n", - __func__, replay->overflow, - ipsec_sa2str(sav, buf, sizeof(buf)))); + set_window(replay, seq); + replay->count++; + return (0); } + /* + * Seq is within [0, bl) but the whole window is within one subspace. + * This means that seq has wrapped and is in next subspace + */ + seqh = th + 1; + + /* Don't let high part wrap. */ + if (seqh == 0) + return (1); + + advance_window(replay, ((uint64_t)seqh << 32) | seq); + set_window(replay, seq); + replay->last = ((uint64_t)seqh << 32) | seq; replay->count++; return (0); } - int ipsec_updateid(struct secasvar *sav, crypto_session_t *new, crypto_session_t *old) Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Fri Oct 16 11:23:30 2020 (r366756) +++ head/sys/netipsec/ipsec.h Fri Oct 16 11:24:12 2020 (r366757) @@ -325,7 +325,7 @@ int udp_ipsec_output(struct mbuf *, struct secasvar *) int udp_ipsec_input(struct mbuf *, int, int); int udp_ipsec_pcbctl(struct inpcb *, struct sockopt *); -int ipsec_chkreplay(uint32_t, struct secasvar *); +int ipsec_chkreplay(uint32_t, uint32_t *, struct secasvar *); int ipsec_updatereplay(uint32_t, struct secasvar *); int ipsec_updateid(struct secasvar *, crypto_session_t *, crypto_session_t *); int ipsec_initialized(void); Modified: head/sys/netipsec/key_debug.c ============================================================================== --- head/sys/netipsec/key_debug.c Fri Oct 16 11:23:30 2020 (r366756) +++ head/sys/netipsec/key_debug.c Fri Oct 16 11:24:12 2020 (r366757) @@ -809,8 +809,8 @@ kdebug_secreplay(struct secreplay *rpl) int len, l; IPSEC_ASSERT(rpl != NULL, ("null rpl")); - printf(" secreplay{ count=%u bitmap_size=%u wsize=%u seq=%u lastseq=%u", - rpl->count, rpl->bitmap_size, rpl->wsize, rpl->seq, rpl->lastseq); + printf(" secreplay{ count=%lu bitmap_size=%u wsize=%u last=%lu", + rpl->count, rpl->bitmap_size, rpl->wsize, rpl->last); if (rpl->bitmap == NULL) { printf(" }\n"); Modified: head/sys/netipsec/keydb.h ============================================================================== --- head/sys/netipsec/keydb.h Fri Oct 16 11:23:30 2020 (r366756) +++ head/sys/netipsec/keydb.h Fri Oct 16 11:24:12 2020 (r366757) @@ -202,10 +202,9 @@ struct secasvar { * (c) read only except during creation / free */ struct secreplay { - u_int32_t count; /* (m) */ + u_int64_t count; /* (m) */ u_int wsize; /* (c) window size, i.g. 4 bytes */ - u_int32_t seq; /* (m) used by sender */ - u_int32_t lastseq; /* (m) used by receiver */ + u_int64_t last; /* (m) used by receiver */ u_int32_t *bitmap; /* (m) used by receiver */ u_int bitmap_size; /* (c) size of the bitmap array */ int overflow; /* (m) overflow flag */ Modified: head/sys/netipsec/xform_ah.c ============================================================================== --- head/sys/netipsec/xform_ah.c Fri Oct 16 11:23:30 2020 (r366756) +++ head/sys/netipsec/xform_ah.c Fri Oct 16 11:24:12 2020 (r366757) @@ -534,6 +534,7 @@ ah_input(struct mbuf *m, struct secasvar *sav, int ski struct newah *ah; crypto_session_t cryptoid; int hl, rplen, authsize, ahsize, error; + uint32_t seqh; IPSEC_ASSERT(sav != NULL, ("null SA")); IPSEC_ASSERT(sav->key_auth != NULL, ("null authentication key")); @@ -557,7 +558,7 @@ ah_input(struct mbuf *m, struct secasvar *sav, int ski /* Check replay window, if applicable. */ SECASVAR_LOCK(sav); if (sav->replay != NULL && sav->replay->wsize != 0 && - ipsec_chkreplay(ntohl(ah->ah_seq), sav) == 0) { + ipsec_chkreplay(ntohl(ah->ah_seq), &seqh, sav) == 0) { SECASVAR_UNLOCK(sav); AHSTAT_INC(ahs_replay); DPRINTF(("%s: packet replay failure: %s\n", __func__, @@ -925,7 +926,9 @@ ah_output(struct mbuf *m, struct secpolicy *sp, struct /* Insert packet replay counter, as requested. */ SECASVAR_LOCK(sav); if (sav->replay) { - if (sav->replay->count == ~0 && + if ((sav->replay->count == ~0 || + (!(sav->flags & SADB_X_SAFLAGS_ESN) && + ((uint32_t)sav->replay->count) == ~0)) && (sav->flags & SADB_X_EXT_CYCSEQ) == 0) { SECASVAR_UNLOCK(sav); DPRINTF(("%s: replay counter wrapped for SA %s/%08lx\n", @@ -940,7 +943,7 @@ ah_output(struct mbuf *m, struct secpolicy *sp, struct if (!V_ipsec_replay) #endif sav->replay->count++; - ah->ah_seq = htonl(sav->replay->count); + ah->ah_seq = htonl((uint32_t)sav->replay->count); } cryptoid = sav->tdb_cryptoid; SECASVAR_UNLOCK(sav); Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Fri Oct 16 11:23:30 2020 (r366756) +++ head/sys/netipsec/xform_esp.c Fri Oct 16 11:24:12 2020 (r366757) @@ -262,6 +262,7 @@ esp_input(struct mbuf *m, struct secasvar *sav, int sk uint8_t *ivp; crypto_session_t cryptoid; int alen, error, hlen, plen; + uint32_t seqh; IPSEC_ASSERT(sav != NULL, ("null SA")); IPSEC_ASSERT(sav->tdb_encalgxform != NULL, ("null encoding xform")); @@ -320,7 +321,7 @@ esp_input(struct mbuf *m, struct secasvar *sav, int sk */ SECASVAR_LOCK(sav); if (esph != NULL && sav->replay != NULL && sav->replay->wsize != 0) { - if (ipsec_chkreplay(ntohl(esp->esp_seq), sav) == 0) { + if (ipsec_chkreplay(ntohl(esp->esp_seq), &seqh, sav) == 0) { SECASVAR_UNLOCK(sav); DPRINTF(("%s: packet replay check for %s\n", __func__, ipsec_sa2str(sav, buf, sizeof(buf)))); @@ -740,7 +741,7 @@ esp_output(struct mbuf *m, struct secpolicy *sp, struc if (!V_ipsec_replay) #endif sav->replay->count++; - replay = htonl(sav->replay->count); + replay = htonl((uint32_t)sav->replay->count); bcopy((caddr_t) &replay, mtod(mo, caddr_t) + roff + sizeof(uint32_t), sizeof(uint32_t)); From owner-svn-src-head@freebsd.org Fri Oct 16 11:25:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77C68431A8D; Fri, 16 Oct 2020 11:25:46 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCP3G2c3Gz4pLr; Fri, 16 Oct 2020 11:25:46 +0000 (UTC) (envelope-from mw@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 3DD27F655; Fri, 16 Oct 2020 11:25:46 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GBPkhl074090; Fri, 16 Oct 2020 11:25:46 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GBPjpU074088; Fri, 16 Oct 2020 11:25:45 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202010161125.09GBPjpU074088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Fri, 16 Oct 2020 11:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366758 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 366758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 11:25:46 -0000 Author: mw Date: Fri Oct 16 11:25:45 2020 New Revision: 366758 URL: https://svnweb.freebsd.org/changeset/base/366758 Log: Add support for IPsec ESN and pass relevant information to crypto layer Implement support for including IPsec ESN (Extended Sequence Number) to both encrypt and authenticate mode (eg. AES-CBC and SHA256) and combined mode (eg. AES-GCM). Both ESP and AH protocols are updated. Additionally pass relevant information about ESN to crypto layer. For the ETA mode the ESN is stored in separate crp_esn buffer because the high-order 32 bits of the sequence number are appended after the Next Header (RFC 4303). For the AEAD modes the high-order 32 bits of the sequence number [e.g. RFC 4106, Chapter 5 AAD Construction] are included as part of crp_aad (SPI + ESN (32 high order bits) + Seq nr (32 low order bits)). Submitted by: Grzegorz Jaszczyk Patryk Duda Reviewed by: jhb, gnn Differential revision: https://reviews.freebsd.org/D22369 Obtained from: Semihalf Sponsored by: Stormshield Modified: head/sys/netipsec/keydb.h head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c Modified: head/sys/netipsec/keydb.h ============================================================================== --- head/sys/netipsec/keydb.h Fri Oct 16 11:24:12 2020 (r366757) +++ head/sys/netipsec/keydb.h Fri Oct 16 11:25:45 2020 (r366758) @@ -197,6 +197,8 @@ struct secasvar { #define SAV_ISCTR(_sav) ((_sav)->alg_enc == SADB_X_EALG_AESCTR) #define SAV_ISCTRORGCM(_sav) (SAV_ISCTR((_sav)) || SAV_ISGCM((_sav))) +#define IPSEC_SEQH_SHIFT 32 + /* Replay prevention, protected by SECASVAR_LOCK: * (m) locked by mtx * (c) read only except during creation / free Modified: head/sys/netipsec/xform_ah.c ============================================================================== --- head/sys/netipsec/xform_ah.c Fri Oct 16 11:24:12 2020 (r366757) +++ head/sys/netipsec/xform_ah.c Fri Oct 16 11:25:45 2020 (r366758) @@ -236,6 +236,10 @@ ah_init(struct secasvar *sav, struct xformsw *xsp) memset(&csp, 0, sizeof(csp)); csp.csp_mode = CSP_MODE_DIGEST; + + if (sav->flags & SADB_X_SAFLAGS_ESN) + csp.csp_flags |= CSP_F_ESN; + error = ah_init0(sav, xsp, &csp); return error ? error : crypto_newsession(&sav->tdb_cryptoid, &csp, V_crypto_support); @@ -654,6 +658,12 @@ ah_input(struct mbuf *m, struct secasvar *sav, int ski crp->crp_callback = ah_input_cb; crp->crp_opaque = xd; + if (sav->flags & SADB_X_SAFLAGS_ESN && + sav->replay != NULL && sav->replay->wsize != 0) { + seqh = htonl(seqh); + memcpy(crp->crp_esn, &seqh, sizeof(seqh)); + } + /* These are passed as-is to the callback. */ xd->sav = sav; xd->nxt = hl; @@ -834,6 +844,7 @@ ah_output(struct mbuf *m, struct secpolicy *sp, struct uint16_t iplen; int error, rplen, authsize, ahsize, maxpacketsize, roff; uint8_t prot; + uint32_t seqh; IPSEC_ASSERT(sav != NULL, ("null SA")); ahx = sav->tdb_authalgxform; @@ -1030,6 +1041,11 @@ ah_output(struct mbuf *m, struct secpolicy *sp, struct crypto_use_mbuf(crp, m); crp->crp_callback = ah_output_cb; crp->crp_opaque = xd; + + if (sav->flags & SADB_X_SAFLAGS_ESN && sav->replay != NULL) { + seqh = htonl((uint32_t)(sav->replay->count >> IPSEC_SEQH_SHIFT)); + memcpy(crp->crp_esn, &seqh, sizeof(seqh)); + } /* These are passed as-is to the callback. */ xd->sp = sp; Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Fri Oct 16 11:24:12 2020 (r366757) +++ head/sys/netipsec/xform_esp.c Fri Oct 16 11:25:45 2020 (r366758) @@ -80,6 +80,8 @@ #include #include +#define SPI_SIZE 4 + VNET_DEFINE(int, esp_enable) = 1; VNET_DEFINE_STATIC(int, esp_ctr_compatibility) = 1; #define V_esp_ctr_compatibility VNET(esp_ctr_compatibility) @@ -219,9 +221,13 @@ esp_init(struct secasvar *sav, struct xformsw *xsp) return EINVAL; } csp.csp_mode = CSP_MODE_AEAD; - } else if (sav->alg_auth != 0) + if (sav->flags & SADB_X_SAFLAGS_ESN) + csp.csp_flags |= CSP_F_SEPARATE_AAD; + } else if (sav->alg_auth != 0) { csp.csp_mode = CSP_MODE_ETA; - else + if (sav->flags & SADB_X_SAFLAGS_ESN) + csp.csp_flags |= CSP_F_ESN; + } else csp.csp_mode = CSP_MODE_CIPHER; /* Initialize crypto session. */ @@ -263,6 +269,7 @@ esp_input(struct mbuf *m, struct secasvar *sav, int sk crypto_session_t cryptoid; int alen, error, hlen, plen; uint32_t seqh; + const struct crypto_session_params *csp; IPSEC_ASSERT(sav != NULL, ("null SA")); IPSEC_ASSERT(sav->tdb_encalgxform != NULL, ("null encoding xform")); @@ -329,6 +336,7 @@ esp_input(struct mbuf *m, struct secasvar *sav, int sk error = EACCES; goto bad; } + seqh = htonl(seqh); } cryptoid = sav->tdb_cryptoid; SECASVAR_UNLOCK(sav); @@ -350,19 +358,49 @@ esp_input(struct mbuf *m, struct secasvar *sav, int sk xd = malloc(sizeof(*xd), M_XDATA, M_NOWAIT | M_ZERO); if (xd == NULL) { DPRINTF(("%s: failed to allocate xform_data\n", __func__)); - ESPSTAT_INC(esps_crypto); - crypto_freereq(crp); - error = ENOBUFS; - goto bad; + goto xd_fail; } if (esph != NULL) { crp->crp_op = CRYPTO_OP_VERIFY_DIGEST; - crp->crp_aad_start = skip; if (SAV_ISGCM(sav)) crp->crp_aad_length = 8; /* RFC4106 5, SPI + SN */ else crp->crp_aad_length = hlen; + + csp = crypto_get_params(crp->crp_session); + if ((csp->csp_flags & CSP_F_SEPARATE_AAD) && + (sav->replay != NULL) && (sav->replay->wsize != 0)) { + int aad_skip; + + crp->crp_aad_length += sizeof(seqh); + crp->crp_aad = malloc(crp->crp_aad_length, M_XDATA, M_NOWAIT); + if (crp->crp_aad == NULL) { + DPRINTF(("%s: failed to allocate xform_data\n", + __func__)); + goto crp_aad_fail; + } + + /* SPI */ + m_copydata(m, skip, SPI_SIZE, crp->crp_aad); + aad_skip = SPI_SIZE; + + /* ESN */ + bcopy(&seqh, (char *)crp->crp_aad + aad_skip, sizeof(seqh)); + aad_skip += sizeof(seqh); + + /* Rest of aad */ + if (crp->crp_aad_length - aad_skip > 0) + m_copydata(m, skip + SPI_SIZE, + crp->crp_aad_length - aad_skip, + (char *)crp->crp_aad + aad_skip); + } else + crp->crp_aad_start = skip; + + if (csp->csp_flags & CSP_F_ESN && + sav->replay != NULL && sav->replay->wsize != 0) + memcpy(crp->crp_esn, &seqh, sizeof(seqh)); + crp->crp_digest_start = m->m_pkthdr.len - alen; } @@ -423,6 +461,13 @@ esp_input(struct mbuf *m, struct secasvar *sav, int sk crp->crp_iv_start = skip + hlen - sav->ivlen; return (crypto_dispatch(crp)); + +crp_aad_fail: + free(xd, M_XDATA); +xd_fail: + crypto_freereq(crp); + ESPSTAT_INC(esps_crypto); + error = ENOBUFS; bad: m_freem(m); key_freesav(&sav); @@ -505,6 +550,7 @@ esp_input_cb(struct cryptop *crp) /* Release the crypto descriptors */ free(xd, M_XDATA), xd = NULL; + free(crp->crp_aad, M_XDATA), crp->crp_aad = NULL; crypto_freereq(crp), crp = NULL; /* @@ -614,8 +660,10 @@ bad: m_freem(m); if (xd != NULL) free(xd, M_XDATA); - if (crp != NULL) + if (crp != NULL) { + free(crp->crp_aad, M_XDATA); crypto_freereq(crp); + } return error; } /* @@ -639,6 +687,8 @@ esp_output(struct mbuf *m, struct secpolicy *sp, struc int hlen, rlen, padding, blks, alen, i, roff; int error, maxpacketsize; uint8_t prot; + uint32_t seqh; + const struct crypto_session_params *csp; IPSEC_ASSERT(sav != NULL, ("null SA")); esph = sav->tdb_authalgxform; @@ -745,6 +795,8 @@ esp_output(struct mbuf *m, struct secpolicy *sp, struc bcopy((caddr_t) &replay, mtod(mo, caddr_t) + roff + sizeof(uint32_t), sizeof(uint32_t)); + + seqh = htonl((uint32_t)(sav->replay->count >> IPSEC_SEQH_SHIFT)); } cryptoid = sav->tdb_cryptoid; if (SAV_ISCTRORGCM(sav)) @@ -801,13 +853,10 @@ esp_output(struct mbuf *m, struct secpolicy *sp, struc } /* IPsec-specific opaque crypto info. */ - xd = malloc(sizeof(struct xform_data), M_XDATA, M_NOWAIT | M_ZERO); + xd = malloc(sizeof(struct xform_data), M_XDATA, M_NOWAIT | M_ZERO); if (xd == NULL) { - crypto_freereq(crp); DPRINTF(("%s: failed to allocate xform_data\n", __func__)); - ESPSTAT_INC(esps_crypto); - error = ENOBUFS; - goto bad; + goto xd_fail; } /* Encryption descriptor. */ @@ -855,15 +904,54 @@ esp_output(struct mbuf *m, struct secpolicy *sp, struc if (esph) { /* Authentication descriptor. */ crp->crp_op |= CRYPTO_OP_COMPUTE_DIGEST; - crp->crp_aad_start = skip; if (SAV_ISGCM(sav)) crp->crp_aad_length = 8; /* RFC4106 5, SPI + SN */ else crp->crp_aad_length = hlen; + + csp = crypto_get_params(crp->crp_session); + if (csp->csp_flags & CSP_F_SEPARATE_AAD && + sav->replay != NULL) { + int aad_skip; + + crp->crp_aad_length += sizeof(seqh); + crp->crp_aad = malloc(crp->crp_aad_length, M_XDATA, M_NOWAIT); + if (crp->crp_aad == NULL) { + DPRINTF(("%s: failed to allocate xform_data\n", + __func__)); + goto crp_aad_fail; + } + + /* SPI */ + m_copydata(m, skip, SPI_SIZE, crp->crp_aad); + aad_skip = SPI_SIZE; + + /* ESN */ + bcopy(&seqh, (char *)crp->crp_aad + aad_skip, sizeof(seqh)); + aad_skip += sizeof(seqh); + + /* Rest of aad */ + if (crp->crp_aad_length - aad_skip > 0) + m_copydata(m, skip + SPI_SIZE, + crp->crp_aad_length - aad_skip, + (char *)crp->crp_aad + aad_skip); + } else + crp->crp_aad_start = skip; + + if (csp->csp_flags & CSP_F_ESN && sav->replay != NULL) + memcpy(crp->crp_esn, &seqh, sizeof(seqh)); + crp->crp_digest_start = m->m_pkthdr.len - alen; } return crypto_dispatch(crp); + +crp_aad_fail: + free(xd, M_XDATA); +xd_fail: + crypto_freereq(crp); + ESPSTAT_INC(esps_crypto); + error = ENOBUFS; bad: if (m) m_freem(m); @@ -918,6 +1006,7 @@ esp_output_cb(struct cryptop *crp) goto bad; } free(xd, M_XDATA); + free(crp->crp_aad, M_XDATA); crypto_freereq(crp); ESPSTAT_INC(esps_hist[sav->alg_enc]); if (sav->tdb_authalgxform != NULL) @@ -951,6 +1040,7 @@ esp_output_cb(struct cryptop *crp) bad: CURVNET_RESTORE(); free(xd, M_XDATA); + free(crp->crp_aad, M_XDATA); crypto_freereq(crp); key_freesav(&sav); key_freesp(&sp); From owner-svn-src-head@freebsd.org Fri Oct 16 11:27:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB676431C1F; Fri, 16 Oct 2020 11:27:01 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCP4j44Wkz4pgt; Fri, 16 Oct 2020 11:27:01 +0000 (UTC) (envelope-from mw@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 6F43BF7EA; Fri, 16 Oct 2020 11:27:01 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GBR1Mf074196; Fri, 16 Oct 2020 11:27:01 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GBR1HC074195; Fri, 16 Oct 2020 11:27:01 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202010161127.09GBR1HC074195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Fri, 16 Oct 2020 11:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366759 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 366759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 11:27:01 -0000 Author: mw Date: Fri Oct 16 11:27:01 2020 New Revision: 366759 URL: https://svnweb.freebsd.org/changeset/base/366759 Log: Trigger soft lifetime expiration on sequence number This patch adds 80% of UINT32_MAX limit on sequence number. When sequence number reaches limit kernel sends SADB_EXPIRE message to IKE daemon which is responsible to perform rekeying. Submitted by: Patryk Duda Reviewed by: ae Differential revision: https://reviews.freebsd.org/D22370 Obtained from: Semihalf Sponsored by: Stormshield Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Fri Oct 16 11:25:45 2020 (r366758) +++ head/sys/netipsec/key.c Fri Oct 16 11:27:01 2020 (r366759) @@ -101,6 +101,7 @@ #define FULLMASK 0xff #define _BITS(bytes) ((bytes) << 3) +#define UINT32_80PCT 0xcccccccc /* * Note on SA reference counting: * - SAs that are not in DEAD state will have (total external reference + 1) @@ -4536,7 +4537,11 @@ key_flush_sad(time_t now) (sav->lft_s->usetime != 0 && sav->firstused && now - sav->firstused > sav->lft_s->usetime) || (sav->lft_s->bytes != 0 && counter_u64_fetch( - sav->lft_c_bytes) > sav->lft_s->bytes))) { + sav->lft_c_bytes) > sav->lft_s->bytes) || + (!(sav->flags & SADB_X_SAFLAGS_ESN) && + (sav->replay != NULL) && ( + (sav->replay->count > UINT32_80PCT) || + (sav->replay->last > UINT32_80PCT))))) { SECASVAR_UNLOCK(sav); SAV_ADDREF(sav); LIST_INSERT_HEAD(&sexpireq, sav, drainq); From owner-svn-src-head@freebsd.org Fri Oct 16 13:35:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 42183436815; Fri, 16 Oct 2020 13:35:30 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCRwy152Tz3V76; Fri, 16 Oct 2020 13:35:30 +0000 (UTC) (envelope-from mhorne@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 086DB11399; Fri, 16 Oct 2020 13:35:30 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GDZTUl054506; Fri, 16 Oct 2020 13:35:29 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GDZTRN054504; Fri, 16 Oct 2020 13:35:29 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010161335.09GDZTRN054504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 16 Oct 2020 13:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366763 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 366763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 13:35:30 -0000 Author: mhorne Date: Fri Oct 16 13:35:29 2020 New Revision: 366763 URL: https://svnweb.freebsd.org/changeset/base/366763 Log: Update the ID_AA64MMFR2_EL1 register definitions This brings these definitions in sync with the ARMv8.6 version of the architecture reference manual. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26706 Modified: head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/armreg.h Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Fri Oct 16 13:34:56 2020 (r366762) +++ head/sys/arm64/arm64/identcpu.c Fri Oct 16 13:35:29 2020 (r366763) @@ -690,6 +690,50 @@ static struct mrs_field id_aa64mmfr1_fields[] = { /* ID_AA64MMFR2_EL1 */ +static struct mrs_field_value id_aa64mmfr2_e0pd[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR2, E0PD, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_aa64mmfr2_evt[] = { + MRS_FIELD_VALUE(ID_AA64MMFR2_EVT_NONE, ""), + MRS_FIELD_VALUE(ID_AA64MMFR2_EVT_8_2, "EVT-8.2"), + MRS_FIELD_VALUE(ID_AA64MMFR2_EVT_8_5, "EVT-8.5"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_aa64mmfr2_bbm[] = { + MRS_FIELD_VALUE(ID_AA64MMFR2_BBM_LEVEL0, ""), + MRS_FIELD_VALUE(ID_AA64MMFR2_BBM_LEVEL1, "BBM level 1"), + MRS_FIELD_VALUE(ID_AA64MMFR2_BBM_LEVEL2, "BBM level 2"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_aa64mmfr2_ttl[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR2, TTL, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_aa64mmfr2_fwb[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR2, FWB, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_aa64mmfr2_ids[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR2, IDS, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_aa64mmfr2_at[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR2, AT, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_aa64mmfr2_st[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR2, ST, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + static struct mrs_field_value id_aa64mmfr2_nv[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR2, NV, NONE, IMPL), MRS_FIELD_VALUE_END, @@ -728,6 +772,14 @@ static struct mrs_field_value id_aa64mmfr2_cnp[] = { }; static struct mrs_field id_aa64mmfr2_fields[] = { + MRS_FIELD(ID_AA64MMFR2, E0PD, false, MRS_EXACT, id_aa64mmfr2_e0pd), + MRS_FIELD(ID_AA64MMFR2, EVT, false, MRS_EXACT, id_aa64mmfr2_evt), + MRS_FIELD(ID_AA64MMFR2, BBM, false, MRS_EXACT, id_aa64mmfr2_bbm), + MRS_FIELD(ID_AA64MMFR2, TTL, false, MRS_EXACT, id_aa64mmfr2_ttl), + MRS_FIELD(ID_AA64MMFR2, FWB, false, MRS_EXACT, id_aa64mmfr2_fwb), + MRS_FIELD(ID_AA64MMFR2, IDS, false, MRS_EXACT, id_aa64mmfr2_ids), + MRS_FIELD(ID_AA64MMFR2, AT, false, MRS_LOWER, id_aa64mmfr2_at), + MRS_FIELD(ID_AA64MMFR2, ST, false, MRS_EXACT, id_aa64mmfr2_st), MRS_FIELD(ID_AA64MMFR2, NV, false, MRS_EXACT, id_aa64mmfr2_nv), MRS_FIELD(ID_AA64MMFR2, CCIDX, false, MRS_EXACT, id_aa64mmfr2_ccidx), MRS_FIELD(ID_AA64MMFR2, VARange, false, MRS_EXACT, Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Fri Oct 16 13:34:56 2020 (r366762) +++ head/sys/arm64/include/armreg.h Fri Oct 16 13:35:29 2020 (r366763) @@ -578,6 +578,48 @@ #define ID_AA64MMFR2_NV_VAL(x) ((x) & ID_AA64MMFR2_NV_MASK) #define ID_AA64MMFR2_NV_NONE (UL(0x0) << ID_AA64MMFR2_NV_SHIFT) #define ID_AA64MMFR2_NV_IMPL (UL(0x1) << ID_AA64MMFR2_NV_SHIFT) +#define ID_AA64MMFR2_ST_SHIFT 28 +#define ID_AA64MMFR2_ST_MASK (UL(0xf) << ID_AA64MMFR2_ST_SHIFT) +#define ID_AA64MMFR2_ST_VAL(x) ((x) & ID_AA64MMFR2_ST_MASK) +#define ID_AA64MMFR2_ST_NONE (UL(0x0) << ID_AA64MMFR2_ST_SHIFT) +#define ID_AA64MMFR2_ST_IMPL (UL(0x1) << ID_AA64MMFR2_ST_SHIFT) +#define ID_AA64MMFR2_AT_SHIFT 32 +#define ID_AA64MMFR2_AT_MASK (UL(0xf) << ID_AA64MMFR2_AT_SHIFT) +#define ID_AA64MMFR2_AT_VAL(x) ((x) & ID_AA64MMFR2_AT_MASK) +#define ID_AA64MMFR2_AT_NONE (UL(0x0) << ID_AA64MMFR2_AT_SHIFT) +#define ID_AA64MMFR2_AT_IMPL (UL(0x1) << ID_AA64MMFR2_AT_SHIFT) +#define ID_AA64MMFR2_IDS_SHIFT 36 +#define ID_AA64MMFR2_IDS_MASK (UL(0xf) << ID_AA64MMFR2_IDS_SHIFT) +#define ID_AA64MMFR2_IDS_VAL(x) ((x) & ID_AA64MMFR2_IDS_MASK) +#define ID_AA64MMFR2_IDS_NONE (UL(0x0) << ID_AA64MMFR2_IDS_SHIFT) +#define ID_AA64MMFR2_IDS_IMPL (UL(0x1) << ID_AA64MMFR2_IDS_SHIFT) +#define ID_AA64MMFR2_FWB_SHIFT 40 +#define ID_AA64MMFR2_FWB_MASK (UL(0xf) << ID_AA64MMFR2_FWB_SHIFT) +#define ID_AA64MMFR2_FWB_VAL(x) ((x) & ID_AA64MMFR2_FWB_MASK) +#define ID_AA64MMFR2_FWB_NONE (UL(0x0) << ID_AA64MMFR2_FWB_SHIFT) +#define ID_AA64MMFR2_FWB_IMPL (UL(0x1) << ID_AA64MMFR2_FWB_SHIFT) +#define ID_AA64MMFR2_TTL_SHIFT 48 +#define ID_AA64MMFR2_TTL_MASK (UL(0xf) << ID_AA64MMFR2_TTL_SHIFT) +#define ID_AA64MMFR2_TTL_VAL(x) ((x) & ID_AA64MMFR2_TTL_MASK) +#define ID_AA64MMFR2_TTL_NONE (UL(0x0) << ID_AA64MMFR2_TTL_SHIFT) +#define ID_AA64MMFR2_TTL_IMPL (UL(0x1) << ID_AA64MMFR2_TTL_SHIFT) +#define ID_AA64MMFR2_BBM_SHIFT 52 +#define ID_AA64MMFR2_BBM_MASK (UL(0xf) << ID_AA64MMFR2_BBM_SHIFT) +#define ID_AA64MMFR2_BBM_VAL(x) ((x) & ID_AA64MMFR2_BBM_MASK) +#define ID_AA64MMFR2_BBM_LEVEL0 (UL(0x0) << ID_AA64MMFR2_BBM_SHIFT) +#define ID_AA64MMFR2_BBM_LEVEL1 (UL(0x1) << ID_AA64MMFR2_BBM_SHIFT) +#define ID_AA64MMFR2_BBM_LEVEL2 (UL(0x2) << ID_AA64MMFR2_BBM_SHIFT) +#define ID_AA64MMFR2_EVT_SHIFT 56 +#define ID_AA64MMFR2_EVT_MASK (UL(0xf) << ID_AA64MMFR2_EVT_SHIFT) +#define ID_AA64MMFR2_EVT_VAL(x) ((x) & ID_AA64MMFR2_EVT_MASK) +#define ID_AA64MMFR2_EVT_NONE (UL(0x0) << ID_AA64MMFR2_EVT_SHIFT) +#define ID_AA64MMFR2_EVT_8_2 (UL(0x1) << ID_AA64MMFR2_EVT_SHIFT) +#define ID_AA64MMFR2_EVT_8_5 (UL(0x2) << ID_AA64MMFR2_EVT_SHIFT) +#define ID_AA64MMFR2_E0PD_SHIFT 60 +#define ID_AA64MMFR2_E0PD_MASK (UL(0xf) << ID_AA64MMFR2_E0PD_SHIFT) +#define ID_AA64MMFR2_E0PD_VAL(x) ((x) & ID_AA64MMFR2_E0PD_MASK) +#define ID_AA64MMFR2_E0PD_NONE (UL(0x0) << ID_AA64MMFR2_E0PD_SHIFT) +#define ID_AA64MMFR2_E0PD_IMPL (UL(0x1) << ID_AA64MMFR2_E0PD_SHIFT) /* ID_AA64PFR0_EL1 */ #define ID_AA64PFR0_EL1 MRS_REG(3, 0, 0, 4, 0) From owner-svn-src-head@freebsd.org Fri Oct 16 13:37:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CE5C436A03; Fri, 16 Oct 2020 13:37:59 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCRzp6ZXXz3Txk; Fri, 16 Oct 2020 13:37:58 +0000 (UTC) (envelope-from mhorne@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 C1CB41139B; Fri, 16 Oct 2020 13:37:58 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GDbw3r054646; Fri, 16 Oct 2020 13:37:58 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GDbwuq054645; Fri, 16 Oct 2020 13:37:58 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010161337.09GDbwuq054645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 16 Oct 2020 13:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366764 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 366764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 13:37:59 -0000 Author: mhorne Date: Fri Oct 16 13:37:58 2020 New Revision: 366764 URL: https://svnweb.freebsd.org/changeset/base/366764 Log: arm64: export a few more HWCAPs These were missed in the previous pass. The extensions (partially) supported by this change are: - ARMv8.2-FHM, Floating-point multiplication variant - ARMv8.4-LSE, Large System Extensions - ARMv8.4-DIT, Data Independent Timing instructions Reviewed by: andrew, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26707 Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Fri Oct 16 13:35:29 2020 (r366763) +++ head/sys/arm64/arm64/identcpu.c Fri Oct 16 13:37:58 2020 (r366764) @@ -883,7 +883,7 @@ static struct mrs_field_value id_aa64pfr0_el0[] = { static struct mrs_field id_aa64pfr0_fields[] = { MRS_FIELD(ID_AA64PFR0, CSV3, false, MRS_EXACT, id_aa64pfr0_csv3), MRS_FIELD(ID_AA64PFR0, CSV2, false, MRS_EXACT, id_aa64pfr0_csv2), - MRS_FIELD(ID_AA64PFR0, DIT, false, MRS_EXACT, id_aa64pfr0_dit), + MRS_FIELD(ID_AA64PFR0, DIT, false, MRS_LOWER, id_aa64pfr0_dit), MRS_FIELD(ID_AA64PFR0, AMU, false, MRS_EXACT, id_aa64pfr0_amu), MRS_FIELD(ID_AA64PFR0, MPAM, false, MRS_EXACT, id_aa64pfr0_mpam), MRS_FIELD(ID_AA64PFR0, SEL2, false, MRS_EXACT, id_aa64pfr0_sel2), @@ -1257,6 +1257,10 @@ parse_cpu_features_hwcap(void) break; } + if (ID_AA64ISAR0_FHM_VAL(user_cpu_desc.id_aa64isar0) == + ID_AA64ISAR0_FHM_IMPL) + hwcap |= HWCAP_ASIMDFHM; + if (ID_AA64ISAR0_DP_VAL(user_cpu_desc.id_aa64isar0) == ID_AA64ISAR0_DP_IMPL) hwcap |= HWCAP_ASIMDDP; @@ -1337,6 +1341,14 @@ parse_cpu_features_hwcap(void) if (ID_AA64ISAR1_DPB_VAL(user_cpu_desc.id_aa64isar1) == ID_AA64ISAR1_DPB_DCCVAP) hwcap |= HWCAP_DCPOP; + + if (ID_AA64MMFR2_AT_VAL(user_cpu_desc.id_aa64mmfr2) == + ID_AA64MMFR2_AT_IMPL) + hwcap |= HWCAP_USCAT; + + if (ID_AA64PFR0_DIT_VAL(user_cpu_desc.id_aa64pfr0) == + ID_AA64PFR0_DIT_PSTATE) + hwcap |= HWCAP_DIT; if (ID_AA64PFR0_SVE_VAL(user_cpu_desc.id_aa64pfr0) == ID_AA64PFR0_SVE_IMPL) From owner-svn-src-head@freebsd.org Fri Oct 16 14:28:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3F37437A43; Fri, 16 Oct 2020 14:28:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCT5p3kV7z3XVC; Fri, 16 Oct 2020 14:28:14 +0000 (UTC) (envelope-from adrian@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 633C41195C; Fri, 16 Oct 2020 14:28:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GESEUa085458; Fri, 16 Oct 2020 14:28:14 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GESEoj085457; Fri, 16 Oct 2020 14:28:14 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202010161428.09GESEoj085457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 16 Oct 2020 14:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366765 - head/contrib/libgnuregex X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/contrib/libgnuregex X-SVN-Commit-Revision: 366765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 14:28:14 -0000 Author: adrian Date: Fri Oct 16 14:28:13 2020 New Revision: 366765 URL: https://svnweb.freebsd.org/changeset/base/366765 Log: This fixes some fun type size truncation that shows up giving errors like " changes value from '287948901175001088' to '0' " .. which turns out is a known issue with later gcc's. eg - https://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00154.html It was fixed up upstream corelib/gnulib in commit hash 252b52457da7887667c036d18cc5169777615bb0 (eg in https://github.com/coreutils/gnulib/commit/252b52457da7887667c036d18cc5169777615bb0) TEST PLAN - compiled/run for gcc-6.4 on amd64 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D26804 Modified: head/contrib/libgnuregex/regcomp.c Modified: head/contrib/libgnuregex/regcomp.c ============================================================================== --- head/contrib/libgnuregex/regcomp.c Fri Oct 16 13:37:58 2020 (r366764) +++ head/contrib/libgnuregex/regcomp.c Fri Oct 16 14:28:13 2020 (r366765) @@ -930,26 +930,30 @@ init_word_char (re_dfa_t *dfa) int ch = 0; if (BE (dfa->map_notascii == 0, 1)) { - if (sizeof (dfa->word_char[0]) == 8) + /* Avoid uint32_t and uint64_t as some non-GCC platforms lack + them, an issue when this code is used in Gnulib. */ + bitset_word_t bits0 = 0x00000000; + bitset_word_t bits1 = 0x03ff0000; + bitset_word_t bits2 = 0x87fffffe; + bitset_word_t bits3 = 0x07fffffe; + + if (BITSET_WORD_BITS == 64) { - /* The extra temporaries here avoid "implicitly truncated" - warnings in the case when this is dead code, i.e. 32-bit. */ - const uint64_t wc0 = UINT64_C (0x03ff000000000000); - const uint64_t wc1 = UINT64_C (0x07fffffe87fffffe); - dfa->word_char[0] = wc0; - dfa->word_char[1] = wc1; + /* Pacify gcc -Woverflow on 32-bit platformns. */ + dfa->word_char[0] = bits1 << 31 << 1 | bits0; + dfa->word_char[1] = bits3 << 31 << 1 | bits2; i = 2; } - else if (sizeof (dfa->word_char[0]) == 4) + else if (BITSET_WORD_BITS == 32) { - dfa->word_char[0] = UINT32_C (0x00000000); - dfa->word_char[1] = UINT32_C (0x03ff0000); - dfa->word_char[2] = UINT32_C (0x87fffffe); - dfa->word_char[3] = UINT32_C (0x07fffffe); + dfa->word_char[0] = bits0; + dfa->word_char[1] = bits1; + dfa->word_char[2] = bits2; + dfa->word_char[3] = bits3; i = 4; } else - abort (); + goto general_case; ch = 128; if (BE (dfa->is_utf8, 1)) @@ -959,6 +963,7 @@ init_word_char (re_dfa_t *dfa) } } +general_case: for (; i < BITSET_WORDS; ++i) for (int j = 0; j < BITSET_WORD_BITS; ++j, ++ch) if (isalnum (ch) || ch == '_') From owner-svn-src-head@freebsd.org Fri Oct 16 15:16:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D82643920B; Fri, 16 Oct 2020 15:16:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCV9M6bsSz3ZkB; Fri, 16 Oct 2020 15:16:23 +0000 (UTC) (envelope-from kevans@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 C6FC412688; Fri, 16 Oct 2020 15:16:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GFGN7s015981; Fri, 16 Oct 2020 15:16:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GFGNUI015980; Fri, 16 Oct 2020 15:16:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010161516.09GFGNUI015980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Oct 2020 15:16:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366766 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 366766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 15:16:24 -0000 Author: kevans Date: Fri Oct 16 15:16:23 2020 New Revision: 366766 URL: https://svnweb.freebsd.org/changeset/base/366766 Log: Makefile: add a small blurb about building with gcc xtoolchain The key details are to install the appropriate flavor of devel/freebsd-gcc9 and pass CROSS_TOOLCHAIN while building. Suggested by: kib Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Fri Oct 16 14:28:13 2020 (r366765) +++ head/Makefile Fri Oct 16 15:16:23 2020 (r366766) @@ -89,6 +89,15 @@ # 10. `reboot' # 11. `make delete-old-libs' (in case no 3rd party program uses them anymore) # +# For individuals wanting to build from source with GCC from ports, first build +# or install an appropriate flavor of devel/freebsd-gcc9. The packages produced +# by this port are named "${TARGET_ARCH}-gcc9" -- note that not all +# architectures supported by FreeBSD have an external gcc toolchain available. +# +# Once the appropriate freebsd-gcc package is installed, simply pass +# CROSS_TOOLCHAIN=${TARGET_ARCH}-gcc9 while building with the above steps, +# e.g., `make buildworld CROSS_TOOLCHAIN=amd64-gcc9`. +# # See src/UPDATING `COMMON ITEMS' for more complete information. # # If TARGET=machine (e.g. powerpc, arm64, ...) is specified you can From owner-svn-src-head@freebsd.org Fri Oct 16 15:36:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 917244394B6 for ; Fri, 16 Oct 2020 15:36:09 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCVc86FX6z3btG for ; Fri, 16 Oct 2020 15:36:08 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f45.google.com with SMTP id h7so3424488wre.4 for ; Fri, 16 Oct 2020 08:36:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Z+Q+IZJziP5TadPPnIouIZ58u4Hw8B+x7N5zeodJMt8=; b=mGDabpDvIllT6viFoP0osWpyF371DiIhQ+2rFC8DXjbnS6S8dNSzSalA+1bMKxiyZW XgtuqLSbqOMtfqRoCdNlHWqPljz04J7lxNcaGuKPMmuI3eJAim7MHGM7SYK2JxOUPp12 olI8YZtXAEqeqjx+EeY5K5yVRlQLikc6RCWSNmG5WZeqZVed06vcZbc0daNNzFxvw1y9 +U3sTgO5ppVzOz60xRhen/riTttIB6bzAdnGRC6ilkbdGrMFrYNTYHPbMMgQaR++BAWg 4r7pnOq/0ngFH1X14hHk6se/NSE/GOdsjiz9s5nbk5+BcpsX05KPSw6QByVlQaq4TwJd lhEQ== X-Gm-Message-State: AOAM532s485VqIzVvTM+/7nUBqWWG9+5Ei/PLHvkLH6/R3SqjsxkVSqS R9onD+HAkG7Gad9DqgHo8tvxZQ== X-Google-Smtp-Source: ABdhPJwbOcDJLmfhK1kX/fMxHLxXeDq2QdiQN+feI/ibTJlQJ58Q8p2owlxGU6gcx7uQwBuowLcC/Q== X-Received: by 2002:adf:a31a:: with SMTP id c26mr4419698wrb.378.1602862567387; Fri, 16 Oct 2020 08:36:07 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id j13sm3949713wru.86.2020.10.16.08.36.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Oct 2020 08:36:06 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r366766 - head From: Jessica Clarke In-Reply-To: <202010161516.09GFGNUI015980@repo.freebsd.org> Date: Fri, 16 Oct 2020 16:36:05 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202010161516.09GFGNUI015980@repo.freebsd.org> To: Kyle Evans X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4CCVc86FX6z3btG X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.45 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.08 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.58)[-0.585]; FORGED_SENDER(0.30)[jrtc27@debian.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@debian.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.979]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.02)[-1.016]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[debian.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.45:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.45:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 15:36:09 -0000 On 16 Oct 2020, at 16:16, Kyle Evans wrote: >=20 > Author: kevans > Date: Fri Oct 16 15:16:23 2020 > New Revision: 366766 > URL: https://svnweb.freebsd.org/changeset/base/366766 >=20 > Log: > Makefile: add a small blurb about building with gcc xtoolchain >=20 > The key details are to install the appropriate flavor of = devel/freebsd-gcc9 > and pass CROSS_TOOLCHAIN while building. >=20 > Suggested by: kib >=20 > Modified: > head/Makefile >=20 > Modified: head/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/Makefile Fri Oct 16 14:28:13 2020 (r366765) > +++ head/Makefile Fri Oct 16 15:16:23 2020 (r366766) > @@ -89,6 +89,15 @@ > # 10. `reboot' > # 11. `make delete-old-libs' (in case no 3rd party program uses them = anymore) > # > +# For individuals wanting to build from source with GCC from ports, = first build > +# or install an appropriate flavor of devel/freebsd-gcc9. The = packages produced > +# by this port are named "${TARGET_ARCH}-gcc9" -- note that not all > +# architectures supported by FreeBSD have an external gcc toolchain = available. > +# > +# Once the appropriate freebsd-gcc package is installed, simply pass > +# CROSS_TOOLCHAIN=3D${TARGET_ARCH}-gcc9 while building with the above = steps, > +# e.g., `make buildworld CROSS_TOOLCHAIN=3Damd64-gcc9`. Given GCC 10 is the latest GCC release so this is already a bit outdated (though perhaps GCC 9 is still the recommended version for FreeBSD now?), should this not avoid hard-coding a specific version and thus s/9/N/ (or X)? Jess From owner-svn-src-head@freebsd.org Fri Oct 16 15:41:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B853A4397B6; Fri, 16 Oct 2020 15:41:46 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCVkf4Tvjz3cC6; Fri, 16 Oct 2020 15:41:46 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 78A4318229; Fri, 16 Oct 2020 15:41:46 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f48.google.com with SMTP id cv1so1276189qvb.2; Fri, 16 Oct 2020 08:41:46 -0700 (PDT) X-Gm-Message-State: AOAM532F32z9cUGNjOLZRuwCUDGhhjG3iviSllWJZjdXwROZtaF33Ct4 45VTShGgdK1G+Id4mGwC/7z8lRFiH0GAdDCfbk8= X-Google-Smtp-Source: ABdhPJx2bp3b37QN72+sxm12HwYScxejaGlBBxk/hbMhWYRRhjvGM8RhOO5rbcZzZsysa5/Sm8xRIY2sj90rt91tMXI= X-Received: by 2002:a0c:c709:: with SMTP id w9mr4591216qvi.26.1602862906024; Fri, 16 Oct 2020 08:41:46 -0700 (PDT) MIME-Version: 1.0 References: <202010161516.09GFGNUI015980@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Fri, 16 Oct 2020 10:41:34 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366766 - head To: Jessica Clarke Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 15:41:46 -0000 On Fri, Oct 16, 2020 at 10:36 AM Jessica Clarke wrote: > > On 16 Oct 2020, at 16:16, Kyle Evans wrote: > > > > Author: kevans > > Date: Fri Oct 16 15:16:23 2020 > > New Revision: 366766 > > URL: https://svnweb.freebsd.org/changeset/base/366766 > > > > Log: > > Makefile: add a small blurb about building with gcc xtoolchain > > > > The key details are to install the appropriate flavor of devel/freebsd-gcc9 > > and pass CROSS_TOOLCHAIN while building. > > > > Suggested by: kib > > > > Modified: > > head/Makefile > > > > Modified: head/Makefile > > ============================================================================== > > --- head/Makefile Fri Oct 16 14:28:13 2020 (r366765) > > +++ head/Makefile Fri Oct 16 15:16:23 2020 (r366766) > > @@ -89,6 +89,15 @@ > > # 10. `reboot' > > # 11. `make delete-old-libs' (in case no 3rd party program uses them anymore) > > # > > +# For individuals wanting to build from source with GCC from ports, first build > > +# or install an appropriate flavor of devel/freebsd-gcc9. The packages produced > > +# by this port are named "${TARGET_ARCH}-gcc9" -- note that not all > > +# architectures supported by FreeBSD have an external gcc toolchain available. > > +# > > +# Once the appropriate freebsd-gcc package is installed, simply pass > > +# CROSS_TOOLCHAIN=${TARGET_ARCH}-gcc9 while building with the above steps, > > +# e.g., `make buildworld CROSS_TOOLCHAIN=amd64-gcc9`. > > Given GCC 10 is the latest GCC release so this is already a bit > outdated (though perhaps GCC 9 is still the recommended version for > FreeBSD now?), should this not avoid hard-coding a specific version and > thus s/9/N/ (or X)? > Probably so, yes -- freebsd-gcc9 is still the latest and greatest as far as cross-toolchain gcc goes, though. We still have freebsd-gcc6, too, so at the very least once we drop freebsd-gcc6 and create freebsd-gcc10 I'll revisit this and find some way to make it more generic while still easy to find the port/pkg you need. From owner-svn-src-head@freebsd.org Fri Oct 16 15:55:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E67D1439968; Fri, 16 Oct 2020 15:55:07 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCW23644Lz3d4M; Fri, 16 Oct 2020 15:55:07 +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 B358B12D19; Fri, 16 Oct 2020 15:55:07 +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 09GFt7md041280; Fri, 16 Oct 2020 15:55:07 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GFt7G4041278; Fri, 16 Oct 2020 15:55:07 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202010161555.09GFt7G4041278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 16 Oct 2020 15:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366767 - in head: share/man/man4 sys/dev/arcmsr X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/arcmsr X-SVN-Commit-Revision: 366767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 15:55:08 -0000 Author: delphij Date: Fri Oct 16 15:55:06 2020 New Revision: 366767 URL: https://svnweb.freebsd.org/changeset/base/366767 Log: Update arcmsr(4) to 1.50.00.00: Add support for ARC-1886, NVMe/SAS/SATA controller. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 MFC after: 2 weeks Modified: head/share/man/man4/arcmsr.4 head/sys/dev/arcmsr/arcmsr.c head/sys/dev/arcmsr/arcmsr.h Modified: head/share/man/man4/arcmsr.4 ============================================================================== --- head/share/man/man4/arcmsr.4 Fri Oct 16 15:16:23 2020 (r366766) +++ head/share/man/man4/arcmsr.4 Fri Oct 16 15:55:06 2020 (r366767) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2017 +.Dd October 15, 2020 .Dt ARCMSR 4 .Os .Sh NAME @@ -153,6 +153,8 @@ ARC-1882 ARC-1883 .It ARC-1884 +.It +ARC-1886 .El .Sh FILES .Bl -tag -width ".Pa /dev/arcmsr?" -compact Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Fri Oct 16 15:16:23 2020 (r366766) +++ head/sys/dev/arcmsr/arcmsr.c Fri Oct 16 15:55:06 2020 (r366767) @@ -81,6 +81,7 @@ ** 1.30.00.00 11/30/2015 Ching Huang Added support ARC1203 ** 1.40.00.00 07/11/2017 Ching Huang Added support ARC1884 ** 1.40.00.01 10/30/2017 Ching Huang Fixed release memory resource +** 1.50.00.00 09/30/2020 Ching Huang Added support ARC-1886, NVMe/SAS/SATA controller ****************************************************************************************** */ @@ -138,7 +139,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1); -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.40.00.01 2017-10-30" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.00 2020-09-30" #include /* ************************************************************************** @@ -176,6 +177,7 @@ static void arcmsr_polling_devmap(void *arg); static void arcmsr_srb_timeout(void *arg); static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb); static void arcmsr_hbe_postqueue_isr(struct AdapterControlBlock *acb); +static void arcmsr_hbf_postqueue_isr(struct AdapterControlBlock *acb); static void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock *acb); #ifdef ARCMSR_DEBUG1 static void arcmsr_dump_data(struct AdapterControlBlock *acb); @@ -294,19 +296,20 @@ static u_int32_t arcmsr_disable_allintr( struct Adapte break; case ACB_ADAPTER_TYPE_C: { /* disable all outbound interrupt */ - intmask_org = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_mask) ; /* disable outbound message0 int */ + intmask_org = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_mask); /* disable outbound message0 int */ CHIP_REG_WRITE32(HBC_MessageUnit, 0, host_int_mask, intmask_org|ARCMSR_HBCMU_ALL_INTMASKENABLE); } break; case ACB_ADAPTER_TYPE_D: { /* disable all outbound interrupt */ - intmask_org = CHIP_REG_READ32(HBD_MessageUnit, 0, pcief0_int_enable) ; /* disable outbound message0 int */ + intmask_org = CHIP_REG_READ32(HBD_MessageUnit, 0, pcief0_int_enable); /* disable outbound message0 int */ CHIP_REG_WRITE32(HBD_MessageUnit, 0, pcief0_int_enable, ARCMSR_HBDMU_ALL_INT_DISABLE); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* disable all outbound interrupt */ - intmask_org = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_mask) ; /* disable outbound message0 int */ + intmask_org = CHIP_REG_READ32(HBE_MessageUnit, 0, host_int_mask); /* disable outbound message0 int */ CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_mask, intmask_org | ARCMSR_HBEMU_ALL_INTMASKENABLE); } break; @@ -352,7 +355,8 @@ static void arcmsr_enable_allintr( struct AdapterContr acb->outbound_int_enable = mask; } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* enable outbound Post Queue, outbound doorbell Interrupt */ mask = ~(ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR | ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR); CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_mask, intmask_org & mask); @@ -577,7 +581,8 @@ static void arcmsr_flush_adapter_cache(struct AdapterC arcmsr_flush_hbd_cache(acb); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { arcmsr_flush_hbe_cache(acb); } break; @@ -733,7 +738,8 @@ static void arcmsr_abort_allcmd(struct AdapterControlB arcmsr_abort_hbd_allcmd(acb); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { arcmsr_abort_hbe_allcmd(acb); } break; @@ -844,6 +850,7 @@ static void arcmsr_drain_donequeue(struct AdapterContr srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFE0)); /*frame must be 32 bytes aligned*/ break; case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: srb = acb->psrb_pool[flag_srb]; break; default: @@ -941,14 +948,15 @@ static void arcmsr_done4abort_postqueue(struct Adapter } } break; - case ACB_ADAPTER_TYPE_D: { - arcmsr_hbd_postqueue_isr(acb); - } + case ACB_ADAPTER_TYPE_D: + arcmsr_hbd_postqueue_isr(acb); break; - case ACB_ADAPTER_TYPE_E: { - arcmsr_hbe_postqueue_isr(acb); - } + case ACB_ADAPTER_TYPE_E: + arcmsr_hbe_postqueue_isr(acb); break; + case ACB_ADAPTER_TYPE_F: + arcmsr_hbf_postqueue_isr(acb); + break; } } /* @@ -1167,8 +1175,20 @@ static void arcmsr_post_srb(struct AdapterControlBlock ccb_post_stamp = (srb->smid | ((arc_cdb_size-1) >> 6)); CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_queueport_high, 0); CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_queueport_low, ccb_post_stamp); - } + } break; + case ACB_ADAPTER_TYPE_F: { + u_int32_t ccb_post_stamp, arc_cdb_size; + + if (srb->arc_cdb_size <= 0x300) + arc_cdb_size = (srb->arc_cdb_size - 1) >> 6 | 1; + else + arc_cdb_size = (((srb->arc_cdb_size + 0xff) >> 8) + 2) << 1 | 1; + ccb_post_stamp = (srb->smid | arc_cdb_size); + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_queueport_high, 0); + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_queueport_low, ccb_post_stamp); + } + break; } } /* @@ -1210,6 +1230,9 @@ static struct QBUFFER *arcmsr_get_iop_rqbuffer( struct qbuffer = (struct QBUFFER *)&phbcmu->message_rbuffer; } break; + case ACB_ADAPTER_TYPE_F: + qbuffer = (struct QBUFFER *)acb->message_rbuffer; + break; } return(qbuffer); } @@ -1252,6 +1275,9 @@ static struct QBUFFER *arcmsr_get_iop_wqbuffer( struct qbuffer = (struct QBUFFER *)&phbcmu->message_wbuffer; } break; + case ACB_ADAPTER_TYPE_F: + qbuffer = (struct QBUFFER *)acb->message_wbuffer; + break; } return(qbuffer); } @@ -1283,7 +1309,8 @@ static void arcmsr_iop_message_read(struct AdapterCont CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* let IOP know data has been read */ acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_DATA_READ_OK; CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); @@ -1331,7 +1358,8 @@ static void arcmsr_iop_message_wrote(struct AdapterCon CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_IN_READY); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* ** push inbound doorbell tell iop, driver data write ok ** and wait reply on next hwinterrupt for next Qbuffer post @@ -1432,7 +1460,8 @@ static void arcmsr_stop_adapter_bgrb(struct AdapterCon arcmsr_stop_hbd_bgrb(acb); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { arcmsr_stop_hbe_bgrb(acb); } break; @@ -1671,7 +1700,7 @@ static void arcmsr_rescan_lun(struct AdapterControlBlo union ccb *ccb; if ((ccb = (union ccb *)xpt_alloc_ccb_nowait()) == NULL) - return; + return; if (xpt_create_path(&path, NULL, cam_sim_path(acb->psim), target, lun) != CAM_REQ_CMP) { xpt_free_ccb(ccb); @@ -1760,10 +1789,18 @@ static void arcmsr_dr_handle(struct AdapterControlBloc devicemap = offsetof(struct HBE_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); for (target = 0; target < 4; target++) { - deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); - devicemap += 4; + deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); + devicemap += 4; } break; + case ACB_ADAPTER_TYPE_F: + devicemap = ARCMSR_FW_DEVMAP_OFFSET; + for (target = 0; target < 4; target++) + { + deviceMapCurrent[target] = acb->msgcode_rwbuffer[devicemap]; + devicemap += 1; + } + break; } if(acb->acb_flags & ACB_F_BUS_HANG_ON) @@ -1774,7 +1811,7 @@ static void arcmsr_dr_handle(struct AdapterControlBloc ** adapter posted CONFIG message ** copy the new map, note if there are differences with the current map */ - pDevMap = (u_int8_t *)&deviceMapCurrent[0]; + pDevMap = (u_int8_t *)&deviceMapCurrent[0]; for (target = 0; target < ARCMSR_MAX_TARGETID - 1; target++) { if (*pDevMap != acb->device_map[target]) @@ -2002,7 +2039,7 @@ static void arcmsr_hba_postqueue_isr(struct AdapterCon while((flag_srb = CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_queueport)) != 0xFFFFFFFF) { /* check if command done with no error*/ - error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0) ? TRUE : FALSE; + error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0) ? TRUE : FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ } @@ -2031,7 +2068,7 @@ static void arcmsr_hbb_postqueue_isr(struct AdapterCon index %= ARCMSR_MAX_HBB_POSTQUEUE; /*if last index number set it to 0 */ phbbmu->doneq_index = index; /* check if command done with no error*/ - error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; + error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ } @@ -2049,7 +2086,7 @@ static void arcmsr_hbc_postqueue_isr(struct AdapterCon ** areca cdb command done ***************************************************************************** */ - bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); + bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); do { flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); if (flag_srb == 0xFFFFFFFF) @@ -2059,7 +2096,7 @@ static void arcmsr_hbc_postqueue_isr(struct AdapterCon arcmsr_drain_donequeue(acb, flag_srb, error); throttling++; if(throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) { - CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); throttling = 0; } } while(CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR); @@ -2151,6 +2188,35 @@ static void arcmsr_hbe_postqueue_isr(struct AdapterCon acb->doneq_index = doneq_index; CHIP_REG_WRITE32(HBE_MessageUnit, 0, reply_post_consumer_index, doneq_index); } + +static void arcmsr_hbf_postqueue_isr(struct AdapterControlBlock *acb) +{ + uint16_t error; + uint32_t doneq_index; + uint16_t cmdSMID; + + /* + ***************************************************************************** + ** areca cdb command done + ***************************************************************************** + */ + bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + doneq_index = acb->doneq_index; + while (1) { + cmdSMID = acb->pCompletionQ[doneq_index].cmdSMID; + if (cmdSMID == 0xffff) + break; + error = (acb->pCompletionQ[doneq_index].cmdFlag & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE; + arcmsr_drain_donequeue(acb, (u_int32_t)cmdSMID, error); + acb->pCompletionQ[doneq_index].cmdSMID = 0xffff; + doneq_index++; + if (doneq_index >= acb->completionQ_entry) + doneq_index = 0; + } + acb->doneq_index = doneq_index; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, reply_post_consumer_index, doneq_index); +} + /* ********************************************************************** ********************************************************************** @@ -2312,6 +2378,34 @@ static void arcmsr_handle_hbe_isr( struct AdapterContr host_interrupt_status = CHIP_REG_READ32(HBE_MessageUnit, 0, host_int_status); } while (host_interrupt_status & (ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR | ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR)); } + +static void arcmsr_handle_hbf_isr( struct AdapterControlBlock *acb) +{ + u_int32_t host_interrupt_status; + /* + ********************************************* + ** check outbound intstatus + ********************************************* + */ + host_interrupt_status = CHIP_REG_READ32(HBF_MessageUnit, 0, host_int_status) & + (ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR | + ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR); + if(!host_interrupt_status) { + /*it must be share irq*/ + return; + } + do { + /* MU doorbell interrupts*/ + if(host_interrupt_status & ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR) { + arcmsr_hbe_doorbell_isr(acb); + } + /* MU post queue interrupts*/ + if(host_interrupt_status & ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR) { + arcmsr_hbf_postqueue_isr(acb); + } + host_interrupt_status = CHIP_REG_READ32(HBF_MessageUnit, 0, host_int_status); + } while (host_interrupt_status & (ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR | ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR)); +} /* ****************************************************************************** ****************************************************************************** @@ -2334,6 +2428,9 @@ static void arcmsr_interrupt(struct AdapterControlBloc case ACB_ADAPTER_TYPE_E: arcmsr_handle_hbe_isr(acb); break; + case ACB_ADAPTER_TYPE_F: + arcmsr_handle_hbf_isr(acb); + break; default: printf("arcmsr%d: interrupt service," " unknown adapter type =%d\n", acb->pci_unit, acb->adapter_type); @@ -2364,7 +2461,7 @@ static void arcmsr_polling_devmap(void *arg) CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); break; - case ACB_ADAPTER_TYPE_B: { + case ACB_ADAPTER_TYPE_B: { struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_GET_CONFIG); } @@ -2379,13 +2476,24 @@ static void arcmsr_polling_devmap(void *arg) CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); break; - case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_E: CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); - break; - } + break; + case ACB_ADAPTER_TYPE_F: { + u_int32_t outMsg1 = CHIP_REG_READ32(HBF_MessageUnit, 0, outbound_msgaddr1); + if (!(outMsg1 & ARCMSR_HBFMU_MESSAGE_FIRMWARE_OK) || + (outMsg1 & ARCMSR_HBFMU_MESSAGE_NO_VOLUME_CHANGE)) + goto nxt6s; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + break; + } + } +nxt6s: if((acb->acb_flags & ACB_F_SCSISTOPADAPTER) == 0) { callout_reset(&acb->devmap_callout, 5 * hz, arcmsr_polling_devmap, acb); /* polling per 5 seconds */ @@ -3311,6 +3419,7 @@ static void arcmsr_start_adapter_bgrb(struct AdapterCo arcmsr_start_hbd_bgrb(acb); break; case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: arcmsr_start_hbe_bgrb(acb); break; } @@ -3452,7 +3561,7 @@ polling_ccb_retry: break; } if (acb->srboutstandingcount == 0) { - break; + break; } goto polling_ccb_retry; } @@ -3555,12 +3664,12 @@ polling_ccb_retry: break;/*chip FIFO no ccb for completion already*/ } else { UDELAY(25000); - if ((poll_count > 100) && (poll_srb != NULL)) { + if ((poll_count > 100) && (poll_srb != NULL)) { break; } - if (acb->srboutstandingcount == 0) { - break; - } + if (acb->srboutstandingcount == 0) { + break; + } goto polling_ccb_retry; } } @@ -3596,25 +3705,21 @@ polling_ccb_retry: static void arcmsr_polling_srbdone(struct AdapterControlBlock *acb, struct CommandControlBlock *poll_srb) { switch (acb->adapter_type) { - case ACB_ADAPTER_TYPE_A: { - arcmsr_polling_hba_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_A: + arcmsr_polling_hba_srbdone(acb, poll_srb); break; - case ACB_ADAPTER_TYPE_B: { - arcmsr_polling_hbb_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_B: + arcmsr_polling_hbb_srbdone(acb, poll_srb); break; - case ACB_ADAPTER_TYPE_C: { - arcmsr_polling_hbc_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_C: + arcmsr_polling_hbc_srbdone(acb, poll_srb); break; - case ACB_ADAPTER_TYPE_D: { - arcmsr_polling_hbd_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_D: + arcmsr_polling_hbd_srbdone(acb, poll_srb); break; - case ACB_ADAPTER_TYPE_E: { - arcmsr_polling_hbe_srbdone(acb, poll_srb); - } + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: + arcmsr_polling_hbe_srbdone(acb, poll_srb); break; } } @@ -3874,29 +3979,81 @@ static void arcmsr_get_hbe_config(struct AdapterContro ********************************************************************** ********************************************************************** */ +static void arcmsr_get_hbf_config(struct AdapterControlBlock *acb) +{ + u_int32_t *acb_firm_model = (u_int32_t *)acb->firm_model; + u_int32_t *acb_firm_version = (u_int32_t *)acb->firm_version; + u_int32_t *acb_device_map = (u_int32_t *)acb->device_map; + size_t iop_firm_model = ARCMSR_FW_MODEL_OFFSET; /*firm_model,15,60-67*/ + size_t iop_firm_version = ARCMSR_FW_VERS_OFFSET; /*firm_version,17,68-83*/ + size_t iop_device_map = ARCMSR_FW_DEVMAP_OFFSET; + int i; + + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) + printf("arcmsr%d: wait 'get adapter firmware miscellaneous data' timeout \n", acb->pci_unit); + + i = 0; + while(i < 2) { + *acb_firm_model = acb->msgcode_rwbuffer[iop_firm_model]; + /* 8 bytes firm_model, 15, 60-67*/ + acb_firm_model++; + iop_firm_model++; + i++; + } + i = 0; + while(i < 4) { + *acb_firm_version = acb->msgcode_rwbuffer[iop_firm_version]; + /* 16 bytes firm_version, 17, 68-83*/ + acb_firm_version++; + iop_firm_version++; + i++; + } + i = 0; + while(i < 4) { + *acb_device_map = acb->msgcode_rwbuffer[iop_device_map]; + acb_device_map++; + iop_device_map++; + i++; + } + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); + acb->firm_request_len = acb->msgcode_rwbuffer[1]; /*firm_request_len, 1, 04-07*/ + acb->firm_numbers_queue = acb->msgcode_rwbuffer[2]; /*firm_numbers_queue, 2, 08-11*/ + acb->firm_sdram_size = acb->msgcode_rwbuffer[3]; /*firm_sdram_size, 3, 12-15*/ + acb->firm_ide_channels = acb->msgcode_rwbuffer[4]; /*firm_ide_channels, 4, 16-19*/ + acb->firm_cfg_version = acb->msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]; /*firm_cfg_version, 25*/ + if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) + acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; +} +/* +********************************************************************** +********************************************************************** +*/ static void arcmsr_get_firmware_spec(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { - case ACB_ADAPTER_TYPE_A: { - arcmsr_get_hba_config(acb); - } + case ACB_ADAPTER_TYPE_A: + arcmsr_get_hba_config(acb); break; - case ACB_ADAPTER_TYPE_B: { - arcmsr_get_hbb_config(acb); - } + case ACB_ADAPTER_TYPE_B: + arcmsr_get_hbb_config(acb); break; - case ACB_ADAPTER_TYPE_C: { - arcmsr_get_hbc_config(acb); - } + case ACB_ADAPTER_TYPE_C: + arcmsr_get_hbc_config(acb); break; - case ACB_ADAPTER_TYPE_D: { - arcmsr_get_hbd_config(acb); - } + case ACB_ADAPTER_TYPE_D: + arcmsr_get_hbd_config(acb); break; - case ACB_ADAPTER_TYPE_E: { - arcmsr_get_hbe_config(acb); - } + case ACB_ADAPTER_TYPE_E: + arcmsr_get_hbe_config(acb); break; + case ACB_ADAPTER_TYPE_F: + arcmsr_get_hbf_config(acb); + break; } } /* @@ -3958,7 +4115,8 @@ static void arcmsr_wait_firmware_ready( struct Adapter } } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { while ((CHIP_REG_READ32(HBE_MessageUnit, 0, outbound_msgaddr1) & ARCMSR_HBEMU_MESSAGE_FIRMWARE_OK) == 0) { if (timeout++ > 4000) /* (4000*15)/1000 = 60 sec */ @@ -4011,7 +4169,8 @@ static void arcmsr_clear_doorbell_queue_buffer( struct CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ); } break; - case ACB_ADAPTER_TYPE_E: { + case ACB_ADAPTER_TYPE_E: + case ACB_ADAPTER_TYPE_F: { /* empty doorbell Qbuffer if door bell ringed */ acb->in_doorbell = CHIP_REG_READ32(HBE_MessageUnit, 0, iobound_doorbell); CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); /*clear doorbell interrupt */ @@ -4146,6 +4305,27 @@ static u_int32_t arcmsr_iop_confirm(struct AdapterCont } } break; + case ACB_ADAPTER_TYPE_F: { + u_int32_t cdb_phyaddr_lo32; + cdb_phyaddr_lo32 = srb_phyaddr_lo32 + offsetof(struct CommandControlBlock, arcmsr_cdb); + acb->msgcode_rwbuffer[0] = ARCMSR_SIGNATURE_SET_CONFIG; + acb->msgcode_rwbuffer[1] = ARCMSR_SIGNATURE_1886; + acb->msgcode_rwbuffer[2] = cdb_phyaddr_lo32; + acb->msgcode_rwbuffer[3] = srb_phyaddr_hi32; + acb->msgcode_rwbuffer[4] = SRB_SIZE; + cdb_phyaddr_lo32 = srb_phyaddr_lo32 + ARCMSR_SRBS_POOL_SIZE; + acb->msgcode_rwbuffer[5] = cdb_phyaddr_lo32; + acb->msgcode_rwbuffer[6] = srb_phyaddr_hi32; + acb->msgcode_rwbuffer[7] = COMPLETION_Q_POOL_SIZE; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_SET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) { + printf( "arcmsr%d: 'set srb high part physical address' timeout \n", acb->pci_unit); + return FALSE; + } + } + break; } return (TRUE); } @@ -4209,7 +4389,7 @@ static void arcmsr_map_free_srb(void *arg, bus_dma_seg return; } if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D) - || (acb->adapter_type == ACB_ADAPTER_TYPE_E)) + || (acb->adapter_type == ACB_ADAPTER_TYPE_E) || (acb->adapter_type == ACB_ADAPTER_TYPE_F)) { srb_tmp->cdb_phyaddr_low = srb_phyaddr; srb_tmp->cdb_phyaddr_high = (u_int32_t)((srb_phyaddr >> 16) >> 16); @@ -4224,6 +4404,15 @@ static void arcmsr_map_free_srb(void *arg, bus_dma_seg } if (acb->adapter_type == ACB_ADAPTER_TYPE_E) acb->pCompletionQ = (pCompletion_Q)srb_tmp; + else if (acb->adapter_type == ACB_ADAPTER_TYPE_F) { + acb->pCompletionQ = (pCompletion_Q)srb_tmp; + acb->completeQ_phys = srb_phyaddr; + memset(acb->pCompletionQ, 0xff, COMPLETION_Q_POOL_SIZE); + acb->message_wbuffer = (u_int32_t *)((unsigned long)acb->pCompletionQ + COMPLETION_Q_POOL_SIZE); + acb->message_rbuffer = (u_int32_t *)((unsigned long)acb->message_wbuffer + 0x100); + acb->msgcode_rwbuffer = (u_int32_t *)((unsigned long)acb->message_wbuffer + 0x200); + memset((void *)acb->message_wbuffer, 0, MESG_RW_BUFFER_SIZE); + } acb->vir2phy_offset = (unsigned long)srb_tmp - (unsigned long)srb_phyaddr; } /* @@ -4299,6 +4488,13 @@ static u_int32_t arcmsr_initialize(device_t dev) max_coherent_size = ARCMSR_SRBS_POOL_SIZE + COMPLETION_Q_POOL_SIZE; acb->completionQ_entry = COMPLETION_Q_POOL_SIZE / sizeof(struct deliver_completeQ); break; + case PCIDevVenIDARC1886_: + case PCIDevVenIDARC1886: + acb->adapter_type = ACB_ADAPTER_TYPE_F; + acb->adapter_bus_speed = ACB_BUS_SPEED_12G; + max_coherent_size = ARCMSR_SRBS_POOL_SIZE + COMPLETION_Q_POOL_SIZE + MESG_RW_BUFFER_SIZE; + acb->completionQ_entry = COMPLETION_Q_POOL_SIZE / sizeof(struct deliver_completeQ); + break; case PCIDevVenIDARC1214: { acb->adapter_type = ACB_ADAPTER_TYPE_D; acb->adapter_bus_speed = ACB_BUS_SPEED_6G; @@ -4513,7 +4709,7 @@ static u_int32_t arcmsr_initialize(device_t dev) u_int32_t rid0 = PCIR_BAR(1); vm_offset_t mem_base0; - acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid0, RF_ACTIVE); + acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid0, RF_ACTIVE); if(acb->sys_res_arcmsr[0] == NULL) { arcmsr_free_resource(acb); printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); @@ -4541,7 +4737,7 @@ static u_int32_t arcmsr_initialize(device_t dev) u_int32_t rid0 = PCIR_BAR(0); vm_offset_t mem_base0; - acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid0, RF_ACTIVE); + acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid0, RF_ACTIVE); if(acb->sys_res_arcmsr[0] == NULL) { arcmsr_free_resource(acb); printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); @@ -4598,6 +4794,44 @@ static u_int32_t arcmsr_initialize(device_t dev) CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, ARCMSR_HBEMU_DOORBELL_SYNC); /* synchronize doorbell to 0 */ } break; + case ACB_ADAPTER_TYPE_F: { + u_int32_t rid0 = PCIR_BAR(0); + vm_offset_t mem_base0; + unsigned long host_buffer_dma; + + acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid0, RF_ACTIVE); + if(acb->sys_res_arcmsr[0] == NULL) { + arcmsr_free_resource(acb); + printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); + return ENOMEM; + } + if(rman_get_start(acb->sys_res_arcmsr[0]) <= 0) { + arcmsr_free_resource(acb); + printf("arcmsr%d: rman_get_start failure!\n", device_get_unit(dev)); + return ENXIO; + } + mem_base0 = (vm_offset_t) rman_get_virtual(acb->sys_res_arcmsr[0]); + if(mem_base0 == 0) { + arcmsr_free_resource(acb); + printf("arcmsr%d: rman_get_virtual failure!\n", device_get_unit(dev)); + return ENXIO; + } + acb->btag[0] = rman_get_bustag(acb->sys_res_arcmsr[0]); + acb->bhandle[0] = rman_get_bushandle(acb->sys_res_arcmsr[0]); + acb->pmu = (struct MessageUnit_UNION *)mem_base0; + acb->doneq_index = 0; + acb->in_doorbell = 0; + acb->out_doorbell = 0; + acb->rid[0] = rid0; + arcmsr_wait_firmware_ready(acb); + CHIP_REG_WRITE32(HBF_MessageUnit, 0, host_int_status, 0); /*clear interrupt*/ + CHIP_REG_WRITE32(HBF_MessageUnit, 0, iobound_doorbell, ARCMSR_HBEMU_DOORBELL_SYNC); /* synchronize doorbell to 0 */ + host_buffer_dma = acb->completeQ_phys + COMPLETION_Q_POOL_SIZE; + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_msgaddr0, (u_int32_t)(host_buffer_dma | 1)); /* host buffer low addr, bit0:1 all buffer active */ + CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_msgaddr1, (u_int32_t)((host_buffer_dma >> 16) >> 16));/* host buffer high addr */ + CHIP_REG_WRITE32(HBF_MessageUnit, 0, iobound_doorbell, ARCMSR_HBFMU_DOORBELL_SYNC1); /* set host buffer physical address */ + } + break; } if(acb->acb_flags & ACB_F_MAPFREESRB_FAILD) { arcmsr_free_resource(acb); @@ -4801,6 +5035,10 @@ static int arcmsr_probe(device_t dev) break; case PCIDevVenIDARC1884: type = "SAS 12G"; + break; + case PCIDevVenIDARC1886_: + case PCIDevVenIDARC1886: + type = "NVME,SAS-12G,SATA-6G"; break; case PCIDevVenIDARC1214: case PCIDevVenIDARC1203: Modified: head/sys/dev/arcmsr/arcmsr.h ============================================================================== --- head/sys/dev/arcmsr/arcmsr.h Fri Oct 16 15:16:23 2020 (r366766) +++ head/sys/dev/arcmsr/arcmsr.h Fri Oct 16 15:55:06 2020 (r366767) @@ -150,6 +150,8 @@ typedef struct mtx arcmsr_lock_t; #define PCIDevVenIDARC1880 0x188017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1882 0x188217D3 /* Vendor Device ID */ #define PCIDevVenIDARC1884 0x188417D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1886_ 0x188917D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1886 0x188A17D3 /* Vendor Device ID */ #ifndef PCIR_BARS #define PCIR_BARS 0x10 @@ -458,7 +460,7 @@ struct CMD_MESSAGE_FIELD { /*ARCMSR_HBAMU_MESSAGE_FIRMWARE_OK*/ #define ARCMSR_HBDMU_MESSAGE_FIRMWARE_OK 0x80000000 -/* +/* ******************************************************************************* ** SPEC. for Areca HBE adapter ******************************************************************************* @@ -479,8 +481,22 @@ struct CMD_MESSAGE_FIELD { #define ARCMSR_HBEMU_DOORBELL_SYNC 0x100 #define ARCMSR_ARC188X_RESET_ADAPTER 0x00000004 /* +******************************************************************************* +** SPEC. for Areca HBF adapter +******************************************************************************* +*/ +#define ARCMSR_SIGNATURE_1886 0x188617D3 +// Doorbell and interrupt definition are same as Type E adapter +/* ARC-1886 doorbell sync */ +#define ARCMSR_HBFMU_DOORBELL_SYNC 0x100 +//set host rw buffer physical address at inbound message 0, 1 (low,high) +#define ARCMSR_HBFMU_DOORBELL_SYNC1 0x300 +#define ARCMSR_HBFMU_MESSAGE_FIRMWARE_OK 0x80000000 +#define ARCMSR_HBFMU_MESSAGE_NO_VOLUME_CHANGE 0x20000000 + +/* ********************************************************************* -** Message Unit structure +** Messaging Unit (MU) of Type A processor ********************************************************************* */ struct HBA_MessageUnit @@ -544,7 +560,7 @@ struct HBB_RWBUFFER }; /* ********************************************************************* -** +** Messaging Unit (MU) of Type B processor(MARVEL) ********************************************************************* */ struct HBB_MessageUnit @@ -563,7 +579,7 @@ struct HBB_MessageUnit /* ********************************************************************* -** +** Messaging Unit (MU) of Type C processor(LSI) ********************************************************************* */ struct HBC_MessageUnit { @@ -638,7 +654,7 @@ struct HBC_MessageUnit { }; /* ********************************************************************* -** +** Messaging Unit (MU) of Type D processor ********************************************************************* */ struct InBound_SRB { @@ -707,7 +723,7 @@ struct HBD_MessageUnit0 { }; /* ********************************************************************* -** +** Messaging Unit (MU) of Type E processor(LSI) ********************************************************************* */ struct HBE_MessageUnit { @@ -783,6 +799,80 @@ struct HBE_MessageUnit { u_int32_t msgcode_rwbuffer[256]; /*2200 23FF*/ }; +/* +********************************************************************* +** Messaging Unit (MU) of Type F processor(LSI) +********************************************************************* +*/ +struct HBF_MessageUnit { + u_int32_t iobound_doorbell; /*0000 0003*/ + u_int32_t write_sequence_3xxx; /*0004 0007*/ + u_int32_t host_diagnostic_3xxx; /*0008 000B*/ + u_int32_t posted_outbound_doorbell; /*000C 000F*/ + u_int32_t master_error_attribute; /*0010 0013*/ + u_int32_t master_error_address_low; /*0014 0017*/ + u_int32_t master_error_address_high; /*0018 001B*/ + u_int32_t hcb_size; /*001C 001F*/ + u_int32_t inbound_doorbell; /*0020 0023*/ + u_int32_t diagnostic_rw_data; /*0024 0027*/ + u_int32_t diagnostic_rw_address_low; /*0028 002B*/ + u_int32_t diagnostic_rw_address_high; /*002C 002F*/ + u_int32_t host_int_status; /*0030 0033 host interrupt status*/ + u_int32_t host_int_mask; /*0034 0037 host interrupt mask*/ + u_int32_t dcr_data; /*0038 003B*/ + u_int32_t dcr_address; /*003C 003F*/ + u_int32_t inbound_queueport; /*0040 0043 port32 host inbound queue port*/ + u_int32_t outbound_queueport; /*0044 0047 port32 host outbound queue port*/ + u_int32_t hcb_pci_address_low; /*0048 004B*/ + u_int32_t hcb_pci_address_high; /*004C 004F*/ + u_int32_t iop_int_status; /*0050 0053*/ + u_int32_t iop_int_mask; /*0054 0057*/ + u_int32_t iop_inbound_queue_port; /*0058 005B*/ + u_int32_t iop_outbound_queue_port; /*005C 005F*/ + u_int32_t inbound_free_list_index; /*0060 0063*/ + u_int32_t inbound_post_list_index; /*0064 0067*/ + u_int32_t reply_post_producer_index; /*0068 006B*/ + u_int32_t reply_post_consumer_index; /*006C 006F*/ + u_int32_t inbound_doorbell_clear; /*0070 0073*/ + u_int32_t i2o_message_unit_control; /*0074 0077*/ + u_int32_t last_used_message_source_address_low; /*0078 007B*/ + u_int32_t last_used_message_source_address_high; /*007C 007F*/ + u_int32_t pull_mode_data_byte_count[4]; /*0080 008F*/ + u_int32_t message_dest_address_index; /*0090 0093*/ + u_int32_t done_queue_not_empty_int_counter_timer; /*0094 0097*/ + u_int32_t utility_A_int_counter_timer; /*0098 009B*/ + u_int32_t outbound_doorbell; /*009C 009F*/ + u_int32_t outbound_doorbell_clear; /*00A0 00A3*/ + u_int32_t message_source_address_index; /*00A4 00A7*/ + u_int32_t message_done_queue_index; /*00A8 00AB*/ + u_int32_t reserved0; /*00AC 00AF*/ + u_int32_t inbound_msgaddr0; /*00B0 00B3 scratchpad0*/ + u_int32_t inbound_msgaddr1; /*00B4 00B7 scratchpad1*/ + u_int32_t outbound_msgaddr0; /*00B8 00BB scratchpad2*/ + u_int32_t outbound_msgaddr1; /*00BC 00BF scratchpad3*/ + u_int32_t inbound_queueport_low; /*00C0 00C3 port64 host inbound queue port low*/ + u_int32_t inbound_queueport_high; /*00C4 00C7 port64 host inbound queue port high*/ + u_int32_t outbound_queueport_low; /*00C8 00CB port64 host outbound queue port low*/ + u_int32_t outbound_queueport_high; /*00CC 00CF port64 host outbound queue port high*/ + u_int32_t iop_inbound_queue_port_low; /*00D0 00D3*/ + u_int32_t iop_inbound_queue_port_high; /*00D4 00D7*/ + u_int32_t iop_outbound_queue_port_low; /*00D8 00DB*/ + u_int32_t iop_outbound_queue_port_high; /*00DC 00DF*/ + u_int32_t message_dest_queue_port_low; /*00E0 00E3*/ + u_int32_t message_dest_queue_port_high; /*00E4 00E7*/ + u_int32_t last_used_message_dest_address_low; /*00E8 00EB*/ + u_int32_t last_used_message_dest_address_high; /*00EC 00EF*/ + u_int32_t message_done_queue_base_address_low; /*00F0 00F3*/ + u_int32_t message_done_queue_base_address_high; /*00F4 00F7*/ + u_int32_t host_diagnostic; /*00F8 00FB*/ + u_int32_t write_sequence; /*00FC 00FF*/ + u_int32_t reserved1[46]; /*0100 01B7*/ + u_int32_t reply_post_producer_index1; /*01B8 01BB*/ + u_int32_t reply_post_consumer_index1; /*01BC 01BF*/ +}; + +#define MESG_RW_BUFFER_SIZE (256 * 3) + typedef struct deliver_completeQ { u_int16_t cmdFlag; u_int16_t cmdSMID; @@ -805,6 +895,7 @@ struct MessageUnit_UNION struct HBC_MessageUnit hbcmu; struct HBD_MessageUnit0 hbdmu; struct HBE_MessageUnit hbemu; + struct HBF_MessageUnit hbfmu; } muu; }; /* @@ -1232,6 +1323,7 @@ struct CommandControlBlock { #define ACB_ADAPTER_TYPE_C 0x00000002 /* hbc L IOP */ #define ACB_ADAPTER_TYPE_D 0x00000003 /* hbd M IOP */ #define ACB_ADAPTER_TYPE_E 0x00000004 /* hbd L IOP */ +#define ACB_ADAPTER_TYPE_F 0x00000005 /* hbd L IOP */ struct AdapterControlBlock { u_int32_t adapter_type; /* adapter A,B..... */ @@ -1268,6 +1360,9 @@ struct AdapterControlBlock { u_int32_t outbound_int_enable; struct MessageUnit_UNION *pmu; /* message unit ATU inbound base address0 */ + uint32_t *message_wbuffer; //0x000 - COMPORT_IN (to be sent to ROC) + uint32_t *message_rbuffer; //0x100 - COMPORT_OUT (to be sent to Host) + uint32_t *msgcode_rwbuffer; //0x200 - BIOS_AREA u_int8_t adapter_index; u_int8_t irq; @@ -1317,6 +1412,7 @@ struct AdapterControlBlock { pCompletion_Q pCompletionQ; int msix_vectors; int rid[2]; + unsigned long completeQ_phys; };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 From owner-svn-src-head@freebsd.org Fri Oct 16 16:03:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC015439E57; Fri, 16 Oct 2020 16:03:52 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [18.222.6.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCWD81bbJz3dKD; Fri, 16 Oct 2020 16:03:51 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (unknown [18.188.142.31]) by mail.soaustin.net (Postfix) with ESMTPSA id 2243A170FD; Fri, 16 Oct 2020 16:03:51 +0000 (UTC) Date: Fri, 16 Oct 2020 16:03:50 +0000 From: Mark Linimon To: Jessica Clarke Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366766 - head Message-ID: <20201016160349.GA19939@lonesome.com> References: <202010161516.09GFGNUI015980@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Rspamd-Queue-Id: 4CCWD81bbJz3dKD X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of linimon@lonesome.com has no SPF policy when checking 18.222.6.11) smtp.mailfrom=linimon@lonesome.com X-Spamd-Result: default: False [-1.19 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEFALL_USER(0.00)[linimon]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[lonesome.com]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-0.90)[-0.900]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.33)[-0.328]; NEURAL_HAM_MEDIUM(-0.77)[-0.766]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16509, ipnet:18.220.0.0/14, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_IN_DNSWL_LOW(-0.10)[18.222.6.11:from] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 16:03:52 -0000 On Fri, Oct 16, 2020 at 04:36:05PM +0100, Jessica Clarke wrote: > Given GCC 10 is the latest GCC release so this is already a bit > outdated (though perhaps GCC 9 is still the recommended version for > FreeBSD now?) In possibly unrelated news, there are still about 25 ports which do not build on GCC 10 but do on GCC 9. Almost all of them involve fortran. Because of this, ports GCC still defaults to 9. We are actively working on this: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246700 mcl From owner-svn-src-head@freebsd.org Fri Oct 16 16:22:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FB1743A368; Fri, 16 Oct 2020 16:22:33 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCWdj3CFhz3f6b; Fri, 16 Oct 2020 16:22:33 +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 5246B1335D; Fri, 16 Oct 2020 16:22:33 +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 09GGMXfU059237; Fri, 16 Oct 2020 16:22:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GGMXkM059236; Fri, 16 Oct 2020 16:22:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010161622.09GGMXkM059236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 16 Oct 2020 16:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366768 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 366768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 16:22:33 -0000 Author: kib Date: Fri Oct 16 16:22:32 2020 New Revision: 366768 URL: https://svnweb.freebsd.org/changeset/base/366768 Log: amd64 pmap.h: explicitly provide constants values instead of relying on some more advanced C features. This fixes gcc-toolchain build of exception.S. Reported and tested by: kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/include/pmap.h Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Fri Oct 16 15:55:06 2020 (r366767) +++ head/sys/amd64/include/pmap.h Fri Oct 16 16:22:32 2020 (r366768) @@ -259,8 +259,8 @@ #define PMAP_PCID_OVERMAX_KERN 0x800 #define PMAP_PCID_USER_PT 0x800 -#define PMAP_NO_CR3 (~0UL) -#define PMAP_UCR3_NOMASK (~0UL) +#define PMAP_NO_CR3 0xffffffffffffffff +#define PMAP_UCR3_NOMASK 0xffffffffffffffff #ifndef LOCORE From owner-svn-src-head@freebsd.org Fri Oct 16 16:47:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02FC943AAB1; Fri, 16 Oct 2020 16:47:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCXBH6FXjz3fxj; Fri, 16 Oct 2020 16:47:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:a5e6:f767:6201:8a53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 314C51826B; Fri, 16 Oct 2020 16:47:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r366766 - head To: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010161516.09GFGNUI015980@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <5475d244-b507-d369-46c1-2b75c02a8645@FreeBSD.org> Date: Fri, 16 Oct 2020 09:47:18 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202010161516.09GFGNUI015980@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 16:47:20 -0000 On 10/16/20 8:16 AM, Kyle Evans wrote: > Author: kevans > Date: Fri Oct 16 15:16:23 2020 > New Revision: 366766 > URL: https://svnweb.freebsd.org/changeset/base/366766 > > Log: > Makefile: add a small blurb about building with gcc xtoolchain > > The key details are to install the appropriate flavor of devel/freebsd-gcc9 > and pass CROSS_TOOLCHAIN while building. > > Suggested by: kib > > Modified: > head/Makefile > > Modified: head/Makefile > ============================================================================== > --- head/Makefile Fri Oct 16 14:28:13 2020 (r366765) > +++ head/Makefile Fri Oct 16 15:16:23 2020 (r366766) > @@ -89,6 +89,15 @@ > # 10. `reboot' > # 11. `make delete-old-libs' (in case no 3rd party program uses them anymore) > # > +# For individuals wanting to build from source with GCC from ports, first build > +# or install an appropriate flavor of devel/freebsd-gcc9. The packages produced > +# by this port are named "${TARGET_ARCH}-gcc9" -- note that not all > +# architectures supported by FreeBSD have an external gcc toolchain available. > +# > +# Once the appropriate freebsd-gcc package is installed, simply pass > +# CROSS_TOOLCHAIN=${TARGET_ARCH}-gcc9 while building with the above steps, > +# e.g., `make buildworld CROSS_TOOLCHAIN=amd64-gcc9`. gcc9 is probably still a bit premature. 'make USE_GCC_TOOLCHAINS=yes tinderbox' still uses gcc6 as I still have several open reviews for gcc9 fixes, though OpenZFS regressed the build for both gcc6 and gcc9 as Adrian is finding. I think I would also just suggest 'pkg install ${TARGET_ARCH}-gcc6' rather than building the port. That is what 'make tinderbox' suggests. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Oct 16 16:53:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D0E643A7F6; Fri, 16 Oct 2020 16:53:18 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCXKB0Nc0z3gPL; Fri, 16 Oct 2020 16:53:18 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id E48FB18FF4; Fri, 16 Oct 2020 16:53:17 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f173.google.com with SMTP id m9so1986118qth.7; Fri, 16 Oct 2020 09:53:17 -0700 (PDT) X-Gm-Message-State: AOAM533UKb02iO4s8dbDAR5fm5B3o1+3sYZ7seYVHPtHO7YAUh3z9xjd Ol9K7Nw9ol6WWHOyMCqXyNmQISYh4/O3PL/Rjac= X-Google-Smtp-Source: ABdhPJwE/a/xZUiQ/22jjgDNXj8i4Y79XOf+n/fbCKOOSj++sfg1uP5/QAoE7iConP0iBPEo4XOsZsNSu4SFwbysE4Y= X-Received: by 2002:ac8:6047:: with SMTP id k7mr4204724qtm.60.1602867197305; Fri, 16 Oct 2020 09:53:17 -0700 (PDT) MIME-Version: 1.0 References: <202010161516.09GFGNUI015980@repo.freebsd.org> <5475d244-b507-d369-46c1-2b75c02a8645@FreeBSD.org> In-Reply-To: <5475d244-b507-d369-46c1-2b75c02a8645@FreeBSD.org> From: Kyle Evans Date: Fri, 16 Oct 2020 11:53:06 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366766 - head To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 16:53:18 -0000 On Fri, Oct 16, 2020 at 11:47 AM John Baldwin wrote: > > On 10/16/20 8:16 AM, Kyle Evans wrote: > > Author: kevans > > Date: Fri Oct 16 15:16:23 2020 > > New Revision: 366766 > > URL: https://svnweb.freebsd.org/changeset/base/366766 > > > > Log: > > Makefile: add a small blurb about building with gcc xtoolchain > > > > The key details are to install the appropriate flavor of devel/freebsd-gcc9 > > and pass CROSS_TOOLCHAIN while building. > > > > Suggested by: kib > > > > Modified: > > head/Makefile > > > > Modified: head/Makefile > > ============================================================================== > > --- head/Makefile Fri Oct 16 14:28:13 2020 (r366765) > > +++ head/Makefile Fri Oct 16 15:16:23 2020 (r366766) > > @@ -89,6 +89,15 @@ > > # 10. `reboot' > > # 11. `make delete-old-libs' (in case no 3rd party program uses them anymore) > > # > > +# For individuals wanting to build from source with GCC from ports, first build > > +# or install an appropriate flavor of devel/freebsd-gcc9. The packages produced > > +# by this port are named "${TARGET_ARCH}-gcc9" -- note that not all > > +# architectures supported by FreeBSD have an external gcc toolchain available. > > +# > > +# Once the appropriate freebsd-gcc package is installed, simply pass > > +# CROSS_TOOLCHAIN=${TARGET_ARCH}-gcc9 while building with the above steps, > > +# e.g., `make buildworld CROSS_TOOLCHAIN=amd64-gcc9`. > > gcc9 is probably still a bit premature. 'make USE_GCC_TOOLCHAINS=yes tinderbox' > still uses gcc6 as I still have several open reviews for gcc9 fixes, though > OpenZFS regressed the build for both gcc6 and gcc9 as Adrian is finding. > > I think I would also just suggest 'pkg install ${TARGET_ARCH}-gcc6' rather than > building the port. That is what 'make tinderbox' suggests. > Sure, I'll wordsmith it again and throw something up for review. The key point I want to nail down is the package naming and how to easily locate in the ports tree where that's built from in case that becomes a relevant detail while you're cross-building. From owner-svn-src-head@freebsd.org Fri Oct 16 17:03:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 378C243B236; Fri, 16 Oct 2020 17:03:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCXXz1392z3yCP; Fri, 16 Oct 2020 17:03:31 +0000 (UTC) (envelope-from kevans@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 070A013B3E; Fri, 16 Oct 2020 17:03:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GH3V5O083973; Fri, 16 Oct 2020 17:03:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GH3R3h083957; Fri, 16 Oct 2020 17:03:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010161703.09GH3R3h083957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Oct 2020 17:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366769 - in head/contrib/lua: . doc src X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/contrib/lua: . doc src X-SVN-Commit-Revision: 366769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 17:03:31 -0000 Author: kevans Date: Fri Oct 16 17:03:27 2020 New Revision: 366769 URL: https://svnweb.freebsd.org/changeset/base/366769 Log: MFC r366760: lua: update to 5.3.6 This release contains some minor bugfixes; notably: - 2x minor Makefile fixes (not used in base) - Long brackets with a huge number of '=' overflow some internal buffer arithmetic. - Joining an upvalue with itself can cause a use-after-free crash. See here for examples: http://www.lua.org/bugs.html#5.3.5 MFC after: 2 weeks Modified: head/contrib/lua/Makefile head/contrib/lua/README head/contrib/lua/doc/contents.html head/contrib/lua/doc/manual.html head/contrib/lua/doc/readme.html head/contrib/lua/src/Makefile head/contrib/lua/src/lapi.c head/contrib/lua/src/lauxlib.c head/contrib/lua/src/lcode.c head/contrib/lua/src/ldebug.c head/contrib/lua/src/liolib.c head/contrib/lua/src/llex.c head/contrib/lua/src/lobject.c head/contrib/lua/src/lparser.c head/contrib/lua/src/lua.h head/contrib/lua/src/lundump.c Directory Properties: head/contrib/lua/ (props changed) Modified: head/contrib/lua/Makefile ============================================================================== --- head/contrib/lua/Makefile Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/Makefile Fri Oct 16 17:03:27 2020 (r366769) @@ -46,7 +46,7 @@ TO_MAN= lua.1 luac.1 # Lua version and release. V= 5.3 -R= $V.4 +R= $V.6 # Targets start here. all: $(PLAT) Modified: head/contrib/lua/README ============================================================================== --- head/contrib/lua/README Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/README Fri Oct 16 17:03:27 2020 (r366769) @@ -1,5 +1,5 @@ -This is Lua 5.3.5, released on 26 Jun 2018. +This is Lua 5.3.6, released on 14 Sep 2020. For installation instructions, license details, and further information about Lua, see doc/readme.html. Modified: head/contrib/lua/doc/contents.html ============================================================================== --- head/contrib/lua/doc/contents.html Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/doc/contents.html Fri Oct 16 17:03:27 2020 (r366769) @@ -32,7 +32,7 @@ For a complete introduction to Lua programming, see th

-Copyright © 2015–2018 Lua.org, PUC-Rio. +Copyright © 2015–2020 Lua.org, PUC-Rio. Freely available under the terms of the Lua license. @@ -318,6 +318,37 @@ Freely available under the terms of the utf8.len
utf8.offset
+

metamethods

+

+__add
+__band
+__bnot
+__bor
+__bxor
+__call
+__concat
+__div
+__eq
+__gc
+__idiv
+__index
+__le
+__len
+__lt
+__metatable
+__mod
+__mode
+__mul
+__name
+__newindex
+__pairs
+__pow
+__shl
+__shr
+__sub
+__tostring
+__unm
+

environment
variables

LUA_CPATH
@@ -609,10 +640,10 @@ Freely available under the terms of the

Modified: head/contrib/lua/doc/manual.html ============================================================================== --- head/contrib/lua/doc/manual.html Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/doc/manual.html Fri Oct 16 17:03:27 2020 (r366769) @@ -19,7 +19,7 @@ by Roberto Ierusalimschy, Luiz Henrique de Figueiredo,

-Copyright © 2015–2018 Lua.org, PUC-Rio. +Copyright © 2015–2020 Lua.org, PUC-Rio. Freely available under the terms of the Lua license. @@ -10972,10 +10972,10 @@ and LiteralString, see §3.1.)

Modified: head/contrib/lua/doc/readme.html ============================================================================== --- head/contrib/lua/doc/readme.html Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/doc/readme.html Fri Oct 16 17:03:27 2020 (r366769) @@ -107,7 +107,7 @@ Here are the details.
  1. Open a terminal window and move to -the top-level directory, which is named lua-5.3.5. +the top-level directory, which is named lua-5.3.6. The Makefile there controls both the build process and the installation process.

  2. @@ -328,7 +328,7 @@ For details, see this.
    -Copyright © 1994–2017 Lua.org, PUC-Rio. +Copyright © 1994–2020 Lua.org, PUC-Rio.

    Permission is hereby granted, free of charge, to any person obtaining a copy @@ -355,10 +355,10 @@ THE SOFTWARE.

    Modified: head/contrib/lua/src/Makefile ============================================================================== --- head/contrib/lua/src/Makefile Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/src/Makefile Fri Oct 16 17:03:27 2020 (r366769) @@ -102,7 +102,7 @@ c89: freebsd: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc" + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc" generic: $(ALL) Modified: head/contrib/lua/src/lapi.c ============================================================================== --- head/contrib/lua/src/lapi.c Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/src/lapi.c Fri Oct 16 17:03:27 2020 (r366769) @@ -1254,13 +1254,12 @@ LUA_API const char *lua_setupvalue (lua_State *L, int } -static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) { +static UpVal **getupvalref (lua_State *L, int fidx, int n) { LClosure *f; StkId fi = index2addr(L, fidx); api_check(L, ttisLclosure(fi), "Lua function expected"); f = clLvalue(fi); api_check(L, (1 <= n && n <= f->p->sizeupvalues), "invalid upvalue index"); - if (pf) *pf = f; return &f->upvals[n - 1]; /* get its upvalue pointer */ } @@ -1269,7 +1268,7 @@ LUA_API void *lua_upvalueid (lua_State *L, int fidx, i StkId fi = index2addr(L, fidx); switch (ttype(fi)) { case LUA_TLCL: { /* lua closure */ - return *getupvalref(L, fidx, n, NULL); + return *getupvalref(L, fidx, n); } case LUA_TCCL: { /* C closure */ CClosure *f = clCvalue(fi); @@ -1286,9 +1285,10 @@ LUA_API void *lua_upvalueid (lua_State *L, int fidx, i LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1, int fidx2, int n2) { - LClosure *f1; - UpVal **up1 = getupvalref(L, fidx1, n1, &f1); - UpVal **up2 = getupvalref(L, fidx2, n2, NULL); + UpVal **up1 = getupvalref(L, fidx1, n1); + UpVal **up2 = getupvalref(L, fidx2, n2); + if (*up1 == *up2) + return; luaC_upvdeccount(L, *up1); *up1 = *up2; (*up1)->refcount++; Modified: head/contrib/lua/src/lauxlib.c ============================================================================== --- head/contrib/lua/src/lauxlib.c Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/src/lauxlib.c Fri Oct 16 17:03:27 2020 (r366769) @@ -1011,8 +1011,13 @@ static void *l_alloc (void *ud, void *ptr, size_t osiz free(ptr); return NULL; } - else - return realloc(ptr, nsize); + else { /* cannot fail when shrinking a block */ + void *newptr = realloc(ptr, nsize); + if (newptr == NULL && ptr != NULL && nsize <= osize) + return ptr; /* keep the original block */ + else /* no fail or not shrinking */ + return newptr; /* use the new block */ + } } Modified: head/contrib/lua/src/lcode.c ============================================================================== --- head/contrib/lua/src/lcode.c Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/src/lcode.c Fri Oct 16 17:03:27 2020 (r366769) @@ -1061,7 +1061,7 @@ static void codecomp (FuncState *fs, BinOpr opr, expde /* -** Aplly prefix operation 'op' to expression 'e'. +** Apply prefix operation 'op' to expression 'e'. */ void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) { static const expdesc ef = {VKINT, {0}, NO_JUMP, NO_JUMP}; Modified: head/contrib/lua/src/ldebug.c ============================================================================== --- head/contrib/lua/src/ldebug.c Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/src/ldebug.c Fri Oct 16 17:03:27 2020 (r366769) @@ -133,10 +133,11 @@ static const char *upvalname (Proto *p, int uv) { static const char *findvararg (CallInfo *ci, int n, StkId *pos) { int nparams = clLvalue(ci->func)->p->numparams; - if (n >= cast_int(ci->u.l.base - ci->func) - nparams) + int nvararg = cast_int(ci->u.l.base - ci->func) - nparams; + if (n <= -nvararg) return NULL; /* no such vararg */ else { - *pos = ci->func + nparams + n; + *pos = ci->func + nparams - n; return "(*vararg)"; /* generic name for any vararg */ } } @@ -148,7 +149,7 @@ static const char *findlocal (lua_State *L, CallInfo * StkId base; if (isLua(ci)) { if (n < 0) /* access to vararg values? */ - return findvararg(ci, -n, pos); + return findvararg(ci, n, pos); else { base = ci->u.l.base; name = luaF_getlocalname(ci_func(ci)->p, n, currentpc(ci)); Modified: head/contrib/lua/src/liolib.c ============================================================================== --- head/contrib/lua/src/liolib.c Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/src/liolib.c Fri Oct 16 17:03:27 2020 (r366769) @@ -277,6 +277,8 @@ static int io_popen (lua_State *L) { const char *filename = luaL_checkstring(L, 1); const char *mode = luaL_optstring(L, 2, "r"); LStream *p = newprefile(L); + luaL_argcheck(L, ((mode[0] == 'r' || mode[0] == 'w') && mode[1] == '\0'), + 2, "invalid mode"); p->f = l_popen(L, filename, mode); p->closef = &io_pclose; return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; Modified: head/contrib/lua/src/llex.c ============================================================================== --- head/contrib/lua/src/llex.c Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/src/llex.c Fri Oct 16 17:03:27 2020 (r366769) @@ -244,12 +244,12 @@ static int read_numeral (LexState *ls, SemInfo *seminf /* -** skip a sequence '[=*[' or ']=*]'; if sequence is well formed, return -** its number of '='s; otherwise, return a negative number (-1 iff there -** are no '='s after initial bracket) +** reads a sequence '[=*[' or ']=*]', leaving the last bracket. +** If sequence is well formed, return its number of '='s + 2; otherwise, +** return 1 if there is no '='s or 0 otherwise (an unfinished '[==...'). */ -static int skip_sep (LexState *ls) { - int count = 0; +static size_t skip_sep (LexState *ls) { + size_t count = 0; int s = ls->current; lua_assert(s == '[' || s == ']'); save_and_next(ls); @@ -257,11 +257,14 @@ static int skip_sep (LexState *ls) { save_and_next(ls); count++; } - return (ls->current == s) ? count : (-count) - 1; + return (ls->current == s) ? count + 2 + : (count == 0) ? 1 + : 0; + } -static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) { +static void read_long_string (LexState *ls, SemInfo *seminfo, size_t sep) { int line = ls->linenumber; /* initial line (for error message) */ save_and_next(ls); /* skip 2nd '[' */ if (currIsNewline(ls)) /* string starts with a newline? */ @@ -295,8 +298,8 @@ static void read_long_string (LexState *ls, SemInfo *s } } endloop: if (seminfo) - seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + (2 + sep), - luaZ_bufflen(ls->buff) - 2*(2 + sep)); + seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + sep, + luaZ_bufflen(ls->buff) - 2 * sep); } @@ -444,9 +447,9 @@ static int llex (LexState *ls, SemInfo *seminfo) { /* else is a comment */ next(ls); if (ls->current == '[') { /* long comment? */ - int sep = skip_sep(ls); + size_t sep = skip_sep(ls); luaZ_resetbuffer(ls->buff); /* 'skip_sep' may dirty the buffer */ - if (sep >= 0) { + if (sep >= 2) { read_long_string(ls, NULL, sep); /* skip long comment */ luaZ_resetbuffer(ls->buff); /* previous call may dirty the buff. */ break; @@ -458,12 +461,12 @@ static int llex (LexState *ls, SemInfo *seminfo) { break; } case '[': { /* long string or simply '[' */ - int sep = skip_sep(ls); - if (sep >= 0) { + size_t sep = skip_sep(ls); + if (sep >= 2) { read_long_string(ls, seminfo, sep); return TK_STRING; } - else if (sep != -1) /* '[=...' missing second bracket */ + else if (sep == 0) /* '[=...' missing second bracket */ lexerror(ls, "invalid long string delimiter", TK_STRING); return '['; } Modified: head/contrib/lua/src/lobject.c ============================================================================== --- head/contrib/lua/src/lobject.c Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/src/lobject.c Fri Oct 16 17:03:27 2020 (r366769) @@ -266,7 +266,7 @@ static const char *l_str2dloc (const char *s, lua_Numb ** - 'n'/'N' means 'inf' or 'nan' (which should be rejected) ** - '.' just optimizes the search for the common case (nothing special) ** This function accepts both the current locale or a dot as the radix -** mark. If the convertion fails, it may mean number has a dot but +** mark. If the conversion fails, it may mean number has a dot but ** locale accepts something else. In that case, the code copies 's' ** to a buffer (because 's' is read-only), changes the dot to the ** current locale radix mark, and tries to convert again. Modified: head/contrib/lua/src/lparser.c ============================================================================== --- head/contrib/lua/src/lparser.c Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/src/lparser.c Fri Oct 16 17:03:27 2020 (r366769) @@ -544,6 +544,7 @@ static void open_func (LexState *ls, FuncState *fs, Bl fs->bl = NULL; f = fs->f; f->source = ls->source; + luaC_objbarrier(ls->L, f, f->source); f->maxstacksize = 2; /* registers 0/1 are always valid */ enterblock(fs, bl, 0); } @@ -1616,6 +1617,7 @@ static void mainfunc (LexState *ls, FuncState *fs) { fs->f->is_vararg = 1; /* main function is always declared vararg */ init_exp(&v, VLOCAL, 0); /* create and... */ newupvalue(fs, ls->envn, &v); /* ...set environment upvalue */ + luaC_objbarrier(ls->L, fs->f, ls->envn); luaX_next(ls); /* read first token */ statlist(ls); /* parse main body */ check(ls, TK_EOS); @@ -1634,6 +1636,7 @@ LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer * sethvalue(L, L->top, lexstate.h); /* anchor it */ luaD_inctop(L); funcstate.f = cl->p = luaF_newproto(L); + luaC_objbarrier(L, cl, cl->p); funcstate.f->source = luaS_new(L, name); /* create and anchor TString */ lua_assert(iswhite(funcstate.f)); /* do not need barrier here */ lexstate.buff = buff; Modified: head/contrib/lua/src/lua.h ============================================================================== --- head/contrib/lua/src/lua.h Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/src/lua.h Fri Oct 16 17:03:27 2020 (r366769) @@ -1,5 +1,4 @@ /* -** $Id: lua.h,v 1.332.1.2 2018/06/13 16:58:17 roberto Exp $ ** Lua - A Scripting Language ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) ** See Copyright Notice at the end of this file @@ -19,11 +18,11 @@ #define LUA_VERSION_MAJOR "5" #define LUA_VERSION_MINOR "3" #define LUA_VERSION_NUM 503 -#define LUA_VERSION_RELEASE "5" +#define LUA_VERSION_RELEASE "6" #define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR #define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE -#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2018 Lua.org, PUC-Rio" +#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2020 Lua.org, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes" @@ -460,7 +459,7 @@ struct lua_Debug { /****************************************************************************** -* Copyright (C) 1994-2018 Lua.org, PUC-Rio. +* Copyright (C) 1994-2020 Lua.org, PUC-Rio. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the Modified: head/contrib/lua/src/lundump.c ============================================================================== --- head/contrib/lua/src/lundump.c Fri Oct 16 16:22:32 2020 (r366768) +++ head/contrib/lua/src/lundump.c Fri Oct 16 17:03:27 2020 (r366769) @@ -85,8 +85,10 @@ static lua_Integer LoadInteger (LoadState *S) { } -static TString *LoadString (LoadState *S) { +static TString *LoadString (LoadState *S, Proto *p) { + lua_State *L = S->L; size_t size = LoadByte(S); + TString *ts; if (size == 0xFF) LoadVar(S, size); if (size == 0) @@ -94,13 +96,17 @@ static TString *LoadString (LoadState *S) { else if (--size <= LUAI_MAXSHORTLEN) { /* short string? */ char buff[LUAI_MAXSHORTLEN]; LoadVector(S, buff, size); - return luaS_newlstr(S->L, buff, size); + ts = luaS_newlstr(L, buff, size); } else { /* long string */ - TString *ts = luaS_createlngstrobj(S->L, size); + ts = luaS_createlngstrobj(L, size); + setsvalue2s(L, L->top, ts); /* anchor it ('loadVector' can GC) */ + luaD_inctop(L); LoadVector(S, getstr(ts), size); /* load directly in final place */ - return ts; + L->top--; /* pop string */ } + luaC_objbarrier(L, p, ts); + return ts; } @@ -140,7 +146,7 @@ static void LoadConstants (LoadState *S, Proto *f) { break; case LUA_TSHRSTR: case LUA_TLNGSTR: - setsvalue2n(S->L, o, LoadString(S)); + setsvalue2n(S->L, o, LoadString(S, f)); break; default: lua_assert(0); @@ -158,6 +164,7 @@ static void LoadProtos (LoadState *S, Proto *f) { f->p[i] = NULL; for (i = 0; i < n; i++) { f->p[i] = luaF_newproto(S->L); + luaC_objbarrier(S->L, f, f->p[i]); LoadFunction(S, f->p[i], f->source); } } @@ -189,18 +196,18 @@ static void LoadDebug (LoadState *S, Proto *f) { for (i = 0; i < n; i++) f->locvars[i].varname = NULL; for (i = 0; i < n; i++) { - f->locvars[i].varname = LoadString(S); + f->locvars[i].varname = LoadString(S, f); f->locvars[i].startpc = LoadInt(S); f->locvars[i].endpc = LoadInt(S); } n = LoadInt(S); for (i = 0; i < n; i++) - f->upvalues[i].name = LoadString(S); + f->upvalues[i].name = LoadString(S, f); } static void LoadFunction (LoadState *S, Proto *f, TString *psource) { - f->source = LoadString(S); + f->source = LoadString(S, f); if (f->source == NULL) /* no source in dump? */ f->source = psource; /* reuse parent's source */ f->linedefined = LoadInt(S); @@ -271,6 +278,7 @@ LClosure *luaU_undump(lua_State *L, ZIO *Z, const char setclLvalue(L, L->top, cl); luaD_inctop(L); cl->p = luaF_newproto(L); + luaC_objbarrier(L, cl, cl->p); LoadFunction(&S, cl->p, NULL); lua_assert(cl->nupvalues == cl->p->sizeupvalues); luai_verifycode(L, buff, cl->p); From owner-svn-src-head@freebsd.org Fri Oct 16 17:51:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E788243BF4C; Fri, 16 Oct 2020 17:51:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCYbx5jMtz4117; Fri, 16 Oct 2020 17:51:09 +0000 (UTC) (envelope-from kevans@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 A848414592; Fri, 16 Oct 2020 17:51:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GHp9h9012520; Fri, 16 Oct 2020 17:51:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GHp950012517; Fri, 16 Oct 2020 17:51:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010161751.09GHp950012517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Oct 2020 17:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366770 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 366770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 17:51:10 -0000 Author: kevans Date: Fri Oct 16 17:51:09 2020 New Revision: 366770 URL: https://svnweb.freebsd.org/changeset/base/366770 Log: libc: typo fix (s/involes/involves) Reported by: Masahiko Sawada via twitter MFC after: 3 days Modified: head/lib/libc/stdlib/bsearch.c Modified: head/lib/libc/stdlib/bsearch.c ============================================================================== --- head/lib/libc/stdlib/bsearch.c Fri Oct 16 17:03:27 2020 (r366769) +++ head/lib/libc/stdlib/bsearch.c Fri Oct 16 17:51:09 2020 (r366770) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); * is odd, moving left simply involves halving lim: e.g., when lim * is 5 we look at item 2, so we change lim to 2 so that we will * look at items 0 & 1. If lim is even, the same applies. If lim - * is odd, moving right again involes halving lim, this time moving + * is odd, moving right again involves halving lim, this time moving * the base up one item past p: e.g., when lim is 5 we change base * to item 3 and make lim 2 so that we will look at items 3 and 4. * If lim is even, however, we have to shrink it by one before From owner-svn-src-head@freebsd.org Fri Oct 16 20:27:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7ACD043F384; Fri, 16 Oct 2020 20:27:21 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCd492hj7z485K; Fri, 16 Oct 2020 20:27:21 +0000 (UTC) (envelope-from freqlabs@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 3F1C815CF9; Fri, 16 Oct 2020 20:27:21 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GKRL97006708; Fri, 16 Oct 2020 20:27:21 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GKRLiO006707; Fri, 16 Oct 2020 20:27:21 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202010162027.09GKRLiO006707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Fri, 16 Oct 2020 20:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366771 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 366771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 20:27:21 -0000 Author: freqlabs Date: Fri Oct 16 20:27:20 2020 New Revision: 366771 URL: https://svnweb.freebsd.org/changeset/base/366771 Log: bhyve: Update TX descriptor base address and host mapping on change bhyve sometimes segfaults when using an e1000 NIC with a Windows guest. We are only updating our tdba and cached host mapping when the low address register is written and when tx is set enabled, but not when the high address or length registers are written. It is observed that Windows 10 is occasionally enabling tx first then writing the registers in the order low, high, len. This leaves us with a bogus base address and mapping, which causes a segfault later when we try to copy from a descriptor that has unpredictable garbage in a pointer. Updating the address and mapping when any of those registers change seems to fix that particular issue. Reviewed by: mav, grehan (bhyve) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D26798 Modified: head/usr.sbin/bhyve/pci_e82545.c Modified: head/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- head/usr.sbin/bhyve/pci_e82545.c Fri Oct 16 17:51:09 2020 (r366770) +++ head/usr.sbin/bhyve/pci_e82545.c Fri Oct 16 20:27:20 2020 (r366771) @@ -1701,18 +1701,18 @@ e82545_write_register(struct e82545_softc *sc, uint32_ break; case E1000_TDBAL(0): sc->esc_TDBAL = value & ~0xF; - if (sc->esc_tx_enabled) { - /* Apparently legal */ + if (sc->esc_tx_enabled) e82545_tx_update_tdba(sc); - } break; case E1000_TDBAH(0): - //assert(!sc->esc_tx_enabled); sc->esc_TDBAH = value; + if (sc->esc_tx_enabled) + e82545_tx_update_tdba(sc); break; case E1000_TDLEN(0): - //assert(!sc->esc_tx_enabled); sc->esc_TDLEN = value & ~0xFFF0007F; + if (sc->esc_tx_enabled) + e82545_tx_update_tdba(sc); break; case E1000_TDH(0): //assert(!sc->esc_tx_enabled); From owner-svn-src-head@freebsd.org Fri Oct 16 21:51:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FFD8440FED; Fri, 16 Oct 2020 21:51:18 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCfx21V1Fz4FZC; Fri, 16 Oct 2020 21:51:18 +0000 (UTC) (envelope-from melifaro@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 171141741D; Fri, 16 Oct 2020 21:51:18 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09GLpHjp058561; Fri, 16 Oct 2020 21:51:17 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09GLpHi4058560; Fri, 16 Oct 2020 21:51:17 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202010162151.09GLpHi4058560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 16 Oct 2020 21:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366773 - in head/tests/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/tests/sys: netinet netinet6 X-SVN-Commit-Revision: 366773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 21:51:18 -0000 Author: melifaro Date: Fri Oct 16 21:51:17 2020 New Revision: 366773 URL: https://svnweb.freebsd.org/changeset/base/366773 Log: Try to enable multipath routing in flowid tests. Modified: head/tests/sys/netinet/output.sh head/tests/sys/netinet6/output6.sh Modified: head/tests/sys/netinet/output.sh ============================================================================== --- head/tests/sys/netinet/output.sh Fri Oct 16 20:57:41 2020 (r366772) +++ head/tests/sys/netinet/output.sh Fri Oct 16 21:51:17 2020 (r366773) @@ -223,11 +223,19 @@ output_raw_success_cleanup() mpath_check() { - if [ "`sysctl -i -n net.route.multipath`" != 1 ]; then + if [ `sysctl -iW net.route.multipath | wc -l` != "1" ]; then atf_skip "This test requires ROUTE_MPATH enabled" fi } +mpath_enable() +{ + jexec $1 sysctl net.route.multipath=1 + if [ $? != 0 ]; then + atf_fail "Setting multipath in jail $1 failed". + fi +} + atf_test_case "output_tcp_flowid_mpath_success" "cleanup" output_tcp_flowid_mpath_success_head() { @@ -258,6 +266,7 @@ output_tcp_flowid_mpath_success_body() lo_dst=$(vnet_mkloopback) vnet_mkjail ${jname}a ${epair0}a ${epair1}a ${lo_src} + mpath_enable ${jname}a # Setup transit IPv4 networks jexec ${jname}a ifconfig ${epair0}a up jexec ${jname}a ifconfig ${epair0}a inet 203.0.113.1/30 @@ -386,6 +395,7 @@ output_udp_flowid_mpath_success_body() lo_dst=$(vnet_mkloopback) vnet_mkjail ${jname}a ${epair0}a ${epair1}a ${lo_src} + mpath_enable ${jname}a # Setup transit IPv4 networks jexec ${jname}a ifconfig ${epair0}a up jexec ${jname}a ifconfig ${epair0}a inet 203.0.113.1/30 @@ -509,6 +519,7 @@ output_raw_flowid_mpath_success_body() lo_dst=$(vnet_mkloopback) vnet_mkjail ${jname}a ${epair0}a ${epair1}a ${lo_src} + mpath_enable ${jname}a # Setup transit IPv4 networks jexec ${jname}a ifconfig ${epair0}a up jexec ${jname}a ifconfig ${epair0}a inet 203.0.113.1/30 Modified: head/tests/sys/netinet6/output6.sh ============================================================================== --- head/tests/sys/netinet6/output6.sh Fri Oct 16 20:57:41 2020 (r366772) +++ head/tests/sys/netinet6/output6.sh Fri Oct 16 21:51:17 2020 (r366773) @@ -247,11 +247,20 @@ output6_raw_success_cleanup() mpath_check() { - if [ "`sysctl -i -n net.route.multipath`" != 1 ]; then + if [ `sysctl -iW net.route.multipath | wc -l` != "1" ]; then atf_skip "This test requires ROUTE_MPATH enabled" fi } +mpath_enable() +{ + jexec $1 sysctl net.route.multipath=1 + if [ $? != 0 ]; then + atf_fail "Setting multipath in jail $1 failed". + fi +} + + atf_test_case "output6_tcp_flowid_mpath_success" "cleanup" output6_tcp_flowid_mpath_success_head() { @@ -282,6 +291,7 @@ output6_tcp_flowid_mpath_success_body() lo_dst=$(vnet_mkloopback) vnet_mkjail ${jname}a ${epair0}a ${epair1}a ${lo_src} + mpath_enable ${jname}a jls -N # enable link-local IPv6 jexec ${jname}a ndp -i ${epair0}a -- -disabled @@ -422,6 +432,7 @@ output6_udp_flowid_mpath_success_body() lo_dst=$(vnet_mkloopback) vnet_mkjail ${jname}a ${epair0}a ${epair1}a ${lo_src} + mpath_enable ${jname}a jls -N # enable link-local IPv6 jexec ${jname}a ndp -i ${epair0}a -- -disabled @@ -559,6 +570,7 @@ output6_raw_flowid_mpath_success_body() lo_dst=$(vnet_mkloopback) vnet_mkjail ${jname}a ${epair0}a ${epair1}a ${lo_src} + mpath_enable ${jname}a jls -N # enable link-local IPv6 jexec ${jname}a ndp -i ${epair0}a -- -disabled From owner-svn-src-head@freebsd.org Sat Oct 17 00:08:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 349054433F6; Sat, 17 Oct 2020 00:08:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCjz83lB5z4LXg; Sat, 17 Oct 2020 00:08:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 09H086ZK014519 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 17 Oct 2020 03:08:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 09H086ZK014519 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 09H086rl014518; Sat, 17 Oct 2020 03:08:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 17 Oct 2020 03:08:06 +0300 From: Konstantin Belousov To: Kyle Evans Cc: John Baldwin , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r366766 - head Message-ID: <20201017000806.GX2643@kib.kiev.ua> References: <202010161516.09GFGNUI015980@repo.freebsd.org> <5475d244-b507-d369-46c1-2b75c02a8645@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4CCjz83lB5z4LXg X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 00:08:21 -0000 On Fri, Oct 16, 2020 at 11:53:06AM -0500, Kyle Evans wrote: > On Fri, Oct 16, 2020 at 11:47 AM John Baldwin wrote: > > > > On 10/16/20 8:16 AM, Kyle Evans wrote: > > > Author: kevans > > > Date: Fri Oct 16 15:16:23 2020 > > > New Revision: 366766 > > > URL: https://svnweb.freebsd.org/changeset/base/366766 > > > > > > Log: > > > Makefile: add a small blurb about building with gcc xtoolchain > > > > > > The key details are to install the appropriate flavor of devel/freebsd-gcc9 > > > and pass CROSS_TOOLCHAIN while building. > > > > > > Suggested by: kib > > > > > > Modified: > > > head/Makefile > > > > > > Modified: head/Makefile > > > ============================================================================== > > > --- head/Makefile Fri Oct 16 14:28:13 2020 (r366765) > > > +++ head/Makefile Fri Oct 16 15:16:23 2020 (r366766) > > > @@ -89,6 +89,15 @@ > > > # 10. `reboot' > > > # 11. `make delete-old-libs' (in case no 3rd party program uses them anymore) > > > # > > > +# For individuals wanting to build from source with GCC from ports, first build > > > +# or install an appropriate flavor of devel/freebsd-gcc9. The packages produced > > > +# by this port are named "${TARGET_ARCH}-gcc9" -- note that not all > > > +# architectures supported by FreeBSD have an external gcc toolchain available. > > > +# > > > +# Once the appropriate freebsd-gcc package is installed, simply pass > > > +# CROSS_TOOLCHAIN=${TARGET_ARCH}-gcc9 while building with the above steps, > > > +# e.g., `make buildworld CROSS_TOOLCHAIN=amd64-gcc9`. > > > > gcc9 is probably still a bit premature. 'make USE_GCC_TOOLCHAINS=yes tinderbox' > > still uses gcc6 as I still have several open reviews for gcc9 fixes, though > > OpenZFS regressed the build for both gcc6 and gcc9 as Adrian is finding. > > > > I think I would also just suggest 'pkg install ${TARGET_ARCH}-gcc6' rather than > > building the port. That is what 'make tinderbox' suggests. > > > > Sure, I'll wordsmith it again and throw something up for review. The > key point I want to nail down is the package naming and how to easily > locate in the ports tree where that's built from in case that becomes > a relevant detail while you're cross-building. Yes, please keep a reference to the ports origin, and how to specify flavor, for those who runs local poudriere. From owner-svn-src-head@freebsd.org Sat Oct 17 00:27:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60884443961; Sat, 17 Oct 2020 00:27:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCkPC1s6Rz4MgY; Sat, 17 Oct 2020 00:27:27 +0000 (UTC) (envelope-from mjg@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 2229818E25; Sat, 17 Oct 2020 00:27:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09H0RRTL053795; Sat, 17 Oct 2020 00:27:27 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09H0RQEb053794; Sat, 17 Oct 2020 00:27:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010170027.09H0RQEb053794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Oct 2020 00:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366776 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 00:27:27 -0000 Author: mjg Date: Sat Oct 17 00:27:26 2020 New Revision: 366776 URL: https://svnweb.freebsd.org/changeset/base/366776 Log: cache: add a probe reporting addition of duplicate entries Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 17 00:10:13 2020 (r366775) +++ head/sys/kern/vfs_cache.c Sat Oct 17 00:27:26 2020 (r366776) @@ -82,6 +82,8 @@ __FBSDID("$FreeBSD$"); SDT_PROVIDER_DECLARE(vfs); SDT_PROBE_DEFINE3(vfs, namecache, enter, done, "struct vnode *", "char *", "struct vnode *"); +SDT_PROBE_DEFINE3(vfs, namecache, enter, duplicate, "struct vnode *", "char *", + "struct vnode *"); SDT_PROBE_DEFINE2(vfs, namecache, enter_negative, done, "struct vnode *", "char *"); SDT_PROBE_DEFINE2(vfs, namecache, fullpath_smr, hit, "struct vnode *", @@ -2001,6 +2003,8 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, } } #endif + SDT_PROBE3(vfs, namecache, enter, duplicate, dvp, ncp->nc_name, + vp); goto out_unlock_free; } } From owner-svn-src-head@freebsd.org Sat Oct 17 00:44:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3652443F46; Sat, 17 Oct 2020 00:44:05 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCkmP5Cvnz4Nwv; Sat, 17 Oct 2020 00:44:05 +0000 (UTC) (envelope-from philip@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 9692819351; Sat, 17 Oct 2020 00:44:05 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09H0i57n066248; Sat, 17 Oct 2020 00:44:05 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09H0i4u0066242; Sat, 17 Oct 2020 00:44:04 GMT (envelope-from philip@FreeBSD.org) Message-Id: <202010170044.09H0i4u0066242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Sat, 17 Oct 2020 00:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366779 - head/contrib/tzdata X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/contrib/tzdata X-SVN-Commit-Revision: 366779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 00:44:05 -0000 Author: philip Date: Sat Oct 17 00:44:04 2020 New Revision: 366779 URL: https://svnweb.freebsd.org/changeset/base/366779 Log: Import tzdata 2020c Changes: https://github.com/eggert/tz/blob/2020c/NEWS MFC after: 1 day Modified: head/contrib/tzdata/Makefile head/contrib/tzdata/NEWS head/contrib/tzdata/australasia head/contrib/tzdata/europe head/contrib/tzdata/version head/contrib/tzdata/ziguard.awk Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/Makefile ============================================================================== --- head/contrib/tzdata/Makefile Sat Oct 17 00:41:40 2020 (r366778) +++ head/contrib/tzdata/Makefile Sat Oct 17 00:44:04 2020 (r366779) @@ -1022,10 +1022,14 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-ti done sed '1s/$$/-rearguard/' \ tzdata$(VERSION)-rearguard.dir/version + : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. + touch -md 2020-10-12T22:53:00Z \ + tzdata$(VERSION)-rearguard.dir/pacificnew touch -cmr version tzdata$(VERSION)-rearguard.dir/version LC_ALL=C && export LC_ALL && \ (cd tzdata$(VERSION)-rearguard.dir && \ - tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \ + tar $(TARFLAGS) -cf - \ + $(COMMON) $(DATA) $(MISC) pacificnew | \ gzip $(GZIPFLAGS)) >$@.out mv $@.out $@ Modified: head/contrib/tzdata/NEWS ============================================================================== --- head/contrib/tzdata/NEWS Sat Oct 17 00:41:40 2020 (r366778) +++ head/contrib/tzdata/NEWS Sat Oct 17 00:44:04 2020 (r366779) @@ -1,5 +1,25 @@ News for the tz database +Release 2020c - 2020-10-16 11:15:53 -0700 + + Briefly: + Fiji starts DST later than usual, on 2020-12-20. + + Changes to future timestamps + + Fiji will start DST on 2020-12-20, instead of 2020-11-08 as + previously predicted. DST will still end on 2021-01-17. + (Thanks to Raymond Kumar and Alan Mintz.) Assume for now that + the later-than-usual start date is a one-time departure from the + recent pattern. + + Changes to build procedure + + Rearguard tarballs now contain an empty file pacificnew. + Some older downstream software expects this file to exist. + (Problem reported by Mike Cullinan.) + + Release 2020b - 2020-10-06 18:35:04 -0700 Briefly: Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Sat Oct 17 00:41:40 2020 (r366778) +++ head/contrib/tzdata/australasia Sat Oct 17 00:44:04 2020 (r366779) @@ -381,6 +381,19 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # From Michael Deckers (2019-08-06): # https://www.laws.gov.fj/LawsAsMade/downloadfile/848 +# From Raymond Kumar (2020-10-08): +# [DST in Fiji] is from December 20th 2020, till 17th January 2021. +# From Alan Mintz (2020-10-08): +# https://www.laws.gov.fj/LawsAsMade/GetFile/1071 +# From Tim Parenti (2020-10-08): +# https://www.fijivillage.com/news/Daylight-saving-from-Dec-20th-this-year-to-Jan-17th-2021-8rf4x5/ +# "Minister for Employment, Parveen Bala says they had never thought of +# stopping daylight saving. He says it was just to decide on when it should +# start and end. Bala says it is a short period..." +# Since the end date is still in line with our ongoing predictions, assume for +# now that the later-than-usual start date is a one-time departure from the +# recent second Sunday in November pattern. + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 - Rule Fiji 1999 2000 - Feb lastSun 3:00 0 - @@ -392,7 +405,9 @@ Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 2018 - Nov Sun>=1 2:00 1:00 - Rule Fiji 2015 max - Jan Sun>=12 3:00 0 - -Rule Fiji 2019 max - Nov Sun>=8 2:00 1:00 - +Rule Fiji 2019 only - Nov Sun>=8 2:00 1:00 - +Rule Fiji 2020 only - Dec 20 2:00 1:00 - +Rule Fiji 2021 max - Nov Sun>=8 2:00 1:00 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji +12/+13 Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Sat Oct 17 00:41:40 2020 (r366778) +++ head/contrib/tzdata/europe Sat Oct 17 00:44:04 2020 (r366779) @@ -1589,6 +1589,8 @@ Rule Hungary 1946 only - Oct 7 2:00 0 - # https://library.hungaricana.hu/hu/view/Zala_1948_09/?pg=64 # https://library.hungaricana.hu/hu/view/SatoraljaujhelyiLeveltar_ZempleniNepujsag_1948/?pg=53 # https://library.hungaricana.hu/hu/view/SatoraljaujhelyiLeveltar_ZempleniNepujsag_1948/?pg=160 +# https://library.hungaricana.hu/hu/view/UjSzo_1949_01-04/?pg=102 +# https://library.hungaricana.hu/hu/view/KeletMagyarorszag_1949_03/?pg=96 # https://library.hungaricana.hu/hu/view/Delmagyarorszag_1949_09/?pg=94 Rule Hungary 1947 1949 - Apr Sun>=4 2:00s 1:00 S Rule Hungary 1947 1949 - Oct Sun>=1 2:00s 0 - @@ -1604,9 +1606,10 @@ Rule Hungary 1955 only - Oct 2 3:00 0 - # https://library.hungaricana.hu/hu/view/PestMegyeiHirlap_1957_09/?pg=143 Rule Hungary 1956 1957 - Jun Sun>=1 2:00 1:00 S Rule Hungary 1956 1957 - Sep lastSun 3:00 0 - -# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1980/?pg=1227 +# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1980/?pg=189 Rule Hungary 1980 only - Apr 6 0:00 1:00 S Rule Hungary 1980 only - Sep 28 1:00 0 - +# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1980/?pg=1227 # https://library.hungaricana.hu/hu/view/Delmagyarorszag_1981_01/?pg=79 # https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1982/?pg=115 # https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1983/?pg=85 @@ -1617,6 +1620,7 @@ Rule Hungary 1981 1983 - Sep lastSun 1:00 0 - Zone Europe/Budapest 1:16:20 - LMT 1890 Nov 1 1:00 C-Eur CE%sT 1918 # https://library.hungaricana.hu/hu/view/OGYK_RT_1941/?pg=1204 +# https://library.hungaricana.hu/hu/view/OGYK_RT_1942/?pg=3955 1:00 Hungary CE%sT 1941 Apr 7 23:00 1:00 C-Eur CE%sT 1945 1:00 Hungary CE%sT 1984 Modified: head/contrib/tzdata/version ============================================================================== --- head/contrib/tzdata/version Sat Oct 17 00:41:40 2020 (r366778) +++ head/contrib/tzdata/version Sat Oct 17 00:44:04 2020 (r366779) @@ -1 +1 @@ -2020b +2020c Modified: head/contrib/tzdata/ziguard.awk ============================================================================== --- head/contrib/tzdata/ziguard.awk Sat Oct 17 00:41:40 2020 (r366778) +++ head/contrib/tzdata/ziguard.awk Sat Oct 17 00:44:04 2020 (r366779) @@ -3,7 +3,14 @@ # Contributed by Paul Eggert. This file is in the public domain. # This is not a general-purpose converter; it is designed for current tzdata. +# It just converts from current source to main, vanguard, and rearguard forms. +# Although it might be nice for it to be idempotent, or to be useful +# for converting back and forth between vanguard and rearguard formats, +# it does not do these nonessential tasks now. # +# Although main and vanguard forms are currently equivalent, +# this need not always be the case. +# # When converting to vanguard form, the output can use negative SAVE # values. # @@ -28,7 +35,7 @@ DATAFORM != "main" { in_comment = /^#/ uncomment = comment_out = 0 - # If the line should differ due to Czechoslovakia using negative SAVE values, + # If this line should differ due to Czechoslovakia using negative SAVE values, # uncomment the desired version and comment out the undesired one. if (zone == "Europe/Prague" && /1947 Feb 23/) { if (($(in_comment + 2) != "-") == vanguard) { From owner-svn-src-head@freebsd.org Sat Oct 17 01:06:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 338744447CE; Sat, 17 Oct 2020 01:06:21 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CClG502HDz4QSW; Sat, 17 Oct 2020 01:06:21 +0000 (UTC) (envelope-from mmacy@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 D7D09194B5; Sat, 17 Oct 2020 01:06:20 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09H16KwS080100; Sat, 17 Oct 2020 01:06:20 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09H16519080019; Sat, 17 Oct 2020 01:06:05 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202010170106.09H16519080019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 17 Oct 2020 01:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366780 - in head/sys: cddl/contrib/opensolaris/common/unicode contrib/openzfs contrib/openzfs/cmd/arc_summary contrib/openzfs/cmd/dbufstat contrib/openzfs/cmd/zdb contrib/openzfs/cmd/z... X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/common/unicode contrib/openzfs contrib/openzfs/cmd/arc_summary contrib/openzfs/cmd/dbufstat contrib/openzfs/cmd/zdb contrib/openzfs/cmd/zed contrib/openzfs/cmd/ze... X-SVN-Commit-Revision: 366780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 01:06:21 -0000 Author: mmacy Date: Sat Oct 17 01:06:04 2020 New Revision: 366780 URL: https://svnweb.freebsd.org/changeset/base/366780 Log: Update OpenZFS to 2.0.0-rc3-gfc5966 - fix panic due to tqid overflow - Improve libzfs_error_init messages - Expose zfetch_max_idistance tunable - Make dbufstat work on FreeBSD - Fix EIO after resuming receive of new dataset over an existing one Added: head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix-sa/ - copied from r366775, vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/acl/posix-sa/ head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh - copied unchanged from r366775, vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/acl/posix/posix_004_pos.ksh Deleted: head/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.c Modified: head/sys/contrib/openzfs/CODE_OF_CONDUCT.md head/sys/contrib/openzfs/META head/sys/contrib/openzfs/README.md head/sys/contrib/openzfs/cmd/arc_summary/arc_summary2 head/sys/contrib/openzfs/cmd/arc_summary/arc_summary3 head/sys/contrib/openzfs/cmd/dbufstat/dbufstat.in head/sys/contrib/openzfs/cmd/zdb/zdb.c head/sys/contrib/openzfs/cmd/zdb/zdb_il.c head/sys/contrib/openzfs/cmd/zed/agents/zfs_agents.c head/sys/contrib/openzfs/cmd/zed/agents/zfs_mod.c head/sys/contrib/openzfs/cmd/zed/agents/zfs_retire.c head/sys/contrib/openzfs/cmd/zed/zed.c head/sys/contrib/openzfs/cmd/zed/zed.h head/sys/contrib/openzfs/cmd/zed/zed_conf.c head/sys/contrib/openzfs/cmd/zed/zed_conf.h head/sys/contrib/openzfs/cmd/zed/zed_event.c head/sys/contrib/openzfs/cmd/zed/zed_event.h head/sys/contrib/openzfs/cmd/zed/zed_exec.c head/sys/contrib/openzfs/cmd/zed/zed_exec.h head/sys/contrib/openzfs/cmd/zed/zed_file.c head/sys/contrib/openzfs/cmd/zed/zed_file.h head/sys/contrib/openzfs/cmd/zed/zed_log.c head/sys/contrib/openzfs/cmd/zed/zed_log.h head/sys/contrib/openzfs/cmd/zed/zed_strings.c head/sys/contrib/openzfs/cmd/zed/zed_strings.h head/sys/contrib/openzfs/cmd/zvol_id/Makefile.am head/sys/contrib/openzfs/config/kernel-bio.m4 head/sys/contrib/openzfs/configure.ac head/sys/contrib/openzfs/contrib/dracut/90zfs/module-setup.sh.in head/sys/contrib/openzfs/contrib/pyzfs/README head/sys/contrib/openzfs/contrib/pyzfs/libzfs_core/__init__.py head/sys/contrib/openzfs/copy-builtin head/sys/contrib/openzfs/etc/init.d/README.md head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_x86.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/sunddi.h head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_ctldir.h head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_dir.h head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops_os.h head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vnops.h head/sys/contrib/openzfs/include/os/linux/spl/rpc/xdr.h head/sys/contrib/openzfs/include/os/linux/spl/sys/acl.h head/sys/contrib/openzfs/include/os/linux/spl/sys/atomic.h head/sys/contrib/openzfs/include/os/linux/spl/sys/byteorder.h head/sys/contrib/openzfs/include/os/linux/spl/sys/callb.h head/sys/contrib/openzfs/include/os/linux/spl/sys/callo.h head/sys/contrib/openzfs/include/os/linux/spl/sys/cmn_err.h head/sys/contrib/openzfs/include/os/linux/spl/sys/condvar.h head/sys/contrib/openzfs/include/os/linux/spl/sys/console.h head/sys/contrib/openzfs/include/os/linux/spl/sys/cred.h head/sys/contrib/openzfs/include/os/linux/spl/sys/ctype.h head/sys/contrib/openzfs/include/os/linux/spl/sys/debug.h head/sys/contrib/openzfs/include/os/linux/spl/sys/disp.h head/sys/contrib/openzfs/include/os/linux/spl/sys/dkio.h head/sys/contrib/openzfs/include/os/linux/spl/sys/fcntl.h head/sys/contrib/openzfs/include/os/linux/spl/sys/file.h head/sys/contrib/openzfs/include/os/linux/spl/sys/inttypes.h head/sys/contrib/openzfs/include/os/linux/spl/sys/isa_defs.h head/sys/contrib/openzfs/include/os/linux/spl/sys/kmem.h head/sys/contrib/openzfs/include/os/linux/spl/sys/kmem_cache.h head/sys/contrib/openzfs/include/os/linux/spl/sys/kstat.h head/sys/contrib/openzfs/include/os/linux/spl/sys/list.h head/sys/contrib/openzfs/include/os/linux/spl/sys/mod_os.h head/sys/contrib/openzfs/include/os/linux/spl/sys/mutex.h head/sys/contrib/openzfs/include/os/linux/spl/sys/param.h head/sys/contrib/openzfs/include/os/linux/spl/sys/proc.h head/sys/contrib/openzfs/include/os/linux/spl/sys/processor.h head/sys/contrib/openzfs/include/os/linux/spl/sys/random.h head/sys/contrib/openzfs/include/os/linux/spl/sys/rwlock.h head/sys/contrib/openzfs/include/os/linux/spl/sys/shrinker.h head/sys/contrib/openzfs/include/os/linux/spl/sys/sid.h head/sys/contrib/openzfs/include/os/linux/spl/sys/signal.h head/sys/contrib/openzfs/include/os/linux/spl/sys/simd.h head/sys/contrib/openzfs/include/os/linux/spl/sys/stat.h head/sys/contrib/openzfs/include/os/linux/spl/sys/strings.h head/sys/contrib/openzfs/include/os/linux/spl/sys/sunddi.h head/sys/contrib/openzfs/include/os/linux/spl/sys/sysmacros.h head/sys/contrib/openzfs/include/os/linux/spl/sys/systeminfo.h head/sys/contrib/openzfs/include/os/linux/spl/sys/taskq.h head/sys/contrib/openzfs/include/os/linux/spl/sys/thread.h head/sys/contrib/openzfs/include/os/linux/spl/sys/time.h head/sys/contrib/openzfs/include/os/linux/spl/sys/timer.h head/sys/contrib/openzfs/include/os/linux/spl/sys/tsd.h head/sys/contrib/openzfs/include/os/linux/spl/sys/types.h head/sys/contrib/openzfs/include/os/linux/spl/sys/types32.h head/sys/contrib/openzfs/include/os/linux/spl/sys/uio.h head/sys/contrib/openzfs/include/os/linux/spl/sys/user.h head/sys/contrib/openzfs/include/os/linux/spl/sys/vfs.h head/sys/contrib/openzfs/include/os/linux/spl/sys/vmem.h head/sys/contrib/openzfs/include/os/linux/spl/sys/vmsystm.h head/sys/contrib/openzfs/include/os/linux/spl/sys/vnode.h head/sys/contrib/openzfs/include/os/linux/spl/sys/wait.h head/sys/contrib/openzfs/include/os/linux/spl/sys/zmod.h head/sys/contrib/openzfs/include/os/linux/spl/sys/zone.h head/sys/contrib/openzfs/include/os/linux/zfs/sys/zfs_ctldir.h head/sys/contrib/openzfs/include/os/linux/zfs/sys/zfs_vnops.h head/sys/contrib/openzfs/include/sys/dmu.h head/sys/contrib/openzfs/include/sys/mod.h head/sys/contrib/openzfs/include/sys/pathname.h head/sys/contrib/openzfs/include/sys/spa.h head/sys/contrib/openzfs/include/sys/u8_textprep.h head/sys/contrib/openzfs/include/sys/zfs_ioctl.h head/sys/contrib/openzfs/include/sys/zfs_znode.h head/sys/contrib/openzfs/include/sys/zil.h head/sys/contrib/openzfs/lib/libspl/include/sys/acl.h head/sys/contrib/openzfs/lib/libspl/os/freebsd/getmntany.c head/sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c head/sys/contrib/openzfs/lib/libzfs/libzfs_util.c head/sys/contrib/openzfs/lib/libzfs/os/freebsd/libzfs_compat.c head/sys/contrib/openzfs/lib/libzfsbootenv/libzfsbootenv.pc.in head/sys/contrib/openzfs/lib/libzutil/os/linux/zutil_import_os.c head/sys/contrib/openzfs/man/man1/raidz_test.1 head/sys/contrib/openzfs/man/man5/zfs-module-parameters.5 head/sys/contrib/openzfs/man/man8/zed.8.in head/sys/contrib/openzfs/man/man8/zfsprops.8 head/sys/contrib/openzfs/man/man8/zpool.8 head/sys/contrib/openzfs/module/Makefile.in head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c head/sys/contrib/openzfs/module/os/freebsd/spl/spl_taskq.c head/sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c head/sys/contrib/openzfs/module/os/freebsd/zfs/sysctl_os.c head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_acl.c head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c head/sys/contrib/openzfs/module/os/linux/spl/README.md head/sys/contrib/openzfs/module/os/linux/spl/spl-atomic.c head/sys/contrib/openzfs/module/os/linux/spl/spl-condvar.c head/sys/contrib/openzfs/module/os/linux/spl/spl-cred.c head/sys/contrib/openzfs/module/os/linux/spl/spl-err.c head/sys/contrib/openzfs/module/os/linux/spl/spl-generic.c head/sys/contrib/openzfs/module/os/linux/spl/spl-kmem-cache.c head/sys/contrib/openzfs/module/os/linux/spl/spl-kmem.c head/sys/contrib/openzfs/module/os/linux/spl/spl-kstat.c head/sys/contrib/openzfs/module/os/linux/spl/spl-proc.c head/sys/contrib/openzfs/module/os/linux/spl/spl-taskq.c head/sys/contrib/openzfs/module/os/linux/spl/spl-thread.c head/sys/contrib/openzfs/module/os/linux/spl/spl-tsd.c head/sys/contrib/openzfs/module/os/linux/spl/spl-vmem.c head/sys/contrib/openzfs/module/os/linux/spl/spl-xdr.c head/sys/contrib/openzfs/module/os/linux/spl/spl-zlib.c head/sys/contrib/openzfs/module/os/linux/zfs/zfs_acl.c head/sys/contrib/openzfs/module/os/linux/zfs/zfs_ctldir.c head/sys/contrib/openzfs/module/os/linux/zfs/zfs_dir.c head/sys/contrib/openzfs/module/os/linux/zfs/zfs_vfsops.c head/sys/contrib/openzfs/module/os/linux/zfs/zfs_vnops.c head/sys/contrib/openzfs/module/unicode/u8_textprep.c head/sys/contrib/openzfs/module/zcommon/zfs_prop.c head/sys/contrib/openzfs/module/zfs/dmu_objset.c head/sys/contrib/openzfs/module/zfs/dmu_redact.c head/sys/contrib/openzfs/module/zfs/dmu_traverse.c head/sys/contrib/openzfs/module/zfs/dmu_zfetch.c head/sys/contrib/openzfs/module/zfs/dsl_scan.c head/sys/contrib/openzfs/module/zfs/pathname.c head/sys/contrib/openzfs/module/zfs/range_tree.c head/sys/contrib/openzfs/module/zfs/spa.c head/sys/contrib/openzfs/module/zfs/vdev.c head/sys/contrib/openzfs/module/zfs/vdev_label.c head/sys/contrib/openzfs/module/zfs/vdev_removal.c head/sys/contrib/openzfs/module/zfs/zfeature.c head/sys/contrib/openzfs/module/zfs/zfs_ioctl.c head/sys/contrib/openzfs/module/zfs/zfs_log.c head/sys/contrib/openzfs/module/zfs/zil.c head/sys/contrib/openzfs/module/zstd/lib/zstd.c head/sys/contrib/openzfs/rpm/generic/zfs-dkms.spec.in head/sys/contrib/openzfs/rpm/generic/zfs-kmod.spec.in head/sys/contrib/openzfs/rpm/generic/zfs.spec.in head/sys/contrib/openzfs/rpm/redhat/zfs-kmod.spec.in head/sys/contrib/openzfs/scripts/zimport.sh head/sys/contrib/openzfs/tests/runfiles/common.run head/sys/contrib/openzfs/tests/runfiles/linux.run head/sys/contrib/openzfs/tests/zfs-tests/include/libtest.shlib head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/Makefile.am head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix/Makefile.am head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix/posix_003_pos.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix/setup.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/arc/dbufstats_001_pos.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/arc/dbufstats_002_pos.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/channel_program/synctask_core/tst.get_number_props.zcp head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_test_race.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_sparse.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_user/misc/misc.cfg head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/history/history_002_pos.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/nopwrite/nopwrite_recsize.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/redacted_send/redacted_negative.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend.kshlib head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_008_pos.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_024_pos.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/send_freeobjects.ksh head/sys/modules/dtrace/fasttrap/Makefile Directory Properties: head/sys/contrib/openzfs/ (props changed) Modified: head/sys/contrib/openzfs/CODE_OF_CONDUCT.md ============================================================================== --- head/sys/contrib/openzfs/CODE_OF_CONDUCT.md Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/CODE_OF_CONDUCT.md Sat Oct 17 01:06:04 2020 (r366780) @@ -1,2 +1,2 @@ The [OpenZFS Code of Conduct](http://www.open-zfs.org/wiki/Code_of_Conduct) -applies to spaces associated with the ZFS on Linux project, including GitHub. +applies to spaces associated with the OpenZFS project, including GitHub. Modified: head/sys/contrib/openzfs/META ============================================================================== --- head/sys/contrib/openzfs/META Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/META Sat Oct 17 01:06:04 2020 (r366780) @@ -2,9 +2,9 @@ Meta: 1 Name: zfs Branch: 1.0 Version: 2.0.0 -Release: rc2 +Release: rc3 Release-Tags: relext License: CDDL Author: OpenZFS -Linux-Maximum: 5.8 +Linux-Maximum: 5.9 Linux-Minimum: 3.10 Modified: head/sys/contrib/openzfs/README.md ============================================================================== --- head/sys/contrib/openzfs/README.md Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/README.md Sat Oct 17 01:06:04 2020 (r366780) @@ -16,8 +16,8 @@ This repository contains the code for running OpenZFS # Installation -Full documentation for installing OpenZFS on your favorite Linux distribution can -be found at the [ZoL Site](https://zfsonlinux.org/). +Full documentation for installing OpenZFS on your favorite operating system can +be found at the [Getting Started Page](https://openzfs.github.io/openzfs-docs/Getting%20Started/index.html). # Contribute & Develop Modified: head/sys/contrib/openzfs/cmd/arc_summary/arc_summary2 ============================================================================== --- head/sys/contrib/openzfs/cmd/arc_summary/arc_summary2 Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/arc_summary/arc_summary2 Sat Oct 17 01:06:04 2020 (r366780) @@ -42,7 +42,7 @@ Provides basic information on the ARC, its efficiency, the L2ARC (if present), the Data Management Unit (DMU), Virtual Devices (VDEVs), and tunables. See the in-source documentation and code at -https://github.com/zfsonlinux/zfs/blob/master/module/zfs/arc.c for details. +https://github.com/openzfs/zfs/blob/master/module/zfs/arc.c for details. """ import getopt Modified: head/sys/contrib/openzfs/cmd/arc_summary/arc_summary3 ============================================================================== --- head/sys/contrib/openzfs/cmd/arc_summary/arc_summary3 Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/arc_summary/arc_summary3 Sat Oct 17 01:06:04 2020 (r366780) @@ -32,7 +32,7 @@ Provides basic information on the ARC, its efficiency, the L2ARC (if present), the Data Management Unit (DMU), Virtual Devices (VDEVs), and tunables. See the in-source documentation and code at -https://github.com/zfsonlinux/zfs/blob/master/module/zfs/arc.c for details. +https://github.com/openzfs/zfs/blob/master/module/zfs/arc.c for details. The original introduction to arc_summary can be found at http://cuddletech.com/?p=454 """ @@ -43,7 +43,7 @@ import subprocess import sys import time -DESCRIPTION = 'Print ARC and other statistics for ZFS on Linux' +DESCRIPTION = 'Print ARC and other statistics for OpenZFS' INDENT = ' '*8 LINE_LENGTH = 72 DATE_FORMAT = '%a %b %d %H:%M:%S %Y' @@ -831,7 +831,7 @@ def section_vdev(kstats_dict): # Currently [Nov 2017] the VDEV cache is disabled, because it is actually # harmful. When this is the case, we just skip the whole entry. See - # https://github.com/zfsonlinux/zfs/blob/master/module/zfs/vdev_cache.c + # https://github.com/openzfs/zfs/blob/master/module/zfs/vdev_cache.c # for details tunables = get_vdev_params() @@ -857,7 +857,7 @@ def section_vdev(kstats_dict): def section_zil(kstats_dict): """Collect information on the ZFS Intent Log. Some of the information - taken from https://github.com/zfsonlinux/zfs/blob/master/include/sys/zil.h + taken from https://github.com/openzfs/zfs/blob/master/include/sys/zil.h """ zil_stats = isolate_section('zil', kstats_dict) Modified: head/sys/contrib/openzfs/cmd/dbufstat/dbufstat.in ============================================================================== --- head/sys/contrib/openzfs/cmd/dbufstat/dbufstat.in Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/dbufstat/dbufstat.in Sat Oct 17 01:06:04 2020 (r366780) @@ -113,6 +113,21 @@ cmd = ("Usage: dbufstat [-bdhnrtvx] [-i file] [-f fiel raw = 0 +if sys.platform.startswith("freebsd"): + import io + # Requires py-sysctl on FreeBSD + import sysctl + + def default_ifile(): + dbufs = sysctl.filter("kstat.zfs.misc.dbufs")[0].value + sys.stdin = io.StringIO(dbufs) + return "-" + +elif sys.platform.startswith("linux"): + def default_ifile(): + return "/proc/spl/kstat/zfs/dbufs" + + def print_incompat_helper(incompat): cnt = 0 for key in sorted(incompat): @@ -645,7 +660,7 @@ def main(): sys.exit(1) if not ifile: - ifile = '/proc/spl/kstat/zfs/dbufs' + ifile = default_ifile() if ifile is not "-": try: Modified: head/sys/contrib/openzfs/cmd/zdb/zdb.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zdb/zdb.c Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zdb/zdb.c Sat Oct 17 01:06:04 2020 (r366780) @@ -1120,7 +1120,21 @@ dump_zap(objset_t *os, uint64_t object, void *data, si (void) zap_lookup(os, object, attr.za_name, attr.za_integer_length, attr.za_num_integers, prop); if (attr.za_integer_length == 1) { - (void) printf("%s", (char *)prop); + if (strcmp(attr.za_name, + DSL_CRYPTO_KEY_MASTER_KEY) == 0 || + strcmp(attr.za_name, + DSL_CRYPTO_KEY_HMAC_KEY) == 0 || + strcmp(attr.za_name, DSL_CRYPTO_KEY_IV) == 0 || + strcmp(attr.za_name, DSL_CRYPTO_KEY_MAC) == 0 || + strcmp(attr.za_name, DMU_POOL_CHECKSUM_SALT) == 0) { + uint8_t *u8 = prop; + + for (i = 0; i < attr.za_num_integers; i++) { + (void) printf("%02x", u8[i]); + } + } else { + (void) printf("%s", (char *)prop); + } } else { for (i = 0; i < attr.za_num_integers; i++) { switch (attr.za_integer_length) { Modified: head/sys/contrib/openzfs/cmd/zdb/zdb_il.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zdb/zdb_il.c Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zdb/zdb_il.c Sat Oct 17 01:06:04 2020 (r366780) @@ -62,9 +62,9 @@ print_log_bp(const blkptr_t *bp, const char *prefix) /* ARGSUSED */ static void -zil_prt_rec_create(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_create(zilog_t *zilog, int txtype, const void *arg) { - lr_create_t *lr = arg; + const lr_create_t *lr = arg; time_t crtime = lr->lr_crtime[0]; char *name, *link; lr_attr_t *lrattr; @@ -98,9 +98,9 @@ zil_prt_rec_create(zilog_t *zilog, int txtype, void *a /* ARGSUSED */ static void -zil_prt_rec_remove(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_remove(zilog_t *zilog, int txtype, const void *arg) { - lr_remove_t *lr = arg; + const lr_remove_t *lr = arg; (void) printf("%sdoid %llu, name %s\n", tab_prefix, (u_longlong_t)lr->lr_doid, (char *)(lr + 1)); @@ -108,9 +108,9 @@ zil_prt_rec_remove(zilog_t *zilog, int txtype, void *a /* ARGSUSED */ static void -zil_prt_rec_link(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_link(zilog_t *zilog, int txtype, const void *arg) { - lr_link_t *lr = arg; + const lr_link_t *lr = arg; (void) printf("%sdoid %llu, link_obj %llu, name %s\n", tab_prefix, (u_longlong_t)lr->lr_doid, (u_longlong_t)lr->lr_link_obj, @@ -119,9 +119,9 @@ zil_prt_rec_link(zilog_t *zilog, int txtype, void *arg /* ARGSUSED */ static void -zil_prt_rec_rename(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_rename(zilog_t *zilog, int txtype, const void *arg) { - lr_rename_t *lr = arg; + const lr_rename_t *lr = arg; char *snm = (char *)(lr + 1); char *tnm = snm + strlen(snm) + 1; @@ -148,11 +148,11 @@ zil_prt_rec_write_cb(void *data, size_t len, void *unu /* ARGSUSED */ static void -zil_prt_rec_write(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_write(zilog_t *zilog, int txtype, const void *arg) { - lr_write_t *lr = arg; + const lr_write_t *lr = arg; abd_t *data; - blkptr_t *bp = &lr->lr_blkptr; + const blkptr_t *bp = &lr->lr_blkptr; zbookmark_phys_t zb; int verbose = MAX(dump_opt['d'], dump_opt['i']); int error; @@ -211,9 +211,9 @@ out: /* ARGSUSED */ static void -zil_prt_rec_truncate(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_truncate(zilog_t *zilog, int txtype, const void *arg) { - lr_truncate_t *lr = arg; + const lr_truncate_t *lr = arg; (void) printf("%sfoid %llu, offset 0x%llx, length 0x%llx\n", tab_prefix, (u_longlong_t)lr->lr_foid, (longlong_t)lr->lr_offset, @@ -222,9 +222,9 @@ zil_prt_rec_truncate(zilog_t *zilog, int txtype, void /* ARGSUSED */ static void -zil_prt_rec_setattr(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_setattr(zilog_t *zilog, int txtype, const void *arg) { - lr_setattr_t *lr = arg; + const lr_setattr_t *lr = arg; time_t atime = (time_t)lr->lr_atime[0]; time_t mtime = (time_t)lr->lr_mtime[0]; @@ -268,15 +268,15 @@ zil_prt_rec_setattr(zilog_t *zilog, int txtype, void * /* ARGSUSED */ static void -zil_prt_rec_acl(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_acl(zilog_t *zilog, int txtype, const void *arg) { - lr_acl_t *lr = arg; + const lr_acl_t *lr = arg; (void) printf("%sfoid %llu, aclcnt %llu\n", tab_prefix, (u_longlong_t)lr->lr_foid, (u_longlong_t)lr->lr_aclcnt); } -typedef void (*zil_prt_rec_func_t)(zilog_t *, int, void *); +typedef void (*zil_prt_rec_func_t)(zilog_t *, int, const void *); typedef struct zil_rec_info { zil_prt_rec_func_t zri_print; const char *zri_name; @@ -309,7 +309,7 @@ static zil_rec_info_t zil_rec_info[TX_MAX_TYPE] = { /* ARGSUSED */ static int -print_log_record(zilog_t *zilog, lr_t *lr, void *arg, uint64_t claim_txg) +print_log_record(zilog_t *zilog, const lr_t *lr, void *arg, uint64_t claim_txg) { int txtype; int verbose = MAX(dump_opt['d'], dump_opt['i']); @@ -343,7 +343,8 @@ print_log_record(zilog_t *zilog, lr_t *lr, void *arg, /* ARGSUSED */ static int -print_log_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) +print_log_block(zilog_t *zilog, const blkptr_t *bp, void *arg, + uint64_t claim_txg) { char blkbuf[BP_SPRINTF_LEN + 10]; int verbose = MAX(dump_opt['d'], dump_opt['i']); Modified: head/sys/contrib/openzfs/cmd/zed/agents/zfs_agents.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/agents/zfs_agents.c Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/agents/zfs_agents.c Sat Oct 17 01:06:04 2020 (r366780) @@ -177,9 +177,9 @@ zfs_agent_post_event(const char *class, const char *su } /* - * On ZFS on Linux, we don't get the expected FM_RESOURCE_REMOVED - * ereport from vdev_disk layer after a hot unplug. Fortunately we - * get a EC_DEV_REMOVE from our disk monitor and it is a suitable + * On Linux, we don't get the expected FM_RESOURCE_REMOVED ereport + * from the vdev_disk layer after a hot unplug. Fortunately we do + * get an EC_DEV_REMOVE from our disk monitor and it is a suitable * proxy so we remap it here for the benefit of the diagnosis engine. */ if ((strcmp(class, EC_DEV_REMOVE) == 0) && Modified: head/sys/contrib/openzfs/cmd/zed/agents/zfs_mod.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/agents/zfs_mod.c Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/agents/zfs_mod.c Sat Oct 17 01:06:04 2020 (r366780) @@ -63,9 +63,7 @@ * If the device could not be replaced, then the second online attempt will * trigger the FMA fault that we skipped earlier. * - * ZFS on Linux porting notes: - * Linux udev provides a disk insert for both the disk and the partition - * + * On Linux udev provides a disk insert for both the disk and the partition. */ #include Modified: head/sys/contrib/openzfs/cmd/zed/agents/zfs_retire.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/agents/zfs_retire.c Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/agents/zfs_retire.c Sat Oct 17 01:06:04 2020 (r366780) @@ -364,7 +364,7 @@ zfs_retire_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlis return; /* - * Note: on zfsonlinux statechange events are more than just + * Note: on Linux statechange events are more than just * healthy ones so we need to confirm the actual state value. */ if (strcmp(class, "resource.fs.zfs.statechange") == 0 && Modified: head/sys/contrib/openzfs/cmd/zed/zed.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/zed.c Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/zed.c Sat Oct 17 01:06:04 2020 (r366780) @@ -1,6 +1,6 @@ /* - * This file is part of the ZFS Event Daemon (ZED) - * for ZFS on Linux (ZoL) . + * This file is part of the ZFS Event Daemon (ZED). + * * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. * Refer to the ZoL git commit log for authoritative copyright attribution. Modified: head/sys/contrib/openzfs/cmd/zed/zed.h ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/zed.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/zed.h Sat Oct 17 01:06:04 2020 (r366780) @@ -1,6 +1,6 @@ /* - * This file is part of the ZFS Event Daemon (ZED) - * for ZFS on Linux (ZoL) . + * This file is part of the ZFS Event Daemon (ZED). + * * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. * Refer to the ZoL git commit log for authoritative copyright attribution. Modified: head/sys/contrib/openzfs/cmd/zed/zed_conf.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/zed_conf.c Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/zed_conf.c Sat Oct 17 01:06:04 2020 (r366780) @@ -1,6 +1,6 @@ /* - * This file is part of the ZFS Event Daemon (ZED) - * for ZFS on Linux (ZoL) . + * This file is part of the ZFS Event Daemon (ZED). + * * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. * Refer to the ZoL git commit log for authoritative copyright attribution. Modified: head/sys/contrib/openzfs/cmd/zed/zed_conf.h ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/zed_conf.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/zed_conf.h Sat Oct 17 01:06:04 2020 (r366780) @@ -1,6 +1,6 @@ /* - * This file is part of the ZFS Event Daemon (ZED) - * for ZFS on Linux (ZoL) . + * This file is part of the ZFS Event Daemon (ZED). + * * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. * Refer to the ZoL git commit log for authoritative copyright attribution. Modified: head/sys/contrib/openzfs/cmd/zed/zed_event.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/zed_event.c Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/zed_event.c Sat Oct 17 01:06:04 2020 (r366780) @@ -1,6 +1,6 @@ /* - * This file is part of the ZFS Event Daemon (ZED) - * for ZFS on Linux (ZoL) . + * This file is part of the ZFS Event Daemon (ZED). + * * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. * Refer to the ZoL git commit log for authoritative copyright attribution. Modified: head/sys/contrib/openzfs/cmd/zed/zed_event.h ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/zed_event.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/zed_event.h Sat Oct 17 01:06:04 2020 (r366780) @@ -1,6 +1,6 @@ /* - * This file is part of the ZFS Event Daemon (ZED) - * for ZFS on Linux (ZoL) . + * This file is part of the ZFS Event Daemon (ZED). + * * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. * Refer to the ZoL git commit log for authoritative copyright attribution. Modified: head/sys/contrib/openzfs/cmd/zed/zed_exec.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/zed_exec.c Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/zed_exec.c Sat Oct 17 01:06:04 2020 (r366780) @@ -1,6 +1,6 @@ /* - * This file is part of the ZFS Event Daemon (ZED) - * for ZFS on Linux (ZoL) . + * This file is part of the ZFS Event Daemon (ZED). + * * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. * Refer to the ZoL git commit log for authoritative copyright attribution. Modified: head/sys/contrib/openzfs/cmd/zed/zed_exec.h ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/zed_exec.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/zed_exec.h Sat Oct 17 01:06:04 2020 (r366780) @@ -1,6 +1,6 @@ /* - * This file is part of the ZFS Event Daemon (ZED) - * for ZFS on Linux (ZoL) . + * This file is part of the ZFS Event Daemon (ZED). + * * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. * Refer to the ZoL git commit log for authoritative copyright attribution. Modified: head/sys/contrib/openzfs/cmd/zed/zed_file.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/zed_file.c Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/zed_file.c Sat Oct 17 01:06:04 2020 (r366780) @@ -1,6 +1,6 @@ /* - * This file is part of the ZFS Event Daemon (ZED) - * for ZFS on Linux (ZoL) . + * This file is part of the ZFS Event Daemon (ZED). + * * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. * Refer to the ZoL git commit log for authoritative copyright attribution. Modified: head/sys/contrib/openzfs/cmd/zed/zed_file.h ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/zed_file.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/zed_file.h Sat Oct 17 01:06:04 2020 (r366780) @@ -1,6 +1,6 @@ /* - * This file is part of the ZFS Event Daemon (ZED) - * for ZFS on Linux (ZoL) . + * This file is part of the ZFS Event Daemon (ZED). + * * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. * Refer to the ZoL git commit log for authoritative copyright attribution. Modified: head/sys/contrib/openzfs/cmd/zed/zed_log.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/zed_log.c Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/zed_log.c Sat Oct 17 01:06:04 2020 (r366780) @@ -1,6 +1,6 @@ /* - * This file is part of the ZFS Event Daemon (ZED) - * for ZFS on Linux (ZoL) . + * This file is part of the ZFS Event Daemon (ZED). + * * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. * Refer to the ZoL git commit log for authoritative copyright attribution. Modified: head/sys/contrib/openzfs/cmd/zed/zed_log.h ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/zed_log.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/zed_log.h Sat Oct 17 01:06:04 2020 (r366780) @@ -1,6 +1,6 @@ /* - * This file is part of the ZFS Event Daemon (ZED) - * for ZFS on Linux (ZoL) . + * This file is part of the ZFS Event Daemon (ZED). + * * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. * Refer to the ZoL git commit log for authoritative copyright attribution. Modified: head/sys/contrib/openzfs/cmd/zed/zed_strings.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/zed_strings.c Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/zed_strings.c Sat Oct 17 01:06:04 2020 (r366780) @@ -1,6 +1,6 @@ /* - * This file is part of the ZFS Event Daemon (ZED) - * for ZFS on Linux (ZoL) . + * This file is part of the ZFS Event Daemon (ZED). + * * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. * Refer to the ZoL git commit log for authoritative copyright attribution. Modified: head/sys/contrib/openzfs/cmd/zed/zed_strings.h ============================================================================== --- head/sys/contrib/openzfs/cmd/zed/zed_strings.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zed/zed_strings.h Sat Oct 17 01:06:04 2020 (r366780) @@ -1,6 +1,6 @@ /* - * This file is part of the ZFS Event Daemon (ZED) - * for ZFS on Linux (ZoL) . + * This file is part of the ZFS Event Daemon (ZED). + * * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049). * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC. * Refer to the ZoL git commit log for authoritative copyright attribution. Modified: head/sys/contrib/openzfs/cmd/zvol_id/Makefile.am ============================================================================== --- head/sys/contrib/openzfs/cmd/zvol_id/Makefile.am Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/cmd/zvol_id/Makefile.am Sat Oct 17 01:06:04 2020 (r366780) @@ -1,7 +1,7 @@ include $(top_srcdir)/config/Rules.am # Disable GCC stack protection for zvol_id. This is a kludge and should be -# removed once https://github.com/zfsonlinux/zfs/issues/569 is resolved. +# removed once https://github.com/openzfs/zfs/issues/569 is resolved. AM_CFLAGS += -fno-stack-protector udev_PROGRAMS = zvol_id Modified: head/sys/contrib/openzfs/config/kernel-bio.m4 ============================================================================== --- head/sys/contrib/openzfs/config/kernel-bio.m4 Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/config/kernel-bio.m4 Sat Oct 17 01:06:04 2020 (r366780) @@ -344,7 +344,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKG_TRYGET], [ #include #include ],[ - struct blkcg_gq blkg __attribute__ ((unused)); + struct blkcg_gq blkg __attribute__ ((unused)) = {}; bool rc __attribute__ ((unused)); rc = blkg_tryget(&blkg); ], [], [$ZFS_META_LICENSE]) Modified: head/sys/contrib/openzfs/configure.ac ============================================================================== --- head/sys/contrib/openzfs/configure.ac Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/configure.ac Sat Oct 17 01:06:04 2020 (r366780) @@ -237,6 +237,7 @@ AC_CONFIG_FILES([ tests/zfs-tests/tests/functional/Makefile tests/zfs-tests/tests/functional/acl/Makefile tests/zfs-tests/tests/functional/acl/posix/Makefile + tests/zfs-tests/tests/functional/acl/posix-sa/Makefile tests/zfs-tests/tests/functional/alloc_class/Makefile tests/zfs-tests/tests/functional/arc/Makefile tests/zfs-tests/tests/functional/atime/Makefile Modified: head/sys/contrib/openzfs/contrib/dracut/90zfs/module-setup.sh.in ============================================================================== --- head/sys/contrib/openzfs/contrib/dracut/90zfs/module-setup.sh.in Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/contrib/dracut/90zfs/module-setup.sh.in Sat Oct 17 01:06:04 2020 (r366780) @@ -41,7 +41,8 @@ install() { dracut_install @bindir@/zgenhostid dracut_install @sbindir@/zfs dracut_install @sbindir@/zpool - # Workaround for zfsonlinux/zfs#4749 by ensuring libgcc_s.so(.1) is included + # Workaround for https://github.com/openzfs/zfs/issues/4749 by + # ensuring libgcc_s.so(.1) is included if [[ -n "$(ldd @sbindir@/zpool | grep -F 'libgcc_s.so')" ]]; then # Dracut will have already tracked and included it :; Modified: head/sys/contrib/openzfs/contrib/pyzfs/README ============================================================================== --- head/sys/contrib/openzfs/contrib/pyzfs/README Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/contrib/pyzfs/README Sat Oct 17 01:06:04 2020 (r366780) @@ -25,4 +25,4 @@ a temporary directory specified by, for instance, TMP variable on a memory backed filesystem. Package documentation: http://pyzfs.readthedocs.org -Package development: https://github.com/zfsonlinux/zfs +Package development: https://github.com/openzfs/zfs Modified: head/sys/contrib/openzfs/contrib/pyzfs/libzfs_core/__init__.py ============================================================================== --- head/sys/contrib/openzfs/contrib/pyzfs/libzfs_core/__init__.py Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/contrib/pyzfs/libzfs_core/__init__.py Sat Oct 17 01:06:04 2020 (r366780) @@ -32,7 +32,7 @@ of the error codes to the exceptions by interpreting a in which the error code is produced. To submit an issue or contribute to development of this package -please visit its `GitHub repository `_. +please visit its `GitHub repository `_. .. data:: MAXNAMELEN Modified: head/sys/contrib/openzfs/copy-builtin ============================================================================== --- head/sys/contrib/openzfs/copy-builtin Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/copy-builtin Sat Oct 17 01:06:04 2020 (r366780) @@ -35,9 +35,9 @@ config ZFS select ZLIB_INFLATE select ZLIB_DEFLATE help - This is the ZFS filesystem from the ZFS On Linux project. + This is the ZFS filesystem from the OpenZFS project. - See https://zfsonlinux.org/ + See https://github.com/openzfs/zfs To compile this file system support as a module, choose M here. Modified: head/sys/contrib/openzfs/etc/init.d/README.md ============================================================================== --- head/sys/contrib/openzfs/etc/init.d/README.md Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/etc/init.d/README.md Sat Oct 17 01:06:04 2020 (r366780) @@ -16,7 +16,7 @@ DESCRIPTION SUPPORT If you find that they don't work for your platform, please report this - at the ZFS On Linux issue tracker at https://github.com/zfsonlinux/zfs/issues. + at the OpenZFS issue tracker at https://github.com/openzfs/zfs/issues. Please include: Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/kstat.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_x86.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_x86.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_x86.h Sat Oct 17 01:06:04 2020 (r366780) @@ -26,15 +26,12 @@ * $FreeBSD$ */ -#include #include -#include +#include #include -#ifdef __i386__ -#include -#else -#include -#endif +#include + +#include #include #include Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/sunddi.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/sunddi.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/sunddi.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_ctldir.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_ctldir.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_ctldir.h Sat Oct 17 01:06:04 2020 (r366780) @@ -48,7 +48,7 @@ int zfsctl_root(zfsvfs_t *, int, vnode_t **); void zfsctl_init(void); void zfsctl_fini(void); boolean_t zfsctl_is_node(vnode_t *); -int zfsctl_snapshot_unmount(char *snapname, int flags); +int zfsctl_snapshot_unmount(const char *snapname, int flags); int zfsctl_rename_snapshot(const char *from, const char *to); int zfsctl_destroy_snapshot(const char *snapname, int force); int zfsctl_umount_snapshots(vfs_t *, int, cred_t *); Modified: head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_dir.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_dir.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_dir.h Sat Oct 17 01:06:04 2020 (r366780) @@ -52,11 +52,7 @@ extern int zfs_dirent_lookup(znode_t *, const char *, extern int zfs_link_create(znode_t *, const char *, znode_t *, dmu_tx_t *, int); extern int zfs_link_destroy(znode_t *, const char *, znode_t *, dmu_tx_t *, int, boolean_t *); -#if 0 -extern int zfs_dirlook(vnode_t *, const char *, vnode_t **, int); -#else extern int zfs_dirlook(znode_t *, const char *name, znode_t **); -#endif extern void zfs_mknode(znode_t *, vattr_t *, dmu_tx_t *, cred_t *, uint_t, znode_t **, zfs_acl_ids_t *); extern void zfs_rmnode(znode_t *); Modified: head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops_os.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops_os.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops_os.h Sat Oct 17 01:06:04 2020 (r366780) @@ -72,6 +72,7 @@ struct zfsvfs { boolean_t z_fuid_dirty; /* need to sync fuid table ? */ struct zfs_fuid_info *z_fuid_replay; /* fuid info for replay */ zilog_t *z_log; /* intent log pointer */ + uint_t z_acl_type; /* type of acl usable on this fs */ uint_t z_acl_mode; /* acl chmod/mode behavior */ uint_t z_acl_inherit; /* acl inheritance behavior */ zfs_case_t z_case; /* case-sense */ Modified: head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vnops.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vnops.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vnops.h Sat Oct 17 01:06:04 2020 (r366780) @@ -32,21 +32,21 @@ int dmu_write_pages(objset_t *os, uint64_t object, uin uint64_t size, struct vm_page **ppa, dmu_tx_t *tx); int dmu_read_pages(objset_t *os, uint64_t object, vm_page_t *ma, int count, int *rbehind, int *rahead, int last_size); -extern int zfs_remove(znode_t *dzp, char *name, cred_t *cr, int flags); -extern int zfs_mkdir(znode_t *dzp, char *dirname, vattr_t *vap, +extern int zfs_remove(znode_t *dzp, const char *name, cred_t *cr, int flags); +extern int zfs_mkdir(znode_t *dzp, const char *dirname, vattr_t *vap, znode_t **zpp, cred_t *cr, int flags, vsecattr_t *vsecp); -extern int zfs_rmdir(znode_t *dzp, char *name, znode_t *cwd, +extern int zfs_rmdir(znode_t *dzp, const char *name, znode_t *cwd, cred_t *cr, int flags); extern int zfs_setattr(znode_t *zp, vattr_t *vap, int flag, cred_t *cr); -extern int zfs_rename(znode_t *sdzp, char *snm, znode_t *tdzp, - char *tnm, cred_t *cr, int flags); +extern int zfs_rename(znode_t *sdzp, const char *snm, znode_t *tdzp, + const char *tnm, cred_t *cr, int flags); extern int zfs_symlink(znode_t *dzp, const char *name, vattr_t *vap, const char *link, znode_t **zpp, cred_t *cr, int flags); extern int zfs_link(znode_t *tdzp, znode_t *sp, - char *name, cred_t *cr, int flags); + const char *name, cred_t *cr, int flags); extern int zfs_space(znode_t *zp, int cmd, struct flock *bfp, int flag, offset_t offset, cred_t *cr); -extern int zfs_create(znode_t *dzp, char *name, vattr_t *vap, int excl, +extern int zfs_create(znode_t *dzp, const char *name, vattr_t *vap, int excl, int mode, znode_t **zpp, cred_t *cr, int flag, vsecattr_t *vsecp); extern int zfs_setsecattr(znode_t *zp, vsecattr_t *vsecp, int flag, cred_t *cr); Modified: head/sys/contrib/openzfs/include/os/linux/spl/rpc/xdr.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/rpc/xdr.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/rpc/xdr.h Sat Oct 17 01:06:04 2020 (r366780) @@ -3,7 +3,6 @@ * Written by Ricardo Correia * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/acl.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/acl.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/acl.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/atomic.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/atomic.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/atomic.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/byteorder.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/byteorder.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/byteorder.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/callb.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/callb.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/callb.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/callo.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/callo.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/callo.h Sat Oct 17 01:06:04 2020 (r366780) @@ -5,7 +5,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/cmn_err.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/cmn_err.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/cmn_err.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/condvar.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/condvar.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/condvar.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/console.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/console.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/console.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/cred.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/cred.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/cred.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/ctype.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/ctype.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/ctype.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/debug.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/debug.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/debug.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/disp.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/disp.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/disp.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/dkio.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/dkio.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/dkio.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/fcntl.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/fcntl.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/fcntl.h Sat Oct 17 01:06:04 2020 (r366780) @@ -5,7 +5,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/file.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/file.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/file.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/inttypes.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/inttypes.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/inttypes.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/isa_defs.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/isa_defs.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/isa_defs.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/kmem.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/kmem.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/kmem.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/kmem_cache.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/kmem_cache.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/kmem_cache.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/kstat.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/kstat.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/kstat.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/list.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/list.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/list.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/mod_os.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/mod_os.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/mod_os.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/mutex.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/mutex.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/mutex.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/param.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/param.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/param.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/proc.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/proc.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/proc.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/processor.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/processor.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/processor.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/random.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/random.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/random.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/rwlock.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/rwlock.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/rwlock.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/shrinker.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/shrinker.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/shrinker.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/sid.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/sid.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/sid.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/signal.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/signal.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/signal.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/simd.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/simd.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/simd.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/stat.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/stat.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/stat.h Sat Oct 17 01:06:04 2020 (r366780) @@ -6,7 +6,6 @@ * UCRL-CODE-235197 * * This file is part of the SPL, Solaris Porting Layer. - * For details, see . * * The SPL is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/strings.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/strings.h Sat Oct 17 00:44:04 2020 (r366779) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/strings.h Sat Oct 17 01:06:04 2020 (r366780) @@ -4,7 +4,6 @@ * UCRL-CODE-235197 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Oct 17 04:14:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76C1842888A; Sat, 17 Oct 2020 04:14:40 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCqRN1KDrz4ZJJ; Sat, 17 Oct 2020 04:14:40 +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 0FF2E1BC02; Sat, 17 Oct 2020 04:14:40 +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 09H4EdC0097525; Sat, 17 Oct 2020 04:14:39 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09H4EdBF097521; Sat, 17 Oct 2020 04:14:39 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202010170414.09H4EdBF097521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 17 Oct 2020 04:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366781 - in head: include lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: include lib/libc/stdlib X-SVN-Commit-Revision: 366781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 04:14:40 -0000 Author: delphij Date: Sat Oct 17 04:14:38 2020 New Revision: 366781 URL: https://svnweb.freebsd.org/changeset/base/366781 Log: Implement ptsname_r. MFC after: 2 weeks PR: 250062 Reviewed by: jilles, 0mp, Ray Differential Revision: https://reviews.freebsd.org/D26647 Modified: head/include/stdlib.h head/lib/libc/stdlib/Makefile.inc head/lib/libc/stdlib/Symbol.map head/lib/libc/stdlib/ptsname.3 head/lib/libc/stdlib/ptsname.c Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Sat Oct 17 01:06:04 2020 (r366780) +++ head/include/stdlib.h Sat Oct 17 04:14:38 2020 (r366781) @@ -225,6 +225,7 @@ long mrand48(void); long nrand48(unsigned short[3]); int posix_openpt(int); char *ptsname(int); +int ptsname_r(int, char *, size_t); int putenv(char *); long random(void); unsigned short Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Sat Oct 17 01:06:04 2020 (r366780) +++ head/lib/libc/stdlib/Makefile.inc Sat Oct 17 04:14:38 2020 (r366781) @@ -50,7 +50,7 @@ MLINKS+=hcreate.3 hdestroy.3 hcreate.3 hsearch.3 MLINKS+=hcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 hsearch_r.3 MLINKS+=insque.3 remque.3 MLINKS+=lsearch.3 lfind.3 -MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3 +MLINKS+=ptsname.3 grantpt.3 ptsname.3 ptsname_r.3 ptsname.3 unlockpt.3 MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3 \ qsort.3 qsort_s.3 MLINKS+=rand.3 rand_r.3 rand.3 srand.3 Modified: head/lib/libc/stdlib/Symbol.map ============================================================================== --- head/lib/libc/stdlib/Symbol.map Sat Oct 17 01:06:04 2020 (r366780) +++ head/lib/libc/stdlib/Symbol.map Sat Oct 17 04:14:38 2020 (r366781) @@ -125,6 +125,7 @@ FBSD_1.6 { qsort_s; rand; srand; + ptsname_r; }; FBSDprivate_1.0 { Modified: head/lib/libc/stdlib/ptsname.3 ============================================================================== --- head/lib/libc/stdlib/ptsname.3 Sat Oct 17 01:06:04 2020 (r366780) +++ head/lib/libc/stdlib/ptsname.3 Sat Oct 17 04:14:38 2020 (r366781) @@ -31,12 +31,13 @@ .\" .\" $FreeBSD$ .\" -.Dd August 20, 2008 +.Dd October 17, 2020 .Dt PTSNAME 3 .Os .Sh NAME .Nm grantpt , .Nm ptsname , +.Nm ptsname_r , .Nm unlockpt .Nd pseudo-terminal access functions .Sh LIBRARY @@ -47,6 +48,8 @@ .Fn grantpt "int fildes" .Ft "char *" .Fn ptsname "int fildes" +.Ft "int" +.Fn ptsname_r "int fildes" "char *buffer" "size_t buflen" .Ft int .Fn unlockpt "int fildes" .Sh DESCRIPTION @@ -87,12 +90,23 @@ and have been called. .Pp The +.Fn ptsname_r +function is the thread-safe version of +.Fn ptsname . +The caller must provide storage for the results of the full pathname of +the slave device in the +.Fa buffer +and +.Fa bufsize +arguments. +.Pp +The .Fn unlockpt function clears the lock held on the pseudo-terminal pair for the master device specified with .Fa fildes . .Sh RETURN VALUES -.Rv -std grantpt unlockpt +.Rv -std grantpt ptsname_r unlockpt .Pp The .Fn ptsname @@ -103,7 +117,8 @@ pointer is returned. .Sh ERRORS The .Fn grantpt , -.Fn ptsname +.Fn ptsname , +.Fn ptsname_r and .Fn unlockpt functions may fail and set @@ -116,6 +131,16 @@ is not a valid open file descriptor. .It Bq Er EINVAL .Fa fildes is not a master pseudo-terminal device. +.El +.Pp +In addition, the +.Fn ptsname_r +function may set +.Va errno +to: +.Bl -tag -width Er +.It Bq Er ERANGE +The buffer was too small. .El .Pp In addition, the Modified: head/lib/libc/stdlib/ptsname.c ============================================================================== --- head/lib/libc/stdlib/ptsname.c Sat Oct 17 01:06:04 2020 (r366780) +++ head/lib/libc/stdlib/ptsname.c Sat Oct 17 04:14:38 2020 (r366781) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "un-namespace.h" /* @@ -71,23 +72,46 @@ __strong_reference(__isptmaster, grantpt); __strong_reference(__isptmaster, unlockpt); /* - * ptsname(): return the pathname of the slave pseudo-terminal device - * associated with the specified master. + * ptsname_r(): return the pathname of the slave pseudo-terminal device + * associated with the specified master. */ -char * -ptsname(int fildes) +int +ptsname_r(int fildes, char *buffer, size_t buflen) { - static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN] = _PATH_DEV; - char *ret = NULL; + if (buflen <= sizeof(_PATH_DEV)) { + errno = ERANGE; + return (-1); + } + /* Make sure fildes points to a master device. */ if (__isptmaster(fildes) != 0) - goto done; + return (-1); - if (fdevname_r(fildes, pt_slave + (sizeof _PATH_DEV - 1), - sizeof pt_slave - (sizeof _PATH_DEV - 1)) != NULL) - ret = pt_slave; + memcpy(buffer, _PATH_DEV, sizeof(_PATH_DEV)); + buffer += sizeof(_PATH_DEV) - 1; + buflen -= sizeof(_PATH_DEV) - 1; -done: - return (ret); + if (fdevname_r(fildes, buffer, buflen) == NULL) { + if (errno == EINVAL) + errno = ERANGE; + return (-1); + } + + return (0); +} + +/* + * ptsname(): return the pathname of the slave pseudo-terminal device + * associated with the specified master. + */ +char * +ptsname(int fildes) +{ + static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN]; + + if (ptsname_r(fildes, pt_slave, sizeof(pt_slave)) == 0) + return (pt_slave); + else + return (NULL); } From owner-svn-src-head@freebsd.org Sat Oct 17 04:14:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8BF7E428795; Sat, 17 Oct 2020 04:14:49 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCqRX0jMlz4ZDX; Sat, 17 Oct 2020 04:14:47 +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 0DA491B8B5; Sat, 17 Oct 2020 04:14:47 +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 09H4Ekmm097592; Sat, 17 Oct 2020 04:14:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09H4EkcA097591; Sat, 17 Oct 2020 04:14:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202010170414.09H4EkcA097591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 17 Oct 2020 04:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366782 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 366782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 04:14:50 -0000 Author: delphij Date: Sat Oct 17 04:14:46 2020 New Revision: 366782 URL: https://svnweb.freebsd.org/changeset/base/366782 Log: Bump __FreeBSD_version after ptsname_r addition. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Oct 17 04:14:38 2020 (r366781) +++ head/sys/sys/param.h Sat Oct 17 04:14:46 2020 (r366782) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300121 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300122 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sat Oct 17 06:53:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E72842CA56; Sat, 17 Oct 2020 06:53:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCtyl5rHLz3TvY; Sat, 17 Oct 2020 06:53:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 09H6rQao009529 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 17 Oct 2020 09:53:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 09H6rQao009529 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 09H6rQL8009528; Sat, 17 Oct 2020 09:53:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 17 Oct 2020 09:53:26 +0300 From: Konstantin Belousov To: Xin LI Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366781 - in head: include lib/libc/stdlib Message-ID: <20201017065326.GY2643@kib.kiev.ua> References: <202010170414.09H4EdBF097521@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202010170414.09H4EdBF097521@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4CCtyl5rHLz3TvY X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 06:53:36 -0000 On Sat, Oct 17, 2020 at 04:14:39AM +0000, Xin LI wrote: > Author: delphij > Date: Sat Oct 17 04:14:38 2020 > New Revision: 366781 > URL: https://svnweb.freebsd.org/changeset/base/366781 > > Log: > Implement ptsname_r. > > MFC after: 2 weeks > PR: 250062 > Reviewed by: jilles, 0mp, Ray > Differential Revision: https://reviews.freebsd.org/D26647 > > Modified: > head/include/stdlib.h > head/lib/libc/stdlib/Makefile.inc > head/lib/libc/stdlib/Symbol.map > head/lib/libc/stdlib/ptsname.3 > head/lib/libc/stdlib/ptsname.c > > Modified: head/include/stdlib.h > ============================================================================== > --- head/include/stdlib.h Sat Oct 17 01:06:04 2020 (r366780) > +++ head/include/stdlib.h Sat Oct 17 04:14:38 2020 (r366781) > @@ -225,6 +225,7 @@ long mrand48(void); > long nrand48(unsigned short[3]); > int posix_openpt(int); > char *ptsname(int); > +int ptsname_r(int, char *, size_t); This declaration appears in the __XSI_VISIBLE block, but I do not see the function description in the IEEE Std 1003.1™-2017 text (base issue 7). Review mentioned that the function is scheduled for issue 8, but shouldn't it put under BSD_VISIBLE until specification is finalized ? > int putenv(char *); > long random(void); > unsigned short > > Modified: head/lib/libc/stdlib/Makefile.inc > ============================================================================== > --- head/lib/libc/stdlib/Makefile.inc Sat Oct 17 01:06:04 2020 (r366780) > +++ head/lib/libc/stdlib/Makefile.inc Sat Oct 17 04:14:38 2020 (r366781) > @@ -50,7 +50,7 @@ MLINKS+=hcreate.3 hdestroy.3 hcreate.3 hsearch.3 > MLINKS+=hcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 hsearch_r.3 > MLINKS+=insque.3 remque.3 > MLINKS+=lsearch.3 lfind.3 > -MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3 > +MLINKS+=ptsname.3 grantpt.3 ptsname.3 ptsname_r.3 ptsname.3 unlockpt.3 > MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3 \ > qsort.3 qsort_s.3 > MLINKS+=rand.3 rand_r.3 rand.3 srand.3 > > Modified: head/lib/libc/stdlib/Symbol.map > ============================================================================== > --- head/lib/libc/stdlib/Symbol.map Sat Oct 17 01:06:04 2020 (r366780) > +++ head/lib/libc/stdlib/Symbol.map Sat Oct 17 04:14:38 2020 (r366781) > @@ -125,6 +125,7 @@ FBSD_1.6 { > qsort_s; > rand; > srand; > + ptsname_r; This is unsorted now. > }; > > FBSDprivate_1.0 { > > Modified: head/lib/libc/stdlib/ptsname.3 > ============================================================================== > --- head/lib/libc/stdlib/ptsname.3 Sat Oct 17 01:06:04 2020 (r366780) > +++ head/lib/libc/stdlib/ptsname.3 Sat Oct 17 04:14:38 2020 (r366781) > @@ -31,12 +31,13 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd August 20, 2008 > +.Dd October 17, 2020 > .Dt PTSNAME 3 > .Os > .Sh NAME > .Nm grantpt , > .Nm ptsname , > +.Nm ptsname_r , > .Nm unlockpt > .Nd pseudo-terminal access functions > .Sh LIBRARY > @@ -47,6 +48,8 @@ > .Fn grantpt "int fildes" > .Ft "char *" > .Fn ptsname "int fildes" > +.Ft "int" > +.Fn ptsname_r "int fildes" "char *buffer" "size_t buflen" > .Ft int > .Fn unlockpt "int fildes" > .Sh DESCRIPTION > @@ -87,12 +90,23 @@ and > have been called. > .Pp > The > +.Fn ptsname_r > +function is the thread-safe version of > +.Fn ptsname . > +The caller must provide storage for the results of the full pathname of > +the slave device in the > +.Fa buffer > +and > +.Fa bufsize > +arguments. > +.Pp > +The > .Fn unlockpt > function clears the lock held on the pseudo-terminal pair > for the master device specified with > .Fa fildes . > .Sh RETURN VALUES > -.Rv -std grantpt unlockpt > +.Rv -std grantpt ptsname_r unlockpt > .Pp > The > .Fn ptsname > @@ -103,7 +117,8 @@ pointer is returned. > .Sh ERRORS > The > .Fn grantpt , > -.Fn ptsname > +.Fn ptsname , > +.Fn ptsname_r > and > .Fn unlockpt > functions may fail and set > @@ -116,6 +131,16 @@ is not a valid open file descriptor. > .It Bq Er EINVAL > .Fa fildes > is not a master pseudo-terminal device. > +.El > +.Pp > +In addition, the > +.Fn ptsname_r > +function may set > +.Va errno > +to: > +.Bl -tag -width Er > +.It Bq Er ERANGE > +The buffer was too small. > .El > .Pp > In addition, the > > Modified: head/lib/libc/stdlib/ptsname.c > ============================================================================== > --- head/lib/libc/stdlib/ptsname.c Sat Oct 17 01:06:04 2020 (r366780) > +++ head/lib/libc/stdlib/ptsname.c Sat Oct 17 04:14:38 2020 (r366781) > @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include "un-namespace.h" > > /* > @@ -71,23 +72,46 @@ __strong_reference(__isptmaster, grantpt); > __strong_reference(__isptmaster, unlockpt); > > /* > - * ptsname(): return the pathname of the slave pseudo-terminal device > - * associated with the specified master. > + * ptsname_r(): return the pathname of the slave pseudo-terminal device > + * associated with the specified master. > */ > -char * > -ptsname(int fildes) > +int > +ptsname_r(int fildes, char *buffer, size_t buflen) > { > - static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN] = _PATH_DEV; > - char *ret = NULL; > > + if (buflen <= sizeof(_PATH_DEV)) { > + errno = ERANGE; > + return (-1); > + } > + > /* Make sure fildes points to a master device. */ > if (__isptmaster(fildes) != 0) > - goto done; > + return (-1); > > - if (fdevname_r(fildes, pt_slave + (sizeof _PATH_DEV - 1), > - sizeof pt_slave - (sizeof _PATH_DEV - 1)) != NULL) > - ret = pt_slave; > + memcpy(buffer, _PATH_DEV, sizeof(_PATH_DEV)); > + buffer += sizeof(_PATH_DEV) - 1; > + buflen -= sizeof(_PATH_DEV) - 1; > > -done: > - return (ret); > + if (fdevname_r(fildes, buffer, buflen) == NULL) { > + if (errno == EINVAL) > + errno = ERANGE; > + return (-1); > + } > + > + return (0); > +} > + > +/* > + * ptsname(): return the pathname of the slave pseudo-terminal device > + * associated with the specified master. > + */ > +char * > +ptsname(int fildes) > +{ > + static char pt_slave[sizeof _PATH_DEV + SPECNAMELEN]; We usually write sizeof(_PATH_DEV). > + > + if (ptsname_r(fildes, pt_slave, sizeof(pt_slave)) == 0) Since ptsname_r is non-standard and exported, userspace is allowed to interpose the symbol, which would break ptsname(). > + return (pt_slave); > + else 'else' is redundand. > + return (NULL); > } From owner-svn-src-head@freebsd.org Sat Oct 17 08:47:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 948F242FD93; Sat, 17 Oct 2020 08:47:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCxTn3RVLz3ZvH; Sat, 17 Oct 2020 08:47:09 +0000 (UTC) (envelope-from mjg@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 5900B1EE4B; Sat, 17 Oct 2020 08:47:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09H8l9PL063170; Sat, 17 Oct 2020 08:47:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09H8l928063169; Sat, 17 Oct 2020 08:47:09 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010170847.09H8l928063169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Oct 2020 08:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366783 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 366783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 08:47:09 -0000 Author: mjg Date: Sat Oct 17 08:47:08 2020 New Revision: 366783 URL: https://svnweb.freebsd.org/changeset/base/366783 Log: vfs: annotate mountlist_mtx with __exclusive_cache_line Modified: head/sys/kern/vfs_mount.c head/sys/sys/mount.h Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sat Oct 17 04:14:46 2020 (r366782) +++ head/sys/kern/vfs_mount.c Sat Oct 17 08:47:08 2020 (r366783) @@ -96,7 +96,7 @@ static uma_zone_t mount_zone; struct mntlist mountlist = TAILQ_HEAD_INITIALIZER(mountlist); /* For any iteration/modification of mountlist */ -struct mtx mountlist_mtx; +struct mtx_padalign __exclusive_cache_line mountlist_mtx; MTX_SYSINIT(mountlist, &mountlist_mtx, "mountlist", MTX_DEF); EVENTHANDLER_LIST_DEFINE(vfs_mounted); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sat Oct 17 04:14:46 2020 (r366782) +++ head/sys/sys/mount.h Sat Oct 17 08:47:08 2020 (r366783) @@ -997,7 +997,7 @@ int vfs_suser(struct mount *, struct thread *); void vfs_unbusy(struct mount *); void vfs_unmountall(void); extern TAILQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */ -extern struct mtx mountlist_mtx; +extern struct mtx_padalign mountlist_mtx; extern struct nfs_public nfs_pub; extern struct sx vfsconf_sx; #define vfsconf_lock() sx_xlock(&vfsconf_sx) From owner-svn-src-head@freebsd.org Sat Oct 17 08:48:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D3FC42FAF1; Sat, 17 Oct 2020 08:48:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCxWP2Jnrz3b2K; Sat, 17 Oct 2020 08:48:33 +0000 (UTC) (envelope-from mjg@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 32B9B1EE4C; Sat, 17 Oct 2020 08:48:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09H8mXLw063269; Sat, 17 Oct 2020 08:48:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09H8mXHr063268; Sat, 17 Oct 2020 08:48:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010170848.09H8mXHr063268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Oct 2020 08:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366784 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 08:48:33 -0000 Author: mjg Date: Sat Oct 17 08:48:32 2020 New Revision: 366784 URL: https://svnweb.freebsd.org/changeset/base/366784 Log: cache: remove entries before trying to add new ones, not after Should allow positive entries to replace negative ones in case the cache is full. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 17 08:47:08 2020 (r366783) +++ head/sys/kern/vfs_cache.c Sat Oct 17 08:48:32 2020 (r366784) @@ -1923,8 +1923,21 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, /* * Avoid blowout in namecache entries. + * + * Bugs: + * 1. filesystems may end up tryng to add an already existing entry + * (for example this can happen after a cache miss during concurrent + * lookup), in which case we will call cache_negative_zap_one despite + * not adding anything. + * 2. the routine may fail to free anything and no provisions are made + * to make it try harder (see the inside for failure modes) + * 3. it only ever looks at negative entries. */ lnumcache = atomic_fetchadd_long(&numcache, 1) + 1; + if (numneg * ncnegfactor > lnumcache) { + cache_negative_zap_one(); + lnumcache = atomic_load_long(&numcache); + } if (__predict_false(lnumcache >= ncsize)) { atomic_subtract_long(&numcache, 1); counter_u64_add(numdrops, 1); @@ -2087,8 +2100,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, atomic_store_char(&ncp->nc_flag, ncp->nc_flag & ~NCF_WIP); cache_enter_unlock(&cel); - if (numneg * ncnegfactor > lnumcache) - cache_negative_zap_one(); if (ndd != NULL) cache_free(ndd); return; From owner-svn-src-head@freebsd.org Sat Oct 17 08:48:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C3F042FE7F; Sat, 17 Oct 2020 08:48:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCxWt6Gczz3bL5; Sat, 17 Oct 2020 08:48:58 +0000 (UTC) (envelope-from mjg@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 A26CF1EE4D; Sat, 17 Oct 2020 08:48:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09H8mwIe063331; Sat, 17 Oct 2020 08:48:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09H8mwOc063330; Sat, 17 Oct 2020 08:48:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010170848.09H8mwOc063330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Oct 2020 08:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366785 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 08:48:59 -0000 Author: mjg Date: Sat Oct 17 08:48:58 2020 New Revision: 366785 URL: https://svnweb.freebsd.org/changeset/base/366785 Log: cache: rework parts of negative entry management - declutter sysctl vfs.cache by moving relevant entries into vfs.cache.neg - add a little more parallelism to eviction by replacing the global lock with an atomically modified counter - track more statistics The code needs further effort. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 17 08:48:32 2020 (r366784) +++ head/sys/kern/vfs_cache.c Sat Oct 17 08:48:58 2020 (r366785) @@ -113,7 +113,7 @@ SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct v "struct vnode *"); SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *", "char *"); -SDT_PROBE_DEFINE2(vfs, namecache, shrink_negative, done, "struct vnode *", +SDT_PROBE_DEFINE2(vfs, namecache, evict_negative, done, "struct vnode *", "char *"); SDT_PROBE_DEFINE3(vfs, fplookup, lookup, done, "struct nameidata", "int", "bool"); @@ -251,9 +251,6 @@ cache_ncp_canuse(struct namecache *ncp) * bucketlock mtx for access to given set of hash buckets * neglist mtx negative entry LRU management * - * Additionally, ncneg_shrink_lock mtx is used to have at most one thread - * shrinking the LRU list. - * * It is legal to take multiple vnodelock and bucketlock locks. The locking * order is lower address first. Both are recursive. * @@ -305,13 +302,14 @@ static bool __read_frequently cache_fast_revlookup = t SYSCTL_BOOL(_vfs, OID_AUTO, cache_fast_revlookup, CTLFLAG_RW, &cache_fast_revlookup, 0, ""); -static struct mtx __exclusive_cache_line ncneg_shrink_lock; +static u_int __exclusive_cache_line neg_cycle; #define ncneghash 3 #define numneglists (ncneghash + 1) struct neglist { - struct mtx nl_lock; + struct mtx nl_evict_lock; + struct mtx nl_lock __aligned(CACHE_LINE_SIZE); TAILQ_HEAD(, namecache) nl_list; TAILQ_HEAD(, namecache) nl_hotlist; u_long nl_hotnum; @@ -473,10 +471,6 @@ static long zap_and_exit_bucket_fail2; STATNODE_ULONG( static long cache_lock_vnodes_cel_3_failures; STATNODE_ULONG(cache_lock_vnodes_cel_3_failures, "Number of times 3-way vnode locking failed"); -STATNODE_COUNTER(numneg_evicted, - "Number of negative entries evicted when adding a new entry"); -STATNODE_COUNTER(shrinking_skipped, - "Number of times shrinking was already in progress"); static void cache_zap_locked(struct namecache *ncp); static int vn_fullpath_hardlink(struct nameidata *ndp, char **retbuf, @@ -683,21 +677,6 @@ SYSCTL_PROC(_vfs_cache, OID_AUTO, nchstats, CTLTYPE_OP CTLFLAG_MPSAFE, 0, 0, sysctl_nchstats, "LU", "VFS cache effectiveness statistics"); -static int -sysctl_hotnum(SYSCTL_HANDLER_ARGS) -{ - int i, out; - - out = 0; - for (i = 0; i < numneglists; i++) - out += neglists[i].nl_hotnum; - - return (SYSCTL_OUT(req, &out, sizeof(out))); -} -SYSCTL_PROC(_vfs_cache, OID_AUTO, hotnum, CTLTYPE_INT | CTLFLAG_RD | - CTLFLAG_MPSAFE, 0, 0, sysctl_hotnum, "I", - "Number of hot negative entries"); - #ifdef DIAGNOSTIC /* * Grab an atomic snapshot of the name cache hash chain lengths @@ -792,27 +771,77 @@ SYSCTL_PROC(_debug_hashstat, OID_AUTO, nchash, CTLTYPE /* * Negative entries management * - * A variation of LRU scheme is used. New entries are hashed into one of - * numneglists cold lists. Entries get promoted to the hot list on first hit. + * Various workloads create plenty of negative entries and barely use them + * afterwards. Moreover malicious users can keep performing bogus lookups + * adding even more entries. For example "make tinderbox" as of writing this + * comment ends up with 2.6M namecache entries in total, 1.2M of which are + * negative. * - * The shrinker will demote hot list head and evict from the cold list in a - * round-robin manner. + * As such, a rather aggressive eviction method is needed. The currently + * employed method is a placeholder. + * + * Entries are split over numneglists separate lists, each of which is further + * split into hot and cold entries. Entries get promoted after getting a hit. + * Eviction happens on addition of new entry. */ +static SYSCTL_NODE(_vfs_cache, OID_AUTO, neg, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Name cache negative entry statistics"); + +SYSCTL_ULONG(_vfs_cache_neg, OID_AUTO, count, CTLFLAG_RD, &numneg, 0, + "Number of negative cache entries"); + +static COUNTER_U64_DEFINE_EARLY(neg_created); +SYSCTL_COUNTER_U64(_vfs_cache_neg, OID_AUTO, created, CTLFLAG_RD, &neg_created, + "Number of created negative entries"); + +static COUNTER_U64_DEFINE_EARLY(neg_evicted); +SYSCTL_COUNTER_U64(_vfs_cache_neg, OID_AUTO, evicted, CTLFLAG_RD, &neg_evicted, + "Number of evicted negative entries"); + +static COUNTER_U64_DEFINE_EARLY(neg_evict_skipped_empty); +SYSCTL_COUNTER_U64(_vfs_cache_neg, OID_AUTO, evict_skipped_empty, CTLFLAG_RD, + &neg_evict_skipped_empty, + "Number of times evicting failed due to lack of entries"); + +static COUNTER_U64_DEFINE_EARLY(neg_evict_skipped_contended); +SYSCTL_COUNTER_U64(_vfs_cache_neg, OID_AUTO, evict_skipped_contended, CTLFLAG_RD, + &neg_evict_skipped_contended, + "Number of times evicting failed due to contention"); + +SYSCTL_COUNTER_U64(_vfs_cache_neg, OID_AUTO, hits, CTLFLAG_RD, &numneghits, + "Number of cache hits (negative)"); + +static int +sysctl_neg_hot(SYSCTL_HANDLER_ARGS) +{ + int i, out; + + out = 0; + for (i = 0; i < numneglists; i++) + out += neglists[i].nl_hotnum; + + return (SYSCTL_OUT(req, &out, sizeof(out))); +} +SYSCTL_PROC(_vfs_cache_neg, OID_AUTO, hot, CTLTYPE_INT | CTLFLAG_RD | + CTLFLAG_MPSAFE, 0, 0, sysctl_neg_hot, "I", + "Number of hot negative entries"); + static void -cache_negative_init(struct namecache *ncp) +cache_neg_init(struct namecache *ncp) { struct negstate *ns; ncp->nc_flag |= NCF_NEGATIVE; ns = NCP2NEGSTATE(ncp); ns->neg_flag = 0; + counter_u64_add(neg_created, 1); } /* * Move a negative entry to the hot list. */ static void -cache_negative_promote(struct namecache *ncp) +cache_neg_promote(struct namecache *ncp) { struct neglist *nl; struct negstate *ns; @@ -838,7 +867,7 @@ cache_negative_promote(struct namecache *ncp) * up again. */ static bool -cache_negative_promote_cond(struct vnode *dvp, struct componentname *cnp, +cache_neg_promote_cond(struct vnode *dvp, struct componentname *cnp, struct namecache *oncp, uint32_t hash) { struct namecache *ncp; @@ -896,7 +925,7 @@ cache_negative_promote_cond(struct vnode *dvp, struct goto out_abort; } - cache_negative_promote(ncp); + cache_neg_promote(ncp); SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); counter_u64_add(numneghits, 1); @@ -910,7 +939,7 @@ out_abort: } static void -cache_negative_hit(struct namecache *ncp) +cache_neg_hit(struct namecache *ncp) { struct neglist *nl; struct negstate *ns; @@ -920,12 +949,12 @@ cache_negative_hit(struct namecache *ncp) return; nl = NCP2NEGLIST(ncp); mtx_lock(&nl->nl_lock); - cache_negative_promote(ncp); + cache_neg_promote(ncp); mtx_unlock(&nl->nl_lock); } static void -cache_negative_insert(struct namecache *ncp) +cache_neg_insert(struct namecache *ncp) { struct neglist *nl; @@ -939,7 +968,7 @@ cache_negative_insert(struct namecache *ncp) } static void -cache_negative_remove(struct namecache *ncp) +cache_neg_remove(struct namecache *ncp) { struct neglist *nl; struct negstate *ns; @@ -959,30 +988,22 @@ cache_negative_remove(struct namecache *ncp) } static struct neglist * -cache_negative_shrink_select(void) +cache_neg_evict_select(void) { struct neglist *nl; - static u_int cycle; - u_int i; + u_int c; - cycle++; - for (i = 0; i < numneglists; i++) { - nl = &neglists[(cycle + i) % numneglists]; - if (TAILQ_FIRST(&nl->nl_list) == NULL && - TAILQ_FIRST(&nl->nl_hotlist) == NULL) - continue; - mtx_lock(&nl->nl_lock); - if (TAILQ_FIRST(&nl->nl_list) != NULL || - TAILQ_FIRST(&nl->nl_hotlist) != NULL) - return (nl); - mtx_unlock(&nl->nl_lock); + c = atomic_fetchadd_int(&neg_cycle, 1) + 1; + nl = &neglists[c % numneglists]; + if (!mtx_trylock(&nl->nl_evict_lock)) { + counter_u64_add(neg_evict_skipped_contended, 1); + return (NULL); } - - return (NULL); + return (nl); } static void -cache_negative_zap_one(void) +cache_neg_evict(void) { struct namecache *ncp, *ncp2; struct neglist *nl; @@ -990,18 +1011,12 @@ cache_negative_zap_one(void) struct mtx *dvlp; struct mtx *blp; - if (mtx_owner(&ncneg_shrink_lock) != NULL || - !mtx_trylock(&ncneg_shrink_lock)) { - counter_u64_add(shrinking_skipped, 1); - return; - } - - nl = cache_negative_shrink_select(); - mtx_unlock(&ncneg_shrink_lock); + nl = cache_neg_evict_select(); if (nl == NULL) { return; } + mtx_lock(&nl->nl_lock); ncp = TAILQ_FIRST(&nl->nl_hotlist); if (ncp != NULL) { ns = NCP2NEGSTATE(ncp); @@ -1011,11 +1026,17 @@ cache_negative_zap_one(void) ns->neg_flag &= ~NEG_HOT; } ncp = TAILQ_FIRST(&nl->nl_list); - MPASS(ncp != NULL); + if (ncp == NULL) { + counter_u64_add(neg_evict_skipped_empty, 1); + mtx_unlock(&nl->nl_lock); + mtx_unlock(&nl->nl_evict_lock); + return; + } ns = NCP2NEGSTATE(ncp); dvlp = VP2VNODELOCK(ncp->nc_dvp); blp = NCP2BUCKETLOCK(ncp); mtx_unlock(&nl->nl_lock); + mtx_unlock(&nl->nl_evict_lock); mtx_lock(dvlp); mtx_lock(blp); /* @@ -1031,10 +1052,10 @@ cache_negative_zap_one(void) ncp = NULL; } else { vfs_smr_exit(); - SDT_PROBE2(vfs, namecache, shrink_negative, done, ncp->nc_dvp, + SDT_PROBE2(vfs, namecache, evict_negative, done, ncp->nc_dvp, ncp->nc_name); cache_zap_locked(ncp); - counter_u64_add(numneg_evicted, 1); + counter_u64_add(neg_evicted, 1); } mtx_unlock(blp); mtx_unlock(dvlp); @@ -1074,7 +1095,7 @@ cache_zap_locked(struct namecache *ncp) } else { SDT_PROBE2(vfs, namecache, zap_negative, done, ncp->nc_dvp, ncp->nc_name); - cache_negative_remove(ncp); + cache_neg_remove(ncp); } if (ncp->nc_flag & NCF_ISDOTDOT) { if (ncp == ncp->nc_dvp->v_cache_dd) { @@ -1414,7 +1435,7 @@ negative_success: cache_out_ts(ncp, tsp, ticksp); counter_u64_add(numneghits, 1); whiteout = (ncp->nc_flag & NCF_WHITE); - cache_negative_hit(ncp); + cache_neg_hit(ncp); mtx_unlock(dvlp); if (whiteout) cnp->cn_flags |= ISWHITEOUT; @@ -1525,7 +1546,7 @@ negative_success: cache_out_ts(ncp, tsp, ticksp); counter_u64_add(numneghits, 1); whiteout = (ncp->nc_flag & NCF_WHITE); - cache_negative_hit(ncp); + cache_neg_hit(ncp); mtx_unlock(blp); if (whiteout) cnp->cn_flags |= ISWHITEOUT; @@ -1628,7 +1649,7 @@ negative_success: } if (!neg_hot) { vfs_smr_exit(); - if (!cache_negative_promote_cond(dvp, cnp, ncp, hash)) + if (!cache_neg_promote_cond(dvp, cnp, ncp, hash)) goto out_fallback; } else { SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); @@ -1927,15 +1948,15 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * Bugs: * 1. filesystems may end up tryng to add an already existing entry * (for example this can happen after a cache miss during concurrent - * lookup), in which case we will call cache_negative_zap_one despite - * not adding anything. + * lookup), in which case we will call cache_neg_evict despite not + * adding anything. * 2. the routine may fail to free anything and no provisions are made * to make it try harder (see the inside for failure modes) * 3. it only ever looks at negative entries. */ lnumcache = atomic_fetchadd_long(&numcache, 1) + 1; if (numneg * ncnegfactor > lnumcache) { - cache_negative_zap_one(); + cache_neg_evict(); lnumcache = atomic_load_long(&numcache); } if (__predict_false(lnumcache >= ncsize)) { @@ -1956,7 +1977,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, ncp->nc_flag = flag | NCF_WIP; ncp->nc_vp = vp; if (vp == NULL) - cache_negative_init(ncp); + cache_neg_init(ncp); ncp->nc_dvp = dvp; if (tsp != NULL) { ncp_ts = __containerof(ncp, struct namecache_ts, nc_nc); @@ -2081,7 +2102,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, } else { if (cnp->cn_flags & ISWHITEOUT) ncp->nc_flag |= NCF_WHITE; - cache_negative_insert(ncp); + cache_neg_insert(ncp); SDT_PROBE2(vfs, namecache, enter_negative, done, dvp, ncp->nc_name); } @@ -2183,12 +2204,11 @@ nchinit(void *dummy __unused) mtx_init(&vnodelocks[i], "ncvn", NULL, MTX_DUPOK | MTX_RECURSE); for (i = 0; i < numneglists; i++) { + mtx_init(&neglists[i].nl_evict_lock, "ncnege", NULL, MTX_DEF); mtx_init(&neglists[i].nl_lock, "ncnegl", NULL, MTX_DEF); TAILQ_INIT(&neglists[i].nl_list); TAILQ_INIT(&neglists[i].nl_hotlist); } - - mtx_init(&ncneg_shrink_lock, "ncnegs", NULL, MTX_DEF); } SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nchinit, NULL); @@ -3485,7 +3505,7 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, dvp = fpl->dvp; cache_fpl_smr_exit(fpl); - if (cache_negative_promote_cond(dvp, cnp, oncp, hash)) + if (cache_neg_promote_cond(dvp, cnp, oncp, hash)) return (cache_fpl_handled(fpl, ENOENT)); else return (cache_fpl_aborted(fpl)); From owner-svn-src-head@freebsd.org Sat Oct 17 11:27:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B27F433A7A; Sat, 17 Oct 2020 11:27:18 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward500p.mail.yandex.net (forward500p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:110]) (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 4CD12Y3Tsxz41HB; Sat, 17 Oct 2020 11:27:16 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback9o.mail.yandex.net (mxback9o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::23]) by forward500p.mail.yandex.net (Yandex) with ESMTP id C172F940247; Sat, 17 Oct 2020 14:27:12 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback9o.mail.yandex.net (mxback/Yandex) with ESMTP id NNGt6pZhqK-RBE0Ocxc; Sat, 17 Oct 2020 14:27:11 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1602934031; bh=KwTTmpRzH8UGuLTQ8+auxgiLi5NLbifIG3mgSJ7D8LM=; h=References:Date:Message-Id:Subject:In-Reply-To:To:From; b=G4mkrtWCJo7uviRJmfnLnlFI2nvYY0qQpG3jiAmcp4TPAZ0P2sFZbF7N+GB09BM0R pRjM0PY9KkLvIklC58ojf5soe7y+vovc1ciW63qS0pOQC6W4jH7yhwHS4mepQg9zMA WhcxlWIBlg6lg3OcoQTFG5yDLqWD33ONhXXLYaHw= Received: by sas1-ffdbcd5f1d77.qloud-c.yandex.net with HTTP; Sat, 17 Oct 2020 14:27:11 +0300 From: Alexander V. Chernikov To: Emmanuel Vadot , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <202010021826.092IQfdj023808@repo.freebsd.org> References: <202010021826.092IQfdj023808@repo.freebsd.org> Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 17 Oct 2020 12:27:11 +0100 Message-Id: <44421602932538@mail.yandex.ru> X-Rspamd-Queue-Id: 4CD12Y3Tsxz41HB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ipfw.ru header.s=mail header.b=G4mkrtWC; dmarc=none; spf=pass (mx1.freebsd.org: domain of melifaro@ipfw.ru designates 2a02:6b8:0:1472:2741:0:8b7:110 as permitted sender) smtp.mailfrom=melifaro@ipfw.ru X-Spamd-Result: default: False [-2.97 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[ipfw.ru:s=mail]; FREEFALL_USER(0.00)[melifaro]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.976]; R_SPF_ALLOW(-0.20)[+ip6:2a02:6b8:0:1000::/52]; DMARC_NA(0.00)[ipfw.ru]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-1.05)[-1.047]; DKIM_TRACE(0.00)[ipfw.ru:+]; MIME_BASE64_TEXT(0.10)[]; NEURAL_HAM_SHORT(-0.75)[-0.749]; MIME_HTML_ONLY(0.20)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13238, ipnet:2a02:6b8::/32, country:RU]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_IN_DNSWL_LOW(-0.10)[2a02:6b8:0:1472:2741:0:8b7:110:from] MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 11:27:18 -0000 From owner-svn-src-head@freebsd.org Sat Oct 17 11:32:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C57FD434148; Sat, 17 Oct 2020 11:32:08 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD1880C9sz41ZZ; Sat, 17 Oct 2020 11:32:07 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 8510B260170; Sat, 17 Oct 2020 13:31:59 +0200 (CEST) Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf To: "Alexander V. Chernikov" , Emmanuel Vadot , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> From: Hans Petter Selasky Message-ID: Date: Sat, 17 Oct 2020 13:31:22 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <44421602932538@mail.yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CD1880C9sz41ZZ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.25 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; ARC_NA(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-0.97)[-0.968]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.01)[0.007]; NEURAL_HAM_MEDIUM(-0.99)[-0.989]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 11:32:08 -0000 On 2020-10-17 13:27, Alexander V. Chernikov wrote: > 02.10.2020, 19:26, "Emmanuel Vadot" : > > Author: manu > Date: Fri Oct 2 18:26:41 2020 > New Revision: 366372 > URL: https://svnweb.freebsd.org/changeset/base/366372 > > Log: > linuxkpi: Add backlight support > > Add backlight function to linuxkpi. > Graphics drivers expose the backlight of the panel directly so allow them > to use the backlight subsystem so > user can use backlight(8) to configure them. > > Reviewed by: hselasky > Relnotes: yes > Differential Revision: The FreeBSD Foundation > > Added: > head/sys/compat/linuxkpi/common/include/linux/backlight.h (contents, > props changed) > Modified: > head/sys/compat/linuxkpi/common/include/linux/device.h > head/sys/compat/linuxkpi/common/src/linux_kmod.c > head/sys/compat/linuxkpi/common/src/linux_pci.c > head/sys/conf/kmod.mk > > It breaks the build for me with > /usr/home/melifaro/free/head/sys/compat/linuxkpi/common/src/linux_pci.c:70:10: > fatal error: 'backlight_if.h' file not found How do you build? Doesn't break over here. Maybe you need to do a clean first? --HPS From owner-svn-src-head@freebsd.org Sat Oct 17 12:34:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12B16436C02; Sat, 17 Oct 2020 12:34:37 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward500j.mail.yandex.net (forward500j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::110]) (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 4CD2XC4sRhz45Hm; Sat, 17 Oct 2020 12:34:35 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback20o.mail.yandex.net (mxback20o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::71]) by forward500j.mail.yandex.net (Yandex) with ESMTP id 189AB11C152C; Sat, 17 Oct 2020 15:34:31 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback20o.mail.yandex.net (mxback/Yandex) with ESMTP id fdNAQuM8Vf-YU40tl4G; Sat, 17 Oct 2020 15:34:30 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1602938070; bh=sCRt2eEuFXmvqj0floOB9UZXbOBEuCM/1q2g39EF3cI=; h=References:Date:Message-Id:Subject:In-Reply-To:To:From; b=TqLA02jVSJEZopNG2ziyr9yndkW9E/ZgjPvEEHW/Ym92kssm447HbmFBfnFwTrxbv efg5KhH+jVVMeQNYLOwV8jelwdgq7yShkzwEtNyeCqEDVtXTiS2foK8kxRJDSo0U3P e5LwQuo312BKthXbf9uKJry4a3rSkQFTiQxeBiyo= Received: by sas1-ffdbcd5f1d77.qloud-c.yandex.net with HTTP; Sat, 17 Oct 2020 15:34:29 +0300 From: Alexander V. Chernikov To: Hans Petter Selasky , Emmanuel Vadot , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 17 Oct 2020 13:34:29 +0100 Message-Id: <43251602934532@mail.yandex.ru> X-Rspamd-Queue-Id: 4CD2XC4sRhz45Hm X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ipfw.ru header.s=mail header.b=TqLA02jV; dmarc=none; spf=pass (mx1.freebsd.org: domain of melifaro@ipfw.ru designates 2a02:6b8:0:801:2::110 as permitted sender) smtp.mailfrom=melifaro@ipfw.ru X-Spamd-Result: default: False [-3.25 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[ipfw.ru:s=mail]; FREEFALL_USER(0.00)[melifaro]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a02:6b8:0::/52]; NEURAL_HAM_LONG(-0.98)[-0.981]; DMARC_NA(0.00)[ipfw.ru]; NEURAL_HAM_MEDIUM(-0.89)[-0.888]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[ipfw.ru:+]; MIME_BASE64_TEXT(0.10)[]; NEURAL_HAM_SHORT(-1.18)[-1.178]; MIME_HTML_ONLY(0.20)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13238, ipnet:2a02:6b8::/32, country:RU]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_IN_DNSWL_LOW(-0.10)[2a02:6b8:0:801:2::110:from] MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 12:34:37 -0000 From owner-svn-src-head@freebsd.org Sat Oct 17 13:04:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0CCD4377D0; Sat, 17 Oct 2020 13:04:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD3Bd5bBVz46kc; Sat, 17 Oct 2020 13:04:25 +0000 (UTC) (envelope-from mjg@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 A415921B7F; Sat, 17 Oct 2020 13:04:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09HD4PqU023482; Sat, 17 Oct 2020 13:04:25 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09HD4PO6023481; Sat, 17 Oct 2020 13:04:25 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010171304.09HD4PO6023481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Oct 2020 13:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366791 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 13:04:25 -0000 Author: mjg Date: Sat Oct 17 13:04:25 2020 New Revision: 366791 URL: https://svnweb.freebsd.org/changeset/base/366791 Log: cache: avoid smr in cache_neg_evict in favoro of the already held bucket lock Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 17 09:51:17 2020 (r366790) +++ head/sys/kern/vfs_cache.c Sat Oct 17 13:04:25 2020 (r366791) @@ -803,6 +803,11 @@ SYSCTL_COUNTER_U64(_vfs_cache_neg, OID_AUTO, evict_ski &neg_evict_skipped_empty, "Number of times evicting failed due to lack of entries"); +static COUNTER_U64_DEFINE_EARLY(neg_evict_skipped_missed); +SYSCTL_COUNTER_U64(_vfs_cache_neg, OID_AUTO, evict_skipped_missed, CTLFLAG_RD, + &neg_evict_skipped_missed, + "Number of times evicting failed due to target entry disappearing"); + static COUNTER_U64_DEFINE_EARLY(neg_evict_skipped_contended); SYSCTL_COUNTER_U64(_vfs_cache_neg, OID_AUTO, evict_skipped_contended, CTLFLAG_RD, &neg_evict_skipped_contended, @@ -1008,8 +1013,11 @@ cache_neg_evict(void) struct namecache *ncp, *ncp2; struct neglist *nl; struct negstate *ns; + struct vnode *dvp; struct mtx *dvlp; struct mtx *blp; + uint32_t hash; + u_char nlen; nl = cache_neg_evict_select(); if (nl == NULL) { @@ -1033,25 +1041,30 @@ cache_neg_evict(void) return; } ns = NCP2NEGSTATE(ncp); - dvlp = VP2VNODELOCK(ncp->nc_dvp); - blp = NCP2BUCKETLOCK(ncp); + nlen = ncp->nc_nlen; + dvp = ncp->nc_dvp; + hash = cache_get_hash(ncp->nc_name, nlen, dvp); + dvlp = VP2VNODELOCK(dvp); + blp = HASH2BUCKETLOCK(hash); mtx_unlock(&nl->nl_lock); mtx_unlock(&nl->nl_evict_lock); mtx_lock(dvlp); mtx_lock(blp); /* - * Enter SMR to safely check the negative list. - * Even if the found pointer matches, the entry may now be reallocated - * and used by a different vnode. + * Note that since all locks were dropped above, the entry may be + * gone or reallocated to be something else. */ - vfs_smr_enter(); - ncp2 = TAILQ_FIRST(&nl->nl_list); - if (ncp != ncp2 || dvlp != VP2VNODELOCK(ncp2->nc_dvp) || - blp != NCP2BUCKETLOCK(ncp2)) { - vfs_smr_exit(); + CK_SLIST_FOREACH(ncp2, (NCHHASH(hash)), nc_hash) { + if (ncp2 == ncp && ncp2->nc_dvp == dvp && + ncp2->nc_nlen == nlen && (ncp2->nc_flag & NCF_NEGATIVE) != 0) + break; + } + if (ncp2 == NULL) { + counter_u64_add(neg_evict_skipped_missed, 1); ncp = NULL; } else { - vfs_smr_exit(); + MPASS(dvlp == VP2VNODELOCK(ncp->nc_dvp)); + MPASS(blp == NCP2BUCKETLOCK(ncp)); SDT_PROBE2(vfs, namecache, evict_negative, done, ncp->nc_dvp, ncp->nc_name); cache_zap_locked(ncp); From owner-svn-src-head@freebsd.org Sat Oct 17 13:04:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF28D4377DE; Sat, 17 Oct 2020 13:04:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD3C70pdwz4771; Sat, 17 Oct 2020 13:04:51 +0000 (UTC) (envelope-from mjg@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 8B3BD21CB7; Sat, 17 Oct 2020 13:04:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09HD4kOv023690; Sat, 17 Oct 2020 13:04:46 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09HD4kBo023689; Sat, 17 Oct 2020 13:04:46 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010171304.09HD4kBo023689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Oct 2020 13:04:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366792 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 13:04:51 -0000 Author: mjg Date: Sat Oct 17 13:04:46 2020 New Revision: 366792 URL: https://svnweb.freebsd.org/changeset/base/366792 Log: cache: factor negative lookup out of cache_fplookup_next Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 17 13:04:25 2020 (r366791) +++ head/sys/kern/vfs_cache.c Sat Oct 17 13:04:46 2020 (r366792) @@ -3815,16 +3815,53 @@ cache_fplookup_dotdot(struct cache_fpl *fpl) return (0); } +static int __noinline +cache_fplookup_neg(struct cache_fpl *fpl, struct namecache *ncp, uint32_t hash) +{ + struct negstate *ns; + struct vnode *dvp; + u_char nc_flag; + bool neg_hot; + + dvp = fpl->dvp; + nc_flag = atomic_load_char(&ncp->nc_flag); + MPASS((nc_flag & NCF_NEGATIVE) != 0); + /* + * If they want to create an entry we need to replace this one. + */ + if (__predict_false(fpl->cnp->cn_nameiop != LOOKUP)) { + /* + * TODO + * This should call something similar to + * cache_fplookup_final_modifying. + */ + return (cache_fpl_partial(fpl)); + } + ns = NCP2NEGSTATE(ncp); + neg_hot = ((ns->neg_flag & NEG_HOT) != 0); + if (__predict_false(!cache_ncp_canuse(ncp))) { + return (cache_fpl_partial(fpl)); + } + if (__predict_false((nc_flag & NCF_WHITE) != 0)) { + return (cache_fpl_partial(fpl)); + } + if (!neg_hot) { + return (cache_fplookup_negative_promote(fpl, ncp, hash)); + } + SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); + counter_u64_add(numneghits, 1); + cache_fpl_smr_exit(fpl); + return (cache_fpl_handled(fpl, ENOENT)); +} + static int cache_fplookup_next(struct cache_fpl *fpl) { struct componentname *cnp; struct namecache *ncp; - struct negstate *ns; struct vnode *dvp, *tvp; u_char nc_flag; uint32_t hash; - bool neg_hot; cnp = fpl->cnp; dvp = fpl->dvp; @@ -3853,28 +3890,7 @@ cache_fplookup_next(struct cache_fpl *fpl) tvp = atomic_load_ptr(&ncp->nc_vp); nc_flag = atomic_load_char(&ncp->nc_flag); if ((nc_flag & NCF_NEGATIVE) != 0) { - /* - * If they want to create an entry we need to replace this one. - */ - if (__predict_false(fpl->cnp->cn_nameiop != LOOKUP)) { - return (cache_fpl_partial(fpl)); - } - ns = NCP2NEGSTATE(ncp); - neg_hot = ((ns->neg_flag & NEG_HOT) != 0); - if (__predict_false(!cache_ncp_canuse(ncp))) { - return (cache_fpl_partial(fpl)); - } - if (__predict_false((nc_flag & NCF_WHITE) != 0)) { - return (cache_fpl_partial(fpl)); - } - if (!neg_hot) { - return (cache_fplookup_negative_promote(fpl, ncp, hash)); - } - SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, - ncp->nc_name); - counter_u64_add(numneghits, 1); - cache_fpl_smr_exit(fpl); - return (cache_fpl_handled(fpl, ENOENT)); + return (cache_fplookup_neg(fpl, ncp, hash)); } if (__predict_false(!cache_ncp_canuse(ncp))) { From owner-svn-src-head@freebsd.org Sat Oct 17 13:06:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2793437BDA; Sat, 17 Oct 2020 13:06:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD3F23bcnz47Hn; Sat, 17 Oct 2020 13:06:30 +0000 (UTC) (envelope-from mjg@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 600F721A5B; Sat, 17 Oct 2020 13:06:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09HD6UKV023966; Sat, 17 Oct 2020 13:06:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09HD6UxA023965; Sat, 17 Oct 2020 13:06:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010171306.09HD6UxA023965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Oct 2020 13:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366793 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 13:06:30 -0000 Author: mjg Date: Sat Oct 17 13:06:29 2020 New Revision: 366793 URL: https://svnweb.freebsd.org/changeset/base/366793 Log: cache: erwork sysctl vfs.cache tree Split everything into neg, debug, param and stat categories. The legacy nchstats sysctl (queried e.g., by systat) remains untouched. While here rename some vars to be easier on the eye. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 17 13:04:46 2020 (r366792) +++ head/sys/kern/vfs_cache.c Sat Oct 17 13:06:29 2020 (r366793) @@ -79,6 +79,9 @@ __FBSDID("$FreeBSD$"); #include +static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Name cache"); + SDT_PROVIDER_DECLARE(vfs); SDT_PROBE_DEFINE3(vfs, namecache, enter, done, "struct vnode *", "char *", "struct vnode *"); @@ -277,6 +280,21 @@ cache_ncp_canuse(struct namecache *ncp) VFS_SMR_DECLARE; +static SYSCTL_NODE(_vfs_cache, OID_AUTO, param, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Name cache parameters"); + +static u_int __read_mostly ncsize; /* the size as computed on creation or resizing */ +SYSCTL_UINT(_vfs_cache_param, OID_AUTO, size, CTLFLAG_RW, &ncsize, 0, + "Total namecache capacity"); + +u_int ncsizefactor = 2; +SYSCTL_UINT(_vfs_cache_param, OID_AUTO, sizefactor, CTLFLAG_RW, &ncsizefactor, 0, + "Size factor for namecache"); + +static u_long __read_mostly ncnegfactor = 5; /* ratio of negative entries */ +SYSCTL_ULONG(_vfs_cache_param, OID_AUTO, negfactor, CTLFLAG_RW, &ncnegfactor, 0, + "Ratio of negative namecache entries"); + /* * Structures associated with name caching. */ @@ -286,15 +304,8 @@ static __read_mostly CK_SLIST_HEAD(nchashhead, namecac static u_long __read_mostly nchash; /* size of hash table */ SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0, "Size of namecache hash table"); -static u_long __read_mostly ncnegfactor = 5; /* ratio of negative entries */ -SYSCTL_ULONG(_vfs, OID_AUTO, ncnegfactor, CTLFLAG_RW, &ncnegfactor, 0, - "Ratio of negative namecache entries"); static u_long __exclusive_cache_line numneg; /* number of negative entries allocated */ static u_long __exclusive_cache_line numcache;/* number of cache entries allocated */ -u_int ncsizefactor = 2; -SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor, CTLFLAG_RW, &ncsizefactor, 0, - "Size factor for namecache"); -static u_int __read_mostly ncsize; /* the size as computed on creation or resizing */ struct nchstats nchstats; /* cache effectiveness statistics */ @@ -433,43 +444,58 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG /* * The new name cache statistics */ -static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, +static SYSCTL_NODE(_vfs_cache, OID_AUTO, stats, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Name cache statistics"); -#define STATNODE_ULONG(name, descr) \ - SYSCTL_ULONG(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, 0, descr); -#define STATNODE_COUNTER(name, descr) \ - static COUNTER_U64_DEFINE_EARLY(name); \ - SYSCTL_COUNTER_U64(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, \ + +#define STATNODE_ULONG(name, varname, descr) \ + SYSCTL_ULONG(_vfs_cache_stats, OID_AUTO, name, CTLFLAG_RD, &varname, 0, descr); +#define STATNODE_COUNTER(name, varname, descr) \ + static COUNTER_U64_DEFINE_EARLY(varname); \ + SYSCTL_COUNTER_U64(_vfs_cache_stats, OID_AUTO, name, CTLFLAG_RD, &varname, \ descr); -STATNODE_ULONG(numneg, "Number of negative cache entries"); -STATNODE_ULONG(numcache, "Number of cache entries"); -STATNODE_COUNTER(numcachehv, "Number of namecache entries with vnodes held"); -STATNODE_COUNTER(numdrops, "Number of dropped entries due to reaching the limit"); -STATNODE_COUNTER(dothits, "Number of '.' hits"); -STATNODE_COUNTER(dotdothits, "Number of '..' hits"); -STATNODE_COUNTER(nummiss, "Number of cache misses"); -STATNODE_COUNTER(nummisszap, "Number of cache misses we do not want to cache"); -STATNODE_COUNTER(numposzaps, +STATNODE_ULONG(neg, numneg, "Number of negative cache entries"); +STATNODE_ULONG(count, numcache, "Number of cache entries"); +STATNODE_COUNTER(heldvnodes, numcachehv, "Number of namecache entries with vnodes held"); +STATNODE_COUNTER(drops, numdrops, "Number of dropped entries due to reaching the limit"); +STATNODE_COUNTER(dothits, dothits, "Number of '.' hits"); +STATNODE_COUNTER(dotdothis, dotdothits, "Number of '..' hits"); +STATNODE_COUNTER(miss, nummiss, "Number of cache misses"); +STATNODE_COUNTER(misszap, nummisszap, "Number of cache misses we do not want to cache"); +STATNODE_COUNTER(posszaps, numposzaps, "Number of cache hits (positive) we do not want to cache"); -STATNODE_COUNTER(numposhits, "Number of cache hits (positive)"); -STATNODE_COUNTER(numnegzaps, +STATNODE_COUNTER(poshits, numposhits, "Number of cache hits (positive)"); +STATNODE_COUNTER(negzaps, numnegzaps, "Number of cache hits (negative) we do not want to cache"); -STATNODE_COUNTER(numneghits, "Number of cache hits (negative)"); +STATNODE_COUNTER(neghits, numneghits, "Number of cache hits (negative)"); /* These count for vn_getcwd(), too. */ -STATNODE_COUNTER(numfullpathcalls, "Number of fullpath search calls"); -STATNODE_COUNTER(numfullpathfail1, "Number of fullpath search errors (ENOTDIR)"); -STATNODE_COUNTER(numfullpathfail2, +STATNODE_COUNTER(fullpathcalls, numfullpathcalls, "Number of fullpath search calls"); +STATNODE_COUNTER(fullpathfail1, numfullpathfail1, "Number of fullpath search errors (ENOTDIR)"); +STATNODE_COUNTER(fullpathfail2, numfullpathfail2, "Number of fullpath search errors (VOP_VPTOCNP failures)"); -STATNODE_COUNTER(numfullpathfail4, "Number of fullpath search errors (ENOMEM)"); -STATNODE_COUNTER(numfullpathfound, "Number of successful fullpath calls"); -STATNODE_COUNTER(zap_and_exit_bucket_relock_success, +STATNODE_COUNTER(fullpathfail4, numfullpathfail4, "Number of fullpath search errors (ENOMEM)"); +STATNODE_COUNTER(fullpathfound, numfullpathfound, "Number of successful fullpath calls"); + +/* + * Debug or developer statistics. + */ +static SYSCTL_NODE(_vfs_cache, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Name cache debugging"); +#define DEBUGNODE_ULONG(name, descr) \ + SYSCTL_ULONG(_vfs_cache_debug, OID_AUTO, name, CTLFLAG_RD, &name, 0, descr); +#define DEBUGNODE_COUNTER(name, descr) \ + static COUNTER_U64_DEFINE_EARLY(name); \ + SYSCTL_COUNTER_U64(_vfs_cache_debug, OID_AUTO, name, CTLFLAG_RD, &name, \ + descr); +DEBUGNODE_COUNTER(zap_and_exit_bucket_relock_success, "Number of successful removals after relocking"); -static long zap_and_exit_bucket_fail; STATNODE_ULONG(zap_and_exit_bucket_fail, +static long zap_and_exit_bucket_fail; +DEBUGNODE_ULONG(zap_and_exit_bucket_fail, "Number of times zap_and_exit failed to lock"); -static long zap_and_exit_bucket_fail2; STATNODE_ULONG(zap_and_exit_bucket_fail2, +static long zap_and_exit_bucket_fail2; +DEBUGNODE_ULONG(zap_and_exit_bucket_fail2, "Number of times zap_and_exit failed to lock"); static long cache_lock_vnodes_cel_3_failures; -STATNODE_ULONG(cache_lock_vnodes_cel_3_failures, +DEBUGNODE_ULONG(cache_lock_vnodes_cel_3_failures, "Number of times 3-way vnode locking failed"); static void cache_zap_locked(struct namecache *ncp); From owner-svn-src-head@freebsd.org Sat Oct 17 13:07:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 170DF437E35; Sat, 17 Oct 2020 13:07:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD3GB006Cz47Sx; Sat, 17 Oct 2020 13:07:29 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 5923A260170; Sat, 17 Oct 2020 15:07:22 +0200 (CEST) Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf To: "Alexander V. Chernikov" , Emmanuel Vadot , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> <43251602934532@mail.yandex.ru> From: Hans Petter Selasky Message-ID: Date: Sat, 17 Oct 2020 15:06:44 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <43251602934532@mail.yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CD3GB006Cz47Sx X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.28 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-0.97)[-0.967]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.10)[-0.098]; NEURAL_HAM_MEDIUM(-0.92)[-0.917]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 13:07:31 -0000 On 2020-10-17 14:34, Alexander V. Chernikov wrote: > 17.10.2020, 12:32, "Hans Petter Selasky" : > > On 2020-10-17 13:27, Alexander V. Chernikov wrote: > > 02.10.2020, 19:26, "Emmanuel Vadot" >: > > Author: manu > Date: Fri Oct 2 18:26:41 2020 > New Revision: 366372 > URL: https://svnweb.freebsd.org/changeset/base/366372 > > Log: > linuxkpi: Add backlight support > > Add backlight function to linuxkpi. > Graphics drivers expose the backlight of the panel directly so > allow them > to use the backlight subsystem so > user can use backlight(8) to configure them. > > Reviewed by: hselasky > Relnotes: yes > Differential Revision: The FreeBSD Foundation > > Added: > head/sys/compat/linuxkpi/common/include/linux/backlight.h > (contents, > props changed) > Modified: > head/sys/compat/linuxkpi/common/include/linux/device.h > head/sys/compat/linuxkpi/common/src/linux_kmod.c > head/sys/compat/linuxkpi/common/src/linux_pci.c > head/sys/conf/kmod.mk > > It breaks the build for me with > /usr/home/melifaro/free/head/sys/compat/linuxkpi/common/src/linux_pci.c:70:10: > fatal error: 'backlight_if.h' file not found > > > How do you build? Doesn't break over here. > > GENERIC + COMPAT_LINUXKPI. > Try adding: options backlight To the kernel config. --HPS From owner-svn-src-head@freebsd.org Sat Oct 17 16:11:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6792443C118; Sat, 17 Oct 2020 16:11:07 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward501p.mail.yandex.net (forward501p.mail.yandex.net [77.88.28.111]) (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 4CD7L1688nz4MfV; Sat, 17 Oct 2020 16:11:05 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback17o.mail.yandex.net (mxback17o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::68]) by forward501p.mail.yandex.net (Yandex) with ESMTP id 3E43D3500299; Sat, 17 Oct 2020 19:11:02 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback17o.mail.yandex.net (mxback/Yandex) with ESMTP id 5mGvx0lkBz-B1g4WtYp; Sat, 17 Oct 2020 19:11:01 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1602951061; bh=mv4OVCxEmQKpcJQvGtSUESiLsysG3KkzuzuMhpy4J1I=; h=References:Date:Message-Id:Subject:In-Reply-To:To:From; b=b1JF6PWvcm91gIVJ9B4c8VGwzq6HstQFMg77y4PgczjB4WHkYYEcu4oTTD4V4Cxjl Pqzr7ThNr1s7sM+JlgPQp4XcrrE4R2oMDKsopHbHKklf3iobjAp3oHNwMgaYbvP9CL Za/0EJXCh5PtTWw9UWLnXA4KxmKJWLBrcKCKDJDI= Received: by sas1-5cb23de04cc6.qloud-c.yandex.net with HTTP; Sat, 17 Oct 2020 19:11:01 +0300 From: Alexander V. Chernikov To: Hans Petter Selasky , Emmanuel Vadot , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> <43251602934532@mail.yandex.ru> Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 17 Oct 2020 17:11:01 +0100 Message-Id: <59021602950992@mail.yandex.ru> X-Rspamd-Queue-Id: 4CD7L1688nz4MfV X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ipfw.ru header.s=mail header.b=b1JF6PWv; dmarc=none; spf=pass (mx1.freebsd.org: domain of melifaro@ipfw.ru designates 77.88.28.111 as permitted sender) smtp.mailfrom=melifaro@ipfw.ru X-Spamd-Result: default: False [-2.93 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[ipfw.ru:s=mail]; FREEFALL_USER(0.00)[melifaro]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:77.88.0.0/18]; NEURAL_HAM_LONG(-0.98)[-0.979]; DMARC_NA(0.00)[ipfw.ru]; NEURAL_HAM_MEDIUM(-0.89)[-0.886]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[ipfw.ru:+]; MIME_BASE64_TEXT(0.10)[]; NEURAL_HAM_SHORT(-0.87)[-0.867]; MIME_HTML_ONLY(0.20)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13238, ipnet:77.88.0.0/18, country:RU]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_IN_DNSWL_LOW(-0.10)[77.88.28.111:from] MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 16:11:07 -0000 From owner-svn-src-head@freebsd.org Sat Oct 17 16:39:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A74C43CA2D for ; Sat, 17 Oct 2020 16:39:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD7zB1qmrz4NTJ for ; Sat, 17 Oct 2020 16:39:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x844.google.com with SMTP id j62so3583570qtd.0 for ; Sat, 17 Oct 2020 09:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3HVQC4jzB93RbLJK6XZQBe9OwE7El8jcY3UR1rJAxtQ=; b=LtjR1bP0vUHHKB2477ox0UpfBA9rsQs1n0XE+oXQBCI/N56WDeXklBUiOzLL4jtbpY MYTIbtRc/l1ybOSKQ2r08PeuGyozYFJgxsK/JgUEXI8RyfWP6EZd5UefJ8H3t4yzD2yS m1M1t7t6r7TarTNEFqTSww6wBnoI5aBnWXSu5R2FjZ+qBJ8ipNMLDbkVReWNZjrRpy3b l+OhMN8azKLQUeEl8K5wmBpnw9EKOmFx1tqmyHgvnB8H5zfAFMpKaFN0iqaormy17/kJ z7GamrhOEz9C6DpHWLoKWi41xgWuU5h373w0b3JTMuRK4HqKtV+usLjqRBjS4QRDcZ96 enng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3HVQC4jzB93RbLJK6XZQBe9OwE7El8jcY3UR1rJAxtQ=; b=KBTHqBzF1DKu6BfejJ+KGFsTDDtHPGOAPuFI8hyhAjKVdKu5QwmnY6PVkv2uN1n0xK XXofvQ5fIWtnTSCewzidWceBgbXA7CB0ZwJenZS6cv9gKKYKmbSePBvpaLM805dE463L wQGYuJOxALSnU96ijfWqiwXEHx/S5ziBMZAxzgjZ/d7Lx2QJWZRU9olLtxmPKYhRae9C F4KW0fMMT8OwxhRsIxkGG7lAvYgb8QdKjtX1c6jnpNBTkfL2d+JT/WbAGQgUW4/ovf74 mHSLTOXkXGupKx3zSrC/lXnIdUfwqqfk9kKrEVwYvxLTPnaI4uQVUS6+R+qaIw2umU4S G6nA== X-Gm-Message-State: AOAM531xS4sIM/MxyZeY/P6bDC9hIr0LBxxioZO4H/RF5q4+Q8fa4AyF QzWr7phHgMvC7q+ut+ZbHCe662bJRp7IFaSBkMJ/YA== X-Google-Smtp-Source: ABdhPJzk2gEqL7nRoIRgadRKhAD0aaxhu2YCoNe8suIjX7wVPhbE1OYdJkvTcgpm0gQN+/xVL9BychtNZZ/klYn7dfg= X-Received: by 2002:ac8:7247:: with SMTP id l7mr8266869qtp.244.1602952789089; Sat, 17 Oct 2020 09:39:49 -0700 (PDT) MIME-Version: 1.0 References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> <43251602934532@mail.yandex.ru> <59021602950992@mail.yandex.ru> In-Reply-To: <59021602950992@mail.yandex.ru> From: Warner Losh Date: Sat, 17 Oct 2020 10:39:37 -0600 Message-ID: Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf To: "Alexander V. Chernikov" Cc: Hans Petter Selasky , Emmanuel Vadot , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 4CD7zB1qmrz4NTJ X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=LtjR1bP0; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::844) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.31 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.89)[-0.890]; NEURAL_HAM_LONG(-0.96)[-0.965]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.44)[0.443]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MIME_BASE64_TEXT(0.10)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::844:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-head]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 16:39:51 -0000 On Sat, Oct 17, 2020, 10:11 AM Alexander V. Chernikov wrote: > 17.10.2020, 14:07, "Hans Petter Selasky" : > > On 2020-10-17 14:34, Alexander V. Chernikov wrote: > > 17.10.2020, 12:32, "Hans Petter Selasky" : > > On 2020-10-17 13:27, Alexander V. Chernikov wrote: > > 02.10.2020, 19:26, "Emmanuel Vadot" >>: > > Author: manu > Date: Fri Oct 2 18:26:41 2020 > New Revision: 366372 > URL: https://svnweb.freebsd.org/changeset/base/366372 > > Log: > linuxkpi: Add backlight support > > Add backlight function to linuxkpi. > Graphics drivers expose the backlight of the panel > directly so > allow them > to use the backlight subsystem so > user can use backlight(8) to configure them. > > Reviewed by: hselasky > Relnotes: yes > Differential Revision: The FreeBSD Foundation > > Added: > > head/sys/compat/linuxkpi/common/include/linux/backlight.h > (contents, > props changed) > Modified: > head/sys/compat/linuxkpi/common/include/linux/device.h > head/sys/compat/linuxkpi/common/src/linux_kmod.c > head/sys/compat/linuxkpi/common/src/linux_pci.c > head/sys/conf/kmod.mk > > It breaks the build for me with > > /usr/home/melifaro/free/head/sys/compat/linuxkpi/common/src/linux_pci.c:70:10: > fatal error: 'backlight_if.h' file not found > > > How do you build? Doesn't break over here. > > GENERIC + COMPAT_LINUXKPI. > > > > Try adding: > > options backlight > > To the kernel config. > > Yep, thank you! > Maybe it's worth considering adding static assert with the message > describing this dependency? > Yes. It likely is worth doing something to highlight this issue. Warner --HPS > > > From owner-svn-src-head@freebsd.org Sat Oct 17 17:31:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53F2F43D317; Sat, 17 Oct 2020 17:31:07 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD96M1Zr9z4R7l; Sat, 17 Oct 2020 17:31:07 +0000 (UTC) (envelope-from mhorne@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 1B1F3252A7; Sat, 17 Oct 2020 17:31:07 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09HHV6cw087798; Sat, 17 Oct 2020 17:31:06 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09HHV6iD087797; Sat, 17 Oct 2020 17:31:06 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010171731.09HHV6iD087797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 17 Oct 2020 17:31:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366794 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 366794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 17:31:07 -0000 Author: mhorne Date: Sat Oct 17 17:31:06 2020 New Revision: 366794 URL: https://svnweb.freebsd.org/changeset/base/366794 Log: riscv: zero reserved PTE bits for L2 PTEs As was done for L3 PTEs in r362853, mask out the reserved bits when extracting the physical address from an L2 PTE. Future versions of the spec or custom implementations may make use of these reserved bits, in which case the resulting physical address could be incorrect. Submitted by: Nathaniel Filardo Reviewed by: kp, mhorne Differential Revision: https://reviews.freebsd.org/D26607 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Sat Oct 17 13:06:29 2020 (r366793) +++ head/sys/riscv/riscv/pmap.c Sat Oct 17 17:31:06 2020 (r366794) @@ -342,6 +342,8 @@ pagezero(void *p) #define PTE_TO_PHYS(pte) \ ((((pte) & ~PTE_HI_MASK) >> PTE_PPN0_S) * PAGE_SIZE) +#define L2PTE_TO_PHYS(l2) \ + ((((l2) & ~PTE_HI_MASK) >> PTE_PPN1_S) << L2_SHIFT) static __inline pd_entry_t * pmap_l1(pmap_t pmap, vm_offset_t va) @@ -477,7 +479,7 @@ pmap_early_vtophys(vm_offset_t l1pt, vm_offset_t va) ("Invalid bootstrap L2 table")); /* L2 is superpages */ - ret = (l2[l2_slot] >> PTE_PPN1_S) << L2_SHIFT; + ret = L2PTE_TO_PHYS(l2[l2_slot]); ret += (va & L2_OFFSET); return (ret); @@ -825,7 +827,7 @@ pmap_extract(pmap_t pmap, vm_offset_t va) } } else { /* L2 is superpages */ - pa = (l2 >> PTE_PPN1_S) << L2_SHIFT; + pa = L2PTE_TO_PHYS(l2); pa |= (va & L2_OFFSET); } } @@ -877,7 +879,7 @@ pmap_kextract(vm_offset_t va) panic("pmap_kextract: No l2"); if ((pmap_load(l2) & PTE_RX) != 0) { /* superpages */ - pa = (pmap_load(l2) >> PTE_PPN1_S) << L2_SHIFT; + pa = L2PTE_TO_PHYS(pmap_load(l2)); pa |= (va & L2_OFFSET); return (pa); } From owner-svn-src-head@freebsd.org Sat Oct 17 20:14:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 502B944151E; Sat, 17 Oct 2020 20:14:31 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDDkt6vF7z4ZKW; Sat, 17 Oct 2020 20:14:30 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.1.9] (c-98-249-71-218.hsd1.nm.comcast.net [98.249.71.218]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id CDCE41AF5C8; Sat, 17 Oct 2020 20:14:23 +0000 (UTC) Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf To: "Alexander V. Chernikov" , Emmanuel Vadot , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> From: Sean Bruno Autocrypt: addr=sbruno@freebsd.org; prefer-encrypt=mutual; keydata= mQENBFk+0UEBCADaf4bgxxKvMOhRV5NPoGWRCCGm49d6+1VFNlQ77WsY/+Zvf95TPULdRlnG w648KfxWt7+O3kdKhdRwnqlXWC7zA2Qt0dRE1yIqOGJ4jp4INvp/bcxWzgr0aoKOjrlnfxRV bh+s0rzdZt6TsNL3cVYxkC8oezjaUkHdW4mFJU249U1QJogkF8g0FeKNfEcjEkwJNX6lQJH+ EzCWT0NCk6J+Xyo+zOOljxPp1OUfdvZi3ulkU/qTZstGVWxFVsP8xQklV/y3AFcbIYx6iGJ4 5L7WuB0IWhO7Z4yHENr8wFaNYwpod9i4egX2BugbrM8pOfhN2/qqdeG1L5LMtXw3yyAhABEB AAG0N1NlYW4gQnJ1bm8gKEZyZWVCU0QgRGV2ZWxvcGVyIEtleSkgPHNicnVub0BmcmVlYnNk Lm9yZz6JAVQEEwEKAD4CGwMFCwkIBwMFFQoJCAsFFgMCAQACHgECF4AWIQToxOn4gDUE4eP0 ujS95PX+ibX8tgUCXuqFTwUJB4znjgAKCRC95PX+ibX8tjxxCADWgN7OeMpkAsIMePQwMLJ4 UfNe3mKQP305UmiCvWO7q62ry0ZZzPuwIDGoUc9VBQ63NjgmcFbOEvbvVtFfxLTWPSAwehmC OjF+O5NvKtrUEzp4pgtXr/qjI04i3m4IhPD837Zd2WxUqZcbwIUtoFOZKi7q8F0/Kp14PUnU 5bCw/R8ORLtyK/7pfcXKJ7OLitH+hZaCSn8LQzaQ2AueiszPx9aNIbkNPvucsk0YH9UQaD14 +Nu5cM24B0sct65yd5/vQeL2aS4HXwxqk4AYxM+4zJ0eFkf3OqzzXw6N/OrmBv3+XVq4ohNc J9YaO3OTu9s4svDtLEfQPkz+64F2KAoGuQENBFk+0UEBCADIXBmQOaKMHGbc9vwjhV4Oj5aZ DdhNedn12FVeTdOXJvuTOusgxS29lla0RenHGDsgD08UiFpasBXWq/E+BhQ19d+iRbLLR17O KKc1ZGefoVbLARLXD68J5j4XAyK+6k2KqBLlqzAEpHTzsksM9naARkVXiEVcrt6ciw0FSm8n kuK3gDKKe93XfzfP+TQdbvvzJc7Fa+appLbXz61TM1aikaQlda8bWubDegwXbuoJdB34xU1m yjr/N4o+raL0x7QrzdH+wwgrTTo+H4S2c1972Skt5K5tbxLowfHicRl23V8itVQr3sBtlX4+ 66q+Apm7+R36bUS/k+G45Sp6iPpxABEBAAGJATwEGAEKACYCGwwWIQToxOn4gDUE4eP0ujS9 5PX+ibX8tgUCXuqFUwUJB4znkgAKCRC95PX+ibX8tl5VCACLIn7bhT/WiU31WGqZKYBIAI+/ mtAhGxPJ9Yq20/Prz3Yjj+RMiH5UfXPRX/tvdoq+Ce02wlUs07PeyQvMx59P2QwIamrY66Rj BNW2IiwLnuN+0cUUPDXfeTyE2yK0d6FAaz9I2UqOB3+6h2vhVH6RxYpWfQSMFR1RVpzR2LyX WGI4TREGsNU/MTngWdoJ/lvAUcfNo9s71H/W8iBFoSQA7rgrQDjyG3XQ07SUW7xgqcwG6PgU 4mrdTKNidvJonbPkl6pToGiLpcVVs7KXpJpSNP1utD604nI3bHiucaQx3A6/zHdiycwYATn8 fSbndstcXMm3CN+L8pdX8/FpaWxU Message-ID: Date: Sat, 17 Oct 2020 14:14:20 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <44421602932538@mail.yandex.ru> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ldpRy3QGECdaFUPengzGpLJhYIPWMqGFp" X-Rspamd-Queue-Id: 4CDDkt6vF7z4ZKW X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:36236, ipnet:199.102.76.0/22, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 20:14:31 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ldpRy3QGECdaFUPengzGpLJhYIPWMqGFp Content-Type: multipart/mixed; boundary="b06ayA5bLqWDDd7Zfzk5RT2LIBZaOeu5C" --b06ayA5bLqWDDd7Zfzk5RT2LIBZaOeu5C Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2020-10-17 05:27, Alexander V. Chernikov wrote: > 02.10.2020, 19:26, "Emmanuel Vadot" : >=20 > Author: manu > Date: Fri Oct 2 18:26:41 2020 > New Revision: 366372 > URL: https://svnweb.freebsd.org/changeset/base/366372 >=20 > Log: > =C2=A0=C2=A0linuxkpi: Add backlight support > =C2=A0=C2=A0 > =C2=A0=C2=A0Add backlight function to linuxkpi. > =C2=A0=C2=A0Graphics drivers expose the backlight of the panel dire= ctly so > allow them to use the backlight subsystem so > =C2=A0=C2=A0user can use backlight(8) to configure them. > =C2=A0=C2=A0 > =C2=A0=C2=A0Reviewed by: hselasky > =C2=A0=C2=A0Relnotes: yes > =C2=A0=C2=A0Differential Revision: The FreeBSD Foundation >=20 > Added: > =C2=A0=C2=A0head/sys/compat/linuxkpi/common/include/linux/backlight= =2Eh > (contents, props changed) > Modified: > =C2=A0=C2=A0head/sys/compat/linuxkpi/common/include/linux/device.h > =C2=A0=C2=A0head/sys/compat/linuxkpi/common/src/linux_kmod.c > =C2=A0=C2=A0head/sys/compat/linuxkpi/common/src/linux_pci.c > =C2=A0=C2=A0head/sys/conf/kmod.mk >=20 > It breaks the build for me with > =C2=A0 > /usr/home/melifaro/free/head/sys/compat/linuxkpi/common/src/linux_pci.c= :70:10: > fatal error: 'backlight_if.h' file not found >=20 >=20 Same buildfailure with GENERIC-NODEBUG. sean https://people.freebsd.org/~sbruno/backlight.txt --b06ayA5bLqWDDd7Zfzk5RT2LIBZaOeu5C-- --ldpRy3QGECdaFUPengzGpLJhYIPWMqGFp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAl+LUJxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /Lauhwf9FBFFiu4jOG77APSJhm1sR/5+DTq2Sor1IoMVD4dT6LxvrvsAjJw4zT3h ckfR4lquTtdiX1Jn2yi18qU67LRY+Rttxlyj+byeyDGUzDdOYNXYhRAZrBMW7KST +UZe6of8LoFur3fxu9AWuK+bNH+3KZUuSkrQdoMhsTYqarfeewKT2Nsa4Fq5w9GO vPDX/4Nqv0q8tYpwJH1bf/KW3NBm5r+oZT0qX2f6D3yYfjlvQrZlEkUf4+YQFn4F vM9m7Jk9YbioCxbzJDiTf+FLq88+RSkqrY61ewOSalJPgUP8h1DmJLiF/wlQueJf s5MVrUE//Fk9UppI7cmKNaARKa3o/A== =BU3Z -----END PGP SIGNATURE----- --ldpRy3QGECdaFUPengzGpLJhYIPWMqGFp-- From owner-svn-src-head@freebsd.org Sat Oct 17 20:33:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B0A4441C11; Sat, 17 Oct 2020 20:33:10 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDF8Q2d5Nz4b6S; Sat, 17 Oct 2020 20:33:10 +0000 (UTC) (envelope-from melifaro@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 3D633276AC; Sat, 17 Oct 2020 20:33:10 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09HKXAEF003234; Sat, 17 Oct 2020 20:33:10 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09HKXAjG003233; Sat, 17 Oct 2020 20:33:10 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202010172033.09HKXAjG003233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 17 Oct 2020 20:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366795 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 20:33:10 -0000 Author: melifaro Date: Sat Oct 17 20:33:09 2020 New Revision: 366795 URL: https://svnweb.freebsd.org/changeset/base/366795 Log: Fix sleepq_add panic happening with too wide net epoch in mcast control. PR: 250413 Reported by: Christopher Hall Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D26827 Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Sat Oct 17 17:31:06 2020 (r366794) +++ head/sys/netinet/in_mcast.c Sat Oct 17 20:33:09 2020 (r366795) @@ -1905,7 +1905,7 @@ inp_getmoptions(struct inpcb *inp, struct sockopt *sop * this in order to allow groups to be joined when the routing * table has not yet been populated during boot. * - * Returns NULL if no ifp could be found. + * Returns NULL if no ifp could be found, otherwise return referenced ifp. * * FUTURE: Implement IPv4 source-address selection. */ @@ -1926,13 +1926,16 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, if (!in_nullhost(ina)) { IN_IFADDR_RLOCK(&in_ifa_tracker); INADDR_TO_IFP(ina, ifp); + if (ifp != NULL) + if_ref(ifp); IN_IFADDR_RUNLOCK(&in_ifa_tracker); } else { - fibnum = inp ? inp->inp_inc.inc_fibnum : 0; - nh = fib4_lookup(fibnum, gsin->sin_addr, 0, 0, 0); - if (nh != NULL) + fibnum = inp ? inp->inp_inc.inc_fibnum : RT_DEFAULT_FIB; + nh = fib4_lookup(fibnum, gsin->sin_addr, 0, NHR_NONE, 0); + if (nh != NULL) { ifp = nh->nh_ifp; - else { + if_ref(ifp); + } else { struct in_ifaddr *ia; struct ifnet *mifp; @@ -1943,6 +1946,7 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, if (!(mifp->if_flags & IFF_LOOPBACK) && (mifp->if_flags & IFF_MULTICAST)) { ifp = mifp; + if_ref(ifp); break; } } @@ -1966,6 +1970,7 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt struct ip_moptions *imo; struct in_multi *inm; struct in_msource *lims; + struct epoch_tracker et; int error, is_new; ifp = NULL; @@ -1997,9 +2002,10 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) return (EINVAL); + NET_EPOCH_ENTER(et); if (sopt->sopt_valsize == sizeof(struct ip_mreqn) && mreqn.imr_ifindex != 0) - ifp = ifnet_byindex(mreqn.imr_ifindex); + ifp = ifnet_byindex_ref(mreqn.imr_ifindex); else ifp = inp_lookup_mcast_ifp(inp, &gsa->sin, mreqn.imr_address); @@ -2023,6 +2029,7 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt ssa->sin.sin_addr = mreqs.imr_sourceaddr; + NET_EPOCH_ENTER(et); ifp = inp_lookup_mcast_ifp(inp, &gsa->sin, mreqs.imr_interface); CTR3(KTR_IGMPV3, "%s: imr_interface = 0x%08x, ifp = %p", @@ -2065,7 +2072,8 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt if (gsr.gsr_interface == 0 || V_if_index < gsr.gsr_interface) return (EADDRNOTAVAIL); - ifp = ifnet_byindex(gsr.gsr_interface); + NET_EPOCH_ENTER(et); + ifp = ifnet_byindex_ref(gsr.gsr_interface); break; default: @@ -2074,9 +2082,13 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt return (EOPNOTSUPP); break; } + NET_EPOCH_EXIT(et); - if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) + if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) { + if (ifp != NULL) + if_rele(ifp); return (EADDRNOTAVAIL); + } IN_MULTI_LOCK(); @@ -2265,6 +2277,7 @@ out_inp_unlocked: } ip_mfilter_free(imf); } + if_rele(ifp); return (error); } @@ -2740,7 +2753,6 @@ inp_setmoptions(struct inpcb *inp, struct sockopt *sop { struct ip_moptions *imo; int error; - struct epoch_tracker et; error = 0; @@ -2847,9 +2859,7 @@ inp_setmoptions(struct inpcb *inp, struct sockopt *sop case IP_ADD_SOURCE_MEMBERSHIP: case MCAST_JOIN_GROUP: case MCAST_JOIN_SOURCE_GROUP: - NET_EPOCH_ENTER(et); error = inp_join_group(inp, sopt); - NET_EPOCH_EXIT(et); break; case IP_DROP_MEMBERSHIP: From owner-svn-src-head@freebsd.org Sat Oct 17 20:38:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D68FC441A39; Sat, 17 Oct 2020 20:38:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDFGw6DPzz4bpK; Sat, 17 Oct 2020 20:38:48 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 9E33D2601B7; Sat, 17 Oct 2020 22:38:45 +0200 (CEST) Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf To: Sean Bruno , "Alexander V. Chernikov" , Emmanuel Vadot , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> From: Hans Petter Selasky Message-ID: Date: Sat, 17 Oct 2020 22:38:08 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CDFGw6DPzz4bpK X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-2.41 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-0.97)[-0.968]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.23)[-0.226]; NEURAL_HAM_MEDIUM(-0.92)[-0.915]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 20:38:49 -0000 On 2020-10-17 22:14, Sean Bruno wrote: > On 2020-10-17 05:27, Alexander V. Chernikov wrote: >> 02.10.2020, 19:26, "Emmanuel Vadot" : >> >> Author: manu >> Date: Fri Oct 2 18:26:41 2020 >> New Revision: 366372 >> URL: https://svnweb.freebsd.org/changeset/base/366372 >> >> Log: >>   linuxkpi: Add backlight support >> >>   Add backlight function to linuxkpi. >>   Graphics drivers expose the backlight of the panel directly so >> allow them to use the backlight subsystem so >>   user can use backlight(8) to configure them. >> >>   Reviewed by: hselasky >>   Relnotes: yes >>   Differential Revision: The FreeBSD Foundation >> >> Added: >>   head/sys/compat/linuxkpi/common/include/linux/backlight.h >> (contents, props changed) >> Modified: >>   head/sys/compat/linuxkpi/common/include/linux/device.h >>   head/sys/compat/linuxkpi/common/src/linux_kmod.c >>   head/sys/compat/linuxkpi/common/src/linux_pci.c >>   head/sys/conf/kmod.mk >> >> It breaks the build for me with >> >> /usr/home/melifaro/free/head/sys/compat/linuxkpi/common/src/linux_pci.c:70:10: >> fatal error: 'backlight_if.h' file not found >> >> > > Same buildfailure with GENERIC-NODEBUG. I'll have a look at it tomorrow. I think Emmanuel is OOO this week. --HPS From owner-svn-src-head@freebsd.org Sat Oct 17 20:39:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32A2044187C; Sat, 17 Oct 2020 20:39:51 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDFJ53tYKz4bmR; Sat, 17 Oct 2020 20:39:49 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 9EA958D4A21B; Sat, 17 Oct 2020 20:39:46 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 11F99E7087A; Sat, 17 Oct 2020 20:39:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 1J3-EQ9OQHUE; Sat, 17 Oct 2020 20:39:44 +0000 (UTC) Received: from [169.254.148.91] (unknown [IPv6:fde9:577b:c1a9:4902:280e:7b69:92fc:710f]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 077E3E707B1; Sat, 17 Oct 2020 20:39:43 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Sean Bruno" Cc: "Alexander V. Chernikov" , "Emmanuel Vadot" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf Date: Sat, 17 Oct 2020 20:39:43 +0000 X-Mailer: MailMate (2.0BETAr6151) Message-ID: In-Reply-To: References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4CDFJ53tYKz4bmR X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of bzeeb-lists@lists.zabbadoz.net designates 195.201.62.131 as permitted sender) smtp.mailfrom=bzeeb-lists@lists.zabbadoz.net X-Spamd-Result: default: False [-3.03 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:195.201.62.131]; NEURAL_HAM_LONG(-0.98)[-0.976]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[zabbadoz.net]; NEURAL_HAM_MEDIUM(-0.95)[-0.953]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.80)[-0.802]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:24940, ipnet:195.201.0.0/16, country:DE]; MIME_TRACE(0.00)[0:+]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 20:39:51 -0000 On 17 Oct 2020, at 20:14, Sean Bruno wrote: > On 2020-10-17 05:27, Alexander V. Chernikov wrote: >> 02.10.2020, 19:26, "Emmanuel Vadot" : >> >> Author: manu >> Date: Fri Oct 2 18:26:41 2020 >> New Revision: 366372 >> URL: https://svnweb.freebsd.org/changeset/base/366372 >> >> Log: >> =C2=A0=C2=A0linuxkpi: Add backlight support >> =C2=A0=C2=A0 >> =C2=A0=C2=A0Add backlight function to linuxkpi. >> =C2=A0=C2=A0Graphics drivers expose the backlight of the panel dir= ectly = >> so >> allow them to use the backlight subsystem so >> =C2=A0=C2=A0user can use backlight(8) to configure them. >> =C2=A0=C2=A0 >> =C2=A0=C2=A0Reviewed by: hselasky >> =C2=A0=C2=A0Relnotes: yes >> =C2=A0=C2=A0Differential Revision: The FreeBSD Foundation >> >> Added: >> =C2=A0=C2=A0head/sys/compat/linuxkpi/common/include/linux/backligh= t.h >> (contents, props changed) >> Modified: >> =C2=A0=C2=A0head/sys/compat/linuxkpi/common/include/linux/device.h= >> =C2=A0=C2=A0head/sys/compat/linuxkpi/common/src/linux_kmod.c >> =C2=A0=C2=A0head/sys/compat/linuxkpi/common/src/linux_pci.c >> =C2=A0=C2=A0head/sys/conf/kmod.mk >> >> It breaks the build for me with >> =C2=A0 >> /usr/home/melifaro/free/head/sys/compat/linuxkpi/common/src/linux_pci.= c:70:10: >> fatal error: 'backlight_if.h' file not found >> >> > > Same buildfailure with GENERIC-NODEBUG. Seems different. > https://people.freebsd.org/~sbruno/backlight.txt HEAD with which version of the drm port/package? /bz From owner-svn-src-head@freebsd.org Sat Oct 17 20:48:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56BF74420A6; Sat, 17 Oct 2020 20:48:33 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDFV91HFYz4cHH; Sat, 17 Oct 2020 20:48:32 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.1.9] (c-98-249-71-218.hsd1.nm.comcast.net [98.249.71.218]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id B0EAF1AF5C8; Sat, 17 Oct 2020 20:48:31 +0000 (UTC) Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf To: "Bjoern A. Zeeb" Cc: "Alexander V. Chernikov" , Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> From: Sean Bruno Autocrypt: addr=sbruno@freebsd.org; prefer-encrypt=mutual; keydata= mQENBFk+0UEBCADaf4bgxxKvMOhRV5NPoGWRCCGm49d6+1VFNlQ77WsY/+Zvf95TPULdRlnG w648KfxWt7+O3kdKhdRwnqlXWC7zA2Qt0dRE1yIqOGJ4jp4INvp/bcxWzgr0aoKOjrlnfxRV bh+s0rzdZt6TsNL3cVYxkC8oezjaUkHdW4mFJU249U1QJogkF8g0FeKNfEcjEkwJNX6lQJH+ EzCWT0NCk6J+Xyo+zOOljxPp1OUfdvZi3ulkU/qTZstGVWxFVsP8xQklV/y3AFcbIYx6iGJ4 5L7WuB0IWhO7Z4yHENr8wFaNYwpod9i4egX2BugbrM8pOfhN2/qqdeG1L5LMtXw3yyAhABEB AAG0N1NlYW4gQnJ1bm8gKEZyZWVCU0QgRGV2ZWxvcGVyIEtleSkgPHNicnVub0BmcmVlYnNk Lm9yZz6JAVQEEwEKAD4CGwMFCwkIBwMFFQoJCAsFFgMCAQACHgECF4AWIQToxOn4gDUE4eP0 ujS95PX+ibX8tgUCXuqFTwUJB4znjgAKCRC95PX+ibX8tjxxCADWgN7OeMpkAsIMePQwMLJ4 UfNe3mKQP305UmiCvWO7q62ry0ZZzPuwIDGoUc9VBQ63NjgmcFbOEvbvVtFfxLTWPSAwehmC OjF+O5NvKtrUEzp4pgtXr/qjI04i3m4IhPD837Zd2WxUqZcbwIUtoFOZKi7q8F0/Kp14PUnU 5bCw/R8ORLtyK/7pfcXKJ7OLitH+hZaCSn8LQzaQ2AueiszPx9aNIbkNPvucsk0YH9UQaD14 +Nu5cM24B0sct65yd5/vQeL2aS4HXwxqk4AYxM+4zJ0eFkf3OqzzXw6N/OrmBv3+XVq4ohNc J9YaO3OTu9s4svDtLEfQPkz+64F2KAoGuQENBFk+0UEBCADIXBmQOaKMHGbc9vwjhV4Oj5aZ DdhNedn12FVeTdOXJvuTOusgxS29lla0RenHGDsgD08UiFpasBXWq/E+BhQ19d+iRbLLR17O KKc1ZGefoVbLARLXD68J5j4XAyK+6k2KqBLlqzAEpHTzsksM9naARkVXiEVcrt6ciw0FSm8n kuK3gDKKe93XfzfP+TQdbvvzJc7Fa+appLbXz61TM1aikaQlda8bWubDegwXbuoJdB34xU1m yjr/N4o+raL0x7QrzdH+wwgrTTo+H4S2c1972Skt5K5tbxLowfHicRl23V8itVQr3sBtlX4+ 66q+Apm7+R36bUS/k+G45Sp6iPpxABEBAAGJATwEGAEKACYCGwwWIQToxOn4gDUE4eP0ujS9 5PX+ibX8tgUCXuqFUwUJB4znkgAKCRC95PX+ibX8tl5VCACLIn7bhT/WiU31WGqZKYBIAI+/ mtAhGxPJ9Yq20/Prz3Yjj+RMiH5UfXPRX/tvdoq+Ce02wlUs07PeyQvMx59P2QwIamrY66Rj BNW2IiwLnuN+0cUUPDXfeTyE2yK0d6FAaz9I2UqOB3+6h2vhVH6RxYpWfQSMFR1RVpzR2LyX WGI4TREGsNU/MTngWdoJ/lvAUcfNo9s71H/W8iBFoSQA7rgrQDjyG3XQ07SUW7xgqcwG6PgU 4mrdTKNidvJonbPkl6pToGiLpcVVs7KXpJpSNP1utD604nI3bHiucaQx3A6/zHdiycwYATn8 fSbndstcXMm3CN+L8pdX8/FpaWxU Message-ID: Date: Sat, 17 Oct 2020 14:48:28 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yNd7NsL2TCfVVGA4umpKsezlIzMiXxhrq" X-Rspamd-Queue-Id: 4CDFV91HFYz4cHH X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:36236, ipnet:199.102.76.0/22, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 20:48:33 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --yNd7NsL2TCfVVGA4umpKsezlIzMiXxhrq Content-Type: multipart/mixed; boundary="RTvwVgM1dvCQAfbjdHwWDHFR6nlVg2ahR" --RTvwVgM1dvCQAfbjdHwWDHFR6nlVg2ahR Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable >> Same buildfailure with GENERIC-NODEBUG. >=20 > Seems different. >=20 >=20 >> https://people.freebsd.org/~sbruno/backlight.txt >=20 > HEAD with which version of the drm port/package? >=20 > /bz sbruno@alice:~ % pkg info |grep kmod drm-current-kmod-4.16.g20200320 DRM modules for the linuxkpi-based KMS components drm-kmod-g20190710 Metaport of DRM modules for the linuxkpi-based KMS components gpu-firmware-kmod-g20200503 Firmware modules for the linuxkpi-based KMS components >=20 >=20 --RTvwVgM1dvCQAfbjdHwWDHFR6nlVg2ahR-- --yNd7NsL2TCfVVGA4umpKsezlIzMiXxhrq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAl+LWJxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LZm7QgA0w9vzUe9nfJWQgk2tg2qcR8cuQBwFDblKyuHlS989DiIQB88XFEuiSqi jJek0d6lH4AYePjr8DPjSM8FsrWY/9ITvc84RASNfVxtcdH2X73+HG/+tG3sgteF ielh/UYdRnX6zRb5djVRuQLKW4RqHkO08kz3tkSijjMIcmw53zq0W8IumQsau9rV +aCq4s6FjGTPlxNIrWrkG1tBgaV6+b4HIWsulN/QmJjPbs6/efGoY5YkPR7KjJXr oqbpjR6XXwLEUjwmrSnRZpYo7boxB7WkSifSv54X33djU3/LlIBypPjGtN5SfgVr 1+yw97D6wwMO75vWtjUSJraWAKxE8A== =ia1T -----END PGP SIGNATURE----- --yNd7NsL2TCfVVGA4umpKsezlIzMiXxhrq-- From owner-svn-src-head@freebsd.org Sat Oct 17 20:56:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6148B441FFD; Sat, 17 Oct 2020 20:56:22 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDFg91zcdz4cTr; Sat, 17 Oct 2020 20:56:20 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id A41C68D4A179; Sat, 17 Oct 2020 20:56:19 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 156D1E70813; Sat, 17 Oct 2020 20:56:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id Js_MbUyEQj6r; Sat, 17 Oct 2020 20:56:17 +0000 (UTC) Received: from [169.254.148.91] (unknown [IPv6:fde9:577b:c1a9:4902:280e:7b69:92fc:710f]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 62FCDE707B1; Sat, 17 Oct 2020 20:56:17 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Sean Bruno" Cc: "Alexander V. Chernikov" , "Emmanuel Vadot" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf Date: Sat, 17 Oct 2020 20:56:15 +0000 X-Mailer: MailMate (2.0BETAr6151) Message-ID: <6597658A-EED5-4A13-9F1D-42F6F405DCF1@lists.zabbadoz.net> In-Reply-To: References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CDFg91zcdz4cTr X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of bzeeb-lists@lists.zabbadoz.net designates 195.201.62.131 as permitted sender) smtp.mailfrom=bzeeb-lists@lists.zabbadoz.net X-Spamd-Result: default: False [-3.03 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:195.201.62.131:c]; NEURAL_HAM_LONG(-0.98)[-0.977]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[zabbadoz.net]; NEURAL_HAM_MEDIUM(-0.96)[-0.957]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.80)[-0.798]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:195.201.0.0/16, country:DE]; RCVD_TLS_LAST(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 20:56:22 -0000 On 17 Oct 2020, at 20:48, Sean Bruno wrote: >>> Same buildfailure with GENERIC-NODEBUG. >> >> Seems different. >> >> >>> https://people.freebsd.org/~sbruno/backlight.txt >> >> HEAD with which version of the drm port/package? >> >> /bz > > sbruno@alice:~ % pkg info |grep kmod > drm-current-kmod-4.16.g20200320 DRM modules for the linuxkpi-based KMS > components > drm-kmod-g20190710 Metaport of DRM modules for the > linuxkpi-based KMS components > gpu-firmware-kmod-g20200503 Firmware modules for the linuxkpi-based > KMS components You may want to have to update this to recent and try again; if that still breaks I assume either Hans or I will be happy to help until manu is back. I’d assume with more linuxkpi bits implemented in HEAD the conflicts in head will stay … and port/package updates will have to happen once in a while (*). https://svnweb.freebsd.org/base?view=revision&revision=366374 https://svnweb.freebsd.org/ports?view=revision&revision=551266 /bz (*) manu is making sure that after the commit to head the new port keeps compiling with older kernels for a while using __FreeBSD_version; I may have a partial solution that might allow us to update the port first but neither won’t help with old ports like in this case. From owner-svn-src-head@freebsd.org Sat Oct 17 21:22:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 500A74429F2; Sat, 17 Oct 2020 21:22:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDGFY1Q9tz4dnS; Sat, 17 Oct 2020 21:22:41 +0000 (UTC) (envelope-from mjg@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 13ADD804C; Sat, 17 Oct 2020 21:22:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09HLMe9B033572; Sat, 17 Oct 2020 21:22:40 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09HLMeGG033571; Sat, 17 Oct 2020 21:22:40 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010172122.09HLMeGG033571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Oct 2020 21:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366796 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 21:22:41 -0000 Author: mjg Date: Sat Oct 17 21:22:40 2020 New Revision: 366796 URL: https://svnweb.freebsd.org/changeset/base/366796 Log: cache: don't automatically evict negative entries if usage is low The previous scheme only looked at negative entry count in relation to the total count, leading to tons of spurious evictions if the cache is not significantly populated. Instead, only try the above if negative entry count goes beyond namecache capacity. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 17 20:33:09 2020 (r366795) +++ head/sys/kern/vfs_cache.c Sat Oct 17 21:22:40 2020 (r366796) @@ -296,6 +296,17 @@ SYSCTL_ULONG(_vfs_cache_param, OID_AUTO, negfactor, CT "Ratio of negative namecache entries"); /* + * Negative entry % of namecahe capacity above which automatic eviction is allowed. + * + * Check cache_neg_evict_cond for details. + */ +static u_int ncnegminpct = 3; + +static u_int __read_mostly neg_min; /* the above recomputed against ncsize */ +SYSCTL_UINT(_vfs_cache_param, OID_AUTO, negmin, CTLFLAG_RD, &neg_min, 0, + "Negative entry count above which automatic eviction is allowed"); + +/* * Structures associated with name caching. */ #define NCHHASH(hash) \ @@ -703,6 +714,37 @@ SYSCTL_PROC(_vfs_cache, OID_AUTO, nchstats, CTLTYPE_OP CTLFLAG_MPSAFE, 0, 0, sysctl_nchstats, "LU", "VFS cache effectiveness statistics"); +static void +cache_recalc_neg_min(u_int val) +{ + + neg_min = (ncsize * val) / 100; +} + +static int +sysctl_negminpct(SYSCTL_HANDLER_ARGS) +{ + u_int val; + int error; + + val = ncnegminpct; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (val == ncnegminpct) + return (0); + if (val < 0 || val > 99) + return (EINVAL); + ncnegminpct = val; + cache_recalc_neg_min(val); + return (0); +} + +SYSCTL_PROC(_vfs_cache_param, OID_AUTO, negminpct, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_negminpct, + "I", "Negative entry \% of namecahe capacity above which automatic eviction is allowed"); + #ifdef DIAGNOSTIC /* * Grab an atomic snapshot of the name cache hash chain lengths @@ -1033,7 +1075,7 @@ cache_neg_evict_select(void) return (nl); } -static void +static bool cache_neg_evict(void) { struct namecache *ncp, *ncp2; @@ -1044,10 +1086,11 @@ cache_neg_evict(void) struct mtx *blp; uint32_t hash; u_char nlen; + bool evicted; nl = cache_neg_evict_select(); if (nl == NULL) { - return; + return (false); } mtx_lock(&nl->nl_lock); @@ -1064,7 +1107,7 @@ cache_neg_evict(void) counter_u64_add(neg_evict_skipped_empty, 1); mtx_unlock(&nl->nl_lock); mtx_unlock(&nl->nl_evict_lock); - return; + return (false); } ns = NCP2NEGSTATE(ncp); nlen = ncp->nc_nlen; @@ -1088,6 +1131,7 @@ cache_neg_evict(void) if (ncp2 == NULL) { counter_u64_add(neg_evict_skipped_missed, 1); ncp = NULL; + evicted = false; } else { MPASS(dvlp == VP2VNODELOCK(ncp->nc_dvp)); MPASS(blp == NCP2BUCKETLOCK(ncp)); @@ -1095,14 +1139,44 @@ cache_neg_evict(void) ncp->nc_name); cache_zap_locked(ncp); counter_u64_add(neg_evicted, 1); + evicted = true; } mtx_unlock(blp); mtx_unlock(dvlp); if (ncp != NULL) cache_free(ncp); + return (evicted); } /* + * Maybe evict a negative entry to create more room. + * + * The ncnegfactor parameter limits what fraction of the total count + * can comprise of negative entries. However, if the cache is just + * warming up this leads to excessive evictions. As such, ncnegminpct + * (recomputed to neg_min) dictates whether the above should be + * applied. + * + * Try evicting if the cache is close to full capacity regardless of + * other considerations. + */ +static bool +cache_neg_evict_cond(u_long lnumcache) +{ + u_long lnumneg; + + if (ncsize - 1000 < lnumcache) + goto out_evict; + lnumneg = atomic_load_long(&numneg); + if (lnumneg < neg_min) + return (false); + if (lnumneg * ncnegfactor < lnumcache) + return (false); +out_evict: + return (cache_neg_evict()); +} + +/* * cache_zap_locked(): * * Removes a namecache entry from cache, whether it contains an actual @@ -1994,8 +2068,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * 3. it only ever looks at negative entries. */ lnumcache = atomic_fetchadd_long(&numcache, 1) + 1; - if (numneg * ncnegfactor > lnumcache) { - cache_neg_evict(); + if (cache_neg_evict_cond(lnumcache)) { lnumcache = atomic_load_long(&numcache); } if (__predict_false(lnumcache >= ncsize)) { @@ -2226,6 +2299,7 @@ nchinit(void *dummy __unused) VFS_SMR_ZONE_SET(cache_zone_large_ts); ncsize = desiredvnodes * ncsizefactor; + cache_recalc_neg_min(ncnegminpct); nchashtbl = nchinittbl(desiredvnodes * 2, &nchash); ncbuckethash = cache_roundup_2(mp_ncpus * mp_ncpus) - 1; if (ncbuckethash < 7) /* arbitrarily chosen to avoid having one lock */ @@ -2302,6 +2376,7 @@ cache_changesize(u_long newmaxvnodes) } } ncsize = newncsize; + cache_recalc_neg_min(ncnegminpct); cache_unlock_all_buckets(); cache_unlock_all_vnodes(); ncfreetbl(old_nchashtbl); From owner-svn-src-head@freebsd.org Sat Oct 17 21:30:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A548442CC7; Sat, 17 Oct 2020 21:30:47 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDGQv39q0z4dmL; Sat, 17 Oct 2020 21:30:47 +0000 (UTC) (envelope-from mjg@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 51CC327977; Sat, 17 Oct 2020 21:30:47 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09HLUlQj034024; Sat, 17 Oct 2020 21:30:47 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09HLUltg034023; Sat, 17 Oct 2020 21:30:47 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010172130.09HLUltg034023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 17 Oct 2020 21:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366797 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 21:30:47 -0000 Author: mjg Date: Sat Oct 17 21:30:46 2020 New Revision: 366797 URL: https://svnweb.freebsd.org/changeset/base/366797 Log: cache: shorten names of debug stats Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 17 21:22:40 2020 (r366796) +++ head/sys/kern/vfs_cache.c Sat Oct 17 21:30:46 2020 (r366797) @@ -491,22 +491,20 @@ STATNODE_COUNTER(fullpathfound, numfullpathfound, "Num */ static SYSCTL_NODE(_vfs_cache, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Name cache debugging"); -#define DEBUGNODE_ULONG(name, descr) \ - SYSCTL_ULONG(_vfs_cache_debug, OID_AUTO, name, CTLFLAG_RD, &name, 0, descr); -#define DEBUGNODE_COUNTER(name, descr) \ - static COUNTER_U64_DEFINE_EARLY(name); \ - SYSCTL_COUNTER_U64(_vfs_cache_debug, OID_AUTO, name, CTLFLAG_RD, &name, \ +#define DEBUGNODE_ULONG(name, varname, descr) \ + SYSCTL_ULONG(_vfs_cache_debug, OID_AUTO, name, CTLFLAG_RD, &varname, 0, descr); +#define DEBUGNODE_COUNTER(name, varname, descr) \ + static COUNTER_U64_DEFINE_EARLY(varname); \ + SYSCTL_COUNTER_U64(_vfs_cache_debug, OID_AUTO, name, CTLFLAG_RD, &varname, \ descr); -DEBUGNODE_COUNTER(zap_and_exit_bucket_relock_success, +DEBUGNODE_COUNTER(zap_bucket_relock_success, zap_bucket_relock_success, "Number of successful removals after relocking"); -static long zap_and_exit_bucket_fail; -DEBUGNODE_ULONG(zap_and_exit_bucket_fail, - "Number of times zap_and_exit failed to lock"); -static long zap_and_exit_bucket_fail2; -DEBUGNODE_ULONG(zap_and_exit_bucket_fail2, - "Number of times zap_and_exit failed to lock"); +static long zap_bucket_fail; +DEBUGNODE_ULONG(zap_bucket_fail, zap_bucket_fail, ""); +static long zap_bucket_fail2; +DEBUGNODE_ULONG(zap_bucket_fail2, zap_bucket_fail2, ""); static long cache_lock_vnodes_cel_3_failures; -DEBUGNODE_ULONG(cache_lock_vnodes_cel_3_failures, +DEBUGNODE_ULONG(vnodes_cel_3_failures, cache_lock_vnodes_cel_3_failures, "Number of times 3-way vnode locking failed"); static void cache_zap_locked(struct namecache *ncp); @@ -1325,7 +1323,7 @@ cache_zap_unlocked_bucket(struct namecache *ncp, struc cache_zap_locked(rncp); mtx_unlock(blp); cache_unlock_vnodes(dvlp, vlp); - counter_u64_add(zap_and_exit_bucket_relock_success, 1); + counter_u64_add(zap_bucket_relock_success, 1); return (0); } @@ -1423,7 +1421,7 @@ retry: error = cache_zap_locked_bucket(ncp, cnp, hash, blp); if (__predict_false(error != 0)) { - zap_and_exit_bucket_fail++; + zap_bucket_fail++; goto retry; } counter_u64_add(numposzaps, 1); @@ -1647,7 +1645,7 @@ negative_success: counter_u64_add(numnegzaps, 1); error = cache_zap_locked_bucket(ncp, cnp, hash, blp); if (__predict_false(error != 0)) { - zap_and_exit_bucket_fail2++; + zap_bucket_fail2++; goto retry; } cache_free(ncp); From owner-svn-src-head@freebsd.org Sat Oct 17 22:33:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1EBC443E71; Sat, 17 Oct 2020 22:33:21 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDHq53Pf3z3SNf; Sat, 17 Oct 2020 22:33:21 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.1.9] (c-98-249-71-218.hsd1.nm.comcast.net [98.249.71.218]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id C86521AF5C8; Sat, 17 Oct 2020 22:33:19 +0000 (UTC) Subject: Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf To: "Bjoern A. Zeeb" Cc: "Alexander V. Chernikov" , Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010021826.092IQfdj023808@repo.freebsd.org> <44421602932538@mail.yandex.ru> <6597658A-EED5-4A13-9F1D-42F6F405DCF1@lists.zabbadoz.net> From: Sean Bruno Autocrypt: addr=sbruno@freebsd.org; prefer-encrypt=mutual; keydata= mQENBFk+0UEBCADaf4bgxxKvMOhRV5NPoGWRCCGm49d6+1VFNlQ77WsY/+Zvf95TPULdRlnG w648KfxWt7+O3kdKhdRwnqlXWC7zA2Qt0dRE1yIqOGJ4jp4INvp/bcxWzgr0aoKOjrlnfxRV bh+s0rzdZt6TsNL3cVYxkC8oezjaUkHdW4mFJU249U1QJogkF8g0FeKNfEcjEkwJNX6lQJH+ EzCWT0NCk6J+Xyo+zOOljxPp1OUfdvZi3ulkU/qTZstGVWxFVsP8xQklV/y3AFcbIYx6iGJ4 5L7WuB0IWhO7Z4yHENr8wFaNYwpod9i4egX2BugbrM8pOfhN2/qqdeG1L5LMtXw3yyAhABEB AAG0N1NlYW4gQnJ1bm8gKEZyZWVCU0QgRGV2ZWxvcGVyIEtleSkgPHNicnVub0BmcmVlYnNk Lm9yZz6JAVQEEwEKAD4CGwMFCwkIBwMFFQoJCAsFFgMCAQACHgECF4AWIQToxOn4gDUE4eP0 ujS95PX+ibX8tgUCXuqFTwUJB4znjgAKCRC95PX+ibX8tjxxCADWgN7OeMpkAsIMePQwMLJ4 UfNe3mKQP305UmiCvWO7q62ry0ZZzPuwIDGoUc9VBQ63NjgmcFbOEvbvVtFfxLTWPSAwehmC OjF+O5NvKtrUEzp4pgtXr/qjI04i3m4IhPD837Zd2WxUqZcbwIUtoFOZKi7q8F0/Kp14PUnU 5bCw/R8ORLtyK/7pfcXKJ7OLitH+hZaCSn8LQzaQ2AueiszPx9aNIbkNPvucsk0YH9UQaD14 +Nu5cM24B0sct65yd5/vQeL2aS4HXwxqk4AYxM+4zJ0eFkf3OqzzXw6N/OrmBv3+XVq4ohNc J9YaO3OTu9s4svDtLEfQPkz+64F2KAoGuQENBFk+0UEBCADIXBmQOaKMHGbc9vwjhV4Oj5aZ DdhNedn12FVeTdOXJvuTOusgxS29lla0RenHGDsgD08UiFpasBXWq/E+BhQ19d+iRbLLR17O KKc1ZGefoVbLARLXD68J5j4XAyK+6k2KqBLlqzAEpHTzsksM9naARkVXiEVcrt6ciw0FSm8n kuK3gDKKe93XfzfP+TQdbvvzJc7Fa+appLbXz61TM1aikaQlda8bWubDegwXbuoJdB34xU1m yjr/N4o+raL0x7QrzdH+wwgrTTo+H4S2c1972Skt5K5tbxLowfHicRl23V8itVQr3sBtlX4+ 66q+Apm7+R36bUS/k+G45Sp6iPpxABEBAAGJATwEGAEKACYCGwwWIQToxOn4gDUE4eP0ujS9 5PX+ibX8tgUCXuqFUwUJB4znkgAKCRC95PX+ibX8tl5VCACLIn7bhT/WiU31WGqZKYBIAI+/ mtAhGxPJ9Yq20/Prz3Yjj+RMiH5UfXPRX/tvdoq+Ce02wlUs07PeyQvMx59P2QwIamrY66Rj BNW2IiwLnuN+0cUUPDXfeTyE2yK0d6FAaz9I2UqOB3+6h2vhVH6RxYpWfQSMFR1RVpzR2LyX WGI4TREGsNU/MTngWdoJ/lvAUcfNo9s71H/W8iBFoSQA7rgrQDjyG3XQ07SUW7xgqcwG6PgU 4mrdTKNidvJonbPkl6pToGiLpcVVs7KXpJpSNP1utD604nI3bHiucaQx3A6/zHdiycwYATn8 fSbndstcXMm3CN+L8pdX8/FpaWxU Message-ID: <5dd8ff7f-9424-4ef5-534c-9fa4419fd941@freebsd.org> Date: Sat, 17 Oct 2020 16:33:13 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <6597658A-EED5-4A13-9F1D-42F6F405DCF1@lists.zabbadoz.net> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="1CCEEYwCony46REwkklOKD0HVrr3CYXo6" X-Rspamd-Queue-Id: 4CDHq53Pf3z3SNf X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:36236, ipnet:199.102.76.0/22, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 22:33:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1CCEEYwCony46REwkklOKD0HVrr3CYXo6 Content-Type: multipart/mixed; boundary="b3mZ1fzLrrvy1omiRwc8Ln3v1fEK4R0rL" --b3mZ1fzLrrvy1omiRwc8Ln3v1fEK4R0rL Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable >> sbruno@alice:~ % pkg info |grep kmod >> drm-current-kmod-4.16.g20200320 DRM modules for the linuxkpi-based KMS= >> components >> drm-kmod-g20190710=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 Metaport of DRM modules for the >> linuxkpi-based KMS components >> gpu-firmware-kmod-g20200503=C2=A0=C2=A0=C2=A0 Firmware modules for the= linuxkpi-based >> KMS components >=20 > You may want to have to update this to recent and try again;=C2=A0 if t= hat > still breaks I assume either Hans or I will be happy to help until manu= > is back. >=20 > I=E2=80=99d assume with more linuxkpi bits implemented in HEAD the conf= licts in > head will stay =E2=80=A6 and port/package updates will have to happen o= nce in a > while (*). >=20 > https://svnweb.freebsd.org/base?view=3Drevision&revision=3D366374 > https://svnweb.freebsd.org/ports?view=3Drevision&revision=3D551266 >=20 > /bz >=20 > (*) manu is making sure that after the commit to head the new port keep= s > compiling with older kernels for a while using __FreeBSD_version; I may= > have a partial solution that might allow us to update the port first bu= t > neither won=E2=80=99t help with old ports like in this case. >=20 I think its fair to tell people like me who update -current every couple of months to update more frequently or pop something into the top of -current reminding them that they need to keep up. :-) For now, I'm rebuilding my poudriere jail and will update my pkg's to ports-HEAD then retry the updates. I don't think you folks should spend too much time on it. sean --b3mZ1fzLrrvy1omiRwc8Ln3v1fEK4R0rL-- --1CCEEYwCony46REwkklOKD0HVrr3CYXo6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAl+LcSlfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LZQbggAwsfyhynDJxpml7ODJUfzYMLppd1uBQ/0dEL/sX566uduuj/nkAP89M5I AW5yUq+ZMF03O++upCF22rOpIuG4maSfyCuiKfTrSPZxvWBPsc+FRdH/xg4SiJWa ZQUgmYFk0XgmCgP6PQYyFPDpr/C2OKHFbSI7HoHItQwn1g1T55wtcPy/t5mCL19Q vIFDfiW191zQbwzt0a8i+2whe+w8QQ5wLThrg2p5TzJkRSKGUeboIyPnXERgPXD5 jLoPTEGQVY24BLg3XMN1O1bx8nhBDsnzmijYF35gNEcQdkju4TLvZKMltQWuOfeZ fPacYIn+tjIbNVt/Tbnny5gCqQPOTA== =22hA -----END PGP SIGNATURE----- --1CCEEYwCony46REwkklOKD0HVrr3CYXo6-- From owner-svn-src-head@freebsd.org Sat Oct 17 22:47:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79D4E4441FE; Sat, 17 Oct 2020 22:47:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDJ712YTzz3TNN; Sat, 17 Oct 2020 22:47:09 +0000 (UTC) (envelope-from bz@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 399F78BBE; Sat, 17 Oct 2020 22:47:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09HMl95Q082730; Sat, 17 Oct 2020 22:47:09 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09HMl9ZK082729; Sat, 17 Oct 2020 22:47:09 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202010172247.09HMl9ZK082729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 17 Oct 2020 22:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366798 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 22:47:09 -0000 Author: bz Date: Sat Oct 17 22:47:08 2020 New Revision: 366798 URL: https://svnweb.freebsd.org/changeset/base/366798 Log: ddb: add show sysinit command Add a show sysinit command to ddb (similar to show vnet_sysinit) which proved to be helpful to debug some ordering issues on early-mid kernel start panics. Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Sat Oct 17 21:30:46 2020 (r366797) +++ head/sys/kern/init_main.c Sat Oct 17 22:47:08 2020 (r366798) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" +#include "opt_kdb.h" #include "opt_init_path.h" #include "opt_verbose_sysinit.h" @@ -838,3 +839,51 @@ kick_init(const void *udata __unused) sched_add(td, SRQ_BORING); } SYSINIT(kickinit, SI_SUB_KTHREAD_INIT, SI_ORDER_MIDDLE, kick_init, NULL); + +/* + * DDB(4). + */ +#ifdef DDB +static void +db_show_print_syinit(struct sysinit *sip, bool ddb) +{ + const char *sname, *funcname; + c_db_sym_t sym; + db_expr_t offset; + +#define xprint(...) \ + if (ddb) \ + db_printf(__VA_ARGS__); \ + else \ + printf(__VA_ARGS__) + + if (sip == NULL) { + xprint("%s: no sysinit * given\n", __func__); + return; + } + + sym = db_search_symbol((vm_offset_t)sip, DB_STGY_ANY, &offset); + db_symbol_values(sym, &sname, NULL); + sym = db_search_symbol((vm_offset_t)sip->func, DB_STGY_PROC, &offset); + db_symbol_values(sym, &funcname, NULL); + xprint("%s(%p)\n", (sname != NULL) ? sname : "", sip); + xprint(" %#08x %#08x\n", sip->subsystem, sip->order); + xprint(" %p(%s)(%p)\n", + sip->func, (funcname != NULL) ? funcname : "", sip->udata); +#undef xprint +} + +DB_SHOW_COMMAND(sysinit, db_show_sysinit) +{ + struct sysinit **sipp; + + db_printf("SYSINIT vs Name(Ptr)\n"); + db_printf(" Subsystem Order\n"); + db_printf(" Function(Name)(Arg)\n"); + for (sipp = sysinit; sipp < sysinit_end; sipp++) { + db_show_print_syinit(*sipp, true); + if (db_pager_quit) + break; + } +} +#endif /* DDB */ From owner-svn-src-head@freebsd.org Sat Oct 17 23:42:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8583344537B; Sat, 17 Oct 2020 23:42:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDKLy30tXz3W2r; Sat, 17 Oct 2020 23:42:34 +0000 (UTC) (envelope-from bz@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 4AD9D917B; Sat, 17 Oct 2020 23:42:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09HNgYQq019117; Sat, 17 Oct 2020 23:42:34 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09HNgYa3019116; Sat, 17 Oct 2020 23:42:34 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202010172342.09HNgYa3019116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 17 Oct 2020 23:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366799 - head/sys/dev/extres/clk X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/dev/extres/clk X-SVN-Commit-Revision: 366799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2020 23:42:34 -0000 Author: bz Date: Sat Oct 17 23:42:33 2020 New Revision: 366799 URL: https://svnweb.freebsd.org/changeset/base/366799 Log: clk: fix indentation Just fix indentation of an if() clause. No functional changes intended. MFC after: 3 days Modified: head/sys/dev/extres/clk/clk.c Modified: head/sys/dev/extres/clk/clk.c ============================================================================== --- head/sys/dev/extres/clk/clk.c Sat Oct 17 22:47:08 2020 (r366798) +++ head/sys/dev/extres/clk/clk.c Sat Oct 17 23:42:33 2020 (r366799) @@ -544,7 +544,7 @@ clknode_create(struct clkdom * clkdom, clknode_class_t CLK_TOPO_SLOCK(); clknode = clknode_find_by_name(def->name); CLK_TOPO_UNLOCK(); - if (clknode != NULL) { + if (clknode != NULL) { if (!(clknode->flags & CLK_NODE_LINKED) && def->flags & CLK_NODE_LINKED) { /*