From owner-dev-commits-src-main@freebsd.org Mon Feb 8 07:04:58 2021 Return-Path: Delivered-To: dev-commits-src-main@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 CEA05547DCA; Mon, 8 Feb 2021 07:04:58 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYxqG5V7Mz4mcG; Mon, 8 Feb 2021 07:04:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF72D13445; Mon, 8 Feb 2021 07:04:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11874wep017473; Mon, 8 Feb 2021 07:04:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11874w7E017472; Mon, 8 Feb 2021 07:04:58 GMT (envelope-from git) Date: Mon, 8 Feb 2021 07:04:58 GMT Message-Id: <202102080704.11874w7E017472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Daniel Ebdrup Jensen Subject: git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: debdrup X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 866c8b8d5ddb982c2b8139153a4ddfdb2aac3364 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 07:04:58 -0000 The branch main has been updated by debdrup (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=866c8b8d5ddb982c2b8139153a4ddfdb2aac3364 commit 866c8b8d5ddb982c2b8139153a4ddfdb2aac3364 Author: Daniel Ebdrup Jensen AuthorDate: 2021-02-08 06:49:32 +0000 Commit: Daniel Ebdrup Jensen CommitDate: 2021-02-08 06:57:36 +0000 kldload(8): Add note about using kld_list in rc.conf(5) While here, also recommend that loader.conf(5) should only be used in order to get to mountroot, as rc(8) is less fragile, faster, and is easier to fix by booting to single-user mode instead of having to blacklist modules in the loader. MFH: 2 weeks --- sbin/kldload/kldload.8 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sbin/kldload/kldload.8 b/sbin/kldload/kldload.8 index 9401c22819d5..d95cf1fcdfe9 100644 --- a/sbin/kldload/kldload.8 +++ b/sbin/kldload/kldload.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2017 +.Dd February 8, 2021 .Dt KLDLOAD 8 .Os .Sh NAME @@ -108,6 +108,11 @@ time when the corresponding .Xr rc.conf 5 statement is used. Modules may also be auto-loaded through their addition to +.Xr loader.conf 5 +or kld_list in +.Xr rc.conf 5 . +.Pp +Only modules needed to get to mountroot should be loaded via .Xr loader.conf 5 . .Sh SEE ALSO .Xr kldload 2 , From owner-dev-commits-src-main@freebsd.org Mon Feb 8 07:06:14 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C1141528122 for ; Mon, 8 Feb 2021 07:06:14 +0000 (UTC) (envelope-from debdrup@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYxrk56m4z4mjh for ; Mon, 8 Feb 2021 07:06:14 +0000 (UTC) (envelope-from debdrup@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1612767974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lioe1e5DOf3BcCb2bVWvYFwibKLzmaQd/ZwD7wn6aJc=; b=ZGHQeD1N5F3dPp9kvR8+QqIoHovxW7mjDTJr3ORPmuZyEnmDoYFxJvQ+hKs4+S0Pw6bgzl smURJRo94NkoWx0GQeJs/66KIYymwU6oAjrOAfJskP3Pewfx1Dp7Z0Qr2VqnTKmjTb69V5 gANaDXi0ADKBZ6MxQPMESbSCo646N1kCv9Y63cIVZqndSBKuri4vRSkERK0jl6VdsPeAi8 e7iyxPrRLAgXbP2g0U8embsisIbBZ6+qMbVO0ds01Ypq9OcIXoUniiGhgTvVmhad6fKNfj m5jVdlL91jbh6KfD7MQUwbBLqUxhao7FOIwqaYQdHXUdAEnz7pb9n/Kr6OX2nA== Received: by freefall.freebsd.org (Postfix, from userid 1471) id A0A8C1AE92; Mon, 8 Feb 2021 07:06:14 +0000 (UTC) Date: Mon, 8 Feb 2021 08:06:12 +0100 From: Daniel Ebdrup Jensen To: dev-commits-src-main@freebsd.org Subject: Re: git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5) Message-ID: <20210208070612.m2yuyofhdcfwpac3@nerd-thinkpad.local> References: <202102080704.11874w7E017472@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="o6ky3uefc2opxite" Content-Disposition: inline In-Reply-To: <202102080704.11874w7E017472@gitrepo.freebsd.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1612767974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lioe1e5DOf3BcCb2bVWvYFwibKLzmaQd/ZwD7wn6aJc=; b=aC8tRLLPDNfUjPQGTG1a7w+MXUwH2DrRbq6nFTDA/94gWe5ugHqDIMAnoUhDutEfIKm6ES J4EmBKFiIvL4bqB6b3PaSdsGp7qAXjQEjkpRd8kRK1R1RHjBuqwLVxtmBgPsZ5TJX9Qbh9 FG+qU7ll9J23d2vx1BHElCon18Oej6YZRmDgp9zYHs4x6cuv73ep4eqSqsxIKUqSA56j/Y lyyhQwOdzNPE0tsE+FjuXZMECKr4nn6d62yByCU9ksxg+sf312aDRKUFb0DhKkqlAsYBtc sZQfzWHLmcGJ1GFfMcOs09wCcW1hQL+nke6QhzVdXulpBxga9fNJ2P1DYQT37w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1612767974; a=rsa-sha256; cv=none; b=HXbtKTHeLjIT3xp8quIkAFAz6QDLoyHIEnYKlld6E+M3EWHtx96+XppL0BKWMy3XcFK0tu 1RPAGlJC+3SADp6YT89RpOG7m75IgutQG7ZaasJqOvR5szCixf0bfpm03L0MKPMgEAhg48 Obl+cy7O7WknOaHFupkiDUVQVRa9L5VII6gZ1gKs47eoNd6DqTfffOiQ/Fpk1/2ncDaBEo z6+HSaFbn19AuZtiYZ61rgYXUC47+DQa5259S7jLyjowtLWjBDFu/wD7J4MXzmC0fNLmKC UpwK0cRsN9WiYjdL6GIM8+fBG+F9XoWbMeME2EBQDRF8sNALfJX0hxzzFXe38g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 07:06:14 -0000 --o6ky3uefc2opxite Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline On Mon, Feb 08, 2021 at 07:04:58AM +0000, Daniel Ebdrup Jensen wrote: >The branch main has been updated by debdrup (doc committer): > >URL: https://cgit.FreeBSD.org/src/commit/?id=866c8b8d5ddb982c2b8139153a4ddfdb2aac3364 > >commit 866c8b8d5ddb982c2b8139153a4ddfdb2aac3364 >Author: Daniel Ebdrup Jensen >AuthorDate: 2021-02-08 06:49:32 +0000 >Commit: Daniel Ebdrup Jensen >CommitDate: 2021-02-08 06:57:36 +0000 > > kldload(8): Add note about using kld_list in rc.conf(5) > > While here, also recommend that loader.conf(5) should only be used in > order to get to mountroot, as rc(8) is less fragile, faster, and is > easier to fix by booting to single-user mode instead of having to > blacklist modules in the loader. > > MFH: 2 weeks >--- > sbin/kldload/kldload.8 | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > >diff --git a/sbin/kldload/kldload.8 b/sbin/kldload/kldload.8 >index 9401c22819d5..d95cf1fcdfe9 100644 >--- a/sbin/kldload/kldload.8 >+++ b/sbin/kldload/kldload.8 >@@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" >-.Dd April 27, 2017 >+.Dd February 8, 2021 > .Dt KLDLOAD 8 > .Os > .Sh NAME >@@ -108,6 +108,11 @@ time when the corresponding > .Xr rc.conf 5 > statement is used. > Modules may also be auto-loaded through their addition to >+.Xr loader.conf 5 >+or kld_list in >+.Xr rc.conf 5 . >+.Pp >+Only modules needed to get to mountroot should be loaded via > .Xr loader.conf 5 . > .Sh SEE ALSO > .Xr kldload 2 , >_______________________________________________ >dev-commits-src-main@freebsd.org mailing list >https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main >To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@freebsd.org" Welp, I used the wrong field for my MFC reminder. Pointy hat goes on me. --o6ky3uefc2opxite Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEEDonNJPbg/JLIMoS6Ps5hSHzN87oFAmAg4uRfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDBF ODlDRDI0RjZFMEZDOTJDODMyODRCQTNFQ0U2MTQ4N0NDREYzQkEACgkQPs5hSHzN 87r1PAf+O2iGmTd3EuIN0gT69FkLnnl4SkbjbfAatPqQ41Ysw5N8JPcE1pCtM5/C wjL7ud0ZpK5TIMBlmUAXGwDiIVw04nukWpMXjwmmKau7owHs/TIKrmInS9CKFXTx nOAZRokypoUJ65kyUFttUIN7MMeY0ynBGWDcfApF6BwfunJaM62BWJ0zAQKcyZxp 1k0ep7pdkvxMLo6r8ViO3+sEL1jnf4OOT2PXUCimWzk33/5QyPkI0TlMuI8Htwjc 65FmZxwgq+ElDwU+s6fLlcRIrE9GV32jUEN197gbxO0GTXdMhBXiTAExasO8BZOR 4UYCUSANjT2g30dK3wXUf1g09XkGYw== =c3ft -----END PGP SIGNATURE----- --o6ky3uefc2opxite-- From owner-dev-commits-src-main@freebsd.org Mon Feb 8 07:12:41 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E21AD547DFE for ; Mon, 8 Feb 2021 07:12:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (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 4DYy095w3Lz4n1h for ; Mon, 8 Feb 2021 07:12:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x729.google.com with SMTP id l27so13413551qki.9 for ; Sun, 07 Feb 2021 23:12:41 -0800 (PST) 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=NWNwJTkUHjFZeAP9sTP37Il/zdakeFw3hw66o6KcSSc=; b=kc1hkAIYJutuFxQaj4ZzOevtt5wRkwNYkK0EYu1WmkOyQizJ6005U8HtV6x6Y7/rOl IJ4W7Lq+M5f4+IwozWGaKOpbl/lpFUCTC4CWN/uDZYqYfY1/aXbtG8Tyo1270zCtqHqP BV7LgQ18tNMxuPAVTm4yrJsmGIOmZO1np76FYn29DAle8fS1dtGHeqLi6umDQ90LR7Eh rpNVq8FxKP923jVAntW7Qk9bXfCWYtLHXUysZSV3MZfoTk/zBL4A7pa5//jQtE/ME3zM cKudzXjpS5Dm8stV8Wuc0uQ5KesBGj8nHI5dfshzvSteBTTRYNldzf2lV6FgoG4KevCP 3Etg== 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=NWNwJTkUHjFZeAP9sTP37Il/zdakeFw3hw66o6KcSSc=; b=j98Nr3VHWQ9bjyvgpIv3zpuBAqRQxcSyqpf2y/1/Mlzkccz8XFVGaSiKBHaWP7yd7i x4cczYcSxN27MmzvoDsgoZKZlRgg85QNxZEfNU0x4mlL7Kh5mKGNQXa5WNDhNj8JVe2U yA2PR9KOM2ZBwNl46FrjcnOoEOvsiuFHeZWdoNj7P96RkGHkhZlYaZYq12VLgmUH/rkV 45LE+Vh5xHjGkIQxWU6wN5O9D5R27U94NNDOy2cLSyPeJVIUIDliB6Lczv4It9nhEE/l vJu4aTv+NDHnkaspMxhwTmf7ZXRistjwiXeuk+Ou7XNc6uKFG9BwS1LytTDsHWLIMZ1v lz1g== X-Gm-Message-State: AOAM5301J3/ybmGMZXn1+lbErd/wGtJCaL0b+Drc42Ix+ITu1yHlG+sJ pmNf/67trWdGPkRs3gBUpDICVD0ruOyhyyuilJUEQq47rpk= X-Google-Smtp-Source: ABdhPJw5s7so3o09PnbOTHp7I82E6KlXvm1mjJ4tJmhf3DtwPSOOLctvwdqpF1Yq5v7JM1fAuI4QMl6whOFJvubnv9E= X-Received: by 2002:a37:ad1:: with SMTP id 200mr16132228qkk.195.1612768360806; Sun, 07 Feb 2021 23:12:40 -0800 (PST) MIME-Version: 1.0 References: <202102080704.11874w7E017472@gitrepo.freebsd.org> In-Reply-To: <202102080704.11874w7E017472@gitrepo.freebsd.org> From: Warner Losh Date: Mon, 8 Feb 2021 00:12:29 -0700 Message-ID: Subject: Re: git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5) To: Daniel Ebdrup Jensen Cc: src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DYy095w3Lz4n1h X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 07:12:41 -0000 On Mon, Feb 8, 2021, 12:05 AM Daniel Ebdrup Jensen wrote: > The branch main has been updated by debdrup (doc committer): > > URL: > https://cgit.FreeBSD.org/src/commit/?id=866c8b8d5ddb982c2b8139153a4ddfdb2aac3364 > > commit 866c8b8d5ddb982c2b8139153a4ddfdb2aac3364 > Author: Daniel Ebdrup Jensen > AuthorDate: 2021-02-08 06:49:32 +0000 > Commit: Daniel Ebdrup Jensen > CommitDate: 2021-02-08 06:57:36 +0000 > > kldload(8): Add note about using kld_list in rc.conf(5) > > While here, also recommend that loader.conf(5) should only be used in > order to get to mountroot, as rc(8) is less fragile, faster, and is > easier to fix by booting to single-user mode instead of having to > blacklist modules in the loader. > I'm not sure this is good advice. The only modules that are fragile are 3rd party things like drm. It's no less hard to fix by unloading in the loader or fixing in single user. The speed difference is true, but unless the modules are huge, it isn't much. Warner MFH: 2 weeks > --- > sbin/kldload/kldload.8 | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/sbin/kldload/kldload.8 b/sbin/kldload/kldload.8 > index 9401c22819d5..d95cf1fcdfe9 100644 > --- a/sbin/kldload/kldload.8 > +++ b/sbin/kldload/kldload.8 > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd April 27, 2017 > +.Dd February 8, 2021 > .Dt KLDLOAD 8 > .Os > .Sh NAME > @@ -108,6 +108,11 @@ time when the corresponding > .Xr rc.conf 5 > statement is used. > Modules may also be auto-loaded through their addition to > +.Xr loader.conf 5 > +or kld_list in > +.Xr rc.conf 5 . > +.Pp > +Only modules needed to get to mountroot should be loaded via > .Xr loader.conf 5 . > .Sh SEE ALSO > .Xr kldload 2 , > From owner-dev-commits-src-main@freebsd.org Mon Feb 8 10:48:26 2021 Return-Path: Delivered-To: dev-commits-src-main@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 336B752D37D; Mon, 8 Feb 2021 10:48:26 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ2n52sTzz3HHk; Mon, 8 Feb 2021 10:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BA0716375; Mon, 8 Feb 2021 10:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118AmNe7004236; Mon, 8 Feb 2021 10:48:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118AmNMF004235; Mon, 8 Feb 2021 10:48:23 GMT (envelope-from git) Date: Mon, 8 Feb 2021 10:48:23 GMT Message-Id: <202102081048.118AmNMF004235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: fb8c2f743ab6 - main - arm64: optimize set_syscall_retval() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb8c2f743ab695f6004650b58bf96972e2535b20 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 10:48:26 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=fb8c2f743ab695f6004650b58bf96972e2535b20 commit fb8c2f743ab695f6004650b58bf96972e2535b20 Author: Edward Tomasz Napierala AuthorDate: 2021-02-08 10:46:29 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-08 10:46:47 +0000 arm64: optimize set_syscall_retval() Microoptimize set_syscall_retval() for arm64 by predicting the return value to be zero. This is similar to what has been done for other architectures Reviewed By: emaste, mhorne Differential Revision: https://reviews.freebsd.org/D26991 --- sys/arm64/arm64/vm_machdep.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c index 9e9b588c7db1..d4dd32caef06 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -143,12 +143,14 @@ cpu_set_syscall_retval(struct thread *td, int error) frame = td->td_frame; - switch (error) { - case 0: + if (__predict_true(error == 0)) { frame->tf_x[0] = td->td_retval[0]; frame->tf_x[1] = td->td_retval[1]; frame->tf_spsr &= ~PSR_C; /* carry bit */ - break; + return; + } + + switch (error) { case ERESTART: frame->tf_elr -= 4; break; From owner-dev-commits-src-main@freebsd.org Mon Feb 8 13:35:11 2021 Return-Path: Delivered-To: dev-commits-src-main@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 3ED3E532BCE; Mon, 8 Feb 2021 13:35:11 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ6TW1Gmpz3jcB; Mon, 8 Feb 2021 13:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E590183BC; Mon, 8 Feb 2021 13:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118DZBcB024912; Mon, 8 Feb 2021 13:35:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118DZB5F024911; Mon, 8 Feb 2021 13:35:11 GMT (envelope-from git) Date: Mon, 8 Feb 2021 13:35:11 GMT Message-Id: <202102081335.118DZB5F024911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 45d75e3ac3fb - main - netgraph/ng_base: Allow larger BINARY2ASCII conversions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 13:35:11 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f commit 45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f Author: Lutz Donnerhacke AuthorDate: 2021-02-07 21:07:34 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-08 13:31:58 +0000 netgraph/ng_base: Allow larger BINARY2ASCII conversions Allocate the necessary memory for the conversion dynamically starting with a value which is sufficient for almost all normal cases. PR: 187835 Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D23840 --- sys/netgraph/ng_base.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 6ab39421b255..63bc251f52f9 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -2771,7 +2771,7 @@ ng_generic_msg(node_p here, item_p item, hook_p lasthook) case NGM_BINARY2ASCII: { - int bufSize = 20 * 1024; /* XXX hard coded constant */ + int bufSize = 1024; const struct ng_parse_type *argstype; const struct ng_cmdlist *c; struct ng_mesg *binary, *ascii; @@ -2785,7 +2785,7 @@ ng_generic_msg(node_p here, item_p item, hook_p lasthook) error = EINVAL; break; } - +retry_b2a: /* Get a response message with lots of room */ NG_MKRESPONSE(resp, msg, sizeof(*ascii) + bufSize, M_NOWAIT); if (resp == NULL) { @@ -2827,9 +2827,13 @@ ng_generic_msg(node_p here, item_p item, hook_p lasthook) if (argstype == NULL) { *ascii->data = '\0'; } else { - if ((error = ng_unparse(argstype, - (u_char *)binary->data, - ascii->data, bufSize)) != 0) { + error = ng_unparse(argstype, (u_char *)binary->data, + ascii->data, bufSize); + if (error == ERANGE) { + NG_FREE_MSG(resp); + bufSize *= 2; + goto retry_b2a; + } else if (error) { NG_FREE_MSG(resp); break; } From owner-dev-commits-src-main@freebsd.org Mon Feb 8 14:00:33 2021 Return-Path: Delivered-To: dev-commits-src-main@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 F21F0533834; Mon, 8 Feb 2021 14:00:33 +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 4DZ72n5jqSz3lLq; Mon, 8 Feb 2021 14:00:33 +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 118E0LkO000171 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 8 Feb 2021 14:00:23 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: imp@bsdimp.com Received: from [10.58.0.10] (dadv@dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.16.1/8.16.1) with ESMTPS id 118E07Er033779 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 8 Feb 2021 21:00:07 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5) To: Warner Losh , Daniel Ebdrup Jensen References: <202102080704.11874w7E017472@gitrepo.freebsd.org> Cc: src-committers , "" , dev-commits-src-main@freebsd.org From: Eugene Grosbein Message-ID: Date: Mon, 8 Feb 2021 21:00:03 +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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, NICE_REPLY_A,SPF_HELO_NONE,T_SPF_PERMERROR 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 T_SPF_PERMERROR SPF: test of record failed (permerror) * 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: 4DZ72n5jqSz3lLq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 14:00:34 -0000 08.02.2021 14:12, Warner Losh wrote: > > > On Mon, Feb 8, 2021, 12:05 AM Daniel Ebdrup Jensen > wrote: > > The branch main has been updated by debdrup (doc committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=866c8b8d5ddb982c2b8139153a4ddfdb2aac3364 > > commit 866c8b8d5ddb982c2b8139153a4ddfdb2aac3364 > Author: Daniel Ebdrup Jensen > AuthorDate: 2021-02-08 06:49:32 +0000 > Commit: Daniel Ebdrup Jensen > CommitDate: 2021-02-08 06:57:36 +0000 > > kldload(8): Add note about using kld_list in rc.conf(5) > > While here, also recommend that loader.conf(5) should only be used in > order to get to mountroot, as rc(8) is less fragile, faster, and is > easier to fix by booting to single-user mode instead of having to > blacklist modules in the loader. > > > I'm not sure this is good advice. The only modules that are fragile are 3rd party things like drm. It's no less hard to fix by unloading in the loader or fixing in single user. The speed difference is true, but unless the modules are huge, it isn't much. +1 Plus, Daniel missed two other points: nextboot(8) facility that works with modules loaded with the loader; and possibility to point to alternative location of kernel module with *_name variable documented in the loader.conf(5) manual page. The latter makes it possible to load alternative version of same driver, real example is if_em.ko from base system vs. one from ports that has different code base and set of bugs/features. kld_list cannot do that. From owner-dev-commits-src-main@freebsd.org Mon Feb 8 14:09:01 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E1F88533BE0; Mon, 8 Feb 2021 14:09:01 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ7DY5xxmz3m3G; Mon, 8 Feb 2021 14:09:01 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (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 BA4222587A; Mon, 8 Feb 2021 14:09:01 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f45.google.com with SMTP id p12so2059349qvv.5; Mon, 08 Feb 2021 06:09:01 -0800 (PST) X-Gm-Message-State: AOAM530bdGXkN9TPqWwNkV35A06T0uyUIVK5WLmwr1WHOfuI5N+DrQvX oebaCWWpRFu+RAyILPVWhXGZNMr9+T5pdyV0jZc= X-Google-Smtp-Source: ABdhPJzabTmmdYybC8JR9jHoL1dB56n4J0U644GQcyzoLiF1C6GB/Ka7sook/oUDrq10NXs6Wm21a+10tPJ7P2cASk4= X-Received: by 2002:ad4:4f41:: with SMTP id eu1mr16092071qvb.34.1612793341290; Mon, 08 Feb 2021 06:09:01 -0800 (PST) MIME-Version: 1.0 References: <202102080704.11874w7E017472@gitrepo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Mon, 8 Feb 2021 08:08:48 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5) To: Eugene Grosbein Cc: Warner Losh , Daniel Ebdrup Jensen , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 14:09:01 -0000 On Mon, Feb 8, 2021 at 8:00 AM Eugene Grosbein wrote: > > 08.02.2021 14:12, Warner Losh wrote: > > > > > > On Mon, Feb 8, 2021, 12:05 AM Daniel Ebdrup Jensen > wrote: > > > > The branch main has been updated by debdrup (doc committer): > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D866c8b8d5ddb982c2b81= 39153a4ddfdb2aac3364 > > > > commit 866c8b8d5ddb982c2b8139153a4ddfdb2aac3364 > > Author: Daniel Ebdrup Jensen > > AuthorDate: 2021-02-08 06:49:32 +0000 > > Commit: Daniel Ebdrup Jensen > > CommitDate: 2021-02-08 06:57:36 +0000 > > > > kldload(8): Add note about using kld_list in rc.conf(5) > > > > While here, also recommend that loader.conf(5) should only be u= sed in > > order to get to mountroot, as rc(8) is less fragile, faster, an= d is > > easier to fix by booting to single-user mode instead of having = to > > blacklist modules in the loader. > > > > > > I'm not sure this is good advice. The only modules that are fragile are= 3rd party things like drm. It's no less hard to fix by unloading in the lo= ader or fixing in single user. The speed difference is true, but unless the= modules are huge, it isn't much. > > +1 > > Plus, Daniel missed two other points: nextboot(8) facility that works wit= h modules > loaded with the loader; and possibility to point to alternative location = of kernel module > with *_name variable documented in the loader.conf(5) manual page. > > The latter makes it possible to load alternative version of same driver, > real example is if_em.ko from base system vs. one from ports that has dif= ferent code base > and set of bugs/features. > > kld_list cannot do that. > Huh? kld_list accepts a full pathname, which is the same kind of specification you'd need to do with one from port in loader with *_name. From owner-dev-commits-src-main@freebsd.org Mon Feb 8 14:23:28 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6457F53475F; Mon, 8 Feb 2021 14:23:28 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ7YD2P5mz3p1Q; Mon, 8 Feb 2021 14:23:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44AEB18C51; Mon, 8 Feb 2021 14:23:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118ENSG1089506; Mon, 8 Feb 2021 14:23:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118ENSct089505; Mon, 8 Feb 2021 14:23:28 GMT (envelope-from git) Date: Mon, 8 Feb 2021 14:23:28 GMT Message-Id: <202102081423.118ENSct089505@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 1755b2b9891b - main - ktls: Use COUNTER_U64_DEFINE_EARLY MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1755b2b9891bb1bfa7a58383ef5126821f7e46e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 14:23:28 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1755b2b9891bb1bfa7a58383ef5126821f7e46e3 commit 1755b2b9891bb1bfa7a58383ef5126821f7e46e3 Author: Mark Johnston AuthorDate: 2021-02-08 14:18:51 +0000 Commit: Mark Johnston CommitDate: 2021-02-08 14:18:51 +0000 ktls: Use COUNTER_U64_DEFINE_EARLY This makes it a bit more straightforward to add new counters when debugging. No functional change intended. Reviewed by: jhb Sponsored by: Ampere Computing Submitted by: Klara, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28498 --- sys/kern/uipc_ktls.c | 63 +++++++++++++++-------------------------------- sys/opencrypto/ktls_ocf.c | 35 ++++++-------------------- 2 files changed, 28 insertions(+), 70 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 700206681965..28a63f3ce734 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -134,51 +134,51 @@ SYSCTL_BOOL(_kern_ipc_tls, OID_AUTO, cbc_enable, CTLFLAG_RW, &ktls_cbc_enable, 1, "Enable Support of AES-CBC crypto for kernel TLS"); -static counter_u64_t ktls_tasks_active; +static COUNTER_U64_DEFINE_EARLY(ktls_tasks_active); SYSCTL_COUNTER_U64(_kern_ipc_tls, OID_AUTO, tasks_active, CTLFLAG_RD, &ktls_tasks_active, "Number of active tasks"); -static counter_u64_t ktls_cnt_tx_queued; +static COUNTER_U64_DEFINE_EARLY(ktls_cnt_tx_queued); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, sw_tx_inqueue, CTLFLAG_RD, &ktls_cnt_tx_queued, "Number of TLS records in queue to tasks for SW encryption"); -static counter_u64_t ktls_cnt_rx_queued; +static COUNTER_U64_DEFINE_EARLY(ktls_cnt_rx_queued); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, sw_rx_inqueue, CTLFLAG_RD, &ktls_cnt_rx_queued, "Number of TLS sockets in queue to tasks for SW decryption"); -static counter_u64_t ktls_offload_total; +static COUNTER_U64_DEFINE_EARLY(ktls_offload_total); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, offload_total, CTLFLAG_RD, &ktls_offload_total, "Total successful TLS setups (parameters set)"); -static counter_u64_t ktls_offload_enable_calls; +static COUNTER_U64_DEFINE_EARLY(ktls_offload_enable_calls); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, enable_calls, CTLFLAG_RD, &ktls_offload_enable_calls, "Total number of TLS enable calls made"); -static counter_u64_t ktls_offload_active; +static COUNTER_U64_DEFINE_EARLY(ktls_offload_active); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, active, CTLFLAG_RD, &ktls_offload_active, "Total Active TLS sessions"); -static counter_u64_t ktls_offload_corrupted_records; +static COUNTER_U64_DEFINE_EARLY(ktls_offload_corrupted_records); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, corrupted_records, CTLFLAG_RD, &ktls_offload_corrupted_records, "Total corrupted TLS records received"); -static counter_u64_t ktls_offload_failed_crypto; +static COUNTER_U64_DEFINE_EARLY(ktls_offload_failed_crypto); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, failed_crypto, CTLFLAG_RD, &ktls_offload_failed_crypto, "Total TLS crypto failures"); -static counter_u64_t ktls_switch_to_ifnet; +static COUNTER_U64_DEFINE_EARLY(ktls_switch_to_ifnet); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, switch_to_ifnet, CTLFLAG_RD, &ktls_switch_to_ifnet, "TLS sessions switched from SW to ifnet"); -static counter_u64_t ktls_switch_to_sw; +static COUNTER_U64_DEFINE_EARLY(ktls_switch_to_sw); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, switch_to_sw, CTLFLAG_RD, &ktls_switch_to_sw, "TLS sessions switched from ifnet to SW"); -static counter_u64_t ktls_switch_failed; +static COUNTER_U64_DEFINE_EARLY(ktls_switch_failed); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, switch_failed, CTLFLAG_RD, &ktls_switch_failed, "TLS sessions unable to switch between SW and ifnet"); @@ -191,34 +191,34 @@ SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, toe, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "TOE TLS session stats"); #endif -static counter_u64_t ktls_sw_cbc; +static COUNTER_U64_DEFINE_EARLY(ktls_sw_cbc); SYSCTL_COUNTER_U64(_kern_ipc_tls_sw, OID_AUTO, cbc, CTLFLAG_RD, &ktls_sw_cbc, "Active number of software TLS sessions using AES-CBC"); -static counter_u64_t ktls_sw_gcm; +static COUNTER_U64_DEFINE_EARLY(ktls_sw_gcm); SYSCTL_COUNTER_U64(_kern_ipc_tls_sw, OID_AUTO, gcm, CTLFLAG_RD, &ktls_sw_gcm, "Active number of software TLS sessions using AES-GCM"); -static counter_u64_t ktls_ifnet_cbc; +static COUNTER_U64_DEFINE_EARLY(ktls_ifnet_cbc); SYSCTL_COUNTER_U64(_kern_ipc_tls_ifnet, OID_AUTO, cbc, CTLFLAG_RD, &ktls_ifnet_cbc, "Active number of ifnet TLS sessions using AES-CBC"); -static counter_u64_t ktls_ifnet_gcm; +static COUNTER_U64_DEFINE_EARLY(ktls_ifnet_gcm); SYSCTL_COUNTER_U64(_kern_ipc_tls_ifnet, OID_AUTO, gcm, CTLFLAG_RD, &ktls_ifnet_gcm, "Active number of ifnet TLS sessions using AES-GCM"); -static counter_u64_t ktls_ifnet_reset; +static COUNTER_U64_DEFINE_EARLY(ktls_ifnet_reset); SYSCTL_COUNTER_U64(_kern_ipc_tls_ifnet, OID_AUTO, reset, CTLFLAG_RD, &ktls_ifnet_reset, "TLS sessions updated to a new ifnet send tag"); -static counter_u64_t ktls_ifnet_reset_dropped; +static COUNTER_U64_DEFINE_EARLY(ktls_ifnet_reset_dropped); SYSCTL_COUNTER_U64(_kern_ipc_tls_ifnet, OID_AUTO, reset_dropped, CTLFLAG_RD, &ktls_ifnet_reset_dropped, "TLS sessions dropped after failing to update ifnet send tag"); -static counter_u64_t ktls_ifnet_reset_failed; +static COUNTER_U64_DEFINE_EARLY(ktls_ifnet_reset_failed); SYSCTL_COUNTER_U64(_kern_ipc_tls_ifnet, OID_AUTO, reset_failed, CTLFLAG_RD, &ktls_ifnet_reset_failed, "TLS sessions that failed to allocate a new ifnet send tag"); @@ -229,12 +229,12 @@ SYSCTL_UINT(_kern_ipc_tls_ifnet, OID_AUTO, permitted, CTLFLAG_RWTUN, "Whether to permit hardware (ifnet) TLS sessions"); #ifdef TCP_OFFLOAD -static counter_u64_t ktls_toe_cbc; +static COUNTER_U64_DEFINE_EARLY(ktls_toe_cbc); SYSCTL_COUNTER_U64(_kern_ipc_tls_toe, OID_AUTO, cbc, CTLFLAG_RD, &ktls_toe_cbc, "Active number of TOE TLS sessions using AES-CBC"); -static counter_u64_t ktls_toe_gcm; +static COUNTER_U64_DEFINE_EARLY(ktls_toe_gcm); SYSCTL_COUNTER_U64(_kern_ipc_tls_toe, OID_AUTO, gcm, CTLFLAG_RD, &ktls_toe_gcm, "Active number of TOE TLS sessions using AES-GCM"); @@ -359,29 +359,6 @@ ktls_init(void *dummy __unused) cpuset_t mask; int count, domain, error, i; - ktls_tasks_active = counter_u64_alloc(M_WAITOK); - ktls_cnt_tx_queued = counter_u64_alloc(M_WAITOK); - ktls_cnt_rx_queued = counter_u64_alloc(M_WAITOK); - ktls_offload_total = counter_u64_alloc(M_WAITOK); - ktls_offload_enable_calls = counter_u64_alloc(M_WAITOK); - ktls_offload_active = counter_u64_alloc(M_WAITOK); - ktls_offload_corrupted_records = counter_u64_alloc(M_WAITOK); - ktls_offload_failed_crypto = counter_u64_alloc(M_WAITOK); - ktls_switch_to_ifnet = counter_u64_alloc(M_WAITOK); - ktls_switch_to_sw = counter_u64_alloc(M_WAITOK); - ktls_switch_failed = counter_u64_alloc(M_WAITOK); - ktls_sw_cbc = counter_u64_alloc(M_WAITOK); - ktls_sw_gcm = counter_u64_alloc(M_WAITOK); - ktls_ifnet_cbc = counter_u64_alloc(M_WAITOK); - ktls_ifnet_gcm = counter_u64_alloc(M_WAITOK); - ktls_ifnet_reset = counter_u64_alloc(M_WAITOK); - ktls_ifnet_reset_dropped = counter_u64_alloc(M_WAITOK); - ktls_ifnet_reset_failed = counter_u64_alloc(M_WAITOK); -#ifdef TCP_OFFLOAD - ktls_toe_cbc = counter_u64_alloc(M_WAITOK); - ktls_toe_gcm = counter_u64_alloc(M_WAITOK); -#endif - rm_init(&ktls_backends_lock, "ktls backends"); LIST_INIT(&ktls_backends); diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index d66ad88729b1..7f9ece99ccb1 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -72,37 +72,37 @@ 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; +static COUNTER_U64_DEFINE_EARLY(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; +static COUNTER_U64_DEFINE_EARLY(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; +static COUNTER_U64_DEFINE_EARLY(ocf_tls12_gcm_crypts); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_gcm_crypts, CTLFLAG_RD, &ocf_tls12_gcm_crypts, "Total number of OCF TLS 1.2 GCM encryption operations"); -static counter_u64_t ocf_tls13_gcm_crypts; +static COUNTER_U64_DEFINE_EARLY(ocf_tls13_gcm_crypts); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls13_gcm_crypts, CTLFLAG_RD, &ocf_tls13_gcm_crypts, "Total number of OCF TLS 1.3 GCM encryption operations"); -static counter_u64_t ocf_inplace; +static COUNTER_U64_DEFINE_EARLY(ocf_inplace); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, inplace, CTLFLAG_RD, &ocf_inplace, "Total number of OCF in-place operations"); -static counter_u64_t ocf_separate_output; +static COUNTER_U64_DEFINE_EARLY(ocf_separate_output); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, separate_output, CTLFLAG_RD, &ocf_separate_output, "Total number of OCF operations with a separate output buffer"); -static counter_u64_t ocf_retries; +static COUNTER_U64_DEFINE_EARLY(ocf_retries); SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, retries, CTLFLAG_RD, &ocf_retries, "Number of OCF encryption operation retries"); @@ -698,30 +698,11 @@ struct ktls_crypto_backend ocf_backend = { static int ktls_ocf_modevent(module_t mod, int what, void *arg) { - int error; - 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); - ocf_separate_output = counter_u64_alloc(M_WAITOK); - ocf_retries = counter_u64_alloc(M_WAITOK); return (ktls_crypto_backend_register(&ocf_backend)); case MOD_UNLOAD: - 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); - counter_u64_free(ocf_separate_output); - counter_u64_free(ocf_retries); - return (0); + return (ktls_crypto_backend_deregister(&ocf_backend)); default: return (EOPNOTSUPP); } From owner-dev-commits-src-main@freebsd.org Mon Feb 8 14:23:29 2021 Return-Path: Delivered-To: dev-commits-src-main@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 78EB1534B03; Mon, 8 Feb 2021 14:23:29 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ7YF33wKz3ngh; Mon, 8 Feb 2021 14:23:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BEB4190AF; Mon, 8 Feb 2021 14:23:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118ENTol089528; Mon, 8 Feb 2021 14:23:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118ENTl5089527; Mon, 8 Feb 2021 14:23:29 GMT (envelope-from git) Date: Mon, 8 Feb 2021 14:23:29 GMT Message-Id: <202102081423.118ENTl5089527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b5aa9ad43aea - main - ktls: Make configuration sysctls available as tunables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5aa9ad43aead288dca0eb94fb4621991917f4e1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 14:23:29 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b5aa9ad43aead288dca0eb94fb4621991917f4e1 commit b5aa9ad43aead288dca0eb94fb4621991917f4e1 Author: Mark Johnston AuthorDate: 2021-02-08 14:19:02 +0000 Commit: Mark Johnston CommitDate: 2021-02-08 14:19:02 +0000 ktls: Make configuration sysctls available as tunables Reviewed by: gallatin, jhb Sponsored by: Ampere Computing Submitted by: Klara, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28499 --- sys/kern/uipc_ktls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 28a63f3ce734..26912e410239 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -125,12 +125,12 @@ SYSCTL_INT(_kern_ipc_tls_stats, OID_AUTO, threads, CTLFLAG_RD, "Number of TLS threads in thread-pool"); static bool ktls_offload_enable; -SYSCTL_BOOL(_kern_ipc_tls, OID_AUTO, enable, CTLFLAG_RW, +SYSCTL_BOOL(_kern_ipc_tls, OID_AUTO, enable, CTLFLAG_RWTUN, &ktls_offload_enable, 0, "Enable support for kernel TLS offload"); static bool ktls_cbc_enable = true; -SYSCTL_BOOL(_kern_ipc_tls, OID_AUTO, cbc_enable, CTLFLAG_RW, +SYSCTL_BOOL(_kern_ipc_tls, OID_AUTO, cbc_enable, CTLFLAG_RWTUN, &ktls_cbc_enable, 1, "Enable Support of AES-CBC crypto for kernel TLS"); From owner-dev-commits-src-main@freebsd.org Mon Feb 8 14:23:34 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2ED425347CC; Mon, 8 Feb 2021 14:23:34 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ7YH011zz3p04; Mon, 8 Feb 2021 14:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAF4318EE3; Mon, 8 Feb 2021 14:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118ENUVi089547; Mon, 8 Feb 2021 14:23:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118ENUp2089546; Mon, 8 Feb 2021 14:23:30 GMT (envelope-from git) Date: Mon, 8 Feb 2021 14:23:30 GMT Message-Id: <202102081423.118ENUp2089546@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 0dc7076037a8 - main - armv8crypto: Fix some edge cases in the AES-GCM implementation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0dc7076037a87100060309f7179ef6a01f32f99e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 14:23:37 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0dc7076037a87100060309f7179ef6a01f32f99e commit 0dc7076037a87100060309f7179ef6a01f32f99e Author: Mark Johnston AuthorDate: 2021-02-08 14:19:07 +0000 Commit: Mark Johnston CommitDate: 2021-02-08 14:19:07 +0000 armv8crypto: Fix some edge cases in the AES-GCM implementation - We were only hashing up to the first 16 bytes of the AAD. - When computing the digest during decryption, handle the case where len == trailer, i.e., len < AES_BLOCK_LEN, properly. While here: - trailer is always smaller than AES_BLOCK_LEN, so remove a pair of unnecessary modulus operations. - Replace some byte-by-byte loops with memcpy() and memset() calls. In particular, zero the full block before copying a partial block into it since we do that elsewhere and it means that the memset() length is known at compile time. Reviewed by: jhb Sponsored by: Ampere Computing Submitted by: Klara, Inc. MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28501 --- sys/crypto/armv8/armv8_crypto_wrap.c | 47 ++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/sys/crypto/armv8/armv8_crypto_wrap.c b/sys/crypto/armv8/armv8_crypto_wrap.c index ea93f1b9a176..2f880258bf46 100644 --- a/sys/crypto/armv8/armv8_crypto_wrap.c +++ b/sys/crypto/armv8/armv8_crypto_wrap.c @@ -263,9 +263,16 @@ armv8_aes_encrypt_gcm(AES_key_t *aes_key, size_t len, aes_counter[AES_BLOCK_LEN - 1] = 2; memset(Xi.c, 0, sizeof(Xi.c)); - memset(block, 0, sizeof(block)); - memcpy(block, authdata, min(authdatalen, sizeof(block))); - gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); + trailer = authdatalen % AES_BLOCK_LEN; + if (authdatalen - trailer > 0) { + gcm_ghash_v8(Xi.u, Htable, authdata, authdatalen - trailer); + authdata += authdatalen - trailer; + } + if (trailer > 0 || authdatalen == 0) { + memset(block, 0, sizeof(block)); + memcpy(block, authdata, trailer); + gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); + } from64 = (const uint64_t*)from; to64 = (uint64_t*)to; @@ -288,13 +295,11 @@ armv8_aes_encrypt_gcm(AES_key_t *aes_key, size_t len, if (trailer) { aes_v8_encrypt(aes_counter, EKi.c, aes_key); AES_INC_COUNTER(aes_counter); + memset(block, 0, sizeof(block)); for (i = 0; i < trailer; i++) { - block[i] = to[i] = from[i] ^ EKi.c[i % AES_BLOCK_LEN]; + block[i] = to[i] = from[i] ^ EKi.c[i]; } - for (; i < AES_BLOCK_LEN; i++) - block[i] = 0; - gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); } @@ -343,17 +348,23 @@ armv8_aes_decrypt_gcm(AES_key_t *aes_key, size_t len, aes_v8_encrypt(aes_counter, EK0.c, aes_key); memset(Xi.c, 0, sizeof(Xi.c)); - memset(block, 0, sizeof(block)); - memcpy(block, authdata, min(authdatalen, sizeof(block))); - gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); - trailer = len % AES_BLOCK_LEN; - gcm_ghash_v8(Xi.u, Htable, from, len - trailer); + trailer = authdatalen % AES_BLOCK_LEN; + if (authdatalen - trailer > 0) { + gcm_ghash_v8(Xi.u, Htable, authdata, authdatalen - trailer); + authdata += authdatalen - trailer; + } + if (trailer > 0 || authdatalen == 0) { + memset(block, 0, sizeof(block)); + memcpy(block, authdata, trailer); + gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); + } - if (trailer) { - for (i = 0; i < trailer; i++) - block[i] = from[len - trailer + i]; - for (; i < AES_BLOCK_LEN; i++) - block[i] = 0; + trailer = len % AES_BLOCK_LEN; + if (len - trailer > 0) + gcm_ghash_v8(Xi.u, Htable, from, len - trailer); + if (trailer > 0) { + memset(block, 0, sizeof(block)); + memcpy(block, from + len - trailer, trailer); gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); } @@ -392,7 +403,7 @@ armv8_aes_decrypt_gcm(AES_key_t *aes_key, size_t len, aes_v8_encrypt(aes_counter, EKi.c, aes_key); AES_INC_COUNTER(aes_counter); for (i = 0; i < trailer; i++) - to[i] = from[i] ^ EKi.c[i % AES_BLOCK_LEN]; + to[i] = from[i] ^ EKi.c[i]; } out: From owner-dev-commits-src-main@freebsd.org Mon Feb 8 14:23:37 2021 Return-Path: Delivered-To: dev-commits-src-main@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 66FDB534B80; Mon, 8 Feb 2021 14:23:36 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ7YM3PX8z3nkm; Mon, 8 Feb 2021 14:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0043B18EE4; Mon, 8 Feb 2021 14:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118ENXk7089609; Mon, 8 Feb 2021 14:23:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118ENXdF089608; Mon, 8 Feb 2021 14:23:33 GMT (envelope-from git) Date: Mon, 8 Feb 2021 14:23:33 GMT Message-Id: <202102081423.118ENXdF089608@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: db6b56441e3a - main - ktls: Avoid wakeups and locking for synchronous callbacks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db6b56441e3a142e7fe58a5a85d9071e772a943e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 14:23:37 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=db6b56441e3a142e7fe58a5a85d9071e772a943e commit db6b56441e3a142e7fe58a5a85d9071e772a943e Author: Mark Johnston AuthorDate: 2021-02-08 14:19:27 +0000 Commit: Mark Johnston CommitDate: 2021-02-08 14:19:27 +0000 ktls: Avoid wakeups and locking for synchronous callbacks When performing encryption in software, the KTLS crypto callback always locks the session to deliver a wakeup. But, if we're handling the operation synchronously this is wasted effort and can result in sleepqueue lock contention on large systems. Use CRYPTO_SESS_SYNC() to determine whether the operation will be completed asynchronously or not, and select a callback appropriately. Avoid locking the session to check for completion if the session handles requests synchronously. Reviewed by: jhb Sponsored by: Ampere Computing Submitted by: Klara, Inc. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28195 --- sys/opencrypto/ktls_ocf.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index 7f9ece99ccb1..28c55257b047 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -108,7 +108,13 @@ SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, retries, CTLFLAG_RD, "Number of OCF encryption operation retries"); static int -ktls_ocf_callback(struct cryptop *crp) +ktls_ocf_callback_sync(struct cryptop *crp __unused) +{ + return (0); +} + +static int +ktls_ocf_callback_async(struct cryptop *crp) { struct ocf_operation *oo; @@ -125,21 +131,26 @@ ktls_ocf_dispatch(struct ocf_session *os, struct cryptop *crp) { struct ocf_operation oo; int error; + bool async; oo.os = os; oo.done = false; crp->crp_opaque = &oo; - crp->crp_callback = ktls_ocf_callback; for (;;) { + async = !CRYPTO_SESS_SYNC(crp->crp_session); + crp->crp_callback = async ? ktls_ocf_callback_async : + ktls_ocf_callback_sync; + error = crypto_dispatch(crp); if (error) break; - - mtx_lock(&os->lock); - while (!oo.done) - mtx_sleep(&oo, &os->lock, 0, "ocfktls", 0); - mtx_unlock(&os->lock); + if (async) { + mtx_lock(&os->lock); + while (!oo.done) + mtx_sleep(&oo, &os->lock, 0, "ocfktls", 0); + mtx_unlock(&os->lock); + } if (crp->crp_etype != EAGAIN) { error = crp->crp_etype; From owner-dev-commits-src-main@freebsd.org Mon Feb 8 14:23:35 2021 Return-Path: Delivered-To: dev-commits-src-main@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 7DA2E53484A; Mon, 8 Feb 2021 14:23:35 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ7YK2Bpxz3nh2; Mon, 8 Feb 2021 14:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED22719276; Mon, 8 Feb 2021 14:23:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118ENVAT089569; Mon, 8 Feb 2021 14:23:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118ENVnL089568; Mon, 8 Feb 2021 14:23:31 GMT (envelope-from git) Date: Mon, 8 Feb 2021 14:23:31 GMT Message-Id: <202102081423.118ENVnL089568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 7509b677b413 - main - armv8crypto: Extract GCM state into a structure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7509b677b413b9551c15b483ec2ed9ce655d2455 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 14:23:37 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7509b677b413b9551c15b483ec2ed9ce655d2455 commit 7509b677b413b9551c15b483ec2ed9ce655d2455 Author: Mark Johnston AuthorDate: 2021-02-08 14:19:10 +0000 Commit: Mark Johnston CommitDate: 2021-02-08 14:19:10 +0000 armv8crypto: Extract GCM state into a structure This makes it easier to refactor the GCM code to operate on crypto_buffer_cursors rather than plain contiguous buffers, with the aim of minimizing the amount of copying and zeroing done today. No functional change intended. Reviewed by: jhb MFC after: 1 week Sponsored by: Ampere Computing Submitted by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D28500 --- sys/crypto/armv8/armv8_crypto_wrap.c | 135 +++++++++++++++++------------------ 1 file changed, 65 insertions(+), 70 deletions(-) diff --git a/sys/crypto/armv8/armv8_crypto_wrap.c b/sys/crypto/armv8/armv8_crypto_wrap.c index 2f880258bf46..eb4a431d33e9 100644 --- a/sys/crypto/armv8/armv8_crypto_wrap.c +++ b/sys/crypto/armv8/armv8_crypto_wrap.c @@ -234,6 +234,14 @@ armv8_aes_decrypt_xts(AES_key_t *data_schedule, break; \ } while (0) +struct armv8_gcm_state { + __uint128_val_t EK0; + __uint128_val_t EKi; + __uint128_val_t Xi; + __uint128_val_t lenblock; + uint8_t aes_counter[AES_BLOCK_LEN]; +}; + void armv8_aes_encrypt_gcm(AES_key_t *aes_key, size_t len, const uint8_t *from, uint8_t *to, @@ -242,36 +250,34 @@ armv8_aes_encrypt_gcm(AES_key_t *aes_key, size_t len, const uint8_t iv[static AES_GCM_IV_LEN], const __uint128_val_t *Htable) { - size_t i; + struct armv8_gcm_state s; const uint64_t *from64; uint64_t *to64; - uint8_t aes_counter[AES_BLOCK_LEN]; uint8_t block[AES_BLOCK_LEN]; - size_t trailer; - __uint128_val_t EK0, EKi, Xi, lenblock; + size_t i, trailer; - bzero(&aes_counter, AES_BLOCK_LEN); - memcpy(aes_counter, iv, AES_GCM_IV_LEN); + bzero(&s.aes_counter, AES_BLOCK_LEN); + memcpy(s.aes_counter, iv, AES_GCM_IV_LEN); /* Setup the counter */ - aes_counter[AES_BLOCK_LEN - 1] = 1; + s.aes_counter[AES_BLOCK_LEN - 1] = 1; /* EK0 for a final GMAC round */ - aes_v8_encrypt(aes_counter, EK0.c, aes_key); + aes_v8_encrypt(s.aes_counter, s.EK0.c, aes_key); /* GCM starts with 2 as counter, 1 is used for final xor of tag. */ - aes_counter[AES_BLOCK_LEN - 1] = 2; + s.aes_counter[AES_BLOCK_LEN - 1] = 2; - memset(Xi.c, 0, sizeof(Xi.c)); + memset(s.Xi.c, 0, sizeof(s.Xi.c)); trailer = authdatalen % AES_BLOCK_LEN; if (authdatalen - trailer > 0) { - gcm_ghash_v8(Xi.u, Htable, authdata, authdatalen - trailer); + gcm_ghash_v8(s.Xi.u, Htable, authdata, authdatalen - trailer); authdata += authdatalen - trailer; } if (trailer > 0 || authdatalen == 0) { memset(block, 0, sizeof(block)); memcpy(block, authdata, trailer); - gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); + gcm_ghash_v8(s.Xi.u, Htable, block, AES_BLOCK_LEN); } from64 = (const uint64_t*)from; @@ -279,11 +285,11 @@ armv8_aes_encrypt_gcm(AES_key_t *aes_key, size_t len, trailer = len % AES_BLOCK_LEN; for (i = 0; i < (len - trailer); i += AES_BLOCK_LEN) { - aes_v8_encrypt(aes_counter, EKi.c, aes_key); - AES_INC_COUNTER(aes_counter); - to64[0] = from64[0] ^ EKi.u[0]; - to64[1] = from64[1] ^ EKi.u[1]; - gcm_ghash_v8(Xi.u, Htable, (uint8_t*)to64, AES_BLOCK_LEN); + aes_v8_encrypt(s.aes_counter, s.EKi.c, aes_key); + AES_INC_COUNTER(s.aes_counter); + to64[0] = from64[0] ^ s.EKi.u[0]; + to64[1] = from64[1] ^ s.EKi.u[1]; + gcm_ghash_v8(s.Xi.u, Htable, (uint8_t*)to64, AES_BLOCK_LEN); to64 += 2; from64 += 2; @@ -293,31 +299,27 @@ armv8_aes_encrypt_gcm(AES_key_t *aes_key, size_t len, from += (len - trailer); if (trailer) { - aes_v8_encrypt(aes_counter, EKi.c, aes_key); - AES_INC_COUNTER(aes_counter); + aes_v8_encrypt(s.aes_counter, s.EKi.c, aes_key); + AES_INC_COUNTER(s.aes_counter); memset(block, 0, sizeof(block)); for (i = 0; i < trailer; i++) { - block[i] = to[i] = from[i] ^ EKi.c[i]; + block[i] = to[i] = from[i] ^ s.EKi.c[i]; } - gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); + gcm_ghash_v8(s.Xi.u, Htable, block, AES_BLOCK_LEN); } /* Lengths block */ - lenblock.u[0] = lenblock.u[1] = 0; - lenblock.d[1] = htobe32(authdatalen * 8); - lenblock.d[3] = htobe32(len * 8); - gcm_ghash_v8(Xi.u, Htable, lenblock.c, AES_BLOCK_LEN); - - Xi.u[0] ^= EK0.u[0]; - Xi.u[1] ^= EK0.u[1]; - memcpy(tag, Xi.c, GMAC_DIGEST_LEN); - - explicit_bzero(aes_counter, sizeof(aes_counter)); - explicit_bzero(Xi.c, sizeof(Xi.c)); - explicit_bzero(EK0.c, sizeof(EK0.c)); - explicit_bzero(EKi.c, sizeof(EKi.c)); - explicit_bzero(lenblock.c, sizeof(lenblock.c)); + s.lenblock.u[0] = s.lenblock.u[1] = 0; + s.lenblock.d[1] = htobe32(authdatalen * 8); + s.lenblock.d[3] = htobe32(len * 8); + gcm_ghash_v8(s.Xi.u, Htable, s.lenblock.c, AES_BLOCK_LEN); + + s.Xi.u[0] ^= s.EK0.u[0]; + s.Xi.u[1] ^= s.EK0.u[1]; + memcpy(tag, s.Xi.c, GMAC_DIGEST_LEN); + + explicit_bzero(&s, sizeof(s)); } int @@ -328,70 +330,68 @@ armv8_aes_decrypt_gcm(AES_key_t *aes_key, size_t len, const uint8_t iv[static AES_GCM_IV_LEN], const __uint128_val_t *Htable) { - size_t i; + struct armv8_gcm_state s; const uint64_t *from64; uint64_t *to64; - uint8_t aes_counter[AES_BLOCK_LEN]; uint8_t block[AES_BLOCK_LEN]; - size_t trailer; - __uint128_val_t EK0, EKi, Xi, lenblock; + size_t i, trailer; int error; error = 0; - bzero(&aes_counter, AES_BLOCK_LEN); - memcpy(aes_counter, iv, AES_GCM_IV_LEN); + bzero(&s.aes_counter, AES_BLOCK_LEN); + memcpy(s.aes_counter, iv, AES_GCM_IV_LEN); /* Setup the counter */ - aes_counter[AES_BLOCK_LEN - 1] = 1; + s.aes_counter[AES_BLOCK_LEN - 1] = 1; /* EK0 for a final GMAC round */ - aes_v8_encrypt(aes_counter, EK0.c, aes_key); + aes_v8_encrypt(s.aes_counter, s.EK0.c, aes_key); - memset(Xi.c, 0, sizeof(Xi.c)); + memset(s.Xi.c, 0, sizeof(s.Xi.c)); trailer = authdatalen % AES_BLOCK_LEN; if (authdatalen - trailer > 0) { - gcm_ghash_v8(Xi.u, Htable, authdata, authdatalen - trailer); + gcm_ghash_v8(s.Xi.u, Htable, authdata, authdatalen - trailer); authdata += authdatalen - trailer; } if (trailer > 0 || authdatalen == 0) { memset(block, 0, sizeof(block)); memcpy(block, authdata, trailer); - gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); + gcm_ghash_v8(s.Xi.u, Htable, block, AES_BLOCK_LEN); } trailer = len % AES_BLOCK_LEN; if (len - trailer > 0) - gcm_ghash_v8(Xi.u, Htable, from, len - trailer); + gcm_ghash_v8(s.Xi.u, Htable, from, len - trailer); if (trailer > 0) { memset(block, 0, sizeof(block)); memcpy(block, from + len - trailer, trailer); - gcm_ghash_v8(Xi.u, Htable, block, AES_BLOCK_LEN); + gcm_ghash_v8(s.Xi.u, Htable, block, AES_BLOCK_LEN); } /* Lengths block */ - lenblock.u[0] = lenblock.u[1] = 0; - lenblock.d[1] = htobe32(authdatalen * 8); - lenblock.d[3] = htobe32(len * 8); - gcm_ghash_v8(Xi.u, Htable, lenblock.c, AES_BLOCK_LEN); - - Xi.u[0] ^= EK0.u[0]; - Xi.u[1] ^= EK0.u[1]; - if (timingsafe_bcmp(tag, Xi.c, GMAC_DIGEST_LEN) != 0) { + s.lenblock.u[0] = s.lenblock.u[1] = 0; + s.lenblock.d[1] = htobe32(authdatalen * 8); + s.lenblock.d[3] = htobe32(len * 8); + gcm_ghash_v8(s.Xi.u, Htable, s.lenblock.c, AES_BLOCK_LEN); + + s.Xi.u[0] ^= s.EK0.u[0]; + s.Xi.u[1] ^= s.EK0.u[1]; + if (timingsafe_bcmp(tag, s.Xi.c, GMAC_DIGEST_LEN) != 0) { error = EBADMSG; goto out; } /* GCM starts with 2 as counter, 1 is used for final xor of tag. */ - aes_counter[AES_BLOCK_LEN - 1] = 2; + s.aes_counter[AES_BLOCK_LEN - 1] = 2; from64 = (const uint64_t*)from; to64 = (uint64_t*)to; for (i = 0; i < (len - trailer); i += AES_BLOCK_LEN) { - aes_v8_encrypt(aes_counter, EKi.c, aes_key); - AES_INC_COUNTER(aes_counter); - to64[0] = from64[0] ^ EKi.u[0]; - to64[1] = from64[1] ^ EKi.u[1]; + aes_v8_encrypt(s.aes_counter, s.EKi.c, aes_key); + AES_INC_COUNTER(s.aes_counter); + to64[0] = from64[0] ^ s.EKi.u[0]; + to64[1] = from64[1] ^ s.EKi.u[1]; to64 += 2; from64 += 2; } @@ -400,18 +400,13 @@ armv8_aes_decrypt_gcm(AES_key_t *aes_key, size_t len, from += (len - trailer); if (trailer) { - aes_v8_encrypt(aes_counter, EKi.c, aes_key); - AES_INC_COUNTER(aes_counter); + aes_v8_encrypt(s.aes_counter, s.EKi.c, aes_key); + AES_INC_COUNTER(s.aes_counter); for (i = 0; i < trailer; i++) - to[i] = from[i] ^ EKi.c[i]; + to[i] = from[i] ^ s.EKi.c[i]; } out: - explicit_bzero(aes_counter, sizeof(aes_counter)); - explicit_bzero(Xi.c, sizeof(Xi.c)); - explicit_bzero(EK0.c, sizeof(EK0.c)); - explicit_bzero(EKi.c, sizeof(EKi.c)); - explicit_bzero(lenblock.c, sizeof(lenblock.c)); - + explicit_bzero(&s, sizeof(s)); return (error); } From owner-dev-commits-src-main@freebsd.org Mon Feb 8 14:23:37 2021 Return-Path: Delivered-To: dev-commits-src-main@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 362685347CF; Mon, 8 Feb 2021 14:23:37 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ7YN1BDCz3nnH; Mon, 8 Feb 2021 14:23:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15E18190B1; Mon, 8 Feb 2021 14:23:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118ENYob089631; Mon, 8 Feb 2021 14:23:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118ENYqO089630; Mon, 8 Feb 2021 14:23:34 GMT (envelope-from git) Date: Mon, 8 Feb 2021 14:23:34 GMT Message-Id: <202102081423.118ENYqO089630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c7fcb36f5670 - main - binmiscctl: Avoid segfault with "binmiscctl add" and no extra params MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7fcb36f5670b1d6c1f80c3c29d9d2ba374807f7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 14:23:37 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c7fcb36f5670b1d6c1f80c3c29d9d2ba374807f7 commit c7fcb36f5670b1d6c1f80c3c29d9d2ba374807f7 Author: Mark Johnston AuthorDate: 2021-02-08 14:20:38 +0000 Commit: Mark Johnston CommitDate: 2021-02-08 14:20:38 +0000 binmiscctl: Avoid segfault with "binmiscctl add" and no extra params MFC after: 1 week --- usr.sbin/binmiscctl/binmiscctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/binmiscctl/binmiscctl.c b/usr.sbin/binmiscctl/binmiscctl.c index 471f4c2c68dd..3c5e19def67b 100644 --- a/usr.sbin/binmiscctl/binmiscctl.c +++ b/usr.sbin/binmiscctl/binmiscctl.c @@ -284,6 +284,8 @@ add_cmd(__unused int argc, char *argv[], ximgact_binmisc_entry_t *xbe) char *magic = NULL, *mask = NULL; int sz; + if (argc == 0) + usage("Required argument missing\n"); if (strlen(argv[0]) > IBE_NAME_MAX) usage("'%s' string length longer than IBE_NAME_MAX (%d)", IBE_NAME_MAX); From owner-dev-commits-src-main@freebsd.org Mon Feb 8 14:23:37 2021 Return-Path: Delivered-To: dev-commits-src-main@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 BE0805347CD; Mon, 8 Feb 2021 14:23:35 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ7YL6MjNz3p0J; Mon, 8 Feb 2021 14:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9499190B0; Mon, 8 Feb 2021 14:23:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118ENWBs089591; Mon, 8 Feb 2021 14:23:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118ENWnK089590; Mon, 8 Feb 2021 14:23:32 GMT (envelope-from git) Date: Mon, 8 Feb 2021 14:23:32 GMT Message-Id: <202102081423.118ENWnK089590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 68f6800ce05c - main - opencrypto: Introduce crypto_dispatch_async() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 68f6800ce05c386ff045b4416d8595d09c4d8fdd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 14:23:37 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=68f6800ce05c386ff045b4416d8595d09c4d8fdd commit 68f6800ce05c386ff045b4416d8595d09c4d8fdd Author: Mark Johnston AuthorDate: 2021-02-08 14:19:19 +0000 Commit: Mark Johnston CommitDate: 2021-02-08 14:19:19 +0000 opencrypto: Introduce crypto_dispatch_async() Currently, OpenCrypto consumers can request asynchronous dispatch by setting a flag in the cryptop. (Currently only IPSec may do this.) I think this is a bit confusing: we (conditionally) set cryptop flags to request async dispatch, and then crypto_dispatch() immediately examines those flags to see if the consumer wants async dispatch. The flag names are also confusing since they don't specify what "async" applies to: dispatch or completion. Add a new KPI, crypto_dispatch_async(), rather than encoding the requested dispatch type in each cryptop. crypto_dispatch_async() falls back to crypto_dispatch() if the session's driver provides asynchronous dispatch. Get rid of CRYPTOP_ASYNC() and CRYPTOP_ASYNC_KEEPORDER(). Similarly, add crypto_dispatch_batch() to request processing of a tailq of cryptops, rather than encoding the scheduling policy using cryptop flags. Convert GELI, the only user of this interface (disabled by default) to use the new interface. Add CRYPTO_SESS_SYNC(), which can be used by consumers to determine whether crypto requests will be dispatched synchronously. This is just a helper macro. Use it instead of looking at cap flags directly. Fix style in crypto_done(). Also get rid of CRYPTO_RETW_EMPTY() and just check the relevant queues directly. This could result in some unnecessary wakeups but I think it's very uncommon to be using more than one queue per worker in a given workload, so checking all three queues is a waste of cycles. Reviewed by: jhb Sponsored by: Ampere Computing Submitted by: Klara, Inc. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28194 --- share/man/man9/crypto_request.9 | 112 +++++++++++++++--------------- sys/geom/eli/g_eli_integrity.c | 20 ++++-- sys/geom/eli/g_eli_privacy.c | 24 ++++--- sys/kgssapi/krb5/kcrypto_aes.c | 6 +- sys/netipsec/xform_ah.c | 14 ++-- sys/netipsec/xform_esp.c | 14 ++-- sys/opencrypto/crypto.c | 146 +++++++++++++++++++++++----------------- sys/opencrypto/cryptodev.h | 23 +++---- sys/sys/param.h | 2 +- 9 files changed, 199 insertions(+), 162 deletions(-) diff --git a/share/man/man9/crypto_request.9 b/share/man/man9/crypto_request.9 index 6253e49dfb32..eb259f96be5e 100644 --- a/share/man/man9/crypto_request.9 +++ b/share/man/man9/crypto_request.9 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 12, 2020 +.Dd February 8, 2021 .Dt CRYPTO_REQUEST 9 .Os .Sh NAME @@ -40,6 +40,10 @@ .In opencrypto/cryptodev.h .Ft int .Fn crypto_dispatch "struct cryptop *crp" +.Ft int +.Fn crypto_dispatch_async "struct cryptop *crp" "int flags" +.Ft void +.Fn crypto_dispatch_batch "struct cryptopq *crpq" "int flags" .Ft void .Fn crypto_destroyreq "struct cryptop *crp" .Ft void @@ -104,10 +108,15 @@ the caller should set fields in the structure to describe request-specific parameters. Unused fields should be left as-is. .Pp -.Fn crypto_dispatch -passes a crypto request to the driver attached to the request's session. -If there are errors in the request's fields, this function may return -an error to the caller. +The +.Fn crypto_dispatch , +.Fn crypto_dispatch_async , +and +.Fn crypto_dispatch_batch +functions pass one or more crypto requests to the driver attached to the +request's session. +If there are errors in the request's fields, these functions may return an +error to the caller. If errors are encountered while servicing the request, they will instead be reported to the request's callback function .Pq Fa crp_callback @@ -341,64 +350,53 @@ store the partial IV in the data buffer and pass the full IV separately in .Ss Request and Callback Scheduling The crypto framework provides multiple methods of scheduling the dispatch of requests to drivers along with the processing of driver callbacks. -Requests use flags in -.Fa crp_flags -to select the desired scheduling methods. +The +.Fn crypto_dispatch , +.Fn crypto_dispatch_async , +and +.Fn crypto_dispatch_batch +functions can be used to request different dispatch scheduling policies. .Pp .Fn crypto_dispatch -can pass the request to the session's driver via three different methods: -.Bl -enum -.It -The request is queued to a taskqueue backed by a pool of worker threads. +synchronously passes the request to the driver. +The driver itself may process the request synchronously or asynchronously +depending on whether the driver is implemented by software or hardware. +.Pp +.Fn crypto_dispatch_async +dispatches the request asynchronously. +If the driver is inherently synchronous, the request is queued to a taskqueue +backed by a pool of worker threads. +This can increase througput by allowing requests from a single producer to be +processed in parallel. By default the pool is sized to provide one thread for each CPU. -Worker threads dequeue requests and pass them to the driver -asynchronously. -.It -The request is passed to the driver synchronously in the context of the -thread invoking +Worker threads dequeue requests and pass them to the driver asynchronously. +.Fn crypto_dispatch_async +additionally takes a +.Va flags +parameter. +The +.Dv CRYPTO_ASYNC_ORDERED +flag indicates that completion callbacks for requests must be called in the +same order as requests were dispatched. +If the driver is asynchronous, the behavior of +.Fn crypto_dispatch_async +is identical to that of .Fn crypto_dispatch . -.It -The request is queued to a queue of pending requests. -A single worker thread dequeues requests and passes them to the driver -asynchronously. -.El .Pp -To select the first method (taskqueue backed by multiple threads), -requests should set -.Dv CRYPTO_F_ASYNC . -To always use the third method (queue to single worker thread), -requests should set -.Dv CRYPTO_F_BATCH . -If both flags are set, -.Dv CRYPTO_F_ASYNC -takes precedence. -If neither flag is set, -.Fn crypto_dispatch -will first attempt the second method (invoke driver synchronously). -If the driver is blocked, -the request will be queued using the third method. -One caveat is that the first method is only used for requests using software -drivers which use host CPUs to process requests. -Requests whose session is associated with a hardware driver will ignore -.Dv CRYPTO_F_ASYNC -and only use -.Dv CRYPTO_F_BATCH -to determine how requests should be scheduled. -.Pp -In addition to bypassing synchronous dispatch in -.Fn crypto_dispatch , -.Dv CRYPTO_F_BATCH -requests additional changes aimed at optimizing batches of requests to -the same driver. -When the worker thread processes a request with -.Dv CRYPTO_F_BATCH , -it will search the pending request queue for any other requests for the same -driver, -including requests from different sessions. -If any other requests are present, +.Fn crypto_dispatch_batch +allows the caller to collect a batch of requests and submit them to the driver +at the same time. +This allows hardware drivers to optimize the scheduling of request processing +and batch completion interrupts. +A batch is submitted to the driver by invoking the driver's process method on +each request, specifying .Dv CRYPTO_HINT_MORE -is passed to the driver's process method. -Drivers may use this to batch completion interrupts. +with each request except for the last. +The +.Fa flags +parameter to +.Fn crypto_dispatch_batch +is currently ignored. .Pp Callback function scheduling is simpler than request scheduling. Callbacks can either be invoked synchronously from diff --git a/sys/geom/eli/g_eli_integrity.c b/sys/geom/eli/g_eli_integrity.c index 4cf982e3ddfa..e79ec136aa2e 100644 --- a/sys/geom/eli/g_eli_integrity.c +++ b/sys/geom/eli/g_eli_integrity.c @@ -449,11 +449,13 @@ void g_eli_auth_run(struct g_eli_worker *wr, struct bio *bp) { struct g_eli_softc *sc; + struct cryptopq crpq; struct cryptop *crp; u_int i, lsec, nsec, data_secsize, decr_secsize, encr_secsize; off_t dstoff; u_char *p, *data, *authkey, *plaindata; int error; + bool batch; G_ELI_LOGREQ(3, bp, "%s", __func__); @@ -496,6 +498,9 @@ g_eli_auth_run(struct g_eli_worker *wr, struct bio *bp) p = (char *)roundup((uintptr_t)p, sizeof(uintptr_t)); #endif + TAILQ_INIT(&crpq); + batch = atomic_load_int(&g_eli_batch) != 0; + for (i = 1; i <= nsec; i++, dstoff += encr_secsize) { crp = crypto_getreq(wr->w_sid, M_WAITOK); authkey = (u_char *)p; p += G_ELI_AUTH_SECKEYLEN; @@ -521,8 +526,6 @@ g_eli_auth_run(struct g_eli_worker *wr, struct bio *bp) crp->crp_opaque = (void *)bp; data += encr_secsize; crp->crp_flags = CRYPTO_F_CBIFSYNC; - if (g_eli_batch) - crp->crp_flags |= CRYPTO_F_BATCH; if (bp->bio_cmd == BIO_WRITE) { crp->crp_callback = g_eli_auth_write_done; crp->crp_op = CRYPTO_OP_ENCRYPT | @@ -549,8 +552,15 @@ g_eli_auth_run(struct g_eli_worker *wr, struct bio *bp) g_eli_auth_keygen(sc, dstoff, authkey); crp->crp_auth_key = authkey; - error = crypto_dispatch(crp); - KASSERT(error == 0, ("crypto_dispatch() failed (error=%d)", - error)); + if (batch) { + TAILQ_INSERT_TAIL(&crpq, crp, crp_next); + } else { + error = crypto_dispatch(crp); + KASSERT(error == 0, + ("crypto_dispatch() failed (error=%d)", error)); + } } + + if (batch) + crypto_dispatch_batch(&crpq, 0); } diff --git a/sys/geom/eli/g_eli_privacy.c b/sys/geom/eli/g_eli_privacy.c index adb353441e3d..f4e0416cc828 100644 --- a/sys/geom/eli/g_eli_privacy.c +++ b/sys/geom/eli/g_eli_privacy.c @@ -261,13 +261,14 @@ void g_eli_crypto_run(struct g_eli_worker *wr, struct bio *bp) { struct g_eli_softc *sc; + struct cryptopq crpq; struct cryptop *crp; vm_page_t *pages; u_int i, nsec, secsize; off_t dstoff; u_char *data = NULL; - int error; - int pages_offset; + int error, pages_offset; + bool batch; G_ELI_LOGREQ(3, bp, "%s", __func__); @@ -303,6 +304,9 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio *bp) } } + TAILQ_INIT(&crpq); + batch = atomic_load_int(&g_eli_batch) != 0; + for (i = 0, dstoff = bp->bio_offset; i < nsec; i++, dstoff += secsize) { crp = crypto_getreq(wr->w_sid, M_WAITOK); @@ -325,9 +329,6 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio *bp) crp->crp_callback = g_eli_crypto_read_done; } crp->crp_flags = CRYPTO_F_CBIFSYNC; - if (g_eli_batch) - crp->crp_flags |= CRYPTO_F_BATCH; - crp->crp_payload_start = 0; crp->crp_payload_length = secsize; if ((sc->sc_flags & G_ELI_FLAG_SINGLE_KEY) == 0) { @@ -340,8 +341,15 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio *bp) sizeof(crp->crp_iv)); } - error = crypto_dispatch(crp); - KASSERT(error == 0, ("crypto_dispatch() failed (error=%d)", - error)); + if (batch) { + TAILQ_INSERT_TAIL(&crpq, crp, crp_next); + } else { + error = crypto_dispatch(crp); + KASSERT(error == 0, + ("crypto_dispatch() failed (error=%d)", error)); + } } + + if (batch) + crypto_dispatch_batch(&crpq, 0); } diff --git a/sys/kgssapi/krb5/kcrypto_aes.c b/sys/kgssapi/krb5/kcrypto_aes.c index 38faeb37066c..ecc8603036fe 100644 --- a/sys/kgssapi/krb5/kcrypto_aes.c +++ b/sys/kgssapi/krb5/kcrypto_aes.c @@ -122,7 +122,7 @@ aes_crypto_cb(struct cryptop *crp) int error; struct aes_state *as = (struct aes_state *) crp->crp_opaque; - if (crypto_ses2caps(crp->crp_session) & CRYPTOCAP_F_SYNC) + if (CRYPTO_SESS_SYNC(crp->crp_session)) return (0); error = crp->crp_etype; @@ -165,7 +165,7 @@ aes_encrypt_1(const struct krb5_key_state *ks, int buftype, void *buf, error = crypto_dispatch(crp); - if ((crypto_ses2caps(as->as_session_aes) & CRYPTOCAP_F_SYNC) == 0) { + if (!CRYPTO_SESS_SYNC(as->as_session_aes)) { mtx_lock(&as->as_lock); if (!error && !(crp->crp_flags & CRYPTO_F_DONE)) error = msleep(crp, &as->as_lock, 0, "gssaes", 0); @@ -335,7 +335,7 @@ aes_checksum(const struct krb5_key_state *ks, int usage, error = crypto_dispatch(crp); - if ((crypto_ses2caps(as->as_session_sha1) & CRYPTOCAP_F_SYNC) == 0) { + if (!CRYPTO_SESS_SYNC(as->as_session_sha1)) { mtx_lock(&as->as_lock); if (!error && !(crp->crp_flags & CRYPTO_F_DONE)) error = msleep(crp, &as->as_lock, 0, "gssaes", 0); diff --git a/sys/netipsec/xform_ah.c b/sys/netipsec/xform_ah.c index 5163bda86931..774f11a16c44 100644 --- a/sys/netipsec/xform_ah.c +++ b/sys/netipsec/xform_ah.c @@ -652,8 +652,6 @@ ah_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff) /* Crypto operation descriptor. */ crp->crp_op = CRYPTO_OP_COMPUTE_DIGEST; crp->crp_flags = CRYPTO_F_CBIFSYNC; - if (V_async_crypto) - crp->crp_flags |= CRYPTO_F_ASYNC | CRYPTO_F_ASYNC_KEEPORDER; crypto_use_mbuf(crp, m); crp->crp_callback = ah_input_cb; crp->crp_opaque = xd; @@ -671,7 +669,10 @@ ah_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff) xd->skip = skip; xd->cryptoid = cryptoid; xd->vnet = curvnet; - return (crypto_dispatch(crp)); + if (V_async_crypto) + return (crypto_dispatch_async(crp, CRYPTO_ASYNC_ORDERED)); + else + return (crypto_dispatch(crp)); bad: m_freem(m); key_freesav(&sav); @@ -1036,8 +1037,6 @@ ah_output(struct mbuf *m, struct secpolicy *sp, struct secasvar *sav, /* Crypto operation descriptor. */ crp->crp_op = CRYPTO_OP_COMPUTE_DIGEST; crp->crp_flags = CRYPTO_F_CBIFSYNC; - if (V_async_crypto) - crp->crp_flags |= CRYPTO_F_ASYNC | CRYPTO_F_ASYNC_KEEPORDER; crypto_use_mbuf(crp, m); crp->crp_callback = ah_output_cb; crp->crp_opaque = xd; @@ -1055,7 +1054,10 @@ ah_output(struct mbuf *m, struct secpolicy *sp, struct secasvar *sav, xd->cryptoid = cryptoid; xd->vnet = curvnet; - return crypto_dispatch(crp); + if (V_async_crypto) + return (crypto_dispatch_async(crp, CRYPTO_ASYNC_ORDERED)); + else + return (crypto_dispatch(crp)); bad: if (m) m_freem(m); diff --git a/sys/netipsec/xform_esp.c b/sys/netipsec/xform_esp.c index dc64dc732992..a7d5776e4da2 100644 --- a/sys/netipsec/xform_esp.c +++ b/sys/netipsec/xform_esp.c @@ -406,8 +406,6 @@ esp_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff) /* Crypto operation descriptor */ crp->crp_flags = CRYPTO_F_CBIFSYNC; - if (V_async_crypto) - crp->crp_flags |= CRYPTO_F_ASYNC | CRYPTO_F_ASYNC_KEEPORDER; crypto_use_mbuf(crp, m); crp->crp_callback = esp_input_cb; crp->crp_opaque = xd; @@ -460,7 +458,10 @@ esp_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff) } else if (sav->ivlen != 0) crp->crp_iv_start = skip + hlen - sav->ivlen; - return (crypto_dispatch(crp)); + if (V_async_crypto) + return (crypto_dispatch_async(crp, CRYPTO_ASYNC_ORDERED)); + else + return (crypto_dispatch(crp)); crp_aad_fail: free(xd, M_XDATA); @@ -895,8 +896,6 @@ esp_output(struct mbuf *m, struct secpolicy *sp, struct secasvar *sav, /* Crypto operation descriptor. */ crp->crp_flags |= CRYPTO_F_CBIFSYNC; - if (V_async_crypto) - crp->crp_flags |= CRYPTO_F_ASYNC | CRYPTO_F_ASYNC_KEEPORDER; crypto_use_mbuf(crp, m); crp->crp_callback = esp_output_cb; crp->crp_opaque = xd; @@ -944,7 +943,10 @@ esp_output(struct mbuf *m, struct secpolicy *sp, struct secasvar *sav, crp->crp_digest_start = m->m_pkthdr.len - alen; } - return crypto_dispatch(crp); + if (V_async_crypto) + return (crypto_dispatch_async(crp, CRYPTO_ASYNC_ORDERED)); + else + return (crypto_dispatch(crp)); crp_aad_fail: free(xd, M_XDATA); diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index 0316eb35361a..3b489739f067 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -188,8 +188,6 @@ static struct crypto_ret_worker *crypto_ret_workers = NULL; #define CRYPTO_RETW_LOCK(w) mtx_lock(&w->crypto_ret_mtx) #define CRYPTO_RETW_UNLOCK(w) mtx_unlock(&w->crypto_ret_mtx) -#define CRYPTO_RETW_EMPTY(w) \ - (TAILQ_EMPTY(&w->crp_ret_q) && TAILQ_EMPTY(&w->crp_ret_kq) && TAILQ_EMPTY(&w->crp_ordered_ret_q)) static int crypto_workers_num = 0; SYSCTL_INT(_kern_crypto, OID_AUTO, num_workers, CTLFLAG_RDTUN, @@ -1406,11 +1404,8 @@ crp_sanity(struct cryptop *crp) } #endif -/* - * Add a crypto request to a queue, to be processed by the kernel thread. - */ -int -crypto_dispatch(struct cryptop *crp) +static int +crypto_dispatch_one(struct cryptop *crp, int hint) { struct cryptocap *cap; int result; @@ -1418,49 +1413,82 @@ crypto_dispatch(struct cryptop *crp) #ifdef INVARIANTS crp_sanity(crp); #endif - CRYPTOSTAT_INC(cs_ops); crp->crp_retw_id = crp->crp_session->id % crypto_workers_num; - if (CRYPTOP_ASYNC(crp)) { - if (crp->crp_flags & CRYPTO_F_ASYNC_KEEPORDER) { - struct crypto_ret_worker *ret_worker; + /* + * Caller marked the request to be processed immediately; dispatch it + * directly to the driver unless the driver is currently blocked, in + * which case it is queued for deferred dispatch. + */ + cap = crp->crp_session->cap; + if (!atomic_load_int(&cap->cc_qblocked)) { + result = crypto_invoke(cap, crp, hint); + if (result != ERESTART) + return (result); - ret_worker = CRYPTO_RETW(crp->crp_retw_id); + /* + * The driver ran out of resources, put the request on the + * queue. + */ + } + crypto_batch_enqueue(crp); + return (0); +} - CRYPTO_RETW_LOCK(ret_worker); - crp->crp_seq = ret_worker->reorder_ops++; - CRYPTO_RETW_UNLOCK(ret_worker); - } +int +crypto_dispatch(struct cryptop *crp) +{ + return (crypto_dispatch_one(crp, 0)); +} - TASK_INIT(&crp->crp_task, 0, crypto_task_invoke, crp); - taskqueue_enqueue(crypto_tq, &crp->crp_task); - return (0); - } +int +crypto_dispatch_async(struct cryptop *crp, int flags) +{ + struct crypto_ret_worker *ret_worker; - if ((crp->crp_flags & CRYPTO_F_BATCH) == 0) { + if (!CRYPTO_SESS_SYNC(crp->crp_session)) { /* - * Caller marked the request to be processed - * immediately; dispatch it directly to the - * driver unless the driver is currently blocked. + * The driver issues completions asynchonously, don't bother + * deferring dispatch to a worker thread. */ - cap = crp->crp_session->cap; - if (!cap->cc_qblocked) { - result = crypto_invoke(cap, crp, 0); - if (result != ERESTART) - return (result); - /* - * The driver ran out of resources, put the request on - * the queue. - */ - } + return (crypto_dispatch(crp)); } - crypto_batch_enqueue(crp); - return 0; + +#ifdef INVARIANTS + crp_sanity(crp); +#endif + CRYPTOSTAT_INC(cs_ops); + + crp->crp_retw_id = crp->crp_session->id % crypto_workers_num; + if ((flags & CRYPTO_ASYNC_ORDERED) != 0) { + crp->crp_flags |= CRYPTO_F_ASYNC_ORDERED; + ret_worker = CRYPTO_RETW(crp->crp_retw_id); + CRYPTO_RETW_LOCK(ret_worker); + crp->crp_seq = ret_worker->reorder_ops++; + CRYPTO_RETW_UNLOCK(ret_worker); + } + TASK_INIT(&crp->crp_task, 0, crypto_task_invoke, crp); + taskqueue_enqueue(crypto_tq, &crp->crp_task); + return (0); } void +crypto_dispatch_batch(struct cryptopq *crpq, int flags) +{ + struct cryptop *crp; + int hint; + + while ((crp = TAILQ_FIRST(crpq)) != NULL) { + hint = TAILQ_NEXT(crp, crp_next) != NULL ? CRYPTO_HINT_MORE : 0; + TAILQ_REMOVE(crpq, crp, crp_next); + if (crypto_dispatch_one(crp, hint) != 0) + crypto_batch_enqueue(crp); + } +} + +static void crypto_batch_enqueue(struct cryptop *crp) { @@ -1814,10 +1842,10 @@ crypto_done(struct cryptop *crp) * doing extraneous context switches; the latter is mostly * used with the software crypto driver. */ - if (!CRYPTOP_ASYNC_KEEPORDER(crp) && - ((crp->crp_flags & CRYPTO_F_CBIMM) || - ((crp->crp_flags & CRYPTO_F_CBIFSYNC) && - (crypto_ses2caps(crp->crp_session) & CRYPTOCAP_F_SYNC)))) { + if ((crp->crp_flags & CRYPTO_F_ASYNC_ORDERED) == 0 && + ((crp->crp_flags & CRYPTO_F_CBIMM) != 0 || + ((crp->crp_flags & CRYPTO_F_CBIFSYNC) != 0 && + CRYPTO_SESS_SYNC(crp->crp_session)))) { /* * Do the callback directly. This is ok when the * callback routine does very little (e.g. the @@ -1829,36 +1857,35 @@ crypto_done(struct cryptop *crp) bool wake; ret_worker = CRYPTO_RETW(crp->crp_retw_id); - wake = false; /* * Normal case; queue the callback for the thread. */ CRYPTO_RETW_LOCK(ret_worker); - if (CRYPTOP_ASYNC_KEEPORDER(crp)) { + if ((crp->crp_flags & CRYPTO_F_ASYNC_ORDERED) != 0) { struct cryptop *tmp; - TAILQ_FOREACH_REVERSE(tmp, &ret_worker->crp_ordered_ret_q, - cryptop_q, crp_next) { + TAILQ_FOREACH_REVERSE(tmp, + &ret_worker->crp_ordered_ret_q, cryptop_q, + crp_next) { if (CRYPTO_SEQ_GT(crp->crp_seq, tmp->crp_seq)) { - TAILQ_INSERT_AFTER(&ret_worker->crp_ordered_ret_q, - tmp, crp, crp_next); + TAILQ_INSERT_AFTER( + &ret_worker->crp_ordered_ret_q, tmp, + crp, crp_next); break; } } if (tmp == NULL) { - TAILQ_INSERT_HEAD(&ret_worker->crp_ordered_ret_q, - crp, crp_next); + TAILQ_INSERT_HEAD( + &ret_worker->crp_ordered_ret_q, crp, + crp_next); } - if (crp->crp_seq == ret_worker->reorder_cur_seq) - wake = true; - } - else { - if (CRYPTO_RETW_EMPTY(ret_worker)) - wake = true; - - TAILQ_INSERT_TAIL(&ret_worker->crp_ret_q, crp, crp_next); + wake = crp->crp_seq == ret_worker->reorder_cur_seq; + } else { + wake = TAILQ_EMPTY(&ret_worker->crp_ret_q); + TAILQ_INSERT_TAIL(&ret_worker->crp_ret_q, crp, + crp_next); } if (wake) @@ -1894,7 +1921,7 @@ crypto_kdone(struct cryptkop *krp) ret_worker = CRYPTO_RETW(0); CRYPTO_RETW_LOCK(ret_worker); - if (CRYPTO_RETW_EMPTY(ret_worker)) + if (TAILQ_EMPTY(&ret_worker->crp_ret_kq)) wakeup_one(&ret_worker->crp_ret_q); /* shared wait channel */ TAILQ_INSERT_TAIL(&ret_worker->crp_ret_kq, krp, krp_next); CRYPTO_RETW_UNLOCK(ret_worker); @@ -1991,13 +2018,10 @@ crypto_proc(void) */ if (submit->crp_session->cap == cap) hint = CRYPTO_HINT_MORE; - break; } else { submit = crp; - if ((submit->crp_flags & CRYPTO_F_BATCH) == 0) - break; - /* keep scanning for more are q'd */ } + break; } } if (submit != NULL) { diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h index ecb1d929d1db..659599cb7d60 100644 --- a/sys/opencrypto/cryptodev.h +++ b/sys/opencrypto/cryptodev.h @@ -455,18 +455,10 @@ struct cryptop { */ int crp_flags; -#define CRYPTO_F_BATCH 0x0008 /* Batch op if possible */ #define CRYPTO_F_CBIMM 0x0010 /* Do callback immediately */ #define CRYPTO_F_DONE 0x0020 /* Operation completed */ #define CRYPTO_F_CBIFSYNC 0x0040 /* Do CBIMM if op is synchronous */ -#define CRYPTO_F_ASYNC 0x0080 /* Dispatch crypto jobs on several threads - * if op is synchronous - */ -#define CRYPTO_F_ASYNC_KEEPORDER 0x0100 /* - * Dispatch the crypto jobs in the same - * order there are submitted. Applied only - * if CRYPTO_F_ASYNC flags is set - */ +#define CRYPTO_F_ASYNC_ORDERED 0x0100 /* Completions must happen in order */ #define CRYPTO_F_IV_SEPARATE 0x0200 /* Use crp_iv[] as IV. */ int crp_op; @@ -506,6 +498,8 @@ struct cryptop { */ }; +TAILQ_HEAD(cryptopq, cryptop); + static __inline void _crypto_use_buf(struct crypto_buffer *cb, void *buf, int len) { @@ -587,12 +581,6 @@ crypto_use_output_uio(struct cryptop *crp, struct uio *uio) _crypto_use_uio(&crp->crp_obuf, uio); } -#define CRYPTOP_ASYNC(crp) \ - (((crp)->crp_flags & CRYPTO_F_ASYNC) && \ - crypto_ses2caps((crp)->crp_session) & CRYPTOCAP_F_SYNC) -#define CRYPTOP_ASYNC_KEEPORDER(crp) \ - (CRYPTOP_ASYNC(crp) && \ - (crp)->crp_flags & CRYPTO_F_ASYNC_KEEPORDER) #define CRYPTO_HAS_OUTPUT_BUFFER(crp) \ ((crp)->crp_obuf.cb_type != CRYPTO_BUF_NONE) @@ -642,6 +630,8 @@ extern void crypto_freesession(crypto_session_t cses); #define CRYPTOCAP_F_SOFTWARE CRYPTO_FLAG_SOFTWARE #define CRYPTOCAP_F_SYNC 0x04000000 /* operates synchronously */ #define CRYPTOCAP_F_ACCEL_SOFTWARE 0x08000000 +#define CRYPTO_SESS_SYNC(sess) \ + ((crypto_ses2caps(sess) & CRYPTOCAP_F_SYNC) != 0) extern int32_t crypto_get_driverid(device_t dev, size_t session_size, int flags); extern int crypto_find_driver(const char *); @@ -650,6 +640,9 @@ extern int crypto_getcaps(int hid); extern int crypto_kregister(uint32_t, int, uint32_t); extern int crypto_unregister_all(uint32_t driverid); extern int crypto_dispatch(struct cryptop *crp); +#define CRYPTO_ASYNC_ORDERED 0x1 /* complete in order dispatched */ +extern int crypto_dispatch_async(struct cryptop *crp, int flags); +extern void crypto_dispatch_batch(struct cryptopq *crpq, int flags); extern int crypto_kdispatch(struct cryptkop *); #define CRYPTO_SYMQ 0x1 #define CRYPTO_ASYMQ 0x2 diff --git a/sys/sys/param.h b/sys/sys/param.h index d6f1eb21dcd2..058aef99e077 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400003 /* Master, propagated to newvers */ +#define __FreeBSD_version 1400004 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-main@freebsd.org Mon Feb 8 14:54:35 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8CFF4535BDE; Mon, 8 Feb 2021 14:54:35 +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 4DZ8F72JSvz3rYV; Mon, 8 Feb 2021 14:54:35 +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 118EsVPu000845 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 8 Feb 2021 14:54:31 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: kevans@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 118EsRid034327 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 8 Feb 2021 21:54:27 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5) To: Kyle Evans References: <202102080704.11874w7E017472@gitrepo.freebsd.org> Cc: Warner Losh , Daniel Ebdrup Jensen , src-committers , "" , dev-commits-src-main@freebsd.org From: Eugene Grosbein Message-ID: Date: Mon, 8 Feb 2021 21:54:19 +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: Content-Type: text/plain; charset=utf-8 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,T_SPF_PERMERROR 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 T_SPF_PERMERROR SPF: test of record failed (permerror) * 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: 4DZ8F72JSvz3rYV X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 14:54:35 -0000 08.02.2021 21:08, Kyle Evans wrote: >> kld_list cannot do that. >> > > Huh? kld_list accepts a full pathname, which is the same kind of > specification you'd need to do with one from port in loader with > *_name. Good, but seems to be undocumented. From owner-dev-commits-src-main@freebsd.org Mon Feb 8 14:58:45 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A514353611D; Mon, 8 Feb 2021 14:58:45 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ8Kx3DjFz3rtZ; Mon, 8 Feb 2021 14:58:45 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (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 5D27C2604A; Mon, 8 Feb 2021 14:58:45 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f174.google.com with SMTP id q85so2308802qke.8; Mon, 08 Feb 2021 06:58:45 -0800 (PST) X-Gm-Message-State: AOAM533AqerekFTgnMPc/tgWYcJctz1rtxatE5oiWykPNfRQ9CD37r+H JVLaOOHMNVEDPixhcjDeK1AmECj2tMah/6HYWlE= X-Google-Smtp-Source: ABdhPJz9C/lGY1X6FANvErKqZhjBoK9s/YMA6PpBXSasjSq0KNuvx1DBIHEwLYIM2TIbNBCI265RYFRbfTcQrNsgcYg= X-Received: by 2002:a37:f50d:: with SMTP id l13mr8829310qkk.34.1612796325054; Mon, 08 Feb 2021 06:58:45 -0800 (PST) MIME-Version: 1.0 References: <202102080704.11874w7E017472@gitrepo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Mon, 8 Feb 2021 08:58:30 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5) To: Eugene Grosbein Cc: Warner Losh , Daniel Ebdrup Jensen , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 14:58:45 -0000 On Mon, Feb 8, 2021 at 8:54 AM Eugene Grosbein wrote: > > 08.02.2021 21:08, Kyle Evans wrote: > > >> kld_list cannot do that. > >> > > > > Huh? kld_list accepts a full pathname, which is the same kind of > > specification you'd need to do with one from port in loader with > > *_name. > > Good, but seems to be undocumented. > In what sense? Is there some other place that kld_list is even documented than kldload(8)? I note that the kld service and load_kld() in rc.subr are only a really, really light wrapper around kldload(8), and kldload(8) is exceptionally clear about accepting arbitrary files. From owner-dev-commits-src-main@freebsd.org Mon Feb 8 15:07:08 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8D9A553607E; Mon, 8 Feb 2021 15:07:08 +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 4DZ8Wc2D1gz3scp; Mon, 8 Feb 2021 15:07:08 +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 118F75rU000990 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 8 Feb 2021 15:07:06 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: kevans@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 118F6sCn034428 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 8 Feb 2021 22:06:54 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5) To: Kyle Evans References: <202102080704.11874w7E017472@gitrepo.freebsd.org> Cc: src-committers , "" , dev-commits-src-main@freebsd.org From: Eugene Grosbein Message-ID: <33d6f518-2005-e859-0230-34490c3c5914@grosbein.net> Date: Mon, 8 Feb 2021 22:06:46 +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: Content-Type: text/plain; charset=utf-8 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,T_SPF_PERMERROR 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 T_SPF_PERMERROR SPF: test of record failed (permerror) * 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: 4DZ8Wc2D1gz3scp X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 15:07:08 -0000 08.02.2021 21:58, Kyle Evans wrote: >>>> kld_list cannot do that. >>> >>> Huh? kld_list accepts a full pathname, which is the same kind of >>> specification you'd need to do with one from port in loader with >>> *_name. >> >> Good, but seems to be undocumented. >> > > In what sense? Is there some other place that kld_list is even > documented than kldload(8)? Naturally: rc.conf(5), also in /etc/defaults/rc.conf From owner-dev-commits-src-main@freebsd.org Mon Feb 8 15:13:13 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D0FDC536927; Mon, 8 Feb 2021 15:13:13 +0000 (UTC) (envelope-from rm@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ8fd5cjPz3tFR; Mon, 8 Feb 2021 15:13:13 +0000 (UTC) (envelope-from rm@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1612797193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/X7I1aFh1dY+V51QjXxGOqFYMWC+sC8ZnFdj4sdzpkE=; b=czpC1OLrtGXOdq4ir1glmqIAvT7eUECJsFhw8ehzmd1deShOLEsTmXWujBdIr75SVBvahg 9GaphNqWCH1TgJ7LtIkjZGXsHSImcHrrgt3XQlppcsJtv19UyllhOCs3SmnhmsZMni4xCy 1W4jsx4uO4vQE1jQrfoMxWCLDwGoqSS+Eu9XSVcpA/bMzPf7gQwpda9t+pOHxMPTYzudtO mLWzfSNJ0qbT7igy1DH3iquo4YJhblEgyw2plUEovBRfIfevXjoeRq5anwl+79QvH96/3u +japiznlNvGuOBsCbF+jkWJw5syugU+l75fBF/R8UBXuaVC1tZlzpdW61Iy45g== Received: from [127.0.0.1] (unknown [127.0.1.132]) by freefall.freebsd.org (Postfix) with ESMTP id 09EAF207B; Mon, 8 Feb 2021 15:13:12 +0000 (UTC) (envelope-from rm@FreeBSD.org) Subject: Re: git: 45456abc4ce7 - main - cache: fix trailing slash support in face of permission problems To: Mateusz Guzik , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202102021814.112IEqLa009596@gitrepo.freebsd.org> From: Ruslan Makhmatkhanov Message-ID: <5a2d5e05-e1cf-1b14-c888-c78e83021e71@FreeBSD.org> Date: Mon, 8 Feb 2021 18:13:12 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <202102021814.112IEqLa009596@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1612797193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/X7I1aFh1dY+V51QjXxGOqFYMWC+sC8ZnFdj4sdzpkE=; b=DH0K5901+ach1Yq5/lRSmmAiX04KP+VXXpJlgUzIpPrffZN2BXYW+3NMKxk0lMuqQXmTKF M7ZPgZwicGLocISuyGhXaGYo3L2q873cvw2lZ3E1J3if0Lah4ZaCJ4w8CxZCcDC1bMPlax QTy+e/z6HJf0hcOcugrSpa3rgPXtdtL9Jy3l9ru9bB7jWDPSwNW2cLWTW6qu4emAqCYWqM +oH7Pz0lCI2+FlB+VGHHNTHcSG/bHQFS7Ek1d1mWk5z321aa+Y4LqU6VOFqZG/M7vAmMZd amQWF9/bpFf5F+jqicx+ZM5ypNZ4EwZy7KOdhXPmZTby7I3RPIbbV3w0WbcfcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1612797193; a=rsa-sha256; cv=none; b=WrUF+cQjtl5YliR3nkQdPJeAFdXjimwkOAqLRTSu/yRITViGOMINU9xHRVyp/th+cTmkL8 +1QHyJr9TbtucZ4wJKmbg5dFWSMi/xr32Z3nLrB9OXFMhtwPWs3GiZEhAmL1j8drf6Cuea FyC6mzbhAnfjMqF3li+Q0MIBudNkCgHkyHvBaBKgXdibZlFwhTcJw4ulSa+0EgOA76/zQp IXBjy29ciRSKpTWWjXfkRhdwwSwAY0+XpfAYgaOwMs83PBDDp/xP6qiFkIIq4zY61+gUy2 H4CngnlezuEg/+hCHgOAYIUI851jba+kph51x5sLI6+05smZTBiBD2nV8QhCIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 15:13:13 -0000 Hello, Mateusz Guzik wrote on 2/2/21 9:14 PM: > The branch main has been updated by mjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=45456abc4ce71053d07cf03ca63bd1ce459fec55 > > commit 45456abc4ce71053d07cf03ca63bd1ce459fec55 > Author: Mateusz Guzik > AuthorDate: 2021-02-02 18:06:56 +0000 > Commit: Mateusz Guzik > CommitDate: 2021-02-02 18:13:51 +0000 > > cache: fix trailing slash support in face of permission problems > > Reported by: Johan Hendriks > Tested by: kevans > --- > sys/kern/vfs_cache.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c > index 7f0e59f1a1ee..db482ea4eba3 100644 > --- a/sys/kern/vfs_cache.c > +++ b/sys/kern/vfs_cache.c > @@ -5521,6 +5521,16 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) > dvp = fpl->dvp; > dvp_seqc = fpl->dvp_seqc; > > + /* > + * TODO: Due to ignoring slashes lookup will perform a permission check > + * on the last dir when it should not have. If it fails, we get here. > + * It is possible possible to fix it up fully without resorting to ^^^^^^^^ there is redundant "possible" instance [...] -- Regards, Ruslan T.O.S. Of Reality From owner-dev-commits-src-main@freebsd.org Mon Feb 8 15:18:10 2021 Return-Path: Delivered-To: dev-commits-src-main@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 F25A45365F3; Mon, 8 Feb 2021 15:18:10 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) (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 4DZ8mL6MNpz3t7n; Mon, 8 Feb 2021 15:18:10 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qv1-xf2f.google.com with SMTP id 2so7103294qvd.0; Mon, 08 Feb 2021 07:18:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+YteNDmpsaz1o1ARDbTOhZH29i8EYrZtuwgFSJ0ZW1I=; b=W8+UCiThjgPTNv2rwG9Z+MjbHZMZB2c5quVtUfYM/beZNmpl8KQIQV2+JIEHzTiv2b W+5SAhHaCuaQxfRtKbemmTrkpeC1vnMLQ2hnRSKKQ1nnFGRcCfL0VLeuuZIoBUZxrDce s4oDH77pqTJZ2uwupWsGfehW2Geaur7auTmFxjUT15iQdKpkU6fyw+hl4Brv4fhR7a0W kmzsQjaq4NUM5wKCZt2mfKS4B7cS8ptZVQe1yjd5UDLGMad0UW6AaajiNEzg1qWFo7Sy 4Ru5GZYYnhHcrAuZSinjwSVKeaL0oDKxAj4GJgyIl0VOsy1sjBAWL8oIKhTIXij/4VVt 0fmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=+YteNDmpsaz1o1ARDbTOhZH29i8EYrZtuwgFSJ0ZW1I=; b=GkUzVsDoTPOgA8oR26mSFzKJHeq1s/coyqfY3dIMJ05R7xOg7urET8DZOQnU2zZZtF jBc3p/BO/ClO/7OWxr2c7S2YHT4IEoCFWQledkGabhWHmGrIs6GsiBoA5Te2NrZyCoTL HCoGMaOIIMh1xeIM+OhKwtqhEDbi9NaZ1Xps+V8wLunz0qU67tB9te5dYPXXQ+j1aeQ/ 97MLgtlfS1jkYA1eIyAjwFpPQj43/zv+oPqbmnsR5mG0yj5M/uYa0bkV8FkYoKCKwvy9 00NDLmq1nbIQsm4MYOBUHyG1LfnC8Z15Mm9AOfVzNBlEFmgXAgTDrTvoe9OpJGUY4WxX E/XQ== X-Gm-Message-State: AOAM5314LVnVh36LFWA8OcMCrPHll7rp0S/RTEqKOd9Ne4zeCl0ufq1H opUxa4FktVW5bIS0/S3o0p77S+Ey9i4= X-Google-Smtp-Source: ABdhPJynxMJVxLiL/4cS3Scm1rIjVTw643ScvBepgzb54/5/xd7QQZkCchRqFy7IgVzUa3chwfKk6A== X-Received: by 2002:a0c:b66c:: with SMTP id q44mr16418676qvf.3.1612797489204; Mon, 08 Feb 2021 07:18:09 -0800 (PST) Received: from raichu ([142.126.164.150]) by smtp.gmail.com with ESMTPSA id n20sm5874747qke.128.2021.02.08.07.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 07:18:08 -0800 (PST) Sender: Mark Johnston Date: Mon, 8 Feb 2021 10:18:06 -0500 From: Mark Johnston To: Lutz Donnerhacke Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 45d75e3ac3fb - main - netgraph/ng_base: Allow larger BINARY2ASCII conversions Message-ID: References: <202102081335.118DZB5F024911@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202102081335.118DZB5F024911@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4DZ8mL6MNpz3t7n X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 15:18:11 -0000 On Mon, Feb 08, 2021 at 01:35:11PM +0000, Lutz Donnerhacke wrote: > The branch main has been updated by donner: > > URL: https://cgit.FreeBSD.org/src/commit/?id=45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f > > commit 45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f > Author: Lutz Donnerhacke > AuthorDate: 2021-02-07 21:07:34 +0000 > Commit: Lutz Donnerhacke > CommitDate: 2021-02-08 13:31:58 +0000 > > netgraph/ng_base: Allow larger BINARY2ASCII conversions > > Allocate the necessary memory for the conversion dynamically starting > with a value which is sufficient for almost all normal cases. Is there some upper bound on the length of the input message? If not, a sufficiently large input looks like it could cause an infinite loop by triggering overflow in the bufSize *= 2 calculation. I also wonder why the same change was not made for ASCII2BINARY. > > PR: 187835 > Reviewed by: kp > Differential Revision: https://reviews.freebsd.org/D23840 > --- > sys/netgraph/ng_base.c | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > > diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c > index 6ab39421b255..63bc251f52f9 100644 > --- a/sys/netgraph/ng_base.c > +++ b/sys/netgraph/ng_base.c > @@ -2771,7 +2771,7 @@ ng_generic_msg(node_p here, item_p item, hook_p lasthook) > > case NGM_BINARY2ASCII: > { > - int bufSize = 20 * 1024; /* XXX hard coded constant */ > + int bufSize = 1024; > const struct ng_parse_type *argstype; > const struct ng_cmdlist *c; > struct ng_mesg *binary, *ascii; > @@ -2785,7 +2785,7 @@ ng_generic_msg(node_p here, item_p item, hook_p lasthook) > error = EINVAL; > break; > } > - > +retry_b2a: > /* Get a response message with lots of room */ > NG_MKRESPONSE(resp, msg, sizeof(*ascii) + bufSize, M_NOWAIT); > if (resp == NULL) { > @@ -2827,9 +2827,13 @@ ng_generic_msg(node_p here, item_p item, hook_p lasthook) > if (argstype == NULL) { > *ascii->data = '\0'; > } else { > - if ((error = ng_unparse(argstype, > - (u_char *)binary->data, > - ascii->data, bufSize)) != 0) { > + error = ng_unparse(argstype, (u_char *)binary->data, > + ascii->data, bufSize); > + if (error == ERANGE) { > + NG_FREE_MSG(resp); > + bufSize *= 2; > + goto retry_b2a; > + } else if (error) { > NG_FREE_MSG(resp); > break; > } > _______________________________________________ > dev-commits-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all > To unsubscribe, send any mail to "dev-commits-src-all-unsubscribe@freebsd.org" From owner-dev-commits-src-main@freebsd.org Mon Feb 8 15:22:39 2021 Return-Path: Delivered-To: dev-commits-src-main@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 36B43536AC2; Mon, 8 Feb 2021 15:22:39 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ8sW0x1zz3tlt; Mon, 8 Feb 2021 15:22:39 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 135C5266C3; Mon, 8 Feb 2021 15:22:39 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f169.google.com with SMTP id q85so2405433qke.8; Mon, 08 Feb 2021 07:22:39 -0800 (PST) X-Gm-Message-State: AOAM533qkRWzmGWOo1B1yjSFHcf6MObstldQAC/q+qBst+nLbPbTi2h+ XvPk0AL8OXLMIKiGQSwB4/yfOHxAzeOYou1G+N0= X-Google-Smtp-Source: ABdhPJw/nKbjAsQTUEyQeeN+Jzy5piR5L9unDFjC1k0NlnOg5DwJWuAuXeBBb4Wk5AIQwroCJHbqD7oSLu9DijGvUbI= X-Received: by 2002:a37:f50d:: with SMTP id l13mr8954784qkk.34.1612797758723; Mon, 08 Feb 2021 07:22:38 -0800 (PST) MIME-Version: 1.0 References: <202102080704.11874w7E017472@gitrepo.freebsd.org> <33d6f518-2005-e859-0230-34490c3c5914@grosbein.net> In-Reply-To: <33d6f518-2005-e859-0230-34490c3c5914@grosbein.net> From: Kyle Evans Date: Mon, 8 Feb 2021 09:22:25 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5) To: Eugene Grosbein Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 15:22:39 -0000 On Mon, Feb 8, 2021 at 9:07 AM Eugene Grosbein wrote: > > 08.02.2021 21:58, Kyle Evans wrote: > > >>>> kld_list cannot do that. > >>> > >>> Huh? kld_list accepts a full pathname, which is the same kind of > >>> specification you'd need to do with one from port in loader with > >>> *_name. > >> > >> Good, but seems to be undocumented. > >> > > > > In what sense? Is there some other place that kld_list is even > > documented than kldload(8)? > > Naturally: rc.conf(5), also in /etc/defaults/rc.conf > Wow, that documentation is just flat wrong for multiple reasons. kld_list (str) A whitespace-separated list of kernel modules to load right after the local disks are mounted, without any .ko extension or path. Loading modules at this point in the boot process is much faster than doing it via /boot/loader.conf for those modules not necessary for mounting local disks. The second part of the first sentence is a self-imposed limitation, and an incredibly unimportant one at that. Specifying a .ko will only break the existing "Is it loaded" behavior and cause it to always try, which is mostly a nuisance at best because it will get rejected if the kldstat inquiry is wrong -- the kld rc script will append .ko whether the path has one or not, so this should be fixed. Despite that, a path will work just fine for the most part; kldstat -v shows the fully qualified path. If it wanted to be improved, it just needs to basename what it was given to be able to detect if it was loaded from any other path and pass that in as the -e argument to load_kld if it really was a file. It's not wrong about loading modules being faster here, and at some point in the past it was even necessary due to loader(8) being too early or problematic in some terrible cases (e.g. nvidia modsetting bits), but the second half of that sentence should probably just be omitted or reworked to more vaguely refer to "... those modules not necessary for booting the system, including those required for mounting the root filesystem." The key changes being that there are other reasons you might need to load something early enough in boot, and that root isn't always a local disk. It's OK to call out the more common case for folks, but this feels a lot more absolute than it needs to be. From owner-dev-commits-src-main@freebsd.org Mon Feb 8 16:00:57 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9C5DA537F69; Mon, 8 Feb 2021 16:00:57 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZ9jj3rl4z4RQs; Mon, 8 Feb 2021 16:00:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76CCB1A471; Mon, 8 Feb 2021 16:00:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118G0vn2017541; Mon, 8 Feb 2021 16:00:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118G0vAP017540; Mon, 8 Feb 2021 16:00:57 GMT (envelope-from git) Date: Mon, 8 Feb 2021 16:00:57 GMT Message-Id: <202102081600.118G0vAP017540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 32bf05ad89aa - main - vt: terminal size can grow too big with small font MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 32bf05ad89aaa93f4dd27e3721f4cb52cf57fa03 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 16:00:57 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=32bf05ad89aaa93f4dd27e3721f4cb52cf57fa03 commit 32bf05ad89aaa93f4dd27e3721f4cb52cf57fa03 Author: Toomas Soome AuthorDate: 2021-01-21 22:18:56 +0000 Commit: Toomas Soome CommitDate: 2021-02-08 16:00:37 +0000 vt: terminal size can grow too big with small font vt is using static buffers for on screen data, the buffer size is calculated based on maximum supported screen size and 8x16 font. When using hi-res graphics and very smaller than 8x16 font, we need to be careful not to overflow static buffers in vt. Testing: I did test by building smaller buffers than vt currently is using, royger was testing on actual 4k capable hardware. MFC after: 1 week Tested by: royger --- sys/dev/vt/vt_core.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 05c383829f49..e4a8288962c4 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -640,8 +640,10 @@ vt_termsize(struct vt_device *vd, struct vt_font *vf, term_pos_t *size) size->tp_row -= vt_logo_sprite_height; size->tp_col = vd->vd_width; if (vf != NULL) { - size->tp_row /= vf->vf_height; - size->tp_col /= vf->vf_width; + size->tp_row = MIN(size->tp_row / vf->vf_height, + PIXEL_HEIGHT(VT_FB_MAX_HEIGHT)); + size->tp_col = MIN(size->tp_col / vf->vf_width, + PIXEL_WIDTH(VT_FB_MAX_WIDTH)); } } @@ -660,8 +662,10 @@ vt_termrect(struct vt_device *vd, struct vt_font *vf, term_rect_t *rect) rect->tr_begin.tp_row = howmany(rect->tr_begin.tp_row, vf->vf_height); - rect->tr_end.tp_row /= vf->vf_height; - rect->tr_end.tp_col /= vf->vf_width; + rect->tr_end.tp_row = MIN(rect->tr_end.tp_row / vf->vf_height, + PIXEL_HEIGHT(VT_FB_MAX_HEIGHT)); + rect->tr_end.tp_col = MIN(rect->tr_end.tp_col / vf->vf_width, + PIXEL_WIDTH(VT_FB_MAX_WIDTH)); } } @@ -675,8 +679,10 @@ vt_winsize(struct vt_device *vd, struct vt_font *vf, struct winsize *size) size->ws_row = size->ws_ypixel; size->ws_col = size->ws_xpixel = vd->vd_width; if (vf != NULL) { - size->ws_row /= vf->vf_height; - size->ws_col /= vf->vf_width; + size->ws_row = MIN(size->ws_row / vf->vf_height, + PIXEL_HEIGHT(VT_FB_MAX_HEIGHT)); + size->ws_col = MIN(size->ws_col / vf->vf_width, + PIXEL_WIDTH(VT_FB_MAX_WIDTH)); } } From owner-dev-commits-src-main@freebsd.org Mon Feb 8 16:08:23 2021 Return-Path: Delivered-To: dev-commits-src-main@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 7D998538525; Mon, 8 Feb 2021 16:08:23 +0000 (UTC) (envelope-from lutz@iks-jena.de) Received: from annwfn.iks-jena.de (annwfn.iks-jena.de [IPv6:2001:4bd8::19]) (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 4DZ9tH28x3z4S9S; Mon, 8 Feb 2021 16:08:22 +0000 (UTC) (envelope-from lutz@iks-jena.de) X-SMTP-Sender: IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f Received: from belenus.iks-jena.de (belenus.iks-jena.de [IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f]) by annwfn.iks-jena.de (8.15.2/8.15.2) with ESMTPS id 118G8HKv017537 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 8 Feb 2021 17:08:17 +0100 X-MSA-Host: belenus.iks-jena.de Received: (from lutz@localhost) by belenus.iks-jena.de (8.14.3/8.14.1/Submit) id 118G8Ho2005150; Mon, 8 Feb 2021 17:08:17 +0100 Date: Mon, 8 Feb 2021 17:08:17 +0100 From: Lutz Donnerhacke To: Mark Johnston Cc: Lutz Donnerhacke , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 45d75e3ac3fb - main - netgraph/ng_base: Allow larger BINARY2ASCII conversions Message-ID: <20210208160817.GA4953@belenus.iks-jena.de> References: <202102081335.118DZB5F024911@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-message-flag: Please send plain text messages only. Thank you. User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: 4DZ9tH28x3z4S9S X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 16:08:23 -0000 On Mon, Feb 08, 2021 at 10:18:06AM -0500, Mark Johnston wrote: > On Mon, Feb 08, 2021 at 01:35:11PM +0000, Lutz Donnerhacke wrote: > > The branch main has been updated by donner: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f > > > > commit 45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f > > Author: Lutz Donnerhacke > > AuthorDate: 2021-02-07 21:07:34 +0000 > > Commit: Lutz Donnerhacke > > CommitDate: 2021-02-08 13:31:58 +0000 > > > > netgraph/ng_base: Allow larger BINARY2ASCII conversions > > > > Allocate the necessary memory for the conversion dynamically starting > > with a value which is sufficient for almost all normal cases. > > Is there some upper bound on the length of the input message? Yes. Quote from D23840: : Of course, to transmit the data via the ng_socket, the buffer sizes needs : to be adjusted manually. : net.graph.recvspace: 204800 : net.graph.maxdgram: 204800 : To transmit arbitary large data, it's better to change the ng_socket : interface (incl. libnetgraph), but that is out of scope of this issue : here. > If not, a sufficiently large input looks like it could cause an infinite > loop by triggering overflow in the bufSize *= 2 calculation. That's a valid point. Thank you. > I also wonder why the same change was not made for ASCII2BINARY. Because it's usually a compression. If you are able to send the ASCII message, the binary message is shorter and will match anyway. But to answer your question: It was not part of the PR, it's an nonissue. From owner-dev-commits-src-main@freebsd.org Mon Feb 8 17:46:16 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B1C5A53B012; Mon, 8 Feb 2021 17:46:16 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) (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 4DZD3D4SXLz4Ygg; Mon, 8 Feb 2021 17:46:16 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qv1-xf36.google.com with SMTP id l11so7345011qvt.1; Mon, 08 Feb 2021 09:46:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bQMytWM/pnpVjPKwaz1Dl70pX7vs5uBTHG3Olt1nBGk=; b=rPU4yjvAa4Oe1GPuE7qt5rGw9YS9ygO8BKfEymtzqxnh/MIY5xEfe7M6reEc02+EoT rJexHn6jOi/wbQqXx653HEaCSevAIFrEDBRDpx7vblblta2eTQFz28/r+TRS3DtSuMwI wOPETOXULZfVz/vRApdj/EffOJNF6X3xg4zzhpCPGrsGokn/ewul7VQpKOY+jv9SLuh/ K7CmBmgklznGug4pSGzOg2A5nOc2T0ezfPMpduNIn5z1NmTBWKNmty+4sS9Oq3hy9efZ LZrFFHouEybz/4zq84cXwwCtkivA2CkqfFrwbMM5tEsE2EQLsws33NxrNRQV2CLLwR2P cWdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=bQMytWM/pnpVjPKwaz1Dl70pX7vs5uBTHG3Olt1nBGk=; b=jvrCPYANaL5FfGScr/S1dWkG9sYjbO1LTcWOasSvue7n4QuUoTenj5PdN81OJsQOzp 7runGaAYgM5XK5J8/JcVt6+1IxxhjH6/AeY8HQQaEEVJ5dRhXX+Oy98LAq14OtOjkgVV qD+u810Dr9mUYOGSC6hdvC0eLFx4cNLCnp43Y7kWrbx6sZ09qEmJ+s+0qNGlAukUewyh ph1WOkzaQbi1k2MJ+xW9oS/oJmlETLdIHRmWj3N3E54DXoCjwwFdu/iwYd6MB5PQoFyt UA2x2ovY/3/m4s4pQ76FFj8iV1SwqIBo17v3oqfeRNtlFlO2yC8ENQCdbizT6P2/JW7d zTZA== X-Gm-Message-State: AOAM530FjjH+XvkgPP1EcmGd51dPyZxSfnrivUOVL4VPNrr5jETw4qNk 9auFIbXyIchiOD74ouA926BI+GsZaks= X-Google-Smtp-Source: ABdhPJyqky6xeCXSgfK7iFWllnNSMMoeCY7i2cbeTfKQCYL/tfVmDNKLWWIMGQ+jv+GxOs8m3RwHpw== X-Received: by 2002:a0c:e302:: with SMTP id s2mr4681962qvl.45.1612806375861; Mon, 08 Feb 2021 09:46:15 -0800 (PST) Received: from raichu ([142.126.164.150]) by smtp.gmail.com with ESMTPSA id l66sm423301qkd.21.2021.02.08.09.46.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 09:46:15 -0800 (PST) Sender: Mark Johnston Date: Mon, 8 Feb 2021 12:46:13 -0500 From: Mark Johnston To: Lutz Donnerhacke Cc: Lutz Donnerhacke , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 45d75e3ac3fb - main - netgraph/ng_base: Allow larger BINARY2ASCII conversions Message-ID: References: <202102081335.118DZB5F024911@gitrepo.freebsd.org> <20210208160817.GA4953@belenus.iks-jena.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210208160817.GA4953@belenus.iks-jena.de> X-Rspamd-Queue-Id: 4DZD3D4SXLz4Ygg X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 17:46:16 -0000 On Mon, Feb 08, 2021 at 05:08:17PM +0100, Lutz Donnerhacke wrote: > On Mon, Feb 08, 2021 at 10:18:06AM -0500, Mark Johnston wrote: > > On Mon, Feb 08, 2021 at 01:35:11PM +0000, Lutz Donnerhacke wrote: > > > The branch main has been updated by donner: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f > > > > > > commit 45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f > > > Author: Lutz Donnerhacke > > > AuthorDate: 2021-02-07 21:07:34 +0000 > > > Commit: Lutz Donnerhacke > > > CommitDate: 2021-02-08 13:31:58 +0000 > > > > > > netgraph/ng_base: Allow larger BINARY2ASCII conversions > > > > > > Allocate the necessary memory for the conversion dynamically starting > > > with a value which is sufficient for almost all normal cases. > > > > Is there some upper bound on the length of the input message? > > Yes. Quote from D23840: > > : Of course, to transmit the data via the ng_socket, the buffer sizes needs > : to be adjusted manually. > > : net.graph.recvspace: 204800 > : net.graph.maxdgram: 204800 > > : To transmit arbitary large data, it's better to change the ng_socket > : interface (incl. libnetgraph), but that is out of scope of this issue > : here. Ok, thanks. I looked through the review but missed this. > > If not, a sufficiently large input looks like it could cause an infinite > > loop by triggering overflow in the bufSize *= 2 calculation. > > That's a valid point. Thank you. > > > I also wonder why the same change was not made for ASCII2BINARY. > > Because it's usually a compression. If you are able to send the ASCII > message, the binary message is shorter and will match anyway. But to answer > your question: It was not part of the PR, it's an nonissue. Ok. From owner-dev-commits-src-main@freebsd.org Mon Feb 8 18:41:28 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1ED5253CBE7; Mon, 8 Feb 2021 18:41:28 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZFGw0Qcdz4fN0; Mon, 8 Feb 2021 18:41:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 007DF1C369; Mon, 8 Feb 2021 18:41:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118IfRXW024033; Mon, 8 Feb 2021 18:41:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118IfRgO024032; Mon, 8 Feb 2021 18:41:27 GMT (envelope-from git) Date: Mon, 8 Feb 2021 18:41:27 GMT Message-Id: <202102081841.118IfRgO024032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 3e2d96ac974d - main - grep: fix -A handling in conjunction with -m match limitation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e2d96ac974db823255a6f40b90eeffa6e38d022 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 18:41:28 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3e2d96ac974db823255a6f40b90eeffa6e38d022 commit 3e2d96ac974db823255a6f40b90eeffa6e38d022 Author: Kyle Evans AuthorDate: 2021-02-08 18:31:17 +0000 Commit: Kyle Evans CommitDate: 2021-02-08 18:41:22 +0000 grep: fix -A handling in conjunction with -m match limitation The basic issue here is that grep, when given -m 1, would stop all line processing once it hit the match count and exit immediately. The problem with exiting immediately is that -A processing only happens when subsequent lines are processed and do not match. The fix here is relatively easy; when bsdgrep matches a line, it resets the 'tail' of the matching context to the value supplied to -A and dumps anything that's been queued up for -B. After the current line has been printed and tail is reset, we check our mcount and do what's needed. Therefore, at the time that we decide we're doing nothing, we know that 'tail' of the context is correct and we can simply continue on if there's still more to pick up. With this change, we still bail out immediately if there's been no -A flag. If -A was supplied, we signal that we should continue on. However, subsequent lines will not even bothere to try and process the line. We have reached the match count, so even if the next line would match then we must process it if it hadn't. Thus, the loop in procfile() can short-circuit and just process the line as a non-match until procmatches() indicates that it's safe to stop. A test has been added to reflect both that we should be picking up the next line and that the next line should be considered a non-match even if it should have been. PR: 253350 MFC-after: 3 days --- contrib/netbsd-tests/usr.bin/grep/t_grep.sh | 17 +++++++++++++++++ usr.bin/grep/util.c | 21 ++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh index ef3f0617465e..d2539a8250de 100755 --- a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh +++ b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh @@ -907,6 +907,22 @@ mflag_body() atf_check -o inline:"test1:2\n" grep -m 2 -EHc "a|b|e|f" test1 } +atf_test_case mflag_trail_ctx +mflag_trail_ctx_head() +{ + atf_set "descr" "Check proper handling of -m with trailing context (PR 253350)" +} +mflag_trail_ctx_body() +{ + printf "foo\nfoo\nbar\nfoo\nbar\nfoo\nbar\n" > test1 + + # Should pick up the next line after matching the first. + atf_check -o inline:"foo\nfoo\n" grep -A1 -m1 foo test1 + + # Make sure the trailer is picked up as a non-match! + atf_check -o inline:"1:foo\n2-foo\n" grep -A1 -nm1 foo test1 +} + atf_test_case zgrep_multiple_files zgrep_multiple_files_head() { @@ -978,6 +994,7 @@ atf_init_test_cases() atf_add_test_case fgrep_oflag atf_add_test_case cflag atf_add_test_case mflag + atf_add_test_case mflag_trail_ctx atf_add_test_case zgrep_multiple_files # End FreeBSD } diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index f22b7abd79ef..a2520e24de8e 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -252,6 +252,16 @@ static bool procmatches(struct mprintc *mc, struct parsec *pc, bool matched) { + if (mflag && mcount <= 0) { + /* + * We already hit our match count, but we need to keep dumping + * lines until we've lost our tail. + */ + grep_printline(&pc->ln, '-'); + mc->tail--; + return (mc->tail != 0); + } + /* * XXX TODO: This should loop over pc->matches and handle things on a * line-by-line basis, setting up a `struct str` as needed. @@ -265,7 +275,7 @@ procmatches(struct mprintc *mc, struct parsec *pc, bool matched) /* XXX TODO: Decrement by number of matched lines */ mcount -= 1; if (mcount <= 0) - return (false); + return (mc->tail != 0); } } else if (mc->doctx) procmatch_nomatch(mc, pc); @@ -357,6 +367,15 @@ procfile(const char *fn) return (0); } + if (mflag && mcount <= 0) { + /* + * Short-circuit, already hit match count and now we're + * just picking up any remaining pieces. + */ + if (!procmatches(&mc, &pc, false)) + break; + continue; + } line_matched = procline(&pc) == !vflag; if (line_matched) ++lines; From owner-dev-commits-src-main@freebsd.org Mon Feb 8 18:48:25 2021 Return-Path: Delivered-To: dev-commits-src-main@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 118AC53D481; Mon, 8 Feb 2021 18:48:25 +0000 (UTC) (envelope-from debdrup@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZFQw73whz4fXQ; Mon, 8 Feb 2021 18:48:24 +0000 (UTC) (envelope-from debdrup@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1612810105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6yjLKXXd0ltVlLnYcJUP66sypGlc7FG1H6CBSR7jads=; b=ZY3NwhUy5vAkq7WAnIVEYhrUlS2P6yVsiu+H1Pqw4/6N9DLqJmUy1JPAuypjTXpAmeEYqa rzfTlX/IOlIuw/GRmdUAwVGnOAwz/KjwyhaM1+75xQUh9bWG4DaxTLmQRgy2P1UqXAdAo4 mqG5EKiiyYDDfHVm1+gM18QQLGLT2J8aSh0pCFyG+O5/sLQtvFkNe4vVH6K3iLvMsC0Ss8 KZqYaeY9d+z7I4OPcwyP1WHw0w1URfzPGzyuft+aML5Oi38T+kpdVKLatDqK0raGcnlY2s YwiRM9TE91bH3JuTTbQROnbEg150nI6l1uJI1XnbPI7DR9NH0bJNfa+9y2k41A== Received: by freefall.freebsd.org (Postfix, from userid 1471) id DB9A75CAE; Mon, 8 Feb 2021 18:48:24 +0000 (UTC) Date: Mon, 8 Feb 2021 19:48:22 +0100 From: Daniel Ebdrup Jensen To: dev-commits-src-main@freebsd.org, "" Subject: Re: git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5) Message-ID: <20210208184822.uejqvgyl2ddv4emc@nerd-thinkpad.local> Mail-Followup-To: Daniel Ebdrup Jensen , dev-commits-src-main@freebsd.org, "" References: <202102080704.11874w7E017472@gitrepo.freebsd.org> <33d6f518-2005-e859-0230-34490c3c5914@grosbein.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ngewsruxf4hgc6kg" Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1612810105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6yjLKXXd0ltVlLnYcJUP66sypGlc7FG1H6CBSR7jads=; b=dcDyDYsispaoSSvcNzYZJBVsmaDA5Hydh7/DE6pZGwqEuMMNSUPIS5z/9YE+Hi02EO8SRB KI/zIy+k8ziYXzKXE/3szUxGghgLHJCkHk/a6dnqSx6A8EtyDZNHh0yK2Qck1yig2mDZ/y 0R+ktCUhqLNzzhBM2c+Z2HVK2zj1UCPoZaolhOpWi5R0V+NdiZq+UNcfp/ZqRay63Vbctg Z58JmPK+LKXTmDWxbFEKhLurHcTIZdi2EXaVANTGT9xDl2UJAtoncUchGgOjPptXftdyPi Xjpbksb7wlm+d/Ru+Orgt5h1wyXkzjbCnHLeWfoaweqn8E4WWY2POaGnN5lEnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1612810105; a=rsa-sha256; cv=none; b=nM8Bh14Zh5vzdFvZ/K1IZFDDPzZ4nj0GnDHrIo7qpJRx/id0Wp63iW/xTepKLLFc+m3ws5 yhDN+cEIcBenELHSmM+0Fg+lfNpa4sRVUD+W5/JjH7H+nsZlBHhG06qO00k/UjQEFsGG7S FWKcUcg79J7fqJGnV6wEUHB1kM4m4X6CyLSxUmOOOVH8NovUUlsT/pmBUCAK9nD9M4feVj 17/JR75KDBvS3YS1gXvLhtutXU+YpZe2LtK+QrPwFuy7y4lmtQ4fQPf4y+kZLlZI2T580R 3XEwYt3Cwptm6RYeQ+FatuNPcJDyiM4T6LRaTbI454F5dgVEX7OAtDTflvB3Jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 18:48:25 -0000 --ngewsruxf4hgc6kg Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline On Mon, Feb 08, 2021 at 09:22:25AM -0600, Kyle Evans wrote: >On Mon, Feb 8, 2021 at 9:07 AM Eugene Grosbein wrote: >> >> 08.02.2021 21:58, Kyle Evans wrote: >> >> >>>> kld_list cannot do that. >> >>> >> >>> Huh? kld_list accepts a full pathname, which is the same kind of >> >>> specification you'd need to do with one from port in loader with >> >>> *_name. >> >> >> >> Good, but seems to be undocumented. >> >> >> > >> > In what sense? Is there some other place that kld_list is even >> > documented than kldload(8)? >> >> Naturally: rc.conf(5), also in /etc/defaults/rc.conf >> > >Wow, that documentation is just flat wrong for multiple reasons. > > kld_list (str) A whitespace-separated list of kernel modules to load > right after the local disks are mounted, without any .ko > extension or path. Loading modules at this point in the boot > process is much faster than doing it via /boot/loader.conf > for those modules not necessary for mounting local disks. > >The second part of the first sentence is a self-imposed limitation, >and an incredibly unimportant one at that. Specifying a .ko will only >break the existing "Is it loaded" behavior and cause it to always try, >which is mostly a nuisance at best because it will get rejected if the >kldstat inquiry is wrong -- the kld rc script will append .ko whether >the path has one or not, so this should be fixed. Despite that, a path >will work just fine for the most part; kldstat -v shows the fully >qualified path. If it wanted to be improved, it just needs to basename >what it was given to be able to detect if it was loaded from any other >path and pass that in as the -e argument to load_kld if it really was >a file. > >It's not wrong about loading modules being faster here, and at some >point in the past it was even necessary due to loader(8) being too >early or problematic in some terrible cases (e.g. nvidia modsetting >bits), but the second half of that sentence should probably just be >omitted or reworked to more vaguely refer to "... those modules not >necessary for booting the system, including those required for >mounting the root filesystem." The key changes being that there are >other reasons you might need to load something early enough in boot, >and that root isn't always a local disk. It's OK to call out the more >common case for folks, but this feels a lot more absolute than it >needs to be. >_______________________________________________ >dev-commits-src-main@freebsd.org mailing list >https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main >To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@freebsd.org" Hi folks, I'd originally replied to imp@ when he sent me a comment about this, although because of a misconfiguration I hadn't seen it was also sent to a different list, but in it I remarked the same things about nvidia-modesetting and the speed, however I do think Kyle is right that it's better to rework the sentence because mountroot isn't really docuemented in the extant manual pages. I'm not sure about wanting to document the other details outlined here, because I'm not entirely sure I understand them - plus, it's in a different manual page, so it's free for anyone with an active commit bit and an understanding to persue. :) I'll try and work something out and do a Phabricator review, but let's try and keep the bike-shedding to a minimum. Yours, Daniel Ebdrup Jensen P.S. We all know the best colour is purple. ;) --ngewsruxf4hgc6kg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEEDonNJPbg/JLIMoS6Ps5hSHzN87oFAmAhh3ZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDBF ODlDRDI0RjZFMEZDOTJDODMyODRCQTNFQ0U2MTQ4N0NDREYzQkEACgkQPs5hSHzN 87p7IAf+OFg52NNYY4KiYfajBDZ3W2suF/4XnEEmjEXK19kv8J76+IhmOZVloe6O uw1EF+p6Sd+vbmd/DMxUnxlFVI+kz8FhDse5Fqed3SWyEkqvjLzhO/qhQ9blNJ5S O9DLEJz8izUpwZvV/+zlLthqkP+zL/ezsy0qiEMsGRPv0n3kj8CkivpHIr0sGHAC DFN0xlV74CR1tCEBh6eJgPwrj61r1H1vJ82O4S0a1sQ/u4kSHg530Jsxu+MW4k5m kArGQDQ797b+KL90iVrpilJM0uchpntB5CjrIjA0B5Tq6on7cfbgtIvrd184P2uL POoAAffaZQXbmkwTmVYLi1NtJkMcWw== =fcdt -----END PGP SIGNATURE----- --ngewsruxf4hgc6kg-- From owner-dev-commits-src-main@freebsd.org Mon Feb 8 19:15:31 2021 Return-Path: Delivered-To: dev-commits-src-main@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 7C8F753DA64; Mon, 8 Feb 2021 19:15:31 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZG2C35J8z4h3M; Mon, 8 Feb 2021 19:15:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D8541CCE2; Mon, 8 Feb 2021 19:15:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118JFV5u067852; Mon, 8 Feb 2021 19:15:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118JFVS0067851; Mon, 8 Feb 2021 19:15:31 GMT (envelope-from git) Date: Mon, 8 Feb 2021 19:15:31 GMT Message-Id: <202102081915.118JFVS0067851@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 81e074d57dfc - main - libkern: use compiler builtins for strcpy, strcmp and strlen MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81e074d57dfcd86f152e2848dc44b77087ee7a2d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 19:15:31 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=81e074d57dfcd86f152e2848dc44b77087ee7a2d commit 81e074d57dfcd86f152e2848dc44b77087ee7a2d Author: Mateusz Guzik AuthorDate: 2021-02-07 19:50:25 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-08 19:15:21 +0000 libkern: use compiler builtins for strcpy, strcmp and strlen --- sys/sys/libkern.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h index 3874ef9ec4bd..3f8827de06c5 100644 --- a/sys/sys/libkern.h +++ b/sys/sys/libkern.h @@ -199,6 +199,10 @@ size_t kcsan_strlen(const char *); #define strcpy(d, s) kcsan_strcpy((d), (s)) #define strcmp(s1, s2) kcsan_strcmp((s1), (s2)) #define strlen(s) kcsan_strlen((s)) +#else +#define strcpy(d, s) __builtin_strcpy((d), (s)) +#define strcmp(s1, s2) __builtin_strcmp((s1), (s2)) +#define strlen(s) __builtin_strlen((s)) #endif static __inline char * From owner-dev-commits-src-main@freebsd.org Mon Feb 8 19:15:32 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A1B4953DBA1; Mon, 8 Feb 2021 19:15:32 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZG2D4FdNz4gvR; Mon, 8 Feb 2021 19:15:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A7331CEA9; Mon, 8 Feb 2021 19:15:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118JFWwh067875; Mon, 8 Feb 2021 19:15:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118JFW3w067874; Mon, 8 Feb 2021 19:15:32 GMT (envelope-from git) Date: Mon, 8 Feb 2021 19:15:32 GMT Message-Id: <202102081915.118JFW3w067874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 3acea07c1873 - main - Restore the augmented strlen commentary MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3acea07c1873b1e4042f4a4fa8668745ee59f15b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 19:15:32 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3acea07c1873b1e4042f4a4fa8668745ee59f15b commit 3acea07c1873b1e4042f4a4fa8668745ee59f15b Author: Mateusz Guzik AuthorDate: 2021-02-07 19:53:34 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-08 19:15:21 +0000 Restore the augmented strlen commentary ... lost in revert --- lib/libc/string/strlen.c | 15 ++++----------- sys/libkern/strlen.c | 15 ++++----------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/lib/libc/string/strlen.c b/lib/libc/string/strlen.c index a862ffc245ca..2d1803b1e078 100644 --- a/lib/libc/string/strlen.c +++ b/lib/libc/string/strlen.c @@ -35,10 +35,6 @@ __FBSDID("$FreeBSD$"); /* * Portable strlen() for 32-bit and 64-bit systems. * - * Rationale: it is generally much more efficient to do word length - * operations and avoid branches on modern computer systems, as - * compared to byte-length operations with a lot of branches. - * * The expression: * * ((x - 0x01....01) & ~x & 0x80....80) @@ -46,15 +42,12 @@ __FBSDID("$FreeBSD$"); * would evaluate to a non-zero value iff any of the bytes in the * original word is zero. * - * On multi-issue processors, we can divide the above expression into: - * a) (x - 0x01....01) - * b) (~x & 0x80....80) - * c) a & b - * - * Where, a) and b) can be partially computed in parallel. - * * The algorithm above is found on "Hacker's Delight" by * Henry S. Warren, Jr. + * + * Note: this leaves performance on the table and each architecture + * would be best served with a tailor made routine instead, even if + * using the same trick. */ /* Magic numbers for the algorithm */ diff --git a/sys/libkern/strlen.c b/sys/libkern/strlen.c index a8c7964f69a3..1c4a2b954de3 100644 --- a/sys/libkern/strlen.c +++ b/sys/libkern/strlen.c @@ -34,10 +34,6 @@ __FBSDID("$FreeBSD$"); /* * Portable strlen() for 32-bit and 64-bit systems. * - * Rationale: it is generally much more efficient to do word length - * operations and avoid branches on modern computer systems, as - * compared to byte-length operations with a lot of branches. - * * The expression: * * ((x - 0x01....01) & ~x & 0x80....80) @@ -45,15 +41,12 @@ __FBSDID("$FreeBSD$"); * would evaluate to a non-zero value iff any of the bytes in the * original word is zero. * - * On multi-issue processors, we can divide the above expression into: - * a) (x - 0x01....01) - * b) (~x & 0x80....80) - * c) a & b - * - * Where, a) and b) can be partially computed in parallel. - * * The algorithm above is found on "Hacker's Delight" by * Henry S. Warren, Jr. + * + * Note: this leaves performance on the table and each architecture + * would be best served with a tailor made routine instead, even if + * using the same trick. */ /* Magic numbers for the algorithm */ From owner-dev-commits-src-main@freebsd.org Mon Feb 8 19:15:34 2021 Return-Path: Delivered-To: dev-commits-src-main@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 7A20753DB5D; Mon, 8 Feb 2021 19:15:34 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZG2G0YGtz4h3Q; Mon, 8 Feb 2021 19:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C08C51CA7E; Mon, 8 Feb 2021 19:15:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118JFXim067893; Mon, 8 Feb 2021 19:15:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118JFXkJ067892; Mon, 8 Feb 2021 19:15:33 GMT (envelope-from git) Date: Mon, 8 Feb 2021 19:15:33 GMT Message-Id: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: af366d353b84 - main - amd64: implement strlen in assembly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: af366d353b84bdc4e730f0fc563853abc338271c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 19:15:34 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=af366d353b84bdc4e730f0fc563853abc338271c commit af366d353b84bdc4e730f0fc563853abc338271c Author: Mateusz Guzik AuthorDate: 2021-02-08 17:01:48 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-08 19:15:21 +0000 amd64: implement strlen in assembly The C variant in libkern performs excessive branching to find the non-zero byte instead of using the bsfq instruction. The same code patched to use it is still slower than the routine implemented here as the compiler keeps neglecting to perform certain optimizations (like using leaq). On top of that the routine can is a starting point for copyinstr which operates on words instead of bytes. Tested with glibc test suite. Sample results (calls/s): Haswell: $(perl -e "print 'A' x 3"): stock: 211198039 patched:338626619 asm: 465609618 $(perl -e "print 'A' x 100"): stock: 83151997 patched: 98285919 asm: 120719888 AMD EPYC 7R32: $(perl -e "print 'A' x 3"): stock: 282523617 asm: 491498172 $(perl -e "print 'A' x 100"): stock: 114857172 asm: 112082057 --- sys/amd64/amd64/support.S | 66 +++++++++++++++++++++++++++++++++++++++++++++++ sys/conf/files | 1 - sys/conf/files.arm | 1 + sys/conf/files.arm64 | 1 + sys/conf/files.i386 | 1 + sys/conf/files.mips | 1 + sys/conf/files.powerpc | 1 + sys/conf/files.riscv | 1 + 8 files changed, 72 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index b623fba277db..994c5f15e245 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -697,6 +697,72 @@ ENTRY(fillw) ret END(fillw) +/* + * strlen(string) + * %rdi + * + * Uses the ((x - 0x01....01) & ~x & 0x80....80) trick. + * + * 0x80....80 is replaced with 0 - 0x80....80 so that it can be added + * with leaq. + * + * For a description see either: + * - "Hacker's Delight" by Henry S. Warren, Jr. + * - "Optimizing subroutines in assembly language: An optimization guide for x86 platforms" + * by Agner Fog + * + * The latter contains a 32-bit variant of the same algorithm coded in assembly for i386. + */ +ENTRY(strlen) + PUSH_FRAME_POINTER + movabsq $0xfefefefefefefeff,%r8 + movabsq $0x8080808080808080,%r9 + + movq %rdi,%r10 + movq %rdi,%rcx + testb $7,%dil + jz 2f + + /* + * Handle misaligned reads: align to 8 and fill + * the spurious bytes. + */ + andq $~7,%rdi + movq (%rdi),%r11 + shlq $3,%rcx + movq $-1,%rdx + shlq %cl,%rdx + notq %rdx + orq %rdx,%r11 + + leaq (%r11,%r8),%rcx + notq %r11 + andq %r11,%rcx + andq %r9,%rcx + jnz 3f + + /* + * Main loop. + */ + ALIGN_TEXT +1: + leaq 8(%rdi),%rdi +2: + movq (%rdi),%r11 + leaq (%r11,%r8),%rcx + notq %r11 + andq %rcx,%r11 + andq %r9,%rcx + jz 1b +3: + bsfq %rcx,%rcx + shrq $3,%rcx + leaq (%rcx,%rdi),%rax + subq %r10,%rax + POP_FRAME_POINTER + ret +END(strlen) + /*****************************************************************************/ /* copyout and fubyte family */ /*****************************************************************************/ diff --git a/sys/conf/files b/sys/conf/files index edca1003e904..1abfadb1e8d8 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4085,7 +4085,6 @@ libkern/strdup.c standard libkern/strndup.c standard libkern/strlcat.c standard libkern/strlcpy.c standard -libkern/strlen.c standard libkern/strncat.c standard libkern/strncmp.c standard libkern/strncpy.c standard diff --git a/sys/conf/files.arm b/sys/conf/files.arm index eb3a23b5fc21..69986585bdf6 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -127,6 +127,7 @@ libkern/lshrdi3.c standard libkern/memcmp.c standard libkern/moddi3.c standard libkern/qdivrem.c standard +libkern/strlen.c standard libkern/ucmpdi2.c standard libkern/udivdi3.c standard libkern/umoddi3.c standard diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index f7003b1048c8..42ec3b2787b1 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -432,6 +432,7 @@ libkern/memcmp.c standard \ compile-with "${NORMAL_C:N-fsanitize*}" libkern/memset.c standard \ compile-with "${NORMAL_C:N-fsanitize*}" +libkern/strlen.c standard libkern/arm64/crc32c_armv8.S standard cddl/dev/dtrace/aarch64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/aarch64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index 6560ab217d96..1e2ab5f8c52a 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -218,6 +218,7 @@ libkern/memcmp.c standard libkern/memset.c standard libkern/moddi3.c standard libkern/qdivrem.c standard +libkern/strlen.c standard libkern/ucmpdi2.c standard libkern/udivdi3.c standard libkern/umoddi3.c standard diff --git a/sys/conf/files.mips b/sys/conf/files.mips index c18f0a5c69be..7ee5b0019bd7 100644 --- a/sys/conf/files.mips +++ b/sys/conf/files.mips @@ -66,6 +66,7 @@ libkern/ucmpdi2.c optional mips | mipshf | mipsel | mipselhf libkern/ashldi3.c standard libkern/ashrdi3.c standard libkern/memcmp.c standard +libkern/strlen.c standard # cfe support dev/cfe/cfe_api.c optional cfe diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc index 3022fd6f6e39..347abee153d2 100644 --- a/sys/conf/files.powerpc +++ b/sys/conf/files.powerpc @@ -129,6 +129,7 @@ libkern/memcmp.c standard libkern/memset.c standard libkern/moddi3.c optional powerpc | powerpcspe libkern/qdivrem.c optional powerpc | powerpcspe +libkern/strlen.c standard libkern/ucmpdi2.c optional powerpc | powerpcspe libkern/udivdi3.c optional powerpc | powerpcspe libkern/umoddi3.c optional powerpc | powerpcspe diff --git a/sys/conf/files.riscv b/sys/conf/files.riscv index 3969528db07e..7ecea016b9a3 100644 --- a/sys/conf/files.riscv +++ b/sys/conf/files.riscv @@ -29,6 +29,7 @@ libkern/flsl.c standard libkern/flsll.c standard libkern/memcmp.c standard libkern/memset.c standard +libkern/strlen.c standard riscv/riscv/autoconf.c standard riscv/riscv/bus_machdep.c standard riscv/riscv/bus_space_asm.S standard From owner-dev-commits-src-main@freebsd.org Mon Feb 8 19:19:03 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9B16E53E183; Mon, 8 Feb 2021 19:19:03 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZG6H41Lwz4hDR; Mon, 8 Feb 2021 19:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C95E1C9F3; Mon, 8 Feb 2021 19:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118JJ3wj068528; Mon, 8 Feb 2021 19:19:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118JJ3Qw068527; Mon, 8 Feb 2021 19:19:03 GMT (envelope-from git) Date: Mon, 8 Feb 2021 19:19:03 GMT Message-Id: <202102081919.118JJ3Qw068527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Daniel Ebdrup Jensen Subject: git: d242f782c249 - main - prepare-commit-msg: Remove blank character MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: debdrup X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d242f782c24980627716613ff8fb5e6078520a5b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 19:19:03 -0000 The branch main has been updated by debdrup (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d242f782c24980627716613ff8fb5e6078520a5b commit d242f782c24980627716613ff8fb5e6078520a5b Author: Daniel Ebdrup Jensen AuthorDate: 2021-02-08 19:15:34 +0000 Commit: Daniel Ebdrup Jensen CommitDate: 2021-02-08 19:18:39 +0000 prepare-commit-msg: Remove blank character Approved by: emaste@ (maintainer) --- tools/tools/git/hooks/prepare-commit-msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/git/hooks/prepare-commit-msg b/tools/tools/git/hooks/prepare-commit-msg index 6a8db33649f0..4d1072700af0 100755 --- a/tools/tools/git/hooks/prepare-commit-msg +++ b/tools/tools/git/hooks/prepare-commit-msg @@ -41,7 +41,7 @@ $(awk '1;/^#$/{exit}' $1) # 72 columns --| # # Uncomment and complete these metadata fields, as appropriate: -# +# # PR: # Reported by: # Reviewed by: From owner-dev-commits-src-main@freebsd.org Mon Feb 8 19:25:42 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5445053E1BD; Mon, 8 Feb 2021 19:25:42 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZGFy17byz4hrv; Mon, 8 Feb 2021 19:25:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 195521CE75; Mon, 8 Feb 2021 19:25:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118JPgJp080949; Mon, 8 Feb 2021 19:25:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118JPgpG080948; Mon, 8 Feb 2021 19:25:42 GMT (envelope-from git) Date: Mon, 8 Feb 2021 19:25:42 GMT Message-Id: <202102081925.118JPgpG080948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 7da3bfc20ca8 - main - amd64: fix up a braino in strlen comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7da3bfc20ca8aca8177b677cba37c9f52714605c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 19:25:42 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=7da3bfc20ca8aca8177b677cba37c9f52714605c commit 7da3bfc20ca8aca8177b677cba37c9f52714605c Author: Mateusz Guzik AuthorDate: 2021-02-08 19:24:26 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-08 19:24:26 +0000 amd64: fix up a braino in strlen comment --- sys/amd64/amd64/support.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 994c5f15e245..a059b520c5d5 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -703,7 +703,7 @@ END(fillw) * * Uses the ((x - 0x01....01) & ~x & 0x80....80) trick. * - * 0x80....80 is replaced with 0 - 0x80....80 so that it can be added + * 0x01....01 is replaced with 0x0 - 0x01....01 so that it can be added * with leaq. * * For a description see either: From owner-dev-commits-src-main@freebsd.org Mon Feb 8 19:36:45 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E577553E871 for ; Mon, 8 Feb 2021 19:36:45 +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 4DZGVj5xJjz4k3F for ; Mon, 8 Feb 2021 19:36:45 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f45.google.com with SMTP id g6so5629067wrs.11 for ; Mon, 08 Feb 2021 11:36:45 -0800 (PST) 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=O81UVmBRD1JcxFCvYm5cyLv3yKY72WYggDRlAi/+jPw=; b=NfjYQmrzFZhWiOHusicpUNz/9S68Ed2KnV7Wiq3ao8fJnZULeDR3W5rGHR7iZ77H92 bTnRVSed4L2PCjE5228iWjcqoui1eWU+XYN9bNFKd+joMF6zavo67EG02kbnbDA0zgTM fl3TtIS+YYCKUDAdbd6i54NkfT7hSzsFkVz8R2ZhIhXVgBent6CrzLrd/YtKrGjBlzkD pJ+Bl1L+WVvRGmt5wFFmYVXH4wp2zslT3erkZzXptn4+CVYMBdq6g+lwv4aMlmnySUON nRf53Gsj0sEKiurLg8L7bUI7T+g2wklLKOdX4KoRh2LK3UH2bSSbdIcaJQfy+EwYjE+s HRVg== X-Gm-Message-State: AOAM530XFKwqeHi4rLuvagfuFQvcdIk96/ywoC7XyCwLggQIOgRH1K22 I+PcONhr9KRSCJHcn3bWnLK7OA== X-Google-Smtp-Source: ABdhPJzIDKEvEXZ/TWBvng29nekyUkt9zhS60eZL/b3SoYTdY7cEH3vWHGh5flRnVKjhBA9j9uwmrA== X-Received: by 2002:a05:6000:1565:: with SMTP id 5mr22006701wrz.109.1612813004393; Mon, 08 Feb 2021 11:36:44 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id w15sm29538756wrp.15.2021.02.08.11.36.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2021 11:36:43 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly From: Jessica Clarke In-Reply-To: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> Date: Mon, 8 Feb 2021 19:36:42 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DZGVj5xJjz4k3F X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 19:36:46 -0000 On 8 Feb 2021, at 19:15, Mateusz Guzik wrote: >=20 > The branch main has been updated by mjg: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Daf366d353b84bdc4e730f0fc563853ab= c338271c >=20 > commit af366d353b84bdc4e730f0fc563853abc338271c > Author: Mateusz Guzik > AuthorDate: 2021-02-08 17:01:48 +0000 > Commit: Mateusz Guzik > CommitDate: 2021-02-08 19:15:21 +0000 >=20 > amd64: implement strlen in assembly >=20 > The C variant in libkern performs excessive branching to find the > non-zero byte instead of using the bsfq instruction. The same code > patched to use it is still slower than the routine implemented here > as the compiler keeps neglecting to perform certain optimizations > (like using leaq). >=20 > On top of that the routine can is a starting point for copyinstr > which operates on words instead of bytes. >=20 > Tested with glibc test suite. >=20 > Sample results (calls/s): >=20 > Haswell: > $(perl -e "print 'A' x 3"): > stock: 211198039 > patched:338626619 > asm: 465609618 >=20 > $(perl -e "print 'A' x 100"): > stock: 83151997 > patched: 98285919 > asm: 120719888 >=20 > AMD EPYC 7R32: > $(perl -e "print 'A' x 3"): > stock: 282523617 > asm: 491498172 >=20 > $(perl -e "print 'A' x 100"): > stock: 114857172 > asm: 112082057 No Reviewed by? More than one pair of eyes on non-trivial assembly is almost always a good idea. Jess From owner-dev-commits-src-main@freebsd.org Mon Feb 8 19:37:01 2021 Return-Path: Delivered-To: dev-commits-src-main@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 F325A53E8EF for ; Mon, 8 Feb 2021 19:37:01 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 4DZGW16R60z4kKf for ; Mon, 8 Feb 2021 19:37:01 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f51.google.com with SMTP id v15so18620427wrx.4 for ; Mon, 08 Feb 2021 11:37:01 -0800 (PST) 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=iVWjTMA1J1aqa4Ko9A3COtqC+O+0E+i1fYIxrj8W7ik=; b=Jnwcxws4TO76sajCN29gdgCP5++TyDZLYZIajwPbG3DAHorWPSvDdXS+aSMulnim/K 0Lqek2PZnVMIJv0416jbZjWkcf/9v9sOWByoyeohOXlcRyiKjJWcJ4qDArye7Cw4EduP NzQMzOiO3kXHTHy3TCJx22TvF8DCyXbHASYFTgtWKpces8eXoq3ojqpSotXwHz3n6lJL ScBFwg1SBlR2MRzICCAv8Zvo3A+2GU05v9h1ziao7bwNK0ebFxyp2v2l45KbxlCpPCqY JeC8PoR6m2x1E4/rQiKbR0hf46dERLfkmAcuCg05HX342lRdj7PTx6EehFCkdOxPz46K szew== X-Gm-Message-State: AOAM531dknnnWJyOBaxLXsfCRLOT1UUbZeV29xhQ6z9bOl4udQlklheF pIw+nq0gUmW1gnm+WkPZ3ubmJwuzEAAso4QC X-Google-Smtp-Source: ABdhPJwJb7rRXsCEfZ7LXv3DHJpu3gkWixf/O2IFIKWcdtCq/or9k6V5PYz54l+T/S6WVOBWeeGmdQ== X-Received: by 2002:a05:6000:234:: with SMTP id l20mr21577484wrz.212.1612813020647; Mon, 08 Feb 2021 11:37:00 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id w15sm29538756wrp.15.2021.02.08.11.37.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2021 11:37:00 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 81e074d57dfc - main - libkern: use compiler builtins for strcpy, strcmp and strlen From: Jessica Clarke In-Reply-To: <202102081915.118JFVS0067851@gitrepo.freebsd.org> Date: Mon, 8 Feb 2021 19:36:59 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <8F5A406F-FB06-4D52-8CD7-1DCE01B6C126@freebsd.org> References: <202102081915.118JFVS0067851@gitrepo.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DZGW16R60z4kKf X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 19:37:02 -0000 On 8 Feb 2021, at 19:15, Mateusz Guzik wrote: >=20 > The branch main has been updated by mjg: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D81e074d57dfcd86f152e2848dc44b770= 87ee7a2d >=20 > commit 81e074d57dfcd86f152e2848dc44b77087ee7a2d > Author: Mateusz Guzik > AuthorDate: 2021-02-07 19:50:25 +0000 > Commit: Mateusz Guzik > CommitDate: 2021-02-08 19:15:21 +0000 >=20 > libkern: use compiler builtins for strcpy, strcmp and strlen Why? Jess From owner-dev-commits-src-main@freebsd.org Mon Feb 8 19:46:04 2021 Return-Path: Delivered-To: dev-commits-src-main@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 90CA153EE32; Mon, 8 Feb 2021 19:46:04 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZGjS3kMTz4l78; Mon, 8 Feb 2021 19:46:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72DE91D0D9; Mon, 8 Feb 2021 19:46:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118Jk4lO007560; Mon, 8 Feb 2021 19:46:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118Jk4sN007559; Mon, 8 Feb 2021 19:46:04 GMT (envelope-from git) Date: Mon, 8 Feb 2021 19:46:04 GMT Message-Id: <202102081946.118Jk4sN007559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b57704702762 - main - mca: Handle inconsistent CMCI capability reporting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5770470276268acef21368b3e77a325df883500 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 19:46:04 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b5770470276268acef21368b3e77a325df883500 commit b5770470276268acef21368b3e77a325df883500 Author: Mark Johnston AuthorDate: 2021-02-08 19:42:54 +0000 Commit: Mark Johnston CommitDate: 2021-02-08 19:42:54 +0000 mca: Handle inconsistent CMCI capability reporting A BIOS bug may apparently cause the BSP to report that it does not implement CMCI, with some APs reporting that they do. In this scenario, avoid a NULL pointer dereference that occurs in cmci_monitor() because cmc_state was not allocated by the BSP. PR: 253272 Reported by: asomers, mmacy Reviewed by: kib (previous version) MFC after: 1 week --- sys/x86/x86/mca.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/x86/x86/mca.c b/sys/x86/x86/mca.c index 03100e77d455..801e18073a52 100644 --- a/sys/x86/x86/mca.c +++ b/sys/x86/x86/mca.c @@ -1070,6 +1070,20 @@ cmci_monitor(int i) KASSERT(i < mca_banks, ("CPU %d has more MC banks", PCPU_GET(cpuid))); + /* + * It is possible for some APs to report CMCI support even if the BSP + * does not, apparently due to a BIOS bug. + */ + if (cmc_state == NULL) { + if (bootverbose) { + printf( + "AP %d (%d,%d) reports CMCI support but the BSP does not\n", + PCPU_GET(cpuid), PCPU_GET(apic_id), + PCPU_GET(acpi_id)); + } + return; + } + ctl = rdmsr(MSR_MC_CTL2(i)); if (ctl & MC_CTL2_CMCI_EN) /* Already monitored by another CPU. */ @@ -1114,6 +1128,10 @@ cmci_resume(int i) KASSERT(i < mca_banks, ("CPU %d has more MC banks", PCPU_GET(cpuid))); + /* See cmci_monitor(). */ + if (cmc_state == NULL) + return; + /* Ignore banks not monitored by this CPU. */ if (!(PCPU_GET(cmci_mask) & 1 << i)) return; From owner-dev-commits-src-main@freebsd.org Mon Feb 8 19:49:01 2021 Return-Path: Delivered-To: dev-commits-src-main@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 ACC2A53EF3C; Mon, 8 Feb 2021 19:49:01 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZGms4VVJz4lX1; Mon, 8 Feb 2021 19:49:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D14B1D52B; Mon, 8 Feb 2021 19:49:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118Jn1kL008134; Mon, 8 Feb 2021 19:49:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118Jn10U008133; Mon, 8 Feb 2021 19:49:01 GMT (envelope-from git) Date: Mon, 8 Feb 2021 19:49:01 GMT Message-Id: <202102081949.118Jn10U008133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 93fc67896550 - main - Fix incorrect powf(3) result with x near 1 and |y| much larger than 1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93fc67896550548f91b307dbe3053f11db5d4a8a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 19:49:01 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=93fc67896550548f91b307dbe3053f11db5d4a8a commit 93fc67896550548f91b307dbe3053f11db5d4a8a Author: Steve Kargl AuthorDate: 2021-02-08 19:45:30 +0000 Commit: Dimitry Andric CommitDate: 2021-02-08 19:48:43 +0000 Fix incorrect powf(3) result with x near 1 and |y| much larger than 1 This adjusts the check to trigger overflow/underflow to a slightly lower value. Before: powf(9.999995e-01, -1.342177e+08) -> inf After: powf(9.999995e-01, -1.342177e+08) -> 1.858724e+31 MFC after: 1 week --- lib/msun/src/e_powf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msun/src/e_powf.c b/lib/msun/src/e_powf.c index 53f1d37d6bec..33eedad50b16 100644 --- a/lib/msun/src/e_powf.c +++ b/lib/msun/src/e_powf.c @@ -136,7 +136,7 @@ __ieee754_powf(float x, float y) /* |y| is huge */ if(iy>0x4d000000) { /* if |y| > 2**27 */ /* over/underflow if x is not close to one */ - if(ix<0x3f7ffff8) return (hy<0)? sn*huge*huge:sn*tiny*tiny; + if(ix<0x3f7ffff7) return (hy<0)? sn*huge*huge:sn*tiny*tiny; if(ix>0x3f800007) return (hy>0)? sn*huge*huge:sn*tiny*tiny; /* now |1-x| is tiny <= 2**-20, suffice to compute log(x) by x-x^2/2+x^3/3-x^4/4 */ From owner-dev-commits-src-main@freebsd.org Mon Feb 8 20:10:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9FF7653FF07; Mon, 8 Feb 2021 20:10:20 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZHFS3x5Pz4n6r; Mon, 8 Feb 2021 20:10:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A4D71D5ED; Mon, 8 Feb 2021 20:10:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118KAK8q041418; Mon, 8 Feb 2021 20:10:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118KAKsc041411; Mon, 8 Feb 2021 20:10:20 GMT (envelope-from git) Date: Mon, 8 Feb 2021 20:10:20 GMT Message-Id: <202102082010.118KAKsc041411@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9600aa31aa63 - main - nvme: use NVME_GONE rather than hard-coded 0xffffffff MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9600aa31aa633bbb9e8a56d91a781d5a7ce2bff6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 20:10:20 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9600aa31aa633bbb9e8a56d91a781d5a7ce2bff6 commit 9600aa31aa633bbb9e8a56d91a781d5a7ce2bff6 Author: Warner Losh AuthorDate: 2021-02-08 20:08:48 +0000 Commit: Warner Losh CommitDate: 2021-02-08 20:08:48 +0000 nvme: use NVME_GONE rather than hard-coded 0xffffffff Make it clearer that the value 0xfffffff is being used to detect the device is gone. We use it other places in the driver for other meanings. --- sys/dev/nvme/nvme_ctrlr.c | 6 +++--- sys/dev/nvme/nvme_private.h | 2 ++ sys/dev/nvme/nvme_qpair.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 2bd7074ee378..c0e6c408ab56 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -261,7 +261,7 @@ nvme_ctrlr_wait_for_ready(struct nvme_controller *ctrlr, int desired_val) ms_waited = 0; while (1) { csts = nvme_mmio_read_4(ctrlr, csts); - if (csts == 0xffffffff) /* Hot unplug. */ + if (csts == NVME_GONE) /* Hot unplug. */ return (ENXIO); if (((csts >> NVME_CSTS_REG_RDY_SHIFT) & NVME_CSTS_REG_RDY_MASK) == desired_val) @@ -1471,7 +1471,7 @@ nvme_ctrlr_destruct(struct nvme_controller *ctrlr, device_t dev) * Check whether it is a hot unplug or a clean driver detach. * If device is not there any more, skip any shutdown commands. */ - gone = (nvme_mmio_read_4(ctrlr, csts) == 0xffffffff); + gone = (nvme_mmio_read_4(ctrlr, csts) == NVME_GONE); if (gone) nvme_ctrlr_fail(ctrlr); else @@ -1549,7 +1549,7 @@ nvme_ctrlr_shutdown(struct nvme_controller *ctrlr) ((uint64_t)ctrlr->cdata.rtd3e * hz + 999999) / 1000000; while (1) { csts = nvme_mmio_read_4(ctrlr, csts); - if (csts == 0xffffffff) /* Hot unplug. */ + if (csts == NVME_GONE) /* Hot unplug. */ break; if (NVME_CSTS_GET_SHST(csts) == NVME_SHST_COMPLETE) break; diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index d44f1989dd71..6c1d293f047d 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -104,6 +104,8 @@ MALLOC_DECLARE(M_NVME); #define CACHE_LINE_SIZE (64) #endif +#define NVME_GONE 0xfffffffful + extern int32_t nvme_retry_count; extern bool nvme_verbose_cmd_dump; diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 45b1568a4c5a..0726ca248442 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -945,7 +945,7 @@ nvme_timeout(void *arg) nvme_abort_complete, tr); } else { nvme_printf(ctrlr, "Resetting controller due to a timeout%s.\n", - (csts == 0xffffffff) ? " and possible hot unplug" : + (csts == NVME_GONE) ? " and possible hot unplug" : (cfs ? " and fatal error status" : "")); nvme_ctrlr_reset(ctrlr); } From owner-dev-commits-src-main@freebsd.org Mon Feb 8 20:25:19 2021 Return-Path: Delivered-To: dev-commits-src-main@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 ACE07540621; Mon, 8 Feb 2021 20:25:19 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZHZl4Zv0z4nys; Mon, 8 Feb 2021 20:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 905FD1DCA6; Mon, 8 Feb 2021 20:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118KPJ38059592; Mon, 8 Feb 2021 20:25:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118KPJbo059591; Mon, 8 Feb 2021 20:25:19 GMT (envelope-from git) Date: Mon, 8 Feb 2021 20:25:19 GMT Message-Id: <202102082025.118KPJbo059591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 6c34d8ce11cb - main - ktls(4): Mention WITH_OPENSSL_KTLS in the ktls(4) manual page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6c34d8ce11cb73e718fc23d85b6fbfab07ee15b4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 20:25:19 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6c34d8ce11cb73e718fc23d85b6fbfab07ee15b4 commit 6c34d8ce11cb73e718fc23d85b6fbfab07ee15b4 Author: Gordon Bergling AuthorDate: 2021-02-08 20:21:26 +0000 Commit: Gordon Bergling CommitDate: 2021-02-08 20:21:26 +0000 ktls(4): Mention WITH_OPENSSL_KTLS in the ktls(4) manual page Since we ship a ktls(4) enabled OpenSSL version, mention the src.conf(5) option WITH_OPENSSL_KTLS in the manual page. Reviewed by: jhb MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28435 --- share/man/man4/ktls.4 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/man/man4/ktls.4 b/share/man/man4/ktls.4 index 9a8dccfb8afe..21e1a1bdb6ca 100644 --- a/share/man/man4/ktls.4 +++ b/share/man/man4/ktls.4 @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2020 +.Dd February 8, 2021 .Dt KTLS 4 .Os .Sh NAME @@ -237,7 +237,9 @@ port may also be built with support for .Nm by enabling the .Dv KTLS -option . +option. +OpenSSL in the base system includes KTLS support when built with +.Dv WITH_OPENSSL_KTLS . .Pp Applications using a supported library should generally work with .Nm @@ -256,6 +258,7 @@ As a result, it is only supported on architectures with a direct map. .Xr cxgbe 4 , .Xr mlx5en 4 , .Xr tcp 4 , +.Xr src.conf 5 , .Xr ifconfig 8 , .Xr sysctl 8 , .Xr crypto 9 From owner-dev-commits-src-main@freebsd.org Mon Feb 8 20:31:01 2021 Return-Path: Delivered-To: dev-commits-src-main@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 EE59D540A3D; Mon, 8 Feb 2021 20:31:01 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZHjK6TSxz4pR2; Mon, 8 Feb 2021 20:31:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D13671E017; Mon, 8 Feb 2021 20:31:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118KV1Tx067880; Mon, 8 Feb 2021 20:31:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118KV1LH067878; Mon, 8 Feb 2021 20:31:01 GMT (envelope-from git) Date: Mon, 8 Feb 2021 20:31:01 GMT Message-Id: <202102082031.118KV1LH067878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: dd2516fc078f - main - nvme: Make nvme_ctrlr_hw_reset static MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd2516fc078f15633ad5aedaad6de140cb491f80 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 20:31:02 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=dd2516fc078f15633ad5aedaad6de140cb491f80 commit dd2516fc078f15633ad5aedaad6de140cb491f80 Author: Warner Losh AuthorDate: 2021-02-08 20:28:18 +0000 Commit: Warner Losh CommitDate: 2021-02-08 20:29:24 +0000 nvme: Make nvme_ctrlr_hw_reset static nvme_ctrlr_hw_reset is no longer used outside of nvme_ctrlr.c, so make it static. If we need to change this in the future we can. --- sys/dev/nvme/nvme_ctrlr.c | 2 +- sys/dev/nvme/nvme_private.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index c0e6c408ab56..351c6839a6f6 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -403,7 +403,7 @@ nvme_ctrlr_disable_qpairs(struct nvme_controller *ctrlr) } } -int +static int nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr) { int err; diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index 6c1d293f047d..ee0a909e24ec 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -398,7 +398,6 @@ void nvme_completion_poll_cb(void *arg, const struct nvme_completion *cpl); int nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev); void nvme_ctrlr_destruct(struct nvme_controller *ctrlr, device_t dev); void nvme_ctrlr_shutdown(struct nvme_controller *ctrlr); -int nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr); void nvme_ctrlr_reset(struct nvme_controller *ctrlr); /* ctrlr defined as void * to allow use with config_intrhook. */ void nvme_ctrlr_start_config_hook(void *ctrlr_arg); From owner-dev-commits-src-main@freebsd.org Mon Feb 8 21:36:27 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4E67D542744; Mon, 8 Feb 2021 21:36:27 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZK8q1qsRz4tZF; Mon, 8 Feb 2021 21:36:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 319551E777; Mon, 8 Feb 2021 21:36:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118LaR9F051008; Mon, 8 Feb 2021 21:36:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118LaRAW051007; Mon, 8 Feb 2021 21:36:27 GMT (envelope-from git) Date: Mon, 8 Feb 2021 21:36:27 GMT Message-Id: <202102082136.118LaRAW051007@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: d8c6d4c7321d - main - wsp: Add sysctl tunable for Z-Axis inversion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8c6d4c7321d4c969216bda8f792b45ed00afd64 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 21:36:27 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=d8c6d4c7321d4c969216bda8f792b45ed00afd64 commit d8c6d4c7321d4c969216bda8f792b45ed00afd64 Author: Vladimir Kondratyev AuthorDate: 2021-02-08 21:26:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-08 21:35:39 +0000 wsp: Add sysctl tunable for Z-Axis inversion This adds a new sysctl to Wellspring Touchpad driver for controlling Z-Axis (2-finger vertical scroll) direction "hw.usb.wsp.z_invert". Submitted by: James Wright Reviewed by: wulf PR: 253321 Differential revision: https://reviews.freebsd.org/D28521 --- share/man/man4/wsp.4 | 7 ++++++- sys/dev/usb/input/wsp.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/share/man/man4/wsp.4 b/share/man/man4/wsp.4 index 70a1219533dc..847c79c71f29 100644 --- a/share/man/man4/wsp.4 +++ b/share/man/man4/wsp.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2018 +.Dd February 9, 2021 .Dt WSP 4 .Os .Sh NAME @@ -67,6 +67,11 @@ Pointer sensitivity can be controlled using the sysctl tunable Tap to left-click can be controlled using the sysctl tunable .Nm hw.usb.wsp.enable_single_tap_clicks , set to 0 to disable single tap clicks or 1 to enable them (default). +Z-Axis sensitivity can be controlled using the sysctl tunable +.Nm hw.usb.wsp.z_factor . +Z-Axis inversion can be controlled using the sysctl tunable +.Nm hw.usb.wsp.z_invert , +set to 0 to disable (default) or 1 to enable inversion. .Sh FILES .Nm creates a blocking pseudo-device file, diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index a25539e7b939..c44c4aceb308 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -88,6 +88,7 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, debug, CTLFLAG_RWTUN, static struct wsp_tuning { int scale_factor; int z_factor; + int z_invert; int pressure_touch_threshold; int pressure_untouch_threshold; int pressure_tap_threshold; @@ -98,6 +99,7 @@ static struct wsp_tuning { { .scale_factor = 12, .z_factor = 5, + .z_invert = 0, .pressure_touch_threshold = 50, .pressure_untouch_threshold = 10, .pressure_tap_threshold = 120, @@ -110,6 +112,7 @@ wsp_runing_rangecheck(struct wsp_tuning *ptun) { WSP_CLAMP(ptun->scale_factor, 1, 63); WSP_CLAMP(ptun->z_factor, 1, 63); + WSP_CLAMP(ptun->z_invert, 0, 1); WSP_CLAMP(ptun->pressure_touch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_untouch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_tap_threshold, 1, 255); @@ -121,6 +124,8 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scale_factor, CTLFLAG_RWTUN, &wsp_tuning.scale_factor, 0, "movement scale factor"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, z_factor, CTLFLAG_RWTUN, &wsp_tuning.z_factor, 0, "Z-axis scale factor"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, z_invert, CTLFLAG_RWTUN, + &wsp_tuning.z_invert, 0, "enable Z-axis inversion"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_touch_threshold, CTLFLAG_RWTUN, &wsp_tuning.pressure_touch_threshold, 0, "touch pressure threshold"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_untouch_threshold, CTLFLAG_RWTUN, @@ -1126,7 +1131,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) dx = dy = 0; if (sc->dz_count == 0) - dz = sc->dz_sum / tun.z_factor; + dz = (sc->dz_sum / tun.z_factor) * (tun.z_invert ? -1 : 1); if (sc->scr_mode == WSP_SCR_HOR || abs(sc->pos_x[0] - sc->pos_x[1]) > MAX_DISTANCE || abs(sc->pos_y[0] - sc->pos_y[1]) > MAX_DISTANCE) From owner-dev-commits-src-main@freebsd.org Mon Feb 8 21:42:28 2021 Return-Path: Delivered-To: dev-commits-src-main@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 68AF9542AAB; Mon, 8 Feb 2021 21:42:28 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZKHm2WGXz4tlb; Mon, 8 Feb 2021 21:42:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48B5D1F085; Mon, 8 Feb 2021 21:42:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118LgSb5063391; Mon, 8 Feb 2021 21:42:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118LgSY3063390; Mon, 8 Feb 2021 21:42:28 GMT (envelope-from git) Date: Mon, 8 Feb 2021 21:42:28 GMT Message-Id: <202102082142.118LgSY3063390@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 4a01b854ca5c - main - SO_RERROR indicates that receive buffer overflows should be handled as errors. Historically receive buffer overflows have been ignored and programs could not tell if they missed messages or messages had been truncated because of overflows. Since programs historically do not expect to get receive overflow errors, this behavior is not the default. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a01b854ca5c2e5124958363b3326708b913af71 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 21:42:28 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=4a01b854ca5c2e5124958363b3326708b913af71 commit 4a01b854ca5c2e5124958363b3326708b913af71 Author: Alexander V. Chernikov AuthorDate: 2021-02-07 17:21:18 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-08 21:42:20 +0000 SO_RERROR indicates that receive buffer overflows should be handled as errors. Historically receive buffer overflows have been ignored and programs could not tell if they missed messages or messages had been truncated because of overflows. Since programs historically do not expect to get receive overflow errors, this behavior is not the default. This is really really important for programs that use route(4) to keep in sync with the system. If we loose a message then we need to reload the full system state, otherwise the behaviour from that point is undefined and can lead to chasing bogus bug reports. --- lib/libc/sys/getsockopt.2 | 10 +++++++- sbin/route/route.c | 13 +++++++++- sys/kern/uipc_sockbuf.c | 24 +++++++++++++++++ sys/kern/uipc_socket.c | 30 ++++++++++++++++------ sys/kern/uipc_usrreq.c | 2 +- sys/net/raw_usrreq.c | 11 ++++---- .../bluetooth/socket/ng_btsocket_hci_raw.c | 1 + sys/netgraph/ng_socket.c | 2 +- sys/netinet/ip_divert.c | 2 +- sys/netinet/ip_mroute.c | 2 +- sys/netinet/raw_ip.c | 3 +-- sys/netinet/udp_usrreq.c | 2 +- sys/netinet6/icmp6.c | 6 ++--- sys/netinet6/ip6_input.c | 1 + sys/netinet6/ip6_mroute.c | 3 ++- sys/netinet6/raw_ip6.c | 2 ++ sys/netinet6/send.c | 2 +- sys/netinet6/udp6_usrreq.c | 2 +- sys/netipsec/keysock.c | 10 ++++---- sys/sys/socket.h | 1 + sys/sys/socketvar.h | 6 ++++- 21 files changed, 100 insertions(+), 35 deletions(-) diff --git a/lib/libc/sys/getsockopt.2 b/lib/libc/sys/getsockopt.2 index 1e4ed6827170..223eb3e8a28b 100644 --- a/lib/libc/sys/getsockopt.2 +++ b/lib/libc/sys/getsockopt.2 @@ -28,7 +28,7 @@ .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd June 3, 2020 +.Dd Feb 07, 2020 .Dt GETSOCKOPT 2 .Os .Sh NAME @@ -177,6 +177,7 @@ for the socket .It Dv SO_PROTOCOL Ta "get the protocol number for the socket (get only)" .It Dv SO_PROTOTYPE Ta "SunOS alias for the Linux SO_PROTOCOL (get only)" .It Dv SO_ERROR Ta "get and clear error on the socket (get only)" +.It Dv SO_RERROR Ta "enables receive error reporting" .It Dv SO_SETFIB Ta "set the associated FIB (routing table) for the socket (set only)" .El .Pp @@ -514,6 +515,13 @@ returns any pending error on the socket and clears the error status. It may be used to check for asynchronous errors on connected datagram sockets or for other asynchronous errors. +.Dv SO_RERROR +indicates that receive buffer overflows should be handled as errors. +Historically receive buffer overflows have been ignored and programs +could not tell if they missed messages or messages had been truncated +because of overflows. +Since programs historically do not expect to get receive overflow errors, +this behavior is not the default. .Pp .Dv SO_LABEL returns the MAC label of the socket. diff --git a/sbin/route/route.c b/sbin/route/route.c index 51a0c68746a6..b16fb6d17a08 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1444,9 +1444,20 @@ monitor(int argc, char *argv[]) interfaces(); exit(0); } + +#ifdef SO_RERROR + n = 1; + if (setsockopt(s, SOL_SOCKET, SO_RERROR, &n, sizeof(n)) == -1) + warn("SO_RERROR"); +#endif + for (;;) { time_t now; - n = read(s, msg, 2048); + n = read(s, msg, sizeof(msg)); + if (n == -1) { + warn("read"); + continue; + } now = time(NULL); (void)printf("\ngot message of size %d on %s", n, ctime(&now)); print_rtmsg((struct rt_msghdr *)(void *)msg, n); diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index cf53f234d8fc..b5ecdb99b59b 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -436,6 +436,30 @@ socantrcvmore(struct socket *so) mtx_assert(SOCKBUF_MTX(&so->so_rcv), MA_NOTOWNED); } +void +soroverflow_locked(struct socket *so) +{ + + SOCKBUF_LOCK_ASSERT(&so->so_rcv); + + if (so->so_options & SO_RERROR) { + so->so_rerror = ENOBUFS; + sorwakeup_locked(so); + } else + SOCKBUF_UNLOCK(&so->so_rcv); + + mtx_assert(SOCKBUF_MTX(&so->so_rcv), MA_NOTOWNED); +} + +void +soroverflow(struct socket *so) +{ + + SOCKBUF_LOCK(&so->so_rcv); + soroverflow_locked(so); + mtx_assert(SOCKBUF_MTX(&so->so_rcv), MA_NOTOWNED); +} + /* * Wait for data to arrive at/drain from a socket buffer. */ diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 7b16401b7071..8d218cf10a81 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1953,12 +1953,19 @@ restart: KASSERT(m != NULL || !sbavail(&so->so_rcv), ("receive: m == %p sbavail == %u", m, sbavail(&so->so_rcv))); - if (so->so_error) { + if (so->so_error || so->so_rerror) { if (m != NULL) goto dontblock; - error = so->so_error; - if ((flags & MSG_PEEK) == 0) - so->so_error = 0; + if (so->so_error) + error = so->so_error; + else + error = so->so_rerror; + if ((flags & MSG_PEEK) == 0) { + if (so->so_error) + so->so_error = 0; + else + so->so_rerror = 0; + } SOCKBUF_UNLOCK(&so->so_rcv); goto release; } @@ -2302,7 +2309,7 @@ dontblock: while (flags & MSG_WAITALL && m == NULL && uio->uio_resid > 0 && !sosendallatonce(so) && nextrecord == NULL) { SOCKBUF_LOCK_ASSERT(&so->so_rcv); - if (so->so_error || + if (so->so_error || so->so_rerror || so->so_rcv.sb_state & SBS_CANTRCVMORE) break; /* @@ -3043,6 +3050,7 @@ sosetopt(struct socket *so, struct sockopt *sopt) case SO_NOSIGPIPE: case SO_NO_DDP: case SO_NO_OFFLOAD: + case SO_RERROR: error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); if (error) @@ -3264,6 +3272,7 @@ sogetopt(struct socket *so, struct sockopt *sopt) case SO_NOSIGPIPE: case SO_NO_DDP: case SO_NO_OFFLOAD: + case SO_RERROR: optval = so->so_options & sopt->sopt_name; integer: error = sooptcopyout(sopt, &optval, sizeof optval); @@ -3283,8 +3292,13 @@ integer: case SO_ERROR: SOCK_LOCK(so); - optval = so->so_error; - so->so_error = 0; + if (so->so_error) { + optval = so->so_error; + so->so_error = 0; + } else { + optval = so->so_rerror; + so->so_rerror = 0; + } SOCK_UNLOCK(so); goto integer; @@ -3833,7 +3847,7 @@ filt_soread(struct knote *kn, long hint) kn->kn_flags |= EV_EOF; kn->kn_fflags = so->so_error; return (1); - } else if (so->so_error) /* temporary udp error */ + } else if (so->so_error || so->so_rerror) return (1); if (kn->kn_sfflags & NOTE_LOWAT) { diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 0809f5180cc1..10680ad88136 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1058,7 +1058,7 @@ uipc_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, m = NULL; control = NULL; } else { - SOCKBUF_UNLOCK(&so2->so_rcv); + soroverflow_locked(so2); error = ENOBUFS; } if (nam != NULL) diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c index f43de7dae9ca..5d4e223e5a0a 100644 --- a/sys/net/raw_usrreq.c +++ b/sys/net/raw_usrreq.c @@ -100,10 +100,10 @@ raw_input_ext(struct mbuf *m0, struct sockproto *proto, struct sockaddr *src, n = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (n) { if (sbappendaddr(&last->so_rcv, src, - n, (struct mbuf *)0) == 0) - /* should notify about lost packet */ + n, (struct mbuf *)0) == 0) { + soroverflow(last); m_freem(n); - else + } else sorwakeup(last); } } @@ -111,9 +111,10 @@ raw_input_ext(struct mbuf *m0, struct sockproto *proto, struct sockaddr *src, } if (last) { if (sbappendaddr(&last->so_rcv, src, - m, (struct mbuf *)0) == 0) + m, (struct mbuf *)0) == 0) { + soroverflow(last); m_freem(m); - else + } else sorwakeup(last); } else m_freem(m); diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c index 5f6b98d03359..c82515f82631 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c @@ -539,6 +539,7 @@ ng_btsocket_hci_raw_data_input(struct mbuf *nam) NG_FREE_M(m); NG_FREE_M(ctl); + soroverflow(pcb->so); } } next: diff --git a/sys/netgraph/ng_socket.c b/sys/netgraph/ng_socket.c index 865e9dd7948f..905567c86b47 100644 --- a/sys/netgraph/ng_socket.c +++ b/sys/netgraph/ng_socket.c @@ -982,7 +982,7 @@ ngs_rcvmsg(node_p node, item_p item, hook_p lasthook) /* Send it up to the socket. */ if (sbappendaddr_locked(&so->so_rcv, (struct sockaddr *)&addr, m, NULL) == 0) { - SOCKBUF_UNLOCK(&so->so_rcv); + soroverflow_locked(so); TRAP_ERROR; m_freem(m); return (ENOBUFS); diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 65f1d263b5fa..99a8405fe334 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -285,7 +285,7 @@ divert_packet(struct mbuf *m, bool incoming) if (sbappendaddr_locked(&sa->so_rcv, (struct sockaddr *)&divsrc, m, (struct mbuf *)0) == 0) { - SOCKBUF_UNLOCK(&sa->so_rcv); + soroverflow_locked(sa); sa = NULL; /* force mbuf reclaim below */ } else sorwakeup_locked(sa); diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index b66fe8df0793..6aeea44f631c 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1199,7 +1199,7 @@ socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in *src) sorwakeup_locked(s); return 0; } - SOCKBUF_UNLOCK(&s->so_rcv); + soroverflow_locked(s); } m_freem(mm); return -1; diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index c9def015343c..1df54a8cfdba 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -263,11 +263,10 @@ rip_append(struct inpcb *last, struct ip *ip, struct mbuf *n, SOCKBUF_LOCK(&so->so_rcv); if (sbappendaddr_locked(&so->so_rcv, (struct sockaddr *)ripsrc, n, opts) == 0) { - /* should notify about lost packet */ + soroverflow_locked(so); m_freem(n); if (opts) m_freem(opts); - SOCKBUF_UNLOCK(&so->so_rcv); } else sorwakeup_locked(so); } else diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 52304ddd6584..6392c6c441d6 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -379,7 +379,7 @@ udp_append(struct inpcb *inp, struct ip *ip, struct mbuf *n, int off, so = inp->inp_socket; SOCKBUF_LOCK(&so->so_rcv); if (sbappendaddr_locked(&so->so_rcv, append_sa, n, opts) == 0) { - SOCKBUF_UNLOCK(&so->so_rcv); + soroverflow(so); m_freem(n); if (opts) m_freem(opts); diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 1a08dad7de64..71007d5e9d11 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1973,13 +1973,11 @@ icmp6_rip6_input(struct mbuf **mp, int off) &last->inp_socket->so_rcv, (struct sockaddr *)&fromsa, n, opts) == 0) { - /* should notify about lost packet */ + soroverflow_locked(last->inp_socket); m_freem(n); if (opts) { m_freem(opts); } - SOCKBUF_UNLOCK( - &last->inp_socket->so_rcv); } else sorwakeup_locked(last->inp_socket); opts = NULL; @@ -2019,7 +2017,7 @@ icmp6_rip6_input(struct mbuf **mp, int off) m_freem(m); if (opts) m_freem(opts); - SOCKBUF_UNLOCK(&last->inp_socket->so_rcv); + soroverflow_locked(last->inp_socket); } else sorwakeup_locked(last->inp_socket); INP_RUNLOCK(last); diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 8f500cb87bfe..9a4fd20a52b8 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1576,6 +1576,7 @@ ip6_notify_pmtu(struct inpcb *inp, struct sockaddr_in6 *dst, u_int32_t mtu) so = inp->inp_socket; if (sbappendaddr(&so->so_rcv, (struct sockaddr *)dst, NULL, m_mtu) == 0) { + soroverflow(so); m_freem(m_mtu); /* XXX: should count statistics */ } else diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index d2277e41110c..503c83490940 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1038,7 +1038,8 @@ socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in6 *src) mm, (struct mbuf *)0) != 0) { sorwakeup(s); return (0); - } + } else + soroverflow(s); } m_freem(mm); return (-1); diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index aea99add4391..92fe8b7e2253 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -214,6 +214,7 @@ rip6_input(struct mbuf **mp, int *offp, int proto) if (sbappendaddr(&last->inp_socket->so_rcv, (struct sockaddr *)&fromsa, n, opts) == 0) { + soroverflow(last->inp_socket); m_freem(n); if (opts) m_freem(opts); @@ -325,6 +326,7 @@ skip_2: m_adj(m, *offp); if (sbappendaddr(&last->inp_socket->so_rcv, (struct sockaddr *)&fromsa, m, opts) == 0) { + soroverflow(last->inp_socket); m_freem(m); if (opts) m_freem(opts); diff --git a/sys/netinet6/send.c b/sys/netinet6/send.c index bc9880c82267..8458ef367cba 100644 --- a/sys/netinet6/send.c +++ b/sys/netinet6/send.c @@ -291,7 +291,7 @@ send_input(struct mbuf *m, struct ifnet *ifp, int direction, int msglen __unused SOCKBUF_LOCK(&V_send_so->so_rcv); if (sbappendaddr_locked(&V_send_so->so_rcv, (struct sockaddr *)&sendsrc, m, NULL) == 0) { - SOCKBUF_UNLOCK(&V_send_so->so_rcv); + soroverflow_locked(V_send_so); /* XXX stats. */ m_freem(m); } else { diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 1535be90e1b0..bc1d8cc5b2fa 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -197,7 +197,7 @@ udp6_append(struct inpcb *inp, struct mbuf *n, int off, SOCKBUF_LOCK(&so->so_rcv); if (sbappendaddr_locked(&so->so_rcv, (struct sockaddr *)&fromsa[0], n, opts) == 0) { - SOCKBUF_UNLOCK(&so->so_rcv); + soroverflow_locked(so); m_freem(n); if (opts) m_freem(opts); diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c index 49efa0a3c510..7a0b9e757022 100644 --- a/sys/netipsec/keysock.c +++ b/sys/netipsec/keysock.c @@ -141,7 +141,6 @@ end: static int key_sendup0(struct rawcb *rp, struct mbuf *m, int promisc) { - int error; if (promisc) { struct sadb_msg *pmsg; @@ -165,11 +164,12 @@ key_sendup0(struct rawcb *rp, struct mbuf *m, int promisc) m, NULL)) { PFKEYSTAT_INC(in_nomem); m_freem(m); - error = ENOBUFS; - } else - error = 0; + soroverflow(rp->rcb_socket); + return ENOBUFS; + } + sorwakeup(rp->rcb_socket); - return error; + return 0; } /* so can be NULL if target != KEY_SENDUP_ONE */ diff --git a/sys/sys/socket.h b/sys/sys/socket.h index d9256fd7544a..2cb76f9c6d63 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -147,6 +147,7 @@ typedef __uintptr_t uintptr_t; #define SO_NO_OFFLOAD 0x00004000 /* socket cannot be offloaded */ #define SO_NO_DDP 0x00008000 /* disable direct data placement */ #define SO_REUSEPORT_LB 0x00010000 /* reuse with load balancing */ +#define SO_RERROR 0x00020000 /* keep track of receive errors */ /* * Additional options, not kept in so_options. diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 295a1cf3d37f..60a4dde7f0cb 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -100,6 +100,7 @@ struct socket { struct protosw *so_proto; /* (a) protocol handle */ short so_timeo; /* (g) connection timeout */ u_short so_error; /* (f) error affecting connection */ + u_short so_rerror; /* (f) error affecting connection */ struct sigio *so_sigio; /* [sg] information for async I/O or out of band data (SIGURG) */ struct ucred *so_cred; /* (a) user credentials */ @@ -266,7 +267,8 @@ struct socket { /* can we read something from so? */ #define soreadabledata(so) \ - (sbavail(&(so)->so_rcv) >= (so)->so_rcv.sb_lowat || (so)->so_error) + (sbavail(&(so)->so_rcv) >= (so)->so_rcv.sb_lowat || \ + (so)->so_error || (so)->so_rerror) #define soreadable(so) \ (soreadabledata(so) || ((so)->so_rcv.sb_state & SBS_CANTRCVMORE)) @@ -480,6 +482,8 @@ void socantrcvmore(struct socket *so); void socantrcvmore_locked(struct socket *so); void socantsendmore(struct socket *so); void socantsendmore_locked(struct socket *so); +void soroverflow(struct socket *so); +void soroverflow_locked(struct socket *so); /* * Accept filter functions (duh). From owner-dev-commits-src-main@freebsd.org Mon Feb 8 21:42:29 2021 Return-Path: Delivered-To: dev-commits-src-main@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 890D9542C23; Mon, 8 Feb 2021 21:42:29 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZKHn3HxTz4v4f; Mon, 8 Feb 2021 21:42:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6477E1ED3D; Mon, 8 Feb 2021 21:42:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118LgTNj063414; Mon, 8 Feb 2021 21:42:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118LgTcB063413; Mon, 8 Feb 2021 21:42:29 GMT (envelope-from git) Date: Mon, 8 Feb 2021 21:42:29 GMT Message-Id: <202102082142.118LgTcB063413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: adc4ea97bd77 - main - Turn off forgotten multipath debug messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: adc4ea97bd775cb49df5dbfd71dd497c834ae150 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 21:42:29 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=adc4ea97bd775cb49df5dbfd71dd497c834ae150 commit adc4ea97bd775cb49df5dbfd71dd497c834ae150 Author: Alexander V. Chernikov AuthorDate: 2021-02-08 20:11:38 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-08 21:42:20 +0000 Turn off forgotten multipath debug messages Reported by: mike tancsa MFC after: 3 days --- sys/net/route/nhgrp_ctl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/net/route/nhgrp_ctl.c b/sys/net/route/nhgrp_ctl.c index c4f86500ca8d..c2119506370f 100644 --- a/sys/net/route/nhgrp_ctl.c +++ b/sys/net/route/nhgrp_ctl.c @@ -26,7 +26,6 @@ * * $FreeBSD$ */ -#define RTDEBUG #include "opt_inet.h" #include "opt_route.h" From owner-dev-commits-src-main@freebsd.org Mon Feb 8 21:48:53 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2E1C4543076; Mon, 8 Feb 2021 21:48:53 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZKR90pJ1z4vd5; Mon, 8 Feb 2021 21:48:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E77D1F00A; Mon, 8 Feb 2021 21:48:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118LmqsP064587; Mon, 8 Feb 2021 21:48:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118LmqGL064586; Mon, 8 Feb 2021 21:48:52 GMT (envelope-from git) Date: Mon, 8 Feb 2021 21:48:52 GMT Message-Id: <202102082148.118LmqGL064586@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 35af933173d5 - main - acpi: limit the AMDI0020/AMDI0010 workaround to an option MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35af933173d516101f4c44af328fbe2d6e587869 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 21:48:53 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=35af933173d516101f4c44af328fbe2d6e587869 commit 35af933173d516101f4c44af328fbe2d6e587869 Author: Warner Losh AuthorDate: 2021-02-08 21:43:25 +0000 Commit: Warner Losh CommitDate: 2021-02-08 21:47:49 +0000 acpi: limit the AMDI0020/AMDI0010 workaround to an option It appears that production versions of EPYC firmware get the _STA method right for these nodes. In fact, this workaround breaks on production hardware by including too many uart nodes. This work around was for pre-release hardware that wound up not having a large deployment. Move this work around to a kernel option since the machines that needed it have been powered off and are difficult to resurrect. Should there be a more significant deployment than is understood, we can restrict it based on smbios strings. Discussed with: mmacy@, seanc@, jhb@ MFC After: 3 days --- sys/conf/options | 1 + sys/dev/acpica/acpi.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/sys/conf/options b/sys/conf/options index 77979b72fe58..2f324143c574 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -705,6 +705,7 @@ ACPI_DEBUG opt_acpi.h ACPI_MAX_TASKS opt_acpi.h ACPI_MAX_THREADS opt_acpi.h DEV_ACPI opt_acpi.h +ACPI_EARLY_EPYC_WAR opt_acpi.h # options for IOMMU support IOMMU opt_iommu.h diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 04c8c1b27625..18623a6ab240 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -2273,6 +2273,8 @@ acpi_DeviceIsPresent(device_t dev) h = acpi_get_handle(dev); if (h == NULL) return (FALSE); + +#ifdef ACPI_EARLY_EPYC_WAR /* * Certain Treadripper boards always returns 0 for FreeBSD because it * only returns non-zero for the OS string "Windows 2015". Otherwise it @@ -2281,6 +2283,7 @@ acpi_DeviceIsPresent(device_t dev) */ if (acpi_MatchHid(h, "AMDI0020") || acpi_MatchHid(h, "AMDI0010")) return (TRUE); +#endif status = acpi_GetInteger(h, "_STA", &s); From owner-dev-commits-src-main@freebsd.org Mon Feb 8 22:00:34 2021 Return-Path: Delivered-To: dev-commits-src-main@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 382165433C9; Mon, 8 Feb 2021 22:00:34 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZKhf1CGDz3CDL; Mon, 8 Feb 2021 22:00:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C37F1F0AA; Mon, 8 Feb 2021 22:00:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118M0YtJ085090; Mon, 8 Feb 2021 22:00:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118M0Yft085089; Mon, 8 Feb 2021 22:00:34 GMT (envelope-from git) Date: Mon, 8 Feb 2021 22:00:34 GMT Message-Id: <202102082200.118M0Yft085089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 07cac176fba9 - main - Don't check compat.linux.emul_path before loading linux(4) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07cac176fba947381c8111b8e02e8067e7fa542a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 22:00:34 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=07cac176fba947381c8111b8e02e8067e7fa542a commit 07cac176fba947381c8111b8e02e8067e7fa542a Author: Edward Tomasz Napierala AuthorDate: 2021-02-08 21:52:31 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-08 22:00:25 +0000 Don't check compat.linux.emul_path before loading linux(4) Fix e40787f900f to make libexec/rc/rc.d/linux retrieve the sysctl after loading the kernel module which provides it, not before. Reported By: jkim Sponsored By: The FreeBSD Foundation --- libexec/rc/rc.d/linux | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/linux b/libexec/rc/rc.d/linux index 4381b62cc660..f44a9d02fc8d 100755 --- a/libexec/rc/rc.d/linux +++ b/libexec/rc/rc.d/linux @@ -18,7 +18,6 @@ stop_cmd=":" linux_start() { local _emul_path _tmpdir - _emul_path="$(sysctl -n compat.linux.emul_path)" load_kld -e 'linux(aout|elf)' linux case `sysctl -n hw.machine_arch` in @@ -26,6 +25,9 @@ linux_start() load_kld -e 'linux64elf' linux64 ;; esac + + _emul_path="$(sysctl -n compat.linux.emul_path)" + if [ -x ${_emul_path}/sbin/ldconfigDisabled ]; then _tmpdir=`mktemp -d -t linux-ldconfig` ${_emul_path}/sbin/ldconfig -C ${_tmpdir}/ld.so.cache From owner-dev-commits-src-main@freebsd.org Mon Feb 8 22:08:19 2021 Return-Path: Delivered-To: dev-commits-src-main@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 951CC5437E8; Mon, 8 Feb 2021 22:08:19 +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 4DZKsb3dVJz3D3n; Mon, 8 Feb 2021 22:08:19 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f41.google.com with SMTP id sa23so28084008ejb.0; Mon, 08 Feb 2021 14:08:19 -0800 (PST) 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=lbCrQTQyGdRrPWWXHKAMjCql2jztOHX3p1Wn+sfi4ng=; b=ETcgNvk//fJS/VOoK2ed8qWaWWq3Ij8U6C+/O5aUWG4HVC0rrluWAxoPh7rfdY4DV8 O+SzoSFNq7sY19Ci/e5ZgLGuYaRadh7EswvWdImPJCV8iFOMdw/JyPToZtyZnSKw5L9H EeuCkGa3cuCB2mN9LEWb7GZ3lMTQatNIExVwDe/J267DxxqP2PCH7QNfGPlG6guKHjnt 2dMO+l4KbV0Qlf4KQy/lbdvnmfjkBW+ljXFFtC8J7gvEEY365Dq0B8XPhOO+EPvRU871 QQxYRGhKganud2C3aPAr2/jctfKBLH6VBbiF1R/8VTbpj/fOP/xXZvKwYscpr+5BI5GW 02BA== X-Gm-Message-State: AOAM533RgMOmVQbOiZZamNNwXIaAZ9inYI3AAaE0STjWP5QCX6yiLsxm hK+EtcrGzlz22/+klfOkARUUoQvrMa/fKg== X-Google-Smtp-Source: ABdhPJwmEgCq6gmj0nl2fJQjFyrDz+VXTewJ5zJ/ugl0hKmuQTrdtm0bB79wDnzqM3m/fx+6W4zPqw== X-Received: by 2002:a17:906:30cd:: with SMTP id b13mr19092533ejb.336.1612822098158; Mon, 08 Feb 2021 14:08:18 -0800 (PST) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com. [209.85.128.45]) by smtp.gmail.com with ESMTPSA id y1sm10261877edq.26.2021.02.08.14.08.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Feb 2021 14:08:17 -0800 (PST) Received: by mail-wm1-f45.google.com with SMTP id w4so444985wmi.4; Mon, 08 Feb 2021 14:08:17 -0800 (PST) X-Received: by 2002:a1c:b782:: with SMTP id h124mr706770wmf.67.1612822097581; Mon, 08 Feb 2021 14:08:17 -0800 (PST) MIME-Version: 1.0 References: <202102081915.118JFVS0067851@gitrepo.freebsd.org> <8F5A406F-FB06-4D52-8CD7-1DCE01B6C126@freebsd.org> In-Reply-To: <8F5A406F-FB06-4D52-8CD7-1DCE01B6C126@freebsd.org> From: Alexander Richardson Date: Mon, 8 Feb 2021 22:08:07 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 81e074d57dfc - main - libkern: use compiler builtins for strcpy, strcmp and strlen To: Jessica Clarke Cc: Mateusz Guzik , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DZKsb3dVJz3D3n X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 22:08:19 -0000 On Mon, 8 Feb 2021, 19:37 Jessica Clarke, wrote: > On 8 Feb 2021, at 19:15, Mateusz Guzik wrote: > > > > The branch main has been updated by mjg: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=81e074d57dfcd86f152e2848dc44b77087ee7a2d > > > > commit 81e074d57dfcd86f152e2848dc44b77087ee7a2d > > Author: Mateusz Guzik > > AuthorDate: 2021-02-07 19:50:25 +0000 > > Commit: Mateusz Guzik > > CommitDate: 2021-02-08 19:15:21 +0000 > > > > libkern: use compiler builtins for strcpy, strcmp and strlen > > Why? > I guess because the kernel uses -ffreestanding, so the libcall inlining optimization requires explicit uses of __builtin_foo Alex > From owner-dev-commits-src-main@freebsd.org Mon Feb 8 22:09:42 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E48F1543C08; Mon, 8 Feb 2021 22:09:42 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (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 4DZKvB5mRrz3DF8; Mon, 8 Feb 2021 22:09:42 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f52.google.com with SMTP id i8so27971259ejc.7; Mon, 08 Feb 2021 14:09:42 -0800 (PST) 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=zwH2QtajO0M2cFe5AJJeiki/37ehDIALF2/C9XcHNdI=; b=mrFk66U9icIYdj45gD4t5jUCO8J7MSUfw6luSLCtVn1GGMrijJGpdlA/A9H0vi56iC NCEVtk6srY4QXLJLm612AnjQRYuQxGPNyQMWpPG5r73whda3JepEE23b0s1RqA4Aygfs jccBh5XvGZM3tzuxR8chi39YWRTWLWQsgV/YhExt+B+o3hSL+sOI1i2RvE1cKYA34gpH lhgpiAM/Vlh40AyceCJeaus3YQTXYITv+EfPaFrFyu9XIO0UuARCG7FtkaTZ7gBoC03+ c0BwhqWvmDdk0Kwg6uncJ5mnQsQWsws3RVIUU9LA0Zpp/PiOl+T9CmNZMwfv7DlZYL0u GgvA== X-Gm-Message-State: AOAM531CXV50Cand9HUFJ1cGFTMmRJ3KTzHiu4uCFZ6rK6ebuTAp4JG9 /30CmVwqxKeu9MfAiGCFo3kE7ctpokKx5w== X-Google-Smtp-Source: ABdhPJwS26NYmwt8mFSULiCUV1VX60WPJz8hmEKtWLe+oGmiW2aJakOqKkakFBwgAF6nIGnS0UTAVA== X-Received: by 2002:a17:906:2993:: with SMTP id x19mr18232996eje.409.1612822181133; Mon, 08 Feb 2021 14:09:41 -0800 (PST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com. [209.85.128.42]) by smtp.gmail.com with ESMTPSA id w3sm9525382eja.52.2021.02.08.14.09.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Feb 2021 14:09:41 -0800 (PST) Received: by mail-wm1-f42.google.com with SMTP id t142so461165wmt.1; Mon, 08 Feb 2021 14:09:40 -0800 (PST) X-Received: by 2002:a1c:2e83:: with SMTP id u125mr673458wmu.13.1612822174874; Mon, 08 Feb 2021 14:09:34 -0800 (PST) MIME-Version: 1.0 References: <202102081949.118Jn10U008133@gitrepo.freebsd.org> In-Reply-To: <202102081949.118Jn10U008133@gitrepo.freebsd.org> From: Alexander Richardson Date: Mon, 8 Feb 2021 22:09:24 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 93fc67896550 - main - Fix incorrect powf(3) result with x near 1 and |y| much larger than 1 To: Dimitry Andric Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DZKvB5mRrz3DF8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 22:09:43 -0000 On Mon, 8 Feb 2021, 19:49 Dimitry Andric, wrote: > The branch main has been updated by dim: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=93fc67896550548f91b307dbe3053f11db5d4a8a > > commit 93fc67896550548f91b307dbe3053f11db5d4a8a > Author: Steve Kargl > AuthorDate: 2021-02-08 19:45:30 +0000 > Commit: Dimitry Andric > CommitDate: 2021-02-08 19:48:43 +0000 > > Fix incorrect powf(3) result with x near 1 and |y| much larger than 1 > > This adjusts the check to trigger overflow/underflow to a slightly > lower > value. > > Before: powf(9.999995e-01, -1.342177e+08) -> inf > After: powf(9.999995e-01, -1.342177e+08) -> 1.858724e+31 > > MFC after: 1 week > --- > lib/msun/src/e_powf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/msun/src/e_powf.c b/lib/msun/src/e_powf.c > index 53f1d37d6bec..33eedad50b16 100644 > --- a/lib/msun/src/e_powf.c > +++ b/lib/msun/src/e_powf.c > @@ -136,7 +136,7 @@ __ieee754_powf(float x, float y) > /* |y| is huge */ > if(iy>0x4d000000) { /* if |y| > 2**27 */ > /* over/underflow if x is not close to one */ > - if(ix<0x3f7ffff8) return (hy<0)? sn*huge*huge:sn*tiny*tiny; > + if(ix<0x3f7ffff7) return (hy<0)? sn*huge*huge:sn*tiny*tiny; > if(ix>0x3f800007) return (hy>0)? sn*huge*huge:sn*tiny*tiny; > /* now |1-x| is tiny <= 2**-20, suffice to compute > log(x) by x-x^2/2+x^3/3-x^4/4 */ > Do we have a test with previously buggy values? If not it would be good to add one. Alex > From owner-dev-commits-src-main@freebsd.org Mon Feb 8 22:32:02 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D14F45441B9; Mon, 8 Feb 2021 22:32:02 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZLNy5dH9z3FJR; Mon, 8 Feb 2021 22:32:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B41081F658; Mon, 8 Feb 2021 22:32:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118MW2LU029311; Mon, 8 Feb 2021 22:32:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118MW2OF029310; Mon, 8 Feb 2021 22:32:02 GMT (envelope-from git) Date: Mon, 8 Feb 2021 22:32:02 GMT Message-Id: <202102082232.118MW2OF029310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: db2f512381ac - main - hid: bump HID_ITEM_MAXUSAGES to 8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db2f512381ac3c0c227f5c0354690bb929dcac17 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 22:32:02 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=db2f512381ac3c0c227f5c0354690bb929dcac17 commit db2f512381ac3c0c227f5c0354690bb929dcac17 Author: Warner Losh AuthorDate: 2021-02-08 19:29:20 +0000 Commit: Warner Losh CommitDate: 2021-02-08 22:31:39 +0000 hid: bump HID_ITEM_MAXUSAGES to 8 My YOGA requires a minimum of 7 to parse w/o an error. Since the memory savings are trivial and the yoga a popular system, bump the default up to 8. There's no API/ABI issues in doing this. This hid_item struct isn't exported to userland and the one libusbhid has is different and only shares a name... MFC After: 3 days Reviewed by: wulf@ Differential Revision: https://reviews.freebsd.org/D28543 --- sys/dev/hid/hid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/hid/hid.h b/sys/dev/hid/hid.h index e88cbba04d9a..37ab8c9cdf7e 100644 --- a/sys/dev/hid/hid.h +++ b/sys/dev/hid/hid.h @@ -189,7 +189,7 @@ #if defined(_KERNEL) || defined(_STANDALONE) -#define HID_ITEM_MAXUSAGE 4 +#define HID_ITEM_MAXUSAGE 8 #define HID_MAX_AUTO_QUIRK 8 /* maximum number of dynamic quirks */ #define HID_PNP_ID_SIZE 20 /* includes null terminator */ From owner-dev-commits-src-main@freebsd.org Mon Feb 8 22:32:44 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6A4FE544520; Mon, 8 Feb 2021 22:32:44 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZLPm2WfDz3FVF; Mon, 8 Feb 2021 22:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 495111F75F; Mon, 8 Feb 2021 22:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118MWiaJ029529; Mon, 8 Feb 2021 22:32:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118MWieO029527; Mon, 8 Feb 2021 22:32:44 GMT (envelope-from git) Date: Mon, 8 Feb 2021 22:32:44 GMT Message-Id: <202102082232.118MWieO029527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 924d1c9a050d - main - Revert "SO_RERROR indicates that receive buffer overflows should be handled as errors." Wrong version of the change was pushed inadvertenly. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 924d1c9a050d7e355d0562fca62bd2bb9b5f53d7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 22:32:44 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=924d1c9a050d7e355d0562fca62bd2bb9b5f53d7 commit 924d1c9a050d7e355d0562fca62bd2bb9b5f53d7 Author: Alexander V. Chernikov AuthorDate: 2021-02-08 22:30:39 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-08 22:32:32 +0000 Revert "SO_RERROR indicates that receive buffer overflows should be handled as errors." Wrong version of the change was pushed inadvertenly. This reverts commit 4a01b854ca5c2e5124958363b3326708b913af71. --- lib/libc/sys/getsockopt.2 | 10 +------- sbin/route/route.c | 13 +--------- sys/kern/uipc_sockbuf.c | 24 ----------------- sys/kern/uipc_socket.c | 30 ++++++---------------- sys/kern/uipc_usrreq.c | 2 +- sys/net/raw_usrreq.c | 11 ++++---- .../bluetooth/socket/ng_btsocket_hci_raw.c | 1 - sys/netgraph/ng_socket.c | 2 +- sys/netinet/ip_divert.c | 2 +- sys/netinet/ip_mroute.c | 2 +- sys/netinet/raw_ip.c | 3 ++- sys/netinet/udp_usrreq.c | 2 +- sys/netinet6/icmp6.c | 6 +++-- sys/netinet6/ip6_input.c | 1 - sys/netinet6/ip6_mroute.c | 3 +-- sys/netinet6/raw_ip6.c | 2 -- sys/netinet6/send.c | 2 +- sys/netinet6/udp6_usrreq.c | 2 +- sys/netipsec/keysock.c | 10 ++++---- sys/sys/socket.h | 1 - sys/sys/socketvar.h | 6 +---- 21 files changed, 35 insertions(+), 100 deletions(-) diff --git a/lib/libc/sys/getsockopt.2 b/lib/libc/sys/getsockopt.2 index 223eb3e8a28b..1e4ed6827170 100644 --- a/lib/libc/sys/getsockopt.2 +++ b/lib/libc/sys/getsockopt.2 @@ -28,7 +28,7 @@ .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd Feb 07, 2020 +.Dd June 3, 2020 .Dt GETSOCKOPT 2 .Os .Sh NAME @@ -177,7 +177,6 @@ for the socket .It Dv SO_PROTOCOL Ta "get the protocol number for the socket (get only)" .It Dv SO_PROTOTYPE Ta "SunOS alias for the Linux SO_PROTOCOL (get only)" .It Dv SO_ERROR Ta "get and clear error on the socket (get only)" -.It Dv SO_RERROR Ta "enables receive error reporting" .It Dv SO_SETFIB Ta "set the associated FIB (routing table) for the socket (set only)" .El .Pp @@ -515,13 +514,6 @@ returns any pending error on the socket and clears the error status. It may be used to check for asynchronous errors on connected datagram sockets or for other asynchronous errors. -.Dv SO_RERROR -indicates that receive buffer overflows should be handled as errors. -Historically receive buffer overflows have been ignored and programs -could not tell if they missed messages or messages had been truncated -because of overflows. -Since programs historically do not expect to get receive overflow errors, -this behavior is not the default. .Pp .Dv SO_LABEL returns the MAC label of the socket. diff --git a/sbin/route/route.c b/sbin/route/route.c index b16fb6d17a08..51a0c68746a6 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1444,20 +1444,9 @@ monitor(int argc, char *argv[]) interfaces(); exit(0); } - -#ifdef SO_RERROR - n = 1; - if (setsockopt(s, SOL_SOCKET, SO_RERROR, &n, sizeof(n)) == -1) - warn("SO_RERROR"); -#endif - for (;;) { time_t now; - n = read(s, msg, sizeof(msg)); - if (n == -1) { - warn("read"); - continue; - } + n = read(s, msg, 2048); now = time(NULL); (void)printf("\ngot message of size %d on %s", n, ctime(&now)); print_rtmsg((struct rt_msghdr *)(void *)msg, n); diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index b5ecdb99b59b..cf53f234d8fc 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -436,30 +436,6 @@ socantrcvmore(struct socket *so) mtx_assert(SOCKBUF_MTX(&so->so_rcv), MA_NOTOWNED); } -void -soroverflow_locked(struct socket *so) -{ - - SOCKBUF_LOCK_ASSERT(&so->so_rcv); - - if (so->so_options & SO_RERROR) { - so->so_rerror = ENOBUFS; - sorwakeup_locked(so); - } else - SOCKBUF_UNLOCK(&so->so_rcv); - - mtx_assert(SOCKBUF_MTX(&so->so_rcv), MA_NOTOWNED); -} - -void -soroverflow(struct socket *so) -{ - - SOCKBUF_LOCK(&so->so_rcv); - soroverflow_locked(so); - mtx_assert(SOCKBUF_MTX(&so->so_rcv), MA_NOTOWNED); -} - /* * Wait for data to arrive at/drain from a socket buffer. */ diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 8d218cf10a81..7b16401b7071 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1953,19 +1953,12 @@ restart: KASSERT(m != NULL || !sbavail(&so->so_rcv), ("receive: m == %p sbavail == %u", m, sbavail(&so->so_rcv))); - if (so->so_error || so->so_rerror) { + if (so->so_error) { if (m != NULL) goto dontblock; - if (so->so_error) - error = so->so_error; - else - error = so->so_rerror; - if ((flags & MSG_PEEK) == 0) { - if (so->so_error) - so->so_error = 0; - else - so->so_rerror = 0; - } + error = so->so_error; + if ((flags & MSG_PEEK) == 0) + so->so_error = 0; SOCKBUF_UNLOCK(&so->so_rcv); goto release; } @@ -2309,7 +2302,7 @@ dontblock: while (flags & MSG_WAITALL && m == NULL && uio->uio_resid > 0 && !sosendallatonce(so) && nextrecord == NULL) { SOCKBUF_LOCK_ASSERT(&so->so_rcv); - if (so->so_error || so->so_rerror || + if (so->so_error || so->so_rcv.sb_state & SBS_CANTRCVMORE) break; /* @@ -3050,7 +3043,6 @@ sosetopt(struct socket *so, struct sockopt *sopt) case SO_NOSIGPIPE: case SO_NO_DDP: case SO_NO_OFFLOAD: - case SO_RERROR: error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); if (error) @@ -3272,7 +3264,6 @@ sogetopt(struct socket *so, struct sockopt *sopt) case SO_NOSIGPIPE: case SO_NO_DDP: case SO_NO_OFFLOAD: - case SO_RERROR: optval = so->so_options & sopt->sopt_name; integer: error = sooptcopyout(sopt, &optval, sizeof optval); @@ -3292,13 +3283,8 @@ integer: case SO_ERROR: SOCK_LOCK(so); - if (so->so_error) { - optval = so->so_error; - so->so_error = 0; - } else { - optval = so->so_rerror; - so->so_rerror = 0; - } + optval = so->so_error; + so->so_error = 0; SOCK_UNLOCK(so); goto integer; @@ -3847,7 +3833,7 @@ filt_soread(struct knote *kn, long hint) kn->kn_flags |= EV_EOF; kn->kn_fflags = so->so_error; return (1); - } else if (so->so_error || so->so_rerror) + } else if (so->so_error) /* temporary udp error */ return (1); if (kn->kn_sfflags & NOTE_LOWAT) { diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 10680ad88136..0809f5180cc1 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1058,7 +1058,7 @@ uipc_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, m = NULL; control = NULL; } else { - soroverflow_locked(so2); + SOCKBUF_UNLOCK(&so2->so_rcv); error = ENOBUFS; } if (nam != NULL) diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c index 5d4e223e5a0a..f43de7dae9ca 100644 --- a/sys/net/raw_usrreq.c +++ b/sys/net/raw_usrreq.c @@ -100,10 +100,10 @@ raw_input_ext(struct mbuf *m0, struct sockproto *proto, struct sockaddr *src, n = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (n) { if (sbappendaddr(&last->so_rcv, src, - n, (struct mbuf *)0) == 0) { - soroverflow(last); + n, (struct mbuf *)0) == 0) + /* should notify about lost packet */ m_freem(n); - } else + else sorwakeup(last); } } @@ -111,10 +111,9 @@ raw_input_ext(struct mbuf *m0, struct sockproto *proto, struct sockaddr *src, } if (last) { if (sbappendaddr(&last->so_rcv, src, - m, (struct mbuf *)0) == 0) { - soroverflow(last); + m, (struct mbuf *)0) == 0) m_freem(m); - } else + else sorwakeup(last); } else m_freem(m); diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c index c82515f82631..5f6b98d03359 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c @@ -539,7 +539,6 @@ ng_btsocket_hci_raw_data_input(struct mbuf *nam) NG_FREE_M(m); NG_FREE_M(ctl); - soroverflow(pcb->so); } } next: diff --git a/sys/netgraph/ng_socket.c b/sys/netgraph/ng_socket.c index 905567c86b47..865e9dd7948f 100644 --- a/sys/netgraph/ng_socket.c +++ b/sys/netgraph/ng_socket.c @@ -982,7 +982,7 @@ ngs_rcvmsg(node_p node, item_p item, hook_p lasthook) /* Send it up to the socket. */ if (sbappendaddr_locked(&so->so_rcv, (struct sockaddr *)&addr, m, NULL) == 0) { - soroverflow_locked(so); + SOCKBUF_UNLOCK(&so->so_rcv); TRAP_ERROR; m_freem(m); return (ENOBUFS); diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 99a8405fe334..65f1d263b5fa 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -285,7 +285,7 @@ divert_packet(struct mbuf *m, bool incoming) if (sbappendaddr_locked(&sa->so_rcv, (struct sockaddr *)&divsrc, m, (struct mbuf *)0) == 0) { - soroverflow_locked(sa); + SOCKBUF_UNLOCK(&sa->so_rcv); sa = NULL; /* force mbuf reclaim below */ } else sorwakeup_locked(sa); diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 6aeea44f631c..b66fe8df0793 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1199,7 +1199,7 @@ socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in *src) sorwakeup_locked(s); return 0; } - soroverflow_locked(s); + SOCKBUF_UNLOCK(&s->so_rcv); } m_freem(mm); return -1; diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 1df54a8cfdba..c9def015343c 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -263,10 +263,11 @@ rip_append(struct inpcb *last, struct ip *ip, struct mbuf *n, SOCKBUF_LOCK(&so->so_rcv); if (sbappendaddr_locked(&so->so_rcv, (struct sockaddr *)ripsrc, n, opts) == 0) { - soroverflow_locked(so); + /* should notify about lost packet */ m_freem(n); if (opts) m_freem(opts); + SOCKBUF_UNLOCK(&so->so_rcv); } else sorwakeup_locked(so); } else diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 6392c6c441d6..52304ddd6584 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -379,7 +379,7 @@ udp_append(struct inpcb *inp, struct ip *ip, struct mbuf *n, int off, so = inp->inp_socket; SOCKBUF_LOCK(&so->so_rcv); if (sbappendaddr_locked(&so->so_rcv, append_sa, n, opts) == 0) { - soroverflow(so); + SOCKBUF_UNLOCK(&so->so_rcv); m_freem(n); if (opts) m_freem(opts); diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 71007d5e9d11..1a08dad7de64 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1973,11 +1973,13 @@ icmp6_rip6_input(struct mbuf **mp, int off) &last->inp_socket->so_rcv, (struct sockaddr *)&fromsa, n, opts) == 0) { - soroverflow_locked(last->inp_socket); + /* should notify about lost packet */ m_freem(n); if (opts) { m_freem(opts); } + SOCKBUF_UNLOCK( + &last->inp_socket->so_rcv); } else sorwakeup_locked(last->inp_socket); opts = NULL; @@ -2017,7 +2019,7 @@ icmp6_rip6_input(struct mbuf **mp, int off) m_freem(m); if (opts) m_freem(opts); - soroverflow_locked(last->inp_socket); + SOCKBUF_UNLOCK(&last->inp_socket->so_rcv); } else sorwakeup_locked(last->inp_socket); INP_RUNLOCK(last); diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 9a4fd20a52b8..8f500cb87bfe 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1576,7 +1576,6 @@ ip6_notify_pmtu(struct inpcb *inp, struct sockaddr_in6 *dst, u_int32_t mtu) so = inp->inp_socket; if (sbappendaddr(&so->so_rcv, (struct sockaddr *)dst, NULL, m_mtu) == 0) { - soroverflow(so); m_freem(m_mtu); /* XXX: should count statistics */ } else diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 503c83490940..d2277e41110c 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1038,8 +1038,7 @@ socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in6 *src) mm, (struct mbuf *)0) != 0) { sorwakeup(s); return (0); - } else - soroverflow(s); + } } m_freem(mm); return (-1); diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 92fe8b7e2253..aea99add4391 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -214,7 +214,6 @@ rip6_input(struct mbuf **mp, int *offp, int proto) if (sbappendaddr(&last->inp_socket->so_rcv, (struct sockaddr *)&fromsa, n, opts) == 0) { - soroverflow(last->inp_socket); m_freem(n); if (opts) m_freem(opts); @@ -326,7 +325,6 @@ skip_2: m_adj(m, *offp); if (sbappendaddr(&last->inp_socket->so_rcv, (struct sockaddr *)&fromsa, m, opts) == 0) { - soroverflow(last->inp_socket); m_freem(m); if (opts) m_freem(opts); diff --git a/sys/netinet6/send.c b/sys/netinet6/send.c index 8458ef367cba..bc9880c82267 100644 --- a/sys/netinet6/send.c +++ b/sys/netinet6/send.c @@ -291,7 +291,7 @@ send_input(struct mbuf *m, struct ifnet *ifp, int direction, int msglen __unused SOCKBUF_LOCK(&V_send_so->so_rcv); if (sbappendaddr_locked(&V_send_so->so_rcv, (struct sockaddr *)&sendsrc, m, NULL) == 0) { - soroverflow_locked(V_send_so); + SOCKBUF_UNLOCK(&V_send_so->so_rcv); /* XXX stats. */ m_freem(m); } else { diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index bc1d8cc5b2fa..1535be90e1b0 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -197,7 +197,7 @@ udp6_append(struct inpcb *inp, struct mbuf *n, int off, SOCKBUF_LOCK(&so->so_rcv); if (sbappendaddr_locked(&so->so_rcv, (struct sockaddr *)&fromsa[0], n, opts) == 0) { - soroverflow_locked(so); + SOCKBUF_UNLOCK(&so->so_rcv); m_freem(n); if (opts) m_freem(opts); diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c index 7a0b9e757022..49efa0a3c510 100644 --- a/sys/netipsec/keysock.c +++ b/sys/netipsec/keysock.c @@ -141,6 +141,7 @@ end: static int key_sendup0(struct rawcb *rp, struct mbuf *m, int promisc) { + int error; if (promisc) { struct sadb_msg *pmsg; @@ -164,12 +165,11 @@ key_sendup0(struct rawcb *rp, struct mbuf *m, int promisc) m, NULL)) { PFKEYSTAT_INC(in_nomem); m_freem(m); - soroverflow(rp->rcb_socket); - return ENOBUFS; - } - + error = ENOBUFS; + } else + error = 0; sorwakeup(rp->rcb_socket); - return 0; + return error; } /* so can be NULL if target != KEY_SENDUP_ONE */ diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 2cb76f9c6d63..d9256fd7544a 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -147,7 +147,6 @@ typedef __uintptr_t uintptr_t; #define SO_NO_OFFLOAD 0x00004000 /* socket cannot be offloaded */ #define SO_NO_DDP 0x00008000 /* disable direct data placement */ #define SO_REUSEPORT_LB 0x00010000 /* reuse with load balancing */ -#define SO_RERROR 0x00020000 /* keep track of receive errors */ /* * Additional options, not kept in so_options. diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 60a4dde7f0cb..295a1cf3d37f 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -100,7 +100,6 @@ struct socket { struct protosw *so_proto; /* (a) protocol handle */ short so_timeo; /* (g) connection timeout */ u_short so_error; /* (f) error affecting connection */ - u_short so_rerror; /* (f) error affecting connection */ struct sigio *so_sigio; /* [sg] information for async I/O or out of band data (SIGURG) */ struct ucred *so_cred; /* (a) user credentials */ @@ -267,8 +266,7 @@ struct socket { /* can we read something from so? */ #define soreadabledata(so) \ - (sbavail(&(so)->so_rcv) >= (so)->so_rcv.sb_lowat || \ - (so)->so_error || (so)->so_rerror) + (sbavail(&(so)->so_rcv) >= (so)->so_rcv.sb_lowat || (so)->so_error) #define soreadable(so) \ (soreadabledata(so) || ((so)->so_rcv.sb_state & SBS_CANTRCVMORE)) @@ -482,8 +480,6 @@ void socantrcvmore(struct socket *so); void socantrcvmore_locked(struct socket *so); void socantsendmore(struct socket *so); void socantsendmore_locked(struct socket *so); -void soroverflow(struct socket *so); -void soroverflow_locked(struct socket *so); /* * Accept filter functions (duh). From owner-dev-commits-src-main@freebsd.org Mon Feb 8 22:34:22 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0E81A5441F5; Mon, 8 Feb 2021 22:34:22 +0000 (UTC) (envelope-from dim@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZLRd5KVvz3FrJ; Mon, 8 Feb 2021 22:34:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 965C429798; Mon, 8 Feb 2021 22:34:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::8504:b25a:10b3:a2de] (unknown [IPv6:2001:470:7a58:0:8504:b25a:10b3:a2de]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id C3B305AB1F; Mon, 8 Feb 2021 23:34:18 +0100 (CET) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_4719ED40-36DF-4E36-B5AE-29B40C4F8DE8"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: git: 93fc67896550 - main - Fix incorrect powf(3) result with x near 1 and |y| much larger than 1 Date: Mon, 8 Feb 2021 23:34:12 +0100 In-Reply-To: Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org To: Alexander Richardson References: <202102081949.118Jn10U008133@gitrepo.freebsd.org> X-Mailer: Apple Mail (2.3445.104.17) X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 22:34:22 -0000 --Apple-Mail=_4719ED40-36DF-4E36-B5AE-29B40C4F8DE8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 8 Feb 2021, at 23:09, Alexander Richardson = wrote: >=20 > On Mon, 8 Feb 2021, 19:49 Dimitry Andric, wrote: > The branch main has been updated by dim: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D93fc67896550548f91b307dbe3053f11= db5d4a8a >=20 > commit 93fc67896550548f91b307dbe3053f11db5d4a8a > Author: Steve Kargl > AuthorDate: 2021-02-08 19:45:30 +0000 > Commit: Dimitry Andric > CommitDate: 2021-02-08 19:48:43 +0000 >=20 > Fix incorrect powf(3) result with x near 1 and |y| much larger = than 1 >=20 > This adjusts the check to trigger overflow/underflow to a slightly = lower > value. >=20 > Before: powf(9.999995e-01, -1.342177e+08) -> inf > After: powf(9.999995e-01, -1.342177e+08) -> 1.858724e+31 >=20 > MFC after: 1 week > --- > lib/msun/src/e_powf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/msun/src/e_powf.c b/lib/msun/src/e_powf.c > index 53f1d37d6bec..33eedad50b16 100644 > --- a/lib/msun/src/e_powf.c > +++ b/lib/msun/src/e_powf.c > @@ -136,7 +136,7 @@ __ieee754_powf(float x, float y) > /* |y| is huge */ > if(iy>0x4d000000) { /* if |y| > 2**27 */ > /* over/underflow if x is not close to one */ > - if(ix<0x3f7ffff8) return (hy<0)? = sn*huge*huge:sn*tiny*tiny; > + if(ix<0x3f7ffff7) return (hy<0)? = sn*huge*huge:sn*tiny*tiny; > if(ix>0x3f800007) return (hy>0)? = sn*huge*huge:sn*tiny*tiny; > /* now |1-x| is tiny <=3D 2**-20, suffice to compute > log(x) by x-x^2/2+x^3/3-x^4/4 */ >=20 >=20 > Do we have a test with previously buggy values? If not it would be = good to add one. Nope, I'll see if I can grok the awful kyua stuff enough to add it. -Dimitry --Apple-Mail=_4719ED40-36DF-4E36-B5AE-29B40C4F8DE8 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 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCYCG8ZAAKCRCwXqMKLiCW ox1xAKDif7gyRNSkSUrzQJUdg9YNE/j9bACguwOPczcPPbWMZeHpF8OsuobRZys= =wh56 -----END PGP SIGNATURE----- --Apple-Mail=_4719ED40-36DF-4E36-B5AE-29B40C4F8DE8-- From owner-dev-commits-src-main@freebsd.org Mon Feb 8 23:13:19 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C2582545626 for ; Mon, 8 Feb 2021 23:13:19 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) (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 4DZMJb52C1z3JcH for ; Mon, 8 Feb 2021 23:13:19 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb2d.google.com with SMTP id l8so3948332ybe.12 for ; Mon, 08 Feb 2021 15:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dtqMVTHuWRHAqa5igx+7KUMxAugygD6giRPjnLurKrs=; b=YpunP0Z5P6KGYIJeY/udor51yvgbGS8x5WQa4TzOPY/zeAwtBGta6p7i2LpIts5REj RQkRiyRYipywbufv+Gxuvb5xVMG11UkY44fORPJIbCsjCrcWEioFuhdBnKCz8oTG3hsb Dl195sEBK16rILJRJCg+mllSCUpdyKTNuAri0= 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=dtqMVTHuWRHAqa5igx+7KUMxAugygD6giRPjnLurKrs=; b=e6zUzOkOQOgqXuFvp/Z33JX7HCsjsf7cevSKawy7RHZQwbvd1CfO11T8d7i2MlDFBX Wt8M7K840z/u60RGY3PTIK3Jxr99OMd44sn6MPySo7I62zsQ0iysaXqtmIScbG3O55Ft W0eG40lUYGpJnXvuId3Y1DaPrcn+asQANp1fznW/rGmyzT02J1lxmfvWiCohRAe5Yvya aoLuCtMOgpped/M7Za7IBWQpyeLC8LpR7ItxzWMs2zWVv8njmz/hueIiSW9VvkIzN4j+ oA4ywjCX4kkxQByJJ96OwUfCwavRWcN9TxT4RUxQa/PryK8v3mPM5SA1y1Ihlhy0iEmU I8cg== X-Gm-Message-State: AOAM531huW5N1OLh4hW7v69MXWylRtzwcVrSy8TNbT0jm6wbR72WIid8 ahfcpkVtNEfE6HmpzSLkNFzaMoST2k7jG/UEcPkCKWZZ3+eq0w== X-Google-Smtp-Source: ABdhPJztm59NWBttU3jOstBzSK0WaOi5dttUFKysUZW0IEUBGlrdkHwE6SuTNrcJSuEGAjkYE9gR42oLD7OVmnuoX9c= X-Received: by 2002:a25:7453:: with SMTP id p80mr28199124ybc.297.1612825998183; Mon, 08 Feb 2021 15:13:18 -0800 (PST) MIME-Version: 1.0 References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> In-Reply-To: <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> From: Kevin Bowling Date: Mon, 8 Feb 2021 16:13:05 -0700 Message-ID: Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly To: Jessica Clarke Cc: Mateusz Guzik , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DZMJb52C1z3JcH X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 23:13:19 -0000 FreeBSD does not require pre-commit approval unless called out specifically. Are you volunteering to review the changes, and if so where is your guidance? These messages are otherwise unhelpful. On Mon, Feb 8, 2021 at 12:37 PM Jessica Clarke wrote: > > On 8 Feb 2021, at 19:15, Mateusz Guzik wrote: > > > > The branch main has been updated by mjg: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=af366d353b84bdc4e730f0fc563853abc338271c > > > > commit af366d353b84bdc4e730f0fc563853abc338271c > > Author: Mateusz Guzik > > AuthorDate: 2021-02-08 17:01:48 +0000 > > Commit: Mateusz Guzik > > CommitDate: 2021-02-08 19:15:21 +0000 > > > > amd64: implement strlen in assembly > > > > The C variant in libkern performs excessive branching to find the > > non-zero byte instead of using the bsfq instruction. The same code > > patched to use it is still slower than the routine implemented here > > as the compiler keeps neglecting to perform certain optimizations > > (like using leaq). > > > > On top of that the routine can is a starting point for copyinstr > > which operates on words instead of bytes. > > > > Tested with glibc test suite. > > > > Sample results (calls/s): > > > > Haswell: > > $(perl -e "print 'A' x 3"): > > stock: 211198039 > > patched:338626619 > > asm: 465609618 > > > > $(perl -e "print 'A' x 100"): > > stock: 83151997 > > patched: 98285919 > > asm: 120719888 > > > > AMD EPYC 7R32: > > $(perl -e "print 'A' x 3"): > > stock: 282523617 > > asm: 491498172 > > > > $(perl -e "print 'A' x 100"): > > stock: 114857172 > > asm: 112082057 > > No Reviewed by? More than one pair of eyes on non-trivial assembly is > almost always a good idea. > > Jess > > _______________________________________________ > dev-commits-src-main@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main > To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@freebsd.org" From owner-dev-commits-src-main@freebsd.org Mon Feb 8 23:16:56 2021 Return-Path: Delivered-To: dev-commits-src-main@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 89EB7545830 for ; Mon, 8 Feb 2021 23:16:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (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 4DZMNm3HQYz3JVf for ; Mon, 8 Feb 2021 23:16:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x731.google.com with SMTP id s77so16316533qke.4 for ; Mon, 08 Feb 2021 15:16:56 -0800 (PST) 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=dzLwaN08NA3n/DYkB2TpPc5qEpVbaeOa6v+Qi8Eh67I=; b=WWdOza8rYiRB0I41eeNzIWSPTNgP7c0dWBwg4a4/40yXST1a4T5F9NrOESmgSPg2LL ltSXnG+nbC0bZPybnZkjdJjTsjDtRNuXWaK5fwQixdIHYa2D2UxzKyXC1j7vHthrL1Gi TYosF0F/KNLyvfsRWN4CUjAnlgq4UCpZyNKl80np6v3V/r2V9Jsq4ty8jrpKYP9YGRnp AbxDf6tCoLkb1BlWdvUPTt/RJbofmFciZiAtfegrU4P7ZTgynSgBCXB8pktvlVtZwK1r y+ZolIEXY5mg1O0lg7jIHQvyrEx3TPX01T6vlsBj6x71aZVKevJKx3glbEtsHiTP+nCB YdcA== 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=dzLwaN08NA3n/DYkB2TpPc5qEpVbaeOa6v+Qi8Eh67I=; b=nCd80RtG3+ohxOMs68cAEWr8wxkwkav6htzTHEE7hrxydfF+L31sYTdomXcEEQjVAO 6cGqSB4EyZTRz2aqAcGWdk8XG5nKqWpCcsvI1enRLNrhZaBUMaXGLC1JIJEVzRMSbG3m JH+tF2wAVVHCqkm0njxalXRE6Yr/6Oho7xVO0Kz1NGUD1RSJx2QA0MVIPUEIUXKu3mS9 799xi3Eqwbj2UkztpvvMMbnW6bP5/7zh48oVG9kCMVFzxfrUVytb9RhK2FMNnVC+x7uq 7Mt2VbnhhrNc0rDH9AxlTGIR7dJM+KMvhjBts9QOJf0ynlJk+Q5fSelNksTOpCf3e7Cw 7+zA== X-Gm-Message-State: AOAM532znIrO/vpUyYTRj20MQ/K05hEjqyKIQ8AbE4BfosEIpVMjqiXR HsaXbXu9qLsDw+wi+8XzfFcnDegVbaA7S3BRWXZkpA== X-Google-Smtp-Source: ABdhPJzexS1te6dPZevr1coOX9p3LjyF0UQlJura2xXR9JK9tG39DJoi0p0zA0f5Kkg9XKNKUNpnPJ+nPAMWfXuPOXc= X-Received: by 2002:a37:ad1:: with SMTP id 200mr20092077qkk.195.1612826215557; Mon, 08 Feb 2021 15:16:55 -0800 (PST) MIME-Version: 1.0 References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 8 Feb 2021 16:16:44 -0700 Message-ID: Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly To: Kevin Bowling Cc: Jessica Clarke , Mateusz Guzik , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" X-Rspamd-Queue-Id: 4DZMNm3HQYz3JVf X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 23:16:56 -0000 To be fair, though, FreeBSD has been moving to a culture where people seek out reviews because they produce better results. It would be better for complex changes, like this, if they underwent some kind of review... While the tone of the message Jessica sent might not be to your liking, the notion that people should seek out more review isn't wrong... Warner On Mon, Feb 8, 2021 at 4:13 PM Kevin Bowling wrote: > FreeBSD does not require pre-commit approval unless called out > specifically. Are you volunteering to review the changes, and if so > where is your guidance? These messages are otherwise unhelpful. > > On Mon, Feb 8, 2021 at 12:37 PM Jessica Clarke wrote: > > > > On 8 Feb 2021, at 19:15, Mateusz Guzik wrote: > > > > > > The branch main has been updated by mjg: > > > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=af366d353b84bdc4e730f0fc563853abc338271c > > > > > > commit af366d353b84bdc4e730f0fc563853abc338271c > > > Author: Mateusz Guzik > > > AuthorDate: 2021-02-08 17:01:48 +0000 > > > Commit: Mateusz Guzik > > > CommitDate: 2021-02-08 19:15:21 +0000 > > > > > > amd64: implement strlen in assembly > > > > > > The C variant in libkern performs excessive branching to find the > > > non-zero byte instead of using the bsfq instruction. The same code > > > patched to use it is still slower than the routine implemented here > > > as the compiler keeps neglecting to perform certain optimizations > > > (like using leaq). > > > > > > On top of that the routine can is a starting point for copyinstr > > > which operates on words instead of bytes. > > > > > > Tested with glibc test suite. > > > > > > Sample results (calls/s): > > > > > > Haswell: > > > $(perl -e "print 'A' x 3"): > > > stock: 211198039 > > > patched:338626619 > > > asm: 465609618 > > > > > > $(perl -e "print 'A' x 100"): > > > stock: 83151997 > > > patched: 98285919 > > > asm: 120719888 > > > > > > AMD EPYC 7R32: > > > $(perl -e "print 'A' x 3"): > > > stock: 282523617 > > > asm: 491498172 > > > > > > $(perl -e "print 'A' x 100"): > > > stock: 114857172 > > > asm: 112082057 > > > > No Reviewed by? More than one pair of eyes on non-trivial assembly is > > almost always a good idea. > > > > Jess > > > > _______________________________________________ > > dev-commits-src-main@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main > > To unsubscribe, send any mail to " > dev-commits-src-main-unsubscribe@freebsd.org" > From owner-dev-commits-src-main@freebsd.org Mon Feb 8 23:19:04 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C846254584A for ; Mon, 8 Feb 2021 23:19:04 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 4DZMRD59dSz3JsG for ; Mon, 8 Feb 2021 23:19:04 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f51.google.com with SMTP id v14so3658581wro.7 for ; Mon, 08 Feb 2021 15:19:04 -0800 (PST) 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=ukQ64b8MTKDw1x7zWPz9+p4w6kqOeiUPI+Zs45bMWxM=; b=TeR2/sN2+O7XbQ7mzDJ43Mcv7rENTUXicOGpEiBjFy/TduWcI9h4K/CBvhEmOSE/KM OihG1UjkXRANvmlkrq5kqyidf/leStzqvGd5pQbl8x95hDT7aPzddh3DLWshtPf+pIOF FEHQ35swwzhekzyr7DiSaxkVRNJ3q8hVeSZ91mqZZBDT+m88MSyYL9SDF7UxWwIif9XL TA7tWO9cxEq2EFBnWMSdJhtDbe5kT3Zxu4IpU+FZ4tUH7Kcr1tPqoo/FPEIWN0TF34j5 8u3pnJL4kF+CLxGj8u5bGyt6taBrqyEF47Xf9BS9W8nOdqb+ssJvVag8g70PzyiJjatH Kj2A== X-Gm-Message-State: AOAM5300hu+CN5Jzz1BLV9yxjirnBORhiLWK1mVQ2jP3nAmGcaKYjRvY I8wLa3tL4KFujiSghID1mYOPMg== X-Google-Smtp-Source: ABdhPJzuKfwgKh30/uBLXn6vwhl5kM168Z6VP7Z7mSSBDz1jQ52A7YM7ipYS/dBKPkKMgDfP7BleLQ== X-Received: by 2002:adf:fd52:: with SMTP id h18mr22504848wrs.295.1612826343105; Mon, 08 Feb 2021 15:19:03 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id z15sm1057464wmi.38.2021.02.08.15.19.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2021 15:19:02 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly From: Jessica Clarke In-Reply-To: Date: Mon, 8 Feb 2021 23:19:01 +0000 Cc: Mateusz Guzik , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <8E61EA5C-39D1-49CC-8319-06E9192FF735@freebsd.org> References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> To: Kevin Bowling X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DZMRD59dSz3JsG X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 23:19:04 -0000 > On 8 Feb 2021, at 23:13, Kevin Bowling = wrote: >=20 > FreeBSD does not require pre-commit approval unless called out > specifically. Are you volunteering to review the changes, and if so > where is your guidance? These messages are otherwise unhelpful. It is not a hard requirement, but it is strongly encouraged. Section 7 of the committer's guide says: =E2=80=A2 All non-trivial changes should be reviewed before they = are committed to the repository. This was a non-trivial change. I was particularly frustrated to see this commit go in without review having previously called out mjg@ for not getting any reviews for his (now reverted) previous strlen change. Jess > On Mon, Feb 8, 2021 at 12:37 PM Jessica Clarke = wrote: >>=20 >> On 8 Feb 2021, at 19:15, Mateusz Guzik wrote: >>>=20 >>> The branch main has been updated by mjg: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Daf366d353b84bdc4e730f0fc563853ab= c338271c >>>=20 >>> commit af366d353b84bdc4e730f0fc563853abc338271c >>> Author: Mateusz Guzik >>> AuthorDate: 2021-02-08 17:01:48 +0000 >>> Commit: Mateusz Guzik >>> CommitDate: 2021-02-08 19:15:21 +0000 >>>=20 >>> amd64: implement strlen in assembly >>>=20 >>> The C variant in libkern performs excessive branching to find the >>> non-zero byte instead of using the bsfq instruction. The same code >>> patched to use it is still slower than the routine implemented = here >>> as the compiler keeps neglecting to perform certain optimizations >>> (like using leaq). >>>=20 >>> On top of that the routine can is a starting point for copyinstr >>> which operates on words instead of bytes. >>>=20 >>> Tested with glibc test suite. >>>=20 >>> Sample results (calls/s): >>>=20 >>> Haswell: >>> $(perl -e "print 'A' x 3"): >>> stock: 211198039 >>> patched:338626619 >>> asm: 465609618 >>>=20 >>> $(perl -e "print 'A' x 100"): >>> stock: 83151997 >>> patched: 98285919 >>> asm: 120719888 >>>=20 >>> AMD EPYC 7R32: >>> $(perl -e "print 'A' x 3"): >>> stock: 282523617 >>> asm: 491498172 >>>=20 >>> $(perl -e "print 'A' x 100"): >>> stock: 114857172 >>> asm: 112082057 >>=20 >> No Reviewed by? More than one pair of eyes on non-trivial assembly is >> almost always a good idea. >>=20 >> Jess >>=20 >> _______________________________________________ >> dev-commits-src-main@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main >> To unsubscribe, send any mail to = "dev-commits-src-main-unsubscribe@freebsd.org" From owner-dev-commits-src-main@freebsd.org Mon Feb 8 23:29:28 2021 Return-Path: Delivered-To: dev-commits-src-main@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 13E4C545C97 for ; Mon, 8 Feb 2021 23:29:28 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 4DZMgC6qSqz3KKT for ; Mon, 8 Feb 2021 23:29:27 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f51.google.com with SMTP id m1so622383wml.2 for ; Mon, 08 Feb 2021 15:29:27 -0800 (PST) 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=YC4SFofFhQ9SupdVQl801TjgDZ7rUL45lUr2yhY5j3E=; b=CH3o39Lv10d7OYcBEOipWjY1TTyx8PGaj2Elx/1NDOcvsb6DaXyTlbhYuB34e4LQa3 hsWG5U74kSSVUUw4L6IgvTJ1XFPdzIlZLxUn+H9SVadZO9vZDFH6XW/uJNgyWTThjKAc sgRmEEs8e4e8bYnvUS3twYGe04J/TK0+MNdOPdkGc4rjNmjlJdLz6EGwRVoFROwCWZVN vlB5POlubVNNdoA+SDszENZuqz++wYJKmuUQ2eVEzHMt6RmWmb0bfT8RyenvC/3G7HG7 lRD5FMMXUKrc4CXkmvk5B+fKQsy2T8uiyQe0QLuyiSLmfw5xVf1c8Khu9hTRqZxnyNxY RJVQ== X-Gm-Message-State: AOAM532HmEEgjfJPCNzO2SrM+Utt2988FTVGhxyrA4jUYXVgOH6Y1rEm GyS8+LeeDQre58yykgomjFRkSg== X-Google-Smtp-Source: ABdhPJwSzugale/3OUBOK4a551dBkmBKwutlQNst+vn5kYzNQRR9IrUdCmZje6wFniTrcb+XAmXsCg== X-Received: by 2002:a1c:29c6:: with SMTP id p189mr932614wmp.110.1612826966536; Mon, 08 Feb 2021 15:29:26 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id s23sm1094402wmc.35.2021.02.08.15.29.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2021 15:29:26 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 81e074d57dfc - main - libkern: use compiler builtins for strcpy, strcmp and strlen From: Jessica Clarke In-Reply-To: Date: Mon, 8 Feb 2021 23:29:25 +0000 Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202102081915.118JFVS0067851@gitrepo.freebsd.org> <8F5A406F-FB06-4D52-8CD7-1DCE01B6C126@freebsd.org> To: Alexander Richardson , Mateusz Guzik X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DZMgC6qSqz3KKT X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 23:29:28 -0000 On 8 Feb 2021, at 22:08, Alexander Richardson = wrote: >=20 > On Mon, 8 Feb 2021, 19:37 Jessica Clarke, wrote: >> On 8 Feb 2021, at 19:15, Mateusz Guzik wrote: >> >=20 >> > The branch main has been updated by mjg: >> >=20 >> > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D81e074d57dfcd86f152e2848dc44b770= 87ee7a2d >> >=20 >> > commit 81e074d57dfcd86f152e2848dc44b77087ee7a2d >> > Author: Mateusz Guzik >> > AuthorDate: 2021-02-07 19:50:25 +0000 >> > Commit: Mateusz Guzik >> > CommitDate: 2021-02-08 19:15:21 +0000 >> >=20 >> > libkern: use compiler builtins for strcpy, strcmp and strlen >>=20 >> Why? >=20 >=20 > I guess because the kernel uses -ffreestanding, so the libcall = inlining optimization requires explicit uses of __builtin_foo That would make sense, but such info belongs in the commit message, a comment or both... As it stands the message is not useful as anyone can see from reading the diff that that's what it does. Jess From owner-dev-commits-src-main@freebsd.org Mon Feb 8 23:42:35 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8806054630A; Mon, 8 Feb 2021 23:42:35 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZMyM3Qsmz3LV3; Mon, 8 Feb 2021 23:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 687ED20A14; Mon, 8 Feb 2021 23:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 118NgZm8021030; Mon, 8 Feb 2021 23:42:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 118NgZeF021029; Mon, 8 Feb 2021 23:42:35 GMT (envelope-from git) Date: Mon, 8 Feb 2021 23:42:35 GMT Message-Id: <202102082342.118NgZeF021029@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 174a7e578a33 - main - ZFS: fix assertions with INVARIANTS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 174a7e578a33c01401e33f9bfcc077fc3155251c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 23:42:35 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=174a7e578a33c01401e33f9bfcc077fc3155251c commit 174a7e578a33c01401e33f9bfcc077fc3155251c Author: Alan Somers AuthorDate: 2021-01-20 15:55:36 +0000 Commit: Alan Somers CommitDate: 2021-02-08 23:41:35 +0000 ZFS: fix assertions with INVARIANTS AFAICT, this was an oversight from 9e5787d2284e187abb5b654d924394a65772e004 (svn r364746). That revision inadvertently disabled assertions unconditionally. Reviewed by: freqlabs MFC after: 3 days Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D28256 --- sys/modules/zfs/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index e4b92db764ef..49256609b549 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -282,6 +282,8 @@ SRCS+= zfs_zstd.c \ .include +CFLAGS+= -include ${SRCTOP}/sys/cddl/compat/opensolaris/sys/debug_compat.h + CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} CFLAGS.gcc+= -Wno-pointer-to-int-cast From owner-dev-commits-src-main@freebsd.org Tue Feb 9 00:18:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 82C5D546FA9 for ; Tue, 9 Feb 2021 00:18:20 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) (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 4DZNlc1zLzz3N0l for ; Tue, 9 Feb 2021 00:18:20 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb31.google.com with SMTP id e132so16424077ybh.8 for ; Mon, 08 Feb 2021 16:18:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9mpgF1vFaoosp1Q7FztwyeaDDcq0pgBKtjY1w964Pm0=; b=KS62rzBkZ/U/RKzCHtvHSBMDGyT0HExNzBf9VWkNeeTyy3GbQxCc2+PAT1ewlR2UzA kG9vfBgSYeVPs2Le7tN4TdUzf8n5LmaK8EtLdYT8G5GuMjYuuYUOC7Wnsxv/BtevmKXr ZNcmVWqilbR8alFNFFQOc9KtdCcLBDYOteHR8= 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=9mpgF1vFaoosp1Q7FztwyeaDDcq0pgBKtjY1w964Pm0=; b=d92VkT6zMcQjX6UEGHaZFVxsRXYeNJ4aCGebOO5in/9Xp+fEnEGI2yrcsGkFtbTk7f oFkIfxYHj/V6skLfKJSABRDX3pSfFXvM08lPIs4DrtQnZPYoXTn8CtSPKtn1rp0fnLAP +fcK2A5G4fcnyMAD1+bIxu6HhZnh08cO391JIw+1iezLZYHbiGL8z0bJpebgQmHENw6A p61dQQ0Q1rvk6uziyXhm6DIteL5AwR4sGzRCKJTFGFXpAbGz1H9+0Qw8iqV2FKn5C/zZ LB3OK26A0emthk/53Gj3L44OPYo2D8OyMyQCRhn9oI7KqNAxMapuJWVHtIGj7Zw2g+zA JtNQ== X-Gm-Message-State: AOAM53284m68zvsjLI+wpbM1l1lxnbMnaJTrxGI7dHCNmvH63PRfeEl7 8Eyw+1LxmBGlYFNbXnIhFDVw/A7J7rS1Q/GTOPT6/Q== X-Google-Smtp-Source: ABdhPJyLp2qp6/oTDAkeO72jiLeAWPT73klx5nxbxWJV8VRw6yuI7dM0v0wEGK6adp0uCTHOPN+z/hR9XNVxI+pPBEc= X-Received: by 2002:a25:7453:: with SMTP id p80mr28474014ybc.297.1612829899236; Mon, 08 Feb 2021 16:18:19 -0800 (PST) MIME-Version: 1.0 References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> <8E61EA5C-39D1-49CC-8319-06E9192FF735@freebsd.org> In-Reply-To: <8E61EA5C-39D1-49CC-8319-06E9192FF735@freebsd.org> From: Kevin Bowling Date: Mon, 8 Feb 2021 17:18:08 -0700 Message-ID: Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly To: Jessica Clarke Cc: Mateusz Guzik , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , "src-committers@freebsd.org" X-Rspamd-Queue-Id: 4DZNlc1zLzz3N0l X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 00:18:20 -0000 I understand your position and Warner=E2=80=99s from the documentation. Th= e problem which is not described is that frustration is asymptotically higher in the other direction without volunteering to do work. As another example I could reply and ask for unit tests for any change (tests are obviously helpful too) but unless I am willing to help it is just a suggestion and should not be sent as a command. If you are willing to do such reviews timely, or have command of someone who will, I will coordinate with mjg and person. Otherwise it=E2=80=99s volunteering other people=E2=80=99s time an= d reduces the willpower to fix these performance areas. The head model supports occasional break and revert. I think this is important given the resources FreeBSD has available, since a lot of the less glamorous work is unpaid and underpaid. Picking on mjg for this is suspicious given how frequently breakage happens by anyone right now juxtaposed to his track record of improvements and quickness to address issues or revert where issue arose. Regards, Kevin On Mon, Feb 8, 2021 at 4:19 PM Jessica Clarke wrote: > > On 8 Feb 2021, at 23:13, Kevin Bowling wrote= : > > > > FreeBSD does not require pre-commit approval unless called out > > specifically. Are you volunteering to review the changes, and if so > > where is your guidance? These messages are otherwise unhelpful. > > It is not a hard requirement, but it is strongly encouraged. Section 7 > of the committer's guide says: > > =E2=80=A2 All non-trivial changes should be reviewed before they = are > committed to the repository. > > This was a non-trivial change. I was particularly frustrated to see > this commit go in without review having previously called out mjg@ for > not getting any reviews for his (now reverted) previous strlen change. > > Jess > > > On Mon, Feb 8, 2021 at 12:37 PM Jessica Clarke > wrote: > >> > >> On 8 Feb 2021, at 19:15, Mateusz Guzik wrote: > >>> > >>> The branch main has been updated by mjg: > >>> > >>> URL: > https://cgit.FreeBSD.org/src/commit/?id=3Daf366d353b84bdc4e730f0fc563853a= bc338271c > >>> > >>> commit af366d353b84bdc4e730f0fc563853abc338271c > >>> Author: Mateusz Guzik > >>> AuthorDate: 2021-02-08 17:01:48 +0000 > >>> Commit: Mateusz Guzik > >>> CommitDate: 2021-02-08 19:15:21 +0000 > >>> > >>> amd64: implement strlen in assembly > >>> > >>> The C variant in libkern performs excessive branching to find the > >>> non-zero byte instead of using the bsfq instruction. The same code > >>> patched to use it is still slower than the routine implemented here > >>> as the compiler keeps neglecting to perform certain optimizations > >>> (like using leaq). > >>> > >>> On top of that the routine can is a starting point for copyinstr > >>> which operates on words instead of bytes. > >>> > >>> Tested with glibc test suite. > >>> > >>> Sample results (calls/s): > >>> > >>> Haswell: > >>> $(perl -e "print 'A' x 3"): > >>> stock: 211198039 > >>> patched:338626619 > >>> asm: 465609618 > >>> > >>> $(perl -e "print 'A' x 100"): > >>> stock: 83151997 > >>> patched: 98285919 > >>> asm: 120719888 > >>> > >>> AMD EPYC 7R32: > >>> $(perl -e "print 'A' x 3"): > >>> stock: 282523617 > >>> asm: 491498172 > >>> > >>> $(perl -e "print 'A' x 100"): > >>> stock: 114857172 > >>> asm: 112082057 > >> > >> No Reviewed by? More than one pair of eyes on non-trivial assembly is > >> almost always a good idea. > >> > >> Jess > >> > >> _______________________________________________ > >> dev-commits-src-main@freebsd.org mailing list > >> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main > >> To unsubscribe, send any mail to " > dev-commits-src-main-unsubscribe@freebsd.org" > > From owner-dev-commits-src-main@freebsd.org Tue Feb 9 00:36:57 2021 Return-Path: Delivered-To: dev-commits-src-main@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 DB23554752A; Tue, 9 Feb 2021 00:36:57 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZP955mBbz3PlX; Tue, 9 Feb 2021 00:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B432E21238; Tue, 9 Feb 2021 00:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1190avGi087094; Tue, 9 Feb 2021 00:36:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1190avRi087093; Tue, 9 Feb 2021 00:36:57 GMT (envelope-from git) Date: Tue, 9 Feb 2021 00:36:57 GMT Message-Id: <202102090036.1190avRi087093@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: d20f7a5a3da1 - main - Simply FreeBSD check using __FreeBSD__ and remove OpenBSD MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d20f7a5a3da1aa5bccdabb89c181ca0c49385ecd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 00:36:57 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=d20f7a5a3da1aa5bccdabb89c181ca0c49385ecd commit d20f7a5a3da1aa5bccdabb89c181ca0c49385ecd Author: Cy Schubert AuthorDate: 2021-02-07 03:15:27 +0000 Commit: Cy Schubert CommitDate: 2021-02-09 00:36:27 +0000 Simply FreeBSD check using __FreeBSD__ and remove OpenBSD MFC after: 1 week --- contrib/ipfilter/lib/printaps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ipfilter/lib/printaps.c b/contrib/ipfilter/lib/printaps.c index 0304f34c6010..47c8def6106b 100644 --- a/contrib/ipfilter/lib/printaps.c +++ b/contrib/ipfilter/lib/printaps.c @@ -47,7 +47,7 @@ printaps(aps, opts, proto) ap.aps_state[0], ap.aps_state[1], ap.aps_sel[0], ap.aps_sel[1]); #if (defined(NetBSD) && (NetBSD >= 199905) && (NetBSD < 1991011)) || \ - (__FreeBSD_version >= 300000) || defined(OpenBSD) + defined(__FreeBSD__) PRINTF("\t\tseq: off %hd/%hd min %x/%x\n", ap.aps_seqoff[0], ap.aps_seqoff[1], ap.aps_seqmin[0], ap.aps_seqmin[1]); From owner-dev-commits-src-main@freebsd.org Tue Feb 9 00:36:59 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0AA3254761A; Tue, 9 Feb 2021 00:36:59 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZP966sHzz3PlZ; Tue, 9 Feb 2021 00:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEDA1212A6; Tue, 9 Feb 2021 00:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1190awuE087119; Tue, 9 Feb 2021 00:36:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1190awOp087118; Tue, 9 Feb 2021 00:36:58 GMT (envelope-from git) Date: Tue, 9 Feb 2021 00:36:58 GMT Message-Id: <202102090036.1190awOp087118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 57785538c6e0 - main - Simplify the FreeBSD check using __FreeBSD__ compiler macro. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 57785538c6e0d7e8ca0f161ab95bae10fd304047 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 00:36:59 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=57785538c6e0d7e8ca0f161ab95bae10fd304047 commit 57785538c6e0d7e8ca0f161ab95bae10fd304047 Author: Cy Schubert AuthorDate: 2021-02-07 03:22:52 +0000 Commit: Cy Schubert CommitDate: 2021-02-09 00:36:27 +0000 Simplify the FreeBSD check using __FreeBSD__ compiler macro. Rather than rely on __FreeBSD_version, defined in sys/param.h, use __FreeBSD__ defined by the compiler. Reported by: emaste MFC after: 1 week --- contrib/ipfilter/ip_dstlist.c | 2 +- contrib/ipfilter/ip_fil_compat.c | 2 +- contrib/ipfilter/ipf.h | 2 +- contrib/ipfilter/ipsend/sbpf.c | 2 +- contrib/ipfilter/ipsend/sock.c | 2 +- sys/contrib/ipfilter/netinet/fil.c | 6 +++--- sys/contrib/ipfilter/netinet/ip_auth.c | 8 ++++---- sys/contrib/ipfilter/netinet/ip_compat.h | 6 +++--- sys/contrib/ipfilter/netinet/ip_dstlist.c | 2 +- sys/contrib/ipfilter/netinet/ip_fil.h | 8 ++++---- sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 6 +++--- sys/contrib/ipfilter/netinet/ip_frag.c | 2 +- sys/contrib/ipfilter/netinet/ip_htable.c | 2 +- sys/contrib/ipfilter/netinet/ip_log.c | 12 ++++++------ sys/contrib/ipfilter/netinet/ip_lookup.c | 2 +- sys/contrib/ipfilter/netinet/ip_nat.c | 10 +++++----- sys/contrib/ipfilter/netinet/ip_nat6.c | 8 ++++---- sys/contrib/ipfilter/netinet/ip_pool.c | 2 +- sys/contrib/ipfilter/netinet/ip_proxy.c | 10 +++++----- sys/contrib/ipfilter/netinet/ip_rules.c | 2 +- sys/contrib/ipfilter/netinet/ip_state.c | 8 ++++---- sys/contrib/ipfilter/netinet/ip_sync.c | 6 +++--- sys/contrib/ipfilter/netinet/mlfk_ipl.c | 18 +++++++++--------- 23 files changed, 64 insertions(+), 64 deletions(-) diff --git a/contrib/ipfilter/ip_dstlist.c b/contrib/ipfilter/ip_dstlist.c index 14b071b0b95f..2802ef694aa9 100644 --- a/contrib/ipfilter/ip_dstlist.c +++ b/contrib/ipfilter/ip_dstlist.c @@ -41,7 +41,7 @@ # include # include #endif -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif diff --git a/contrib/ipfilter/ip_fil_compat.c b/contrib/ipfilter/ip_fil_compat.c index 6184502e0f58..0b426f5d9c48 100644 --- a/contrib/ipfilter/ip_fil_compat.c +++ b/contrib/ipfilter/ip_fil_compat.c @@ -14,7 +14,7 @@ #include #include #include -#if defined(__FreeBSD_version) && defined(_KERNEL) +#if defined(__FreeBSD__) && defined(_KERNEL) # include # include #else diff --git a/contrib/ipfilter/ipf.h b/contrib/ipfilter/ipf.h index c7f7308a9ba9..e178cfc1676e 100644 --- a/contrib/ipfilter/ipf.h +++ b/contrib/ipfilter/ipf.h @@ -172,7 +172,7 @@ typedef struct proxyrule { } proxyrule_t; -#if defined(__NetBSD__) || defined(__FreeBSD_version) || \ +#if defined(__NetBSD__) || defined(__FreeBSD__) || \ SOLARIS # include typedef int (* ioctlfunc_t)(int, ioctlcmd_t, ...); diff --git a/contrib/ipfilter/ipsend/sbpf.c b/contrib/ipfilter/ipsend/sbpf.c index 9b4f20c3fea9..f3b8d2f37775 100644 --- a/contrib/ipfilter/ipsend/sbpf.c +++ b/contrib/ipfilter/ipsend/sbpf.c @@ -12,7 +12,7 @@ #include #include #include -#ifdef __FreeBSD_version +#ifdef __FreeBSD__ # include #else # include diff --git a/contrib/ipfilter/ipsend/sock.c b/contrib/ipfilter/ipsend/sock.c index ddb59eb029f8..7754ef9d8e1c 100644 --- a/contrib/ipfilter/ipsend/sock.c +++ b/contrib/ipfilter/ipsend/sock.c @@ -168,7 +168,7 @@ struct tcpcb *find_tcp(tfd, ti) fd = (struct filedesc *)malloc(sizeof(*fd)); if (fd == NULL) return NULL; -#if defined( __FreeBSD_version) +#if defined( __FreeBSD__) if (KMCPY(fd, p->ki_fd, sizeof(*fd)) == -1) { fprintf(stderr, "read(%#lx,%#lx) failed\n", diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c index 2dca1e754b9e..09b4c27a1cb4 100644 --- a/sys/contrib/ipfilter/netinet/fil.c +++ b/sys/contrib/ipfilter/netinet/fil.c @@ -20,7 +20,7 @@ #include #include #include -#if defined(_KERNEL) && defined(__FreeBSD_version) +#if defined(_KERNEL) && defined(__FreeBSD__) # if !defined(IPFILTER_LKM) # include "opt_inet6.h" # endif @@ -91,7 +91,7 @@ #if defined(IPFILTER_BPF) && defined(_KERNEL) # include #endif -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif #include "netinet/ipl.h" @@ -2886,7 +2886,7 @@ ipf_check(ctx, ip, hlen, ifp, out */ m->m_flags &= ~M_CANFASTFWD; # endif /* M_CANFASTFWD */ -# if defined(CSUM_DELAY_DATA) && !defined(__FreeBSD_version) +# if defined(CSUM_DELAY_DATA) && !defined(__FreeBSD__) /* * disable delayed checksums. */ diff --git a/sys/contrib/ipfilter/netinet/ip_auth.c b/sys/contrib/ipfilter/netinet/ip_auth.c index c40bb1b435f2..881dab1aaea8 100644 --- a/sys/contrib/ipfilter/netinet/ip_auth.c +++ b/sys/contrib/ipfilter/netinet/ip_auth.c @@ -27,7 +27,7 @@ # include # undef _KERNEL #endif -#if defined(_KERNEL) && defined(__FreeBSD_version) +#if defined(_KERNEL) && defined(__FreeBSD__) # include # include #else @@ -50,7 +50,7 @@ # include # include #endif -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif #if defined(__NetBSD__) @@ -81,7 +81,7 @@ # undef KERNEL #endif #include -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include # define IF_QFULL _IF_QFULL # define IF_DROP _IF_DROP @@ -100,7 +100,7 @@ # include # endif #endif -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include # if defined(_KERNEL) && !defined(IPFILTER_LKM) # include diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h index 3de517b4559d..5c00f8d37e40 100644 --- a/sys/contrib/ipfilter/netinet/ip_compat.h +++ b/sys/contrib/ipfilter/netinet/ip_compat.h @@ -101,7 +101,7 @@ * There may be other, safe, kernels but this is not extensively tested yet. */ # define HAVE_M_PULLDOWN -# if !defined(IPFILTER_LKM) && defined(__FreeBSD_version) +# if !defined(IPFILTER_LKM) && defined(__FreeBSD__) # include "opt_ipfilter.h" # endif # define COPYIN(a,b,c) copyin((caddr_t)(a), (caddr_t)(b), (c)) @@ -282,7 +282,7 @@ typedef union { #define ipf_isw ipf_lkun_s.ipf_sw #define ipf_magic ipf_lkun_s.ipf_magic -#if !defined(__GNUC__) || defined(__FreeBSD_version) +#if !defined(__GNUC__) || defined(__FreeBSD__) # ifndef INLINE # define INLINE # endif @@ -290,7 +290,7 @@ typedef union { # define INLINE __inline__ #endif -#if defined(__FreeBSD_version) && defined(_KERNEL) +#if defined(__FreeBSD__) && defined(_KERNEL) CTASSERT(sizeof(ipfrwlock_t) == KRWLOCK_FILL_SZ); CTASSERT(sizeof(ipfmutex_t) == KMUTEX_FILL_SZ); #endif diff --git a/sys/contrib/ipfilter/netinet/ip_dstlist.c b/sys/contrib/ipfilter/netinet/ip_dstlist.c index 11e1a1846d89..af584d8e4d72 100644 --- a/sys/contrib/ipfilter/netinet/ip_dstlist.c +++ b/sys/contrib/ipfilter/netinet/ip_dstlist.c @@ -41,7 +41,7 @@ # include # include #endif -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h index 72def439b3e8..8cb988e1fd17 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.h +++ b/sys/contrib/ipfilter/netinet/ip_fil.h @@ -1374,7 +1374,7 @@ typedef struct ipftune { ** HPUX Port */ -#if !defined(CDEV_MAJOR) && defined (__FreeBSD_version) +#if !defined(CDEV_MAJOR) && defined (__FreeBSD__) # define CDEV_MAJOR 79 #endif @@ -1567,7 +1567,7 @@ typedef struct ipf_main_softc_s { frentry_t *ipf_rule_explist[2]; ipftoken_t *ipf_token_head; ipftoken_t **ipf_token_tail; -#if defined(__FreeBSD_version) && defined(_KERNEL) +#if defined(__FreeBSD__) && defined(_KERNEL) struct callout ipf_slow_ch; #endif #if NETBSD_GE_REV(104040000) @@ -1641,14 +1641,14 @@ extern size_t mbufchainlen(mb_t *); # ifdef IPFILTER_LKM extern int ipf_identify(char *); # endif -# if defined(__FreeBSD_version) +# if defined(__FreeBSD__) extern int ipfioctl(struct cdev*, u_long, caddr_t, int, struct thread *); # elif defined(__NetBSD__) extern int ipfioctl(dev_t, u_long, void *, int, struct lwp *); # endif # endif /* SOLARIS */ -# if defined(__FreeBSD_version) +# if defined(__FreeBSD__) extern int ipf_pfil_hook(void); extern int ipf_pfil_unhook(void); extern void ipf_event_reg(void); diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c index 39fe0933f417..9f03ab3bf946 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c @@ -16,11 +16,11 @@ static const char rcsid[] = "@(#)$Id$"; # define KERNEL 1 # define _KERNEL 1 #endif -#if defined(__FreeBSD_version) && \ +#if defined(__FreeBSD__) && \ !defined(KLD_MODULE) && !defined(IPFILTER_LKM) # include "opt_inet6.h" #endif -#if defined(__FreeBSD_version) && \ +#if defined(__FreeBSD__) && \ !defined(KLD_MODULE) && !defined(IPFILTER_LKM) # include "opt_random_ip_id.h" #endif @@ -35,7 +35,7 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif #include diff --git a/sys/contrib/ipfilter/netinet/ip_frag.c b/sys/contrib/ipfilter/netinet/ip_frag.c index 0636f27c81e8..93bcc2ed9415 100644 --- a/sys/contrib/ipfilter/netinet/ip_frag.c +++ b/sys/contrib/ipfilter/netinet/ip_frag.c @@ -24,7 +24,7 @@ # include # undef _KERNEL #endif -#if defined(_KERNEL) && defined(__FreeBSD_version) +#if defined(_KERNEL) && defined(__FreeBSD__) # include # include #else diff --git a/sys/contrib/ipfilter/netinet/ip_htable.c b/sys/contrib/ipfilter/netinet/ip_htable.c index bd76c2b5b0be..bd1a7136086f 100644 --- a/sys/contrib/ipfilter/netinet/ip_htable.c +++ b/sys/contrib/ipfilter/netinet/ip_htable.c @@ -24,7 +24,7 @@ # undef _KERNEL #endif #include -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif #if defined(__FreeBSD__) diff --git a/sys/contrib/ipfilter/netinet/ip_log.c b/sys/contrib/ipfilter/netinet/ip_log.c index d7acaf1ebf4e..7a80b3e0d4e7 100644 --- a/sys/contrib/ipfilter/netinet/ip_log.c +++ b/sys/contrib/ipfilter/netinet/ip_log.c @@ -39,7 +39,7 @@ # undef _KERNEL # undef KERNEL #endif -#if defined(__FreeBSD_version) && defined(_KERNEL) +#if defined(__FreeBSD__) && defined(_KERNEL) # include # include #else @@ -52,12 +52,12 @@ # include # endif #endif /* _KERNEL */ -# if defined(NetBSD) || defined(__FreeBSD_version) +# if defined(NetBSD) || defined(__FreeBSD__) # include # include # include # endif -# if defined(__FreeBSD_version) +# if defined(__FreeBSD__) # include # endif #if SOLARIS && defined(_KERNEL) @@ -78,7 +78,7 @@ #ifdef sun # include #endif -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif #include @@ -102,7 +102,7 @@ #include "netinet/ip_frag.h" #include "netinet/ip_state.h" #include "netinet/ip_auth.h" -#if defined(__FreeBSD_version) || defined(__NetBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) # include #endif /* END OF INCLUDES */ @@ -443,7 +443,7 @@ ipf_log_pkt(fin, flags) COPYIFNAME(fin->fin_v, ifp, ipfl.fl_ifname); # else # if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199603)) || \ - defined(__FreeBSD_version) + defined(__FreeBSD__) COPYIFNAME(fin->fin_v, ifp, ipfl.fl_ifname); # else ipfl.fl_unit = (u_int)ifp->if_unit; diff --git a/sys/contrib/ipfilter/netinet/ip_lookup.c b/sys/contrib/ipfilter/netinet/ip_lookup.c index f25174a752ec..66dec84944a1 100644 --- a/sys/contrib/ipfilter/netinet/ip_lookup.c +++ b/sys/contrib/ipfilter/netinet/ip_lookup.c @@ -15,7 +15,7 @@ #include #include #include -#if defined(__FreeBSD_version) && defined(_KERNEL) +#if defined(__FreeBSD__) && defined(_KERNEL) # include # include #else diff --git a/sys/contrib/ipfilter/netinet/ip_nat.c b/sys/contrib/ipfilter/netinet/ip_nat.c index 17c1133e145d..33d190c61a0a 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.c +++ b/sys/contrib/ipfilter/netinet/ip_nat.c @@ -31,7 +31,7 @@ struct file; # include # undef KERNEL #endif -#if defined(_KERNEL) && defined(__FreeBSD_version) +#if defined(_KERNEL) && defined(__FreeBSD__) # include # include #else @@ -55,11 +55,11 @@ struct file; # include # include #endif -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif #include -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif #ifdef sun @@ -90,7 +90,7 @@ extern struct ifnet vpnif; #include "netinet/ip_lookup.h" #include "netinet/ip_dstlist.h" #include "netinet/ip_sync.h" -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif #ifdef HAS_SYS_MD5_H @@ -1017,7 +1017,7 @@ ipf_nat_ioctl(softc, data, cmd, mode, uid, ctx) KAUTH_REQ_NETWORK_FIREWALL_FW, NULL, NULL, NULL)) # else -# if defined(__FreeBSD_version) +# if defined(__FreeBSD__) if (securelevel_ge(curthread->td_ucred, 3) && (mode & FWRITE)) # else if ((securelevel >= 3) && (mode & FWRITE)) diff --git a/sys/contrib/ipfilter/netinet/ip_nat6.c b/sys/contrib/ipfilter/netinet/ip_nat6.c index 13fa6fb6bc30..921eefc0ea3f 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat6.c +++ b/sys/contrib/ipfilter/netinet/ip_nat6.c @@ -29,7 +29,7 @@ struct file; # include # undef _KERNEL #endif -#if defined(_KERNEL) && defined(__FreeBSD_version) +#if defined(_KERNEL) && defined(__FreeBSD__) # include # include #else @@ -53,11 +53,11 @@ struct file; # include # include #endif -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif #include -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif #ifdef sun @@ -88,7 +88,7 @@ extern struct ifnet vpnif; #include "netinet/ip_lookup.h" #include "netinet/ip_dstlist.h" #include "netinet/ip_sync.h" -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif #ifdef HAS_SYS_MD5_H diff --git a/sys/contrib/ipfilter/netinet/ip_pool.c b/sys/contrib/ipfilter/netinet/ip_pool.c index 51d810baa310..fdd83ebd977f 100644 --- a/sys/contrib/ipfilter/netinet/ip_pool.c +++ b/sys/contrib/ipfilter/netinet/ip_pool.c @@ -38,7 +38,7 @@ # include # include #endif -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.c b/sys/contrib/ipfilter/netinet/ip_proxy.c index 2c6b4eb6369d..b4773bb6f358 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.c +++ b/sys/contrib/ipfilter/netinet/ip_proxy.c @@ -29,7 +29,7 @@ # include #include #if defined(_KERNEL) -#ifdef __FreeBSD_version +#ifdef __FreeBSD__ # include # endif # include @@ -37,7 +37,7 @@ # include # endif #endif -#if defined(_KERNEL) && defined(__FreeBSD_version) +#if defined(_KERNEL) && defined(__FreeBSD__) # include # include #else @@ -51,11 +51,11 @@ # include # include #endif -#ifdef __FreeBSD_version +#ifdef __FreeBSD__ # include #endif #include -#if defined(__FreeBSD_version) && defined(_KERNEL) +#if defined(__FreeBSD__) && defined(_KERNEL) #include #else #define CURVNET_SET(arg) @@ -80,7 +80,7 @@ #include "netinet/ip_nat.h" #include "netinet/ip_state.h" #include "netinet/ip_proxy.h" -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include #endif diff --git a/sys/contrib/ipfilter/netinet/ip_rules.c b/sys/contrib/ipfilter/netinet/ip_rules.c index 2fb61e9d91bf..fcf6923adeb3 100644 --- a/sys/contrib/ipfilter/netinet/ip_rules.c +++ b/sys/contrib/ipfilter/netinet/ip_rules.c @@ -12,7 +12,7 @@ #include #include #include -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # if defined(_KERNEL) # include # else diff --git a/sys/contrib/ipfilter/netinet/ip_state.c b/sys/contrib/ipfilter/netinet/ip_state.c index a050a2d324d2..0ebebb49297d 100644 --- a/sys/contrib/ipfilter/netinet/ip_state.c +++ b/sys/contrib/ipfilter/netinet/ip_state.c @@ -19,7 +19,7 @@ #include #include #include -#if defined(_KERNEL) && defined(__FreeBSD_version) && \ +#if defined(_KERNEL) && defined(__FreeBSD__) && \ !defined(KLD_MODULE) #include "opt_inet6.h" #endif @@ -31,7 +31,7 @@ # include # undef _KERNEL #endif -#if defined(_KERNEL) && defined(__FreeBSD_version) +#if defined(_KERNEL) && defined(__FreeBSD__) # include # include #else @@ -82,7 +82,7 @@ #ifdef USE_INET6 #include #endif -#ifdef __FreeBSD_version +#ifdef __FreeBSD__ # include # if defined(_KERNEL) && !defined(IPFILTER_LKM) # include @@ -307,7 +307,7 @@ ipf_state_seed_alloc(u_int state_size, u_int state_max) /* * XXX - ipf_state_seed[X] should be a random number of sorts. */ -#ifdef __FreeBSD_version +#ifdef __FreeBSD__ state_seed[i] = arc4random(); #else state_seed[i] = ((u_long)state_seed + i) * state_size; diff --git a/sys/contrib/ipfilter/netinet/ip_sync.c b/sys/contrib/ipfilter/netinet/ip_sync.c index f95cd824544b..66bf88e877f0 100644 --- a/sys/contrib/ipfilter/netinet/ip_sync.c +++ b/sys/contrib/ipfilter/netinet/ip_sync.c @@ -30,14 +30,14 @@ # include # endif # include -# ifdef __FreeBSD_version +# ifdef __FreeBSD__ # include # endif #endif #if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) # include #endif -#if defined(_KERNEL) && defined(__FreeBSD_version) +#if defined(_KERNEL) && defined(__FreeBSD__) # include # include #else @@ -79,7 +79,7 @@ #ifdef USE_INET6 #include #endif -#if defined(__FreeBSD_version) +#if defined(__FreeBSD__) # include # if defined(_KERNEL) && !defined(IPFILTER_LKM) # include diff --git a/sys/contrib/ipfilter/netinet/mlfk_ipl.c b/sys/contrib/ipfilter/netinet/mlfk_ipl.c index 1f4daf28824d..6e49ef77b486 100644 --- a/sys/contrib/ipfilter/netinet/mlfk_ipl.c +++ b/sys/contrib/ipfilter/netinet/mlfk_ipl.c @@ -22,7 +22,7 @@ #include #include #include -#ifdef __FreeBSD_version +#ifdef __FreeBSD__ # include # include # ifdef _KERNEL @@ -52,7 +52,7 @@ VNET_DECLARE(ipf_main_softc_t, ipfmain); #define V_ipfmain VNET(ipfmain) -#ifdef __FreeBSD_version +#ifdef __FreeBSD__ static struct cdev *ipf_devs[IPL_LOGSIZE]; #else static dev_t ipf_devs[IPL_LOGSIZE]; @@ -68,7 +68,7 @@ static int ipf_modunload(void); static int ipf_fbsd_sysctl_create(void); static int ipf_fbsd_sysctl_destroy(void); -#ifdef __FreeBSD_version +#ifdef __FreeBSD__ static int ipfopen(struct cdev*, int, int, struct thread *); static int ipfclose(struct cdev*, int, int, struct thread *); static int ipfread(struct cdev*, struct uio *, int); @@ -135,7 +135,7 @@ SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_minttl, CTLFLAG_RW, &VNET_NAME(ipfmain.ip #define CDEV_MAJOR 79 #include -#ifdef __FreeBSD_version +#ifdef __FreeBSD__ # include static int ipfpoll(struct cdev *dev, int events, struct thread *td); @@ -417,7 +417,7 @@ sysctl_ipf_int_frag ( SYSCTL_HANDLER_ARGS ) static int -#ifdef __FreeBSD_version +#ifdef __FreeBSD__ ipfpoll(struct cdev *dev, int events, struct thread *td) #else ipfpoll(dev_t dev, int events, struct proc *td) @@ -470,7 +470,7 @@ ipfpoll(dev_t dev, int events, struct proc *td) * routines below for saving IP headers to buffer */ static int ipfopen(dev, flags -#ifdef __FreeBSD_version +#ifdef __FreeBSD__ , devtype, p) int devtype; struct thread *p; @@ -510,7 +510,7 @@ static int ipfopen(dev, flags static int ipfclose(dev, flags -#ifdef __FreeBSD_version +#ifdef __FreeBSD__ , devtype, p) int devtype; struct thread *p; @@ -538,7 +538,7 @@ static int ipfclose(dev, flags */ static int ipfread(dev, uio, ioflag) int ioflag; -#ifdef __FreeBSD_version +#ifdef __FreeBSD__ struct cdev *dev; #else dev_t dev; @@ -581,7 +581,7 @@ static int ipfread(dev, uio, ioflag) */ static int ipfwrite(dev, uio, ioflag) int ioflag; -#ifdef __FreeBSD_version +#ifdef __FreeBSD__ struct cdev *dev; #else dev_t dev; From owner-dev-commits-src-main@freebsd.org Tue Feb 9 01:54:56 2021 Return-Path: Delivered-To: dev-commits-src-main@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 AB81A52A40E; Tue, 9 Feb 2021 01:54:56 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZQv44WmHz3l75; Tue, 9 Feb 2021 01:54:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E26122425; Tue, 9 Feb 2021 01:54:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1191suKW091661; Tue, 9 Feb 2021 01:54:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1191su8a091660; Tue, 9 Feb 2021 01:54:56 GMT (envelope-from git) Date: Tue, 9 Feb 2021 01:54:56 GMT Message-Id: <202102090154.1191su8a091660@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 3bc17248d317 - main - devfs: fix use count leak when using TIOCSCTTY MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3bc17248d31794519ba95b2c6b9ff8a0d31dba81 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 01:54:56 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3bc17248d31794519ba95b2c6b9ff8a0d31dba81 commit 3bc17248d31794519ba95b2c6b9ff8a0d31dba81 Author: Mateusz Guzik AuthorDate: 2021-02-08 22:10:57 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-09 01:54:21 +0000 devfs: fix use count leak when using TIOCSCTTY by matching devfs_ctty_ref Fixes: 3b44443626603f65 ("devfs: rework si_usecount to track opens") --- sys/fs/devfs/devfs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 983bfc803999..043cee74fde2 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -974,7 +974,7 @@ devfs_ioctl(struct vop_ioctl_args *ap) /* Get rid of reference to old control tty */ if (vpold) - vrele(vpold); + devfs_ctty_unref(vpold); } return (error); } From owner-dev-commits-src-main@freebsd.org Tue Feb 9 03:20:23 2021 Return-Path: Delivered-To: dev-commits-src-main@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 EFAB752D0E5 for ; Tue, 9 Feb 2021 03:20:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) (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 4DZSng5yYvz3rJ9 for ; Tue, 9 Feb 2021 03:20:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82c.google.com with SMTP id e11so12018550qtg.6 for ; Mon, 08 Feb 2021 19:20:23 -0800 (PST) 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=k5uYUfh05w0MoiaqOWuTbf0lu8lKPwDKSD0WCHOv1J8=; b=OsQCU/Z/BtpiJP2zr+ZHx/xvy72lbRUVzvFNjjfptqp2WkCjttFZC8hitu/spYRbTP lZOJSQHGecKU4U2yhr8f1/id2T/ZOsuc8moY/bs7oh3tORiR9T5gh9n2QasXqDPzTnyp 8eqG3CUAM9+FlIRIv1tDtPRS+vp5ZkTT7jH2DsmZ1s2DwaNJAfmj1jgLbqAmJij0PRtf /5B5VKeirrPRvTY2iJFeEWEstRKFw+bT/3+ARAahH7+iug9V7gxu/BxFpZwiYL9jAtaM r/K3lIHuaX6kQbPvAkkMyWKnoH6aAUqgk/q/IFYiGB+kJm7slnD+PWtFREJyCCYs2XBL rX9Q== 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=k5uYUfh05w0MoiaqOWuTbf0lu8lKPwDKSD0WCHOv1J8=; b=hsFw6BlCdVrkUFtAvYKb8pEijI2iYR06UjlMNCCsPGyyECIqiRP1hRtumG+7HV2TXe XCKuW57JJOGlydCm+ccCQtvlX4cZ5PAGCqclEKTHXT8NmSvfx3KKj1l884nVPEoa38Ds 73LiBSGNcgBOtmxHNacFpmuU1vyKdCInlECpk2ZjCIsb6wO4WXNkD0GitsW7jcrhMY+m rqtldncr+vL9Y6blzSlawGQG0UPoQGsaz8rQJ6dxxsDRgFtVUThXbU9goosvAM2e8tJm U4T2ZP48urStQBr+OMW8cl/0wigsy6yk+bWLM0+aAyXNAq+UTobNHFq33fQOxJQw3s50 9DeQ== X-Gm-Message-State: AOAM532oIT+6kkHBbOzYLaUZKBA+YPPvVDwoHLaVXbHdZjGrS6a70U9s LdOtJaLMEa1/jgjqmljEq54MCam7ccaDSiqmycevYg== X-Google-Smtp-Source: ABdhPJz2+zz4blMWkUBzooQnlXsBNyIFXScysukKh3sy8TfEtH8Z80gIzox3Ak0iEo3+wgrO+1Wau/k8uSFXJiexc1U= X-Received: by 2002:aed:2de2:: with SMTP id i89mr18252790qtd.73.1612840822629; Mon, 08 Feb 2021 19:20:22 -0800 (PST) MIME-Version: 1.0 References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> <8E61EA5C-39D1-49CC-8319-06E9192FF735@freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 8 Feb 2021 20:20:11 -0700 Message-ID: Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly To: Kevin Bowling Cc: Jessica Clarke , Mateusz Guzik , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , "src-committers@freebsd.org" X-Rspamd-Queue-Id: 4DZSng5yYvz3rJ9 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 03:20:24 -0000 Kevin, I'm sure that you think you are being reasonable. But you sure are coming off as attacking Jessica and I for a polite request to adhere to documented project norms. It's not unreasonable to make a request. You are proposing a crazy and unreasonable standard by attacking Jessica and I with the "would you have reviewed it?" line. I personally look at every single src review. I don't comment on them all. I don't know if I can until I take a look, but I at least read the summaries. It's cool that mjg has gone ahead and rewritten strlen. However, that's not a blank check to ignore project norms, nor for others to attack those that suggest it. The code is only about 50 lines of assembler, well within the range of code that often gets a good review. Suggesting that it would have benefitted from a review is not picking on mjg. Anyway, this is the last thing I'll post here... These threads get way out of hand, so if you want to post a rebuttal, I'll give you the last word. Warner On Mon, Feb 8, 2021 at 5:18 PM Kevin Bowling wrote: > I understand your position and Warner=E2=80=99s from the documentation. = The > problem which is not described is that frustration is asymptotically high= er > in the other direction without volunteering to do work. As another examp= le > I could reply and ask for unit tests for any change (tests are obviously > helpful too) but unless I am willing to help it is just a suggestion and > should not be sent as a command. If you are willing to do such reviews > timely, or have command of someone who will, I will coordinate with mjg a= nd > person. Otherwise it=E2=80=99s volunteering other people=E2=80=99s time = and reduces the > willpower to fix these performance areas. > > The head model supports occasional break and revert. I think this is > important given the resources FreeBSD has available, since a lot of the > less glamorous work is unpaid and underpaid. > > Picking on mjg for this is suspicious given how frequently breakage > happens by anyone right now juxtaposed to his track record of improvement= s > and quickness to address issues or revert where issue arose. > > Regards, > Kevin > > On Mon, Feb 8, 2021 at 4:19 PM Jessica Clarke wrote: > >> > On 8 Feb 2021, at 23:13, Kevin Bowling >> wrote: >> > >> > FreeBSD does not require pre-commit approval unless called out >> > specifically. Are you volunteering to review the changes, and if so >> > where is your guidance? These messages are otherwise unhelpful. >> >> It is not a hard requirement, but it is strongly encouraged. Section 7 >> of the committer's guide says: >> >> =E2=80=A2 All non-trivial changes should be reviewed before they= are >> committed to the repository. >> >> This was a non-trivial change. I was particularly frustrated to see >> this commit go in without review having previously called out mjg@ for >> not getting any reviews for his (now reverted) previous strlen change. >> >> Jess >> >> > On Mon, Feb 8, 2021 at 12:37 PM Jessica Clarke >> wrote: >> >> >> >> On 8 Feb 2021, at 19:15, Mateusz Guzik wrote: >> >>> >> >>> The branch main has been updated by mjg: >> >>> >> >>> URL: >> https://cgit.FreeBSD.org/src/commit/?id=3Daf366d353b84bdc4e730f0fc563853= abc338271c >> >>> >> >>> commit af366d353b84bdc4e730f0fc563853abc338271c >> >>> Author: Mateusz Guzik >> >>> AuthorDate: 2021-02-08 17:01:48 +0000 >> >>> Commit: Mateusz Guzik >> >>> CommitDate: 2021-02-08 19:15:21 +0000 >> >>> >> >>> amd64: implement strlen in assembly >> >>> >> >>> The C variant in libkern performs excessive branching to find the >> >>> non-zero byte instead of using the bsfq instruction. The same code >> >>> patched to use it is still slower than the routine implemented her= e >> >>> as the compiler keeps neglecting to perform certain optimizations >> >>> (like using leaq). >> >>> >> >>> On top of that the routine can is a starting point for copyinstr >> >>> which operates on words instead of bytes. >> >>> >> >>> Tested with glibc test suite. >> >>> >> >>> Sample results (calls/s): >> >>> >> >>> Haswell: >> >>> $(perl -e "print 'A' x 3"): >> >>> stock: 211198039 >> >>> patched:338626619 >> >>> asm: 465609618 >> >>> >> >>> $(perl -e "print 'A' x 100"): >> >>> stock: 83151997 >> >>> patched: 98285919 >> >>> asm: 120719888 >> >>> >> >>> AMD EPYC 7R32: >> >>> $(perl -e "print 'A' x 3"): >> >>> stock: 282523617 >> >>> asm: 491498172 >> >>> >> >>> $(perl -e "print 'A' x 100"): >> >>> stock: 114857172 >> >>> asm: 112082057 >> >> >> >> No Reviewed by? More than one pair of eyes on non-trivial assembly is >> >> almost always a good idea. >> >> >> >> Jess >> >> >> >> _______________________________________________ >> >> dev-commits-src-main@freebsd.org mailing list >> >> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main >> >> To unsubscribe, send any mail to " >> dev-commits-src-main-unsubscribe@freebsd.org" >> >> From owner-dev-commits-src-main@freebsd.org Tue Feb 9 03:45:49 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2B62E52D8FF; Tue, 9 Feb 2021 03:45:49 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZTM10KGrz3sZk; Tue, 9 Feb 2021 03:45:48 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (unknown [18.188.142.31]) by mail.soaustin.net (Postfix) with ESMTPSA id E65AD170FF; Tue, 9 Feb 2021 03:45:47 +0000 (UTC) Date: Tue, 9 Feb 2021 03:45:46 +0000 From: Mark Linimon To: Kevin Bowling Cc: Jessica Clarke , Mateusz Guzik , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , "src-committers@freebsd.org" Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly Message-ID: <20210209034546.GA11469@lonesome.com> References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> <8E61EA5C-39D1-49CC-8319-06E9192FF735@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: 4DZTM10KGrz3sZk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 03:45:49 -0000 One thing I think that has been missed in this discussion is that this is hardly a piece of obscure code in a device driver that few people have; instead, it's a piece of code that anyone who uses FreeBSD relies on. My take on it would be that perhas such bits of code should be more closely examined. mcl From owner-dev-commits-src-main@freebsd.org Tue Feb 9 03:47:07 2021 Return-Path: Delivered-To: dev-commits-src-main@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 234CD52E19A; Tue, 9 Feb 2021 03:47:07 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZTNW0YxQz3t2B; Tue, 9 Feb 2021 03:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05F3723D23; Tue, 9 Feb 2021 03:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1193l6ed035968; Tue, 9 Feb 2021 03:47:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1193l6WB035967; Tue, 9 Feb 2021 03:47:06 GMT (envelope-from git) Date: Tue, 9 Feb 2021 03:47:06 GMT Message-Id: <202102090347.1193l6WB035967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 504ebd612ec6 - main - kern: sonewconn: set so_options before pru_attach() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 504ebd612ec61165bb949cfce3a348b0d6f37008 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 03:47:07 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=504ebd612ec61165bb949cfce3a348b0d6f37008 commit 504ebd612ec61165bb949cfce3a348b0d6f37008 Author: Kyle Evans AuthorDate: 2021-01-20 17:53:05 +0000 Commit: Kyle Evans CommitDate: 2021-02-09 03:44:43 +0000 kern: sonewconn: set so_options before pru_attach() Protocol attachment has historically been able to observe and modify so->so_options as needed, and it still can for newly created sockets. 779f106aa169 moved this to after pru_attach() when we re-acquire the lock on the listening socket. Restore the historical behavior so that pru_attach implementations can consistently use it. Note that some pru_attach() do currently rely on this, though that may change in the future. D28265 contains a change to remove the use in TCP and IB/SDP bits, as resetting the requested linger time on incoming connections seems questionable at best. This does move the assignment out from under the head's listen lock, but glebius notes that head won't be going away and applications cannot assume any specific ordering with a race between a connection coming in and the application changing socket options anyways. Discussed-with: glebius MFC-after: 1 week --- sys/kern/uipc_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 7b16401b7071..7f06b51cf096 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -718,6 +718,7 @@ sonewconn(struct socket *head, int connstatus) } so->so_listen = head; so->so_type = head->so_type; + so->so_options = head->so_options & ~SO_ACCEPTCONN; so->so_linger = head->so_linger; so->so_state = head->so_state | SS_NOFDREF; so->so_fibnum = head->so_fibnum; @@ -754,7 +755,6 @@ sonewconn(struct socket *head, int connstatus) if (head->sol_accept_filter != NULL) connstatus = 0; so->so_state |= connstatus; - so->so_options = head->so_options & ~SO_ACCEPTCONN; soref(head); /* A socket on (in)complete queue refs head. */ if (connstatus) { TAILQ_INSERT_TAIL(&head->sol_comp, so, so_list); From owner-dev-commits-src-main@freebsd.org Tue Feb 9 03:53:00 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6689F52E1CE for ; Tue, 9 Feb 2021 03:53:00 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) (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 4DZTWJ2FVhz3tGv for ; Tue, 9 Feb 2021 03:53:00 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb31.google.com with SMTP id l8so4474204ybe.12 for ; Mon, 08 Feb 2021 19:53:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=vt5rdb4uy+sm0WI499fQjszQn4S8XYafHExrbXd8KRA=; b=YCQupFnzLTCb3aupWbwCGkRY4HOVTK3rwnHidO3aO/knHw6UdkD3ynaj70kASxSz29 89BBvZAgEOAuppuZ9mR3ieP25ZF+552BQdI9S5eg9256dnwzUEprGVZUytZvVrkFSv1D KmC3Q5dJb+S/aSQDpNTdZTNC6zxBkNFDEI9TQ= 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:content-transfer-encoding; bh=vt5rdb4uy+sm0WI499fQjszQn4S8XYafHExrbXd8KRA=; b=nMZVhftKY9TwSq9vMqCMUUP6vvGPf/wHzThUHHtWnWQSIi2CrHK291TW3lPW66tueV V4mxJY/7XM4hqvcd5ZxozxW4IX6zxtCZC1d9ctCjgdb8N69lsJ8vPNvQukae51sVZqka qkqBBHp/AyXW1Ty5e01A7xNr6hHSgecDVmiMICoU+A0Fbh8veEU9xOd1fDTSD1FerSyk Q1dT/mMdJaC3nz0REdLoN9uRtTgguQg77DTMQ8V9eNZukdo81gjl2UpGlM4qALbyfYay Qey48sP0y0g1vZRr1S/29AqGSMxH2TmyplAsH3hK5jhtbdvGz03rIvPPXfyEaLJgG8Cp mJgg== X-Gm-Message-State: AOAM531raPEsPXVXNOR2Etzl3F8IBecHOTm0F4D479SdbPz23Vbr5w2F ylkOaQ54C6RBcAfffArHXl+KwSAek9uuD83jC16Omw== X-Google-Smtp-Source: ABdhPJzFDroBp60ylIYN1f715eRa/qx36askEtG4rCKTbfnEoz/BAxX+LQ+Elou2vFZiRueFgULutwl6rmit6DIdibA= X-Received: by 2002:a25:4981:: with SMTP id w123mr29850614yba.123.1612842779170; Mon, 08 Feb 2021 19:52:59 -0800 (PST) MIME-Version: 1.0 References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> <8E61EA5C-39D1-49CC-8319-06E9192FF735@freebsd.org> In-Reply-To: From: Kevin Bowling Date: Mon, 8 Feb 2021 20:52:47 -0700 Message-ID: Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly To: Warner Losh Cc: Jessica Clarke , Mateusz Guzik , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4DZTWJ2FVhz3tGv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 03:53:00 -0000 Warner, My intent was not to attack Jessica just as I do not believe her intent was to pick on Mateuz but from different perspectives frustrations can build up to the point that the message is not well received. What I intended was the opposite: to encourage tact in this kind of exchan= ge. If we can start over in the future, the best way to do this is something like: "Mateuz, this is interesting work. I would like to have a chance to review your amd64 assembly changes before you commit them... [because $reasons might be nice to help someone internally process and change their behavior, but without justification sure it's just implied they care about the quality of the code and that is enough]".. I stand behind my position that commanding someone to do something without offer or without having an existing relationship such that they will receive the request in the way it was intended is a good way to burn people out. There are two contributors here. Siding with one is a negative outcome. I am trying to propose an actionable criteria that Mateuz can act on and have good faith in because I know him well enough to know he will do it. Regards, Kevin On Mon, Feb 8, 2021 at 8:20 PM Warner Losh wrote: > > Kevin, > > I'm sure that you think you are being reasonable. But you sure are coming= off as attacking Jessica and I for a polite request to adhere to documente= d project norms. It's not unreasonable to make a request. You are proposing= a crazy and unreasonable standard by attacking Jessica and I with the "wou= ld you have reviewed it?" line. I personally look at every single src revie= w. I don't comment on them all. I don't know if I can until I take a look, = but I at least read the summaries. > > It's cool that mjg has gone ahead and rewritten strlen. However, that's n= ot a blank check to ignore project norms, nor for others to attack those th= at suggest it. The code is only about 50 lines of assembler, well within th= e range of code that often gets a good review. Suggesting that it would hav= e benefitted from a review is not picking on mjg. > > Anyway, this is the last thing I'll post here... These threads get way ou= t of hand, so if you want to post a rebuttal, I'll give you the last word. > > Warner > > On Mon, Feb 8, 2021 at 5:18 PM Kevin Bowling w= rote: >> >> I understand your position and Warner=E2=80=99s from the documentation. = The problem which is not described is that frustration is asymptotically h= igher in the other direction without volunteering to do work. As another e= xample I could reply and ask for unit tests for any change (tests are obvio= usly helpful too) but unless I am willing to help it is just a suggestion a= nd should not be sent as a command. If you are willing to do such reviews = timely, or have command of someone who will, I will coordinate with mjg and= person. Otherwise it=E2=80=99s volunteering other people=E2=80=99s time a= nd reduces the willpower to fix these performance areas. >> >> The head model supports occasional break and revert. I think this is im= portant given the resources FreeBSD has available, since a lot of the less = glamorous work is unpaid and underpaid. >> >> Picking on mjg for this is suspicious given how frequently breakage happ= ens by anyone right now juxtaposed to his track record of improvements and = quickness to address issues or revert where issue arose. >> >> Regards, >> Kevin >> >> On Mon, Feb 8, 2021 at 4:19 PM Jessica Clarke wrote= : >>> >>> > On 8 Feb 2021, at 23:13, Kevin Bowling wro= te: >>> > >>> > FreeBSD does not require pre-commit approval unless called out >>> > specifically. Are you volunteering to review the changes, and if so >>> > where is your guidance? These messages are otherwise unhelpful. >>> >>> It is not a hard requirement, but it is strongly encouraged. Section 7 >>> of the committer's guide says: >>> >>> =E2=80=A2 All non-trivial changes should be reviewed before the= y are >>> committed to the repository. >>> >>> This was a non-trivial change. I was particularly frustrated to see >>> this commit go in without review having previously called out mjg@ for >>> not getting any reviews for his (now reverted) previous strlen change. >>> >>> Jess >>> >>> > On Mon, Feb 8, 2021 at 12:37 PM Jessica Clarke w= rote: >>> >> >>> >> On 8 Feb 2021, at 19:15, Mateusz Guzik wrote: >>> >>> >>> >>> The branch main has been updated by mjg: >>> >>> >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=3Daf366d353b84bdc4e730= f0fc563853abc338271c >>> >>> >>> >>> commit af366d353b84bdc4e730f0fc563853abc338271c >>> >>> Author: Mateusz Guzik >>> >>> AuthorDate: 2021-02-08 17:01:48 +0000 >>> >>> Commit: Mateusz Guzik >>> >>> CommitDate: 2021-02-08 19:15:21 +0000 >>> >>> >>> >>> amd64: implement strlen in assembly >>> >>> >>> >>> The C variant in libkern performs excessive branching to find the >>> >>> non-zero byte instead of using the bsfq instruction. The same cod= e >>> >>> patched to use it is still slower than the routine implemented he= re >>> >>> as the compiler keeps neglecting to perform certain optimizations >>> >>> (like using leaq). >>> >>> >>> >>> On top of that the routine can is a starting point for copyinstr >>> >>> which operates on words instead of bytes. >>> >>> >>> >>> Tested with glibc test suite. >>> >>> >>> >>> Sample results (calls/s): >>> >>> >>> >>> Haswell: >>> >>> $(perl -e "print 'A' x 3"): >>> >>> stock: 211198039 >>> >>> patched:338626619 >>> >>> asm: 465609618 >>> >>> >>> >>> $(perl -e "print 'A' x 100"): >>> >>> stock: 83151997 >>> >>> patched: 98285919 >>> >>> asm: 120719888 >>> >>> >>> >>> AMD EPYC 7R32: >>> >>> $(perl -e "print 'A' x 3"): >>> >>> stock: 282523617 >>> >>> asm: 491498172 >>> >>> >>> >>> $(perl -e "print 'A' x 100"): >>> >>> stock: 114857172 >>> >>> asm: 112082057 >>> >> >>> >> No Reviewed by? More than one pair of eyes on non-trivial assembly i= s >>> >> almost always a good idea. >>> >> >>> >> Jess >>> >> >>> >> _______________________________________________ >>> >> dev-commits-src-main@freebsd.org mailing list >>> >> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main >>> >> To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@f= reebsd.org" >>> From owner-dev-commits-src-main@freebsd.org Tue Feb 9 08:26:58 2021 Return-Path: Delivered-To: dev-commits-src-main@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 DBC1A53610B; Tue, 9 Feb 2021 08:26:58 +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 4DZbbQ4JHhz4fly; Tue, 9 Feb 2021 08:26:58 +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 1198QpK9011666 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 9 Feb 2021 08:26:53 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: kevans@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 1198QjNo045882 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 9 Feb 2021 15:26:45 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5) To: Kyle Evans References: <202102080704.11874w7E017472@gitrepo.freebsd.org> <33d6f518-2005-e859-0230-34490c3c5914@grosbein.net> Cc: src-committers , "" , dev-commits-src-main@freebsd.org From: Eugene Grosbein Message-ID: <94a88abe-c38b-9bfa-6814-c84a58644df5@grosbein.net> Date: Tue, 9 Feb 2021 15:26:36 +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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,LOCAL_FROM, NICE_REPLY_A,SPF_HELO_NONE,T_SPF_PERMERROR 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 T_SPF_PERMERROR SPF: test of record failed (permerror) * 2.6 LOCAL_FROM From my domains * -0.3 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: 4DZbbQ4JHhz4fly X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 08:26:59 -0000 08.02.2021 22:22, Kyle Evans wrote: > It's OK to call out the more > common case for folks, but this feels a lot more absolute than it > needs to be. Also, the loader is capable of loading compressed .ko files that may be important for space-constrained ("embedded") systems. AFAIR, kldload cannot do that. From owner-dev-commits-src-main@freebsd.org Tue Feb 9 09:19:26 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A905E537FA5; Tue, 9 Feb 2021 09:19:26 +0000 (UTC) (envelope-from debdrup@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZcly4Kt6z4lh8; Tue, 9 Feb 2021 09:19:26 +0000 (UTC) (envelope-from debdrup@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1612862366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PfLm0LDuhspL/uQDXJVFvc8wiwyy+VUlCibvN6ecPrk=; b=fPlqXnjzBiBwk1al6k6bKq2np9Lz1GOyMXhMMnYfRUimOJiwD89kGRqQYjpa9NY2xBvtyy 4XJyhEyI2RSWOgpgbmJy0IQp7O1vuqHJ6TVNa3i45mjyTtecYdwcxHa5dNyvDGS2cyorDx rYAaae4kM2Sd9z27eF5UJSd3N10eC3b5tLu5l8ysSVJAbD3rujrABjMOA9nFSQVPIDIFgz jfNrvEo/IOEMwMWgA0futwOxXVK5XvLts1jqcTwNRKhIpmaPYKSwgAmOIxy9IR3UaQCIWR VgBWQBmHaTHabj106LxoWJFFh4LiA4rx9T6h/IqOPbg7Tx5ntOIxKgwE9nHerg== Received: by freefall.freebsd.org (Postfix, from userid 1471) id 86AF514519; Tue, 9 Feb 2021 09:19:26 +0000 (UTC) Date: Tue, 9 Feb 2021 10:19:24 +0100 From: Daniel Ebdrup Jensen To: dev-commits-src-main@freebsd.org, "" Subject: Re: git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5) Message-ID: <20210209091924.2llehdxlndekytkp@nerd-thinkpad.local> Mail-Followup-To: Daniel Ebdrup Jensen , dev-commits-src-main@freebsd.org, "" References: <202102080704.11874w7E017472@gitrepo.freebsd.org> <33d6f518-2005-e859-0230-34490c3c5914@grosbein.net> <20210208184822.uejqvgyl2ddv4emc@nerd-thinkpad.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wfpb4v3ij6dlmabh" Content-Disposition: inline In-Reply-To: <20210208184822.uejqvgyl2ddv4emc@nerd-thinkpad.local> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1612862366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PfLm0LDuhspL/uQDXJVFvc8wiwyy+VUlCibvN6ecPrk=; b=tIr1e7xCMnvu9Vv+8kJ5xvaaHLFBaKDJBhegA9J+lpdLQ4O/9xA+DLw4eyome0nn3rRtJ8 HP9CAlpaZ8+A/tEA+lMTnAhWU2tihzbGuHjBxA/EHoEwaJZpkWdc/q0Axv5RaTil7f3yfZ QCcjct8qbTQI9aeZhI0Vmjh8GHKdpKcGhtYMX6DpXSkqiHKS+YfgH2PeDBj9EDE8zIOkGG HIO17TT76yxXXCc2sA1HuwZjR3J4koc+0fGGXNACCSuAjsl0GlELg/60NnU7gZ1QzhBLh8 7CtwVtJ90cpKHjTrpFtdzyymQ7U/+ZhtHVeH/XeEvptH4s7vGuOUGOzlshA12w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1612862366; a=rsa-sha256; cv=none; b=Gw+27bPYui2TU+44dA40j5Y4VB5rSAA1GDS+YJ0YLBFv/a45yULoI+1sXuaHQA7HWHdzBI Xs4CQMzaOC7NOrv+7Z8f0+8639n/81CIJYNuK1gKvZK79DTUk/i07xXv1AyZ2EsYWJ3RLB MLgHkaGWHun2kXnIQF3yVnbVQjzi9EOlhcNjkiRL+1CgiJ15HTAMCHz+g9e7sscsfkfQGx zo7CeC573ZxI0Ji4/VsnKpRvwc8T2QBIzvlzJsr9w0OvjMi844UJgZ/W8o04czjJjWQhHM afeCRQUmRY+K/xtpWWaJ8SR36B720sUA+pd9j8i86Ab3dGCygDRunQ9GA2raog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 09:19:26 -0000 --wfpb4v3ij6dlmabh Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline On Mon, Feb 08, 2021 at 07:48:22PM +0100, Daniel Ebdrup Jensen wrote: >On Mon, Feb 08, 2021 at 09:22:25AM -0600, Kyle Evans wrote: >>On Mon, Feb 8, 2021 at 9:07 AM Eugene Grosbein wrote: >>> >>>08.02.2021 21:58, Kyle Evans wrote: >>> >>>>>>> kld_list cannot do that. >>>>>> >>>>>> Huh? kld_list accepts a full pathname, which is the same kind of >>>>>> specification you'd need to do with one from port in loader with >>>>>> *_name. >>>>> >>>>> Good, but seems to be undocumented. >>>>> >>>> >>>> In what sense? Is there some other place that kld_list is even >>>> documented than kldload(8)? >>> >>>Naturally: rc.conf(5), also in /etc/defaults/rc.conf >>> >> >>Wow, that documentation is just flat wrong for multiple reasons. >> >> kld_list (str) A whitespace-separated list of kernel modules to load >> right after the local disks are mounted, without any .ko >> extension or path. Loading modules at this point in the boot >> process is much faster than doing it via /boot/loader.conf >> for those modules not necessary for mounting local disks. >> >>The second part of the first sentence is a self-imposed limitation, >>and an incredibly unimportant one at that. Specifying a .ko will only >>break the existing "Is it loaded" behavior and cause it to always try, >>which is mostly a nuisance at best because it will get rejected if the >>kldstat inquiry is wrong -- the kld rc script will append .ko whether >>the path has one or not, so this should be fixed. Despite that, a path >>will work just fine for the most part; kldstat -v shows the fully >>qualified path. If it wanted to be improved, it just needs to basename >>what it was given to be able to detect if it was loaded from any other >>path and pass that in as the -e argument to load_kld if it really was >>a file. >> >>It's not wrong about loading modules being faster here, and at some >>point in the past it was even necessary due to loader(8) being too >>early or problematic in some terrible cases (e.g. nvidia modsetting >>bits), but the second half of that sentence should probably just be >>omitted or reworked to more vaguely refer to "... those modules not >>necessary for booting the system, including those required for >>mounting the root filesystem." The key changes being that there are >>other reasons you might need to load something early enough in boot, >>and that root isn't always a local disk. It's OK to call out the more >>common case for folks, but this feels a lot more absolute than it >>needs to be. >>_______________________________________________ >>dev-commits-src-main@freebsd.org mailing list >>https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main >>To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@freebsd.org" > >Hi folks, > >I'd originally replied to imp@ when he sent me a comment about this, >although because of a misconfiguration I hadn't seen it was also sent to >a different list, but in it I remarked the same things about >nvidia-modesetting and the speed, however I do think Kyle is right that >it's better to rework the sentence because mountroot isn't really >docuemented in the extant manual pages. > >I'm not sure about wanting to document the other details outlined here, >because I'm not entirely sure I understand them - plus, it's in a >different manual page, so it's free for anyone with an active commit bit >and an understanding to persue. :) > >I'll try and work something out and do a Phabricator review, but let's >try and keep the bike-shedding to a minimum. > >Yours, >Daniel Ebdrup Jensen > >P.S. We all know the best colour is purple. ;) Hi folks, For reference, the review is up at https://reviews.freebsd.org/D28542 and I've added a few people, who contacted me about this, to it. Yours, Daniel Ebdrup Jensen --wfpb4v3ij6dlmabh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEEDonNJPbg/JLIMoS6Ps5hSHzN87oFAmAiU5xfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDBF ODlDRDI0RjZFMEZDOTJDODMyODRCQTNFQ0U2MTQ4N0NDREYzQkEACgkQPs5hSHzN 87o63Af+I29+WGzQjR1DWcd1ROlzTJQllnO9EFZIRaav7MDiiFOwbI846554U0pQ 2bkITJo8GDpRPxyu0Qha67UA9dAR7IxznabapgodOGcrkLxExlhY9oGZiOt3WcfS SdrAIMlM7ADuHlUdqjBrNiltUaTVIzVmle+ZEPdqbYHZeOOvcC4QNitD3BuRG2iI tm8lmN/+DwIRAGHDprIJWpFdWke4b86rXw04TOlNofsKW5spNqUWOyrya0PZ0jbd EnzVUk9+ZgxWBRDIGnWrFeDCi1wc90D3DN/Bz2L3PWWxx/cCPNrrYgulw/1mCXrE Uh68Co50HZOGFaAeLFnNvcDNLkekZA== =6T5M -----END PGP SIGNATURE----- --wfpb4v3ij6dlmabh-- From owner-dev-commits-src-main@freebsd.org Tue Feb 9 11:46:27 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6F74A53B80F; Tue, 9 Feb 2021 11:46:27 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZh1b2nK2z4tn2; Tue, 9 Feb 2021 11:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 527262383; Tue, 9 Feb 2021 11:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119BkRED061047; Tue, 9 Feb 2021 11:46:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119BkRhW061046; Tue, 9 Feb 2021 11:46:27 GMT (envelope-from git) Date: Tue, 9 Feb 2021 11:46:27 GMT Message-Id: <202102091146.119BkRhW061046@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 96bef2053a87 - main - loader: remove BORDER_PIXELS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 96bef2053a87c8d01ce08ea88857e4657489c8e7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 11:46:27 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=96bef2053a87c8d01ce08ea88857e4657489c8e7 commit 96bef2053a87c8d01ce08ea88857e4657489c8e7 Author: Toomas Soome AuthorDate: 2021-02-08 18:49:09 +0000 Commit: Toomas Soome CommitDate: 2021-02-09 11:45:07 +0000 loader: remove BORDER_PIXELS BORDER_PIXELS is left over from picking up the source from illumos port. Since FreeBSD VT does not use border in terminal size calculation, there is no reason why should loader use it. MFC after: 1 week --- stand/common/gfx_fb.c | 23 ++++++++--------------- stand/i386/libi386/vidconsole.c | 4 ++-- stand/lua/drawer.lua | 2 +- sys/sys/font.h | 1 - 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index 08c0f59505f2..2aed8775a540 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -1888,25 +1888,18 @@ set_font(teken_unit_t *rows, teken_unit_t *cols, teken_unit_t h, teken_unit_t w) } if (font != NULL) { - *rows = (height - BORDER_PIXELS) / font->vfbd_height; - *cols = (width - BORDER_PIXELS) / font->vfbd_width; + *rows = height / font->vfbd_height; + *cols = width / font->vfbd_width; return (font); } /* * Find best font for these dimensions, or use default - * - * A 1 pixel border is the absolute minimum we could have - * as a border around the text window (BORDER_PIXELS = 2), - * however a slightly larger border not only looks better - * but for the fonts currently statically built into the - * emulator causes much better font selection for the - * normal range of screen resolutions. */ STAILQ_FOREACH(fl, &fonts, font_next) { font = fl->font_data; - if ((((*rows * font->vfbd_height) + BORDER_PIXELS) <= height) && - (((*cols * font->vfbd_width) + BORDER_PIXELS) <= width)) { + if ((*rows * font->vfbd_height <= height) && + (*cols * font->vfbd_width <= width)) { if (font->vfbd_font == NULL || fl->font_flags == FONT_RELOAD) { if (fl->font_load != NULL && @@ -1916,8 +1909,8 @@ set_font(teken_unit_t *rows, teken_unit_t *cols, teken_unit_t h, teken_unit_t w) if (font == NULL) continue; } - *rows = (height - BORDER_PIXELS) / font->vfbd_height; - *cols = (width - BORDER_PIXELS) / font->vfbd_width; + *rows = height / font->vfbd_height; + *cols = width / font->vfbd_width; break; } font = NULL; @@ -1936,8 +1929,8 @@ set_font(teken_unit_t *rows, teken_unit_t *cols, teken_unit_t h, teken_unit_t w) if (font == NULL) font = &DEFAULT_FONT_DATA; - *rows = (height - BORDER_PIXELS) / font->vfbd_height; - *cols = (width - BORDER_PIXELS) / font->vfbd_width; + *rows = height / font->vfbd_height; + *cols = width / font->vfbd_width; } return (font); diff --git a/stand/i386/libi386/vidconsole.c b/stand/i386/libi386/vidconsole.c index e17885cb7b0c..f94ed2d26712 100644 --- a/stand/i386/libi386/vidconsole.c +++ b/stand/i386/libi386/vidconsole.c @@ -908,8 +908,8 @@ cons_update_mode(bool use_gfx_mode) } else { /* Trigger loading of 8x16 font. */ setup_font(&gfx_state, - 16 * gfx_state.tg_fb.fb_height + BORDER_PIXELS, - 8 * gfx_state.tg_fb.fb_width + BORDER_PIXELS); + 16 * gfx_state.tg_fb.fb_height, + 8 * gfx_state.tg_fb.fb_width); gfx_state.tg_functions = &tf; /* ensure the following are not set for text mode */ unsetenv("screen.height"); diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index 6062d7e87a03..eb9b18117cd3 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -308,7 +308,7 @@ local function drawbrand() if core.isFramebufferConsole() and loader.term_putimage ~= nil and branddef.image ~= nil then - if loader.term_putimage(branddef.image, 0, 0, 0, 7, 0) + if loader.term_putimage(branddef.image, 1, 1, 0, 7, 0) then return true end diff --git a/sys/sys/font.h b/sys/sys/font.h index e09b2112959d..969a9bce4e6d 100644 --- a/sys/sys/font.h +++ b/sys/sys/font.h @@ -107,7 +107,6 @@ struct fontlist { STAILQ_ENTRY(fontlist) font_next; }; -#define BORDER_PIXELS 10 /* space from screen border */ typedef STAILQ_HEAD(font_list, fontlist) font_list_t; #define FONT_HEADER_MAGIC "VFNT0002" From owner-dev-commits-src-main@freebsd.org Tue Feb 9 11:47:26 2021 Return-Path: Delivered-To: dev-commits-src-main@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 7D11553B5FA; Tue, 9 Feb 2021 11:47:26 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZh2k3Bb6z4twv; Tue, 9 Feb 2021 11:47:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 609202385; Tue, 9 Feb 2021 11:47:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119BlQ9v061282; Tue, 9 Feb 2021 11:47:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119BlQYR061281; Tue, 9 Feb 2021 11:47:26 GMT (envelope-from git) Date: Tue, 9 Feb 2021 11:47:26 GMT Message-Id: <202102091147.119BlQYR061281@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: a26f73585831 - main - loader: do not autoselect smaller font than 8x16 with high res display MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a26f7358583174f2fe0df3e979f7b8b02069278c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 11:47:26 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=a26f7358583174f2fe0df3e979f7b8b02069278c commit a26f7358583174f2fe0df3e979f7b8b02069278c Author: Toomas Soome AuthorDate: 2021-02-08 22:34:47 +0000 Commit: Toomas Soome CommitDate: 2021-02-09 11:46:58 +0000 loader: do not autoselect smaller font than 8x16 with high res display The VT screen buffer size is calculated based on our default built in (8x16) font. With high-resolution display, we want to use at least 8x16 font, or we will have large unused areas on screen. MFC after: 1 week --- stand/common/gfx_fb.c | 12 +++++++++--- stand/common/gfx_fb.h | 12 ++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index 2aed8775a540..02a0a3d2be22 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -1894,12 +1894,18 @@ set_font(teken_unit_t *rows, teken_unit_t *cols, teken_unit_t h, teken_unit_t w) } /* - * Find best font for these dimensions, or use default + * Find best font for these dimensions, or use default. + * If height >= VT_FB_MAX_HEIGHT and width >= VT_FB_MAX_WIDTH, + * do not use smaller font than our DEFAULT_FONT_DATA. */ STAILQ_FOREACH(fl, &fonts, font_next) { font = fl->font_data; - if ((*rows * font->vfbd_height <= height) && - (*cols * font->vfbd_width <= width)) { + if ((*rows * font->vfbd_height <= height && + *cols * font->vfbd_width <= width) || + (height >= VT_FB_MAX_HEIGHT && + width >= VT_FB_MAX_WIDTH && + font->vfbd_height == DEFAULT_FONT_DATA.vfbd_height && + font->vfbd_width == DEFAULT_FONT_DATA.vfbd_width)) { if (font->vfbd_font == NULL || fl->font_flags == FONT_RELOAD) { if (fl->font_load != NULL && diff --git a/stand/common/gfx_fb.h b/stand/common/gfx_fb.h index d046865604ea..04076a2c6d38 100644 --- a/stand/common/gfx_fb.h +++ b/stand/common/gfx_fb.h @@ -164,6 +164,18 @@ struct vesa_flat_panel_info { #define NCMAP 256 extern uint32_t cmap[NCMAP]; +/* + * VT_FB_MAX_WIDTH and VT_FB_MAX_HEIGHT are dimensions from where + * we will not auto select smaller font than 8x16. + * See also sys/dev/vt/vt.h + */ +#ifndef VT_FB_MAX_WIDTH +#define VT_FB_MAX_WIDTH 4096 +#endif +#ifndef VT_FB_MAX_HEIGHT +#define VT_FB_MAX_HEIGHT 2400 +#endif + enum FB_TYPE { FB_TEXT = -1, FB_GOP, From owner-dev-commits-src-main@freebsd.org Tue Feb 9 12:12:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8AFAE53CEF6; Tue, 9 Feb 2021 12:12:20 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZhbS3Zntz4x07; Tue, 9 Feb 2021 12:12:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DE69279C; Tue, 9 Feb 2021 12:12:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119CCKER096688; Tue, 9 Feb 2021 12:12:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119CCKkv096687; Tue, 9 Feb 2021 12:12:20 GMT (envelope-from git) Date: Tue, 9 Feb 2021 12:12:20 GMT Message-Id: <202102091212.119CCKkv096687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: ec090f4a6765 - main - arm32: Align arguments of sync_icache() syscall to cacheline size. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec090f4a67654fa541e6d97fd5f74d3f66c1c0d0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 12:12:20 -0000 The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=ec090f4a67654fa541e6d97fd5f74d3f66c1c0d0 commit ec090f4a67654fa541e6d97fd5f74d3f66c1c0d0 Author: Michal Meloun AuthorDate: 2021-02-09 10:36:36 +0000 Commit: Michal Meloun CommitDate: 2021-02-09 11:53:09 +0000 arm32: Align arguments of sync_icache() syscall to cacheline size. Otherwise, we may miss synchronization of the last cacheline. MFC after: 3 days --- sys/arm/arm/sys_machdep.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/arm/arm/sys_machdep.c b/sys/arm/arm/sys_machdep.c index d33ac75ad73b..fc424d0fad39 100644 --- a/sys/arm/arm/sys_machdep.c +++ b/sys/arm/arm/sys_machdep.c @@ -68,12 +68,9 @@ sync_icache(uintptr_t addr, size_t len) size_t size; vm_offset_t rv; - /* - * Align starting address to even number because value of "1" - * is used as return value for success. - */ - len += addr & 1; - addr &= ~1; + /* Align starting address to cacheline size */ + len += addr & cpuinfo.dcache_line_mask; + addr &= ~cpuinfo.dcache_line_mask; /* Break whole range to pages. */ do { From owner-dev-commits-src-main@freebsd.org Tue Feb 9 13:41:18 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D633553F119; Tue, 9 Feb 2021 13:41:18 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (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 4DZkZ656HFz51t7; Tue, 9 Feb 2021 13:41:18 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x42f.google.com with SMTP id q7so21750612wre.13; Tue, 09 Feb 2021 05:41:18 -0800 (PST) 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:content-transfer-encoding; bh=tHgukRA1lyjBxBml3TUdnTAZFM0XeHjQ+Mnj2uRa1bM=; b=TkMuKsSwCmj/GlC6AJ4WS3w/zQBZdzMAkJM1KuMjZQvoxIz9jWky4UzIVPNQGUlsK0 8ifX727GB2TbRuwxx2iEBPBUZMRzmkcXPHbprYelnSsJ1IFU9mHBCYE0yVZqSkeXU8O2 t0gaMyunwyAOBHZAK3zCRWnLvCh1kOG/DvbV0FzJUaugw7OpNtizH1sCRunovkX1e6Jt 8erdAUlWUChksGAp2o0we0xriBIUiR0rn3w9YLmoa8xZ2DUkl/vMbV9YlTfWh0gz2nSd xNZ+2Y3g/2uPH4Jz94GuMHcFWW0Y41SPsn01WzUT/0QAQGIuO759q7PQLIRfcB/n9Mqy B+Vg== 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:content-transfer-encoding; bh=tHgukRA1lyjBxBml3TUdnTAZFM0XeHjQ+Mnj2uRa1bM=; b=odhWDQzjYLnLbMPbFRvFnogHTYSbc4U9sm0YjryhhU4zGauH4QNLL9dE5M5485huuS 3DMoCkJGBNv48fSTIrTxboZG3JuRzP2y2zUQAJ8o9HYHvWECXq2O0lPxS8HVsc+AITxc hBOj5z9aJOxPDK0MqNrYR/8dq9FFO8ri4fkvQn9iIFdmyHPVoXPLr8qRRq5s6ftpp3wu PIU8GVplhEYnU3iGnPUYIgdLkkn+8pXvwbPAarKYUGCPIstgu/JcqCwx1aDjF9uxeLpn 2z80PmONjhmuPHp0o36IADnTs9I6mB2EsLUHn47xknrzGswxWRmfJXTJqIR7pHn6c2US gtRA== X-Gm-Message-State: AOAM531FCuzwTHCBnCxcq1et8yVOaIl/e8hOotwsXvvBwygd+VX/5QTq GjYTIzw2BEqFWMn7vT6hdCMVRLXcddepxL8lqSpOxOS3tG4= X-Google-Smtp-Source: ABdhPJxndz56Jo+G75YIIC/ePAu5KJPqiTHHCBkZ8zh14BKa731K765lEJbGxq0j7zrneyjMRBRW/QS2ElTn6vqUWN4= X-Received: by 2002:a05:6000:1565:: with SMTP id 5mr26203661wrz.109.1612878077323; Tue, 09 Feb 2021 05:41:17 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Tue, 9 Feb 2021 05:41:15 -0800 (PST) In-Reply-To: <8E61EA5C-39D1-49CC-8319-06E9192FF735@freebsd.org> References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> <8E61EA5C-39D1-49CC-8319-06E9192FF735@freebsd.org> From: Mateusz Guzik Date: Tue, 9 Feb 2021 14:41:15 +0100 Message-ID: Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly To: Jessica Clarke Cc: Kevin Bowling , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4DZkZ656HFz51t7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 13:41:18 -0000 On 2/9/21, Jessica Clarke wrote: >> On 8 Feb 2021, at 23:13, Kevin Bowling wrote: >> >> FreeBSD does not require pre-commit approval unless called out >> specifically. Are you volunteering to review the changes, and if so >> where is your guidance? These messages are otherwise unhelpful. > > It is not a hard requirement, but it is strongly encouraged. Section 7 > of the committer's guide says: > > =E2=80=A2 All non-trivial changes should be reviewed before they are > committed to the repository. > > This was a non-trivial change. I was particularly frustrated to see > this commit go in without review having previously called out mjg@ for > not getting any reviews for his (now reverted) previous strlen change. > There is a lot to say here and I don't know if I'll manage to make my points come across. First I'll address reviews in general and then I'll comment on strlen. The key is that reviews in this project notoriously fail to reduce/prevent breakage. I know this because several patches written by me which got accepted with little to no objection turned out to have problems which would have been found if review was better. I also know because I see the very same problem with reviews involving other people. Note I'm not talking about expecting reviews to guarantee bug-free commits. I'm talking about bugs one would expect a review to find, but did not. It got to the point where I put no stock in 'reviewed by'. Examples below. Ultimately what reduces/prevents breakage is testing and that's what I'm normally doing. Of course not all problems can be found in testing, so this boils down to making a call whether a review is warranted and what it can do to begin with. I do think a review is mandatory when making a non-cosmetic change to an area worked on by someone else. Similarly, if there are multiple people active somewhere, it's probably best to coordinate. Review may be a great idea if a design choice has to be made or certain people have expertise from the problem domain, even if they are not active somewhere. I don't believe the project has manpower to perform good quality code reviews of every single change. The developer has to make a judgment call whether the change warrants a review and sometimes they will make a mistake here, just like even a good review will sometimes fail to spot problems it otherwise would. I do believe shallow reviews allow people to dodge criticism for breakage -- after all, someone else accepted the change. Examples from recent past (all fixed): https://reviews.freebsd.org/D28091 Add -NODEBUG variant of GENERIC-MMCCAM kernel configuration. Some discussion, accepted by 2 people, has a typo in the kernel config breaking tinderbox https://reviews.freebsd.org/D28102 amd64: compare TLB shootdown target to all_cpus Nothing pointed out, accepted by 4 people, crashes on boot when the kernel is built with INVARIANTS. https://reviews.freebsd.org/D28284 elfctl: allow features to be specified by value Nothing pointed out, accepted by 1 person, has '!=3D' instead of '|=3D' breaking the change. https://reviews.freebsd.org/D28306 nfs client: block vnode_pager_setsize() calls from nfscl_loadattrcache in nfs_write There was a question about something but the patch got accepted, breaks writes by partially pushing garbage into files. https://reviews.freebsd.org/D27609 ndis(4): remove as previous announced Nothing pointed out, accepted by 1 person. Breaks the build in 2 ways and leaves leftovers (grep git log for ndis and you will see what I mean). Change like this is arguably to review, but bare minimum which could have been done is to ask if they built tinderbox and perhaps git grep -i ndis on your own. This in my experience is the standard. Which brings me to C strlen. Before committing my patch to the C variant I did the due diligence for little endian -- I have glibc test suite up and running, I have a small test program on my own and finally I ran several workloads on it. For big endian I only ran the small test program on ref13-ppc64 and called it a day. That was a failure to do the due diligence -- I should spent time to set up the test suite in that environment, but could not be arsed to do it. I should have also asked someone running the hardware to the code by just using it. Bad call on my end, a bug was reported and I promptly reverted the change. Would a review prevent the problem? That is plausible, but given track record indicated above, I would not count on it. More, if reviews were mandatory, I would expect their quality to go down even further, making them even less likely to prevent breakage. And now we reach this change. I did the due diligence in testing (glibc, my test jig, actual workloads). Because of this, while I can never claim the routine is bug free, I doubt bugs (if any) would be found in a review and this is why I did not ask for one. In contrast, here are examples from my TODO list where I do plan to get a review if I write a patch: - nofault/onfault so that C routines can handle interaction with userspace memory -- several decisions to make here - hot patching of sdt probes -- same as above - copyinstr using the mycroft trick -- possibly questionable hacks pop up That said, I do own to my mistake with C strlen (shallow testing for big endian) and I do stand behind not getting a review for this patch. I believe you have good intentions, but are simply suffering from confirmation bias. Perhaps the breakage introduced by me is something which popped up for you. If you want an example of something which is frustrating, I suggest you take a look at how often the build is broken and who keeps reporting or fixing it. >> On Mon, Feb 8, 2021 at 12:37 PM Jessica Clarke >> wrote: >>> >>> On 8 Feb 2021, at 19:15, Mateusz Guzik wrote: >>>> >>>> The branch main has been updated by mjg: >>>> >>>> URL: >>>> https://cgit.FreeBSD.org/src/commit/?id=3Daf366d353b84bdc4e730f0fc5638= 53abc338271c >>>> >>>> commit af366d353b84bdc4e730f0fc563853abc338271c >>>> Author: Mateusz Guzik >>>> AuthorDate: 2021-02-08 17:01:48 +0000 >>>> Commit: Mateusz Guzik >>>> CommitDate: 2021-02-08 19:15:21 +0000 >>>> >>>> amd64: implement strlen in assembly >>>> >>>> The C variant in libkern performs excessive branching to find the >>>> non-zero byte instead of using the bsfq instruction. The same code >>>> patched to use it is still slower than the routine implemented here >>>> as the compiler keeps neglecting to perform certain optimizations >>>> (like using leaq). >>>> >>>> On top of that the routine can is a starting point for copyinstr >>>> which operates on words instead of bytes. >>>> >>>> Tested with glibc test suite. >>>> >>>> Sample results (calls/s): >>>> >>>> Haswell: >>>> $(perl -e "print 'A' x 3"): >>>> stock: 211198039 >>>> patched:338626619 >>>> asm: 465609618 >>>> >>>> $(perl -e "print 'A' x 100"): >>>> stock: 83151997 >>>> patched: 98285919 >>>> asm: 120719888 >>>> >>>> AMD EPYC 7R32: >>>> $(perl -e "print 'A' x 3"): >>>> stock: 282523617 >>>> asm: 491498172 >>>> >>>> $(perl -e "print 'A' x 100"): >>>> stock: 114857172 >>>> asm: 112082057 >>> >>> No Reviewed by? More than one pair of eyes on non-trivial assembly is >>> almost always a good idea. >>> >>> Jess >>> >>> _______________________________________________ >>> dev-commits-src-main@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main >>> To unsubscribe, send any mail to >>> "dev-commits-src-main-unsubscribe@freebsd.org" > > --=20 Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Tue Feb 9 14:00:32 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1C41E53F876; Tue, 9 Feb 2021 14:00:32 +0000 (UTC) (envelope-from lwhsu@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZl0J0Cn0z53WL; Tue, 9 Feb 2021 14:00:32 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com [209.85.219.176]) (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: lwhsu/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id E9459F45; Tue, 9 Feb 2021 14:00:31 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: by mail-yb1-f176.google.com with SMTP id m76so18295103ybf.0; Tue, 09 Feb 2021 06:00:31 -0800 (PST) X-Gm-Message-State: AOAM5315UVtGCOgMxheC+h2MxeU2lPGO3T5eoat3hw3S0WUZq2ZEiz8W PVtdyCdbOdIpkVe6zP6xq5ENt55qrRMK6sBmsrk= X-Google-Smtp-Source: ABdhPJy64m/sfv8DGXj0jhmHeNy1r7e9twvHBFFNa6NzGz826nmfU9mwt2t3meGQyUj0XAq7V4rZlRroUHjcGFEMrWs= X-Received: by 2002:a25:ad84:: with SMTP id z4mr34297732ybi.127.1612879231467; Tue, 09 Feb 2021 06:00:31 -0800 (PST) MIME-Version: 1.0 References: <202102081915.118JFVS0067851@gitrepo.freebsd.org> In-Reply-To: <202102081915.118JFVS0067851@gitrepo.freebsd.org> From: Li-Wen Hsu Date: Tue, 9 Feb 2021 22:00:20 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 81e074d57dfc - main - libkern: use compiler builtins for strcpy, strcmp and strlen To: Mateusz Guzik Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 14:00:32 -0000 On Tue, Feb 9, 2021 at 3:15 AM Mateusz Guzik wrote: > > The branch main has been updated by mjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=81e074d57dfcd86f152e2848dc44b77087ee7a2d > > commit 81e074d57dfcd86f152e2848dc44b77087ee7a2d > Author: Mateusz Guzik > AuthorDate: 2021-02-07 19:50:25 +0000 > Commit: Mateusz Guzik > CommitDate: 2021-02-08 19:15:21 +0000 > > libkern: use compiler builtins for strcpy, strcmp and strlen > --- > sys/sys/libkern.h | 4 ++++ > 1 file changed, 4 insertions(+) Hi, I suspect this or other commits in: https://ci.freebsd.org/job/FreeBSD-main-amd64-test/17500/changes breaks this test: https://ci.freebsd.org/job/FreeBSD-main-amd64-test/17500/testReport/lib.libc.gen/setdomainname_test/setdomainname_basic/ Can you help check if the code or the test case needs to be fixed? Thanks, Li-Wen From owner-dev-commits-src-main@freebsd.org Tue Feb 9 14:53:49 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2B7AE540FE2; Tue, 9 Feb 2021 14:53:49 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZm9n0m66z56Dx; Tue, 9 Feb 2021 14:53:49 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1612882429; 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=3i2hmKIWaJq/RqLU4EInUg171v4y61U8XT30xW3QYZ4=; b=bm4bNuAeyhV+YmlQtKwIg6eOj+eVTN6UT4j9a0pi6LsPXlE19yfMTCePrX+wUCxtcdOpeD tlHYNrQAZgxue4JbVd8zQCDuthMDulka+gWDCX+0ZhxMk52OM63gR6/fj/y8X0q5HUfa5u MgQBltHBoJKvHrrIQb4BL+Lcd8n0U/HUKnMwF34PNYB8iEPrP4HHTSDVHgiW81xR1hOwbW Axqv4HKF635fdZCHbnt3wfjV2vY2/WYuzMCHKQELHRaXiiGAYVS3r6JTXryhWnCSo5E4Sa +EF6qrByrwmq7EuxhEI24U+Zh/WhCHH6scZQuFmAd5xyYTz4NGxBxdycC7c6EA== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 0BDDB181B2; Tue, 9 Feb 2021 14:53:49 +0000 (UTC) Date: Tue, 9 Feb 2021 14:53:48 +0000 From: Alexey Dokuchaev To: Mateusz Guzik Cc: Jessica Clarke , Kevin Bowling , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly Message-ID: <20210209145348.GA70871@FreeBSD.org> References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> <8E61EA5C-39D1-49CC-8319-06E9192FF735@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=1612882429; 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=3i2hmKIWaJq/RqLU4EInUg171v4y61U8XT30xW3QYZ4=; b=abQ6z3eTzwGFH8kIhys9P1E6rtj7vgkzsaPGvSm4lk2lNDp+yKpaspuKkKoez34u7Ee874 YP2XKgfdHuYgwFYbyisdCUfnVrtYm3v8T9O20Z7oIihsI8olYCRtgcGTv3Ncwesm7BxNoz tFPSk5xrx1medr4ViaJi7dZHWkIC202S5XclP6+MoNHdsD57ghfH29nudzAWhTny14I84J WM7MllrQchcTIdjh/rVr6RcTaB+nNmYUKacmeC9T/ooJyo43L8hJcXy668ltahhwAIfflD ibX5SLJDh50esU0vpc2hXo9vK8j6QxBGr6ZU1uJgqQFXOqx9gKWBXK3ij6U0SA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1612882429; a=rsa-sha256; cv=none; b=FV2DwyGN+51Do8Z3YFTt6oNw9J6Ymcl3n0qLbN4i3d5Cpx7u1vGwLoOKxL1aJSbs/wrCha 2TwGaUzF10jeLmYWhFJXpX7PtbzBeYG9qj7bw4ZGWOn0+fE86fxXkcQDaFH8TZlWOZYOXB 8Ftigv+1W2/Skmcp5KjdeavcpJx9eRnlnaUB7fq3l91Mms+VXvGB5T/m7eE/nPdLn3j6hS 9Gm7lMUJHXrJG+0gDLMB3eUYp3/TViHms8cKz7cqp9WBp9LWtnjK4lUv2A34NSBCX2E068 epX5rvJRiD76DAyHZpuv/ZCERaSHtHzu+3rqo5mPMlSxSszdfpTqGif48Tm8YA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 14:53:49 -0000 On Tue, Feb 09, 2021 at 02:41:15PM +0100, Mateusz Guzik wrote: > ... > More, if reviews were mandatory, I would expect their quality to go > down even further, making them even less likely to prevent breakage. Exactly that. In fact, the good reviews are typically coming from people who care. But those you'll get regardless of whether you've asked for them. ./danfe From owner-dev-commits-src-main@freebsd.org Tue Feb 9 15:28:07 2021 Return-Path: Delivered-To: dev-commits-src-main@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 661E5542921; Tue, 9 Feb 2021 15:28:07 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZmxM2QqYz58wq; Tue, 9 Feb 2021 15:28:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B763523B; Tue, 9 Feb 2021 15:28:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119FS72K048234; Tue, 9 Feb 2021 15:28:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119FS7uZ048233; Tue, 9 Feb 2021 15:28:07 GMT (envelope-from git) Date: Tue, 9 Feb 2021 15:28:07 GMT Message-Id: <202102091528.119FS7uZ048233@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: b49a0db6628e - main - Revert "amd64: implement strlen in assembly" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b49a0db6628e6f953504ebc8712ed582471ccd05 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 15:28:07 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b49a0db6628e6f953504ebc8712ed582471ccd05 commit b49a0db6628e6f953504ebc8712ed582471ccd05 Author: Mateusz Guzik AuthorDate: 2021-02-09 15:18:58 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-09 15:23:18 +0000 Revert "amd64: implement strlen in assembly" This reverts commit af366d353b84bdc4e730f0fc563853abc338271c. Trips over '\xa4' byte and terminates early, as found in lib/libc/gen/setdomainname_test:setdomainname_basic testcase However, keep moving libkern/strlen.c out of conf/files. Reported by: lwhsu --- sys/amd64/amd64/support.S | 66 ----------------------------------------------- sys/conf/files.amd64 | 1 + 2 files changed, 1 insertion(+), 66 deletions(-) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index a059b520c5d5..b623fba277db 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -697,72 +697,6 @@ ENTRY(fillw) ret END(fillw) -/* - * strlen(string) - * %rdi - * - * Uses the ((x - 0x01....01) & ~x & 0x80....80) trick. - * - * 0x01....01 is replaced with 0x0 - 0x01....01 so that it can be added - * with leaq. - * - * For a description see either: - * - "Hacker's Delight" by Henry S. Warren, Jr. - * - "Optimizing subroutines in assembly language: An optimization guide for x86 platforms" - * by Agner Fog - * - * The latter contains a 32-bit variant of the same algorithm coded in assembly for i386. - */ -ENTRY(strlen) - PUSH_FRAME_POINTER - movabsq $0xfefefefefefefeff,%r8 - movabsq $0x8080808080808080,%r9 - - movq %rdi,%r10 - movq %rdi,%rcx - testb $7,%dil - jz 2f - - /* - * Handle misaligned reads: align to 8 and fill - * the spurious bytes. - */ - andq $~7,%rdi - movq (%rdi),%r11 - shlq $3,%rcx - movq $-1,%rdx - shlq %cl,%rdx - notq %rdx - orq %rdx,%r11 - - leaq (%r11,%r8),%rcx - notq %r11 - andq %r11,%rcx - andq %r9,%rcx - jnz 3f - - /* - * Main loop. - */ - ALIGN_TEXT -1: - leaq 8(%rdi),%rdi -2: - movq (%rdi),%r11 - leaq (%r11,%r8),%rcx - notq %r11 - andq %rcx,%r11 - andq %r9,%rcx - jz 1b -3: - bsfq %rcx,%rcx - shrq $3,%rcx - leaq (%rcx,%rdi),%rax - subq %r10,%rax - POP_FRAME_POINTER - ret -END(strlen) - /*****************************************************************************/ /* copyout and fubyte family */ /*****************************************************************************/ diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 395f501198f8..98a78a8b1ef9 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -390,6 +390,7 @@ isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/imgact_aout.c optional compat_aout kern/link_elf_obj.c standard +libkern/strlen.c standard # # IA32 binary support # From owner-dev-commits-src-main@freebsd.org Tue Feb 9 15:37:49 2021 Return-Path: Delivered-To: dev-commits-src-main@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 E8289542ABF for ; Tue, 9 Feb 2021 15:37:49 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 4DZn8Y67cFz59Hm for ; Tue, 9 Feb 2021 15:37:49 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f54.google.com with SMTP id u14so22523056wri.3 for ; Tue, 09 Feb 2021 07:37:49 -0800 (PST) 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=CMzrgTJxYTrUIldxV+YXEi3NZcYR8RfRuSkkHU0HleM=; b=Ex9utGr18vtp3fmRpvM+V9DVdXDuabmL2wxOoZ270Oe8PfJ2zKk5zSofgQX3MFd6/K Sc2P29tky1iieLc/oYQ4WZhO2e7CnFC5CG833Fyu1bq70t5LCNWH2h6O11vsnc0m+18Z NZO6j6QdKnuN7RwEckFO6aGomwmHZDIaDCQR6HGFUH4/wamtrd67En6CF67LTc+2LfH6 fDvZp9a+De+yhbA3ylU7OV97e2eUyzuUMup0QRAEFNZSxQYhZm0PMo/Hfu66UDV2fTn1 RQebhBe9fdyNGkjJa6kfqCCzea5ZtBW/+EERZncCcUiE2n4IFHsBvXtbsW/0x83jr/F7 BVXQ== X-Gm-Message-State: AOAM530nlVPI1J40+G3QAiv23y2w46PIsjF2jqlqJp1YPBpr3ArmQd48 6koe5dyhzEGnFYi9DBbBnJbyvQ== X-Google-Smtp-Source: ABdhPJx/onBcoEW9EnKGbUyBB6edf1fGwvih1l25GCAbzoH9lwsFnUwLHl+T2mNWfp9yj0vYap1Sww== X-Received: by 2002:a05:6000:1547:: with SMTP id 7mr26418879wry.301.1612885068384; Tue, 09 Feb 2021 07:37:48 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id p17sm4156885wmq.18.2021.02.09.07.37.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Feb 2021 07:37:47 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly From: Jessica Clarke In-Reply-To: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> Date: Tue, 9 Feb 2021 15:37:46 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: 7bit Message-Id: <83E33E2F-F7FE-4385-8F99-0A7235F87C63@freebsd.org> References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DZn8Y67cFz59Hm X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 15:37:50 -0000 Here's your review after reading through it for <5 minutes today: On 8 Feb 2021, at 19:15, Mateusz Guzik wrote: > + leaq (%r11,%r8),%rcx > + notq %r11 > + andq %r11,%rcx > + andq %r9,%rcx > ... > + leaq (%r11,%r8),%rcx > + notq %r11 > + andq %rcx,%r11 These look the wrong way round (but you got it the right way round above). > + andq %r9,%rcx Jess From owner-dev-commits-src-main@freebsd.org Tue Feb 9 15:49:31 2021 Return-Path: Delivered-To: dev-commits-src-main@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 69141542E4C; Tue, 9 Feb 2021 15:49:31 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (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 4DZnQ326Xhz3CWD; Tue, 9 Feb 2021 15:49:31 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x433.google.com with SMTP id n6so9703195wrv.8; Tue, 09 Feb 2021 07:49:30 -0800 (PST) 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=DO/xrr/FDDW+KvbXc9O4rn6h9X/VxjxustXOllagqQ4=; b=sVB4NbtMgGtQCEir8obC9yXMMe1xNw3ayV7ZFmE/73XaxLRcocHen7n7SS4EuMYoE4 lAYwm3Sim3yLkPmLJnhsY9kN8obbQpIOMGBylgfNUYPyhidRBunSJVVmf/YU/j3E7NsR HUMULrbQn6XBgg05EGIpGRqcLV5KJLWJJHMI1B2mCLJmkSVYAs9evQdHtOBnmw3S4U3O gpZuhd7gHiGlXC5q1JBnyZzj+7/XPjw27YdqTmicBVae0xTUQowB47eUwhNZoFTBdHGA oqdWi4EYt3XbZlR1hXie8v1iia4/fnkFivrg9PJH3G82WHq1zMjJLhzXAeVf6gIp8dlK A7mg== 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=DO/xrr/FDDW+KvbXc9O4rn6h9X/VxjxustXOllagqQ4=; b=Zio4TsDimngHpEX3xFVoEG8tAXEZMW2hOYsiSQfIEXKbXyIpzMbllldCXlsq/ehlFN 4ljq7k7d37LniqNi1Pvw1I8pxsSjmKIfcE42Gz87sz280cSV/5T+S1VEE97QlR6k/+bM C65hVLogU4Lpie+BygtG77eS7E/5gWiqPMoYxjKjfa29AUeP4fZ6i4wpSPtN9m1VxGz4 aTSbXZoN7z1u00tHo+VlxWPU1Q78M4ge0asDxKwL7Xe9kD8ISwCtjElEGY3IxQgdN80B SA0BKKQe+VHyB7+F7JzfsyCEiBHR/bmrDBSpafnB0vEDls25WBbHsFF2phvXPRyfM/8C 7MpQ== X-Gm-Message-State: AOAM530qAUNYBgN/M9tGwFrUWWm2sR1K4JhylN1XUtrnOQixyFzcYjDu JGt/B8/nOOYtPr9LI7ufjke/wpUKUqrq9YiaYtOHpc7HGn4= X-Google-Smtp-Source: ABdhPJwAckRthV9kB61m+7DAHR+wABUhIqlUtb52fEeKHeu8tpUxlmlvLyLeajtNcw2SXAmsOE2dCN3QcydxxOJOsr4= X-Received: by 2002:a5d:5248:: with SMTP id k8mr2983563wrc.17.1612885769930; Tue, 09 Feb 2021 07:49:29 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Tue, 9 Feb 2021 07:49:28 -0800 (PST) In-Reply-To: <83E33E2F-F7FE-4385-8F99-0A7235F87C63@freebsd.org> References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <83E33E2F-F7FE-4385-8F99-0A7235F87C63@freebsd.org> From: Mateusz Guzik Date: Tue, 9 Feb 2021 16:49:28 +0100 Message-ID: Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DZnQ326Xhz3CWD X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 15:49:31 -0000 On 2/9/21, Jessica Clarke wrote: > Here's your review after reading through it for <5 minutes today: > > On 8 Feb 2021, at 19:15, Mateusz Guzik wrote: >> + leaq (%r11,%r8),%rcx >> + notq %r11 >> + andq %r11,%rcx >> + andq %r9,%rcx >> ... >> + leaq (%r11,%r8),%rcx >> + notq %r11 >> + andq %rcx,%r11 > > These look the wrong way round (but you got it the right way round > above). > Indeed, solid brainfart. Interesting this still passed the test suite. Thank you for noting this. However, your response does not really address any of the points I raised in my e-mail. >> + andq %r9,%rcx > > Jess > > -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Tue Feb 9 16:12:59 2021 Return-Path: Delivered-To: dev-commits-src-main@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 18D675439DA; Tue, 9 Feb 2021 16:12:59 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZnx7096Dz3F7h; Tue, 9 Feb 2021 16:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECBDA5E8C; Tue, 9 Feb 2021 16:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119GCwYK012522; Tue, 9 Feb 2021 16:12:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119GCwvB012521; Tue, 9 Feb 2021 16:12:58 GMT (envelope-from git) Date: Tue, 9 Feb 2021 16:12:58 GMT Message-Id: <202102091612.119GCwvB012521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 39e0c3f68638 - main - cache: assorted comment fixups MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39e0c3f686387605591f8f646ceec53613619525 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 16:12:59 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=39e0c3f686387605591f8f646ceec53613619525 commit 39e0c3f686387605591f8f646ceec53613619525 Author: Mateusz Guzik AuthorDate: 2021-02-09 16:06:27 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-09 16:09:44 +0000 cache: assorted comment fixups --- sys/kern/vfs_cache.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 21eb436681fc..fef1e31d197b 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -5268,6 +5268,10 @@ cache_fplookup_parse(struct cache_fpl *fpl) cache_fpl_pathlen_sub(fpl, cnp->cn_namelen); #ifdef INVARIANTS + /* + * cache_get_hash only accepts lengths up to NAME_MAX. This is fine since + * we are going to fail this lookup with ENAMETOOLONG (see below). + */ if (cnp->cn_namelen <= NAME_MAX) { if (fpl->hash != cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp)) { panic("%s: mismatched hash for [%s] len %ld", __func__, @@ -5359,7 +5363,7 @@ cache_fplookup_skip_slashes(struct cache_fpl *fpl) * manner relying on an invariant that a non-directory vnode will get a miss. * In this case cn_nameptr[0] == '\0' and cn_namelen == 0. * - * Thus for a path like "foo/bar/" the code unwinds the state back to 'bar/' + * Thus for a path like "foo/bar/" the code unwinds the state back to "bar/" * and denotes this is the last path component, which avoids looping back. * * Only plain lookups are supported for now to restrict corner cases to handle. @@ -5454,14 +5458,14 @@ cache_fplookup_trailingslash(struct cache_fpl *fpl) #endif /* - * The previous directory is this one. + * If this was a "./" lookup the parent directory is already correct. */ if (cnp->cn_nameptr[0] == '.' && cnp->cn_namelen == 1) { return (0); } /* - * The previous directory is something else. + * Otherwise we need to look it up. */ tvp = fpl->tvp; ncp = atomic_load_consume_ptr(&tvp->v_cache_dd); @@ -5495,10 +5499,11 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) dvp_seqc = fpl->dvp_seqc; /* - * TODO: Due to ignoring slashes lookup will perform a permission check - * on the last dir when it should not have. If it fails, we get here. - * It is possible possible to fix it up fully without resorting to - * regular lookup, but for now just abort. + * TODO: Due to ignoring trailing slashes lookup will perform a + * permission check on the last dir when it should not be doing it. It + * may fail, but said failure should be ignored. It is possible to fix + * it up fully without resorting to regular lookup, but for now just + * abort. */ if (cache_fpl_istrailingslash(fpl)) { return (cache_fpl_aborted(fpl)); From owner-dev-commits-src-main@freebsd.org Tue Feb 9 17:15:21 2021 Return-Path: Delivered-To: dev-commits-src-main@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 CBA935450BA; Tue, 9 Feb 2021 17:15:21 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZqK55BMHz3J1Z; Tue, 9 Feb 2021 17:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0EBE6927; Tue, 9 Feb 2021 17:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119HFLpL091190; Tue, 9 Feb 2021 17:15:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119HFL3w091189; Tue, 9 Feb 2021 17:15:21 GMT (envelope-from git) Date: Tue, 9 Feb 2021 17:15:21 GMT Message-Id: <202102091715.119HFL3w091189@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 81c3f64110bb - main - usr.bin/grep: Fix Address OOB read error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81c3f64110bb76e24d6062eafd7206c10f676d6f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 17:15:21 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=81c3f64110bb76e24d6062eafd7206c10f676d6f commit 81c3f64110bb76e24d6062eafd7206c10f676d6f Author: Alex Richardson AuthorDate: 2021-01-19 11:35:07 +0000 Commit: Alex Richardson CommitDate: 2021-02-09 17:13:32 +0000 usr.bin/grep: Fix Address OOB read error I found this when compiling all the bootstrap tools with -fsanitize=addres: ==65590==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62d000008400 at pc 0x000000473053 bp 0x7ffc1c7dd910 sp 0x7ffc1c7dd0b8 READ of size 32769 at 0x62d000008400 thread T0 #0 0x473052 in regexec (/local/scratch/alr48/cheri/build/freebsd-amd64-build/local/scratch/alr48/cheri/freebsd/amd64.amd64/tmp/legacy/bin/grep+0x473052) #1 0x4c9cf3 in procline /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c:539:8 #2 0x4c8687 in procfile /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c:379:18 #3 0x4c6596 in main /local/scratch/alr48/cheri/freebsd/usr.bin/grep/grep.c:714:8 0x62d000008400 is located 0 bytes to the right of 32768-byte region [0x62d000000400,0x62d000008400) allocated by thread T0 here: #0 0x493d5d in malloc (/local/scratch/alr48/cheri/build/freebsd-amd64-build/local/scratch/alr48/cheri/freebsd/amd64.amd64/tmp/legacy/bin/grep+0x493d5d) #1 0x4cad75 in grep_malloc /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c:656:13 #2 0x4c8129 in procfile /local/scratch/alr48/cheri/freebsd/usr.bin/grep/util.c #3 0x4c6596 in main /local/scratch/alr48/cheri/freebsd/usr.bin/grep/grep.c:714:8 SUMMARY: AddressSanitizer: heap-buffer-overflow (/local/scratch/alr48/cheri/build/freebsd-amd64-build/local/scratch/alr48/cheri/freebsd/amd64.amd64/tmp/legacy/bin/grep+0x473052) in regexec Reviewed By: kevans MFC after: 1 week --- usr.bin/grep/file.c | 11 +++++++---- usr.bin/grep/queue.c | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/usr.bin/grep/file.c b/usr.bin/grep/file.c index 3d86bef010e5..8577572c2887 100644 --- a/usr.bin/grep/file.c +++ b/usr.bin/grep/file.c @@ -98,7 +98,6 @@ char * grep_fgetln(struct file *f, struct parsec *pc) { char *p; - char *ret; size_t len; size_t off; ptrdiff_t diff; @@ -116,12 +115,15 @@ grep_fgetln(struct file *f, struct parsec *pc) /* Look for a newline in the remaining part of the buffer */ if ((p = memchr(bufpos, fileeol, bufrem)) != NULL) { ++p; /* advance over newline */ - ret = bufpos; len = p - bufpos; + if (grep_lnbufgrow(len + 1)) + goto error; + memcpy(lnbuf, bufpos, len); bufrem -= len; bufpos = p; pc->ln.len = len; - return (ret); + lnbuf[len] = '\0'; + return (lnbuf); } /* We have to copy the current buffered data to the line buffer */ @@ -148,7 +150,7 @@ grep_fgetln(struct file *f, struct parsec *pc) ++p; diff = p - bufpos; len += diff; - if (grep_lnbufgrow(len)) + if (grep_lnbufgrow(len + 1)) goto error; memcpy(lnbuf + off, bufpos, diff); bufrem -= diff; @@ -156,6 +158,7 @@ grep_fgetln(struct file *f, struct parsec *pc) break; } pc->ln.len = len; + lnbuf[len] = '\0'; return (lnbuf); error: diff --git a/usr.bin/grep/queue.c b/usr.bin/grep/queue.c index ac15185f0694..9babdbf74af8 100644 --- a/usr.bin/grep/queue.c +++ b/usr.bin/grep/queue.c @@ -95,12 +95,14 @@ enqueue(struct str *x) rotated = true; free(item->dat); } - item->dat = grep_malloc(sizeof(char) * x->len); + /* len + 1 for NUL-terminator */ + item->dat = grep_malloc(sizeof(char) * x->len + 1); item->len = x->len; item->line_no = x->line_no; item->boff = x->boff; item->off = x->off; memcpy(item->dat, x->dat, x->len); + item->dat[x->len] = '\0'; item->file = x->file; return (rotated); From owner-dev-commits-src-main@freebsd.org Tue Feb 9 17:34:10 2021 Return-Path: Delivered-To: dev-commits-src-main@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 120F9545B91; Tue, 9 Feb 2021 17:34:10 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZqkp04Txz3L3w; Tue, 9 Feb 2021 17:34:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E95926DB3; Tue, 9 Feb 2021 17:34:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119HY9gh017703; Tue, 9 Feb 2021 17:34:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119HY9iD017702; Tue, 9 Feb 2021 17:34:09 GMT (envelope-from git) Date: Tue, 9 Feb 2021 17:34:09 GMT Message-Id: <202102091734.119HY9iD017702@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: e9d419a05357 - main - Set file mode during zfs_write MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e9d419a05357036ea2fd37218d853d2c713d55cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 17:34:10 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=e9d419a05357036ea2fd37218d853d2c713d55cc commit e9d419a05357036ea2fd37218d853d2c713d55cc Author: Antonio Russo AuthorDate: 2021-02-08 17:15:05 +0000 Commit: Ryan Moeller CommitDate: 2021-02-09 17:30:06 +0000 Set file mode during zfs_write Apply https://github.com/openzfs/zfs/pull/11576 Direct commit from upstream openzfs. Full commit message below: Set file mode during zfs_write 3d40b65 refactored zfs_vnops.c, which shared much code verbatim between Linux and BSD. After a successful write, the suid/sgid bits are reset, and the mode to be written is stored in newmode. On Linux, this was propagated to both the in-memory inode and znode, which is then updated with sa_update. 3d40b65 accidentally removed the initialization of newmode, which happened to occur on the same line as the inode update (which has been moved out of the function). The uninitialized newmode can be saved to disk, leading to a crash on stat() of that file, in addition to a merely incorrect file mode. Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Signed-off-by: Antonio Russo Closes #11474 Closes #11576 Obtained from: openzfs/zfs@f8ce8aed0 MFC after: 0 days Sponsored by: iXsystems, Inc. --- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/contrib/openzfs/module/zfs/zfs_vnops.c b/sys/contrib/openzfs/module/zfs/zfs_vnops.c index 3b7c52b8dd34..2dcc231b30b6 100644 --- a/sys/contrib/openzfs/module/zfs/zfs_vnops.c +++ b/sys/contrib/openzfs/module/zfs/zfs_vnops.c @@ -620,6 +620,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr) ((zp->z_mode & S_ISUID) != 0 && uid == 0)) != 0) { uint64_t newmode; zp->z_mode &= ~(S_ISUID | S_ISGID); + newmode = zp->z_mode; (void) sa_update(zp->z_sa_hdl, SA_ZPL_MODE(zfsvfs), (void *)&newmode, sizeof (uint64_t), tx); } From owner-dev-commits-src-main@freebsd.org Tue Feb 9 18:34:33 2021 Return-Path: Delivered-To: dev-commits-src-main@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 396AC546FFE; Tue, 9 Feb 2021 18:34:33 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZs4T19Npz3Q5V; Tue, 9 Feb 2021 18:34:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AF987BEA; Tue, 9 Feb 2021 18:34:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119IYX4O095757; Tue, 9 Feb 2021 18:34:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119IYX7N095756; Tue, 9 Feb 2021 18:34:33 GMT (envelope-from git) Date: Tue, 9 Feb 2021 18:34:33 GMT Message-Id: <202102091834.119IYX7N095756@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: ccf4cd2e7830 - main - netgraph/ng_bridge: Merge internal structures MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ccf4cd2e7830394467d5f6cf546ab453f9657b69 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 18:34:33 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=ccf4cd2e7830394467d5f6cf546ab453f9657b69 commit ccf4cd2e7830394467d5f6cf546ab453f9657b69 Author: Lutz Donnerhacke AuthorDate: 2021-02-08 21:36:46 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-09 18:29:27 +0000 netgraph/ng_bridge: Merge internal structures In a earlier version of ng_bridge(4) the exernal visible host entry structure was a strict subset of the internal one. So internal view was a direct annotation of the external structure. This strict inheritance was lost many versions ago. There is no need to encapsulate a part of the internal represntation as a separate structure. This patch is a preparation to make the internal structure read only in the data path in order to make ng_bridge(4) multithreaded. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28545 --- sys/netgraph/ng_bridge.c | 85 +++++++++++++++++++++++++----------------------- sys/netgraph/ng_bridge.h | 7 ---- 2 files changed, 44 insertions(+), 48 deletions(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index d5b3b520a497..6e3f993d591b 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -134,13 +134,16 @@ typedef struct ng_bridge_private *priv_p; typedef struct ng_bridge_private const *priv_cp; /* read only access */ /* Information about a host, stored in a hash table entry */ -struct ng_bridge_hent { - struct ng_bridge_host host; /* actual host info */ - SLIST_ENTRY(ng_bridge_hent) next; /* next entry in bucket */ +struct ng_bridge_host { + u_char addr[6]; /* ethernet address */ + link_p link; /* link where addr can be found */ + u_int16_t age; /* seconds ago entry was created */ + u_int16_t staleness; /* seconds ago host last heard from */ + SLIST_ENTRY(ng_bridge_host) next; /* next entry in bucket */ }; /* Hash table bucket declaration */ -SLIST_HEAD(ng_bridge_bucket, ng_bridge_hent); +SLIST_HEAD(ng_bridge_bucket, ng_bridge_host); /* Netgraph node methods */ static ng_constructor_t ng_bridge_constructor; @@ -567,7 +570,7 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) case NGM_BRIDGE_GET_TABLE: { struct ng_bridge_host_ary *ary; - struct ng_bridge_hent *hent; + struct ng_bridge_host *host; int i = 0, bucket; NG_MKRESPONSE(resp, msg, sizeof(*ary) @@ -579,14 +582,14 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) ary = (struct ng_bridge_host_ary *)resp->data; ary->numHosts = priv->numHosts; for (bucket = 0; bucket < priv->numBuckets; bucket++) { - SLIST_FOREACH(hent, &priv->tab[bucket], next) { + SLIST_FOREACH(host, &priv->tab[bucket], next) { memcpy(ary->hosts[i].addr, - hent->host.addr, + host->addr, sizeof(ary->hosts[i].addr)); - ary->hosts[i].age = hent->host.age; - ary->hosts[i].staleness = hent->host.staleness; + ary->hosts[i].age = host->age; + ary->hosts[i].staleness = host->staleness; strncpy(ary->hosts[i].hook, - NG_HOOK_NAME(hent->host.link->hook), + NG_HOOK_NAME(host->link->hook), sizeof(ary->hosts[i].hook)); i++; } @@ -925,11 +928,11 @@ static struct ng_bridge_host * ng_bridge_get(priv_cp priv, const u_char *addr) { const int bucket = HASH(addr, priv->hashMask); - struct ng_bridge_hent *hent; + struct ng_bridge_host *host; - SLIST_FOREACH(hent, &priv->tab[bucket], next) { - if (ETHER_EQUAL(hent->host.addr, addr)) - return (&hent->host); + SLIST_FOREACH(host, &priv->tab[bucket], next) { + if (ETHER_EQUAL(host->addr, addr)) + return (host); } return (NULL); } @@ -943,27 +946,27 @@ static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link) { const int bucket = HASH(addr, priv->hashMask); - struct ng_bridge_hent *hent; + struct ng_bridge_host *host; #ifdef INVARIANTS /* Assert that entry does not already exist in hashtable */ - SLIST_FOREACH(hent, &priv->tab[bucket], next) { - KASSERT(!ETHER_EQUAL(hent->host.addr, addr), + SLIST_FOREACH(host, &priv->tab[bucket], next) { + KASSERT(!ETHER_EQUAL(host->addr, addr), ("%s: entry %6D exists in table", __func__, addr, ":")); } #endif /* Allocate and initialize new hashtable entry */ - hent = malloc(sizeof(*hent), M_NETGRAPH_BRIDGE, M_NOWAIT); - if (hent == NULL) + host = malloc(sizeof(*host), M_NETGRAPH_BRIDGE, M_NOWAIT); + if (host == NULL) return (0); - bcopy(addr, hent->host.addr, ETHER_ADDR_LEN); - hent->host.link = link; - hent->host.staleness = 0; - hent->host.age = 0; + bcopy(addr, host->addr, ETHER_ADDR_LEN); + host->link = link; + host->staleness = 0; + host->age = 0; /* Add new element to hash bucket */ - SLIST_INSERT_HEAD(&priv->tab[bucket], hent, next); + SLIST_INSERT_HEAD(&priv->tab[bucket], host, next); priv->numHosts++; /* Resize table if necessary */ @@ -1008,12 +1011,12 @@ ng_bridge_rehash(priv_p priv) struct ng_bridge_bucket *const oldList = &priv->tab[oldBucket]; while (!SLIST_EMPTY(oldList)) { - struct ng_bridge_hent *const hent + struct ng_bridge_host *const host = SLIST_FIRST(oldList); SLIST_REMOVE_HEAD(oldList, next); - newBucket = HASH(hent->host.addr, newMask); - SLIST_INSERT_HEAD(&newTab[newBucket], hent, next); + newBucket = HASH(host->addr, newMask); + SLIST_INSERT_HEAD(&newTab[newBucket], host, next); } } @@ -1044,17 +1047,17 @@ ng_bridge_remove_hosts(priv_p priv, link_p link) int bucket; for (bucket = 0; bucket < priv->numBuckets; bucket++) { - struct ng_bridge_hent **hptr = &SLIST_FIRST(&priv->tab[bucket]); + struct ng_bridge_host **hptr = &SLIST_FIRST(&priv->tab[bucket]); while (*hptr != NULL) { - struct ng_bridge_hent *const hent = *hptr; + struct ng_bridge_host *const host = *hptr; - if (link == NULL || hent->host.link == link) { - *hptr = SLIST_NEXT(hent, next); - free(hent, M_NETGRAPH_BRIDGE); + if (link == NULL || host->link == link) { + *hptr = SLIST_NEXT(host, next); + free(host, M_NETGRAPH_BRIDGE); priv->numHosts--; } else - hptr = &SLIST_NEXT(hent, next); + hptr = &SLIST_NEXT(host, next); } } } @@ -1095,20 +1098,20 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2) /* Update host time counters and remove stale entries */ for (bucket = 0; bucket < priv->numBuckets; bucket++) { - struct ng_bridge_hent **hptr = &SLIST_FIRST(&priv->tab[bucket]); + struct ng_bridge_host **hptr = &SLIST_FIRST(&priv->tab[bucket]); while (*hptr != NULL) { - struct ng_bridge_hent *const hent = *hptr; + struct ng_bridge_host *const host = *hptr; /* Remove hosts we haven't heard from in a while */ - if (++hent->host.staleness >= priv->conf.maxStaleness) { - *hptr = SLIST_NEXT(hent, next); - free(hent, M_NETGRAPH_BRIDGE); + if (++host->staleness >= priv->conf.maxStaleness) { + *hptr = SLIST_NEXT(host, next); + free(host, M_NETGRAPH_BRIDGE); priv->numHosts--; } else { - if (hent->host.age < 0xffff) - hent->host.age++; - hptr = &SLIST_NEXT(hent, next); + if (host->age < 0xffff) + host->age++; + hptr = &SLIST_NEXT(host, next); counter++; } } diff --git a/sys/netgraph/ng_bridge.h b/sys/netgraph/ng_bridge.h index f4771cc401d4..03541deceacd 100644 --- a/sys/netgraph/ng_bridge.h +++ b/sys/netgraph/ng_bridge.h @@ -109,13 +109,6 @@ struct ng_bridge_link_stats { struct ng_bridge_link; typedef struct ng_bridge_link *link_p; -/* Structure describing a single host */ -struct ng_bridge_host { - u_char addr[6]; /* ethernet address */ - link_p link; /* link where addr can be found */ - u_int16_t age; /* seconds ago entry was created */ - u_int16_t staleness; /* seconds ago host last heard from */ -}; /* external representation of the host */ struct ng_bridge_hostent { From owner-dev-commits-src-main@freebsd.org Tue Feb 9 18:46:05 2021 Return-Path: Delivered-To: dev-commits-src-main@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 20D09547445; Tue, 9 Feb 2021 18:46:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) (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 4DZsKn08frz3QRy; Tue, 9 Feb 2021 18:46:04 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f173.google.com with SMTP id q5so17042970ilc.10; Tue, 09 Feb 2021 10:46:04 -0800 (PST) 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=JgadIckbR1xbVO2/hbazlRYqcIbzG2YUnVP0/xZ1qOU=; b=mDy4TSpgH/KuAxp5L1uj8tW62XOwGyGuRmptVYu/I3EIBrD92HtAYlDepYzDc7eTQj mxazAgAHmHa1xpR6nfmUgZ9x+KVZoOIdHyA+i47kuOH/Qnkp3wr9HsECedEqXyTav3MY xfX72h9QqCthtvbEBCWDTVbIXRcmpS7P1nYgaHWay6ANyRKsdXdfNn8ONLKcQiYPNQpr +EDZfzw4M3UPeJhr76L1mSiYhii+RKn4AauY4xryfHL8KH2lQic0Sp5sPDvRGzW4OTIU qVdIrRYLzaWNxBF2opoGTs5x+LF1IDEhbWtY+HSYeedB2BQ7i9hFE5GMi7oHR84bN4g9 tvsQ== X-Gm-Message-State: AOAM533Hq7IPyHHWmhT5D0B6y6Wq5rkGYVGcjVtHsV26UbGVcs/ORUHb 6vOZGaJYNJOZSzIIOlxIJRNXFsDIeUWJr2z2xfs= X-Google-Smtp-Source: ABdhPJx4ckHewkwtFzVEMnTljshhjrUGJYEVabledpBhsI+6Rgj2akmBtamIYZ6fQrhukMdK+KKWH+9TuntDub1ymw8= X-Received: by 2002:a05:6e02:4cc:: with SMTP id f12mr21800495ils.182.1612896364070; Tue, 09 Feb 2021 10:46:04 -0800 (PST) MIME-Version: 1.0 References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> <8E61EA5C-39D1-49CC-8319-06E9192FF735@freebsd.org> In-Reply-To: From: Ed Maste Date: Tue, 9 Feb 2021 13:45:40 -0500 Message-ID: Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly To: Mateusz Guzik Cc: Jessica Clarke , Kevin Bowling , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DZsKn08frz3QRy X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 18:46:05 -0000 On Tue, 9 Feb 2021 at 08:41, Mateusz Guzik wrote: > > Examples from recent past (all fixed): I don't think the examples are all good ones - several are failures of our tooling, not of code review. The limited review effort we have shouldn't be spent pointing out style(9) violations or build-breaking typos - our CI should be doing this. Reviewers should be able to expect that a patch builds and boots, and that it is sufficiently compliant with coding style, etc. I agree there's little value in putting changes into review solely because it's some sort of checklist item. That said, several of the reviews you identified had value in refining the change prior to commit, even if an issue escaped. > Would a review prevent the problem? That is plausible, but given track > record indicated above, I would not count on it. It wouldn't guarantee it, but the review could serve as a rendezvous point for testing - one of the examples even demonstrates that use. Of course we'd still need to get someone with an interest in the associated platform(s) to test, regardless of where/how the patch is conveyed. > And now we reach this change. > > I did the due diligence in testing (glibc, my test jig, actual > workloads). Because of this, while I can never claim the routine is > bug free, I doubt bugs (if any) would be found in a review and this is > why I did not ask for one. IMO back to (missing) tooling - eventually pre-commit CI build/test (whether integrated into Phabricator or elsewhere) should find these sorts of issues. From owner-dev-commits-src-main@freebsd.org Tue Feb 9 19:25:28 2021 Return-Path: Delivered-To: dev-commits-src-main@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 3DF005286EE; Tue, 9 Feb 2021 19:25:28 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZtCD1JkKz3jXn; Tue, 9 Feb 2021 19:25:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F81C1073B; Tue, 9 Feb 2021 19:25:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119JPSnC062760; Tue, 9 Feb 2021 19:25:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119JPSho062759; Tue, 9 Feb 2021 19:25:28 GMT (envelope-from git) Date: Tue, 9 Feb 2021 19:25:28 GMT Message-Id: <202102091925.119JPSho062759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 011b7317dbb5 - main - netgraph/ng_bridge: Document staleness in multithreaded operation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 011b7317dbb5038a95b9b4fca050325a62f3991e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 19:25:28 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=011b7317dbb5038a95b9b4fca050325a62f3991e commit 011b7317dbb5038a95b9b4fca050325a62f3991e Author: Lutz Donnerhacke AuthorDate: 2021-02-09 11:32:46 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-09 19:09:05 +0000 netgraph/ng_bridge: Document staleness in multithreaded operation In the data path of ng_bridge(4), the only value of the host struct, which needs to be modified, is the staleness, which is reset every time a frame is received. It's save to leave the code as it is. This patch is part of a series to make ng_bridge(4) multithreaded. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28546 --- sys/netgraph/ng_bridge.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 6e3f993d591b..29ab2c715aa7 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -739,7 +739,10 @@ ng_bridge_rcvdata(hook_p hook, item_p item) /* Look up packet's source Ethernet address in hashtable */ if ((host = ng_bridge_get(priv, eh->ether_shost)) != NULL) { - /* Update time since last heard from this host */ + /* Update time since last heard from this host. + * This is safe without locking, because it's + * the only operation during shared access. + */ host->staleness = 0; /* Did host jump to a different link? */ From owner-dev-commits-src-main@freebsd.org Tue Feb 9 19:42:42 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0DBCE5290DE; Tue, 9 Feb 2021 19:42:42 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 4DZtb56KZtz3kt0; Tue, 9 Feb 2021 19:42:41 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x435.google.com with SMTP id z6so23440206wrq.10; Tue, 09 Feb 2021 11:42:41 -0800 (PST) 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=t4FaPt3ikaJ/gM21Q+TwStAk47VKDCpSF3wXu9Bybrk=; b=TjENia3br3D61iMSURVtUzkr7INbAejDR1E7cqY/ID50+tyx4czvEUMf7JjZcV59Ny flrxQwc8SQJwMaB2Bz1wlmZW25IcSnAEg5jLnk1ORArcQnHfh1Crm6wqoOepT9xLGEDa UUvinMGT7/xlLocVgVacFU8HkZaQm2VqQb596IVyPZHkOIDO55reBephyJU3+rD43vh6 Mgi8B+iOrESxnoIzvIAFqp+qzddlPRTDf/VMnYnv/7IpHH16kuF+yjHUAvgBiFW3/eIw +L/LaRgkGqqj6OHjAGlhIO+57s7laho2lMesV0PAbsnrvl7aTKPEck7uLhuzDjQhqNip LV4A== 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=t4FaPt3ikaJ/gM21Q+TwStAk47VKDCpSF3wXu9Bybrk=; b=KsvZaUgHpTAkKbH50Mb+MaTIX/+ExrTXea9V8/OB9SGVPJRZ2jZ2zruRYJk5W+gTLK UgZ2Fyr2aGFkE/MOnPkbdooelPASy40FN1XozROwrWvqvrL81SplgrlNYd/JSXJSQY1/ xB94VpZo+TQum0GEFbZrCTYQzJYHtEIYItHYcZB/5jsrZ8UO+mABzBy4n7fGZwGpnqik ZIf/Il8IpBka7nGhzufz8xR00ttmZb1AtdqRbp4Q4gsEeTT0cbYTf7g7OfK0LU0WeO0x bc2bbYS/PKFDY0seJW/QDCavqd4+Lt9umAy7qvH1mfU+VBCmt1OLo93SBlFRFfdIswCU 6Q8w== X-Gm-Message-State: AOAM533jRorysHY9VIX1wlnTAn6GAYbM/zusocL2qQAObpOIK6qtPLok gL+1DOEhm9Vrrj8vSxRIbW84Z94z9PJqKTEWftgQKZ2PeGI= X-Google-Smtp-Source: ABdhPJz9ROuTHzYqXxqZO3nDVvETYsD8m2Czwo9onWMzJnTjq5/egG/qKFHIc+PuXHTfhmvgk07kaBD0TTlWoMlBhb0= X-Received: by 2002:a05:6000:1565:: with SMTP id 5mr28044591wrz.109.1612899759560; Tue, 09 Feb 2021 11:42:39 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Tue, 9 Feb 2021 11:42:38 -0800 (PST) In-Reply-To: <202102091925.119JPSho062759@gitrepo.freebsd.org> References: <202102091925.119JPSho062759@gitrepo.freebsd.org> From: Mateusz Guzik Date: Tue, 9 Feb 2021 20:42:38 +0100 Message-ID: Subject: Re: git: 011b7317dbb5 - main - netgraph/ng_bridge: Document staleness in multithreaded operation To: Lutz Donnerhacke Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DZtb56KZtz3kt0 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 19:42:42 -0000 Things like this are best sorted out with atomic_store, otherwise you may fall victim of various compiler mischief (even if it happens to be harmless for the time being). iow all ->staleness accesses should be converted to atomic_*. grep finds this in ng_bridge_timeout: if (++host->staleness >= priv->conf.maxStaleness) { the code should probably explain how this is synchronized against said zeroing On 2/9/21, Lutz Donnerhacke wrote: > The branch main has been updated by donner: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=011b7317dbb5038a95b9b4fca050325a62f3991e > > commit 011b7317dbb5038a95b9b4fca050325a62f3991e > Author: Lutz Donnerhacke > AuthorDate: 2021-02-09 11:32:46 +0000 > Commit: Lutz Donnerhacke > CommitDate: 2021-02-09 19:09:05 +0000 > > netgraph/ng_bridge: Document staleness in multithreaded operation > > In the data path of ng_bridge(4), the only value of the host struct, > which needs to be modified, is the staleness, which is reset every > time a frame is received. It's save to leave the code as it is. > > This patch is part of a series to make ng_bridge(4) multithreaded. > > Reviewed by: kp > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D28546 > --- > sys/netgraph/ng_bridge.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c > index 6e3f993d591b..29ab2c715aa7 100644 > --- a/sys/netgraph/ng_bridge.c > +++ b/sys/netgraph/ng_bridge.c > @@ -739,7 +739,10 @@ ng_bridge_rcvdata(hook_p hook, item_p item) > > /* Look up packet's source Ethernet address in hashtable */ > if ((host = ng_bridge_get(priv, eh->ether_shost)) != NULL) { > - /* Update time since last heard from this host */ > + /* Update time since last heard from this host. > + * This is safe without locking, because it's > + * the only operation during shared access. > + */ > host->staleness = 0; > > /* Did host jump to a different link? */ > _______________________________________________ > dev-commits-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all > To unsubscribe, send any mail to > "dev-commits-src-all-unsubscribe@freebsd.org" > -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Tue Feb 9 20:32:24 2021 Return-Path: Delivered-To: dev-commits-src-main@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 ECA3D52A396; Tue, 9 Feb 2021 20:32:24 +0000 (UTC) (envelope-from lutz@iks-jena.de) Received: from annwfn.iks-jena.de (annwfn.iks-jena.de [IPv6:2001:4bd8::19]) (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 4DZvhS4dZPz3p8C; Tue, 9 Feb 2021 20:32:24 +0000 (UTC) (envelope-from lutz@iks-jena.de) X-SMTP-Sender: IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f Received: from belenus.iks-jena.de (belenus.iks-jena.de [IPv6:2001:4bd8:0:666:248:54ff:fe12:ee3f]) by annwfn.iks-jena.de (8.15.2/8.15.2) with ESMTPS id 119KWAF1016221 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 9 Feb 2021 21:32:11 +0100 X-MSA-Host: belenus.iks-jena.de Received: (from lutz@localhost) by belenus.iks-jena.de (8.14.3/8.14.1/Submit) id 119KWAuR016420; Tue, 9 Feb 2021 21:32:10 +0100 Date: Tue, 9 Feb 2021 21:32:10 +0100 From: Lutz Donnerhacke To: Mateusz Guzik Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 011b7317dbb5 - main - netgraph/ng_bridge: Document staleness in multithreaded operation Message-ID: <20210209203210.GA16222@belenus.iks-jena.de> References: <202102091925.119JPSho062759@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-message-flag: Please send plain text messages only. Thank you. User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: 4DZvhS4dZPz3p8C X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 20:32:25 -0000 On Tue, Feb 09, 2021 at 08:42:38PM +0100, Mateusz Guzik wrote: > Things like this are best sorted out with atomic_store, otherwise you > may fall victim of various compiler mischief (even if it happens to be > harmless for the time being). > > iow all ->staleness accesses should be converted to atomic_*. > > grep finds this in ng_bridge_timeout: > > if (++host->staleness >= priv->conf.maxStaleness) { > > the code should probably explain how this is synchronized against said zeroing There is no risk, because all other access to this variable is done under a WRITER lock of the whole node. Even this one, you are quoting here. The lock comes from the netgraph framework itself. The only remaining access, which can be run in parallel, is the mentioned setting to zero. In order to document all this reasoning the comment was extended. At the moment the ng_bridge(4) node is completely singlethreaded, any call runs under the WRITER lock. The purpose of all the commits and all the open reviews are to remove this limitation in order to give the node a major performance boost. From owner-dev-commits-src-main@freebsd.org Tue Feb 9 21:07:30 2021 Return-Path: Delivered-To: dev-commits-src-main@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 97BF152B2D9; Tue, 9 Feb 2021 21:07:30 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZwSy3s9Tz3rp5; Tue, 9 Feb 2021 21:07:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D45D11F5A; Tue, 9 Feb 2021 21:07:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119L7UY8093869; Tue, 9 Feb 2021 21:07:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119L7UEx093868; Tue, 9 Feb 2021 21:07:30 GMT (envelope-from git) Date: Tue, 9 Feb 2021 21:07:30 GMT Message-Id: <202102092107.119L7UEx093868@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: ac76bc1145dd - main - Fix lib/msun's ctrig_test/test_inf_inputs test case with clang >= 10 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac76bc1145dd7f4476e5d982ce8f355f71015713 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 21:07:30 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=ac76bc1145dd7f4476e5d982ce8f355f71015713 commit ac76bc1145dd7f4476e5d982ce8f355f71015713 Author: Dimitry Andric AuthorDate: 2021-02-09 21:06:51 +0000 Commit: Dimitry Andric CommitDate: 2021-02-09 21:07:05 +0000 Fix lib/msun's ctrig_test/test_inf_inputs test case with clang >= 10 This sprinkles a few strategic volatiles in an attempt to defeat clang's optimization interfering with the expected floating-point exception flags. Reported by: lwhsu PR: 244732 MFC after: 3 days --- lib/msun/src/s_ccoshf.c | 2 +- lib/msun/src/s_ctanh.c | 2 +- lib/msun/src/s_ctanhf.c | 2 +- lib/msun/tests/ctrig_test.c | 3 --- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/msun/src/s_ccoshf.c b/lib/msun/src/s_ccoshf.c index 5d7a09ba5f8d..e72395c277d5 100644 --- a/lib/msun/src/s_ccoshf.c +++ b/lib/msun/src/s_ccoshf.c @@ -43,7 +43,7 @@ static const float huge = 0x1p127; float complex ccoshf(float complex z) { - float x, y, h; + volatile float x, y, h; int32_t hx, hy, ix, iy; x = crealf(z); diff --git a/lib/msun/src/s_ctanh.c b/lib/msun/src/s_ctanh.c index 88afeb50e26e..13eb9d40b678 100644 --- a/lib/msun/src/s_ctanh.c +++ b/lib/msun/src/s_ctanh.c @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); double complex ctanh(double complex z) { - double x, y; + volatile double x, y; double t, beta, s, rho, denom; uint32_t hx, ix, lx; diff --git a/lib/msun/src/s_ctanhf.c b/lib/msun/src/s_ctanhf.c index d2bd0b6786f0..7d375eafd2ae 100644 --- a/lib/msun/src/s_ctanhf.c +++ b/lib/msun/src/s_ctanhf.c @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); float complex ctanhf(float complex z) { - float x, y; + volatile float x, y; float t, beta, s, rho, denom; uint32_t hx, ix; diff --git a/lib/msun/tests/ctrig_test.c b/lib/msun/tests/ctrig_test.c index effc4cfce281..45b2b78b0416 100644 --- a/lib/msun/tests/ctrig_test.c +++ b/lib/msun/tests/ctrig_test.c @@ -248,9 +248,6 @@ ATF_TC_BODY(test_inf_inputs, tc) long double complex z, c, s; unsigned i; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_expect_fail("https://bugs.freebsd.org/244732"); - /* * IN CSINH CCOSH CTANH * Inf,Inf +-Inf,NaN inval +-Inf,NaN inval 1,+-0 From owner-dev-commits-src-main@freebsd.org Tue Feb 9 21:42:01 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9403C52C524; Tue, 9 Feb 2021 21:42:01 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZxDn3qYlz3vWd; Tue, 9 Feb 2021 21:42:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 764C712784; Tue, 9 Feb 2021 21:42:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119Lg1oV042941; Tue, 9 Feb 2021 21:42:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119Lg1Cq042940; Tue, 9 Feb 2021 21:42:01 GMT (envelope-from git) Date: Tue, 9 Feb 2021 21:42:01 GMT Message-Id: <202102092142.119Lg1Cq042940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 9c6954329a92 - main - bsd.compiler.mk: Detect distribution-provided GCC when executed as cc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c6954329a9285547881ddd60e393b7c55ed30c4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 21:42:01 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=9c6954329a9285547881ddd60e393b7c55ed30c4 commit 9c6954329a9285547881ddd60e393b7c55ed30c4 Author: Jessica Clarke AuthorDate: 2021-02-09 21:40:24 +0000 Commit: Jessica Clarke CommitDate: 2021-02-09 21:40:24 +0000 bsd.compiler.mk: Detect distribution-provided GCC when executed as cc Clang always prints "clang $VERSION" regardless of the name used to execute it, whereas GCC prints "$progname $VERSION", meaning if CC is set to cc and cc is GCC it will print "cc $VERSION". We are able to detect some of those cases since it then prints "($PKGVERSION)", where the default is "GCC", but many distributions override that to print their name and the package version number (e.g. "Debian 10.2.1-6"), so nothing tells us it's GCC other than the fact that it's not Clang (and that there's an FSF copyright disclaimer). However, GCC's -v option will always print "gcc version $VERSION", so fall back on using that to detect GCC. Whilst Clang also supports this option, we should never get here, so Clang handling is not added. Reviewed by: brooks, emaste, arichardson Differential Revision: https://reviews.freebsd.org/D28315 --- share/mk/bsd.compiler.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index 8253669fe279..fa8e6c44a17e 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -187,7 +187,16 @@ ${X_}COMPILER_TYPE:= gcc . elif ${_v:Mclang} || ${_v:M(clang-*.*.*)} ${X_}COMPILER_TYPE:= clang . else +# With GCC, cc --version prints "cc $VERSION ($PKGVERSION)", so if a +# distribution overrides the default GCC PKGVERSION it is not identified. +# However, its -v output always says "gcc version" in it, so fall back on that. +_gcc_version!= ${${cc}:N${CCACHE_BIN}} -v 2>&1 | grep "gcc version" +. if !empty(_gcc_version) +${X_}COMPILER_TYPE:= gcc +. else .error Unable to determine compiler type for ${cc}=${${cc}}. Consider setting ${X_}COMPILER_TYPE. +. endif +.undef _gcc_version . endif .endif .if !defined(${X_}COMPILER_VERSION) From owner-dev-commits-src-main@freebsd.org Tue Feb 9 22:17:08 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2F75452CE53; Tue, 9 Feb 2021 22:17:08 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZy1J0j9Bz4Rl4; Tue, 9 Feb 2021 22:17:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:cd55:671f:3576:6456]) (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 4344B4977; Tue, 9 Feb 2021 22:17:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: Alexey Dokuchaev , Mateusz Guzik Cc: Jessica Clarke , Kevin Bowling , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> <8E61EA5C-39D1-49CC-8319-06E9192FF735@freebsd.org> <20210209145348.GA70871@FreeBSD.org> From: John Baldwin Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly Message-ID: <3e6dfdae-48a8-2d6c-1f42-c92554d74f82@FreeBSD.org> Date: Tue, 9 Feb 2021 14:17:03 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210209145348.GA70871@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 22:17:08 -0000 On 2/9/21 6:53 AM, Alexey Dokuchaev wrote: > On Tue, Feb 09, 2021 at 02:41:15PM +0100, Mateusz Guzik wrote: >> ... >> More, if reviews were mandatory, I would expect their quality to go >> down even further, making them even less likely to prevent breakage. > > Exactly that. In fact, the good reviews are typically coming from > people who care. But those you'll get regardless of whether you've > asked for them. No, that's not quite true. Committing without asking for any review at all is not the same as requesting review and then timing out when it doesn't occur. Also, as has been noted multiple times now, people do point out questions that can't easily be fixed post-commit such as too-terse commit logs. Those are quite easily caught in review if one makes the effort to ask. If we want to cherry-pick examples, we can also find examples where reviews do find issues pre-commit. Look at all the back and forth on Warner's doc change about libraries and symbol versioning in D28486 for an example. The discussion in D28453 has led to a better approach I still need to update the review with that moves the handling of pollable sims one layer up. Rob Wing found an issue I had missed in my bhyve config change (D26035) in terms of new warnings from iasl during pre-commit testing. Kostik posted a possible patch trying to address a PR in D28485 that is probably not valid (see my review comments) and thus saved having something committed that then had to be reverted. Kostik's review on D28342 forced me to rework the change to only scan segments and not ELF sections since valid ELF executables and DSO's aren't required to have section headers. Review on D27454 led to acclerated AES-GCM for ARMv8 that was targeted at KTLS being reimplemented in a more generic fashion that also accelerates IPsec and other users of AES-GCM in the kernel. I could keep going listing changes that benefit from cooperation among developers. However, cooperation does mean one has to be a bit more patient and be willing to work on follow-on work while letting review feedback come in. Using tools like git make this fairly easy as you can apply fixups to the earlier changes and rebase the follow-on changes under active development afterwards. It is true that you can't get meaningful review on all changes (or all aspects of a change), but I think the notion that review _never_ helps is not supported by the evidence. The fact that Jess found a bug in the assembly code in question the day after it was committed indicates that pre-commit review would have been beneficial for this commit. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Tue Feb 9 22:37:44 2021 Return-Path: Delivered-To: dev-commits-src-main@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 185F552DA6A; Tue, 9 Feb 2021 22:37:44 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZyT407mLz4SpF; Tue, 9 Feb 2021 22:37:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB4D412D65; Tue, 9 Feb 2021 22:37:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119MbhBq012173; Tue, 9 Feb 2021 22:37:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119Mbhwb012172; Tue, 9 Feb 2021 22:37:43 GMT (envelope-from git) Date: Tue, 9 Feb 2021 22:37:43 GMT Message-Id: <202102092237.119Mbhwb012172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 51af03328755 - main - Add test case for 93fc67896550 (incorrect powf(3) result) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 51af03328755c9095e94d20858a8d10acfe412ae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 22:37:44 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=51af03328755c9095e94d20858a8d10acfe412ae commit 51af03328755c9095e94d20858a8d10acfe412ae Author: Dimitry Andric AuthorDate: 2021-02-09 22:37:08 +0000 Commit: Dimitry Andric CommitDate: 2021-02-09 22:37:18 +0000 Add test case for 93fc67896550 (incorrect powf(3) result) This adds the test case to contrib/netbsd-tests/lib/libm/t_pow.c, as it is currently the only place testing pow(3) and friends. MFC after: 1 week --- contrib/netbsd-tests/lib/libm/t_pow.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/contrib/netbsd-tests/lib/libm/t_pow.c b/contrib/netbsd-tests/lib/libm/t_pow.c index 7afee9f6dffa..09e72be7311b 100644 --- a/contrib/netbsd-tests/lib/libm/t_pow.c +++ b/contrib/netbsd-tests/lib/libm/t_pow.c @@ -637,6 +637,27 @@ ATF_TC_BODY(powf_zero_y, tc) } } +ATF_TC(powf_near_one_x_huge_y); +ATF_TC_HEAD(powf_near_one_x_huge_y, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test powf(->1, huge) != inf"); +} + +ATF_TC_BODY(powf_near_one_x_huge_y, tc) +{ + const float x = 0x1.ffffeep-1f; /* 9.999995e-01f */ + const float y = -0x1.000002p+27f; /* -1.342177e+08f */ + const float e = 0x1.d53532p+103f; /* 1.858724e+31f */ + const float ulp = __FLT_EPSILON__; + float z; + + z = powf(x, y); + + ATF_CHECK(isinf(z) == 0); + ATF_CHECK(fabsf(z - e) <= 2 * ulp); +} + + ATF_TP_ADD_TCS(tp) { @@ -661,6 +682,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, powf_one_pos_x); ATF_TP_ADD_TC(tp, powf_zero_x); ATF_TP_ADD_TC(tp, powf_zero_y); + ATF_TP_ADD_TC(tp, powf_near_one_x_huge_y); return atf_no_error(); } From owner-dev-commits-src-main@freebsd.org Tue Feb 9 22:42:36 2021 Return-Path: Delivered-To: dev-commits-src-main@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 075F452DEBF; Tue, 9 Feb 2021 22:42:36 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZyZg6rKxz4TRm; Tue, 9 Feb 2021 22:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDA7613406; Tue, 9 Feb 2021 22:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 119MgZBh025039; Tue, 9 Feb 2021 22:42:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 119MgZJQ025038; Tue, 9 Feb 2021 22:42:35 GMT (envelope-from git) Date: Tue, 9 Feb 2021 22:42:35 GMT Message-Id: <202102092242.119MgZJQ025038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: f25266bee7da - main - libsysdecode: fix decoding of TCP_NOPUSH and TCP_MD5SIG MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f25266bee7dafb10f03e06537c8127cc17335bed Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 22:42:36 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f25266bee7dafb10f03e06537c8127cc17335bed commit f25266bee7dafb10f03e06537c8127cc17335bed Author: Michael Tuexen AuthorDate: 2021-02-09 22:35:55 +0000 Commit: Michael Tuexen CommitDate: 2021-02-09 22:42:27 +0000 libsysdecode: fix decoding of TCP_NOPUSH and TCP_MD5SIG TCP_FASTOPEN_MIN_COOKIE_LEN was incorrectly registered as a name of a IPPROTO_TCP level socket option, which overwrote TCP_NOPUSH. TCP_FASTOPEN_PSK_LEN was incorrectly registered as a name of an IPPROTO_TCP level socket option, which overwrote TCP_MD5SIG. MFC after: 3 days Sponsored by: Netflix, Inc. --- lib/libsysdecode/mktables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsysdecode/mktables b/lib/libsysdecode/mktables index 3a0284a2deb4..3d152a3a2646 100644 --- a/lib/libsysdecode/mktables +++ b/lib/libsysdecode/mktables @@ -140,7 +140,7 @@ gen_table "sockopt" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/ gen_table "sockoptip" "(IP_[[:alnum:]_]+|MCAST_[[:alnum:]_]+_GROUP)[[:space:]]+" "netinet/in.h" "IP_DEFAULT|IP_MIN|IP_MAX|IP_PORTRANGE" gen_table "sockoptipv6" "IPV6_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet6/in6.h" "IPV6_ADDR_|IPV6_TAG_DIRECT|IPV6_OPTIONS|IPV6_RECVOPTS|IPV6_RECVRETOPTS|IPV6_RECVDSTADDR|IPV6_RETOPTS|IPV6_2292|IPV6_RECVRTHDRDSTOPTS|IPV6_REACHCONF|IPV6_PKTOPTIONS" gen_table "sockoptsctp" "SCTP_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/sctp.h" -gen_table "sockopttcp" "TCP_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/tcp.h" "TCP_MIN|TCP_MAX[^S]|TCP_MSS|TCP_[[:alnum:]_]+_MAX" +gen_table "sockopttcp" "TCP_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/tcp.h" "TCP_MIN|TCP_MAX[^S]|TCP_MSS|TCP_[[:alnum:]_]+_MAX|TCP_FASTOPEN_MIN_COOKIE_LEN|TCP_FASTOPEN_PSK_LEN" gen_table "sockoptudp" "UDP_[[:alnum:]]+[[:space:]]+[0-9]+" "netinet/udp.h" "UDP_ENCAP_" gen_table "sockoptudplite" "UDPLITE_[[:alnum:]_]+[[:space:]]+[0-9]+" "netinet/udplite.h" gen_table "socktype" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h" From owner-dev-commits-src-main@freebsd.org Tue Feb 9 23:36:11 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D2D9A52FAE7 for ; Tue, 9 Feb 2021 23:36:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) (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 4DZzmW59Mlz4XXZ for ; Tue, 9 Feb 2021 23:36:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf31.google.com with SMTP id r13so25106qvm.11 for ; Tue, 09 Feb 2021 15:36:11 -0800 (PST) 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=G7bHsYwj1JEJA/EPcQhvC6M+ZINR6iXPdiazVMQxB/Y=; b=c70ztciz2Yqrpp86oOtKBSJK+Agc7QV/XhoFurVsnYOS0zyfpvjchUQdEOnYBlmdfH 3P9Y78MhR4K4TF2P1+b3aitaSAzo98tX/EyECLNvQ023BEIkyN1LXH9+Hd+U6PXJ9JTd RpbMokFPiH5kMyhNS65FPSlj+EiXWIi7NuNBVyQLYPneTvlSmK4/7ixassb0VHbFVXTR VO13iyqwiybrDQISw1+5G1urXgxwHuczWuI+JmZT52dd5FGOra6O++hVOW3x/TwWQKOo dZkOuNacoqwag8e/b5rX4IkrakkvXHGkEcmIzFPOqQWV/fJ38GdI0TBl7vb6tecw4IDq kCCg== 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=G7bHsYwj1JEJA/EPcQhvC6M+ZINR6iXPdiazVMQxB/Y=; b=KuHXuJLI2etsb4lXqv2z2N4YrmL/AAvxSJxS0I69vOJ650MzRK0waLXUZUTxIzwVpS ZUCxen3sHz1+BdRrqMcnfugg5JC5giyfXNWNQKwXIh6ip7vOMiq76CMKoZcaVx75Vdzr OMcBX2o4nmpFrpgFEhO31NFQsYtIkXC14GCYg+nWXWzyx2XXejUV4xQhf1bjLx0y/aao T2wLodQpOBAyYx8jph2WbZ4BNo3lbycUaMqT2eNHf80GZnj4Qxjw09kZ+pRqexXHUXfI hZeXrgaYZPwZ2ta9gYJIYQXV1+Ce5catsTX7BqAMHge9z8wv1y5vsCSNPlZh8twKya3K sDMA== X-Gm-Message-State: AOAM532hcj0BfQNmfRN1pHUZVBBn4oSL+7izp+Leg17CrYkh2GQgbyIw o9aAymOqnHxYED5ohqhd5jcOqRZayuDjb93zQ40jWQ== X-Google-Smtp-Source: ABdhPJxhScIp30j1IFAQG2/W/F8wXsSUgChbOnAodKr056aGpW1fSAUYtIYXLN5BQZyG6uB85RioSNjLNDO/HOGa/14= X-Received: by 2002:a0c:abce:: with SMTP id k14mr204741qvb.23.1612913770760; Tue, 09 Feb 2021 15:36:10 -0800 (PST) MIME-Version: 1.0 References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> <8E61EA5C-39D1-49CC-8319-06E9192FF735@freebsd.org> <20210209145348.GA70871@FreeBSD.org> <3e6dfdae-48a8-2d6c-1f42-c92554d74f82@FreeBSD.org> In-Reply-To: <3e6dfdae-48a8-2d6c-1f42-c92554d74f82@FreeBSD.org> From: Warner Losh Date: Tue, 9 Feb 2021 16:35:59 -0700 Message-ID: Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly To: John Baldwin Cc: Alexey Dokuchaev , Mateusz Guzik , Jessica Clarke , Kevin Bowling , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" X-Rspamd-Queue-Id: 4DZzmW59Mlz4XXZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 23:36:11 -0000 On Tue, Feb 9, 2021 at 3:17 PM John Baldwin wrote: > On 2/9/21 6:53 AM, Alexey Dokuchaev wrote: > > On Tue, Feb 09, 2021 at 02:41:15PM +0100, Mateusz Guzik wrote: > >> ... > >> More, if reviews were mandatory, I would expect their quality to go > >> down even further, making them even less likely to prevent breakage. > > > > Exactly that. In fact, the good reviews are typically coming from > > people who care. But those you'll get regardless of whether you've > > asked for them. > > No, that's not quite true. Committing without asking for any review at > all is not the same as requesting review and then timing out when it > doesn't occur. > > Also, as has been noted multiple times now, people do point out questions > that can't easily be fixed post-commit such as too-terse commit logs. > Those are quite easily caught in review if one makes the effort to ask. > > If we want to cherry-pick examples, we can also find examples where > reviews do find issues pre-commit. Look at all the back and forth on > Warner's doc change about libraries and symbol versioning in D28486 for > an example. > > The discussion in D28453 has led to a better approach I still need to > update the review with that moves the handling of pollable sims one > layer up. > > Rob Wing found an issue I had missed in my bhyve config change (D26035) > in terms of new warnings from iasl during pre-commit testing. > > Kostik posted a possible patch trying to address a PR in D28485 that is > probably not valid (see my review comments) and thus saved having > something committed that then had to be reverted. > > Kostik's review on D28342 forced me to rework the change to only scan > segments and not ELF sections since valid ELF executables and DSO's > aren't required to have section headers. > > Review on D27454 led to acclerated AES-GCM for ARMv8 that was targeted > at KTLS being reimplemented in a more generic fashion that also > accelerates IPsec and other users of AES-GCM in the kernel. > > I could keep going listing changes that benefit from cooperation among > developers. However, cooperation does mean one has to be a bit more > patient and be willing to work on follow-on work while letting review > feedback come in. Using tools like git make this fairly easy as you > can apply fixups to the earlier changes and rebase the follow-on changes > under active development afterwards. It is true that you can't get > meaningful review on all changes (or all aspects of a change), but I > think the notion that review _never_ helps is not supported by the > evidence. > > The fact that Jess found a bug in the assembly code in question the day > after it was committed indicates that pre-commit review would have > been beneficial for this commit. > Just to draw back to the main point I was trying to make: Let's not let the perfect be the enemy of the better. Reviews are better today than we were last year and even better than two years ago. While we still have a ways to go, we've gotten better and will continue to get better as more people give things another try. Warner From owner-dev-commits-src-main@freebsd.org Wed Feb 10 01:18:37 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9FA5C5341EC; Wed, 10 Feb 2021 01:18:37 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Db22j46dwz4g9g; Wed, 10 Feb 2021 01:18:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 801501511F; Wed, 10 Feb 2021 01:18:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11A1Ib7f021537; Wed, 10 Feb 2021 01:18:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11A1IbeZ021536; Wed, 10 Feb 2021 01:18:37 GMT (envelope-from git) Date: Wed, 10 Feb 2021 01:18:37 GMT Message-Id: <202102100118.11A1IbeZ021536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 1e811efbc591 - main - Fix non-IPv6 build post 57785538c6e0d7e8ca0f161ab95bae10fd304047. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e811efbc591699b872bea42b9de419c373199df Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 01:18:37 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=1e811efbc591699b872bea42b9de419c373199df commit 1e811efbc591699b872bea42b9de419c373199df Author: Cy Schubert AuthorDate: 2021-02-10 01:13:01 +0000 Commit: Cy Schubert CommitDate: 2021-02-10 01:18:25 +0000 Fix non-IPv6 build post 57785538c6e0d7e8ca0f161ab95bae10fd304047. 57785538c6e0d7e8ca0f161ab95bae10fd304047 change the test for FreeBSD from __FreeBSD_version to __FreeBSD__. However this test was performed before sys/param.h was included, therefore __FreeBSD_version was never defined. As the test was never true opt_random_ip_id.h was never included. Submitted by: bdragon Reported by: bdragon MFC after: 1 week X-MFC with: 57785538c6e0d7e8ca0f161ab95bae10fd304047 --- sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c index 9f03ab3bf946..bac73cee4e8b 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c @@ -20,10 +20,6 @@ static const char rcsid[] = "@(#)$Id$"; !defined(KLD_MODULE) && !defined(IPFILTER_LKM) # include "opt_inet6.h" #endif -#if defined(__FreeBSD__) && \ - !defined(KLD_MODULE) && !defined(IPFILTER_LKM) -# include "opt_random_ip_id.h" -#endif #include #include #include From owner-dev-commits-src-main@freebsd.org Wed Feb 10 04:27:43 2021 Return-Path: Delivered-To: dev-commits-src-main@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 7CE06539815; Wed, 10 Feb 2021 04:27:43 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Db6Dv34KSz4v7q; Wed, 10 Feb 2021 04:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BDA3178B9; Wed, 10 Feb 2021 04:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11A4Rhgg070271; Wed, 10 Feb 2021 04:27:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11A4RgTa070269; Wed, 10 Feb 2021 04:27:42 GMT (envelope-from git) Date: Wed, 10 Feb 2021 04:27:42 GMT Message-Id: <202102100427.11A4RgTa070269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: f44e67d120ad - main - MFV d60fa10fd872db7e3d8cb1e161cfdae026c43b14: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f44e67d120ad78ef7894241b519ee79fd190a16e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 04:27:43 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=f44e67d120ad78ef7894241b519ee79fd190a16e commit f44e67d120ad78ef7894241b519ee79fd190a16e Merge: 1e811efbc591 d60fa10fd872 Author: Cy Schubert AuthorDate: 2021-02-10 04:25:05 +0000 Commit: Cy Schubert CommitDate: 2021-02-10 04:27:25 +0000 MFV d60fa10fd872db7e3d8cb1e161cfdae026c43b14: Update unbound 1.13.0 --> 1.13.1. Includes numerous bugfixes documented at: https://www.nlnetlabs.nl/projects/unbound/download/#unbound-1-13-1 MFC after: 1 month contrib/unbound/Makefile.in | 516 ++++++++++++--------- contrib/unbound/aclocal.m4 | 8 +- contrib/unbound/acx_nlnetlabs.m4 | 60 ++- contrib/unbound/acx_python.m4 | 6 +- contrib/unbound/cachedb/cachedb.c | 1 + contrib/unbound/config.guess | 20 +- contrib/unbound/config.h.in | 3 +- contrib/unbound/config.sub | 20 +- contrib/unbound/configure | 137 +++--- contrib/unbound/configure.ac | 197 ++++---- .../contrib/build-unbound-localzone-from-hosts.pl | 0 .../unbound/contrib/create_unbound_ad_servers.sh | 0 contrib/unbound/contrib/parseunbound.pl | 0 contrib/unbound/contrib/unbound_cache.sh | 0 contrib/unbound/contrib/warmup.sh | 0 contrib/unbound/daemon/remote.c | 55 +++ contrib/unbound/daemon/worker.c | 22 +- contrib/unbound/dns64/dns64.c | 43 +- contrib/unbound/dnscrypt/dnscrypt.m4 | 2 +- contrib/unbound/dnstap/dnstap.m4 | 2 +- contrib/unbound/dnstap/unbound-dnstap-socket.c | 9 +- contrib/unbound/doc/Changelog | 131 +++++- contrib/unbound/doc/FEATURES | 1 + contrib/unbound/doc/README | 2 +- contrib/unbound/doc/TODO | 1 - contrib/unbound/doc/example.conf.in | 32 +- contrib/unbound/doc/libunbound.3.in | 4 +- contrib/unbound/doc/unbound-anchor.8.in | 2 +- contrib/unbound/doc/unbound-checkconf.8.in | 2 +- contrib/unbound/doc/unbound-control.8.in | 8 +- contrib/unbound/doc/unbound-host.1.in | 2 +- contrib/unbound/doc/unbound.8.in | 4 +- contrib/unbound/doc/unbound.conf.5.in | 60 ++- contrib/unbound/doc/unbound.doxygen | 6 +- contrib/unbound/dynlibmod/dynlibmod.c | 20 +- contrib/unbound/dynlibmod/dynlibmod.h | 4 +- contrib/unbound/dynlibmod/examples/helloworld.c | 14 +- contrib/unbound/ipset/ipset.c | 0 contrib/unbound/ipset/ipset.h | 0 contrib/unbound/libunbound/libworker.c | 4 + contrib/unbound/ltmain.sh | 0 contrib/unbound/respip/respip.c | 2 +- contrib/unbound/services/authzone.c | 17 +- contrib/unbound/services/cache/rrset.c | 2 + contrib/unbound/services/listen_dnsport.c | 14 +- contrib/unbound/services/listen_dnsport.h | 2 +- contrib/unbound/services/localzone.c | 107 ++++- contrib/unbound/services/localzone.h | 7 + contrib/unbound/services/mesh.c | 38 +- contrib/unbound/services/outside_network.c | 77 ++- contrib/unbound/services/outside_network.h | 2 + contrib/unbound/services/rpz.c | 21 +- contrib/unbound/services/rpz.h | 13 + contrib/unbound/smallapp/unbound-anchor.c | 67 +-- contrib/unbound/smallapp/unbound-control.c | 105 ++++- contrib/unbound/smallapp/worker_cb.c | 3 + contrib/unbound/util/config_file.c | 71 ++- contrib/unbound/util/config_file.h | 27 ++ contrib/unbound/util/configlexer.lex | 6 + contrib/unbound/util/configparser.y | 87 +++- contrib/unbound/util/configyyrename.h | 6 + contrib/unbound/util/data/msgencode.c | 63 ++- contrib/unbound/util/data/msgparse.c | 2 + contrib/unbound/util/data/msgparse.h | 4 + contrib/unbound/util/data/msgreply.c | 36 +- contrib/unbound/util/data/msgreply.h | 20 +- contrib/unbound/util/data/packed_rrset.c | 17 +- contrib/unbound/util/data/packed_rrset.h | 3 + contrib/unbound/util/edns.c | 16 + contrib/unbound/util/iana_ports.inc | 2 +- contrib/unbound/util/module.h | 4 +- contrib/unbound/util/net_help.c | 2 +- contrib/unbound/util/netevent.c | 122 ++++- contrib/unbound/util/netevent.h | 12 + contrib/unbound/util/storage/lruhash.c | 4 +- contrib/unbound/validator/autotrust.c | 1 + usr.sbin/unbound/config.h | 6 +- 77 files changed, 1700 insertions(+), 686 deletions(-) diff --cc contrib/unbound/contrib/build-unbound-localzone-from-hosts.pl index c11bbc330795,c11bbc330795..c11bbc330795 mode 100755,100644..100644 --- a/contrib/unbound/contrib/build-unbound-localzone-from-hosts.pl +++ b/contrib/unbound/contrib/build-unbound-localzone-from-hosts.pl diff --cc contrib/unbound/contrib/create_unbound_ad_servers.sh index 49fdbffedfaf,49fdbffedfaf..49fdbffedfaf mode 100755,100644..100644 --- a/contrib/unbound/contrib/create_unbound_ad_servers.sh +++ b/contrib/unbound/contrib/create_unbound_ad_servers.sh diff --cc contrib/unbound/contrib/parseunbound.pl index 1d294b13288d,1d294b13288d..1d294b13288d mode 100755,100644..100644 --- a/contrib/unbound/contrib/parseunbound.pl +++ b/contrib/unbound/contrib/parseunbound.pl diff --cc contrib/unbound/contrib/unbound_cache.sh index b3e876ba9012,b3e876ba9012..b3e876ba9012 mode 100755,100644..100644 --- a/contrib/unbound/contrib/unbound_cache.sh +++ b/contrib/unbound/contrib/unbound_cache.sh diff --cc contrib/unbound/contrib/warmup.sh index b4d9135a68dd,b4d9135a68dd..b4d9135a68dd mode 100755,100644..100644 --- a/contrib/unbound/contrib/warmup.sh +++ b/contrib/unbound/contrib/warmup.sh diff --cc contrib/unbound/doc/unbound-checkconf.8.in index abcd45c8b811,000000000000..ed9db8ffa82c mode 100644,000000..100644 --- a/contrib/unbound/doc/unbound-checkconf.8.in +++ b/contrib/unbound/doc/unbound-checkconf.8.in @@@ -1,52 -1,0 +1,52 @@@ - .TH "unbound-checkconf" "8" "Dec 3, 2020" "NLnet Labs" "unbound 1.13.0" ++.TH "unbound-checkconf" "8" "Feb 9, 2021" "NLnet Labs" "unbound 1.13.1" +.\" +.\" unbound-checkconf.8 -- unbound configuration checker manual +.\" +.\" Copyright (c) 2007, NLnet Labs. All rights reserved. +.\" +.\" See LICENSE for the license. +.\" +.\" +.SH "NAME" +.B unbound\-checkconf +\- Check unbound configuration file for errors. +.SH "SYNOPSIS" +.B unbound\-checkconf +.RB [ \-h ] +.RB [ \-f ] +.RB [ \-o +.IR option ] +.RI [ cfgfile ] +.SH "DESCRIPTION" +.B Unbound\-checkconf +checks the configuration file for the +\fIunbound\fR(8) +DNS resolver for syntax and other errors. +The config file syntax is described in +\fIunbound.conf\fR(5). +.P +The available options are: +.TP +.B \-h +Show the version and commandline option help. +.TP +.B \-f +Print full pathname, with chroot applied to it. Use with the \-o option. +.TP +.B \-o\fI option +If given, after checking the config file the value of this option is +printed to stdout. For "" (disabled) options an empty line is printed. +.TP +.I cfgfile +The config file to read with settings for unbound. It is checked. +If omitted, the config file at the default location is checked. +.SH "EXIT CODE" +The unbound\-checkconf program exits with status code 1 on error, +0 for a correct config file. +.SH "FILES" +.TP +.I @ub_conf_file@ +unbound configuration file. +.SH "SEE ALSO" +\fIunbound.conf\fR(5), +\fIunbound\fR(8). diff --cc contrib/unbound/ipset/ipset.c index f6e2c4a9d8a6,f6e2c4a9d8a6..f6e2c4a9d8a6 mode 100755,100644..100644 --- a/contrib/unbound/ipset/ipset.c +++ b/contrib/unbound/ipset/ipset.c diff --cc contrib/unbound/ipset/ipset.h index f60a8be8c837,f60a8be8c837..f60a8be8c837 mode 100755,100644..100644 --- a/contrib/unbound/ipset/ipset.h +++ b/contrib/unbound/ipset/ipset.h diff --cc contrib/unbound/ltmain.sh index 7f3523d335c5,7f3523d335c5..7f3523d335c5 mode 100755,100644..100644 --- a/contrib/unbound/ltmain.sh +++ b/contrib/unbound/ltmain.sh diff --cc contrib/unbound/services/authzone.c index a43a25def993,000000000000..ecd63ec144f5 mode 100644,000000..100644 --- a/contrib/unbound/services/authzone.c +++ b/contrib/unbound/services/authzone.c @@@ -1,6969 -1,0 +1,6974 @@@ +/* + * services/authzone.c - authoritative zone that is locally hosted. + * + * Copyright (c) 2017, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER 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. + */ + +/** + * \file + * + * This file contains the functions for an authority zone. This zone + * is queried by the iterator, just like a stub or forward zone, but then + * the data is locally held. + */ + +#include "config.h" +#include "services/authzone.h" +#include "util/data/dname.h" +#include "util/data/msgparse.h" +#include "util/data/msgreply.h" +#include "util/data/msgencode.h" +#include "util/data/packed_rrset.h" +#include "util/regional.h" +#include "util/net_help.h" +#include "util/netevent.h" +#include "util/config_file.h" +#include "util/log.h" +#include "util/module.h" +#include "util/random.h" +#include "services/cache/dns.h" +#include "services/outside_network.h" +#include "services/listen_dnsport.h" +#include "services/mesh.h" +#include "sldns/rrdef.h" +#include "sldns/pkthdr.h" +#include "sldns/sbuffer.h" +#include "sldns/str2wire.h" +#include "sldns/wire2str.h" +#include "sldns/parseutil.h" +#include "sldns/keyraw.h" +#include "validator/val_nsec3.h" +#include "validator/val_secalgo.h" +#include + +/** bytes to use for NSEC3 hash buffer. 20 for sha1 */ +#define N3HASHBUFLEN 32 +/** max number of CNAMEs we are willing to follow (in one answer) */ +#define MAX_CNAME_CHAIN 8 +/** timeout for probe packets for SOA */ +#define AUTH_PROBE_TIMEOUT 100 /* msec */ +/** when to stop with SOA probes (when exponential timeouts exceed this) */ +#define AUTH_PROBE_TIMEOUT_STOP 1000 /* msec */ +/* auth transfer timeout for TCP connections, in msec */ +#define AUTH_TRANSFER_TIMEOUT 10000 /* msec */ +/* auth transfer max backoff for failed tranfers and probes */ +#define AUTH_TRANSFER_MAX_BACKOFF 86400 /* sec */ +/* auth http port number */ +#define AUTH_HTTP_PORT 80 +/* auth https port number */ +#define AUTH_HTTPS_PORT 443 +/* max depth for nested $INCLUDEs */ +#define MAX_INCLUDE_DEPTH 10 +/** number of timeouts before we fallback from IXFR to AXFR, + * because some versions of servers (eg. dnsmasq) drop IXFR packets. */ +#define NUM_TIMEOUTS_FALLBACK_IXFR 3 + +/** pick up nextprobe task to start waiting to perform transfer actions */ +static void xfr_set_timeout(struct auth_xfer* xfr, struct module_env* env, + int failure, int lookup_only); +/** move to sending the probe packets, next if fails. task_probe */ +static void xfr_probe_send_or_end(struct auth_xfer* xfr, + struct module_env* env); +/** pick up probe task with specified(or NULL) destination first, + * or transfer task if nothing to probe, or false if already in progress */ +static int xfr_start_probe(struct auth_xfer* xfr, struct module_env* env, + struct auth_master* spec); +/** delete xfer structure (not its tree entry) */ +static void auth_xfer_delete(struct auth_xfer* xfr); + +/** create new dns_msg */ +static struct dns_msg* +msg_create(struct regional* region, struct query_info* qinfo) +{ + struct dns_msg* msg = (struct dns_msg*)regional_alloc(region, + sizeof(struct dns_msg)); + if(!msg) + return NULL; + msg->qinfo.qname = regional_alloc_init(region, qinfo->qname, + qinfo->qname_len); + if(!msg->qinfo.qname) + return NULL; + msg->qinfo.qname_len = qinfo->qname_len; + msg->qinfo.qtype = qinfo->qtype; + msg->qinfo.qclass = qinfo->qclass; + msg->qinfo.local_alias = NULL; + /* non-packed reply_info, because it needs to grow the array */ + msg->rep = (struct reply_info*)regional_alloc_zero(region, + sizeof(struct reply_info)-sizeof(struct rrset_ref)); + if(!msg->rep) + return NULL; + msg->rep->flags = (uint16_t)(BIT_QR | BIT_AA); + msg->rep->authoritative = 1; + msg->rep->qdcount = 1; + /* rrsets is NULL, no rrsets yet */ + return msg; +} + +/** grow rrset array by one in msg */ +static int +msg_grow_array(struct regional* region, struct dns_msg* msg) +{ + if(msg->rep->rrsets == NULL) { + msg->rep->rrsets = regional_alloc_zero(region, + sizeof(struct ub_packed_rrset_key*)*(msg->rep->rrset_count+1)); + if(!msg->rep->rrsets) + return 0; + } else { + struct ub_packed_rrset_key** rrsets_old = msg->rep->rrsets; + msg->rep->rrsets = regional_alloc_zero(region, + sizeof(struct ub_packed_rrset_key*)*(msg->rep->rrset_count+1)); + if(!msg->rep->rrsets) + return 0; + memmove(msg->rep->rrsets, rrsets_old, + sizeof(struct ub_packed_rrset_key*)*msg->rep->rrset_count); + } + return 1; +} + +/** get ttl of rrset */ +static time_t +get_rrset_ttl(struct ub_packed_rrset_key* k) +{ + struct packed_rrset_data* d = (struct packed_rrset_data*) + k->entry.data; + return d->ttl; +} + +/** Copy rrset into region from domain-datanode and packet rrset */ +static struct ub_packed_rrset_key* +auth_packed_rrset_copy_region(struct auth_zone* z, struct auth_data* node, + struct auth_rrset* rrset, struct regional* region, time_t adjust) +{ + struct ub_packed_rrset_key key; + memset(&key, 0, sizeof(key)); + key.entry.key = &key; + key.entry.data = rrset->data; + key.rk.dname = node->name; + key.rk.dname_len = node->namelen; + key.rk.type = htons(rrset->type); + key.rk.rrset_class = htons(z->dclass); + key.entry.hash = rrset_key_hash(&key.rk); + return packed_rrset_copy_region(&key, region, adjust); +} + +/** fix up msg->rep TTL and prefetch ttl */ +static void +msg_ttl(struct dns_msg* msg) +{ + if(msg->rep->rrset_count == 0) return; + if(msg->rep->rrset_count == 1) { + msg->rep->ttl = get_rrset_ttl(msg->rep->rrsets[0]); + msg->rep->prefetch_ttl = PREFETCH_TTL_CALC(msg->rep->ttl); + msg->rep->serve_expired_ttl = msg->rep->ttl + SERVE_EXPIRED_TTL; + } else if(get_rrset_ttl(msg->rep->rrsets[msg->rep->rrset_count-1]) < + msg->rep->ttl) { + msg->rep->ttl = get_rrset_ttl(msg->rep->rrsets[ + msg->rep->rrset_count-1]); + msg->rep->prefetch_ttl = PREFETCH_TTL_CALC(msg->rep->ttl); + msg->rep->serve_expired_ttl = msg->rep->ttl + SERVE_EXPIRED_TTL; + } +} + +/** see if rrset is a duplicate in the answer message */ +static int +msg_rrset_duplicate(struct dns_msg* msg, uint8_t* nm, size_t nmlen, + uint16_t type, uint16_t dclass) +{ + size_t i; + for(i=0; irep->rrset_count; i++) { + struct ub_packed_rrset_key* k = msg->rep->rrsets[i]; + if(ntohs(k->rk.type) == type && k->rk.dname_len == nmlen && + ntohs(k->rk.rrset_class) == dclass && + query_dname_compare(k->rk.dname, nm) == 0) + return 1; + } + return 0; +} + +/** add rrset to answer section (no auth, add rrsets yet) */ +static int +msg_add_rrset_an(struct auth_zone* z, struct regional* region, + struct dns_msg* msg, struct auth_data* node, struct auth_rrset* rrset) +{ + log_assert(msg->rep->ns_numrrsets == 0); + log_assert(msg->rep->ar_numrrsets == 0); + if(!rrset || !node) + return 1; + if(msg_rrset_duplicate(msg, node->name, node->namelen, rrset->type, + z->dclass)) + return 1; + /* grow array */ + if(!msg_grow_array(region, msg)) + return 0; + /* copy it */ + if(!(msg->rep->rrsets[msg->rep->rrset_count] = + auth_packed_rrset_copy_region(z, node, rrset, region, 0))) + return 0; + msg->rep->rrset_count++; + msg->rep->an_numrrsets++; + msg_ttl(msg); + return 1; +} + +/** add rrset to authority section (no additonal section rrsets yet) */ +static int +msg_add_rrset_ns(struct auth_zone* z, struct regional* region, + struct dns_msg* msg, struct auth_data* node, struct auth_rrset* rrset) +{ + log_assert(msg->rep->ar_numrrsets == 0); + if(!rrset || !node) + return 1; + if(msg_rrset_duplicate(msg, node->name, node->namelen, rrset->type, + z->dclass)) + return 1; + /* grow array */ + if(!msg_grow_array(region, msg)) + return 0; + /* copy it */ + if(!(msg->rep->rrsets[msg->rep->rrset_count] = + auth_packed_rrset_copy_region(z, node, rrset, region, 0))) + return 0; + msg->rep->rrset_count++; + msg->rep->ns_numrrsets++; + msg_ttl(msg); + return 1; +} + +/** add rrset to additional section */ +static int +msg_add_rrset_ar(struct auth_zone* z, struct regional* region, + struct dns_msg* msg, struct auth_data* node, struct auth_rrset* rrset) +{ + if(!rrset || !node) + return 1; + if(msg_rrset_duplicate(msg, node->name, node->namelen, rrset->type, + z->dclass)) + return 1; + /* grow array */ + if(!msg_grow_array(region, msg)) + return 0; + /* copy it */ + if(!(msg->rep->rrsets[msg->rep->rrset_count] = + auth_packed_rrset_copy_region(z, node, rrset, region, 0))) + return 0; + msg->rep->rrset_count++; + msg->rep->ar_numrrsets++; + msg_ttl(msg); + return 1; +} + +struct auth_zones* auth_zones_create(void) +{ + struct auth_zones* az = (struct auth_zones*)calloc(1, sizeof(*az)); + if(!az) { + log_err("out of memory"); + return NULL; + } + rbtree_init(&az->ztree, &auth_zone_cmp); + rbtree_init(&az->xtree, &auth_xfer_cmp); + lock_rw_init(&az->lock); + lock_protect(&az->lock, &az->ztree, sizeof(az->ztree)); + lock_protect(&az->lock, &az->xtree, sizeof(az->xtree)); + /* also lock protects the rbnode's in struct auth_zone, auth_xfer */ + lock_rw_init(&az->rpz_lock); + lock_protect(&az->rpz_lock, &az->rpz_first, sizeof(az->rpz_first)); + return az; +} + +int auth_zone_cmp(const void* z1, const void* z2) +{ + /* first sort on class, so that hierarchy can be maintained within + * a class */ + struct auth_zone* a = (struct auth_zone*)z1; + struct auth_zone* b = (struct auth_zone*)z2; + int m; + if(a->dclass != b->dclass) { + if(a->dclass < b->dclass) + return -1; + return 1; + } + /* sorted such that higher zones sort before lower zones (their + * contents) */ + return dname_lab_cmp(a->name, a->namelabs, b->name, b->namelabs, &m); +} + +int auth_data_cmp(const void* z1, const void* z2) +{ + struct auth_data* a = (struct auth_data*)z1; + struct auth_data* b = (struct auth_data*)z2; + int m; + /* canonical sort, because DNSSEC needs that */ + return dname_canon_lab_cmp(a->name, a->namelabs, b->name, + b->namelabs, &m); +} + +int auth_xfer_cmp(const void* z1, const void* z2) +{ + /* first sort on class, so that hierarchy can be maintained within + * a class */ + struct auth_xfer* a = (struct auth_xfer*)z1; + struct auth_xfer* b = (struct auth_xfer*)z2; + int m; + if(a->dclass != b->dclass) { + if(a->dclass < b->dclass) + return -1; + return 1; + } + /* sorted such that higher zones sort before lower zones (their + * contents) */ + return dname_lab_cmp(a->name, a->namelabs, b->name, b->namelabs, &m); +} + +/** delete auth rrset node */ +static void +auth_rrset_delete(struct auth_rrset* rrset) +{ + if(!rrset) return; + free(rrset->data); + free(rrset); +} + +/** delete auth data domain node */ +static void +auth_data_delete(struct auth_data* n) +{ + struct auth_rrset* p, *np; + if(!n) return; + p = n->rrsets; + while(p) { + np = p->next; + auth_rrset_delete(p); + p = np; + } + free(n->name); + free(n); +} + +/** helper traverse to delete zones */ +static void +auth_data_del(rbnode_type* n, void* ATTR_UNUSED(arg)) +{ + struct auth_data* z = (struct auth_data*)n->key; + auth_data_delete(z); +} + +/** delete an auth zone structure (tree remove must be done elsewhere) */ +static void +auth_zone_delete(struct auth_zone* z, struct auth_zones* az) +{ + if(!z) return; + lock_rw_destroy(&z->lock); + traverse_postorder(&z->data, auth_data_del, NULL); + + if(az && z->rpz) { + /* keep RPZ linked list intact */ + lock_rw_wrlock(&az->rpz_lock); + if(z->rpz_az_prev) + z->rpz_az_prev->rpz_az_next = z->rpz_az_next; + else + az->rpz_first = z->rpz_az_next; + if(z->rpz_az_next) + z->rpz_az_next->rpz_az_prev = z->rpz_az_prev; + lock_rw_unlock(&az->rpz_lock); + } + if(z->rpz) + rpz_delete(z->rpz); + free(z->name); + free(z->zonefile); + free(z); +} + +struct auth_zone* +auth_zone_create(struct auth_zones* az, uint8_t* nm, size_t nmlen, + uint16_t dclass) +{ + struct auth_zone* z = (struct auth_zone*)calloc(1, sizeof(*z)); + if(!z) { + return NULL; + } + z->node.key = z; + z->dclass = dclass; + z->namelen = nmlen; + z->namelabs = dname_count_labels(nm); + z->name = memdup(nm, nmlen); + if(!z->name) { + free(z); + return NULL; + } + rbtree_init(&z->data, &auth_data_cmp); + lock_rw_init(&z->lock); + lock_protect(&z->lock, &z->name, sizeof(*z)-sizeof(rbnode_type)- + sizeof(&z->rpz_az_next)-sizeof(&z->rpz_az_prev)); + lock_rw_wrlock(&z->lock); + /* z lock protects all, except rbtree itself and the rpz linked list + * pointers, which are protected using az->lock */ + if(!rbtree_insert(&az->ztree, &z->node)) { + lock_rw_unlock(&z->lock); + auth_zone_delete(z, NULL); + log_warn("duplicate auth zone"); + return NULL; + } + return z; +} + +struct auth_zone* +auth_zone_find(struct auth_zones* az, uint8_t* nm, size_t nmlen, + uint16_t dclass) +{ + struct auth_zone key; + key.node.key = &key; + key.dclass = dclass; + key.name = nm; + key.namelen = nmlen; + key.namelabs = dname_count_labels(nm); + return (struct auth_zone*)rbtree_search(&az->ztree, &key); +} + +struct auth_xfer* +auth_xfer_find(struct auth_zones* az, uint8_t* nm, size_t nmlen, + uint16_t dclass) +{ + struct auth_xfer key; + key.node.key = &key; + key.dclass = dclass; + key.name = nm; + key.namelen = nmlen; + key.namelabs = dname_count_labels(nm); + return (struct auth_xfer*)rbtree_search(&az->xtree, &key); +} + +/** find an auth zone or sorted less-or-equal, return true if exact */ +static int +auth_zone_find_less_equal(struct auth_zones* az, uint8_t* nm, size_t nmlen, + uint16_t dclass, struct auth_zone** z) +{ + struct auth_zone key; + key.node.key = &key; + key.dclass = dclass; + key.name = nm; + key.namelen = nmlen; + key.namelabs = dname_count_labels(nm); + return rbtree_find_less_equal(&az->ztree, &key, (rbnode_type**)z); +} + + +/** find the auth zone that is above the given name */ +struct auth_zone* +auth_zones_find_zone(struct auth_zones* az, uint8_t* name, size_t name_len, + uint16_t dclass) +{ + uint8_t* nm = name; + size_t nmlen = name_len; + struct auth_zone* z; + if(auth_zone_find_less_equal(az, nm, nmlen, dclass, &z)) { + /* exact match */ + return z; + } else { + /* less-or-nothing */ + if(!z) return NULL; /* nothing smaller, nothing above it */ + /* we found smaller name; smaller may be above the name, + * but not below it. */ + nm = dname_get_shared_topdomain(z->name, name); + dname_count_size_labels(nm, &nmlen); + z = NULL; + } + + /* search up */ + while(!z) { + z = auth_zone_find(az, nm, nmlen, dclass); + if(z) return z; + if(dname_is_root(nm)) break; + dname_remove_label(&nm, &nmlen); + } + return NULL; +} + +/** find or create zone with name str. caller must have lock on az. + * returns a wrlocked zone */ +static struct auth_zone* +auth_zones_find_or_add_zone(struct auth_zones* az, char* name) +{ + uint8_t nm[LDNS_MAX_DOMAINLEN+1]; + size_t nmlen = sizeof(nm); + struct auth_zone* z; + + if(sldns_str2wire_dname_buf(name, nm, &nmlen) != 0) { + log_err("cannot parse auth zone name: %s", name); + return 0; + } + z = auth_zone_find(az, nm, nmlen, LDNS_RR_CLASS_IN); + if(!z) { + /* not found, create the zone */ + z = auth_zone_create(az, nm, nmlen, LDNS_RR_CLASS_IN); + } else { + lock_rw_wrlock(&z->lock); + } + return z; +} + +/** find or create xfer zone with name str. caller must have lock on az. + * returns a locked xfer */ +static struct auth_xfer* +auth_zones_find_or_add_xfer(struct auth_zones* az, struct auth_zone* z) +{ + struct auth_xfer* x; + x = auth_xfer_find(az, z->name, z->namelen, z->dclass); + if(!x) { + /* not found, create the zone */ + x = auth_xfer_create(az, z); + } else { + lock_basic_lock(&x->lock); + } + return x; +} + +int +auth_zone_set_zonefile(struct auth_zone* z, char* zonefile) +{ + if(z->zonefile) free(z->zonefile); + if(zonefile == NULL) { + z->zonefile = NULL; + } else { + z->zonefile = strdup(zonefile); + if(!z->zonefile) { + log_err("malloc failure"); + return 0; + } + } + return 1; +} + +/** set auth zone fallback. caller must have lock on zone */ +int +auth_zone_set_fallback(struct auth_zone* z, char* fallbackstr) +{ + if(strcmp(fallbackstr, "yes") != 0 && strcmp(fallbackstr, "no") != 0){ + log_err("auth zone fallback, expected yes or no, got %s", + fallbackstr); + return 0; + } + z->fallback_enabled = (strcmp(fallbackstr, "yes")==0); + return 1; +} + +/** create domain with the given name */ +static struct auth_data* +az_domain_create(struct auth_zone* z, uint8_t* nm, size_t nmlen) +{ + struct auth_data* n = (struct auth_data*)malloc(sizeof(*n)); + if(!n) return NULL; + memset(n, 0, sizeof(*n)); + n->node.key = n; + n->name = memdup(nm, nmlen); + if(!n->name) { + free(n); + return NULL; + } + n->namelen = nmlen; + n->namelabs = dname_count_labels(nm); + if(!rbtree_insert(&z->data, &n->node)) { + log_warn("duplicate auth domain name"); + free(n->name); + free(n); + return NULL; + } + return n; +} + +/** find domain with exactly the given name */ +static struct auth_data* +az_find_name(struct auth_zone* z, uint8_t* nm, size_t nmlen) +{ + struct auth_zone key; + key.node.key = &key; + key.name = nm; + key.namelen = nmlen; + key.namelabs = dname_count_labels(nm); + return (struct auth_data*)rbtree_search(&z->data, &key); +} + +/** Find domain name (or closest match) */ +static void +az_find_domain(struct auth_zone* z, struct query_info* qinfo, int* node_exact, + struct auth_data** node) +{ + struct auth_zone key; + key.node.key = &key; + key.name = qinfo->qname; + key.namelen = qinfo->qname_len; + key.namelabs = dname_count_labels(key.name); + *node_exact = rbtree_find_less_equal(&z->data, &key, + (rbnode_type**)node); +} + +/** find or create domain with name in zone */ +static struct auth_data* +az_domain_find_or_create(struct auth_zone* z, uint8_t* dname, + size_t dname_len) +{ + struct auth_data* n = az_find_name(z, dname, dname_len); + if(!n) { + n = az_domain_create(z, dname, dname_len); + } + return n; +} + +/** find rrset of given type in the domain */ +static struct auth_rrset* +az_domain_rrset(struct auth_data* n, uint16_t t) +{ + struct auth_rrset* rrset; + if(!n) return NULL; + rrset = n->rrsets; + while(rrset) { + if(rrset->type == t) + return rrset; + rrset = rrset->next; + } + return NULL; +} + +/** remove rrset of this type from domain */ +static void +domain_remove_rrset(struct auth_data* node, uint16_t rr_type) +{ + struct auth_rrset* rrset, *prev; + if(!node) return; + prev = NULL; + rrset = node->rrsets; + while(rrset) { + if(rrset->type == rr_type) { + /* found it, now delete it */ + if(prev) prev->next = rrset->next; + else node->rrsets = rrset->next; + auth_rrset_delete(rrset); + return; + } + prev = rrset; + rrset = rrset->next; + } +} + +/** find an rrsig index in the rrset. returns true if found */ +static int +az_rrset_find_rrsig(struct packed_rrset_data* d, uint8_t* rdata, size_t len, + size_t* index) +{ + size_t i; + for(i=d->count; icount + d->rrsig_count; i++) { + if(d->rr_len[i] != len) + continue; + if(memcmp(d->rr_data[i], rdata, len) == 0) { + *index = i; + return 1; + } + } + return 0; +} + +/** see if rdata is duplicate */ +static int +rdata_duplicate(struct packed_rrset_data* d, uint8_t* rdata, size_t len) +{ + size_t i; + for(i=0; icount + d->rrsig_count; i++) { + if(d->rr_len[i] != len) + continue; + if(memcmp(d->rr_data[i], rdata, len) == 0) + return 1; + } + return 0; +} + +/** get rrsig type covered from rdata. + * @param rdata: rdata in wireformat, starting with 16bit rdlength. + * @param rdatalen: length of rdata buffer. + * @return type covered (or 0). + */ +static uint16_t +rrsig_rdata_get_type_covered(uint8_t* rdata, size_t rdatalen) +{ + if(rdatalen < 4) + return 0; + return sldns_read_uint16(rdata+2); +} + +/** remove RR from existing RRset. Also sig, if it is a signature. + * reallocates the packed rrset for a new one, false on alloc failure */ +static int +rrset_remove_rr(struct auth_rrset* rrset, size_t index) +{ + struct packed_rrset_data* d, *old = rrset->data; + size_t i; + if(index >= old->count + old->rrsig_count) + return 0; /* index out of bounds */ + d = (struct packed_rrset_data*)calloc(1, packed_rrset_sizeof(old) - ( + sizeof(size_t) + sizeof(uint8_t*) + sizeof(time_t) + + old->rr_len[index])); + if(!d) { + log_err("malloc failure"); + return 0; + } + d->ttl = old->ttl; + d->count = old->count; + d->rrsig_count = old->rrsig_count; + if(index < d->count) d->count--; + else d->rrsig_count--; + d->trust = old->trust; + d->security = old->security; + + /* set rr_len, needed for ptr_fixup */ + d->rr_len = (size_t*)((uint8_t*)d + + sizeof(struct packed_rrset_data)); + if(index > 0) + memmove(d->rr_len, old->rr_len, (index)*sizeof(size_t)); + if(index+1 < old->count+old->rrsig_count) + memmove(&d->rr_len[index], &old->rr_len[index+1], + (old->count+old->rrsig_count - (index+1))*sizeof(size_t)); + packed_rrset_ptr_fixup(d); + + /* move over ttls */ + if(index > 0) + memmove(d->rr_ttl, old->rr_ttl, (index)*sizeof(time_t)); + if(index+1 < old->count+old->rrsig_count) + memmove(&d->rr_ttl[index], &old->rr_ttl[index+1], + (old->count+old->rrsig_count - (index+1))*sizeof(time_t)); + + /* move over rr_data */ + for(i=0; icount+d->rrsig_count; i++) { + size_t oldi; + if(i < index) oldi = i; + else oldi = i+1; + memmove(d->rr_data[i], old->rr_data[oldi], d->rr_len[i]); + } + + /* recalc ttl (lowest of remaining RR ttls) */ + if(d->count + d->rrsig_count > 0) + d->ttl = d->rr_ttl[0]; + for(i=0; icount+d->rrsig_count; i++) { + if(d->rr_ttl[i] < d->ttl) + d->ttl = d->rr_ttl[i]; + } + + free(rrset->data); + rrset->data = d; *** 14663 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Wed Feb 10 15:24:45 2021 Return-Path: Delivered-To: dev-commits-src-main@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 56459549D16; Wed, 10 Feb 2021 15:24:45 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbNq120gHz4btk; Wed, 10 Feb 2021 15:24:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3776720120; Wed, 10 Feb 2021 15:24:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11AFOjVA032248; Wed, 10 Feb 2021 15:24:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11AFOjsm032247; Wed, 10 Feb 2021 15:24:45 GMT (envelope-from git) Date: Wed, 10 Feb 2021 15:24:45 GMT Message-Id: <202102101524.11AFOjsm032247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 12ad8bdb34aa - main - usr.sbin/makefs: fix use-after-free in read_mtree_keywords() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12ad8bdb34aa990bcc4f3faa92a6e0557385d2b2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 15:24:45 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=12ad8bdb34aa990bcc4f3faa92a6e0557385d2b2 commit 12ad8bdb34aa990bcc4f3faa92a6e0557385d2b2 Author: Alex Richardson AuthorDate: 2021-02-10 15:23:23 +0000 Commit: Alex Richardson CommitDate: 2021-02-10 15:24:25 +0000 usr.sbin/makefs: fix use-after-free in read_mtree_keywords() The st variable is used as a shortcut for &node->inode->st, but in one branch just before the exit we update node->inode without changing st. Reported by: AddressSanitizer Reviewed By: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28570 --- usr.sbin/makefs/mtree.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/makefs/mtree.c b/usr.sbin/makefs/mtree.c index 63b52193b872..266315466900 100644 --- a/usr.sbin/makefs/mtree.c +++ b/usr.sbin/makefs/mtree.c @@ -783,6 +783,8 @@ read_mtree_keywords(FILE *fp, fsnode *node) free(node->inode); node->inode = curino; node->inode->nlink++; + /* Reset st since node->inode has been updated. */ + st = &node->inode->st; } } From owner-dev-commits-src-main@freebsd.org Wed Feb 10 15:25:43 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B1A72549BC3; Wed, 10 Feb 2021 15:25:43 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbNr7490Fz4cJl; Wed, 10 Feb 2021 15:25:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81BE81FDD6; Wed, 10 Feb 2021 15:25:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11AFPhYr032498; Wed, 10 Feb 2021 15:25:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11AFPh3p032497; Wed, 10 Feb 2021 15:25:43 GMT (envelope-from git) Date: Wed, 10 Feb 2021 15:25:43 GMT Message-Id: <202102101525.11AFPh3p032497@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 7676b388adbc - main - Always build the sanitizer runtimes when compiling with clang MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7676b388adbc81a2ad46b43852cd9bc7ac7fad7e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 15:25:43 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=7676b388adbc81a2ad46b43852cd9bc7ac7fad7e commit 7676b388adbc81a2ad46b43852cd9bc7ac7fad7e Author: Alex Richardson AuthorDate: 2021-02-10 15:25:14 +0000 Commit: Alex Richardson CommitDate: 2021-02-10 15:25:14 +0000 Always build the sanitizer runtimes when compiling with clang This allows instrumenting e.g. test binaries even when compiling with an external clang (e.g. CROSS_TOOLCHAIN=llvm11). I have some upcoming patches that allow building the entire base system with ASan/UBSan/etc. instrumentation and this is required in preparation for this. Reviewed By: dim, emaste Differential Revision: https://reviews.freebsd.org/D28532 --- lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Makefile b/lib/Makefile index 48276fcd361e..80b77f1fd704 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -175,7 +175,7 @@ SUBDIR.${MK_STATS}+= libstats # The libraries under libclang_rt can only be built by clang, and only make # sense to build when clang is enabled at all. Furthermore, they can only be # built for certain architectures. -.if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \ +.if ${COMPILER_TYPE} == "clang" && \ (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "i386" || \ ${MACHINE_CPUARCH} == "powerpc") From owner-dev-commits-src-main@freebsd.org Wed Feb 10 16:10:36 2021 Return-Path: Delivered-To: dev-commits-src-main@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 3D03F54B0CF; Wed, 10 Feb 2021 16:10:36 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbPqw1JLcz4g96; Wed, 10 Feb 2021 16:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FABA20A3C; Wed, 10 Feb 2021 16:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11AGAa0f093938; Wed, 10 Feb 2021 16:10:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11AGAadK093936; Wed, 10 Feb 2021 16:10:36 GMT (envelope-from git) Date: Wed, 10 Feb 2021 16:10:36 GMT Message-Id: <202102101610.11AGAadK093936@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 5c18744ea9b9 - main - vm: Honour the "noreuse" flag to vm_page_unwire_managed() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c18744ea9b94cb6a9a091a900fa4999868736e1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 16:10:36 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5c18744ea9b94cb6a9a091a900fa4999868736e1 commit 5c18744ea9b94cb6a9a091a900fa4999868736e1 Author: Mark Johnston AuthorDate: 2021-02-10 16:10:27 +0000 Commit: Mark Johnston CommitDate: 2021-02-10 16:10:27 +0000 vm: Honour the "noreuse" flag to vm_page_unwire_managed() This flag indicates that the page should be enqueued near the head of the inactive queue, skipping the LRU queue. It is used when unwiring pages from the buffer cache following direct I/O or after I/O when POSIX_FADV_NOREUSE or _DONTNEED advice was specified, or when sendfile(SF_NOCACHE) completes. For the direct I/O and sendfile cases we only enqueue the page if we decide not to free it, typically because it's mapped. Pass "noreuse" through to vm_page_release_toq() so that we actually honour the desired LRU policy for these scenarios. Reported by: bdrewery Reviewed by: alc, kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28555 --- sys/vm/vm_page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index e668bbdc6178..c36b8cdc5762 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -3989,7 +3989,7 @@ vm_page_unwire_managed(vm_page_t m, uint8_t nqueue, bool noreuse) * (i.e., the VPRC_OBJREF bit is clear), we only need to * clear leftover queue state. */ - vm_page_release_toq(m, nqueue, false); + vm_page_release_toq(m, nqueue, noreuse); } else if (old == 1) { vm_page_aflag_clear(m, PGA_DEQUEUE); } From owner-dev-commits-src-main@freebsd.org Wed Feb 10 16:42:02 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6E2E454C000; Wed, 10 Feb 2021 16:42:02 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbQXB2lLmz4jM4; Wed, 10 Feb 2021 16:42:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 474E420C70; Wed, 10 Feb 2021 16:42:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11AGg2lQ037464; Wed, 10 Feb 2021 16:42:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11AGg2JN037463; Wed, 10 Feb 2021 16:42:02 GMT (envelope-from git) Date: Wed, 10 Feb 2021 16:42:02 GMT Message-Id: <202102101642.11AGg2JN037463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 01d07b03ef2b - main - localedef: Fix bootstrapping on Ubuntu 16.04 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01d07b03ef2b59e70a25cfc4d9e438a7331c5926 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 16:42:02 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=01d07b03ef2b59e70a25cfc4d9e438a7331c5926 commit 01d07b03ef2b59e70a25cfc4d9e438a7331c5926 Author: Jessica Clarke AuthorDate: 2021-02-10 16:41:35 +0000 Commit: Jessica Clarke CommitDate: 2021-02-10 16:41:35 +0000 localedef: Fix bootstrapping on Ubuntu 16.04 Glibc's stdlib.h defines various prototypes for GNU extensions that take a locale_t. Newer versions use locale_t directly and include an internal bits/types/locale_t.h in order to get its definition, but older versions include xlocale.h for that, for which our bootstrap version is empty. Moreover it expects to use the glibc-specific __locale_t type. Thus, provide dummy definitions of both types in order to ensure the prototypes don't give any errors, and guard against the header being inadvertently included between the bootstrapping namespace.h and un-namespace.h, where locale_t is #define'd. This header is not used when bootstrapping on FreeBSD and exists solely to stub out glibc's, so this should have no impact on FreeBSD hosts. Reviewed by: arichardson, emaste (comment only) Differential Revision: https://reviews.freebsd.org/D28317 --- usr.bin/localedef/bootstrap/xlocale.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/usr.bin/localedef/bootstrap/xlocale.h b/usr.bin/localedef/bootstrap/xlocale.h index 67d1cc4116c6..05629a32f4e3 100644 --- a/usr.bin/localedef/bootstrap/xlocale.h +++ b/usr.bin/localedef/bootstrap/xlocale.h @@ -35,8 +35,21 @@ * * $FreeBSD$ */ + +#pragma once + /* - * This header only exists to avoid pulling in the host xlocale.h from - * the libc-internal headers. This is required since newer Linux GLibc no - * longer includes xlocale.h and older versions include an incompatible header. + * This header only exists to avoid pulling in the host xlocale.h from the + * libc-internal headers. New versions of glibc include bits/types/locale.h + * from stdlib.h and so get their own locale_t (and don't provide xlocale.h), + * but older versions include xlocale.h and expect to have a __locale_t. Thus + * we provide dummy definitions of both so the (unused) prototypes don't give + * errors. */ + +#ifdef locale_t +#error "Dummy xlocale.h included inside bootstrapping namespace context" +#endif + +typedef struct __dummy_host_locale *__locale_t; +typedef __locale_t locale_t; From owner-dev-commits-src-main@freebsd.org Wed Feb 10 17:09:41 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8A34454CE9E; Wed, 10 Feb 2021 17:09:41 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbR853ZS0z4llp; Wed, 10 Feb 2021 17:09:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DBBD2154F; Wed, 10 Feb 2021 17:09:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11AH9fPH065098; Wed, 10 Feb 2021 17:09:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11AH9fw1065097; Wed, 10 Feb 2021 17:09:41 GMT (envelope-from git) Date: Wed, 10 Feb 2021 17:09:41 GMT Message-Id: <202102101709.11AH9fw1065097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: fcbaf46b763a - main - systat.1: Remove Tn macros MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fcbaf46b763a91bb41fe68afdcf59a7d210bc2f7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 17:09:41 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fcbaf46b763a91bb41fe68afdcf59a7d210bc2f7 commit fcbaf46b763a91bb41fe68afdcf59a7d210bc2f7 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-02-06 13:14:20 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-02-10 17:09:27 +0000 systat.1: Remove Tn macros They are no longer supported by mdoc(7). MFC after: 1 week --- usr.bin/systat/systat.1 | 55 +++++++++++++------------------------------------ 1 file changed, 14 insertions(+), 41 deletions(-) diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1 index d2eeb2854816..7a84feaf6dac 100644 --- a/usr.bin/systat/systat.1 +++ b/usr.bin/systat/systat.1 @@ -28,7 +28,7 @@ .\" @(#)systat.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd December 5, 2016 +.Dd February 10, 2021 .Dt SYSTAT 1 .Os .Sh NAME @@ -62,14 +62,11 @@ By default .Nm displays the processes getting the largest percentage of the processor in the lower window. -Other displays show swap space usage, disk -.Tn I/O -statistics (a la +Other displays show swap space usage, disk I/O statistics (a la .Xr iostat 8 ) , virtual memory statistics (a la .Xr vmstat 8 ) , -.Tn TCP/IP -statistics, +TCP/IP statistics, and network connections (a la .Xr netstat 1 ) . .Pp @@ -189,7 +186,7 @@ is accounted to the ``idle'' process. .It Ic icmp Display, in the lower window, statistics about messages received and transmitted by the Internet Control Message Protocol -.Pq Dq Tn ICMP . +.Pq Dq ICMP . The left half of the screen displays information about received packets, and the right half displays information regarding transmitted packets. @@ -232,32 +229,21 @@ but displays statistics for IPv6 ICMP. .It Ic ip Otherwise identical to the .Ic icmp -display, except that it displays -.Tn IP -and -.Tn UDP -statistics. +display, except that it displays IP and UDP statistics. .It Ic ip6 Like the .Ic ip display, -except that it displays -.Tn IPv6 -statistics. -It does not display -.Tn UDP statistics. +except that it displays IPv6 statistics. +It does not display UDP statistics. .It Ic sctp Like .Ic icmp , -but with -.Tn SCTP -statistics. +but with SCTP statistics. .It Ic tcp Like .Ic icmp , -but with -.Tn TCP -statistics. +but with TCP statistics. .It Ic iostat Display, in the lower window, statistics about processor use and disk throughput. @@ -281,15 +267,11 @@ display; the minimum unambiguous prefix may be supplied. .Pp .Bl -tag -width Fl -compact .It Cm numbers -Show the disk -.Tn I/O -statistics in numeric form. +Show the disk I/O statistics in numeric form. Values are displayed in numeric columns which scroll downward. .It Cm bars -Show the disk -.Tn I/O -statistics in bar graph form (default). +Show the disk I/O statistics in bar graph form (default). .It Cm kbpt Toggle the display of kilobytes per transaction. (the default is to @@ -310,9 +292,7 @@ Areas known to the kernel, but not in use are shown as not available. .It Ic vmstat Take over the entire display and show a (rather crowded) compendium of statistics related to virtual memory usage, process scheduling, -device interrupts, system name translation caching, disk -.Tn I/O -etc. +device interrupts, system name translation caching, disk I/O etc. .Pp The upper left quadrant of the screen shows the number of users logged in and the load average over the last one, five, @@ -666,18 +646,11 @@ and displays appeared in .Fx 3.0 ; the notion of having different display modes for the -.Tn ICMP , -.Tn IP , -.Tn TCP , -and -.Tn UDP -statistics was stolen from the +ICMP, IP, TCP, and UDP statistics was stolen from the .Fl C option to .Xr netstat 1 -in Silicon Graphics' -.Tn IRIX -system. +in Silicon Graphics' IRIX system. .Sh BUGS Certain displays presume a minimum of 80 characters per line. Ifstat does not detect new interfaces. From owner-dev-commits-src-main@freebsd.org Wed Feb 10 17:09:44 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B0BC554D081; Wed, 10 Feb 2021 17:09:44 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbR871bKhz4lrx; Wed, 10 Feb 2021 17:09:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CED34217F6; Wed, 10 Feb 2021 17:09:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11AH9gqc065121; Wed, 10 Feb 2021 17:09:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11AH9gV3065120; Wed, 10 Feb 2021 17:09:42 GMT (envelope-from git) Date: Wed, 10 Feb 2021 17:09:42 GMT Message-Id: <202102101709.11AH9gV3065120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: e6f59be239aa - main - systat.1: Fix synopsis MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6f59be239aa17f80b44ded4779e29f5d5352b28 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 17:09:45 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e6f59be239aa17f80b44ded4779e29f5d5352b28 commit e6f59be239aa17f80b44ded4779e29f5d5352b28 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-02-10 17:02:14 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-02-10 17:09:49 +0000 systat.1: Fix synopsis systat does not have a "-display" flag. Use Ar to indicate that "display" is meant to be substituted with an actual display command. MFC after: 1 week --- usr.bin/systat/systat.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1 index 7a84feaf6dac..5ad8078a85a4 100644 --- a/usr.bin/systat/systat.1 +++ b/usr.bin/systat/systat.1 @@ -36,7 +36,7 @@ .Nd display system statistics .Sh SYNOPSIS .Nm -.Op Fl display +.Op Fl Ar display .Op Ar display-commands .Op Ar refresh-interval .Sh DESCRIPTION From owner-dev-commits-src-main@freebsd.org Wed Feb 10 18:14:00 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8228354EBEF; Wed, 10 Feb 2021 18:14:00 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbSZJ3Dhcz4ryL; Wed, 10 Feb 2021 18:14:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61CD62269D; Wed, 10 Feb 2021 18:14:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11AIE0T1056063; Wed, 10 Feb 2021 18:14:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11AIE009056062; Wed, 10 Feb 2021 18:14:00 GMT (envelope-from git) Date: Wed, 10 Feb 2021 18:14:00 GMT Message-Id: <202102101814.11AIE009056062@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 3c958f5fdfc0 - main - netgraph/ng_bridge: Add counters for the first link, too MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c958f5fdfc01b7579ea0fbfc3f15f8a85bebee9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 18:14:00 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=3c958f5fdfc01b7579ea0fbfc3f15f8a85bebee9 commit 3c958f5fdfc01b7579ea0fbfc3f15f8a85bebee9 Author: Lutz Donnerhacke AuthorDate: 2021-02-10 10:47:38 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-10 18:05:37 +0000 netgraph/ng_bridge: Add counters for the first link, too For broadcast, multicast and unknown unicast, the replication loop sends a copy of the packet to each link, beside the first one. This special path is handled later, but the counters are not updated. Factor out the common send and count actions as a function. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28537 --- sys/netgraph/ng_bridge.c | 59 +++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 29ab2c715aa7..7b03b1a2599b 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -626,6 +626,41 @@ struct ng_bridge_send_ctx { int manycast, error; }; +/* + * Update stats and send out + */ +static inline int +ng_bridge_send_data(link_cp dst, int manycast, struct mbuf *m, item_p item) { + int error = 0; + size_t len = m->m_pkthdr.len; + + if(item != NULL) + NG_FWD_NEW_DATA(error, item, dst->hook, m); + else + NG_SEND_DATA_ONLY(error, dst->hook, m); + + if (error == 0) { + counter_u64_add(dst->stats.xmitPackets, 1); + counter_u64_add(dst->stats.xmitOctets, len); + switch (manycast) { + default: /* unknown unicast */ + break; + case 1: /* multicast */ + counter_u64_add(dst->stats.xmitMulticasts, 1); + break; + case 2: /* broadcast */ + counter_u64_add(dst->stats.xmitBroadcasts, 1); + break; + } + } + + return (error); +} + +/* + * Loop body for sending to multiple destinations + * return 0 to stop looping + */ static int ng_bridge_send_ctx(hook_p dst, void *arg) { @@ -664,22 +699,8 @@ ng_bridge_send_ctx(hook_p dst, void *arg) return (0); /* abort loop */ } - /* Update stats */ - counter_u64_add(destLink->stats.xmitPackets, 1); - counter_u64_add(destLink->stats.xmitOctets, m2->m_pkthdr.len); - switch (ctx->manycast) { - default: /* unknown unicast */ - break; - case 1: /* multicast */ - counter_u64_add(destLink->stats.xmitMulticasts, 1); - break; - case 2: /* broadcast */ - counter_u64_add(destLink->stats.xmitBroadcasts, 1); - break; - } - /* Send packet */ - NG_SEND_DATA_ONLY(error, destLink->hook, m2); + error = ng_bridge_send_data(destLink, ctx->manycast, m2, NULL); if(error) ctx->error = error; return (1); @@ -820,10 +841,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) } /* Deliver packet out the destination link */ - counter_u64_add(destLink->stats.xmitPackets, 1); - counter_u64_add(destLink->stats.xmitOctets, ctx.m->m_pkthdr.len); - NG_FWD_NEW_DATA(ctx.error, item, destLink->hook, ctx.m); - return (ctx.error); + return (ng_bridge_send_data(destLink, ctx.manycast, ctx.m, item)); } /* Destination host is not known */ @@ -844,8 +862,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) * If we've sent all the others, send the original * on the first link we found. */ - NG_FWD_NEW_DATA(ctx.error, item, ctx.foundFirst->hook, ctx.m); - return (ctx.error); + return (ng_bridge_send_data(ctx.foundFirst, ctx.manycast, ctx.m, item)); } /* From owner-dev-commits-src-main@freebsd.org Wed Feb 10 19:38:10 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4B8A7528B92 for ; Wed, 10 Feb 2021 19:38:10 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 4DbVRP4fMJz3Drh for ; Wed, 10 Feb 2021 19:38:09 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-lf1-f52.google.com with SMTP id d3so4579800lfg.10 for ; Wed, 10 Feb 2021 11:38:09 -0800 (PST) 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=NJsci89OA2fPyZGPJmBk9h98HhBAcJbE6RJBJ/M+owk=; b=FzEcngTSFPwvvBrmIaFkkcdwujh8Ksq4i32e53mHUi32KzWINpPZO5QEphaOpFm5sz 1TBdGLnWzFY4Yj4HW2lrbmQsf+Fyq6Eqda6YlezUae08ALf0tnGUeltB45Bbg9TBNkeG LPGhhOfm8lBiUcUEqxfdYMQYxUOqMhhxUCVv3FblzzfLPGZ6oAiTU7Dg7uioCgnwq81G VIY7b4bksYW2sGVZZ/SG2bt5GNANGCHZUz7a6nocWjLXwTGxux4/vYue+CYEKW3wXETT dw31usbwCQwXGUizTWETevg0AMcmm+mxKaaS3Lp88tSl9sNcEjWODIjEMvVoDCIwWvXf 5GlQ== X-Gm-Message-State: AOAM532869ryrOubQYbPXl0Hty5dTRoRoBhZ1VVmmmmcMv576/MHajIs PWFesT5QwGE1/E6e3Wtbhz9r8SdypNFazA== X-Google-Smtp-Source: ABdhPJxc64mr8NsFjaWTpoyN/1yBMkNfXkZfH540/bwI6jOGMUH7ZLz3LF8aJieTDmrFQAYWSAEJTg== X-Received: by 2002:a19:2341:: with SMTP id j62mr2399736lfj.413.1612985887705; Wed, 10 Feb 2021 11:38:07 -0800 (PST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com. [209.85.167.50]) by smtp.gmail.com with ESMTPSA id f2sm436558lfc.240.2021.02.10.11.38.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Feb 2021 11:38:07 -0800 (PST) Received: by mail-lf1-f50.google.com with SMTP id d3so4579690lfg.10 for ; Wed, 10 Feb 2021 11:38:07 -0800 (PST) X-Received: by 2002:a05:6512:2014:: with SMTP id a20mr2351086lfb.437.1612985886673; Wed, 10 Feb 2021 11:38:06 -0800 (PST) MIME-Version: 1.0 References: <202102042333.114NXowE086993@gitrepo.freebsd.org> In-Reply-To: From: Eric Joyner Date: Wed, 10 Feb 2021 11:37:55 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 7d4dceec1030 - main - ixl(4): Fix VLAN HW filtering To: Kyle Evans Cc: Krzysztof Galazka , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DbVRP4fMJz3Drh X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of ricera10@gmail.com designates 209.85.167.52 as permitted sender) smtp.mailfrom=ricera10@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[erj@freebsd.org,ricera10@gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.167.52:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[erj@freebsd.org,ricera10@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[209.85.167.52:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.52:from]; R_DKIM_NA(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.52:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-main] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 19:38:10 -0000 Yeah, Internally we have the ixl and iavf drivers split up so that they no longer share source and have independent code bases, but that change hasn't made it upstream yet. Doing that would fix the dependency issue, so I'll see about doing that ASAP, possibly for 13.0. I recently came back from a long vacation, so I have to catch up on all of these things. :( - Eric On Sat, Feb 6, 2021 at 10:32 AM Kyle Evans wrote: > On Sat, Feb 6, 2021 at 12:30 PM Kyle Evans wrote: > > > > On Thu, Feb 4, 2021 at 5:34 PM Eric Joyner wrote: > > > > > > The branch main has been updated by erj: > > > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=7d4dceec103039e2b2fa90793ceeb71a8d6684aa > > > > > > commit 7d4dceec103039e2b2fa90793ceeb71a8d6684aa > > > Author: Krzysztof Galazka > > > AuthorDate: 2021-02-03 23:22:55 +0000 > > > Commit: Eric Joyner > > > CommitDate: 2021-02-04 23:33:42 +0000 > > > > > > ixl(4): Fix VLAN HW filtering > > > > > > X700 family of controllers has limited number of available VLAN > > > HW filters. Driver did not handle properly a case when user > > > assigned more VLANs to the interface which had all filters > > > already in use. Fix that by disabling HW filtering when > > > it is impossible to create filters for all requested VLANs. > > > Keep track of registered VLANs using bitstring to be able > > > to re-enable HW filtering when number of requested VLANs > > > drops below the limit. > > > > > > Also switch all allocations to use M_IXL malloc type > > > to ease detecting memory leaks in the driver. > > > > > > > Hi, > > > > This adds a dependency on `device ixl` for `device iavf` since M_IXL > > is defined in ixl_pf_main.c, but I think that particular part should > > be partially reverted anyways. There's an M_IAVF already that's more > > appropriate for i40e_osdep.c -- proposed patch here: > > > https://people.freebsd.org/~kevans/0001-ixl-switch-i40e_osdep.c-allocations-to-M_IAVF.patch > > > > Ah crud, nope. I missed that i40e_osdep is pulled in for ixl as well. :-( > From owner-dev-commits-src-main@freebsd.org Wed Feb 10 20:17:08 2021 Return-Path: Delivered-To: dev-commits-src-main@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 35482529769; Wed, 10 Feb 2021 20:17:08 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbWJN11ZHz3Gdr; Wed, 10 Feb 2021 20:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1574A24017; Wed, 10 Feb 2021 20:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11AKH84e012971; Wed, 10 Feb 2021 20:17:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11AKH87E012970; Wed, 10 Feb 2021 20:17:08 GMT (envelope-from git) Date: Wed, 10 Feb 2021 20:17:08 GMT Message-Id: <202102102017.11AKH87E012970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: ea3b6abf3f2f - main - arm64: Order sys/conf/files.arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea3b6abf3f2fd7db11a95ea10cc4b6d136958f8d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 20:17:08 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=ea3b6abf3f2fd7db11a95ea10cc4b6d136958f8d commit ea3b6abf3f2fd7db11a95ea10cc4b6d136958f8d Author: Emmanuel Vadot AuthorDate: 2021-02-04 13:54:22 +0000 Commit: Emmanuel Vadot CommitDate: 2021-02-10 20:15:19 +0000 arm64: Order sys/conf/files.arm64 This is now easier to read and see what's compiled-in No functional changes intended. MFC after: 3 days --- sys/conf/files.arm64 | 894 +++++++++++++++++++++++++++------------------------ 1 file changed, 474 insertions(+), 420 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 42ec3b2787b1..8abe5d194d90 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -1,212 +1,84 @@ # $FreeBSD$ -cloudabi32_vdso.o optional compat_cloudabi32 \ - dependency "$S/contrib/cloudabi/cloudabi_vdso_armv6_on_64bit.S" \ - compile-with "${CC} -x assembler-with-cpp -m32 -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_armv6_on_64bit.S -o ${.TARGET}" \ - no-obj no-implicit-rule \ - clean "cloudabi32_vdso.o" -# -cloudabi32_vdso_blob.o optional compat_cloudabi32 \ - dependency "cloudabi32_vdso.o" \ - compile-with "${OBJCOPY} --input-target binary --output-target elf64-littleaarch64 --binary-architecture aarch64 cloudabi32_vdso.o ${.TARGET}" \ - no-implicit-rule \ - clean "cloudabi32_vdso_blob.o" -# -cloudabi64_vdso.o optional compat_cloudabi64 \ - dependency "$S/contrib/cloudabi/cloudabi_vdso_aarch64.S" \ - compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_aarch64.S -o ${.TARGET}" \ - no-obj no-implicit-rule \ - clean "cloudabi64_vdso.o" -# -cloudabi64_vdso_blob.o optional compat_cloudabi64 \ - dependency "cloudabi64_vdso.o" \ - compile-with "${OBJCOPY} --input-target binary --output-target elf64-littleaarch64 --binary-architecture aarch64 cloudabi64_vdso.o ${.TARGET}" \ - no-implicit-rule \ - clean "cloudabi64_vdso_blob.o" -# -# Allwinner common files -arm/allwinner/a10_timer.c optional a10_timer fdt -arm/allwinner/a10_codec.c optional sound a10_codec -arm/allwinner/a31_dmac.c optional a31_dmac -arm/allwinner/sunxi_dma_if.m optional a31_dmac -arm/allwinner/aw_cir.c optional evdev aw_cir fdt -arm/allwinner/aw_dwc3.c optional aw_dwc3 fdt -arm/allwinner/aw_gpio.c optional gpio aw_gpio fdt -arm/allwinner/aw_mmc.c optional mmc aw_mmc fdt | mmccam aw_mmc fdt -arm/allwinner/aw_nmi.c optional aw_nmi fdt \ - compile-with "${NORMAL_C} -I$S/contrib/device-tree/include" -arm/allwinner/aw_pwm.c optional aw_pwm fdt -arm/allwinner/aw_rsb.c optional aw_rsb fdt -arm/allwinner/aw_rtc.c optional aw_rtc fdt -arm/allwinner/aw_sid.c optional aw_sid nvmem fdt -arm/allwinner/aw_spi.c optional aw_spi fdt -arm/allwinner/aw_syscon.c optional aw_syscon ext_resources syscon fdt -arm/allwinner/aw_thermal.c optional aw_thermal nvmem fdt -arm/allwinner/aw_usbphy.c optional ehci aw_usbphy fdt -arm/allwinner/aw_usb3phy.c optional xhci aw_usbphy fdt -arm/allwinner/aw_wdog.c optional aw_wdog fdt -arm/allwinner/axp81x.c optional axp81x fdt -arm/allwinner/if_awg.c optional awg ext_resources syscon aw_sid nvmem fdt +## +## Kernel +## -# Allwinner clock driver -arm/allwinner/clkng/aw_ccung.c optional aw_ccu fdt -arm/allwinner/clkng/aw_clk_frac.c optional aw_ccu fdt -arm/allwinner/clkng/aw_clk_m.c optional aw_ccu fdt -arm/allwinner/clkng/aw_clk_mipi.c optional aw_ccu fdt -arm/allwinner/clkng/aw_clk_nkmp.c optional aw_ccu fdt -arm/allwinner/clkng/aw_clk_nm.c optional aw_ccu fdt -arm/allwinner/clkng/aw_clk_nmm.c optional aw_ccu fdt -arm/allwinner/clkng/aw_clk_np.c optional aw_ccu fdt -arm/allwinner/clkng/aw_clk_prediv_mux.c optional aw_ccu fdt -arm/allwinner/clkng/ccu_a64.c optional soc_allwinner_a64 aw_ccu fdt -arm/allwinner/clkng/ccu_h3.c optional soc_allwinner_h5 aw_ccu fdt -arm/allwinner/clkng/ccu_h6.c optional soc_allwinner_h6 aw_ccu fdt -arm/allwinner/clkng/ccu_h6_r.c optional soc_allwinner_h6 aw_ccu fdt -arm/allwinner/clkng/ccu_sun8i_r.c optional aw_ccu fdt -arm/allwinner/clkng/ccu_de2.c optional aw_ccu fdt +kern/msi_if.m optional intrng +kern/pic_if.m optional intrng +kern/subr_devmap.c standard +kern/subr_intr.c optional intrng +kern/subr_physmem.c standard +libkern/bcmp.c standard +libkern/memcmp.c standard \ + compile-with "${NORMAL_C:N-fsanitize*}" +libkern/memset.c standard \ + compile-with "${NORMAL_C:N-fsanitize*}" +libkern/strlen.c standard +libkern/arm64/crc32c_armv8.S standard + +arm/arm/generic_timer.c standard +arm/arm/gic.c standard +arm/arm/gic_acpi.c optional acpi +arm/arm/gic_fdt.c optional fdt +arm/arm/pmu.c standard +arm/arm/pmu_fdt.c optional fdt +arm64/acpica/acpi_iort.c optional acpi +arm64/acpica/acpi_machdep.c optional acpi +arm64/acpica/OsdEnvironment.c optional acpi +arm64/acpica/acpi_wakeup.c optional acpi +arm64/acpica/pci_cfgreg.c optional acpi pci +arm64/arm64/autoconf.c standard +arm64/arm64/bus_machdep.c standard +arm64/arm64/bus_space_asm.S standard +arm64/arm64/busdma_bounce.c standard +arm64/arm64/busdma_machdep.c standard +arm64/arm64/bzero.S standard +arm64/arm64/clock.c standard +arm64/arm64/copyinout.S standard +arm64/arm64/cpu_errata.c standard +arm64/arm64/cpufunc_asm.S standard +arm64/arm64/db_disasm.c optional ddb +arm64/arm64/db_interface.c optional ddb +arm64/arm64/db_trace.c optional ddb +arm64/arm64/debug_monitor.c standard +arm64/arm64/disassem.c optional ddb +arm64/arm64/dump_machdep.c standard +arm64/arm64/efirt_machdep.c optional efirt +arm64/arm64/elf32_machdep.c optional compat_freebsd32 +arm64/arm64/elf_machdep.c standard +arm64/arm64/exception.S standard +arm64/arm64/freebsd32_machdep.c optional compat_freebsd32 +arm64/arm64/gdb_machdep.c optional gdb +arm64/arm64/gicv3_its.c optional intrng fdt +arm64/arm64/gic_v3.c standard +arm64/arm64/gic_v3_acpi.c optional acpi +arm64/arm64/gic_v3_fdt.c optional fdt +arm64/arm64/identcpu.c standard +arm64/arm64/in_cksum.c optional inet | inet6 +arm64/arm64/locore.S standard no-obj +arm64/arm64/machdep.c standard +arm64/arm64/machdep_boot.c standard +arm64/arm64/mem.c standard +arm64/arm64/memcpy.S standard +arm64/arm64/memmove.S standard +arm64/arm64/minidump_machdep.c standard +arm64/arm64/mp_machdep.c optional smp +arm64/arm64/nexus.c standard +arm64/arm64/ofw_machdep.c optional fdt +arm64/arm64/pmap.c standard +arm64/arm64/stack_machdep.c optional ddb | stack +arm64/arm64/support.S standard +arm64/arm64/swtch.S standard +arm64/arm64/sys_machdep.c standard +arm64/arm64/trap.c standard +arm64/arm64/uio_machdep.c standard +arm64/arm64/uma_machdep.c standard +arm64/arm64/undefined.c standard +arm64/arm64/unwind.c optional ddb | kdtrace_hooks | stack +arm64/arm64/vfp.c standard +arm64/arm64/vm_machdep.c standard -# Allwinner padconf files -arm/allwinner/a64/a64_padconf.c optional soc_allwinner_a64 fdt -arm/allwinner/a64/a64_r_padconf.c optional soc_allwinner_a64 fdt -arm/allwinner/h3/h3_padconf.c optional soc_allwinner_h5 fdt -arm/allwinner/h3/h3_r_padconf.c optional soc_allwinner_h5 fdt -arm/allwinner/h6/h6_padconf.c optional soc_allwinner_h6 fdt -arm/allwinner/h6/h6_r_padconf.c optional soc_allwinner_h6 fdt - -arm/annapurna/alpine/alpine_ccu.c optional al_ccu fdt -arm/annapurna/alpine/alpine_nb_service.c optional al_nb_service fdt -arm/annapurna/alpine/alpine_pci.c optional al_pci fdt -arm/annapurna/alpine/alpine_pci_msix.c optional al_pci fdt -arm/annapurna/alpine/alpine_serdes.c optional al_serdes fdt \ - no-depend \ - compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" -arm/arm/generic_timer.c standard -arm/arm/gic.c standard -arm/arm/gic_acpi.c optional acpi -arm/arm/gic_fdt.c optional fdt -arm/arm/pmu.c standard -arm/arm/pmu_fdt.c optional fdt -arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq fdt \ - compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" -arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc fdt -arm/broadcom/bcm2835/bcm2835_clkman.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm2835_cpufreq.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm2835_dma.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm2835_fbd.c optional vt soc_brcm_bcm2837 fdt | vt soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm2835_firmware.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev bcm2835_ft5406 fdt -arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio soc_brcm_bcm2837 fdt | gpio soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm2835_intr.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm2835_mbox.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm2835_rng.c optional !random_loadable soc_brcm_bcm2837 fdt | !random_loadable soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci soc_brcm_bcm2837 fdt | sdhci soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm2835_sdhost.c optional sdhci soc_brcm_bcm2837 fdt | sdhci soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi fdt -arm/broadcom/bcm2835/bcm2835_vcbus.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm2835_vcio.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm2835_wdog.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt -arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt soc_brcm_bcm2837 | dwcotg fdt soc_brcm_bcm2838 -arm/broadcom/bcm2835/bcm2838_pci.c optional soc_brcm_bcm2838 fdt pci -arm/broadcom/bcm2835/bcm2838_xhci.c optional soc_brcm_bcm2838 fdt pci xhci -arm/broadcom/bcm2835/raspberrypi_gpio.c optional soc_brcm_bcm2837 gpio | soc_brcm_bcm2838 gpio -arm/freescale/vybrid/vf_i2c.c optional vf_i2c iicbus SOC_NXP_LS -arm/mv/a37x0_gpio.c optional a37x0_gpio gpio fdt -arm/mv/a37x0_iic.c optional a37x0_iic iicbus fdt -arm/mv/a37x0_spi.c optional a37x0_spi spibus fdt -arm/mv/armada38x/armada38x_rtc.c optional mv_rtc fdt -arm/mv/gpio.c optional mv_gpio fdt -arm/mv/mvebu_gpio.c optional mv_gpio fdt -arm/mv/mvebu_pinctrl.c optional mvebu_pinctrl fdt -arm/mv/mv_ap806_clock.c optional SOC_MARVELL_8K fdt -arm/mv/mv_ap806_gicp.c optional mv_ap806_gicp fdt -arm/mv/mv_ap806_sei.c optional mv_ap806_sei fdt -arm/mv/mv_cp110_clock.c optional SOC_MARVELL_8K fdt -arm/mv/mv_cp110_icu.c optional mv_cp110_icu fdt -arm/mv/mv_cp110_icu_bus.c optional mv_cp110_icu fdt -arm/mv/mv_thermal.c optional SOC_MARVELL_8K mv_thermal fdt -arm/mv/armada38x/armada38x_rtc.c optional mv_rtc fdt -arm/nvidia/tegra_abpmisc.c optional fdt soc_nvidia_tegra210 -arm/nvidia/tegra_ahci.c optional fdt soc_nvidia_tegra210 -arm/nvidia/tegra_efuse.c optional fdt soc_nvidia_tegra210 -arm/nvidia/tegra_ehci.c optional fdt soc_nvidia_tegra210 -arm/nvidia/tegra_gpio.c optional fdt soc_nvidia_tegra210 -arm/nvidia/tegra_i2c.c optional fdt soc_nvidia_tegra210 -arm/nvidia/tegra_lic.c optional fdt soc_nvidia_tegra210 -arm/nvidia/tegra_mc.c optional fdt soc_nvidia_tegra210 -arm/nvidia/tegra_pcie.c optional fdt soc_nvidia_tegra210 -arm/nvidia/tegra_sdhci.c optional fdt soc_nvidia_tegra210 -arm/nvidia/tegra_soctherm_if.m optional fdt soc_nvidia_tegra210 -arm/nvidia/tegra_soctherm.c optional fdt soc_nvidia_tegra210 -arm/nvidia/tegra_uart.c optional fdt soc_nvidia_tegra210 -arm/nvidia/tegra_usbphy.c optional fdt soc_nvidia_tegra210 -arm/nvidia/tegra_xhci.c optional fdt soc_nvidia_tegra210 -arm/xilinx/uart_dev_cdnc.c optional uart soc_xilinx_zynq -arm64/acpica/acpi_iort.c optional acpi -arm64/acpica/acpi_machdep.c optional acpi -arm64/acpica/OsdEnvironment.c optional acpi -arm64/acpica/acpi_wakeup.c optional acpi -arm64/acpica/pci_cfgreg.c optional acpi pci -arm64/arm64/autoconf.c standard -arm64/arm64/bus_machdep.c standard -arm64/arm64/bus_space_asm.S standard -arm64/arm64/busdma_bounce.c standard -arm64/arm64/busdma_machdep.c standard -arm64/arm64/bzero.S standard -arm64/arm64/clock.c standard -arm64/arm64/copyinout.S standard -arm64/arm64/cpu_errata.c standard -arm64/arm64/cpufunc_asm.S standard -arm64/arm64/db_disasm.c optional ddb -arm64/arm64/db_interface.c optional ddb -arm64/arm64/db_trace.c optional ddb -arm64/arm64/debug_monitor.c standard -arm64/arm64/disassem.c optional ddb -arm64/arm64/dump_machdep.c standard -arm64/arm64/efirt_machdep.c optional efirt -arm64/arm64/elf32_machdep.c optional compat_freebsd32 -arm64/arm64/elf_machdep.c standard -arm64/arm64/exception.S standard -arm64/arm64/freebsd32_machdep.c optional compat_freebsd32 -arm64/arm64/gdb_machdep.c optional gdb -arm64/arm64/gicv3_its.c optional intrng fdt -arm64/arm64/gic_v3.c standard -arm64/arm64/gic_v3_acpi.c optional acpi -arm64/arm64/gic_v3_fdt.c optional fdt -arm64/arm64/identcpu.c standard -arm64/arm64/in_cksum.c optional inet | inet6 -arm64/arm64/locore.S standard no-obj -arm64/arm64/machdep.c standard -arm64/arm64/machdep_boot.c standard -arm64/arm64/mem.c standard -arm64/arm64/memcpy.S standard -arm64/arm64/memmove.S standard -arm64/arm64/minidump_machdep.c standard -arm64/arm64/mp_machdep.c optional smp -arm64/arm64/nexus.c standard -arm64/arm64/ofw_machdep.c optional fdt -arm64/arm64/pmap.c standard -arm64/arm64/stack_machdep.c optional ddb | stack -arm64/arm64/support.S standard -arm64/arm64/swtch.S standard -arm64/arm64/sys_machdep.c standard -arm64/arm64/trap.c standard -arm64/arm64/uio_machdep.c standard -arm64/arm64/uma_machdep.c standard -arm64/arm64/undefined.c standard -arm64/arm64/unwind.c optional ddb | kdtrace_hooks | stack -arm64/arm64/vfp.c standard -arm64/arm64/vm_machdep.c standard -arm64/broadcom/brcmmdio/mdio_mux_iproc.c optional fdt -arm64/broadcom/brcmmdio/mdio_nexus_iproc.c optional fdt -arm64/broadcom/brcmmdio/mdio_ns2_pcie_phy.c optional fdt pci -arm64/broadcom/genet/if_genet.c optional SOC_BRCM_BCM2838 fdt genet -arm64/cavium/thunder_pcie_fdt.c optional soc_cavm_thunderx pci fdt -arm64/cavium/thunder_pcie_pem.c optional soc_cavm_thunderx pci -arm64/cavium/thunder_pcie_pem_fdt.c optional soc_cavm_thunderx pci fdt -arm64/cavium/thunder_pcie_common.c optional soc_cavm_thunderx pci -arm64/cloudabi32/cloudabi32_sysvec.c optional compat_cloudabi32 -arm64/cloudabi64/cloudabi64_sysvec.c optional compat_cloudabi64 arm64/coresight/coresight.c standard arm64/coresight/coresight_acpi.c optional acpi arm64/coresight/coresight_fdt.c optional fdt @@ -225,286 +97,468 @@ arm64/coresight/coresight_replicator_fdt.c optional fdt arm64/coresight/coresight_tmc.c standard arm64/coresight/coresight_tmc_acpi.c optional acpi arm64/coresight/coresight_tmc_fdt.c optional fdt -arm64/intel/firmware.c optional soc_intel_stratix10 -arm64/intel/stratix10-soc-fpga-mgr.c optional soc_intel_stratix10 -arm64/intel/stratix10-svc.c optional soc_intel_stratix10 + arm64/iommu/iommu.c optional iommu arm64/iommu/iommu_if.m optional iommu arm64/iommu/smmu.c optional iommu arm64/iommu/smmu_acpi.c optional acpi iommu arm64/iommu/smmu_quirks.c optional iommu -arm64/nvidia/tegra210/max77620.c optional fdt soc_nvidia_tegra210 -arm64/nvidia/tegra210/max77620_gpio.c optional fdt soc_nvidia_tegra210 -arm64/nvidia/tegra210/max77620_regulators.c optional fdt soc_nvidia_tegra210 -arm64/nvidia/tegra210/max77620_rtc.c optional fdt soc_nvidia_tegra210 -arm64/nvidia/tegra210/tegra210_car.c optional fdt soc_nvidia_tegra210 -arm64/nvidia/tegra210/tegra210_clk_per.c optional fdt soc_nvidia_tegra210 -arm64/nvidia/tegra210/tegra210_clk_pll.c optional fdt soc_nvidia_tegra210 -arm64/nvidia/tegra210/tegra210_clk_super.c optional fdt soc_nvidia_tegra210 -arm64/nvidia/tegra210/tegra210_coretemp.c optional fdt soc_nvidia_tegra210 -arm64/nvidia/tegra210/tegra210_cpufreq.c optional fdt soc_nvidia_tegra210 -arm64/nvidia/tegra210/tegra210_pinmux.c optional fdt soc_nvidia_tegra210 -arm64/nvidia/tegra210/tegra210_pmc.c optional fdt soc_nvidia_tegra210 -arm64/nvidia/tegra210/tegra210_xusbpadctl.c optional fdt soc_nvidia_tegra210 -arm64/qoriq/ls1046_gpio.c optional ls1046_gpio gpio fdt SOC_NXP_LS -arm64/qoriq/qoriq_dw_pci.c optional pci fdt SOC_NXP_LS -arm64/qoriq/qoriq_therm.c optional pci fdt SOC_NXP_LS -arm64/qoriq/qoriq_therm_if.m optional pci fdt SOC_NXP_LS -arm64/qoriq/clk/ls1046a_clkgen.c optional clk SOC_NXP_LS -arm64/qoriq/clk/lx2160a_clkgen.c optional clk SOC_NXP_LS -arm64/qoriq/clk/qoriq_clk_pll.c optional clk SOC_NXP_LS -arm64/qoriq/clk/qoriq_clkgen.c optional clk SOC_NXP_LS -arm64/qualcomm/qcom_gcc.c optional qcom_gcc fdt -contrib/vchiq/interface/compat/vchi_bsd.c optional vchiq soc_brcm_bcm2837 \ - compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" -contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c optional vchiq soc_brcm_bcm2837 \ - compile-with "${NORMAL_C} -Wno-unused -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" -contrib/vchiq/interface/vchiq_arm/vchiq_arm.c optional vchiq soc_brcm_bcm2837 \ - compile-with "${NORMAL_C} -Wno-unused -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" -contrib/vchiq/interface/vchiq_arm/vchiq_connected.c optional vchiq soc_brcm_bcm2837 \ - compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" -contrib/vchiq/interface/vchiq_arm/vchiq_core.c optional vchiq soc_brcm_bcm2837 \ - compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" -contrib/vchiq/interface/vchiq_arm/vchiq_kern_lib.c optional vchiq soc_brcm_bcm2837 \ - compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" -contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c optional vchiq soc_brcm_bcm2837 \ - compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" -contrib/vchiq/interface/vchiq_arm/vchiq_shim.c optional vchiq soc_brcm_bcm2837 \ - compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" -contrib/vchiq/interface/vchiq_arm/vchiq_util.c optional vchiq soc_brcm_bcm2837 \ - compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" -crypto/armv8/armv8_crypto.c optional armv8crypto -armv8_crypto_wrap.o optional armv8crypto \ +dev/iommu/busdma_iommu.c optional iommu +dev/iommu/iommu_gas.c optional iommu + +crypto/armv8/armv8_crypto.c optional armv8crypto +armv8_crypto_wrap.o optional armv8crypto \ dependency "$S/crypto/armv8/armv8_crypto_wrap.c" \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ ${WERROR} ${NO_WCAST_QUAL} ${PROF} -march=armv8-a+crypto ${.IMPSRC}" \ no-implicit-rule \ clean "armv8_crypto_wrap.o" -aesv8-armx.o optional armv8crypto \ +aesv8-armx.o optional armv8crypto \ dependency "$S/crypto/openssl/aarch64/aesv8-armx.S" \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ -I$S/crypto/openssl/crypto ${WERROR} ${NO_WCAST_QUAL} ${PROF} -march=armv8-a+crypto ${.IMPSRC}" \ no-implicit-rule \ clean "aesv8-armx.o" -ghashv8-armx.o optional armv8crypto \ +ghashv8-armx.o optional armv8crypto \ dependency "$S/crypto/openssl/aarch64/ghashv8-armx.S" \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ -I$S/crypto/openssl/crypto ${WERROR} ${NO_WCAST_QUAL} ${PROF} -march=armv8-a+crypto ${.IMPSRC}" \ no-implicit-rule \ clean "ghashv8-armx.o" -crypto/des/des_enc.c optional netsmb -crypto/openssl/ossl_aarch64.c optional ossl -crypto/openssl/aarch64/sha1-armv8.S optional ossl \ + +crypto/des/des_enc.c optional netsmb +crypto/openssl/ossl_aarch64.c optional ossl +crypto/openssl/aarch64/sha1-armv8.S optional ossl \ compile-with "${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${PROF} ${.IMPSRC}" -crypto/openssl/aarch64/sha256-armv8.S optional ossl \ +crypto/openssl/aarch64/sha256-armv8.S optional ossl \ compile-with "${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${PROF} ${.IMPSRC}" -crypto/openssl/aarch64/sha512-armv8.S optional ossl \ +crypto/openssl/aarch64/sha512-armv8.S optional ossl \ compile-with "${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${PROF} ${.IMPSRC}" -dev/acpica/acpi_bus_if.m optional acpi -dev/acpica/acpi_if.m optional acpi -dev/acpica/acpi_pci_link.c optional acpi pci -dev/acpica/acpi_pcib.c optional acpi pci -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 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 -dev/gpio/pl061_fdt.c optional pl061 gpio fdt -dev/hwpmc/hwpmc_arm64.c optional hwpmc -dev/hwpmc/hwpmc_arm64_md.c optional hwpmc -dev/ice/if_ice_iflib.c optional ice pci \ + +dev/acpica/acpi_bus_if.m optional acpi +dev/acpica/acpi_if.m optional acpi +dev/acpica/acpi_pci_link.c optional acpi pci +dev/acpica/acpi_pcib.c optional acpi pci +dev/acpica/acpi_pxm.c optional acpi +dev/ahci/ahci_generic.c optional ahci + +cddl/dev/dtrace/aarch64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" +cddl/dev/dtrace/aarch64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" +cddl/dev/fbt/aarch64/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" + +## +## Device drivers +## + +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 +dev/gpio/pl061_fdt.c optional pl061 gpio fdt + +dev/hwpmc/hwpmc_arm64.c optional hwpmc +dev/hwpmc/hwpmc_arm64_md.c optional hwpmc + +dev/ice/if_ice_iflib.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_lib.c optional ice pci \ +dev/ice/ice_lib.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_osdep.c optional ice pci \ +dev/ice/ice_osdep.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_resmgr.c optional ice pci \ +dev/ice/ice_resmgr.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_strings.c optional ice pci \ +dev/ice/ice_strings.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_iflib_recovery_txrx.c optional ice pci \ +dev/ice/ice_iflib_recovery_txrx.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_iflib_txrx.c optional ice pci \ +dev/ice/ice_iflib_txrx.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_common.c optional ice pci \ +dev/ice/ice_common.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_controlq.c optional ice pci \ +dev/ice/ice_controlq.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_dcb.c optional ice pci \ +dev/ice/ice_dcb.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_flex_pipe.c optional ice pci \ +dev/ice/ice_flex_pipe.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_flow.c optional ice pci \ +dev/ice/ice_flow.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_nvm.c optional ice pci \ +dev/ice/ice_nvm.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_sched.c optional ice pci \ +dev/ice/ice_sched.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_sriov.c optional ice pci \ +dev/ice/ice_sriov.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_switch.c optional ice pci \ +dev/ice/ice_switch.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" -ice_ddp.c optional ice_ddp \ +ice_ddp.c optional ice_ddp \ compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031000 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" -ice_ddp.fwo optional ice_ddp \ +ice_ddp.fwo optional ice_ddp \ dependency "ice_ddp.fw" \ compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "ice_ddp.fwo" -ice_ddp.fw optional ice_ddp \ +ice_ddp.fw optional ice_ddp \ dependency "$S/contrib/dev/ice/ice-1.3.16.0.pkg" \ compile-with "${CP} $S/contrib/dev/ice/ice-1.3.16.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" -dev/iicbus/sy8106a.c optional sy8106a fdt -dev/iicbus/twsi/mv_twsi.c optional twsi fdt -dev/iicbus/twsi/a10_twsi.c optional twsi fdt -dev/iicbus/twsi/twsi.c optional twsi fdt -dev/iommu/busdma_iommu.c optional iommu -dev/iommu/iommu_gas.c optional iommu -dev/ipmi/ipmi.c optional ipmi -dev/ipmi/ipmi_acpi.c optional ipmi acpi -dev/ipmi/ipmi_kcs.c optional ipmi -dev/ipmi/ipmi_smic.c optional ipmi -dev/mbox/mbox_if.m optional soc_brcm_bcm2837 -dev/mmc/host/dwmmc.c optional dwmmc fdt -dev/mmc/host/dwmmc_altera.c optional dwmmc dwmmc_altera fdt -dev/mmc/host/dwmmc_hisi.c optional dwmmc dwmmc_hisi fdt -dev/mmc/host/dwmmc_rockchip.c optional dwmmc rk_dwmmc fdt -dev/neta/if_mvneta_fdt.c optional neta fdt -dev/neta/if_mvneta.c optional neta mdio mii -dev/ofw/ofw_cpu.c optional fdt -dev/ofw/ofwpci.c optional fdt pci -dev/pci/controller/pci_n1sdp.c optional pci_n1sdp acpi -dev/pci/pci_host_generic.c optional pci -dev/pci/pci_host_generic_acpi.c optional pci acpi -dev/pci/pci_host_generic_fdt.c optional pci fdt -dev/pci/pci_dw_mv.c optional pci fdt -dev/pci/pci_dw.c optional pci fdt -dev/pci/pci_dw_if.m optional pci fdt -dev/psci/psci.c standard -dev/psci/smccc_arm64.S standard -dev/psci/smccc.c standard -dev/safexcel/safexcel.c optional safexcel fdt -dev/sdhci/sdhci_xenon.c optional sdhci_xenon sdhci fdt -dev/uart/uart_cpu_arm64.c optional uart -dev/uart/uart_dev_mu.c optional uart uart_mu -dev/uart/uart_dev_pl011.c optional uart pl011 -dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220 -dev/usb/controller/dwc3.c optional fdt dwc3 -dev/usb/controller/ehci_mv.c optional ehci_mv fdt -dev/usb/controller/generic_ehci.c optional ehci -dev/usb/controller/generic_ehci_acpi.c optional ehci acpi -dev/usb/controller/generic_ehci_fdt.c optional ehci fdt -dev/usb/controller/generic_ohci.c optional ohci fdt -dev/usb/controller/generic_usb_if.m optional ohci fdt -dev/usb/controller/musb_otg_allwinner.c optional musb fdt soc_allwinner_a64 -dev/usb/controller/usb_nop_xceiv.c optional fdt ext_resources -dev/usb/controller/generic_xhci.c optional xhci -dev/usb/controller/generic_xhci_acpi.c optional xhci acpi -dev/usb/controller/generic_xhci_fdt.c optional xhci fdt -dev/vnic/mrml_bridge.c optional vnic fdt -dev/vnic/nic_main.c optional vnic pci -dev/vnic/nicvf_main.c optional vnic pci pci_iov -dev/vnic/nicvf_queues.c optional vnic pci pci_iov -dev/vnic/thunder_bgx_fdt.c optional vnic fdt -dev/vnic/thunder_bgx.c optional vnic pci -dev/vnic/thunder_mdio_fdt.c optional vnic fdt -dev/vnic/thunder_mdio.c optional vnic -dev/vnic/lmac_if.m optional inet | inet6 | vnic -kern/msi_if.m optional intrng -kern/pic_if.m optional intrng -kern/subr_devmap.c standard -kern/subr_intr.c optional intrng -kern/subr_physmem.c standard -libkern/bcmp.c standard -libkern/memcmp.c standard \ - compile-with "${NORMAL_C:N-fsanitize*}" -libkern/memset.c standard \ - compile-with "${NORMAL_C:N-fsanitize*}" -libkern/strlen.c standard -libkern/arm64/crc32c_armv8.S standard -cddl/dev/dtrace/aarch64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" -cddl/dev/dtrace/aarch64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" -cddl/dev/fbt/aarch64/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -# RockChip Drivers -arm64/rockchip/rk3399_emmcphy.c optional fdt rk_emmcphy soc_rockchip_rk3399 -arm64/rockchip/rk_dwc3.c optional fdt rk_dwc3 soc_rockchip_rk3399 -arm64/rockchip/rk_i2c.c optional fdt rk_i2c soc_rockchip_rk3328 | fdt rk_i2c soc_rockchip_rk3399 -arm64/rockchip/rk805.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 -arm64/rockchip/rk_grf.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 -arm64/rockchip/rk_pinctrl.c optional fdt rk_pinctrl soc_rockchip_rk3328 | fdt rk_pinctrl soc_rockchip_rk3399 -arm64/rockchip/rk_gpio.c optional fdt rk_gpio soc_rockchip_rk3328 | fdt rk_gpio soc_rockchip_rk3399 -arm64/rockchip/rk_iodomain.c optional fdt rk_iodomain -arm64/rockchip/rk_spi.c optional fdt rk_spi -arm64/rockchip/rk_usb2phy.c optional fdt rk_usb2phy soc_rockchip_rk3328 | soc_rockchip_rk3399 -arm64/rockchip/rk_typec_phy.c optional fdt rk_typec_phy soc_rockchip_rk3399 -arm64/rockchip/if_dwc_rk.c optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 -arm64/rockchip/rk_tsadc_if.m optional fdt soc_rockchip_rk3399 -arm64/rockchip/rk_tsadc.c optional fdt soc_rockchip_rk3399 -arm64/rockchip/rk_pwm.c optional fdt rk_pwm -arm64/rockchip/rk_pcie.c optional fdt pci soc_rockchip_rk3399 -arm64/rockchip/rk_pcie_phy.c optional fdt pci soc_rockchip_rk3399 -dev/dwc/if_dwc.c optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 -dev/dwc/if_dwc_if.m optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 +dev/iicbus/sy8106a.c optional sy8106a fdt +dev/iicbus/twsi/mv_twsi.c optional twsi fdt +dev/iicbus/twsi/a10_twsi.c optional twsi fdt +dev/iicbus/twsi/twsi.c optional twsi fdt -# RockChip Clock support -arm64/rockchip/clk/rk_cru.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 -arm64/rockchip/clk/rk_clk_armclk.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 -arm64/rockchip/clk/rk_clk_composite.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 -arm64/rockchip/clk/rk_clk_fract.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 -arm64/rockchip/clk/rk_clk_gate.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 -arm64/rockchip/clk/rk_clk_mux.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 -arm64/rockchip/clk/rk_clk_pll.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 -arm64/rockchip/clk/rk3328_cru.c optional fdt soc_rockchip_rk3328 -arm64/rockchip/clk/rk3399_cru.c optional fdt soc_rockchip_rk3399 -arm64/rockchip/clk/rk3399_pmucru.c optional fdt soc_rockchip_rk3399 +dev/ipmi/ipmi.c optional ipmi +dev/ipmi/ipmi_acpi.c optional ipmi acpi +dev/ipmi/ipmi_kcs.c optional ipmi +dev/ipmi/ipmi_smic.c optional ipmi + +dev/mbox/mbox_if.m optional soc_brcm_bcm2837 + +dev/mmc/host/dwmmc.c optional dwmmc fdt +dev/mmc/host/dwmmc_altera.c optional dwmmc dwmmc_altera fdt +dev/mmc/host/dwmmc_hisi.c optional dwmmc dwmmc_hisi fdt +dev/mmc/host/dwmmc_rockchip.c optional dwmmc rk_dwmmc fdt + +dev/neta/if_mvneta_fdt.c optional neta fdt +dev/neta/if_mvneta.c optional neta mdio mii + +dev/ofw/ofw_cpu.c optional fdt +dev/ofw/ofwpci.c optional fdt pci + +dev/pci/controller/pci_n1sdp.c optional pci_n1sdp acpi +dev/pci/pci_host_generic.c optional pci +dev/pci/pci_host_generic_acpi.c optional pci acpi +dev/pci/pci_host_generic_fdt.c optional pci fdt +dev/pci/pci_dw_mv.c optional pci fdt +dev/pci/pci_dw.c optional pci fdt +dev/pci/pci_dw_if.m optional pci fdt + +dev/psci/psci.c standard +dev/psci/smccc_arm64.S standard +dev/psci/smccc.c standard +dev/safexcel/safexcel.c optional safexcel fdt + +dev/sdhci/sdhci_xenon.c optional sdhci_xenon sdhci fdt + +dev/uart/uart_cpu_arm64.c optional uart +dev/uart/uart_dev_mu.c optional uart uart_mu +dev/uart/uart_dev_pl011.c optional uart pl011 + +dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220 +dev/usb/controller/dwc3.c optional fdt dwc3 +dev/usb/controller/ehci_mv.c optional ehci_mv fdt +dev/usb/controller/generic_ehci.c optional ehci +dev/usb/controller/generic_ehci_acpi.c optional ehci acpi +dev/usb/controller/generic_ehci_fdt.c optional ehci fdt +dev/usb/controller/generic_ohci.c optional ohci fdt +dev/usb/controller/generic_usb_if.m optional ohci fdt +dev/usb/controller/musb_otg_allwinner.c optional musb fdt soc_allwinner_a64 +dev/usb/controller/usb_nop_xceiv.c optional fdt ext_resources +dev/usb/controller/generic_xhci.c optional xhci +dev/usb/controller/generic_xhci_acpi.c optional xhci acpi +dev/usb/controller/generic_xhci_fdt.c optional xhci fdt + +dev/vnic/mrml_bridge.c optional vnic fdt +dev/vnic/nic_main.c optional vnic pci +dev/vnic/nicvf_main.c optional vnic pci pci_iov +dev/vnic/nicvf_queues.c optional vnic pci pci_iov +dev/vnic/thunder_bgx_fdt.c optional vnic fdt +dev/vnic/thunder_bgx.c optional vnic pci +dev/vnic/thunder_mdio_fdt.c optional vnic fdt +dev/vnic/thunder_mdio.c optional vnic +dev/vnic/lmac_if.m optional inet | inet6 | vnic + +## +## SoC Support +## + +# Allwinner common files +arm/allwinner/a10_timer.c optional a10_timer fdt +arm/allwinner/a10_codec.c optional sound a10_codec +arm/allwinner/a31_dmac.c optional a31_dmac +arm/allwinner/sunxi_dma_if.m optional a31_dmac +arm/allwinner/aw_cir.c optional evdev aw_cir fdt +arm/allwinner/aw_dwc3.c optional aw_dwc3 fdt +arm/allwinner/aw_gpio.c optional gpio aw_gpio fdt +arm/allwinner/aw_mmc.c optional mmc aw_mmc fdt | mmccam aw_mmc fdt +arm/allwinner/aw_nmi.c optional aw_nmi fdt \ + compile-with "${NORMAL_C} -I$S/contrib/device-tree/include" +arm/allwinner/aw_pwm.c optional aw_pwm fdt +arm/allwinner/aw_rsb.c optional aw_rsb fdt +arm/allwinner/aw_rtc.c optional aw_rtc fdt +arm/allwinner/aw_sid.c optional aw_sid nvmem fdt +arm/allwinner/aw_spi.c optional aw_spi fdt +arm/allwinner/aw_syscon.c optional aw_syscon ext_resources syscon fdt +arm/allwinner/aw_thermal.c optional aw_thermal nvmem fdt +arm/allwinner/aw_usbphy.c optional ehci aw_usbphy fdt +arm/allwinner/aw_usb3phy.c optional xhci aw_usbphy fdt +arm/allwinner/aw_wdog.c optional aw_wdog fdt +arm/allwinner/axp81x.c optional axp81x fdt +arm/allwinner/if_awg.c optional awg ext_resources syscon aw_sid nvmem fdt + +# Allwinner clock driver +arm/allwinner/clkng/aw_ccung.c optional aw_ccu fdt +arm/allwinner/clkng/aw_clk_frac.c optional aw_ccu fdt +arm/allwinner/clkng/aw_clk_m.c optional aw_ccu fdt +arm/allwinner/clkng/aw_clk_mipi.c optional aw_ccu fdt +arm/allwinner/clkng/aw_clk_nkmp.c optional aw_ccu fdt +arm/allwinner/clkng/aw_clk_nm.c optional aw_ccu fdt +arm/allwinner/clkng/aw_clk_nmm.c optional aw_ccu fdt +arm/allwinner/clkng/aw_clk_np.c optional aw_ccu fdt +arm/allwinner/clkng/aw_clk_prediv_mux.c optional aw_ccu fdt +arm/allwinner/clkng/ccu_a64.c optional soc_allwinner_a64 aw_ccu fdt +arm/allwinner/clkng/ccu_h3.c optional soc_allwinner_h5 aw_ccu fdt +arm/allwinner/clkng/ccu_h6.c optional soc_allwinner_h6 aw_ccu fdt +arm/allwinner/clkng/ccu_h6_r.c optional soc_allwinner_h6 aw_ccu fdt +arm/allwinner/clkng/ccu_sun8i_r.c optional aw_ccu fdt +arm/allwinner/clkng/ccu_de2.c optional aw_ccu fdt + +# Allwinner padconf files +arm/allwinner/a64/a64_padconf.c optional soc_allwinner_a64 fdt +arm/allwinner/a64/a64_r_padconf.c optional soc_allwinner_a64 fdt +arm/allwinner/h3/h3_padconf.c optional soc_allwinner_h5 fdt +arm/allwinner/h3/h3_r_padconf.c optional soc_allwinner_h5 fdt +arm/allwinner/h6/h6_padconf.c optional soc_allwinner_h6 fdt +arm/allwinner/h6/h6_r_padconf.c optional soc_allwinner_h6 fdt + +# Altera/Intel +dev/altera/dwc/if_dwc_socfpga.c optional fdt dwc_socfpga +arm64/intel/firmware.c optional soc_intel_stratix10 +arm64/intel/stratix10-soc-fpga-mgr.c optional soc_intel_stratix10 +arm64/intel/stratix10-svc.c optional soc_intel_stratix10 + +# Annapurna +arm/annapurna/alpine/alpine_ccu.c optional al_ccu fdt +arm/annapurna/alpine/alpine_nb_service.c optional al_nb_service fdt +arm/annapurna/alpine/alpine_pci.c optional al_pci fdt +arm/annapurna/alpine/alpine_pci_msix.c optional al_pci fdt +arm/annapurna/alpine/alpine_serdes.c optional al_serdes fdt \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" + +# Broadcom +arm64/broadcom/brcmmdio/mdio_mux_iproc.c optional fdt +arm64/broadcom/brcmmdio/mdio_nexus_iproc.c optional fdt +arm64/broadcom/brcmmdio/mdio_ns2_pcie_phy.c optional fdt pci +arm64/broadcom/genet/if_genet.c optional SOC_BRCM_BCM2838 fdt genet +arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq fdt \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc fdt +arm/broadcom/bcm2835/bcm2835_clkman.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm2835_cpufreq.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm2835_dma.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm2835_fbd.c optional vt soc_brcm_bcm2837 fdt | vt soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm2835_firmware.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev bcm2835_ft5406 fdt +arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio soc_brcm_bcm2837 fdt | gpio soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm2835_intr.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm2835_mbox.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm2835_rng.c optional !random_loadable soc_brcm_bcm2837 fdt | !random_loadable soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci soc_brcm_bcm2837 fdt | sdhci soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm2835_sdhost.c optional sdhci soc_brcm_bcm2837 fdt | sdhci soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi fdt +arm/broadcom/bcm2835/bcm2835_vcbus.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm2835_vcio.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm2835_wdog.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt +arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt soc_brcm_bcm2837 | dwcotg fdt soc_brcm_bcm2838 +arm/broadcom/bcm2835/bcm2838_pci.c optional soc_brcm_bcm2838 fdt pci +arm/broadcom/bcm2835/bcm2838_xhci.c optional soc_brcm_bcm2838 fdt pci xhci +arm/broadcom/bcm2835/raspberrypi_gpio.c optional soc_brcm_bcm2837 gpio | soc_brcm_bcm2838 gpio +contrib/vchiq/interface/compat/vchi_bsd.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -Wno-unused -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_arm.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -Wno-unused -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_connected.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_core.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_kern_lib.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_shim.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" +contrib/vchiq/interface/vchiq_arm/vchiq_util.c optional vchiq soc_brcm_bcm2837 \ + compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" + +# Cavium +arm64/cavium/thunder_pcie_fdt.c optional soc_cavm_thunderx pci fdt +arm64/cavium/thunder_pcie_pem.c optional soc_cavm_thunderx pci +arm64/cavium/thunder_pcie_pem_fdt.c optional soc_cavm_thunderx pci fdt +arm64/cavium/thunder_pcie_common.c optional soc_cavm_thunderx pci # i.MX8 Clock support -arm64/freescale/imx/imx8mq_ccm.c optional fdt soc_freescale_imx8 -arm64/freescale/imx/clk/imx_clk_gate.c optional fdt soc_freescale_imx8 -arm64/freescale/imx/clk/imx_clk_mux.c optional fdt soc_freescale_imx8 +arm64/freescale/imx/imx8mq_ccm.c optional fdt soc_freescale_imx8 +arm64/freescale/imx/clk/imx_clk_gate.c optional fdt soc_freescale_imx8 +arm64/freescale/imx/clk/imx_clk_mux.c optional fdt soc_freescale_imx8 arm64/freescale/imx/clk/imx_clk_composite.c optional fdt soc_freescale_imx8 arm64/freescale/imx/clk/imx_clk_sscg_pll.c optional fdt soc_freescale_imx8 arm64/freescale/imx/clk/imx_clk_frac_pll.c optional fdt soc_freescale_imx8 # iMX drivers -arm/freescale/imx/imx_gpio.c optional gpio soc_freescale_imx8 -arm/freescale/imx/imx_i2c.c optional fsliic -arm/freescale/imx/imx_machdep.c optional fdt soc_freescale_imx8 -arm64/freescale/imx/imx7gpc.c optional fdt soc_freescale_imx8 -dev/ffec/if_ffec.c optional ffec +arm/freescale/imx/imx_gpio.c optional gpio soc_freescale_imx8 +arm/freescale/imx/imx_i2c.c optional fsliic +arm/freescale/imx/imx_machdep.c optional fdt soc_freescale_imx8 +arm64/freescale/imx/imx7gpc.c optional fdt soc_freescale_imx8 +dev/ffec/if_ffec.c optional ffec + +# Marvell +arm/mv/a37x0_gpio.c optional a37x0_gpio gpio fdt +arm/mv/a37x0_iic.c optional a37x0_iic iicbus fdt +arm/mv/a37x0_spi.c optional a37x0_spi spibus fdt +arm/mv/armada38x/armada38x_rtc.c optional mv_rtc fdt +arm/mv/gpio.c optional mv_gpio fdt +arm/mv/mvebu_gpio.c optional mv_gpio fdt +arm/mv/mvebu_pinctrl.c optional mvebu_pinctrl fdt +arm/mv/mv_ap806_clock.c optional SOC_MARVELL_8K fdt +arm/mv/mv_ap806_gicp.c optional mv_ap806_gicp fdt +arm/mv/mv_ap806_sei.c optional mv_ap806_sei fdt +arm/mv/mv_cp110_clock.c optional SOC_MARVELL_8K fdt +arm/mv/mv_cp110_icu.c optional mv_cp110_icu fdt +arm/mv/mv_cp110_icu_bus.c optional mv_cp110_icu fdt +arm/mv/mv_thermal.c optional SOC_MARVELL_8K mv_thermal fdt +arm/mv/armada38x/armada38x_rtc.c optional mv_rtc fdt + +# NVidia +arm/nvidia/tegra_abpmisc.c optional fdt soc_nvidia_tegra210 +arm/nvidia/tegra_ahci.c optional fdt soc_nvidia_tegra210 +arm/nvidia/tegra_efuse.c optional fdt soc_nvidia_tegra210 +arm/nvidia/tegra_ehci.c optional fdt soc_nvidia_tegra210 +arm/nvidia/tegra_gpio.c optional fdt soc_nvidia_tegra210 +arm/nvidia/tegra_i2c.c optional fdt soc_nvidia_tegra210 +arm/nvidia/tegra_lic.c optional fdt soc_nvidia_tegra210 +arm/nvidia/tegra_mc.c optional fdt soc_nvidia_tegra210 +arm/nvidia/tegra_pcie.c optional fdt soc_nvidia_tegra210 +arm/nvidia/tegra_sdhci.c optional fdt soc_nvidia_tegra210 +arm/nvidia/tegra_soctherm_if.m optional fdt soc_nvidia_tegra210 +arm/nvidia/tegra_soctherm.c optional fdt soc_nvidia_tegra210 +arm/nvidia/tegra_uart.c optional fdt soc_nvidia_tegra210 +arm/nvidia/tegra_usbphy.c optional fdt soc_nvidia_tegra210 +arm/nvidia/tegra_xhci.c optional fdt soc_nvidia_tegra210 +arm64/nvidia/tegra210/max77620.c optional fdt soc_nvidia_tegra210 +arm64/nvidia/tegra210/max77620_gpio.c optional fdt soc_nvidia_tegra210 +arm64/nvidia/tegra210/max77620_regulators.c optional fdt soc_nvidia_tegra210 +arm64/nvidia/tegra210/max77620_rtc.c optional fdt soc_nvidia_tegra210 +arm64/nvidia/tegra210/tegra210_car.c optional fdt soc_nvidia_tegra210 +arm64/nvidia/tegra210/tegra210_clk_per.c optional fdt soc_nvidia_tegra210 +arm64/nvidia/tegra210/tegra210_clk_pll.c optional fdt soc_nvidia_tegra210 +arm64/nvidia/tegra210/tegra210_clk_super.c optional fdt soc_nvidia_tegra210 +arm64/nvidia/tegra210/tegra210_coretemp.c optional fdt soc_nvidia_tegra210 +arm64/nvidia/tegra210/tegra210_cpufreq.c optional fdt soc_nvidia_tegra210 +arm64/nvidia/tegra210/tegra210_pinmux.c optional fdt soc_nvidia_tegra210 +arm64/nvidia/tegra210/tegra210_pmc.c optional fdt soc_nvidia_tegra210 +arm64/nvidia/tegra210/tegra210_xusbpadctl.c optional fdt soc_nvidia_tegra210 # Nvidia firmware for Tegra -tegra210_xusb_fw.c optional tegra210_xusb_fw \ - dependency "$S/conf/files.arm64" \ +tegra210_xusb_fw.c optional tegra210_xusb_fw \ + dependency "$S/conf/files.arm64" \ compile-with "${AWK} -f $S/tools/fw_stub.awk tegra210_xusb.fw:tegra210_xusb_fw -mtegra210_xusb_fw -c${.TARGET}" \ - no-ctfconvert no-implicit-rule before-depend local \ + no-ctfconvert no-implicit-rule before-depend local \ clean "tegra210_xusb_fw.c" -tegra210_xusb.fwo optional tegra210_xusb_fw \ - dependency "tegra210_xusb.fw" \ - compile-with "${NORMAL_FWO}" \ - no-implicit-rule \ +tegra210_xusb.fwo optional tegra210_xusb_fw \ + dependency "tegra210_xusb.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ clean "tegra210_xusb.fwo" -tegra210_xusb.fw optional tegra210_xusb_fw \ - dependency "$S/contrib/dev/nvidia/tegra210_xusb.bin.uu" \ - compile-with "${NORMAL_FW}" \ - no-obj no-implicit-rule \ +tegra210_xusb.fw optional tegra210_xusb_fw \ + dependency "$S/contrib/dev/nvidia/tegra210_xusb.bin.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ clean "tegra210_xusb.fw" +# NXP +arm/freescale/vybrid/vf_i2c.c optional vf_i2c iicbus SOC_NXP_LS +arm64/qoriq/ls1046_gpio.c optional ls1046_gpio gpio fdt SOC_NXP_LS +arm64/qoriq/qoriq_dw_pci.c optional pci fdt SOC_NXP_LS +arm64/qoriq/qoriq_therm.c optional pci fdt SOC_NXP_LS +arm64/qoriq/qoriq_therm_if.m optional pci fdt SOC_NXP_LS +arm64/qoriq/clk/ls1046a_clkgen.c optional clk SOC_NXP_LS +arm64/qoriq/clk/lx2160a_clkgen.c optional clk SOC_NXP_LS +arm64/qoriq/clk/qoriq_clk_pll.c optional clk SOC_NXP_LS +arm64/qoriq/clk/qoriq_clkgen.c optional clk SOC_NXP_LS +dev/ahci/ahci_fsl_fdt.c optional SOC_NXP_LS ahci fdt + +# Qualcomm +arm64/qualcomm/qcom_gcc.c optional qcom_gcc fdt + +# RockChip Drivers +arm64/rockchip/rk3399_emmcphy.c optional fdt rk_emmcphy soc_rockchip_rk3399 +arm64/rockchip/rk_dwc3.c optional fdt rk_dwc3 soc_rockchip_rk3399 +arm64/rockchip/rk_i2c.c optional fdt rk_i2c soc_rockchip_rk3328 | fdt rk_i2c soc_rockchip_rk3399 +arm64/rockchip/rk805.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 +arm64/rockchip/rk_grf.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 +arm64/rockchip/rk_pinctrl.c optional fdt rk_pinctrl soc_rockchip_rk3328 | fdt rk_pinctrl soc_rockchip_rk3399 +arm64/rockchip/rk_gpio.c optional fdt rk_gpio soc_rockchip_rk3328 | fdt rk_gpio soc_rockchip_rk3399 +arm64/rockchip/rk_iodomain.c optional fdt rk_iodomain +arm64/rockchip/rk_spi.c optional fdt rk_spi +arm64/rockchip/rk_usb2phy.c optional fdt rk_usb2phy soc_rockchip_rk3328 | soc_rockchip_rk3399 +arm64/rockchip/rk_typec_phy.c optional fdt rk_typec_phy soc_rockchip_rk3399 +arm64/rockchip/if_dwc_rk.c optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 +arm64/rockchip/rk_tsadc_if.m optional fdt soc_rockchip_rk3399 +arm64/rockchip/rk_tsadc.c optional fdt soc_rockchip_rk3399 +arm64/rockchip/rk_pwm.c optional fdt rk_pwm +arm64/rockchip/rk_pcie.c optional fdt pci soc_rockchip_rk3399 +arm64/rockchip/rk_pcie_phy.c optional fdt pci soc_rockchip_rk3399 +dev/dwc/if_dwc.c optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 +dev/dwc/if_dwc_if.m optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 + +# RockChip Clock support +arm64/rockchip/clk/rk_cru.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 +arm64/rockchip/clk/rk_clk_armclk.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 +arm64/rockchip/clk/rk_clk_composite.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 +arm64/rockchip/clk/rk_clk_fract.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 +arm64/rockchip/clk/rk_clk_gate.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 +arm64/rockchip/clk/rk_clk_mux.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 +arm64/rockchip/clk/rk_clk_pll.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 +arm64/rockchip/clk/rk3328_cru.c optional fdt soc_rockchip_rk3328 +arm64/rockchip/clk/rk3399_cru.c optional fdt soc_rockchip_rk3399 +arm64/rockchip/clk/rk3399_pmucru.c optional fdt soc_rockchip_rk3399 + +# Xilinx +arm/xilinx/uart_dev_cdnc.c optional uart soc_xilinx_zynq + +# Linuxkpi compat/linuxkpi/common/src/linux_fpu.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" + +# Cloudabi +arm64/cloudabi32/cloudabi32_sysvec.c optional compat_cloudabi32 +arm64/cloudabi64/cloudabi64_sysvec.c optional compat_cloudabi64 + +cloudabi32_vdso.o optional compat_cloudabi32 \ + dependency "$S/contrib/cloudabi/cloudabi_vdso_armv6_on_64bit.S" \ + compile-with "${CC} -x assembler-with-cpp -m32 -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_armv6_on_64bit.S -o ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "cloudabi32_vdso.o" +cloudabi32_vdso_blob.o optional compat_cloudabi32 \ + dependency "cloudabi32_vdso.o" \ + compile-with "${OBJCOPY} --input-target binary --output-target elf64-littleaarch64 --binary-architecture aarch64 cloudabi32_vdso.o ${.TARGET}" \ *** 12 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Wed Feb 10 20:17:09 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A4C13529843; Wed, 10 Feb 2021 20:17:09 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbWJP2hvjz3H5X; Wed, 10 Feb 2021 20:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37F1123C7C; Wed, 10 Feb 2021 20:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11AKH90Z012993; Wed, 10 Feb 2021 20:17:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11AKH93F012992; Wed, 10 Feb 2021 20:17:09 GMT (envelope-from git) Date: Wed, 10 Feb 2021 20:17:09 GMT Message-Id: <202102102017.11AKH93F012992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: b81439d1eb3a - main - arm64: Make thunderx vnic file depend on soc_cavm_thunderx MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b81439d1eb3a25fd2329a4391597de43b9c52589 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 20:17:09 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=b81439d1eb3a25fd2329a4391597de43b9c52589 commit b81439d1eb3a25fd2329a4391597de43b9c52589 Author: Emmanuel Vadot AuthorDate: 2021-02-04 14:31:23 +0000 Commit: Emmanuel Vadot CommitDate: 2021-02-10 20:15:40 +0000 arm64: Make thunderx vnic file depend on soc_cavm_thunderx MFC after: 3 days --- sys/conf/files.arm64 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 8abe5d194d90..5c9cc1ca7b76 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -274,10 +274,10 @@ dev/vnic/mrml_bridge.c optional vnic fdt dev/vnic/nic_main.c optional vnic pci dev/vnic/nicvf_main.c optional vnic pci pci_iov dev/vnic/nicvf_queues.c optional vnic pci pci_iov -dev/vnic/thunder_bgx_fdt.c optional vnic fdt -dev/vnic/thunder_bgx.c optional vnic pci -dev/vnic/thunder_mdio_fdt.c optional vnic fdt -dev/vnic/thunder_mdio.c optional vnic +dev/vnic/thunder_bgx_fdt.c optional soc_cavm_thunderx pci vnic fdt +dev/vnic/thunder_bgx.c optional soc_cavm_thunderx pci vnic pci +dev/vnic/thunder_mdio_fdt.c optional soc_cavm_thunderx pci vnic fdt +dev/vnic/thunder_mdio.c optional soc_cavm_thunderx pci vnic dev/vnic/lmac_if.m optional inet | inet6 | vnic ## From owner-dev-commits-src-main@freebsd.org Wed Feb 10 20:17:10 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B5EE15297C1; Wed, 10 Feb 2021 20:17:10 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbWJQ3RbPz3H0y; Wed, 10 Feb 2021 20:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 590BA23DDD; Wed, 10 Feb 2021 20:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11AKHA0X013012; Wed, 10 Feb 2021 20:17:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11AKHA3e013011; Wed, 10 Feb 2021 20:17:10 GMT (envelope-from git) Date: Wed, 10 Feb 2021 20:17:10 GMT Message-Id: <202102102017.11AKHA3e013011@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 3b721b44955a - main - arm64: Add a SOC_BRCM_NS2 option MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b721b44955af8f915a6974b1012a5089c6a48ca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 20:17:10 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=3b721b44955af8f915a6974b1012a5089c6a48ca commit 3b721b44955af8f915a6974b1012a5089c6a48ca Author: Emmanuel Vadot AuthorDate: 2021-02-04 14:40:54 +0000 Commit: Emmanuel Vadot CommitDate: 2021-02-10 20:15:50 +0000 arm64: Add a SOC_BRCM_NS2 option Only compile files needed for this platform if the option is enabled in the kernel config file. Add the option to GENERIC. MFC after: 3 days --- sys/arm64/conf/GENERIC | 1 + sys/conf/files.arm64 | 6 +++--- sys/conf/options.arm64 | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/arm64/conf/GENERIC b/sys/arm64/conf/GENERIC index 5eb0a270f006..bb790a1b6df9 100644 --- a/sys/arm64/conf/GENERIC +++ b/sys/arm64/conf/GENERIC @@ -125,6 +125,7 @@ options SOC_HISI_HI6220 options SOC_INTEL_STRATIX10 options SOC_BRCM_BCM2837 options SOC_BRCM_BCM2838 +options SOC_BRCM_NS2 options SOC_MARVELL_8K options SOC_NVIDIA_TEGRA210 options SOC_NXP_LS diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 5c9cc1ca7b76..c01fa64133d2 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -349,9 +349,9 @@ arm/annapurna/alpine/alpine_serdes.c optional al_serdes fdt \ compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" # Broadcom -arm64/broadcom/brcmmdio/mdio_mux_iproc.c optional fdt -arm64/broadcom/brcmmdio/mdio_nexus_iproc.c optional fdt -arm64/broadcom/brcmmdio/mdio_ns2_pcie_phy.c optional fdt pci +arm64/broadcom/brcmmdio/mdio_mux_iproc.c optional soc_brcm_ns2 fdt +arm64/broadcom/brcmmdio/mdio_nexus_iproc.c optional soc_brcm_ns2 fdt +arm64/broadcom/brcmmdio/mdio_ns2_pcie_phy.c optional soc_brcm_ns2 fdt pci arm64/broadcom/genet/if_genet.c optional SOC_BRCM_BCM2838 fdt genet arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq fdt \ compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" diff --git a/sys/conf/options.arm64 b/sys/conf/options.arm64 index 24e34c1e3b6a..5a97fd6b3ef6 100644 --- a/sys/conf/options.arm64 +++ b/sys/conf/options.arm64 @@ -21,6 +21,7 @@ SOC_ALLWINNER_H5 opt_soc.h SOC_ALLWINNER_H6 opt_soc.h SOC_BRCM_BCM2837 opt_soc.h SOC_BRCM_BCM2838 opt_soc.h +SOC_BRCM_NS2 opt_soc.h SOC_CAVM_THUNDERX opt_soc.h SOC_FREESCALE_IMX8 opt_soc.h SOC_HISI_HI6220 opt_soc.h From owner-dev-commits-src-main@freebsd.org Wed Feb 10 20:17:11 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B37605298A8; Wed, 10 Feb 2021 20:17:11 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbWJR4GnDz3GgY; Wed, 10 Feb 2021 20:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7117E23DDE; Wed, 10 Feb 2021 20:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11AKHBCc013034; Wed, 10 Feb 2021 20:17:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11AKHBoN013033; Wed, 10 Feb 2021 20:17:11 GMT (envelope-from git) Date: Wed, 10 Feb 2021 20:17:11 GMT Message-Id: <202102102017.11AKHBoN013033@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: a6dc68c0e0f8 - main - arm64: if_dwc is also needed by intel stratix10 platform MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6dc68c0e0f8a24ffaf0b4e78e58141ef7897047 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 20:17:11 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=a6dc68c0e0f8a24ffaf0b4e78e58141ef7897047 commit a6dc68c0e0f8a24ffaf0b4e78e58141ef7897047 Author: Emmanuel Vadot AuthorDate: 2021-02-04 16:07:17 +0000 Commit: Emmanuel Vadot CommitDate: 2021-02-10 20:15:59 +0000 arm64: if_dwc is also needed by intel stratix10 platform MFC after: 3 days --- sys/conf/files.arm64 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index c01fa64133d2..c1e5b40db3f9 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -159,6 +159,9 @@ dev/axgbe/xgbe-phy-v1.c optional axa dev/cpufreq/cpufreq_dt.c optional cpufreq fdt +dev/dwc/if_dwc.c optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 | fdt dwc_socfpga soc_intel_stratix10 +dev/dwc/if_dwc_if.m optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 | fdt dwc_socfpga soc_intel_stratix10 + dev/gpio/pl061.c optional pl061 gpio dev/gpio/pl061_acpi.c optional pl061 gpio acpi dev/gpio/pl061_fdt.c optional pl061 gpio fdt @@ -516,8 +519,6 @@ arm64/rockchip/rk_tsadc.c optional fdt soc_rockchip_rk3399 arm64/rockchip/rk_pwm.c optional fdt rk_pwm arm64/rockchip/rk_pcie.c optional fdt pci soc_rockchip_rk3399 arm64/rockchip/rk_pcie_phy.c optional fdt pci soc_rockchip_rk3399 -dev/dwc/if_dwc.c optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 -dev/dwc/if_dwc_if.m optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 # RockChip Clock support arm64/rockchip/clk/rk_cru.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 From owner-dev-commits-src-main@freebsd.org Wed Feb 10 22:30:43 2021 Return-Path: Delivered-To: dev-commits-src-main@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 28DAD52C772; Wed, 10 Feb 2021 22:30:43 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbZGW0g58z3QTY; Wed, 10 Feb 2021 22:30:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F357825B2A; Wed, 10 Feb 2021 22:30:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11AMUgi8090713; Wed, 10 Feb 2021 22:30:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11AMUgms090712; Wed, 10 Feb 2021 22:30:42 GMT (envelope-from git) Date: Wed, 10 Feb 2021 22:30:42 GMT Message-Id: <202102102230.11AMUgms090712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: d3338f3355a6 - main - Fix incorrect hypotl(3) result with subnormal numbers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d3338f3355a612cf385632291f46c5777bba8d18 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 22:30:43 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=d3338f3355a612cf385632291f46c5777bba8d18 commit d3338f3355a612cf385632291f46c5777bba8d18 Author: Dimitry Andric AuthorDate: 2021-02-10 22:28:43 +0000 Commit: Dimitry Andric CommitDate: 2021-02-10 22:28:43 +0000 Fix incorrect hypotl(3) result with subnormal numbers This adjusts the factor used to scale the subnormal numbers, so it becomes the right value after adjusting its exponent. Thanks to Steve Kargl for finding the most elegant fix. Also enable the hypot tests, and add a test case for this bug. PR: 253313 MFC after: 1 week --- contrib/netbsd-tests/lib/libm/t_hypot.c | 20 ++++++++++++++++++++ lib/msun/src/e_hypotl.c | 2 +- lib/msun/tests/Makefile | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/lib/libm/t_hypot.c b/contrib/netbsd-tests/lib/libm/t_hypot.c index deb7e86ad5ac..075c5c83fe14 100644 --- a/contrib/netbsd-tests/lib/libm/t_hypot.c +++ b/contrib/netbsd-tests/lib/libm/t_hypot.c @@ -70,12 +70,32 @@ ATF_TC_BODY(pr50698, tc) ATF_CHECK(!isnan(val)); } +ATF_TC(hypotl_near_underflow); +ATF_TC_HEAD(hypotl_near_underflow, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test hypotl near underflow"); +} + +ATF_TC_BODY(hypotl_near_underflow, tc) +{ + volatile long double a = 0x1.b2933cafa0bb7p-16383L; + volatile long double b = 0x1.fffffffffffffp-16351L; + volatile long double e = 0x1.fffffffffffffp-16351L; + volatile long double ulp = __LDBL_EPSILON__; + + volatile long double val = hypotl(a, b); + + ATF_CHECK(!isinf(val)); + ATF_CHECK(fabsl(val - e) <= 2 * ulp); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, hypot_integer); ATF_TP_ADD_TC(tp, hypotf_integer); ATF_TP_ADD_TC(tp, pr50698); + ATF_TP_ADD_TC(tp, hypotl_near_underflow); return atf_no_error(); } diff --git a/lib/msun/src/e_hypotl.c b/lib/msun/src/e_hypotl.c index 9189b1fab54d..fc43538dfa65 100644 --- a/lib/msun/src/e_hypotl.c +++ b/lib/msun/src/e_hypotl.c @@ -82,7 +82,7 @@ hypotl(long double x, long double y) man_t manh, manl; GET_LDBL_MAN(manh,manl,b); if((manh|manl)==0) return a; - t1=0; + t1=1; SET_HIGH_WORD(t1,ESW(MAX_EXP-2)); /* t1=2^(MAX_EXP-2) */ b *= t1; a *= t1; diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index 5e9c54189bb7..67a38855309e 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -31,6 +31,7 @@ NETBSD_ATF_TESTS_C+= erf_test NETBSD_ATF_TESTS_C+= exp_test NETBSD_ATF_TESTS_C+= fmod_test NETBSD_ATF_TESTS_C+= fe_round_test +NETBSD_ATF_TESTS_C+= hypot_test NETBSD_ATF_TESTS_C+= infinity_test NETBSD_ATF_TESTS_C+= ilogb_test NETBSD_ATF_TESTS_C+= ldexp_test From owner-dev-commits-src-main@freebsd.org Thu Feb 11 01:29:37 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B6E9E53175B; Thu, 11 Feb 2021 01:29:37 +0000 (UTC) (envelope-from bdragon@imap.cc) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 4DbfDx4XGzz4Ryl; Thu, 11 Feb 2021 01:29:37 +0000 (UTC) (envelope-from bdragon@imap.cc) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id A34535C0145; Wed, 10 Feb 2021 20:29:36 -0500 (EST) Received: from imap38 ([10.202.2.88]) by compute5.internal (MEProxy); Wed, 10 Feb 2021 20:29:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imap.cc; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm2; bh=K/a9ZDcRI2FsPshEnf2o1P8xpB0FLsd 0OqbcvQZ7I+w=; b=NcAq1ydR15zM/AGi6S28ev3XQFb47vHf09qouHg7v5p0/Hc L8ykP175RIZpjyyhncErd7YJc16ev61PRkM4n8sX0W+KaaL3VQzc++AzdEclpYzw wMZeSTw+kyLp1Hmhar0ub9SULBOxN9qHlSAQBjkDcoROxdGjylSHk3ko3XOwss5i rt17QS3kPqtkXWNhKDpSw8V2iSlyqlAMQuxMtucwPMwZBbs1LhvZ8eisXFDnQmAB wKX3yI5hr5bki5sQG1MqnCObqP2iKgtZ7nCgA5QYpQwITKD9ZC5CLOWvUwu7Chmf HQJkwGuhMae/8ZIfxJB/ZLjAMgZahJruOLpG/ag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=K/a9ZD cRI2FsPshEnf2o1P8xpB0FLsd0OqbcvQZ7I+w=; b=oJDsrRvZXanawVdxmFFXPA fUS0obQAhqV7IwjAVQlCwLP0pvhWxYYbJyZAKn8PrBh5ZIK1kSJ3uA4mIf7CVPKx GSP0zJ2o1XtnOFKdMQhfMnx9EVi69BiI/7j09nAv5wjl73XDwz1aFhVC1VWZDut9 QVral1gPdlujSSbwyPbRM/KYj8J1UT41e4uqTcQ8MWGj4uUFIFuNHBb60F9dQrEJ ZU4XQfCr98fidrNQ2Hw55+nykej5e+9Fe2t5zUIDZmzXqpQXtcinfKjasqOhXtwr e7Wr3CBb0zQ4WKAFrDVRVprxCKzlFNvEJQiiS7twI4uw7v5Rs9hyOwuWOfHv/5kw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrheekgdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdduhedmnecujfgurhepofgfgg fkjghffffhvffutgesthdtredtreerjeenucfhrhhomhepfdeurhgrnhguohhnuceuvghr ghhrvghnfdcuoegsughrrghgohhnsehimhgrphdrtggtqeenucggtffrrghtthgvrhhnpe efjefggfekiedtiedtueehveekheefjeehteegvdfghffghfdvhfevvdekfefhvdenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsughrrghgoh hnsehimhgrphdrtggt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 30A83CA005D; Wed, 10 Feb 2021 20:29:36 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-93-gef6c4048e6-fm-20210128.002-gef6c4048 Mime-Version: 1.0 Message-Id: In-Reply-To: <202102102230.11AMUgms090712@gitrepo.freebsd.org> References: <202102102230.11AMUgms090712@gitrepo.freebsd.org> Date: Wed, 10 Feb 2021 19:29:15 -0600 From: "Brandon Bergren" To: "Dimitry Andric" , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: =?UTF-8?Q?Re:_git:_d3338f3355a6_-_main_-_Fix_incorrect_hypotl(3)_result_?= =?UTF-8?Q?with_subnormal_numbers?= Content-Type: text/plain X-Rspamd-Queue-Id: 4DbfDx4XGzz4Ryl X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 01:29:37 -0000 On Wed, Feb 10, 2021, at 4:30 PM, Dimitry Andric wrote: > + volatile long double a = 0x1.b2933cafa0bb7p-16383L; > + volatile long double b = 0x1.fffffffffffffp-16351L; > + volatile long double e = 0x1.fffffffffffffp-16351L; These are compile errors on most platforms. I believe these constants are specific to the x86-centric 80-bit long double format, whereas all other platforms use either 64-bit or 128-bit long doubles. -- Brandon Bergren bdragon@imap.cc From owner-dev-commits-src-main@freebsd.org Thu Feb 11 02:24:12 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0800E536232; Thu, 11 Feb 2021 02:24:12 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbgRv52sMz4YpF; Thu, 11 Feb 2021 02:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99218CCA; Thu, 11 Feb 2021 02:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11B2OB3p089093; Thu, 11 Feb 2021 02:24:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11B2OBpi089092; Thu, 11 Feb 2021 02:24:11 GMT (envelope-from git) Date: Thu, 11 Feb 2021 02:24:11 GMT Message-Id: <202102110224.11B2OBpi089092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Glen Barber Subject: git: c511a5ab53ba - main - release: fix overriding UNAME_r MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c511a5ab53ba335dc85f7ac93843872eb5763602 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 02:24:12 -0000 The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=c511a5ab53ba335dc85f7ac93843872eb5763602 commit c511a5ab53ba335dc85f7ac93843872eb5763602 Author: Glen Barber AuthorDate: 2021-02-11 02:23:58 +0000 Commit: Glen Barber CommitDate: 2021-02-11 02:23:58 +0000 release: fix overriding UNAME_r Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/tools/arm.subr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release/tools/arm.subr b/release/tools/arm.subr index 1d4ae17d3851..343d9f3a7034 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -175,6 +175,10 @@ arm_install_base() { if [ "${PART_SCHEME}" == "MBR" ]; then chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${DESTDIR} fi + _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) + REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) + BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) + export UNAME_r=${REVISION}-${BRANCH} eval chroot ${CHROOTDIR} make -C ${WORLDDIR} \ TARGET=${EMBEDDED_TARGET} \ TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ From owner-dev-commits-src-main@freebsd.org Thu Feb 11 03:53:16 2021 Return-Path: Delivered-To: dev-commits-src-main@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 62981538EDE; Thu, 11 Feb 2021 03:53:16 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbjQh2KBKz4gNH; Thu, 11 Feb 2021 03:53:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 428A72310; Thu, 11 Feb 2021 03:53:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11B3rG0b007083; Thu, 11 Feb 2021 03:53:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11B3rGsr007082; Thu, 11 Feb 2021 03:53:16 GMT (envelope-from git) Date: Thu, 11 Feb 2021 03:53:16 GMT Message-Id: <202102110353.11B3rGsr007082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 4956af2a8f0d - main - usleep(3): replace 'process' with 'calling thread' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4956af2a8f0d7723cb09c98e7f5295b156136f70 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 03:53:16 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4956af2a8f0d7723cb09c98e7f5295b156136f70 commit 4956af2a8f0d7723cb09c98e7f5295b156136f70 Author: Konstantin Belousov AuthorDate: 2021-02-11 03:49:25 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-11 03:52:55 +0000 usleep(3): replace 'process' with 'calling thread' PR: 253395 Reported by: zegang.luo@qq.com MFC after: 3 days Sponsored by: The FreeBSD Foundation --- lib/libc/gen/usleep.3 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libc/gen/usleep.3 b/lib/libc/gen/usleep.3 index b298380977ba..f6ed9e6bb52e 100644 --- a/lib/libc/gen/usleep.3 +++ b/lib/libc/gen/usleep.3 @@ -28,12 +28,12 @@ .\" @(#)usleep.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 13, 1998 +.Dd February 11, 2021 .Dt USLEEP 3 .Os .Sh NAME .Nm usleep -.Nd suspend process execution for an interval measured in microseconds +.Nd suspend thread execution for an interval measured in microseconds .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -43,9 +43,9 @@ .Sh DESCRIPTION The .Fn usleep -function suspends execution of the calling process until either +function suspends execution of the calling thread until either .Fa microseconds -microseconds have elapsed or a signal is delivered to the process and its +microseconds have elapsed or a signal is delivered to the thread and its action is to invoke a signal-catching function or to terminate the process. System activity may lengthen the sleep by an indeterminate amount. @@ -67,7 +67,7 @@ function will fail if: .Bl -tag -width Er .It Bq Er EINTR -A signal was delivered to the process and its +A signal was delivered to the calling thread and its action was to invoke a signal-catching function. .El .Sh SEE ALSO From owner-dev-commits-src-main@freebsd.org Thu Feb 11 05:05:18 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0095E53A37C; Thu, 11 Feb 2021 05:05:18 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dbl1n6ZGHz4kHN; Thu, 11 Feb 2021 05:05:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D46472B58; Thu, 11 Feb 2021 05:05:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11B55HuV099407; Thu, 11 Feb 2021 05:05:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11B55Hl4099406; Thu, 11 Feb 2021 05:05:17 GMT (envelope-from git) Date: Thu, 11 Feb 2021 05:05:17 GMT Message-Id: <202102110505.11B55Hl4099406@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Daniel Ebdrup Jensen Subject: git: 2a7d4d954504 - main - kldload(8): Improve phrasing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: debdrup X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a7d4d95450429a0d08232a5019a592c47955de3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 05:05:18 -0000 The branch main has been updated by debdrup (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2a7d4d95450429a0d08232a5019a592c47955de3 commit 2a7d4d95450429a0d08232a5019a592c47955de3 Author: Daniel Ebdrup Jensen AuthorDate: 2021-02-11 05:01:49 +0000 Commit: Daniel Ebdrup Jensen CommitDate: 2021-02-11 05:03:53 +0000 kldload(8): Improve phrasing Mountroot isn't documented in the extant manual pages - so this phrasing, while less absolute and concise, still conveys which modules are recommended to be handled via loader.conf(5), and it also does a better job of elucidating that the modules can include filesystem drivers. Submitted by: kevans (earlier version) Reported by: imp, kevans, eugen Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D28542 --- sbin/kldload/kldload.8 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sbin/kldload/kldload.8 b/sbin/kldload/kldload.8 index d95cf1fcdfe9..a008b187c367 100644 --- a/sbin/kldload/kldload.8 +++ b/sbin/kldload/kldload.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2021 +.Dd February 11, 2021 .Dt KLDLOAD 8 .Os .Sh NAME @@ -112,7 +112,8 @@ Modules may also be auto-loaded through their addition to or kld_list in .Xr rc.conf 5 . .Pp -Only modules needed to get to mountroot should be loaded via +Only those modules necessary for booting the system, including those +required for mounting the root filesystem, should be handled by .Xr loader.conf 5 . .Sh SEE ALSO .Xr kldload 2 , From owner-dev-commits-src-main@freebsd.org Thu Feb 11 06:04:27 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B5D9D53BD8F; Thu, 11 Feb 2021 06:04:27 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbmL34jz6z4n58; Thu, 11 Feb 2021 06:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FEE03E83; Thu, 11 Feb 2021 06:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11B64R1S078215; Thu, 11 Feb 2021 06:04:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11B64RFg078214; Thu, 11 Feb 2021 06:04:27 GMT (envelope-from git) Date: Thu, 11 Feb 2021 06:04:27 GMT Message-Id: <202102110604.11B64RFg078214@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: dba7b0ef928a - main - Merge bmake-20210206 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dba7b0ef928af88caa38728a73657b837aeeac93 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 06:04:27 -0000 The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=dba7b0ef928af88caa38728a73657b837aeeac93 commit dba7b0ef928af88caa38728a73657b837aeeac93 Merge: 2a7d4d954504 8b6f73e37baf Author: Simon J. Gerraty AuthorDate: 2021-02-11 06:01:59 +0000 Commit: Simon J. Gerraty CommitDate: 2021-02-11 06:03:22 +0000 Merge bmake-20210206 Changes of interest o unit-tests: use private TMPDIR to avoid errors from other users o avoid strdup in mkTempFile o always use vfork o job.c: do not create empty shell files in jobs mode reduce unnecessary calls to waitpid o cond.c: fix debug output for comparison operators in conditionals contrib/bmake/ChangeLog | 73 +++ contrib/bmake/FILES | 6 + contrib/bmake/VERSION | 2 +- contrib/bmake/arch.c | 24 +- contrib/bmake/bmake.1 | 6 +- contrib/bmake/bmake.cat1 | 4 +- contrib/bmake/buf.c | 59 +- contrib/bmake/buf.h | 25 +- contrib/bmake/compat.c | 18 +- contrib/bmake/cond.c | 655 ++++++++++--------- contrib/bmake/config.h.in | 3 + contrib/bmake/configure | 36 +- contrib/bmake/configure.in | 15 +- contrib/bmake/dir.c | 454 +++++++------ contrib/bmake/dir.h | 10 +- contrib/bmake/enum.c | 16 +- contrib/bmake/enum.h | 33 +- contrib/bmake/filemon/filemon.h | 4 +- contrib/bmake/filemon/filemon_dev.c | 6 +- contrib/bmake/filemon/filemon_ktrace.c | 13 +- contrib/bmake/for.c | 253 ++++---- contrib/bmake/hash.c | 13 +- contrib/bmake/job.c | 260 ++++---- contrib/bmake/job.h | 3 +- contrib/bmake/lst.c | 17 +- contrib/bmake/lst.h | 4 +- contrib/bmake/main.c | 316 ++++----- contrib/bmake/make.1 | 6 +- contrib/bmake/make.c | 154 +++-- contrib/bmake/make.h | 104 +-- contrib/bmake/make_malloc.c | 6 +- contrib/bmake/make_malloc.h | 4 +- contrib/bmake/meta.c | 87 +-- contrib/bmake/metachar.c | 7 +- contrib/bmake/metachar.h | 6 +- contrib/bmake/mk/ChangeLog | 9 + contrib/bmake/mk/dirdeps.mk | 10 +- contrib/bmake/mk/install-mk | 4 +- contrib/bmake/mk/meta.stage.mk | 7 +- contrib/bmake/nonints.h | 58 +- contrib/bmake/parse.c | 306 ++++----- contrib/bmake/str.c | 22 +- contrib/bmake/suff.c | 66 +- contrib/bmake/targ.c | 30 +- contrib/bmake/trace.c | 10 +- contrib/bmake/trace.h | 6 +- contrib/bmake/unit-tests/Makefile | 80 ++- .../bmake/unit-tests/cmdline-redirect-stdin.exp | 1 + contrib/bmake/unit-tests/cmdline-redirect-stdin.mk | 34 + contrib/bmake/unit-tests/cmdline.exp | 4 +- contrib/bmake/unit-tests/cmdline.mk | 4 +- contrib/bmake/unit-tests/cond-cmp-numeric-eq.exp | 1 - contrib/bmake/unit-tests/cond-cmp-numeric.exp | 8 +- contrib/bmake/unit-tests/cond-cmp-string.exp | 5 +- contrib/bmake/unit-tests/cond-cmp-string.mk | 30 +- contrib/bmake/unit-tests/cond-func-defined.exp | 6 +- contrib/bmake/unit-tests/cond-func.exp | 9 +- contrib/bmake/unit-tests/cond-op-not.exp | 5 +- contrib/bmake/unit-tests/cond-op-not.mk | 9 +- contrib/bmake/unit-tests/cond-op-parentheses.exp | 6 +- contrib/bmake/unit-tests/cond-op-parentheses.mk | 19 +- contrib/bmake/unit-tests/cond-op.exp | 4 + contrib/bmake/unit-tests/cond-op.mk | 40 +- contrib/bmake/unit-tests/cond-token-plain.exp | 31 +- contrib/bmake/unit-tests/cond-token-plain.mk | 97 ++- contrib/bmake/unit-tests/cond-token-string.exp | 20 +- contrib/bmake/unit-tests/cond-token-string.mk | 47 +- contrib/bmake/unit-tests/cond1.exp | 2 +- contrib/bmake/unit-tests/dir.mk | 4 +- contrib/bmake/unit-tests/directive-error.exp | 5 +- contrib/bmake/unit-tests/directive-error.mk | 13 +- contrib/bmake/unit-tests/directive-export-impl.exp | 8 +- contrib/bmake/unit-tests/directive-for-escape.exp | 43 +- contrib/bmake/unit-tests/directive-for-escape.mk | 28 +- contrib/bmake/unit-tests/directive-ifdef.exp | 2 + contrib/bmake/unit-tests/directive-ifdef.mk | 17 +- .../bmake/unit-tests/directive-include-fatal.mk | 4 +- contrib/bmake/unit-tests/envfirst.mk | 4 +- contrib/bmake/unit-tests/export.exp | 1 + contrib/bmake/unit-tests/gnode-submake.exp | 16 +- contrib/bmake/unit-tests/include-main.exp | 9 +- contrib/bmake/unit-tests/include-main.mk | 6 +- contrib/bmake/unit-tests/include-subsub.mk | 4 +- contrib/bmake/unit-tests/jobs-empty-commands.exp | 2 + contrib/bmake/unit-tests/jobs-empty-commands.mk | 18 + contrib/bmake/unit-tests/lint.mk | 13 +- contrib/bmake/unit-tests/objdir-writable.exp | 6 +- contrib/bmake/unit-tests/opt-debug-graph1.exp | 16 +- contrib/bmake/unit-tests/opt-debug-graph2.exp | 92 ++- contrib/bmake/unit-tests/opt-debug-graph2.mk | 22 +- contrib/bmake/unit-tests/opt-debug-graph3.exp | 92 ++- contrib/bmake/unit-tests/opt-debug-graph3.mk | 22 +- contrib/bmake/unit-tests/opt-no-action-touch.exp | 11 + contrib/bmake/unit-tests/opt-no-action-touch.mk | 48 ++ contrib/bmake/unit-tests/opt-touch-jobs.mk | 8 +- .../bmake/unit-tests/opt-warnings-as-errors.exp | 4 +- contrib/bmake/unit-tests/opt-warnings-as-errors.mk | 7 +- contrib/bmake/unit-tests/suff-incomplete.exp | 4 +- contrib/bmake/unit-tests/suff-main-several.exp | 16 +- contrib/bmake/unit-tests/suff-transform-debug.exp | 2 +- contrib/bmake/unit-tests/var-op-append.exp | 6 +- contrib/bmake/unit-tests/var-op-append.mk | 14 +- contrib/bmake/unit-tests/var-op-assign.exp | 2 +- contrib/bmake/unit-tests/var-op-shell.exp | 4 +- contrib/bmake/unit-tests/var-op-shell.mk | 13 +- contrib/bmake/unit-tests/vardebug.exp | 36 +- contrib/bmake/unit-tests/vardebug.mk | 4 +- contrib/bmake/unit-tests/varmisc.mk | 10 +- contrib/bmake/unit-tests/varmod-assign.mk | 3 +- contrib/bmake/unit-tests/varmod-gmtime.exp | 20 +- contrib/bmake/unit-tests/varmod-gmtime.mk | 19 +- contrib/bmake/unit-tests/varmod-ifelse.mk | 4 +- contrib/bmake/unit-tests/varmod-indirect.exp | 32 +- contrib/bmake/unit-tests/varmod-localtime.exp | 20 +- contrib/bmake/unit-tests/varmod-localtime.mk | 21 +- contrib/bmake/unit-tests/varmod-loop.mk | 6 +- contrib/bmake/unit-tests/varmod-match-escape.exp | 16 +- contrib/bmake/unit-tests/varmod-match-escape.mk | 20 +- contrib/bmake/unit-tests/varname-dot-shell.mk | 6 +- contrib/bmake/unit-tests/varname-empty.exp | 38 +- contrib/bmake/unit-tests/varname-empty.mk | 9 +- .../varname-make_print_var_on_error-jobs.mk | 4 +- .../unit-tests/varname-make_print_var_on_error.mk | 4 +- contrib/bmake/unit-tests/varname.exp | 10 +- contrib/bmake/unit-tests/varparse-dynamic.mk | 6 +- contrib/bmake/util.c | 10 +- contrib/bmake/var.c | 713 ++++++++++++--------- usr.bin/bmake/Makefile.config | 2 +- usr.bin/bmake/config.h | 7 +- usr.bin/bmake/unit-tests/Makefile | 80 ++- 130 files changed, 3225 insertions(+), 2153 deletions(-) diff --cc contrib/bmake/job.c index d43761ca80ff,000000000000..eb5454cde574 mode 100644,000000..100644 --- a/contrib/bmake/job.c +++ b/contrib/bmake/job.c @@@ -1,3016 -1,0 +1,3012 @@@ - /* $NetBSD: job.c,v 1.397 2021/01/10 23:59:53 rillig Exp $ */ ++/* $NetBSD: job.c,v 1.420 2021/02/05 22:15:44 sjg Exp $ */ + +/* + * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Adam de Boor. + * + * 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. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + */ + +/* + * Copyright (c) 1988, 1989 by Adam de Boor + * Copyright (c) 1989 by Berkeley Softworks + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Adam de Boor. + * + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + */ + - /*- ++/* + * job.c -- + * handle the creation etc. of our child processes. + * + * Interface: + * Job_Init Called to initialize this module. In addition, - * any commands attached to the .BEGIN target - * are executed before this function returns. ++ * the .BEGIN target is made including all of its ++ * dependencies before this function returns. + * Hence, the makefiles must have been parsed + * before this function is called. + * + * Job_End Clean up any memory used. + * + * Job_Make Start the creation of the given target. + * + * Job_CatchChildren + * Check for and handle the termination of any + * children. This must be called reasonably + * frequently to keep the whole make going at + * a decent clip, since job table entries aren't + * removed until their process is caught this way. + * + * Job_CatchOutput + * Print any output our children have produced. + * Should also be called fairly frequently to + * keep the user informed of what's going on. + * If no output is waiting, it will block for + * a time given by the SEL_* constants, below, + * or until output is ready. + * - * Job_ParseShell Given the line following a .SHELL target, parse - * the line as a shell specification. Returns - * FALSE if the spec was incorrect. ++ * Job_ParseShell Given a special dependency line with target '.SHELL', ++ * define the shell that is used for the creation ++ * commands in jobs mode. + * + * Job_Finish Perform any final processing which needs doing. + * This includes the execution of any commands + * which have been/were attached to the .END + * target. It should only be called when the + * job table is empty. + * - * Job_AbortAll Abort all currently running jobs. It doesn't - * handle output or do anything for the jobs, - * just kills them. It should only be called in - * an emergency. ++ * Job_AbortAll Abort all currently running jobs. Do not handle ++ * output or do anything for the jobs, just kill them. ++ * Should only be called in an emergency. + * + * Job_CheckCommands + * Verify that the commands for a target are + * ok. Provide them if necessary and possible. + * + * Job_Touch Update a target without really updating it. + * + * Job_Wait Wait for all currently-running jobs to finish. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#include +#include +#include +#include +#include "wait.h" + +#include +#if !defined(USE_SELECT) && defined(HAVE_POLL_H) +#include +#else +#ifndef USE_SELECT /* no poll.h */ +# define USE_SELECT +#endif +#if defined(HAVE_SYS_SELECT_H) +# include +#endif +#endif +#include +#include +#if defined(HAVE_SYS_SOCKET_H) +# include +#endif + +#include "make.h" +#include "dir.h" +#include "job.h" +#include "pathnames.h" +#include "trace.h" + +/* "@(#)job.c 8.2 (Berkeley) 3/19/94" */ - MAKE_RCSID("$NetBSD: job.c,v 1.397 2021/01/10 23:59:53 rillig Exp $"); ++MAKE_RCSID("$NetBSD: job.c,v 1.420 2021/02/05 22:15:44 sjg Exp $"); + +/* + * A shell defines how the commands are run. All commands for a target are + * written into a single file, which is then given to the shell to execute + * the commands from it. The commands are written to the file using a few + * templates for echo control and error control. + * + * The name of the shell is the basename for the predefined shells, such as + * "sh", "csh", "bash". For custom shells, it is the full pathname, and its + * basename is used to select the type of shell; the longest match wins. + * So /usr/pkg/bin/bash has type sh, /usr/local/bin/tcsh has type csh. + * + * The echoing of command lines is controlled using hasEchoCtl, echoOff, + * echoOn, noPrint and noPrintLen. When echoOff is executed by the shell, it + * still outputs something, but this something is not interesting, therefore + * it is filtered out using noPrint and noPrintLen. + * + * The error checking for individual commands is controlled using hasErrCtl, + * errOn, errOff and runChkTmpl. + * - * If a shell doesn't have error control, echoTmpl becomes a printf template - * for echoing the command, should echoing be on; runIgnTmpl becomes - * another printf template for executing the command while ignoring the return ++ * In case a shell doesn't have error control, echoTmpl is a printf template ++ * for echoing the command, should echoing be on; runIgnTmpl is another ++ * printf template for executing the command while ignoring the return + * status. Finally runChkTmpl is a printf template for running the command and + * causing the shell to exit on error. If any of these strings are empty when + * hasErrCtl is FALSE, the command will be executed anyway as is, and if it + * causes an error, so be it. Any templates set up to echo the command will - * escape any '$ ` \ "' characters in the command string to avoid common - * problems with echo "%s\n" as a template. ++ * escape any '$ ` \ "' characters in the command string to avoid unwanted ++ * shell code injection, the escaped command is safe to use in double quotes. + * + * The command-line flags "echo" and "exit" also control the behavior. The + * "echo" flag causes the shell to start echoing commands right away. The + * "exit" flag causes the shell to exit when an error is detected in one of + * the commands. + */ +typedef struct Shell { + + /* + * The name of the shell. For Bourne and C shells, this is used only + * to find the shell description when used as the single source of a + * .SHELL target. For user-defined shells, this is the full path of + * the shell. + */ + const char *name; + + Boolean hasEchoCtl; /* whether both echoOff and echoOn are there */ + const char *echoOff; /* command to turn echoing off */ + const char *echoOn; /* command to turn echoing back on */ + const char *noPrint; /* text to skip when printing output from the + * shell. This is usually the same as echoOff */ + size_t noPrintLen; /* length of noPrint command */ + + Boolean hasErrCtl; /* whether error checking can be controlled + * for individual commands */ + const char *errOn; /* command to turn on error checking */ + const char *errOff; /* command to turn off error checking */ + + const char *echoTmpl; /* template to echo a command */ + const char *runIgnTmpl; /* template to run a command + * without error checking */ + const char *runChkTmpl; /* template to run a command + * with error checking */ + + /* string literal that results in a newline character when it appears + * outside of any 'quote' or "quote" characters */ + const char *newline; + char commentChar; /* character used by shell for comment lines */ + + const char *echoFlag; /* shell flag to echo commands */ + const char *errFlag; /* shell flag to exit on error */ +} Shell; + +typedef struct CommandFlags { - /* Whether to echo the command before running it. */ ++ /* Whether to echo the command before or instead of running it. */ + Boolean echo; + + /* Run the command even in -n or -N mode. */ + Boolean always; + + /* + * true if we turned error checking off before printing the command + * and need to turn it back on + */ + Boolean ignerr; +} CommandFlags; + +/* + * Write shell commands to a file. + * + * TODO: keep track of whether commands are echoed. + * TODO: keep track of whether error checking is active. + */ +typedef struct ShellWriter { + FILE *f; + + /* we've sent 'set -x' */ + Boolean xtraced; + +} ShellWriter; + +/* + * FreeBSD: traditionally .MAKE is not required to + * pass jobs queue to sub-makes. + * Use .MAKE.ALWAYS_PASS_JOB_QUEUE=no to disable. + */ +#define MAKE_ALWAYS_PASS_JOB_QUEUE ".MAKE.ALWAYS_PASS_JOB_QUEUE" +static int Always_pass_job_queue = TRUE; +/* + * FreeBSD: aborting entire parallel make isn't always + * desired. When doing tinderbox for example, failure of + * one architecture should not stop all. + * We still want to bail on interrupt though. + */ +#define MAKE_JOB_ERROR_TOKEN "MAKE_JOB_ERROR_TOKEN" +static int Job_error_token = TRUE; + +/* + * error handling variables + */ +static int job_errors = 0; /* number of errors reported */ +typedef enum AbortReason { /* why is the make aborting? */ + ABORT_NONE, + ABORT_ERROR, /* Because of an error */ + ABORT_INTERRUPT, /* Because it was interrupted */ + ABORT_WAIT /* Waiting for jobs to finish */ ++ /* XXX: "WAIT" is not a _reason_ for aborting, it's rather a status. */ +} AbortReason; +static AbortReason aborting = ABORT_NONE; +#define JOB_TOKENS "+EI+" /* Token to requeue for each abort state */ + +/* + * this tracks the number of tokens currently "out" to build jobs. + */ +int jobTokensRunning = 0; + +typedef enum JobStartResult { + JOB_RUNNING, /* Job is running */ + JOB_ERROR, /* Error in starting the job */ + JOB_FINISHED /* The job is already finished */ +} JobStartResult; + +/* + * Descriptions for various shells. + * + * The build environment may set DEFSHELL_INDEX to one of + * DEFSHELL_INDEX_SH, DEFSHELL_INDEX_KSH, or DEFSHELL_INDEX_CSH, to + * select one of the predefined shells as the default shell. + * + * Alternatively, the build environment may set DEFSHELL_CUSTOM to the + * name or the full path of a sh-compatible shell, which will be used as + * the default shell. + * + * ".SHELL" lines in Makefiles can choose the default shell from the + * set defined here, or add additional shells. + */ + +#ifdef DEFSHELL_CUSTOM +#define DEFSHELL_INDEX_CUSTOM 0 +#define DEFSHELL_INDEX_SH 1 +#define DEFSHELL_INDEX_KSH 2 +#define DEFSHELL_INDEX_CSH 3 +#else /* !DEFSHELL_CUSTOM */ +#define DEFSHELL_INDEX_SH 0 +#define DEFSHELL_INDEX_KSH 1 +#define DEFSHELL_INDEX_CSH 2 +#endif /* !DEFSHELL_CUSTOM */ + +#ifndef DEFSHELL_INDEX +#define DEFSHELL_INDEX 0 /* DEFSHELL_INDEX_CUSTOM or DEFSHELL_INDEX_SH */ +#endif /* !DEFSHELL_INDEX */ + +static Shell shells[] = { +#ifdef DEFSHELL_CUSTOM + /* + * An sh-compatible shell with a non-standard name. + * + * Keep this in sync with the "sh" description below, but avoid + * non-portable features that might not be supplied by all + * sh-compatible shells. + */ + { + DEFSHELL_CUSTOM, /* .name */ + FALSE, /* .hasEchoCtl */ + "", /* .echoOff */ + "", /* .echoOn */ + "", /* .noPrint */ + 0, /* .noPrintLen */ + FALSE, /* .hasErrCtl */ + "", /* .errOn */ + "", /* .errOff */ + "echo \"%s\"\n", /* .echoTmpl */ + "%s\n", /* .runIgnTmpl */ + "{ %s \n} || exit $?\n", /* .runChkTmpl */ + "'\n'", /* .newline */ + '#', /* .commentChar */ + "", /* .echoFlag */ + "", /* .errFlag */ + }, +#endif /* DEFSHELL_CUSTOM */ + /* + * SH description. Echo control is also possible and, under + * sun UNIX anyway, one can even control error checking. + */ + { + "sh", /* .name */ + FALSE, /* .hasEchoCtl */ + "", /* .echoOff */ + "", /* .echoOn */ + "", /* .noPrint */ + 0, /* .noPrintLen */ + FALSE, /* .hasErrCtl */ + "", /* .errOn */ + "", /* .errOff */ + "echo \"%s\"\n", /* .echoTmpl */ + "%s\n", /* .runIgnTmpl */ + "{ %s \n} || exit $?\n", /* .runChkTmpl */ + "'\n'", /* .newline */ + '#', /* .commentChar*/ +#if defined(MAKE_NATIVE) && defined(__NetBSD__) + /* XXX: -q is not really echoFlag, it's more like noEchoInSysFlag. */ + "q", /* .echoFlag */ +#else + "", /* .echoFlag */ +#endif + "", /* .errFlag */ + }, + /* + * KSH description. + */ + { + "ksh", /* .name */ + TRUE, /* .hasEchoCtl */ + "set +v", /* .echoOff */ + "set -v", /* .echoOn */ + "set +v", /* .noPrint */ + 6, /* .noPrintLen */ + FALSE, /* .hasErrCtl */ + "", /* .errOn */ + "", /* .errOff */ + "echo \"%s\"\n", /* .echoTmpl */ + "%s\n", /* .runIgnTmpl */ + "{ %s \n} || exit $?\n", /* .runChkTmpl */ + "'\n'", /* .newline */ + '#', /* .commentChar */ + "v", /* .echoFlag */ + "", /* .errFlag */ + }, + /* + * CSH description. The csh can do echo control by playing + * with the setting of the 'echo' shell variable. Sadly, + * however, it is unable to do error control nicely. + */ + { + "csh", /* .name */ + TRUE, /* .hasEchoCtl */ + "unset verbose", /* .echoOff */ + "set verbose", /* .echoOn */ + "unset verbose", /* .noPrint */ + 13, /* .noPrintLen */ + FALSE, /* .hasErrCtl */ + "", /* .errOn */ + "", /* .errOff */ + "echo \"%s\"\n", /* .echoTmpl */ + "csh -c \"%s || exit 0\"\n", /* .runIgnTmpl */ + "", /* .runChkTmpl */ + "'\\\n'", /* .newline */ + '#', /* .commentChar */ + "v", /* .echoFlag */ + "e", /* .errFlag */ + } +}; + +/* + * This is the shell to which we pass all commands in the Makefile. + * It is set by the Job_ParseShell function. + */ +static Shell *shell = &shells[DEFSHELL_INDEX]; +const char *shellPath = NULL; /* full pathname of executable image */ +const char *shellName = NULL; /* last component of shellPath */ +char *shellErrFlag = NULL; - static char *shellArgv = NULL; /* Custom shell args */ ++static char *shell_freeIt = NULL; /* Allocated memory for custom .SHELL */ + + +static Job *job_table; /* The structures that describe them */ +static Job *job_table_end; /* job_table + maxJobs */ +static unsigned int wantToken; /* we want a token */ +static Boolean lurking_children = FALSE; +static Boolean make_suspended = FALSE; /* Whether we've seen a SIGTSTP (etc) */ + +/* + * Set of descriptors of pipes connected to + * the output channels of children + */ +static struct pollfd *fds = NULL; - static Job **allJobs = NULL; - static nfds_t nJobs = 0; ++static Job **jobByFdIndex = NULL; ++static nfds_t fdsLen = 0; +static void watchfd(Job *); +static void clearfd(Job *); +static Boolean readyfd(Job *); + +static char *targPrefix = NULL; /* To identify a job change in the output. */ +static Job tokenWaitJob; /* token wait pseudo-job */ + +static Job childExitJob; /* child exit pseudo-job */ +#define CHILD_EXIT "." +#define DO_JOB_RESUME "R" + +enum { + npseudojobs = 2 /* number of pseudo-jobs */ +}; + +static sigset_t caught_signals; /* Set of signals we handle */ ++static volatile sig_atomic_t caught_sigchld; + +static void JobDoOutput(Job *, Boolean); +static void JobInterrupt(Boolean, int) MAKE_ATTR_DEAD; +static void JobRestartJobs(void); +static void JobSigReset(void); + +static void +SwitchOutputTo(GNode *gn) +{ + /* The node for which output was most recently produced. */ + static GNode *lastNode = NULL; + + if (gn == lastNode) + return; + lastNode = gn; + + if (opts.maxJobs != 1 && targPrefix != NULL && targPrefix[0] != '\0') + (void)fprintf(stdout, "%s %s ---\n", targPrefix, gn->name); +} + +static unsigned +nfds_per_job(void) +{ +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + if (useMeta) + return 2; +#endif + return 1; +} + +void +Job_FlagsToString(const Job *job, char *buf, size_t bufsize) +{ + snprintf(buf, bufsize, "%c%c%c", + job->ignerr ? 'i' : '-', + !job->echo ? 's' : '-', + job->special ? 'S' : '-'); +} + +static void +job_table_dump(const char *where) +{ + Job *job; + char flags[4]; + + debug_printf("job table @ %s\n", where); + for (job = job_table; job < job_table_end; job++) { + Job_FlagsToString(job, flags, sizeof flags); + debug_printf("job %d, status %d, flags %s, pid %d\n", + (int)(job - job_table), job->status, flags, job->pid); + } +} + +/* + * Delete the target of a failed, interrupted, or otherwise + * unsuccessful job unless inhibited by .PRECIOUS. + */ +static void +JobDeleteTarget(GNode *gn) +{ + const char *file; + + if (gn->type & OP_JOIN) + return; + if (gn->type & OP_PHONY) + return; + if (Targ_Precious(gn)) + return; + if (opts.noExecute) + return; + + file = GNode_Path(gn); + if (eunlink(file) != -1) + Error("*** %s removed", file); +} + +/* + * JobSigLock/JobSigUnlock + * + * Signal lock routines to get exclusive access. Currently used to + * protect `jobs' and `stoppedJobs' list manipulations. + */ +static void +JobSigLock(sigset_t *omaskp) +{ + if (sigprocmask(SIG_BLOCK, &caught_signals, omaskp) != 0) { + Punt("JobSigLock: sigprocmask: %s", strerror(errno)); + sigemptyset(omaskp); + } +} + +static void +JobSigUnlock(sigset_t *omaskp) +{ + (void)sigprocmask(SIG_SETMASK, omaskp, NULL); +} + +static void +JobCreatePipe(Job *job, int minfd) +{ + int i, fd, flags; + int pipe_fds[2]; + + if (pipe(pipe_fds) == -1) + Punt("Cannot create pipe: %s", strerror(errno)); + + for (i = 0; i < 2; i++) { + /* Avoid using low numbered fds */ + fd = fcntl(pipe_fds[i], F_DUPFD, minfd); + if (fd != -1) { + close(pipe_fds[i]); + pipe_fds[i] = fd; + } + } + + job->inPipe = pipe_fds[0]; + job->outPipe = pipe_fds[1]; + + /* Set close-on-exec flag for both */ + if (fcntl(job->inPipe, F_SETFD, FD_CLOEXEC) == -1) + Punt("Cannot set close-on-exec: %s", strerror(errno)); + if (fcntl(job->outPipe, F_SETFD, FD_CLOEXEC) == -1) + Punt("Cannot set close-on-exec: %s", strerror(errno)); + + /* + * We mark the input side of the pipe non-blocking; we poll(2) the + * pipe when we're waiting for a job token, but we might lose the + * race for the token when a new one becomes available, so the read + * from the pipe should not block. + */ + flags = fcntl(job->inPipe, F_GETFL, 0); + if (flags == -1) + Punt("Cannot get flags: %s", strerror(errno)); + flags |= O_NONBLOCK; + if (fcntl(job->inPipe, F_SETFL, flags) == -1) + Punt("Cannot set flags: %s", strerror(errno)); +} + +/* Pass the signal to each running job. */ +static void +JobCondPassSig(int signo) +{ + Job *job; + + DEBUG1(JOB, "JobCondPassSig(%d) called.\n", signo); + + for (job = job_table; job < job_table_end; job++) { + if (job->status != JOB_ST_RUNNING) + continue; + DEBUG2(JOB, "JobCondPassSig passing signal %d to child %d.\n", + signo, job->pid); + KILLPG(job->pid, signo); + } +} + +/* + * SIGCHLD handler. + * + * Sends a token on the child exit pipe to wake us up from select()/poll(). + */ +/*ARGSUSED*/ +static void +JobChildSig(int signo MAKE_ATTR_UNUSED) +{ ++ caught_sigchld = 1; + while (write(childExitJob.outPipe, CHILD_EXIT, 1) == -1 && + errno == EAGAIN) + continue; +} + + +/* Resume all stopped jobs. */ +/*ARGSUSED*/ +static void +JobContinueSig(int signo MAKE_ATTR_UNUSED) +{ + /* + * Defer sending SIGCONT to our stopped children until we return + * from the signal handler. + */ + while (write(childExitJob.outPipe, DO_JOB_RESUME, 1) == -1 && + errno == EAGAIN) + continue; +} + +/* + * Pass a signal on to all jobs, then resend to ourselves. + * We die by the same signal. + */ +MAKE_ATTR_DEAD static void +JobPassSig_int(int signo) +{ + /* Run .INTERRUPT target then exit */ + JobInterrupt(TRUE, signo); +} + +/* + * Pass a signal on to all jobs, then resend to ourselves. + * We die by the same signal. + */ +MAKE_ATTR_DEAD static void +JobPassSig_term(int signo) +{ + /* Dont run .INTERRUPT target then exit */ + JobInterrupt(FALSE, signo); +} + +static void +JobPassSig_suspend(int signo) +{ + sigset_t nmask, omask; + struct sigaction act; + + /* Suppress job started/continued messages */ + make_suspended = TRUE; + + /* Pass the signal onto every job */ + JobCondPassSig(signo); + + /* + * Send ourselves the signal now we've given the message to everyone + * else. Note we block everything else possible while we're getting + * the signal. This ensures that all our jobs get continued when we + * wake up before we take any other signal. + */ + sigfillset(&nmask); + sigdelset(&nmask, signo); + (void)sigprocmask(SIG_SETMASK, &nmask, &omask); + + act.sa_handler = SIG_DFL; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; + (void)sigaction(signo, &act, NULL); + + DEBUG1(JOB, "JobPassSig passing signal %d to self.\n", signo); + + (void)kill(getpid(), signo); + + /* + * We've been continued. + * + * A whole host of signals continue to happen! + * SIGCHLD for any processes that actually suspended themselves. + * SIGCHLD for any processes that exited while we were alseep. + * The SIGCONT that actually caused us to wakeup. + * + * Since we defer passing the SIGCONT on to our children until + * the main processing loop, we can be sure that all the SIGCHLD + * events will have happened by then - and that the waitpid() will + * collect the child 'suspended' events. + * For correct sequencing we just need to ensure we process the + * waitpid() before passing on the SIGCONT. + * + * In any case nothing else is needed here. + */ + + /* Restore handler and signal mask */ + act.sa_handler = JobPassSig_suspend; + (void)sigaction(signo, &act, NULL); + (void)sigprocmask(SIG_SETMASK, &omask, NULL); +} + +static Job * +JobFindPid(int pid, JobStatus status, Boolean isJobs) +{ + Job *job; + + for (job = job_table; job < job_table_end; job++) { + if (job->status == status && job->pid == pid) + return job; + } + if (DEBUG(JOB) && isJobs) + job_table_dump("no pid"); + return NULL; +} + +/* Parse leading '@', '-' and '+', which control the exact execution mode. */ +static void +ParseCommandFlags(char **pp, CommandFlags *out_cmdFlags) +{ + char *p = *pp; + out_cmdFlags->echo = TRUE; + out_cmdFlags->ignerr = FALSE; + out_cmdFlags->always = FALSE; + + for (;;) { + if (*p == '@') + out_cmdFlags->echo = DEBUG(LOUD); + else if (*p == '-') + out_cmdFlags->ignerr = TRUE; + else if (*p == '+') + out_cmdFlags->always = TRUE; + else + break; + p++; + } + + pp_skip_whitespace(&p); + + *pp = p; +} + +/* Escape a string for a double-quoted string literal in sh, csh and ksh. */ +static char * +EscapeShellDblQuot(const char *cmd) +{ + size_t i, j; + + /* Worst that could happen is every char needs escaping. */ + char *esc = bmake_malloc(strlen(cmd) * 2 + 1); + for (i = 0, j = 0; cmd[i] != '\0'; i++, j++) { + if (cmd[i] == '$' || cmd[i] == '`' || cmd[i] == '\\' || + cmd[i] == '"') + esc[j++] = '\\'; + esc[j] = cmd[i]; + } + esc[j] = '\0'; + + return esc; +} + +static void +ShellWriter_PrintFmt(ShellWriter *wr, const char *fmt, const char *arg) +{ + DEBUG1(JOB, fmt, arg); + + (void)fprintf(wr->f, fmt, arg); + /* XXX: Is flushing needed in any case, or only if f == stdout? */ + (void)fflush(wr->f); +} + +static void +ShellWriter_Println(ShellWriter *wr, const char *line) +{ + ShellWriter_PrintFmt(wr, "%s\n", line); *** 5994 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Thu Feb 11 09:23:53 2021 Return-Path: Delivered-To: dev-commits-src-main@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 52741540670; Thu, 11 Feb 2021 09:23:53 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dbrm91xnPz3DlS; Thu, 11 Feb 2021 09:23:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35C9C66A9; Thu, 11 Feb 2021 09:23:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11B9NrCK038739; Thu, 11 Feb 2021 09:23:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11B9NrCX038738; Thu, 11 Feb 2021 09:23:53 GMT (envelope-from git) Date: Thu, 11 Feb 2021 09:23:53 GMT Message-Id: <202102110923.11B9NrCX038738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 3c782d9c9166 - main - [udp6] fix possible panic due to lack of locking. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c782d9c91666886d868426f0aea040d1a1a8ee4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 09:23:53 -0000 The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=3c782d9c91666886d868426f0aea040d1a1a8ee4 commit 3c782d9c91666886d868426f0aea040d1a1a8ee4 Author: Andrey V. Elsukov AuthorDate: 2021-02-11 08:38:41 +0000 Commit: Andrey V. Elsukov CommitDate: 2021-02-11 09:00:25 +0000 [udp6] fix possible panic due to lack of locking. The lookup for a IPv6 multicast addresses corresponding to the destination address in the datagram is protected by the NET_EPOCH section. Access to each PCB is protected by INP_RLOCK during comparing. But access to socket's so_options field is not protected. And in some cases it is possible, that PCB pointer is still valid, but inp_socket is not. The patch wides lock holding to protect access to inp_socket. It copies locking strategy from IPv4 UDP handling. PR: 232192 Obtained from: Yandex LLC MFC after: 3 days Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D28232 --- sys/netinet6/udp6_usrreq.c | 61 +++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 1535be90e1b0..3a001fea077d 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -353,6 +353,13 @@ skip_checksum: continue; } + INP_RLOCK(inp); + + if (__predict_false(inp->inp_flags2 & INP_FREED)) { + INP_RUNLOCK(inp); + continue; + } + /* * XXXRW: Because we weren't holding either the inpcb * or the hash lock when we checked for a match @@ -365,16 +372,10 @@ skip_checksum: * and source-specific multicast. [RFC3678] */ imo = inp->in6p_moptions; - if (imo && IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { + if (imo != NULL) { struct sockaddr_in6 mcaddr; int blocked; - INP_RLOCK(inp); - if (__predict_false(inp->inp_flags2 & INP_FREED)) { - INP_RUNLOCK(inp); - continue; - } - bzero(&mcaddr, sizeof(struct sockaddr_in6)); mcaddr.sin6_len = sizeof(struct sockaddr_in6); mcaddr.sin6_family = AF_INET6; @@ -389,33 +390,30 @@ skip_checksum: if (blocked == MCAST_NOTSMEMBER || blocked == MCAST_MUTED) UDPSTAT_INC(udps_filtermcast); - INP_RUNLOCK(inp); /* XXX */ + INP_RUNLOCK(inp); continue; } - - INP_RUNLOCK(inp); } + if (last != NULL) { struct mbuf *n; if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) != NULL) { - INP_RLOCK(last); - if (__predict_true(last->inp_flags2 & INP_FREED) == 0) { - if (nxt == IPPROTO_UDPLITE) - UDPLITE_PROBE(receive, NULL, last, - ip6, last, uh); - else - UDP_PROBE(receive, NULL, last, - ip6, last, uh); - if (udp6_append(last, n, off, fromsa)) { - /* XXX-BZ do we leak m here? */ - *mp = NULL; - return (IPPROTO_DONE); - } + if (nxt == IPPROTO_UDPLITE) + UDPLITE_PROBE(receive, NULL, + last, ip6, last, uh); + else + UDP_PROBE(receive, NULL, last, + ip6, last, uh); + if (udp6_append(last, n, off, + fromsa)) { + INP_RUNLOCK(inp); + goto badunlocked; } - INP_RUNLOCK(last); } + /* Release PCB lock taken on previous pass. */ + INP_RUNLOCK(last); } last = inp; /* @@ -441,15 +439,12 @@ skip_checksum: UDPSTAT_INC(udps_noportmcast); goto badunlocked; } - INP_RLOCK(last); - if (__predict_true(last->inp_flags2 & INP_FREED) == 0) { - if (nxt == IPPROTO_UDPLITE) - UDPLITE_PROBE(receive, NULL, last, ip6, last, uh); - else - UDP_PROBE(receive, NULL, last, ip6, last, uh); - if (udp6_append(last, m, off, fromsa) == 0) - INP_RUNLOCK(last); - } else + + if (nxt == IPPROTO_UDPLITE) + UDPLITE_PROBE(receive, NULL, last, ip6, last, uh); + else + UDP_PROBE(receive, NULL, last, ip6, last, uh); + if (udp6_append(last, m, off, fromsa) == 0) INP_RUNLOCK(last); *mp = NULL; return (IPPROTO_DONE); From owner-dev-commits-src-main@freebsd.org Thu Feb 11 09:23:54 2021 Return-Path: Delivered-To: dev-commits-src-main@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 83684540671; Thu, 11 Feb 2021 09:23:54 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbrmB2wFqz3Dc4; Thu, 11 Feb 2021 09:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56FF7655F; Thu, 11 Feb 2021 09:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11B9NsJs038757; Thu, 11 Feb 2021 09:23:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11B9NsO9038756; Thu, 11 Feb 2021 09:23:54 GMT (envelope-from git) Date: Thu, 11 Feb 2021 09:23:54 GMT Message-Id: <202102110923.11B9NsO9038756@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: c6ded47d0bae - main - [udp] fix possible mbuf and lock leak in udp_input(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6ded47d0bae801589b564dbe01dccd474edaed0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 09:23:54 -0000 The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=c6ded47d0bae801589b564dbe01dccd474edaed0 commit c6ded47d0bae801589b564dbe01dccd474edaed0 Author: Andrey V. Elsukov AuthorDate: 2021-02-11 08:55:39 +0000 Commit: Andrey V. Elsukov CommitDate: 2021-02-11 09:08:41 +0000 [udp] fix possible mbuf and lock leak in udp_input(). In error case we can leave `inp' locked, also we need to free mbuf chain `m' in the same case. Release the lock and use `badunlocked' label to exit with freed mbuf. Also modify UDP error statistic to match the IPv6 code. Remove redundant INP_RUNLOCK() from the `if (last == NULL)' block, there are no ways to reach this point with locked `inp'. Obtained from: Yandex LLC MFC after: 3 days Sponsored by: Yandex LLC --- sys/netinet/udp_usrreq.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 52304ddd6584..c2ad9381850e 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -610,9 +610,11 @@ udp_input(struct mbuf **mp, int *offp, int proto) uh); if (udp_append(last, ip, n, iphlen, udp_in)) { - goto inp_lost; + INP_RUNLOCK(inp); + goto badunlocked; } } + /* Release PCB lock taken on previous pass. */ INP_RUNLOCK(last); } last = inp; @@ -635,9 +637,11 @@ udp_input(struct mbuf **mp, int *offp, int proto) * to send an ICMP Port Unreachable for a broadcast * or multicast datgram.) */ - UDPSTAT_INC(udps_noportbcast); - if (inp) - INP_RUNLOCK(inp); + UDPSTAT_INC(udps_noport); + if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) + UDPSTAT_INC(udps_noportmcast); + else + UDPSTAT_INC(udps_noportbcast); goto badunlocked; } if (proto == IPPROTO_UDPLITE) @@ -646,7 +650,6 @@ udp_input(struct mbuf **mp, int *offp, int proto) UDP_PROBE(receive, NULL, last, ip, last, uh); if (udp_append(last, ip, m, iphlen, udp_in) == 0) INP_RUNLOCK(last); - inp_lost: return (IPPROTO_DONE); } From owner-dev-commits-src-main@freebsd.org Thu Feb 11 11:01:42 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A9045543B14; Thu, 11 Feb 2021 11:01:42 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dbtx24PjJz3LHy; Thu, 11 Feb 2021 11:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A29F79B2; Thu, 11 Feb 2021 11:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BB1gYx066068; Thu, 11 Feb 2021 11:01:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BB1gRH066067; Thu, 11 Feb 2021 11:01:42 GMT (envelope-from git) Date: Thu, 11 Feb 2021 11:01:42 GMT Message-Id: <202102111101.11BB1gRH066067@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 251206622844 - main - Fix lib/msun/test builds on platforms without 80-bit long doubles MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25120662284466ecef976df8f86e97bafdedf991 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 11:01:42 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=25120662284466ecef976df8f86e97bafdedf991 commit 25120662284466ecef976df8f86e97bafdedf991 Author: Dimitry Andric AuthorDate: 2021-02-11 11:01:10 +0000 Commit: Dimitry Andric CommitDate: 2021-02-11 11:01:10 +0000 Fix lib/msun/test builds on platforms without 80-bit long doubles After d3338f3355a612cf385632291f46c5777bba8d18, the lib/msun test case 'hypotl_near_underflow' would fail to compile on platforms where long doubles weren't 80 bit, like on x86. Disable this particular test on such platforms for now. PR: 253313 MFC after: 1 week X-MFC-With: d3338f3355a612cf385632291f46c5777bba8d18 --- contrib/netbsd-tests/lib/libm/t_hypot.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/netbsd-tests/lib/libm/t_hypot.c b/contrib/netbsd-tests/lib/libm/t_hypot.c index 075c5c83fe14..cbb056ee470e 100644 --- a/contrib/netbsd-tests/lib/libm/t_hypot.c +++ b/contrib/netbsd-tests/lib/libm/t_hypot.c @@ -70,6 +70,7 @@ ATF_TC_BODY(pr50698, tc) ATF_CHECK(!isnan(val)); } +#if __LDBL_MANT_DIG__ == 64 ATF_TC(hypotl_near_underflow); ATF_TC_HEAD(hypotl_near_underflow, tc) { @@ -88,6 +89,7 @@ ATF_TC_BODY(hypotl_near_underflow, tc) ATF_CHECK(!isinf(val)); ATF_CHECK(fabsl(val - e) <= 2 * ulp); } +#endif /* __LDBL_MANT_DIG__ == 64 */ ATF_TP_ADD_TCS(tp) { @@ -95,7 +97,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, hypot_integer); ATF_TP_ADD_TC(tp, hypotf_integer); ATF_TP_ADD_TC(tp, pr50698); +#if __LDBL_MANT_DIG__ == 64 ATF_TP_ADD_TC(tp, hypotl_near_underflow); +#endif /* __LDBL_MANT_DIG__ == 64 */ return atf_no_error(); } From owner-dev-commits-src-main@freebsd.org Thu Feb 11 14:03:01 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A3121528EE6; Thu, 11 Feb 2021 14:03:01 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DbyyF3B8pz3nK8; Thu, 11 Feb 2021 14:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6014C12518; Thu, 11 Feb 2021 14:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BE31IF004782; Thu, 11 Feb 2021 14:03:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BE31LL004781; Thu, 11 Feb 2021 14:03:01 GMT (envelope-from git) Date: Thu, 11 Feb 2021 14:03:01 GMT Message-Id: <202102111403.11BE31LL004781@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Guangyuan Yang Subject: git: c03ccb991d0e - main - VOP_ADVLOCK(9): fix a typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c03ccb991d0e399435c9bbdb6b266ecee93f5b46 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 14:03:01 -0000 The branch main has been updated by ygy (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c03ccb991d0e399435c9bbdb6b266ecee93f5b46 commit c03ccb991d0e399435c9bbdb6b266ecee93f5b46 Author: Guangyuan Yang AuthorDate: 2021-02-11 00:25:58 +0000 Commit: Guangyuan Yang CommitDate: 2021-02-11 14:02:43 +0000 VOP_ADVLOCK(9): fix a typo Submitted by: Ka Ho Ng MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28575 --- share/man/man9/VOP_ADVLOCK.9 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man9/VOP_ADVLOCK.9 b/share/man/man9/VOP_ADVLOCK.9 index e850f32e12b4..fab1e30484d2 100644 --- a/share/man/man9/VOP_ADVLOCK.9 +++ b/share/man/man9/VOP_ADVLOCK.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2019 +.Dd February 10, 2021 .Dt VOP_ADVLOCK 9 .Os .Sh NAME @@ -54,7 +54,7 @@ The operation to perform (see .It Fa fl Description of the lock. .It Fa flags -One of more of the following: +One or more of the following: .Pp .Bl -tag -width ".Dv F_REMOTE" -offset indent -compact .It Dv F_WAIT From owner-dev-commits-src-main@freebsd.org Thu Feb 11 15:17:17 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1D45B52B3B2; Thu, 11 Feb 2021 15:17:17 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc0bx0K7hz3tWr; Thu, 11 Feb 2021 15:17:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1AE413148; Thu, 11 Feb 2021 15:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BFHGS0097367; Thu, 11 Feb 2021 15:17:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BFHGnE097366; Thu, 11 Feb 2021 15:17:16 GMT (envelope-from git) Date: Thu, 11 Feb 2021 15:17:16 GMT Message-Id: <202102111517.11BFHGnE097366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 29ed53850e72 - main - mlx4, mthca: Silence warnings about no-op alignment operations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29ed53850e72ab1b470b978d150561281addc0fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 15:17:17 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=29ed53850e72ab1b470b978d150561281addc0fc commit 29ed53850e72ab1b470b978d150561281addc0fc Author: Mark Johnston AuthorDate: 2021-02-11 15:16:59 +0000 Commit: Mark Johnston CommitDate: 2021-02-11 15:16:59 +0000 mlx4, mthca: Silence warnings about no-op alignment operations Since commit 8fa6abb6f4f64f ("Expose clang's alignment builtins and use them for roundup2/rounddown2"), clang emits warnings for several alignment operations in these drivers because the operation is a no-op. The compiler is arguably being too strict here, but in the meantime let's silence the warnings by conditionally compiling the alignment operations. Reviewed by: arichardson, hselasky MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28576 --- sys/dev/mlx4/mlx4_core/icm.h | 6 ++---- sys/dev/mlx4/mlx4_core/mlx4_fw.c | 4 ++++ sys/dev/mthca/mthca_cmd.c | 4 ++++ sys/dev/mthca/mthca_memfree.h | 8 +++----- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/sys/dev/mlx4/mlx4_core/icm.h b/sys/dev/mlx4/mlx4_core/icm.h index 30dac5174f6d..e658f1dd0383 100644 --- a/sys/dev/mlx4/mlx4_core/icm.h +++ b/sys/dev/mlx4/mlx4_core/icm.h @@ -43,10 +43,8 @@ ((256 - sizeof (struct list_head) - 2 * sizeof (int)) / \ (sizeof (struct scatterlist))) -enum { - MLX4_ICM_PAGE_SHIFT = 12, - MLX4_ICM_PAGE_SIZE = 1 << MLX4_ICM_PAGE_SHIFT, -}; +#define MLX4_ICM_PAGE_SHIFT 12 +#define MLX4_ICM_PAGE_SIZE (1 << MLX4_ICM_PAGE_SHIFT) struct mlx4_icm_chunk { struct list_head list; diff --git a/sys/dev/mlx4/mlx4_core/mlx4_fw.c b/sys/dev/mlx4/mlx4_core/mlx4_fw.c index 8ad31b812428..0ac45e1297b9 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_fw.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_fw.c @@ -1707,9 +1707,11 @@ int mlx4_QUERY_FW(struct mlx4_dev *dev) * Round up number of system pages needed in case * MLX4_ICM_PAGE_SIZE < PAGE_SIZE. */ +#if MLX4_ICM_PAGE_SIZE < PAGE_SIZE fw->fw_pages = ALIGN(fw->fw_pages, PAGE_SIZE / MLX4_ICM_PAGE_SIZE) >> (PAGE_SHIFT - MLX4_ICM_PAGE_SHIFT); +#endif mlx4_dbg(dev, "Clear int @ %llx, BAR %d\n", (unsigned long long) fw->clr_int_base, fw->clr_int_bar); @@ -2546,8 +2548,10 @@ int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages) * Round up number of system pages needed in case * MLX4_ICM_PAGE_SIZE < PAGE_SIZE. */ +#if MLX4_ICM_PAGE_SIZE < PAGE_SIZE *aux_pages = ALIGN(*aux_pages, PAGE_SIZE / MLX4_ICM_PAGE_SIZE) >> (PAGE_SHIFT - MLX4_ICM_PAGE_SHIFT); +#endif return 0; } diff --git a/sys/dev/mthca/mthca_cmd.c b/sys/dev/mthca/mthca_cmd.c index adb76bc9edbd..b4c0dc2f6f1d 100644 --- a/sys/dev/mthca/mthca_cmd.c +++ b/sys/dev/mthca/mthca_cmd.c @@ -852,9 +852,11 @@ int mthca_QUERY_FW(struct mthca_dev *dev) * Round up number of system pages needed in case * MTHCA_ICM_PAGE_SIZE < PAGE_SIZE. */ +#if MTHCA_ICM_PAGE_SIZE < PAGE_SIZE dev->fw.arbel.fw_pages = ALIGN(dev->fw.arbel.fw_pages, PAGE_SIZE / MTHCA_ICM_PAGE_SIZE) >> (PAGE_SHIFT - MTHCA_ICM_PAGE_SHIFT); +#endif mthca_dbg(dev, "Clear int @ %llx, EQ arm @ %llx, EQ set CI @ %llx\n", (unsigned long long) dev->fw.arbel.clr_int_base, @@ -1588,8 +1590,10 @@ int mthca_SET_ICM_SIZE(struct mthca_dev *dev, u64 icm_size, u64 *aux_pages) * Round up number of system pages needed in case * MTHCA_ICM_PAGE_SIZE < PAGE_SIZE. */ +#if MTHCA_ICM_PAGE_SIZE < PAGE_SIZE *aux_pages = ALIGN(*aux_pages, PAGE_SIZE / MTHCA_ICM_PAGE_SIZE) >> (PAGE_SHIFT - MTHCA_ICM_PAGE_SHIFT); +#endif return 0; } diff --git a/sys/dev/mthca/mthca_memfree.h b/sys/dev/mthca/mthca_memfree.h index da9b8f9b884f..9aa10a6a47e1 100644 --- a/sys/dev/mthca/mthca_memfree.h +++ b/sys/dev/mthca/mthca_memfree.h @@ -42,11 +42,9 @@ ((256 - sizeof (struct list_head) - 2 * sizeof (int)) / \ (sizeof (struct scatterlist))) -enum { - MTHCA_ICM_PAGE_SHIFT = 12, - MTHCA_ICM_PAGE_SIZE = 1 << MTHCA_ICM_PAGE_SHIFT, - MTHCA_DB_REC_PER_PAGE = MTHCA_ICM_PAGE_SIZE / 8 -}; +#define MTHCA_ICM_PAGE_SHIFT 12 +#define MTHCA_ICM_PAGE_SIZE (1 << MTHCA_ICM_PAGE_SHIFT) +#define MTHCA_DB_REC_PER_PAGE (MTHCA_ICM_PAGE_SIZE / 8) struct mthca_icm_chunk { struct list_head list; From owner-dev-commits-src-main@freebsd.org Thu Feb 11 15:46:55 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C4BD152C336; Thu, 11 Feb 2021 15:46:55 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc1G74PxSz4RRV; Thu, 11 Feb 2021 15:46:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85AD613A4C; Thu, 11 Feb 2021 15:46:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BFktj9036826; Thu, 11 Feb 2021 15:46:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BFktCf036825; Thu, 11 Feb 2021 15:46:55 GMT (envelope-from git) Date: Thu, 11 Feb 2021 15:46:55 GMT Message-Id: <202102111546.11BFktCf036825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Glen Barber Subject: git: 6462113b7012 - main - release.sh: fix OSVERSION and UNAME_r overrides MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6462113b7012025c2d88451c1795368ef0607deb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 15:46:55 -0000 The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=6462113b7012025c2d88451c1795368ef0607deb commit 6462113b7012025c2d88451c1795368ef0607deb Author: Glen Barber AuthorDate: 2021-02-11 15:46:38 +0000 Commit: Glen Barber CommitDate: 2021-02-11 15:46:38 +0000 release.sh: fix OSVERSION and UNAME_r overrides Add PBUILD_FLAGS and UNAME_r overrides to extra_chroot_setup() to fix building ports for 14-CURRENT builds on 13.x. MFC after: 3 days MFC with: c511a5ab53ba335dc85f7ac93843872eb5763602 Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/release.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/release/release.sh b/release/release.sh index 4020c27feaa0..58f946b9bba1 100755 --- a/release/release.sh +++ b/release/release.sh @@ -308,7 +308,13 @@ extra_chroot_setup() { GITUNSETOPTS="${GITUNSETOPTS} ICONV NLS P4 PERL" GITUNSETOPTS="${GITUNSETOPTS} SEND_EMAIL SUBTREE SVN" GITUNSETOPTS="${GITUNSETOPTS} PCRE PCRE2" + PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" + PBUILD_FLAGS="${PBUILD_FLAGS} UNAME_r=${UNAME_r}" + PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}" + PBUILD_FLAGS="${PBUILD_FLAGS} WRKDIRPREFIX=/tmp/ports" + PBUILD_FLAGS="${PBUILD_FLAGS} DISTDIR=/tmp/distfiles" eval chroot ${CHROOTDIR} env OPTIONS_UNSET=\"${GITUNSETOPTS}\" \ + ${PBUILD_FLAGS} \ make -C /usr/ports/devel/git FORCE_PKG_REGISTER=1 \ WRKDIRPREFIX=/tmp/ports \ DISTDIR=/tmp/distfiles \ @@ -345,6 +351,7 @@ extra_chroot_setup() { _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) + UNAME_r=${REVISION}-${BRANCH} PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" PBUILD_FLAGS="${PBUILD_FLAGS} UNAME_r=${UNAME_r}" PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}" From owner-dev-commits-src-main@freebsd.org Thu Feb 11 20:06:01 2021 Return-Path: Delivered-To: dev-commits-src-main@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 63080533D9F; Thu, 11 Feb 2021 20:06:01 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc7152QPBz4l0x; Thu, 11 Feb 2021 20:06:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 375E816E75; Thu, 11 Feb 2021 20:06:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BK61OS076059; Thu, 11 Feb 2021 20:06:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BK61MV076058; Thu, 11 Feb 2021 20:06:01 GMT (envelope-from git) Date: Thu, 11 Feb 2021 20:06:01 GMT Message-Id: <202102112006.11BK61MV076058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6d2a10d96fb5 - main - Widen ifnet_detach_sxlock coverage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d2a10d96fb5d4ee42fd67b0b07a6d098db5d55a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 20:06:01 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6d2a10d96fb5d4ee42fd67b0b07a6d098db5d55a commit 6d2a10d96fb5d4ee42fd67b0b07a6d098db5d55a Author: Kristof Provost AuthorDate: 2021-02-08 09:04:27 +0000 Commit: Kristof Provost CommitDate: 2021-02-11 15:12:29 +0000 Widen ifnet_detach_sxlock coverage Widen the ifnet_detach_sxlock to cover the entire vnet sysuninit code. This ensures that we can't end up having the vnet_sysuninit free the UDP pcb while the detach code is running and trying to purge the UDP pcb. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28530 --- sys/net/if.c | 13 ++++++------- sys/net/if.h | 3 +++ sys/net/vnet.c | 2 ++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 74fdd066fd2d..c85cfab19bf6 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -315,7 +315,8 @@ struct sx ifnet_sxlock; SX_SYSINIT_FLAGS(ifnet_sx, &ifnet_sxlock, "ifnet_sx", SX_RECURSE); struct sx ifnet_detach_sxlock; -SX_SYSINIT(ifnet_detach, &ifnet_detach_sxlock, "ifnet_detach_sx"); +SX_SYSINIT_FLAGS(ifnet_detach, &ifnet_detach_sxlock, "ifnet_detach_sx", + SX_RECURSE); /* * The allocation of network interfaces is a rather non-atomic affair; we @@ -546,9 +547,7 @@ vnet_if_return(const void *unused __unused) IFNET_WUNLOCK(); for (int j = 0; j < i; j++) { - sx_xlock(&ifnet_detach_sxlock); if_vmove(pending[j], pending[j]->if_home_vnet); - sx_xunlock(&ifnet_detach_sxlock); } free(pending, M_IFNET); @@ -1124,9 +1123,9 @@ if_detach(struct ifnet *ifp) CURVNET_SET_QUIET(ifp->if_vnet); found = if_unlink_ifnet(ifp, false); if (found) { - sx_slock(&ifnet_detach_sxlock); + sx_xlock(&ifnet_detach_sxlock); if_detach_internal(ifp, 0, NULL); - sx_sunlock(&ifnet_detach_sxlock); + sx_xunlock(&ifnet_detach_sxlock); } CURVNET_RESTORE(); } @@ -3015,9 +3014,9 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) error = priv_check(td, PRIV_NET_IFDESTROY); if (error == 0) { - sx_slock(&ifnet_detach_sxlock); + sx_xlock(&ifnet_detach_sxlock); error = if_clone_destroy(ifr->ifr_name); - sx_sunlock(&ifnet_detach_sxlock); + sx_xunlock(&ifnet_detach_sxlock); } goto out_noref; diff --git a/sys/net/if.h b/sys/net/if.h index eabd4e053733..e6073563bce2 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -604,6 +604,9 @@ struct ifdownreason { MALLOC_DECLARE(M_IFADDR); MALLOC_DECLARE(M_IFMADDR); #endif + +extern struct sx ifnet_detach_sxlock; + #endif #ifndef _KERNEL diff --git a/sys/net/vnet.c b/sys/net/vnet.c index c5dafedbc6b2..2480fc8dd86c 100644 --- a/sys/net/vnet.c +++ b/sys/net/vnet.c @@ -283,7 +283,9 @@ vnet_destroy(struct vnet *vnet) vnet->vnet_shutdown = true; CURVNET_SET_QUIET(vnet); + sx_xlock(&ifnet_detach_sxlock); vnet_sysuninit(); + sx_xunlock(&ifnet_detach_sxlock); CURVNET_RESTORE(); /* From owner-dev-commits-src-main@freebsd.org Thu Feb 11 21:52:46 2021 Return-Path: Delivered-To: dev-commits-src-main@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 10ACD5378C4; Thu, 11 Feb 2021 21:52:46 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc9NG01lXz4sqQ; Thu, 11 Feb 2021 21:52:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7B8318478; Thu, 11 Feb 2021 21:52:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BLqjet019382; Thu, 11 Feb 2021 21:52:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BLqjsB019381; Thu, 11 Feb 2021 21:52:45 GMT (envelope-from git) Date: Thu, 11 Feb 2021 21:52:45 GMT Message-Id: <202102112152.11BLqjsB019381@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 447b3557a9cc - main - cam: Permit non-pollable sims. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 447b3557a9cc5f00a301be8404339f21a9a0faa8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 21:52:46 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=447b3557a9cc5f00a301be8404339f21a9a0faa8 commit 447b3557a9cc5f00a301be8404339f21a9a0faa8 Author: John Baldwin AuthorDate: 2021-02-11 21:49:43 +0000 Commit: John Baldwin CommitDate: 2021-02-11 21:52:12 +0000 cam: Permit non-pollable sims. Some CAM sim drivers do not support polling (notably iscsi(4)). Rather than using a no-op poll routine that always times out requests, permit a SIM to set a NULL poll callback. cam_periph_runccb() will fail polled requests non-pollable sims immediately as if they had timed out. Reviewed by: scottl, mav (earlier version) Reviewed by: imp MFC after: 2 weeks Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D28453 --- sys/cam/cam_periph.c | 6 +++++- sys/cam/cam_sim.h | 6 ++++++ sys/cam/cam_xpt.c | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 92f7c33cbc75..98b9264f1069 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1247,7 +1248,10 @@ cam_periph_runccb(union ccb *ccb, * in the do loop below. */ if (must_poll) { - timeout = xpt_poll_setup(ccb); + if (cam_sim_pollable(ccb->ccb_h.path->bus->sim)) + timeout = xpt_poll_setup(ccb); + else + timeout = 0; } if (timeout == 0) { diff --git a/sys/cam/cam_sim.h b/sys/cam/cam_sim.h index 589d2bd1f16d..a1595a51fadb 100644 --- a/sys/cam/cam_sim.h +++ b/sys/cam/cam_sim.h @@ -142,5 +142,11 @@ cam_sim_bus(const struct cam_sim *sim) return (sim->bus_id); } +static __inline bool +cam_sim_pollable(const struct cam_sim *sim) +{ + return (sim->sim_poll != NULL); +} + #endif /* _KERNEL */ #endif /* _CAM_CAM_SIM_H */ diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index d71b8ef81240..bae40faf50e4 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -3181,6 +3181,7 @@ xpt_sim_poll(struct cam_sim *sim) { struct mtx *mtx; + KASSERT(cam_sim_pollable(sim), ("%s: non-pollable sim", __func__)); mtx = sim->mtx; if (mtx) mtx_lock(mtx); @@ -3203,6 +3204,8 @@ xpt_poll_setup(union ccb *start_ccb) devq = sim->devq; dev = start_ccb->ccb_h.path->device; + KASSERT(cam_sim_pollable(sim), ("%s: non-pollable sim", __func__)); + /* * Steal an opening so that no other queued requests * can get it before us while we simulate interrupts. @@ -3226,6 +3229,7 @@ void xpt_pollwait(union ccb *start_ccb, uint32_t timeout) { + KASSERT(cam_sim_pollable(sim), ("%s: non-pollable sim", __func__)); while (--timeout > 0) { xpt_sim_poll(start_ccb->ccb_h.path->bus->sim); if ((start_ccb->ccb_h.status & CAM_STATUS_MASK) From owner-dev-commits-src-main@freebsd.org Thu Feb 11 21:52:47 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2E5DE53791F; Thu, 11 Feb 2021 21:52:47 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc9NH0qkTz4sbZ; Thu, 11 Feb 2021 21:52:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04EFB18A51; Thu, 11 Feb 2021 21:52:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BLqk30019405; Thu, 11 Feb 2021 21:52:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BLqkrQ019404; Thu, 11 Feb 2021 21:52:46 GMT (envelope-from git) Date: Thu, 11 Feb 2021 21:52:46 GMT Message-Id: <202102112152.11BLqkrQ019404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: e07ac3f2fd73 - main - cam: Don't permit crashdumps on non-pollable devices. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e07ac3f2fd7336e04178d116033989a6c099fec4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 21:52:47 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e07ac3f2fd7336e04178d116033989a6c099fec4 commit e07ac3f2fd7336e04178d116033989a6c099fec4 Author: John Baldwin AuthorDate: 2021-02-11 21:51:01 +0000 Commit: John Baldwin CommitDate: 2021-02-11 21:52:18 +0000 cam: Don't permit crashdumps on non-pollable devices. If a disk's SIM doesn't support polling, then it can't be used to store crashdumps. Leave d_dump NULL in that case so that dumpon(8) fails gracefully rather than having dumps fail at crash time. Reviewed by: scottl, mav, imp MFC after: 2 weeks Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D28454 --- sys/cam/ata/ata_da.c | 3 ++- sys/cam/nvme/nvme_da.c | 3 ++- sys/cam/scsi/scsi_da.c | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index a34df577174c..38d996510f98 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -1880,7 +1880,8 @@ adaregister(struct cam_periph *periph, void *arg) softc->disk->d_close = adaclose; softc->disk->d_strategy = adastrategy; softc->disk->d_getattr = adagetattr; - softc->disk->d_dump = adadump; + if (cam_sim_pollable(periph->sim)) + softc->disk->d_dump = adadump; softc->disk->d_gone = adadiskgonecb; softc->disk->d_name = "ada"; softc->disk->d_drv1 = periph; diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index 8e7f7318ce3b..baeaad182f3a 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -898,7 +898,8 @@ ndaregister(struct cam_periph *periph, void *arg) disk->d_strategy = ndastrategy; disk->d_ioctl = ndaioctl; disk->d_getattr = ndagetattr; - disk->d_dump = ndadump; + if (cam_sim_pollable(periph->sim)) + disk->d_dump = ndadump; disk->d_gone = ndadiskgonecb; disk->d_name = "nda"; disk->d_drv1 = periph; diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 490f75336efd..e426fe07621b 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -2849,7 +2849,7 @@ daregister(struct cam_periph *periph, void *arg) TASK_INIT(&softc->sysctl_task, 0, dasysctlinit, periph); /* - * Take an exclusive section lock qon the periph while dastart is called + * Take an exclusive section lock on the periph while dastart is called * to finish the probe. The lock will be dropped in dadone at the end * of probe. This locks out daopen and daclose from racing with the * probe. @@ -2914,7 +2914,8 @@ daregister(struct cam_periph *periph, void *arg) softc->disk->d_open = daopen; softc->disk->d_close = daclose; softc->disk->d_strategy = dastrategy; - softc->disk->d_dump = dadump; + if (cam_sim_pollable(periph->sim)) + softc->disk->d_dump = dadump; softc->disk->d_getattr = dagetattr; softc->disk->d_gone = dadiskgonecb; softc->disk->d_name = "da"; From owner-dev-commits-src-main@freebsd.org Thu Feb 11 21:52:49 2021 Return-Path: Delivered-To: dev-commits-src-main@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 06DEA537B93; Thu, 11 Feb 2021 21:52:48 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc9NJ2SMnz4sT0; Thu, 11 Feb 2021 21:52:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A96B18479; Thu, 11 Feb 2021 21:52:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BLqmPD019423; Thu, 11 Feb 2021 21:52:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BLqmQV019422; Thu, 11 Feb 2021 21:52:48 GMT (envelope-from git) Date: Thu, 11 Feb 2021 21:52:48 GMT Message-Id: <202102112152.11BLqmQV019422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 47769bc5573f - main - iscsi: Mark iSCSI CAM sims as non-pollable. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47769bc5573fc5d2263f9e20cb06f6c12d0a82e7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 21:52:50 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=47769bc5573fc5d2263f9e20cb06f6c12d0a82e7 commit 47769bc5573fc5d2263f9e20cb06f6c12d0a82e7 Author: John Baldwin AuthorDate: 2021-02-11 21:51:20 +0000 Commit: John Baldwin CommitDate: 2021-02-11 21:52:18 +0000 iscsi: Mark iSCSI CAM sims as non-pollable. Previously, iscsi_poll() just panicked. This meant if you got a panic on a box when using the iSCSI initiator, the attempt to shutdown would trigger a nested panic and never write out a core. Now, CCB's sent to iSCSI devices (such as the sychronize-cache request in dashutdown()) just fail with a timeout during a panic shutdown. Reviewed by: scottl, mav MFC after: 2 weeks Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D28455 --- sys/dev/iscsi/iscsi.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index c4123d9f4aa7..4367f780d84b 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -171,7 +171,6 @@ static void iscsi_pdu_handle_reject(struct icl_pdu *response); static void iscsi_session_reconnect(struct iscsi_session *is); static void iscsi_session_terminate(struct iscsi_session *is); static void iscsi_action(struct cam_sim *sim, union ccb *ccb); -static void iscsi_poll(struct cam_sim *sim); static struct iscsi_outstanding *iscsi_outstanding_find(struct iscsi_session *is, uint32_t initiator_task_tag); static struct iscsi_outstanding *iscsi_outstanding_add(struct iscsi_session *is, @@ -1491,7 +1490,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_softc *sc, return (ENOMEM); } - is->is_sim = cam_sim_alloc(iscsi_action, iscsi_poll, "iscsi", + is->is_sim = cam_sim_alloc(iscsi_action, NULL, "iscsi", is, is->is_id /* unit */, &is->is_lock, 1, ic->ic_maxtags, is->is_devq); if (is->is_sim == NULL) { @@ -2462,13 +2461,6 @@ iscsi_action(struct cam_sim *sim, union ccb *ccb) xpt_done(ccb); } -static void -iscsi_poll(struct cam_sim *sim) -{ - - KASSERT(0, ("%s: you're not supposed to be here", __func__)); -} - static void iscsi_terminate_sessions(struct iscsi_softc *sc) { From owner-dev-commits-src-main@freebsd.org Thu Feb 11 22:08:49 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5DC9953831C; Thu, 11 Feb 2021 22:08:49 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dc9kn29w2z4trs; Thu, 11 Feb 2021 22:08:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DF7418C86; Thu, 11 Feb 2021 22:08:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BM8nkD034284; Thu, 11 Feb 2021 22:08:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BM8nSZ034283; Thu, 11 Feb 2021 22:08:49 GMT (envelope-from git) Date: Thu, 11 Feb 2021 22:08:49 GMT Message-Id: <202102112208.11BM8nSZ034283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: e6405c8c3733 - main - cam: Properly find the sim in the assertion in xpt_pollwait(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6405c8c37335a42a187a9d2470025b57347b1b5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 22:08:49 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e6405c8c37335a42a187a9d2470025b57347b1b5 commit e6405c8c37335a42a187a9d2470025b57347b1b5 Author: John Baldwin AuthorDate: 2021-02-08 23:02:14 +0000 Commit: John Baldwin CommitDate: 2021-02-11 22:06:58 +0000 cam: Properly find the sim in the assertion in xpt_pollwait(). I had missed merging this fixup into 447b3557a9cc5f00a301be8404339f21a9a0faa8 before pushing it. Pointy hat to: jhb MFC after: 2 weeks --- sys/cam/cam_xpt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index bae40faf50e4..9cfee80a6049 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -3229,7 +3229,8 @@ void xpt_pollwait(union ccb *start_ccb, uint32_t timeout) { - KASSERT(cam_sim_pollable(sim), ("%s: non-pollable sim", __func__)); + KASSERT(cam_sim_pollable(start_ccb->ccb_h.path->bus->sim), + ("%s: non-pollable sim", __func__)); while (--timeout > 0) { xpt_sim_poll(start_ccb->ccb_h.path->bus->sim); if ((start_ccb->ccb_h.status & CAM_STATUS_MASK) From owner-dev-commits-src-main@freebsd.org Thu Feb 11 23:10:11 2021 Return-Path: Delivered-To: dev-commits-src-main@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 CABCB539605; Thu, 11 Feb 2021 23:10:11 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcC5b5Nxtz3DT1; Thu, 11 Feb 2021 23:10:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7C9919A00; Thu, 11 Feb 2021 23:10:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BNABJr015773; Thu, 11 Feb 2021 23:10:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BNABTx015766; Thu, 11 Feb 2021 23:10:11 GMT (envelope-from git) Date: Thu, 11 Feb 2021 23:10:11 GMT Message-Id: <202102112310.11BNABTx015766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 145bf6c0af48 - main - Fix blackhole/reject routes. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 145bf6c0af48b89f13465e145f4516de37c31d85 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 23:10:11 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=145bf6c0af48b89f13465e145f4516de37c31d85 commit 145bf6c0af48b89f13465e145f4516de37c31d85 Author: Alexander V. Chernikov AuthorDate: 2021-02-08 23:29:05 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-11 23:08:55 +0000 Fix blackhole/reject routes. Traditionally *BSD routing stack required to supply some interface data for blackhole/reject routes. This lead to varieties of hacks in routing daemons when inserting such routes. With the recent routeing stack changes, gateway sockaddr without RTF_GATEWAY started to be treated differently, purely as link identifier. This change broke net/bird, which installs blackhole routes with 127.0.0.1 gateway without RTF_GATEWAY flags. Fix this by automatically constructing necessary gateway data at rtsock level if RTF_REJECT/RTF_BLACKHOLE is set. Reported by: Marek Zarychta Reviewed by: donner MFC after: 1 week --- sys/net/rtsock.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index ba1182d55439..f67252f9fd5f 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -562,6 +562,50 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet *ifp, return (0); } +static int +fill_blackholeinfo(struct rt_addrinfo *info, union sockaddr_union *saun) +{ + struct ifaddr *ifa; + sa_family_t saf; + + if (V_loif == NULL) { + printf("Unable to add blackhole/reject nhop without loopback"); + return (ENOTSUP); + } + info->rti_ifp = V_loif; + + saf = info->rti_info[RTAX_DST]->sa_family; + + CK_STAILQ_FOREACH(ifa, &info->rti_ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family == saf) { + info->rti_ifa = ifa; + break; + } + } + if (info->rti_ifa == NULL) + return (ENOTSUP); + + bzero(saun, sizeof(union sockaddr_union)); + switch (saf) { + case AF_INET: + saun->sin.sin_family = AF_INET; + saun->sin.sin_len = sizeof(struct sockaddr_in); + saun->sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + break; + case AF_INET6: + saun->sin6.sin6_family = AF_INET6; + saun->sin6.sin6_len = sizeof(struct sockaddr_in6); + saun->sin6.sin6_addr = in6addr_loopback; + break; + default: + return (ENOTSUP); + } + info->rti_info[RTAX_GATEWAY] = &saun->sa; + info->rti_flags |= RTF_GATEWAY; + + return (0); +} + /* * Fills in @info based on userland-provided @rtm message. * @@ -944,7 +988,6 @@ route_output(struct mbuf *m, struct socket *so, ...) #endif int alloc_len = 0, len, error = 0, fibnum; sa_family_t saf = AF_UNSPEC; - struct walkarg w; struct rib_cmd_info rc; struct nhop_object *nh; @@ -972,7 +1015,6 @@ route_output(struct mbuf *m, struct socket *so, ...) m_copydata(m, 0, len, (caddr_t)rtm); bzero(&info, sizeof(info)); - bzero(&w, sizeof(w)); nh = NULL; if (rtm->rtm_version != RTM_VERSION) { @@ -1004,6 +1046,18 @@ route_output(struct mbuf *m, struct socket *so, ...) goto flush; } + union sockaddr_union gw_saun; + int blackhole_flags = rtm->rtm_flags & (RTF_BLACKHOLE|RTF_REJECT); + if (blackhole_flags != 0) { + if (blackhole_flags != (RTF_BLACKHOLE | RTF_REJECT)) + error = fill_blackholeinfo(&info, &gw_saun); + else + error = EINVAL; + if (error != 0) + senderr(error); + /* TODO: rebuild rtm from scratch */ + } + switch (rtm->rtm_type) { case RTM_ADD: case RTM_CHANGE: From owner-dev-commits-src-main@freebsd.org Thu Feb 11 23:11:00 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4029053968C; Thu, 11 Feb 2021 23:11:00 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcC6X1R4Dz3Dwr; Thu, 11 Feb 2021 23:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2412D199DB; Thu, 11 Feb 2021 23:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BNB0cg021218; Thu, 11 Feb 2021 23:11:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BNB0n3021217; Thu, 11 Feb 2021 23:11:00 GMT (envelope-from git) Date: Thu, 11 Feb 2021 23:11:00 GMT Message-Id: <202102112311.11BNB0n3021217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7fe2f504f8a0 - main - efibootmgr: Check for efi supported after parsing args MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7fe2f504f8a0e4237872f8528e911c5f7b7ed59d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 23:11:00 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7fe2f504f8a0e4237872f8528e911c5f7b7ed59d commit 7fe2f504f8a0e4237872f8528e911c5f7b7ed59d Author: Warner Losh AuthorDate: 2021-02-11 23:06:30 +0000 Commit: Warner Losh CommitDate: 2021-02-11 23:09:51 +0000 efibootmgr: Check for efi supported after parsing args Move the check for efi variables being supported to after parsing the args. This allows '-h' to produce both as a normal user as well as on all systems. --- usr.sbin/efibootmgr/efibootmgr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index 8c7ba82cb5a5..53bc417c4e07 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -1072,11 +1072,12 @@ int main(int argc, char *argv[]) { + memset(&opts, 0, sizeof (bmgr_opts_t)); + parse_args(argc, argv); + if (!efi_variables_supported()) errx(1, "efi variables not supported on this system. root? kldload efirt?"); - memset(&opts, 0, sizeof (bmgr_opts_t)); - parse_args(argc, argv); read_vars(); if (opts.create) From owner-dev-commits-src-main@freebsd.org Thu Feb 11 23:53:35 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9927B53A391; Thu, 11 Feb 2021 23:53:35 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcD3g3wsVz3HD3; Thu, 11 Feb 2021 23:53:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79C2019FE0; Thu, 11 Feb 2021 23:53:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BNrZl0077437; Thu, 11 Feb 2021 23:53:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BNrZP3077436; Thu, 11 Feb 2021 23:53:35 GMT (envelope-from git) Date: Thu, 11 Feb 2021 23:53:35 GMT Message-Id: <202102112353.11BNrZP3077436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: 34e67bb59770 - main - lex: Use NULL instead of 0 for pointers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 34e67bb5977049afb3e965b52b86ac12ea4899b4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 23:53:35 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=34e67bb5977049afb3e965b52b86ac12ea4899b4 commit 34e67bb5977049afb3e965b52b86ac12ea4899b4 Author: Jung-uk Kim AuthorDate: 2021-02-11 23:31:53 +0000 Commit: Jung-uk Kim CommitDate: 2021-02-11 23:31:53 +0000 lex: Use NULL instead of 0 for pointers Note araujo tried to fix it in r298241 but he only touched generated files for bootstrap. This commit properly fixes the problem. --- contrib/flex/src/scan.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/flex/src/scan.l b/contrib/flex/src/scan.l index 1570f505b342..d01406ecdd4a 100644 --- a/contrib/flex/src/scan.l +++ b/contrib/flex/src/scan.l @@ -705,7 +705,7 @@ M4QEND "]""]" } nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ - if ( (nmdefptr = ndlookup( nmstr )) == 0 ) + if ( (nmdefptr = ndlookup( nmstr )) == NULL ) format_synerr( _( "undefined definition {%s}" ), nmstr ); From owner-dev-commits-src-main@freebsd.org Thu Feb 11 23:53:36 2021 Return-Path: Delivered-To: dev-commits-src-main@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 DAD5353A4D1; Thu, 11 Feb 2021 23:53:36 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcD3h50rGz3HD5; Thu, 11 Feb 2021 23:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D3A81A2B2; Thu, 11 Feb 2021 23:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BNra26077456; Thu, 11 Feb 2021 23:53:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BNraBT077455; Thu, 11 Feb 2021 23:53:36 GMT (envelope-from git) Date: Thu, 11 Feb 2021 23:53:36 GMT Message-Id: <202102112353.11BNraBT077455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: 80f314327434 - main - yacc: Use NULL instead of 0 for pointers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80f31432743446a1e8e4f8cb8268b74ac4e4f2da Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 23:53:37 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=80f31432743446a1e8e4f8cb8268b74ac4e4f2da commit 80f31432743446a1e8e4f8cb8268b74ac4e4f2da Author: Jung-uk Kim AuthorDate: 2021-02-11 23:40:00 +0000 Commit: Jung-uk Kim CommitDate: 2021-02-11 23:40:00 +0000 yacc: Use NULL instead of 0 for pointers Note araujo tried to fix it in r298241 but he only touched generated files for bootstrap. This commit properly fixes the problem. --- contrib/byacc/btyaccpar.c | 8 ++++---- contrib/byacc/btyaccpar.skel | 8 ++++---- contrib/byacc/yaccpar.c | 6 +++--- contrib/byacc/yaccpar.skel | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/contrib/byacc/btyaccpar.c b/contrib/byacc/btyaccpar.c index 64a9febd17e4..f4db838e3244 100644 --- a/contrib/byacc/btyaccpar.c +++ b/contrib/byacc/btyaccpar.c @@ -326,14 +326,14 @@ const char *const body_1[] = "", " i = (int) (data->s_mark - data->s_base);", " newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));", - " if (newss == 0)", + " if (newss == NULL)", " return YYENOMEM;", "", " data->s_base = newss;", " data->s_mark = newss + i;", "", " newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));", - " if (newvs == 0)", + " if (newvs == NULL)", " return YYENOMEM;", "", " data->l_base = newvs;", @@ -341,7 +341,7 @@ const char *const body_1[] = "", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", " newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));", - " if (newps == 0)", + " if (newps == NULL)", " return YYENOMEM;", "", " data->p_base = newps;", @@ -446,7 +446,7 @@ const char *const body_2[] = "#if YYDEBUG", " const char *yys;", "", - " if ((yys = getenv(\"YYDEBUG\")) != 0)", + " if ((yys = getenv(\"YYDEBUG\")) != NULL)", " {", " yyn = *yys;", " if (yyn >= '0' && yyn <= '9')", diff --git a/contrib/byacc/btyaccpar.skel b/contrib/byacc/btyaccpar.skel index 009942ee041f..84ea14846138 100644 --- a/contrib/byacc/btyaccpar.skel +++ b/contrib/byacc/btyaccpar.skel @@ -271,14 +271,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -286,7 +286,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -381,7 +381,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/yaccpar.c b/contrib/byacc/yaccpar.c index e57bd4bb7d36..30299074523f 100644 --- a/contrib/byacc/yaccpar.c +++ b/contrib/byacc/yaccpar.c @@ -160,14 +160,14 @@ const char *const body_1[] = "", " i = (int) (data->s_mark - data->s_base);", " newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));", - " if (newss == 0)", + " if (newss == NULL)", " return YYENOMEM;", "", " data->s_base = newss;", " data->s_mark = newss + i;", "", " newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));", - " if (newvs == 0)", + " if (newvs == NULL)", " return YYENOMEM;", "", " data->l_base = newvs;", @@ -206,7 +206,7 @@ const char *const body_2[] = "#if YYDEBUG", " const char *yys;", "", - " if ((yys = getenv(\"YYDEBUG\")) != 0)", + " if ((yys = getenv(\"YYDEBUG\")) != NULL)", " {", " yyn = *yys;", " if (yyn >= '0' && yyn <= '9')", diff --git a/contrib/byacc/yaccpar.skel b/contrib/byacc/yaccpar.skel index 32e2d1560537..f12e0d29cca9 100644 --- a/contrib/byacc/yaccpar.skel +++ b/contrib/byacc/yaccpar.skel @@ -119,14 +119,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -161,7 +161,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') From owner-dev-commits-src-main@freebsd.org Thu Feb 11 23:53:38 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2ADAE53A4D6; Thu, 11 Feb 2021 23:53:38 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcD3j6NFjz3H7q; Thu, 11 Feb 2021 23:53:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCB611A042; Thu, 11 Feb 2021 23:53:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BNrbT5077478; Thu, 11 Feb 2021 23:53:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BNrbkO077477; Thu, 11 Feb 2021 23:53:37 GMT (envelope-from git) Date: Thu, 11 Feb 2021 23:53:37 GMT Message-Id: <202102112353.11BNrbkO077477@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: bf80e08ed5ed - main - yacc: Regen test cases for the previous commit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf80e08ed5ed32bbfd50674c01f8a0e519133e17 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 23:53:38 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=bf80e08ed5ed32bbfd50674c01f8a0e519133e17 commit bf80e08ed5ed32bbfd50674c01f8a0e519133e17 Author: Jung-uk Kim AuthorDate: 2021-02-11 23:41:28 +0000 Commit: Jung-uk Kim CommitDate: 2021-02-11 23:41:28 +0000 yacc: Regen test cases for the previous commit --- contrib/byacc/test/btyacc/btyacc_calc1.tab.c | 8 ++++---- contrib/byacc/test/btyacc/btyacc_demo.tab.c | 8 ++++---- contrib/byacc/test/btyacc/btyacc_destroy1.tab.c | 8 ++++---- contrib/byacc/test/btyacc/btyacc_destroy2.tab.c | 8 ++++---- contrib/byacc/test/btyacc/btyacc_destroy3.tab.c | 8 ++++---- contrib/byacc/test/btyacc/calc.tab.c | 8 ++++---- contrib/byacc/test/btyacc/calc1.tab.c | 8 ++++---- contrib/byacc/test/btyacc/calc2.tab.c | 8 ++++---- contrib/byacc/test/btyacc/calc3.tab.c | 8 ++++---- contrib/byacc/test/btyacc/calc_code_all.tab.c | 8 ++++---- contrib/byacc/test/btyacc/calc_code_default.tab.c | 8 ++++---- contrib/byacc/test/btyacc/calc_code_imports.tab.c | 8 ++++---- contrib/byacc/test/btyacc/calc_code_provides.tab.c | 8 ++++---- contrib/byacc/test/btyacc/calc_code_requires.tab.c | 8 ++++---- contrib/byacc/test/btyacc/calc_code_top.tab.c | 8 ++++---- contrib/byacc/test/btyacc/code_calc.code.c | 8 ++++---- contrib/byacc/test/btyacc/code_error.code.c | 8 ++++---- contrib/byacc/test/btyacc/defines1.calc.c | 8 ++++---- contrib/byacc/test/btyacc/defines2.calc.c | 8 ++++---- contrib/byacc/test/btyacc/defines3.calc.c | 8 ++++---- contrib/byacc/test/btyacc/empty.tab.c | 8 ++++---- contrib/byacc/test/btyacc/err_inherit3.tab.c | 8 ++++---- contrib/byacc/test/btyacc/err_inherit4.tab.c | 8 ++++---- contrib/byacc/test/btyacc/err_syntax10.tab.c | 8 ++++---- contrib/byacc/test/btyacc/err_syntax11.tab.c | 8 ++++---- contrib/byacc/test/btyacc/err_syntax12.tab.c | 8 ++++---- contrib/byacc/test/btyacc/err_syntax18.tab.c | 8 ++++---- contrib/byacc/test/btyacc/err_syntax20.tab.c | 8 ++++---- contrib/byacc/test/btyacc/error.tab.c | 8 ++++---- contrib/byacc/test/btyacc/expr.oxout.tab.c | 8 ++++---- contrib/byacc/test/btyacc/grammar.tab.c | 8 ++++---- contrib/byacc/test/btyacc/inherit0.tab.c | 8 ++++---- contrib/byacc/test/btyacc/inherit1.tab.c | 8 ++++---- contrib/byacc/test/btyacc/inherit2.tab.c | 8 ++++---- contrib/byacc/test/btyacc/ok_syntax1.tab.c | 8 ++++---- contrib/byacc/test/btyacc/pure_calc.tab.c | 8 ++++---- contrib/byacc/test/btyacc/pure_error.tab.c | 8 ++++---- contrib/byacc/test/btyacc/quote_calc-s.tab.c | 8 ++++---- contrib/byacc/test/btyacc/quote_calc.tab.c | 8 ++++---- contrib/byacc/test/btyacc/quote_calc2-s.tab.c | 8 ++++---- contrib/byacc/test/btyacc/quote_calc2.tab.c | 8 ++++---- contrib/byacc/test/btyacc/quote_calc3-s.tab.c | 8 ++++---- contrib/byacc/test/btyacc/quote_calc3.tab.c | 8 ++++---- contrib/byacc/test/btyacc/quote_calc4-s.tab.c | 8 ++++---- contrib/byacc/test/btyacc/quote_calc4.tab.c | 8 ++++---- contrib/byacc/test/btyacc/rename_debug.c | 8 ++++---- contrib/byacc/test/btyacc/stdin1.calc.c | 8 ++++---- contrib/byacc/test/btyacc/stdin2.calc.c | 8 ++++---- contrib/byacc/test/btyacc/varsyntax_calc1.tab.c | 8 ++++---- contrib/byacc/test/yacc/calc.tab.c | 6 +++--- contrib/byacc/test/yacc/calc1.tab.c | 6 +++--- contrib/byacc/test/yacc/calc2.tab.c | 6 +++--- contrib/byacc/test/yacc/calc3.tab.c | 6 +++--- contrib/byacc/test/yacc/calc_code_all.tab.c | 6 +++--- contrib/byacc/test/yacc/calc_code_default.tab.c | 6 +++--- contrib/byacc/test/yacc/calc_code_imports.tab.c | 6 +++--- contrib/byacc/test/yacc/calc_code_provides.tab.c | 6 +++--- contrib/byacc/test/yacc/calc_code_requires.tab.c | 6 +++--- contrib/byacc/test/yacc/calc_code_top.tab.c | 6 +++--- contrib/byacc/test/yacc/code_calc.code.c | 6 +++--- contrib/byacc/test/yacc/code_error.code.c | 6 +++--- contrib/byacc/test/yacc/defines1.calc.c | 6 +++--- contrib/byacc/test/yacc/defines2.calc.c | 6 +++--- contrib/byacc/test/yacc/defines3.calc.c | 6 +++--- contrib/byacc/test/yacc/empty.tab.c | 6 +++--- contrib/byacc/test/yacc/err_syntax10.tab.c | 6 +++--- contrib/byacc/test/yacc/err_syntax11.tab.c | 6 +++--- contrib/byacc/test/yacc/err_syntax12.tab.c | 6 +++--- contrib/byacc/test/yacc/err_syntax18.tab.c | 6 +++--- contrib/byacc/test/yacc/err_syntax20.tab.c | 6 +++--- contrib/byacc/test/yacc/error.tab.c | 6 +++--- contrib/byacc/test/yacc/expr.oxout.tab.c | 6 +++--- contrib/byacc/test/yacc/grammar.tab.c | 6 +++--- contrib/byacc/test/yacc/ok_syntax1.tab.c | 6 +++--- contrib/byacc/test/yacc/pure_calc.tab.c | 6 +++--- contrib/byacc/test/yacc/pure_error.tab.c | 6 +++--- contrib/byacc/test/yacc/quote_calc-s.tab.c | 6 +++--- contrib/byacc/test/yacc/quote_calc.tab.c | 6 +++--- contrib/byacc/test/yacc/quote_calc2-s.tab.c | 6 +++--- contrib/byacc/test/yacc/quote_calc2.tab.c | 6 +++--- contrib/byacc/test/yacc/quote_calc3-s.tab.c | 6 +++--- contrib/byacc/test/yacc/quote_calc3.tab.c | 6 +++--- contrib/byacc/test/yacc/quote_calc4-s.tab.c | 6 +++--- contrib/byacc/test/yacc/quote_calc4.tab.c | 6 +++--- contrib/byacc/test/yacc/rename_debug.c | 6 +++--- contrib/byacc/test/yacc/stdin1.calc.c | 6 +++--- contrib/byacc/test/yacc/stdin2.calc.c | 6 +++--- contrib/byacc/test/yacc/varsyntax_calc1.tab.c | 6 +++--- 88 files changed, 313 insertions(+), 313 deletions(-) diff --git a/contrib/byacc/test/btyacc/btyacc_calc1.tab.c b/contrib/byacc/test/btyacc/btyacc_calc1.tab.c index a1368f2c72f5..aa02292ef69f 100644 --- a/contrib/byacc/test/btyacc/btyacc_calc1.tab.c +++ b/contrib/byacc/test/btyacc/btyacc_calc1.tab.c @@ -651,14 +651,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -666,7 +666,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -812,7 +812,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/btyacc_demo.tab.c b/contrib/byacc/test/btyacc/btyacc_demo.tab.c index 3493ee7555db..d5875fae1838 100644 --- a/contrib/byacc/test/btyacc/btyacc_demo.tab.c +++ b/contrib/byacc/test/btyacc/btyacc_demo.tab.c @@ -1215,14 +1215,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -1230,7 +1230,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -1324,7 +1324,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/btyacc_destroy1.tab.c b/contrib/byacc/test/btyacc/btyacc_destroy1.tab.c index 2ddb0cdba988..5375d069d1f5 100644 --- a/contrib/byacc/test/btyacc/btyacc_destroy1.tab.c +++ b/contrib/byacc/test/btyacc/btyacc_destroy1.tab.c @@ -547,14 +547,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -562,7 +562,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -656,7 +656,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/btyacc_destroy2.tab.c b/contrib/byacc/test/btyacc/btyacc_destroy2.tab.c index 7833f8532907..9f5c68891723 100644 --- a/contrib/byacc/test/btyacc/btyacc_destroy2.tab.c +++ b/contrib/byacc/test/btyacc/btyacc_destroy2.tab.c @@ -547,14 +547,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -562,7 +562,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -656,7 +656,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/btyacc_destroy3.tab.c b/contrib/byacc/test/btyacc/btyacc_destroy3.tab.c index 28a6c94a9c8b..f4d1fdc2b136 100644 --- a/contrib/byacc/test/btyacc/btyacc_destroy3.tab.c +++ b/contrib/byacc/test/btyacc/btyacc_destroy3.tab.c @@ -547,14 +547,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -562,7 +562,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -656,7 +656,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/calc.tab.c b/contrib/byacc/test/btyacc/calc.tab.c index e171ee9eb7ed..906a4b4e04d8 100644 --- a/contrib/byacc/test/btyacc/calc.tab.c +++ b/contrib/byacc/test/btyacc/calc.tab.c @@ -542,14 +542,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -557,7 +557,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -651,7 +651,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/calc1.tab.c b/contrib/byacc/test/btyacc/calc1.tab.c index 298a0600121b..c246d4f01e42 100644 --- a/contrib/byacc/test/btyacc/calc1.tab.c +++ b/contrib/byacc/test/btyacc/calc1.tab.c @@ -686,14 +686,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -701,7 +701,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -795,7 +795,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/calc2.tab.c b/contrib/byacc/test/btyacc/calc2.tab.c index cb2a4d92196d..474dbdbcc477 100644 --- a/contrib/byacc/test/btyacc/calc2.tab.c +++ b/contrib/byacc/test/btyacc/calc2.tab.c @@ -555,14 +555,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -570,7 +570,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -664,7 +664,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/calc3.tab.c b/contrib/byacc/test/btyacc/calc3.tab.c index 5dc48f1c4fb5..503725978768 100644 --- a/contrib/byacc/test/btyacc/calc3.tab.c +++ b/contrib/byacc/test/btyacc/calc3.tab.c @@ -508,14 +508,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -523,7 +523,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -669,7 +669,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/calc_code_all.tab.c b/contrib/byacc/test/btyacc/calc_code_all.tab.c index 92d4d63886e3..c321adee1590 100644 --- a/contrib/byacc/test/btyacc/calc_code_all.tab.c +++ b/contrib/byacc/test/btyacc/calc_code_all.tab.c @@ -570,14 +570,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -585,7 +585,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -679,7 +679,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/calc_code_default.tab.c b/contrib/byacc/test/btyacc/calc_code_default.tab.c index 3ba5e5b4d274..9995d89a3f2f 100644 --- a/contrib/byacc/test/btyacc/calc_code_default.tab.c +++ b/contrib/byacc/test/btyacc/calc_code_default.tab.c @@ -550,14 +550,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -565,7 +565,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -659,7 +659,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/calc_code_imports.tab.c b/contrib/byacc/test/btyacc/calc_code_imports.tab.c index 6bc36a29b683..4f3b28111511 100644 --- a/contrib/byacc/test/btyacc/calc_code_imports.tab.c +++ b/contrib/byacc/test/btyacc/calc_code_imports.tab.c @@ -542,14 +542,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -557,7 +557,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -651,7 +651,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/calc_code_provides.tab.c b/contrib/byacc/test/btyacc/calc_code_provides.tab.c index 6ee06f34d2ae..5e3398504fac 100644 --- a/contrib/byacc/test/btyacc/calc_code_provides.tab.c +++ b/contrib/byacc/test/btyacc/calc_code_provides.tab.c @@ -550,14 +550,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -565,7 +565,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -659,7 +659,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/calc_code_requires.tab.c b/contrib/byacc/test/btyacc/calc_code_requires.tab.c index 086e6b7bd1af..1b630f9dadea 100644 --- a/contrib/byacc/test/btyacc/calc_code_requires.tab.c +++ b/contrib/byacc/test/btyacc/calc_code_requires.tab.c @@ -550,14 +550,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -565,7 +565,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -659,7 +659,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/calc_code_top.tab.c b/contrib/byacc/test/btyacc/calc_code_top.tab.c index 6e6ce04adfc7..e1ef6ec0ff2b 100644 --- a/contrib/byacc/test/btyacc/calc_code_top.tab.c +++ b/contrib/byacc/test/btyacc/calc_code_top.tab.c @@ -550,14 +550,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -565,7 +565,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -659,7 +659,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/code_calc.code.c b/contrib/byacc/test/btyacc/code_calc.code.c index 4434a187ead9..49fe8c4b0ff9 100644 --- a/contrib/byacc/test/btyacc/code_calc.code.c +++ b/contrib/byacc/test/btyacc/code_calc.code.c @@ -415,14 +415,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -430,7 +430,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -524,7 +524,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/code_error.code.c b/contrib/byacc/test/btyacc/code_error.code.c index 5b4130f4cd85..3cffb9e85318 100644 --- a/contrib/byacc/test/btyacc/code_error.code.c +++ b/contrib/byacc/test/btyacc/code_error.code.c @@ -385,14 +385,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -400,7 +400,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -494,7 +494,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/defines1.calc.c b/contrib/byacc/test/btyacc/defines1.calc.c index 606ad414f571..8c1206a89683 100644 --- a/contrib/byacc/test/btyacc/defines1.calc.c +++ b/contrib/byacc/test/btyacc/defines1.calc.c @@ -449,14 +449,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -464,7 +464,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -558,7 +558,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/defines2.calc.c b/contrib/byacc/test/btyacc/defines2.calc.c index 606ad414f571..8c1206a89683 100644 --- a/contrib/byacc/test/btyacc/defines2.calc.c +++ b/contrib/byacc/test/btyacc/defines2.calc.c @@ -449,14 +449,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -464,7 +464,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -558,7 +558,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/defines3.calc.c b/contrib/byacc/test/btyacc/defines3.calc.c index 34473f73b66a..9a1655555d0c 100644 --- a/contrib/byacc/test/btyacc/defines3.calc.c +++ b/contrib/byacc/test/btyacc/defines3.calc.c @@ -449,14 +449,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -464,7 +464,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -558,7 +558,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/empty.tab.c b/contrib/byacc/test/btyacc/empty.tab.c index 8ec7d2d9d386..ae26439aeeed 100644 --- a/contrib/byacc/test/btyacc/empty.tab.c +++ b/contrib/byacc/test/btyacc/empty.tab.c @@ -404,14 +404,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -419,7 +419,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -513,7 +513,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/err_inherit3.tab.c b/contrib/byacc/test/btyacc/err_inherit3.tab.c index 790d9c5eaf66..3b1da35ee3eb 100644 --- a/contrib/byacc/test/btyacc/err_inherit3.tab.c +++ b/contrib/byacc/test/btyacc/err_inherit3.tab.c @@ -504,14 +504,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -519,7 +519,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) return YYENOMEM; data->p_base = newps; @@ -613,7 +613,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/contrib/byacc/test/btyacc/err_inherit4.tab.c b/contrib/byacc/test/btyacc/err_inherit4.tab.c index 9e101f8370b1..087ee9cd1d92 100644 --- a/contrib/byacc/test/btyacc/err_inherit4.tab.c +++ b/contrib/byacc/test/btyacc/err_inherit4.tab.c @@ -502,14 +502,14 @@ static int yygrowstack(YYSTACKDATA *data) i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return YYENOMEM; data->l_base = newvs; @@ -517,7 +517,7 @@ static int yygrowstack(YYSTACKDATA *data) #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); - if (newps == 0) + if (newps == NULL) *** 2196 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Fri Feb 12 00:58:41 2021 Return-Path: Delivered-To: dev-commits-src-main@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 EA6BC53CDF9; Fri, 12 Feb 2021 00:58:41 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFVn6JH5z3MdB; Fri, 12 Feb 2021 00:58:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB1F81ADB8; Fri, 12 Feb 2021 00:58:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C0wfVL056681; Fri, 12 Feb 2021 00:58:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C0wfgc056680; Fri, 12 Feb 2021 00:58:41 GMT (envelope-from git) Date: Fri, 12 Feb 2021 00:58:41 GMT Message-Id: <202102120058.11C0wfgc056680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 18418e1936b5 - main - pkg(7): add an -r reponame option for bootstrap and add MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 18418e1936b59c34a9c4a02a1ba5fe0d00dde1b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 00:58:42 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=18418e1936b59c34a9c4a02a1ba5fe0d00dde1b3 commit 18418e1936b59c34a9c4a02a1ba5fe0d00dde1b3 Author: Kyle Evans AuthorDate: 2021-02-12 00:58:26 +0000 Commit: Kyle Evans CommitDate: 2021-02-12 00:58:26 +0000 pkg(7): add an -r reponame option for bootstrap and add This is limited to bootstrap/add because some real pkg(8) commands have -r flags with an incompatible meaning/usage, e.g., pkg-audit. pkg(7) will still commence the search as it has, but it will ignore any repo objects without the given name so that overrides and whatnot still work as expected. The use of it for add is noted in the manpage; notably, that the signature config for that repository will be used over global config if it's specified. i.e., pkg(7) should assume that the given pkg did come from that repository and treat it appropriately. Reviewed by: bapt, manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28524 --- usr.sbin/pkg/config.c | 24 +++++++++++++++--------- usr.sbin/pkg/config.h | 2 +- usr.sbin/pkg/pkg.7 | 37 +++++++++++++++++++++++++++++++------ usr.sbin/pkg/pkg.c | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 91 insertions(+), 19 deletions(-) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index 7402112a967e..6f723254d394 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -322,7 +322,7 @@ cleanup: * etc... */ static void -parse_repo_file(ucl_object_t *obj) +parse_repo_file(ucl_object_t *obj, const char *requested_repo) { ucl_object_iter_t it = NULL; const ucl_object_t *cur; @@ -337,13 +337,17 @@ parse_repo_file(ucl_object_t *obj) if (cur->type != UCL_OBJECT) continue; + if (requested_repo != NULL && strcmp(requested_repo, key) != 0) + continue; + config_parse(cur, CONFFILE_REPO); } } static int -read_conf_file(const char *confpath, pkg_conf_file_t conftype) +read_conf_file(const char *confpath, const char *requested_repo, + pkg_conf_file_t conftype) { struct ucl_parser *p; ucl_object_t *obj = NULL; @@ -367,7 +371,7 @@ read_conf_file(const char *confpath, pkg_conf_file_t conftype) if (conftype == CONFFILE_PKG) config_parse(obj, conftype); else if (conftype == CONFFILE_REPO) - parse_repo_file(obj); + parse_repo_file(obj, requested_repo); } ucl_object_unref(obj); @@ -377,7 +381,7 @@ read_conf_file(const char *confpath, pkg_conf_file_t conftype) } static int -load_repositories(const char *repodir) +load_repositories(const char *repodir, const char *requested_repo) { struct dirent *ent; DIR *d; @@ -401,8 +405,10 @@ load_repositories(const char *repodir) repodir, repodir[strlen(repodir) - 1] == '/' ? "" : "/", ent->d_name); - if (access(path, F_OK) == 0 && - read_conf_file(path, CONFFILE_REPO)) { + if (access(path, F_OK) != 0) + continue; + if (read_conf_file(path, requested_repo, + CONFFILE_REPO)) { ret = 1; goto cleanup; } @@ -416,7 +422,7 @@ cleanup: } int -config_init(void) +config_init(const char *requested_repo) { char *val; int i; @@ -457,7 +463,7 @@ config_init(void) localbase = getlocalbase(); snprintf(confpath, sizeof(confpath), "%s/etc/pkg.conf", localbase); - if (access(confpath, F_OK) == 0 && read_conf_file(confpath, + if (access(confpath, F_OK) == 0 && read_conf_file(confpath, NULL, CONFFILE_PKG)) goto finalize; @@ -475,7 +481,7 @@ config_init(void) } STAILQ_FOREACH(cv, c[REPOS_DIR].list, next) - if (load_repositories(cv->value)) + if (load_repositories(cv->value, requested_repo)) goto finalize; finalize: diff --git a/usr.sbin/pkg/config.h b/usr.sbin/pkg/config.h index f1a2aa227f16..afcd728abd92 100644 --- a/usr.sbin/pkg/config.h +++ b/usr.sbin/pkg/config.h @@ -58,7 +58,7 @@ typedef enum { CONFFILE_REPO, } pkg_conf_file_t; -int config_init(void); +int config_init(const char *); void config_finish(void); int config_string(pkg_config_key, const char **); int config_bool(pkg_config_key, bool *); diff --git a/usr.sbin/pkg/pkg.7 b/usr.sbin/pkg/pkg.7 index c672306ac08d..b92f5c9820cd 100644 --- a/usr.sbin/pkg/pkg.7 +++ b/usr.sbin/pkg/pkg.7 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 31, 2020 +.Dd February 7, 2021 .Dt PKG 7 .Os .Sh NAME @@ -36,6 +36,7 @@ .Nm add .Op Fl f +.Op Fl r Ar reponame .Op Fl y .Ao Pa pkg.txz Ac .Nm @@ -44,6 +45,7 @@ add .Op Fl 4 | Fl 6 bootstrap .Op Fl f +.Op Fl r Ar reponame .Op Fl y .Sh DESCRIPTION .Nm @@ -68,7 +70,7 @@ is not installed yet, it will be fetched, have its signature verified, installed, and then have the original command forwarded to it. If already installed, the command requested will be forwarded to the real .Xr pkg 8 . -.It Nm Li add Oo Fl f Oc Oo Fl y Oc Ao Pa pkg.txz Ac +.It Nm Li add Oo Fl f Oc Oo Fl r Ar reponame Oc Oo Fl y Oc Ao Pa pkg.txz Ac Install .Xr pkg 8 from a local package instead of fetching from remote. @@ -83,13 +85,19 @@ If the .Fl y flag is specified, no confirmation will be asked when bootstrapping .Xr pkg 8 . +.Pp +If a +.Ar reponame +has been specified, then the signature configuration for that repository will be +used. .It Nm Fl N Do not bootstrap, just determine if .Xr pkg 8 is actually installed or not. Returns 0 and the number of packages installed if it is, otherwise 1. -.It Nm Oo Fl 4 | Fl 6 Oc Li bootstrap Oo Fl f Oc Oo Fl y Oc +.It Nm Oo Fl 4 | Fl 6 Oc Li bootstrap Oo Fl f Oc \ +Oo Fl r Ar reponame Oc Oo Fl y Oc Attempt to bootstrap and do not forward anything to .Xr pkg 8 after it is installed. @@ -110,14 +118,30 @@ If the .Fl y flag is specified, no confirmation will be asked when bootstrapping .Xr pkg 8 . +.Pp +If a +.Ar reponame +has been specified, then the configuration for that repository will be used. .El .Sh CONFIGURATION Configuration varies in whether it is in a repository configuration file or the global configuration file. +The default repository configuration for +.Fx +is stored in +.Pa /etc/pkg/FreeBSD.conf , +and additional repository configuration files will be searched for in +.Ev REPOS_DIR , +or +.Pa /usr/local/etc/pkg/repos +if it is unset. .Pp -Repository configuration can be stored in -.Pa /etc/pkg/FreeBSD.conf -in the following format: +For bootstrapping, +.Nm +will process all repositories that it finds and use the last enabled repository +by default. +.Pp +Repository configuration is stored in the following format: .Bd -literal -offset indent FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", @@ -127,6 +151,7 @@ FreeBSD: { enabled: yes } .Ed +.Pp .Bl -tag -width signature_type -compact .It url Refer to diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 788fdb39ebb9..5e424cf83034 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -1045,7 +1045,7 @@ int main(int argc, char *argv[]) { char pkgpath[MAXPATHLEN]; - const char *pkgarg; + const char *pkgarg, *repo_name; bool activation_test, add_pkg, bootstrap_only, force, yes; signed char ch; const char *fetchOpts; @@ -1058,6 +1058,7 @@ main(int argc, char *argv[]) fetchOpts = ""; force = false; pkgarg = NULL; + repo_name = NULL; yes = false; struct option longopts[] = { @@ -1070,7 +1071,7 @@ main(int argc, char *argv[]) snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", getlocalbase()); - while ((ch = getopt_long(argc, argv, "-:fyN46", longopts, NULL)) != -1) { + while ((ch = getopt_long(argc, argv, "-:fr::yN46", longopts, NULL)) != -1) { switch (ch) { case 'f': force = true; @@ -1087,6 +1088,46 @@ main(int argc, char *argv[]) case '6': fetchOpts = "6"; break; + case 'r': + /* + * The repository can only be specified for an explicit + * bootstrap request at this time, so that we don't + * confuse the user if they're trying to use a verb that + * has some other conflicting meaning but we need to + * bootstrap. + * + * For that reason, we specify that -r has an optional + * argument above and process the next index ourselves. + * This is mostly significant because getopt(3) will + * otherwise eat the next argument, which could be + * something we need to try and make sense of. + * + * At worst this gets us false positives that we ignore + * in other contexts, and we have to do a little fudging + * in order to support separating -r from the reponame + * with a space since it's not actually optional in + * the bootstrap/add sense. + */ + if (add_pkg || bootstrap_only) { + if (optarg != NULL) { + repo_name = optarg; + } else if (optind < argc) { + repo_name = argv[optind]; + } + + if (repo_name == NULL || *repo_name == '\0') { + fprintf(stderr, + "Must specify a repository with -r!\n"); + exit(EXIT_FAILURE); + } + + if (optarg == NULL) { + /* Advance past repo name. */ + optreset = 1; + optind++; + } + } + break; case 1: // Non-option arguments, first one is the command if (command == NULL) { @@ -1126,7 +1167,7 @@ main(int argc, char *argv[]) if (activation_test) errx(EXIT_FAILURE, "pkg is not installed"); - config_init(); + config_init(repo_name); if (add_pkg) { if (pkgarg == NULL) { From owner-dev-commits-src-main@freebsd.org Fri Feb 12 00:58:43 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0974353CD58; Fri, 12 Feb 2021 00:58:43 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFVp6xHNz3MTq; Fri, 12 Feb 2021 00:58:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E17EB1AAE4; Fri, 12 Feb 2021 00:58:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C0wgYW056704; Fri, 12 Feb 2021 00:58:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C0wgnk056703; Fri, 12 Feb 2021 00:58:42 GMT (envelope-from git) Date: Fri, 12 Feb 2021 00:58:42 GMT Message-Id: <202102120058.11C0wgnk056703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: b2c4ca8d2872 - main - pkg(7): address minor nits (mostly clang-analyze complaints) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2c4ca8d2872bc4410626f2b1ceafa49de5828ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 00:58:43 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b2c4ca8d2872bc4410626f2b1ceafa49de5828ce commit b2c4ca8d2872bc4410626f2b1ceafa49de5828ce Author: Kyle Evans AuthorDate: 2021-02-12 00:58:27 +0000 Commit: Kyle Evans CommitDate: 2021-02-12 00:58:27 +0000 pkg(7): address minor nits (mostly clang-analyze complaints) - One (1) spurious whitespace. - One (1) occurrence of "random(3) bad, arc4random(3)" good. - Three (3) writes that will never be seen. The latter two points are complaints from clang-analyze. Switching to arc4random(3) is decidedly a good idea because we weren't doing any kind of PRNG seeding anyways. The discarded assignments are arguably good for future-proofing, but it's better to improve the S/N ratio from clang-analyze. Reviewed by: bapt, manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28525 --- usr.sbin/pkg/dns_utils.c | 5 +++-- usr.sbin/pkg/pkg.c | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/usr.sbin/pkg/dns_utils.c b/usr.sbin/pkg/dns_utils.c index 78ebdd426f8b..f3bde529daca 100644 --- a/usr.sbin/pkg/dns_utils.c +++ b/usr.sbin/pkg/dns_utils.c @@ -87,7 +87,7 @@ compute_weight(struct dns_srvinfo **d, int first, int last) int *chosen; totalweight = 0; - + for (i = 0; i <= last; i++) totalweight += d[i]->weight; @@ -98,7 +98,8 @@ compute_weight(struct dns_srvinfo **d, int first, int last) for (i = 0; i <= last; i++) { for (;;) { - chosen[i] = random() % (d[i]->weight * 100 / totalweight); + chosen[i] = arc4random_uniform(d[i]->weight * 100 / + totalweight); for (j = 0; j < i; j++) { if (chosen[i] == chosen[j]) break; diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 5e424cf83034..1f787e3dd246 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -434,9 +434,7 @@ sha256_fd(int fd, char out[SHA256_DIGEST_LENGTH * 2 + 1]) int ret; SHA256_CTX sha256; - my_fd = -1; fp = NULL; - r = 0; ret = 1; out[0] = '\0'; @@ -627,7 +625,6 @@ parse_cert(int fd) { ssize_t linelen; buf = NULL; - my_fd = -1; sc = NULL; line = NULL; linecap = 0; From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:00 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5BEF253D344; Fri, 12 Feb 2021 01:07:00 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhN27pnz3NB5; Fri, 12 Feb 2021 01:07:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 386BA1B221; Fri, 12 Feb 2021 01:07:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C170gQ070367; Fri, 12 Feb 2021 01:07:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C170jg070366; Fri, 12 Feb 2021 01:07:00 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:00 GMT Message-Id: <202102120107.11C170jg070366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0281f88e5dbc - main - ffs_vnops.c: Move opt_*.h includes to the top. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0281f88e5dbc8d6f819bf3f22dd11239ff5374ea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:00 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0281f88e5dbc8d6f819bf3f22dd11239ff5374ea commit 0281f88e5dbc8d6f819bf3f22dd11239ff5374ea Author: Konstantin Belousov AuthorDate: 2021-01-28 18:30:35 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:19 +0000 ffs_vnops.c: Move opt_*.h includes to the top. as it is done in other places. Header files might need options defined for correct operation. Reviewed by: chs, mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/ufs/ffs/ffs_vnops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 6ca98a84869d..68985d8715f3 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -66,6 +66,9 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_directio.h" +#include "opt_ffs.h" + #include #include #include @@ -99,8 +102,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "opt_directio.h" -#include "opt_ffs.h" #define ALIGNED_TO(ptr, s) \ (((uintptr_t)(ptr) & (_Alignof(s) - 1)) == 0) From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:01 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5B4F453D231; Fri, 12 Feb 2021 01:07:01 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhP2B33z3N7r; Fri, 12 Feb 2021 01:07:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AD3D1AFCD; Fri, 12 Feb 2021 01:07:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C171ZG070390; Fri, 12 Feb 2021 01:07:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C171c7070389; Fri, 12 Feb 2021 01:07:01 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:01 GMT Message-Id: <202102120107.11C171c7070389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: bf0db19339e7 - main - buf SU hooks: track buf_start() calls with B_IOSTARTED flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf0db19339e770a82236b74f523be4b572bde15d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:01 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bf0db19339e770a82236b74f523be4b572bde15d commit bf0db19339e770a82236b74f523be4b572bde15d Author: Konstantin Belousov AuthorDate: 2021-01-30 02:10:34 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:19 +0000 buf SU hooks: track buf_start() calls with B_IOSTARTED flag and only call buf_complete() if previously started. Some error paths, like CoW failire, might skip buf_start() and do bufdone(), which itself call buf_complete(). Various SU handle_written_XXX() functions check that io was started and incomplete parts of the buffer data reverted before restoring them. This is a useful invariant that B_IO_STARTED on buffer layer allows to keep instead of changing check and panic into check and return. Reported by: pho Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundations --- sys/kern/vfs_bio.c | 14 ++++++++++++++ sys/sys/buf.h | 16 +++++++++++----- sys/ufs/ffs/ffs_vfsops.c | 4 ++-- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index ff25e5b0043c..45be14b47207 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -2639,6 +2639,13 @@ brelse(struct buf *bp) return; } + if (LIST_EMPTY(&bp->b_dep)) { + bp->b_flags &= ~B_IOSTARTED; + } else { + KASSERT((bp->b_flags & B_IOSTARTED) == 0, + ("brelse: SU io not finished bp %p", bp)); + } + if ((bp->b_vflags & (BV_BKGRDINPROG | BV_BKGRDERR)) == BV_BKGRDERR) { BO_LOCK(bp->b_bufobj); bp->b_vflags &= ~BV_BKGRDERR; @@ -2826,6 +2833,13 @@ bqrelse(struct buf *bp) bp->b_flags &= ~(B_ASYNC | B_NOCACHE | B_AGE | B_RELBUF); bp->b_xflags &= ~(BX_CVTENXIO); + if (LIST_EMPTY(&bp->b_dep)) { + bp->b_flags &= ~B_IOSTARTED; + } else { + KASSERT((bp->b_flags & B_IOSTARTED) == 0, + ("bqrelse: SU io not finished bp %p", bp)); + } + if (bp->b_flags & B_MANAGED) { if (bp->b_flags & B_REMFREE) bremfreef(bp); diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 50fa0f35491e..2997560b9ab3 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -232,7 +232,7 @@ struct buf { #define B_MALLOC 0x00010000 /* malloced b_data */ #define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */ #define B_INVALONERR 0x00040000 /* Invalidate on write error. */ -#define B_00080000 0x00080000 /* Available flag. */ +#define B_IOSTARTED 0x00080000 /* buf_start() called */ #define B_00100000 0x00100000 /* Available flag. */ #define B_MAXPHYS 0x00200000 /* nitems(b_pages[]) = atop(MAXPHYS). */ #define B_RELBUF 0x00400000 /* Release VMIO buffer. */ @@ -248,8 +248,8 @@ struct buf { #define PRINT_BUF_FLAGS "\20\40remfree\37cluster\36vmio\35ram\34managed" \ "\33paging\32infreecnt\31nocopy\30b23\27relbuf\26maxphys\25b20" \ - "\24b19\23invalonerr\22clusterok\21malloc\20nocache\17b14\16inval" \ - "\15reuse\14noreuse\13eintr\12done\11b8\10delwri" \ + "\24iostarted\23invalonerr\22clusterok\21malloc\20nocache\17b14" \ + "\16inval\15reuse\14noreuse\13eintr\12done\11b8\10delwri" \ "\7validsuspwrt\6cache\5deferred\4direct\3async\2needcommit\1age" /* @@ -434,6 +434,9 @@ bstrategy(struct buf *bp) static __inline void buf_start(struct buf *bp) { + KASSERT((bp->b_flags & B_IOSTARTED) == 0, + ("recursed buf_start %p", bp)); + bp->b_flags |= B_IOSTARTED; if (bioops.io_start) (*bioops.io_start)(bp); } @@ -441,8 +444,11 @@ buf_start(struct buf *bp) static __inline void buf_complete(struct buf *bp) { - if (bioops.io_complete) - (*bioops.io_complete)(bp); + if ((bp->b_flags & B_IOSTARTED) != 0) { + bp->b_flags &= ~B_IOSTARTED; + if (bioops.io_complete) + (*bioops.io_complete)(bp); + } } static __inline void diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 60d4dad57d03..04afbfd4d6e4 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -2393,10 +2393,10 @@ ffs_backgroundwritedone(struct buf *bp) #endif /* * This buffer is marked B_NOCACHE so when it is released - * by biodone it will be tossed. + * by biodone it will be tossed. Clear B_IOSTARTED in case of error. */ bp->b_flags |= B_NOCACHE; - bp->b_flags &= ~B_CACHE; + bp->b_flags &= ~(B_CACHE | B_IOSTARTED); pbrelvp(bp); /* From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:03 2021 Return-Path: Delivered-To: dev-commits-src-main@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 34B6053D51D; Fri, 12 Feb 2021 01:07:03 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhQ55fTz3NPp; Fri, 12 Feb 2021 01:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B1341B283; Fri, 12 Feb 2021 01:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C172kB070410; Fri, 12 Feb 2021 01:07:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C172iS070409; Fri, 12 Feb 2021 01:07:02 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:02 GMT Message-Id: <202102120107.11C172iS070409@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e94f2f1be322 - main - ffs: call ufsdirhash_dirtrunc() right after setting directory size MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e94f2f1be32294cb6d519b6631f7522466fbbb3b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:03 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e94f2f1be32294cb6d519b6631f7522466fbbb3b commit e94f2f1be32294cb6d519b6631f7522466fbbb3b Author: Konstantin Belousov AuthorDate: 2021-01-28 18:33:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:19 +0000 ffs: call ufsdirhash_dirtrunc() right after setting directory size Later processing of ffs_truncate() might temporary unlock the directory vnode, causing unsychronized dirhash and inode sizes if update is postponed to UFS_TRUNCATE() callers. Reviewed by: chs, mkcusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_inode.c | 13 +++++++++++++ sys/ufs/ufs/ufs_lookup.c | 4 ---- sys/ufs/ufs/ufs_vnops.c | 2 -- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 0b4172b34300..3df7bf8e8596 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -34,6 +34,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ufs.h" #include "opt_quota.h" #include @@ -59,6 +60,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#ifdef UFS_DIRHASH +#include +#endif #include #include @@ -456,6 +461,10 @@ ffs_truncate(vp, length, flags, cred) ip->i_size = length; DIP_SET(ip, i_size, length); UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); +#ifdef UFS_DIRHASH + if (vp->v_type == VDIR && ip->i_dirhash != NULL) + ufsdirhash_dirtrunc(ip, length); +#endif } else { lbn = lblkno(fs, length); flags |= BA_CLRBUF; @@ -482,6 +491,10 @@ ffs_truncate(vp, length, flags, cred) return (error); ip->i_size = length; DIP_SET(ip, i_size, length); +#ifdef UFS_DIRHASH + if (vp->v_type == VDIR && ip->i_dirhash != NULL) + ufsdirhash_dirtrunc(ip, length); +#endif size = blksize(fs, ip, lbn); if (vp->v_type != VDIR && offset != 0) bzero((char *)bp->b_data + offset, diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 7dbd58f795cc..2f5fbf3d8001 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1131,10 +1131,6 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) vn_printf(dvp, "ufs_direnter: failed to truncate, error %d\n", error); -#ifdef UFS_DIRHASH - if (error == 0 && dp->i_dirhash != NULL) - ufsdirhash_dirtrunc(dp, I_ENDOFF(dp)); -#endif error = 0; if (tvp != NULL) vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 0e7ec7ae5453..70b5a44ca21d 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1694,8 +1694,6 @@ unlockout: #ifdef UFS_DIRHASH if (error != 0) ufsdirhash_free(tdp); - else if (tdp->i_dirhash != NULL) - ufsdirhash_dirtrunc(tdp, endoff); #endif /* * Even if the directory compaction failed, rename was From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:05 2021 Return-Path: Delivered-To: dev-commits-src-main@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 8333053D58E; Fri, 12 Feb 2021 01:07:05 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhS6310z3NMM; Fri, 12 Feb 2021 01:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 821C51B17D; Fri, 12 Feb 2021 01:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C173nm070430; Fri, 12 Feb 2021 01:07:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C1736U070429; Fri, 12 Feb 2021 01:07:03 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:03 GMT Message-Id: <202102120107.11C1736U070429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f16c26b1c009 - main - ffs: Add FFSV_REPLACE_DOOMED flag to ffs_vgetf() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f16c26b1c009fd0d87d07d3b1cf0d5078ad7f511 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:05 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f16c26b1c009fd0d87d07d3b1cf0d5078ad7f511 commit f16c26b1c009fd0d87d07d3b1cf0d5078ad7f511 Author: Konstantin Belousov AuthorDate: 2021-01-26 11:35:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:20 +0000 ffs: Add FFSV_REPLACE_DOOMED flag to ffs_vgetf() It specifies that caller requests a fresh non-doomed vnode. If doomed vnode is found in the hash, it should behave similarly to FFSV_REPLACE. Or, to put it differently, the flag is same as FFSV_REPLACE, but only when the found hashed vnode is doomed. Reviewed by: chs, mkcusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_extern.h | 5 +++-- sys/ufs/ffs/ffs_vfsops.c | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index d54df1deced9..bdb3f533e1ad 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -122,8 +122,9 @@ int ffs_breadz(struct ufsmount *, struct vnode *, daddr_t, daddr_t, int, /* * Flags to ffs_vgetf */ -#define FFSV_FORCEINSMQ 0x0001 -#define FFSV_REPLACE 0x0002 +#define FFSV_FORCEINSMQ 0x0001 +#define FFSV_REPLACE 0x0002 +#define FFSV_REPLACE_DOOMED 0x0004 /* * Flags to ffs_reload diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 04afbfd4d6e4..91b8c30f0919 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1954,13 +1954,16 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) daddr_t dbn; int error; - MPASS((ffs_flags & FFSV_REPLACE) == 0 || (flags & LK_EXCLUSIVE) != 0); + MPASS((ffs_flags & (FFSV_REPLACE | FFSV_REPLACE_DOOMED)) == 0 || + (flags & LK_EXCLUSIVE) != 0); error = vfs_hash_get(mp, ino, flags, curthread, vpp, NULL, NULL); if (error != 0) return (error); if (*vpp != NULL) { - if ((ffs_flags & FFSV_REPLACE) == 0) + if ((ffs_flags & FFSV_REPLACE) == 0 || + ((ffs_flags & FFSV_REPLACE_DOOMED) == 0 || + !VN_IS_DOOMED(*vpp))) return (0); vgone(*vpp); vput(*vpp); From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:08 2021 Return-Path: Delivered-To: dev-commits-src-main@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 71D3153D17A; Fri, 12 Feb 2021 01:07:08 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhV1jGBz3N3R; Fri, 12 Feb 2021 01:07:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B74191B1BB; Fri, 12 Feb 2021 01:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C174hl070452; Fri, 12 Feb 2021 01:07:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C1744G070451; Fri, 12 Feb 2021 01:07:04 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:04 GMT Message-Id: <202102120107.11C1744G070451@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5952c86c78b1 - main - ffs_inotovp(): interface to convert (ino, gen) into alive vnode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5952c86c78b177b5e904bf139e6b56519897c7e0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:08 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5952c86c78b177b5e904bf139e6b56519897c7e0 commit 5952c86c78b177b5e904bf139e6b56519897c7e0 Author: Konstantin Belousov AuthorDate: 2021-01-26 11:52:59 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:20 +0000 ffs_inotovp(): interface to convert (ino, gen) into alive vnode It generalizes the VFS_FHTOVP() interface, making it possible to fetch the inode without faking filehandle. Also it adds the ffs flags argument which allows to control ffs_vgetf() call. Requested by: mckusick Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_extern.h | 2 ++ sys/ufs/ffs/ffs_vfsops.c | 44 ++++++++++++++++++++++++++++++++------------ sys/ufs/ufs/ufs_extern.h | 2 +- sys/ufs/ufs/ufs_vfsops.c | 21 +++++---------------- 4 files changed, 40 insertions(+), 29 deletions(-) diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index bdb3f533e1ad..9694489266b6 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -80,6 +80,8 @@ int ffs_freefile(struct ufsmount *, struct fs *, struct vnode *, ino_t, void ffs_fserr(struct fs *, ino_t, char *); int ffs_getcg(struct fs *, struct vnode *, u_int, int, struct buf **, struct cg **); +int ffs_inotovp(struct mount *, ino_t, u_int64_t, int, struct vnode **, + int); int ffs_isblock(struct fs *, u_char *, ufs1_daddr_t); int ffs_isfreeblock(struct fs *, u_char *, ufs1_daddr_t); void ffs_oldfscompat_write(struct fs *, struct ufsmount *); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 91b8c30f0919..596e2f4b4b5f 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -2153,35 +2153,55 @@ ffs_fhtovp(mp, fhp, flags, vpp) struct vnode **vpp; { struct ufid *ufhp; + + ufhp = (struct ufid *)fhp; + return (ffs_inotovp(mp, ufhp->ufid_ino, ufhp->ufid_gen, flags, + vpp, 0)); +} + +int +ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags) + struct mount *mp; + ino_t ino; + u_int64_t gen; + int lflags; + struct vnode **vpp; + int ffs_flags; +{ struct ufsmount *ump; + struct vnode *nvp; struct fs *fs; struct cg *cgp; struct buf *bp; - ino_t ino; u_int cg; int error; - ufhp = (struct ufid *)fhp; - ino = ufhp->ufid_ino; ump = VFSTOUFS(mp); fs = ump->um_fs; if (ino < UFS_ROOTINO || ino >= fs->fs_ncg * fs->fs_ipg) return (ESTALE); + /* * Need to check if inode is initialized because UFS2 does lazy * initialization and nfs_fhtovp can offer arbitrary inode numbers. */ - if (fs->fs_magic != FS_UFS2_MAGIC) - return (ufs_fhtovp(mp, ufhp, flags, vpp)); - cg = ino_to_cg(fs, ino); - if ((error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp)) != 0) - return (error); - if (ino >= cg * fs->fs_ipg + cgp->cg_initediblk) { + if (fs->fs_magic == FS_UFS2_MAGIC) { + cg = ino_to_cg(fs, ino); + error = ffs_getcg(fs, ump->um_devvp, cg, 0, &bp, &cgp); + if (error != 0) + return (error); + if (ino >= cg * fs->fs_ipg + cgp->cg_initediblk) { + brelse(bp); + return (ESTALE); + } brelse(bp); - return (ESTALE); } - brelse(bp); - return (ufs_fhtovp(mp, ufhp, flags, vpp)); + + error = ffs_vgetf(mp, ino, lflags, &nvp, ffs_flags); + if (error == 0) + error = ufs_fhtovp(mp, nvp, gen); + *vpp = error == 0 ? nvp : NULLVP; + return (error); } /* diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index a28fcffabd2e..ab26750455e8 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -59,7 +59,7 @@ int ufs_bmap(struct vop_bmap_args *); int ufs_bmaparray(struct vnode *, ufs2_daddr_t, ufs2_daddr_t *, struct buf *, int *, int *); int ufs_bmap_seekdata(struct vnode *, off_t *); -int ufs_fhtovp(struct mount *, struct ufid *, int, struct vnode **); +int ufs_fhtovp(struct mount *, struct vnode *, u_int64_t); int ufs_checkpath(ino_t, ino_t, struct inode *, struct ucred *, ino_t *); void ufs_dirbad(struct inode *, doff_t, char *); int ufs_dirbadentry(struct vnode *, struct direct *, int); diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c index 4813ac7db763..1a63e92b3e2c 100644 --- a/sys/ufs/ufs/ufs_vfsops.c +++ b/sys/ufs/ufs/ufs_vfsops.c @@ -222,31 +222,20 @@ ufs_uninit(vfsp) * Call the VFS_CHECKEXP beforehand to verify access. */ int -ufs_fhtovp(mp, ufhp, flags, vpp) +ufs_fhtovp(mp, nvp, gen) struct mount *mp; - struct ufid *ufhp; - int flags; - struct vnode **vpp; + struct vnode *nvp; + u_int64_t gen; { struct inode *ip; - struct vnode *nvp; - int error; - error = VFS_VGET(mp, ufhp->ufid_ino, flags, &nvp); - if (error) { - *vpp = NULLVP; - return (error); - } ip = VTOI(nvp); - if (ip->i_mode == 0 || ip->i_gen != ufhp->ufid_gen || - ip->i_effnlink <= 0) { + if (ip->i_mode == 0 || ip->i_gen != gen || ip->i_effnlink <= 0) { if (ip->i_mode == 0) vgone(nvp); vput(nvp); - *vpp = NULLVP; return (ESTALE); } - *vpp = nvp; - vnode_create_vobject(*vpp, DIP(ip, i_size), curthread); + vnode_create_vobject(nvp, DIP(ip, i_size), curthread); return (0); } From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:11 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B6D2453D59D; Fri, 12 Feb 2021 01:07:11 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhW130jz3NH9; Fri, 12 Feb 2021 01:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB5071AAFD; Fri, 12 Feb 2021 01:07:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C175DI070472; Fri, 12 Feb 2021 01:07:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C175ir070471; Fri, 12 Feb 2021 01:07:05 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:05 GMT Message-Id: <202102120107.11C175ir070471@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 89fd61d955ad - main - Merge ufs_fhtovp() into ffs_inotovp(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89fd61d955ada4fdb20030253206201bc279cdf0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:12 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=89fd61d955ada4fdb20030253206201bc279cdf0 commit 89fd61d955ada4fdb20030253206201bc279cdf0 Author: Konstantin Belousov AuthorDate: 2021-01-28 12:20:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:20 +0000 Merge ufs_fhtovp() into ffs_inotovp(). The function alone was not used for anything but ffs_fstovp() for long time. Suggested by: mckusick Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_vfsops.c | 21 +++++++++++++++++---- sys/ufs/ufs/ufs_extern.h | 1 - sys/ufs/ufs/ufs_vfsops.c | 25 ------------------------- 3 files changed, 17 insertions(+), 30 deletions(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 596e2f4b4b5f..540dd02c9631 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -2170,6 +2170,7 @@ ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags) { struct ufsmount *ump; struct vnode *nvp; + struct inode *ip; struct fs *fs; struct cg *cgp; struct buf *bp; @@ -2178,6 +2179,8 @@ ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags) ump = VFSTOUFS(mp); fs = ump->um_fs; + *vpp = NULL; + if (ino < UFS_ROOTINO || ino >= fs->fs_ncg * fs->fs_ipg) return (ESTALE); @@ -2198,10 +2201,20 @@ ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags) } error = ffs_vgetf(mp, ino, lflags, &nvp, ffs_flags); - if (error == 0) - error = ufs_fhtovp(mp, nvp, gen); - *vpp = error == 0 ? nvp : NULLVP; - return (error); + if (error != 0) + return (error); + + ip = VTOI(nvp); + if (ip->i_mode == 0 || ip->i_gen != gen || ip->i_effnlink <= 0) { + if (ip->i_mode == 0) + vgone(nvp); + vput(nvp); + return (ESTALE); + } + + vnode_create_vobject(nvp, DIP(ip, i_size), curthread); + *vpp = nvp; + return (0); } /* diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index ab26750455e8..1697f2c0ba61 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -59,7 +59,6 @@ int ufs_bmap(struct vop_bmap_args *); int ufs_bmaparray(struct vnode *, ufs2_daddr_t, ufs2_daddr_t *, struct buf *, int *, int *); int ufs_bmap_seekdata(struct vnode *, off_t *); -int ufs_fhtovp(struct mount *, struct vnode *, u_int64_t); int ufs_checkpath(ino_t, ino_t, struct inode *, struct ucred *, ino_t *); void ufs_dirbad(struct inode *, doff_t, char *); int ufs_dirbadentry(struct vnode *, struct direct *, int); diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c index 1a63e92b3e2c..0f45baed634f 100644 --- a/sys/ufs/ufs/ufs_vfsops.c +++ b/sys/ufs/ufs/ufs_vfsops.c @@ -214,28 +214,3 @@ ufs_uninit(vfsp) #endif return (0); } - -/* - * This is the generic part of fhtovp called after the underlying - * filesystem has validated the file handle. - * - * Call the VFS_CHECKEXP beforehand to verify access. - */ -int -ufs_fhtovp(mp, nvp, gen) - struct mount *mp; - struct vnode *nvp; - u_int64_t gen; -{ - struct inode *ip; - - ip = VTOI(nvp); - if (ip->i_mode == 0 || ip->i_gen != gen || ip->i_effnlink <= 0) { - if (ip->i_mode == 0) - vgone(nvp); - vput(nvp); - return (ESTALE); - } - vnode_create_vobject(nvp, DIP(ip, i_size), curthread); - return (0); -} From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:12 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C1E1453D4CD; Fri, 12 Feb 2021 01:07:12 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhY2qlQz3NQC; Fri, 12 Feb 2021 01:07:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 092461AFCF; Fri, 12 Feb 2021 01:07:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C177Qq070514; Fri, 12 Feb 2021 01:07:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C177Dp070513; Fri, 12 Feb 2021 01:07:07 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:07 GMT Message-Id: <202102120107.11C177Dp070513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 08c2dc284121 - main - ufs_direnter/SU: unconditionally UFS_UPDATE inode when extending directory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08c2dc2841214187a162d5e4475aa1b94d03fd77 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:12 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=08c2dc2841214187a162d5e4475aa1b94d03fd77 commit 08c2dc2841214187a162d5e4475aa1b94d03fd77 Author: Konstantin Belousov AuthorDate: 2021-01-23 21:52:10 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:20 +0000 ufs_direnter/SU: unconditionally UFS_UPDATE inode when extending directory for all kinds of async/SU mount variants. Submitted by: mckusick Reviewed by: chs Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ufs/ufs_lookup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 2f5fbf3d8001..e614f189a623 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -964,9 +964,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) if (newdirbp) bdwrite(newdirbp); bdwrite(bp); - if ((dp->i_flag & IN_NEEDSYNC) == 0) - return (UFS_UPDATE(dvp, 0)); - return (0); + return (UFS_UPDATE(dvp, 0)); } if (DOINGASYNC(dvp)) { bdwrite(bp); From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:14 2021 Return-Path: Delivered-To: dev-commits-src-main@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 43C4653D35A; Fri, 12 Feb 2021 01:07:14 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhb3X3pz3NQN; Fri, 12 Feb 2021 01:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D5731AFD0; Fri, 12 Feb 2021 01:07:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17AtQ070554; Fri, 12 Feb 2021 01:07:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17Ark070553; Fri, 12 Feb 2021 01:07:10 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:10 GMT Message-Id: <202102120107.11C17Ark070553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 49c117c19376 - main - Add VOP_VPUT_PAIR() with trivial default implementation. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49c117c193768b10f5fb1c5e4d6b88300cfbcdd6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:14 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=49c117c193768b10f5fb1c5e4d6b88300cfbcdd6 commit 49c117c193768b10f5fb1c5e4d6b88300cfbcdd6 Author: Konstantin Belousov AuthorDate: 2021-01-28 22:30:53 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:20 +0000 Add VOP_VPUT_PAIR() with trivial default implementation. The VOP is intended to be used in situations where VFS has two referenced locked vnodes, typically a directory vnode dvp and a vnode vp that is linked from the directory, and at least dvp is vput(9)ed. The child vnode can be also vput-ed, but optionally left referenced and locked. There, at least UFS may need to do some actions with dvp which cannot be done while vp is also locked, so its lock might be dropped temporary. For instance, in some cases UFS needs to sync dvp to avoid filesystem state that is currently not handled by either kernel nor fsck. Having such VOP provides the neccessary context for filesystem which can do correct locking and handle potential reclamation of vp after relock. Trivial implementation does vput(dvp) and optionally vput(vp). Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/kern/vfs_default.c | 15 +++++++++++++++ sys/kern/vnode_if.src | 9 +++++++++ 2 files changed, 24 insertions(+) diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 4b96d9522ce3..382fbb2d9ace 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -92,6 +92,7 @@ static int vop_stdfdatasync(struct vop_fdatasync_args *ap); static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); static int vop_stdread_pgcache(struct vop_read_pgcache_args *ap); static int vop_stdstat(struct vop_stat_args *ap); +static int vop_stdvput_pair(struct vop_vput_pair_args *ap); /* * This vnode table stores what we want to do if the filesystem doesn't @@ -151,6 +152,7 @@ struct vop_vector default_vnodeops = { .vop_unset_text = vop_stdunset_text, .vop_add_writecount = vop_stdadd_writecount, .vop_copy_file_range = vop_stdcopy_file_range, + .vop_vput_pair = vop_stdvput_pair, }; VFS_VOP_VECTOR_REGISTER(default_vnodeops); @@ -1592,3 +1594,16 @@ vop_stdread_pgcache(struct vop_read_pgcache_args *ap __unused) { return (EJUSTRETURN); } + +static int +vop_stdvput_pair(struct vop_vput_pair_args *ap) +{ + struct vnode *dvp, *vp, **vpp; + + dvp = ap->a_dvp; + vpp = ap->a_vpp; + vput(dvp); + if (vpp != NULL && ap->a_unlock_vp && (vp = *vpp) != NULL) + vput(vp); + return (0); +} diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index 5d15d4a0c863..b506237f385d 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -792,6 +792,15 @@ vop_copy_file_range { }; +%% vput_pair dvp E - - + +vop_vput_pair { + IN struct vnode *dvp; + INOUT struct vnode **vpp; + IN bool unlock_vp; +}; + + # The VOPs below are spares at the end of the table to allow new VOPs to be # added in stable branches without breaking the KBI. New VOPs in HEAD should # be added above these spares. When merging a new VOP to a stable branch, From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:14 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0E46353D0F3; Fri, 12 Feb 2021 01:07:14 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhb3QFxz3N3w; Fri, 12 Feb 2021 01:07:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CA901B284; Fri, 12 Feb 2021 01:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C179ia070536; Fri, 12 Feb 2021 01:07:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C1795k070535; Fri, 12 Feb 2021 01:07:09 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:09 GMT Message-Id: <202102120107.11C1795k070535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ee965dfa6492 - main - vn_open(): If the vnode is reclaimed during open(2), do not return error. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee965dfa64929227ced8adb68900c35f877480e7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:14 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ee965dfa64929227ced8adb68900c35f877480e7 commit ee965dfa64929227ced8adb68900c35f877480e7 Author: Konstantin Belousov AuthorDate: 2021-02-03 11:02:18 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:20 +0000 vn_open(): If the vnode is reclaimed during open(2), do not return error. Most future operations on the returned file descriptor will fail anyway, and application should be ready to handle that failures. Not forcing it to understand the transient failure mode on open, which is implementation-specific, should make us less special without loss of reporting of errors. Suggested by: chs Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/fs/deadfs/dead_vnops.c | 11 +++++++++-- sys/kern/vfs_vnops.c | 2 -- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/fs/deadfs/dead_vnops.c b/sys/fs/deadfs/dead_vnops.c index 09c3c996ee0e..324bbafd7caf 100644 --- a/sys/fs/deadfs/dead_vnops.c +++ b/sys/fs/deadfs/dead_vnops.c @@ -45,6 +45,7 @@ */ static vop_lookup_t dead_lookup; static vop_open_t dead_open; +static vop_close_t dead_close; static vop_getwritemount_t dead_getwritemount; static vop_rename_t dead_rename; static vop_unset_text_t dead_unset_text; @@ -55,6 +56,7 @@ struct vop_vector dead_vnodeops = { .vop_access = VOP_EBADF, .vop_advlock = VOP_EBADF, .vop_bmap = VOP_EBADF, + .vop_close = dead_close, .vop_create = VOP_PANIC, .vop_getattr = VOP_EBADF, .vop_getwritemount = dead_getwritemount, @@ -104,13 +106,18 @@ dead_lookup(struct vop_lookup_args *ap) } /* - * Open always fails as if device did not exist. + * Silently succeed open and close. */ static int dead_open(struct vop_open_args *ap) { + return (0); +} - return (ENXIO); +static int +dead_close(struct vop_close_args *ap) +{ + return (0); } int diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 6c6727c7f372..f70bcdab4208 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -356,8 +356,6 @@ vn_open_vnode_advlock(struct vnode *vp, int fmode, struct file *fp) fp->f_flag |= FHASLOCK; vn_lock(vp, lock_flags | LK_RETRY); - if (error == 0 && VN_IS_DOOMED(vp)) - error = ENOENT; return (error); } From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:13 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1885153D4CE; Fri, 12 Feb 2021 01:07:13 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhX2qm7z3N3b; Fri, 12 Feb 2021 01:07:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D89701ADDD; Fri, 12 Feb 2021 01:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C176ZX070492; Fri, 12 Feb 2021 01:07:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C176Jn070491; Fri, 12 Feb 2021 01:07:06 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:06 GMT Message-Id: <202102120107.11C176Jn070491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1de1e2bfbf3c - main - ffs_syncvnode: only clear IN_NEEDSYNC after successfull sync MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1de1e2bfbf3c089418bbe67c096d60315c8ca5dd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:13 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1de1e2bfbf3c089418bbe67c096d60315c8ca5dd commit 1de1e2bfbf3c089418bbe67c096d60315c8ca5dd Author: Konstantin Belousov AuthorDate: 2021-01-23 21:50:55 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:20 +0000 ffs_syncvnode: only clear IN_NEEDSYNC after successfull sync If it is cleaned before the sync, other threads might see the inode without the flag set, because syncing could unlock it. Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_vnops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 68985d8715f3..be2653e32adc 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -257,7 +257,6 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags) bool still_dirty, unlocked, wait; ip = VTOI(vp); - ip->i_flag &= ~IN_NEEDSYNC; bo = &vp->v_bufobj; ump = VFSTOUFS(vp->v_mount); @@ -445,6 +444,8 @@ next: } if (error == 0 && unlocked) error = ERELOOKUP; + if (error == 0) + ip->i_flag &= ~IN_NEEDSYNC; return (error); } From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4B6BF53D633; Fri, 12 Feb 2021 01:07:20 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhk3jFLz3NYB; Fri, 12 Feb 2021 01:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34B191ADDE; Fri, 12 Feb 2021 01:07:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17Grt070680; Fri, 12 Feb 2021 01:07:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17GOP070679; Fri, 12 Feb 2021 01:07:16 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:16 GMT Message-Id: <202102120107.11C17GOP070679@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 30bfb2fa0fad - main - ffs_vput_pair(): try harder to recover from the vnode reclaim MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30bfb2fa0fad8e5bbcce369df46dcaa2e08324f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:20 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=30bfb2fa0fad8e5bbcce369df46dcaa2e08324f3 commit 30bfb2fa0fad8e5bbcce369df46dcaa2e08324f3 Author: Konstantin Belousov AuthorDate: 2021-01-27 18:10:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:21 +0000 ffs_vput_pair(): try harder to recover from the vnode reclaim In particular, if unlock_vp is false, save vp's inode number and generation. If ffs_inotovp() can re-create the vnode with the same number and generation after we finished with handling dvp, then we most likely raced with unmount, and were able to restore atomicity of open. We use FFSV_REPLACE_DOOMED there, to drop the old vnode. This additional recovery is not strictly required, but it improves the quality of the implementation. Suggested by: mckusick Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_vnops.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 623b13790ce0..2ac67adad5f2 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1924,8 +1924,11 @@ ffs_getpages_async(struct vop_getpages_async_args *ap) static int ffs_vput_pair(struct vop_vput_pair_args *ap) { - struct vnode *dvp, *vp, **vpp; - struct inode *dp; + struct mount *mp; + struct vnode *dvp, *vp, *vp1, **vpp; + struct inode *dp, *ip; + ino_t ip_ino; + u_int64_t ip_gen; int error, vp_locked; dvp = ap->a_dvp; @@ -1940,12 +1943,17 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) return (0); } + mp = NULL; if (vp != NULL) { if (ap->a_unlock_vp) { vput(vp); } else { MPASS(vp->v_type != VNON); vp_locked = VOP_ISLOCKED(vp); + ip = VTOI(vp); + ip_ino = ip->i_number; + ip_gen = ip->i_gen; + mp = vp->v_mount; VOP_UNLOCK(vp); } } @@ -1957,6 +1965,7 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) if (vp == NULL || ap->a_unlock_vp) return (0); + MPASS(mp != NULL); /* * It is possible that vp is reclaimed at this point. Only @@ -1970,5 +1979,29 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) * and respond to dead vnodes by returning ESTALE. */ VOP_LOCK(vp, vp_locked | LK_RETRY); - return (0); + if (!VN_IS_DOOMED(vp)) + return (0); + + /* + * Try harder to recover from reclaimed vp if reclaim was not + * because underlying inode was cleared. We saved inode + * number and inode generation, so we can try to reinstantiate + * exactly same version of inode. If this fails, return + * original doomed vnode and let caller to handle + * consequences. + * + * Note that callers must keep write started around + * VOP_VPUT_PAIR() calls, so it is safe to use mp without + * busying it. + */ + VOP_UNLOCK(vp); + error = ffs_inotovp(mp, ip_ino, ip_gen, LK_EXCLUSIVE, &vp1, + FFSV_REPLACE_DOOMED); + if (error != 0) { + VOP_LOCK(vp, vp_locked | LK_RETRY); + } else { + vrele(vp); + *vpp = vp1; + } + return (error); } From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:14 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5F9D453D60F; Fri, 12 Feb 2021 01:07:14 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhc2J49z3N8m; Fri, 12 Feb 2021 01:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65B181AFD1; Fri, 12 Feb 2021 01:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17B5Z070576; Fri, 12 Feb 2021 01:07:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17BYI070575; Fri, 12 Feb 2021 01:07:11 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:11 GMT Message-Id: <202102120107.11C17BYI070575@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e4aaf35ab549 - main - nullfs: provide special bypass for VOP_VPUT_PAIR MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e4aaf35ab54958f74409790fa2b7df8c2d230cee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:15 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e4aaf35ab54958f74409790fa2b7df8c2d230cee commit e4aaf35ab54958f74409790fa2b7df8c2d230cee Author: Konstantin Belousov AuthorDate: 2021-01-24 13:22:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:20 +0000 nullfs: provide special bypass for VOP_VPUT_PAIR Generic bypass cannot understand the rules of liveness for the VOP. Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/fs/nullfs/null_vnops.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 1de0cdfca9ac..45065e0be7b5 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -967,6 +967,54 @@ null_read_pgcache(struct vop_read_pgcache_args *ap) return (error); } +/* + * Avoid standard bypass, since lower dvp and vp could be no longer + * valid after vput(). + */ +static int +null_vput_pair(struct vop_vput_pair_args *ap) +{ + struct mount *mp; + struct vnode *dvp, *ldvp, *lvp, *vp, *vp1, **vpp; + int error, res; + + dvp = ap->a_dvp; + ldvp = NULLVPTOLOWERVP(dvp); + vref(ldvp); + + vpp = ap->a_vpp; + vp = NULL; + lvp = NULL; + if (vpp != NULL) { + vp = *vpp; + if (vp != NULL) { + vhold(vp); + mp = vp->v_mount; + lvp = NULLVPTOLOWERVP(vp); + if (ap->a_unlock_vp) + vref(lvp); + } + } + + res = VOP_VPUT_PAIR(ldvp, &lvp, ap->a_unlock_vp); + + /* lvp might have been unlocked and vp reclaimed */ + if (vp != NULL) { + if (!ap->a_unlock_vp && vp->v_vnlock != lvp->v_vnlock) { + error = null_nodeget(mp, lvp, &vp1); + if (error == 0) { + vput(vp); + *vpp = vp1; + } + } + if (ap->a_unlock_vp) + vrele(vp); + vdrop(vp); + } + vrele(dvp); + return (res); +} + /* * Global vfs data structures */ @@ -997,5 +1045,6 @@ struct vop_vector null_vnodeops = { .vop_vptocnp = null_vptocnp, .vop_vptofh = null_vptofh, .vop_add_writecount = null_add_writecount, + .vop_vput_pair = null_vput_pair, }; VFS_VOP_VECTOR_REGISTER(null_vnodeops); From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:16 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6289653D259; Fri, 12 Feb 2021 01:07:15 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhd4DMjz3N69; Fri, 12 Feb 2021 01:07:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AE271B285; Fri, 12 Feb 2021 01:07:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17COW070598; Fri, 12 Feb 2021 01:07:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17CsL070597; Fri, 12 Feb 2021 01:07:12 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:12 GMT Message-Id: <202102120107.11C17CsL070597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 3b2aa36024ab - main - Use VOP_VPUT_PAIR() for eligible VFS syscalls. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b2aa36024abcb2d8fdbf3a6ecc7438b073b04e4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:16 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3b2aa36024abcb2d8fdbf3a6ecc7438b073b04e4 commit 3b2aa36024abcb2d8fdbf3a6ecc7438b073b04e4 Author: Konstantin Belousov AuthorDate: 2021-01-28 22:31:30 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:20 +0000 Use VOP_VPUT_PAIR() for eligible VFS syscalls. The current list is limited to the cases where UFS needs to handle vput(dvp) specially. Which means VOP_CREATE(), VOP_MKDIR(), VOP_MKNOD(), VOP_LINK(), and VOP_SYMLINK(). Reviewed by: chs, mkcusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/kern/uipc_usrreq.c | 5 +++-- sys/kern/vfs_syscalls.c | 29 ++++++++++++----------------- sys/kern/vfs_vnops.c | 5 +++-- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 0809f5180cc1..ca23ccbdb05e 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -669,8 +669,8 @@ restart: if (error == 0) error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); NDFREE(&nd, NDF_ONLY_PNBUF); - vput(nd.ni_dvp); if (error) { + VOP_VPUT_PAIR(nd.ni_dvp, NULL, true); vn_finished_write(mp); if (error == ERELOOKUP) goto restart; @@ -686,7 +686,8 @@ restart: unp->unp_addr = soun; unp->unp_flags &= ~UNP_BINDING; UNP_PCB_UNLOCK(unp); - VOP_UNLOCK(vp); + vref(vp); + VOP_VPUT_PAIR(nd.ni_dvp, &vp, true); vn_finished_write(mp); free(buf, M_TEMP); return (0); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 35a56510e9ef..aba3d62936bb 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1370,13 +1370,12 @@ restart: else { error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); - if (error == 0) - vput(nd.ni_vp); } } - NDFREE(&nd, NDF_ONLY_PNBUF); - vput(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, error == 0 && !whiteout ? &nd.ni_vp : NULL, + true); vn_finished_write(mp); + NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ERELOOKUP) goto restart; return (error); @@ -1457,12 +1456,10 @@ restart: goto out; #endif error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); - if (error == 0) - vput(nd.ni_vp); #ifdef MAC out: #endif - vput(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, error == 0 ? &nd.ni_vp : NULL, true); vn_finished_write(mp); NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ERELOOKUP) @@ -1629,10 +1626,10 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path, return (EAGAIN); } error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd); - VOP_UNLOCK(vp); - vput(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, &vp, true); vn_finished_write(mp); NDFREE(&nd, NDF_ONLY_PNBUF); + vp = NULL; } else { vput(nd.ni_dvp); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1640,7 +1637,8 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path, return (EAGAIN); } } - vrele(vp); + if (vp != NULL) + vrele(vp); return (error); } @@ -1710,6 +1708,7 @@ restart: else vput(nd.ni_dvp); vrele(nd.ni_vp); + nd.ni_vp = NULL; error = EEXIST; goto out; } @@ -1730,14 +1729,12 @@ restart: goto out2; #endif error = VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr, syspath); - if (error == 0) - vput(nd.ni_vp); #ifdef MAC out2: #endif - NDFREE(&nd, NDF_ONLY_PNBUF); - vput(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, error == 0 ? &nd.ni_vp : NULL, true); vn_finished_write(mp); + NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ERELOOKUP) goto restart; out: @@ -3794,9 +3791,7 @@ restart: out: #endif NDFREE(&nd, NDF_ONLY_PNBUF); - vput(nd.ni_dvp); - if (error == 0) - vput(nd.ni_vp); + VOP_VPUT_PAIR(nd.ni_dvp, error == 0 ? &nd.ni_vp : NULL, true); vn_finished_write(mp); if (error == ERELOOKUP) goto restart; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index f70bcdab4208..f8943b3c07e7 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -274,8 +274,9 @@ restart: if (error == 0) #endif error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp, - &ndp->ni_cnd, vap); - vput(ndp->ni_dvp); + &ndp->ni_cnd, vap); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : + NULL, false); vn_finished_write(mp); if (error) { NDFREE(ndp, NDF_ONLY_PNBUF); From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:19 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A085853D54D; Fri, 12 Feb 2021 01:07:19 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhg5tSgz3NQZ; Fri, 12 Feb 2021 01:07:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A31E11B1BC; Fri, 12 Feb 2021 01:07:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17DnU070617; Fri, 12 Feb 2021 01:07:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17DVQ070616; Fri, 12 Feb 2021 01:07:13 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:13 GMT Message-Id: <202102120107.11C17DVQ070616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: be44e9863777 - main - ffs_snapshot: use VOP_VPUT_PAIR after VOP_CREATE. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: be44e986377780f533f961fe7c009b93379b4710 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:20 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=be44e986377780f533f961fe7c009b93379b4710 commit be44e986377780f533f961fe7c009b93379b4710 Author: Konstantin Belousov AuthorDate: 2021-01-24 13:56:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:20 +0000 ffs_snapshot: use VOP_VPUT_PAIR after VOP_CREATE. If the snapshot embrio was reclaimed under us, return error outright. Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_snapshot.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 32dc47653d18..b5daec14decf 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -296,16 +296,21 @@ restart: goto restart; } error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vat); - VOP_UNLOCK(nd.ni_dvp); if (error) { + VOP_VPUT_PAIR(nd.ni_dvp, NULL, true); NDFREE(&nd, NDF_ONLY_PNBUF); vn_finished_write(wrtmp); - vrele(nd.ni_dvp); if (error == ERELOOKUP) goto restart; return (error); } vp = nd.ni_vp; + vref(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, &vp, false); + if (VN_IS_DOOMED(vp)) { + error = EBADF; + goto out; + } vnode_create_vobject(nd.ni_vp, fs->fs_size, td); vp->v_vflag |= VV_SYSTEM; ip = VTOI(vp); From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5CE5353D363; Fri, 12 Feb 2021 01:07:20 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhk1LZsz3NCD; Fri, 12 Feb 2021 01:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1F271AFD2; Fri, 12 Feb 2021 01:07:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17Edd070638; Fri, 12 Feb 2021 01:07:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17EsI070637; Fri, 12 Feb 2021 01:07:14 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:14 GMT Message-Id: <202102120107.11C17EsI070637@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 4a21bcb24174 - main - nfsserver: use VOP_VPUT_PAIR(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a21bcb24174438e0944d6e4d6633290a067b7a8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:21 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4a21bcb24174438e0944d6e4d6633290a067b7a8 commit 4a21bcb24174438e0944d6e4d6633290a067b7a8 Author: Konstantin Belousov AuthorDate: 2021-01-24 13:02:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:21 +0000 nfsserver: use VOP_VPUT_PAIR(). Apply VOP_VPUT_PAIR() to the end of vnode operations after the VOP_MKNOD(), VOP_MKDIR(), VOP_LINK(), VOP_SYMLINK(), VOP_CREATE(). Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/fs/nfsserver/nfs_nfsdport.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index b781503a6815..4d19c73dfa06 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1105,7 +1105,8 @@ nfsvno_createsub(struct nfsrv_descript *nd, struct nameidata *ndp, nfsrv_pnfscreate(ndp->ni_vp, &nvap->na_vattr, nd->nd_cred, p); } - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : + NULL, false); nfsvno_relpathbuf(ndp); if (!error) { if (*exclusive_flagp) { @@ -1140,7 +1141,8 @@ nfsvno_createsub(struct nfsrv_descript *nd, struct nameidata *ndp, nvap->na_rdev = rdev; error = VOP_MKNOD(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : + NULL, false); nfsvno_relpathbuf(ndp); vrele(ndp->ni_startdir); if (error) @@ -1221,7 +1223,8 @@ nfsvno_mknod(struct nameidata *ndp, struct nfsvattr *nvap, struct ucred *cred, vrele(ndp->ni_startdir); error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : NULL, + false); nfsvno_relpathbuf(ndp); } else { if (nvap->na_type != VFIFO && @@ -1233,7 +1236,8 @@ nfsvno_mknod(struct nameidata *ndp, struct nfsvattr *nvap, struct ucred *cred, } error = VOP_MKNOD(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : NULL, + false); nfsvno_relpathbuf(ndp); vrele(ndp->ni_startdir); /* @@ -1268,7 +1272,7 @@ nfsvno_mkdir(struct nameidata *ndp, struct nfsvattr *nvap, uid_t saved_uid, } error = VOP_MKDIR(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : NULL, false); nfsvno_relpathbuf(ndp); out: @@ -1300,17 +1304,15 @@ nfsvno_symlink(struct nameidata *ndp, struct nfsvattr *nvap, char *pathcp, error = VOP_SYMLINK(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr, pathcp); - vput(ndp->ni_dvp); - vrele(ndp->ni_startdir); - nfsvno_relpathbuf(ndp); /* * Although FreeBSD still had the lookup code in * it for 7/current, there doesn't seem to be any * point, since VOP_SYMLINK() returns the ni_vp. * Just vput it for v2. */ - if (!not_v2 && !error) - vput(ndp->ni_vp); + VOP_VPUT_PAIR(ndp->ni_dvp, &ndp->ni_vp, !not_v2 && error == 0); + vrele(ndp->ni_startdir); + nfsvno_relpathbuf(ndp); out: NFSEXITCODE(error); @@ -1595,11 +1597,13 @@ nfsvno_link(struct nameidata *ndp, struct vnode *vp, struct ucred *cred, error = VOP_LINK(ndp->ni_dvp, vp, &ndp->ni_cnd); else error = EPERM; - if (ndp->ni_dvp == vp) + if (ndp->ni_dvp == vp) { vrele(ndp->ni_dvp); - else - vput(ndp->ni_dvp); - NFSVOPUNLOCK(vp); + NFSVOPUNLOCK(vp); + } else { + vref(vp); + VOP_VPUT_PAIR(ndp->ni_dvp, &vp, true); + } } else { if (ndp->ni_dvp == ndp->ni_vp) vrele(ndp->ni_dvp); @@ -1793,7 +1797,8 @@ nfsvno_open(struct nfsrv_descript *nd, struct nameidata *ndp, nfsrv_pnfscreate(ndp->ni_vp, &nvap->na_vattr, cred, p); } - vput(ndp->ni_dvp); + VOP_VPUT_PAIR(ndp->ni_dvp, nd->nd_repstat == 0 ? + &ndp->ni_vp : NULL, false); nfsvno_relpathbuf(ndp); if (!nd->nd_repstat) { if (*exclusive_flagp) { @@ -4106,7 +4111,8 @@ nfsrv_dscreate(struct vnode *dvp, struct vattr *vap, struct vattr *nvap, error = NFSVOPLOCK(dvp, LK_EXCLUSIVE); if (error == 0) { error = VOP_CREATE(dvp, &nvp, &named.ni_cnd, vap); - NFSVOPUNLOCK(dvp); + vref(dvp); + VOP_VPUT_PAIR(dvp, error == 0 ? &nvp : NULL, false); if (error == 0) { /* Set the ownership of the file. */ error = VOP_SETATTR(nvp, nvap, tcred); From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 58DD053D4E0; Fri, 12 Feb 2021 01:07:20 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhk3k2Sz3NQp; Fri, 12 Feb 2021 01:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E16421B1BD; Fri, 12 Feb 2021 01:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17F8M070660; Fri, 12 Feb 2021 01:07:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17FwV070659; Fri, 12 Feb 2021 01:07:15 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:15 GMT Message-Id: <202102120107.11C17FwV070659@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f2c9d038bdee - main - FFS: implement special VOP_VPUT_PAIR(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2c9d038bdee547be07c8b0404547617b71f2232 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:23 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f2c9d038bdee547be07c8b0404547617b71f2232 commit f2c9d038bdee547be07c8b0404547617b71f2232 Author: Konstantin Belousov AuthorDate: 2021-01-27 18:09:53 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:21 +0000 FFS: implement special VOP_VPUT_PAIR(). It cleans IN_NEEDSYNC flag on dvp before returning, by applying ffs_syncvnode() until success or an error different from ERELOOKUP. IN_NEEDSYNC cleanup is required to avoid creating holes in the directories when extended into indirect block. Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_vnops.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index be2653e32adc..623b13790ce0 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -130,6 +130,7 @@ static vop_listextattr_t ffs_listextattr; static vop_openextattr_t ffs_openextattr; static vop_setextattr_t ffs_setextattr; static vop_vptofh_t ffs_vptofh; +static vop_vput_pair_t ffs_vput_pair; /* Global vfs data structures for ufs. */ struct vop_vector ffs_vnodeops1 = { @@ -146,6 +147,7 @@ struct vop_vector ffs_vnodeops1 = { .vop_reallocblks = ffs_reallocblks, .vop_write = ffs_write, .vop_vptofh = ffs_vptofh, + .vop_vput_pair = ffs_vput_pair, }; VFS_VOP_VECTOR_REGISTER(ffs_vnodeops1); @@ -182,6 +184,7 @@ struct vop_vector ffs_vnodeops2 = { .vop_openextattr = ffs_openextattr, .vop_setextattr = ffs_setextattr, .vop_vptofh = ffs_vptofh, + .vop_vput_pair = ffs_vput_pair, }; VFS_VOP_VECTOR_REGISTER(ffs_vnodeops2); @@ -1917,3 +1920,55 @@ ffs_getpages_async(struct vop_getpages_async_args *ap) return (error); } + +static int +ffs_vput_pair(struct vop_vput_pair_args *ap) +{ + struct vnode *dvp, *vp, **vpp; + struct inode *dp; + int error, vp_locked; + + dvp = ap->a_dvp; + dp = VTOI(dvp); + vpp = ap->a_vpp; + vp = vpp != NULL ? *vpp : NULL; + + if ((dp->i_flag & IN_NEEDSYNC) == 0) { + vput(dvp); + if (vp != NULL && ap->a_unlock_vp) + vput(vp); + return (0); + } + + if (vp != NULL) { + if (ap->a_unlock_vp) { + vput(vp); + } else { + MPASS(vp->v_type != VNON); + vp_locked = VOP_ISLOCKED(vp); + VOP_UNLOCK(vp); + } + } + + do { + error = ffs_syncvnode(dvp, MNT_WAIT, 0); + } while (error == ERELOOKUP); + vput(dvp); + + if (vp == NULL || ap->a_unlock_vp) + return (0); + + /* + * It is possible that vp is reclaimed at this point. Only + * routines that call us with a_unlock_vp == false can find + * that their vp has been reclaimed. There are three areas + * that are affected: + * 1) vn_open_cred() - later VOPs could fail, but + * dead_open() returns 0 to simulate successful open. + * 2) ffs_snapshot() - creation of snapshot fails with EBADF. + * 3) NFS server (several places) - code is prepared to detect + * and respond to dead vnodes by returning ESTALE. + */ + VOP_LOCK(vp, vp_locked | LK_RETRY); + return (0); +} From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:32 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1069153D804; Fri, 12 Feb 2021 01:07:32 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhz1d3Yz3NcH; Fri, 12 Feb 2021 01:07:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A9041B1C0; Fri, 12 Feb 2021 01:07:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17SL8070890; Fri, 12 Feb 2021 01:07:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17SVq070889; Fri, 12 Feb 2021 01:07:28 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:28 GMT Message-Id: <202102120107.11C17SVq070889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 26af9f72f7cb - main - ffs_unlock: assert that IN_ENDOFF is not leaked past locked scope MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 26af9f72f7cb162abeced8b7e444800b601e5017 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:32 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=26af9f72f7cb162abeced8b7e444800b601e5017 commit 26af9f72f7cb162abeced8b7e444800b601e5017 Author: Konstantin Belousov AuthorDate: 2021-01-31 19:01:17 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:22 +0000 ffs_unlock: assert that IN_ENDOFF is not leaked past locked scope This catches both missed processing of IN_ENDOFF and missed application of VOP_VPUT_PAIR() after VOP that created an entry in the directory. Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_vnops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 38511647c502..1dfdf5182a42 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -591,6 +591,9 @@ ffs_unlock_debug(struct vop_unlock_args *ap) VI_UNLOCK(vp); } } + KASSERT(vp->v_type != VDIR || vp->v_vnlock->lk_recurse != 0 || + (ip->i_flag & IN_ENDOFF) == 0, + ("ufs dir vp %p ip %p flags %#x", vp, ip, ip->i_flag)); #ifdef DIAGNOSTIC if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE && ip != NULL && vp->v_vnlock->lk_recurse == 0) From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:25 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5406253D6A8; Fri, 12 Feb 2021 01:07:25 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhp3JX4z3NJ9; Fri, 12 Feb 2021 01:07:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 704A71B1BF; Fri, 12 Feb 2021 01:07:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17JfE070722; Fri, 12 Feb 2021 01:07:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17JKG070721; Fri, 12 Feb 2021 01:07:19 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:19 GMT Message-Id: <202102120107.11C17JKG070721@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 038fe6e089f0 - main - ufs_rename: use VOP_VPUT_PAIR and rely on directory sync/truncation there MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 038fe6e089f03ca864c1dd5ac0c76404a13bbe79 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:25 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=038fe6e089f03ca864c1dd5ac0c76404a13bbe79 commit 038fe6e089f03ca864c1dd5ac0c76404a13bbe79 Author: Konstantin Belousov AuthorDate: 2021-01-28 13:34:56 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:21 +0000 ufs_rename: use VOP_VPUT_PAIR and rely on directory sync/truncation there Suggested by: mckusick Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ufs/ufs_vnops.c | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 70b5a44ca21d..c101e699bad6 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1676,38 +1676,16 @@ unlockout: vput(fdvp); vput(fvp); - if (tvp) - vput(tvp); + /* - * If compaction or fsync was requested do it now that other locks - * are no longer needed. + * If compaction or fsync was requested do it in + * ffs_vput_pair() now that other locks are no longer needed. */ if (error == 0 && endoff != 0) { - do { - error = UFS_TRUNCATE(tdvp, endoff, IO_NORMAL | - (DOINGASYNC(tdvp) ? 0 : IO_SYNC), tcnp->cn_cred); - } while (error == ERELOOKUP); - if (error != 0 && !ffs_fsfail_cleanup(VFSTOUFS(mp), error)) - vn_printf(tdvp, - "ufs_rename: failed to truncate, error %d\n", - error); -#ifdef UFS_DIRHASH - if (error != 0) - ufsdirhash_free(tdp); -#endif - /* - * Even if the directory compaction failed, rename was - * succesful. Do not propagate a UFS_TRUNCATE() error - * to the caller. - */ - error = 0; - } - if (error == 0 && tdp->i_flag & IN_NEEDSYNC) { - do { - error = VOP_FSYNC(tdvp, MNT_WAIT, td); - } while (error == ERELOOKUP); + UFS_INODE_SET_FLAG(tdp, IN_ENDOFF); + SET_I_ENDOFF(tdp, endoff); } - vput(tdvp); + VOP_VPUT_PAIR(tdvp, &tvp, true); return (error); bad: From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:26 2021 Return-Path: Delivered-To: dev-commits-src-main@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 184F753D78C; Fri, 12 Feb 2021 01:07:26 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhq6pjZz3NJJ; Fri, 12 Feb 2021 01:07:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C56921B222; Fri, 12 Feb 2021 01:07:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17MCF070784; Fri, 12 Feb 2021 01:07:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17Mx4070783; Fri, 12 Feb 2021 01:07:22 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:22 GMT Message-Id: <202102120107.11C17Mx4070783@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6aed2435c8bf - main - ufs vnops: brace softdep_prelink() with DOINGSUJ instead of DOINGSOFTDEP MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6aed2435c8bf1fa55891c7d30186c9ad91064da8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:27 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6aed2435c8bf1fa55891c7d30186c9ad91064da8 commit 6aed2435c8bf1fa55891c7d30186c9ad91064da8 Author: Konstantin Belousov AuthorDate: 2021-01-23 23:12:39 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:21 +0000 ufs vnops: brace softdep_prelink() with DOINGSUJ instead of DOINGSOFTDEP because softdep_prelink() is reverted to NOP for non-J case. There is no need to do anything before ufs_direnter() in SU/non-J case, everything required to sync the directory is done in VOP_VPUT_PAIR(). Suggested by: mckusick Reviewed by: chs, mckusick Tested by: pho MFC after: 2 week Sponsored by: The FreeBSD Foundation --- sys/ufs/ufs/ufs_vnops.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index b035a8b1c34d..e6a78c3655cc 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1006,7 +1006,7 @@ ufs_remove(ap) if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND)) || (VTOI(dvp)->i_flags & APPEND)) return (EPERM); - if (DOINGSOFTDEP(dvp)) { + if (DOINGSUJ(dvp)) { error = softdep_prelink(dvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); @@ -1071,7 +1071,7 @@ ufs_link(ap) panic("ufs_link: no name"); #endif - if (DOINGSOFTDEP(tdvp)) { + if (DOINGSUJ(tdvp)) { error = softdep_prelink(tdvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); @@ -1142,7 +1142,7 @@ ufs_whiteout(ap) struct direct newdir; int error = 0; - if (DOINGSOFTDEP(dvp) && (ap->a_flags == CREATE || + if (DOINGSUJ(dvp) && (ap->a_flags == CREATE || ap->a_flags == DELETE)) { error = softdep_prelink(dvp, NULL); if (error != 0) { @@ -1945,7 +1945,7 @@ ufs_mkdir(ap) goto out; } - if (DOINGSOFTDEP(dvp)) { + if (DOINGSUJ(dvp)) { error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); @@ -2209,7 +2209,7 @@ ufs_rmdir(ap) error = EINVAL; goto out; } - if (DOINGSOFTDEP(dvp)) { + if (DOINGSUJ(dvp)) { error = softdep_prelink(dvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); @@ -2736,7 +2736,7 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) print_bad_link_count(callfunc, dvp); return (EINVAL); } - if (DOINGSOFTDEP(dvp)) { + if (DOINGSUJ(dvp)) { error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:25 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6A21353D27F; Fri, 12 Feb 2021 01:07:25 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhn0S56z3NNf; Fri, 12 Feb 2021 01:07:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C0AE1B1BE; Fri, 12 Feb 2021 01:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17I5G070700; Fri, 12 Feb 2021 01:07:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17IYh070699; Fri, 12 Feb 2021 01:07:18 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:18 GMT Message-Id: <202102120107.11C17IYh070699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 74a3652f832f - main - ufs_direnter: move directory truncation to ffs_vput_pair(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 74a3652f832f4ed0f1ad9f7eb60d70013b478e1a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:25 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=74a3652f832f4ed0f1ad9f7eb60d70013b478e1a commit 74a3652f832f4ed0f1ad9f7eb60d70013b478e1a Author: Konstantin Belousov AuthorDate: 2021-01-27 20:34:14 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:21 +0000 ufs_direnter: move directory truncation to ffs_vput_pair(). VOP_VPUT_PAIR() provides the hook to do the truncation right before unlock, which is required since truncation might need to fsync(), which itself might unlock the directory vnode. Set new flag IN_ENDOFF which indicates that i_endoff is valid and should be checked against inode size. Excessive size is chomped, but this operation is advisory and failure to truncate should not result in the failure of the main VOP. Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_vnops.c | 44 ++++++++++++++++++++++++++++++++++++++------ sys/ufs/ufs/inode.h | 2 ++ sys/ufs/ufs/ufs_lookup.c | 25 ++++++------------------- 3 files changed, 46 insertions(+), 25 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 2ac67adad5f2..dd0f1ba6b81d 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include "opt_directio.h" #include "opt_ffs.h" +#include "opt_ufs.h" #include #include @@ -99,6 +100,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#ifdef UFS_DIRHASH +#include +#endif #include #include @@ -1929,6 +1934,7 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) struct inode *dp, *ip; ino_t ip_ino; u_int64_t ip_gen; + off_t old_size; int error, vp_locked; dvp = ap->a_dvp; @@ -1936,14 +1942,14 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) vpp = ap->a_vpp; vp = vpp != NULL ? *vpp : NULL; - if ((dp->i_flag & IN_NEEDSYNC) == 0) { + if ((dp->i_flag & (IN_NEEDSYNC | IN_ENDOFF)) == 0) { vput(dvp); if (vp != NULL && ap->a_unlock_vp) vput(vp); return (0); } - mp = NULL; + mp = dvp->v_mount; if (vp != NULL) { if (ap->a_unlock_vp) { vput(vp); @@ -1953,14 +1959,40 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) ip = VTOI(vp); ip_ino = ip->i_number; ip_gen = ip->i_gen; - mp = vp->v_mount; VOP_UNLOCK(vp); } } - do { - error = ffs_syncvnode(dvp, MNT_WAIT, 0); - } while (error == ERELOOKUP); + /* + * If compaction or fsync was requested do it in ffs_vput_pair() + * now that other locks are no longer held. + */ + if ((dp->i_flag & IN_ENDOFF) != 0) { + dp->i_flag &= ~IN_ENDOFF; + if (I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size) { + old_size = dp->i_size; + error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), + IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), + curthread->td_ucred); + if (error != 0 && error != ERELOOKUP) { + if (!ffs_fsfail_cleanup(VFSTOUFS(mp), error)) { + vn_printf(dvp, + "IN_ENDOFF: failed to truncate, " + "error %d\n", error); + } +#ifdef UFS_DIRHASH + ufsdirhash_free(dp); +#endif + } + } + SET_I_ENDOFF(dp, 0); + } + if ((dp->i_flag & IN_NEEDSYNC) != 0) { + do { + error = ffs_syncvnode(dvp, MNT_WAIT, 0); + } while (error == ERELOOKUP); + } + vput(dvp); if (vp == NULL || ap->a_unlock_vp) diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h index 16db8d6d5cea..4515dcbed401 100644 --- a/sys/ufs/ufs/inode.h +++ b/sys/ufs/ufs/inode.h @@ -152,6 +152,8 @@ struct inode { #define IN_IBLKDATA 0x0800 /* datasync requires inode block update */ #define IN_SIZEMOD 0x1000 /* Inode size has been modified */ +#define IN_ENDOFF 0x2000 /* Free space at the end of directory, + try to truncate when possible */ #define PRINT_INODE_FLAGS "\20\20b16\17b15\16b14\15sizemod" \ "\14iblkdata\13is_ufs2\12truncated\11ea_lockwait\10ea_locked" \ diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index e614f189a623..3036bce81caf 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1112,27 +1112,14 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) } } UFS_INODE_SET_FLAG(dp, IN_CHANGE | IN_UPDATE); + /* - * If all went well, and the directory can be shortened, proceed - * with the truncation. Note that we have to unlock the inode for - * the entry that we just entered, as the truncation may need to - * lock other inodes which can lead to deadlock if we also hold a - * lock on the newly entered node. + * If all went well, and the directory can be shortened, mark directory inode + * with the truncation request right before unlock. */ - if (isrename == 0 && error == 0 && - I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size) { - if (tvp != NULL) - VOP_UNLOCK(tvp); - error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), - IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), cr); - if (error != 0) - vn_printf(dvp, - "ufs_direnter: failed to truncate, error %d\n", - error); - error = 0; - if (tvp != NULL) - vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); - } + if (isrename == 0 && error == 0) + UFS_INODE_SET_FLAG(dp, IN_ENDOFF); + return (error); } From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:26 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0827953D55E; Fri, 12 Feb 2021 01:07:26 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhr6W1Mz3Nbr; Fri, 12 Feb 2021 01:07:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1E3F1B17F; Fri, 12 Feb 2021 01:07:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17LKD070762; Fri, 12 Feb 2021 01:07:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17L12070761; Fri, 12 Feb 2021 01:07:21 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:21 GMT Message-Id: <202102120107.11C17L12070761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ede40b067515 - main - ffs softdep: remove will_direnter argument of softdep_prelink() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ede40b0675155b5cc862652f2fee11c738a46bcd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:27 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ede40b0675155b5cc862652f2fee11c738a46bcd commit ede40b0675155b5cc862652f2fee11c738a46bcd Author: Konstantin Belousov AuthorDate: 2021-01-23 22:40:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:21 +0000 ffs softdep: remove will_direnter argument of softdep_prelink() Originally this was done in 8a1509e442bc9a075 to forcibly cover cases where a hole in the directory could be created by extending into indirect block, since dependency of writing out indirect block is not tracked. This results in excessive amount of fsyncing the directories, where all creation of new entry forced fsync before it. This is not needed, it is enough to fsync when IN_NEEDSYNC is set, and VOP_VPUT_PAIR() provides the required hook to only perform required syncing. The series of changes culminating in this commit puts the performance of metadata-intensive loads back to that before 8a1509e442bc9a075. Analyzed by: mckusick Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_extern.h | 2 +- sys/ufs/ffs/ffs_softdep.c | 46 ++++++++-------------------------------------- sys/ufs/ufs/ufs_vnops.c | 12 ++++++------ 3 files changed, 15 insertions(+), 45 deletions(-) diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 9694489266b6..544012089046 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -178,7 +178,7 @@ int softdep_request_cleanup(struct fs *, struct vnode *, struct ucred *, int); int softdep_prerename(struct vnode *, struct vnode *, struct vnode *, struct vnode *); -int softdep_prelink(struct vnode *, struct vnode *, int); +int softdep_prelink(struct vnode *, struct vnode *); void softdep_setup_freeblocks(struct inode *, off_t, int); void softdep_setup_inomapdep(struct buf *, struct inode *, ino_t, int); void softdep_setup_blkmapdep(struct buf *, struct mount *, ufs2_daddr_t, diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index e90593b20e40..3cc76f9142c3 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -621,10 +621,9 @@ softdep_prerename(fdvp, fvp, tdvp, tvp) } int -softdep_prelink(dvp, vp, will_direnter) +softdep_prelink(dvp, vp) struct vnode *dvp; struct vnode *vp; - int will_direnter; { panic("softdep_prelink called"); @@ -3358,13 +3357,11 @@ softdep_prerename(fdvp, fvp, tdvp, tvp) * syscall must be restarted at top level from the lookup. */ int -softdep_prelink(dvp, vp, will_direnter) +softdep_prelink(dvp, vp) struct vnode *dvp; struct vnode *vp; - int will_direnter; { struct ufsmount *ump; - int error, error1; ASSERT_VOP_ELOCKED(dvp, "prelink dvp"); if (vp != NULL) @@ -3372,40 +3369,13 @@ softdep_prelink(dvp, vp, will_direnter) ump = VFSTOUFS(dvp->v_mount); /* - * Nothing to do if we have sufficient journal space. - * If we currently hold the snapshot lock, we must avoid - * handling other resources that could cause deadlock. - * - * will_direnter == 1: In case allocated a directory block in - * an indirect block, we must prevent holes in the directory - * created if directory entries are written out of order. To - * accomplish this we fsync when we extend a directory into - * indirects. During rename it's not safe to drop the tvp - * lock so sync must be delayed until it is. - * - * This synchronous step could be removed if fsck and the - * kernel were taught to fill in sparse directories rather - * than panic. + * Nothing to do if we have sufficient journal space. We skip + * flushing when vp is a snapshot to avoid deadlock where + * another thread is trying to update the inodeblock for dvp + * and is waiting on snaplk that vp holds. */ - if (journal_space(ump, 0) || (vp != NULL && IS_SNAPSHOT(VTOI(vp)))) { - error = 0; - if (will_direnter && (vp == NULL || !IS_SNAPSHOT(VTOI(vp)))) { - if (vp != NULL) - VOP_UNLOCK(vp); - error = ffs_syncvnode(dvp, MNT_WAIT, 0); - if (vp != NULL) { - error1 = vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT); - if (error1 != 0) { - vn_lock_pair(dvp, true, vp, false); - if (error == 0) - error = ERELOOKUP; - } else if (vp->v_data == NULL) { - error = ERELOOKUP; - } - } - } - return (error); - } + if (journal_space(ump, 0) || (vp != NULL && IS_SNAPSHOT(VTOI(vp)))) + return (0); stat_journal_low++; if (vp != NULL) { diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 22199a390dd4..b035a8b1c34d 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1007,7 +1007,7 @@ ufs_remove(ap) (VTOI(dvp)->i_flags & APPEND)) return (EPERM); if (DOINGSOFTDEP(dvp)) { - error = softdep_prelink(dvp, vp, true); + error = softdep_prelink(dvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -1072,7 +1072,7 @@ ufs_link(ap) #endif if (DOINGSOFTDEP(tdvp)) { - error = softdep_prelink(tdvp, vp, true); + error = softdep_prelink(tdvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -1144,7 +1144,7 @@ ufs_whiteout(ap) if (DOINGSOFTDEP(dvp) && (ap->a_flags == CREATE || ap->a_flags == DELETE)) { - error = softdep_prelink(dvp, NULL, true); + error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -1946,7 +1946,7 @@ ufs_mkdir(ap) } if (DOINGSOFTDEP(dvp)) { - error = softdep_prelink(dvp, NULL, true); + error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -2210,7 +2210,7 @@ ufs_rmdir(ap) goto out; } if (DOINGSOFTDEP(dvp)) { - error = softdep_prelink(dvp, vp, false); + error = softdep_prelink(dvp, vp); if (error != 0) { MPASS(error == ERELOOKUP); return (error); @@ -2737,7 +2737,7 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) return (EINVAL); } if (DOINGSOFTDEP(dvp)) { - error = softdep_prelink(dvp, NULL, true); + error = softdep_prelink(dvp, NULL); if (error != 0) { MPASS(error == ERELOOKUP); return (error); From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:26 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0B9C553D78B; Fri, 12 Feb 2021 01:07:26 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhr0Wkhz3NSn; Fri, 12 Feb 2021 01:07:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77CB61B17E; Fri, 12 Feb 2021 01:07:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17Ku1070744; Fri, 12 Feb 2021 01:07:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17Kn0070743; Fri, 12 Feb 2021 01:07:20 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:20 GMT Message-Id: <202102120107.11C17Kn0070743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 06f2918ab8a2 - main - ufs_direnter: directory truncation does not need special case for rename MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06f2918ab8a2621c6e6bc5729ed9ab982741aaf2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:26 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=06f2918ab8a2621c6e6bc5729ed9ab982741aaf2 commit 06f2918ab8a2621c6e6bc5729ed9ab982741aaf2 Author: Konstantin Belousov AuthorDate: 2021-01-29 12:31:52 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:21 +0000 ufs_direnter: directory truncation does not need special case for rename In ufs_rename case, tdvp is locked from the place where ufs_direnter() is done till VOP_VPUT_PAIR(), which means that we no longer need to specially handle rename in ufs_direnter(). Truncation, if possible, is done in the same way in ffs_vput_pair() both for rename and other VOPs calling ufs_direnter(). Remove isrename argument and set IN_ENDOFF if ufs_direnter() succeeded and directory needs truncation. In ffs_vput_pair(), stop verifying the condition that directory needs truncation when IN_ENDOFF is set, instead assert that the condition is true. Suggested by: mckusick Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_vnops.c | 25 ++++++++++++------------- sys/ufs/ufs/ufs_extern.h | 2 +- sys/ufs/ufs/ufs_lookup.c | 12 +++++------- sys/ufs/ufs/ufs_vnops.c | 10 +++++----- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index dd0f1ba6b81d..38511647c502 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1968,22 +1968,21 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) * now that other locks are no longer held. */ if ((dp->i_flag & IN_ENDOFF) != 0) { + VNASSERT(I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size, dvp, + ("IN_ENDOFF set but I_ENDOFF() is not")); dp->i_flag &= ~IN_ENDOFF; - if (I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size) { - old_size = dp->i_size; - error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), - IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), - curthread->td_ucred); - if (error != 0 && error != ERELOOKUP) { - if (!ffs_fsfail_cleanup(VFSTOUFS(mp), error)) { - vn_printf(dvp, - "IN_ENDOFF: failed to truncate, " - "error %d\n", error); - } + old_size = dp->i_size; + error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), IO_NORMAL | + (DOINGASYNC(dvp) ? 0 : IO_SYNC), curthread->td_ucred); + if (error != 0 && error != ERELOOKUP) { + if (!ffs_fsfail_cleanup(VFSTOUFS(mp), error)) { + vn_printf(dvp, + "IN_ENDOFF: failed to truncate, " + "error %d\n", error); + } #ifdef UFS_DIRHASH - ufsdirhash_free(dp); + ufsdirhash_free(dp); #endif - } } SET_I_ENDOFF(dp, 0); } diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index 1697f2c0ba61..3ac631e6ab0b 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -68,7 +68,7 @@ int ufs_extwrite(struct vop_write_args *); void ufs_makedirentry(struct inode *, struct componentname *, struct direct *); int ufs_direnter(struct vnode *, struct vnode *, struct direct *, - struct componentname *, struct buf *, int); + struct componentname *, struct buf *); int ufs_dirremove(struct vnode *, struct inode *, int, int); int ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, int); int ufs_lookup_ino(struct vnode *, struct vnode **, struct componentname *, diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 3036bce81caf..0509185c4663 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -876,13 +876,12 @@ ufs_makedirentry(ip, cnp, newdirp) * soft dependency code). */ int -ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) +ufs_direnter(dvp, tvp, dirp, cnp, newdirbp) struct vnode *dvp; struct vnode *tvp; struct direct *dirp; struct componentname *cnp; struct buf *newdirbp; - int isrename; { struct ucred *cr; struct thread *td; @@ -1111,14 +1110,13 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename) error = bwrite(bp); } } - UFS_INODE_SET_FLAG(dp, IN_CHANGE | IN_UPDATE); /* - * If all went well, and the directory can be shortened, mark directory inode - * with the truncation request right before unlock. + * If all went well, and the directory can be shortened, + * mark directory inode with the truncation request. */ - if (isrename == 0 && error == 0) - UFS_INODE_SET_FLAG(dp, IN_ENDOFF); + UFS_INODE_SET_FLAG(dp, IN_CHANGE | IN_UPDATE | (error == 0 && + I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size ? IN_ENDOFF : 0)); return (error); } diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index c101e699bad6..22199a390dd4 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1111,7 +1111,7 @@ ufs_link(ap) error = UFS_UPDATE(vp, !DOINGSOFTDEP(vp) && !DOINGASYNC(vp)); if (!error) { ufs_makedirentry(ip, cnp, &newdir); - error = ufs_direnter(tdvp, vp, &newdir, cnp, NULL, 0); + error = ufs_direnter(tdvp, vp, &newdir, cnp, NULL); } if (error) { @@ -1171,7 +1171,7 @@ ufs_whiteout(ap) newdir.d_namlen = cnp->cn_namelen; bcopy(cnp->cn_nameptr, newdir.d_name, (unsigned)cnp->cn_namelen + 1); newdir.d_type = DT_WHT; - error = ufs_direnter(dvp, NULL, &newdir, cnp, NULL, 0); + error = ufs_direnter(dvp, NULL, &newdir, cnp, NULL); break; case DELETE: @@ -1511,7 +1511,7 @@ relock: } } ufs_makedirentry(fip, tcnp, &newdir); - error = ufs_direnter(tdvp, NULL, &newdir, tcnp, NULL, 1); + error = ufs_direnter(tdvp, NULL, &newdir, tcnp, NULL); if (error) goto bad; /* Setup tdvp for directory compaction if needed. */ @@ -2132,7 +2132,7 @@ ufs_mkdir(ap) else if (!DOINGSOFTDEP(dvp) && ((error = bwrite(bp)))) goto bad; ufs_makedirentry(ip, cnp, &newdir); - error = ufs_direnter(dvp, tvp, &newdir, cnp, bp, 0); + error = ufs_direnter(dvp, tvp, &newdir, cnp, bp); bad: if (error == 0) { @@ -2865,7 +2865,7 @@ ufs_makeinode(mode, dvp, vpp, cnp, callfunc) } #endif /* !UFS_ACL */ ufs_makedirentry(ip, cnp, &newdir); - error = ufs_direnter(dvp, tvp, &newdir, cnp, NULL, 0); + error = ufs_direnter(dvp, tvp, &newdir, cnp, NULL); if (error) goto bad; vn_seqc_write_end(tvp); From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:31 2021 Return-Path: Delivered-To: dev-commits-src-main@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 F077053D37D; Fri, 12 Feb 2021 01:07:30 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhw4Ms0z3NM1; Fri, 12 Feb 2021 01:07:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E60EF1B286; Fri, 12 Feb 2021 01:07:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17NX9070806; Fri, 12 Feb 2021 01:07:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17NSW070805; Fri, 12 Feb 2021 01:07:23 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:23 GMT Message-Id: <202102120107.11C17NSW070805@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b59a8e63d6bf - main - Stop ignoring ERELOOKUP from VOP_INACTIVE() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b59a8e63d6bf9092419b7a421c655d0ae2099662 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:31 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b59a8e63d6bf9092419b7a421c655d0ae2099662 commit b59a8e63d6bf9092419b7a421c655d0ae2099662 Author: Konstantin Belousov AuthorDate: 2021-01-30 19:17:29 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:21 +0000 Stop ignoring ERELOOKUP from VOP_INACTIVE() When possible, relock the vnode and retry inactivation. Only vunref() is required not to drop the vnode lock, so handle it specially by not retrying. This is a part of the efforts to ensure that unlinked not referenced vnode does not prevent inode from reusing. Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/kern/vfs_subr.c | 47 ++++++++++++++++++++++++++++++++-------------- sys/sys/vnode.h | 3 ++- sys/ufs/ffs/ffs_snapshot.c | 8 +++++++- 3 files changed, 42 insertions(+), 16 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 047e4c54f0c5..04cd0e0175f9 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3159,9 +3159,21 @@ vput_final(struct vnode *vp, enum vput_op func) break; } if (error == 0) { - vinactive(vp); - if (want_unlock) - VOP_UNLOCK(vp); + if (func == VUNREF) { + VNASSERT((vp->v_vflag & VV_UNREF) == 0, vp, + ("recursive vunref")); + vp->v_vflag |= VV_UNREF; + } + for (;;) { + error = vinactive(vp); + if (want_unlock) + VOP_UNLOCK(vp); + if (error != ERELOOKUP || !want_unlock) + break; + VOP_LOCK(vp, LK_EXCLUSIVE); + } + if (func == VUNREF) + vp->v_vflag &= ~VV_UNREF; vdropl(vp); } else { vdefer_inactive(vp); @@ -3546,10 +3558,11 @@ vdropl(struct vnode *vp) * Call VOP_INACTIVE on the vnode and manage the DOINGINACT and OWEINACT * flags. DOINGINACT prevents us from recursing in calls to vinactive. */ -static void +static int vinactivef(struct vnode *vp) { struct vm_object *obj; + int error; ASSERT_VOP_ELOCKED(vp, "vinactive"); ASSERT_VI_LOCKED(vp, "vinactive"); @@ -3575,14 +3588,15 @@ vinactivef(struct vnode *vp) vm_object_page_clean(obj, 0, 0, 0); VM_OBJECT_WUNLOCK(obj); } - VOP_INACTIVE(vp); + error = VOP_INACTIVE(vp); VI_LOCK(vp); VNASSERT(vp->v_iflag & VI_DOINGINACT, vp, ("vinactive: lost VI_DOINGINACT")); vp->v_iflag &= ~VI_DOINGINACT; + return (error); } -void +int vinactive(struct vnode *vp) { @@ -3591,14 +3605,14 @@ vinactive(struct vnode *vp) CTR2(KTR_VFS, "%s: vp %p", __func__, vp); if ((vp->v_iflag & VI_OWEINACT) == 0) - return; + return (0); if (vp->v_iflag & VI_DOINGINACT) - return; + return (0); if (vp->v_usecount > 0) { vp->v_iflag &= ~VI_OWEINACT; - return; + return (0); } - vinactivef(vp); + return (vinactivef(vp)); } /* @@ -3911,10 +3925,15 @@ vgonel(struct vnode *vp) */ if (active) VOP_CLOSE(vp, FNONBLOCK, NOCRED, td); - if ((oweinact || active) && !doinginact) { - VI_LOCK(vp); - vinactivef(vp); - VI_UNLOCK(vp); + if (!doinginact) { + do { + if (oweinact || active) { + VI_LOCK(vp); + vinactivef(vp); + oweinact = (vp->v_iflag & VI_OWEINACT) != 0; + VI_UNLOCK(vp); + } + } while (oweinact); } if (vp->v_type == VSOCK) vfs_unp_reclaim(vp); diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 78fbec1bd0ba..639a16881e09 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -269,6 +269,7 @@ struct xvnode { #define VV_MD 0x0800 /* vnode backs the md device */ #define VV_FORCEINSMQ 0x1000 /* force the insmntque to succeed */ #define VV_READLINK 0x2000 /* fdescfs linux vnode */ +#define VV_UNREF 0x4000 /* vunref, do not drop lock in inactive() */ #define VMP_LAZYLIST 0x0001 /* Vnode is on mnt's lazy list */ @@ -710,7 +711,7 @@ void vgone(struct vnode *vp); void vhold(struct vnode *); void vholdnz(struct vnode *); bool vhold_smr(struct vnode *); -void vinactive(struct vnode *vp); +int vinactive(struct vnode *vp); int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); int vtruncbuf(struct vnode *vp, off_t length, int blksize); void v_inval_buf_range(struct vnode *vp, daddr_t startlbn, daddr_t endlbn, diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index b5daec14decf..72c8061917d8 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -2595,6 +2595,7 @@ process_deferred_inactive(struct mount *mp) continue; } vholdl(vp); +retry_vnode: error = vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK); if (error != 0) { vdrop(vp); @@ -2609,7 +2610,12 @@ process_deferred_inactive(struct mount *mp) UFS_INODE_SET_FLAG(ip, IN_MODIFIED); } VI_LOCK(vp); - vinactive(vp); + error = vinactive(vp); + if (error == ERELOOKUP && vp->v_usecount == 0) { + VI_UNLOCK(vp); + VOP_UNLOCK(vp); + goto retry_vnode; + } VI_UNLOCK(vp); VOP_UNLOCK(vp); vdrop(vp); From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:31 2021 Return-Path: Delivered-To: dev-commits-src-main@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 F158B53D37E; Fri, 12 Feb 2021 01:07:30 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhw6KGLz3Nhb; Fri, 12 Feb 2021 01:07:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 282311B287; Fri, 12 Feb 2021 01:07:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17Ov3070826; Fri, 12 Feb 2021 01:07:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17OA8070824; Fri, 12 Feb 2021 01:07:24 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:24 GMT Message-Id: <202102120107.11C17OA8070824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 013168db8cea - main - ufs_inactive(): stop hiding ERELOOKUP from ffs_truncate(), return it. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 013168db8cea926c3dde1247d400d6bedf9a889d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:31 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=013168db8cea926c3dde1247d400d6bedf9a889d commit 013168db8cea926c3dde1247d400d6bedf9a889d Author: Konstantin Belousov AuthorDate: 2021-01-30 19:18:22 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:21 +0000 ufs_inactive(): stop hiding ERELOOKUP from ffs_truncate(), return it. VFS should retry inactivation when possible, then. This should provide timely removal of unlinked unreferenced inodes. Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_softdep.c | 9 +++++---- sys/ufs/ufs/ufs_inode.c | 2 -- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 3cc76f9142c3..8c3ae9dd95fc 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1493,13 +1493,14 @@ get_parent_vp(struct vnode *vp, struct mount *mp, ino_t inum, struct buf *bp, } /* - * Do not drop vnode lock while inactivating. This - * would result in leaks of the VI flags and - * reclaiming of non-truncated vnode. Instead, + * Do not drop vnode lock while inactivating during + * vunref. This would result in leaks of the VI flags + * and reclaiming of non-truncated vnode. Instead, * re-schedule inactivation hoping that we would be * able to sync inode later. */ - if ((vp->v_iflag & VI_DOINGINACT) != 0) { + if ((vp->v_iflag & VI_DOINGINACT) != 0 && + (vp->v_vflag & VV_UNREF) != 0) { VI_LOCK(vp); vp->v_iflag |= VI_OWEINACT; VI_UNLOCK(vp); diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c index 15bd8be448a9..46e4f8e54e41 100644 --- a/sys/ufs/ufs/ufs_inode.c +++ b/sys/ufs/ufs/ufs_inode.c @@ -212,8 +212,6 @@ out: vrecycle(vp); if (mp != NULL) vn_finished_secondary_write(mp); - if (error == ERELOOKUP) - error = 0; return (error); } From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:32 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0A01253D889; Fri, 12 Feb 2021 01:07:32 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhz2yzTz3NPT; Fri, 12 Feb 2021 01:07:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71F8A1B224; Fri, 12 Feb 2021 01:07:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17RMB070868; Fri, 12 Feb 2021 01:07:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17ROP070867; Fri, 12 Feb 2021 01:07:27 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:27 GMT Message-Id: <202102120107.11C17ROP070867@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 28703d27130c - main - ffs softdep: Force processing of VI_OWEINACT vnodes when there is inode shortage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28703d27130c9cb7e7830ff53155c379a502c248 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:32 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=28703d27130c9cb7e7830ff53155c379a502c248 commit 28703d27130c9cb7e7830ff53155c379a502c248 Author: Konstantin Belousov AuthorDate: 2021-01-31 18:39:49 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:22 +0000 ffs softdep: Force processing of VI_OWEINACT vnodes when there is inode shortage Such vnodes prevent inode reuse, and should be force-cleared when ffs_valloc() is unable to find a free inode. Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_softdep.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++ sys/ufs/ffs/softdep.h | 2 ++ 2 files changed, 63 insertions(+) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 8c52139687f9..786fb43c7d81 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1311,6 +1311,7 @@ static int softdep_flushcache = 0; /* Should we do BIO_FLUSH? */ */ static int stat_flush_threads; /* number of softdep flushing threads */ static int stat_worklist_push; /* number of worklist cleanups */ +static int stat_delayed_inact; /* number of delayed inactivation cleanups */ static int stat_blk_limit_push; /* number of times block limit neared */ static int stat_ino_limit_push; /* number of times inode limit neared */ static int stat_blk_limit_hit; /* number of times block slowdown imposed */ @@ -1344,6 +1345,8 @@ SYSCTL_INT(_debug_softdep, OID_AUTO, flush_threads, CTLFLAG_RD, &stat_flush_threads, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, worklist_push, CTLFLAG_RW | CTLFLAG_STATS, &stat_worklist_push, 0,""); +SYSCTL_INT(_debug_softdep, OID_AUTO, delayed_inactivations, CTLFLAG_RD, + &stat_delayed_inact, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, blk_limit_push, CTLFLAG_RW | CTLFLAG_STATS, &stat_blk_limit_push, 0,""); SYSCTL_INT(_debug_softdep, OID_AUTO, ino_limit_push, @@ -13707,6 +13710,37 @@ softdep_slowdown(vp) return (1); } +static int +softdep_request_cleanup_filter(struct vnode *vp, void *arg __unused) +{ + return ((vp->v_iflag & VI_OWEINACT) != 0 && vp->v_usecount == 0 && + ((vp->v_vflag & VV_NOSYNC) != 0 || VTOI(vp)->i_effnlink == 0)); +} + +static void +softdep_request_cleanup_inactivate(struct mount *mp) +{ + struct vnode *vp, *mvp; + int error; + + MNT_VNODE_FOREACH_LAZY(vp, mp, mvp, softdep_request_cleanup_filter, + NULL) { + vholdl(vp); + vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK | LK_RETRY); + VI_LOCK(vp); + if (vp->v_data != NULL && vp->v_usecount == 0) { + while ((vp->v_iflag & VI_OWEINACT) != 0) { + error = vinactive(vp); + if (error != 0 && error != ERELOOKUP) + break; + } + atomic_add_int(&stat_delayed_inact, 1); + } + VOP_UNLOCK(vp); + vdropl(vp); + } +} + /* * Called by the allocation routines when they are about to fail * in the hope that we can free up the requested resource (inodes @@ -13819,6 +13853,33 @@ retry: stat_worklist_push += 1; FREE_LOCK(ump); } + + /* + * Check that there are vnodes pending inactivation. As they + * have been unlinked, inactivating them will free up their + * inodes. + */ + ACQUIRE_LOCK(ump); + if (resource == FLUSH_INODES_WAIT && + fs->fs_cstotal.cs_nifree <= needed && + fs->fs_pendinginodes <= needed) { + if ((ump->um_softdep->sd_flags & FLUSH_DI_ACTIVE) == 0) { + ump->um_softdep->sd_flags |= FLUSH_DI_ACTIVE; + FREE_LOCK(ump); + softdep_request_cleanup_inactivate(mp); + ACQUIRE_LOCK(ump); + ump->um_softdep->sd_flags &= ~FLUSH_DI_ACTIVE; + wakeup(&ump->um_softdep->sd_flags); + } else { + while ((ump->um_softdep->sd_flags & + FLUSH_DI_ACTIVE) != 0) { + msleep(&ump->um_softdep->sd_flags, + LOCK_PTR(ump), PVM, "ffsvina", hz); + } + } + } + FREE_LOCK(ump); + /* * If we still need resources and there are no more worklist * entries to process to obtain them, we have to start flushing diff --git a/sys/ufs/ffs/softdep.h b/sys/ufs/ffs/softdep.h index 868ada00f2dc..3493aadafc98 100644 --- a/sys/ufs/ffs/softdep.h +++ b/sys/ufs/ffs/softdep.h @@ -1086,6 +1086,8 @@ struct mount_softdeps { #define FLUSH_CLEANUP 0x0002 /* need to clear out softdep structures */ #define FLUSH_STARTING 0x0004 /* flush thread not yet started */ #define FLUSH_RC_ACTIVE 0x0008 /* a thread is flushing the mount point */ +#define FLUSH_DI_ACTIVE 0x0010 /* a thread is processing delayed + inactivations */ /* * Keep the old names from when these were in the ufsmount structure. From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:31 2021 Return-Path: Delivered-To: dev-commits-src-main@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 ED07A53D560; Fri, 12 Feb 2021 01:07:30 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhx4Dh8z3NPH; Fri, 12 Feb 2021 01:07:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E1BE1B288; Fri, 12 Feb 2021 01:07:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17Qat070846; Fri, 12 Feb 2021 01:07:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17QCS070845; Fri, 12 Feb 2021 01:07:26 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:26 GMT Message-Id: <202102120107.11C17QCS070845@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 2011b44fa3f2 - main - softdep_request_cleanup: wait for softdep_request_clean_flush() to pass MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2011b44fa3f2b2bd5a24be01094420cce9144b2d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:31 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2011b44fa3f2b2bd5a24be01094420cce9144b2d commit 2011b44fa3f2b2bd5a24be01094420cce9144b2d Author: Konstantin Belousov AuthorDate: 2021-02-03 23:58:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:22 +0000 softdep_request_cleanup: wait for softdep_request_clean_flush() to pass if we noted a parallel request is active and declined to overflow the system with parallel redundant sync of the vnodes. But we need to wait for the flush to finish to see if there are any freed resources. Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_softdep.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 8c3ae9dd95fc..8c52139687f9 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -13847,6 +13847,7 @@ retry: failed_vnode = softdep_request_cleanup_flush(mp, ump); ACQUIRE_LOCK(ump); ump->um_softdep->sd_flags &= ~FLUSH_RC_ACTIVE; + wakeup(&ump->um_softdep->sd_flags); FREE_LOCK(ump); if (ump->softdep_on_worklist > 0) { stat_cleanup_retries += 1; @@ -13854,6 +13855,11 @@ retry: goto retry; } } else { + while ((ump->um_softdep->sd_flags & + FLUSH_RC_ACTIVE) != 0) { + msleep(&ump->um_softdep->sd_flags, + LOCK_PTR(ump), PVM, "ffsrca", hz); + } FREE_LOCK(ump); error = 0; } From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:07:35 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A977F53D5CD; Fri, 12 Feb 2021 01:07:33 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcFhz6bngz3NRg; Fri, 12 Feb 2021 01:07:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6EB31B225; Fri, 12 Feb 2021 01:07:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C17TUV070908; Fri, 12 Feb 2021 01:07:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C17Tvv070907; Fri, 12 Feb 2021 01:07:29 GMT (envelope-from git) Date: Fri, 12 Feb 2021 01:07:29 GMT Message-Id: <202102120107.11C17Tvv070907@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: adf28ab45670 - main - fifo: minor comment and assert improvements. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: adf28ab45670329459aed8afeec2dbe91c9b3713 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:07:35 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=adf28ab45670329459aed8afeec2dbe91c9b3713 commit adf28ab45670329459aed8afeec2dbe91c9b3713 Author: Konstantin Belousov AuthorDate: 2021-02-01 10:43:16 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-12 01:02:22 +0000 fifo: minor comment and assert improvements. In particular, replace a note that reload through vget() is obsoleted, with explanation why this code is required. Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/kern/vfs_syscalls.c | 3 ++- sys/ufs/ufs/ufs_vnops.c | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index aba3d62936bb..a51d693446e3 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1183,7 +1183,8 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, * vnode operations here. */ if (fp->f_ops == &badfileops) { - KASSERT(vp->v_type != VFIFO, ("Unexpected fifo.")); + KASSERT(vp->v_type != VFIFO, + ("Unexpected fifo fp %p vp %p", fp, vp)); finit_vnode(fp, flags, NULL, &vnops); } diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index e6a78c3655cc..301c583291d1 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -252,9 +252,10 @@ ufs_mknod(ap) DIP_SET(ip, i_rdev, vap->va_rdev); } /* - * Remove inode, then reload it through VFS_VGET so it is - * checked to see if it is an alias of an existing entry in - * the inode cache. XXX I don't believe this is necessary now. + * Remove inode, then reload it through VFS_VGET(). This is + * needed to do further inode initialization, for instance + * fifo, which was too early for VFS_VGET() done as part of + * UFS_VALLOC(). */ (*vpp)->v_type = VNON; ino = ip->i_number; /* Save this before vgone() invalidates ip. */ From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:59:08 2021 Return-Path: Delivered-To: dev-commits-src-main@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 3ADEB53FAB8; Fri, 12 Feb 2021 01:59:08 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (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 4DcGrX0dnKz3l9M; Fri, 12 Feb 2021 01:59:07 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x42f.google.com with SMTP id v1so2604773wrd.6; Thu, 11 Feb 2021 17:59:07 -0800 (PST) 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=6fKf8kGpJLFUSm3yifAdgsuZiQ+lxAT36SNHIAGRm+M=; b=RrLDNw2NG+/D2UeiunXc7ZBGuXKr6lr4WUBJIEsPTL2oQk4hXmdHad716R6BI6gMCF n8BQbDz77GxI5alSVi9+d4u+7fqnwbH5EwRcXHWRFJzl/CuiHVxNIFLA7YC3ywH93CGB 0kfvQ6WcISZXct8qOQVPti+6eagVWMbGA/p+ogjYS/Ol0yFWKVuM0LofHBxKUg7aabsi DQc06FKGSic/G+h9TRsZB+YBXkyB0FdP7H/btjJVQS4TUt9khMK7SucCbW8fxQUgR0un w3TSwRpJZDOH2tMgh8mJxhwAyMZlb9bFNDFtrcYAPuykar4e1d2ty+/rQ1zSzyoJ6x3i DPDg== 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=6fKf8kGpJLFUSm3yifAdgsuZiQ+lxAT36SNHIAGRm+M=; b=VxWrtzJPqgpYn0t6Z5U+gxaNfCjw1ZLuXrtmMW8s582Ao2/i/7grb5jaICX/5haPQ0 1riQrQX8UNP9p9s7VwhNpg9IfkP3q9haKEAYXHKXEVEDgBoZ3uoN+0vXNCSvD+KqYwnX jNvktdtt4fYhQsd1ZS2BS14WmFNFkil/bY9ubf6PIqV+pyFG7x4NkJC3VwFKIuC/LfXT lcoKnz7cKJe/zpUPUNORKPbDXOlwoK9GeZzSL+OwIzEX7NTuonCDvH4yoKdLBZWGEBHC Ol9UnEKShu7l8ZC3bYeXRoynVp/bpicHdlUk33CxBHdpCxOn6emtm07RLaGw34hbiIzS cNrA== X-Gm-Message-State: AOAM531c8PefQHvA9d9zycwRJ6+7owgOpguPLQi4ZfSW8IYi+eICHzOP EfWC1jefd5WyVQ4e8Hny5GYv2oMZes93klG9YfD8iu448r4= X-Google-Smtp-Source: ABdhPJzaPDwIVaWIYVonwDv3W8BkQ5uJIrH/93FBcRWQ8sdUDOLNv8OV6NY1rgFS4dgMkS4yZj0louOzRGxMfsz4tGk= X-Received: by 2002:a5d:5248:: with SMTP id k8mr667807wrc.17.1613095146833; Thu, 11 Feb 2021 17:59:06 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Thu, 11 Feb 2021 17:59:05 -0800 (PST) In-Reply-To: <202102112310.11BNABTx015766@gitrepo.freebsd.org> References: <202102112310.11BNABTx015766@gitrepo.freebsd.org> From: Mateusz Guzik Date: Fri, 12 Feb 2021 02:59:05 +0100 Message-ID: Subject: Re: git: 145bf6c0af48 - main - Fix blackhole/reject routes. To: "Alexander V. Chernikov" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DcGrX0dnKz3l9M X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:59:08 -0000 This breaks building a kernel with INET6 for me, I presume it will also break LINT-NOINET On 2/12/21, Alexander V. Chernikov wrote: > The branch main has been updated by melifaro: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=145bf6c0af48b89f13465e145f4516de37c31d85 > > commit 145bf6c0af48b89f13465e145f4516de37c31d85 > Author: Alexander V. Chernikov > AuthorDate: 2021-02-08 23:29:05 +0000 > Commit: Alexander V. Chernikov > CommitDate: 2021-02-11 23:08:55 +0000 > > Fix blackhole/reject routes. > > Traditionally *BSD routing stack required to supply some > interface data for blackhole/reject routes. This lead to > varieties of hacks in routing daemons when inserting such routes. > With the recent routeing stack changes, gateway sockaddr without > RTF_GATEWAY started to be treated differently, purely as link > identifier. > > This change broke net/bird, which installs blackhole routes with > 127.0.0.1 gateway without RTF_GATEWAY flags. > > Fix this by automatically constructing necessary gateway data at > rtsock level if RTF_REJECT/RTF_BLACKHOLE is set. > > Reported by: Marek Zarychta > Reviewed by: donner > MFC after: 1 week > --- > sys/net/rtsock.c | 58 > ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 56 insertions(+), 2 deletions(-) > > diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c > index ba1182d55439..f67252f9fd5f 100644 > --- a/sys/net/rtsock.c > +++ b/sys/net/rtsock.c > @@ -562,6 +562,50 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet > *ifp, > return (0); > } > > +static int > +fill_blackholeinfo(struct rt_addrinfo *info, union sockaddr_union *saun) > +{ > + struct ifaddr *ifa; > + sa_family_t saf; > + > + if (V_loif == NULL) { > + printf("Unable to add blackhole/reject nhop without loopback"); > + return (ENOTSUP); > + } > + info->rti_ifp = V_loif; > + > + saf = info->rti_info[RTAX_DST]->sa_family; > + > + CK_STAILQ_FOREACH(ifa, &info->rti_ifp->if_addrhead, ifa_link) { > + if (ifa->ifa_addr->sa_family == saf) { > + info->rti_ifa = ifa; > + break; > + } > + } > + if (info->rti_ifa == NULL) > + return (ENOTSUP); > + > + bzero(saun, sizeof(union sockaddr_union)); > + switch (saf) { > + case AF_INET: > + saun->sin.sin_family = AF_INET; > + saun->sin.sin_len = sizeof(struct sockaddr_in); > + saun->sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); > + break; > + case AF_INET6: > + saun->sin6.sin6_family = AF_INET6; > + saun->sin6.sin6_len = sizeof(struct sockaddr_in6); > + saun->sin6.sin6_addr = in6addr_loopback; > + break; > + default: > + return (ENOTSUP); > + } > + info->rti_info[RTAX_GATEWAY] = &saun->sa; > + info->rti_flags |= RTF_GATEWAY; > + > + return (0); > +} > + > /* > * Fills in @info based on userland-provided @rtm message. > * > @@ -944,7 +988,6 @@ route_output(struct mbuf *m, struct socket *so, ...) > #endif > int alloc_len = 0, len, error = 0, fibnum; > sa_family_t saf = AF_UNSPEC; > - struct walkarg w; > struct rib_cmd_info rc; > struct nhop_object *nh; > > @@ -972,7 +1015,6 @@ route_output(struct mbuf *m, struct socket *so, ...) > > m_copydata(m, 0, len, (caddr_t)rtm); > bzero(&info, sizeof(info)); > - bzero(&w, sizeof(w)); > nh = NULL; > > if (rtm->rtm_version != RTM_VERSION) { > @@ -1004,6 +1046,18 @@ route_output(struct mbuf *m, struct socket *so, ...) > goto flush; > } > > + union sockaddr_union gw_saun; > + int blackhole_flags = rtm->rtm_flags & (RTF_BLACKHOLE|RTF_REJECT); > + if (blackhole_flags != 0) { > + if (blackhole_flags != (RTF_BLACKHOLE | RTF_REJECT)) > + error = fill_blackholeinfo(&info, &gw_saun); > + else > + error = EINVAL; > + if (error != 0) > + senderr(error); > + /* TODO: rebuild rtm from scratch */ > + } > + > switch (rtm->rtm_type) { > case RTM_ADD: > case RTM_CHANGE: > _______________________________________________ > dev-commits-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all > To unsubscribe, send any mail to > "dev-commits-src-all-unsubscribe@freebsd.org" > -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Fri Feb 12 01:59:24 2021 Return-Path: Delivered-To: dev-commits-src-main@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 038B653FAC8; Fri, 12 Feb 2021 01:59:24 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 4DcGrq2LNSz3lB2; Fri, 12 Feb 2021 01:59:23 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x436.google.com with SMTP id v7so1079471wrr.12; Thu, 11 Feb 2021 17:59:23 -0800 (PST) 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=uSzwg90hnmdxnonbGODrdrXO+KD4NKXw7aqH3/LLiow=; b=GAMwETH/xtHn8vtkppDnW3Q7CU/RJl1MzTgJ+NzUBAaZRLQ8X9bW0zhnplPLotZv7z 8rEatau/Ha+ryC1QjtH1iqOFvp9YFRHlHZg48+P2D9KG2dUf8TTYzzWCpeQGPqTiHuRN edT8OKpn25XRwDZzIO8gYDp+YgfxSxXx8kKX7WtrnJgb6jJCc4Z5WjFFxswnzvsugDPR nh/1iFNPK+UzfNOOEF4qJmbyJ1Qbdwbi4mMVLz/I/J7K2Fm93xrMosIdjmgTShTg6dm2 UxyvSo3Hv2KAJjYuqf6865KzJraDwCXO1TRSOwNkixFWOC+TKkPj0rnNJFBOkibvkWmz e/rA== 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=uSzwg90hnmdxnonbGODrdrXO+KD4NKXw7aqH3/LLiow=; b=WgrRabVZKrB76uYumGBG+LKlse6G/vywPPQzL0Nft4mt0Mk8TcPwXw4kFLj9JIToLZ H1cEQvoYMS2z/D/Lb1caBzSH+YQvJcodxFFmMRC3MLLbXUeaqSuvzJoeWBnlH1JNx9Za ir+gCRv/M6helu/gkzLXB8YEp7VvqRJnA/wjsHbSvd+oDrP8QbASgbhds54QC8pMHhSL 96DmMGqurCEBwN1pfNBpZkCaUPa+Bul/UJ/fWlBHZHqCkrMYQtvIdofYpFikL3A9ijiw YvVOmsjgQSz0cngi7s2CQu8cReVOGNVzigQ2c540aPLlz91JLqptcUySSbQyxjEc//Ev aBdw== X-Gm-Message-State: AOAM532xVGg7r2EuVW1xxDcv5eB2Nf+37ohW/85nsayRr3YnMJU5FRsi mSAoOuN2TGg1ZWL6u390Lun5Purrf91LIQGVOswUMGF6VfA= X-Google-Smtp-Source: ABdhPJxwqW36OwyBgKxj7qs8a9gEO1Yhf/1PloifYsWl7W+lu7BHSkghkz118nAJZ1/CRr5elIy5gs4QRvqLqvGYtow= X-Received: by 2002:a05:6000:186f:: with SMTP id d15mr650024wri.237.1613095160559; Thu, 11 Feb 2021 17:59:20 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Thu, 11 Feb 2021 17:59:19 -0800 (PST) In-Reply-To: References: <202102112310.11BNABTx015766@gitrepo.freebsd.org> From: Mateusz Guzik Date: Fri, 12 Feb 2021 02:59:19 +0100 Message-ID: Subject: Re: git: 145bf6c0af48 - main - Fix blackhole/reject routes. To: "Alexander V. Chernikov" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DcGrq2LNSz3lB2 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=GAMwETH/; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::436 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.89 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.89)[-0.887]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::436:from]; TO_DN_SOME(0.00)[]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::436:from:127.0.2.255]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::436:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 01:59:24 -0000 I mean *without* INET6 On 2/12/21, Mateusz Guzik wrote: > This breaks building a kernel with INET6 for me, I presume it will > also break LINT-NOINET > > On 2/12/21, Alexander V. Chernikov wrote: >> The branch main has been updated by melifaro: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=145bf6c0af48b89f13465e145f4516de37c31d85 >> >> commit 145bf6c0af48b89f13465e145f4516de37c31d85 >> Author: Alexander V. Chernikov >> AuthorDate: 2021-02-08 23:29:05 +0000 >> Commit: Alexander V. Chernikov >> CommitDate: 2021-02-11 23:08:55 +0000 >> >> Fix blackhole/reject routes. >> >> Traditionally *BSD routing stack required to supply some >> interface data for blackhole/reject routes. This lead to >> varieties of hacks in routing daemons when inserting such routes. >> With the recent routeing stack changes, gateway sockaddr without >> RTF_GATEWAY started to be treated differently, purely as link >> identifier. >> >> This change broke net/bird, which installs blackhole routes with >> 127.0.0.1 gateway without RTF_GATEWAY flags. >> >> Fix this by automatically constructing necessary gateway data at >> rtsock level if RTF_REJECT/RTF_BLACKHOLE is set. >> >> Reported by: Marek Zarychta >> Reviewed by: donner >> MFC after: 1 week >> --- >> sys/net/rtsock.c | 58 >> ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- >> 1 file changed, 56 insertions(+), 2 deletions(-) >> >> diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c >> index ba1182d55439..f67252f9fd5f 100644 >> --- a/sys/net/rtsock.c >> +++ b/sys/net/rtsock.c >> @@ -562,6 +562,50 @@ rtm_get_jailed(struct rt_addrinfo *info, struct >> ifnet >> *ifp, >> return (0); >> } >> >> +static int >> +fill_blackholeinfo(struct rt_addrinfo *info, union sockaddr_union *saun) >> +{ >> + struct ifaddr *ifa; >> + sa_family_t saf; >> + >> + if (V_loif == NULL) { >> + printf("Unable to add blackhole/reject nhop without loopback"); >> + return (ENOTSUP); >> + } >> + info->rti_ifp = V_loif; >> + >> + saf = info->rti_info[RTAX_DST]->sa_family; >> + >> + CK_STAILQ_FOREACH(ifa, &info->rti_ifp->if_addrhead, ifa_link) { >> + if (ifa->ifa_addr->sa_family == saf) { >> + info->rti_ifa = ifa; >> + break; >> + } >> + } >> + if (info->rti_ifa == NULL) >> + return (ENOTSUP); >> + >> + bzero(saun, sizeof(union sockaddr_union)); >> + switch (saf) { >> + case AF_INET: >> + saun->sin.sin_family = AF_INET; >> + saun->sin.sin_len = sizeof(struct sockaddr_in); >> + saun->sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); >> + break; >> + case AF_INET6: >> + saun->sin6.sin6_family = AF_INET6; >> + saun->sin6.sin6_len = sizeof(struct sockaddr_in6); >> + saun->sin6.sin6_addr = in6addr_loopback; >> + break; >> + default: >> + return (ENOTSUP); >> + } >> + info->rti_info[RTAX_GATEWAY] = &saun->sa; >> + info->rti_flags |= RTF_GATEWAY; >> + >> + return (0); >> +} >> + >> /* >> * Fills in @info based on userland-provided @rtm message. >> * >> @@ -944,7 +988,6 @@ route_output(struct mbuf *m, struct socket *so, ...) >> #endif >> int alloc_len = 0, len, error = 0, fibnum; >> sa_family_t saf = AF_UNSPEC; >> - struct walkarg w; >> struct rib_cmd_info rc; >> struct nhop_object *nh; >> >> @@ -972,7 +1015,6 @@ route_output(struct mbuf *m, struct socket *so, ...) >> >> m_copydata(m, 0, len, (caddr_t)rtm); >> bzero(&info, sizeof(info)); >> - bzero(&w, sizeof(w)); >> nh = NULL; >> >> if (rtm->rtm_version != RTM_VERSION) { >> @@ -1004,6 +1046,18 @@ route_output(struct mbuf *m, struct socket *so, >> ...) >> goto flush; >> } >> >> + union sockaddr_union gw_saun; >> + int blackhole_flags = rtm->rtm_flags & (RTF_BLACKHOLE|RTF_REJECT); >> + if (blackhole_flags != 0) { >> + if (blackhole_flags != (RTF_BLACKHOLE | RTF_REJECT)) >> + error = fill_blackholeinfo(&info, &gw_saun); >> + else >> + error = EINVAL; >> + if (error != 0) >> + senderr(error); >> + /* TODO: rebuild rtm from scratch */ >> + } >> + >> switch (rtm->rtm_type) { >> case RTM_ADD: >> case RTM_CHANGE: >> _______________________________________________ >> dev-commits-src-all@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all >> To unsubscribe, send any mail to >> "dev-commits-src-all-unsubscribe@freebsd.org" >> > > > -- > Mateusz Guzik > -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Fri Feb 12 02:37:49 2021 Return-Path: Delivered-To: dev-commits-src-main@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 A36BC5403E6; Fri, 12 Feb 2021 02:37:49 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcHj93xzKz3mqN; Fri, 12 Feb 2021 02:37:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A86B1C44F; Fri, 12 Feb 2021 02:37:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C2bn4S088186; Fri, 12 Feb 2021 02:37:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C2bnwV088185; Fri, 12 Feb 2021 02:37:49 GMT (envelope-from git) Date: Fri, 12 Feb 2021 02:37:49 GMT Message-Id: <202102120237.11C2bnwV088185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 154adbbeb8fc - main - ssh: diff reduction against OpenBSD, remove unused includes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 154adbbeb8fc2a0d183ec3a4db32cd13668205e8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 02:37:49 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=154adbbeb8fc2a0d183ec3a4db32cd13668205e8 commit 154adbbeb8fc2a0d183ec3a4db32cd13668205e8 Author: Ed Maste AuthorDate: 2021-02-12 01:41:02 +0000 Commit: Ed Maste CommitDate: 2021-02-12 02:37:31 +0000 ssh: diff reduction against OpenBSD, remove unused includes These appear to be leftovers from ca86bcf2531c7 and f7167e0ea0bf5 MFC after: 3 days Sponsored by: The FreeBSD Foundation --- crypto/openssh/misc.c | 1 - crypto/openssh/sshconnect.c | 1 - 2 files changed, 2 deletions(-) diff --git a/crypto/openssh/misc.c b/crypto/openssh/misc.c index 662d6bf48716..bdc06fdb3332 100644 --- a/crypto/openssh/misc.c +++ b/crypto/openssh/misc.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/crypto/openssh/sshconnect.c b/crypto/openssh/sshconnect.c index 2776be920a2c..b50029de71b8 100644 --- a/crypto/openssh/sshconnect.c +++ b/crypto/openssh/sshconnect.c @@ -27,7 +27,6 @@ __RCSID("$FreeBSD$"); #include #include #include -#include #include #include From owner-dev-commits-src-main@freebsd.org Fri Feb 12 03:26:06 2021 Return-Path: Delivered-To: dev-commits-src-main@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 145E85418E1; Fri, 12 Feb 2021 03:26:06 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcJmt03DBz3q80; Fri, 12 Feb 2021 03:26:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8B1F1CF92; Fri, 12 Feb 2021 03:26:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C3Q52o053840; Fri, 12 Feb 2021 03:26:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C3Q5Lx053839; Fri, 12 Feb 2021 03:26:05 GMT (envelope-from git) Date: Fri, 12 Feb 2021 03:26:05 GMT Message-Id: <202102120326.11C3Q5Lx053839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 9e14b918f956 - main - ssh: remove unused variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e14b918f956c532d0b81c945160bd9bc85c5604 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 03:26:06 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9e14b918f956c532d0b81c945160bd9bc85c5604 commit 9e14b918f956c532d0b81c945160bd9bc85c5604 Author: Ed Maste AuthorDate: 2021-02-12 03:21:40 +0000 Commit: Ed Maste CommitDate: 2021-02-12 03:22:30 +0000 ssh: remove unused variable This was introduced in 03f6c5cd93ec, which added use of sysctl net.inet.ip.portrange.reservedhigh instead of IPPORT_RESERVED, but it appears the rest of that change was lost in some subsequent update. The change should probably be restored, but until then there is no reason to leave an unused variable around. MFC after: 3 days Sponsored by: The FreeBSD Foundation --- crypto/openssh/readconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/openssh/readconf.c b/crypto/openssh/readconf.c index 434da47ce9e2..75fbd4ca222f 100644 --- a/crypto/openssh/readconf.c +++ b/crypto/openssh/readconf.c @@ -336,7 +336,7 @@ void add_local_forward(Options *options, const struct Forward *newfwd) { struct Forward *fwd; - int i, ipport_reserved; + int i; /* Don't add duplicates */ for (i = 0; i < options->num_local_forwards; i++) { From owner-dev-commits-src-main@freebsd.org Fri Feb 12 05:35:19 2021 Return-Path: Delivered-To: dev-commits-src-main@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 88AF9544835; Fri, 12 Feb 2021 05:35:19 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcMdz3T46z4RsC; Fri, 12 Feb 2021 05:35:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A1501E769; Fri, 12 Feb 2021 05:35:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11C5ZJhv023940; Fri, 12 Feb 2021 05:35:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11C5ZJbN023939; Fri, 12 Feb 2021 05:35:19 GMT (envelope-from git) Date: Fri, 12 Feb 2021 05:35:19 GMT Message-Id: <202102120535.11C5ZJbN023939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 8563de2f2799 - main - Fix bug 253158 - Panic: snapacct_ufs2: bad block - mksnap_ffs(8) crash MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8563de2f2799b2cb6f2f06e3c9dddd48dca2a986 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 05:35:19 -0000 The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=8563de2f2799b2cb6f2f06e3c9dddd48dca2a986 commit 8563de2f2799b2cb6f2f06e3c9dddd48dca2a986 Author: Kirk McKusick AuthorDate: 2021-02-12 05:31:16 +0000 Commit: Kirk McKusick CommitDate: 2021-02-12 05:31:16 +0000 Fix bug 253158 - Panic: snapacct_ufs2: bad block - mksnap_ffs(8) crash The panic reported in 253158 arises because the /mnt/.snap/.factory snapshot allocated the last block in the filesystem. The snapshot code allocates the last block in the filesystem as a way of setting its length to be the size of the filesystem. Part of taking a snapshot is to remove all the earlier snapshots from the image of the newest snapshot so that newer snapshots will not claim the blocks of the earlier snapshots. The panic occurs when the new snapshot finds that both it and an earlier snapshot claim the same block. The fix is to set the size of the snapshot to be one block after the last block in the filesystem. This block can never be allocated since it is not a valid block in the filesystem. This extra block is used as a place to store the initial list of blocks that the snapshot has already copied and is used to avoid a deadlock in and speed up the ffs_copyonwrite() function. Reported by: Harald Schmalzbauer Tested by: Peter Holm PR: 253158 Sponsored by: Netflix --- sys/ufs/ffs/ffs_snapshot.c | 137 +++++++++++++++++++++++---------------------- 1 file changed, 70 insertions(+), 67 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 72c8061917d8..8f0adde6f5e4 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -316,21 +316,20 @@ restart: ip = VTOI(vp); devvp = ITODEVVP(ip); /* - * Allocate and copy the last block contents so as to be able - * to set size to that of the filesystem. + * Calculate the size of the filesystem then allocate the block + * immediately following the last block of the filesystem that + * will contain the snapshot list. This operation allows us to + * set the size of the snapshot. */ numblks = howmany(fs->fs_size, fs->fs_frag); - error = UFS_BALLOC(vp, lblktosize(fs, (off_t)(numblks - 1)), + error = UFS_BALLOC(vp, lblktosize(fs, (off_t)numblks), fs->fs_bsize, KERNCRED, BA_CLRBUF, &bp); if (error) goto out; - ip->i_size = lblktosize(fs, (off_t)numblks); + bawrite(bp); + ip->i_size = lblktosize(fs, (off_t)(numblks + 1)); DIP_SET(ip, i_size, ip->i_size); UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); - error = readblock(vp, bp, numblks - 1); - bawrite(bp); - if (error != 0) - goto out; /* * Preallocate critical data structures so that we can copy * them in without further allocation after we suspend all @@ -452,23 +451,13 @@ restart: vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (ip->i_effnlink == 0) { error = ENOENT; /* Snapshot file unlinked */ - goto out1; + goto resumefs; } #ifdef DIAGNOSTIC if (collectsnapstats) nanotime(&starttime); #endif - /* The last block might have changed. Copy it again to be sure. */ - error = UFS_BALLOC(vp, lblktosize(fs, (off_t)(numblks - 1)), - fs->fs_bsize, KERNCRED, BA_CLRBUF, &bp); - if (error != 0) - goto out1; - error = readblock(vp, bp, numblks - 1); - bp->b_flags |= B_VALIDSUSPWRT; - bawrite(bp); - if (error != 0) - goto out1; /* * First, copy all the cylinder group maps that have changed. */ @@ -479,11 +468,11 @@ restart: error = UFS_BALLOC(vp, lfragtosize(fs, cgtod(fs, cg)), fs->fs_bsize, KERNCRED, 0, &nbp); if (error) - goto out1; + goto resumefs; error = cgaccount(cg, vp, nbp, 2); bawrite(nbp); if (error) - goto out1; + goto resumefs; } /* * Grab a copy of the superblock and its summary information. @@ -513,11 +502,7 @@ restart: if ((error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + loc), len, KERNCRED, &bp)) != 0) { brelse(bp); - free(copy_fs->fs_csp, M_UFSMNT); - free(copy_fs->fs_si, M_UFSMNT); - free(copy_fs, M_UFSMNT); - copy_fs = NULL; - goto out1; + goto resumefs; } bcopy(bp->b_data, space, (u_int)len); space = (char *)space + len; @@ -539,10 +524,27 @@ restart: * Note that we skip unlinked snapshot files as they will * be handled separately below. * - * We also calculate the needed size for the snapshot list. + * We also calculate the size needed for the snapshot list. + * Initial number of entries is composed of: + * - one for each cylinder group map + * - one for each block used by superblock summary table + * - one for each snapshot inode block + * - one for the superblock + * - one for the snapshot list + * The direct block entries in the snapshot are always + * copied (see reason below). Note that the superblock and + * the first cylinder group will almost always be allocated + * in the direct blocks, but we add the slop for them in case + * they do not end up there. The snapshot list size may get + * expanded by one because of an update of an inode block for + * an unlinked but still open file when it is expunged. + * + * Because the direct block pointers are always copied, they + * are not added to the list. Instead ffs_copyonwrite() + * explicitly checks for them before checking the snapshot list. */ snaplistsize = fs->fs_ncg + howmany(fs->fs_cssize, fs->fs_bsize) + - FSMAXSNAP + 1 /* superblock */ + 1 /* last block */ + 1 /* size */; + FSMAXSNAP + /* superblock */ 1 + /* snaplist */ 1; MNT_ILOCK(mp); mp->mnt_kern_flag &= ~MNTK_SUSPENDED; MNT_IUNLOCK(mp); @@ -624,12 +626,8 @@ loop: VOP_UNLOCK(xvp); vdrop(xvp); if (error) { - free(copy_fs->fs_csp, M_UFSMNT); - free(copy_fs->fs_si, M_UFSMNT); - free(copy_fs, M_UFSMNT); - copy_fs = NULL; MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); - goto out1; + goto resumefs; } } /* @@ -637,13 +635,8 @@ loop: */ if (fs->fs_flags & FS_SUJ) { error = softdep_journal_lookup(mp, &xvp); - if (error) { - free(copy_fs->fs_csp, M_UFSMNT); - free(copy_fs->fs_si, M_UFSMNT); - free(copy_fs, M_UFSMNT); - copy_fs = NULL; - goto out1; - } + if (error) + goto resumefs; xp = VTOI(xvp); if (I_IS_UFS1(xp)) error = expunge_ufs1(vp, xp, copy_fs, fullacct_ufs1, @@ -694,6 +687,27 @@ loop: sn->sn_listsize = blkp - snapblklist; VI_UNLOCK(devvp); } + /* + * Preallocate all the direct blocks in the snapshot inode so + * that we never have to write the inode itself to commit an + * update to the contents of the snapshot. Note that once + * created, the size of the snapshot will never change, so + * there will never be a need to write the inode except to + * update the non-integrity-critical time fields and + * allocated-block count. + */ + for (blockno = 0; blockno < UFS_NDADDR; blockno++) { + if (DIP(ip, i_db[blockno]) != 0) + continue; + error = UFS_BALLOC(vp, lblktosize(fs, blockno), + fs->fs_bsize, KERNCRED, BA_CLRBUF, &bp); + if (error) + goto resumefs; + error = readblock(vp, bp, blockno); + bawrite(bp); + if (error != 0) + goto resumefs; + } /* * Record snapshot inode. Since this is the newest snapshot, * it must be placed at the end of the list. @@ -706,11 +720,16 @@ loop: TAILQ_INSERT_TAIL(&sn->sn_head, ip, i_nextsnap); devvp->v_vflag |= VV_COPYONWRITE; VI_UNLOCK(devvp); +resumefs: ASSERT_VOP_LOCKED(vp, "ffs_snapshot vp"); -out1: - KASSERT((sn != NULL && copy_fs != NULL && error == 0) || - (sn == NULL && copy_fs == NULL && error != 0), - ("email phk@ and mckusick@")); + if (error != 0 && copy_fs != NULL) { + free(copy_fs->fs_csp, M_UFSMNT); + free(copy_fs->fs_si, M_UFSMNT); + free(copy_fs, M_UFSMNT); + copy_fs = NULL; + } + KASSERT(error != 0 || (sn != NULL && copy_fs != NULL), + ("missing snapshot setup parameters")); /* * Resume operation on filesystem. */ @@ -786,7 +805,7 @@ out1: aiov.iov_base = (void *)snapblklist; aiov.iov_len = snaplistsize * sizeof(daddr_t); auio.uio_resid = aiov.iov_len; - auio.uio_offset = ip->i_size; + auio.uio_offset = lblktosize(fs, (off_t)numblks); auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_WRITE; auio.uio_td = td; @@ -835,27 +854,6 @@ out1: VI_UNLOCK(devvp); if (space != NULL) free(space, M_UFSMNT); - /* - * Preallocate all the direct blocks in the snapshot inode so - * that we never have to write the inode itself to commit an - * update to the contents of the snapshot. Note that once - * created, the size of the snapshot will never change, so - * there will never be a need to write the inode except to - * update the non-integrity-critical time fields and - * allocated-block count. - */ - for (blockno = 0; blockno < UFS_NDADDR; blockno++) { - if (DIP(ip, i_db[blockno]) != 0) - continue; - error = UFS_BALLOC(vp, lblktosize(fs, blockno), - fs->fs_bsize, KERNCRED, BA_CLRBUF, &bp); - if (error) - break; - error = readblock(vp, bp, blockno); - bawrite(bp); - if (error != 0) - break; - } done: free(copy_fs->fs_csp, M_UFSMNT); free(copy_fs->fs_si, M_UFSMNT); @@ -1573,7 +1571,8 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expungetype) blkno = *oldblkp; if (blkno == 0 || blkno == BLK_NOCOPY) continue; - if (acctit && expungetype == BLK_SNAP && blkno != BLK_SNAP) + if (acctit && expungetype == BLK_SNAP && blkno != BLK_SNAP && + lblkno >= UFS_NDADDR) *ip->i_snapblklist++ = lblkno; if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); @@ -2320,6 +2319,10 @@ ffs_copyonwrite(devvp, bp) ip = TAILQ_FIRST(&sn->sn_head); fs = ITOFS(ip); lbn = fragstoblks(fs, dbtofsb(fs, bp->b_blkno)); + if (lbn < UFS_NDADDR) { + VI_UNLOCK(devvp); + return (0); /* Direct blocks are always copied */ + } snapblklist = sn->sn_blklist; upper = sn->sn_listsize - 1; lower = 1; From owner-dev-commits-src-main@freebsd.org Fri Feb 12 09:03:38 2021 Return-Path: Delivered-To: dev-commits-src-main@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 945C7548F8C; Fri, 12 Feb 2021 09:03:38 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (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 (2048 bits) client-digest SHA256) (Client CN "CN", Issuer "CN" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcSGL2Wnsz4d7D; Fri, 12 Feb 2021 09:03:37 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (mh0.gentlemail.de [IPv6:2a00:e10:2800:0:0:0:0:a135]) by mx0.gentlemail.de (8.15.2/8.15.2) with ESMTP id 11C93O3r070389; Fri, 12 Feb 2021 10:03:27 +0100 (CET) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id B150F7CC; Fri, 12 Feb 2021 10:03:24 +0100 (CET) Subject: Re: git: 8563de2f2799 - main - Fix bug 253158 - Panic: snapacct_ufs2: bad block - mksnap_ffs(8) crash To: Kirk McKusick , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202102120535.11C5ZJbN023939@gitrepo.freebsd.org> From: Harry Schmalzbauer Organization: OmniLAN Message-ID: <1a24720e-5710-2eee-5646-e557e59ef30e@omnilan.de> Date: Fri, 12 Feb 2021 10:03:18 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <202102120535.11C5ZJbN023939@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Greylist: inspected by milter-greylist-4.6.2 (mx0.gentlemail.de [IPv6:2a00:e10:2800:0:0:0:0:a130]); Fri, 12 Feb 2021 10:03:29 +0100 (CET) for IP:'2a00:e10:2800::a135' DOMAIN:'mh0.gentlemail.de' HELO:'mh0.gentlemail.de' FROM:'freebsd@omnilan.de' RCPT:'' X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx0.gentlemail.de [IPv6:2a00:e10:2800:0:0:0:0:a130]); Fri, 12 Feb 2021 10:03:29 +0100 (CET) X-Rspamd-Queue-Id: 4DcSGL2Wnsz4d7D X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 09:03:38 -0000 Am 12.02.2021 um 06:35 schrieb Kirk McKusick: > The branch main has been updated by mckusick: > > URL: https://cgit.FreeBSD.org/src/commit/?id=8563de2f2799b2cb6f2f06e3c9dddd48dca2a986 > > commit 8563de2f2799b2cb6f2f06e3c9dddd48dca2a986 > Author: Kirk McKusick > AuthorDate: 2021-02-12 05:31:16 +0000 > Commit: Kirk McKusick > CommitDate: 2021-02-12 05:31:16 +0000 > > Fix bug 253158 - Panic: snapacct_ufs2: bad block - mksnap_ffs(8) crash Please see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253158#c9 This introduces a "page fault while in kernel mode" for fstyp(8) in my environment, easy reproducable by /sbin/mksnap_ffs /.snap/.test2 /usr/sbin/fstyp /.snap/.test2 Thanks, -harry From owner-dev-commits-src-main@freebsd.org Fri Feb 12 12:09:30 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6ED5C54C712; Fri, 12 Feb 2021 12:09:30 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcXNp2mrDz4nRh; Fri, 12 Feb 2021 12:09:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 519F923576; Fri, 12 Feb 2021 12:09:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11CC9UHv035059; Fri, 12 Feb 2021 12:09:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11CC9UfQ035058; Fri, 12 Feb 2021 12:09:30 GMT (envelope-from git) Date: Fri, 12 Feb 2021 12:09:30 GMT Message-Id: <202102121209.11CC9UfQ035058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: a78fee818261 - main - Adding PRR sysctls to tcp(4) man page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a78fee8182614593992e841fbb0d4a958f70da0f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 12:09:30 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=a78fee8182614593992e841fbb0d4a958f70da0f commit a78fee8182614593992e841fbb0d4a958f70da0f Author: Richard Scheffenegger AuthorDate: 2021-02-12 11:32:48 +0000 Commit: Richard Scheffenegger CommitDate: 2021-02-12 11:33:27 +0000 Adding PRR sysctls to tcp(4) man page Summary: Documenting the newly added, and enabled by default, Proportional Rate Reduction algorithm's governing sysctls. MFC: 3 days Reviewed By: kbowling, rgrimes Differential Revision: https://reviews.freebsd.org/D28568 --- share/man/man4/tcp.4 | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index dee4040c0a98..431bcd95513b 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd January 14, 2021 +.Dd February 11, 2021 .Dt TCP 4 .Os .Sh NAME @@ -544,9 +544,22 @@ This gently reduces the congestion window during periods, where TCP is application limited and the network bandwidth is not utilized completely. That prevents self-inflicted packet losses once the application starts to transmit data at a higher speed. +.It Va do_prr +Perform SACK loss recovery using the Proportional Rate Reduction (PRR) algorithm +described in RFC6937. +This improves the effectiveness of retransmissions particular in environments +with ACK thinning or burst loss events, as chances to run out of the ACK clock +are reduced, preventing lengthy and performance reducing RTO based loss recovery +(default is true). +.It Va do_prr_conservative +While doing Proportional Rate Reduction, remain strictly in a packet conserving +mode, sending only one new packet for each ACK received. +Helpful when a misconfigured token bucket traffic policer causes persistent +high losses leading to RTO, but reduces PRR effectiveness in more common settings +(default is false). .It Va rfc6675_pipe Calculate the bytes in flight using the algorithm described in RFC 6675, and -is also a prerequisite to enable Proportional Rate Reduction. +is also an improvement when Proportional Rate Reduction is enabled. .It Va rfc3042 Enable the Limited Transmit algorithm as described in RFC 3042. It helps avoid timeouts on lossy links and also when the congestion window From owner-dev-commits-src-main@freebsd.org Fri Feb 12 15:11:31 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2FF5D54FA9A; Fri, 12 Feb 2021 15:11:31 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DccQq0x27z3F4y; Fri, 12 Feb 2021 15:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1349626010; Fri, 12 Feb 2021 15:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11CFBVs2078855; Fri, 12 Feb 2021 15:11:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11CFBVYK078854; Fri, 12 Feb 2021 15:11:31 GMT (envelope-from git) Date: Fri, 12 Feb 2021 15:11:31 GMT Message-Id: <202102121511.11CFBVYK078854@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: a62dc346f617 - main - ssh: remove ssh-hpn leftovers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a62dc346f6171ef1bd52bb8795eaf2d64394ac24 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 15:11:31 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a62dc346f6171ef1bd52bb8795eaf2d64394ac24 commit a62dc346f6171ef1bd52bb8795eaf2d64394ac24 Author: Ed Maste AuthorDate: 2021-02-12 14:09:00 +0000 Commit: Ed Maste CommitDate: 2021-02-12 15:11:06 +0000 ssh: remove ssh-hpn leftovers This was introduced in 8998619212f3a, and left behind when the hpn-ssh patches were removed in 60c59fad8806. Although Being able to log SO_RCVBUF in debug mode might have some small value on its own, it's not worth carrying an extra diff against upstream. Reviewed by: kevans MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28610 --- crypto/openssh/sshd.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index 06fa7b8de339..532e5dc04fc2 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -1056,8 +1056,6 @@ listen_on_addrs(struct listenaddr *la) int ret, listen_sock; struct addrinfo *ai; char ntop[NI_MAXHOST], strport[NI_MAXSERV]; - int socksize; - socklen_t len; for (ai = la->addrs; ai; ai = ai->ai_next) { if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) @@ -1103,10 +1101,6 @@ listen_on_addrs(struct listenaddr *la) debug("Bind to port %s on %s.", strport, ntop); - len = sizeof(socksize); - getsockopt(listen_sock, SOL_SOCKET, SO_RCVBUF, &socksize, &len); - debug("Server TCP RWIN socket size: %d", socksize); - /* Bind the socket to the desired port. */ if (bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) { error("Bind to port %s on %s failed: %.200s.", From owner-dev-commits-src-main@freebsd.org Fri Feb 12 17:16:29 2021 Return-Path: Delivered-To: dev-commits-src-main@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 15B5152A625; Fri, 12 Feb 2021 17:16:29 +0000 (UTC) (envelope-from bdragon@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcgC06mFfz3N9G; Fri, 12 Feb 2021 17:16:28 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com [66.111.4.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id D4E294781; Fri, 12 Feb 2021 17:16:28 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id A8DC927C005B; Fri, 12 Feb 2021 12:16:28 -0500 (EST) Received: from imap38 ([10.202.2.88]) by compute3.internal (MEProxy); Fri, 12 Feb 2021 12:16:28 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledriedugddutdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdluddtmdenucfjughrpefofgggkfgjfhffhffvufgtsehttdertder redtnecuhfhrohhmpedfuehrrghnughonhcuuegvrhhgrhgvnhdfuceosggurhgrghhonh eshfhrvggvuefuffdrohhrgheqnecuggftrfgrthhtvghrnhepgffgheetheeutedtgefh gedvfedvtdeitddtiefhledvteeuvddvvdefvefftdehnecuffhomhgrihhnpehfrhgvvg gsshgurdhorhhgpdhpfihsthgvrdgvughurdhplhenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpegsughrrghgohhnodhmvghsmhhtphgruhhthh hpvghrshhonhgrlhhithihqddutdegvdefheekieegqddukedutdekheduqdgsughrrghg ohhnpeephfhrvggvuefuffdrohhrghesihhmrghprdgttg X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 49759CA005D; Fri, 12 Feb 2021 12:16:28 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-141-gf094924a34-fm-20210210.001-gf094924a Mime-Version: 1.0 Message-Id: <2a143d84-ee5e-48f6-99a9-366b3f0fdf40@www.fastmail.com> In-Reply-To: References: <202102112310.11BNABTx015766@gitrepo.freebsd.org> Date: Fri, 12 Feb 2021 11:16:07 -0600 From: "Brandon Bergren" To: "Mateusz Guzik" , "Alexander V. Chernikov" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 145bf6c0af48 - main - Fix blackhole/reject routes. Content-Type: text/plain X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 17:16:29 -0000 This actually directly breaks the mips and mips64 builds because the MALTA and MALTA64 kernels do not have INET6 enabled. On Thu, Feb 11, 2021, at 7:59 PM, Mateusz Guzik wrote: > I mean *without* INET6 > > On 2/12/21, Mateusz Guzik wrote: > > This breaks building a kernel with INET6 for me, I presume it will > > also break LINT-NOINET > > > > On 2/12/21, Alexander V. Chernikov wrote: > >> The branch main has been updated by melifaro: > >> > >> URL: > >> https://cgit.FreeBSD.org/src/commit/?id=145bf6c0af48b89f13465e145f4516de37c31d85 > >> > >> commit 145bf6c0af48b89f13465e145f4516de37c31d85 > >> Author: Alexander V. Chernikov > >> AuthorDate: 2021-02-08 23:29:05 +0000 > >> Commit: Alexander V. Chernikov > >> CommitDate: 2021-02-11 23:08:55 +0000 > >> > >> Fix blackhole/reject routes. > >> > >> Traditionally *BSD routing stack required to supply some > >> interface data for blackhole/reject routes. This lead to > >> varieties of hacks in routing daemons when inserting such routes. > >> With the recent routeing stack changes, gateway sockaddr without > >> RTF_GATEWAY started to be treated differently, purely as link > >> identifier. > >> > >> This change broke net/bird, which installs blackhole routes with > >> 127.0.0.1 gateway without RTF_GATEWAY flags. > >> > >> Fix this by automatically constructing necessary gateway data at > >> rtsock level if RTF_REJECT/RTF_BLACKHOLE is set. > >> > >> Reported by: Marek Zarychta > >> Reviewed by: donner > >> MFC after: 1 week > >> --- > >> sys/net/rtsock.c | 58 > >> ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- > >> 1 file changed, 56 insertions(+), 2 deletions(-) > >> > >> diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c > >> index ba1182d55439..f67252f9fd5f 100644 > >> --- a/sys/net/rtsock.c > >> +++ b/sys/net/rtsock.c > >> @@ -562,6 +562,50 @@ rtm_get_jailed(struct rt_addrinfo *info, struct > >> ifnet > >> *ifp, > >> return (0); > >> } > >> > >> +static int > >> +fill_blackholeinfo(struct rt_addrinfo *info, union sockaddr_union *saun) > >> +{ > >> + struct ifaddr *ifa; > >> + sa_family_t saf; > >> + > >> + if (V_loif == NULL) { > >> + printf("Unable to add blackhole/reject nhop without loopback"); > >> + return (ENOTSUP); > >> + } > >> + info->rti_ifp = V_loif; > >> + > >> + saf = info->rti_info[RTAX_DST]->sa_family; > >> + > >> + CK_STAILQ_FOREACH(ifa, &info->rti_ifp->if_addrhead, ifa_link) { > >> + if (ifa->ifa_addr->sa_family == saf) { > >> + info->rti_ifa = ifa; > >> + break; > >> + } > >> + } > >> + if (info->rti_ifa == NULL) > >> + return (ENOTSUP); > >> + > >> + bzero(saun, sizeof(union sockaddr_union)); > >> + switch (saf) { > >> + case AF_INET: > >> + saun->sin.sin_family = AF_INET; > >> + saun->sin.sin_len = sizeof(struct sockaddr_in); > >> + saun->sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); > >> + break; > >> + case AF_INET6: > >> + saun->sin6.sin6_family = AF_INET6; > >> + saun->sin6.sin6_len = sizeof(struct sockaddr_in6); > >> + saun->sin6.sin6_addr = in6addr_loopback; > >> + break; > >> + default: > >> + return (ENOTSUP); > >> + } > >> + info->rti_info[RTAX_GATEWAY] = &saun->sa; > >> + info->rti_flags |= RTF_GATEWAY; > >> + > >> + return (0); > >> +} > >> + > >> /* > >> * Fills in @info based on userland-provided @rtm message. > >> * > >> @@ -944,7 +988,6 @@ route_output(struct mbuf *m, struct socket *so, ...) > >> #endif > >> int alloc_len = 0, len, error = 0, fibnum; > >> sa_family_t saf = AF_UNSPEC; > >> - struct walkarg w; > >> struct rib_cmd_info rc; > >> struct nhop_object *nh; > >> > >> @@ -972,7 +1015,6 @@ route_output(struct mbuf *m, struct socket *so, ...) > >> > >> m_copydata(m, 0, len, (caddr_t)rtm); > >> bzero(&info, sizeof(info)); > >> - bzero(&w, sizeof(w)); > >> nh = NULL; > >> > >> if (rtm->rtm_version != RTM_VERSION) { > >> @@ -1004,6 +1046,18 @@ route_output(struct mbuf *m, struct socket *so, > >> ...) > >> goto flush; > >> } > >> > >> + union sockaddr_union gw_saun; > >> + int blackhole_flags = rtm->rtm_flags & (RTF_BLACKHOLE|RTF_REJECT); > >> + if (blackhole_flags != 0) { > >> + if (blackhole_flags != (RTF_BLACKHOLE | RTF_REJECT)) > >> + error = fill_blackholeinfo(&info, &gw_saun); > >> + else > >> + error = EINVAL; > >> + if (error != 0) > >> + senderr(error); > >> + /* TODO: rebuild rtm from scratch */ > >> + } > >> + > >> switch (rtm->rtm_type) { > >> case RTM_ADD: > >> case RTM_CHANGE: > >> _______________________________________________ > >> dev-commits-src-all@freebsd.org mailing list > >> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all > >> To unsubscribe, send any mail to > >> "dev-commits-src-all-unsubscribe@freebsd.org" > >> > > > > > > -- > > Mateusz Guzik > > > > > -- > Mateusz Guzik > -- Brandon Bergren bdragon@FreeBSD.org From owner-dev-commits-src-main@freebsd.org Fri Feb 12 18:54:07 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9F1EE52D02B; Fri, 12 Feb 2021 18:54:07 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcjMg44Nxz3lXZ; Fri, 12 Feb 2021 18:54:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E509D43; Fri, 12 Feb 2021 18:54:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11CIs7Ac071050; Fri, 12 Feb 2021 18:54:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11CIs7Qg071049; Fri, 12 Feb 2021 18:54:07 GMT (envelope-from git) Date: Fri, 12 Feb 2021 18:54:07 GMT Message-Id: <202102121854.11CIs7Qg071049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: f540cb27a237 - main - mount_nullfs: rename a local variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f540cb27a23719d88b7e5143be6e62f75dd25f08 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 18:54:07 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=f540cb27a23719d88b7e5143be6e62f75dd25f08 commit f540cb27a23719d88b7e5143be6e62f75dd25f08 Author: Alan Somers AuthorDate: 2021-02-12 18:30:52 +0000 Commit: Alan Somers CommitDate: 2021-02-12 18:30:52 +0000 mount_nullfs: rename a local variable The "source" variable was introduced in r26072, probably as the traditional counterpart to "target". But the "source"/"target" names suggest the opposite of their actual meaning. With ln, for example, the source is the real file and the target is the newly created link. In mount_nullfs the meaning is the opposite: the target is the existing file system and the source is the newly created mountpoint. Better to use "target"/"mountpoint" terminology, which matches the man page. MFC after: 6 weeks Sponsored by: Axcient --- sbin/mount_nullfs/mount_nullfs.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sbin/mount_nullfs/mount_nullfs.c b/sbin/mount_nullfs/mount_nullfs.c index 1fb44eb864af..77ec0991ea9b 100644 --- a/sbin/mount_nullfs/mount_nullfs.c +++ b/sbin/mount_nullfs/mount_nullfs.c @@ -66,7 +66,7 @@ main(int argc, char *argv[]) { struct iovec *iov; char *p, *val; - char source[MAXPATHLEN]; + char mountpoint[MAXPATHLEN]; char target[MAXPATHLEN]; char errmsg[255]; int ch, iovlen; @@ -97,21 +97,21 @@ main(int argc, char *argv[]) if (argc != 2) usage(); - /* resolve target and source with realpath(3) */ + /* resolve target and mountpoint with realpath(3) */ if (checkpath(argv[0], target) != 0) err(EX_USAGE, "%s", target); - if (checkpath(argv[1], source) != 0) - err(EX_USAGE, "%s", source); + if (checkpath(argv[1], mountpoint) != 0) + err(EX_USAGE, "%s", mountpoint); build_iovec(&iov, &iovlen, "fstype", nullfs, (size_t)-1); - build_iovec(&iov, &iovlen, "fspath", source, (size_t)-1); + build_iovec(&iov, &iovlen, "fspath", mountpoint, (size_t)-1); build_iovec(&iov, &iovlen, "target", target, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); if (nmount(iov, iovlen, 0) < 0) { if (errmsg[0] != 0) - err(1, "%s: %s", source, errmsg); + err(1, "%s: %s", mountpoint, errmsg); else - err(1, "%s", source); + err(1, "%s", mountpoint); } exit(0); } From owner-dev-commits-src-main@freebsd.org Fri Feb 12 19:36:57 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9933E52E2DA; Fri, 12 Feb 2021 19:36:57 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DckK53tKDz3pc7; Fri, 12 Feb 2021 19:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77E1C171F; Fri, 12 Feb 2021 19:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11CJav9t023818; Fri, 12 Feb 2021 19:36:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11CJavPG023817; Fri, 12 Feb 2021 19:36:57 GMT (envelope-from git) Date: Fri, 12 Feb 2021 19:36:57 GMT Message-Id: <202102121936.11CJavPG023817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 1253835121cb - main - inetd: fix unix sockaddr's length assignment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1253835121cb38fd93478849e32a4a4c13436fb2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 19:36:57 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=1253835121cb38fd93478849e32a4a4c13436fb2 commit 1253835121cb38fd93478849e32a4a4c13436fb2 Author: Kyle Evans AuthorDate: 2021-02-12 19:19:43 +0000 Commit: Kyle Evans CommitDate: 2021-02-12 19:36:38 +0000 inetd: fix unix sockaddr's length assignment unsz was always exactly '1' here due to an unfortunate mispositioning of closing parenthesis. While it's generally irrelevant because bind(2) is passed the (accurate) sep->se_ctrladdr_size instead, it's not very helpful for anything locally that wants to use it rather than assuming that sep->se_ctrladdr_size perfectly fits the end of sun_path. Just drop unsz entirely and use the result of SUN_LEN() for it. MFC-after: 3 days --- usr.sbin/inetd/inetd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index 7ba51c9af593..6c4e26fad5cd 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -1624,7 +1624,6 @@ getconfigent(void) int v6bind; #endif int i; - size_t unsz; #ifdef IPSEC policy = NULL; @@ -1852,16 +1851,16 @@ more: #define SUN_PATH_MAXSIZE sizeof(sep->se_ctrladdr_un.sun_path) memset(&sep->se_ctrladdr, 0, sizeof(sep->se_ctrladdr)); sep->se_ctrladdr_un.sun_family = sep->se_family; - if ((unsz = strlcpy(sep->se_ctrladdr_un.sun_path, - sep->se_service, SUN_PATH_MAXSIZE) >= SUN_PATH_MAXSIZE)) { + if (strlcpy(sep->se_ctrladdr_un.sun_path, sep->se_service, + SUN_PATH_MAXSIZE) >= SUN_PATH_MAXSIZE) { syslog(LOG_ERR, "domain socket pathname too long for service %s", sep->se_service); goto more; } - sep->se_ctrladdr_un.sun_len = unsz; #undef SUN_PATH_MAXSIZE - sep->se_ctrladdr_size = SUN_LEN(&sep->se_ctrladdr_un); + sep->se_ctrladdr_size = sep->se_ctrladdr_un.sun_len = + SUN_LEN(&sep->se_ctrladdr_un); } arg = sskip(&cp); if (!strncmp(arg, "wait", 4)) From owner-dev-commits-src-main@freebsd.org Fri Feb 12 19:45:48 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2DC5652E940; Fri, 12 Feb 2021 19:45:48 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DckWJ0t6Wz3qFK; Fri, 12 Feb 2021 19:45:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C6DE1A91; Fri, 12 Feb 2021 19:45:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11CJjlfj037180; Fri, 12 Feb 2021 19:45:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11CJjl5f037179; Fri, 12 Feb 2021 19:45:47 GMT (envelope-from git) Date: Fri, 12 Feb 2021 19:45:47 GMT Message-Id: <202102121945.11CJjl5f037179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 8170a7d43835 - main - Fix interface route addition with net/bird. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8170a7d43835047f9c1548a081eea45116473995 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 19:45:48 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=8170a7d43835047f9c1548a081eea45116473995 commit 8170a7d43835047f9c1548a081eea45116473995 Author: Alexander V. Chernikov AuthorDate: 2021-02-11 23:24:27 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-12 19:45:35 +0000 Fix interface route addition with net/bird. The case of adding interface route by specifying interface address as the gateway was missed during code refactoring. Re-add it back by copying non-AF_LINK gateway data when RTF_GATEWAY is not set. Reviewed by: donner MFC after: 3 days --- sys/net/route/nhop_ctl.c | 50 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/sys/net/route/nhop_ctl.c b/sys/net/route/nhop_ctl.c index 542380afd64b..7de553799fab 100644 --- a/sys/net/route/nhop_ctl.c +++ b/sys/net/route/nhop_ctl.c @@ -219,42 +219,44 @@ set_nhop_gw_from_info(struct nhop_object *nh, struct rt_addrinfo *info) gw = info->rti_info[RTAX_GATEWAY]; KASSERT(gw != NULL, ("gw is NULL")); - if (info->rti_flags & RTF_GATEWAY) { - if (gw->sa_len > sizeof(struct sockaddr_in6)) { - DPRINTF("nhop SA size too big: AF %d len %u", - gw->sa_family, gw->sa_len); - return (ENOMEM); - } - memcpy(&nh->gw_sa, gw, gw->sa_len); - } else { + if ((gw->sa_family == AF_LINK) && !(info->rti_flags & RTF_GATEWAY)) { /* - * Interface route. Currently the route.c code adds - * sa of type AF_LINK, which is 56 bytes long. The only - * meaningful data there is the interface index. It is used - * used is the IPv6 loopback output, where we need to preserve - * the original interface to maintain proper scoping. + * Interface route with interface specified by the interface + * index in sockadd_dl structure. It is used in the IPv6 loopback + * output code, where we need to preserve the original interface + * to maintain proper scoping. * Despite the fact that nexthop code stores original interface * in the separate field (nh_aifp, see below), write AF_LINK * compatible sa with shorter total length. */ - struct sockaddr_dl *sdl; - struct ifnet *ifp; - - /* Fetch and validate interface index */ - sdl = (struct sockaddr_dl *)gw; - if (sdl->sdl_family != AF_LINK) { - DPRINTF("unsupported AF: %d", sdl->sdl_family); - return (ENOTSUP); - } - ifp = ifnet_byindex(sdl->sdl_index); + struct sockaddr_dl *sdl = (struct sockaddr_dl *)gw; + struct ifnet *ifp = ifnet_byindex(sdl->sdl_index); if (ifp == NULL) { DPRINTF("invalid ifindex %d", sdl->sdl_index); return (EINVAL); } fill_sdl_from_ifp(&nh->gwl_sa, ifp); - } + } else { + /* + * Multiple options here: + * + * 1) RTF_GATEWAY with IPv4/IPv6 gateway data + * 2) Interface route with IPv4/IPv6 address of the + * matching interface. Some routing daemons do that + * instead of specifying ifindex in AF_LINK. + * + * In both cases, save the original nexthop to make the callers + * happy. + */ + if (gw->sa_len > sizeof(struct sockaddr_in6)) { + DPRINTF("nhop SA size too big: AF %d len %u", + gw->sa_family, gw->sa_len); + return (ENOMEM); + } + memcpy(&nh->gw_sa, gw, gw->sa_len); + } return (0); } From owner-dev-commits-src-main@freebsd.org Fri Feb 12 20:38:20 2021 Return-Path: Delivered-To: dev-commits-src-main@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 CF10E530257; Fri, 12 Feb 2021 20:38:20 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dclgw5LHzz3tRX; Fri, 12 Feb 2021 20:38:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5F3522CE; Fri, 12 Feb 2021 20:38:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11CKcKKm002802; Fri, 12 Feb 2021 20:38:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11CKcKmE002801; Fri, 12 Feb 2021 20:38:20 GMT (envelope-from git) Date: Fri, 12 Feb 2021 20:38:20 GMT Message-Id: <202102122038.11CKcKmE002801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 8ca99aecf749 - main - Fix various NOINET* builds broken by 145bf6c0af48. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ca99aecf749dd088310f81f3c5364a462f1e332 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 20:38:20 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=8ca99aecf749dd088310f81f3c5364a462f1e332 commit 8ca99aecf749dd088310f81f3c5364a462f1e332 Author: Alexander V. Chernikov AuthorDate: 2021-02-12 20:36:20 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-12 20:36:20 +0000 Fix various NOINET* builds broken by 145bf6c0af48. Reported by: mjg, bdragon --- sys/net/rtsock.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index f67252f9fd5f..f8e741d87a10 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -587,16 +587,20 @@ fill_blackholeinfo(struct rt_addrinfo *info, union sockaddr_union *saun) bzero(saun, sizeof(union sockaddr_union)); switch (saf) { +#ifdef INET case AF_INET: saun->sin.sin_family = AF_INET; saun->sin.sin_len = sizeof(struct sockaddr_in); saun->sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); break; +#endif +#ifdef INET6 case AF_INET6: saun->sin6.sin6_family = AF_INET6; saun->sin6.sin6_len = sizeof(struct sockaddr_in6); saun->sin6.sin6_addr = in6addr_loopback; break; +#endif default: return (ENOTSUP); } From owner-dev-commits-src-main@freebsd.org Fri Feb 12 20:58:27 2021 Return-Path: Delivered-To: dev-commits-src-main@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 62D31530F4C; Fri, 12 Feb 2021 20:58:27 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dcm771Y8hz3w6T; Fri, 12 Feb 2021 20:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 288012A09; Fri, 12 Feb 2021 20:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11CKwRNa028848; Fri, 12 Feb 2021 20:58:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11CKwRQO028847; Fri, 12 Feb 2021 20:58:27 GMT (envelope-from git) Date: Fri, 12 Feb 2021 20:58:27 GMT Message-Id: <202102122058.11CKwRQO028847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 62374dfa0f0d - main - git-arc: Use a separate message file MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62374dfa0f0dba4fcb4cb6106af3c2019b8447c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 20:58:27 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=62374dfa0f0dba4fcb4cb6106af3c2019b8447c7 commit 62374dfa0f0dba4fcb4cb6106af3c2019b8447c7 Author: Mark Johnston AuthorDate: 2021-02-12 20:58:17 +0000 Commit: Mark Johnston CommitDate: 2021-02-12 20:58:17 +0000 git-arc: Use a separate message file Rather than putting revision metadata in .git/arc/create-message, create a tmpfile and use that. Otherwise arc diff always prompts about it and in some cases complains because its standard input is piped. Reported by: imp Differential Revision: https://reviews.freebsd.org/D28614 --- tools/tools/git/git-arc.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index 3b85d851319f..e8c84ea672f7 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -217,7 +217,7 @@ commit2diff() create_one_review() { - local childphid commit dir doprompt msg parent parentphid reviewers + local childphid commit doprompt msg parent parentphid reviewers local subscribers commit=$1 @@ -232,10 +232,7 @@ create_one_review() git checkout -q $commit - dir=$(git rev-parse --git-dir)/arc - mkdir -p "$dir" - - msg=${dir}/create-message + msg=$(mktemp) git show -s --format='%B' $commit > $msg printf "\nTest Plan:\n" >> $msg printf "\nReviewers:\n" >> $msg @@ -244,7 +241,7 @@ create_one_review() printf "${subscribers}\n" >> $msg yes | env EDITOR=true \ - arc diff --never-apply-patches --create --allow-untracked $BROWSE HEAD~ + arc diff --message-file $msg --never-apply-patches --create --allow-untracked $BROWSE HEAD~ [ $? -eq 0 ] || err "could not create Phabricator diff" if [ -n "$parent" ]; then @@ -263,6 +260,7 @@ create_one_review() ]}' | arc call-conduit -- differential.revision.edit >&3 fi + rm -f $msg return 0 } From owner-dev-commits-src-main@freebsd.org Fri Feb 12 22:36:14 2021 Return-Path: Delivered-To: dev-commits-src-main@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 AF1DB533C8F; Fri, 12 Feb 2021 22:36:14 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcpHy4b1Rz4X1M; Fri, 12 Feb 2021 22:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9058C401E; Fri, 12 Feb 2021 22:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11CMaEYK059423; Fri, 12 Feb 2021 22:36:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11CMaEqQ059422; Fri, 12 Feb 2021 22:36:14 GMT (envelope-from git) Date: Fri, 12 Feb 2021 22:36:14 GMT Message-Id: <202102122236.11CMaEqQ059422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Daniel Ebdrup Jensen Subject: git: 30f78a063e0d - main - git-arc(1): Add manual page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: debdrup X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30f78a063e0d8d34e43c82837f8b2af7efef3770 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 22:36:14 -0000 The branch main has been updated by debdrup (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=30f78a063e0d8d34e43c82837f8b2af7efef3770 commit 30f78a063e0d8d34e43c82837f8b2af7efef3770 Author: Daniel Ebdrup Jensen AuthorDate: 2021-02-12 22:35:02 +0000 Commit: Daniel Ebdrup Jensen CommitDate: 2021-02-12 22:35:02 +0000 git-arc(1): Add manual page Add manual page based on the usage in the script with a few changes and hook it up to the build. Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D28519 --- tools/tools/git/Makefile | 1 + tools/tools/git/git-arc.1 | 202 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 203 insertions(+) diff --git a/tools/tools/git/Makefile b/tools/tools/git/Makefile index 228a41d65275..86c90b9fe77d 100644 --- a/tools/tools/git/Makefile +++ b/tools/tools/git/Makefile @@ -1,4 +1,5 @@ SCRIPTS= git-arc.sh BINDIR?= /usr/local/bin +MAN= git-arc.1 .include diff --git a/tools/tools/git/git-arc.1 b/tools/tools/git/git-arc.1 new file mode 100644 index 000000000000..d863447ea98e --- /dev/null +++ b/tools/tools/git/git-arc.1 @@ -0,0 +1,202 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2021 Daniel Ebdrup Jensen +.\" +.\" 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. +.\" +.Dd February 7, 2021 +.Dt GIT-ARC 1 +.Os +.Sh NAME +.Nm git arc +.Nd a wrapper to improve integration betwen git and arcanist +.Sh SYNOPSIS +.Nm +.Cm create +.Op Fl l +.Op Fl r Ar reviewer1 Ns Op Cm \&, Ns Ar reviewer2 ... +.Op Fl s Ar subscriber1 Ns Op Cm \&, Ns Ar subscriber2 ... +.Op Ar commit Ns | Ns Ar commit-range +.Nm +.Cm list Ar commit Ns | Ns Ar commit-range +.Nm +.Cm patch Ar diff1 Ns Op Cm \&, Ns Ar diff2 +.Nm +.Cm stage +.Op Fl b +.Ar branch Op Ar commit Ns | Ns Ar commit-range +.Nm +.Cm update +.Op Ar branch Oo Ar commit Ns | Ns Ar commit-range Oc +.Sh DESCRIPTION +The +.Nm +utility creates and manages +.Fx +Phabricator reviews based on git commits. +.Pp +Git +assumes a one-to-one relationship between git commits and +Differential Revisions, and the Differential Revision title must match +the summary line of the corresponding commit. +In particular, the commit summaries must be unique across all open +Differential Revisions authored the submitter. +.Pp +The first parameter must be a verb. +The available verbs are: +.Bl -tag -width "create" +.It Cm create +Create new Differential Revisions from the specified commits. +.It Cm list +Print the associated Differential Revisions for the specified commits. +.It Cm patch +Try to apply a patch from a Differential revision to the currently +checked out tree. +.It Cm stage +Prepare a series of commits to be pushed to the upstream +.Fx +repository. +The commits are cherry-picked to a branch (by default the +.Dq main +branch), review tags are added to the commit log message, and +the log message is opened in an editor for any last-minute +updates. +The commits need not have associated Differential +Revisions. +.It Cm update +Synchronize the Differential Revisions associated with the +specified commits. +Currently only the diff is updated; the review description and other +metadata is not synchronized. +.El +.Sh CONFIGURATION +These are manipulated by +.Nm git-config : +.Bl -tag -width "arc.assume_yes" -offset indent +.It Va arc.assume_yes +Assume a +.Dq yes +answer to all prompts instead of +prompting the user. +Equivalent to the +.Fl -y +flag. +Defaults to false. +.It Va arc.browse +Try to open newly created reviews in a browser tab. +Defaults to false. +.It Va arc.list +Always use +.Dq list mode +.Pq Fl l +with create. +In this mode, the list of git revisions to create reviews for +is listed with a single prompt before creating reviews. +The diffs for individual commits are not shown. +Defaults to false. +.It Va arc.verbose +Always use verbose output. +Equivalent to the +.Fl v +flag. +Defaults to false. +.El +.Sh EXAMPLES +The typical end-to-end usage looks something like this. +.Pp +Commit changes with a message and create a Differential review: +.Bd -literal -offset indent +$ git commit -m "kern: Rewrite in Rust" +$ git arc create HEAD +.Ed +.Pp +Make changes to the diff based on review feedback, then amend the +changes to the existing commit and update the Differential review: +.Bd -literal -offset indent +$ git commit --amend +$ git arc update HEAD +.Ed +.Pp +Now that all reviewers are happy, it is time to stage the commit and +push it: +.Bd -literal -offset indent +$ git arc stage HEAD +$ git push freebsd HEAD:main +.Ed +.Pp +Create a Phabricator review using the contents of the most recent +commit in your git checkout: +.Bd -literal -offset indent +$ git arc create -r markj HEAD +.Ed +.Pp +The commit title is used as the review title, the commit log +message is used as the review description, and +.Aq Mt markj@FreeBSD.org +is added as a reviewer. +.Pp +Create a series of Phabricator reviews for each of HEAD~2, HEAD~ and +HEAD: +.Bd -literal -offset indent +$ git arc create HEAD~3..HEAD +.Ed +.Pp +Pairs of consecutive commits are linked into a patch stack. +Note that the first commit in the specified range is excluded. +.Pp +Update the review corresponding to commit b409afcfedcdda: +.Bd -literal -offset indent +$ git arc update b409afcfedcdda +.Ed +.Pp +The title of the commit must be the same as it was when the review +was created. +Note that the review description is not automatically updated. +.Pp +Apply the patch in review D12345 to the currently checked-out tree, +and stage it: +.Bd -literal -offset indent +$ git arc patch D12345 +.Ed +.Pp +List the status of reviews for all the commits in the branch +.Dq feature : +.Bd -literal -offset indent +$ git arc list main..feature +.Ed +.Sh SEE ALSO +.Xr build 7 , +.Xr development 7 +.Sh HISTORY +The +.Nm +utility appeared in the src tools collection in +.Fx 14.0 . +.Sh AUTHORS +The +.Nm +utility was written by +.An -nosplit +.An Mark Johnston Aq Mt markj@FreeBSD.org +and the manual page was written by +.An Daniel Ebdrup Jensen Aq Mt debdrup@FreeBSD.org . From owner-dev-commits-src-main@freebsd.org Fri Feb 12 22:40:07 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6ECD7533EB3; Fri, 12 Feb 2021 22:40:07 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcpNR2mhBz4XZr; Fri, 12 Feb 2021 22:40:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DD813BEA; Fri, 12 Feb 2021 22:40:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11CMe7Af061982; Fri, 12 Feb 2021 22:40:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11CMe7Wf061980; Fri, 12 Feb 2021 22:40:07 GMT (envelope-from git) Date: Fri, 12 Feb 2021 22:40:07 GMT Message-Id: <202102122240.11CMe7Wf061980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Daniel Ebdrup Jensen Subject: git: 5ae8b018321f - main - git-arc(1): Fix nits pointed out in final review MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: debdrup X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ae8b018321f1562cd6bc39992aa110f9a0a2586 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 22:40:07 -0000 The branch main has been updated by debdrup (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5ae8b018321f1562cd6bc39992aa110f9a0a2586 commit 5ae8b018321f1562cd6bc39992aa110f9a0a2586 Author: Daniel Ebdrup Jensen AuthorDate: 2021-02-12 22:39:00 +0000 Commit: Daniel Ebdrup Jensen CommitDate: 2021-02-12 22:39:00 +0000 git-arc(1): Fix nits pointed out in final review Pointy hat to: me --- tools/tools/git/git-arc.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/tools/git/git-arc.1 b/tools/tools/git/git-arc.1 index d863447ea98e..cc510c069c3a 100644 --- a/tools/tools/git/git-arc.1 +++ b/tools/tools/git/git-arc.1 @@ -92,14 +92,14 @@ metadata is not synchronized. .Sh CONFIGURATION These are manipulated by .Nm git-config : -.Bl -tag -width "arc.assume_yes" -offset indent +.Bl -tag -width "arc.assume_yes" .It Va arc.assume_yes Assume a .Dq yes answer to all prompts instead of prompting the user. Equivalent to the -.Fl -y +.Fl y flag. Defaults to false. .It Va arc.browse From owner-dev-commits-src-main@freebsd.org Sat Feb 13 00:06:23 2021 Return-Path: Delivered-To: dev-commits-src-main@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 3F61B5365AA; Sat, 13 Feb 2021 00:06:23 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcrHz1HNxz4fSv; Sat, 13 Feb 2021 00:06:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19F8253A4; Sat, 13 Feb 2021 00:06:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11D06Nr5077608; Sat, 13 Feb 2021 00:06:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11D06NiO077607; Sat, 13 Feb 2021 00:06:23 GMT (envelope-from git) Date: Sat, 13 Feb 2021 00:06:23 GMT Message-Id: <202102130006.11D06NiO077607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: a375ec52a7b4 - main - Fix ifa refcount leak during route addition. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a375ec52a7b423133f66878ecf002efc3b6e9fca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 00:06:23 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=a375ec52a7b423133f66878ecf002efc3b6e9fca commit a375ec52a7b423133f66878ecf002efc3b6e9fca Author: Alexander V. Chernikov AuthorDate: 2021-02-12 20:56:52 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-13 00:06:14 +0000 Fix ifa refcount leak during route addition. Reported by: rstone Reviewed by: rstone MFC after: 1 day --- sys/net/route/route_ctl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index 6b0869196d12..9aedfb9d5855 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -594,14 +594,12 @@ create_rtentry(struct rib_head *rnh, struct rt_addrinfo *info, } error = nhop_create_from_info(rnh, info, &nh); - if (error != 0) { - ifa_free(info->rti_ifa); + ifa_free(info->rti_ifa); + if (error != 0) return (error); - } rt = uma_zalloc(V_rtzone, M_NOWAIT | M_ZERO); if (rt == NULL) { - ifa_free(info->rti_ifa); nhop_free(nh); return (ENOBUFS); } From owner-dev-commits-src-main@freebsd.org Sat Feb 13 04:51:24 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2A22A53EDE4; Sat, 13 Feb 2021 04:51:24 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dcycr0VJ8z3DYm; Sat, 13 Feb 2021 04:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F14A411486; Sat, 13 Feb 2021 04:51:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11D4pNr9056182; Sat, 13 Feb 2021 04:51:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11D4pNTB056181; Sat, 13 Feb 2021 04:51:23 GMT (envelope-from git) Date: Sat, 13 Feb 2021 04:51:23 GMT Message-Id: <202102130451.11D4pNTB056181@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 71befc35061b - main - fusefs: set d_off during VOP_READDIR MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71befc35061b3c9d8cc07e34c5dce622c848fcdb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 04:51:24 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=71befc35061b3c9d8cc07e34c5dce622c848fcdb commit 71befc35061b3c9d8cc07e34c5dce622c848fcdb Author: Alan Somers AuthorDate: 2021-02-12 01:01:10 +0000 Commit: Alan Somers CommitDate: 2021-02-13 04:50:52 +0000 fusefs: set d_off during VOP_READDIR This allows d_off to be used with lseek to position the file so that getdirentries(2) will return the next entry. It is not used by readdir(3). PR: 253411 Reported by: John Millikin Reviewed by: cem MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28605 --- sys/fs/fuse/fuse_internal.c | 13 ++++---- tests/sys/fs/fusefs/Makefile | 3 ++ tests/sys/fs/fusefs/readdir.cc | 74 ++++++++++++++++++++++++++++++++++++------ 3 files changed, 74 insertions(+), 16 deletions(-) diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index 60f9a7319e00..a5f646e5f449 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -583,7 +583,7 @@ fuse_internal_readdir_processdata(struct uio *uio, u_long **cookiesp) { int err = 0; - int bytesavail; + int oreclen; size_t freclen; struct dirent *de; @@ -620,10 +620,10 @@ fuse_internal_readdir_processdata(struct uio *uio, err = EINVAL; break; } - bytesavail = GENERIC_DIRSIZ((struct pseudo_dirent *) + oreclen = GENERIC_DIRSIZ((struct pseudo_dirent *) &fudge->namelen); - if (bytesavail > uio_resid(uio)) { + if (oreclen > uio_resid(uio)) { /* Out of space for the dir so we are done. */ err = -1; break; @@ -633,12 +633,13 @@ fuse_internal_readdir_processdata(struct uio *uio, * the requested offset in the directory is found. */ if (*fnd_start != 0) { - fiov_adjust(cookediov, bytesavail); - bzero(cookediov->base, bytesavail); + fiov_adjust(cookediov, oreclen); + bzero(cookediov->base, oreclen); de = (struct dirent *)cookediov->base; de->d_fileno = fudge->ino; - de->d_reclen = bytesavail; + de->d_off = fudge->off; + de->d_reclen = oreclen; de->d_type = fudge->type; de->d_namlen = fudge->namelen; memcpy((char *)cookediov->base + sizeof(struct dirent) - diff --git a/tests/sys/fs/fusefs/Makefile b/tests/sys/fs/fusefs/Makefile index 2c858ff42dd1..832b30dc6911 100644 --- a/tests/sys/fs/fusefs/Makefile +++ b/tests/sys/fs/fusefs/Makefile @@ -71,6 +71,9 @@ FUSEFS= ${SRCTOP}/sys/fs/fuse MOUNT= ${SRCTOP}/sbin/mount # Suppress warnings that GCC generates for the libc++ and gtest headers. CXXWARNFLAGS.gcc+= -Wno-placement-new -Wno-attributes +# Suppress Wcast-align for readdir.cc, because it is unavoidable when using +# getdirentries. +CXXWARNFLAGS.readdir.cc+= -Wno-cast-align .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 80000 CXXWARNFLAGS+= -Wno-class-memaccess .endif diff --git a/tests/sys/fs/fusefs/readdir.cc b/tests/sys/fs/fusefs/readdir.cc index 8f0b9742890e..b6b807f350e9 100644 --- a/tests/sys/fs/fusefs/readdir.cc +++ b/tests/sys/fs/fusefs/readdir.cc @@ -62,6 +62,9 @@ void expect_lookup(const char *relpath, uint64_t ino) } }; +const char dot[] = "."; +const char dotdot[] = ".."; + /* FUSE_READDIR returns nothing but "." and ".." */ TEST_F(Readdir, dots) { @@ -72,8 +75,6 @@ TEST_F(Readdir, dots) struct dirent *de; vector ents(2); vector empty_ents(0); - const char dot[] = "."; - const char dotdot[] = ".."; expect_lookup(RELPATH, ino); expect_opendir(ino); @@ -98,11 +99,6 @@ TEST_F(Readdir, dots) de = readdir(dir); ASSERT_NE(nullptr, de) << strerror(errno); EXPECT_EQ(2ul, de->d_fileno); - /* - * fuse(4) doesn't actually set d_off, which is ok for now because - * nothing uses it. - */ - //EXPECT_EQ(2000, de->d_off); EXPECT_EQ(DT_DIR, de->d_type); EXPECT_EQ(sizeof(dotdot), de->d_namlen); EXPECT_EQ(0, strcmp(dotdot, de->d_name)); @@ -111,7 +107,6 @@ TEST_F(Readdir, dots) de = readdir(dir); ASSERT_NE(nullptr, de) << strerror(errno); EXPECT_EQ(3ul, de->d_fileno); - //EXPECT_EQ(3000, de->d_off); EXPECT_EQ(DT_DIR, de->d_type); EXPECT_EQ(sizeof(dot), de->d_namlen); EXPECT_EQ(0, strcmp(dot, de->d_name)); @@ -153,8 +148,11 @@ TEST_F(Readdir, eio) leakdir(dir); } -/* getdirentries(2) can use a larger buffer size than readdir(3) */ -TEST_F(Readdir, getdirentries) +/* + * getdirentries(2) can use a larger buffer size than readdir(3). It also has + * some additional non-standardized fields in the returned dirent. + */ +TEST_F(Readdir, getdirentries_empty) { const char FULLPATH[] = "mountpoint/some_dir"; const char RELPATH[] = "some_dir"; @@ -186,6 +184,62 @@ TEST_F(Readdir, getdirentries) leak(fd); } +/* + * The dirent.d_off field can be used with lseek to position the directory so + * that getdirentries will return the subsequent dirent. + */ +TEST_F(Readdir, getdirentries_seek) +{ + const char FULLPATH[] = "mountpoint/some_dir"; + const char RELPATH[] = "some_dir"; + vector ents0(2); + vector ents1(1); + uint64_t ino = 42; + int fd; + const size_t bufsize = 8192; + char buf[bufsize]; + struct dirent *de0, *de1; + ssize_t r; + + expect_lookup(RELPATH, ino); + expect_opendir(ino); + + ents0[0].d_fileno = 2; + ents0[0].d_off = 2000; + ents0[0].d_namlen = sizeof(dotdot); + ents0[0].d_type = DT_DIR; + strncpy(ents0[0].d_name, dotdot, ents0[0].d_namlen); + expect_readdir(ino, 0, ents0); + ents0[1].d_fileno = 3; + ents0[1].d_off = 3000; + ents0[1].d_namlen = sizeof(dot); + ents0[1].d_type = DT_DIR; + ents1[0].d_fileno = 3; + ents1[0].d_off = 3000; + ents1[0].d_namlen = sizeof(dot); + ents1[0].d_type = DT_DIR; + strncpy(ents1[0].d_name, dot, ents1[0].d_namlen); + expect_readdir(ino, 0, ents0); + expect_readdir(ino, 2000, ents1); + + fd = open(FULLPATH, O_DIRECTORY); + ASSERT_LE(0, fd) << strerror(errno); + r = getdirentries(fd, buf, sizeof(buf), 0); + ASSERT_LT(0, r) << strerror(errno); + de0 = (struct dirent*)&buf[0]; + ASSERT_EQ(2000, de0->d_off); + ASSERT_LT(de0->d_reclen + offsetof(struct dirent, d_fileno), bufsize); + de1 = (struct dirent*)(&(buf[de0->d_reclen])); + ASSERT_EQ(3ul, de1->d_fileno); + + r = lseek(fd, de0->d_off, SEEK_SET); + ASSERT_LE(0, r); + r = getdirentries(fd, buf, sizeof(buf), 0); + ASSERT_LT(0, r) << strerror(errno); + de0 = (struct dirent*)&buf[0]; + ASSERT_EQ(3000, de0->d_off); +} + /* * Nothing bad should happen if getdirentries is called on two file descriptors * which were concurrently open, but one has already been closed. From owner-dev-commits-src-main@freebsd.org Sat Feb 13 05:16:58 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1748B53FDB4; Sat, 13 Feb 2021 05:16:58 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DczBL054Sz3GVc; Sat, 13 Feb 2021 05:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9FCE116B9; Sat, 13 Feb 2021 05:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11D5Gvec085348; Sat, 13 Feb 2021 05:16:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11D5GvDx085347; Sat, 13 Feb 2021 05:16:57 GMT (envelope-from git) Date: Sat, 13 Feb 2021 05:16:57 GMT Message-Id: <202102130516.11D5GvDx085347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 6fea22cebe5c - main - fmtree: add a deprecation notice to the manpage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6fea22cebe5cb1e51e98c894a738bea910b7bc2f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 05:16:58 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6fea22cebe5cb1e51e98c894a738bea910b7bc2f commit 6fea22cebe5cb1e51e98c894a738bea910b7bc2f Author: Kyle Evans AuthorDate: 2021-02-10 15:10:52 +0000 Commit: Kyle Evans CommitDate: 2021-02-13 05:15:58 +0000 fmtree: add a deprecation notice to the manpage Note that this mtree(8) is actually installed as fmtree(8), while mtree(8) is located in ^/contrib/mtree -- thus, the reference to mtree(8) makes a lot more sense in the context in which folks would actually notice it. Shout-out to Ravi for pointing out that this may not be an obvious fact. MFC after: 3 days Reviewed by: bdrewery, brooks, cy, emaste Relnotes: yes Differential Revision: https://reviews.freebsd.org/D28573 --- usr.sbin/fmtree/mtree.8 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/usr.sbin/fmtree/mtree.8 b/usr.sbin/fmtree/mtree.8 index c2901e6776da..f5b4de4e7438 100644 --- a/usr.sbin/fmtree/mtree.8 +++ b/usr.sbin/fmtree/mtree.8 @@ -28,7 +28,7 @@ .\" From: @(#)mtree.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd June 16, 2007 +.Dd February 13, 2021 .Dt MTREE 8 .Os .Sh NAME @@ -362,6 +362,12 @@ style BSD.*.dist file, use .Fl n .Fl k .Cm uname,gname,mode,nochange. +.Sh DEPRECATION NOTICE +.Nm fmtree +is deprecated, and will be gone in +.Fx 14.0 . +.Xr mtree 8 +should be used instead. .Sh SEE ALSO .Xr chflags 1 , .Xr chgrp 1 , @@ -371,7 +377,8 @@ style BSD.*.dist file, use .Xr stat 2 , .Xr fts 3 , .Xr md5 3 , -.Xr chown 8 +.Xr chown 8 , +.Xr mtree 8 .Sh HISTORY The .Nm From owner-dev-commits-src-main@freebsd.org Sat Feb 13 05:16:59 2021 Return-Path: Delivered-To: dev-commits-src-main@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 3906F53FDB6; Sat, 13 Feb 2021 05:16:59 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DczBM12yzz3GF0; Sat, 13 Feb 2021 05:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16D6B116BA; Sat, 13 Feb 2021 05:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11D5GxlT085368; Sat, 13 Feb 2021 05:16:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11D5GxUw085367; Sat, 13 Feb 2021 05:16:59 GMT (envelope-from git) Date: Sat, 13 Feb 2021 05:16:59 GMT Message-Id: <202102130516.11D5GxUw085367@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: c975494ad76a - main - build: turn off FMTREE by default to prepare for removal MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c975494ad76a35d5bfc480f7275c6a1f4927f38e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 05:16:59 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=c975494ad76a35d5bfc480f7275c6a1f4927f38e commit c975494ad76a35d5bfc480f7275c6a1f4927f38e Author: Kyle Evans AuthorDate: 2021-02-10 14:57:25 +0000 Commit: Kyle Evans CommitDate: 2021-02-13 05:16:06 +0000 build: turn off FMTREE by default to prepare for removal nmtree is derived from fmtree, and has been the default mtree(8) since 6adfbbbf161, a little over a year after its introduction. fmtree has not seen any substantial work since then, except for build fixes and runtime issues that were diagnosed in nmtree and backported because this was still in the tree. Turn it off by default. Reviewed by: bdrewery, brooks, cy, emaste Differential Revision: https://reviews.freebsd.org/D28573 --- share/mk/src.opts.mk | 2 +- tools/build/options/WITH_FMTREE | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 6cfab4b50613..9e7a0c88f8af 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -99,7 +99,6 @@ __DEFAULT_YES_OPTIONS = \ FILE \ FINGER \ FLOPPY \ - FMTREE \ FORTH \ FP_LIBC \ FREEBSD_UPDATE \ @@ -202,6 +201,7 @@ __DEFAULT_NO_OPTIONS = \ CLANG_FORMAT \ DTRACE_TESTS \ EXPERIMENTAL \ + FMTREE \ HESIOD \ LIBSOFT \ LOADER_FIREWIRE \ diff --git a/tools/build/options/WITH_FMTREE b/tools/build/options/WITH_FMTREE new file mode 100644 index 000000000000..e384ff426774 --- /dev/null +++ b/tools/build/options/WITH_FMTREE @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to build and install +.Pa /usr/sbin/fmtree . +This option is deprecated, and will be gone in +.Fx 14.0 . From owner-dev-commits-src-main@freebsd.org Sat Feb 13 05:17:01 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4984A53FB6D; Sat, 13 Feb 2021 05:17:01 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DczBN3FYpz3GN9; Sat, 13 Feb 2021 05:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EA44118E5; Sat, 13 Feb 2021 05:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11D5H0d2085389; Sat, 13 Feb 2021 05:17:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11D5H0gG085388; Sat, 13 Feb 2021 05:17:00 GMT (envelope-from git) Date: Sat, 13 Feb 2021 05:17:00 GMT Message-Id: <202102130517.11D5H0gG085388@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 95138d09d20a - main - Regenerate src.conf(5) after FMTREE default change MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95138d09d20a539cd483783f8b3d2d7052dfd793 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 05:17:02 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=95138d09d20a539cd483783f8b3d2d7052dfd793 commit 95138d09d20a539cd483783f8b3d2d7052dfd793 Author: Kyle Evans AuthorDate: 2021-02-10 15:11:55 +0000 Commit: Kyle Evans CommitDate: 2021-02-13 05:16:06 +0000 Regenerate src.conf(5) after FMTREE default change --- share/man/man5/src.conf.5 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index ea94bac4d2dc..48bd0eb04293 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd February 2, 2021 +.Dd February 13, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -630,9 +630,11 @@ and .It Va WITHOUT_FLOPPY Set to not build or install programs for operating floppy disk driver. -.It Va WITHOUT_FMTREE -Set to not build and install +.It Va WITH_FMTREE +Set to build and install .Pa /usr/sbin/fmtree . +This option is deprecated, and will be gone in +.Fx 14.0 . .It Va WITHOUT_FORMAT_EXTENSIONS Set to not enable .Fl fformat-extensions From owner-dev-commits-src-main@freebsd.org Sat Feb 13 13:41:09 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D8DA152D06A; Sat, 13 Feb 2021 13:41:09 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DdBN55kY4z4Xb5; Sat, 13 Feb 2021 13:41:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B72C718402; Sat, 13 Feb 2021 13:41:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11DDf9K3055020; Sat, 13 Feb 2021 13:41:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11DDf9U9055018; Sat, 13 Feb 2021 13:41:09 GMT (envelope-from git) Date: Sat, 13 Feb 2021 13:41:09 GMT Message-Id: <202102131341.11DDf9U9055018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 0ff101494489 - main - Update Subversion to 1.14.1 LTS. See contrib/subversion/CHANGES for a summary of changes, or for a more thorough overview: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ff1014944897f4f3ffa4462406cdee920b53400 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 13:41:09 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=0ff1014944897f4f3ffa4462406cdee920b53400 commit 0ff1014944897f4f3ffa4462406cdee920b53400 Author: Dimitry Andric AuthorDate: 2021-02-13 13:38:51 +0000 Commit: Dimitry Andric CommitDate: 2021-02-13 13:38:51 +0000 Update Subversion to 1.14.1 LTS. See contrib/subversion/CHANGES for a summary of changes, or for a more thorough overview: https://subversion.apache.org/docs/release-notes/1.14 NOTE 1: There is no need to dump and reload repositories, and the working copy format is still the same as Subversion 1.8 through 1.13. NOTE 2: The upstream release also contains a fix for a security issue in mod_dav_svn (CVE-2020-17525), but since we do not build or use any Apache modules, it is not an issue for the FreeBSD base system. Relnotes: yes MFC after: 3 days --- contrib/subversion/.editorconfig | 1 + contrib/subversion/.swig_pl_checked | 0 contrib/subversion/.swig_py_checked | 0 contrib/subversion/.swig_rb_checked | 0 contrib/subversion/CHANGES | 68 +++++- contrib/subversion/INSTALL | 12 +- contrib/subversion/NOTICE | 2 +- contrib/subversion/autogen.sh | 4 +- contrib/subversion/build-outputs.mk | 29 ++- contrib/subversion/build.conf | 15 +- contrib/subversion/configure | 240 +++++++++++---------- contrib/subversion/configure.ac | 2 +- contrib/subversion/gen-make.py | 2 +- .../subversion/include/private/svn_dep_compat.h | 11 + .../subversion/include/private/svn_sorts_private.h | 10 +- contrib/subversion/subversion/include/svn_ra.h | 2 +- contrib/subversion/subversion/include/svn_types.h | 29 +++ .../subversion/subversion/include/svn_version.h | 6 +- .../subversion/subversion/libsvn_client/merge.c | 40 +++- .../subversion/libsvn_client/mergeinfo.h | 2 - contrib/subversion/subversion/libsvn_client/mtcc.c | 3 +- contrib/subversion/subversion/libsvn_fs_fs/index.c | 2 +- contrib/subversion/subversion/libsvn_repos/authz.c | 31 ++- .../subversion/libsvn_repos/config_file.c | 4 + .../subversion/subversion/libsvn_subr/apr_escape.c | 135 ++++++++++++ .../subversion/subversion/libsvn_subr/cmdline.c | 101 +++++++-- contrib/subversion/subversion/libsvn_subr/iter.c | 26 +++ contrib/subversion/subversion/libsvn_subr/opt.c | 2 +- .../subversion/subversion/libsvn_subr/version.c | 2 +- .../subversion/subversion/libsvn_wc/wc-metadata.h | 2 +- .../subversion/libsvn_wc/wc-metadata.sql | 2 +- .../subversion/subversion/libsvn_wc/wc-queries.h | 2 +- contrib/subversion/subversion/svn/cl-conflicts.c | 6 +- contrib/subversion/subversion/svn/filesize.c | 57 +++-- contrib/subversion/win-tests.py | 11 +- usr.bin/svn/lib/libsvn_subr/Makefile | 1 + usr.bin/svn/svn_private_config.h | 4 +- 37 files changed, 668 insertions(+), 198 deletions(-) diff --git a/contrib/subversion/.editorconfig b/contrib/subversion/.editorconfig index 13868c63e3f8..b000de12aff1 100644 --- a/contrib/subversion/.editorconfig +++ b/contrib/subversion/.editorconfig @@ -10,6 +10,7 @@ trim_trailing_whitespace = false [**/Makefile*] indent_style = tab +indent_size = 8 [build-outputs.mk] indent_style = tab diff --git a/contrib/subversion/.swig_pl_checked b/contrib/subversion/.swig_pl_checked deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/contrib/subversion/.swig_py_checked b/contrib/subversion/.swig_py_checked deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/contrib/subversion/.swig_rb_checked b/contrib/subversion/.swig_rb_checked deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/contrib/subversion/CHANGES b/contrib/subversion/CHANGES index 08398a98ac8b..656b1898d7d0 100644 --- a/contrib/subversion/CHANGES +++ b/contrib/subversion/CHANGES @@ -4,8 +4,51 @@ # To view an issue listed as (issue #XXXX), visit: # https://subversion.apache.org/issue-XXXX +Version 1.14.1 +(10 Feb 2021, from /branches/1.14.x) + User-visible changes: + - Client-side improvements and bugfixes: + * Fix non-deterministic generation of mergeinfo (issue #4862) + * Fix merge removing a folder with non-inheritable mergeinfo (issue #4859) + * Do not suggest --help -v for commands which do not support -v (r1882157) + * Fix invalid SQL quoting in working copy upgrade system (r1879198) + * Fix problems in human-readable file size formatting (r1878909, -18, -50) + * Improve an error message from svnmucc (r1877072) + * Fix 'svn info --xml' gives wrong 'source-right' of conflict (issue #4869) + * Fix filename encoding/quoting when invoking editor on Windows (r1885953) + * Convert filename for editor from UTF-8 to the locale's encoding (r1882234) + + - Server-side improvements and bugfixes: + * Fix authz doesn't combine global and repository rules (issue #4762) + * Make the hot-backup.py script work with Python 3 (r1878855, r1878859) + * Fix an uninitialized read in FSFS (r1880374) + * Make mailer.py work properly with Python 3 (r1884427 et al) + * Fix a potential NULL dereference in the config file parser (r1886019) + + Developer-visible changes: + - General: + * Restore support for building with APR 1.4 (r1881958, r1882128) + * Rewrite internal test data to avoid literal trailing spaces (r1875675) + * Remove use of os.dup2() from tests for Python 3.6 on Windows (r1883337) + * Note in INSTALL that non-release mode is required for Python 2 (r1877960) + * Make gen-make.py --debug work with Python 3 (r1876906) + * Make test suite run correctly with Python 3 on Windows (r1876707 et al) + * Fix compilation errors with Visual Studio 2008 (r1877259) + * Use Doxygen comment leader for comments with doxygen syntax (r1877794) + - Bindings: + * Fix win-tests.py to load Python 3 bindings with debug config (r1884642) + * Fix C4204 errors building swig-py with Python 3.9 on Windows (r1883570) + * Fix unable to load *.pyd files with Python 3.8.x on Windows (r1883335) + * Add SWIG4 support for SWIG Python binding on Windows (r1877338) + * Fix incorrect cache in JavaHL SVNBase::createCppBoundObject (r1882115) + * Fix crash in JavaHL JNI wrapper caused by object lifetimes (r1880886) + * autogen.sh: Remove .swig_*_checked files from release tarballs (r1878413) + * Avoid version check for Python if --without-swig is used (r1876662) + * siwg-py: Fix a syntax error for Python 3.6 and later (r1885112) + * Fix several crashes and JNI warnings in javahl TunnelAgent (r1886029) + Version 1.14.0 -(6 May 2020, from /branches/1.14.x) +(27 May 2020, from /branches/1.14.x) https://svn.apache.org/repos/asf/subversion/tags/1.14.0 User-visible changes: @@ -222,6 +265,29 @@ http://svn.apache.org/repos/asf/subversion/tags/1.11.0 * Fix a potential crash in JavaHL (issue #4764) +Version 1.10.7 +(10 Feb 2021, from /branches/1.10.x) + User-visible changes: + - Client-side bugfixes: + * Fix 'svn patch' setting mode 0600 on patched files with props (r1864440) + * Fix invalid SQL quoting in working copy upgrade system (r1879198) + * Fix non-deterministic generation of mergeinfo (issue #4862) + * Fix a crash seen when using git-svn with kwallet (r1875680) + * Fix merge removing a folder with non-inheritable mergeinfo (issue #4859) + * Fix 'svn info --xml' gives wrong 'source-right' of conflict (issue #4869) + + - Server-side bugfixes: + * mod_dav_svn: install cleanup handler for FS warning logging (r1865266) + * mod_dav_svn: Fix missing Last-Modified header on 'external' GET requests (r1866425) + * Fix formatting type size mismatches in FSFS (r1865987, -8) + * Fix an undefined behavior problem in FSFS caching code (r1876054) + * Fix a potential NULL dereference in the config file parser (r1886019) + + Developer-visible changes: + * Fix Requires(.private) fields in pkg-config files (r1863987, -90) + * Fix crash in JavaHL JNI wrapper caused by object lifetimes (r1880886) + * Fix an EOL issue in tests on Windows (r1881985 et al) + Version 1.10.6 (24 Jul 2019, from /branches/1.10.x) https://svn.apache.org/repos/asf/subversion/tags/1.10.6 diff --git a/contrib/subversion/INSTALL b/contrib/subversion/INSTALL index 64f821a31057..44a916b4ac49 100644 --- a/contrib/subversion/INSTALL +++ b/contrib/subversion/INSTALL @@ -3,7 +3,7 @@ A Quick Guide ====================================== -$LastChangedDate: 2020-02-17 03:49:42 +0000 (Mon, 17 Feb 2020) $ +$LastChangedDate: 2020-12-18 04:00:24 +0000 (Fri, 18 Dec 2020) $ Contents: @@ -206,7 +206,7 @@ I. INTRODUCTION commands described in section II.B before installing the following. - 1. Apache Portable Runtime 1.5 or newer (REQUIRED) + 1. Apache Portable Runtime 1.4 or newer (REQUIRED) Whenever you want to build any part of Subversion, you need the Apache Portable Runtime (APR) and the APR Utility (APR-util) @@ -506,6 +506,12 @@ I. INTRODUCTION reached end of life. All users are strongly encouraged to move to Python 3. + Note: If you are using a Subversion distribution tarball and want + to build the Python bindings for Python 2, you should rebuild + the build environment in non-release mode by running + 'sh autogen.sh' before running the ./configure script; see + section II.B for more about autogen.sh. + 13. Perl 5.8 or newer (Windows only) (OPTIONAL) @@ -832,7 +838,7 @@ II. INSTALLATION needed to compile Apache. Note that this is the actual awk program, not an installer - just rename it to awk.exe and it is ready to use. * Apache apr, apr-util, and optionally apr-iconv libraries, version - 1.5 or later (1.2 for apr-iconv). If you are building from a Subversion + 1.4 or later (1.2 for apr-iconv). If you are building from a Subversion checkout and have not downloaded Apache 2, then get these 3 libraries from https://www.apache.org/dist/apr/. * SQLite 3.8.2 or higher from https://www.sqlite.org/download.html diff --git a/contrib/subversion/NOTICE b/contrib/subversion/NOTICE index a3e794d536e7..84d77667c40d 100644 --- a/contrib/subversion/NOTICE +++ b/contrib/subversion/NOTICE @@ -1,5 +1,5 @@ Apache Subversion -Copyright 2020 The Apache Software Foundation +Copyright 2021 The Apache Software Foundation This product includes software developed by many people, and distributed under Contributor License Agreements to The Apache Software Foundation diff --git a/contrib/subversion/autogen.sh b/contrib/subversion/autogen.sh index 84a6e2ca33cc..6579daa9e415 100755 --- a/contrib/subversion/autogen.sh +++ b/contrib/subversion/autogen.sh @@ -178,8 +178,8 @@ if test -n "$RELEASE_MODE"; then # Build the SWIG-related files make -f autogen-standalone.mk autogen-swig || gen_failed=1 - # Remove the .swig_checked file - rm -f .swig_checked + # Remove the .swig_*checked files + rm -f .swig_checked .swig_pl_checked .swig_py_checked .swig_rb_checked fi if test -n "$SKIP_DEPS"; then diff --git a/contrib/subversion/build-outputs.mk b/contrib/subversion/build-outputs.mk index aee265351a80..3f7ac1a100f8 100644 --- a/contrib/subversion/build-outputs.mk +++ b/contrib/subversion/build-outputs.mk @@ -23,21 +23,21 @@ RA_SERF_LINK = ../../subversion/libsvn_ra_serf/libsvn_ra_serf-1.la ../../subvers RA_SVN_DEPS = subversion/libsvn_ra_svn/libsvn_ra_svn-1.la subversion/libsvn_delta/libsvn_delta-1.la subversion/libsvn_subr/libsvn_subr-1.la RA_SVN_LINK = ../../subversion/libsvn_ra_svn/libsvn_ra_svn-1.la ../../subversion/libsvn_delta/libsvn_delta-1.la ../../subversion/libsvn_subr/libsvn_subr-1.la -BUILD_DIRS = subversion/tests/afl subversion/tests/cmdline subversion/tests/libsvn_subr subversion/tests/libsvn_repos subversion/tests/libsvn_fs_base subversion/tests/libsvn_client subversion/tests/libsvn_wc subversion/tests/libsvn_client/../libsvn_wc tools/diff subversion/tests/libsvn_diff subversion/tests/libsvn_fs_fs subversion/tests/libsvn_fs subversion/tests/libsvn_fs_x tools/dev subversion/bindings/javahl/src/org/apache/subversion/javahl/callback subversion/bindings/javahl/classes subversion/bindings/javahl/include subversion/bindings/javahl/src/org/tigris/subversion/javahl subversion/bindings/javahl/tests/org/tigris/subversion/javahl subversion/bindings/javahl/src/org/apache/subversion/javahl subversion/bindings/javahl/src/org/apache/subversion/javahl/remote subversion/bindings/javahl/tests/org/apache/subversion/javahl subversion/bindings/javahl/src/org/apache/subversion/javahl/types subversion/bindings/javahl/src/org/apache/subversion/javahl/util subversion/libsvn_auth_gnome _keyring subversion/libsvn_auth_kwallet subversion/libsvn_client subversion/libsvn_delta subversion/libsvn_diff subversion/libsvn_fs subversion/libsvn_fs_base subversion/libsvn_fs_base/bdb subversion/libsvn_fs_base/util subversion/libsvn_fs_fs subversion/libsvn_fs_util subversion/libsvn_fs_x subversion/libsvn_ra subversion/libsvn_ra_local subversion/libsvn_ra_serf subversion/libsvn_ra_svn subversion/libsvn_repos subversion/libsvn_subr subversion/libsvn_subr/lz4 subversion/bindings/swig/perl/libsvn_swig_perl subversion/bindings/swig/python/libsvn_swig_py subversion/bindings/swig/ruby/libsvn_swig_ruby subversion/tests subversion/libsvn_wc subversion/bindings/javahl/native subversion/bindings/javahl/native/jniwrapper subversion/bindings/cxx subversion/bindings/cxx/src subversion/bindings/cxx/src/aprwrap subversion/po subversion/mod_authz_svn subversion/mod_dav_svn subversion/mod_dav_svn/reports subversion/mod_dav_svn/posts tools/server-side/mod_dontdothat subversion/tests/libsvn_ra_loc al subversion/tests/libsvn_ra subversion/tes! ts/libsvn_delta subversion/svn tools/client-side/svn-mergeinfo-normalizer tools/server-side tools/dev/wc-ng subversion/svnadmin subversion/svnbench tools/client-side/svnconflict subversion/svndumpfilter subversion/svnfsfs subversion/svnlook tools/dev/svnmover subversion/svnmucc tools/dev/svnraisetreeconflict subversion/svnrdump subversion/svnserve subversion/svnsync subversion/svnversion subversion/bindings/cxx/tests subversion/bindings/swig subversion/tests/libsvn_wc/../../libsvn_subr subversion/bindings/swig/python subversion/bindings/swig/perl subversion/bindings/swig/ruby subversion/bindings/swig/proxy +BUILD_DIRS = subversion/tests/afl subversion/tests/cmdline subversion/tests/libsvn_subr subversion/tests/libsvn_repos subversion/tests/libsvn_fs_base subversion/tests/libsvn_client subversion/tests/libsvn_wc subversion/tests/libsvn_client/../libsvn_wc tools/diff subversion/tests/libsvn_diff subversion/tests/client subversion/tests/libsvn_fs_fs subversion/tests/libsvn_fs subversion/tests/libsvn_fs_x tools/dev subversion/bindings/javahl/src/org/apache/subversion/javahl/callback subversion/bindings/javahl/classes subversion/bindings/javahl/include subversion/bindings/javahl/src/org/tigris/subversion/javahl subversion/bindings/javahl/tests/org/tigris/subversion/javahl subversion/bindings/javahl/src/org/apache/subversion/javahl subversion/bindings/javahl/src/org/apache/subversion/javahl/remote subversion/bindings/javahl/tests/org/apache/subversion/javahl subversion/bindings/javahl/src/org/apache/subversion/javahl/types subversion/bindings/javahl/src/org/apache/subversion/javahl/util subv ersion/libsvn_auth_gnome_keyring subversion/libsvn_auth_kwallet subversion/libsvn_client subversion/libsvn_delta subversion/libsvn_diff subversion/libsvn_fs subversion/libsvn_fs_base subversion/libsvn_fs_base/bdb subversion/libsvn_fs_base/util subversion/libsvn_fs_fs subversion/libsvn_fs_util subversion/libsvn_fs_x subversion/libsvn_ra subversion/libsvn_ra_local subversion/libsvn_ra_serf subversion/libsvn_ra_svn subversion/libsvn_repos subversion/libsvn_subr subversion/libsvn_subr/lz4 subversion/bindings/swig/perl/libsvn_swig_perl subversion/bindings/swig/python/libsvn_swig_py subversion/bindings/swig/ruby/libsvn_swig_ruby subversion/tests subversion/libsvn_wc subversion/bindings/javahl/native subversion/bindings/javahl/native/jniwrapper subversion/bindings/cxx subversion/bindings/cxx/src subversion/bindings/cxx/src/aprwrap subversion/po subversion/mod_authz_svn subversion/mod_dav_svn subversion/mod_dav_svn/reports subversion/mod_dav_svn/posts tools/server-side/mod_dontdothat subver sion/tests/libsvn_ra_local subversion/tests/! libsvn_ra subversion/tests/libsvn_delta subversion/svn tools/client-side/svn-mergeinfo-normalizer tools/server-side tools/dev/wc-ng subversion/svnadmin subversion/svnbench tools/client-side/svnconflict subversion/svndumpfilter subversion/svnfsfs subversion/svnlook tools/dev/svnmover subversion/svnmucc tools/dev/svnraisetreeconflict subversion/svnrdump subversion/svnserve subversion/svnsync subversion/svnversion subversion/bindings/cxx/tests subversion/bindings/swig subversion/tests/libsvn_wc/../../libsvn_subr subversion/bindings/swig/python subversion/bindings/swig/perl subversion/bindings/swig/ruby subversion/bindings/swig/proxy BDB_TEST_DEPS = subversion/tests/libsvn_fs_base/changes-test$(EXEEXT) subversion/tests/libsvn_fs_base/fs-base-test$(EXEEXT) subversion/tests/libsvn_fs_base/strings-reps-test$(EXEEXT) BDB_TEST_PROGRAMS = subversion/tests/libsvn_fs_base/changes-test$(EXEEXT) subversion/tests/libsvn_fs_base/fs-base-test$(EXEEXT) subversion/tests/libsvn_fs_base/strings-reps-test$(EXEEXT) -TEST_DEPS = subversion/tests/afl/afl-svndiff$(EXEEXT) subversion/tests/afl/afl-x509$(EXEEXT) subversion/tests/cmdline/atomic-ra-revprop-change$(EXEEXT) subversion/tests/libsvn_subr/auth-test$(EXEEXT) subversion/tests/libsvn_repos/authz-test$(EXEEXT) subversion/tests/libsvn_subr/bit-array-test$(EXEEXT) subversion/tests/libsvn_subr/cache-test$(EXEEXT) subversion/tests/libsvn_subr/checksum-test$(EXEEXT) subversion/tests/libsvn_client/client-test$(EXEEXT) subversion/tests/libsvn_subr/compat-test$(EXEEXT) subversion/tests/libsvn_subr/compress-test$(EXEEXT) subversion/tests/libsvn_subr/config-test$(EXEEXT) subversion/tests/libsvn_wc/conflict-data-test$(EXEEXT) subversion/tests/libsvn_client/conflicts-test$(EXEEXT) subversion/tests/libsvn_subr/crypto-test$(EXEEXT) subversion/tests/libsvn_wc/db-test$(EXEEXT) subversion/tests/libsvn_diff/diff-diff3-test$(EXEEXT) subversion/tests/libsvn_subr/dirent_uri-test$(EXEEXT) subversion/tests/libsvn_repos/dump-load-test$(EXEEXT) subversion/tests/libsvn _wc/entries-compat-test$(EXEEXT) subversion/tests/cmdline/entries-dump$(EXEEXT) subversion/tests/libsvn_subr/error-code-test$(EXEEXT) subversion/tests/libsvn_subr/error-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-pack-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-private-test$(EXEEXT) subversion/tests/libsvn_fs/fs-sequential-test$(EXEEXT) subversion/tests/libsvn_fs/fs-test$(EXEEXT) subversion/tests/libsvn_fs_x/fs-x-pack-test$(EXEEXT) subversion/tests/libsvn_subr/hashdump-test$(EXEEXT) subversion/tests/libsvn_subr/io-test$(EXEEXT) subversion/tests/cmdline/lock-helper$(EXEEXT) subversion/tests/libsvn_fs/locks-test$(EXEEXT) subversion/tests/libsvn_subr/mergeinfo-test$(EXEEXT) subversion/tests/libsvn_client/mtcc-test$(EXEEXT) subversion/tests/libsvn_wc/op-depth-test$(EXEEXT) subversion/tests/libsvn_subr/opt-test$(EXEEXT) subversion/tests/libsvn_subr/packed-data-test$(EXEEXT) subversion/tests/libsvn_diff/parse-diff-test$(EXEEXT) subversion/tests/libsvn_subr/path-test$(EXEEXT) s ubversion/tests/libsvn_subr/prefix-string-te! st$(EXEEXT) subversion/tests/libsvn_subr/priority-queue-test$(EXEEXT) subversion/tests/libsvn_wc/pristine-store-test$(EXEEXT) subversion/tests/libsvn_ra_local/ra-local-test$(EXEEXT) subversion/tests/libsvn_ra/ra-test$(EXEEXT) subversion/tests/libsvn_delta/random-test$(EXEEXT) subversion/tests/libsvn_repos/repos-test$(EXEEXT) subversion/tests/libsvn_subr/revision-test$(EXEEXT) subversion/tests/libsvn_subr/root-pools-test$(EXEEXT) subversion/tests/libsvn_subr/skel-test$(EXEEXT) subversion/tests/libsvn_subr/spillbuf-test$(EXEEXT) subversion/tests/libsvn_subr/sqlite-test$(EXEEXT) subversion/tests/libsvn_subr/stream-test$(EXEEXT) subversion/tests/libsvn_fs_x/string-table-test$(EXEEXT) subversion/tests/libsvn_subr/string-test$(EXEEXT) subversion/tests/libsvn_subr/subst_translate-test$(EXEEXT) tools/dev/wc-ng/svn-wc-db-tester$(EXEEXT) tools/server-side/svnauthz$(EXEEXT) tools/server-side/svnauthz-validate$(EXEEXT) subversion/tests/libsvn_delta/svndiff-stream-test$(EXEEXT) subversion/tests/ libsvn_delta/svndiff-test$(EXEEXT) tools/dev/svnmover/svnmover$(EXEEXT) subversion/tests/libsvn_subr/time-test$(EXEEXT) subversion/tests/libsvn_subr/translate-test$(EXEEXT) subversion/tests/libsvn_subr/utf-test$(EXEEXT) subversion/tests/libsvn_delta/vdelta-test$(EXEEXT) subversion/tests/libsvn_wc/wc-incomplete-tester$(EXEEXT) subversion/tests/libsvn_wc/wc-lock-tester$(EXEEXT) subversion/tests/libsvn_wc/wc-queries-test$(EXEEXT) subversion/tests/libsvn_wc/wc-test$(EXEEXT) subversion/tests/libsvn_delta/window-test$(EXEEXT) subversion/tests/libsvn_subr/x509-test$(EXEEXT) subversion/tests/libsvn_subr/xml-test$(EXEEXT) subversion/tests/cmdline/authz_tests.py subversion/tests/cmdline/autoprop_tests.py subversion/tests/cmdline/basic_tests.py subversion/tests/cmdline/blame_tests.py subversion/tests/cmdline/cat_tests.py subversion/tests/cmdline/changelist_tests.py subversion/tests/cmdline/checkout_tests.py subversion/tests/cmdline/commit_tests.py subversion/tests/cmdline/copy_tests.py subvers ion/tests/cmdline/dav_tests.py subversion/te! sts/cmdli! ne/depth_tests.py subversion/tests/cmdline/diff_tests.py subversion/tests/cmdline/entries_tests.py subversion/tests/cmdline/export_tests.py subversion/tests/cmdline/externals_tests.py subversion/tests/cmdline/getopt_tests.py subversion/tests/cmdline/history_tests.py subversion/tests/cmdline/import_tests.py subversion/tests/cmdline/info_tests.py subversion/tests/cmdline/input_validation_tests.py subversion/tests/cmdline/iprop_authz_tests.py subversion/tests/cmdline/iprop_tests.py subversion/tests/cmdline/lock_tests.py subversion/tests/cmdline/log_tests.py subversion/tests/cmdline/merge_authz_tests.py subversion/tests/cmdline/merge_automatic_tests.py subversion/tests/cmdline/merge_reintegrate_tests.py subversion/tests/cmdline/merge_tests.py subversion/tests/cmdline/merge_tree_conflict_tests.py subversion/tests/cmdline/mergeinfo_tests.py subversion/tests/cmdline/mod_authz_svn_tests.py subversion/tests/cmdline/mod_dav_svn_tests.py subversion/tests/cmdline/move_tests.py subversion/tests/ cmdline/patch_tests.py subversion/tests/cmdline/pegrev_parse_tests.py subversion/tests/cmdline/prop_tests.py subversion/tests/cmdline/redirect_tests.py subversion/tests/cmdline/relocate_tests.py subversion/tests/cmdline/resolve_tests.py subversion/tests/cmdline/revert_tests.py subversion/tests/cmdline/schedule_tests.py subversion/tests/cmdline/shelf2_tests.py subversion/tests/cmdline/shelf_tests.py subversion/tests/cmdline/special_tests.py subversion/tests/cmdline/stat_tests.py subversion/tests/cmdline/svnadmin_tests.py subversion/tests/cmdline/svnauthz_tests.py subversion/tests/cmdline/svndumpfilter_tests.py subversion/tests/cmdline/svnfsfs_tests.py subversion/tests/cmdline/svnlook_tests.py subversion/tests/cmdline/svnmover_tests.py subversion/tests/cmdline/svnmucc_tests.py subversion/tests/cmdline/svnrdump_tests.py subversion/tests/cmdline/svnsync_authz_tests.py subversion/tests/cmdline/svnsync_tests.py subversion/tests/cmdline/svnversion_tests.py subversion/tests/cmdline/switch_t ests.py subversion/tests/cmdline/trans_tests! .py subve! rsion/tests/cmdline/tree_conflict_tests.py subversion/tests/cmdline/update_tests.py subversion/tests/cmdline/upgrade_tests.py subversion/tests/cmdline/wc_tests.py +TEST_DEPS = subversion/tests/afl/afl-svndiff$(EXEEXT) subversion/tests/afl/afl-x509$(EXEEXT) subversion/tests/cmdline/atomic-ra-revprop-change$(EXEEXT) subversion/tests/libsvn_subr/auth-test$(EXEEXT) subversion/tests/libsvn_repos/authz-test$(EXEEXT) subversion/tests/libsvn_subr/bit-array-test$(EXEEXT) subversion/tests/libsvn_subr/cache-test$(EXEEXT) subversion/tests/libsvn_subr/checksum-test$(EXEEXT) subversion/tests/libsvn_client/client-test$(EXEEXT) subversion/tests/libsvn_subr/compat-test$(EXEEXT) subversion/tests/libsvn_subr/compress-test$(EXEEXT) subversion/tests/libsvn_subr/config-test$(EXEEXT) subversion/tests/libsvn_wc/conflict-data-test$(EXEEXT) subversion/tests/libsvn_client/conflicts-test$(EXEEXT) subversion/tests/libsvn_subr/crypto-test$(EXEEXT) subversion/tests/libsvn_wc/db-test$(EXEEXT) subversion/tests/libsvn_diff/diff-diff3-test$(EXEEXT) subversion/tests/libsvn_subr/dirent_uri-test$(EXEEXT) subversion/tests/libsvn_repos/dump-load-test$(EXEEXT) subversion/tests/libsvn _wc/entries-compat-test$(EXEEXT) subversion/tests/cmdline/entries-dump$(EXEEXT) subversion/tests/libsvn_subr/error-code-test$(EXEEXT) subversion/tests/libsvn_subr/error-test$(EXEEXT) subversion/tests/client/filesize-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-pack-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-private-test$(EXEEXT) subversion/tests/libsvn_fs/fs-sequential-test$(EXEEXT) subversion/tests/libsvn_fs/fs-test$(EXEEXT) subversion/tests/libsvn_fs_x/fs-x-pack-test$(EXEEXT) subversion/tests/libsvn_subr/hashdump-test$(EXEEXT) subversion/tests/libsvn_subr/io-test$(EXEEXT) subversion/tests/cmdline/lock-helper$(EXEEXT) subversion/tests/libsvn_fs/locks-test$(EXEEXT) subversion/tests/libsvn_subr/mergeinfo-test$(EXEEXT) subversion/tests/libsvn_client/mtcc-test$(EXEEXT) subversion/tests/libsvn_wc/op-depth-test$(EXEEXT) subversion/tests/libsvn_subr/opt-test$(EXEEXT) subversion/tests/libsvn_subr/packed-data-test$(EXEEXT) subversion/tests/libsvn_diff/parse-diff-test$(EXEEXT) su bversion/tests/libsvn_subr/path-test$(EXEEXT! ) subversion/tests/libsvn_subr/prefix-string-test$(EXEEXT) subversion/tests/libsvn_subr/priority-queue-test$(EXEEXT) subversion/tests/libsvn_wc/pristine-store-test$(EXEEXT) subversion/tests/libsvn_ra_local/ra-local-test$(EXEEXT) subversion/tests/libsvn_ra/ra-test$(EXEEXT) subversion/tests/libsvn_delta/random-test$(EXEEXT) subversion/tests/libsvn_repos/repos-test$(EXEEXT) subversion/tests/libsvn_subr/revision-test$(EXEEXT) subversion/tests/libsvn_subr/root-pools-test$(EXEEXT) subversion/tests/libsvn_subr/skel-test$(EXEEXT) subversion/tests/libsvn_subr/spillbuf-test$(EXEEXT) subversion/tests/libsvn_subr/sqlite-test$(EXEEXT) subversion/tests/libsvn_subr/stream-test$(EXEEXT) subversion/tests/libsvn_fs_x/string-table-test$(EXEEXT) subversion/tests/libsvn_subr/string-test$(EXEEXT) subversion/tests/libsvn_subr/subst_translate-test$(EXEEXT) tools/dev/wc-ng/svn-wc-db-tester$(EXEEXT) tools/server-side/svnauthz$(EXEEXT) tools/server-side/svnauthz-validate$(EXEEXT) subversion/tests/libsvn_delta /svndiff-stream-test$(EXEEXT) subversion/tests/libsvn_delta/svndiff-test$(EXEEXT) tools/dev/svnmover/svnmover$(EXEEXT) subversion/tests/libsvn_subr/time-test$(EXEEXT) subversion/tests/libsvn_subr/translate-test$(EXEEXT) subversion/tests/libsvn_subr/utf-test$(EXEEXT) subversion/tests/libsvn_delta/vdelta-test$(EXEEXT) subversion/tests/libsvn_wc/wc-incomplete-tester$(EXEEXT) subversion/tests/libsvn_wc/wc-lock-tester$(EXEEXT) subversion/tests/libsvn_wc/wc-queries-test$(EXEEXT) subversion/tests/libsvn_wc/wc-test$(EXEEXT) subversion/tests/libsvn_delta/window-test$(EXEEXT) subversion/tests/libsvn_subr/x509-test$(EXEEXT) subversion/tests/libsvn_subr/xml-test$(EXEEXT) subversion/tests/cmdline/authz_tests.py subversion/tests/cmdline/autoprop_tests.py subversion/tests/cmdline/basic_tests.py subversion/tests/cmdline/blame_tests.py subversion/tests/cmdline/cat_tests.py subversion/tests/cmdline/changelist_tests.py subversion/tests/cmdline/checkout_tests.py subversion/tests/cmdline/commit_tests.py subversion/tests/cmdline/copy_tests.py subv! ersion/te! sts/cmdline/dav_tests.py subversion/tests/cmdline/depth_tests.py subversion/tests/cmdline/diff_tests.py subversion/tests/cmdline/entries_tests.py subversion/tests/cmdline/export_tests.py subversion/tests/cmdline/externals_tests.py subversion/tests/cmdline/getopt_tests.py subversion/tests/cmdline/history_tests.py subversion/tests/cmdline/import_tests.py subversion/tests/cmdline/info_tests.py subversion/tests/cmdline/input_validation_tests.py subversion/tests/cmdline/iprop_authz_tests.py subversion/tests/cmdline/iprop_tests.py subversion/tests/cmdline/lock_tests.py subversion/tests/cmdline/log_tests.py subversion/tests/cmdline/merge_authz_tests.py subversion/tests/cmdline/merge_automatic_tests.py subversion/tests/cmdline/merge_reintegrate_tests.py subversion/tests/cmdline/merge_tests.py subversion/tests/cmdline/merge_tree_conflict_tests.py subversion/tests/cmdline/mergeinfo_tests.py subversion/tests/cmdline/mod_authz_svn_tests.py subversion/tests/cmdline/mod_dav_svn_tests.py subversio n/tests/cmdline/move_tests.py subversion/tests/cmdline/patch_tests.py subversion/tests/cmdline/pegrev_parse_tests.py subversion/tests/cmdline/prop_tests.py subversion/tests/cmdline/redirect_tests.py subversion/tests/cmdline/relocate_tests.py subversion/tests/cmdline/resolve_tests.py subversion/tests/cmdline/revert_tests.py subversion/tests/cmdline/schedule_tests.py subversion/tests/cmdline/shelf2_tests.py subversion/tests/cmdline/shelf_tests.py subversion/tests/cmdline/special_tests.py subversion/tests/cmdline/stat_tests.py subversion/tests/cmdline/svnadmin_tests.py subversion/tests/cmdline/svnauthz_tests.py subversion/tests/cmdline/svndumpfilter_tests.py subversion/tests/cmdline/svnfsfs_tests.py subversion/tests/cmdline/svnlook_tests.py subversion/tests/cmdline/svnmover_tests.py subversion/tests/cmdline/svnmucc_tests.py subversion/tests/cmdline/svnrdump_tests.py subversion/tests/cmdline/svnsync_authz_tests.py subversion/tests/cmdline/svnsync_tests.py subversion/tests/cmdline/svnver sion_tests.py subversion/tests/cmdline/switc! h_tests.p! y subversion/tests/cmdline/trans_tests.py subversion/tests/cmdline/tree_conflict_tests.py subversion/tests/cmdline/update_tests.py subversion/tests/cmdline/upgrade_tests.py subversion/tests/cmdline/wc_tests.py -TEST_PROGRAMS = subversion/tests/libsvn_subr/auth-test$(EXEEXT) subversion/tests/libsvn_repos/authz-test$(EXEEXT) subversion/tests/libsvn_subr/bit-array-test$(EXEEXT) subversion/tests/libsvn_subr/cache-test$(EXEEXT) subversion/tests/libsvn_subr/checksum-test$(EXEEXT) subversion/tests/libsvn_client/client-test$(EXEEXT) subversion/tests/libsvn_subr/compat-test$(EXEEXT) subversion/tests/libsvn_subr/compress-test$(EXEEXT) subversion/tests/libsvn_subr/config-test$(EXEEXT) subversion/tests/libsvn_wc/conflict-data-test$(EXEEXT) subversion/tests/libsvn_client/conflicts-test$(EXEEXT) subversion/tests/libsvn_subr/crypto-test$(EXEEXT) subversion/tests/libsvn_wc/db-test$(EXEEXT) subversion/tests/libsvn_diff/diff-diff3-test$(EXEEXT) subversion/tests/libsvn_subr/dirent_uri-test$(EXEEXT) subversion/tests/libsvn_repos/dump-load-test$(EXEEXT) subversion/tests/libsvn_wc/entries-compat-test$(EXEEXT) subversion/tests/libsvn_subr/error-code-test$(EXEEXT) subversion/tests/libsvn_subr/error-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-pack-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-private-test$(EXEEXT) subversion/tests/libsvn_fs/fs-sequential-test$(EXEEXT) subversion/tests/libsvn_fs/fs-test$(EXEEXT) subversion/tests/libsvn_fs_x/fs-x-pack-test$(EXEEXT) subversion/tests/libsvn_subr/hashdump-test$(EXEEXT) subversion/tests/libsvn_subr/io-test$(EXEEXT) subversion/tests/libsvn_fs/locks-test$(EXEEXT) subversion/tests/libsvn_subr/mergeinfo-test$(EXEEXT) subversion/tests/libsvn_client/mtcc-test$(EXEEXT) subversion/tests/libsvn_wc/op-depth-test$(EXEEXT) subversion/tests/libsvn_subr/opt-test$(EXEEXT) subversion/tests/libsvn_subr/packed-data-test$(EXEEXT) subversion/tests/libsvn_diff/parse-diff-test$(EXEEXT) subversion/tests/libsvn_subr/path-test$(EXEEXT) subversion/tests/libsvn_subr/prefix-string-test$(EXEEXT) subversion/tests/libsvn_subr/priority-queue-test$(EXEEXT) subversion/tests/libsvn_wc/pristine-store-test$(EXEEXT) subversion/tests/libsvn_ra_local/ra-local-test$(EXEEXT) sub version/tests/libsvn_ra/ra-test$(EXEEXT) sub! version/tests/libsvn_delta/random-test$(EXEEXT) subversion/tests/libsvn_repos/repos-test$(EXEEXT) subversion/tests/libsvn_subr/revision-test$(EXEEXT) subversion/tests/libsvn_subr/root-pools-test$(EXEEXT) subversion/tests/libsvn_subr/skel-test$(EXEEXT) subversion/tests/libsvn_subr/spillbuf-test$(EXEEXT) subversion/tests/libsvn_subr/sqlite-test$(EXEEXT) subversion/tests/libsvn_subr/stream-test$(EXEEXT) subversion/tests/libsvn_fs_x/string-table-test$(EXEEXT) subversion/tests/libsvn_subr/string-test$(EXEEXT) subversion/tests/libsvn_subr/subst_translate-test$(EXEEXT) subversion/tests/libsvn_delta/svndiff-stream-test$(EXEEXT) subversion/tests/libsvn_subr/time-test$(EXEEXT) subversion/tests/libsvn_subr/translate-test$(EXEEXT) subversion/tests/libsvn_subr/utf-test$(EXEEXT) subversion/tests/libsvn_wc/wc-queries-test$(EXEEXT) subversion/tests/libsvn_wc/wc-test$(EXEEXT) subversion/tests/libsvn_delta/window-test$(EXEEXT) subversion/tests/libsvn_subr/x509-test$(EXEEXT) subversion/tests/libsvn_su br/xml-test$(EXEEXT) subversion/tests/cmdline/authz_tests.py subversion/tests/cmdline/autoprop_tests.py subversion/tests/cmdline/basic_tests.py subversion/tests/cmdline/blame_tests.py subversion/tests/cmdline/cat_tests.py subversion/tests/cmdline/changelist_tests.py subversion/tests/cmdline/checkout_tests.py subversion/tests/cmdline/commit_tests.py subversion/tests/cmdline/copy_tests.py subversion/tests/cmdline/dav_tests.py subversion/tests/cmdline/depth_tests.py subversion/tests/cmdline/diff_tests.py subversion/tests/cmdline/entries_tests.py subversion/tests/cmdline/export_tests.py subversion/tests/cmdline/externals_tests.py subversion/tests/cmdline/getopt_tests.py subversion/tests/cmdline/history_tests.py subversion/tests/cmdline/import_tests.py subversion/tests/cmdline/info_tests.py subversion/tests/cmdline/input_validation_tests.py subversion/tests/cmdline/iprop_authz_tests.py subversion/tests/cmdline/iprop_tests.py subversion/tests/cmdline/lock_tests.py subversion/tests/cmdline /log_tests.py subversion/tests/cmdline/merge! _authz_te! sts.py subversion/tests/cmdline/merge_automatic_tests.py subversion/tests/cmdline/merge_reintegrate_tests.py subversion/tests/cmdline/merge_tests.py subversion/tests/cmdline/merge_tree_conflict_tests.py subversion/tests/cmdline/mergeinfo_tests.py subversion/tests/cmdline/mod_authz_svn_tests.py subversion/tests/cmdline/mod_dav_svn_tests.py subversion/tests/cmdline/move_tests.py subversion/tests/cmdline/patch_tests.py subversion/tests/cmdline/pegrev_parse_tests.py subversion/tests/cmdline/prop_tests.py subversion/tests/cmdline/redirect_tests.py subversion/tests/cmdline/relocate_tests.py subversion/tests/cmdline/resolve_tests.py subversion/tests/cmdline/revert_tests.py subversion/tests/cmdline/schedule_tests.py subversion/tests/cmdline/shelf2_tests.py subversion/tests/cmdline/shelf_tests.py subversion/tests/cmdline/special_tests.py subversion/tests/cmdline/stat_tests.py subversion/tests/cmdline/svnadmin_tests.py subversion/tests/cmdline/svnauthz_tests.py subversion/tests/cmdline/svndum pfilter_tests.py subversion/tests/cmdline/svnfsfs_tests.py subversion/tests/cmdline/svnlook_tests.py subversion/tests/cmdline/svnmover_tests.py subversion/tests/cmdline/svnmucc_tests.py subversion/tests/cmdline/svnrdump_tests.py subversion/tests/cmdline/svnsync_authz_tests.py subversion/tests/cmdline/svnsync_tests.py subversion/tests/cmdline/svnversion_tests.py subversion/tests/cmdline/switch_tests.py subversion/tests/cmdline/trans_tests.py subversion/tests/cmdline/tree_conflict_tests.py subversion/tests/cmdline/update_tests.py subversion/tests/cmdline/upgrade_tests.py subversion/tests/cmdline/wc_tests.py +TEST_PROGRAMS = subversion/tests/libsvn_subr/auth-test$(EXEEXT) subversion/tests/libsvn_repos/authz-test$(EXEEXT) subversion/tests/libsvn_subr/bit-array-test$(EXEEXT) subversion/tests/libsvn_subr/cache-test$(EXEEXT) subversion/tests/libsvn_subr/checksum-test$(EXEEXT) subversion/tests/libsvn_client/client-test$(EXEEXT) subversion/tests/libsvn_subr/compat-test$(EXEEXT) subversion/tests/libsvn_subr/compress-test$(EXEEXT) subversion/tests/libsvn_subr/config-test$(EXEEXT) subversion/tests/libsvn_wc/conflict-data-test$(EXEEXT) subversion/tests/libsvn_client/conflicts-test$(EXEEXT) subversion/tests/libsvn_subr/crypto-test$(EXEEXT) subversion/tests/libsvn_wc/db-test$(EXEEXT) subversion/tests/libsvn_diff/diff-diff3-test$(EXEEXT) subversion/tests/libsvn_subr/dirent_uri-test$(EXEEXT) subversion/tests/libsvn_repos/dump-load-test$(EXEEXT) subversion/tests/libsvn_wc/entries-compat-test$(EXEEXT) subversion/tests/libsvn_subr/error-code-test$(EXEEXT) subversion/tests/libsvn_subr/error-test$(EXEEXT) subversion/tests/client/filesize-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-pack-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-private-test$(EXEEXT) subversion/tests/libsvn_fs/fs-sequential-test$(EXEEXT) subversion/tests/libsvn_fs/fs-test$(EXEEXT) subversion/tests/libsvn_fs_x/fs-x-pack-test$(EXEEXT) subversion/tests/libsvn_subr/hashdump-test$(EXEEXT) subversion/tests/libsvn_subr/io-test$(EXEEXT) subversion/tests/libsvn_fs/locks-test$(EXEEXT) subversion/tests/libsvn_subr/mergeinfo-test$(EXEEXT) subversion/tests/libsvn_client/mtcc-test$(EXEEXT) subversion/tests/libsvn_wc/op-depth-test$(EXEEXT) subversion/tests/libsvn_subr/opt-test$(EXEEXT) subversion/tests/libsvn_subr/packed-data-test$(EXEEXT) subversion/tests/libsvn_diff/parse-diff-test$(EXEEXT) subversion/tests/libsvn_subr/path-test$(EXEEXT) subversion/tests/libsvn_subr/prefix-string-test$(EXEEXT) subversion/tests/libsvn_subr/priority-queue-test$(EXEEXT) subversion/tests/libsvn_wc/pristine-store-test$(EXEEXT) subversion/t ests/libsvn_ra_local/ra-local-test$(EXEEXT) ! subversion/tests/libsvn_ra/ra-test$(EXEEXT) subversion/tests/libsvn_delta/random-test$(EXEEXT) subversion/tests/libsvn_repos/repos-test$(EXEEXT) subversion/tests/libsvn_subr/revision-test$(EXEEXT) subversion/tests/libsvn_subr/root-pools-test$(EXEEXT) subversion/tests/libsvn_subr/skel-test$(EXEEXT) subversion/tests/libsvn_subr/spillbuf-test$(EXEEXT) subversion/tests/libsvn_subr/sqlite-test$(EXEEXT) subversion/tests/libsvn_subr/stream-test$(EXEEXT) subversion/tests/libsvn_fs_x/string-table-test$(EXEEXT) subversion/tests/libsvn_subr/string-test$(EXEEXT) subversion/tests/libsvn_subr/subst_translate-test$(EXEEXT) subversion/tests/libsvn_delta/svndiff-stream-test$(EXEEXT) subversion/tests/libsvn_subr/time-test$(EXEEXT) subversion/tests/libsvn_subr/translate-test$(EXEEXT) subversion/tests/libsvn_subr/utf-test$(EXEEXT) subversion/tests/libsvn_wc/wc-queries-test$(EXEEXT) subversion/tests/libsvn_wc/wc-test$(EXEEXT) subversion/tests/libsvn_delta/window-test$(EXEEXT) subversion/tests/libsvn_sub r/x509-test$(EXEEXT) subversion/tests/libsvn_subr/xml-test$(EXEEXT) subversion/tests/cmdline/authz_tests.py subversion/tests/cmdline/autoprop_tests.py subversion/tests/cmdline/basic_tests.py subversion/tests/cmdline/blame_tests.py subversion/tests/cmdline/cat_tests.py subversion/tests/cmdline/changelist_tests.py subversion/tests/cmdline/checkout_tests.py subversion/tests/cmdline/commit_tests.py subversion/tests/cmdline/copy_tests.py subversion/tests/cmdline/dav_tests.py subversion/tests/cmdline/depth_tests.py subversion/tests/cmdline/diff_tests.py subversion/tests/cmdline/entries_tests.py subversion/tests/cmdline/export_tests.py subversion/tests/cmdline/externals_tests.py subversion/tests/cmdline/getopt_tests.py subversion/tests/cmdline/history_tests.py subversion/tests/cmdline/import_tests.py subversion/tests/cmdline/info_tests.py subversion/tests/cmdline/input_validation_tests.py subversion/tests/cmdline/iprop_authz_tests.py subversion/tests/cmdline/iprop_tests.py subversion/tests /cmdline/lock_tests.py subversion/tests/cmdl! ine/log_t! ests.py subversion/tests/cmdline/merge_authz_tests.py subversion/tests/cmdline/merge_automatic_tests.py subversion/tests/cmdline/merge_reintegrate_tests.py subversion/tests/cmdline/merge_tests.py subversion/tests/cmdline/merge_tree_conflict_tests.py subversion/tests/cmdline/mergeinfo_tests.py subversion/tests/cmdline/mod_authz_svn_tests.py subversion/tests/cmdline/mod_dav_svn_tests.py subversion/tests/cmdline/move_tests.py subversion/tests/cmdline/patch_tests.py subversion/tests/cmdline/pegrev_parse_tests.py subversion/tests/cmdline/prop_tests.py subversion/tests/cmdline/redirect_tests.py subversion/tests/cmdline/relocate_tests.py subversion/tests/cmdline/resolve_tests.py subversion/tests/cmdline/revert_tests.py subversion/tests/cmdline/schedule_tests.py subversion/tests/cmdline/shelf2_tests.py subversion/tests/cmdline/shelf_tests.py subversion/tests/cmdline/special_tests.py subversion/tests/cmdline/stat_tests.py subversion/tests/cmdline/svnadmin_tests.py subversion/tests/cmdline/sv nauthz_tests.py subversion/tests/cmdline/svndumpfilter_tests.py subversion/tests/cmdline/svnfsfs_tests.py subversion/tests/cmdline/svnlook_tests.py subversion/tests/cmdline/svnmover_tests.py subversion/tests/cmdline/svnmucc_tests.py subversion/tests/cmdline/svnrdump_tests.py subversion/tests/cmdline/svnsync_authz_tests.py subversion/tests/cmdline/svnsync_tests.py subversion/tests/cmdline/svnversion_tests.py subversion/tests/cmdline/switch_tests.py subversion/tests/cmdline/trans_tests.py subversion/tests/cmdline/tree_conflict_tests.py subversion/tests/cmdline/update_tests.py subversion/tests/cmdline/upgrade_tests.py subversion/tests/cmdline/wc_tests.py check-deps test-deps: subversion/tests/afl/afl-svndiff$(EXEEXT) subversion/tests/afl/afl-x509$(EXEEXT) subversion/tests/cmdline/atomic-ra-revprop-change$(EXEEXT) subversion/tests/cmdline/entries-dump$(EXEEXT) subversion/tests/cmdline/lock-helper$(EXEEXT) tools/dev/wc-ng/svn-wc-db-tester$(EXEEXT) tools/server-side/svnauthz$(EXEEXT) tools/server-side/svnauthz-validate$(EXEEXT) subversion/tests/libsvn_delta/svndiff-test$(EXEEXT) tools/dev/svnmover/svnmover$(EXEEXT) subversion/tests/libsvn_delta/vdelta-test$(EXEEXT) subversion/tests/libsvn_wc/wc-incomplete-tester$(EXEEXT) subversion/tests/libsvn_wc/wc-lock-tester$(EXEEXT) MANPAGES = subversion/svn/svn.1 subversion/svnadmin/svnadmin.1 subversion/svndumpfilter/svndumpfilter.1 subversion/svnlook/svnlook.1 subversion/svnmucc/svnmucc.1 subversion/svnrdump/svnrdump.1 subversion/svnserve/svnserve.8 subversion/svnserve/svnserve.conf.5 subversion/svnsync/svnsync.1 subversion/svnversion/svnversion.1 -CLEAN_FILES = subversion/bindings/cxx/svnxx-tests$(EXEEXT) subversion/svn/svn$(EXEEXT) subversion/svnadmin/svnadmin$(EXEEXT) subversion/svnbench/svnbench$(EXEEXT) subversion/svndumpfilter/svndumpfilter$(EXEEXT) subversion/svnfsfs/svnfsfs$(EXEEXT) subversion/svnlook/svnlook$(EXEEXT) subversion/svnmucc/svnmucc$(EXEEXT) subversion/svnrdump/svnrdump$(EXEEXT) subversion/svnserve/svnserve$(EXEEXT) subversion/svnsync/svnsync$(EXEEXT) subversion/svnversion/svnversion$(EXEEXT) subversion/tests/afl/afl-svndiff$(EXEEXT) subversion/tests/afl/afl-x509$(EXEEXT) subversion/tests/cmdline/atomic-ra-revprop-change$(EXEEXT) subversion/tests/cmdline/authz_tests.pyc subversion/tests/cmdline/autoprop_tests.pyc subversion/tests/cmdline/basic_tests.pyc subversion/tests/cmdline/blame_tests.pyc subversion/tests/cmdline/cat_tests.pyc subversion/tests/cmdline/changelist_tests.pyc subversion/tests/cmdline/checkout_tests.pyc subversion/tests/cmdline/commit_tests.pyc subversion/tests/cmdline/copy_tests.pyc subver sion/tests/cmdline/dav_tests.pyc subversion/tests/cmdline/depth_tests.pyc subversion/tests/cmdline/diff_tests.pyc subversion/tests/cmdline/entries-dump$(EXEEXT) subversion/tests/cmdline/entries_tests.pyc subversion/tests/cmdline/export_tests.pyc subversion/tests/cmdline/externals_tests.pyc subversion/tests/cmdline/getopt_tests.pyc subversion/tests/cmdline/history_tests.pyc subversion/tests/cmdline/import_tests.pyc subversion/tests/cmdline/info_tests.pyc subversion/tests/cmdline/input_validation_tests.pyc subversion/tests/cmdline/iprop_authz_tests.pyc subversion/tests/cmdline/iprop_tests.pyc subversion/tests/cmdline/lock-helper$(EXEEXT) subversion/tests/cmdline/lock_tests.pyc subversion/tests/cmdline/log_tests.pyc subversion/tests/cmdline/merge_authz_tests.pyc subversion/tests/cmdline/merge_automatic_tests.pyc subversion/tests/cmdline/merge_reintegrate_tests.pyc subversion/tests/cmdline/merge_tests.pyc subversion/tests/cmdline/merge_tree_conflict_tests.pyc subversion/tests/cmdline/me rgeinfo_tests.pyc subversion/tests/cmdline/m! od_authz_svn_tests.pyc subversion/tests/cmdline/mod_dav_svn_tests.pyc subversion/tests/cmdline/move_tests.pyc subversion/tests/cmdline/patch_tests.pyc subversion/tests/cmdline/pegrev_parse_tests.pyc subversion/tests/cmdline/prop_tests.pyc subversion/tests/cmdline/redirect_tests.pyc subversion/tests/cmdline/relocate_tests.pyc subversion/tests/cmdline/resolve_tests.pyc subversion/tests/cmdline/revert_tests.pyc subversion/tests/cmdline/schedule_tests.pyc subversion/tests/cmdline/shelf2_tests.pyc subversion/tests/cmdline/shelf_tests.pyc subversion/tests/cmdline/special_tests.pyc subversion/tests/cmdline/stat_tests.pyc subversion/tests/cmdline/svnadmin_tests.pyc subversion/tests/cmdline/svnauthz_tests.pyc subversion/tests/cmdline/svndumpfilter_tests.pyc subversion/tests/cmdline/svnfsfs_tests.pyc subversion/tests/cmdline/svnlook_tests.pyc subversion/tests/cmdline/svnmover_tests.pyc subversion/tests/cmdline/svnmucc_tests.pyc subversion/tests/cmdline/svnrdump_tests.pyc subversion/tests/cmdl ine/svnsync_authz_tests.pyc subversion/tests/cmdline/svnsync_tests.pyc subversion/tests/cmdline/svnversion_tests.pyc subversion/tests/cmdline/switch_tests.pyc subversion/tests/cmdline/trans_tests.pyc subversion/tests/cmdline/tree_conflict_tests.pyc subversion/tests/cmdline/update_tests.pyc subversion/tests/cmdline/upgrade_tests.pyc subversion/tests/cmdline/wc_tests.pyc subversion/tests/libsvn_client/client-test$(EXEEXT) subversion/tests/libsvn_client/conflicts-test$(EXEEXT) subversion/tests/libsvn_client/mtcc-test$(EXEEXT) subversion/tests/libsvn_delta/random-test$(EXEEXT) subversion/tests/libsvn_delta/svndiff-stream-test$(EXEEXT) subversion/tests/libsvn_delta/svndiff-test$(EXEEXT) subversion/tests/libsvn_delta/vdelta-test$(EXEEXT) subversion/tests/libsvn_delta/window-test$(EXEEXT) subversion/tests/libsvn_diff/diff-diff3-test$(EXEEXT) subversion/tests/libsvn_diff/parse-diff-test$(EXEEXT) subversion/tests/libsvn_fs/fs-sequential-test$(EXEEXT) subversion/tests/libsvn_fs/fs-test$(EXEEX T) subversion/tests/libsvn_fs/locks-test$(EX! EEXT) sub! version/tests/libsvn_fs_base/changes-test$(EXEEXT) subversion/tests/libsvn_fs_base/fs-base-test$(EXEEXT) subversion/tests/libsvn_fs_base/strings-reps-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-pack-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-private-test$(EXEEXT) subversion/tests/libsvn_fs_x/fs-x-pack-test$(EXEEXT) subversion/tests/libsvn_fs_x/string-table-test$(EXEEXT) subversion/tests/libsvn_ra/ra-test$(EXEEXT) subversion/tests/libsvn_ra_local/ra-local-test$(EXEEXT) subversion/tests/libsvn_repos/authz-test$(EXEEXT) subversion/tests/libsvn_repos/dump-load-test$(EXEEXT) subversion/tests/libsvn_repos/repos-test$(EXEEXT) subversion/tests/libsvn_subr/auth-test$(EXEEXT) subversion/tests/libsvn_subr/bit-array-test$(EXEEXT) subversion/tests/libsvn_subr/cache-test$(EXEEXT) subversion/tests/libsvn_subr/checksum-test$(EXEEXT) subversion/tests/libsvn_subr/compat-test$(EXEEXT) subversion/tests/libsvn_subr/compress-test$(EXEEX T) subversion/tests/libsvn_subr/config-test$(EXEEXT) subversion/tests/libsvn_subr/crypto-test$(EXEEXT) subversion/tests/libsvn_subr/dirent_uri-test$(EXEEXT) subversion/tests/libsvn_subr/error-code-test$(EXEEXT) subversion/tests/libsvn_subr/error-test$(EXEEXT) subversion/tests/libsvn_subr/hashdump-test$(EXEEXT) subversion/tests/libsvn_subr/io-test$(EXEEXT) subversion/tests/libsvn_subr/mergeinfo-test$(EXEEXT) subversion/tests/libsvn_subr/opt-test$(EXEEXT) subversion/tests/libsvn_subr/packed-data-test$(EXEEXT) subversion/tests/libsvn_subr/path-test$(EXEEXT) subversion/tests/libsvn_subr/prefix-string-test$(EXEEXT) subversion/tests/libsvn_subr/priority-queue-test$(EXEEXT) subversion/tests/libsvn_subr/revision-test$(EXEEXT) subversion/tests/libsvn_subr/root-pools-test$(EXEEXT) subversion/tests/libsvn_subr/skel-test$(EXEEXT) subversion/tests/libsvn_subr/spillbuf-test$(EXEEXT) subversion/tests/libsvn_subr/sqlite-test$(EXEEXT) subversion/tests/libsvn_subr/stream-test$(EXEEXT) subversion/test s/libsvn_subr/string-test$(EXEEXT) subversio! n/tests/l! ibsvn_subr/subst_translate-test$(EXEEXT) subversion/tests/libsvn_subr/time-test$(EXEEXT) subversion/tests/libsvn_subr/translate-test$(EXEEXT) subversion/tests/libsvn_subr/utf-test$(EXEEXT) subversion/tests/libsvn_subr/x509-test$(EXEEXT) subversion/tests/libsvn_subr/xml-test$(EXEEXT) subversion/tests/libsvn_wc/conflict-data-test$(EXEEXT) subversion/tests/libsvn_wc/db-test$(EXEEXT) subversion/tests/libsvn_wc/entries-compat-test$(EXEEXT) subversion/tests/libsvn_wc/op-depth-test$(EXEEXT) subversion/tests/libsvn_wc/pristine-store-test$(EXEEXT) subversion/tests/libsvn_wc/wc-incomplete-tester$(EXEEXT) subversion/tests/libsvn_wc/wc-lock-tester$(EXEEXT) subversion/tests/libsvn_wc/wc-queries-test$(EXEEXT) subversion/tests/libsvn_wc/wc-test$(EXEEXT) tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer$(EXEEXT) tools/client-side/svnconflict/svnconflict$(EXEEXT) tools/dev/fsfs-access-map$(EXEEXT) tools/dev/svnmover/svnmover$(EXEEXT) tools/dev/svnraisetreeconflict/svnraisetreeconfl ict$(EXEEXT) tools/dev/wc-ng/svn-wc-db-tester$(EXEEXT) tools/dev/x509-parser$(EXEEXT) tools/diff/diff$(EXEEXT) tools/diff/diff3$(EXEEXT) tools/diff/diff4$(EXEEXT) tools/server-side/svn-populate-node-origins-index$(EXEEXT) tools/server-side/svnauthz$(EXEEXT) tools/server-side/svnauthz-validate$(EXEEXT) +CLEAN_FILES = subversion/bindings/cxx/svnxx-tests$(EXEEXT) subversion/svn/svn$(EXEEXT) subversion/svnadmin/svnadmin$(EXEEXT) subversion/svnbench/svnbench$(EXEEXT) subversion/svndumpfilter/svndumpfilter$(EXEEXT) subversion/svnfsfs/svnfsfs$(EXEEXT) subversion/svnlook/svnlook$(EXEEXT) subversion/svnmucc/svnmucc$(EXEEXT) subversion/svnrdump/svnrdump$(EXEEXT) subversion/svnserve/svnserve$(EXEEXT) subversion/svnsync/svnsync$(EXEEXT) subversion/svnversion/svnversion$(EXEEXT) subversion/tests/afl/afl-svndiff$(EXEEXT) subversion/tests/afl/afl-x509$(EXEEXT) subversion/tests/client/filesize-test$(EXEEXT) subversion/tests/cmdline/atomic-ra-revprop-change$(EXEEXT) subversion/tests/cmdline/authz_tests.pyc subversion/tests/cmdline/autoprop_tests.pyc subversion/tests/cmdline/basic_tests.pyc subversion/tests/cmdline/blame_tests.pyc subversion/tests/cmdline/cat_tests.pyc subversion/tests/cmdline/changelist_tests.pyc subversion/tests/cmdline/checkout_tests.pyc subversion/tests/cmdline/commit_tests.pyc subversion/tests/cmdline/copy_tests.pyc subversion/tests/cmdline/dav_tests.pyc subversion/tests/cmdline/depth_tests.pyc subversion/tests/cmdline/diff_tests.pyc subversion/tests/cmdline/entries-dump$(EXEEXT) subversion/tests/cmdline/entries_tests.pyc subversion/tests/cmdline/export_tests.pyc subversion/tests/cmdline/externals_tests.pyc subversion/tests/cmdline/getopt_tests.pyc subversion/tests/cmdline/history_tests.pyc subversion/tests/cmdline/import_tests.pyc subversion/tests/cmdline/info_tests.pyc subversion/tests/cmdline/input_validation_tests.pyc subversion/tests/cmdline/iprop_authz_tests.pyc subversion/tests/cmdline/iprop_tests.pyc subversion/tests/cmdline/lock-helper$(EXEEXT) subversion/tests/cmdline/lock_tests.pyc subversion/tests/cmdline/log_tests.pyc subversion/tests/cmdline/merge_authz_tests.pyc subversion/tests/cmdline/merge_automatic_tests.pyc subversion/tests/cmdline/merge_reintegrate_tests.pyc subversion/tests/cmdline/merge_tests.pyc subversion/tests/cmdline/merge_tree _conflict_tests.pyc subversion/tests/cmdline! /mergeinfo_tests.pyc subversion/tests/cmdline/mod_authz_svn_tests.pyc subversion/tests/cmdline/mod_dav_svn_tests.pyc subversion/tests/cmdline/move_tests.pyc subversion/tests/cmdline/patch_tests.pyc subversion/tests/cmdline/pegrev_parse_tests.pyc subversion/tests/cmdline/prop_tests.pyc subversion/tests/cmdline/redirect_tests.pyc subversion/tests/cmdline/relocate_tests.pyc subversion/tests/cmdline/resolve_tests.pyc subversion/tests/cmdline/revert_tests.pyc subversion/tests/cmdline/schedule_tests.pyc subversion/tests/cmdline/shelf2_tests.pyc subversion/tests/cmdline/shelf_tests.pyc subversion/tests/cmdline/special_tests.pyc subversion/tests/cmdline/stat_tests.pyc subversion/tests/cmdline/svnadmin_tests.pyc subversion/tests/cmdline/svnauthz_tests.pyc subversion/tests/cmdline/svndumpfilter_tests.pyc subversion/tests/cmdline/svnfsfs_tests.pyc subversion/tests/cmdline/svnlook_tests.pyc subversion/tests/cmdline/svnmover_tests.pyc subversion/tests/cmdline/svnmucc_tests.pyc subversion/tests/c mdline/svnrdump_tests.pyc subversion/tests/cmdline/svnsync_authz_tests.pyc subversion/tests/cmdline/svnsync_tests.pyc subversion/tests/cmdline/svnversion_tests.pyc subversion/tests/cmdline/switch_tests.pyc subversion/tests/cmdline/trans_tests.pyc subversion/tests/cmdline/tree_conflict_tests.pyc subversion/tests/cmdline/update_tests.pyc subversion/tests/cmdline/upgrade_tests.pyc subversion/tests/cmdline/wc_tests.pyc subversion/tests/libsvn_client/client-test$(EXEEXT) subversion/tests/libsvn_client/conflicts-test$(EXEEXT) subversion/tests/libsvn_client/mtcc-test$(EXEEXT) subversion/tests/libsvn_delta/random-test$(EXEEXT) subversion/tests/libsvn_delta/svndiff-stream-test$(EXEEXT) subversion/tests/libsvn_delta/svndiff-test$(EXEEXT) subversion/tests/libsvn_delta/vdelta-test$(EXEEXT) subversion/tests/libsvn_delta/window-test$(EXEEXT) subversion/tests/libsvn_diff/diff-diff3-test$(EXEEXT) subversion/tests/libsvn_diff/parse-diff-test$(EXEEXT) subversion/tests/libsvn_fs/fs-sequential-test$(EX EEXT) subversion/tests/libsvn_fs/fs-test$(EX! EEXT) sub! version/tests/libsvn_fs/locks-test$(EXEEXT) subversion/tests/libsvn_fs_base/changes-test$(EXEEXT) subversion/tests/libsvn_fs_base/fs-base-test$(EXEEXT) subversion/tests/libsvn_fs_base/strings-reps-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-pack-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-private-test$(EXEEXT) subversion/tests/libsvn_fs_x/fs-x-pack-test$(EXEEXT) subversion/tests/libsvn_fs_x/string-table-test$(EXEEXT) subversion/tests/libsvn_ra/ra-test$(EXEEXT) subversion/tests/libsvn_ra_local/ra-local-test$(EXEEXT) subversion/tests/libsvn_repos/authz-test$(EXEEXT) subversion/tests/libsvn_repos/dump-load-test$(EXEEXT) subversion/tests/libsvn_repos/repos-test$(EXEEXT) subversion/tests/libsvn_subr/auth-test$(EXEEXT) subversion/tests/libsvn_subr/bit-array-test$(EXEEXT) subversion/tests/libsvn_subr/cache-test$(EXEEXT) subversion/tests/libsvn_subr/checksum-test$(EXEEXT) subversion/tests/libsvn_subr/compat-test$(EXEEXT) su bversion/tests/libsvn_subr/compress-test$(EXEEXT) subversion/tests/libsvn_subr/config-test$(EXEEXT) subversion/tests/libsvn_subr/crypto-test$(EXEEXT) subversion/tests/libsvn_subr/dirent_uri-test$(EXEEXT) subversion/tests/libsvn_subr/error-code-test$(EXEEXT) subversion/tests/libsvn_subr/error-test$(EXEEXT) subversion/tests/libsvn_subr/hashdump-test$(EXEEXT) subversion/tests/libsvn_subr/io-test$(EXEEXT) subversion/tests/libsvn_subr/mergeinfo-test$(EXEEXT) subversion/tests/libsvn_subr/opt-test$(EXEEXT) subversion/tests/libsvn_subr/packed-data-test$(EXEEXT) subversion/tests/libsvn_subr/path-test$(EXEEXT) subversion/tests/libsvn_subr/prefix-string-test$(EXEEXT) subversion/tests/libsvn_subr/priority-queue-test$(EXEEXT) subversion/tests/libsvn_subr/revision-test$(EXEEXT) subversion/tests/libsvn_subr/root-pools-test$(EXEEXT) subversion/tests/libsvn_subr/skel-test$(EXEEXT) subversion/tests/libsvn_subr/spillbuf-test$(EXEEXT) subversion/tests/libsvn_subr/sqlite-test$(EXEEXT) subversion/tests/l ibsvn_subr/stream-test$(EXEEXT) subversion/t! ests/libs! vn_subr/string-test$(EXEEXT) subversion/tests/libsvn_subr/subst_translate-test$(EXEEXT) subversion/tests/libsvn_subr/time-test$(EXEEXT) subversion/tests/libsvn_subr/translate-test$(EXEEXT) subversion/tests/libsvn_subr/utf-test$(EXEEXT) subversion/tests/libsvn_subr/x509-test$(EXEEXT) subversion/tests/libsvn_subr/xml-test$(EXEEXT) subversion/tests/libsvn_wc/conflict-data-test$(EXEEXT) subversion/tests/libsvn_wc/db-test$(EXEEXT) subversion/tests/libsvn_wc/entries-compat-test$(EXEEXT) subversion/tests/libsvn_wc/op-depth-test$(EXEEXT) subversion/tests/libsvn_wc/pristine-store-test$(EXEEXT) subversion/tests/libsvn_wc/wc-incomplete-tester$(EXEEXT) subversion/tests/libsvn_wc/wc-lock-tester$(EXEEXT) subversion/tests/libsvn_wc/wc-queries-test$(EXEEXT) subversion/tests/libsvn_wc/wc-test$(EXEEXT) tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer$(EXEEXT) tools/client-side/svnconflict/svnconflict$(EXEEXT) tools/dev/fsfs-access-map$(EXEEXT) tools/dev/svnmover/svnmover$(EXEEXT) t ools/dev/svnraisetreeconflict/svnraisetreeconflict$(EXEEXT) tools/dev/wc-ng/svn-wc-db-tester$(EXEEXT) tools/dev/x509-parser$(EXEEXT) tools/diff/diff$(EXEEXT) tools/diff/diff3$(EXEEXT) tools/diff/diff4$(EXEEXT) tools/server-side/svn-populate-node-origins-index$(EXEEXT) tools/server-side/svnauthz$(EXEEXT) tools/server-side/svnauthz-validate$(EXEEXT) EXTRACLEAN_FILES = subversion/libsvn_fs_fs/rep-cache-db.h subversion/libsvn_fs_x/rep-cache-db.h subversion/libsvn_subr/internal_statements.h subversion/libsvn_wc/wc-queries.h subversion/tests/libsvn_wc/wc-test-queries.h \ $(abs_builddir)/subversion/libsvn_subr/errorcode.inc \ $(abs_builddir)/subversion/libsvn_subr/config_keys.inc \ @@ -285,6 +285,12 @@ error_test_OBJECTS = error-test.lo subversion/tests/libsvn_subr/error-test$(EXEEXT): $(error_test_DEPS) cd subversion/tests/libsvn_subr && $(LINK) $(error_test_LDFLAGS) -o error-test$(EXEEXT) $(error_test_OBJECTS) ../../../subversion/tests/libsvn_test-1.la ../../../subversion/libsvn_subr/libsvn_subr-1.la $(SVN_APRUTIL_LIBS) $(SVN_APR_LIBS) $(LIBS) +filesize_test_PATH = subversion/tests/client +filesize_test_DEPS = subversion/tests/client/filesize-test.lo subversion/libsvn_client/libsvn_client-1.la subversion/tests/libsvn_test-1.la subversion/libsvn_wc/libsvn_wc-1.la subversion/libsvn_subr/libsvn_subr-1.la +filesize_test_OBJECTS = filesize-test.lo +subversion/tests/client/filesize-test$(EXEEXT): $(filesize_test_DEPS) + cd subversion/tests/client && $(LINK) $(filesize_test_LDFLAGS) -o filesize-test$(EXEEXT) $(filesize_test_OBJECTS) ../../../subversion/libsvn_client/libsvn_client-1.la ../../../subversion/tests/libsvn_test-1.la ../../../subversion/libsvn_wc/libsvn_wc-1.la ../../../subversion/libsvn_subr/libsvn_subr-1.la $(SVN_APRUTIL_LIBS) $(SVN_APR_LIBS) $(LIBS) + fs_base_test_PATH = subversion/tests/libsvn_fs_base fs_base_test_DEPS = subversion/tests/libsvn_fs_base/fs-base-test.lo subversion/tests/libsvn_test-1.la subversion/libsvn_fs/libsvn_fs-1.la subversion/libsvn_fs_base/libsvn_fs_base-1.la subversion/libsvn_delta/libsvn_delta-1.la subversion/libsvn_fs_util/libsvn_fs_util-1.la subversion/libsvn_subr/libsvn_subr-1.la fs_base_test_OBJECTS = fs-base-test.lo @@ -518,8 +524,8 @@ subversion/libsvn_repos/libsvn_repos-1.la: $(libsvn_repos_DEPS) cd subversion/libsvn_repos && $(LINK_LIB) $(libsvn_repos_LDFLAGS) -o libsvn_repos-1.la $(LT_NO_UNDEFINED) $(libsvn_repos_OBJECTS) ../../subversion/libsvn_fs/libsvn_fs-1.la ../../subversion/libsvn_delta/libsvn_delta-1.la ../../subversion/libsvn_subr/libsvn_subr-1.la $(SVN_APRUTIL_LIBS) $(SVN_APR_LIBS) $(LIBS) libsvn_subr_PATH = subversion/libsvn_subr -libsvn_subr_DEPS = subversion/libsvn_subr/adler32.lo subversion/libsvn_subr/atomic.lo subversion/libsvn_subr/auth.lo subversion/libsvn_subr/base64.lo subversion/libsvn_subr/bit_array.lo subversion/libsvn_subr/cache-inprocess.lo subversion/libsvn_subr/cache-membuffer.lo subversion/libsvn_subr/cache-memcache.lo subversion/libsvn_subr/cache-null.lo subversion/libsvn_subr/cache.lo subversion/libsvn_subr/cache_config.lo subversion/libsvn_subr/checksum.lo subversion/libsvn_subr/cmdline.lo subversion/libsvn_subr/compat.lo subversion/libsvn_subr/compress_lz4.lo subversion/libsvn_subr/compress_zlib.lo subversion/libsvn_subr/config.lo subversion/libsvn_subr/config_auth.lo subversion/libsvn_subr/config_file.lo subversion/libsvn_subr/config_win.lo subversion/libsvn_subr/crypto.lo subversion/libsvn_subr/ctype.lo subversion/libsvn_subr/date.lo subversion/libsvn_subr/debug.lo subversion/libsvn_subr/deprecated.lo subversion/libsvn_subr/dirent_uri.lo subversion/libsvn_subr/dso.lo subversion/libsvn_s ubr/encode.lo subversion/libsvn_subr/eol.lo subversion/libsvn_subr/error.lo subversion/libsvn_subr/fnv1a.lo subversion/libsvn_subr/gpg_agent.lo subversion/libsvn_subr/hash.lo subversion/libsvn_subr/io.lo subversion/libsvn_subr/iter.lo subversion/libsvn_subr/lock.lo subversion/libsvn_subr/log.lo subversion/libsvn_subr/lz4/lz4.lo subversion/libsvn_subr/macos_keychain.lo subversion/libsvn_subr/magic.lo subversion/libsvn_subr/md5.lo subversion/libsvn_subr/mergeinfo.lo subversion/libsvn_subr/mutex.lo subversion/libsvn_subr/nls.lo subversion/libsvn_subr/object_pool.lo subversion/libsvn_subr/opt.lo subversion/libsvn_subr/packed_data.lo subversion/libsvn_subr/path.lo subversion/libsvn_subr/pool.lo subversion/libsvn_subr/prefix_string.lo subversion/libsvn_subr/prompt.lo subversion/libsvn_subr/properties.lo subversion/libsvn_subr/quoprint.lo subversion/libsvn_subr/root_pools.lo subversion/libsvn_subr/simple_providers.lo subversion/libsvn_subr/skel.lo subversion/libsvn_subr/sorts.lo subversion /libsvn_subr/spillbuf.lo subversion/libsvn_s! ubr/sqlite.lo subversion/libsvn_subr/sqlite3wrapper.lo subversion/libsvn_subr/ssl_client_cert_providers.lo subversion/libsvn_subr/ssl_client_cert_pw_providers.lo subversion/libsvn_subr/ssl_server_trust_providers.lo subversion/libsvn_subr/stream.lo subversion/libsvn_subr/string.lo subversion/libsvn_subr/subst.lo subversion/libsvn_subr/sysinfo.lo subversion/libsvn_subr/target.lo subversion/libsvn_subr/temp_serializer.lo subversion/libsvn_subr/time.lo subversion/libsvn_subr/token.lo subversion/libsvn_subr/types.lo subversion/libsvn_subr/user.lo subversion/libsvn_subr/username_providers.lo subversion/libsvn_subr/utf.lo subversion/libsvn_subr/utf8proc.lo subversion/libsvn_subr/utf_validate.lo subversion/libsvn_subr/utf_width.lo subversion/libsvn_subr/validate.lo subversion/libsvn_subr/version.lo subversion/libsvn_subr/win32_crashrpt.lo subversion/libsvn_subr/win32_crypto.lo subversion/libsvn_subr/win32_xlate.lo subversion/libsvn_subr/x509info.lo subversion/libsvn_subr/x509parse.lo subver sion/libsvn_subr/xml.lo -libsvn_subr_OBJECTS = adler32.lo atomic.lo auth.lo base64.lo bit_array.lo cache-inprocess.lo cache-membuffer.lo cache-memcache.lo cache-null.lo cache.lo cache_config.lo checksum.lo cmdline.lo compat.lo compress_lz4.lo compress_zlib.lo config.lo config_auth.lo config_file.lo config_win.lo crypto.lo ctype.lo date.lo debug.lo deprecated.lo dirent_uri.lo dso.lo encode.lo eol.lo error.lo fnv1a.lo gpg_agent.lo hash.lo io.lo iter.lo lock.lo log.lo lz4/lz4.lo macos_keychain.lo magic.lo md5.lo mergeinfo.lo mutex.lo nls.lo object_pool.lo opt.lo packed_data.lo path.lo pool.lo prefix_string.lo prompt.lo properties.lo quoprint.lo root_pools.lo simple_providers.lo skel.lo sorts.lo spillbuf.lo sqlite.lo sqlite3wrapper.lo ssl_client_cert_providers.lo ssl_client_cert_pw_providers.lo ssl_server_trust_providers.lo stream.lo string.lo subst.lo sysinfo.lo target.lo temp_serializer.lo time.lo token.lo types.lo user.lo username_providers.lo utf.lo utf8proc.lo utf_validate.lo utf_width.lo validate.lo versi on.lo win32_crashrpt.lo win32_crypto.lo win32_xlate.lo x509info.lo x509parse.lo xml.lo +libsvn_subr_DEPS = subversion/libsvn_subr/adler32.lo subversion/libsvn_subr/apr_escape.lo subversion/libsvn_subr/atomic.lo subversion/libsvn_subr/auth.lo subversion/libsvn_subr/base64.lo subversion/libsvn_subr/bit_array.lo subversion/libsvn_subr/cache-inprocess.lo subversion/libsvn_subr/cache-membuffer.lo subversion/libsvn_subr/cache-memcache.lo subversion/libsvn_subr/cache-null.lo subversion/libsvn_subr/cache.lo subversion/libsvn_subr/cache_config.lo subversion/libsvn_subr/checksum.lo subversion/libsvn_subr/cmdline.lo subversion/libsvn_subr/compat.lo subversion/libsvn_subr/compress_lz4.lo subversion/libsvn_subr/compress_zlib.lo subversion/libsvn_subr/config.lo subversion/libsvn_subr/config_auth.lo subversion/libsvn_subr/config_file.lo subversion/libsvn_subr/config_win.lo subversion/libsvn_subr/crypto.lo subversion/libsvn_subr/ctype.lo subversion/libsvn_subr/date.lo subversion/libsvn_subr/debug.lo subversion/libsvn_subr/deprecated.lo subversion/libsvn_subr/dirent_uri.lo subversion/l ibsvn_subr/dso.lo subversion/libsvn_subr/encode.lo subversion/libsvn_subr/eol.lo subversion/libsvn_subr/error.lo subversion/libsvn_subr/fnv1a.lo subversion/libsvn_subr/gpg_agent.lo subversion/libsvn_subr/hash.lo subversion/libsvn_subr/io.lo subversion/libsvn_subr/iter.lo subversion/libsvn_subr/lock.lo subversion/libsvn_subr/log.lo subversion/libsvn_subr/lz4/lz4.lo subversion/libsvn_subr/macos_keychain.lo subversion/libsvn_subr/magic.lo subversion/libsvn_subr/md5.lo subversion/libsvn_subr/mergeinfo.lo subversion/libsvn_subr/mutex.lo subversion/libsvn_subr/nls.lo subversion/libsvn_subr/object_pool.lo subversion/libsvn_subr/opt.lo subversion/libsvn_subr/packed_data.lo subversion/libsvn_subr/path.lo subversion/libsvn_subr/pool.lo subversion/libsvn_subr/prefix_string.lo subversion/libsvn_subr/prompt.lo subversion/libsvn_subr/properties.lo subversion/libsvn_subr/quoprint.lo subversion/libsvn_subr/root_pools.lo subversion/libsvn_subr/simple_providers.lo subversion/libsvn_subr/skel.lo subve rsion/libsvn_subr/sorts.lo subversion/libsvn! _subr/spillbuf.lo subversion/libsvn_subr/sqlite.lo subversion/libsvn_subr/sqlite3wrapper.lo subversion/libsvn_subr/ssl_client_cert_providers.lo subversion/libsvn_subr/ssl_client_cert_pw_providers.lo subversion/libsvn_subr/ssl_server_trust_providers.lo subversion/libsvn_subr/stream.lo subversion/libsvn_subr/string.lo subversion/libsvn_subr/subst.lo subversion/libsvn_subr/sysinfo.lo subversion/libsvn_subr/target.lo subversion/libsvn_subr/temp_serializer.lo subversion/libsvn_subr/time.lo subversion/libsvn_subr/token.lo subversion/libsvn_subr/types.lo subversion/libsvn_subr/user.lo subversion/libsvn_subr/username_providers.lo subversion/libsvn_subr/utf.lo subversion/libsvn_subr/utf8proc.lo subversion/libsvn_subr/utf_validate.lo subversion/libsvn_subr/utf_width.lo subversion/libsvn_subr/validate.lo subversion/libsvn_subr/version.lo subversion/libsvn_subr/win32_crashrpt.lo subversion/libsvn_subr/win32_crypto.lo subversion/libsvn_subr/win32_xlate.lo subversion/libsvn_subr/x509info.lo subve rsion/libsvn_subr/x509parse.lo subversion/libsvn_subr/xml.lo +libsvn_subr_OBJECTS = adler32.lo apr_escape.lo atomic.lo auth.lo base64.lo bit_array.lo cache-inprocess.lo cache-membuffer.lo cache-memcache.lo cache-null.lo cache.lo cache_config.lo checksum.lo cmdline.lo compat.lo compress_lz4.lo compress_zlib.lo config.lo config_auth.lo config_file.lo config_win.lo crypto.lo ctype.lo date.lo debug.lo deprecated.lo dirent_uri.lo dso.lo encode.lo eol.lo error.lo fnv1a.lo gpg_agent.lo hash.lo io.lo iter.lo lock.lo log.lo lz4/lz4.lo macos_keychain.lo magic.lo md5.lo mergeinfo.lo mutex.lo nls.lo object_pool.lo opt.lo packed_data.lo path.lo pool.lo prefix_string.lo prompt.lo properties.lo quoprint.lo root_pools.lo simple_providers.lo skel.lo sorts.lo spillbuf.lo sqlite.lo sqlite3wrapper.lo ssl_client_cert_providers.lo ssl_client_cert_pw_providers.lo ssl_server_trust_providers.lo stream.lo string.lo subst.lo sysinfo.lo target.lo temp_serializer.lo time.lo token.lo types.lo user.lo username_providers.lo utf.lo utf8proc.lo utf_validate.lo utf_width.lo val idate.lo version.lo win32_crashrpt.lo win32_crypto.lo win32_xlate.lo x509info.lo x509parse.lo xml.lo subversion/libsvn_subr/libsvn_subr-1.la: $(libsvn_subr_DEPS) cd subversion/libsvn_subr && $(LINK_LIB) $(libsvn_subr_LDFLAGS) -o libsvn_subr-1.la $(LT_NO_UNDEFINED) $(libsvn_subr_OBJECTS) $(SVN_APRUTIL_LIBS) $(SVN_APR_LIBS) $(SVN_XML_LIBS) $(SVN_ZLIB_LIBS) $(SVN_APR_MEMCACHE_LIBS) $(SVN_SQLITE_LIBS) $(SVN_MAGIC_LIBS) $(SVN_INTL_LIBS) $(SVN_LZ4_LIBS) $(SVN_UTF8PROC_LIBS) $(SVN_MACOS_PLIST_LIBS) $(SVN_MACOS_KEYCHAIN_LIBS) $(LIBS) @@ -1152,7 +1158,7 @@ swig-rb: subversion/bindings/swig/ruby/client.la subversion/bindings/swig/ruby/c swig-rb-lib: subversion/bindings/swig/ruby/libsvn_swig_ruby/libsvn_swig_ruby-1.la -test: subversion/tests/afl/afl-svndiff$(EXEEXT) subversion/tests/afl/afl-x509$(EXEEXT) subversion/tests/cmdline/atomic-ra-revprop-change$(EXEEXT) subversion/tests/libsvn_subr/auth-test$(EXEEXT) subversion/tests/libsvn_repos/authz-test$(EXEEXT) subversion/tests/libsvn_subr/bit-array-test$(EXEEXT) subversion/tests/libsvn_subr/cache-test$(EXEEXT) subversion/tests/libsvn_subr/checksum-test$(EXEEXT) subversion/tests/libsvn_client/client-test$(EXEEXT) subversion/tests/libsvn_subr/compat-test$(EXEEXT) subversion/tests/libsvn_subr/compress-test$(EXEEXT) subversion/tests/libsvn_subr/config-test$(EXEEXT) subversion/tests/libsvn_wc/conflict-data-test$(EXEEXT) subversion/tests/libsvn_client/conflicts-test$(EXEEXT) subversion/tests/libsvn_subr/crypto-test$(EXEEXT) subversion/tests/libsvn_wc/db-test$(EXEEXT) subversion/tests/libsvn_diff/diff-diff3-test$(EXEEXT) subversion/tests/libsvn_subr/dirent_uri-test$(EXEEXT) subversion/tests/libsvn_repos/dump-load-test$(EXEEXT) subversion/tests/libsvn_wc/en tries-compat-test$(EXEEXT) subversion/tests/cmdline/entries-dump$(EXEEXT) subversion/tests/libsvn_subr/error-code-test$(EXEEXT) subversion/tests/libsvn_subr/error-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-pack-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-private-test$(EXEEXT) subversion/tests/libsvn_fs/fs-sequential-test$(EXEEXT) subversion/tests/libsvn_fs/fs-test$(EXEEXT) subversion/tests/libsvn_fs_x/fs-x-pack-test$(EXEEXT) subversion/tests/libsvn_subr/hashdump-test$(EXEEXT) subversion/tests/libsvn_subr/io-test$(EXEEXT) subversion/tests/libsvn_test-1.la subversion/tests/cmdline/lock-helper$(EXEEXT) subversion/tests/libsvn_fs/locks-test$(EXEEXT) subversion/tests/libsvn_subr/mergeinfo-test$(EXEEXT) subversion/tests/libsvn_client/mtcc-test$(EXEEXT) subversion/tests/libsvn_wc/op-depth-test$(EXEEXT) subversion/tests/libsvn_subr/opt-test$(EXEEXT) subversion/tests/libsvn_subr/packed-data-test$(EXEEXT) subversion/tests/libsvn_diff/parse-diff-test$(EXEEXT) subversion/tests/libs vn_subr/path-test$(EXEEXT) subversion/tests/! libsvn_subr/prefix-string-test$(EXEEXT) subversion/tests/libsvn_subr/priority-queue-test$(EXEEXT) subversion/tests/libsvn_wc/pristine-store-test$(EXEEXT) subversion/tests/libsvn_ra_local/ra-local-test$(EXEEXT) subversion/tests/libsvn_ra/ra-test$(EXEEXT) subversion/tests/libsvn_delta/random-test$(EXEEXT) subversion/tests/libsvn_repos/repos-test$(EXEEXT) subversion/tests/libsvn_subr/revision-test$(EXEEXT) subversion/tests/libsvn_subr/root-pools-test$(EXEEXT) subversion/tests/libsvn_subr/skel-test$(EXEEXT) subversion/tests/libsvn_subr/spillbuf-test$(EXEEXT) subversion/tests/libsvn_subr/sqlite-test$(EXEEXT) subversion/tests/libsvn_subr/stream-test$(EXEEXT) subversion/tests/libsvn_fs_x/string-table-test$(EXEEXT) subversion/tests/libsvn_subr/string-test$(EXEEXT) subversion/tests/libsvn_subr/subst_translate-test$(EXEEXT) tools/dev/wc-ng/svn-wc-db-tester$(EXEEXT) subversion/tests/libsvn_delta/svndiff-stream-test$(EXEEXT) subversion/tests/libsvn_delta/svndiff-test$(EXEEXT) subversion/tests/l ibsvn_subr/time-test$(EXEEXT) subversion/tests/libsvn_subr/translate-test$(EXEEXT) subversion/tests/libsvn_subr/utf-test$(EXEEXT) subversion/tests/libsvn_delta/vdelta-test$(EXEEXT) subversion/tests/libsvn_wc/wc-incomplete-tester$(EXEEXT) subversion/tests/libsvn_wc/wc-lock-tester$(EXEEXT) subversion/tests/libsvn_wc/wc-queries-test$(EXEEXT) subversion/tests/libsvn_wc/wc-test$(EXEEXT) subversion/tests/libsvn_delta/window-test$(EXEEXT) subversion/tests/libsvn_subr/x509-test$(EXEEXT) subversion/tests/libsvn_subr/xml-test$(EXEEXT) +test: subversion/tests/afl/afl-svndiff$(EXEEXT) subversion/tests/afl/afl-x509$(EXEEXT) subversion/tests/cmdline/atomic-ra-revprop-change$(EXEEXT) subversion/tests/libsvn_subr/auth-test$(EXEEXT) subversion/tests/libsvn_repos/authz-test$(EXEEXT) subversion/tests/libsvn_subr/bit-array-test$(EXEEXT) subversion/tests/libsvn_subr/cache-test$(EXEEXT) subversion/tests/libsvn_subr/checksum-test$(EXEEXT) subversion/tests/libsvn_client/client-test$(EXEEXT) subversion/tests/libsvn_subr/compat-test$(EXEEXT) subversion/tests/libsvn_subr/compress-test$(EXEEXT) subversion/tests/libsvn_subr/config-test$(EXEEXT) subversion/tests/libsvn_wc/conflict-data-test$(EXEEXT) subversion/tests/libsvn_client/conflicts-test$(EXEEXT) subversion/tests/libsvn_subr/crypto-test$(EXEEXT) subversion/tests/libsvn_wc/db-test$(EXEEXT) subversion/tests/libsvn_diff/diff-diff3-test$(EXEEXT) subversion/tests/libsvn_subr/dirent_uri-test$(EXEEXT) subversion/tests/libsvn_repos/dump-load-test$(EXEEXT) subversion/tests/libsvn_wc/en tries-compat-test$(EXEEXT) subversion/tests/cmdline/entries-dump$(EXEEXT) subversion/tests/libsvn_subr/error-code-test$(EXEEXT) subversion/tests/libsvn_subr/error-test$(EXEEXT) subversion/tests/client/filesize-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-pack-test$(EXEEXT) subversion/tests/libsvn_fs_fs/fs-fs-private-test$(EXEEXT) subversion/tests/libsvn_fs/fs-sequential-test$(EXEEXT) subversion/tests/libsvn_fs/fs-test$(EXEEXT) subversion/tests/libsvn_fs_x/fs-x-pack-test$(EXEEXT) subversion/tests/libsvn_subr/hashdump-test$(EXEEXT) subversion/tests/libsvn_subr/io-test$(EXEEXT) subversion/tests/libsvn_test-1.la subversion/tests/cmdline/lock-helper$(EXEEXT) subversion/tests/libsvn_fs/locks-test$(EXEEXT) subversion/tests/libsvn_subr/mergeinfo-test$(EXEEXT) subversion/tests/libsvn_client/mtcc-test$(EXEEXT) subversion/tests/libsvn_wc/op-depth-test$(EXEEXT) subversion/tests/libsvn_subr/opt-test$(EXEEXT) subversion/tests/libsvn_subr/packed-data-test$(EXEEXT) subversion/tests/libsvn_diff /parse-diff-test$(EXEEXT) subversion/tests/l! ibsvn_subr/path-test$(EXEEXT) subversion/tests/libsvn_subr/prefix-string-test$(EXEEXT) subversion/tests/libsvn_subr/priority-queue-test$(EXEEXT) subversion/tests/libsvn_wc/pristine-store-test$(EXEEXT) subversion/tests/libsvn_ra_local/ra-local-test$(EXEEXT) subversion/tests/libsvn_ra/ra-test$(EXEEXT) subversion/tests/libsvn_delta/random-test$(EXEEXT) subversion/tests/libsvn_repos/repos-test$(EXEEXT) subversion/tests/libsvn_subr/revision-test$(EXEEXT) subversion/tests/libsvn_subr/root-pools-test$(EXEEXT) subversion/tests/libsvn_subr/skel-test$(EXEEXT) subversion/tests/libsvn_subr/spillbuf-test$(EXEEXT) subversion/tests/libsvn_subr/sqlite-test$(EXEEXT) subversion/tests/libsvn_subr/stream-test$(EXEEXT) subversion/tests/libsvn_fs_x/string-table-test$(EXEEXT) subversion/tests/libsvn_subr/string-test$(EXEEXT) subversion/tests/libsvn_subr/subst_translate-test$(EXEEXT) tools/dev/wc-ng/svn-wc-db-tester$(EXEEXT) subversion/tests/libsvn_delta/svndiff-stream-test$(EXEEXT) subversion/tests/libsvn _delta/svndiff-test$(EXEEXT) subversion/tests/libsvn_subr/time-test$(EXEEXT) subversion/tests/libsvn_subr/translate-test$(EXEEXT) subversion/tests/libsvn_subr/utf-test$(EXEEXT) subversion/tests/libsvn_delta/vdelta-test$(EXEEXT) subversion/tests/libsvn_wc/wc-incomplete-tester$(EXEEXT) subversion/tests/libsvn_wc/wc-lock-tester$(EXEEXT) subversion/tests/libsvn_wc/wc-queries-test$(EXEEXT) subversion/tests/libsvn_wc/wc-test$(EXEEXT) subversion/tests/libsvn_delta/window-test$(EXEEXT) subversion/tests/libsvn_subr/x509-test$(EXEEXT) subversion/tests/libsvn_subr/xml-test$(EXEEXT) tools: tools/diff/diff$(EXEEXT) tools/diff/diff3$(EXEEXT) tools/diff/diff4$(EXEEXT) tools/dev/fsfs-access-map$(EXEEXT) tools/server-side/mod_dontdothat/mod_dontdothat.la tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer$(EXEEXT) tools/server-side/svn-populate-node-origins-index$(EXEEXT) tools/server-side/svnauthz$(EXEEXT) tools/server-side/svnauthz-validate$(EXEEXT) tools/client-side/svnconflict/svnconflict$(EXEEXT) tools/dev/svnmover/svnmover$(EXEEXT) tools/dev/svnraisetreeconflict/svnraisetreeconflict$(EXEEXT) tools/dev/x509-parser$(EXEEXT) @@ -1496,6 +1502,7 @@ entries-compat-test: subversion/tests/libsvn_wc/entries-compat-test$(EXEEXT) entries-dump: subversion/tests/cmdline/entries-dump$(EXEEXT) error-code-test: subversion/tests/libsvn_subr/error-code-test$(EXEEXT) error-test: subversion/tests/libsvn_subr/error-test$(EXEEXT) +filesize-test: subversion/tests/client/filesize-test$(EXEEXT) fs-base-test: subversion/tests/libsvn_fs_base/fs-base-test$(EXEEXT) fs-fs-fuzzy-test: subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test$(EXEEXT) fs-fs-pack-test: subversion/tests/libsvn_fs_fs/fs-fs-pack-test$(EXEEXT) @@ -2890,6 +2897,8 @@ subversion/libsvn_repos/rev_hunt.lo: subversion/libsvn_repos/rev_hunt.c subversi subversion/libsvn_subr/adler32.lo: subversion/libsvn_subr/adler32.c subversion/include/private/svn_adler32.h +subversion/libsvn_subr/apr_escape.lo: subversion/libsvn_subr/apr_escape.c subversion/include/private/svn_dep_compat.h + subversion/libsvn_subr/atomic.lo: subversion/libsvn_subr/atomic.c subversion/include/private/svn_atomic.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_mutex.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_pools.h subversion/include/svn_types.h subversion/include/svn_types_impl.h subversion/libsvn_subr/auth.lo: subversion/libsvn_subr/auth.c subversion/include/private/svn_auth_private.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_dso.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_types_impl.h subversion/include/svn_version.h subversion/libsvn_subr/auth.h subversion/svn_private_config.h @@ -2912,7 +2921,7 @@ subversion/libsvn_subr/cache_config.lo: subversion/libsvn_subr/cache_config.c su subversion/libsvn_subr/checksum.lo: subversion/libsvn_subr/checksum.c subversion/include/private/svn_debug.h subversion/include/private/svn_subr_private.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_ctype.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_io.h subversion/include/svn_sorts.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_types_impl.h subversion/libsvn_subr/checksum.h subversion/libsvn_subr/fnv1a.h subversion/svn_private_config.h -subversion/libsvn_subr/cmdline.lo: subversion/libsvn_subr/cmdline.c subversion/include/private/svn_cmdline_private.h subversion/include/private/svn_debug.h subversion/include/private/svn_sorts_private.h subversion/include/private/svn_string_private.h subversion/include/private/svn_utf_private.h subversion/include/svn_auth.h subversion/include/svn_base64.h subversion/include/svn_checksum.h subversion/include/svn_cmdline.h subversion/include/svn_config.h subversion/include/svn_ctype.h subversion/include/svn_dirent_uri.h subversion/include/svn_dso.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_nls.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_sorts.h subversion/include/svn_string.h subversion/include/svn_subst.h subversion/include/svn_types.h subversion/include/svn_types_impl.h subversion/include/svn_utf.h subvers ion/include/svn_xml.h subversion/libsvn_subr/win32_crashrpt.h subversion/svn_private_config.h +subversion/libsvn_subr/cmdline.lo: subversion/libsvn_subr/cmdline.c subversion/include/private/svn_cmdline_private.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_sorts_private.h subversion/include/private/svn_string_private.h subversion/include/private/svn_utf_private.h subversion/include/svn_auth.h subversion/include/svn_base64.h subversion/include/svn_checksum.h subversion/include/svn_cmdline.h subversion/include/svn_config.h subversion/include/svn_ctype.h subversion/include/svn_dirent_uri.h subversion/include/svn_dso.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_nls.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_sorts.h subversion/include/svn_string.h subversion/include/svn_subst.h subversion/include/svn_types.h subversion/include/svn_types _impl.h subversion/include/svn_utf.h subversion/include/svn_xml.h subversion/libsvn_subr/win32_crashrpt.h subversion/svn_private_config.h subversion/libsvn_subr/compat.lo: subversion/libsvn_subr/compat.c subversion/include/private/svn_debug.h subversion/include/svn_checksum.h subversion/include/svn_compat.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_props.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_types_impl.h @@ -3402,9 +3411,11 @@ subversion/tests/afl/afl-svndiff.lo: subversion/tests/afl/afl-svndiff.c subversi subversion/tests/afl/afl-x509.lo: subversion/tests/afl/afl-x509.c subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_cmdline.h subversion/include/svn_config.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_io.h subversion/include/svn_pools.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_types_impl.h subversion/include/svn_x509.h +subversion/tests/client/filesize-test.lo: subversion/tests/client/filesize-test.c subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_cmdline.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_opt_impl.h subversion/include/svn_path.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_types_impl.h subversion/include/svn_wc.h subversion/svn/cl.h subversion/svn/filesize.c subversion/tests/svn_test.h + subversion/tests/cmdline/atomic-ra-revprop-change.lo: subversion/tests/cmdline/atomic-ra-revprop-change.c subversion/include/private/svn_debug.h subversion/include/private/svn_skel.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_cmdline.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_types_impl.h subversion/svn_private_config.h -subversion/tests/cmdline/entries-dump.lo: subversion/tests/cmdline/entries-dump.c subversion/include/private/svn_debug.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_cmdline.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_opt_impl.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_types_impl.h subversion/include/svn_wc.h subversion/libsvn_wc/lock.h subversion/libsvn_wc/wc.h subversion/libsvn_wc/wc_db.h subversion/sv n_private_config.h +subversion/tests/cmdline/entries-dump.lo: subversion/tests/cmdline/entries-dump.c subversion/include/private/svn_debug.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_cmdline.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_opt_impl.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_types_impl.h subversion/include/svn_wc.h subversion/include/svn_xml.h subversion/libsvn_wc/lock.h subversion/libsvn_wc/wc.h subversion/li bsvn_wc/wc_db.h subversion/svn_private_config.h subversion/tests/cmdline/lock-helper.lo: subversion/tests/cmdline/lock-helper.c subversion/include/private/svn_debug.h subversion/include/svn_checksum.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_pools.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_types_impl.h diff --git a/contrib/subversion/build.conf b/contrib/subversion/build.conf index 1f0d2d8054a6..95875a7ebdb1 100644 --- a/contrib/subversion/build.conf +++ b/contrib/subversion/build.conf @@ -53,6 +53,7 @@ private-includes = subversion/libsvn_subr/utf8proc/utf8proc_internal.h subversion/libsvn_subr/utf8proc/utf8proc.c subversion/libsvn_subr/utf8proc/utf8proc_data.c + subversion/svn/filesize.c private-built-includes = subversion/svn_private_config.h subversion/libsvn_fs_fs/rep-cache-db.h @@ -1338,6 +1339,18 @@ install = test libs = libsvn_client libsvn_test libsvn_wc libsvn_subr apriconv apr msvc-force-static = yes +# ---------------------------------------------------------------------------- +# Tests for the client's internal functions + +[filesize-test] +description = Test conversion of file sizes to human-readable form +type = exe +path = subversion/tests/client +sources = filesize-test.c +install = test +libs = libsvn_client libsvn_test libsvn_wc libsvn_subr apriconv apr +msvc-force-static = yes + # ---------------------------------------------------------------------------- # These are not unit tests at all, they are small programs that exercise # parts of the libsvn_delta API from the command line. They are stuck here @@ -1565,7 +1578,7 @@ libs = __ALL__ checksum-test compat-test config-test hashdump-test mergeinfo-test opt-test packed-data-test path-test prefix-string-test priority-queue-test root-pools-test stream-test - string-test time-test utf-test bit-array-test + string-test time-test utf-test bit-array-test filesize-test error-test error-code-test cache-test spillbuf-test crypto-test revision-test subst_translate-test io-test diff --git a/contrib/subversion/configure b/contrib/subversion/configure index 4666c5d0c5fd..76cad5a00cd3 100755 --- a/contrib/subversion/configure +++ b/contrib/subversion/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for subversion 1.14.0. +# Generated by GNU Autoconf 2.69 for subversion 1.14.1. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='subversion' PACKAGE_TARNAME='subversion' -PACKAGE_VERSION='1.14.0' -PACKAGE_STRING='subversion 1.14.0' +PACKAGE_VERSION='1.14.1' +PACKAGE_STRING='subversion 1.14.1' PACKAGE_BUGREPORT='http://subversion.apache.org/' PACKAGE_URL='' @@ -1504,7 +1504,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures subversion 1.14.0 to adapt to many kinds of systems. +\`configure' configures subversion 1.14.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1570,7 +1570,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of subversion 1.14.0:";; + short | recursive ) echo "Configuration of subversion 1.14.1:";; esac cat <<\_ACEOF @@ -1826,7 +1826,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -subversion configure 1.14.0 +subversion configure 1.14.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2370,7 +2370,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by subversion $as_me 1.14.0, which was +It was created by subversion $as_me 1.14.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2750,8 +2750,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.14.0" >&5 -$as_echo "$as_me: Configuring Subversion 1.14.0" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.14.1" >&5 +$as_echo "$as_me: Configuring Subversion 1.14.1" >&6;} abs_srcdir="`cd $srcdir && pwd`" @@ -4773,7 +4773,7 @@ fi # ==== Libraries, for which we may have source to build ====================== -APR_VER_REGEXES="1\.[5-9]\. 2\." +APR_VER_REGEXES="1\.[4-9]\. 2\." APR_WANTED_REGEXES="$APR_VER_REGEXES" @@ -24462,46 +24462,52 @@ $as_echo "$ac_cv_python_libs" >&6; } fi `" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python >= 3" >&5 + if test "$SWIG" = "none"; then + SWIG_PY_ERRMSG="" + else + # Look more closely at the SWIG and Python versions to + # determine SWIG_PY_OPTS. We can skip this if we already + # have the SWIG-generated files. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python >= 3" >&5 $as_echo_n "checking for Python >= 3... " >&6; } if ${ac_cv_python_is_py3+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_python_is_py3="no" - $PYTHON -c 'import sys; sys.exit(0x3000000 > sys.hexversion)' && \ - ac_cv_python_is_py3="yes" + ac_cv_python_is_py3="no" + $PYTHON -c 'import sys; sys.exit(0x3000000 > sys.hexversion)' && \ + ac_cv_python_is_py3="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_python_is_py3" >&5 $as_echo "$ac_cv_python_is_py3" >&6; } - if test "$ac_cv_python_is_py3" = "yes"; then - if test "$SWIG_VERSION" -ge "300010"; then - SWIG_PY_ERRMSG="" - else - SWIG_PY_ERRMSG="SWIG version is not suitable" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 3 require SWIG 3.0.10 or newer" >&5 + if test "$ac_cv_python_is_py3" = "yes"; then + if test "$SWIG_VERSION" -ge "300010"; then + SWIG_PY_ERRMSG="" + else + SWIG_PY_ERRMSG="SWIG version is not suitable" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 3 require SWIG 3.0.10 or newer" >&5 $as_echo "$as_me: WARNING: Subversion Python bindings for Python 3 require SWIG 3.0.10 or newer" >&2;} - fi - if test "$SWIG_VERSION" -lt "400000"; then - SWIG_PY_OPTS="-python -py3 -nofastunpack -modern" - else - SWIG_PY_OPTS="-python -py3 -nofastunpack" - fi - else - if test "$SWIG_VERSION" -lt "400000"; then - SWIG_PY_OPTS="-python -classic" - SWIG_PY_ERRMSG="" + fi + if test "$SWIG_VERSION" -lt "400000"; then + SWIG_PY_OPTS="-python -py3 -nofastunpack -modern" + else + SWIG_PY_OPTS="-python -py3 -nofastunpack" + fi else - SWIG_PY_OPTS="-python -nofastunpack" - SWIG_PY_ERRMSG="SWIG version is not suitable" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 2 require 1.3.24 <= SWIG < 4.0.0" >&5 + if test "$SWIG_VERSION" -lt "400000"; then + SWIG_PY_OPTS="-python -classic" + SWIG_PY_ERRMSG="" + else + SWIG_PY_OPTS="-python -nofastunpack" + SWIG_PY_ERRMSG="SWIG version is not suitable" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 2 require 1.3.24 <= SWIG < 4.0.0" >&5 $as_echo "$as_me: WARNING: Subversion Python bindings for Python 2 require 1.3.24 <= SWIG < 4.0.0" >&2;} + fi fi fi fi - fi fi @@ -25093,46 +25099,52 @@ $as_echo "$ac_cv_python_libs" >&6; } fi `" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python >= 3" >&5 + if test "$SWIG" = "none"; then + SWIG_PY_ERRMSG="" + else + # Look more closely at the SWIG and Python versions to + # determine SWIG_PY_OPTS. We can skip this if we already + # have the SWIG-generated files. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python >= 3" >&5 $as_echo_n "checking for Python >= 3... " >&6; } if ${ac_cv_python_is_py3+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_python_is_py3="no" - $PYTHON -c 'import sys; sys.exit(0x3000000 > sys.hexversion)' && \ - ac_cv_python_is_py3="yes" + ac_cv_python_is_py3="no" + $PYTHON -c 'import sys; sys.exit(0x3000000 > sys.hexversion)' && \ + ac_cv_python_is_py3="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_python_is_py3" >&5 $as_echo "$ac_cv_python_is_py3" >&6; } - if test "$ac_cv_python_is_py3" = "yes"; then - if test "$SWIG_VERSION" -ge "300010"; then - SWIG_PY_ERRMSG="" - else - SWIG_PY_ERRMSG="SWIG version is not suitable" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 3 require SWIG 3.0.10 or newer" >&5 + if test "$ac_cv_python_is_py3" = "yes"; then + if test "$SWIG_VERSION" -ge "300010"; then + SWIG_PY_ERRMSG="" + else + SWIG_PY_ERRMSG="SWIG version is not suitable" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 3 require SWIG 3.0.10 or newer" >&5 $as_echo "$as_me: WARNING: Subversion Python bindings for Python 3 require SWIG 3.0.10 or newer" >&2;} - fi - if test "$SWIG_VERSION" -lt "400000"; then - SWIG_PY_OPTS="-python -py3 -nofastunpack -modern" - else - SWIG_PY_OPTS="-python -py3 -nofastunpack" - fi - else - if test "$SWIG_VERSION" -lt "400000"; then - SWIG_PY_OPTS="-python -classic" - SWIG_PY_ERRMSG="" + fi + if test "$SWIG_VERSION" -lt "400000"; then + SWIG_PY_OPTS="-python -py3 -nofastunpack -modern" + else + SWIG_PY_OPTS="-python -py3 -nofastunpack" + fi else - SWIG_PY_OPTS="-python -nofastunpack" - SWIG_PY_ERRMSG="SWIG version is not suitable" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 2 require 1.3.24 <= SWIG < 4.0.0" >&5 + if test "$SWIG_VERSION" -lt "400000"; then + SWIG_PY_OPTS="-python -classic" + SWIG_PY_ERRMSG="" + else + SWIG_PY_OPTS="-python -nofastunpack" + SWIG_PY_ERRMSG="SWIG version is not suitable" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 2 require 1.3.24 <= SWIG < 4.0.0" >&5 $as_echo "$as_me: WARNING: Subversion Python bindings for Python 2 require 1.3.24 <= SWIG < 4.0.0" >&2;} + fi fi fi fi - fi fi @@ -25724,46 +25736,52 @@ $as_echo "$ac_cv_python_libs" >&6; } fi `" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python >= 3" >&5 + if test "$SWIG" = "none"; then + SWIG_PY_ERRMSG="" + else + # Look more closely at the SWIG and Python versions to + # determine SWIG_PY_OPTS. We can skip this if we already + # have the SWIG-generated files. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python >= 3" >&5 $as_echo_n "checking for Python >= 3... " >&6; } if ${ac_cv_python_is_py3+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_python_is_py3="no" - $PYTHON -c 'import sys; sys.exit(0x3000000 > sys.hexversion)' && \ - ac_cv_python_is_py3="yes" + ac_cv_python_is_py3="no" + $PYTHON -c 'import sys; sys.exit(0x3000000 > sys.hexversion)' && \ + ac_cv_python_is_py3="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_python_is_py3" >&5 $as_echo "$ac_cv_python_is_py3" >&6; } - if test "$ac_cv_python_is_py3" = "yes"; then - if test "$SWIG_VERSION" -ge "300010"; then - SWIG_PY_ERRMSG="" - else - SWIG_PY_ERRMSG="SWIG version is not suitable" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 3 require SWIG 3.0.10 or newer" >&5 + if test "$ac_cv_python_is_py3" = "yes"; then + if test "$SWIG_VERSION" -ge "300010"; then + SWIG_PY_ERRMSG="" + else + SWIG_PY_ERRMSG="SWIG version is not suitable" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 3 require SWIG 3.0.10 or newer" >&5 $as_echo "$as_me: WARNING: Subversion Python bindings for Python 3 require SWIG 3.0.10 or newer" >&2;} - fi - if test "$SWIG_VERSION" -lt "400000"; then - SWIG_PY_OPTS="-python -py3 -nofastunpack -modern" - else - SWIG_PY_OPTS="-python -py3 -nofastunpack" - fi - else - if test "$SWIG_VERSION" -lt "400000"; then - SWIG_PY_OPTS="-python -classic" - SWIG_PY_ERRMSG="" + fi + if test "$SWIG_VERSION" -lt "400000"; then + SWIG_PY_OPTS="-python -py3 -nofastunpack -modern" + else + SWIG_PY_OPTS="-python -py3 -nofastunpack" + fi else - SWIG_PY_OPTS="-python -nofastunpack" - SWIG_PY_ERRMSG="SWIG version is not suitable" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 2 require 1.3.24 <= SWIG < 4.0.0" >&5 + if test "$SWIG_VERSION" -lt "400000"; then + SWIG_PY_OPTS="-python -classic" + SWIG_PY_ERRMSG="" + else + SWIG_PY_OPTS="-python -nofastunpack" + SWIG_PY_ERRMSG="SWIG version is not suitable" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 2 require 1.3.24 <= SWIG < 4.0.0" >&5 $as_echo "$as_me: WARNING: Subversion Python bindings for Python 2 require 1.3.24 <= SWIG < 4.0.0" >&2;} + fi fi fi fi - fi fi @@ -26358,46 +26376,52 @@ $as_echo "$ac_cv_python_libs" >&6; } fi `" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python >= 3" >&5 + if test "$SWIG" = "none"; then + SWIG_PY_ERRMSG="" + else + # Look more closely at the SWIG and Python versions to + # determine SWIG_PY_OPTS. We can skip this if we already + # have the SWIG-generated files. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python >= 3" >&5 $as_echo_n "checking for Python >= 3... " >&6; } if ${ac_cv_python_is_py3+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_python_is_py3="no" - $PYTHON -c 'import sys; sys.exit(0x3000000 > sys.hexversion)' && \ - ac_cv_python_is_py3="yes" + ac_cv_python_is_py3="no" + $PYTHON -c 'import sys; sys.exit(0x3000000 > sys.hexversion)' && \ + ac_cv_python_is_py3="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_python_is_py3" >&5 $as_echo "$ac_cv_python_is_py3" >&6; } - if test "$ac_cv_python_is_py3" = "yes"; then - if test "$SWIG_VERSION" -ge "300010"; then - SWIG_PY_ERRMSG="" - else - SWIG_PY_ERRMSG="SWIG version is not suitable" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 3 require SWIG 3.0.10 or newer" >&5 + if test "$ac_cv_python_is_py3" = "yes"; then + if test "$SWIG_VERSION" -ge "300010"; then + SWIG_PY_ERRMSG="" + else + SWIG_PY_ERRMSG="SWIG version is not suitable" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 3 require SWIG 3.0.10 or newer" >&5 $as_echo "$as_me: WARNING: Subversion Python bindings for Python 3 require SWIG 3.0.10 or newer" >&2;} - fi - if test "$SWIG_VERSION" -lt "400000"; then - SWIG_PY_OPTS="-python -py3 -nofastunpack -modern" - else - SWIG_PY_OPTS="-python -py3 -nofastunpack" - fi - else - if test "$SWIG_VERSION" -lt "400000"; then - SWIG_PY_OPTS="-python -classic" - SWIG_PY_ERRMSG="" + fi + if test "$SWIG_VERSION" -lt "400000"; then + SWIG_PY_OPTS="-python -py3 -nofastunpack -modern" + else + SWIG_PY_OPTS="-python -py3 -nofastunpack" + fi else - SWIG_PY_OPTS="-python -nofastunpack" - SWIG_PY_ERRMSG="SWIG version is not suitable" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 2 require 1.3.24 <= SWIG < 4.0.0" >&5 + if test "$SWIG_VERSION" -lt "400000"; then + SWIG_PY_OPTS="-python -classic" + SWIG_PY_ERRMSG="" + else + SWIG_PY_OPTS="-python -nofastunpack" + SWIG_PY_ERRMSG="SWIG version is not suitable" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion Python bindings for Python 2 require 1.3.24 <= SWIG < 4.0.0" >&5 $as_echo "$as_me: WARNING: Subversion Python bindings for Python 2 require 1.3.24 <= SWIG < 4.0.0" >&2;} + fi fi fi fi - fi fi @@ -28361,7 +28385,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by subversion $as_me 1.14.0, which was +This file was extended by subversion $as_me 1.14.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -28427,7 +28451,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -subversion config.status 1.14.0 +subversion config.status 1.14.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/contrib/subversion/configure.ac b/contrib/subversion/configure.ac index 07103e550a81..42a9f14e8fb5 100644 --- a/contrib/subversion/configure.ac +++ b/contrib/subversion/configure.ac @@ -91,7 +91,7 @@ AC_SUBST([MKDIR]) dnl verify apr version and set apr flags dnl These regular expressions should not contain "\(" and "\)". -APR_VER_REGEXES=["1\.[5-9]\. 2\."] +APR_VER_REGEXES=["1\.[4-9]\. 2\."] SVN_LIB_APR($APR_VER_REGEXES) diff --git a/contrib/subversion/gen-make.py b/contrib/subversion/gen-make.py index bdb359394e1c..5811705322cc 100755 --- a/contrib/subversion/gen-make.py +++ b/contrib/subversion/gen-make.py @@ -70,7 +70,7 @@ def main(fname, gentype, verfname=None, if ('--debug', '') in other_options: for dep_type, target_dict in generator.graph.deps.items(): - sorted_targets = list(target_dict.keys()); sorted_targets.sort() + sorted_targets = sorted(target_dict.keys(), key=str) for target in sorted_targets: print(dep_type + ": " + _objinfo(target)) for source in target_dict[target]: diff --git a/contrib/subversion/subversion/include/private/svn_dep_compat.h b/contrib/subversion/subversion/include/private/svn_dep_compat.h index 7e6603826135..9a2e49a19cba 100644 --- a/contrib/subversion/subversion/include/private/svn_dep_compat.h +++ b/contrib/subversion/subversion/include/private/svn_dep_compat.h @@ -29,6 +29,7 @@ #define SVN_DEP_COMPAT_H #include +#include #ifdef __cplusplus extern "C" { @@ -193,6 +194,16 @@ extern "C" { ((major*1000000 + minor*1000 + patch) <= SVN_SQLITE_MIN_VERSION_NUMBER) #endif /* SQLITE_VERSION_AT_LEAST */ +/** + * Support for 'apr_escape_shell() which was introduced in APR 1.5. + */ +#if !APR_VERSION_AT_LEAST(1,5,0) +/* from apr_escape.h */ +#define APR_ESCAPE_STRING (-1) +APR_DECLARE(apr_status_t) apr_escape_shell(char *escaped, const char *str, + apr_ssize_t slen, apr_size_t *len); +#endif + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/contrib/subversion/subversion/include/private/svn_sorts_private.h b/contrib/subversion/subversion/include/private/svn_sorts_private.h index d0fddc0c6488..d11ebbe1a992 100644 --- a/contrib/subversion/subversion/include/private/svn_sorts_private.h +++ b/contrib/subversion/subversion/include/private/svn_sorts_private.h @@ -80,7 +80,7 @@ svn_sort__array(apr_array_header_t *array, int (*comparison_func)(const void *, const void *)); -/* Return the lowest index at which the element @a *key should be inserted into +/** Return the lowest index at which the element @a *key should be inserted into * the array @a array, according to the ordering defined by @a compare_func. * The array must already be sorted in the ordering defined by @a compare_func. * @a compare_func is defined as for the C stdlib function bsearch(); the @@ -93,7 +93,7 @@ svn_sort__bsearch_lower_bound(const apr_array_header_t *array, const void *key, int (*compare_func)(const void *, const void *)); -/* Find the lowest index at which the element @a *key should be inserted into +/** Find the lowest index at which the element @a *key should be inserted into * the array @a array, according to the ordering defined by @a compare_func. * The array must already be sorted in the ordering defined by @a compare_func. * @a compare_func is defined as for the C stdlib function bsearch(); the @@ -116,7 +116,7 @@ svn_sort__array_lookup(const apr_array_header_t *array, int (*compare_func)(const void *, const void *)); -/* Insert a shallow copy of @a *new_element into the array @a array at the index +/** Insert a shallow copy of @a *new_element into the array @a array at the index * @a insert_index, growing the array and shuffling existing elements along to * make room. * @@ -131,7 +131,7 @@ svn_sort__array_insert2(apr_array_header_t *array, int insert_index); -/* Remove @a elements_to_delete elements starting at @a delete_index from the +/** Remove @a elements_to_delete elements starting at @a delete_index from the * array @a arr. * * Raise an error if the indexes to delete extends outside the array bounds @@ -144,7 +144,7 @@ svn_sort__array_delete2(apr_array_header_t *arr, int delete_index, int elements_to_delete); -/* Reverse the order of elements in @a array, in place. +/** Reverse the order of elements in @a array, in place. * * @note Private. For use by Subversion's own code only. */ diff --git a/contrib/subversion/subversion/include/svn_ra.h b/contrib/subversion/subversion/include/svn_ra.h index 4c71520dd1ff..d534ab70caa1 100644 --- a/contrib/subversion/subversion/include/svn_ra.h +++ b/contrib/subversion/subversion/include/svn_ra.h @@ -2244,7 +2244,7 @@ svn_ra_has_capability(svn_ra_session_t *session, /** * The capability of a server to automatically remove transaction - * properties prefixed with SVN_PROP_EPHEMERAL_PREFIX. + * properties prefixed with #SVN_PROP_TXN_PREFIX. * * @since New in 1.8. */ diff --git a/contrib/subversion/subversion/include/svn_types.h b/contrib/subversion/subversion/include/svn_types.h index 418d6ac9cc84..d9f98f23150a 100644 --- a/contrib/subversion/subversion/include/svn_types.h +++ b/contrib/subversion/subversion/include/svn_types.h @@ -248,6 +248,35 @@ typedef struct svn_version_t svn_version_t; /** @} */ + +/** @defgroup apr_hash_utilities APR Hash Table Helpers + * These functions enable the caller to dereference an APR hash table index + * without type casts or temporary variables. + * + * These functions are provided by APR itself from version 1.5. + * Definitions are provided here for when using older versions of APR. + * @{ + */ + +#if !APR_VERSION_AT_LEAST(1, 5, 0) + +/** Return the key of the hash table entry indexed by @a hi. */ +const void * +apr_hash_this_key(apr_hash_index_t *hi); + +/** Return the key length of the hash table entry indexed by @a hi. */ +apr_ssize_t +apr_hash_this_key_len(apr_hash_index_t *hi); + +/** Return the value of the hash table entry indexed by @a hi. */ +void * +apr_hash_this_val(apr_hash_index_t *hi); + +#endif + +/** @} */ + + /** On Windows, APR_STATUS_IS_ENOTDIR includes several kinds of * invalid-pathname error but not ERROR_INVALID_NAME, so we include it. diff --git a/contrib/subversion/subversion/include/svn_version.h b/contrib/subversion/subversion/include/svn_version.h index 25bbe542df5b..69e886cc5437 100644 --- a/contrib/subversion/subversion/include/svn_version.h +++ b/contrib/subversion/subversion/include/svn_version.h @@ -70,7 +70,7 @@ extern "C" { * * @since New in 1.1. */ -#define SVN_VER_PATCH 0 +#define SVN_VER_PATCH 1 /** @deprecated Provided for backward compatibility with the 1.0 API. */ @@ -93,7 +93,7 @@ extern "C" { * * Always change this at the same time as SVN_VER_NUMTAG. */ -#define SVN_VER_TAG " (r1876290)" +#define SVN_VER_TAG " (r1886195)" /** Number tag: a string describing the version. @@ -117,7 +117,7 @@ extern "C" { * file version. Its value remains 0 in the repository except in release * tags where it is the revision from which the tag was created. */ -#define SVN_VER_REVISION 1876290 +#define SVN_VER_REVISION 1886195 /* Version strings composed from the above definitions. */ diff --git a/contrib/subversion/subversion/libsvn_client/merge.c b/contrib/subversion/subversion/libsvn_client/merge.c index 9d9a1c300a10..e535647d8649 100644 --- a/contrib/subversion/subversion/libsvn_client/merge.c +++ b/contrib/subversion/subversion/libsvn_client/merge.c @@ -264,7 +264,7 @@ typedef struct merge_cmd_baton_t { /* Reference to the one-and-only CHILDREN_WITH_MERGEINFO (see global comment) or a similar list for single-file-merges */ - const apr_array_header_t *children_with_mergeinfo; + apr_array_header_t *children_with_mergeinfo; *** 827 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Sat Feb 13 14:12:45 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B3A5F52DE42; Sat, 13 Feb 2021 14:12:45 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DdC4Y4hwsz4ZBn; Sat, 13 Feb 2021 14:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 942391864A; Sat, 13 Feb 2021 14:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11DECjiO000975; Sat, 13 Feb 2021 14:12:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11DECjO0000974; Sat, 13 Feb 2021 14:12:45 GMT (envelope-from git) Date: Sat, 13 Feb 2021 14:12:45 GMT Message-Id: <202102131412.11DECjO0000974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 90b5fc95832d - main - lib/libc/tests/rpc: Correctly set timeout MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90b5fc95832da64a5f56295e687379732c33718f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 14:12:45 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=90b5fc95832da64a5f56295e687379732c33718f commit 90b5fc95832da64a5f56295e687379732c33718f Author: Alex Richardson AuthorDate: 2021-02-13 13:52:59 +0000 Commit: Alex Richardson CommitDate: 2021-02-13 13:53:01 +0000 lib/libc/tests/rpc: Correctly set timeout The rpc_control() API does not accept the CLCR_SET_RPCB_TIMEOUT command, it only accepts RPC_SVC_CONNMAXREC_GET/RPC_SVC_CONNMAXREC_SET, so it was not doing anything. Instead of incorrectly calling this API, use clnt_create_timed() instead. I noticed this because the test was timing out after 120s in the CheriBSD CI. Reviewed By: ngie Differential Revision: https://reviews.freebsd.org/D28478 --- contrib/netbsd-tests/lib/libc/rpc/t_rpc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c b/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c index 59bcd5590764..3000f6aec98b 100644 --- a/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c +++ b/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c @@ -72,11 +72,21 @@ onehost(const char *host, const char *transp) */ tv.tv_sec = 0; tv.tv_usec = 500000; +#ifdef __FreeBSD__ + /* + * FreeBSD does not allow setting the timeout using __rpc_control, + * but does have clnt_create_timed() that allows passing a timeout. + */ + if ((clnt = clnt_create_timed(host, RPCBPROG, RPCBVERS, transp, + &tv)) == NULL) + SKIPX(, "clnt_create (%s)", clnt_spcreateerror("")); +#else #define CLCR_SET_RPCB_TIMEOUT 2 __rpc_control(CLCR_SET_RPCB_TIMEOUT, &tv); if ((clnt = clnt_create(host, RPCBPROG, RPCBVERS, transp)) == NULL) SKIPX(, "clnt_create (%s)", clnt_spcreateerror("")); +#endif tv.tv_sec = 1; tv.tv_usec = 0; From owner-dev-commits-src-main@freebsd.org Sat Feb 13 14:12:46 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D695A52DDF1; Sat, 13 Feb 2021 14:12:46 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DdC4Z5hnlz4Z8x; Sat, 13 Feb 2021 14:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B671818919; Sat, 13 Feb 2021 14:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11DECkHT000994; Sat, 13 Feb 2021 14:12:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11DECk1C000992; Sat, 13 Feb 2021 14:12:46 GMT (envelope-from git) Date: Sat, 13 Feb 2021 14:12:46 GMT Message-Id: <202102131412.11DECk1C000992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 5ff2e55e0071 - main - bin/pkill: Fix {pgrep,pkill}-j_test.sh MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ff2e55e0071dabbf18cdbe13a1230822d1270d4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 14:12:46 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=5ff2e55e0071dabbf18cdbe13a1230822d1270d4 commit 5ff2e55e0071dabbf18cdbe13a1230822d1270d4 Author: Alex Richardson AuthorDate: 2021-02-13 13:53:50 +0000 Commit: Alex Richardson CommitDate: 2021-02-13 13:53:51 +0000 bin/pkill: Fix {pgrep,pkill}-j_test.sh The POSIX sh case statement does not allow for pattern matching using the regex + qualifier so this case statement never matches. Instead just check for a string starting with a digit followed by any character. While touching these files also fix various shellcheck warnings. `kyua -v parallelism=4 test` failed before, succeeds now. Reviewed By: imp Differential Revision: https://reviews.freebsd.org/D28480 --- bin/pkill/tests/pgrep-j_test.sh | 34 +++++++++++++++++----------------- bin/pkill/tests/pkill-j_test.sh | 37 ++++++++++++++++++++----------------- 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/bin/pkill/tests/pgrep-j_test.sh b/bin/pkill/tests/pgrep-j_test.sh index 0e54fd1106a7..5f44109d41b3 100644 --- a/bin/pkill/tests/pgrep-j_test.sh +++ b/bin/pkill/tests/pgrep-j_test.sh @@ -9,7 +9,7 @@ jail_name_to_jid() base=pgrep_j_test -if [ `id -u` -ne 0 ]; then +if [ "$(id -u)" -ne 0 ]; then echo "1..0 # skip Test needs uid 0." exit 0 fi @@ -28,12 +28,12 @@ jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount & sleep 0.5 -for i in `seq 1 10`; do +for i in $(seq 1 10); do jid1=$(jail_name_to_jid ${base}_1_1) jid2=$(jail_name_to_jid ${base}_1_2) jid="${jid1},${jid2}" case "$jid" in - [0-9]+,[0-9]+) + [0-9]*,[0-9]*) break ;; esac @@ -43,14 +43,14 @@ sleep 0.5 pid1="$(pgrep -f -x -j "$jid" "$sleep $sleep_amount" | sort)" pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_1_1.pid)" \ - $(cat ${PWD}/${base}_1_2.pid) | sort) + "$(cat ${PWD}/${base}_1_2.pid)" | sort) if [ "$pid1" = "$pid2" ]; then echo "ok 1 - $name" else - echo "not ok 1 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)'" + echo "not ok 1 - $name # pgrep output: '$pid1', pidfile output: '$pid2'" fi -[ -f ${PWD}/${base}_1_1.pid ] && kill $(cat ${PWD}/${base}_1_1.pid) -[ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid) +[ -f ${PWD}/${base}_1_1.pid ] && kill "$(cat ${PWD}/${base}_1_1.pid)" +[ -f ${PWD}/${base}_1_2.pid ] && kill "$(cat ${PWD}/${base}_1_2.pid)" wait name="pgrep -j any" @@ -64,14 +64,14 @@ jail -c path=/ name=${base}_2_2 ip4.addr=127.0.0.1 \ sleep 2 pid1="$(pgrep -f -x -j any "$sleep $sleep_amount" | sort)" pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_2_1.pid)" \ - $(cat ${PWD}/${base}_2_2.pid) | sort) + "$(cat ${PWD}/${base}_2_2.pid)" | sort) if [ "$pid1" = "$pid2" ]; then echo "ok 2 - $name" else - echo "not ok 2 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)'" + echo "not ok 2 - $name # pgrep output: '$pid1', pidfile output: '$pid2'" fi -[ -f ${PWD}/${base}_2_1.pid ] && kill $(cat ${PWD}/${base}_2_1.pid) -[ -f ${PWD}/${base}_2_2.pid ] && kill $(cat ${PWD}/${base}_2_2.pid) +[ -f ${PWD}/${base}_2_1.pid ] && kill "$(cat ${PWD}/${base}_2_1.pid)" +[ -f ${PWD}/${base}_2_2.pid ] && kill "$(cat ${PWD}/${base}_2_2.pid)" wait name="pgrep -j none" @@ -84,10 +84,10 @@ pid="$(pgrep -f -x -j none "$sleep $sleep_amount")" if [ "$pid" = "$(cat ${PWD}/${base}_3_1.pid)" ]; then echo "ok 3 - $name" else - echo "not ok 3 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)'" + echo "not ok 3 - $name # pgrep output: '$pid1', pidfile output: '$pid2'" fi -[ -f ${PWD}/${base}_3_1.pid ] && kill $(cat $PWD/${base}_3_1.pid) -[ -f ${PWD}/${base}_3_2.pid ] && kill $(cat $PWD/${base}_3_2.pid) +[ -f ${PWD}/${base}_3_1.pid ] && kill "$(cat $PWD/${base}_3_1.pid)" +[ -f ${PWD}/${base}_3_2.pid ] && kill "$(cat $PWD/${base}_3_2.pid)" wait # test 4 is like test 1 except with jname instead of jid. @@ -104,14 +104,14 @@ sleep 0.5 jname="${base}_4_1,${base}_4_2" pid1="$(pgrep -f -x -j "$jname" "$sleep $sleep_amount" | sort)" pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_4_1.pid)" \ - $(cat ${PWD}/${base}_4_2.pid) | sort) + "$(cat ${PWD}/${base}_4_2.pid)" | sort) if [ "$pid1" = "$pid2" ]; then echo "ok 4 - $name" else echo "not ok 4 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)'" fi -[ -f ${PWD}/${base}_4_1.pid ] && kill $(cat ${PWD}/${base}_4_1.pid) -[ -f ${PWD}/${base}_4_2.pid ] && kill $(cat ${PWD}/${base}_4_2.pid) +[ -f ${PWD}/${base}_4_1.pid ] && kill "$(cat ${PWD}/${base}_4_1.pid)" +[ -f ${PWD}/${base}_4_2.pid ] && kill "$(cat ${PWD}/${base}_4_2.pid)" wait rm -f $sleep diff --git a/bin/pkill/tests/pkill-j_test.sh b/bin/pkill/tests/pkill-j_test.sh index 442d9d23885e..1710ca04f653 100644 --- a/bin/pkill/tests/pkill-j_test.sh +++ b/bin/pkill/tests/pkill-j_test.sh @@ -9,7 +9,7 @@ jail_name_to_jid() base=pkill_j_test -if [ `id -u` -ne 0 ]; then +if [ "$(id -u)" -ne 0 ]; then echo "1..0 # skip Test needs uid 0." exit 0 fi @@ -29,28 +29,31 @@ jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ $sleep $sleep_amount & -for i in `seq 1 10`; do +for i in $(seq 1 10); do jid1=$(jail_name_to_jid ${base}_1_1) jid2=$(jail_name_to_jid ${base}_1_2) jid="${jid1},${jid2}" case "$jid" in - [0-9]+,[0-9]+) + [0-9]*,[0-9]*) break ;; + *) + echo "Did not match: '${jid}'" >&2 + ;; esac sleep 0.1 done sleep 0.5 if pkill -f -j "$jid" $sleep && sleep 0.5 && - ! -f ${PWD}/${base}_1_1.pid && - ! -f ${PWD}/${base}_1_2.pid ; then + ! test -f "${PWD}/${base}_1_1.pid" && + ! test -f "${PWD}/${base}_1_2.pid" ; then echo "ok 1 - $name" else echo "not ok 1 - $name" fi 2>/dev/null -[ -f ${PWD}/${base}_1_1.pid ] && kill $(cat ${PWD}/${base}_1_1.pid) -[ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid) +[ -f ${PWD}/${base}_1_1.pid ] && kill "$(cat ${PWD}/${base}_1_1.pid)" +[ -f ${PWD}/${base}_1_2.pid ] && kill "$(cat ${PWD}/${base}_1_2.pid)" wait name="pkill -j any" @@ -65,14 +68,14 @@ $sleep $sleep_amount & chpid3=$! sleep 0.5 if pkill -f -j any $sleep && sleep 0.5 && - [ ! -f ${PWD}/${base}_2_1.pid -a - ! -f ${PWD}/${base}_2_2.pid ] && kill $chpid3; then + ! test -f ${PWD}/${base}_2_1.pid && + ! test -f ${PWD}/${base}_2_2.pid && kill $chpid3; then echo "ok 2 - $name" else echo "not ok 2 - $name" fi 2>/dev/null -[ -f ${PWD}/${base}_2_1.pid ] && kill $(cat ${PWD}/${base}_2_1.pid) -[ -f ${PWD}/${base}_2_2.pid ] && kill $(cat ${PWD}/${base}_2_2.pid) +[ -f ${PWD}/${base}_2_1.pid ] && kill "$(cat ${PWD}/${base}_2_1.pid)" +[ -f ${PWD}/${base}_2_2.pid ] && kill "$(cat ${PWD}/${base}_2_2.pid)" wait name="pkill -j none" @@ -88,8 +91,8 @@ else ls ${PWD}/*.pid echo "not ok 3 - $name" fi 2>/dev/null -[ -f ${PWD}/${base}_3_1.pid ] && kill $(cat ${base}_3_1.pid) -[ -f ${PWD}/${base}_3_2.pid ] && kill $(cat ${base}_3_2.pid) +[ -f ${PWD}/${base}_3_1.pid ] && kill "$(cat ${base}_3_1.pid)" +[ -f ${PWD}/${base}_3_2.pid ] && kill "$(cat ${base}_3_2.pid)" wait # test 4 is like test 1 except with jname instead of jid. @@ -107,14 +110,14 @@ sleep 0.5 jname="${base}_4_1,${base}_4_2" if pkill -f -j "$jname" $sleep && sleep 0.5 && - ! -f ${PWD}/${base}_4_1.pid && - ! -f ${PWD}/${base}_4_2.pid ; then + ! test -f ${PWD}/${base}_4_1.pid && + ! test -f ${PWD}/${base}_4_2.pid ; then echo "ok 4 - $name" else echo "not ok 4 - $name" fi 2>/dev/null -[ -f ${PWD}/${base}_4_1.pid ] && kill $(cat ${PWD}/${base}_4_1.pid) -[ -f ${PWD}/${base}_4_2.pid ] && kill $(cat ${PWD}/${base}_4_2.pid) +[ -f ${PWD}/${base}_4_1.pid ] && kill "$(cat ${PWD}/${base}_4_1.pid)" +[ -f ${PWD}/${base}_4_2.pid ] && kill "$(cat ${PWD}/${base}_4_2.pid)" wait rm -f $sleep From owner-dev-commits-src-main@freebsd.org Sat Feb 13 14:12:48 2021 Return-Path: Delivered-To: dev-commits-src-main@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 0F9E252DE52; Sat, 13 Feb 2021 14:12:48 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DdC4b6VFWz4Z6J; Sat, 13 Feb 2021 14:12:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFEEB1891A; Sat, 13 Feb 2021 14:12:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11DEClkZ001016; Sat, 13 Feb 2021 14:12:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11DEClOL001015; Sat, 13 Feb 2021 14:12:47 GMT (envelope-from git) Date: Sat, 13 Feb 2021 14:12:47 GMT Message-Id: <202102131412.11DEClOL001015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 88db1cc9f197 - main - tools/build/make.py: drop workaround for cc --version not being parsed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88db1cc9f197a376817ce27ba269348666bbd4b7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 14:12:48 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=88db1cc9f197a376817ce27ba269348666bbd4b7 commit 88db1cc9f197a376817ce27ba269348666bbd4b7 Author: Alex Richardson AuthorDate: 2021-02-13 13:54:20 +0000 Commit: Alex Richardson CommitDate: 2021-02-13 13:54:25 +0000 tools/build/make.py: drop workaround for cc --version not being parsed Previously bsd.compiler.mk was not able to detect the compiler type for Ubuntu's /usr/bin/cc unless we were invoking the /usr/bin/gcc symlink. This problem has been fixed by 9c6954329a9285547881ddd60e393b7c55ed30c4 so we can drop the workaround from make.py. Reviewed By: jrtc27 Differential Revision: https://reviews.freebsd.org/D28323 --- tools/build/make.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tools/build/make.py b/tools/build/make.py index e692fef11e05..bc6d8fb449bb 100755 --- a/tools/build/make.py +++ b/tools/build/make.py @@ -182,13 +182,6 @@ if __name__ == "__main__": sys.exit("TARGET= and TARGET_ARCH= must be set explicitly " "when building on non-FreeBSD") # infer values for CC/CXX/CPP - - if sys.platform.startswith( - "linux") and parsed_args.host_compiler_type == "cc": - # FIXME: bsd.compiler.mk doesn't handle the output of GCC if it - # is /usr/bin/cc on Ubuntu since it doesn't contain the GCC string. - parsed_args.host_compiler_type = "gcc" - if parsed_args.host_compiler_type == "gcc": default_cc, default_cxx, default_cpp = ("gcc", "g++", "cpp") # FIXME: this should take values like `clang-9` and then look for @@ -225,8 +218,8 @@ if __name__ == "__main__": if not shutil.which("strip"): if sys.platform.startswith("darwin"): # On macOS systems we have to use /usr/bin/strip. - sys.exit("Cannot find required tool 'strip'. Please install the" - " host compiler and command line tools.") + sys.exit("Cannot find required tool 'strip'. Please install " + "the host compiler and command line tools.") if parsed_args.host_compiler_type == "clang": strip_binary = "llvm-strip" else: From owner-dev-commits-src-main@freebsd.org Sat Feb 13 15:06:24 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C472552F9A9; Sat, 13 Feb 2021 15:06:24 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (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 4DdDGS521lz4d8t; Sat, 13 Feb 2021 15:06:24 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-pf1-x42f.google.com with SMTP id z15so1455703pfc.3; Sat, 13 Feb 2021 07:06:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Yo6RA/jiGRj62XVfm7bp58SpzLA9OjEpHByQk2skgjY=; b=Mgf1uGXXsCDMNwgu5xzJFSn922D773wife8QySHdifpWxY/je5uwEWxoyc8+lG333b 0GNt253vIsvR6aA4mSsIMSNKX1RGspldC7ea+/TrpxqaaKrqN0PuyyG9XXuL9sO+8/mI 7GZf5HKeIep6J1lHZVDeXXOwrTcAdyS2ejDOGQ6uZi9oprQoalNG5pjJn1QiY+mSFvXc FUoavrQdpyOqkHMUBV0OXKwbqLCppu7BFLAesUDTV75CpEsd5POvxpFXytUrJqIc6FkR /anEuK0BGbDwhBJYS2GP6GZ7ccWlvHtYOjQUu1/JYe5rhLFXJ/ooXdlITGUgoDQJQG97 XlUg== 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=Yo6RA/jiGRj62XVfm7bp58SpzLA9OjEpHByQk2skgjY=; b=Fd62T+34JCoF9EGrqXfWh49XWRDQI5IoOWKJ1dowx9ByauNDQbN5kbSCsYFjVqFueL j1UKbRCRVjjr2Yj3ghwmBpWgN/X8ti3rNgTITfmUb7PCpfXR6XE3ZOe5d1sd/XAdAmUp GPaUJ56pUWNOBKZfc84uM0dTWuPBKXjL2GPQNeynAf3JDIQqe84UWCobkkR3LAmpoSiG VXkkzWfrKo7VTX3vfYN1dDcIACznCrXFpT/pw9ePTSEUAMRYD6A603RF3oSkDFaGrXi1 +uHLDoKyF89AgzsdtUvgdVov9jef/b1ApB1MX8LTIe+6bIl03412xJIp08d0Xvk8zpdR nWFQ== X-Gm-Message-State: AOAM532v+j7ApeSmYXczXhs7Z/jgKzfBajzFo9+UgX4ustC7qXSfhTzc hr8e6GV52obLyQml0POtC1MQr0Zr8yrcEGixDnabDU1Ad2tN5A== X-Google-Smtp-Source: ABdhPJzqKiimJU3uVGCKxg2URvF38oFcVBck0KYI9kBWaYkVJpbgsn8ljuPDfxzlwYdl+5VZJKNB1tvWo20awVlIQa4= X-Received: by 2002:aa7:9e90:0:b029:1dd:3cd6:9dde with SMTP id p16-20020aa79e900000b02901dd3cd69ddemr7383344pfq.57.1613228782726; Sat, 13 Feb 2021 07:06:22 -0800 (PST) MIME-Version: 1.0 References: <202102130006.11D06NiO077607@gitrepo.freebsd.org> In-Reply-To: <202102130006.11D06NiO077607@gitrepo.freebsd.org> From: Ryan Stone Date: Sat, 13 Feb 2021 10:06:11 -0500 Message-ID: Subject: Re: git: a375ec52a7b4 - main - Fix ifa refcount leak during route addition. To: "Alexander V. Chernikov" Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DdDGS521lz4d8t X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 15:06:24 -0000 On Fri, Feb 12, 2021 at 7:06 PM Alexander V. Chernikov wrote: > Fix ifa refcount leak during route addition. Thanks! From owner-dev-commits-src-main@freebsd.org Sat Feb 13 18:20:52 2021 Return-Path: Delivered-To: dev-commits-src-main@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 D0470535F8F; Sat, 13 Feb 2021 18:20:52 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DdJZr5byKz4rGy; Sat, 13 Feb 2021 18:20:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B35D21BC33; Sat, 13 Feb 2021 18:20:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11DIKq31025861; Sat, 13 Feb 2021 18:20:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11DIKqSn025860; Sat, 13 Feb 2021 18:20:52 GMT (envelope-from git) Date: Sat, 13 Feb 2021 18:20:52 GMT Message-Id: <202102131820.11DIKqSn025860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 032d3153877e - main - ukbd: Fix handling of keyboard ErrorRollOver reports MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 032d3153877ef1767c121bbdf8e00f4f93b30a5d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 18:20:52 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=032d3153877ef1767c121bbdf8e00f4f93b30a5d commit 032d3153877ef1767c121bbdf8e00f4f93b30a5d Author: Vladimir Kondratyev AuthorDate: 2021-02-13 18:12:56 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-13 18:12:56 +0000 ukbd: Fix handling of keyboard ErrorRollOver reports Ignore fantom keyboard state reports entirelly rather than ignore RollOver states for each key separatelly. Latter results in spurious release/push pairs of events on each fantom keyboard state report. Reported by: Jan Martin Mikkelsen Submitted by: Jan Martin Mikkelsen (initial version) PR: 253249 MFC after: 1 week --- sys/dev/usb/input/ukbd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index 3314a3b3e70f..f2ff476150ff 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -722,11 +722,16 @@ ukbd_intr_callback(struct usb_xfer *xfer, usb_error_t error) hid_get_udata(sc->sc_buffer, len, &tmp_loc); /* advance to next location */ tmp_loc.pos += tmp_loc.size; + if (key == KEY_ERROR) { + DPRINTF("KEY_ERROR\n"); + sc->sc_ndata = sc->sc_odata; + goto tr_setup; /* ignore */ + } if (modifiers & MOD_FN) key = ukbd_apple_fn(key); if (sc->sc_flags & UKBD_FLAG_APPLE_SWAP) key = ukbd_apple_swap(key); - if (key == KEY_NONE || key == KEY_ERROR || key >= UKBD_NKEYCODE) + if (key == KEY_NONE || key >= UKBD_NKEYCODE) continue; /* set key in bitmap */ sc->sc_ndata.bitmap[key / 64] |= 1ULL << (key % 64); From owner-dev-commits-src-main@freebsd.org Sat Feb 13 18:20:55 2021 Return-Path: Delivered-To: dev-commits-src-main@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 2C060535B4F; Sat, 13 Feb 2021 18:20:55 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DdJZv0h6nz4rH6; Sat, 13 Feb 2021 18:20:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A81A1BB30; Sat, 13 Feb 2021 18:20:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11DIKs0W025904; Sat, 13 Feb 2021 18:20:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11DIKsLc025903; Sat, 13 Feb 2021 18:20:54 GMT (envelope-from git) Date: Sat, 13 Feb 2021 18:20:54 GMT Message-Id: <202102131820.11DIKsLc025903@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: f988d7fa050e - main - hidraw: Make HIDIOCGRDESCSIZE ioctl return report descriptor size MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f988d7fa050e4886cdeb9483a039e75d58c31883 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 18:20:55 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=f988d7fa050e4886cdeb9483a039e75d58c31883 commit f988d7fa050e4886cdeb9483a039e75d58c31883 Author: Vladimir Kondratyev AuthorDate: 2021-02-13 18:19:02 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-13 18:19:02 +0000 hidraw: Make HIDIOCGRDESCSIZE ioctl return report descriptor size defined by hardware rather than cached one to match HIDIOCGRDESC ioctl. This fixes errors reported by hid-tools being run against /dev/hidraw# device node belonging to driver which overloads report descriptor. MFC after: 1 week --- sys/dev/hid/hidraw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/hid/hidraw.c b/sys/dev/hid/hidraw.c index 6cc67ff14d23..e71b2e2c7d5d 100644 --- a/sys/dev/hid/hidraw.c +++ b/sys/dev/hid/hidraw.c @@ -703,7 +703,7 @@ hidraw_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, return (0); case HIDIOCGRDESCSIZE: - *(int *)addr = sc->sc_rdesc->len; + *(int *)addr = sc->sc_hw->rdescsize; return (0); case HIDIOCGRDESC: From owner-dev-commits-src-main@freebsd.org Sat Feb 13 18:20:54 2021 Return-Path: Delivered-To: dev-commits-src-main@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 56975535F41; Sat, 13 Feb 2021 18:20:54 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DdJZs6rt7z4rBw; Sat, 13 Feb 2021 18:20:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCAB71BAB4; Sat, 13 Feb 2021 18:20:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11DIKriI025883; Sat, 13 Feb 2021 18:20:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11DIKrKh025882; Sat, 13 Feb 2021 18:20:53 GMT (envelope-from git) Date: Sat, 13 Feb 2021 18:20:53 GMT Message-Id: <202102131820.11DIKrKh025882@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 812c59ed614d - main - hkbd: Fix handling of keyboard ErrorRollOver reports MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 812c59ed614df94380e0b1f9ff4a3d15b78ce1bf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 18:20:54 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=812c59ed614df94380e0b1f9ff4a3d15b78ce1bf commit 812c59ed614df94380e0b1f9ff4a3d15b78ce1bf Author: Vladimir Kondratyev AuthorDate: 2021-02-13 18:18:07 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-13 18:18:07 +0000 hkbd: Fix handling of keyboard ErrorRollOver reports Ignore fantom keyboard state reports entirelly rather than ignore RollOver states for each key separatelly. Latter results in spurious release/push pairs of events on each fantom keyboard state report. Reported by: Jan Martin Mikkelsen Submitted by: Jan Martin Mikkelsen (initial version) PR: 253249 MFC after: 1 week --- sys/dev/hid/hkbd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index 6f4b71dd49b6..89325f9b2499 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -715,11 +715,16 @@ hkbd_intr_callback(void *context, void *data, hid_size_t len) uint32_t key = hid_get_data(buf + offset, len - offset, &sc->sc_loc_key[i]); + if (key == KEY_ERROR) { + DPRINTF("KEY_ERROR\n"); + sc->sc_ndata = sc->sc_odata; + return; /* ignore */ + } if (modifiers & MOD_FN) key = hkbd_apple_fn(key); if (sc->sc_flags & HKBD_FLAG_APPLE_SWAP) key = hkbd_apple_swap(key); - if (key == KEY_NONE || key == KEY_ERROR || key >= HKBD_NKEYCODE) + if (key == KEY_NONE || key >= HKBD_NKEYCODE) continue; /* set key in bitmap */ sc->sc_ndata.bitmap[key / 64] |= 1ULL << (key % 64); From owner-dev-commits-src-main@freebsd.org Sat Feb 13 18:28:37 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4157E5364C6; Sat, 13 Feb 2021 18:28:37 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DdJln1NWsz4s7V; Sat, 13 Feb 2021 18:28:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 224881BF8B; Sat, 13 Feb 2021 18:28:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11DISb2g031162; Sat, 13 Feb 2021 18:28:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11DISb0r031161; Sat, 13 Feb 2021 18:28:37 GMT (envelope-from git) Date: Sat, 13 Feb 2021 18:28:37 GMT Message-Id: <202102131828.11DISb0r031161@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Fernando Apesteguía Subject: git: bffc3fb3c09b - main - Add metor -> mentee information (docs) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bffc3fb3c09b36fd8740242f184d1e8bd8530920 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 18:28:37 -0000 The branch main has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=bffc3fb3c09b36fd8740242f184d1e8bd8530920 commit bffc3fb3c09b36fd8740242f184d1e8bd8530920 Author: Fernando Apesteguía AuthorDate: 2021-02-13 18:18:03 +0000 Commit: Fernando Apesteguía CommitDate: 2021-02-13 18:26:54 +0000 Add metor -> mentee information (docs) As per Committers Guide Step 5 Reviewed by: 0mp Accepted By: 0mp (mentor) Differential Revision: https://reviews.freebsd.org/D28589 --- share/misc/committers-doc.dot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/misc/committers-doc.dot b/share/misc/committers-doc.dot index 4edffffeed1b..9c79abb0214a 100644 --- a/share/misc/committers-doc.dot +++ b/share/misc/committers-doc.dot @@ -68,6 +68,7 @@ dexter [label="Michael Dexter\ndexter@FreeBSD.org\n2016/11/15"] dru [label="Dru Lavigne\ndru@FreeBSD.org\n2013/01/22"] eadler [label="Eitan Adler\neadler@FreeBSD.org\n2012/10/15"] ebrandi [label="Edson Brandi\nebrandi@FreeBSD.org\n2012/09/13"] +fernape [label="Fernando Apesteguia\fernape@FreeBSD.org\n2021/02/07"] gabor [label="Gabor Kovesdan\ngabor@FreeBSD.org\n2007/02/02"] ganbold [label="Ganbold Tsagaankhuu\nganbold@FreeBSD.org\n2008/02/26"] gavin [label="Gavin Atkinson\ngavin@FreeBSD.org\n2011/07/18"] @@ -105,6 +106,7 @@ zeising [label="Niclas Zeising\nzeising@FreeBSD.org\n2012/07/03"] # Keep the list sorted by mentor login. "0mp" -> debdrup +"0mp" -> fernape allanjude -> debdrup @@ -124,6 +126,8 @@ bcr -> "0mp" bcr -> gbe bcr -> debdrup +bge -> fernape + blackend -> ale brueffer -> joel From owner-dev-commits-src-main@freebsd.org Sun Feb 14 01:25:18 2021 Return-Path: Delivered-To: dev-commits-src-main@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 CE855543909; Sun, 14 Feb 2021 01:25:18 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DdV0Z5Pwwz3rDg; Sun, 14 Feb 2021 01:25:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A298221884; Sun, 14 Feb 2021 01:25:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11E1PI6t079931; Sun, 14 Feb 2021 01:25:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11E1PICt079930; Sun, 14 Feb 2021 01:25:18 GMT (envelope-from git) Date: Sun, 14 Feb 2021 01:25:18 GMT Message-Id: <202102140125.11E1PICt079930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 25c6318c7906 - main - procstat: distinguish vm map guards in procstat vm output. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25c6318c7906f6f4e0c66ce16f81bdb830ba2e3b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 01:25:18 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=25c6318c7906f6f4e0c66ce16f81bdb830ba2e3b commit 25c6318c7906f6f4e0c66ce16f81bdb830ba2e3b Author: Konstantin Belousov AuthorDate: 2021-02-14 00:37:24 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-14 01:24:58 +0000 procstat: distinguish vm map guards in procstat vm output. Requested and reviewed by: rwatson (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28658 --- sys/kern/kern_proc.c | 7 +++++-- sys/sys/user.h | 1 + usr.bin/procstat/procstat.1 | 4 +++- usr.bin/procstat/procstat_vm.c | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 305bc7e8a2ef..f8fed2573712 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2514,7 +2514,7 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) vm_offset_t addr; unsigned int last_timestamp; int error; - bool super; + bool guard, super; PROC_LOCK_ASSERT(p, MA_OWNED); @@ -2584,6 +2584,8 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) if (entry->eflags & MAP_ENTRY_USER_WIRED) kve->kve_flags |= KVME_FLAG_USER_WIRED; + guard = (entry->eflags & MAP_ENTRY_GUARD) != 0; + last_timestamp = map->timestamp; vm_map_unlock_read(map); @@ -2620,7 +2622,8 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) vput(vp); } } else { - kve->kve_type = KVME_TYPE_NONE; + kve->kve_type = guard ? KVME_TYPE_GUARD : + KVME_TYPE_NONE; kve->kve_ref_count = 0; kve->kve_shadow_count = 0; } diff --git a/sys/sys/user.h b/sys/sys/user.h index f60d73b77f3e..f882e7dcd699 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -465,6 +465,7 @@ struct kinfo_file { #define KVME_TYPE_DEAD 6 #define KVME_TYPE_SG 7 #define KVME_TYPE_MGTDEVICE 8 +#define KVME_TYPE_GUARD 9 #define KVME_TYPE_UNKNOWN 255 #define KVME_PROT_READ 0x00000001 diff --git a/usr.bin/procstat/procstat.1 b/usr.bin/procstat/procstat.1 index 1ce0b796beb4..affe69ffb615 100644 --- a/usr.bin/procstat/procstat.1 +++ b/usr.bin/procstat/procstat.1 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2020 +.Dd February 13, 2021 .Dt PROCSTAT 1 .Os .Sh NAME @@ -674,6 +674,8 @@ scatter/gather swap .It vn vnode +.It gd +guard (pseudo-type) .El .Pp The following mapping flags may be displayed: diff --git a/usr.bin/procstat/procstat_vm.c b/usr.bin/procstat/procstat_vm.c index 13a4e1cf03af..7d698fefdc30 100644 --- a/usr.bin/procstat/procstat_vm.c +++ b/usr.bin/procstat/procstat_vm.c @@ -155,6 +155,10 @@ procstat_vm(struct procstat *procstat, struct kinfo_proc *kipp) str = "md"; lstr = "managed_device"; break; + case KVME_TYPE_GUARD: + str = "gd"; + lstr = "guard"; + break; case KVME_TYPE_UNKNOWN: default: str = "??"; From owner-dev-commits-src-main@freebsd.org Sun Feb 14 10:13:39 2021 Return-Path: Delivered-To: dev-commits-src-main@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 482335297F6; Sun, 14 Feb 2021 10:13:39 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DdjkC1bMTz4qVx; Sun, 14 Feb 2021 10:13:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 296BD986; Sun, 14 Feb 2021 10:13:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11EADd27071496; Sun, 14 Feb 2021 10:13:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11EADdlq071495; Sun, 14 Feb 2021 10:13:39 GMT (envelope-from git) Date: Sun, 14 Feb 2021 10:13:39 GMT Message-Id: <202102141013.11EADdlq071495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 1bd44b11e59f - main - Do not reference returned ifa in in6_ifawithifp(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1bd44b11e59f1e9ee7245f8de1f823bc5287b9ef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 10:13:39 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=1bd44b11e59f1e9ee7245f8de1f823bc5287b9ef commit 1bd44b11e59f1e9ee7245f8de1f823bc5287b9ef Author: Alexander V. Chernikov AuthorDate: 2021-02-14 10:11:06 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-14 10:11:18 +0000 Do not reference returned ifa in in6_ifawithifp(). The only place where in6_ifawithifp() is used is ip6_output(), which uses the returned ifa to bump traffic counters. Given ifa stability guarantees is provided by epoch, do not refcount ifa. This eliminates 2 atomic ops from IPv6 fast path. Reviewed By: rstone MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28649 --- sys/netinet6/in6.c | 14 +++----------- sys/netinet6/ip6_output.c | 1 - 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 48fa8dd2efc6..057c0ee91e02 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1921,10 +1921,8 @@ in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst) besta = (struct in6_ifaddr *)ifa; } } - if (besta) { - ifa_ref(&besta->ia_ifa); + if (besta) return (besta); - } CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET6) @@ -1941,20 +1939,14 @@ in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst) continue; } - if (ifa != NULL) - ifa_ref(ifa); return (struct in6_ifaddr *)ifa; } /* use the last-resort values, that are, deprecated addresses */ - if (dep[0]) { - ifa_ref((struct ifaddr *)dep[0]); + if (dep[0]) return dep[0]; - } - if (dep[1]) { - ifa_ref((struct ifaddr *)dep[1]); + if (dep[1]) return dep[1]; - } return NULL; } diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index df1e9e6f2dcd..58334788b05b 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1177,7 +1177,6 @@ passout: counter_u64_add(ia6->ia_ifa.ifa_opackets, 1); counter_u64_add(ia6->ia_ifa.ifa_obytes, m->m_pkthdr.len); - ifa_free(&ia6->ia_ifa); } error = ip6_output_send(inp, ifp, origifp, m, dst, ro, (flags & IP_NO_SND_TAG_RL) ? false : true); From owner-dev-commits-src-main@freebsd.org Sun Feb 14 11:18:27 2021 Return-Path: Delivered-To: dev-commits-src-main@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 1CEB852B898; Sun, 14 Feb 2021 11:18:27 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ddl8z0LTzz4tnk; Sun, 14 Feb 2021 11:18:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2CC5143A; Sun, 14 Feb 2021 11:18:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11EBIQgf051140; Sun, 14 Feb 2021 11:18:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11EBIQkn051139; Sun, 14 Feb 2021 11:18:26 GMT (envelope-from git) Date: Sun, 14 Feb 2021 11:18:26 GMT Message-Id: <202102141118.11EBIQkn051139@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: ed782b9f5a7a - main - tcp: improve behaviour when using TCP_NOOPT MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed782b9f5a7a05debe944a33b4ac9e5629a95803 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 11:18:27 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ed782b9f5a7a05debe944a33b4ac9e5629a95803 commit ed782b9f5a7a05debe944a33b4ac9e5629a95803 Author: Michael Tuexen AuthorDate: 2021-02-14 11:10:31 +0000 Commit: Michael Tuexen CommitDate: 2021-02-14 11:16:57 +0000 tcp: improve behaviour when using TCP_NOOPT Use ISS for SEG.SEQ when sending a SYN-ACK segment in response to an SYN segment received in the SYN-SENT state on a socket having the IPPROTO_TCP level socket option TCP_NOOPT enabled. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D28656 --- sys/netinet/tcp_output.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index cacc0c51bd8e..b4c7ab0a1ab7 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -785,6 +785,10 @@ send: #endif hdrlen = sizeof (struct tcpiphdr); + if (flags & TH_SYN) { + tp->snd_nxt = tp->iss; + } + /* * Compute options for segment. * We only have to care about SYN and established connection @@ -795,7 +799,6 @@ send: if ((tp->t_flags & TF_NOOPT) == 0) { /* Maximum segment size. */ if (flags & TH_SYN) { - tp->snd_nxt = tp->iss; to.to_mss = tcp_mssopt(&tp->t_inpcb->inp_inc); to.to_flags |= TOF_MSS; From owner-dev-commits-src-main@freebsd.org Sun Feb 14 12:08:58 2021 Return-Path: Delivered-To: dev-commits-src-main@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 AE1C152DB6E; Sun, 14 Feb 2021 12:08:58 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DdmHG4YJCz3DS5; Sun, 14 Feb 2021 12:08:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F2C81D49; Sun, 14 Feb 2021 12:08:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11EC8wHC016384; Sun, 14 Feb 2021 12:08:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11EC8wTJ016383; Sun, 14 Feb 2021 12:08:58 GMT (envelope-from git) Date: Sun, 14 Feb 2021 12:08:58 GMT Message-Id: <202102141208.11EC8wTJ016383@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5e42cb139fc1 - main - pf: Slightly relax pf_rule_addr validation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5e42cb139fc17f165c9c93ac97069dc7770490e2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 12:08:58 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5e42cb139fc17f165c9c93ac97069dc7770490e2 commit 5e42cb139fc17f165c9c93ac97069dc7770490e2 Author: Kristof Provost AuthorDate: 2021-02-13 15:31:52 +0000 Commit: Kristof Provost CommitDate: 2021-02-14 11:07:31 +0000 pf: Slightly relax pf_rule_addr validation Ensure we don't reject no-route / urpf-failed addresses. PR: 253479 Reported by: michal AT microwave.sk Revied by: donner@ MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28650 --- sys/netpfil/pf/pf_ioctl.c | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 644a091808cd..edc8443dcc0a 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1557,9 +1557,33 @@ pf_krule_to_rule(const struct pf_krule *krule, struct pf_rule *rule) rule->u_src_nodes = counter_u64_fetch(krule->src_nodes); } +static int +pf_check_rule_addr(const struct pf_rule_addr *addr) +{ + + switch (addr->addr.type) { + case PF_ADDR_ADDRMASK: + case PF_ADDR_NOROUTE: + case PF_ADDR_DYNIFTL: + case PF_ADDR_TABLE: + case PF_ADDR_URPFFAILED: + case PF_ADDR_RANGE: + break; + default: + return (EINVAL); + } + + if (addr->addr.p.dyn != NULL) { + return (EINVAL); + } + + return (0); +} + static int pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) { + int ret; #ifndef INET if (rule->af == AF_INET) { @@ -1572,23 +1596,12 @@ pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) } #endif /* INET6 */ - if (rule->src.addr.type != PF_ADDR_ADDRMASK && - rule->src.addr.type != PF_ADDR_DYNIFTL && - rule->src.addr.type != PF_ADDR_TABLE) { - return (EINVAL); - } - if (rule->src.addr.p.dyn != NULL) { - return (EINVAL); - } - - if (rule->dst.addr.type != PF_ADDR_ADDRMASK && - rule->dst.addr.type != PF_ADDR_DYNIFTL && - rule->dst.addr.type != PF_ADDR_TABLE) { - return (EINVAL); - } - if (rule->dst.addr.p.dyn != NULL) { - return (EINVAL); - } + ret = pf_check_rule_addr(&rule->src); + if (ret != 0) + return (ret); + ret = pf_check_rule_addr(&rule->dst); + if (ret != 0) + return (ret); bzero(krule, sizeof(*krule)); From owner-dev-commits-src-main@freebsd.org Sun Feb 14 17:20:48 2021 Return-Path: Delivered-To: dev-commits-src-main@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 6893A53605B; Sun, 14 Feb 2021 17:20:48 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DdvC42b8cz3psM; Sun, 14 Feb 2021 17:20:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B9AB6393; Sun, 14 Feb 2021 17:20:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11EHKm9T031518; Sun, 14 Feb 2021 17:20:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11EHKmtD031515; Sun, 14 Feb 2021 17:20:48 GMT (envelope-from git) Date: Sun, 14 Feb 2021 17:20:48 GMT Message-Id: <202102141720.11EHKmtD031515@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 66803b34a017 - main - Only require mac_veriexec for verified_exec MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66803b34a01777c772bd081b1429ea5742b0f0f7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 17:20:48 -0000 The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=66803b34a01777c772bd081b1429ea5742b0f0f7 commit 66803b34a01777c772bd081b1429ea5742b0f0f7 Author: Simon J. Gerraty AuthorDate: 2021-02-14 17:20:41 +0000 Commit: Simon J. Gerraty CommitDate: 2021-02-14 17:20:41 +0000 Only require mac_veriexec for verified_exec The veriexec option is redundant, mac_veriexec is sufficient. MFC after: 1 week # # 72 columns --| # # Uncomment and complete these metadata fields, as appropriate: # # PR: # Reported by: # Reviewed by: # Approved by: # Obtained from: # MFC after: # MFH: # Relnotes: # Security: # Sponsored by: # Pull Request: /pull/###> # Differential Revision: # # "Pull Request" and "Differential Revision" require the *full* GitHub or # Phabricator URL. The commit author should be set appropriately, using # `git commit --author` if someone besides the committer sent in the change. # # Uncomment and complete these metadata fields, as appropriate: # # PR: # Reported by: # Reviewed by: # Approved by: # Obtained from: # MFC after: # MFH: # Relnotes: # Security: # Sponsored by: # Pull Request: /pull/###> # Differential Revision: # # "Pull Request" and "Differential Revision" require the *full* GitHub or # Phabricator URL. The commit author should be set appropriately, using # `git commit --author` if someone besides the committer sent in the change. # --- sys/conf/files | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/files b/sys/conf/files index 1abfadb1e8d8..459fcddd693b 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3450,7 +3450,7 @@ dev/videomode/videomode.c optional videomode dev/videomode/edid.c optional videomode dev/videomode/pickmode.c optional videomode dev/videomode/vesagtf.c optional videomode -dev/veriexec/verified_exec.c optional veriexec mac_veriexec +dev/veriexec/verified_exec.c optional mac_veriexec dev/vge/if_vge.c optional vge dev/viapm/viapm.c optional viapm pci dev/virtio/virtio.c optional virtio From owner-dev-commits-src-main@freebsd.org Sun Feb 14 18:55:16 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4A552538D96; Sun, 14 Feb 2021 18:55:16 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 4DdxJ34820z3wGT; Sun, 14 Feb 2021 18:55:15 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x436.google.com with SMTP id l12so6312790wry.2; Sun, 14 Feb 2021 10:55:15 -0800 (PST) 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=PhT281q+DDFPIe3C0mPbJYLIJBFz9/ho1YEVxuyBoys=; b=vYvwukijWFPm0diZzaLHpVwZpr2IMeN0QSILTxIxdEC3iFtExHEuDWad6+fvRYtmAq I+kR0+j7V2SrLXWEUGzSAQojuuOxfzeoRLwDkj/SAgSf64j6VDvmIisurjwEKvWO63Cf y/NgF0ntNb5xQ4j+3pySwfI3kqyOvOi3i+fQEL0SmJ0qi5RnjRo+FXkhGICdnCfPkTPt mr1L75Ow7nLpME0qrwcu3Bc3jbQa1wdHJDGb5CV+6Qqi+kpP++Un8KZstT0gExNiOBxA GTGCYrFhO/7bpAoEg+9vrDauqMMO4w9JcrabR2vuMcB13H8FGZ/U7/p+0d0R94xTsieG awjw== 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=PhT281q+DDFPIe3C0mPbJYLIJBFz9/ho1YEVxuyBoys=; b=IVmy2kBJ8JFogIaAJ0Xf9cQESaIPfw5Eq2JjIX7JqL2nGL3Q8K3k0N3qVuUBqPob0V uvCGP/K+eSHtKRzmhOF9MoBFb8P2uP64TjweOC5F2fQW018L+ZuIIbEUijbL5btWOMI0 mFbUv7i0pITlQHSLKCeVRrveGLOjMqvCO4VY/Q5vpI12CV/B93CzviD0veALInucdCl6 Ru87NunzOh2+NKYTc0em3dBce0b4dr51l4TPHaYKhZOxCIjGwpn8EA00slzOM/hndh1f Q/K27dOsLqcirMBqsHbVlCX6NsnoafcffY9pSWxsdTt7y2O78nfDQOKnRorIo5pgXuhl QCxg== X-Gm-Message-State: AOAM530mtH1A23zT4Ci1/psm1KXSfLAUERW2LjfJwF4zrxV91hI/2ZwC SWe2/KgKxIb+iajKVF4dEKjZyGPXq56Fdn0mQclzYNdU2NI= X-Google-Smtp-Source: ABdhPJw/hzVXQadRaOmPQpMLdaBE6tjA6DNEnw0QgMxioL1/xfE6B2HwPGjva1E/l+tdzTtrdyqv1X96uNmg/tikm3g= X-Received: by 2002:a05:6000:1565:: with SMTP id 5mr15284896wrz.109.1613328913647; Sun, 14 Feb 2021 10:55:13 -0800 (PST) MIME-Version: 1.0 Received: by 2002:adf:e406:0:0:0:0:0 with HTTP; Sun, 14 Feb 2021 10:55:12 -0800 (PST) In-Reply-To: <3e6dfdae-48a8-2d6c-1f42-c92554d74f82@FreeBSD.org> References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> <8E61EA5C-39D1-49CC-8319-06E9192FF735@freebsd.org> <20210209145348.GA70871@FreeBSD.org> <3e6dfdae-48a8-2d6c-1f42-c92554d74f82@FreeBSD.org> From: Mateusz Guzik Date: Sun, 14 Feb 2021 19:55:12 +0100 Message-ID: Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly To: John Baldwin Cc: Alexey Dokuchaev , Jessica Clarke , Kevin Bowling , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DdxJ34820z3wGT X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=vYvwukij; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::436 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-0.50 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::436:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; SORTED_RECIPS(3.50)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::436:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::436:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 18:55:16 -0000 On 2/9/21, John Baldwin wrote: > On 2/9/21 6:53 AM, Alexey Dokuchaev wrote: >> On Tue, Feb 09, 2021 at 02:41:15PM +0100, Mateusz Guzik wrote: >>> ... >>> More, if reviews were mandatory, I would expect their quality to go >>> down even further, making them even less likely to prevent breakage. >> >> Exactly that. In fact, the good reviews are typically coming from >> people who care. But those you'll get regardless of whether you've >> asked for them. > > No, that's not quite true. Committing without asking for any review at > all is not the same as requesting review and then timing out when it > doesn't occur. > > Also, as has been noted multiple times now, people do point out questions > that can't easily be fixed post-commit such as too-terse commit logs. > Those are quite easily caught in review if one makes the effort to ask. > > If we want to cherry-pick examples, we can also find examples where > reviews do find issues pre-commit. Look at all the back and forth on > Warner's doc change about libraries and symbol versioning in D28486 for > an example. > > The discussion in D28453 has led to a better approach I still need to > update the review with that moves the handling of pollable sims one > layer up. > > Rob Wing found an issue I had missed in my bhyve config change (D26035) > in terms of new warnings from iasl during pre-commit testing. > > Kostik posted a possible patch trying to address a PR in D28485 that is > probably not valid (see my review comments) and thus saved having > something committed that then had to be reverted. > > Kostik's review on D28342 forced me to rework the change to only scan > segments and not ELF sections since valid ELF executables and DSO's > aren't required to have section headers. > > Review on D27454 led to acclerated AES-GCM for ARMv8 that was targeted > at KTLS being reimplemented in a more generic fashion that also > accelerates IPsec and other users of AES-GCM in the kernel. > > I could keep going listing changes that benefit from cooperation among > developers. However, cooperation does mean one has to be a bit more > patient and be willing to work on follow-on work while letting review > feedback come in. Using tools like git make this fairly easy as you > can apply fixups to the earlier changes and rebase the follow-on changes > under active development afterwards. It is true that you can't get > meaningful review on all changes (or all aspects of a change), but I > think the notion that review _never_ helps is not supported by the > evidence. I think there is a gross misunderstanding here, I don't know if going both ways. First, I never claimed reviews are useless (as performed in this project or in general). To quote from my previous e-mail: > I do think a review is mandatory when making a non-cosmetic change to > an area worked on by someone else. Similarly, if there are multiple > people active somewhere, it's probably best to coordinate. Review may > be a great idea if a design choice has to be made or certain people > have expertise from the problem domain, even if they are not active > somewhere. For a general note: I would love a culture where one can count on a thorough and timely review of every change, but as you yourself noted one cannot expect that in this project. Most of your examples point out design choices which is what I said reviews as performed here can be fine, and apart from one don't counter anything I posted. Can a review find bugs? Of course. Does deliver on it? In my experience too rarely. This poses a question what's the harm getting a review anyway, which is answered at the end. Examples I enumerated myself, one of which has you as a reviewer, are not odd exceptions I had to hunt for and if you are not convinced I can keep going. For any of said changes, if it was my commit without any 'reviewed by', someone would be ready to respond claiming the change would have benefited from a review. Yet, a review was there and it did not help. This brings me to: > The fact that Jess found a bug in the assembly code in question the day > after it was committed indicates that pre-commit review would have > been beneficial for this commit. This can be said about just any commit. If not reviewed, a review perhaps would point out an improvement to be made (or a bug to be fixed). But in the same spirit, for any of the reviews I mentioned where a review failed to deliver on anything, a better one would find the problem. And even for reviews which found something, something could have probably been done. Most notably in https://reviews.freebsd.org/D28102 it really does not take long to realize there is a problem if you look at the entire function, which I suspect none of the 4 reviewers did. Yet the change got accepted by all of them. I consider reviews of this sort to be a bigger problem than people not getting reviews. Thus the question is what's sufficient to commit something in good faith. In particular, given your own statement not everything can be meaningfully reviewed, it comes down to a judgment call by a developer whether to get one. This is on top of figuring out what testing should have been performed. Let's take a look at this commit: For testing I assumed running the code and the glibc test suite would be sufficient -- the latter turns out to be significantly less exhaustive than necessary at least for this routine, lesson learned. Before doing anything more with the code I'm going to have to find a better suite or extend this one. What about a review? Should you read history of amd64/amd64/support.S you will find I rewrote or otherwise heavily patched memcmp, memset, memmove/memcpy, copyinstr and copyin/copyout. Almost all of these changes were reviewed. Reviewer demanded the use of macros to dedup some code, which I complied with (which you could call a benefit from a review). Yet, some of the patches had bugs and they did not get pointed out. As strlen is a self-contained routine, there are no lasting design choices to made there which would impact other code and the mycroft trick is an established method of implementing it, I did not see much use of a getting a review. Maybe it would find a bug, maybe it would not, but getting this particular routine reviewed did not seem useful. What would *definitely* helped is better testing and this is where time should have been spent here. Given all of this, what's the harm on erring on getting a review anyway? Example harm is seen in aforementioned pmap change where the patch is rubber stamped and everyone is absolved of any responsibility. To be clear, gallatin should have posted the review and I would do to given that I don't work in the area (and maybe I would make the same mistake). Here I blame reviewers for not spotting a bug which I would argue is easier to see when looking at a patch than when writing one. This still happened with reviews not even being mandatory. With more reviews, I expect precisely kind of thing to happen more often. You really have to ask yourself, of all the reviewed patches which got committed and did blow up, how many came in already in that general shape. What significance, if any, comes with 'reviewed by'? I also think your perception of how often I don't get a review compared to other people is skewed by granularity of my changes -- what other developers would collapse into one change (maybe committed without review) tends to be a small patchset for me. Finally, it would be good if you took a critical look at other people. It's hard to shake an impression you are just picking on me. -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Sun Feb 14 19:33:52 2021 Return-Path: Delivered-To: dev-commits-src-main@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 BFA58539DBE; Sun, 14 Feb 2021 19:33:52 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ddy8c52vFz4SdD; Sun, 14 Feb 2021 19:33:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A016D1015E; Sun, 14 Feb 2021 19:33:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11EJXqYO004540; Sun, 14 Feb 2021 19:33:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11EJXqjX004539; Sun, 14 Feb 2021 19:33:52 GMT (envelope-from git) Date: Sun, 14 Feb 2021 19:33:52 GMT Message-Id: <202102141933.11EJXqjX004539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 12148d4300db - main - Fix for locking order reversal in USB audio driver, when using mmap(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12148d4300dbbd93260bf2801cdb9eda8b3b05a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 19:33:52 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=12148d4300dbbd93260bf2801cdb9eda8b3b05a4 commit 12148d4300dbbd93260bf2801cdb9eda8b3b05a4 Author: Hans Petter Selasky AuthorDate: 2021-02-14 19:29:16 +0000 Commit: Hans Petter Selasky CommitDate: 2021-02-14 19:32:33 +0000 Fix for locking order reversal in USB audio driver, when using mmap(). Locking the second lock which causes the LOR, can be skipped because the code updating the shared variables is always executing from the same USB thread. lock order reversal: 1st 0xfffff80005cc3840 pcm7:play:dsp7.p0 (pcm play channel, sleep mutex) @ usb_transfer.c:2342 2nd 0xfffff80005cc3860 pcm7:record:dsp7.r0 (pcm record channel, sleep mutex) @ uaudio.c:2317 lock order pcm record channel -> pcm play channel established at: witness_checkorder+0x461 __mtx_lock_flags+0x98 dsp_mmap_single+0x151 vm_mmap_cdev+0x65 devfs_mmap_f+0x143 kern_mmap_req+0x594 sys_mmap+0x46 amd64_syscall+0x12e fast_syscall_common+0xf8 lock order pcm play channel -> pcm record channel attempted at: witness_checkorder+0xd82 __mtx_lock_flags+0x98 uaudio_chan_play_callback+0xeb usbd_callback_wrapper+0x7ec usb_command_wrapper+0x7e usb_callback_proc+0x8e usb_process+0xf3 fork_exit+0x80 fork_trampoline+0xe Found by: Stefan Ehmann MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/sound/usb/uaudio.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index c2a7e328b49e..095078b47e65 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -2313,11 +2313,16 @@ uaudio_chan_play_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: tr_setup: if (ch_rec != NULL) { + /* + * NOTE: The play and record callbacks are + * executed from the same USB thread and + * locking the record channel mutex here is + * not needed. This avoids a LOR situation. + */ + /* reset receive jitter counters */ - mtx_lock(ch_rec->pcm_mtx); ch_rec->jitter_curr = 0; ch_rec->jitter_rem = 0; - mtx_unlock(ch_rec->pcm_mtx); } /* reset transmit jitter counters */ @@ -2338,10 +2343,17 @@ tr_setup: */ if (ch_rec != NULL && uaudio_chan_is_async(ch, ch->cur_alt) != 0) { - mtx_lock(ch_rec->pcm_mtx); - if (ch_rec->cur_alt < ch_rec->num_alt) { + uint32_t rec_alt = ch_rec->cur_alt; + if (rec_alt < ch_rec->num_alt) { int64_t tx_jitter; int64_t rx_rate; + /* + * NOTE: The play and record callbacks + * are executed from the same USB + * thread and locking the record + * channel mutex here is not needed. + * This avoids a LOR situation. + */ /* translate receive jitter into transmit jitter */ tx_jitter = ch->usb_alt[ch->cur_alt].sample_rate; @@ -2353,11 +2365,10 @@ tr_setup: ch_rec->jitter_rem = 0; /* compute exact number of transmit jitter samples */ - rx_rate = ch_rec->usb_alt[ch_rec->cur_alt].sample_rate; + rx_rate = ch_rec->usb_alt[rec_alt].sample_rate; ch->jitter_curr += tx_jitter / rx_rate; ch->jitter_rem = tx_jitter % rx_rate; } - mtx_unlock(ch_rec->pcm_mtx); } /* start the SYNC transfer one time per second, if any */ From owner-dev-commits-src-main@freebsd.org Sun Feb 14 21:16:33 2021 Return-Path: Delivered-To: dev-commits-src-main@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 5CD1353D345; Sun, 14 Feb 2021 21:16:33 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Df0R52DrBz4b54; Sun, 14 Feb 2021 21:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FD83117CD; Sun, 14 Feb 2021 21:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11ELGX3m036515; Sun, 14 Feb 2021 21:16:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11ELGXPD036514; Sun, 14 Feb 2021 21:16:33 GMT (envelope-from git) Date: Sun, 14 Feb 2021 21:16:33 GMT Message-Id: <202102142116.11ELGXPD036514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 5d8c062fe3ee - main - loader_lua: consider userboot console as serial MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d8c062fe3ee7b2d6aed0b46d22f62c7771c0af8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 21:16:33 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=5d8c062fe3ee7b2d6aed0b46d22f62c7771c0af8 commit 5d8c062fe3ee7b2d6aed0b46d22f62c7771c0af8 Author: Toomas Soome AuthorDate: 2021-02-14 08:28:29 +0000 Commit: Toomas Soome CommitDate: 2021-02-14 19:49:23 +0000 loader_lua: consider userboot console as serial We use ascii box chars with serial console because we do not know if terminal can draw unixode box chars. Same problem is about userboot console. MFC after: 5 days --- stand/lua/core.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stand/lua/core.lua b/stand/lua/core.lua index a119c3c258f8..55c26e0d6d39 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -403,7 +403,10 @@ end function core.isSerialConsole() local c = loader.getenv("console") if c ~= nil then - if c:find("comconsole") ~= nil then + -- serial console is comconsole, but also userboot. + -- userboot is there, because we have no way to know + -- if the user terminal can draw unicode box chars or not. + if c:find("comconsole") ~= nil or c:find("userboot") ~= nil then return true end end From owner-dev-commits-src-main@freebsd.org Sun Feb 14 21:44:09 2021 Return-Path: Delivered-To: dev-commits-src-main@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 24BCA53DE87; Sun, 14 Feb 2021 21:44:09 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Df12v30fFz4ctH; Sun, 14 Feb 2021 21:44:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 495E911CF5; Sun, 14 Feb 2021 21:44:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11ELi6LQ076607; Sun, 14 Feb 2021 21:44:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11ELi6LO076606; Sun, 14 Feb 2021 21:44:06 GMT (envelope-from git) Date: Sun, 14 Feb 2021 21:44:06 GMT Message-Id: <202102142144.11ELi6LO076606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 74c59ab790db - main - openssh: port upgrade doc and script to git MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 74c59ab790db0062b768bb9742e4d1ad036501ad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 21:44:09 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=74c59ab790db0062b768bb9742e4d1ad036501ad commit 74c59ab790db0062b768bb9742e4d1ad036501ad Author: Ed Maste AuthorDate: 2021-02-10 00:50:32 +0000 Commit: Ed Maste CommitDate: 2021-02-14 21:41:11 +0000 openssh: port upgrade doc and script to git Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28564 --- crypto/openssh/FREEBSD-upgrade | 37 +++++++++++++++++++++---------------- crypto/openssh/freebsd-pre-merge.sh | 3 +-- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade index 27e738bee2d4..0a62d6fa1e2c 100644 --- a/crypto/openssh/FREEBSD-upgrade +++ b/crypto/openssh/FREEBSD-upgrade @@ -1,6 +1,11 @@ FreeBSD maintainer's guide to OpenSSH-portable ============================================== + These instructions assume you have a clone of the FreeBSD git repo + main branch in src/freebsd/main, and will store vendor trees under + src/freebsd/vendor/. In addition, this assumes there is a "freebsd" + origin pointing to git(repo).freebsd.org/src.git. + 00) Make sure your mail spool has plenty of free space. It'll fill up pretty fast once you're done with this checklist. @@ -15,40 +20,38 @@ $ tar xf openssh-X.YpZ.tar.gz -04) Copy to the vendor directory: +04) Copy to a vendor branch: - $ svn co svn+ssh://repo.freebsd.org/base/vendor-crypto/openssh/dist - $ rsync --archive --delete openssh-X.YpZ/ dist/ + $ cd src/freebsd/main + $ git worktree add ../vendor/openssh freebsd/vendor/openssh + $ cd ../vendor/openssh + $ rsync --archive --delete --exclude=.git /path/to/openssh-X.YpZ/ ./ 05) Take care of added / deleted files: - $ svn rm $(svn stat dist | awk '$1 == "!" { print $2 }') - $ svn add --no-auto-props $(svn stat dist | awk '$1 == "?" { print $2 }') + $ git add -A 06) Commit: - $ svn commit -m "Vendor import of OpenSSH X.YpZ." dist + $ git commit -m "Vendor import of OpenSSH X.YpZ" 07) Tag: - $ svn copy -m "Tag OpenSSH X.YpZ." \ - svn+ssh://repo.freebsd.org/base/vendor-crypto/openssh/dist \ - svn+ssh://repo.freebsd.org/base/vendor-crypto/openssh/X.YpZ + $ git tag -a -m "Tag OpenSSH X.YpZ" vendor/openssh/X.YpZ 08) Check out head and run the pre-merge script, which strips our RCS tags from files that have them: - $ svn co svn+ssh://repo.freebsd.org/base/head - $ cd head/crypto/openssh + $ cd src/freebsd/main/crypto/openssh $ sh freebsd-pre-merge.sh 09) Merge from the vendor branch: - $ svn merge -cNNNNNN \^/vendor-crypto/openssh/dist . + $ git subtree merge -P crypto/openssh vendor/openssh A number of files have been deleted from FreeBSD's copy of ssh, including rendered man pages (which have a .0 extension). When - svn prompts for these deleted files during the merge, choose 'r' + git prompts for these deleted files during the merge, choose 'd' (leaving them deleted). 0A) Resolve conflicts. Remember to bump the version addendum in @@ -57,8 +60,7 @@ 0B) Diff against the vendor branch: - $ svn diff --no-diff-deleted --no-diff-added \ - --ignore-properties \^/vendor-crypto/openssh/X.YpZ . + $ git diff --diff-filter=M vendor/openssh/X.YpZ HEAD:crypto/openssh Files that have modifications relative to the vendor code, and only those files, must have the svn:keywords property set to @@ -70,6 +72,9 @@ $ sh freebsd-post-merge.sh + These tags are not used with git, but we will leave them in place as + long as svn-based FreeBSD 11.x and 12.x are supported. + 0D) Run the configure script: $ sh freebsd-configure.sh @@ -77,7 +82,7 @@ 0E) Review changes to config.h very carefully. Note that libwrap should not be defined in config.h; as of - r311585 it is conditional on MK_TCP_WRAPPERS. + r311585 (233932cc2a60) it is conditional on MK_TCP_WRAPPERS. 0F) If source files have been added or removed, update the appropriate makefiles to reflect changes in the vendor's Makefile.in. diff --git a/crypto/openssh/freebsd-pre-merge.sh b/crypto/openssh/freebsd-pre-merge.sh index 473474c2c4da..f98e71822a0c 100755 --- a/crypto/openssh/freebsd-pre-merge.sh +++ b/crypto/openssh/freebsd-pre-merge.sh @@ -5,9 +5,8 @@ :>keywords :>rcsid -svn list -R | grep -v '/$' | \ +git ls-files | \ while read f ; do - svn proplist -v $f | grep -q 'FreeBSD=%H' || continue egrep -l '^(#|\.\\"|/\*)[[:space:]]+\$FreeBSD[:\$]' $f >>keywords egrep -l '__RCSID\("\$FreeBSD[:\$]' $f >>rcsid done